From 41017478b1f1e4da744f7bd8c3b09fed9f10a925 Mon Sep 17 00:00:00 2001 From: Vinayak Kariappa Chettimada Date: Sun, 6 Sep 2020 06:40:02 +0530 Subject: [PATCH] Bluetooth: controller: Move tx_ull_dequeue to static functions Move tx_ull_dequeue function to be placed alongwith other static function definitions. Signed-off-by: Vinayak Kariappa Chettimada --- subsys/bluetooth/controller/ll_sw/ull_conn.c | 80 ++++++++++---------- 1 file changed, 40 insertions(+), 40 deletions(-) diff --git a/subsys/bluetooth/controller/ll_sw/ull_conn.c b/subsys/bluetooth/controller/ll_sw/ull_conn.c index 3019ed66fc5..e36427abbac 100644 --- a/subsys/bluetooth/controller/ll_sw/ull_conn.c +++ b/subsys/bluetooth/controller/ll_sw/ull_conn.c @@ -63,6 +63,7 @@ static void ticker_start_conn_op_cb(uint32_t status, void *param); static inline void disable(uint16_t handle); static void conn_cleanup(struct ll_conn *conn, uint8_t reason); +static struct node_tx *tx_ull_dequeue(struct ll_conn *conn, struct node_tx *tx); static void tx_ull_flush(struct ll_conn *conn); static void tx_lll_flush(void *param); @@ -1288,46 +1289,6 @@ ull_conn_tx_demux_release: } while (--count); } -static struct node_tx *tx_ull_dequeue(struct ll_conn *conn, - struct node_tx *tx) -{ - if (!conn->tx_ctrl && (conn->tx_head != conn->tx_data)) { - struct pdu_data *pdu_data_tx; - - pdu_data_tx = (void *)conn->tx_head->pdu; - if ((pdu_data_tx->ll_id != PDU_DATA_LLID_CTRL) || - ((pdu_data_tx->llctrl.opcode != - PDU_DATA_LLCTRL_TYPE_ENC_REQ) && - (pdu_data_tx->llctrl.opcode != - PDU_DATA_LLCTRL_TYPE_PAUSE_ENC_REQ))) { - conn->tx_ctrl = conn->tx_ctrl_last = conn->tx_head; - } - } - - if (conn->tx_head == conn->tx_ctrl) { - conn->tx_head = conn->tx_head->next; - if (conn->tx_ctrl == conn->tx_ctrl_last) { - conn->tx_ctrl = NULL; - conn->tx_ctrl_last = NULL; - } else { - conn->tx_ctrl = conn->tx_head; - } - - /* point to self to indicate a control PDU mem alloc */ - tx->next = tx; - } else { - if (conn->tx_head == conn->tx_data) { - conn->tx_data = conn->tx_data->next; - } - conn->tx_head = conn->tx_head->next; - - /* point to NULL to indicate a Data PDU mem alloc */ - tx->next = NULL; - } - - return tx; -} - void ull_conn_tx_lll_enqueue(struct ll_conn *conn, uint8_t count) { bool pause_tx = false; @@ -1735,6 +1696,45 @@ static void conn_cleanup(struct ll_conn *conn, uint8_t reason) ull_conn_tx_demux(UINT8_MAX); } +static struct node_tx *tx_ull_dequeue(struct ll_conn *conn, struct node_tx *tx) +{ + if (!conn->tx_ctrl && (conn->tx_head != conn->tx_data)) { + struct pdu_data *pdu_data_tx; + + pdu_data_tx = (void *)conn->tx_head->pdu; + if ((pdu_data_tx->ll_id != PDU_DATA_LLID_CTRL) || + ((pdu_data_tx->llctrl.opcode != + PDU_DATA_LLCTRL_TYPE_ENC_REQ) && + (pdu_data_tx->llctrl.opcode != + PDU_DATA_LLCTRL_TYPE_PAUSE_ENC_REQ))) { + conn->tx_ctrl = conn->tx_ctrl_last = conn->tx_head; + } + } + + if (conn->tx_head == conn->tx_ctrl) { + conn->tx_head = conn->tx_head->next; + if (conn->tx_ctrl == conn->tx_ctrl_last) { + conn->tx_ctrl = NULL; + conn->tx_ctrl_last = NULL; + } else { + conn->tx_ctrl = conn->tx_head; + } + + /* point to self to indicate a control PDU mem alloc */ + tx->next = tx; + } else { + if (conn->tx_head == conn->tx_data) { + conn->tx_data = conn->tx_data->next; + } + conn->tx_head = conn->tx_head->next; + + /* point to NULL to indicate a Data PDU mem alloc */ + tx->next = NULL; + } + + return tx; +} + static void tx_ull_flush(struct ll_conn *conn) { while (conn->tx_head) {