]> git.karo-electronics.de Git - karo-tx-linux.git/blobdiff - drivers/staging/otus/zdusb.c
otus/zdusb.c: additional USB idnetifier
[karo-tx-linux.git] / drivers / staging / otus / zdusb.c
index 4ebbe717f94e75804502c3abbef0c9ca2ea4a5ed..2a6d937ba5e875fc0d3f1878122d68c992063d96 100644 (file)
@@ -24,7 +24,6 @@
 /*                                                                      */
 /************************************************************************/
 
-#include <linux/version.h>
 #ifdef MODVERSIONS
 #include <linux/modversions.h>
 #endif
@@ -49,7 +48,8 @@ static const char driver_name[] = "Otus";
 static struct usb_device_id zd1221_ids [] = {
        { USB_DEVICE(VENDOR_ATHR, PRODUCT_AR9170) },
         { USB_DEVICE(VENDOR_DLINK, PRODUCT_DWA160A) },
-       { USB_DEVICE(0x0846, 0x9010) },
+       { USB_DEVICE(VENDOR_NETGEAR, PRODUCT_WNDA3100) },
+       { USB_DEVICE(VENDOR_NETGEAR, PRODUCT_WN111v2) },
        { }                                     /* Terminating entry */
 };
 
@@ -69,26 +69,17 @@ extern struct zsWdsStruct wds[ZM_WDS_PORT_NUMBER];
 /* VAP */
 extern struct zsVapStruct vap[ZM_VAP_PORT_NUMBER];
 
-#if (LINUX_VERSION_CODE < KERNEL_VERSION(2,5,0))
-static void *zfLnxProbe(struct usb_device *dev, unsigned int ifnum,
-        const struct usb_device_id *id)
-{
-    struct usb_interface *interface = &dev->actconfig->interface[ifnum];
-#else
 static int zfLnxProbe(struct usb_interface *interface,
        const struct usb_device_id *id)
 {
     struct usb_device *dev = interface_to_usbdev(interface);
-#endif
 
     struct net_device *net = NULL;
     struct usbdrv_private *macp = NULL;
     int vendor_id, product_id;
     int result = 0;
 
-#if (LINUX_VERSION_CODE >= KERNEL_VERSION(2,5,0))
     usb_get_dev(dev);
-#endif
 
     vendor_id = dev->descriptor.idVendor;
     product_id = dev->descriptor.idProduct;
@@ -103,15 +94,6 @@ static int zfLnxProbe(struct usb_interface *interface,
         printk(KERN_NOTICE "USB 1.1 Host\n");
 #endif
 
-#if (LINUX_VERSION_CODE < KERNEL_VERSION(2,5,0))
-    if (usb_set_configuration(dev, dev->config[0].bConfigurationValue))
-    {
-        printk(KERN_ERR "usb_set_configuration() failed\n");
-        result = -EIO;
-        goto fail;
-    }
-#endif
-
     if (!(macp = kmalloc(sizeof(struct usbdrv_private), GFP_KERNEL)))
     {
         printk(KERN_ERR "out of memory allocating device structure\n");
@@ -122,10 +104,6 @@ static int zfLnxProbe(struct usb_interface *interface,
     /* Zero the memory */
     memset(macp, 0, sizeof(struct usbdrv_private));
 
-#if (LINUX_VERSION_CODE < KERNEL_VERSION(2,5,0))
-    usb_inc_dev_use(dev);
-#endif
-
     net = alloc_etherdev(0);
 
     if (net == NULL)
@@ -137,10 +115,6 @@ static int zfLnxProbe(struct usb_interface *interface,
 
     strcpy(net->name, "ath%d");
 
-#if (LINUX_VERSION_CODE < KERNEL_VERSION(2,6,24))
-    SET_MODULE_OWNER(net);
-#endif
-
     net->ml_priv = macp;   //kernel 2.6
     macp->udev = dev;
     macp->device = net;
@@ -166,16 +140,12 @@ static int zfLnxProbe(struct usb_interface *interface,
     }
     else
     {
-#if (LINUX_VERSION_CODE >= KERNEL_VERSION(2,5,0))
         usb_set_intfdata(interface, macp);
         SET_NETDEV_DEV(net, &interface->dev);
-#endif
 
         if (register_netdev(net) != 0)
         {
-#if (LINUX_VERSION_CODE >= KERNEL_VERSION(2,5,0))
             usb_set_intfdata(interface, NULL);
-#endif
             goto fail3;
         }
     }
@@ -191,30 +161,16 @@ fail1:
     kfree(macp);
 
 fail:
-#if (LINUX_VERSION_CODE >= KERNEL_VERSION(2,5,0))
     usb_put_dev(dev);
-#endif
     macp = NULL;
 
 done:
-#if (LINUX_VERSION_CODE < KERNEL_VERSION(2,5,0))
-    return macp;
-#else
     return result;
-#endif
 }
 
-#if (LINUX_VERSION_CODE < KERNEL_VERSION(2,5,0))
-static void zfLnxDisconnect(struct usb_device *dev, void *ptr)
-#else
 static void zfLnxDisconnect(struct usb_interface *interface)
-#endif
 {
-#if (LINUX_VERSION_CODE >= KERNEL_VERSION(2,5,0))
     struct usbdrv_private *macp = (struct usbdrv_private *) usb_get_intfdata(interface);
-#else
-    struct usbdrv_private *macp = (struct usbdrv_private *)ptr;
-#endif
 
     printk(KERN_DEBUG "zfLnxDisconnect\n");
 
@@ -246,11 +202,7 @@ static void zfLnxDisconnect(struct usb_interface *interface)
 
     unregister_netdev(macp->device);
 
-#if (LINUX_VERSION_CODE < KERNEL_VERSION(2,5,0))
-    usb_dec_dev_use(dev);
-#else
     usb_put_dev(interface_to_usbdev(interface));
-#endif
 
     //printk(KERN_ERR "3. zfLnxUnlinkAllUrbs\n");
     //zfLnxUnlinkAllUrbs(macp);
@@ -263,17 +215,10 @@ static void zfLnxDisconnect(struct usb_interface *interface)
     kfree(macp);
     macp = NULL;
 
-#if (LINUX_VERSION_CODE >= KERNEL_VERSION(2,5,0))
     usb_set_intfdata(interface, NULL);
-#endif
 }
 
 static struct usb_driver zd1221_driver = {
-#if (LINUX_VERSION_CODE >= KERNEL_VERSION(2,5,0))
-    #if (LINUX_VERSION_CODE < KERNEL_VERSION(2,6,15))
-       .owner        = THIS_MODULE,
-       #endif
-#endif
        .name         = driver_name,
        .probe        = zfLnxProbe,
        .disconnect   = zfLnxDisconnect,