Packets are forwarded to the native interface or in other words,
the vlan header is simply stripped and ignored. This feature is called
'priority tagging'.
Signed-off-by: Cla Mattia Galliard <cla-mattia.galliard@zuehlke.com>
Signed-off-by: Jukka Rissanen <jukka.rissanen@nordicsemi.no>
The headroom was not taken into account for variable size data
buffers when CONFIG_NET_L2_ETHERNET_RESERVE_HEADER was enabled.
Add a test case for it to make sure the reserve allocation works
properly.
Fixes#84053
Signed-off-by: Jukka Rissanen <jukka.rissanen@nordicsemi.no>
Currently various zbus functions silently change the timeout
to zero when inside an ISR. If a developer is not aware
of this it could lead to unexpected behaviour or a
publish/read failing.
Also in the zbus docs it states to only use a timeout of
zero when inside a ISR multiple times.
Signed-off-by: Brandon Allen <brandon.allen@exacttechnology.com>
Empty code was incorrectly matched as a request, fix that.
Align coap_handle_request_len() function to behave as documented in the
API documentation - in case of invalid request code (which is also the
case for empty code) -ENOTSUP Should be returned.
Signed-off-by: Robert Lubos <robert.lubos@nordicsemi.no>
The algorithm for matching request with response was incorrect, which
could lead to false matches (for example if request had a token, and
piggybacked reply had no token but matching message ID only, that would
still be counted as a match).
This commit fixes it. The request/reply matching is implemented based on
RFC now, with separate conditions for piggybacked/separate responses.
Signed-off-by: Robert Lubos <robert.lubos@nordicsemi.no>
Remove the build assert from NET_L3_REGISTER() macro as that
is causing an issue with llvm. Add runtime check of the handler
pointer value.
subsys/net/l2/ethernet/arp.c:1044:1: error: static_assert expression
is not an integral constant expression
ETH_NET_L3_REGISTER(ARP, NET_ETH_PTYPE_ARP, arp_recv);
^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
include/zephyr/net/ethernet.h:1272:2: note: expanded from
macro 'ETH_NET_L3_REGISTER'
NET_L3_REGISTER(&NET_L2_GET_NAME(ETHERNET), name, ptype, handler)
^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
include/zephyr/net/net_core.h:190:2: note: expanded from
macro 'NET_L3_REGISTER'
BUILD_ASSERT((_handler) != NULL, "Handler is not defined")
^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
include/zephyr/toolchain/gcc.h:87:51: note: expanded from
macro 'BUILD_ASSERT'
define BUILD_ASSERT(EXPR, MSG...) _Static_assert((EXPR), "" MSG)
^~~~~~
subsys/net/l2/ethernet/arp.c:1044:1: note: cast from 'void *' is not
allowed in a constant expression
include/zephyr/net/ethernet.h:1272:2: note: expanded from
macro 'ETH_NET_L3_REGISTER'
NET_L3_REGISTER(&NET_L2_GET_NAME(ETHERNET), name, ptype, handler)
^
include/zephyr/net/net_core.h:190:29: note: expanded from
macro 'NET_L3_REGISTER'
BUILD_ASSERT((_handler) != NULL, "Handler is not defined")
^
/usr/lib/llvm-14/lib/clang/14.0.0/include/stddef.h:89:16: note: expanded
from macro 'NULL'
define NULL ((void*)0)
Signed-off-by: Jukka Rissanen <jukka.rissanen@nordicsemi.no>
Trust that the protocol type is set correctly by functions
called before this one. We should not set the protocol type
blindly in this generic function.
Signed-off-by: Jukka Rissanen <jukka.rissanen@nordicsemi.no>
The ARP code has set the protocol type of the packet to
0x806, so do not change it when preparing to send to 0x800
which is the IP protocol type. Lets trust the previously
called functions to set the ptype correctly and do not set
it here.
Signed-off-by: Jukka Rissanen <jukka.rissanen@nordicsemi.no>
Print more data / debug information for ARP messages.
Also remove unnecessary "&" when printing IPv4 address.
Signed-off-by: Jukka Rissanen <jukka.rissanen@nordicsemi.no>
The work in Ethernet send in commit 2f10d7d816
("net: ethernet: Set the ptype by the caller in send")
introduced a bug because we could try to do ARP resolving
for ARP packets too. This is clearly a wrong thing to do.
So before trying to do ARP resolving, make sure the the
packet type is IP packet.
Signed-off-by: Jukka Rissanen <jukka.rissanen@nordicsemi.no>
Fix reset of drift_skip count when an anchor point sync was
missed so that drift compensation is applied on the next
successful anchor point sync. This will improve connection
stability for short overlapping radio event intervals.
Signed-off-by: Vinayak Kariappa Chettimada <vich@nordicsemi.no>
Currently, when disabling CONFIG_MODBUS_FP_EXTENSIONS,return variable
'err' is not initialized (at least not for debug builds) but later on
checked.
Signed-off-by: Stephan Gatzka <stephan.gatzka@gmail.com>
uart_irq_callback_user_data_set return non-zero if the callback function
can't be set. This might happen if you forgot to enable
CONFIG_UART_INTERRUPT_DRIVEN.
Signed-off-by: Stephan Gatzka <stephan.gatzka@gmail.com>
The connection event at the connection update instant was
skipped due to previous ticker node in use that is being
stopped was registering a relative occupied time that
overlapped with the new ticker node being started for
scheduling the connection with new interval.
Added mock interface for ticker_stop_abs() hence needed by
the Controller unit testing.
Signed-off-by: Vinayak Kariappa Chettimada <vich@nordicsemi.no>
Update the Kconfig configuration to allow enabling the underlying
filesystems (e.g. exFAT), with only `FILE_SYSTEM_LIB_LINK` enabled.
Signed-off-by: Jordan Yates <jordan@embeint.com>
The compiler is unaware of the `block_size > 0` precondition, so it
outputs warnings of uninitialized `reclen`. Explicitly initialize the
variable to suppress this.
Signed-off-by: Jordan Yates <jordan@embeint.com>
Only reserve L2 header for TX case when allocating net buffer,
as for RX case, all the received headers are already in linear
buffer when the driver receives the data, and reserve extra L2
header for RX case may exceed the default buffer size.
Signed-off-by: Maochen Wang <maochen.wang@nxp.com>
bt_gatt_find_by_uuid used bt_gatt_attr_value_handle but that
function only works to get the value handle of a characteristic
declaration, i.e. if the UUID is not BT_UUID_GATT_CHRC then it
would always return handle = 0. This meant that
bt_gatt_find_by_uuid would always use handle = 0 as the starting
handle for non-BT_UUID_GATT_CHRC attributes, instead of the handle
of the provided attr.
This was not an issue for any UUIDs that may only exist once on a
GATT server, which is most UUIDs, but for UUIDs like the
BT_UUID_TBS_* UUIDs that may be multiple instances of, it would
always return the first attribute rather than the one starting
from the provided start attr.
This commit also ensures that we do not overflow the `end_handle`
when adding 2 uint16_t values.
Signed-off-by: Emil Gydesen <emil.gydesen@nordicsemi.no>
This is a follow up to commit 770482a45a.
Add initialization of the `ok` variable to prevent the "may be
uninitialized" warning when `CONFIG_BOOTLOADER_MCUBOOT` is not
defined.
Signed-off-by: Andrzej Głąbek <andrzej.glabek@nordicsemi.no>
Fix byteorder handling in csip sef crypto function.
On big-endian system we also need to convert the k array from
little-endian to big-endian. The Bluetooth protocol is always using
little-endian ordering.
Signed-off-by: Joakim Andersson <joerchan@gmail.com>
Add an array with the states names and use it while logging an error
messages.
Additionally unify the error message format. Do not add
"UART HOST CMD ERROR", because the LOG_ERR macro already informs that
it is an error message.
Signed-off-by: Dawid Niedzwiecki <dawidn@google.com>
When defined both CONFIG_NET_BUF_POOL_USAGE and
CONFIG_MEM_SLAB_TRACE_MAX_UTILIZATION, support using 'net mem' cmd
to get the maximum count of used buffers and net packets.
Signed-off-by: Maochen Wang <maochen.wang@nxp.com>
Allow user to specify protocol extensions when receiving data
from Ethernet network. This means that user can register L3
protocol handler using NET_L3_REGISTER() with the desired
protocol type. Ethernet code will then call the handler if
such a protocol type packet is received. This is currently
only implemented for Ethernet. The original IPv4 and IPv6
handling is left intact even if they can be considered to
be L3 layer protocol. This could be changed in the future
if needed so that IPv4 and IPv6 handling could be made
pluggable protocols.
Signed-off-by: Jukka Rissanen <jukka.rissanen@nordicsemi.no>
With assert condition set to true, assertion never happens.
Change __ASSERT(true) to __ASSERT(false).
Signed-off-by: Dmitry Lukyantsev <dmitrylu@meta.com>
Align DDPI usage with nRF54L series power domains and
available DDPI configurations.
Use indices below 4 when needing to bridge with GPIO,
use indices below 8 when needing to bridge with MCU domain
like CCM and AAR; and use indices above 7 to bridge with
Peripheral domain.
Signed-off-by: Vinayak Kariappa Chettimada <vich@nordicsemi.no>
Replace use of HAL_RADIO_RECV_TIMEOUT_CANCEL_PPI with
HAL_TRIGGER_CRYPT_PPI; they have same value but use the
correctly named HAL_TRIGGER_CRYPT_PPI define now.
Fix conditional compile to correctly exclude reference of
NRF_CCM when CONFIG_BT_CTLR_PRIVACY=n.
Fix missing reference to CCM_TASKS_CRYPT_DELAY_BITS when
CONFIG_BT_CTLR_SW_SWITCH_SINGLE_TIMER=y.
Signed-off-by: Vinayak Kariappa Chettimada <vich@nordicsemi.no>
Update ISO Peripheral for single timer use support required
for nRF54L Series SoCs.
As the timer is reset on every radio end, use the
radio_tmr_hcto_configure_abs() function to set the header
complete timeout correctly when using single timer for s/w
switching.
Signed-off-by: Vinayak Kariappa Chettimada <vich@nordicsemi.no>
Update ISO Central for single timer use support required
for nRF54L Series SoCs.
As the timer is reset on every radio end, use the
radio_tmr_hcto_configure_abs() function to set the header
complete timeout correctly when using single timer for s/w
switching.
Signed-off-by: Vinayak Kariappa Chettimada <vich@nordicsemi.no>
Update ISO Sync Receiver for single timer use support
required for nRF54L Series SoCs.
As the timer is reset on every radio end, use the
radio_tmr_hcto_configure_abs() function to set the header
complete timeout correctly when using single timer for s/w
switching.
Signed-off-by: Vinayak Kariappa Chettimada <vich@nordicsemi.no>
Update Periodic Advertising Sync implementation for single
timer use support required for nRF54L Series SoCs.
As the timer is reset on every radio end, use the
radio_tmr_hcto_configure_abs() function to set the header
complete timeout correctly when using single timer for s/w
switching.
Signed-off-by: Vinayak Kariappa Chettimada <vich@nordicsemi.no>
Update advanced non-overlapping Central Connection Creation
scheduling for single timer use support required for nRF54L
Series SoCs.
Signed-off-by: Vinayak Kariappa Chettimada <vich@nordicsemi.no>
Update Extended Scanning for single timer use support
required for nRF54L Series SoCs.
As the timer is reset on every radio end, use the
radio_tmr_hcto_configure_abs() function to set the header
complete timeout correctly when using single timer for s/w
switching.
Signed-off-by: Vinayak Kariappa Chettimada <vich@nordicsemi.no>
Update Extended Advertising for single timer use support
required for nRF54L Series SoCs.
As the timer is reset on every radio end, add implementation
to accumulate the last_pdu_end_us.
Signed-off-by: Vinayak Kariappa Chettimada <vich@nordicsemi.no>
This reverts commit a7fff7445c.
The next commit will re-add back the fix to primary
advertising channel plus auxiliary advertising channel too.
This will help keep the fix together regarding use of
single timer for software tIFS switching implementation.
Signed-off-by: Vinayak Kariappa Chettimada <vich@nordicsemi.no>
Restrict the jitter considered in the PDU reception in the
subevents of ISO Sync Receiver.
Signed-off-by: Vinayak Kariappa Chettimada <vich@nordicsemi.no>
Fix nRF5 radio and event timer abstractions for some that
where hard coded compared to use of the ones defined in the
resources header file.
Signed-off-by: Vinayak Kariappa Chettimada <vich@nordicsemi.no>
Add radio_sim_nrf54l.h file, which for now a copy of the
SoC radio_nrf54lx.h file. This is added for having separate
simulation model dependent timing values and specific
implementation details.
Signed-off-by: Vinayak Kariappa Chettimada <vich@nordicsemi.no>
Fix single timer s/w switch when using DPPI on nRF53/54L
where the previous compare register index is incorrect when
the base index is a odd numbered DPPI used.
The issue is discovered as failing ISO Receiver sample with
Coded PHY and single timer use, where the compare base is
configured to use the DPPI 3 (instead of 4).
Upstream samples do not use single timer for s/w switch, the
issue is discovered when adding support for nRF54L which has
to use single timer due to the radio only having a single
timer.
Signed-off-by: Vinayak Kariappa Chettimada <vich@nordicsemi.no>