diff options
author | Pekka Enberg <penberg@cs.helsinki.fi> | 2009-01-13 20:51:11 +0200 |
---|---|---|
committer | Greg Kroah-Hartman <gregkh@suse.de> | 2009-04-03 14:53:30 -0700 |
commit | 7f20a18d1803890619dbb686924d629ef95cfd84 (patch) | |
tree | 84f42d2f1878542983106cfa1bcb223f3b9a2e23 /drivers/staging/rt2860/rt_main_dev.c | |
parent | 7034ca4dda60f213d2d428da690710da6ea9a8df (diff) |
Staging: rt2860: remove kernel version compatibility wrappers
The driver is in mainline now so there's no point in keeping the
kernel version compatibility wrappers around.
Signed-off-by: Pekka Enberg <penberg@cs.helsinki.fi>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
Diffstat (limited to 'drivers/staging/rt2860/rt_main_dev.c')
-rw-r--r-- | drivers/staging/rt2860/rt_main_dev.c | 107 |
1 files changed, 8 insertions, 99 deletions
diff --git a/drivers/staging/rt2860/rt_main_dev.c b/drivers/staging/rt2860/rt_main_dev.c index 3873c478f4e..246fb0a29b3 100644 --- a/drivers/staging/rt2860/rt_main_dev.c +++ b/drivers/staging/rt2860/rt_main_dev.c @@ -58,11 +58,7 @@ UINT32 CW_MAX_IN_BITS; char *mac = ""; // default 00:00:00:00:00:00 char *hostname = ""; // default CMPC -#if LINUX_VERSION_CODE <= KERNEL_VERSION(2,6,12) -MODULE_PARM (mac, "s"); -#else module_param (mac, charp, 0); -#endif MODULE_PARM_DESC (mac, "rt28xx: wireless mac addr"); @@ -87,13 +83,6 @@ INT __devinit rt28xx_probe(IN void *_dev_p, IN void *_dev_id_p, static int rt28xx_init(IN struct net_device *net_dev); INT rt28xx_send_packets(IN struct sk_buff *skb_p, IN struct net_device *net_dev); -#if LINUX_VERSION_CODE <= 0x20402 // Red Hat 7.1 -struct net_device *alloc_netdev( - int sizeof_priv, - const char *mask, - void (*setup)(struct net_device *)); -#endif // LINUX_VERSION_CODE // - static void CfgInitHook(PRTMP_ADAPTER pAd); #ifdef CONFIG_STA_SUPPORT @@ -808,9 +797,7 @@ static NDIS_STATUS rt_ieee80211_if_setup(struct net_device *dev, PRTMP_ADAPTER p dev->stop = MainVirtualIF_close; //rt28xx_close; dev->priv_flags = INT_MAIN; dev->do_ioctl = rt28xx_ioctl; -#if LINUX_VERSION_CODE >= KERNEL_VERSION(2,6,24) - dev->validate_addr = NULL; -#endif + dev->validate_addr = NULL; // find available device name for (i = 0; i < 8; i++) { @@ -821,25 +808,11 @@ static NDIS_STATUS rt_ieee80211_if_setup(struct net_device *dev, PRTMP_ADAPTER p #endif // MULTIPLE_CARD_SUPPORT // sprintf(slot_name, "ra%d", i); -#if LINUX_VERSION_CODE >= KERNEL_VERSION(2,5,0) -#if LINUX_VERSION_CODE >= KERNEL_VERSION(2,6,24) -#if LINUX_VERSION_CODE >= KERNEL_VERSION(2,6,26) - device = dev_get_by_name(dev_net(dev), slot_name); -#else - device = dev_get_by_name(dev->nd_net, slot_name); -#endif -#else - device = dev_get_by_name(slot_name); -#endif - if (device != NULL) dev_put(device); -#else - for (device = dev_base; device != NULL; device = device->next) - { - if (strncmp(device->name, slot_name, 4) == 0) - break; - } -#endif - if(device == NULL) + device = dev_get_by_name(dev_net(dev), slot_name); + if (device != NULL) + dev_put(device); + + if (device == NULL) break; } @@ -1261,38 +1234,21 @@ INT __devinit rt28xx_probe( DBGPRINT(RT_DEBUG_TRACE, ("STA Driver version-%s\n", STA_DRIVER_VERSION)); #endif // CONFIG_STA_SUPPORT // -#if LINUX_VERSION_CODE <= 0x20402 // Red Hat 7.1 - net_dev = alloc_netdev(sizeof(PRTMP_ADAPTER), "eth%d", ether_setup); -#else net_dev = alloc_etherdev(sizeof(PRTMP_ADAPTER)); -#endif if (net_dev == NULL) { printk("alloc_netdev failed\n"); -#if LINUX_VERSION_CODE >= KERNEL_VERSION(2,5,0) -#if LINUX_VERSION_CODE < KERNEL_VERSION(2,6,15) - module_put(THIS_MODULE); -#endif //LINUX_VERSION_CODE < KERNEL_VERSION(2,6,15) -#else - MOD_DEC_USE_COUNT; -#endif goto err_out; } -#if LINUX_VERSION_CODE < KERNEL_VERSION(2,6,24) - SET_MODULE_OWNER(net_dev); -#endif - netif_stop_queue(net_dev); #ifdef NATIVE_WPA_SUPPLICANT_SUPPORT /* for supporting Network Manager */ /* Set the sysfs physical device reference for the network logical device * if set prior to registration will cause a symlink during initialization. */ -#if (LINUX_VERSION_CODE >= KERNEL_VERSION(2,6,0)) SET_NETDEV_DEV(net_dev, &(dev_p->dev)); -#endif #endif // NATIVE_WPA_SUPPLICANT_SUPPORT // // Allocate RTMP_ADAPTER miniport adapter structure @@ -1313,13 +1269,8 @@ INT __devinit rt28xx_probe( #endif // CONFIG_STA_SUPPORT // // Post config -#if LINUX_VERSION_CODE < KERNEL_VERSION(2,5,0) - if (RT28XXProbePostConfig(_dev_p, pAd, argc) == FALSE) - goto err_out_unmap; -#else if (RT28XXProbePostConfig(_dev_p, pAd, 0) == FALSE) goto err_out_unmap; -#endif // LINUX_VERSION_CODE // #ifdef CONFIG_STA_SUPPORT pAd->OpMode = OPMODE_STA; @@ -1362,20 +1313,12 @@ err_out_unmap: RT28XX_UNMAP(); err_out_free_netdev: -#if LINUX_VERSION_CODE >= KERNEL_VERSION(2,5,0) - free_netdev(net_dev); -#else - kfree(net_dev); -#endif + free_netdev(net_dev); err_out: RT28XX_PUT_DEVICE(dev_p); -#if LINUX_VERSION_CODE < KERNEL_VERSION(2,5,0) - return (LONG)NULL; -#else - return -ENODEV; /* probe fail */ -#endif // LINUX_VERSION_CODE // + return -ENODEV; /* probe fail */ } /* End of rt28xx_probe */ @@ -1495,40 +1438,6 @@ INT rt28xx_send_packets( -#if LINUX_VERSION_CODE <= 0x20402 // Red Hat 7.1 -struct net_device *alloc_netdev( - int sizeof_priv, - const char *mask, - void (*setup)(struct net_device *)) -{ - struct net_device *dev; - INT alloc_size; - - - /* ensure 32-byte alignment of the private area */ - alloc_size = sizeof (*dev) + sizeof_priv + 31; - - dev = (struct net_device *) kmalloc(alloc_size, GFP_KERNEL); - if (dev == NULL) - { - DBGPRINT(RT_DEBUG_ERROR, - ("alloc_netdev: Unable to allocate device memory.\n")); - return NULL; - } - - memset(dev, 0, alloc_size); - - if (sizeof_priv) - dev->priv = (void *) (((long)(dev + 1) + 31) & ~31); - - setup(dev); - strcpy(dev->name, mask); - - return dev; -} -#endif // LINUX_VERSION_CODE // - - void CfgInitHook(PRTMP_ADAPTER pAd) { pAd->bBroadComHT = TRUE; |