From d13c6b2b29eb9a33864a21cb1ca6344f48fbcba7 Mon Sep 17 00:00:00 2001 From: Vinayak Kariappa Chettimada Date: Tue, 24 Mar 2020 12:52:05 +0530 Subject: [PATCH] Bluetooth: controller: split: 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 --- subsys/bluetooth/controller/ll_sw/ull_conn.c | 12 +++--------- 1 file changed, 3 insertions(+), 9 deletions(-) diff --git a/subsys/bluetooth/controller/ll_sw/ull_conn.c b/subsys/bluetooth/controller/ll_sw/ull_conn.c index 2e4c57e4fe9..236cecccb77 100644 --- a/subsys/bluetooth/controller/ll_sw/ull_conn.c +++ b/subsys/bluetooth/controller/ll_sw/ull_conn.c @@ -4501,8 +4501,7 @@ static inline int length_req_rsp_recv(struct ll_conn *conn, memq_link_t *link, if (/* Local idle, and Peer request then complete the Peer procedure * with response. */ - ((conn->llcp_length.req == conn->llcp_length.ack) && - (pdu_rx->llctrl.opcode == PDU_DATA_LLCTRL_TYPE_LENGTH_REQ)) || + ((conn->llcp_length.req == conn->llcp_length.ack) && tx) || /* or Local has active... */ ((conn->llcp_length.req != conn->llcp_length.ack) && /* with Local requested and Peer request then complete the @@ -4510,17 +4509,12 @@ static inline int length_req_rsp_recv(struct ll_conn *conn, memq_link_t *link, */ ((((conn->llcp_length.state == LLCP_LENGTH_STATE_REQ) || (conn->llcp_length.state == LLCP_LENGTH_STATE_REQ_ACK_WAIT)) && - (pdu_rx->llctrl.opcode == - PDU_DATA_LLCTRL_TYPE_LENGTH_REQ)) || + tx) || /* with Local waiting for response, and Peer response then * complete the Local procedure or Peer request then complete the * Peer procedure with response. */ - ((conn->llcp_length.state == LLCP_LENGTH_STATE_RSP_WAIT) && - ((pdu_rx->llctrl.opcode == - PDU_DATA_LLCTRL_TYPE_LENGTH_RSP) || - (pdu_rx->llctrl.opcode == - PDU_DATA_LLCTRL_TYPE_LENGTH_REQ)))))) { + (conn->llcp_length.state == LLCP_LENGTH_STATE_RSP_WAIT)))) { struct pdu_data_llctrl_length_req *lr; u16_t max_rx_octets; u16_t max_tx_octets;