Skip to contentSkip to conversation

Bluetooth: bpa10x: Add support for set_diag driver callback

PATCH Applied Marcel Holtmann 2 participants 2 messages Oct 8, 2015 Bluetooth drivers

lore
Share & tools
lore

Marcel Holtmann

author maintainer
#0 lore raw

PATCH 1/1 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.

---
 drivers/bluetooth/bpa10x.c | 20 ++++++++++++++++++++
 1 file changed, 20 insertions(+)
drivers/bluetooth/bpa10x.c +20 -0
index 618b1ef20145..a1a0f80212b3 100644
@@ -438,6 +438,25 @@ static int bpa10x_send_frame(struct hci_dev *hdev, struct sk_buff *skb)
 	return 0;
 }
 
+static int bpa10x_set_diag(struct hci_dev *hdev, bool enable)
+{
+	const u8 req[] = { 0x00, enable };
+	struct sk_buff *skb;
+
+	BT_DBG("%s", hdev->name);
+
+	if (!test_bit(HCI_RUNNING, &hdev->flags))
+		return -ENETDOWN;
+
+	/* Enable sniffer operation */
+	skb = __hci_cmd_sync(hdev, 0xfc0e, sizeof(req), req, HCI_INIT_TIMEOUT);
+	if (IS_ERR(skb))
+		return PTR_ERR(skb);
+
+	kfree_skb(skb);
+	return 0;
+}
+
 static int bpa10x_probe(struct usb_interface *intf, const struct usb_device_id *id)
 {
 	struct bpa10x_data *data;
@@ -474,6 +493,7 @@ static int bpa10x_probe(struct usb_interface *intf, const struct usb_device_id *
 	hdev->flush    = bpa10x_flush;
 	hdev->setup    = bpa10x_setup;
 	hdev->send     = bpa10x_send_frame;
+	hdev->set_diag = bpa10x_set_diag;
 
 	set_bit(HCI_QUIRK_RESET_ON_CLOSE, &hdev->quirks);
 
Signature · 1 line
2.4.3
#1 lore raw

Hi Marcel,

Quoted 7 lines · Marcel Holtmann

The BPA-10x devices support tracing operation. Use the set_diag driver callback to allow enabling and disabling that functionality.

---
 drivers/bluetooth/bpa10x.c | 20 ++++++++++++++++++++
 1 file changed, 20 insertions(+)

Applied to bluetooth-next. Thanks.

Johan