Bluetooth: Add support for vendor specific diagnostic channel
Introduce hci_recv_diag function for HCI drivers to allow sending vendor specific diagnostic messages into the Bluetooth core stack. The messages are not processed, but they are forwarded to the monitor channel and can be retrieved by user space diagnostic tools. Signed-off-by: Marcel Holtmann <marcel@holtmann.org> Signed-off-by: Johan Hedberg <johan.hedberg@intel.com>
This commit is contained in:
parent
6c566dd5a1
commit
e875ff8407
5 changed files with 21 additions and 0 deletions
|
@ -3493,6 +3493,21 @@ int hci_recv_frame(struct hci_dev *hdev, struct sk_buff *skb)
|
|||
}
|
||||
EXPORT_SYMBOL(hci_recv_frame);
|
||||
|
||||
/* Receive diagnostic message from HCI drivers */
|
||||
int hci_recv_diag(struct hci_dev *hdev, struct sk_buff *skb)
|
||||
{
|
||||
/* Time stamp */
|
||||
__net_timestamp(skb);
|
||||
|
||||
/* Mark as diagnostic packet and send to monitor */
|
||||
bt_cb(skb)->pkt_type = HCI_DIAG_PKT;
|
||||
hci_send_to_monitor(hdev, skb);
|
||||
|
||||
kfree_skb(skb);
|
||||
return 0;
|
||||
}
|
||||
EXPORT_SYMBOL(hci_recv_diag);
|
||||
|
||||
/* ---- Interface to upper protocols ---- */
|
||||
|
||||
int hci_register_cb(struct hci_cb *cb)
|
||||
|
|
|
@ -279,6 +279,9 @@ void hci_send_to_monitor(struct hci_dev *hdev, struct sk_buff *skb)
|
|||
else
|
||||
opcode = cpu_to_le16(HCI_MON_SCO_TX_PKT);
|
||||
break;
|
||||
case HCI_DIAG_PKT:
|
||||
opcode = cpu_to_le16(HCI_MON_VENDOR_DIAG);
|
||||
break;
|
||||
default:
|
||||
return;
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue