Skip to content

Commit b7e7153

Browse files
cvinayakjhedberg
authored andcommitted
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 <[email protected]>
1 parent 5255001 commit b7e7153

File tree

1 file changed

+3
-9
lines changed

1 file changed

+3
-9
lines changed

subsys/bluetooth/controller/ll_sw/ull_conn.c

Lines changed: 3 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -4489,26 +4489,20 @@ static inline int length_req_rsp_recv(struct ll_conn *conn, memq_link_t *link,
44894489
if (/* Local idle, and Peer request then complete the Peer procedure
44904490
* with response.
44914491
*/
4492-
((conn->llcp_length.req == conn->llcp_length.ack) &&
4493-
(pdu_rx->llctrl.opcode == PDU_DATA_LLCTRL_TYPE_LENGTH_REQ)) ||
4492+
((conn->llcp_length.req == conn->llcp_length.ack) && tx) ||
44944493
/* or Local has active... */
44954494
((conn->llcp_length.req != conn->llcp_length.ack) &&
44964495
/* with Local requested and Peer request then complete the
44974496
* Peer procedure with response.
44984497
*/
44994498
((((conn->llcp_length.state == LLCP_LENGTH_STATE_REQ) ||
45004499
(conn->llcp_length.state == LLCP_LENGTH_STATE_REQ_ACK_WAIT)) &&
4501-
(pdu_rx->llctrl.opcode ==
4502-
PDU_DATA_LLCTRL_TYPE_LENGTH_REQ)) ||
4500+
tx) ||
45034501
/* with Local waiting for response, and Peer response then
45044502
* complete the Local procedure or Peer request then complete the
45054503
* Peer procedure with response.
45064504
*/
4507-
((conn->llcp_length.state == LLCP_LENGTH_STATE_RSP_WAIT) &&
4508-
((pdu_rx->llctrl.opcode ==
4509-
PDU_DATA_LLCTRL_TYPE_LENGTH_RSP) ||
4510-
(pdu_rx->llctrl.opcode ==
4511-
PDU_DATA_LLCTRL_TYPE_LENGTH_REQ)))))) {
4505+
(conn->llcp_length.state == LLCP_LENGTH_STATE_RSP_WAIT)))) {
45124506
struct pdu_data_llctrl_length_req *lr;
45134507
u16_t max_rx_octets;
45144508
u16_t max_tx_octets;

0 commit comments

Comments
 (0)