Skip to content

Commit

Permalink
Bluetooth: Controller: Fix CIS encryption when DF support enabled
Browse files Browse the repository at this point in the history
Fix hung Controller when establishing CIS on an encrypted
ACL connection with Controller built with direction finding
support enabled.

(cherry picked from commit 7ee427f)

Original-Signed-off-by: Vinayak Kariappa Chettimada <vich@nordicsemi.no>
GitOrigin-RevId: 7ee427f
Change-Id: Id2d90ec094c6d31ce60f409469ac2d8297b107c3
Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/third_party/zephyr/+/4933965
Commit-Queue: Keith Short <keithshort@chromium.org>
Tested-by: Keith Short <keithshort@chromium.org>
Tested-by: ChromeOS Prod (Robot) <chromeos-ci-prod@chromeos-bot.iam.gserviceaccount.com>
Reviewed-by: Keith Short <keithshort@chromium.org>
  • Loading branch information
cvinayak authored and Chromeos LUCI committed Oct 12, 2023
1 parent 45f3498 commit 25bcc6b
Showing 1 changed file with 17 additions and 12 deletions.
29 changes: 17 additions & 12 deletions subsys/bluetooth/controller/ll_sw/nordic/hal/nrf5/radio/radio.c
Original file line number Diff line number Diff line change
Expand Up @@ -1692,20 +1692,25 @@ static void *radio_ccm_ext_rx_pkt_set(struct ccm *cnf, uint8_t phy, uint8_t pdu_
mode |= (CCM_MODE_DATARATE_1Mbit <<
CCM_MODE_DATARATE_Pos) &
CCM_MODE_DATARATE_Msk;

if (false) {

#if defined(CONFIG_BT_CTLR_DF_CONN_CTE_RX)
/* When direction finding CTE receive feature is enabled then on-the-fly PDU
* parsing for CTEInfo is always done. In such situation, the CCM TASKS_CRYPT
* must be started with short delay. That give the Radio time to store received bits
* in shared memory.
*/
radio_bc_configure(CCM_TASKS_CRYPT_DELAY_BITS);
radio_bc_status_reset();
hal_trigger_crypt_by_bcmatch_ppi_config();
hal_radio_nrf_ppi_channels_enable(BIT(HAL_TRIGGER_CRYPT_DELAY_PPI));
#else
hal_trigger_crypt_ppi_config();
hal_radio_nrf_ppi_channels_enable(BIT(HAL_TRIGGER_CRYPT_PPI));
} else if (pdu_type == RADIO_PKT_CONF_PDU_TYPE_DC) {
/* When direction finding CTE receive feature is enabled then on-the-fly
* PDU parsing for CTEInfo is always done. In such situation, the CCM
* TASKS_CRYPT must be started with short delay. That give the Radio time
* to store received bits in shared memory.
*/
radio_bc_configure(CCM_TASKS_CRYPT_DELAY_BITS);
radio_bc_status_reset();
hal_trigger_crypt_by_bcmatch_ppi_config();
hal_radio_nrf_ppi_channels_enable(BIT(HAL_TRIGGER_CRYPT_DELAY_PPI));
#endif /* CONFIG_BT_CTLR_DF_CONN_CTE_RX */
} else {
hal_trigger_crypt_ppi_config();
hal_radio_nrf_ppi_channels_enable(BIT(HAL_TRIGGER_CRYPT_PPI));
}
break;

case PHY_2M:
Expand Down

0 comments on commit 25bcc6b

Please sign in to comment.