MFP (Management frame protection) a.k.a PMF (protected management
frames) is now a mandatory feature for certification esp. for WPA3.
Support is added for both scan and connect similar to security type.
Signed-off-by: Krishna T <krishna.t@nordicsemi.no>
SAE password is similar to WPA2 password but without any length
restrictions, so, add a separate optional field, if this is not given we
can fallback to WPA2 password (psk).
Signed-off-by: Krishna T <krishna.t@nordicsemi.no>
This is a variant of standard PSK which uses KDF instead of PRF for
key generation, see section Table 9-151 in [1].
[1] - https://standards.ieee.org/ieee/802.11/7028/
Signed-off-by: Krishna T <krishna.t@nordicsemi.no>
This commit adds the `CODE_UNREACHABLE` hint at the end of the
assertion failure branch so that the compiler takes note of the assert
function not returning when an assertion fails.
This prevents the compiler from generating misguided warnings assuming
the asserted execution paths.
It also introduces the `ASSERT_TEST` Kconfig symbol, which indicates
that the "assert test mode" is enabled. This symbol may be selected by
the tests that require the assert post action function to return
without aborting so that the test can proceed.
Note that the `CODE_UNREACHABLE` hint is specified only when the assert
test mode is disabled in order to prevent the tests from crashing when
the assert post action function returns.
Signed-off-by: Stephanos Ioannidis <root@stephanos.io>
Change introduces authentication callbacks used only for specified
BLE connection. The feature can be used by devices that require
reporting specific bonding capabilities only when pairing using
vendor-specific procedures.
If per-connection authentication callbacks are defined for given
connection, they are used instead of global authentication
callbacks. SMP latches authentication callbacks during the first
access to prevent updating the callbacks while pairing.
Fixes: #38336
Signed-off-by: Marek Pieta <Marek.Pieta@nordicsemi.no>
Updates the ztest_test_fail() function to allow failures in setup.
When executed, a failed assert will fail every test in the suite owning
the setup function. This was verified by adding a suite which asserts
in the setup function and has a test that should pass. During
exeuction, ztest marks the test as failing.
In order to verify exection I also added 2 new APIs:
- ZTEST_EXPECT_FAIL(suite_name, test_name)
- ZTEST_EXPECT_SKIP(suite_name, test_name)
Signed-off-by: Yuval Peress <peress@google.com>
Change the clock control driver API to not call device_is_ready() in every
API call. It is up to the caller to ensure that the clock control device is
ready before calling a clock control API function.
Signed-off-by: Henrik Brix Andersen <hebad@vestas.com>
The def command Indicates that a comment block contains documentation
for a #define macro. This is useful if the comment block documents a
macro not adjacent to it, e.g.
```c
/**
* @def MAX(x,y)
* @brief Computes the maximum of @a x and @a y.
*/
#ifdef XXX
#define MAX(x,y) ...
#endif
```
However, it is not necessary if the comment is adjacent to the
definition, e.g.
```c
/**
* @brief Computes the maximum of @a x and @a y.
*/
#define MAX(x,y) ...
```
This patch removes all unnecessary def entries in-tree.
Signed-off-by: Gerard Marull-Paretas <gerard.marull@nordicsemi.no>
In the continuation of the previous commit, replace _OPT_ by _DOMAIN_
in macros relating to this feature.
hen, adapt drivers and tests to this new wording.
Signed-off-by: Erwan Gouriou <erwan.gouriou@linaro.org>
Wi-Fi protocol uses EAPoL ether type frames for authentication, so, add
support for that ether type so that they are not dropped.
Though we have NET_ETHERNET_FORWARD_UNRECOGNISED_ETHERTYPE to allow
unknown frames to be passed up the stack, but this might cause
performance penalty.
Signed-off-by: Krishna T <krishna.t@nordicsemi.no>
Now that we can iterate over all the status "okay" devicetree nodes
directly using <zephyr/devicetree.h>, use that along with a new helper
macro to pre-declare all possible struct devices.
Unlike the previous implementation, which declared devices even for
disabled nodes, we restrict the new mechanism to only declaring
devices for status "okay" nodes. This keeps drivers honest by not
pre-declaring devices for disabled nodes, which should not be
allocated in the first place.
Signed-off-by: Martí Bolívar <marti.bolivar@nordicsemi.no>
Add two new utility macros for iterating over the entire tree, along
with tests.
I have a use case for DT_FOREACH_STATUS_OKAY_NODE() right now, but I
think it makes sense to define both of them right away for
completeness.
Signed-off-by: Martí Bolívar <marti.bolivar@nordicsemi.no>
This header makes extensive use of devicetree macros, but it does not
include zephyr/devicetree.h. Fix it.
Signed-off-by: Martí Bolívar <marti.bolivar@nordicsemi.no>
NET_BUF_POOL_FIXED_DEFINE locates net_buf_data in __noinit section,
it does not guarantees that data buffer will aligned.
There is wifi driver which required network buffers to be aligned.
Changes:
line below (from NET_BUF_POOL_FIXED_DEFINE macro):
static uint8_t __noinit net_buf_data_##_name[_count][_data_size];
is updated to:
static uint8_t __noinit net_buf_data_##_name[_count][_data_size]
__net_buf_align;
Signed-off-by: Nazar Palamar <nazar.palamar@infineon.com>
Separate closing lwm2m context from closing socket. This patch is required
for the rd client to take more control over lwm2m context and the socket.
The goal is to close the socket and to keep the lwm2m context if this is
needed.
Signed-off-by: Andreas Chmielewski <andreas.chmielewski@grandcentrix.net>
This macro compares two integers from 0 to 255 at compile time, using
the preprocessor.
Signed-off-by: Kumar Gala <galak@kernel.org>
Signed-off-by: Aurelien Jarno <aurelien@aurel32.net>
This change makes the files which are part of this changeset comply to
the project's coding style rules as defined in .clang-format.
This required addition of some forward declarations and additional
dependencies into header files as some of them depended on the order of
header inclusion which was changed due to alphabetical ordering of
includes.
Background: .clang-format states "SortIncludes:true" which will force
re-ording of include-statements which in turn might break the build if
header file inclusion is not order-independent.
Signed-off-by: Florian Grandel <jerico.dev@gmail.com>
New API for suspend and resume LwM2M engine.
New event LWM2M_RD_CLIENT_EVENT_ENGINE_SUSPENDED for indicate
application that engine is suspended.
Simplify stack suspend and resume state same time for queue mode.
New CONFIG_LWM2M_RD_CLIENT_SUSPEND_SOCKET_AT_IDLE for enable skip socket
close at RX_OFF_IDDLE state that socket is only suspended and close is
called only when connection is resumed.
Signed-off-by: Juha Heiskanen <juha.heiskanen@nordicsemi.no>
Current API allowed to get notified when the maximum system latency
changes, however, a single callback was allowed. The design was intended
for SoC specific actions when latency changes. However, in some cases
drivers may also want to know the current maximum latency to perform
local actions if other parts of the system modify it.
This patch updates the API with a pair of subscribe/unsubscribe calls to
achieve such goal. Tests have been updated to show how the API can be
used.
Signed-off-by: Gerard Marull-Paretas <gerard.marull@nordicsemi.no>
Add the "zephyr/" prefix to various #include statements that are
preventing the CI form running with LEGACY_INCLUDE_PATH=n.
Signed-off-by: Fabio Baltieri <fabiobaltieri@google.com>
Added API function +int settings_storage_get(void **storage)
which allows to get storage instance used by the
settings backed to store its records.
Signed-off-by: Andrzej Puzdrowski <andrzej.puzdrowski@nordicsemi.no>
Extend current implementation of vendor-specific HCI events related
with Zephyr Fatal Error. The extended event is able to carry Zephyr
system wide fatal error as well as Controller related assertion.
That gives a possibility to use the event by bt_ctlr_assert_handle
or k_sys_fatal_error_handler to send information about unrecoverable
failures over HCI interface.
There are added two types of errors to Zephyr Fatal Error event:
- system fault error like e.g. Hard Fault. This one caries reason of
a fault and a stack frame in the data field. The stack frame is
defined for Corte-M SoCs only.
- Controller assert. The data field caries file name and line of code
where an assert happened.
Except that the extended event can be used by Host, it can serve as a
debug mean to conformance testing of the Controller.
Signed-off-by: Piotr Pryga <piotr.pryga@nordicsemi.no>
After some analysis I found out that there's no machine timer provided
by the "riscv" vendor. There are some specs for the mtime/mtimecmp
registers (this is why we can have a single driver), but the actual
register layout or implementations differ amongst vendors. GD32 uses the
Nuclei implementation, named "system timer" in their documentation. This
patch aligns with vendor specs.
Signed-off-by: Gerard Marull-Paretas <gerard.marull@nordicsemi.no>
Mesh Profile Specification errata 11310
Section 4.4.4.1
"This model shall support model publication, as defined in Section
4.2.2 of the Mesh Profile specification and model subscription,
as defined in section 4.2.3 of the Mesh Profile specification."
Signed-off-by: Michal Narajowski <michal.narajowski@codecoup.pl>
Spell out BT_ATT_ERR_* instead of using less specific "ATT error code".
Co-authored-by: Emil Gydesen <Thalley@users.noreply.github.com>
Signed-off-by: Nikolai Kondrashov <spbnick@gmail.com>
Name some types in bluetooth/gatt.h and use those names to document the
expected values of some of the BT_GATT_* macro arguments, in an attempt
to make understanding the API a little easier.
Signed-off-by: Nikolai Kondrashov <spbnick@gmail.com>
Refer to BT_GATT_WRITE_FLAG_* specifically, instead of the more general
BT_GATT_WRITE_* namespace to avoid future clashes with new symbols
there.
Signed-off-by: Nikolai Kondrashov <spbnick@gmail.com>
The packet socket implementation did not fill the address structure
provided by the application. This commit fixes this.
Note, that the implementation needs to cover two cases: SOCK_RAW and
SOCK_DGRAM. In the first case, the information is extracted directly
from the L2 header (curently only Ethernet supported). In latter case,
the header is already removed from the packet as the L2 has already
processed the packet, so the information is obtained from the net_pkt
structure.
Signed-off-by: Robert Lubos <robert.lubos@nordicsemi.no>
The L2 protocol type information is not carried to the upper layers.
This is problematic for packet sockets, as the address structure in
recvfrom() is supposed to provide this information.
Fix this by adding ll_proto_type field in the net_pkt structure.
Set the protocol type in the Ethernet L2 when packet is processed.
Signed-off-by: Robert Lubos <robert.lubos@nordicsemi.no>
Rename the placeholder variable generated for PM slots so that the
prefix doesn't colide with the PM structs declared by devices. This
simplifies the process of searching for symbols in `.elf` files.
Signed-off-by: Jordan Yates <jordan.yates@data61.csiro.au>
Add support in Bluetooth Host to enable Periodic Advertising
ADI support feature when supported in the Controller to
include ADI in Periodic Advertising AUX_SYNC_IND PDU.
Signed-off-by: Vinayak Kariappa Chettimada <vich@nordicsemi.no>
Add binding for Aspeed AST10x0 clock driver. The clocks can be turned
on or off through the syscon registers.
Signed-off-by: Dylan Hung <dylan_hung@aspeedtech.com>
Add the ssd16xx_read_ram() function that can be used to read the raw
contents of the two display RAM in the controller. This function is
similar to display_read(), but lets the caller specify the RAM to
operate on. The intention is that this can be used to read out the
contents of the old frame buffer after a partial refresh that
automatically swaps the black/red buffers.
Signed-off-by: Andreas Sandberg <andreas@sandberg.uk>
MISRA C:2012 Rule 14.4 (The controlling expression of an if statement
and the controlling expression of an iteration-statement shall have
essentially Boolean type.)
Use comparisons with NULL instead of implicitly testing pointers.
Use `do { ... } while (false)' instead of `do { ... } while (0)'.
Use comparisons with zero instead of implicitly testing integers.
The commit is a subset of the original auditable-branch commit:
5d02614e34a86b549c7707d3d9f0984bc3a5f22a
Signed-off-by: Simon Hein <SHein@baumer.com>
This commit adds necessary definitions in stm32_clock_control.h
to enable pll2, and pll3 support by:
- reusing existing pll3 divider definitions introduced for h7 series.
- adding pll2 divider definitions, and including them for u5 only.
- introducing clock source definitions for pll2 and pll3
contrary to h7 u5 can select the clock sources for the 3 plls
individually.
Signed-off-by: Thomas Stranger <thomas.stranger@outlook.com>
This commit adds the pll2 and pll3 clock control nodes
with st,stm32u5-pll-clock compatible.
Signed-off-by: Thomas Stranger <thomas.stranger@outlook.com>
There is no easy way to clear event bits without
the potential for a race to exist between producer(s)
and consumer(s). The result of this race is that events
can be lost through the various resetting mechanisms
available (flag to k_event_wait(), or k_event_set()).
Add k_event_set_masked() which permits bits to be set or cleared.
This allows consumers to clear just the bits that they have read
without (accidentally) discarding any new bits.
Update unit tests to verify the functionality.
Partly Fixes#46117.
Signed-off-by: Andrew Jackson <andrew.jackson@amd.com>
Although there is nothing wrong with the existing code,
it doesn't permit individual bits to be set (or cleared).
This makes further changes slightly awkward.
Use a mask to restrict the bits set in an event.
Signed-off-by: Andrew Jackson <andrew.jackson@amd.com>
HSE is a valid alternate clock source for these series,
therefore STM32_SRC_HSE is added in this commit.
Both series can use HSE as an alternate clock source for USB and FDCAN.
Signed-off-by: Thomas Stranger <thomas.stranger@outlook.com>