Bluetooth: controller: Add flow control logging

When Controller to Host flow control is enabled, output informational
messages for certain operations to help tune and debug the feature.

Signed-off-by: Carles Cufi <carles.cufi@nordicsemi.no>
This commit is contained in:
Carles Cufi 2017-05-05 21:54:01 +02:00 committed by Johan Hedberg
commit ff2a85a587
2 changed files with 6 additions and 1 deletions

View file

@ -257,6 +257,7 @@ static void host_buffer_size(struct net_buf *buf, struct net_buf **evt)
return;
}
BT_DBG("FC: host buf size: %d", acl_pkts);
hci_hbuf_total = -acl_pkts;
}
@ -284,6 +285,7 @@ static void host_num_completed_packets(struct net_buf *buf,
count += sys_le16_to_cpu(cmd->h[i].count);
}
BT_DBG("FC: acked: %d", count);
hci_hbuf_acked += count;
k_poll_signal(hbuf_signal, 0x0);
}

View file

@ -165,6 +165,7 @@ static inline struct net_buf *process_node(struct radio_pdu_node_rx *node_rx)
if (pend || !hbuf_count) {
sys_slist_append(&hbuf_pend,
&node_rx->hdr.onion.node);
BT_DBG("FC: Queuing item: %d", class);
return NULL;
}
break;
@ -210,10 +211,12 @@ static inline struct net_buf *process_hbuf(void)
class = hci_get_class(node_rx);
switch (class) {
case HCI_CLASS_EVT_CONNECTION:
BT_DBG("FC: dequeueing event");
node = sys_slist_get(&hbuf_pend);
break;
case HCI_CLASS_ACL_DATA:
if (hbuf_count) {
BT_DBG("FC: dequeueing ACL data");
node = sys_slist_get(&hbuf_pend);
hbuf_count--;
} else {
@ -247,7 +250,7 @@ static inline struct net_buf *process_hbuf(void)
/* more to process, schedule an
* iteration
*/
BT_DBG("FC: signalling");
k_poll_signal(&hbuf_signal, 0x0);
}
}