zephyr/subsys/bluetooth/controller/ll_sw/ull_tx_queue.h
Andries Kruithof f023b5f611 Bluetooth: controller: push topic branch to main
Pushes all work done in the topic-ble-llcp branch into main branch
This is a refactoring of the LL control procedures; the refactored
control procedures are hidden behind a KConfig option and
per default disabled

Goal of the refactoring:

close issue Link Layer Control Procedure overhaul #15256
make it easier to add/update control procedures
Refactoring consists in principal of writing explicit state machines
for the control procedures.
To reduce the risk of regression errors unit-tests have been added

Following control procedures are implemented:

Connection update procedure
Channel map update procedure
Encryption procedure
Feature exchange procedure
Version exchange procedure
ACL termination procedure
Connection parameters request procedure
LE Ping procedure
Data Length Update procedure
PHY update procedure
Min. nr. Of channels used procedure
Constant Tone extension request procedure

This is a joined work by the people listed in the signed-off-by
list (in alphabetical order)

Signed-off-by: Andries Kruithof Andries.Kruithof@nordicsemi.no
Signed-off-by: Erik Brockhoff erbr@oticon.com
Signed-off-by: Piotr Pryga piotr.pryga@nordicsemi.no
Signed-off-by: Szymon Janc szymon.janc@codecoup.pl
Signed-off-by: Thomas Ebert Hansen thoh@oticon.com
Signed-off-by: Tommie Skriver tosk@demant.com

Signed-off-by: Andries Kruithof <Andries.Kruithof@nordicsemi.no>
2021-11-16 21:24:37 -05:00

73 lines
1.6 KiB
C

/*
* Copyright (c) 2020 Demant
*
* SPDX-License-Identifier: Apache-2.0
*/
#include <sys/slist.h>
struct ull_tx_q {
uint8_t pause_data; /* Data pause state of the tx queue */
sys_slist_t tx_list; /* Data and control node_tx list */
sys_slist_t data_list; /* Data node_tx wait list */
};
/* Forward declaration of node_tx */
struct node_tx;
/**
* @brief Initialize a tx queue.
*
* @param ull_tx_q Address of tx queue.
*/
void ull_tx_q_init(struct ull_tx_q *queue);
/**
* @brief Pause the data path of a tx queue.
*
* @param ull_tx_q Address of tx queue.
*/
void ull_tx_q_pause_data(struct ull_tx_q *queue);
/**
* @brief Resume the data path of a tx queue
*
* @param ull_tx_q Address of tx queue.
*/
void ull_tx_q_resume_data(struct ull_tx_q *queue);
/**
* @brief Enqueue a tx node in the data path of a tx queue
*
* @param ull_tx_q Address of tx queue.
* @param tx Address of tx node to enqueue.
*/
void ull_tx_q_enqueue_data(struct ull_tx_q *queue, struct node_tx *tx);
/**
* @brief Enqueue a tx node in the control path of a tx queue
*
* @param ull_tx_q Address of tx queue.
* @param tx Address of tx node to enqueue.
*/
void ull_tx_q_enqueue_ctrl(struct ull_tx_q *queue, struct node_tx *tx);
/**
* @brief Peek head tx node of tx queue.
*
* @param ull_tx_q Address of tx queue.
*
* @return Head tx node of the tx queue.
*/
struct node_tx *ull_tx_q_peek(struct ull_tx_q *queue);
/**
* @brief Dequeue a tx node from a tx queue.
*
* @param ull_tx_q Address of tx queue.
*
* @return Head tx node of the tx queue.
*/
struct node_tx *ull_tx_q_dequeue(struct ull_tx_q *queue);