Bluetooth: Controller: Add Kconfig to enable CTE RX in conn mode
The CTE reception and sampling in connected mode was enabled with CONFIG_BT_CTLR_DF_CONN_CTE_REQ. This is a separate fearure tha can be enabled when CTE reqest procedure is disabled. What more the CONFIG_BT_CTLR_DF_CONN_CTE_REQ is dependent on CONFIG_BT_CTLR_DF_CONN_CTE_RX, not other way around. The commit adds separate Kconfig to provide such possibility. Also changes compilation guards for code related with the CTE reception and sampling. Signed-off-by: Piotr Pryga <piotr.pryga@nordicsemi.no>
This commit is contained in:
parent
4080b03b0b
commit
c5812bab5e
11 changed files with 62 additions and 62 deletions
|
@ -97,7 +97,7 @@ config BT_CTLR_DF_CTE_RX
|
||||||
|
|
||||||
config BT_CTLR_DF_CONN_CTE_REQ
|
config BT_CTLR_DF_CONN_CTE_REQ
|
||||||
bool "Enable Connection CTE Request feature"
|
bool "Enable Connection CTE Request feature"
|
||||||
depends on BT_CTLR_DF_CTE_RX && BT_CONN
|
depends on BT_CTLR_DF_CONN_CTE_RX
|
||||||
help
|
help
|
||||||
Enable support for Bluetooth v5.1 Connection CTE Request feature
|
Enable support for Bluetooth v5.1 Connection CTE Request feature
|
||||||
in controller.
|
in controller.
|
||||||
|
@ -134,13 +134,13 @@ config BT_CTLR_DF_CONN_CTE_TX
|
||||||
Enable transmission of Constant Tone Extension in
|
Enable transmission of Constant Tone Extension in
|
||||||
direction finding connected mode.
|
direction finding connected mode.
|
||||||
|
|
||||||
config BT_CTRL_DF_CONN_CTE_RX
|
config BT_CTLR_DF_CONN_CTE_RX
|
||||||
bool "Enable Connection based CTE Receiver"
|
bool "Enable Connection based CTE Receiver"
|
||||||
depends on BT_CTLR_DF_CTE_RX && BT_CONN
|
depends on BT_CTLR_DF_CTE_RX && BT_CONN
|
||||||
default y
|
default y
|
||||||
help
|
help
|
||||||
Enable reception and sampling of Constant Tone Extension in
|
Enable reception and sampling of Constant Tone Extension in direction
|
||||||
direction finding connected mode.
|
finding connected mode.
|
||||||
|
|
||||||
config BT_CTLR_DF_SAMPLE_CTE_FOR_PDU_WITH_BAD_CRC
|
config BT_CTLR_DF_SAMPLE_CTE_FOR_PDU_WITH_BAD_CRC
|
||||||
bool "Enable sampling of CTE for PDUs with bad CRC"
|
bool "Enable sampling of CTE for PDUs with bad CRC"
|
||||||
|
|
|
@ -2878,7 +2878,7 @@ static void le_df_set_conn_cte_tx_params(struct net_buf *buf,
|
||||||
}
|
}
|
||||||
#endif /* CONFIG_BT_CTLR_DF_CONN_CTE_TX */
|
#endif /* CONFIG_BT_CTLR_DF_CONN_CTE_TX */
|
||||||
|
|
||||||
#if defined(CONFIG_BT_CTRL_DF_CONN_CTE_RX)
|
#if defined(CONFIG_BT_CTLR_DF_CONN_CTE_RX)
|
||||||
static void le_df_set_conn_cte_rx_params(struct net_buf *buf, struct net_buf **evt)
|
static void le_df_set_conn_cte_rx_params(struct net_buf *buf, struct net_buf **evt)
|
||||||
{
|
{
|
||||||
struct bt_hci_cp_le_set_conn_cte_rx_params *cmd = (void *)buf->data;
|
struct bt_hci_cp_le_set_conn_cte_rx_params *cmd = (void *)buf->data;
|
||||||
|
@ -2970,7 +2970,7 @@ static void le_df_connection_iq_report(struct node_rx_pdu *node_rx, struct net_b
|
||||||
sep->sample_count = samples_cnt;
|
sep->sample_count = samples_cnt;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
#endif /* CONFIG_BT_CTRL_DF_CONN_CTE_RX */
|
#endif /* CONFIG_BT_CTLR_DF_CONN_CTE_RX */
|
||||||
|
|
||||||
#if defined(CONFIG_BT_CTLR_DF_CONN_CTE_REQ)
|
#if defined(CONFIG_BT_CTLR_DF_CONN_CTE_REQ)
|
||||||
static void le_df_set_conn_cte_req_enable(struct net_buf *buf, struct net_buf **evt)
|
static void le_df_set_conn_cte_req_enable(struct net_buf *buf, struct net_buf **evt)
|
||||||
|
@ -4355,11 +4355,11 @@ static int controller_cmd_handle(uint16_t ocf, struct net_buf *cmd,
|
||||||
le_df_set_conn_cte_tx_params(cmd, evt);
|
le_df_set_conn_cte_tx_params(cmd, evt);
|
||||||
break;
|
break;
|
||||||
#endif /* CONFIG_BT_CTLR_DF_CONN_CTE_TX */
|
#endif /* CONFIG_BT_CTLR_DF_CONN_CTE_TX */
|
||||||
#if defined(CONFIG_BT_CTRL_DF_CONN_CTE_RX)
|
#if defined(CONFIG_BT_CTLR_DF_CONN_CTE_RX)
|
||||||
case BT_OCF(BT_HCI_OP_LE_SET_CONN_CTE_RX_PARAMS):
|
case BT_OCF(BT_HCI_OP_LE_SET_CONN_CTE_RX_PARAMS):
|
||||||
le_df_set_conn_cte_rx_params(cmd, evt);
|
le_df_set_conn_cte_rx_params(cmd, evt);
|
||||||
break;
|
break;
|
||||||
#endif /* CONFIG_BT_CTRL_DF_CONN_CTE_RX */
|
#endif /* CONFIG_BT_CTLR_DF_CONN_CTE_RX */
|
||||||
#if defined(CONFIG_BT_CTLR_DF_CONN_CTE_REQ)
|
#if defined(CONFIG_BT_CTLR_DF_CONN_CTE_REQ)
|
||||||
case BT_OCF(BT_HCI_OP_LE_CONN_CTE_REQ_ENABLE):
|
case BT_OCF(BT_HCI_OP_LE_CONN_CTE_REQ_ENABLE):
|
||||||
le_df_set_conn_cte_req_enable(cmd, evt);
|
le_df_set_conn_cte_req_enable(cmd, evt);
|
||||||
|
@ -7217,11 +7217,11 @@ static void encode_control(struct node_rx_pdu *node_rx,
|
||||||
return;
|
return;
|
||||||
#endif /* CONFIG_BT_CTLR_CONN_ISO */
|
#endif /* CONFIG_BT_CTLR_CONN_ISO */
|
||||||
|
|
||||||
#if defined(CONFIG_BT_CTRL_DF_CONN_CTE_RX)
|
#if defined(CONFIG_BT_CTLR_DF_CONN_CTE_RX)
|
||||||
case NODE_RX_TYPE_CONN_IQ_SAMPLE_REPORT:
|
case NODE_RX_TYPE_CONN_IQ_SAMPLE_REPORT:
|
||||||
le_df_connection_iq_report(node_rx, buf);
|
le_df_connection_iq_report(node_rx, buf);
|
||||||
return;
|
return;
|
||||||
#endif /* CONFIG_BT_CTRL_DF_CONN_CTE_RX */
|
#endif /* CONFIG_BT_CTLR_DF_CONN_CTE_RX */
|
||||||
#endif /* CONFIG_BT_CONN */
|
#endif /* CONFIG_BT_CONN */
|
||||||
|
|
||||||
#if defined(CONFIG_BT_CTLR_ADV_INDICATION)
|
#if defined(CONFIG_BT_CTLR_ADV_INDICATION)
|
||||||
|
@ -7644,9 +7644,9 @@ uint8_t hci_get_class(struct node_rx_pdu *node_rx)
|
||||||
#if defined(CONFIG_BT_CTLR_CONN_ISO)
|
#if defined(CONFIG_BT_CTLR_CONN_ISO)
|
||||||
case NODE_RX_TYPE_CIS_ESTABLISHED:
|
case NODE_RX_TYPE_CIS_ESTABLISHED:
|
||||||
#endif /* CONFIG_BT_CTLR_CONN_ISO */
|
#endif /* CONFIG_BT_CTLR_CONN_ISO */
|
||||||
#if defined(CONFIG_BT_CTRL_DF_CONN_CTE_RX)
|
#if defined(CONFIG_BT_CTLR_DF_CONN_CTE_RX)
|
||||||
case NODE_RX_TYPE_CONN_IQ_SAMPLE_REPORT:
|
case NODE_RX_TYPE_CONN_IQ_SAMPLE_REPORT:
|
||||||
#endif /* CONFIG_BT_CTRL_DF_CONN_CTE_RX */
|
#endif /* CONFIG_BT_CTLR_DF_CONN_CTE_RX */
|
||||||
return HCI_CLASS_EVT_REQUIRED;
|
return HCI_CLASS_EVT_REQUIRED;
|
||||||
|
|
||||||
case NODE_RX_TYPE_TERMINATE:
|
case NODE_RX_TYPE_TERMINATE:
|
||||||
|
|
|
@ -148,9 +148,9 @@ struct lll_conn {
|
||||||
int8_t tx_pwr_lvl;
|
int8_t tx_pwr_lvl;
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
#if defined(CONFIG_BT_CTRL_DF_CONN_CTE_RX)
|
#if defined(CONFIG_BT_CTLR_DF_CONN_CTE_RX)
|
||||||
struct lll_df_conn_rx_cfg df_rx_cfg;
|
struct lll_df_conn_rx_cfg df_rx_cfg;
|
||||||
#endif /* CONFIG_BT_CTRL_DF_CONN_CTE_RX */
|
#endif /* CONFIG_BT_CTLR_DF_CONN_CTE_RX */
|
||||||
#if defined(CONFIG_BT_CTLR_DF_CONN_CTE_TX)
|
#if defined(CONFIG_BT_CTLR_DF_CONN_CTE_TX)
|
||||||
struct lll_df_conn_tx_cfg df_tx_cfg;
|
struct lll_df_conn_tx_cfg df_tx_cfg;
|
||||||
#endif /* CONFIG_BT_CTLR_DF_CONN_CTE_TX */
|
#endif /* CONFIG_BT_CTLR_DF_CONN_CTE_TX */
|
||||||
|
|
|
@ -88,10 +88,10 @@ static int init_reset(void)
|
||||||
|
|
||||||
static int prepare_cb(struct lll_prepare_param *p)
|
static int prepare_cb(struct lll_prepare_param *p)
|
||||||
{
|
{
|
||||||
#if defined(CONFIG_BT_CTRL_DF_CONN_CTE_RX)
|
#if defined(CONFIG_BT_CTLR_DF_CONN_CTE_RX)
|
||||||
struct lll_df_conn_rx_params *df_rx_params;
|
struct lll_df_conn_rx_params *df_rx_params;
|
||||||
struct lll_df_conn_rx_cfg *df_rx_cfg;
|
struct lll_df_conn_rx_cfg *df_rx_cfg;
|
||||||
#endif /* CONFIG_BT_CTRL_DF_CONN_CTE_RX */
|
#endif /* CONFIG_BT_CTLR_DF_CONN_CTE_RX */
|
||||||
struct pdu_data *pdu_data_tx;
|
struct pdu_data *pdu_data_tx;
|
||||||
uint32_t ticks_at_event;
|
uint32_t ticks_at_event;
|
||||||
uint32_t ticks_at_start;
|
uint32_t ticks_at_start;
|
||||||
|
@ -184,7 +184,7 @@ static int prepare_cb(struct lll_prepare_param *p)
|
||||||
|
|
||||||
radio_tmr_tifs_set(EVENT_IFS_US);
|
radio_tmr_tifs_set(EVENT_IFS_US);
|
||||||
|
|
||||||
#if defined(CONFIG_BT_CTRL_DF_CONN_CTE_RX)
|
#if defined(CONFIG_BT_CTLR_DF_CONN_CTE_RX)
|
||||||
/* If CTE RX is enabled and the PHY is not CODED, store channel used for
|
/* If CTE RX is enabled and the PHY is not CODED, store channel used for
|
||||||
* the connection event to report it with collected IQ samples.
|
* the connection event to report it with collected IQ samples.
|
||||||
* The configuration of the CTE receive may not change during the event,
|
* The configuration of the CTE receive may not change during the event,
|
||||||
|
@ -198,7 +198,7 @@ static int prepare_cb(struct lll_prepare_param *p)
|
||||||
lll->df_rx_cfg.chan = data_chan_use;
|
lll->df_rx_cfg.chan = data_chan_use;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
#endif /* CONFIG_BT_CTRL_DF_CONN_CTE_RX */
|
#endif /* CONFIG_BT_CTLR_DF_CONN_CTE_RX */
|
||||||
|
|
||||||
#if defined(CONFIG_BT_CTLR_PHY)
|
#if defined(CONFIG_BT_CTLR_PHY)
|
||||||
radio_switch_complete_and_rx(lll->phy_rx);
|
radio_switch_complete_and_rx(lll->phy_rx);
|
||||||
|
|
|
@ -48,10 +48,10 @@ static inline int isr_rx_pdu(struct lll_conn *lll, struct pdu_data *pdu_data_rx,
|
||||||
uint8_t *is_rx_enqueue,
|
uint8_t *is_rx_enqueue,
|
||||||
struct node_tx **tx_release, uint8_t *is_done);
|
struct node_tx **tx_release, uint8_t *is_done);
|
||||||
static void empty_tx_init(void);
|
static void empty_tx_init(void);
|
||||||
#if defined(CONFIG_BT_CTRL_DF_CONN_CTE_RX)
|
#if defined(CONFIG_BT_CTLR_DF_CONN_CTE_RX)
|
||||||
static inline bool create_iq_report(struct lll_conn *lll, uint8_t rssi_ready,
|
static inline bool create_iq_report(struct lll_conn *lll, uint8_t rssi_ready,
|
||||||
uint8_t packet_status);
|
uint8_t packet_status);
|
||||||
#endif /* CONFIG_BT_CTRL_DF_CONN_CTE_RX */
|
#endif /* CONFIG_BT_CTLR_DF_CONN_CTE_RX */
|
||||||
#if defined(CONFIG_BT_CTLR_DF_CONN_CTE_TX)
|
#if defined(CONFIG_BT_CTLR_DF_CONN_CTE_TX)
|
||||||
static struct pdu_data *get_last_tx_pdu(struct lll_conn *lll);
|
static struct pdu_data *get_last_tx_pdu(struct lll_conn *lll);
|
||||||
#endif /* CONFIG_BT_CTLR_DF_CONN_CTE_TX */
|
#endif /* CONFIG_BT_CTLR_DF_CONN_CTE_TX */
|
||||||
|
@ -195,9 +195,9 @@ void lll_conn_isr_rx(void *param)
|
||||||
uint8_t is_done;
|
uint8_t is_done;
|
||||||
uint8_t cte_len;
|
uint8_t cte_len;
|
||||||
uint8_t crc_ok;
|
uint8_t crc_ok;
|
||||||
#if defined(CONFIG_BT_CTRL_DF_CONN_CTE_RX)
|
#if defined(CONFIG_BT_CTLR_DF_CONN_CTE_RX)
|
||||||
bool cte_ready;
|
bool cte_ready;
|
||||||
#endif /* CONFIG_BT_CTRL_DF_CONN_CTE_RX */
|
#endif /* CONFIG_BT_CTLR_DF_CONN_CTE_RX */
|
||||||
|
|
||||||
if (IS_ENABLED(CONFIG_BT_CTLR_PROFILE_ISR)) {
|
if (IS_ENABLED(CONFIG_BT_CTLR_PROFILE_ISR)) {
|
||||||
lll_prof_latency_capture();
|
lll_prof_latency_capture();
|
||||||
|
@ -208,15 +208,15 @@ void lll_conn_isr_rx(void *param)
|
||||||
if (trx_done) {
|
if (trx_done) {
|
||||||
crc_ok = radio_crc_is_valid();
|
crc_ok = radio_crc_is_valid();
|
||||||
rssi_ready = radio_rssi_is_ready();
|
rssi_ready = radio_rssi_is_ready();
|
||||||
#if defined(CONFIG_BT_CTRL_DF_CONN_CTE_RX)
|
#if defined(CONFIG_BT_CTLR_DF_CONN_CTE_RX)
|
||||||
cte_ready = radio_df_cte_ready();
|
cte_ready = radio_df_cte_ready();
|
||||||
|
|
||||||
#endif /* CONFIG_BT_CTRL_DF_CONN_CTE_RX */
|
#endif /* CONFIG_BT_CTLR_DF_CONN_CTE_RX */
|
||||||
} else {
|
} else {
|
||||||
crc_ok = rssi_ready = 0U;
|
crc_ok = rssi_ready = 0U;
|
||||||
#if defined(CONFIG_BT_CTRL_DF_CONN_CTE_RX)
|
#if defined(CONFIG_BT_CTLR_DF_CONN_CTE_RX)
|
||||||
cte_ready = 0U;
|
cte_ready = 0U;
|
||||||
#endif /* CONFIG_BT_CTRL_DF_CONN_CTE_RX */
|
#endif /* CONFIG_BT_CTLR_DF_CONN_CTE_RX */
|
||||||
}
|
}
|
||||||
|
|
||||||
/* Clear radio rx status and events */
|
/* Clear radio rx status and events */
|
||||||
|
@ -406,7 +406,7 @@ lll_conn_isr_rx_exit:
|
||||||
is_ull_rx = 1U;
|
is_ull_rx = 1U;
|
||||||
}
|
}
|
||||||
|
|
||||||
#if defined(CONFIG_BT_CTRL_DF_CONN_CTE_RX)
|
#if defined(CONFIG_BT_CTLR_DF_CONN_CTE_RX)
|
||||||
if (cte_ready) {
|
if (cte_ready) {
|
||||||
is_iq_report =
|
is_iq_report =
|
||||||
create_iq_report(lll, rssi_ready,
|
create_iq_report(lll, rssi_ready,
|
||||||
|
@ -415,7 +415,7 @@ lll_conn_isr_rx_exit:
|
||||||
} else {
|
} else {
|
||||||
#else
|
#else
|
||||||
if (1) {
|
if (1) {
|
||||||
#endif /* CONFIG_BT_CTRL_DF_CONN_CTE_RX */
|
#endif /* CONFIG_BT_CTLR_DF_CONN_CTE_RX */
|
||||||
is_iq_report = false;
|
is_iq_report = false;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -467,7 +467,7 @@ void lll_conn_isr_tx(void *param)
|
||||||
|
|
||||||
lll = param;
|
lll = param;
|
||||||
|
|
||||||
#if defined(CONFIG_BT_CTRL_DF_CONN_CTE_RX)
|
#if defined(CONFIG_BT_CTLR_DF_CONN_CTE_RX)
|
||||||
#if defined(CONFIG_BT_CTLR_DF_PHYEND_OFFSET_COMPENSATION_ENABLE)
|
#if defined(CONFIG_BT_CTLR_DF_PHYEND_OFFSET_COMPENSATION_ENABLE)
|
||||||
enum radio_end_evt_delay_state end_evt_delay;
|
enum radio_end_evt_delay_state end_evt_delay;
|
||||||
#endif /* CONFIG_BT_CTLR_DF_PHYEND_OFFSET_COMPENSATION_ENABLE */
|
#endif /* CONFIG_BT_CTLR_DF_PHYEND_OFFSET_COMPENSATION_ENABLE */
|
||||||
|
@ -506,7 +506,7 @@ void lll_conn_isr_tx(void *param)
|
||||||
#endif /* !CONFIG_BT_CTLR_PHY */
|
#endif /* !CONFIG_BT_CTLR_PHY */
|
||||||
|
|
||||||
#endif /* CONFIG_BT_CTLR_DF_PHYEND_OFFSET_COMPENSATION_ENABLE */
|
#endif /* CONFIG_BT_CTLR_DF_PHYEND_OFFSET_COMPENSATION_ENABLE */
|
||||||
#endif /* CONFIG_BT_CTRL_DF_CONN_CTE_RX */
|
#endif /* CONFIG_BT_CTLR_DF_CONN_CTE_RX */
|
||||||
|
|
||||||
/* Use regular API for cases when:
|
/* Use regular API for cases when:
|
||||||
* - CTE RX is not enabled,
|
* - CTE RX is not enabled,
|
||||||
|
@ -554,13 +554,13 @@ void lll_conn_isr_tx(void *param)
|
||||||
|
|
||||||
radio_tmr_hcto_configure(hcto);
|
radio_tmr_hcto_configure(hcto);
|
||||||
|
|
||||||
#if defined(CONFIG_BT_CTRL_DF_CONN_CTE_RX)
|
#if defined(CONFIG_BT_CTLR_DF_CONN_CTE_RX)
|
||||||
if (true) {
|
if (true) {
|
||||||
#elif defined(CONFIG_BT_CENTRAL) && defined(CONFIG_BT_CTLR_CONN_RSSI)
|
#elif defined(CONFIG_BT_CENTRAL) && defined(CONFIG_BT_CTLR_CONN_RSSI)
|
||||||
if (!trx_cnt && !lll->role) {
|
if (!trx_cnt && !lll->role) {
|
||||||
#else
|
#else
|
||||||
if (false) {
|
if (false) {
|
||||||
#endif /* CONFIG_BT_CTRL_DF_CONN_CTE_RX */
|
#endif /* CONFIG_BT_CTLR_DF_CONN_CTE_RX */
|
||||||
|
|
||||||
radio_rssi_measure();
|
radio_rssi_measure();
|
||||||
}
|
}
|
||||||
|
@ -1014,7 +1014,7 @@ static void empty_tx_init(void)
|
||||||
*/
|
*/
|
||||||
}
|
}
|
||||||
|
|
||||||
#if defined(CONFIG_BT_CTRL_DF_CONN_CTE_RX)
|
#if defined(CONFIG_BT_CTLR_DF_CONN_CTE_RX)
|
||||||
static inline bool create_iq_report(struct lll_conn *lll, uint8_t rssi_ready, uint8_t packet_status)
|
static inline bool create_iq_report(struct lll_conn *lll, uint8_t rssi_ready, uint8_t packet_status)
|
||||||
{
|
{
|
||||||
struct lll_df_conn_rx_params *rx_params;
|
struct lll_df_conn_rx_params *rx_params;
|
||||||
|
@ -1057,7 +1057,7 @@ static inline bool create_iq_report(struct lll_conn *lll, uint8_t rssi_ready, ui
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
#endif /* CONFIG_BT_CTRL_DF_CONN_CTE_RX */
|
#endif /* CONFIG_BT_CTLR_DF_CONN_CTE_RX */
|
||||||
|
|
||||||
#if defined(CONFIG_BT_CTLR_DF_CONN_CTE_TX)
|
#if defined(CONFIG_BT_CTLR_DF_CONN_CTE_TX)
|
||||||
/**
|
/**
|
||||||
|
|
|
@ -225,7 +225,7 @@ struct lll_df_sync_cfg *lll_df_sync_cfg_latest_get(struct lll_df_sync *df_cfg,
|
||||||
}
|
}
|
||||||
#endif /* CONFIG_BT_CTLR_DF_SCAN_CTE_RX */
|
#endif /* CONFIG_BT_CTLR_DF_SCAN_CTE_RX */
|
||||||
|
|
||||||
#if defined(CONFIG_BT_CTLR_DF_SCAN_CTE_RX) || defined(CONFIG_BT_CTRL_DF_CONN_CTE_RX)
|
#if defined(CONFIG_BT_CTLR_DF_SCAN_CTE_RX) || defined(CONFIG_BT_CTLR_DF_CONN_CTE_RX)
|
||||||
/* @brief Function initializes reception of Constant Tone Extension.
|
/* @brief Function initializes reception of Constant Tone Extension.
|
||||||
*
|
*
|
||||||
* @param slot_duration Switching and sampling slots duration (1us or 2us).
|
* @param slot_duration Switching and sampling slots duration (1us or 2us).
|
||||||
|
@ -264,9 +264,9 @@ void lll_df_conf_cte_rx_enable(uint8_t slot_duration, uint8_t ant_num, const uin
|
||||||
radio_df_iq_data_packet_set(node_rx->pdu, IQ_SAMPLE_TOTAL_CNT);
|
radio_df_iq_data_packet_set(node_rx->pdu, IQ_SAMPLE_TOTAL_CNT);
|
||||||
node_rx->chan_idx = chan_idx;
|
node_rx->chan_idx = chan_idx;
|
||||||
}
|
}
|
||||||
#endif /* CONFIG_BT_CTLR_DF_SCAN_CTE_RX || CONFIG_BT_CTRL_DF_CONN_CTE_RX */
|
#endif /* CONFIG_BT_CTLR_DF_SCAN_CTE_RX || CONFIG_BT_CTLR_DF_CONN_CTE_RX */
|
||||||
|
|
||||||
#if defined(CONFIG_BT_CTRL_DF_CONN_CTE_RX)
|
#if defined(CONFIG_BT_CTLR_DF_CONN_CTE_RX)
|
||||||
/**
|
/**
|
||||||
* @brief Function initializes parsing of received PDU for CTEInfo.
|
* @brief Function initializes parsing of received PDU for CTEInfo.
|
||||||
*
|
*
|
||||||
|
@ -293,7 +293,7 @@ void lll_df_conf_cte_info_parsing_enable(void)
|
||||||
/* Do not set storage for IQ samples, it is irrelevant for parsing of a PDU for CTEInfo. */
|
/* Do not set storage for IQ samples, it is irrelevant for parsing of a PDU for CTEInfo. */
|
||||||
radio_df_iq_data_packet_set(NULL, 0);
|
radio_df_iq_data_packet_set(NULL, 0);
|
||||||
}
|
}
|
||||||
#endif /* CONFIG_BT_CTRL_DF_CONN_CTE_RX */
|
#endif /* CONFIG_BT_CTLR_DF_CONN_CTE_RX */
|
||||||
|
|
||||||
/* @brief Function performs common steps for initialization and reset
|
/* @brief Function performs common steps for initialization and reset
|
||||||
* of Direction Finding LLL module.
|
* of Direction Finding LLL module.
|
||||||
|
|
|
@ -101,10 +101,10 @@ static int init_reset(void)
|
||||||
|
|
||||||
static int prepare_cb(struct lll_prepare_param *p)
|
static int prepare_cb(struct lll_prepare_param *p)
|
||||||
{
|
{
|
||||||
#if defined(CONFIG_BT_CTRL_DF_CONN_CTE_RX)
|
#if defined(CONFIG_BT_CTLR_DF_CONN_CTE_RX)
|
||||||
struct lll_df_conn_rx_params *df_rx_params;
|
struct lll_df_conn_rx_params *df_rx_params;
|
||||||
struct lll_df_conn_rx_cfg *df_rx_cfg;
|
struct lll_df_conn_rx_cfg *df_rx_cfg;
|
||||||
#endif /* CONFIG_BT_CTRL_DF_CONN_CTE_RX */
|
#endif /* CONFIG_BT_CTLR_DF_CONN_CTE_RX */
|
||||||
uint32_t ticks_at_event;
|
uint32_t ticks_at_event;
|
||||||
uint32_t ticks_at_start;
|
uint32_t ticks_at_start;
|
||||||
uint16_t event_counter;
|
uint16_t event_counter;
|
||||||
|
@ -213,7 +213,7 @@ static int prepare_cb(struct lll_prepare_param *p)
|
||||||
|
|
||||||
radio_tmr_tifs_set(EVENT_IFS_US);
|
radio_tmr_tifs_set(EVENT_IFS_US);
|
||||||
|
|
||||||
#if defined(CONFIG_BT_CTRL_DF_CONN_CTE_RX)
|
#if defined(CONFIG_BT_CTLR_DF_CONN_CTE_RX)
|
||||||
#if defined(CONFIG_BT_CTLR_DF_PHYEND_OFFSET_COMPENSATION_ENABLE)
|
#if defined(CONFIG_BT_CTLR_DF_PHYEND_OFFSET_COMPENSATION_ENABLE)
|
||||||
enum radio_end_evt_delay_state end_evt_delay;
|
enum radio_end_evt_delay_state end_evt_delay;
|
||||||
#endif /* CONFIG_BT_CTLR_DF_PHYEND_OFFSET_COMPENSATION_ENABLE */
|
#endif /* CONFIG_BT_CTLR_DF_PHYEND_OFFSET_COMPENSATION_ENABLE */
|
||||||
|
@ -247,7 +247,7 @@ static int prepare_cb(struct lll_prepare_param *p)
|
||||||
#endif /* !CONFIG_BT_CTLR_PHY */
|
#endif /* !CONFIG_BT_CTLR_PHY */
|
||||||
|
|
||||||
#endif /* CONFIG_BT_CTLR_DF_PHYEND_OFFSET_COMPENSATION_ENABLE */
|
#endif /* CONFIG_BT_CTLR_DF_PHYEND_OFFSET_COMPENSATION_ENABLE */
|
||||||
#endif /* CONFIG_BT_CTRL_DF_CONN_CTE_RX */
|
#endif /* CONFIG_BT_CTLR_DF_CONN_CTE_RX */
|
||||||
|
|
||||||
/* Use regular API for cases when:
|
/* Use regular API for cases when:
|
||||||
* - CTE RX is not enabled,
|
* - CTE RX is not enabled,
|
||||||
|
|
|
@ -1202,9 +1202,9 @@ void ll_rx_dequeue(void)
|
||||||
case NODE_RX_TYPE_SYNC_IQ_SAMPLE_REPORT:
|
case NODE_RX_TYPE_SYNC_IQ_SAMPLE_REPORT:
|
||||||
#endif /* CONFIG_BT_CTLR_DF_SCAN_CTE_RX */
|
#endif /* CONFIG_BT_CTLR_DF_SCAN_CTE_RX */
|
||||||
|
|
||||||
#if defined(CONFIG_BT_CTRL_DF_CONN_CTE_RX)
|
#if defined(CONFIG_BT_CTLR_DF_CONN_CTE_RX)
|
||||||
case NODE_RX_TYPE_CONN_IQ_SAMPLE_REPORT:
|
case NODE_RX_TYPE_CONN_IQ_SAMPLE_REPORT:
|
||||||
#endif /* CONFIG_BT_CTRL_DF_CONN_CTE_RX */
|
#endif /* CONFIG_BT_CTLR_DF_CONN_CTE_RX */
|
||||||
|
|
||||||
/* Ensure that at least one 'case' statement is present for this
|
/* Ensure that at least one 'case' statement is present for this
|
||||||
* code block.
|
* code block.
|
||||||
|
@ -1479,7 +1479,7 @@ void ll_rx_mem_release(void **node_rx)
|
||||||
#endif /* CONFIG_BT_CTLR_SYNC_ISO */
|
#endif /* CONFIG_BT_CTLR_SYNC_ISO */
|
||||||
#endif /* CONFIG_BT_CTLR_SYNC_PERIODIC */
|
#endif /* CONFIG_BT_CTLR_SYNC_PERIODIC */
|
||||||
|
|
||||||
#if defined(CONFIG_BT_CTLR_DF_SCAN_CTE_RX) || defined(CONFIG_BT_CTRL_DF_CONN_CTE_RX)
|
#if defined(CONFIG_BT_CTLR_DF_SCAN_CTE_RX) || defined(CONFIG_BT_CTLR_DF_CONN_CTE_RX)
|
||||||
case NODE_RX_TYPE_SYNC_IQ_SAMPLE_REPORT:
|
case NODE_RX_TYPE_SYNC_IQ_SAMPLE_REPORT:
|
||||||
case NODE_RX_TYPE_CONN_IQ_SAMPLE_REPORT:
|
case NODE_RX_TYPE_CONN_IQ_SAMPLE_REPORT:
|
||||||
{
|
{
|
||||||
|
@ -1490,7 +1490,7 @@ void ll_rx_mem_release(void **node_rx)
|
||||||
ull_df_rx_iq_report_alloc(report_cnt);
|
ull_df_rx_iq_report_alloc(report_cnt);
|
||||||
}
|
}
|
||||||
break;
|
break;
|
||||||
#endif /* CONFIG_BT_CTLR_DF_SCAN_CTE_RX || CONFIG_BT_CTRL_DF_CONN_CTE_RX */
|
#endif /* CONFIG_BT_CTLR_DF_SCAN_CTE_RX || CONFIG_BT_CTLR_DF_CONN_CTE_RX */
|
||||||
|
|
||||||
#if defined(CONFIG_BT_CONN) || defined(CONFIG_BT_CTLR_CONN_ISO)
|
#if defined(CONFIG_BT_CONN) || defined(CONFIG_BT_CTLR_CONN_ISO)
|
||||||
case NODE_RX_TYPE_TERMINATE:
|
case NODE_RX_TYPE_TERMINATE:
|
||||||
|
@ -2441,7 +2441,7 @@ static inline int rx_demux_rx(memq_link_t *link, struct node_rx_hdr *rx)
|
||||||
#endif /* CONFIG_BT_CTLR_ADV_EXT */
|
#endif /* CONFIG_BT_CTLR_ADV_EXT */
|
||||||
#endif /* CONFIG_BT_OBSERVER */
|
#endif /* CONFIG_BT_OBSERVER */
|
||||||
|
|
||||||
#if defined(CONFIG_BT_CTLR_DF_SCAN_CTE_RX) || defined(CONFIG_BT_CTRL_DF_CONN_CTE_RX)
|
#if defined(CONFIG_BT_CTLR_DF_SCAN_CTE_RX) || defined(CONFIG_BT_CTLR_DF_CONN_CTE_RX)
|
||||||
case NODE_RX_TYPE_SYNC_IQ_SAMPLE_REPORT:
|
case NODE_RX_TYPE_SYNC_IQ_SAMPLE_REPORT:
|
||||||
case NODE_RX_TYPE_CONN_IQ_SAMPLE_REPORT:
|
case NODE_RX_TYPE_CONN_IQ_SAMPLE_REPORT:
|
||||||
{
|
{
|
||||||
|
@ -2450,7 +2450,7 @@ static inline int rx_demux_rx(memq_link_t *link, struct node_rx_hdr *rx)
|
||||||
ll_rx_sched();
|
ll_rx_sched();
|
||||||
}
|
}
|
||||||
break;
|
break;
|
||||||
#endif /* CONFIG_BT_CTLR_DF_SCAN_CTE_RX || CONFIG_BT_CTRL_DF_CONN_CTE_RX */
|
#endif /* CONFIG_BT_CTLR_DF_SCAN_CTE_RX || CONFIG_BT_CTLR_DF_CONN_CTE_RX */
|
||||||
|
|
||||||
#if defined(CONFIG_BT_CONN)
|
#if defined(CONFIG_BT_CONN)
|
||||||
case NODE_RX_TYPE_CONNECTION:
|
case NODE_RX_TYPE_CONNECTION:
|
||||||
|
|
|
@ -1025,9 +1025,9 @@ uint8_t ll_adv_enable(uint8_t enable)
|
||||||
#if defined(CONFIG_BT_CTLR_CONN_META)
|
#if defined(CONFIG_BT_CTLR_CONN_META)
|
||||||
memset(&conn_lll->conn_meta, 0, sizeof(conn_lll->conn_meta));
|
memset(&conn_lll->conn_meta, 0, sizeof(conn_lll->conn_meta));
|
||||||
#endif /* CONFIG_BT_CTLR_CONN_META */
|
#endif /* CONFIG_BT_CTLR_CONN_META */
|
||||||
#if defined(CONFIG_BT_CTRL_DF_CONN_CTE_RX)
|
#if defined(CONFIG_BT_CTLR_DF_CONN_CTE_RX)
|
||||||
conn_lll->df_rx_cfg.hdr.elem_size = sizeof(struct lll_df_conn_rx_params);
|
conn_lll->df_rx_cfg.hdr.elem_size = sizeof(struct lll_df_conn_rx_params);
|
||||||
#endif /* CONFIG_BT_CTRL_DF_CONN_CTE_RX */
|
#endif /* CONFIG_BT_CTLR_DF_CONN_CTE_RX */
|
||||||
|
|
||||||
conn->connect_expire = 6;
|
conn->connect_expire = 6;
|
||||||
conn->supervision_expire = 0;
|
conn->supervision_expire = 0;
|
||||||
|
|
|
@ -270,10 +270,10 @@ uint8_t ll_create_connection(uint16_t scan_interval, uint16_t scan_window,
|
||||||
memset(&conn_lll->conn_meta, 0, sizeof(conn_lll->conn_meta));
|
memset(&conn_lll->conn_meta, 0, sizeof(conn_lll->conn_meta));
|
||||||
#endif /* CONFIG_BT_CTLR_CONN_META */
|
#endif /* CONFIG_BT_CTLR_CONN_META */
|
||||||
|
|
||||||
#if defined(CONFIG_BT_CTRL_DF_CONN_CTE_RX)
|
#if defined(CONFIG_BT_CTLR_DF_CONN_CTE_RX)
|
||||||
conn_lll->df_rx_cfg.is_initialized = false;
|
conn_lll->df_rx_cfg.is_initialized = false;
|
||||||
conn_lll->df_rx_cfg.hdr.elem_size = sizeof(struct lll_df_conn_rx_params);
|
conn_lll->df_rx_cfg.hdr.elem_size = sizeof(struct lll_df_conn_rx_params);
|
||||||
#endif /* CONFIG_BT_CTRL_DF_CONN_CTE_RX */
|
#endif /* CONFIG_BT_CTLR_DF_CONN_CTE_RX */
|
||||||
|
|
||||||
conn->connect_expire = CONN_ESTAB_COUNTDOWN;
|
conn->connect_expire = CONN_ESTAB_COUNTDOWN;
|
||||||
conn->supervision_expire = 0U;
|
conn->supervision_expire = 0U;
|
||||||
|
|
|
@ -53,7 +53,7 @@
|
||||||
#include "common/log.h"
|
#include "common/log.h"
|
||||||
#include "hal/debug.h"
|
#include "hal/debug.h"
|
||||||
|
|
||||||
#if defined(CONFIG_BT_CTLR_DF_SCAN_CTE_RX) || defined(CONFIG_BT_CTRL_DF_CONN_CTE_RX)
|
#if defined(CONFIG_BT_CTLR_DF_SCAN_CTE_RX) || defined(CONFIG_BT_CTLR_DF_CONN_CTE_RX)
|
||||||
|
|
||||||
#define CTE_LEN_MAX_US 160U
|
#define CTE_LEN_MAX_US 160U
|
||||||
|
|
||||||
|
@ -76,7 +76,7 @@ static MFIFO_DEFINE(iq_report_free, sizeof(void *), IQ_REPORT_CNT);
|
||||||
|
|
||||||
/* Number of available instance of linked list to be used for node_rx_iq_reports. */
|
/* Number of available instance of linked list to be used for node_rx_iq_reports. */
|
||||||
static uint8_t mem_link_iq_report_quota_pdu;
|
static uint8_t mem_link_iq_report_quota_pdu;
|
||||||
#endif /* CONFIG_BT_CTLR_DF_SCAN_CTE_RX || CONFIG_BT_CTRL_DF_CONN_CTE_RX*/
|
#endif /* CONFIG_BT_CTLR_DF_SCAN_CTE_RX || CONFIG_BT_CTLR_DF_CONN_CTE_RX*/
|
||||||
|
|
||||||
/* ToDo:
|
/* ToDo:
|
||||||
* - Add release of df_adv_cfg when adv_sync is released.
|
* - Add release of df_adv_cfg when adv_sync is released.
|
||||||
|
@ -168,7 +168,7 @@ static int init_reset(void)
|
||||||
&df_adv_cfg_free);
|
&df_adv_cfg_free);
|
||||||
#endif /* CONFIG_BT_CTLR_DF_ADV_CTE_TX */
|
#endif /* CONFIG_BT_CTLR_DF_ADV_CTE_TX */
|
||||||
|
|
||||||
#if defined(CONFIG_BT_CTLR_DF_SCAN_CTE_RX) || defined(CONFIG_BT_CTRL_DF_CONN_CTE_RX)
|
#if defined(CONFIG_BT_CTLR_DF_SCAN_CTE_RX) || defined(CONFIG_BT_CTLR_DF_CONN_CTE_RX)
|
||||||
/* Re-initialize the free IQ report mfifo */
|
/* Re-initialize the free IQ report mfifo */
|
||||||
MFIFO_INIT(iq_report_free);
|
MFIFO_INIT(iq_report_free);
|
||||||
|
|
||||||
|
@ -180,7 +180,7 @@ static int init_reset(void)
|
||||||
/* Allocate free IQ report node rx */
|
/* Allocate free IQ report node rx */
|
||||||
mem_link_iq_report_quota_pdu = IQ_REPORT_CNT;
|
mem_link_iq_report_quota_pdu = IQ_REPORT_CNT;
|
||||||
ull_df_rx_iq_report_alloc(UINT8_MAX);
|
ull_df_rx_iq_report_alloc(UINT8_MAX);
|
||||||
#endif /* CONFIG_BT_CTLR_DF_SCAN_CTE_RX || CONFIG_BT_CTRL_DF_CONN_CTE_RX */
|
#endif /* CONFIG_BT_CTLR_DF_SCAN_CTE_RX || CONFIG_BT_CTLR_DF_CONN_CTE_RX */
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -499,7 +499,7 @@ bool ull_df_sync_cfg_is_not_enabled(struct lll_df_sync *df_cfg)
|
||||||
}
|
}
|
||||||
#endif /* CONFIG_BT_CTLR_DF_SCAN_CTE_RX */
|
#endif /* CONFIG_BT_CTLR_DF_SCAN_CTE_RX */
|
||||||
|
|
||||||
#if defined(CONFIG_BT_CTLR_DF_SCAN_CTE_RX) || defined(CONFIG_BT_CTRL_DF_CONN_CTE_RX)
|
#if defined(CONFIG_BT_CTLR_DF_SCAN_CTE_RX) || defined(CONFIG_BT_CTLR_DF_CONN_CTE_RX)
|
||||||
void *ull_df_iq_report_alloc_peek(uint8_t count)
|
void *ull_df_iq_report_alloc_peek(uint8_t count)
|
||||||
{
|
{
|
||||||
if (count > MFIFO_AVAIL_COUNT_GET(iq_report_free)) {
|
if (count > MFIFO_AVAIL_COUNT_GET(iq_report_free)) {
|
||||||
|
@ -560,9 +560,9 @@ void ull_df_rx_iq_report_alloc(uint8_t max)
|
||||||
ull_iq_report_link_inc_quota(-1);
|
ull_iq_report_link_inc_quota(-1);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
#endif /* CONFIG_BT_CTLR_DF_SCAN_CTE_RX || CONFIG_BT_CTRL_DF_CONN_CTE_RX */
|
#endif /* CONFIG_BT_CTLR_DF_SCAN_CTE_RX || CONFIG_BT_CTLR_DF_CONN_CTE_RX */
|
||||||
|
|
||||||
#if defined(CONFIG_BT_CTRL_DF_CONN_CTE_RX)
|
#if defined(CONFIG_BT_CTLR_DF_CONN_CTE_RX)
|
||||||
bool ull_df_conn_cfg_is_not_enabled(struct lll_df_conn_rx_cfg *rx_cfg)
|
bool ull_df_conn_cfg_is_not_enabled(struct lll_df_conn_rx_cfg *rx_cfg)
|
||||||
{
|
{
|
||||||
struct lll_df_conn_rx_params *rx_params;
|
struct lll_df_conn_rx_params *rx_params;
|
||||||
|
@ -582,7 +582,7 @@ bool ull_df_conn_cfg_is_not_enabled(struct lll_df_conn_rx_cfg *rx_cfg)
|
||||||
|
|
||||||
return !rx_params->is_enabled;
|
return !rx_params->is_enabled;
|
||||||
}
|
}
|
||||||
#endif /* CONFIG_BT_CTRL_DF_CONN_CTE_RX */
|
#endif /* CONFIG_BT_CTLR_DF_CONN_CTE_RX */
|
||||||
|
|
||||||
#if defined(CONFIG_BT_CTLR_DF_ADV_CTE_TX)
|
#if defined(CONFIG_BT_CTLR_DF_ADV_CTE_TX)
|
||||||
/* @brief Function releases unused memory for DF advertising configuration.
|
/* @brief Function releases unused memory for DF advertising configuration.
|
||||||
|
@ -1049,7 +1049,7 @@ uint8_t ll_df_set_conn_cte_tx_params(uint16_t handle, uint8_t cte_types, uint8_t
|
||||||
}
|
}
|
||||||
#endif /* CONFIG_BT_CTLR_DF_CONN_CTE_TX */
|
#endif /* CONFIG_BT_CTLR_DF_CONN_CTE_TX */
|
||||||
|
|
||||||
#if defined(CONFIG_BT_CTRL_DF_CONN_CTE_RX)
|
#if defined(CONFIG_BT_CTLR_DF_CONN_CTE_RX)
|
||||||
/**
|
/**
|
||||||
* @brief Function sets CTE reception parameters for a connection.
|
* @brief Function sets CTE reception parameters for a connection.
|
||||||
*
|
*
|
||||||
|
@ -1118,7 +1118,7 @@ uint8_t ll_df_set_conn_cte_rx_params(uint16_t handle, uint8_t sampling_enable,
|
||||||
|
|
||||||
return BT_HCI_ERR_SUCCESS;
|
return BT_HCI_ERR_SUCCESS;
|
||||||
}
|
}
|
||||||
#endif /* CONFIG_BT_CTRL_DF_CONN_CTE_RX */
|
#endif /* CONFIG_BT_CTLR_DF_CONN_CTE_RX */
|
||||||
|
|
||||||
#if defined(CONFIG_BT_CTLR_DF_CONN_CTE_REQ)
|
#if defined(CONFIG_BT_CTLR_DF_CONN_CTE_REQ)
|
||||||
/* @brief Function enables or disables CTE request control procedure for a connection.
|
/* @brief Function enables or disables CTE request control procedure for a connection.
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue