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 0cb79b684ba..f952c5fa00a 100644 --- a/subsys/bluetooth/controller/ll_sw/nordic/lll/lll_scan.c +++ b/subsys/bluetooth/controller/ll_sw/nordic/lll/lll_scan.c @@ -769,7 +769,17 @@ static inline u32_t isr_rx_pdu(struct lll_scan *lll, u8_t devmatch_ok, rx->hdr.type = NODE_RX_TYPE_CONNECTION; rx->hdr.handle = 0xffff; + u8_t pdu_adv_rx_chan_sel = pdu_adv_rx->chan_sel; + memcpy(rx->pdu, pdu_tx, (offsetof(struct pdu_adv, connect_ind) + + sizeof(struct pdu_adv_connect_ind))); + + /* Overwrite the sent chan sel with received chan sel, when + * giving this PDU to the higher layer. */ + pdu_adv_rx = (void *)rx->pdu; + pdu_adv_rx->chan_sel = pdu_adv_rx_chan_sel; + ftr = &(rx->hdr.rx_ftr); + ftr->param = lll; ftr->ticks_anchor = radio_tmr_start_get(); ftr->us_radio_end = conn_space_us - diff --git a/subsys/bluetooth/controller/ll_sw/ull_master.c b/subsys/bluetooth/controller/ll_sw/ull_master.c index e8fd8ce502b..0af248d06b9 100644 --- a/subsys/bluetooth/controller/ll_sw/ull_master.c +++ b/subsys/bluetooth/controller/ll_sw/ull_master.c @@ -421,7 +421,7 @@ void ull_master_setup(memq_link_t *link, struct node_rx_hdr *rx, struct ll_scan_set *scan; struct node_rx_cc *cc; struct ll_conn *conn; - struct pdu_adv *pdu; + struct pdu_adv *pdu_tx; u32_t ticker_status; u8_t chan_sel; @@ -430,21 +430,22 @@ void ull_master_setup(memq_link_t *link, struct node_rx_hdr *rx, scan = ((struct lll_scan *)ftr->param)->hdr.parent; conn = lll->hdr.parent; - pdu = (void *)((struct node_rx_pdu *)rx)->pdu; + pdu_tx = (void *)((struct node_rx_pdu *)rx)->pdu; #if defined(CONFIG_BT_CTLR_PRIVACY) - u8_t own_addr_type = pdu->tx_addr; + u8_t own_addr_type = pdu_tx->tx_addr; u8_t own_addr[BDADDR_SIZE]; u8_t peer_addr[BDADDR_SIZE]; u8_t rl_idx; - memcpy(own_addr, &pdu->connect_ind.init_addr[0], BDADDR_SIZE); - memcpy(peer_addr, &pdu->connect_ind.adv_addr[0], BDADDR_SIZE); + memcpy(own_addr, &pdu_tx->connect_ind.init_addr[0], BDADDR_SIZE); + memcpy(peer_addr, &pdu_tx->connect_ind.adv_addr[0], BDADDR_SIZE); #endif - chan_sel = pdu->chan_sel; + /* This is the chan sel bit from the received adv pdu */ + chan_sel = pdu_tx->chan_sel; - cc = (void *)pdu; + cc = (void *)pdu_tx; cc->status = 0U; cc->role = 0U;