Skip to content

Commit 881f7e8

Browse files
holtmannJohan Hedberg
authored and
Johan Hedberg
committed
Bluetooth: bpa10x: Add support for set_diag driver callback
The BPA-10x devices support tracing operation. Use the set_diag driver callback to allow enabling and disabling that functionality. Signed-off-by: Marcel Holtmann <marcel@holtmann.org> Signed-off-by: Johan Hedberg <johan.hedberg@intel.com>
1 parent ddd68ec commit 881f7e8

File tree

1 file changed

+20
-0
lines changed

1 file changed

+20
-0
lines changed

drivers/bluetooth/bpa10x.c

Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -438,6 +438,25 @@ static int bpa10x_send_frame(struct hci_dev *hdev, struct sk_buff *skb)
438438
return 0;
439439
}
440440

441+
static int bpa10x_set_diag(struct hci_dev *hdev, bool enable)
442+
{
443+
const u8 req[] = { 0x00, enable };
444+
struct sk_buff *skb;
445+
446+
BT_DBG("%s", hdev->name);
447+
448+
if (!test_bit(HCI_RUNNING, &hdev->flags))
449+
return -ENETDOWN;
450+
451+
/* Enable sniffer operation */
452+
skb = __hci_cmd_sync(hdev, 0xfc0e, sizeof(req), req, HCI_INIT_TIMEOUT);
453+
if (IS_ERR(skb))
454+
return PTR_ERR(skb);
455+
456+
kfree_skb(skb);
457+
return 0;
458+
}
459+
441460
static int bpa10x_probe(struct usb_interface *intf, const struct usb_device_id *id)
442461
{
443462
struct bpa10x_data *data;
@@ -474,6 +493,7 @@ static int bpa10x_probe(struct usb_interface *intf, const struct usb_device_id *
474493
hdev->flush = bpa10x_flush;
475494
hdev->setup = bpa10x_setup;
476495
hdev->send = bpa10x_send_frame;
496+
hdev->set_diag = bpa10x_set_diag;
477497

478498
set_bit(HCI_QUIRK_RESET_ON_CLOSE, &hdev->quirks);
479499

0 commit comments

Comments
 (0)