Remove `OPENTHREAD_CONFIG_NCP_BUFFER_SIZE` define since it does not
exist in OpenThread.
Signed-off-by: Eduardo Montoya <eduardo.montoya@nordicsemi.no>
Add support for ISO feature bits. This includes extending fields that
hold features to 64 bits to be able to handle the host-controlled
"Isochronous Channels" feature.
Signed-off-by: Wolfgang Puffitsch <wopu@demant.com>
Remove support for the Musca-A board. This board is rarely used, few
are available and superceded by Musca-B and Musca-S.
Signed-off-by: Kumar Gala <kumar.gala@linaro.org>
Added Tx fragmentation implementation assertion to check
invalid offset use due to any memory corruptions.
Signed-off-by: Vinayak Kariappa Chettimada <vich@nordicsemi.no>
Use the vendor specific ticker resolution margin in the
central connection initiation offset calculation.
Related to commit 89ab68f242 ("bluetooth: controller:
Vendor specific ticker resolution margin").
Signed-off-by: Vinayak Kariappa Chettimada <vich@nordicsemi.no>
Remove the redundant advanced scheduling event margin used
while finding a free space between existing active central
connections.
Signed-off-by: Vinayak Kariappa Chettimada <vich@nordicsemi.no>
Move the initial connection event length calculation to
when initiating connection so that initiator with advanced
scheduling to place central connections in a non-overlapping
timeline has the correct ticks slot value available.
Signed-off-by: Vinayak Kariappa Chettimada <vich@nordicsemi.no>
If userspace is enabled, then the TLS context needs to be
made a NET_SOCKET kernel object. Without this the userspace
cannot access TLS sockets.
Signed-off-by: Jukka Rissanen <jukka.rissanen@linux.intel.com>
Provide the LoRaWAN stack with an optional callback to be
called whenever the battery level needs to be read.
In the case of callback not being provided, the LoRaWAN
stack will report 255 (battery level unavailable) as per
the LoRaWAN spec.
Signed-off-by: Kuba Sanak <contact@kuba.fyi>
Simplify pm subsystem removing PM_STATE_LOCK option. Constraints API is
small and is a key component of power subsystem.
Signed-off-by: Flavio Ceolin <flavio.ceolin@intel.com>
Add checks to detect ACL data lengths greater than the
configured maximum Tx buffer size in the controller.
The Host should conform to the LE_ACL_Data_Packet_Length
returned by the LE Read Buffer Size command.
Signed-off-by: Vinayak Kariappa Chettimada <vich@nordicsemi.no>
Optimize LOW_LAT_ULL scheduling by avoiding redundant
rx_demux mayfly enqueue. Only schedule after checking for
node rx or tx ack presence in the memq.
Signed-off-by: Vinayak Kariappa Chettimada <vich@nordicsemi.no>
Use the Subsystem defined BT_PER_ADV_SYNC_MAX Kconfig in the
controller implementation of Periodic Advertising Sync Sets.
Signed-off-by: Vinayak Kariappa Chettimada <vich@nordicsemi.no>
A line of code was guarded by CONFIG_BT_L2CAP_TX_FRAG_COUNT instead
of CONFIG_BT_ISO_TX_FRAG_COUNT.
Signed-off-by: Emil Gydesen <emil.gydesen@nordicsemi.no>
ISO is a building block for BT_AUDIO but it is not only
useful for AUDIO, and as such should be possible to
enable without enabling BT_AUDIO.
This commit moves iso.c and iso_internal.h to the
host directory (from host/audio) and removes
the CMakeLists.txt.
The /audio directory is left intact for the Kconfig options
it provides, and as a directory for future BLE Audio
content.
Signed-off-by: Emil Gydesen <emil.gydesen@nordicsemi.no>
This commit moves the BT_ISO to a common (host and controller)
Kconfig and fixes the ISO buffers in hci_raw.c
Signed-off-by: Emil Gydesen <emil.gydesen@nordicsemi.no>
Add release of memory acquired for periodic advetising sync. set
when:
- advertising set is removed
- advertising parameters are changed and past PDU type was
extended advertising PDU
Signed-off-by: Piotr Pryga <piotr.pryga@nordicsemi.no>
Remove LL_ASSERT from functions that return latest advertising PDU.
The LL_ASSERT was raised in situation that there is no memory to
store unused PDUs memory in a pdu_free queue or extra_data_free queue
Those functions return NULL in such sitation. The returned value is
verified by callers by LL_ASSERT. That gives better context if lack
of memory issue issue occurs.
Besides that there was removed a LL_ASSERT from lll_adv_pdu_and_extra_-
data_alloc. The reasons is the same as above, to give better context
when the lack of memory issue occurs.
This function is used in ULL context (ll_adv_sync_ad_data_set).
If it returns NULL the caller will return BT_HCI_ERR_MEM_CAPACITY_-
EXCEEDED to Host.
Signed-off-by: Piotr Pryga <piotr.pryga@nordicsemi.no>
Add set of functions that will make possible to configure
radio Direction Finding Extension to transmit CTE for periodic
advertising.
Some of the new Radio API functions are provided as separate
functions changing the same Radio peripheral registers, e.g.
radio_df_mode_set_aoa, radio_df_mode_set_aod. This is done on
purpose and is related with lack of DFE in nrf52_bsim.
To avoid use of conditionally compiled constants to represent
e.g. CTE mode; separate functions were introduced.
Thanks to that DF unit tests are able to compile successfully
without changes in nrf52_bsim platform. Also if DFE is added
to nrf52_bsim there is no need to change the code until it is
desired.
Signed-off-by: Piotr Pryga <piotr.pryga@nordicsemi.no>
The storage for extra data is required for implementation of
CTE transmission with periodic advertising.
Data required to transmit CTE correctly are compound of two parts:
- PDU field CTEInfo
- radio configuration to transmit actual constant tone at the end
of PDU.
Extra data is a storage required for radio configuration data.
Nevertheless it must be in compliance with content of CTEInfo field.
Because of that extra data is stored as part of lll_adv_pdu and
is double buffered like PDU memory.
Bluetooth 5.1 spec. allows to enable or disable CTE TX
and change CTE TX parameters when periodic advertising is
enabled. Besides that CTE TX settings may be set before periodic
advertising parameters are set. In such situation ll_adv_sync_set
may be not yet created.
To overcome these constraints ULL should store CTE TX
settings and forward them to LLL only when CTE TX is enabled.
Because of above reasons ULL stores CTE TX settings in ll_adv_set.
Signed-off-by: Piotr Pryga <piotr.pryga@nordicsemi.no>
Add Directin Finding related features:
- transmission of connectionless CTE,
- antenna switching during CTE transmission (AoD),
to list of features supported by controller.
Signed-off-by: Piotr Pryga <piotr.pryga@nordicsemi.no>
Remove support for nRF5340 PDK in the BLE controller.
The controller will now support only the nRF5340 DK.
Signed-off-by: Ioannis Glaropoulos <Ioannis.Glaropoulos@nordicsemi.no>
Fix cancel of Periodic Synchronization on Coded PHY. Reset
the association of periodic sync instance after validation
of command disallowed.
Signed-off-by: Vinayak Kariappa Chettimada <vich@nordicsemi.no>
When handling CoAP Confirmable requests, there is a common
Acknowledgement initialization procedure that repeats for each
response packet initialization. This patch adds a function that
simplifies Acknowledgement initialization procedure encapsulating
repeating code.
Signed-off-by: Hubert Miś <hubert.mis@nordicsemi.no>
When address resolution is disabled, an identity address has
been added into the resolving list with peer IRK, and device
privacy has not been selected for the peer device then
connection indication shall not be sent to the peer that is
advertising using its identity address.
Fixes#24731.
Signed-off-by: Vinayak Kariappa Chettimada <vich@nordicsemi.no>
acl_read_cb does not handle incoming (ACL) data
if BT_CTLR_TX_BUFFER_SIZE is greater than
USB_MAX_FS_BULK_MPS - BT_HCI_ACL_HDR_SIZE.
Since the host adjusts the data according to
the BT_CTLR_TX_BUFFER_SIZE and does not use ZLP
we cannot start usb_transfer over the possible length of
the whole packet, with or without USB_TRANS_NO_ZLP flag.
But we can read the packet length from the header and
call net_buf_put() when the whole packet is received.
Fixes: #31922
Reported-by: Matias Karhumaa <matias.karhumaa@gmail.com>
Signed-off-by: Johann Fischer <johann.fischer@nordicsemi.no>
Fail after pairing request and response have been exchanged if the
selected pairing method would not result in the required security level.
This avoids the case where we would discover this after having encrypted
the connection and disconnect instead.
This was partially attempted but lacked checking for authentication
requirement when L3 was required, as well as skipping the check if L4
was required but remote did not support Secure Connections since the
check was after we had taken the legacy branch.
Signed-off-by: Joakim Andersson <joakim.andersson@nordicsemi.no>
Set the error in the security changed callback when the encryption has
not reached the required security level.
Terminate the pairing procedure in SMP on failure to avoid the security
changed callback being called twice in this case.
Signed-off-by: Joakim Andersson <joakim.andersson@nordicsemi.no>
Terminate the pairing procedure when disconnected while this was in
progress. This notifies the application that security has failed and
removes the key entry.
Signed-off-by: Joakim Andersson <joakim.andersson@nordicsemi.no>
Set the SMP flag encryption pending in the case where a bond exists
with ediv and rand equal to zero, i.e LE Secure Connections bond.
Signed-off-by: Joakim Andersson <joakim.andersson@nordicsemi.no>
When receiving unexpected SMP PDUs with no pairing procedures in
progress don't treat it as a pairing procedure that has failed.
This causes unexpected SMP PDUs to trigger the pairing failed and
security changed callback at unexpected times.
Signed-off-by: Joakim Andersson <joakim.andersson@nordicsemi.no>
Add status only pairing failed callbacks (complete and failed) so that
these handlers can be added without providing the ability for MITM
pairing procedures.
Signed-off-by: Joakim Andersson <joakim.andersson@nordicsemi.no>
Rename auth_err_get to security_err_get which better reflect the
error namespace it converts to. Also update to using the enum definition
instead of uint8_t for local variable holding returned value.
Signed-off-by: Joakim Andersson <joakim.andersson@nordicsemi.no>
when BT_PASSKEY_INVALID was set, it never updated the fixed
passkey which made its use ineffective
Signed-off-by: Faisal Saleem <faisal.saleem@setec.com.au>
The ATT request buffers are held until the ATT response has been
received. This means that the ATT request buffers are released by the
RX thread, instead of the from the RX priority context of
num_complete.
This can cause a deadlock in the RX thread when we allocate buffers
and all the available buffers are ATT requests, since the RX thread is
the only thread that can release buffers.
Release the ATT request buffers once they have been sent and instead
handle ATT request resending by reconstructing the buffer from the
GATT parameters.
Also re-order the order of resource allocation by allocating the
request context before the buffer. This ensures that we cannot
allocate more buffers for ATT requests than there are ATT requests.
Fixed a buf reference leak that could occur when the ATT request buffer
has been allocated, but GATT returns an error before handing the
responsebility of the buffer to ATT, for example when bt_att_req_alloc
fails.
This is fixed by moving the functionality of att_req_destroy to
bt_att_req_free.
Signed-off-by: Joakim Andersson <joakim.andersson@nordicsemi.no>
Remove the ATT request destroy callback which is never assigned
by any of the ATT requests.
Signed-off-by: Joakim Andersson <joakim.andersson@nordicsemi.no>