From 8a4c13146e11ea8ea9781f0ae2adebbcc849e74b Mon Sep 17 00:00:00 2001 From: Alexander Svensen Date: Thu, 2 May 2019 13:49:22 +0200 Subject: [PATCH] Bluetooth: controller: ull/lll: Workaround CPR procedure collision This is a workaround for IOP issue, where peer rejects LLCP Slave Connection Parameter Request with LMP Error Transaction Collision error code even if previous request is complete at the instant. Signed-off-by: Alexander Svensen --- subsys/bluetooth/controller/ll_sw/ull_conn.c | 23 +++++++++----------- 1 file changed, 10 insertions(+), 13 deletions(-) diff --git a/subsys/bluetooth/controller/ll_sw/ull_conn.c b/subsys/bluetooth/controller/ll_sw/ull_conn.c index 7ff6bbb31d1..5e5652d192b 100644 --- a/subsys/bluetooth/controller/ll_sw/ull_conn.c +++ b/subsys/bluetooth/controller/ll_sw/ull_conn.c @@ -3485,29 +3485,26 @@ static inline void reject_ind_conn_upd_recv(struct ll_conn *conn, goto reject_ind_conn_upd_recv_exit; } - /* Same Procedure or Different Procedure Collision */ - - /* If not same procedure, stop procedure timeout, else - * continue timer until phy upd ind is received. - */ + /* FIXME: handle unsupported LL parameters error */ else if (rej_ext_ind->error_code != BT_HCI_ERR_LL_PROC_COLLISION) { + /* update to next ticks offset */ + if (lll->role) { + conn->slave.ticks_to_offset = + conn->llcp_conn_param.ticks_to_offset_next; + } + } + + if (conn->llcp_conn_param.state == LLCP_CPR_STATE_RSP_WAIT) { LL_ASSERT(conn_upd_curr == conn); /* reset mutex */ conn_upd_curr = NULL; /* Procedure complete */ - conn->llcp_conn_param.ack = - conn->llcp_conn_param.req; + conn->llcp_conn_param.ack = conn->llcp_conn_param.req; /* Stop procedure timeout */ conn->procedure_expire = 0U; - - /* update to next ticks offsets */ - if (lll->role) { - conn->slave.ticks_to_offset = - conn->llcp_conn_param.ticks_to_offset_next; - } } /* skip event generation if not cmd initiated */