Bluetooth: controller: legacy: Simplify DLE state checks

Simplify the Data Length Update Procedure state check when
processing incoming LENGTH_REQ/RSP PDUs.

Signed-off-by: Vinayak Kariappa Chettimada <vich@nordicsemi.no>
This commit is contained in:
Vinayak Kariappa Chettimada 2020-03-24 12:52:05 +05:30 committed by Carles Cufí
commit 9bd4a786cd

View file

@ -2490,9 +2490,7 @@ static inline u8_t isr_rx_conn_pkt_ctrl_dle(struct pdu_data *pdu_data_rx,
* with response. * with response.
*/ */
((_radio.conn_curr->llcp_length.req == ((_radio.conn_curr->llcp_length.req ==
_radio.conn_curr->llcp_length.ack) && _radio.conn_curr->llcp_length.ack) && node_tx) ||
(pdu_data_rx->llctrl.opcode ==
PDU_DATA_LLCTRL_TYPE_LENGTH_REQ)) ||
/* or Local has active... */ /* or Local has active... */
((_radio.conn_curr->llcp_length.req != ((_radio.conn_curr->llcp_length.req !=
_radio.conn_curr->llcp_length.ack) && _radio.conn_curr->llcp_length.ack) &&
@ -2502,19 +2500,13 @@ static inline u8_t isr_rx_conn_pkt_ctrl_dle(struct pdu_data *pdu_data_rx,
((((_radio.conn_curr->llcp_length.state == ((((_radio.conn_curr->llcp_length.state ==
LLCP_LENGTH_STATE_REQ) || LLCP_LENGTH_STATE_REQ) ||
(_radio.conn_curr->llcp_length.state == (_radio.conn_curr->llcp_length.state ==
LLCP_LENGTH_STATE_REQ_ACK_WAIT)) && LLCP_LENGTH_STATE_REQ_ACK_WAIT)) && node_tx) ||
(pdu_data_rx->llctrl.opcode ==
PDU_DATA_LLCTRL_TYPE_LENGTH_REQ)) ||
/* with Local waiting for response, and Peer response then /* with Local waiting for response, and Peer response then
* complete the Local procedure or Peer request then complete the * complete the Local procedure or Peer request then complete the
* Peer procedure with response. * Peer procedure with response.
*/ */
((_radio.conn_curr->llcp_length.state == (_radio.conn_curr->llcp_length.state ==
LLCP_LENGTH_STATE_RSP_WAIT) && LLCP_LENGTH_STATE_RSP_WAIT)))) {
((pdu_data_rx->llctrl.opcode ==
PDU_DATA_LLCTRL_TYPE_LENGTH_RSP) ||
(pdu_data_rx->llctrl.opcode ==
PDU_DATA_LLCTRL_TYPE_LENGTH_REQ)))))) {
struct pdu_data_llctrl_length_req *lr; struct pdu_data_llctrl_length_req *lr;
lr = &pdu_data_rx->llctrl.length_req; lr = &pdu_data_rx->llctrl.length_req;