Bluetooth: controller: Fix connection failed to be established

Fix connection failed to be established regression
introduced by the commit 350c569aba ("Bluetooth:
controller: Avoid offseting to lldata").

As the Rx-ed PDU buffer is re-used to construct the
connection complete message towards HCI, the fields in the
Rx-ed PDU need to be backup for future use in the control
path. Here the channel selection bit is backup now.

Signed-off-by: Vinayak Kariappa Chettimada <vich@nordicsemi.no>
This commit is contained in:
Vinayak Kariappa Chettimada 2018-10-11 17:46:13 +02:00 committed by Carles Cufí
commit ae8649c5ec

View file

@ -1350,6 +1350,7 @@ static inline u32_t isr_rx_scan(u8_t devmatch_ok, u8_t devmatch_id,
struct radio_le_conn_cmplt *radio_le_conn_cmplt;
struct radio_pdu_node_rx *node_rx;
struct pdu_adv *pdu_adv_tx;
u8_t pdu_adv_rx_chan_sel;
struct connection *conn;
u32_t ticks_slot_offset;
u32_t conn_interval_us;
@ -1382,6 +1383,11 @@ static inline u32_t isr_rx_scan(u8_t devmatch_ok, u8_t devmatch_id,
if (IS_ENABLED(CONFIG_BT_CTLR_CHAN_SEL_2)) {
pdu_adv_tx->chan_sel = 1;
/* backup, as Rx-ed buffer is used to enqueue
* connection message.
*/
pdu_adv_rx_chan_sel = pdu_adv_rx->chan_sel;
} else {
pdu_adv_tx->chan_sel = 0;
}
@ -1552,7 +1558,7 @@ static inline u32_t isr_rx_scan(u8_t devmatch_ok, u8_t devmatch_id,
le_chan_sel_algo = (void *)node_rx->pdu_data;
if (pdu_adv_rx->chan_sel) {
if (pdu_adv_rx_chan_sel) {
u16_t aa_ls =
((u16_t)conn->access_addr[1] << 8) |
conn->access_addr[0];