From 2c72497dab5c04a1a981b046804118e37b5379e2 Mon Sep 17 00:00:00 2001 From: Marcel Holtmann Date: Sat, 27 Dec 2003 21:54:39 +0100 Subject: [PATCH] [Bluetooth] Improve blacklist handling This patch uses the default ID list to ignore the Broadcom BCM2033 devices without firmware. If it not handles a device or a interface it now returns ENODEV to not fill the kernel log with unneeded errors. --- drivers/bluetooth/hci_usb.c | 18 ++++++++---------- drivers/bluetooth/hci_usb.h | 3 ++- 2 files changed, 10 insertions(+), 11 deletions(-) diff --git a/drivers/bluetooth/hci_usb.c b/drivers/bluetooth/hci_usb.c index 4511511cb4755..14b8350652e48 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[] = { + /* Broadcom BCM2033 without firmware */ + { USB_DEVICE(0x0a5c, 0x2033), driver_info: HCI_IGNORE }, + /* Digianswer device */ { USB_DEVICE(0x08fd, 0x0001), driver_info: HCI_DIGIANSWER }, @@ -90,13 +93,6 @@ static struct usb_device_id bluetooth_ids[] = { MODULE_DEVICE_TABLE (usb, bluetooth_ids); -static struct usb_device_id ignore_ids[] = { - /* Broadcom BCM2033 without firmware */ - { USB_DEVICE(0x0a5c, 0x2033) }, - - { } /* Terminating entry */ -}; - struct _urb *_urb_alloc(int isoc, int gfp) { struct _urb *_urb = kmalloc(sizeof(struct _urb) + @@ -792,9 +788,11 @@ int hci_usb_probe(struct usb_interface *intf, const struct usb_device_id *id) iface = udev->actconfig->interface[0]; - /* Check our black list */ - if (usb_match_id(intf, ignore_ids)) - return -EIO; + if (id->driver_info & HCI_IGNORE) + return -ENODEV; + + if (intf->altsetting->desc.bInterfaceNumber > 0) + return -ENODEV; /* Check number of endpoints */ if (intf->altsetting[0].desc.bNumEndpoints < 3) diff --git a/drivers/bluetooth/hci_usb.h b/drivers/bluetooth/hci_usb.h index 08a376c005b3e..e2ba50da30210 100644 --- a/drivers/bluetooth/hci_usb.h +++ b/drivers/bluetooth/hci_usb.h @@ -37,7 +37,8 @@ #define HCI_CTRL_REQ 0x20 #define HCI_DIGI_REQ 0x40 -#define HCI_DIGIANSWER 0x01 +#define HCI_IGNORE 0x01 +#define HCI_DIGIANSWER 0x02 #define HCI_MAX_IFACE_NUM 3 -- 2.53.0