Bluetooth: controller: Introduce a new LLCP class
In order to be able to distinguish between connection-related events that are generated by the controller and others genrated by LL control procedures, introduce a new class for LLCP. Signed-off-by: Carles Cufi <carles.cufi@nordicsemi.no>
This commit is contained in:
parent
058724f329
commit
b37be1c0c5
3 changed files with 12 additions and 6 deletions
|
@ -3494,7 +3494,7 @@ u8_t hci_get_class(struct node_rx_pdu *node_rx)
|
||||||
|
|
||||||
#if defined(CONFIG_BT_CONN)
|
#if defined(CONFIG_BT_CONN)
|
||||||
} else if (pdu_data->ll_id == PDU_DATA_LLID_CTRL) {
|
} else if (pdu_data->ll_id == PDU_DATA_LLID_CTRL) {
|
||||||
return HCI_CLASS_EVT_CONNECTION;
|
return HCI_CLASS_EVT_LLCP;
|
||||||
} else {
|
} else {
|
||||||
return HCI_CLASS_ACL_DATA;
|
return HCI_CLASS_ACL_DATA;
|
||||||
}
|
}
|
||||||
|
|
|
@ -148,6 +148,7 @@ static inline struct net_buf *encode_node(struct node_rx_pdu *node_rx,
|
||||||
case HCI_CLASS_EVT_DISCARDABLE:
|
case HCI_CLASS_EVT_DISCARDABLE:
|
||||||
case HCI_CLASS_EVT_REQUIRED:
|
case HCI_CLASS_EVT_REQUIRED:
|
||||||
case HCI_CLASS_EVT_CONNECTION:
|
case HCI_CLASS_EVT_CONNECTION:
|
||||||
|
case HCI_CLASS_EVT_LLCP:
|
||||||
if (class == HCI_CLASS_EVT_DISCARDABLE) {
|
if (class == HCI_CLASS_EVT_DISCARDABLE) {
|
||||||
buf = bt_buf_get_evt(BT_HCI_EVT_UNKNOWN, true,
|
buf = bt_buf_get_evt(BT_HCI_EVT_UNKNOWN, true,
|
||||||
K_NO_WAIT);
|
K_NO_WAIT);
|
||||||
|
@ -199,6 +200,7 @@ static inline struct net_buf *process_node(struct node_rx_pdu *node_rx)
|
||||||
case HCI_CLASS_EVT_REQUIRED:
|
case HCI_CLASS_EVT_REQUIRED:
|
||||||
break;
|
break;
|
||||||
case HCI_CLASS_EVT_CONNECTION:
|
case HCI_CLASS_EVT_CONNECTION:
|
||||||
|
case HCI_CLASS_EVT_LLCP:
|
||||||
/* for conn-related events, only pend is relevant */
|
/* for conn-related events, only pend is relevant */
|
||||||
hbuf_count = 1;
|
hbuf_count = 1;
|
||||||
/* fallthrough */
|
/* fallthrough */
|
||||||
|
@ -256,6 +258,7 @@ static inline struct net_buf *process_hbuf(struct node_rx_pdu *n)
|
||||||
class = node_rx->hdr.user_meta;
|
class = node_rx->hdr.user_meta;
|
||||||
if (n) {
|
if (n) {
|
||||||
if (class == HCI_CLASS_EVT_CONNECTION ||
|
if (class == HCI_CLASS_EVT_CONNECTION ||
|
||||||
|
class == HCI_CLASS_EVT_LLCP ||
|
||||||
(class == HCI_CLASS_ACL_DATA && hbuf_count)) {
|
(class == HCI_CLASS_ACL_DATA && hbuf_count)) {
|
||||||
/* node to process later, schedule an iteration */
|
/* node to process later, schedule an iteration */
|
||||||
BT_DBG("FC: signalling");
|
BT_DBG("FC: signalling");
|
||||||
|
@ -266,6 +269,7 @@ static inline struct net_buf *process_hbuf(struct node_rx_pdu *n)
|
||||||
|
|
||||||
switch (class) {
|
switch (class) {
|
||||||
case HCI_CLASS_EVT_CONNECTION:
|
case HCI_CLASS_EVT_CONNECTION:
|
||||||
|
case HCI_CLASS_EVT_LLCP:
|
||||||
BT_DBG("FC: dequeueing event");
|
BT_DBG("FC: dequeueing event");
|
||||||
(void) sys_slist_get(&hbuf_pend);
|
(void) sys_slist_get(&hbuf_pend);
|
||||||
break;
|
break;
|
||||||
|
@ -295,6 +299,7 @@ static inline struct net_buf *process_hbuf(struct node_rx_pdu *n)
|
||||||
class = node_rx->hdr.user_meta;
|
class = node_rx->hdr.user_meta;
|
||||||
|
|
||||||
if (class == HCI_CLASS_EVT_CONNECTION ||
|
if (class == HCI_CLASS_EVT_CONNECTION ||
|
||||||
|
class == HCI_CLASS_EVT_LLCP ||
|
||||||
(class == HCI_CLASS_ACL_DATA && hbuf_count)) {
|
(class == HCI_CLASS_ACL_DATA && hbuf_count)) {
|
||||||
/* more to process, schedule an
|
/* more to process, schedule an
|
||||||
* iteration
|
* iteration
|
||||||
|
|
|
@ -14,19 +14,20 @@ extern atomic_t hci_state_mask;
|
||||||
#define HCI_STATE_BIT_RESET 0
|
#define HCI_STATE_BIT_RESET 0
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
#define HCI_CLASS_EVT_REQUIRED 0 /* Mesh and connection-{established,
|
#define HCI_CLASS_NONE 0 /* Invalid class */
|
||||||
|
#define HCI_CLASS_EVT_REQUIRED 1 /* Mesh and connection-{established,
|
||||||
* disconnected}
|
* disconnected}
|
||||||
*/
|
*/
|
||||||
#define HCI_CLASS_EVT_DISCARDABLE 1 /* Best-effort reporting. Discardable
|
#define HCI_CLASS_EVT_DISCARDABLE 2 /* Best-effort reporting. Discardable
|
||||||
* over HCI in case of overflow
|
* over HCI in case of overflow
|
||||||
*/
|
*/
|
||||||
#define HCI_CLASS_EVT_CONNECTION 2 /* Connection management; e.g.
|
#define HCI_CLASS_EVT_CONNECTION 3 /* Connection management; e.g.
|
||||||
* terminate, update, encryption
|
* terminate, update, encryption
|
||||||
*/
|
*/
|
||||||
#define HCI_CLASS_ACL_DATA 3 /* Asynchronous Connection Less (general
|
#define HCI_CLASS_EVT_LLCP 4 /* LL Control Procedures */
|
||||||
|
#define HCI_CLASS_ACL_DATA 5 /* Asynchronous Connection Less (general
|
||||||
* data)
|
* data)
|
||||||
*/
|
*/
|
||||||
#define HCI_CLASS_NONE 0xFF /* Invalid class */
|
|
||||||
|
|
||||||
|
|
||||||
#if defined(CONFIG_BT_LL_SW_SPLIT)
|
#if defined(CONFIG_BT_LL_SW_SPLIT)
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue