Refactor BT_CTLR_ADV_INDICATION feature by moving the
implementation closer to the implementation that is closing
the advertisement event so that in the future new members
can be added as necessary (example, advertised channels).
Signed-off-by: Vinayak Kariappa Chettimada <vich@nordicsemi.no>
Fixed a missing ticks unit to microsecond unit conversion
potentially caused incorrect window offsets being used while
establishing connections.
Signed-off-by: Vinayak Kariappa Chettimada <vich@nordicsemi.no>
ticker timespace reservation can range up to 10.24 seconds,
needing 19-bits to represent in 32KHz clock units. Hence,
fix controller implementation to use u32_t to store ticks
slot values.
Without this fix, the controller is asserting in scan_adv
sample when using continuous scanning with 2 second interval
and window.
Signed-off-by: Vinayak Kariappa Chettimada <vich@nordicsemi.no>
Refactored the high frequency clock preparation advanced
feature to improve radio utilization during continuous
scanning.
The inter-event timespace value now considers the reserved
timespace while determining if the high frequency clock
will be retained. This reduces the preparation time, hence
increased radio use inside scan window.
Signed-off-by: Vinayak Kariappa Chettimada <vich@nordicsemi.no>
Refactor the invalid control PDU handling so as to reuse the
switch-case and hence, reduce code size and CPU time used.
Signed-off-by: Vinayak Kariappa Chettimada <vich@nordicsemi.no>
In preparation towards a refactored controller, rename the
old radio_*_is_enabled() function to ll_*_is_enabled().
Signed-off-by: Vinayak Kariappa Chettimada <vich@nordicsemi.no>
Fix the controller implementation to handle Control PDUs
with invalid lengths by responding with Unknown Response
PDU.
Fixes LL.TS.5.0.2 conformance tests:
LL/PAC/SLA/BI-01-C [Control PDUs with Invalid Length from
Master]
LL/PAC/MAS/BI-01-C [Control PDUs with Invalid Length from
Slave]
Signed-off-by: Vinayak Kariappa Chettimada <vich@nordicsemi.no>
Cleanup the use of long radio_pdu_node_rx and
radio_pdu_node_tx variable to shorter node_rx and node_tx
names.
Signed-off-by: Vinayak Kariappa Chettimada <vich@nordicsemi.no>
Refactor the pdu_data_llctrl_phy_req_rsp struct into
pdu_data_llctrl_phy_req and pdu_data_llctrl_phy_req structs.
Signed-off-by: Vinayak Kariappa Chettimada <vich@nordicsemi.no>
Refactor the pdu_data_llctrl_length_req_rsp struct into
pdu_data_llctrl_length_req and pdu_data_llctrl_length_req
structs.
Signed-off-by: Vinayak Kariappa Chettimada <vich@nordicsemi.no>
This commit implements minor refactoring of radio.c and ctrl.c,
to prepare for adding the implementation of sw-switch based on
the event timer.
Signed-off-by: Ioannis Glaropoulos <Ioannis.Glaropoulos@nordicsemi.no>
Fix generation of redundant length update event when no
change in effective octets or time.
Fixes LL.TS.5.0.2 conformance tests:
LL/CON/MAS/BV-73-C [Master Data Length Update - Responding
to Data Length Update Procedure; LE 1M PHY]
LL/CON/MAS/BV-74-C [Master Data Length Update - Initiating
Data Length Update Procedure; LE 1M PHY]
LL/CON/MAS/BV-76-C [Master Data Length Update - Responding
to Data Length Update Procedure; LE 2M PHY]
LL/CON/MAS/BV-77-C [Master Data Length Update - Initiating
Data Length Update Procedure; LE 2M PHY]
LL/CON/SLA/BV-77-C [Slave Data Length Update - Responding
to Data Length Update Procedure; LE 1M PHY]
LL/CON/SLA/BV-78-C [Slave Data Length Update - Initiating
Data Length Update Procedure; LE 1M PHY]
LL/CON/SLA/BV-80-C [Slave Data Length Update - Responding
to Data Length Update Procedure; LE 2M PHY]
LL/CON/SLA/BV-81-C [Slave Data Length Update - Initiating
Data Length Update Procedure; LE 2M PHY]
Signed-off-by: Vinayak Kariappa Chettimada <vich@nordicsemi.no>
Fixed implementation to use Connection Parameter Request
Procedure Preferred Periodicity value in calculating the new
connection interval used by the master role in Connection
Update Indication.
Fixes LL.TS.5.0.2 conformance tests:
LL/CON/MAS/BV-32-C [Accepting Connection Parameter Request –
Preferred_Periodicity]
LL/CON/MAS/BV-33-C [Accepting Connection Parameter Request –
Preferred_Periodicity and preferred anchor points]
Signed-off-by: Vinayak Kariappa Chettimada <vich@nordicsemi.no>
Fix controller implementation to restrict HCI LE Set Random
Address command when advertising and/or active scanning
and/or initiator state is enable.
Fixes LL.TS.5.0.2 conformance tests:
LL/CON/INI/BV-01-C [Connection Initiation]
LL/SEC/ADV/BV-01-C [Advertising With Static Address]
LL/SEC/SCN/BV-01-C [Random Address Scanning]
Signed-off-by: Vinayak Kariappa Chettimada <vich@nordicsemi.no>
Fix implementation to support Connection Parameter Request
Procedure initiation with and without use of Feature
Exchange Procedure being performed in a connection.
Fixes LL.TS.5.0.2 conformance tests:
LL/CON/MAS/BV-81-C [Initiating Connection Parameter Request
- Unsupported Without Feature Exchange]
LL/CON/MAS/BV-82-C [Initiating Connection Parameter Request
- Unsupported With Feature Exchange]
LL/CON/SLA/BV-85-C [Initiating Connection Parameter Request
- Unsupported Without Feature Exchange]
LL/CON/SLA/BV-86-C [Initiating Connection Parameter Request
- Unsupported With Feature Exchange]
Signed-off-by: Vinayak Kariappa Chettimada <vich@nordicsemi.no>
Fix controller implementation to only restrict HCI LE Set
Random Address command when advertising and/or active
scanning is enable.
Continues to pass the following LL.TS.5.0.2 conformance
test:
LL/SEC/SCN/BV-01-C [Random Address Scanning]
Signed-off-by: Vinayak Kariappa Chettimada <vich@nordicsemi.no>
Fixed implementation to disallow setting Bluetooth device
address under active advertising or scanning states.
Fixes LL.TS.5.0.2 conformance tests:
LL/CON/INI/BV-01-C [Connection Initiation]
LL/SEC/ADV/BV-01-C [Advertising With Static Address]
LL/SEC/SCN/BV-01-C [Random Address Scanning]
Signed-off-by: Vinayak Kariappa Chettimada <vich@nordicsemi.no>
Refactor mayfly based execution context solution out into
the HAL folder. This opens up the possibility to use
tasklets (if and when kernel gets the support) style
execution contexts.
Signed-off-by: Vinayak Kariappa Chettimada <vich@nordicsemi.no>
Fixes a bug where in Connection Parameter Request was
initiated by slave role while Encryption Setup had been
started by the peer master.
Fixes: #5823
Signed-off-by: Vinayak Kariappa Chettimada <vich@nordicsemi.no>
Rename some legacy upstream and downstream interfaces in
radio_* namespace to ll_* namespace for consistency.
Signed-off-by: Vinayak Kariappa Chettimada <vich@nordicsemi.no>
Refactor Kconfig and CMakelists.txt to be able to
conditionally compile in BT_LL_SW variant in the controller
subsystem. This is done to support future controller with
vendor specific variant implementations.
Signed-off-by: Vinayak Kariappa Chettimada <vich@nordicsemi.no>
This commit refactors the nRF5 radio driver of Bluetooth controller
to use symbolic names for PPIs. It also revisits the Radio hardware
timing constants to align with experimental measurements.
Signed-off-by: Ioannis Glaropoulos <Ioannis.Glaropoulos@nordicsemi.no>
Fixes many instances of errors similar to below:
zephyr/subsys/bluetooth/controller/ll_sw/ctrl.c:5927:22:
error: declaration of ‘s_link’ shadows a previous
local [-Werror=shadow]
static memq_link_t s_link;
^~~~~~
zephyr/subsys/bluetooth/controller/ll_sw/ctrl.c:5905:21:
note: shadowed declaration is here
static memq_link_t s_link;
^~~~~~
Signed-off-by: Vinayak Kariappa Chettimada <vich@nordicsemi.no>
When the controller is connecting to multiple connectable
advertisers, the events are scheduled consecutively avoiding
overlapping events. Calculation of the window offset did not
consider the preparation time before the event, causing the
new master role connection event to overlap with previous
event. This is now fixed by including the preparation time
in the used window offset from the end of connect_ind PDU
transmitted.
Signed-off-by: Vinayak Kariappa Chettimada <vich@nordicsemi.no>
Fixed the check related to initiating connection parameter
request procedure. This will avoid sending invalid repeated
dispatch of connection parameter request PDU.
Signed-off-by: Vinayak Kariappa Chettimada <vich@nordicsemi.no>
When connection parameter request procedure was responded
by master role with Unsupported Link Layer Parameter Value,
a missing reset of the connection parameter request
procedure state caused next connection parameter request to
be incorrectly responded with same procedure collision
extended reject ind PDU. This caused an eventual connection
disconnection with reason LMP response timeout. This is now
fixed by reseting the state correctly.
Signed-off-by: Vinayak Kariappa Chettimada <vich@nordicsemi.no>
Fixes the following compile error when CONFIG_BT_CTLR_LE_ENC
is disabled:
subsys/bluetooth/controller/ll_sw/ctrl.c: In function
'isr_rx_conn_pkt_ctrl':
subsys/bluetooth/controller/ll_sw/ctrl.c:2613:29: error:
'LLCP_ENCRYPTION' undeclared (first use in this function)
(conn->llcp_type != LLCP_ENCRYPTION)) ||
^~~~~~~~~~~~~~~
Signed-off-by: Vinayak Kariappa Chettimada <vich@nordicsemi.no>
Replace use if void * declaration related to memq links with
more readable memq_link_t.
Signed-off-by: Carles Cufi <carles.cufi@nordicsemi.no>
Signed-off-by: Vinayak Kariappa Chettimada <vich@nordicsemi.no>
Optimised the parameter passing order of memq interface such
that the compiled code uses less space and execution time.
Having a parameter that gets returned as the first parameter
passed to a function avoids instructions required to have
the result in the return register.
Signed-off-by: Vinayak Kariappa Chettimada <vich@nordicsemi.no>
Fixes the following conformance test regression failure
introduced in commit 7dd5fbee26 ("Bluetooth: controller:
Fix MIC error due to parallel Enc Proc")
TP/CON/MAS/BV-28-C [Initiating Connection Parameter Request
different procedure collision encryption]
Signed-off-by: Vinayak Kariappa Chettimada <vich@nordicsemi.no>
Fix to disallow initiating LE Start Encryption while another
procedure is in progress. Similarly, disallow initiating
another procedure while Encryption procedure is in progress.
Signed-off-by: Vinayak Kariappa Chettimada <vich@nordicsemi.no>
Replace all controller asserts in control procedure responses
that checked for buffer availability with an implementation
that nacks request PDUs if there are no buffer to prepare
response PDUs.
Signed-off-by: Vinayak Kariappa Chettimada <vich@nordicsemi.no>
Add implementation to support Coded PHY update procedure
with packet transmit time restrictions.
Signed-off-by: Vinayak Kariappa Chettimada <vich@nordicsemi.no>
Use S8 coding Rx chain delay timings to calculate the PA
pin assertions when in Coded PHY.
Signed-off-by: Vinayak Kariappa Chettimada <vich@nordicsemi.no>
When calculating and setting up the header compelte timeout
use S8 coding Rx chain delay.
Signed-off-by: Vinayak Kariappa Chettimada <vich@nordicsemi.no>
In the commit dd52b8ea02 ("Bluetooth: controller: Fix
first connection interval timing"), instead of using just a
tick unit as workaround, microseconds corresponding to a
tick unit was used while calculating the window offset to be
used at the connection update instant. This introduced an
error in scheduling the first event with new connection
parameters, causing supervision timeout of connection update
procedure.
Signed-off-by: Vinayak Kariappa Chettimada <vich@nordicsemi.no>
Fixed a missing reset of FC feature on HCI reset. This
feature provided a simple connection handle based event
exclusions, but this is no longer needed with the
support for controller to host flow control. This feature
should be removed in the future.
Signed-off-by: Vinayak Kariappa Chettimada <vich@nordicsemi.no>
When a peer master performed a PHY update procedure with no
change, the state machine was not released. This blocked
any future local initiation of the procedure and also
leading to termination of connection with reason LMP
response timeout.
Signed-off-by: Vinayak Kariappa Chettimada <vich@nordicsemi.no>
PHY Update procedure timeout was started without transition
to the state that waits for the procedure to complete. This
prevented the timeout from being reset on successful
completion of the procedure and eventually leading to a
connection termination with reason LMP Response Timeout.
Signed-off-by: Vinayak Kariappa Chettimada <vich@nordicsemi.no>