Skip to content

Commit 019d282

Browse files
cvinayaknashif
authored andcommitted
Bluetooth: controller: Fix Enc Setup overlap with Length Update
Fix the encryption setup queueing implementation to avoid overlapping with local initiated Length Update Procedure. Fixes #15733. Relates to #15335, and #15186. Signed-off-by: Vinayak Kariappa Chettimada <vich@nordicsemi.no>
1 parent d96ffc1 commit 019d282

File tree

1 file changed

+19
-5
lines changed
  • subsys/bluetooth/controller/ll_sw

1 file changed

+19
-5
lines changed

subsys/bluetooth/controller/ll_sw/ctrl.c

Lines changed: 19 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -9345,7 +9345,16 @@ static bool is_enc_req_pause_tx(struct connection *conn)
93459345
if (!conn->pkt_tx_last) {
93469346
conn->pkt_tx_last = node_tx;
93479347
}
9348+
9349+
/* Head now contains a control packet permitted
9350+
* to be transmitted to peer.
9351+
*/
9352+
return false;
93489353
}
9354+
9355+
/* Head contains ENC_REQ packet deferred due to another
9356+
* control procedure in progress.
9357+
*/
93499358
return true;
93509359
}
93519360

@@ -9355,6 +9364,7 @@ static bool is_enc_req_pause_tx(struct connection *conn)
93559364
conn->llcp_ack--;
93569365
}
93579366

9367+
/* Head contains a permitted data or control packet. */
93589368
return false;
93599369
}
93609370
#endif /* CONFIG_BT_CTLR_LE_ENC */
@@ -9363,21 +9373,25 @@ static void prepare_pdu_data_tx(struct connection *conn,
93639373
struct pdu_data **pdu_data_tx)
93649374
{
93659375
struct pdu_data *_pdu_data_tx;
9376+
bool pause_tx = false;
93669377

93679378
if (/* empty packet */
93689379
conn->empty ||
93699380
/* no ctrl or data packet */
93709381
!conn->pkt_tx_head ||
93719382
/* data tx paused, only control packets allowed */
93729383
((
9373-
#if defined(CONFIG_BT_CTLR_LE_ENC)
9374-
conn->pause_tx ||
9375-
is_enc_req_pause_tx(conn) ||
9376-
#endif /* CONFIG_BT_CTLR_LE_ENC */
93779384
#if defined(CONFIG_BT_CTLR_DATA_LENGTH)
93789385
conn->llcp_length.pause_tx ||
93799386
#endif /* CONFIG_BT_CTLR_DATA_LENGTH */
9380-
0) && (conn->pkt_tx_head != conn->pkt_tx_ctrl))) {
9387+
#if defined(CONFIG_BT_CTLR_LE_ENC)
9388+
conn->pause_tx ||
9389+
/* Encryption setup queued */
9390+
(pause_tx = is_enc_req_pause_tx(conn)) ||
9391+
#endif /* CONFIG_BT_CTLR_LE_ENC */
9392+
0) &&
9393+
/* Encryption setup queued or data paused */
9394+
(pause_tx || (conn->pkt_tx_head != conn->pkt_tx_ctrl)))) {
93819395
_pdu_data_tx = empty_tx_enqueue(conn);
93829396
} else {
93839397
u16_t max_tx_octets;

0 commit comments

Comments
 (0)