Bluetooth: controller: Add control procedure lock

Add control procedure lock flag to detection procedure
transaction violations.

Signed-off-by: Vinayak Kariappa Chettimada <vich@nordicsemi.no>
This commit is contained in:
Vinayak Kariappa Chettimada 2021-03-12 12:06:53 +05:30 committed by Carles Cufí
commit fb5b5b7069
4 changed files with 41 additions and 0 deletions

View file

@ -2019,6 +2019,42 @@ static int empty_data_start_release(struct ll_conn *conn, struct node_tx *tx)
}
#endif /* CONFIG_BT_CTLR_LLID_DATA_START_EMPTY */
/* Check transaction violation and get free ctrl tx PDU */
static struct node_tx *ctrl_tx_rsp_mem_acquire(struct ll_conn *conn,
struct node_rx_pdu *rx,
int *err)
{
struct node_tx *tx;
/* Ignore duplicate requests without previous being acknowledged. */
if (conn->common.txn_lock) {
/* Mark for buffer for release */
rx->hdr.type = NODE_RX_TYPE_RELEASE;
/* Drop request */
*err = 0U;
return NULL;
}
/* Acquire ctrl tx mem */
tx = mem_acquire(&mem_conn_tx_ctrl.free);
if (!tx) {
*err = -ENOBUFS;
return NULL;
}
/* Lock further responses to duplicate requests before previous
* response is acknowledged.
*/
conn->common.txn_lock = 1U;
/* NOTE: err value not required when returning valid ctrl tx PDU */
return tx;
}
#if defined(CONFIG_BT_CTLR_LE_ENC)
static inline void ctrl_tx_check_and_resume(struct ll_conn *conn)
{