All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH] pegasus: Add blacklist support to fix Belkin bluetooth dongle.
@ 2008-07-21 18:02 Ben Collins
  0 siblings, 0 replies; only message in thread
From: Ben Collins @ 2008-07-21 18:02 UTC (permalink / raw)
  To: kernel list; +Cc: linux-usb

Reference: https://launchpad.net/bugs/140511
    
The Belkin bluetooth dongle unfortunately shares the vendor and device
id with the network adapter which causes lockups whenever the bluetooth
dongle is inserted.
    
CC: linux-usb@vger.kernel.org
Signed-off-by: Stefan Bader <stefan.bader@canonical.com>
Signed-off-by: Ben Collins <ben.collins@canonical.com>

diff --git a/drivers/net/usb/pegasus.c b/drivers/net/usb/pegasus.c
index b588c89..a84ba48 100644
--- a/drivers/net/usb/pegasus.c
+++ b/drivers/net/usb/pegasus.c
@@ -1285,6 +1285,21 @@ static void check_carrier(struct work_struct *work)
 	}
 }
 
+static int pegasus_blacklisted(struct usb_device *udev)
+{
+	struct usb_device_descriptor *udd = &udev->descriptor;
+
+	/* Special quirk to keep the driver from handling the Belkin Bluetooth
+	 * dongle which happens to have the same ID.
+	 */
+	if ((udd->idVendor == VENDOR_BELKIN && udd->idProduct == 0x0121) &&
+	    (udd->bDeviceClass == USB_CLASS_WIRELESS_CONTROLLER) &&
+	    (udd->bDeviceProtocol == 1))
+		return 1;
+
+	return 0;
+}
+
 static int pegasus_probe(struct usb_interface *intf,
 			 const struct usb_device_id *id)
 {
@@ -1296,6 +1311,12 @@ static int pegasus_probe(struct usb_interface *intf,
 	DECLARE_MAC_BUF(mac);
 
 	usb_get_dev(dev);
+
+	if (pegasus_blacklisted(dev)) {
+		res = -ENODEV;
+		goto out;
+	}
+
 	net = alloc_etherdev(sizeof(struct pegasus));
 	if (!net) {
 		dev_err(&intf->dev, "can't allocate %s\n", "device");



^ permalink raw reply related	[flat|nested] only message in thread

only message in thread, other threads:[~2008-07-21 18:02 UTC | newest]

Thread overview: (only message) (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2008-07-21 18:02 [PATCH] pegasus: Add blacklist support to fix Belkin bluetooth dongle Ben Collins

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.