Add Kconfig option NET_HOSTNAME_UNIQUE_UPDATE to allow the unique
hostname - which is derived from the network interface's link
address - to be updated on both initial assignment and updates of
the link address.
Signed-off-by: Markus Fuchs <markus.fuchs@de.sauter-bc.com>
This is in order to reduce the redundancy code writing for fatal and
assert handler for error case testing. They can be used both in kernel
and userspace, and are also SMP safe.
Signed-off-by: Enjia Mai <enjiax.mai@intel.com>
`delta_size` was incorrectly used to assess whether extended option
length field shall be used. In result, options larger than 268 bytes
were not encoded properly.
Fixes#31206
Signed-off-by: Robert Lubos <robert.lubos@nordicsemi.no>
* add toolchain abstraction for coverage
* add select HAS_COVERAGE_SUPPORT to kconfig
* port gcov linker code to CKake for arc
* give user permission to gcov bss section
* expand the size of iccm and dccm to 1M
Signed-off-by: Jingru Wang <jingru@synopsys.com>
MESH/NODE/CFG/HBS/BV-01-C expects the MinHops to be 0x7f after
disabling subscription, but 0x00 for subsequent Get requests.
MESH/NODE/CFG/HBS/BV-02-C expects us to return previous
count value and then reset it to 0.
Signed-off-by: Michał Narajowski <michal.narajowski@codecoup.pl>
The #if statement used IS_ENABLED to check if it was defined.
IS_ENABLED will only return true if the value is 1, and false otherwise.
If the NET_TCP_MAX_SEND_WINDOW_SIZE value would be e.g. 8, then the
check would fail.
Signed-off-by: Emil Gydesen <emil.gydesen@nordicsemi.no>
If we receive data that is out-of-order, queue sequential
TCP segments until we have received earlier segment or a timeout
happens.
Note that we only queue data sequentially in current version i.e.,
there should be no holes in the queue. For example, if we receive
SEQs 5,4,3,6 and are waiting SEQ 2, the data in segments 3,4,5,6 is
queued (in this order), and then given to application when we receive
SEQ 2. But if we receive SEQs 5,4,3,7 then the SEQ 7 is discarded
because the list would not be sequential as number 6 is be missing.
Fixes#30364
Signed-off-by: Jukka Rissanen <jukka.rissanen@linux.intel.com>
This is a pairing function with bt_le_scan_cb_register()
to used for remove the scanner callback from callback list.
Signed-off-by: chao an <anchao@xiaomi.com>
Modifies openthread shim layer to automatically join multicast
addresses as they are added to zephyr from openthread, unless the
address is interface-local or link-local. This allows incoming
openthread multicast group messages to avoid being filtered by
zephyr ipv6 recv.
Fixes#31085
Signed-off-by: Joel Frazier <frazieje@gmail.com>
During coverage reports generation in C++ code gcov_coverage_dump()
function would get stuck in endless loop. Fix by checking list head
pointer with current list pointer.
Signed-off-by: Marko Poljanić <mpoljanic@gmail.com>
Fixed misalignment of bitflag in ll_conn type causing unintentional
overwrite between unions. Common flag must be present in master/slave
uinons as well. Problem is only present when enabling feature
CONFIG_BT_CTLR_CONN_META, which is default disabled.
Signed-off-by: Morten Priess <mtpr@oticon.com>
Reserve two link rx buffer for each supported Broadcast ISO
sync instance, for establishment and for sync lost node rx
generation.
Signed-off-by: Vinayak Kariappa Chettimada <vich@nordicsemi.no>
For tx_power_max_get and tx_power_floor, only allow for
positive values of txpower if they are defined.
Signed-off-by: Aurora Sletnes Bjørlo <aurora.sletnes@nordicsemi.no>
The LwM2M firmware pull object no longer uses the system workqueue
to execute firmware_transfer(), but directly executes it itself.
Previously, the workqueue would be blocked because firmware_transfer()
indirectly calls a blocking connect(). This would lead to problems
with e.g. modem drivers that use UART to interface with the modem
hardware, as some UART drivers use the workqueue.
Fixes#31053.
Signed-off-by: Maik Vermeulen <maik.vermeulen@innotractor.com>
As the tcp header struct can be cast to unaligned memory, mark
it as packed and access fields using UNALIGNED_GET/PUT when
needed.
Fixes#31145
Signed-off-by: Jukka Rissanen <jukka.rissanen@linux.intel.com>
Get rid of weak functions adding a new API to register an object to
receive notifications when the system changes power state.
Signed-off-by: Flavio Ceolin <flavio.ceolin@intel.com>
Rename Kconfig BT_CTLR_SCAN_SYNC_ISO_MAX to
BT_CTLR_SCAN_SYNC_ISO_SET, to be consistent with other
Kconfig naming.
Signed-off-by: Vinayak Kariappa Chettimada <vich@nordicsemi.no>
AUX_CONNECT_RSP PDU static buffer definition was missing one
byte required for the Extended Header Flags.
Signed-off-by: Vinayak Kariappa Chettimada <vich@nordicsemi.no>
Document with comments, the explanation of node rx count and
the design of the free rx PDU management.
Signed-off-by: Vinayak Kariappa Chettimada <vich@nordicsemi.no>
Fix for scenarios where in active PHY Update Procedure or
Connection Update Procedure could cause temporary depletion
of the free Rx PDUs in the queue between LL/HCI thread
context to LLL context. Symptoms being on-air NACKing during
the above said procedures, causing supervision timeouts due
to procedures not completing at instants.
Signed-off-by: Vinayak Kariappa Chettimada <vich@nordicsemi.no>
Refactor the implementation of PA/LNA PPI configuration
which was done on every Tx or Rx as common code to be
executed once per radio reset. And only setup the timeout
and enabling of PPI at every Tx or Rx.
Signed-off-by: Vinayak Kariappa Chettimada <vich@nordicsemi.no>
For PA/LNA implementation use NRF_P0/P1 defines instead of
the deprecated NRF_GPIO to reference GPIO Port 0 registers.
Signed-off-by: Vinayak Kariappa Chettimada <vich@nordicsemi.no>
Fix the missing GPIOTE channel disable when GPIOTE channel
is alternately used between PA and LNA use.
Signed-off-by: Vinayak Kariappa Chettimada <vich@nordicsemi.no>
Fix regression in PA/LNA support wherein the GPIO pins where
left in undefined state after each radio event.
Signed-off-by: Vinayak Kariappa Chettimada <vich@nordicsemi.no>
Fix regression, add back missing call to radio_setup HAL
interface. This is needed to setup the initial PA/LNA GPIO
states.
Signed-off-by: Vinayak Kariappa Chettimada <vich@nordicsemi.no>
Fix crash in ATT when the response for a request is received after
the ATT timeout has fired and the ATT channel has been detached.
Add similar handling for all ATT channel operations.
Signed-off-by: Joakim Andersson <joakim.andersson@nordicsemi.no>
Both RS and DAD timeouts are simplified because the delay is a
constant, and by construction the list of timeouts is in increasing
time remaining.
Refactor to avoid repeating the expression that represents the time
until DAD state expires. Uniformly use unsigned operands in deadline
calculation.
Note a case where the racy idiom for retaining an existing timeout is
required in the current work API, but can be replaced with a robust
solution in the proposed new API (the reschedule API replaces any
existing pending update, but the schedule API will leave an existing
scheduled submission in place).
Signed-off-by: Peter Bigot <peter.bigot@nordicsemi.no>
The existing implementation is inconsistent in that checking for
expired routers when a timeout is processed detects end-of-life
correctly (when the remaining duration exceeds the signed maximum),
but the calculation of time remaining before expiration uses only
unsigned calculation. So when the set of routers is changed the newly
calculated timeout will not recognize routers that have expired, and
so those routers expired late. In the worst case if the only
remaining router had expired the timer may be set for almost two
months in the future.
Refactor to calculate remaining time in one place and as a signed
value. Change a function name to more clearly reflect what it does.
Avoid unnecessary race conditions in k_work API.
Signed-off-by: Peter Bigot <peter.bigot@nordicsemi.no>
The net_timeout structure is documented to exist because of behavior
that is no longer true, i.e. that `k_delayed_work_submit()` supports
only delays up to INT32_MAX milliseconds. Nonetheless, use of 32-bit
timestamps within the work handlers mean the restriction is still
present.
This infrastructure is currently used for two timers with long
durations:
* address for IPv6 addresses
* prefix for IPv6 prefixes
The handling of rollover was subtly different between these: address
wraps reset the start time while prefix wraps did not.
The calculation of remaining time in ipv6_nbr was incorrect when the
original requested time in seconds was a multiple of
NET_TIMEOUT_MAX_VALUE: the remainder value would be zero while the
wrap counter was positive, causing the calculation to indicate no time
remained.
The maximum value was set to allow a 100 ms latency between elapse of
the deadline and assessment of a given timer, but detection of
rollover assumed that the captured time in the work handler was
precisely the expected deadline, which is unlikely to be true. Use of
the shared system work queue also risks observed latency exceeding 100
ms. These calculations could produce delays to next event that
exceeded the maximum delay, which introduced special cases.
Refactor so all operations that use this structure are encapsulated
into API that is documented and has a full-coverage unit test. Switch
to the standard mechanism of detecting completed deadlines by
calculating the signed difference between the deadline and the current
time, which eliminates some special cases.
Uniformly rely on the scanning the set of timers to determine the next
deadline, rather than assuming that the most recent update is always
next.
Signed-off-by: Peter Bigot <peter.bigot@nordicsemi.no>
SWI IRQ line mapping for nRF5340 shall use
CONFIG_SOC_NRF5340_CPUNET for conditional compilation
instead of the board define, so as to allow new boards to
use the BLE controller implementation.
Fixes#30488.
Signed-off-by: Vinayak Kariappa Chettimada <vich@nordicsemi.no>
If UART_INTERRUPT_DRIVEN isn't selected the CDC ACM class driver won't
build. Don't require the user's intervention to avoid this.
Signed-off-by: Peter Bigot <peter.bigot@nordicsemi.no>
Adds a new family of `struct net_buf` operations that remove data from
the end of the buffer.
The semantics of `net_buf_remove_mem` have been chosen to match those of
`net_buf_pull_mem`, i.e. the return value is a pointer to the memory
that was removed.
The opposite of this function, `net_buf_remove`, would need to return
the old end of the data buffer to be useful. However this value is
always an invalid target for reading or writing data to (It points to
the middle of unused data).The existance of the function would be
misleading, therefore it is not implemented.
Fixes#31069.
Signed-off-by: Jordan Yates <jordan.yates@data61.csiro.au>
Add publicly accessible function to set Constant Tone Extension
parameters for CTE transmission with periodic advertising.
Signed-off-by: Piotr Pryga <piotr.pryga@nordicsemi.no>
Add implementation of a wrapper for HCI_LE_Set_-
Connectionless_CTE_Transmit_Parameters send command.
Signed-off-by: Piotr Pryga <piotr.pryga@nordicsemi.no>
Add Direction Finding to host initialization sequence.
It allows to get information about Direction finding
optional CTE settings supported by controller.
Signed-off-by: Piotr Pryga <piotr.pryga@nordicsemi.no>
Remove is_enabled flag in LLL of BIS events context, as the
status returned from ticker_stop interface is sufficient to
determine if the Broadcast ISO Sync was established or not.
HCI Command Disallow as reason is to be returned if sync was
not established or sync was loss prior to call of HCI LE
BIG Terminate Command was called.
Signed-off-by: Vinayak Kariappa Chettimada <vich@nordicsemi.no>
Move lll_sync_iso.h as common to all vendors, as currently
there is nothing that is vendor specific.
Fixes#31044.
Signed-off-by: Vinayak Kariappa Chettimada <vich@nordicsemi.no>
Leftover from old renaming commits. This function is not private and
should not start with underscore.
Signed-off-by: Flavio Ceolin <flavio.ceolin@intel.com>