]> err.no Git - linux-2.6/blobdiff - drivers/net/usb/pegasus.c
Merge branch 'for-linus' of git://neil.brown.name/md
[linux-2.6] / drivers / net / usb / pegasus.c
index d1ed68a11e70192ef320c1c15c52c060b952cd4b..a84ba487c713d705d7052963d3e230ebf26dc746 100644 (file)
@@ -1128,12 +1128,8 @@ pegasus_get_settings(struct net_device *dev, struct ethtool_cmd *ecmd)
 {
        pegasus_t *pegasus;
 
-       if (in_atomic())
-               return 0;
-
        pegasus = netdev_priv(dev);
        mii_ethtool_gset(&pegasus->mii, ecmd);
-
        return 0;
 }
 
@@ -1289,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)
 {
@@ -1300,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");