Commit graph

9523 commits

Author SHA1 Message Date
Andrzej Kaczmarek
846f5e7b4a Bluetooth: Controller: Dispatch rx nodes for sync immediately
Periodic advertising reports can be reated directly from single PDU
as they do not require any information from superior PDU, so we can
dispatch them immediately instead of buffering in aux context and
flushing at the end of chain.

This also resolves proper order of Periodic advertising and IQ reports.

Signed-off-by: Andrzej Kaczmarek <andrzej.kaczmarek@codecoup.pl>
2021-08-27 11:46:31 -04:00
Andrzej Kaczmarek
e2cd879539 Bluetooth: Controller: Store parent lll struct in aux context
We use 1st node enqueued in aux context to retrieve lll scan/sync
struct, but that only works if we buffer PDUs in aux context. It's
better to store parent lll struct as explicit member in aux context
as this also works if we skip buffering.

Signed-off-by: Andrzej Kaczmarek <andrzej.kaczmarek@codecoup.pl>
2021-08-27 11:46:31 -04:00
Andrzej Kaczmarek
17a2e3a4ba Bluetooth: Controller: Add chain scanning for per adv
This adds complete support for scanning for periodic advertising trains.

AUX_SYNC_IND is always scheduled from ULL as usual, then code for aux
scanning is reused to allow for AUX_CHAIN_IND scanning scheduled from
both ULL and LLL, depending on AuxPtr.

Signed-off-by: Andrzej Kaczmarek <andrzej.kaczmarek@codecoup.pl>
2021-08-27 11:46:31 -04:00
Andrzej Kaczmarek
103bdb43ef Bluetooth: Controller: Simplify aux flush
aux->rx_last cannot be NULL since it's always set after acquire to a
valid node so the flow in flush() can be simplified.

rx parameter is only used to update PDU chain, then it's overwritten,
so we can instead update PDU chain in caller since there's only one
place when this should happen.

Signed-off-by: Andrzej Kaczmarek <andrzej.kaczmarek@codecoup.pl>
2021-08-27 11:46:31 -04:00
Andrzej Kaczmarek
ee0f93a9c3 Bluetooth: Controller: Fix aux scanning with mixed ULL/LLL sched
We should decide on flush immediately vs. from disabled_cb based on
ull_hdr reference count instead of last rxd node - if ull_hdr has
non-zero ref, then done event is still pending and we should flush
from there.

Signed-off-by: Andrzej Kaczmarek <andrzej.kaczmarek@codecoup.pl>
2021-08-27 11:46:31 -04:00
Andrzej Kaczmarek
a80f5b2081 Bluetooth: Controller: Set default HCI event size with per adv
Periodic advertising reports can have 255 bytes of payload so need to
use that value by default if periodic advertising is enabled.

Signed-off-by: Andrzej Kaczmarek <andrzej.kaczmarek@codecoup.pl>
2021-08-27 11:46:31 -04:00
Emil Gydesen
8490508b59 Bluetooth: ISO: Make ISO/ACL bt_conn pointers clear in ISO API
Update the name of the bt_conn pointers to make it clear
whether the connection pointers are ACL or ISO connections.

Signed-off-by: Emil Gydesen <emil.gydesen@nordicsemi.no>
2021-08-27 11:46:07 -04:00
Emil Gydesen
ecb265be36 Bluetooth: ISO: Clear up ACL/ISO bt_conn pointer names
Make the name of the internal bt_conn pointers explicit as to
whether they point to an ACL or ISO bt_conn.

Signed-off-by: Emil Gydesen <emil.gydesen@nordicsemi.no>
2021-08-27 11:46:07 -04:00
Emil Gydesen
d8d8d82f0e Bluetooth: ISO: Add ISO limits as #defines and use them
Add #define's for ISO HCI limits and use them to validate
input parameters.

Signed-off-by: Emil Gydesen <emil.gydesen@nordicsemi.no>
2021-08-27 09:34:43 -04:00
Vinayak Kariappa Chettimada
50280c67cf Bluetooth: Controller: Ignore PDU with RFU field set
Ignore received Extended Advertising PDU with RFU field set
in the Common Extended Advertising Payload Format of the
PDU.

Signed-off-by: Vinayak Kariappa Chettimada <vich@nordicsemi.no>
2021-08-27 09:34:16 -04:00
Vinayak Kariappa Chettimada
41ed5b2173 Bluetooth: Controller: Use defines to access hdr_data fields
Use defines to access hdr_data fields used by interfaces to
populate the Common Extended Advertising Payload Format in
the PDUs.

Signed-off-by: Vinayak Kariappa Chettimada <vich@nordicsemi.no>
2021-08-27 09:34:16 -04:00
Vinayak Kariappa Chettimada
e976a146d2 Bluetooth: Controller: Use define for channel map size
Use a defined for channel map size of 5 octets.

Signed-off-by: Vinayak Kariappa Chettimada <vich@nordicsemi.no>
2021-08-27 09:34:16 -04:00
Vinayak Kariappa Chettimada
cf3b04534e Bluetooth: Controller: Periodic Adv Review Rework
Changes addressing Periodic Advertising and Synchronization
Channel Map Update Indication feature.

Signed-off-by: Vinayak Kariappa Chettimada <vich@nordicsemi.no>
2021-08-27 09:34:16 -04:00
Vinayak Kariappa Chettimada
e5d93d5757 Bluetooth: Controller: Use helper function to check instant past
Use a helper function to check at instant or past to apply
the channelMapNew.

Signed-off-by: Vinayak Kariappa Chettimada <vich@nordicsemi.no>
2021-08-27 09:34:16 -04:00
Vinayak Kariappa Chettimada
bb51848b93 Bluetooth: Controller: Use defined for event instant and latency max
Use defines for event instant and event instant latency
maximum values of 65536 and 32767 respectively.

Signed-off-by: Vinayak Kariappa Chettimada <vich@nordicsemi.no>
2021-08-27 09:34:16 -04:00
Vinayak Kariappa Chettimada
b76070d57a Bluetooth: Controller: Periodic Sync with Chan Map Update Indication
Added implementation in Periodic Advertising Synchronization
to support Channel Map Update Indications present in the
ACAD fields of the AUX_SYNC_IND PDUs.

Signed-off-by: Vinayak Kariappa Chettimada <vich@nordicsemi.no>
2021-08-27 09:34:16 -04:00
Vinayak Kariappa Chettimada
fbc7cafaf5 Bluetooth: Controller: Periodic Advertising Chan Map Update Indication
Added implementation to perform Periodic Advertising Channel
Map Update Indication as a Broadcaster.

Signed-off-by: Vinayak Kariappa Chettimada <vich@nordicsemi.no>
2021-08-27 09:34:16 -04:00
Vinayak Kariappa Chettimada
c5e077c48f Bluetooth: Controller: Make node rx release code conditionally reusable
Make the block of code that is used to release node rx with
type NODE_RX_TYPE_RELEASE to be conditionally available for
other Kconfig selectable features like Extended Scanning.

Previously it was only available for CONFIG_BT_CONN, but now
Extended Scanning with LLL scheduling releases node rx when
radio event is closed due to failure to receive an auxiliary
PDU.

Relates to commit 2feffaf719 ("Bluetooth: Controller:
Release LLL scheduling aux on incomplete data").

Signed-off-by: Vinayak Kariappa Chettimada <vich@nordicsemi.no>
2021-08-27 06:47:42 -04:00
Vinayak Kariappa Chettimada
fa02dc4d02 Bluetooth: Controller: Fix missing reset of connection handle
Fix missing reset of connection handle in the LLL context.
During a central connection, if LL reset is called, then
disabled connection context's handle has to be reset
otherwise new connection creation will fail by detecting
that there exists a connection to same peer.

Signed-off-by: Vinayak Kariappa Chettimada <vich@nordicsemi.no>
2021-08-27 06:47:21 -04:00
Vinayak Kariappa Chettimada
19099fc980 Bluetooth: Controller: Use define for invalid LLL context handle
Use a define for invalid LLL context handle instead of
0xFFFF magic value.

Signed-off-by: Vinayak Kariappa Chettimada <vich@nordicsemi.no>
2021-08-27 06:47:21 -04:00
Vinayak Kariappa Chettimada
631cc825da Bluetooth: Controller: Add same peer connection check to initiator
Add implementation to initiator to check and reject
connection requests to already connected peer.

Signed-off-by: Vinayak Kariappa Chettimada <vich@nordicsemi.no>
2021-08-27 06:47:21 -04:00
Vinayak Kariappa Chettimada
1c564e750b Bluetooth: Controller: Use id addr type to check same peer connection
Store and check device identity addr type of public or
random.

Signed-off-by: Vinayak Kariappa Chettimada <vich@nordicsemi.no>
2021-08-27 06:47:21 -04:00
Vinayak Kariappa Chettimada
22a48e502e Bluetooth: Controller: Minor rename of disabled callback functions
Minor rename of Connection ISO disabled callback function
names.

Signed-off-by: Vinayak Kariappa Chettimada <vich@nordicsemi.no>
2021-08-27 06:46:55 -04:00
Vinayak Kariappa Chettimada
f06ac2be2c Bluetooth: Controller: Fix LLL events pending check from ULL Low
ULL reference count is checked in ULL_LOW context to decide
if LLL events are pending, but the reference count can be
decremented by the ULL HIGH execution context which can
prevent the set `disabled_cb` function not being called due
to no pending event to produce the done events.

Fixed by checking the reference count in the ULL HIGH
execution context using a mayfly to schedule the check.

Signed-off-by: Vinayak Kariappa Chettimada <vich@nordicsemi.no>
2021-08-27 06:46:55 -04:00
Vinayak Kariappa Chettimada
d2be89d725 Bluetooth: Controller: Use consistent naming for ticker op callbacks
Use consistent naming for ticker operation callback
functions.

Signed-off-by: Vinayak Kariappa Chettimada <vich@nordicsemi.no>
2021-08-27 06:46:55 -04:00
Pavel Vasilyev
cd294c12c3 tests: Bluetooth: Mesh: Verify that all stored mesh entries removed
This ensures that all mesh settings were removed from persistent storage
after node reset.

Signed-off-by: Pavel Vasilyev <pavel.vasilyev@nordicsemi.no>
2021-08-26 14:04:38 -04:00
Joakim Andersson
334369ab44 Bluetooth: host: Fix dereference before null check
Fix dereference before null check in att.c

Fixes: #37947

Signed-off-by: Joakim Andersson <joakim.andersson@nordicsemi.no>
2021-08-26 13:57:16 -04:00
Vinayak Kariappa Chettimada
2e9f6d0201 Bluetooth: Controller: Remove unused PDU size defines
Remove unused legacy PDU size extra defines.

Signed-off-by: Vinayak Kariappa Chettimada <vich@nordicsemi.no>
2021-08-26 13:42:41 -04:00
Vinayak Kariappa Chettimada
af41a508d6 Bluetooth: Controller: Fix radio packet size for Extended Scanning
Fix maximum radio packet size configuration to use 255 bytes
for Extended Scanning and Periodic Synchronization.

Add a Kconfig option so that application can reduce RAM
usage if a specific user scenario can live with smaller PDU
receptions.

Signed-off-by: Vinayak Kariappa Chettimada <vich@nordicsemi.no>
2021-08-26 13:42:41 -04:00
Vinayak Kariappa Chettimada
d3bda1dc06 Bluetooth: Controller: Minor rearrange rx packet set after radio config
Minor rearrange of rx packet set statements after radio
configuration function calls.

Signed-off-by: Vinayak Kariappa Chettimada <vich@nordicsemi.no>
2021-08-26 13:42:41 -04:00
Piotr Pryga
2897870fa5 Bluetooth: controller: Fix aux ptr offset calculation for S2 Coded PHY
In the calculation of auxiliary PDU offset for periodic advertising
AUX_CHAIN_IND PDUs there were used old macro that was removed.
The code didn't compile.
Also there were no support for S2 Coded PHY in the offset calculation.

Signed-off-by: Piotr Pryga <piotr.pryga@nordicsemi.no>
2021-08-26 13:14:38 -04:00
Emil Gydesen
4bd326d6c9 Bluetooth: ISO: Remove use of conn->channels for ISO
The channels list were originally meant to be used
for multiple bt_iso_chan per iso connect (bt_conn), but
that is not the case for the current API, and won't be
going forward, so the use of the list has been removed.

Signed-off-by: Emil Gydesen <emil.gydesen@nordicsemi.no>
2021-08-26 13:14:22 -04:00
Emil Gydesen
51f2022f7b Bluetooth: Audio: Add initial server values in bt_vcs_register_param
Add support for setting initial values in bt_vcs_register_param
when registering a VCS service

Signed-off-by: Emil Gydesen <emil.gydesen@nordicsemi.no>
2021-08-26 09:13:58 -04:00
Emil Gydesen
9341a3d50c Bluetooth: ISO: Add NULL check in bt_iso_big_sync
Verify that the ISO channels supplied by the caller
are non-NULL.

Signed-off-by: Emil Gydesen <emil.gydesen@nordicsemi.no>
2021-08-26 09:12:47 -04:00
Emil Gydesen
581d07e494 Bluetooth: ISO: Add NULL check in bt_iso_big_create
Verify that the ISO channels supplied by the caller
are non-NULL.

Signed-off-by: Emil Gydesen <emil.gydesen@nordicsemi.no>
2021-08-26 09:12:47 -04:00
Emil Gydesen
06ebe239c1 Bluetooth: ISO: Add NULL check in cleanup_big
In case that creating a BIG fails due to missing
ISO channel, cleanup_big would try to access a
NULL pointer.

Signed-off-by: Emil Gydesen <emil.gydesen@nordicsemi.no>
2021-08-26 09:12:47 -04:00
Vinayak Kariappa Chettimada
2f38c522fd Bluetooth: Controller: Remove ULL header include in LLL
Do not include ULL header in LLL, instead values and fields
required in LLL shall be declared in LLL contexts.

Signed-off-by: Vinayak Kariappa Chettimada <vich@nordicsemi.no>
2021-08-26 06:55:43 -04:00
Vinayak Kariappa Chettimada
43d8d34dc4 Bluetooth: Controller: Remove memcpy of SCAN_REQ and CONN_REQ PDUs
Removed implementation that used memcpy of received PDUs and
instead using the free Rx buffers; use the scratch PDU for
transmitting scan requests and connection requests.

Signed-off-by: Vinayak Kariappa Chettimada <vich@nordicsemi.no>
2021-08-25 18:07:53 -04:00
Vinayak Kariappa Chettimada
c409b74f0d Bluetooth: Controller: Add lll_prof_reserve profiling function
Add the lll_prof_reserve and lll_prof_reserve_send profiling
functions to use when profiling active scanning and
initiator.

Signed-off-by: Vinayak Kariappa Chettimada <vich@nordicsemi.no>
2021-08-25 18:07:53 -04:00
Vinayak Kariappa Chettimada
7426045a28 Bluetooth: Controller: Define invalid/unassigned node rx handle value
Add a define for invalid/unassigned node rx handle value.

Signed-off-by: Vinayak Kariappa Chettimada <vich@nordicsemi.no>
2021-08-25 18:07:53 -04:00
Erik Brockhoff
f41b3d7879 Bluetooth: Controller: Fix conn param req ack/req reset
llcp.conn_param.ack was reset on tx of conn param rsp, however this
should only be done once the expected conn update ind is received
and sets the cu.ack flag to indicate cu procedure 'takes over'.

Signed-off-by: Erik Brockhoff <erbr@oticon.com>
Signed-off-by: Vinayak Kariappa Chettimada <vich@nordicsemi.no>
2021-08-25 18:07:35 -04:00
Vinayak Kariappa Chettimada
5123b45761 Bluetooth: Controller: Initial support for advertising on S2/S8 coding
Added implementation to support advertising on S2/S8 coding
scheme.

Signed-off-by: Vinayak Kariappa Chettimada <vich@nordicsemi.no>
2021-08-25 18:06:47 -04:00
Vinayak Kariappa Chettimada
193ce73109 Bluetooth: Controller: Fix missing resume of primary channel scanning
Fix missing implementation to release Auxiliary PDU chains
and then resume back to scanning on primary channel.

Signed-off-by: Vinayak Kariappa Chettimada <vich@nordicsemi.no>
2021-08-25 18:06:47 -04:00
Vinayak Kariappa Chettimada
1ce46fd7a6 Bluetooth: Controller: Add PDU time calculation for S2 Coded PHY
Add PDU time calculation macro for S2 and S8 Coded PHY.
Rename PKT_AC_US to PDU_AC_MAX_US.

Signed-off-by: Vinayak Kariappa Chettimada <vich@nordicsemi.no>
2021-08-25 18:06:47 -04:00
Vinayak Kariappa Chettimada
88b155de31 Bluetooth: Controller: Rename PKT_US to PDU_DC_MAX_US
Rename PKT_US to PDU_DC_MAX_US.

Signed-off-by: Vinayak Kariappa Chettimada <vich@nordicsemi.no>
2021-08-25 18:06:47 -04:00
Vinayak Kariappa Chettimada
869d3c24d7 Bluetooth: Controller: Rename PKT_DC_US to PDU_MAX_US
Rename PKT_DC_US to PDU_MAX_US.

Signed-off-by: Vinayak Kariappa Chettimada <vich@nordicsemi.no>
2021-08-25 18:06:47 -04:00
Vinayak Kariappa Chettimada
48f5990eea Bluetooth: Controller: Add missing range delay for extended active scan
Add missing range delay value when calculating the header
complete timeout value for the reception of extended scan
response PDU.

Signed-off-by: Vinayak Kariappa Chettimada <vich@nordicsemi.no>
2021-08-25 18:06:47 -04:00
Vinayak Kariappa Chettimada
6911e7e1d8 Bluetooth: Controller: Use the received coding scheme when scanning
Use the received coding scheme when scanning for correctly
calculating the receive chain delay and on-air PDU time.

Signed-off-by: Vinayak Kariappa Chettimada <vich@nordicsemi.no>
2021-08-25 18:06:47 -04:00
Vinayak Kariappa Chettimada
cee9ce6b8e Bluetooth: Controller: Add Coded PHY Rx-ed coding get interface
Added a radio interface to fetch the received Coded PHY
coding scheme of the PDU.

Signed-off-by: Vinayak Kariappa Chettimada <vich@nordicsemi.no>
2021-08-25 18:06:47 -04:00
Emil Gydesen
7854088116 Bluetooth: ISO: Fixes missing handling of broadcast ISO TX
After 31045c7 was merged, it was possible to use broadcast
iso without CONFIG_BT_CONN, but it did not properly handle
TX as there were missing support to read the buffer
size from the controller, as well as missing support
for handling the number of completed packets event.

Signed-off-by: Emil Gydesen <emil.gydesen@nordicsemi.no>
2021-08-25 18:06:09 -04:00