From bc782cf11bc20b54c8ef0844fb3ea0f039f96bb2 Mon Sep 17 00:00:00 2001 From: Vinayak Kariappa Chettimada Date: Fri, 12 Mar 2021 14:52:06 +0530 Subject: [PATCH] Bluetooth: controller: Remove redundant connection initiated check Remove the redundant connection initiated check as the event is closed on connection initiated and it is sufficient to check in the prepare_cb function to abort any events in the pipeline after the connection has been initiated. Relates to commit 5ce5dc055e5d ("Bluetooth: controller: Avoid race between ULL and LLL when initiating conn") and commit 18f5fb99c1fe ("Bluetooth: controller: Remove use of lll_stop"). Signed-off-by: Vinayak Kariappa Chettimada --- subsys/bluetooth/controller/ll_sw/nordic/lll/lll_adv.c | 3 +-- subsys/bluetooth/controller/ll_sw/nordic/lll/lll_adv_aux.c | 3 +-- subsys/bluetooth/controller/ll_sw/nordic/lll/lll_scan.c | 2 +- subsys/bluetooth/controller/ll_sw/openisa/lll/lll_adv.c | 3 +-- subsys/bluetooth/controller/ll_sw/openisa/lll/lll_scan.c | 2 +- 5 files changed, 5 insertions(+), 8 deletions(-) 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 885d88e437a..ea9358cfa9c 100644 --- a/subsys/bluetooth/controller/ll_sw/nordic/lll/lll_adv.c +++ b/subsys/bluetooth/controller/ll_sw/nordic/lll/lll_adv.c @@ -1333,8 +1333,7 @@ static inline int isr_rx_pdu(struct lll_adv *lll, lll_adv_connect_ind_check(lll, pdu_rx, tx_addr, addr, rx_addr, tgt_addr, devmatch_ok, &rl_idx) && - lll->conn && - !lll->conn->initiated) { + lll->conn) { struct node_rx_ftr *ftr; struct node_rx_pdu *rx; 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 99f0e44a1b2..db7dd409b4f 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 @@ -577,8 +577,7 @@ static inline int isr_rx_pdu(struct lll_adv_aux *lll_aux, lll_adv_connect_ind_check(lll, pdu_rx, tx_addr, addr, rx_addr, tgt_addr, devmatch_ok, &rl_idx) && - lll->conn && - !lll->conn->initiated) { + lll->conn) { struct node_rx_ftr *ftr; struct node_rx_pdu *rx; struct pdu_adv *pdu_tx; 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 b73dc29f585..ff5353afe94 100644 --- a/subsys/bluetooth/controller/ll_sw/nordic/lll/lll_scan.c +++ b/subsys/bluetooth/controller/ll_sw/nordic/lll/lll_scan.c @@ -777,7 +777,7 @@ static inline int isr_rx_pdu(struct lll_scan *lll, struct pdu_adv *pdu_adv_rx, if (0) { #if defined(CONFIG_BT_CENTRAL) /* Initiator */ - } else if (lll->conn && !lll->conn->initiated && + } else if (lll->conn && isr_scan_init_check(lll, pdu_adv_rx, rl_idx)) { struct lll_conn *lll_conn; struct node_rx_ftr *ftr; 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 4a76d93d726..d41d6b038dd 100644 --- a/subsys/bluetooth/controller/ll_sw/openisa/lll/lll_adv.c +++ b/subsys/bluetooth/controller/ll_sw/openisa/lll/lll_adv.c @@ -898,8 +898,7 @@ static inline int isr_rx_pdu(struct lll_adv *lll, (pdu_rx->len == sizeof(struct pdu_adv_connect_ind)) && isr_rx_ci_check(lll, pdu_adv, pdu_rx, devmatch_ok, &rl_idx) && - lll->conn && - !lll->conn->initiated) { + lll->conn) { struct node_rx_ftr *ftr; struct node_rx_pdu *rx; 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 30e8cbb5f2b..fa6e7f96bdf 100644 --- a/subsys/bluetooth/controller/ll_sw/openisa/lll/lll_scan.c +++ b/subsys/bluetooth/controller/ll_sw/openisa/lll/lll_scan.c @@ -674,7 +674,7 @@ static inline uint32_t isr_rx_pdu(struct lll_scan *lll, uint8_t devmatch_ok, if (0) { #if defined(CONFIG_BT_CENTRAL) /* Initiator */ - } else if (lll->conn && !lll->conn->initiated && + } else if (lll->conn && isr_scan_init_check(lll, pdu_adv_rx, rl_idx)) { struct lll_conn *lll_conn; struct node_rx_ftr *ftr;