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:
Carles Cufi 2019-10-08 19:51:24 +02:00 committed by Carles Cufí
commit b37be1c0c5
3 changed files with 12 additions and 6 deletions

View file

@ -3494,7 +3494,7 @@ u8_t hci_get_class(struct node_rx_pdu *node_rx)
#if defined(CONFIG_BT_CONN)
} else if (pdu_data->ll_id == PDU_DATA_LLID_CTRL) {
return HCI_CLASS_EVT_CONNECTION;
return HCI_CLASS_EVT_LLCP;
} else {
return HCI_CLASS_ACL_DATA;
}

View file

@ -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_REQUIRED:
case HCI_CLASS_EVT_CONNECTION:
case HCI_CLASS_EVT_LLCP:
if (class == HCI_CLASS_EVT_DISCARDABLE) {
buf = bt_buf_get_evt(BT_HCI_EVT_UNKNOWN, true,
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:
break;
case HCI_CLASS_EVT_CONNECTION:
case HCI_CLASS_EVT_LLCP:
/* for conn-related events, only pend is relevant */
hbuf_count = 1;
/* fallthrough */
@ -256,6 +258,7 @@ static inline struct net_buf *process_hbuf(struct node_rx_pdu *n)
class = node_rx->hdr.user_meta;
if (n) {
if (class == HCI_CLASS_EVT_CONNECTION ||
class == HCI_CLASS_EVT_LLCP ||
(class == HCI_CLASS_ACL_DATA && hbuf_count)) {
/* node to process later, schedule an iteration */
BT_DBG("FC: signalling");
@ -266,6 +269,7 @@ static inline struct net_buf *process_hbuf(struct node_rx_pdu *n)
switch (class) {
case HCI_CLASS_EVT_CONNECTION:
case HCI_CLASS_EVT_LLCP:
BT_DBG("FC: dequeueing event");
(void) sys_slist_get(&hbuf_pend);
break;
@ -295,6 +299,7 @@ static inline struct net_buf *process_hbuf(struct node_rx_pdu *n)
class = node_rx->hdr.user_meta;
if (class == HCI_CLASS_EVT_CONNECTION ||
class == HCI_CLASS_EVT_LLCP ||
(class == HCI_CLASS_ACL_DATA && hbuf_count)) {
/* more to process, schedule an
* iteration

View file

@ -14,19 +14,20 @@ extern atomic_t hci_state_mask;
#define HCI_STATE_BIT_RESET 0
#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}
*/
#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
*/
#define HCI_CLASS_EVT_CONNECTION 2 /* Connection management; e.g.
#define HCI_CLASS_EVT_CONNECTION 3 /* Connection management; e.g.
* 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)
*/
#define HCI_CLASS_NONE 0xFF /* Invalid class */
#if defined(CONFIG_BT_LL_SW_SPLIT)