Instead of putting object files inside libzephyr.a,
simply build a separate static library as most other
driver types are doing this already.
Note that the include to subsys has been moved from
under the drivers into subsys, as it is actually
the subsystem's job to make sure the include
directories are correct.
Signed-off-by: Daniel Leung <daniel.leung@intel.com>
Instead of putting object files inside libzephyr.a,
simply build a separate static library as most other
driver types are doing this already.
Note that the include to subsys/bluetooth has been
moved from under drivers/bluetooth to subsys/bluetooth,
as it is actually the subsystem's job to make sure
the include directories are correct.
Signed-off-by: Daniel Leung <daniel.leung@intel.com>
Make subsys/bluetooth/audio build as a static library.
This is in preparation to enable building the bluetooth
drivers as a static library. That would change the line
"zephyr_include_directories(subsys/bluetooth)" where
this include path is applied to all code compiled.
Its removal will result in subsys/bluetooth/audio not
able to find subsys/bluetooth/common/log.h. So change
subsys/bluetooth/audio to be built as a static library
so it can link to the subsys/bluetooth library where
it can find "log.h" there.
Signed-off-by: Daniel Leung <daniel.leung@intel.com>
_pm_devices, pm_suspend_devices, pm_low_power_devices and
pm_resume_devices are only used if CONFIG_PM_DEVICE is defined and not
CONFIG_PM.
Signed-off-by: Flavio Ceolin <flavio.ceolin@intel.com>
Fix a race condition that caused the Controller to deadlock
waiting for a semaphore that be given when LLL events have
been disabled.
ULL reference count is checked in thread context to decide
if LLL events are pending, but the reference count can be
decremented by the ULL execution context which prevents the
set `disabled_cb` function not being called due to no
pending event to produce the done events.
Fixed by re-checking if reference count is zero and avoid
waiting to take the semaphore.
Signed-off-by: Vinayak Kariappa Chettimada <vich@nordicsemi.no>
While RADIO_DFECTRL1_TSAMPLESPACING and RADIO_DFECTRL1_TSAMPLESPACINGREF
has similar values, but they are logically different.
As expected by "radio_df_ctrl_set" function, TSAMPLESPACING should be
passed to this function not TSAMPLESPACINGREF.
Signed-off-by: Saleh Mehdikhani <saleh.mehdikhani@unikie.com>
When events are placed back into pipeline as resume events,
only remove duplicate resume events and not new prepare
events that may have been enqueue between the start of the
pre-empt ticker and its timeout.
Due to new prepare events that was removed, extra done
events generated cause the number of enqueued done events
to overflow and assert.
Fixes#36381.
Fixes#37597.
Signed-off-by: Vinayak Kariappa Chettimada <vich@nordicsemi.no>
Fix the incorrect iterator index being reset when flushing
duplicate resume events in the pipeline.
Signed-off-by: Vinayak Kariappa Chettimada <vich@nordicsemi.no>
Update the AD data race condition handling with explicit
revert of `pdu->last` value after detecting the race.
Signed-off-by: Vinayak Kariappa Chettimada <vich@nordicsemi.no>
Reduce the Rx window swithch overhead for continuous scan by
using radio interfae `radio_tmr_start_now` that accounts for
any minimum ticker offset requirement.
Signed-off-by: Vinayak Kariappa Chettimada <vich@nordicsemi.no>
Remove the radio software switch from Rx to Tx when in
passive scanning, as there is no transmission requirement
after reception of a PDU.
Signed-off-by: Vinayak Kariappa Chettimada <vich@nordicsemi.no>
This commit adds a devmem load command for shell that allows
users to easily load arbitrary data into the device memory.
Signed-off-by: Mateusz Sierszulski <msierszulski@internships.antmicro.com>
Signed-off-by: Tomasz Gorochowik <tgorochowik@antmicro.com>
The new JIT scheduler does not have slot reservation, which means that
the ticker extension feature for automatically re-scheduling a colliding
non-anchored event, e.g. ADV, cannot be used.
This implementaion reacts to ADV envent done with result ABORTED or
TOO_LATE, and in those cases attempts to re-schedule the ADV event again
within the 10 ms pertubation window.
As the original scheduling, the re-scheduling is randomized, so there
is no absolute predictability as to how many attempts will be made. The
advertiser will attempt with randomly delayed re-schdules until the
window is exhausted.
If re-scheduling is unsuccessful, the weight of the ADV event is
increased, improving it's chances of success in the next event.
Signed-off-by: Morten Priess <mtpr@oticon.com>
This migrates all the current iterable section usages to the external
API, dropping the "Z_" prefix:
Z_ITERABLE_SECTION_ROM
Z_ITERABLE_SECTION_ROM_GC_ALLOWED
Z_ITERABLE_SECTION_RAM
Z_ITERABLE_SECTION_RAM_GC_ALLOWED
Z_STRUCT_SECTION_ITERABLE
Z_STRUCT_SECTION_ITERABLE_ALTERNATE
Z_STRUCT_SECTION_FOREACH
Signed-off-by: Fabio Baltieri <fabiobaltieri@google.com>
we use flag 0 in osSignalWait function to wait for
any single signal flag, but with this 0 flag,
it won't clear thread signal results as expected,
we need to check whether signal flag is 0 firstly.
Signed-off-by: Chen Peng1 <peng1.chen@intel.com>
Change cdc_acm_poll_out to do the best to mimic behavior
of a hardware UART controller without flow control.
With this patch, if the USB subsystem is not ready,
no data is transfered to the buffer, that is, new character
is dropped. If the USB subsystem is ready and the buffer is full,
the first character from the tx_ringbuf is removed to
make room for the new character.
Signed-off-by: Johann Fischer <johann.fischer@nordicsemi.no>
Currently, with EATT enabled, when bt_gatt_read is called with multiple
handles first it'll try to use gatt_read_mult_vl, and if it fails
gatt_read_mult will be used to try again. Add option to skip
the gatt_read_mult_vl and use gatt_read_mult right away. This is needed
by tests that expect BT_ATT_OP_READ_MULT_REQ but support variable
lenght, thus don't return BT_ATT_ERR_NOT_SUPPORTED.
Removed fallback from read multiple vl to read multiple on
BT_ATT_ERR_NOT_SUPPORTED error.
This was affecting:
GATT/CL/GAR/BV-05-C, GATT/CL/GAR/BI-18-C, GATT/CL/GAR/BI-19-C,
GATT/CL/GAR/BI-20-C, GATT/CL/GAR/BI-21-C, GATT/CL/GAR/BI-22-C
Signed-off-by: Krzysztof Kopyściński <krzysztof.kopyscinski@codecoup.pl>
Add the number of strdup buffers currently in use to the
`log strdup_utilization` shell command.
Signed-off-by: Andrew Hedin <andrew.hedin@lairdconnect.com>
Fix the node rx memory pool corruption regression introduced
due to same peer connection being rejected.
Regression introduced in commit 30f260dfaa ("Bluetooth:
controller: Fix adv/scan context access post release").
Signed-off-by: Vinayak Kariappa Chettimada <vich@nordicsemi.no>
When a new radio event is scheduled with a relatively short
preempt timeout while there is already a started preempt
ticker, then stop the ticker, abort the previous event that
requested the preemption, and request to start ticker with
the new relatively short preempt timeout.
Fixes#30245.
Signed-off-by: Vinayak Kariappa Chettimada <vich@nordicsemi.no>
When there are multiple events in prepare pipeline then fix
the implementation so that only one preempt ticker start
or stop operation is enqueued towards ticker_job for
processing.
Signed-off-by: Vinayak Kariappa Chettimada <vich@nordicsemi.no>
Introduce a new API to allow devices capable of wake up the system
register themselves was wake up sources. This permits applications to
select the most appropriate way to wake up the system when it is
suspended.
Signed-off-by: Flavio Ceolin <flavio.ceolin@intel.com>
Just using a simple atomic for flags instead of using an array.
While is neat using ATOMIC_DEFINE for future proof. The reality is
that it brings some problem for the wakeup source implementation
that needs to statically initialize it during the device definition.
Signed-off-by: Flavio Ceolin <flavio.ceolin@intel.com>
When transmitting a frame, inform the radio driver whether
security processing and/or header updates are needed or not.
When a frame was transmitted, inform back to OpenThread whether
the security procedure and/or header updates were completed for
the frame or not.
Signed-off-by: Eduardo Montoya <eduardo.montoya@nordicsemi.no>
If HCI LE Set Extended Advertising Enable command is sent
again for an advertising set while that set is enabled, then
any change to the random address shall take effect.
Signed-off-by: Vinayak Kariappa Chettimada <vich@nordicsemi.no>
Permit enabling already enabled advertising. Enabling
advertising when it is already enabled can cause the
random address to change, as specified in the Bluetooth
Specifications.
Signed-off-by: Vinayak Kariappa Chettimada <vich@nordicsemi.no>
By default ICMP desination unreachable error packets are generated when
input packets target ports that are not in a listening state. This not
only reveals the presence of the host on the network which may be
considered a security vulnerability depending on the application, it
also ends up triggering ARP lookups to respond to the sending host. With
a small ARP table and a network where there may be broadcast (or
multicast) service discovery traffic such as mDNS or uPnP, ARP table
thrashing can occur impacting network stack performance.
Signed-off-by: Berend Ozceri <berend@recogni.com>
The latest MESH.TS 1.0.1.2 4.15.10 Appkey List Procedures
MESH/NODE/CFG/AKL/BI-04-C
Verify that the IUT can respond to an Config AppKey Add
message with NetKeyIndex and AppKeyIndex already stored.
6. Repeat step 1 with the same AppKey, the same
AppKeyIndex, but NetKeyIndex field set to 0x001.
7. The Lower Tester expects the IUT to respond
with an Config AppKey Status message with the
Status field set to 0x04 (Invalid NetKey) and
the NetKeyIndex and AppKeyIndex values equal to
those sent in step 5.
Signed-off-by: Lingao Meng <menglingao@xiaomi.com>
The function to execute shell commands: shell_execute_cmd will now
behave similarly to invoking command line commands.
I.e. after the command is executed the command buffer is cleared,
while the cursor is set to the initial position.
Signed-off-by: Jakub Rzeszutko <jakub.rzeszutko@nordicsemi.no>
Fix the missing resumption of connectable advertising and
release of received connection complete buffers from LLL
after detecting connection from same peer.
Relates to commit 010c5c2f20 ("Bluetooth: controller:
Ignore connections from same peer").
Signed-off-by: Vinayak Kariappa Chettimada <vich@nordicsemi.no>
The constructors of static objects are stored in ".ctors"
section. In case of MWDT toolchain we have incompatible
".ctors" section format with GNU toolchain. So let's use
initialization code provided by MWDT instead of Zephyr one
in case of MWDT toolchain usage.
As it is done for GNU toolchain We call constructors of
static objects but we don't call destructors for them.
Signed-off-by: Eugeniy Paltsev <Eugeniy.Paltsev@synopsys.com>
Signed-off-by: Evgeniy Paltsev <PaltsevEvgeniy@gmail.com>
Add a check for the mandatory channel receive callback when the
application provides the L2CAP channel operations.
Signed-off-by: Joakim Andersson <joakim.andersson@nordicsemi.no>
Adds defines for ECC public keys, private keys, DH keys and key
coordinates. Replaces raw numbers throughout.
Signed-off-by: Trond Einar Snekvik <Trond.Einar.Snekvik@nordicsemi.no>
Remove compilation warning about adv_sync_pdu_ad_data_set function
that is defined but not used.
Signed-off-by: Piotr Pryga <piotr.pryga@nordicsemi.no>
Direction finding functionality allows to send a number of periodic
advertising PDUs in a chain that have CTE.
Disable sending CTE requiers additional steps while removing
cte_info from periodic advertising chains.
Removal of cte_info fields may be just delete of that filed
from extended advertising header. In case the PDUs are empty
PDUs created just to transport CTE. Those PDUs should be removed
from a periodic advertising chain.
Signed-off-by: Piotr Pryga <piotr.pryga@nordicsemi.no>
Add release of chained PDUs by lll_adv_pdu_and_extra_data_-
latest_get function. It is requier to release unused
PDUs from a chain to avoid PDUs leakage.
It maight happen when chained PDUs were used by Direction
Finding, then lll_adv_pdu_and_extra_data_lates_get is used
instead of lll_adv_pdu_lates_get.
Signed-off-by: Piotr Pryga <piotr.pryga@nordicsemi.no>
To check if advertising PDU is empty we can compare its length to 1.
To avoid use of magic number, the commit provides a macro for that
purpose.
Signed-off-by: Piotr Pryga <piotr.pryga@nordicsemi.no>