Commit 0d8b93d0 authored by Marcel Holtmann's avatar Marcel Holtmann

[Bluetooth] Add module parameter for ignoring a device

This patch adds a module parameter to the USB Bluetooth drivers
for ignoring devices from their matching list. This makes it
possible for alternate drivers to grab the device.
Signed-off-by: default avatarMarcel Holtmann <marcel@holtmann.org>
parent 4d2e30d7
...@@ -46,6 +46,8 @@ ...@@ -46,6 +46,8 @@
#define VERSION "1.0" #define VERSION "1.0"
static int ignore = 0;
static struct usb_device_id bcm203x_table[] = { static struct usb_device_id bcm203x_table[] = {
/* Broadcom Blutonium (BCM2033) */ /* Broadcom Blutonium (BCM2033) */
{ USB_DEVICE(0x0a5c, 0x2033) }, { USB_DEVICE(0x0a5c, 0x2033) },
...@@ -55,7 +57,6 @@ static struct usb_device_id bcm203x_table[] = { ...@@ -55,7 +57,6 @@ static struct usb_device_id bcm203x_table[] = {
MODULE_DEVICE_TABLE(usb, bcm203x_table); MODULE_DEVICE_TABLE(usb, bcm203x_table);
#define BCM203X_ERROR 0 #define BCM203X_ERROR 0
#define BCM203X_RESET 1 #define BCM203X_RESET 1
#define BCM203X_LOAD_MINIDRV 2 #define BCM203X_LOAD_MINIDRV 2
...@@ -175,7 +176,7 @@ static int bcm203x_probe(struct usb_interface *intf, const struct usb_device_id ...@@ -175,7 +176,7 @@ static int bcm203x_probe(struct usb_interface *intf, const struct usb_device_id
BT_DBG("intf %p id %p", intf, id); BT_DBG("intf %p id %p", intf, id);
if (intf->cur_altsetting->desc.bInterfaceNumber != 0) if (ignore || (intf->cur_altsetting->desc.bInterfaceNumber != 0))
return -ENODEV; return -ENODEV;
data = kmalloc(sizeof(*data), GFP_KERNEL); data = kmalloc(sizeof(*data), GFP_KERNEL);
...@@ -304,6 +305,9 @@ static void __exit bcm203x_exit(void) ...@@ -304,6 +305,9 @@ static void __exit bcm203x_exit(void)
module_init(bcm203x_init); module_init(bcm203x_init);
module_exit(bcm203x_exit); module_exit(bcm203x_exit);
module_param(ignore, bool, 0644);
MODULE_PARM_DESC(ignore, "Ignore devices from the matching table");
MODULE_AUTHOR("Marcel Holtmann <marcel@holtmann.org>"); MODULE_AUTHOR("Marcel Holtmann <marcel@holtmann.org>");
MODULE_DESCRIPTION("Broadcom Blutonium firmware driver ver " VERSION); MODULE_DESCRIPTION("Broadcom Blutonium firmware driver ver " VERSION);
MODULE_VERSION(VERSION); MODULE_VERSION(VERSION);
......
...@@ -47,6 +47,8 @@ ...@@ -47,6 +47,8 @@
#define VERSION "1.1" #define VERSION "1.1"
static int ignore = 0;
static struct usb_driver bfusb_driver; static struct usb_driver bfusb_driver;
static struct usb_device_id bfusb_table[] = { static struct usb_device_id bfusb_table[] = {
...@@ -655,6 +657,9 @@ static int bfusb_probe(struct usb_interface *intf, const struct usb_device_id *i ...@@ -655,6 +657,9 @@ static int bfusb_probe(struct usb_interface *intf, const struct usb_device_id *i
BT_DBG("intf %p id %p", intf, id); BT_DBG("intf %p id %p", intf, id);
if (ignore)
return -ENODEV;
/* Check number of endpoints */ /* Check number of endpoints */
if (intf->cur_altsetting->desc.bNumEndpoints < 2) if (intf->cur_altsetting->desc.bNumEndpoints < 2)
return -EIO; return -EIO;
...@@ -792,6 +797,9 @@ static void __exit bfusb_exit(void) ...@@ -792,6 +797,9 @@ static void __exit bfusb_exit(void)
module_init(bfusb_init); module_init(bfusb_init);
module_exit(bfusb_exit); module_exit(bfusb_exit);
module_param(ignore, bool, 0644);
MODULE_PARM_DESC(ignore, "Ignore devices from the matching table");
MODULE_AUTHOR("Marcel Holtmann <marcel@holtmann.org>"); MODULE_AUTHOR("Marcel Holtmann <marcel@holtmann.org>");
MODULE_DESCRIPTION("BlueFRITZ! USB driver ver " VERSION); MODULE_DESCRIPTION("BlueFRITZ! USB driver ver " VERSION);
MODULE_VERSION(VERSION); MODULE_VERSION(VERSION);
......
...@@ -66,6 +66,7 @@ ...@@ -66,6 +66,7 @@
#define URB_ZERO_PACKET 0 #define URB_ZERO_PACKET 0
#endif #endif
static int ignore = 0;
static int reset = 0; static int reset = 0;
#ifdef CONFIG_BT_HCIUSB_SCO #ifdef CONFIG_BT_HCIUSB_SCO
...@@ -829,7 +830,7 @@ static int hci_usb_probe(struct usb_interface *intf, const struct usb_device_id ...@@ -829,7 +830,7 @@ static int hci_usb_probe(struct usb_interface *intf, const struct usb_device_id
id = match; id = match;
} }
if (id->driver_info & HCI_IGNORE) if (ignore || id->driver_info & HCI_IGNORE)
return -ENODEV; return -ENODEV;
if (intf->cur_altsetting->desc.bInterfaceNumber > 0) if (intf->cur_altsetting->desc.bInterfaceNumber > 0)
...@@ -1038,6 +1039,9 @@ static void __exit hci_usb_exit(void) ...@@ -1038,6 +1039,9 @@ static void __exit hci_usb_exit(void)
module_init(hci_usb_init); module_init(hci_usb_init);
module_exit(hci_usb_exit); module_exit(hci_usb_exit);
module_param(ignore, bool, 0644);
MODULE_PARM_DESC(ignore, "Ignore devices from the matching table");
module_param(reset, bool, 0644); module_param(reset, bool, 0644);
MODULE_PARM_DESC(reset, "Send HCI reset command on initialization"); MODULE_PARM_DESC(reset, "Send HCI reset command on initialization");
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment