mirror of
https://github.com/torvalds/linux.git
synced 2025-12-07 20:06:24 +00:00
Bluetooth: Add support for HCI monitor channel
The HCI monitor channel can be used to monitor all packets and events from the Bluetooth subsystem. The monitor is not bound to any specific HCI device and allows even capturing multiple devices at the same time. Signed-off-by: Marcel Holtmann <marcel@holtmann.org> Signed-off-by: Johan Hedberg <johan.hedberg@intel.com>
This commit is contained in:
committed by
Johan Hedberg
parent
040030ef7d
commit
cd82e61c11
@@ -2113,10 +2113,14 @@ static int hci_send_frame(struct sk_buff *skb)
|
||||
|
||||
BT_DBG("%s type %d len %d", hdev->name, bt_cb(skb)->pkt_type, skb->len);
|
||||
|
||||
if (atomic_read(&hdev->promisc)) {
|
||||
/* Time stamp */
|
||||
__net_timestamp(skb);
|
||||
/* 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);
|
||||
}
|
||||
|
||||
@@ -2802,6 +2806,9 @@ static void hci_rx_work(struct work_struct *work)
|
||||
BT_DBG("%s", hdev->name);
|
||||
|
||||
while ((skb = skb_dequeue(&hdev->rx_q))) {
|
||||
/* 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);
|
||||
|
||||
Reference in New Issue
Block a user