]> 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 04cba6bf3d5477ffb6678e53187cde36e724f624..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)
 {
@@ -1297,8 +1308,15 @@ static int pegasus_probe(struct usb_interface *intf,
        pegasus_t *pegasus;
        int dev_index = id - pegasus_ids;
        int res = -ENOMEM;
+       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");
@@ -1306,7 +1324,6 @@ static int pegasus_probe(struct usb_interface *intf,
        }
 
        pegasus = netdev_priv(net);
-       memset(pegasus, 0, sizeof (struct pegasus));
        pegasus->dev_index = dev_index;
        init_waitqueue_head(&pegasus->ctrl_wait);
 
@@ -1322,7 +1339,6 @@ static int pegasus_probe(struct usb_interface *intf,
        pegasus->intf = intf;
        pegasus->usb = dev;
        pegasus->net = net;
-       SET_MODULE_OWNER(net);
        net->open = pegasus_open;
        net->stop = pegasus_close;
        net->watchdog_timeo = PEGASUS_TX_TIMEOUT;
@@ -1369,12 +1385,10 @@ static int pegasus_probe(struct usb_interface *intf,
        queue_delayed_work(pegasus_workqueue, &pegasus->carrier_check,
                                CARRIER_CHECK_DELAY);
 
-       dev_info(&intf->dev, "%s, %s, %02x:%02x:%02x:%02x:%02x:%02x\n",
-               net->name,
-               usb_dev_id[dev_index].name,
-               net->dev_addr [0], net->dev_addr [1],
-               net->dev_addr [2], net->dev_addr [3],
-               net->dev_addr [4], net->dev_addr [5]);
+       dev_info(&intf->dev, "%s, %s, %s\n",
+                net->name,
+                usb_dev_id[dev_index].name,
+                print_mac(mac, net->dev_addr));
        return 0;
 
 out3: