Bluetooth: controller: Fix rejected enc procedure not terminated

Fix issue in the handling of LL_REJECT_EXT_IND packets, this would look
at the procedures that are enqueued, and not the procedure that was
being rejected. This meant that although a reject was received for the
encryption procedure, the handling for a different control procedure was
run.
This would result in the link being terminated as control procedure
timer would time out for the encryption procedure.

Signed-off-by: Joakim Andersson <joakim.andersson@nordicsemi.no>
This commit is contained in:
Joakim Andersson 2019-10-02 17:54:40 +02:00 committed by Carles Cufí
commit 4135fb55f1

View file

@ -2277,27 +2277,6 @@ isr_rx_conn_pkt_ctrl_rej_phy_upd(struct radio_pdu_node_rx *node_rx,
static inline void
isr_rx_conn_pkt_ctrl_rej(struct radio_pdu_node_rx *node_rx, u8_t *rx_enqueue)
{
if (0) {
#if defined(CONFIG_BT_CTLR_PHY)
} else if (_radio.conn_curr->llcp_phy.ack !=
_radio.conn_curr->llcp_phy.req) {
isr_rx_conn_pkt_ctrl_rej_phy_upd(node_rx, rx_enqueue);
#endif /* CONFIG_BT_CTLR_PHY */
#if defined(CONFIG_BT_CTLR_CONN_PARAM_REQ)
} else if (_radio.conn_curr->llcp_conn_param.ack !=
_radio.conn_curr->llcp_conn_param.req) {
isr_rx_conn_pkt_ctrl_rej_conn_upd(node_rx, rx_enqueue);
#endif /* CONFIG_BT_CTLR_CONN_PARAM_REQ */
#if defined(CONFIG_BT_CTLR_DATA_LENGTH)
} else if (_radio.conn_curr->llcp_length.ack !=
_radio.conn_curr->llcp_length.req) {
isr_rx_conn_pkt_ctrl_rej_dle(node_rx, rx_enqueue);
#endif /* CONFIG_BT_CTLR_DATA_LENGTH */
#if defined(CONFIG_BT_CTLR_LE_ENC)
} else {
struct pdu_data_llctrl_reject_ext_ind *rej_ext_ind;
struct pdu_data *pdu_rx;
@ -2305,6 +2284,7 @@ isr_rx_conn_pkt_ctrl_rej(struct radio_pdu_node_rx *node_rx, u8_t *rx_enqueue)
rej_ext_ind = (void *)&pdu_rx->llctrl.reject_ext_ind;
switch (rej_ext_ind->reject_opcode) {
#if defined(CONFIG_BT_CTLR_LE_ENC)
case PDU_DATA_LLCTRL_TYPE_ENC_REQ:
/* resume data packet rx and tx */
_radio.conn_curr->pause_rx = 0U;
@ -2320,13 +2300,38 @@ isr_rx_conn_pkt_ctrl_rej(struct radio_pdu_node_rx *node_rx, u8_t *rx_enqueue)
rej_ext_ind->error_code;
*rx_enqueue = 1U;
break;
#endif /* CONFIG_BT_CTLR_LE_ENC */
#if defined(CONFIG_BT_CTLR_PHY)
case PDU_DATA_LLCTRL_TYPE_PHY_REQ:
if (_radio.conn_curr->llcp_phy.ack !=
_radio.conn_curr->llcp_phy.req) {
isr_rx_conn_pkt_ctrl_rej_phy_upd(node_rx, rx_enqueue);
}
break;
#endif /* CONFIG_BT_CTLR_PHY */
#if defined(CONFIG_BT_CTLR_CONN_PARAM_REQ)
case PDU_DATA_LLCTRL_TYPE_CONN_PARAM_REQ:
if (_radio.conn_curr->llcp_conn_param.ack !=
_radio.conn_curr->llcp_conn_param.req) {
isr_rx_conn_pkt_ctrl_rej_conn_upd(node_rx, rx_enqueue);
}
break;
#endif /* CONFIG_BT_CTLR_CONN_PARAM_REQ */
#if defined(CONFIG_BT_CTLR_DATA_LENGTH)
case PDU_DATA_LLCTRL_TYPE_LENGTH_REQ:
if (_radio.conn_curr->llcp_length.ack !=
_radio.conn_curr->llcp_length.req) {
isr_rx_conn_pkt_ctrl_rej_dle(node_rx, rx_enqueue);
}
break;
#endif /* CONFIG_BT_CTLR_DATA_LENGTH */
default:
/* Ignore */
break;
}
#endif /* CONFIG_BT_CTLR_LE_ENC */
}
}
#if defined(CONFIG_BT_CTLR_DATA_LENGTH)