diff --git a/subsys/bluetooth/controller/ll_sw/ull.c b/subsys/bluetooth/controller/ll_sw/ull.c index cac617b5339..5edcf17c154 100644 --- a/subsys/bluetooth/controller/ll_sw/ull.c +++ b/subsys/bluetooth/controller/ll_sw/ull.c @@ -1526,25 +1526,15 @@ static inline void rx_demux_conn_tx_ack(uint8_t ack_last, uint16_t handle, #if !defined(CONFIG_BT_CTLR_LOW_LAT_ULL) do { #endif /* CONFIG_BT_CTLR_LOW_LAT_ULL */ - struct ll_conn *conn; - /* Dequeue node */ ull_conn_ack_dequeue(); /* Process Tx ack */ - conn = ull_conn_tx_ack(handle, link, node_tx); + ull_conn_tx_ack(handle, link, node_tx); /* Release link mem */ ull_conn_link_tx_release(link); - /* De-mux 1 tx node from FIFO */ - ull_conn_tx_demux(1); - - /* Enqueue towards LLL */ - if (conn) { - ull_conn_tx_lll_enqueue(conn, 1); - } - /* check for more rx ack */ link = ull_conn_ack_by_last_peek(ack_last, &handle, &node_tx); diff --git a/subsys/bluetooth/controller/ll_sw/ull_conn.c b/subsys/bluetooth/controller/ll_sw/ull_conn.c index e36427abbac..92d209d902a 100644 --- a/subsys/bluetooth/controller/ll_sw/ull_conn.c +++ b/subsys/bluetooth/controller/ll_sw/ull_conn.c @@ -1386,10 +1386,8 @@ void ull_conn_lll_ack_enqueue(uint16_t handle, struct node_tx *tx) MFIFO_ENQUEUE(conn_ack, idx); } -struct ll_conn *ull_conn_tx_ack(uint16_t handle, memq_link_t *link, - struct node_tx *tx) +void ull_conn_tx_ack(uint16_t handle, memq_link_t *link, struct node_tx *tx) { - struct ll_conn *conn = NULL; struct pdu_data *pdu_tx; pdu_tx = (void *)tx->pdu; @@ -1397,32 +1395,32 @@ struct ll_conn *ull_conn_tx_ack(uint16_t handle, memq_link_t *link, if (pdu_tx->ll_id == PDU_DATA_LLID_CTRL) { if (handle != 0xFFFF) { - conn = ll_conn_get(handle); + struct ll_conn *conn = ll_conn_get(handle); ctrl_tx_ack(conn, &tx, pdu_tx); } - /* release mem if points to itself */ + /* release ctrl mem if points to itself */ if (link->next == (void *)tx) { - LL_ASSERT(link->next); mem_release(tx, &mem_conn_tx_ctrl.free); - return conn; + return; } else if (!tx) { - return conn; + /* Tx Node re-used to enqueue new ctrl PDU */ + return; } else { LL_ASSERT(!link->next); } - } else if (handle != 0xFFFF) { - conn = ll_conn_get(handle); - } else { + } else if (handle == 0xFFFF) { pdu_tx->ll_id = PDU_DATA_LLID_RESV; + } else { + LL_ASSERT(handle != 0xFFFF); } ll_tx_ack_put(handle, tx); - return conn; + return; } uint8_t ull_conn_llcp_req(void *conn) diff --git a/subsys/bluetooth/controller/ll_sw/ull_conn_internal.h b/subsys/bluetooth/controller/ll_sw/ull_conn_internal.h index 181079f9a1e..2f2eb2b54cb 100644 --- a/subsys/bluetooth/controller/ll_sw/ull_conn_internal.h +++ b/subsys/bluetooth/controller/ll_sw/ull_conn_internal.h @@ -33,7 +33,6 @@ memq_link_t *ull_conn_ack_peek(uint8_t *ack_last, uint16_t *handle, memq_link_t *ull_conn_ack_by_last_peek(uint8_t last, uint16_t *handle, struct node_tx **tx); void *ull_conn_ack_dequeue(void); -struct ll_conn *ull_conn_tx_ack(uint16_t handle, memq_link_t *link, - struct node_tx *tx); +void ull_conn_tx_ack(uint16_t handle, memq_link_t *link, struct node_tx *tx); uint8_t ull_conn_llcp_req(void *conn); void ull_conn_upd_curr_reset(void);