diff --git a/subsys/bluetooth/controller/ll_sw/lll_conn.h b/subsys/bluetooth/controller/ll_sw/lll_conn.h index 7ea0b7874a1..7fb326e5bd6 100644 --- a/subsys/bluetooth/controller/ll_sw/lll_conn.h +++ b/subsys/bluetooth/controller/ll_sw/lll_conn.h @@ -46,7 +46,6 @@ struct lll_conn { uint8_t data_chan_count:6; uint8_t data_chan_sel:1; uint8_t role:1; - uint8_t initiated:1; union { struct { @@ -57,18 +56,24 @@ struct lll_conn { uint16_t data_chan_id; }; + union { + struct { + uint8_t initiated:1; + } master; #if defined(CONFIG_BT_PERIPHERAL) - struct { - uint8_t latency_enabled:1; + struct { + uint8_t initiated:1; + uint8_t latency_enabled:1; - uint32_t window_widening_periodic_us; - uint32_t window_widening_max_us; - uint32_t window_widening_prepare_us; - uint32_t window_widening_event_us; - uint32_t window_size_prepare_us; - uint32_t window_size_event_us; - } slave; + uint32_t window_widening_periodic_us; + uint32_t window_widening_max_us; + uint32_t window_widening_prepare_us; + uint32_t window_widening_event_us; + uint32_t window_size_prepare_us; + uint32_t window_size_event_us; + } slave; #endif /* CONFIG_BT_PERIPHERAL */ + }; #if defined(CONFIG_BT_CTLR_DATA_LENGTH) uint16_t max_tx_octets; diff --git a/subsys/bluetooth/controller/ll_sw/nordic/lll/lll_adv.c b/subsys/bluetooth/controller/ll_sw/nordic/lll/lll_adv.c index ea9358cfa9c..3714238a14e 100644 --- a/subsys/bluetooth/controller/ll_sw/nordic/lll/lll_adv.c +++ b/subsys/bluetooth/controller/ll_sw/nordic/lll/lll_adv.c @@ -744,7 +744,7 @@ static int prepare_cb(struct lll_prepare_param *p) /* Check if stopped (on connection establishment race between LLL and * ULL. */ - if (unlikely(lll->conn && lll->conn->initiated)) { + if (unlikely(lll->conn && lll->conn->slave.initiated)) { int err; err = lll_hfclock_off(); @@ -1364,7 +1364,7 @@ static inline int isr_rx_pdu(struct lll_adv *lll, #endif /* CONFIG_BT_CTLR_CONN_RSSI */ /* Stop further LLL radio events */ - lll->conn->initiated = 1; + lll->conn->slave.initiated = 1; rx = ull_pdu_rx_alloc(); diff --git a/subsys/bluetooth/controller/ll_sw/nordic/lll/lll_adv_aux.c b/subsys/bluetooth/controller/ll_sw/nordic/lll/lll_adv_aux.c index db7dd409b4f..408e1c9d80b 100644 --- a/subsys/bluetooth/controller/ll_sw/nordic/lll/lll_adv_aux.c +++ b/subsys/bluetooth/controller/ll_sw/nordic/lll/lll_adv_aux.c @@ -685,7 +685,7 @@ static void isr_tx_connect_rsp(void *param) if (is_done) { /* Stop further LLL radio events */ - lll->conn->initiated = 1; + lll->conn->slave.initiated = 1; } /* Clear radio status and events */ diff --git a/subsys/bluetooth/controller/ll_sw/nordic/lll/lll_scan.c b/subsys/bluetooth/controller/ll_sw/nordic/lll/lll_scan.c index ff5353afe94..27a7df0815f 100644 --- a/subsys/bluetooth/controller/ll_sw/nordic/lll/lll_scan.c +++ b/subsys/bluetooth/controller/ll_sw/nordic/lll/lll_scan.c @@ -138,7 +138,7 @@ static int prepare_cb(struct lll_prepare_param *p) /* Check if stopped (on connection establishment race between LLL and * ULL. */ - if (unlikely(lll->conn && lll->conn->initiated)) { + if (unlikely(lll->conn && lll->conn->master.initiated)) { int err; err = lll_hfclock_off(); @@ -371,7 +371,7 @@ static void abort_cb(struct lll_prepare_param *prepare_param, void *param) if (0) { #if defined(CONFIG_BT_CENTRAL) } else if (IS_ENABLED(CONFIG_BT_CTLR_LOW_LAT) && - lll->conn && lll->conn->initiated) { + lll->conn && lll->conn->master.initiated) { while (!radio_has_disabled()) { cpu_sleep(); } @@ -930,7 +930,7 @@ static inline int isr_rx_pdu(struct lll_scan *lll, struct pdu_adv *pdu_adv_rx, */ /* Stop further LLL radio events */ - lll->conn->initiated = 1; + lll->conn->master.initiated = 1; rx = ull_pdu_rx_alloc(); diff --git a/subsys/bluetooth/controller/ll_sw/openisa/lll/lll_adv.c b/subsys/bluetooth/controller/ll_sw/openisa/lll/lll_adv.c index d41d6b038dd..d1c7cf39ff7 100644 --- a/subsys/bluetooth/controller/ll_sw/openisa/lll/lll_adv.c +++ b/subsys/bluetooth/controller/ll_sw/openisa/lll/lll_adv.c @@ -330,7 +330,7 @@ static int prepare_cb(struct lll_prepare_param *prepare_param) /* Check if stopped (on connection establishment race between LLL and * ULL. */ - if (lll->conn && lll->conn->initiated) { + if (unlikely(lll->conn && lll->conn->master.initiated)) { int err; err = lll_clk_off(); @@ -928,7 +928,7 @@ static inline int isr_rx_pdu(struct lll_adv *lll, } #endif /* CONFIG_BT_CTLR_CONN_RSSI */ /* Stop further LLL radio events */ - lll->conn->initiated = 1; + lll->conn->master.initiated = 1; rx = ull_pdu_rx_alloc(); diff --git a/subsys/bluetooth/controller/ll_sw/openisa/lll/lll_scan.c b/subsys/bluetooth/controller/ll_sw/openisa/lll/lll_scan.c index fa6e7f96bdf..6c94b7b0750 100644 --- a/subsys/bluetooth/controller/ll_sw/openisa/lll/lll_scan.c +++ b/subsys/bluetooth/controller/ll_sw/openisa/lll/lll_scan.c @@ -132,7 +132,7 @@ static int prepare_cb(struct lll_prepare_param *prepare_param) /* Check if stopped (on connection establishment race between LLL and * ULL. */ - if (lll->conn && lll->conn->initiated) { + if (unlikely(lll->conn && lll->conn->master.initiated)) { int err; err = lll_clk_off(); @@ -827,7 +827,7 @@ static inline uint32_t isr_rx_pdu(struct lll_scan *lll, uint8_t devmatch_ok, */ /* Stop further LLL radio events */ - lll->conn->initiated = 1; + lll->conn->master.initiated = 1; rx = ull_pdu_rx_alloc(); diff --git a/subsys/bluetooth/controller/ll_sw/ull_adv.c b/subsys/bluetooth/controller/ll_sw/ull_adv.c index fe07ba3e62b..d68c888c56a 100644 --- a/subsys/bluetooth/controller/ll_sw/ull_adv.c +++ b/subsys/bluetooth/controller/ll_sw/ull_adv.c @@ -873,7 +873,7 @@ uint8_t ll_adv_enable(uint8_t enable) /* FIXME: BEGIN: Move to ULL? */ conn_lll->role = 1; - conn_lll->initiated = 0; + conn_lll->slave.initiated = 0; conn_lll->data_chan_sel = 0; conn_lll->data_chan_use = 0; conn_lll->event_counter = 0; diff --git a/subsys/bluetooth/controller/ll_sw/ull_master.c b/subsys/bluetooth/controller/ll_sw/ull_master.c index 541f8735a18..550ed3d994d 100644 --- a/subsys/bluetooth/controller/ll_sw/ull_master.c +++ b/subsys/bluetooth/controller/ll_sw/ull_master.c @@ -221,7 +221,7 @@ uint8_t ll_create_connection(uint16_t scan_interval, uint16_t scan_window, conn_lll->data_chan_sel = 0; conn_lll->data_chan_use = 0; conn_lll->role = 0; - conn_lll->initiated = 0; + conn_lll->master.initiated = 0; /* FIXME: END: Move to ULL? */ #if defined(CONFIG_BT_CTLR_CONN_META) memset(&conn_lll->conn_meta, 0, sizeof(conn_lll->conn_meta)); diff --git a/subsys/bluetooth/controller/ll_sw/ull_slave.c b/subsys/bluetooth/controller/ll_sw/ull_slave.c index 75b9c965262..97d20ee0b66 100644 --- a/subsys/bluetooth/controller/ll_sw/ull_slave.c +++ b/subsys/bluetooth/controller/ll_sw/ull_slave.c @@ -130,7 +130,7 @@ void ull_slave_setup(memq_link_t *link, struct node_rx_hdr *rx, lll->interval = sys_le16_to_cpu(pdu_adv->connect_ind.interval); if ((lll->data_chan_count < 2) || (lll->data_chan_hop < 5) || (lll->data_chan_hop > 16) || !lll->interval) { - lll->initiated = 0U; + lll->slave.initiated = 0U; /* Mark for buffer for release */ rx->type = NODE_RX_TYPE_RELEASE;