Skip to content

Commit ddd68ec

Browse files
holtmannJohan Hedberg
authored and
Johan Hedberg
committed
Bluetooth: bpa10x: Read revision information in setup stage
For debugging pruposes, read the revision string of the BPA-10x devices and print it. For example one of the latest devices respond with the string SNIF_102,BB930,02/01/18,10:37:56. < HCI Command: Vendor (0x3f|0x000e) plen 1 07 . > HCI Event: Command Complete (0x0e) plen 49 Vendor (0x3f|0x000e) ncmd 1 Status: Success (0x00) 53 4e 49 46 5f 31 30 32 2c 42 42 39 33 30 2c 30 SNIF_102,BB930,0 32 2f 30 31 2f 31 38 2c 31 30 3a 33 37 3a 35 36 2/01/18,10:37:56 00 00 00 00 00 00 00 00 00 00 00 00 00 ............. Signed-off-by: Marcel Holtmann <marcel@holtmann.org> Signed-off-by: Johan Hedberg <johan.hedberg@intel.com>
1 parent acc649c commit ddd68ec

File tree

1 file changed

+19
-0
lines changed

1 file changed

+19
-0
lines changed

drivers/bluetooth/bpa10x.c

Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -342,6 +342,24 @@ static int bpa10x_flush(struct hci_dev *hdev)
342342
return 0;
343343
}
344344

345+
static int bpa10x_setup(struct hci_dev *hdev)
346+
{
347+
const u8 req[] = { 0x07 };
348+
struct sk_buff *skb;
349+
350+
BT_DBG("%s", hdev->name);
351+
352+
/* Read revision string */
353+
skb = __hci_cmd_sync(hdev, 0xfc0e, sizeof(req), req, HCI_INIT_TIMEOUT);
354+
if (IS_ERR(skb))
355+
return PTR_ERR(skb);
356+
357+
BT_INFO("%s: %s", hdev->name, (char *)(skb->data + 1));
358+
359+
kfree_skb(skb);
360+
return 0;
361+
}
362+
345363
static int bpa10x_send_frame(struct hci_dev *hdev, struct sk_buff *skb)
346364
{
347365
struct bpa10x_data *data = hci_get_drvdata(hdev);
@@ -454,6 +472,7 @@ static int bpa10x_probe(struct usb_interface *intf, const struct usb_device_id *
454472
hdev->open = bpa10x_open;
455473
hdev->close = bpa10x_close;
456474
hdev->flush = bpa10x_flush;
475+
hdev->setup = bpa10x_setup;
457476
hdev->send = bpa10x_send_frame;
458477

459478
set_bit(HCI_QUIRK_RESET_ON_CLOSE, &hdev->quirks);

0 commit comments

Comments
 (0)