btmon获取hci数据流程
背景
最近在看蓝牙相关的驱动代码,追到hci接收数据处理函数hci_rx_work()(net/bluetooth/hci_core.c),
瞄到下面一段代码:
C
...
while ((skb = skb_dequeue(&hdev->rx_q))) {
/* Send copy to monitor */
hci_send_to_monitor(hdev, skb);
...
}
在hci发送数据的处理函数hci_send_frame()中也有类似的代码片段:
C
...
/* Time stamp */
__net_timestamp(skb); /* Send copy to monitor */
hci_send_to_monitor(hdev, skb); if (atomic_read(&hdev->promisc)) {
/* Send copy to the sockets */
hci_send_to_sock(hdev, skb);
}
...
作者: Shell
标签:hdev,monitor,...,流程,send,btmon,skb,hci From: https://blog.51cto.com/winter91/8284454