Bluetooth: controller: Refactor ull_conn_tx_ack function
Refactor ull_conn_tx_ack function as it no longer needs to return the connection context back to caller. Signed-off-by: Vinayak Kariappa Chettimada <vich@nordicsemi.no>
This commit is contained in:
parent
35c0b77304
commit
0096fca39d
3 changed files with 12 additions and 25 deletions
|
@ -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)
|
#if !defined(CONFIG_BT_CTLR_LOW_LAT_ULL)
|
||||||
do {
|
do {
|
||||||
#endif /* CONFIG_BT_CTLR_LOW_LAT_ULL */
|
#endif /* CONFIG_BT_CTLR_LOW_LAT_ULL */
|
||||||
struct ll_conn *conn;
|
|
||||||
|
|
||||||
/* Dequeue node */
|
/* Dequeue node */
|
||||||
ull_conn_ack_dequeue();
|
ull_conn_ack_dequeue();
|
||||||
|
|
||||||
/* Process Tx ack */
|
/* Process Tx ack */
|
||||||
conn = ull_conn_tx_ack(handle, link, node_tx);
|
ull_conn_tx_ack(handle, link, node_tx);
|
||||||
|
|
||||||
/* Release link mem */
|
/* Release link mem */
|
||||||
ull_conn_link_tx_release(link);
|
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 */
|
/* check for more rx ack */
|
||||||
link = ull_conn_ack_by_last_peek(ack_last, &handle, &node_tx);
|
link = ull_conn_ack_by_last_peek(ack_last, &handle, &node_tx);
|
||||||
|
|
||||||
|
|
|
@ -1386,10 +1386,8 @@ void ull_conn_lll_ack_enqueue(uint16_t handle, struct node_tx *tx)
|
||||||
MFIFO_ENQUEUE(conn_ack, idx);
|
MFIFO_ENQUEUE(conn_ack, idx);
|
||||||
}
|
}
|
||||||
|
|
||||||
struct ll_conn *ull_conn_tx_ack(uint16_t handle, memq_link_t *link,
|
void ull_conn_tx_ack(uint16_t handle, memq_link_t *link, struct node_tx *tx)
|
||||||
struct node_tx *tx)
|
|
||||||
{
|
{
|
||||||
struct ll_conn *conn = NULL;
|
|
||||||
struct pdu_data *pdu_tx;
|
struct pdu_data *pdu_tx;
|
||||||
|
|
||||||
pdu_tx = (void *)tx->pdu;
|
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 (pdu_tx->ll_id == PDU_DATA_LLID_CTRL) {
|
||||||
if (handle != 0xFFFF) {
|
if (handle != 0xFFFF) {
|
||||||
conn = ll_conn_get(handle);
|
struct ll_conn *conn = ll_conn_get(handle);
|
||||||
|
|
||||||
ctrl_tx_ack(conn, &tx, pdu_tx);
|
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) {
|
if (link->next == (void *)tx) {
|
||||||
|
|
||||||
LL_ASSERT(link->next);
|
LL_ASSERT(link->next);
|
||||||
|
|
||||||
mem_release(tx, &mem_conn_tx_ctrl.free);
|
mem_release(tx, &mem_conn_tx_ctrl.free);
|
||||||
return conn;
|
return;
|
||||||
} else if (!tx) {
|
} else if (!tx) {
|
||||||
return conn;
|
/* Tx Node re-used to enqueue new ctrl PDU */
|
||||||
|
return;
|
||||||
} else {
|
} else {
|
||||||
LL_ASSERT(!link->next);
|
LL_ASSERT(!link->next);
|
||||||
}
|
}
|
||||||
} else if (handle != 0xFFFF) {
|
} else if (handle == 0xFFFF) {
|
||||||
conn = ll_conn_get(handle);
|
|
||||||
} else {
|
|
||||||
pdu_tx->ll_id = PDU_DATA_LLID_RESV;
|
pdu_tx->ll_id = PDU_DATA_LLID_RESV;
|
||||||
|
} else {
|
||||||
|
LL_ASSERT(handle != 0xFFFF);
|
||||||
}
|
}
|
||||||
|
|
||||||
ll_tx_ack_put(handle, tx);
|
ll_tx_ack_put(handle, tx);
|
||||||
|
|
||||||
return conn;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
uint8_t ull_conn_llcp_req(void *conn)
|
uint8_t ull_conn_llcp_req(void *conn)
|
||||||
|
|
|
@ -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,
|
memq_link_t *ull_conn_ack_by_last_peek(uint8_t last, uint16_t *handle,
|
||||||
struct node_tx **tx);
|
struct node_tx **tx);
|
||||||
void *ull_conn_ack_dequeue(void);
|
void *ull_conn_ack_dequeue(void);
|
||||||
struct ll_conn *ull_conn_tx_ack(uint16_t handle, memq_link_t *link,
|
void ull_conn_tx_ack(uint16_t handle, memq_link_t *link, struct node_tx *tx);
|
||||||
struct node_tx *tx);
|
|
||||||
uint8_t ull_conn_llcp_req(void *conn);
|
uint8_t ull_conn_llcp_req(void *conn);
|
||||||
void ull_conn_upd_curr_reset(void);
|
void ull_conn_upd_curr_reset(void);
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue