Skip to content

Commit 8044195

Browse files
cvinayaknashif
authored andcommitted
Bluetooth: controller: Fix incorrect reset of CPR reject state
Fix regression in adding the state for Connection Parameter Request being rejected where in Connection Parameter Request Procedure state machine was prematurely reset before the reject PDU was enqueued. Signed-off-by: Vinayak Kariappa Chettimada <[email protected]>
1 parent 7bf2027 commit 8044195

File tree

2 files changed

+10
-12
lines changed

2 files changed

+10
-12
lines changed

subsys/bluetooth/controller/ll_sw/ull_conn.c

Lines changed: 10 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -2320,16 +2320,23 @@ static inline int event_conn_upd_prep(struct ll_conn *conn, uint16_t lazy,
23202320
return -EINPROGRESS;
23212321

23222322
case LLCP_CUI_STATE_REJECT:
2323-
/* move to in progress */
2324-
conn->llcp_cu.state = LLCP_CUI_STATE_INPROG;
2323+
/* procedure request acked */
2324+
conn->llcp_ack = conn->llcp_req;
2325+
conn->llcp_cu.ack = conn->llcp_cu.req;
2326+
conn->llcp_conn_param.ack = conn->llcp_conn_param.req;
2327+
2328+
/* reset mutex */
2329+
ull_conn_upd_curr_reset();
2330+
23252331
/* enqueue control PDU */
23262332
pdu_ctrl_tx =
23272333
CONTAINER_OF(conn->llcp.conn_upd.pdu_win_offset,
23282334
struct pdu_data,
23292335
llctrl.conn_update_ind.win_offset);
23302336
tx = CONTAINER_OF(pdu_ctrl_tx, struct node_tx, pdu);
23312337
ctrl_tx_enqueue(conn, tx);
2332-
return -EINPROGRESS;
2338+
return -ECANCELED;
2339+
23332340
default:
23342341
LL_ASSERT(0);
23352342
break;

subsys/bluetooth/controller/ll_sw/ull_sched.c

Lines changed: 0 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -277,15 +277,6 @@ void ull_sched_mfy_win_offset_select(void *param)
277277
} else {
278278
struct pdu_data *pdu_ctrl_tx;
279279

280-
/* procedure request acked */
281-
conn->llcp_ack = conn->llcp_req;
282-
283-
/* CPR request acked */
284-
conn->llcp_conn_param.ack = conn->llcp_conn_param.req;
285-
286-
/* reset mutex */
287-
ull_conn_upd_curr_reset();
288-
289280
/* send reject_ind_ext */
290281
pdu_ctrl_tx = CONTAINER_OF(conn->llcp.conn_upd.pdu_win_offset,
291282
struct pdu_data,

0 commit comments

Comments
 (0)