Bluetooth: Controller: Fix BT_CTLR_LE_ENC conditional compilation
Fix BT_CTLR_LE_ENC conditional compilation when feature is disabled. Signed-off-by: Vinayak Kariappa Chettimada <vich@nordicsemi.no>
This commit is contained in:
parent
a66baa1101
commit
2d49080cb8
9 changed files with 89 additions and 40 deletions
|
|
@ -173,10 +173,6 @@ zephyr_library_sources_ifdef(
|
||||||
zephyr_library_include_directories(
|
zephyr_library_include_directories(
|
||||||
.
|
.
|
||||||
include
|
include
|
||||||
)
|
|
||||||
|
|
||||||
zephyr_library_include_directories_ifdef(
|
|
||||||
CONFIG_BT_CTLR_CRYPTO
|
|
||||||
../crypto
|
../crypto
|
||||||
)
|
)
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -813,9 +813,14 @@ config BT_CTLR_SYNC_ISO
|
||||||
|
|
||||||
config BT_CTLR_BROADCAST_ISO
|
config BT_CTLR_BROADCAST_ISO
|
||||||
bool
|
bool
|
||||||
select BT_CRYPTO if BT_LL_SW_SPLIT
|
|
||||||
default BT_CTLR_ADV_ISO || BT_CTLR_SYNC_ISO
|
default BT_CTLR_ADV_ISO || BT_CTLR_SYNC_ISO
|
||||||
|
|
||||||
|
config BT_CTLR_BROADCAST_ISO_ENC
|
||||||
|
bool
|
||||||
|
depends on BT_CTLR_CRYPTO_SUPPORT && BT_CTLR_BROADCAST_ISO
|
||||||
|
select BT_CRYPTO if BT_LL_SW_SPLIT
|
||||||
|
default y
|
||||||
|
|
||||||
config BT_CTLR_ADV_ISO_SET
|
config BT_CTLR_ADV_ISO_SET
|
||||||
int "LE Isochronous Channel advertising sets"
|
int "LE Isochronous Channel advertising sets"
|
||||||
depends on BT_CTLR_ADV_ISO
|
depends on BT_CTLR_ADV_ISO
|
||||||
|
|
|
||||||
|
|
@ -1136,7 +1136,9 @@ void radio_tmr_status_reset(void)
|
||||||
{
|
{
|
||||||
nrf_rtc_event_disable(NRF_RTC0, RTC_EVTENCLR_COMPARE2_Msk);
|
nrf_rtc_event_disable(NRF_RTC0, RTC_EVTENCLR_COMPARE2_Msk);
|
||||||
|
|
||||||
|
#if defined(CONFIG_BT_CTLR_LE_ENC) || defined(CONFIG_BT_CTLR_BROADCAST_ISO_ENC)
|
||||||
hal_trigger_crypt_ppi_disable();
|
hal_trigger_crypt_ppi_disable();
|
||||||
|
#endif /* CONFIG_BT_CTLR_LE_ENC || CONFIG_BT_CTLR_BROADCAST_ISO_ENC */
|
||||||
|
|
||||||
hal_radio_nrf_ppi_channels_disable(
|
hal_radio_nrf_ppi_channels_disable(
|
||||||
BIT(HAL_RADIO_ENABLE_TX_ON_TICK_PPI) |
|
BIT(HAL_RADIO_ENABLE_TX_ON_TICK_PPI) |
|
||||||
|
|
@ -1163,14 +1165,19 @@ void radio_tmr_status_reset(void)
|
||||||
#if defined(CONFIG_BT_CTLR_DF_CONN_CTE_RX)
|
#if defined(CONFIG_BT_CTLR_DF_CONN_CTE_RX)
|
||||||
BIT(HAL_TRIGGER_CRYPT_DELAY_PPI) |
|
BIT(HAL_TRIGGER_CRYPT_DELAY_PPI) |
|
||||||
#endif /* CONFIG_BT_CTLR_DF_CONN_CTE_RX */
|
#endif /* CONFIG_BT_CTLR_DF_CONN_CTE_RX */
|
||||||
BIT(HAL_TRIGGER_CRYPT_PPI));
|
#if defined(CONFIG_BT_CTLR_LE_ENC) || defined(CONFIG_BT_CTLR_BROADCAST_ISO_ENC)
|
||||||
|
BIT(HAL_TRIGGER_CRYPT_PPI) |
|
||||||
|
#endif /* CONFIG_BT_CTLR_LE_ENC || CONFIG_BT_CTLR_BROADCAST_ISO_ENC */
|
||||||
|
0);
|
||||||
}
|
}
|
||||||
|
|
||||||
void radio_tmr_tx_status_reset(void)
|
void radio_tmr_tx_status_reset(void)
|
||||||
{
|
{
|
||||||
nrf_rtc_event_disable(NRF_RTC0, RTC_EVTENCLR_COMPARE2_Msk);
|
nrf_rtc_event_disable(NRF_RTC0, RTC_EVTENCLR_COMPARE2_Msk);
|
||||||
|
|
||||||
|
#if defined(CONFIG_BT_CTLR_LE_ENC) || defined(CONFIG_BT_CTLR_BROADCAST_ISO_ENC)
|
||||||
hal_trigger_crypt_ppi_disable();
|
hal_trigger_crypt_ppi_disable();
|
||||||
|
#endif /* CONFIG_BT_CTLR_LE_ENC || CONFIG_BT_CTLR_BROADCAST_ISO_ENC */
|
||||||
|
|
||||||
hal_radio_nrf_ppi_channels_disable(
|
hal_radio_nrf_ppi_channels_disable(
|
||||||
#if (HAL_RADIO_ENABLE_TX_ON_TICK_PPI != HAL_RADIO_ENABLE_RX_ON_TICK_PPI) && \
|
#if (HAL_RADIO_ENABLE_TX_ON_TICK_PPI != HAL_RADIO_ENABLE_RX_ON_TICK_PPI) && \
|
||||||
|
|
@ -1201,14 +1208,19 @@ void radio_tmr_tx_status_reset(void)
|
||||||
#if defined(CONFIG_BT_CTLR_DF_CONN_CTE_RX)
|
#if defined(CONFIG_BT_CTLR_DF_CONN_CTE_RX)
|
||||||
BIT(HAL_TRIGGER_CRYPT_DELAY_PPI) |
|
BIT(HAL_TRIGGER_CRYPT_DELAY_PPI) |
|
||||||
#endif /* CONFIG_BT_CTLR_DF_CONN_CTE_RX */
|
#endif /* CONFIG_BT_CTLR_DF_CONN_CTE_RX */
|
||||||
BIT(HAL_TRIGGER_CRYPT_PPI));
|
#if defined(CONFIG_BT_CTLR_LE_ENC) || defined(CONFIG_BT_CTLR_BROADCAST_ISO_ENC)
|
||||||
|
BIT(HAL_TRIGGER_CRYPT_PPI) |
|
||||||
|
#endif /* CONFIG_BT_CTLR_LE_ENC || CONFIG_BT_CTLR_BROADCAST_ISO_ENC */
|
||||||
|
0);
|
||||||
}
|
}
|
||||||
|
|
||||||
void radio_tmr_rx_status_reset(void)
|
void radio_tmr_rx_status_reset(void)
|
||||||
{
|
{
|
||||||
nrf_rtc_event_disable(NRF_RTC0, RTC_EVTENCLR_COMPARE2_Msk);
|
nrf_rtc_event_disable(NRF_RTC0, RTC_EVTENCLR_COMPARE2_Msk);
|
||||||
|
|
||||||
|
#if defined(CONFIG_BT_CTLR_LE_ENC) || defined(CONFIG_BT_CTLR_BROADCAST_ISO_ENC)
|
||||||
hal_trigger_crypt_ppi_disable();
|
hal_trigger_crypt_ppi_disable();
|
||||||
|
#endif /* CONFIG_BT_CTLR_LE_ENC || CONFIG_BT_CTLR_BROADCAST_ISO_ENC */
|
||||||
|
|
||||||
hal_radio_nrf_ppi_channels_disable(
|
hal_radio_nrf_ppi_channels_disable(
|
||||||
#if (HAL_RADIO_ENABLE_TX_ON_TICK_PPI != HAL_RADIO_ENABLE_RX_ON_TICK_PPI) && \
|
#if (HAL_RADIO_ENABLE_TX_ON_TICK_PPI != HAL_RADIO_ENABLE_RX_ON_TICK_PPI) && \
|
||||||
|
|
@ -1239,7 +1251,10 @@ void radio_tmr_rx_status_reset(void)
|
||||||
#if defined(CONFIG_BT_CTLR_DF_CONN_CTE_RX)
|
#if defined(CONFIG_BT_CTLR_DF_CONN_CTE_RX)
|
||||||
BIT(HAL_TRIGGER_CRYPT_DELAY_PPI) |
|
BIT(HAL_TRIGGER_CRYPT_DELAY_PPI) |
|
||||||
#endif /* CONFIG_BT_CTLR_DF_CONN_CTE_RX */
|
#endif /* CONFIG_BT_CTLR_DF_CONN_CTE_RX */
|
||||||
BIT(HAL_TRIGGER_CRYPT_PPI));
|
#if defined(CONFIG_BT_CTLR_LE_ENC) || defined(CONFIG_BT_CTLR_BROADCAST_ISO_ENC)
|
||||||
|
BIT(HAL_TRIGGER_CRYPT_PPI) |
|
||||||
|
#endif /* CONFIG_BT_CTLR_LE_ENC || CONFIG_BT_CTLR_BROADCAST_ISO_ENC */
|
||||||
|
0);
|
||||||
}
|
}
|
||||||
|
|
||||||
void radio_tmr_tx_enable(void)
|
void radio_tmr_tx_enable(void)
|
||||||
|
|
@ -1739,8 +1754,10 @@ void radio_gpio_pa_lna_disable(void)
|
||||||
}
|
}
|
||||||
#endif /* HAL_RADIO_GPIO_HAVE_PA_PIN || HAL_RADIO_GPIO_HAVE_LNA_PIN */
|
#endif /* HAL_RADIO_GPIO_HAVE_PA_PIN || HAL_RADIO_GPIO_HAVE_LNA_PIN */
|
||||||
|
|
||||||
|
#if defined(CONFIG_BT_CTLR_LE_ENC) || defined(CONFIG_BT_CTLR_BROADCAST_ISO_ENC)
|
||||||
static uint8_t MALIGN(4) _ccm_scratch[(HAL_RADIO_PDU_LEN_MAX - 4) + 16];
|
static uint8_t MALIGN(4) _ccm_scratch[(HAL_RADIO_PDU_LEN_MAX - 4) + 16];
|
||||||
|
|
||||||
|
#if defined(CONFIG_BT_CTLR_LE_ENC) || defined(CONFIG_BT_CTLR_SYNC_ISO)
|
||||||
static void *radio_ccm_ext_rx_pkt_set(struct ccm *cnf, uint8_t phy, uint8_t pdu_type, void *pkt)
|
static void *radio_ccm_ext_rx_pkt_set(struct ccm *cnf, uint8_t phy, uint8_t pdu_type, void *pkt)
|
||||||
{
|
{
|
||||||
uint32_t mode;
|
uint32_t mode;
|
||||||
|
|
@ -1868,7 +1885,9 @@ void *radio_ccm_iso_rx_pkt_set(struct ccm *cnf, uint8_t phy, uint8_t pdu_type, v
|
||||||
{
|
{
|
||||||
return radio_ccm_ext_rx_pkt_set(cnf, phy, pdu_type, pkt);
|
return radio_ccm_ext_rx_pkt_set(cnf, phy, pdu_type, pkt);
|
||||||
}
|
}
|
||||||
|
#endif /* CONFIG_BT_CTLR_LE_ENC || CONFIG_BT_CTLR_SYNC_ISO */
|
||||||
|
|
||||||
|
#if defined(CONFIG_BT_CTLR_LE_ENC) || defined(CONFIG_BT_CTLR_ADV_ISO)
|
||||||
static void *radio_ccm_ext_tx_pkt_set(struct ccm *cnf, uint8_t pdu_type, void *pkt)
|
static void *radio_ccm_ext_tx_pkt_set(struct ccm *cnf, uint8_t pdu_type, void *pkt)
|
||||||
{
|
{
|
||||||
uint32_t mode;
|
uint32_t mode;
|
||||||
|
|
@ -1939,6 +1958,7 @@ void *radio_ccm_iso_tx_pkt_set(struct ccm *cnf, uint8_t pdu_type, void *pkt)
|
||||||
{
|
{
|
||||||
return radio_ccm_ext_tx_pkt_set(cnf, pdu_type, pkt);
|
return radio_ccm_ext_tx_pkt_set(cnf, pdu_type, pkt);
|
||||||
}
|
}
|
||||||
|
#endif /* CONFIG_BT_CTLR_LE_ENC || CONFIG_BT_CTLR_ADV_ISO */
|
||||||
|
|
||||||
uint32_t radio_ccm_is_done(void)
|
uint32_t radio_ccm_is_done(void)
|
||||||
{
|
{
|
||||||
|
|
@ -2086,6 +2106,7 @@ uint8_t radio_ar_resolve(const uint8_t *addr)
|
||||||
|
|
||||||
}
|
}
|
||||||
#endif /* CONFIG_BT_CTLR_PRIVACY */
|
#endif /* CONFIG_BT_CTLR_PRIVACY */
|
||||||
|
#endif /* CONFIG_BT_CTLR_LE_ENC || CONFIG_BT_CTLR_BROADCAST_ISO_ENC */
|
||||||
|
|
||||||
#if defined(CONFIG_BT_CTLR_DF_SUPPORT) && !defined(CONFIG_ZTEST)
|
#if defined(CONFIG_BT_CTLR_DF_SUPPORT) && !defined(CONFIG_ZTEST)
|
||||||
/* @brief Function configures CTE inline register to start sampling of CTE
|
/* @brief Function configures CTE inline register to start sampling of CTE
|
||||||
|
|
|
||||||
|
|
@ -5,6 +5,9 @@
|
||||||
* SPDX-License-Identifier: Apache-2.0
|
* SPDX-License-Identifier: Apache-2.0
|
||||||
*/
|
*/
|
||||||
|
|
||||||
|
/* HAL header files for nRF5x SoCs.
|
||||||
|
* These has to come before the radio_*.h include below.
|
||||||
|
*/
|
||||||
#include <hal/nrf_radio.h>
|
#include <hal/nrf_radio.h>
|
||||||
|
|
||||||
/* Common radio resources */
|
/* Common radio resources */
|
||||||
|
|
@ -44,6 +47,14 @@
|
||||||
#error "Unsupported SoC."
|
#error "Unsupported SoC."
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
|
#include <hal/nrf_rtc.h>
|
||||||
|
#include <hal/nrf_timer.h>
|
||||||
|
|
||||||
|
#if defined(CONFIG_BT_CTLR_LE_ENC) || defined(CONFIG_BT_CTLR_BROADCAST_ISO_ENC)
|
||||||
|
#include <hal/nrf_ccm.h>
|
||||||
|
#include <hal/nrf_aar.h>
|
||||||
|
#endif /* CONFIG_BT_CTLR_LE_ENC || CONFIG_BT_CTLR_BROADCAST_ISO_ENC */
|
||||||
|
|
||||||
/* Define to reset PPI registration.
|
/* Define to reset PPI registration.
|
||||||
* This has to come before the ppi/dppi includes below.
|
* This has to come before the ppi/dppi includes below.
|
||||||
*/
|
*/
|
||||||
|
|
@ -57,10 +68,6 @@
|
||||||
#include "radio_nrf5_ppi_resources.h"
|
#include "radio_nrf5_ppi_resources.h"
|
||||||
#include "radio_nrf5_ppi.h"
|
#include "radio_nrf5_ppi.h"
|
||||||
#elif defined(DPPI_PRESENT)
|
#elif defined(DPPI_PRESENT)
|
||||||
#include <hal/nrf_timer.h>
|
|
||||||
#include <hal/nrf_rtc.h>
|
|
||||||
#include <hal/nrf_aar.h>
|
|
||||||
#include <hal/nrf_ccm.h>
|
|
||||||
#include <hal/nrf_dppi.h>
|
#include <hal/nrf_dppi.h>
|
||||||
#include "radio_nrf5_dppi_resources.h"
|
#include "radio_nrf5_dppi_resources.h"
|
||||||
#include "radio_nrf5_dppi.h"
|
#include "radio_nrf5_dppi.h"
|
||||||
|
|
|
||||||
|
|
@ -113,6 +113,7 @@ static inline void hal_radio_ready_time_capture_ppi_config(void)
|
||||||
NRF_TIMER_TASK_CAPTURE0, HAL_RADIO_READY_TIME_CAPTURE_PPI);
|
NRF_TIMER_TASK_CAPTURE0, HAL_RADIO_READY_TIME_CAPTURE_PPI);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
#if defined(CONFIG_BT_CTLR_LE_ENC) || defined(CONFIG_BT_CTLR_BROADCAST_ISO_ENC)
|
||||||
/*******************************************************************************
|
/*******************************************************************************
|
||||||
* Trigger encryption task upon address reception:
|
* Trigger encryption task upon address reception:
|
||||||
* wire the RADIO EVENTS_ADDRESS event to the CCM TASKS_CRYPT task.
|
* wire the RADIO EVENTS_ADDRESS event to the CCM TASKS_CRYPT task.
|
||||||
|
|
@ -135,6 +136,28 @@ static inline void hal_trigger_crypt_ppi_disable(void)
|
||||||
nrf_ccm_subscribe_clear(NRF_CCM, NRF_CCM_TASK_CRYPT);
|
nrf_ccm_subscribe_clear(NRF_CCM, NRF_CCM_TASK_CRYPT);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/*******************************************************************************
|
||||||
|
* Trigger automatic address resolution on Bit counter match:
|
||||||
|
* wire the RADIO EVENTS_BCMATCH event to the AAR TASKS_START task.
|
||||||
|
*/
|
||||||
|
static inline void hal_trigger_aar_ppi_config(void)
|
||||||
|
{
|
||||||
|
nrf_radio_publish_set(NRF_RADIO, NRF_RADIO_EVENT_BCMATCH, HAL_TRIGGER_AAR_PPI);
|
||||||
|
nrf_aar_subscribe_set(NRF_AAR, NRF_AAR_TASK_START, HAL_TRIGGER_AAR_PPI);
|
||||||
|
}
|
||||||
|
|
||||||
|
#if defined(CONFIG_BT_CTLR_PHY_CODED) && defined(CONFIG_HAS_HW_NRF_RADIO_BLE_CODED)
|
||||||
|
/*******************************************************************************
|
||||||
|
* Trigger Radio Rate override upon Rateboost event.
|
||||||
|
*/
|
||||||
|
static inline void hal_trigger_rateoverride_ppi_config(void)
|
||||||
|
{
|
||||||
|
nrf_radio_publish_set(NRF_RADIO, NRF_RADIO_EVENT_RATEBOOST, HAL_TRIGGER_RATEOVERRIDE_PPI);
|
||||||
|
nrf_ccm_subscribe_set(NRF_CCM, NRF_CCM_TASK_RATEOVERRIDE, HAL_TRIGGER_RATEOVERRIDE_PPI);
|
||||||
|
}
|
||||||
|
#endif /* CONFIG_BT_CTLR_PHY_CODED && CONFIG_HAS_HW_NRF_RADIO_BLE_CODED */
|
||||||
|
#endif /* CONFIG_BT_CTLR_LE_ENC || CONFIG_BT_CTLR_BROADCAST_ISO_ENC */
|
||||||
|
|
||||||
#if defined(CONFIG_BT_CTLR_DF_CONN_CTE_RX)
|
#if defined(CONFIG_BT_CTLR_DF_CONN_CTE_RX)
|
||||||
/*******************************************************************************
|
/*******************************************************************************
|
||||||
* Trigger encryption task on Bit counter match:
|
* Trigger encryption task on Bit counter match:
|
||||||
|
|
@ -161,27 +184,6 @@ static inline void hal_trigger_crypt_by_bcmatch_ppi_config(void)
|
||||||
}
|
}
|
||||||
#endif /* CONFIG_BT_CTLR_DF_CONN_CTE_RX */
|
#endif /* CONFIG_BT_CTLR_DF_CONN_CTE_RX */
|
||||||
|
|
||||||
/*******************************************************************************
|
|
||||||
* Trigger automatic address resolution on Bit counter match:
|
|
||||||
* wire the RADIO EVENTS_BCMATCH event to the AAR TASKS_START task.
|
|
||||||
*/
|
|
||||||
static inline void hal_trigger_aar_ppi_config(void)
|
|
||||||
{
|
|
||||||
nrf_radio_publish_set(NRF_RADIO, NRF_RADIO_EVENT_BCMATCH, HAL_TRIGGER_AAR_PPI);
|
|
||||||
nrf_aar_subscribe_set(NRF_AAR, NRF_AAR_TASK_START, HAL_TRIGGER_AAR_PPI);
|
|
||||||
}
|
|
||||||
|
|
||||||
#if defined(CONFIG_BT_CTLR_PHY_CODED) && defined(CONFIG_HAS_HW_NRF_RADIO_BLE_CODED)
|
|
||||||
/*******************************************************************************
|
|
||||||
* Trigger Radio Rate override upon Rateboost event.
|
|
||||||
*/
|
|
||||||
static inline void hal_trigger_rateoverride_ppi_config(void)
|
|
||||||
{
|
|
||||||
nrf_radio_publish_set(NRF_RADIO, NRF_RADIO_EVENT_RATEBOOST, HAL_TRIGGER_RATEOVERRIDE_PPI);
|
|
||||||
nrf_ccm_subscribe_set(NRF_CCM, NRF_CCM_TASK_RATEOVERRIDE, HAL_TRIGGER_RATEOVERRIDE_PPI);
|
|
||||||
}
|
|
||||||
#endif /* CONFIG_BT_CTLR_PHY_CODED && CONFIG_HAS_HW_NRF_RADIO_BLE_CODED */
|
|
||||||
|
|
||||||
/******************************************************************************/
|
/******************************************************************************/
|
||||||
#if !defined(CONFIG_BT_CTLR_TIFS_HW)
|
#if !defined(CONFIG_BT_CTLR_TIFS_HW)
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -351,7 +351,8 @@ static int prepare_cb_common(struct lll_prepare_param *p)
|
||||||
/* Radio packet configuration */
|
/* Radio packet configuration */
|
||||||
pkt_flags = RADIO_PKT_CONF_FLAGS(RADIO_PKT_CONF_PDU_TYPE_BIS, phy,
|
pkt_flags = RADIO_PKT_CONF_FLAGS(RADIO_PKT_CONF_PDU_TYPE_BIS, phy,
|
||||||
RADIO_PKT_CONF_CTE_DISABLED);
|
RADIO_PKT_CONF_CTE_DISABLED);
|
||||||
if (pdu->len && lll->enc) {
|
if (IS_ENABLED(CONFIG_BT_CTLR_BROADCAST_ISO_ENC) &&
|
||||||
|
pdu->len && lll->enc) {
|
||||||
/* Encryption */
|
/* Encryption */
|
||||||
lll->ccm_tx.counter = payload_count;
|
lll->ccm_tx.counter = payload_count;
|
||||||
|
|
||||||
|
|
@ -698,7 +699,8 @@ static void isr_tx_common(void *param,
|
||||||
lll_chan_set(data_chan_use);
|
lll_chan_set(data_chan_use);
|
||||||
|
|
||||||
/* Encryption */
|
/* Encryption */
|
||||||
if (pdu->len && lll->enc) {
|
if (IS_ENABLED(CONFIG_BT_CTLR_BROADCAST_ISO_ENC) &&
|
||||||
|
pdu->len && lll->enc) {
|
||||||
lll->ccm_tx.counter = payload_count;
|
lll->ccm_tx.counter = payload_count;
|
||||||
|
|
||||||
(void)memcpy(lll->ccm_tx.iv, lll->giv, 4U);
|
(void)memcpy(lll->ccm_tx.iv, lll->giv, 4U);
|
||||||
|
|
|
||||||
|
|
@ -305,7 +305,8 @@ static int prepare_cb_common(struct lll_prepare_param *p)
|
||||||
LL_ASSERT(node_rx);
|
LL_ASSERT(node_rx);
|
||||||
|
|
||||||
/* Encryption */
|
/* Encryption */
|
||||||
if (lll->enc) {
|
if (IS_ENABLED(CONFIG_BT_CTLR_BROADCAST_ISO_ENC) &&
|
||||||
|
lll->enc) {
|
||||||
uint64_t payload_count;
|
uint64_t payload_count;
|
||||||
uint8_t pkt_flags;
|
uint8_t pkt_flags;
|
||||||
|
|
||||||
|
|
@ -619,7 +620,8 @@ static void isr_rx(void *param)
|
||||||
!lll->payload[bis_idx][payload_index]) {
|
!lll->payload[bis_idx][payload_index]) {
|
||||||
uint16_t handle;
|
uint16_t handle;
|
||||||
|
|
||||||
if (lll->enc) {
|
if (IS_ENABLED(CONFIG_BT_CTLR_BROADCAST_ISO_ENC) &&
|
||||||
|
lll->enc) {
|
||||||
uint32_t mic_failure;
|
uint32_t mic_failure;
|
||||||
uint32_t done;
|
uint32_t done;
|
||||||
|
|
||||||
|
|
@ -922,7 +924,8 @@ isr_rx_next_subevent:
|
||||||
lll_chan_set(data_chan_use);
|
lll_chan_set(data_chan_use);
|
||||||
|
|
||||||
/* Encryption */
|
/* Encryption */
|
||||||
if (lll->enc) {
|
if (IS_ENABLED(CONFIG_BT_CTLR_BROADCAST_ISO_ENC) &&
|
||||||
|
lll->enc) {
|
||||||
uint64_t payload_count;
|
uint64_t payload_count;
|
||||||
struct pdu_bis *pdu;
|
struct pdu_bis *pdu;
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -144,6 +144,12 @@ static uint8_t big_create(uint8_t big_handle, uint8_t adv_handle, uint8_t num_bi
|
||||||
return BT_HCI_ERR_UNKNOWN_ADV_IDENTIFIER;
|
return BT_HCI_ERR_UNKNOWN_ADV_IDENTIFIER;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/* Check if encryption supported */
|
||||||
|
if (!IS_ENABLED(CONFIG_BT_CTLR_BROADCAST_ISO_ENC) &&
|
||||||
|
encryption) {
|
||||||
|
return BT_HCI_ERR_CMD_DISALLOWED;
|
||||||
|
};
|
||||||
|
|
||||||
if (IS_ENABLED(CONFIG_BT_CTLR_PARAM_CHECK)) {
|
if (IS_ENABLED(CONFIG_BT_CTLR_PARAM_CHECK)) {
|
||||||
if (num_bis == 0U || num_bis > 0x1F) {
|
if (num_bis == 0U || num_bis > 0x1F) {
|
||||||
return BT_HCI_ERR_INVALID_PARAM;
|
return BT_HCI_ERR_INVALID_PARAM;
|
||||||
|
|
@ -566,7 +572,7 @@ static uint8_t big_create(uint8_t big_handle, uint8_t adv_handle, uint8_t num_bi
|
||||||
big_info->payload_count_framing[4] &= ~BIT(7);
|
big_info->payload_count_framing[4] &= ~BIT(7);
|
||||||
big_info->payload_count_framing[4] |= ((framing & 0x01) << 7);
|
big_info->payload_count_framing[4] |= ((framing & 0x01) << 7);
|
||||||
|
|
||||||
if (encryption) {
|
if (IS_ENABLED(CONFIG_BT_CTLR_BROADCAST_ISO_ENC) && encryption) {
|
||||||
const uint8_t BIG1[16] = {0x31, 0x47, 0x49, 0x42, };
|
const uint8_t BIG1[16] = {0x31, 0x47, 0x49, 0x42, };
|
||||||
const uint8_t BIG2[4] = {0x32, 0x47, 0x49, 0x42};
|
const uint8_t BIG2[4] = {0x32, 0x47, 0x49, 0x42};
|
||||||
const uint8_t BIG3[4] = {0x33, 0x47, 0x49, 0x42};
|
const uint8_t BIG3[4] = {0x33, 0x47, 0x49, 0x42};
|
||||||
|
|
|
||||||
|
|
@ -125,6 +125,12 @@ uint8_t ll_big_sync_create(uint8_t big_handle, uint16_t sync_handle,
|
||||||
last_index = bis[i];
|
last_index = bis[i];
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/* Check if encryption supported */
|
||||||
|
if (!IS_ENABLED(CONFIG_BT_CTLR_BROADCAST_ISO_ENC) &&
|
||||||
|
encryption) {
|
||||||
|
return BT_HCI_ERR_CMD_DISALLOWED;
|
||||||
|
};
|
||||||
|
|
||||||
/* Check if requested encryption matches */
|
/* Check if requested encryption matches */
|
||||||
if (encryption != sync->enc) {
|
if (encryption != sync->enc) {
|
||||||
return BT_HCI_ERR_ENC_MODE_NOT_ACCEPTABLE;
|
return BT_HCI_ERR_ENC_MODE_NOT_ACCEPTABLE;
|
||||||
|
|
@ -470,7 +476,8 @@ void ull_sync_iso_setup(struct ll_sync_iso_set *sync_iso,
|
||||||
/* Set establishment event countdown */
|
/* Set establishment event countdown */
|
||||||
lll->establish_events = CONN_ESTAB_COUNTDOWN;
|
lll->establish_events = CONN_ESTAB_COUNTDOWN;
|
||||||
|
|
||||||
if (lll->enc && (bi_size == PDU_BIG_INFO_ENCRYPTED_SIZE)) {
|
if (IS_ENABLED(CONFIG_BT_CTLR_BROADCAST_ISO_ENC) &&
|
||||||
|
lll->enc && (bi_size == PDU_BIG_INFO_ENCRYPTED_SIZE)) {
|
||||||
const uint8_t BIG3[4] = {0x33, 0x47, 0x49, 0x42};
|
const uint8_t BIG3[4] = {0x33, 0x47, 0x49, 0x42};
|
||||||
struct ccm *ccm_rx;
|
struct ccm *ccm_rx;
|
||||||
uint8_t gsk[16];
|
uint8_t gsk[16];
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue