From 39381f7015cd6959fb0375db8cfbe5b3bbe17a99 Mon Sep 17 00:00:00 2001 From: Marcel Holtmann Date: Thu, 18 Dec 2003 14:23:10 +0100 Subject: [PATCH] [Bluetooth] Add support for the Digianswer USB devices The Digianswer USB Bluetooth devices uses a bRequestType of 0x40 for HCI commands, but the Bluetooth specification says that the correct value is 0x20. This patch sets the needed value according to the vendor and product id's of the Bluetooth device. --- drivers/bluetooth/hci_usb.c | 10 +++++++++- drivers/bluetooth/hci_usb.h | 5 +++++ 2 files changed, 14 insertions(+), 1 deletion(-) diff --git a/drivers/bluetooth/hci_usb.c b/drivers/bluetooth/hci_usb.c index b5ed236a4c793..82c1aa0cf6af2 100644 --- a/drivers/bluetooth/hci_usb.c +++ b/drivers/bluetooth/hci_usb.c @@ -70,6 +70,9 @@ static struct usb_driver hci_usb_driver; static struct usb_device_id bluetooth_ids[] = { + /* Digianswer device */ + { USB_DEVICE(0x08fd, 0x0001), driver_info: HCI_DIGIANSWER }, + /* Generic Bluetooth USB device */ { USB_DEVICE_INFO(HCI_DEV_CLASS, HCI_DEV_SUBCLASS, HCI_DEV_PROTOCOL) }, @@ -426,7 +429,7 @@ static inline int hci_usb_send_ctrl(struct hci_usb *husb, struct sk_buff *skb) } else dr = (void *) _urb->urb.setup_packet; - dr->bRequestType = HCI_CTRL_REQ; + dr->bRequestType = husb->ctrl_req; dr->bRequest = 0; dr->wIndex = 0; dr->wValue = 0; @@ -872,6 +875,11 @@ int hci_usb_probe(struct usb_interface *intf, const struct usb_device_id *id) husb->bulk_in_ep = bulk_in_ep[0]; husb->intr_in_ep = intr_in_ep[0]; + if (id->driver_info & HCI_DIGIANSWER) + husb->ctrl_req = HCI_DIGI_REQ; + else + husb->ctrl_req = HCI_CTRL_REQ; + #ifdef CONFIG_BT_USB_SCO if (isoc_iface) { BT_DBG("isoc ifnum %d alts %d", isoc_ifnum, isoc_alts); diff --git a/drivers/bluetooth/hci_usb.h b/drivers/bluetooth/hci_usb.h index 784d39ac61fd9..08a376c005b3e 100644 --- a/drivers/bluetooth/hci_usb.h +++ b/drivers/bluetooth/hci_usb.h @@ -35,6 +35,9 @@ #define HCI_DEV_PROTOCOL 0x01 /* Bluetooth programming protocol */ #define HCI_CTRL_REQ 0x20 +#define HCI_DIGI_REQ 0x40 + +#define HCI_DIGIANSWER 0x01 #define HCI_MAX_IFACE_NUM 3 @@ -122,6 +125,8 @@ struct hci_usb { struct usb_host_endpoint *isoc_out_ep; struct usb_host_endpoint *isoc_in_ep; + __u8 ctrl_req; + struct sk_buff_head transmit_q[4]; struct sk_buff *reassembly[4]; // Reassembly buffers -- 2.53.0