Commit 7f20a18d authored by Pekka Enberg's avatar Pekka Enberg Committed by Greg Kroah-Hartman

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: default avatarPekka Enberg <penberg@cs.helsinki.fi>
Signed-off-by: default avatarGreg Kroah-Hartman <gregkh@suse.de>
parent 7034ca4d
...@@ -90,12 +90,10 @@ void init_thread_task(PRTMP_ADAPTER pAd); ...@@ -90,12 +90,10 @@ void init_thread_task(PRTMP_ADAPTER pAd);
static void __exit rt2860_cleanup_module(void); static void __exit rt2860_cleanup_module(void);
static int __init rt2860_init_module(void); static int __init rt2860_init_module(void);
#if LINUX_VERSION_CODE >= KERNEL_VERSION(2,5,0)
#ifdef CONFIG_PM #ifdef CONFIG_PM
static int rt2860_suspend(struct pci_dev *pci_dev, pm_message_t state); static int rt2860_suspend(struct pci_dev *pci_dev, pm_message_t state);
static int rt2860_resume(struct pci_dev *pci_dev); static int rt2860_resume(struct pci_dev *pci_dev);
#endif // CONFIG_PM // #endif // CONFIG_PM //
#endif
// //
...@@ -128,22 +126,15 @@ static struct pci_driver rt2860_driver = ...@@ -128,22 +126,15 @@ static struct pci_driver rt2860_driver =
name: "rt2860", name: "rt2860",
id_table: rt2860_pci_tbl, id_table: rt2860_pci_tbl,
probe: rt2860_init_one, probe: rt2860_init_one,
#if LINUX_VERSION_CODE >= 0x20412
remove: __devexit_p(rt2860_remove_one), remove: __devexit_p(rt2860_remove_one),
#else
remove: __devexit(rt2860_remove_one),
#endif
#if LINUX_VERSION_CODE >= KERNEL_VERSION(2,5,0)
#ifdef CONFIG_PM #ifdef CONFIG_PM
suspend: rt2860_suspend, suspend: rt2860_suspend,
resume: rt2860_resume, resume: rt2860_resume,
#endif #endif
#endif
}; };
#if LINUX_VERSION_CODE >= KERNEL_VERSION(2,5,0)
#ifdef CONFIG_PM #ifdef CONFIG_PM
VOID RT2860RejectPendingPackets( VOID RT2860RejectPendingPackets(
...@@ -284,16 +275,11 @@ static int rt2860_resume( ...@@ -284,16 +275,11 @@ static int rt2860_resume(
return 0; return 0;
} }
#endif // CONFIG_PM // #endif // CONFIG_PM //
#endif
static INT __init rt2860_init_module(VOID) static INT __init rt2860_init_module(VOID)
{ {
#if LINUX_VERSION_CODE >= KERNEL_VERSION(2,5,0)
return pci_register_driver(&rt2860_driver); return pci_register_driver(&rt2860_driver);
#else
return pci_module_init(&rt2860_driver);
#endif
} }
...@@ -374,11 +360,7 @@ static VOID __devexit rt2860_remove_one( ...@@ -374,11 +360,7 @@ static VOID __devexit rt2860_remove_one(
} }
// Free pre-allocated net_device memory // Free pre-allocated net_device memory
#if LINUX_VERSION_CODE >= KERNEL_VERSION(2,5,0)
free_netdev(net_dev); free_netdev(net_dev);
#else
kfree(net_dev);
#endif
} }
// //
...@@ -758,11 +740,7 @@ static void ac0_dma_done_tasklet(unsigned long data) ...@@ -758,11 +740,7 @@ static void ac0_dma_done_tasklet(unsigned long data)
int print_int_count; int print_int_count;
IRQ_HANDLE_TYPE IRQ_HANDLE_TYPE
#if (LINUX_VERSION_CODE >= KERNEL_VERSION(2,6,19))
rt2860_interrupt(int irq, void *dev_instance) rt2860_interrupt(int irq, void *dev_instance)
#else
rt2860_interrupt(int irq, void *dev_instance, struct pt_regs *regs)
#endif
{ {
struct net_device *net_dev = (struct net_device *) dev_instance; struct net_device *net_dev = (struct net_device *) dev_instance;
PRTMP_ADAPTER pAd = net_dev->ml_priv; PRTMP_ADAPTER pAd = net_dev->ml_priv;
...@@ -809,11 +787,7 @@ rt2860_interrupt(int irq, void *dev_instance, struct pt_regs *regs) ...@@ -809,11 +787,7 @@ rt2860_interrupt(int irq, void *dev_instance, struct pt_regs *regs)
if (RTMP_TEST_FLAG(pAd, fRTMP_ADAPTER_RESET_IN_PROGRESS) || if (RTMP_TEST_FLAG(pAd, fRTMP_ADAPTER_RESET_IN_PROGRESS) ||
RTMP_TEST_FLAG(pAd, fRTMP_ADAPTER_HALT_IN_PROGRESS)) RTMP_TEST_FLAG(pAd, fRTMP_ADAPTER_HALT_IN_PROGRESS))
{ {
#if LINUX_VERSION_CODE >= KERNEL_VERSION(2,5,0)
return IRQ_HANDLED; return IRQ_HANDLED;
#else
return;
#endif
} }
// //
...@@ -832,11 +806,7 @@ rt2860_interrupt(int irq, void *dev_instance, struct pt_regs *regs) ...@@ -832,11 +806,7 @@ rt2860_interrupt(int irq, void *dev_instance, struct pt_regs *regs)
if (IntSource.word == 0xffffffff) if (IntSource.word == 0xffffffff)
{ {
RTMP_SET_FLAG(pAd, fRTMP_ADAPTER_NIC_NOT_EXIST | fRTMP_ADAPTER_HALT_IN_PROGRESS); RTMP_SET_FLAG(pAd, fRTMP_ADAPTER_NIC_NOT_EXIST | fRTMP_ADAPTER_HALT_IN_PROGRESS);
#if LINUX_VERSION_CODE >= KERNEL_VERSION(2,5,0)
return IRQ_HANDLED; return IRQ_HANDLED;
#else
return;
#endif
} }
if (IntSource.word & TxCoherent) if (IntSource.word & TxCoherent)
...@@ -970,10 +940,7 @@ rt2860_interrupt(int irq, void *dev_instance, struct pt_regs *regs) ...@@ -970,10 +940,7 @@ rt2860_interrupt(int irq, void *dev_instance, struct pt_regs *regs)
} }
#endif // CONFIG_STA_SUPPORT // #endif // CONFIG_STA_SUPPORT //
#if LINUX_VERSION_CODE >= KERNEL_VERSION(2,5,0)
return IRQ_HANDLED; return IRQ_HANDLED;
#endif
} }
/* /*
...@@ -1026,11 +993,7 @@ BOOLEAN RT28XXNetDevInit( ...@@ -1026,11 +993,7 @@ BOOLEAN RT28XXNetDevInit(
ULONG csr_addr; ULONG csr_addr;
#if LINUX_VERSION_CODE >= KERNEL_VERSION(2,5,0)
print_name = pci_dev ? pci_name(pci_dev) : "rt2860"; print_name = pci_dev ? pci_name(pci_dev) : "rt2860";
#else
print_name = pci_dev ? pci_dev->slot_name : "rt2860";
#endif // LINUX_VERSION_CODE //
net_dev->base_addr = 0; net_dev->base_addr = 0;
net_dev->irq = 0; net_dev->irq = 0;
......
...@@ -46,18 +46,10 @@ ...@@ -46,18 +46,10 @@
Status = NDIS_STATUS_SUCCESS; Status = NDIS_STATUS_SUCCESS;
/* function declarations */ /* function declarations */
#if LINUX_VERSION_CODE >= KERNEL_VERSION(2,5,0)
#define IRQ_HANDLE_TYPE irqreturn_t #define IRQ_HANDLE_TYPE irqreturn_t
#else
#define IRQ_HANDLE_TYPE void
#endif
IRQ_HANDLE_TYPE IRQ_HANDLE_TYPE
#if (LINUX_VERSION_CODE >= KERNEL_VERSION(2,6,19))
rt2860_interrupt(int irq, void *dev_instance); rt2860_interrupt(int irq, void *dev_instance);
#else
rt2860_interrupt(int irq, void *dev_instance, struct pt_regs *regs);
#endif
/* ----------------- Frimware Related MACRO ----------------- */ /* ----------------- Frimware Related MACRO ----------------- */
#define RT28XX_WRITE_FIRMWARE(_pAd, _pFwImage, _FwLen) \ #define RT28XX_WRITE_FIRMWARE(_pAd, _pFwImage, _FwLen) \
...@@ -237,9 +229,7 @@ rt2860_interrupt(int irq, void *dev_instance, struct pt_regs *regs); ...@@ -237,9 +229,7 @@ rt2860_interrupt(int irq, void *dev_instance, struct pt_regs *regs);
#define RTMP_MSI_DISABLE(_pAd) #define RTMP_MSI_DISABLE(_pAd)
#endif // PCI_MSI_SUPPORT // #endif // PCI_MSI_SUPPORT //
#if LINUX_VERSION_CODE >= KERNEL_VERSION(2,6,24)
#define SA_SHIRQ IRQF_SHARED #define SA_SHIRQ IRQF_SHARED
#endif
#define RT28XX_IRQ_REQUEST(net_dev) \ #define RT28XX_IRQ_REQUEST(net_dev) \
{ PRTMP_ADAPTER _pAd = (PRTMP_ADAPTER)((net_dev)->ml_priv); \ { PRTMP_ADAPTER _pAd = (PRTMP_ADAPTER)((net_dev)->ml_priv); \
...@@ -251,20 +241,12 @@ rt2860_interrupt(int irq, void *dev_instance, struct pt_regs *regs); ...@@ -251,20 +241,12 @@ rt2860_interrupt(int irq, void *dev_instance, struct pt_regs *regs);
printk("RT2860: request_irq ERROR(%d)\n", retval); \ printk("RT2860: request_irq ERROR(%d)\n", retval); \
return retval; } } return retval; } }
#if LINUX_VERSION_CODE >= KERNEL_VERSION(2,5,0)
#define RT28XX_IRQ_RELEASE(net_dev) \ #define RT28XX_IRQ_RELEASE(net_dev) \
{ PRTMP_ADAPTER _pAd = (PRTMP_ADAPTER)((net_dev)->ml_priv); \ { PRTMP_ADAPTER _pAd = (PRTMP_ADAPTER)((net_dev)->ml_priv); \
POS_COOKIE _pObj = (POS_COOKIE)(_pAd->OS_Cookie); \ POS_COOKIE _pObj = (POS_COOKIE)(_pAd->OS_Cookie); \
synchronize_irq(_pObj->pci_dev->irq); \ synchronize_irq(_pObj->pci_dev->irq); \
free_irq(_pObj->pci_dev->irq, (net_dev)); \ free_irq(_pObj->pci_dev->irq, (net_dev)); \
RTMP_MSI_DISABLE(_pAd); } RTMP_MSI_DISABLE(_pAd); }
#else
#define RT28XX_IRQ_RELEASE(net_dev) \
{ PRTMP_ADAPTER _pAd = (PRTMP_ADAPTER)((net_dev)->priv); \
POS_COOKIE _pObj = (POS_COOKIE)(_pAd->OS_Cookie); \
free_irq(_pObj->pci_dev->irq, (net_dev)); \
RTMP_MSI_DISABLE(_pAd); }
#endif
#define RT28XX_IRQ_INIT(pAd) \ #define RT28XX_IRQ_INIT(pAd) \
{ pAd->int_enable_reg = ((DELAYINTMASK) | \ { pAd->int_enable_reg = ((DELAYINTMASK) | \
......
...@@ -1005,35 +1005,14 @@ err_free_sk_buff: ...@@ -1005,35 +1005,14 @@ err_free_sk_buff:
void rtmp_os_thread_init(PUCHAR pThreadName, PVOID pNotify) void rtmp_os_thread_init(PUCHAR pThreadName, PVOID pNotify)
{ {
#if LINUX_VERSION_CODE >= KERNEL_VERSION(2,5,0)
daemonize(pThreadName /*"%s",pAd->net_dev->name*/); daemonize(pThreadName /*"%s",pAd->net_dev->name*/);
allow_signal(SIGTERM); allow_signal(SIGTERM);
allow_signal(SIGKILL); allow_signal(SIGKILL);
current->flags |= PF_NOFREEZE; current->flags |= PF_NOFREEZE;
#else
unsigned long flags;
daemonize();
reparent_to_init();
strcpy(current->comm, pThreadName);
siginitsetinv(&current->blocked, sigmask(SIGTERM) | sigmask(SIGKILL));
/* Allow interception of SIGKILL only
* Don't allow other signals to interrupt the transmission */
#if LINUX_VERSION_CODE > KERNEL_VERSION(2,4,22)
spin_lock_irqsave(&current->sigmask_lock, flags);
flush_signals(current);
recalc_sigpending(current);
spin_unlock_irqrestore(&current->sigmask_lock, flags);
#endif
#endif
/* signal that we've started the thread */ /* signal that we've started the thread */
complete(pNotify); complete(pNotify);
} }
void RTMP_IndicateMediaState( void RTMP_IndicateMediaState(
......
...@@ -110,8 +110,6 @@ typedef int (*HARD_START_XMIT_FUNC)(struct sk_buff *skb, struct net_device *net_ ...@@ -110,8 +110,6 @@ typedef int (*HARD_START_XMIT_FUNC)(struct sk_buff *skb, struct net_device *net_
#endif // PCI_DEVICE // #endif // PCI_DEVICE //
#endif // RT2860 // #endif // RT2860 //
#if LINUX_VERSION_CODE >= KERNEL_VERSION(2,5,0)
#define RTMP_TIME_AFTER(a,b) \ #define RTMP_TIME_AFTER(a,b) \
(typecheck(unsigned long, (unsigned long)a) && \ (typecheck(unsigned long, (unsigned long)a) && \
typecheck(unsigned long, (unsigned long)b) && \ typecheck(unsigned long, (unsigned long)b) && \
...@@ -122,11 +120,7 @@ typedef int (*HARD_START_XMIT_FUNC)(struct sk_buff *skb, struct net_device *net_ ...@@ -122,11 +120,7 @@ typedef int (*HARD_START_XMIT_FUNC)(struct sk_buff *skb, struct net_device *net_
typecheck(unsigned long, (unsigned long)b) && \ typecheck(unsigned long, (unsigned long)b) && \
((long)(a) - (long)(b) >= 0)) ((long)(a) - (long)(b) >= 0))
#define RTMP_TIME_BEFORE(a,b) RTMP_TIME_AFTER_EQ(b,a) #define RTMP_TIME_BEFORE(a,b) RTMP_TIME_AFTER_EQ(b,a)
#else
#define RTMP_TIME_AFTER(a,b) time_after(a, b)
#endif
#if LINUX_VERSION_CODE >= KERNEL_VERSION(2,5,0)
#define RT_MOD_INC_USE_COUNT() \ #define RT_MOD_INC_USE_COUNT() \
if (!try_module_get(THIS_MODULE)) \ if (!try_module_get(THIS_MODULE)) \
{ \ { \
...@@ -135,10 +129,6 @@ typedef int (*HARD_START_XMIT_FUNC)(struct sk_buff *skb, struct net_device *net_ ...@@ -135,10 +129,6 @@ typedef int (*HARD_START_XMIT_FUNC)(struct sk_buff *skb, struct net_device *net_
} }
#define RT_MOD_DEC_USE_COUNT() module_put(THIS_MODULE); #define RT_MOD_DEC_USE_COUNT() module_put(THIS_MODULE);
#else
#define RT_MOD_INC_USE_COUNT() MOD_INC_USE_COUNT;
#define RT_MOD_DEC_USE_COUNT() MOD_DEC_USE_COUNT;
#endif
#define OS_HZ HZ #define OS_HZ HZ
...@@ -170,21 +160,12 @@ typedef int (*HARD_START_XMIT_FUNC)(struct sk_buff *skb, struct net_device *net_ ...@@ -170,21 +160,12 @@ typedef int (*HARD_START_XMIT_FUNC)(struct sk_buff *skb, struct net_device *net_
#define NDIS_PACKET_TYPE_ALL_MULTICAST 3 #define NDIS_PACKET_TYPE_ALL_MULTICAST 3
#endif // CONFIG_STA_SUPPORT // #endif // CONFIG_STA_SUPPORT //
#if LINUX_VERSION_CODE >= KERNEL_VERSION(2,6,27)
typedef struct pid * THREAD_PID; typedef struct pid * THREAD_PID;
#define THREAD_PID_INIT_VALUE NULL #define THREAD_PID_INIT_VALUE NULL
#define GET_PID(_v) find_get_pid(_v) #define GET_PID(_v) find_get_pid(_v)
#define GET_PID_NUMBER(_v) pid_nr(_v) #define GET_PID_NUMBER(_v) pid_nr(_v)
#define CHECK_PID_LEGALITY(_pid) if (pid_nr(_pid) >= 0) #define CHECK_PID_LEGALITY(_pid) if (pid_nr(_pid) >= 0)
#define KILL_THREAD_PID(_A, _B, _C) kill_pid(_A, _B, _C) #define KILL_THREAD_PID(_A, _B, _C) kill_pid(_A, _B, _C)
#else
typedef pid_t THREAD_PID;
#define THREAD_PID_INIT_VALUE -1
#define GET_PID(_v) _v
#define GET_PID_NUMBER(_v) _v
#define CHECK_PID_LEGALITY(_pid) if (_pid >= 0)
#define KILL_THREAD_PID(_A, _B, _C) kill_proc(_A, _B, _C)
#endif
struct os_lock { struct os_lock {
spinlock_t lock; spinlock_t lock;
......
...@@ -58,11 +58,7 @@ UINT32 CW_MAX_IN_BITS; ...@@ -58,11 +58,7 @@ UINT32 CW_MAX_IN_BITS;
char *mac = ""; // default 00:00:00:00:00:00 char *mac = ""; // default 00:00:00:00:00:00
char *hostname = ""; // default CMPC char *hostname = ""; // default CMPC
#if LINUX_VERSION_CODE <= KERNEL_VERSION(2,6,12)
MODULE_PARM (mac, "s");
#else
module_param (mac, charp, 0); module_param (mac, charp, 0);
#endif
MODULE_PARM_DESC (mac, "rt28xx: wireless mac addr"); 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, ...@@ -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); 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); 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); static void CfgInitHook(PRTMP_ADAPTER pAd);
#ifdef CONFIG_STA_SUPPORT #ifdef CONFIG_STA_SUPPORT
...@@ -808,9 +797,7 @@ static NDIS_STATUS rt_ieee80211_if_setup(struct net_device *dev, PRTMP_ADAPTER p ...@@ -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->stop = MainVirtualIF_close; //rt28xx_close;
dev->priv_flags = INT_MAIN; dev->priv_flags = INT_MAIN;
dev->do_ioctl = rt28xx_ioctl; dev->do_ioctl = rt28xx_ioctl;
#if LINUX_VERSION_CODE >= KERNEL_VERSION(2,6,24)
dev->validate_addr = NULL; dev->validate_addr = NULL;
#endif
// find available device name // find available device name
for (i = 0; i < 8; i++) for (i = 0; i < 8; i++)
{ {
...@@ -821,25 +808,11 @@ static NDIS_STATUS rt_ieee80211_if_setup(struct net_device *dev, PRTMP_ADAPTER p ...@@ -821,25 +808,11 @@ static NDIS_STATUS rt_ieee80211_if_setup(struct net_device *dev, PRTMP_ADAPTER p
#endif // MULTIPLE_CARD_SUPPORT // #endif // MULTIPLE_CARD_SUPPORT //
sprintf(slot_name, "ra%d", i); 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); device = dev_get_by_name(dev_net(dev), slot_name);
#else if (device != NULL)
device = dev_get_by_name(dev->nd_net, slot_name); dev_put(device);
#endif
#else if (device == NULL)
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)
break; break;
} }
...@@ -1261,38 +1234,21 @@ INT __devinit rt28xx_probe( ...@@ -1261,38 +1234,21 @@ INT __devinit rt28xx_probe(
DBGPRINT(RT_DEBUG_TRACE, ("STA Driver version-%s\n", STA_DRIVER_VERSION)); DBGPRINT(RT_DEBUG_TRACE, ("STA Driver version-%s\n", STA_DRIVER_VERSION));
#endif // CONFIG_STA_SUPPORT // #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)); net_dev = alloc_etherdev(sizeof(PRTMP_ADAPTER));
#endif
if (net_dev == NULL) if (net_dev == NULL)
{ {
printk("alloc_netdev failed\n"); 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; goto err_out;
} }
#if LINUX_VERSION_CODE < KERNEL_VERSION(2,6,24)
SET_MODULE_OWNER(net_dev);
#endif
netif_stop_queue(net_dev); netif_stop_queue(net_dev);
#ifdef NATIVE_WPA_SUPPLICANT_SUPPORT #ifdef NATIVE_WPA_SUPPLICANT_SUPPORT
/* for supporting Network Manager */ /* for supporting Network Manager */
/* Set the sysfs physical device reference for the network logical device /* Set the sysfs physical device reference for the network logical device
* if set prior to registration will cause a symlink during initialization. * 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)); SET_NETDEV_DEV(net_dev, &(dev_p->dev));
#endif
#endif // NATIVE_WPA_SUPPLICANT_SUPPORT // #endif // NATIVE_WPA_SUPPLICANT_SUPPORT //
// Allocate RTMP_ADAPTER miniport adapter structure // Allocate RTMP_ADAPTER miniport adapter structure
...@@ -1313,13 +1269,8 @@ INT __devinit rt28xx_probe( ...@@ -1313,13 +1269,8 @@ INT __devinit rt28xx_probe(
#endif // CONFIG_STA_SUPPORT // #endif // CONFIG_STA_SUPPORT //
// Post config // 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) if (RT28XXProbePostConfig(_dev_p, pAd, 0) == FALSE)
goto err_out_unmap; goto err_out_unmap;
#endif // LINUX_VERSION_CODE //
#ifdef CONFIG_STA_SUPPORT #ifdef CONFIG_STA_SUPPORT
pAd->OpMode = OPMODE_STA; pAd->OpMode = OPMODE_STA;
...@@ -1362,20 +1313,12 @@ err_out_unmap: ...@@ -1362,20 +1313,12 @@ err_out_unmap:
RT28XX_UNMAP(); RT28XX_UNMAP();
err_out_free_netdev: err_out_free_netdev:
#if LINUX_VERSION_CODE >= KERNEL_VERSION(2,5,0)
free_netdev(net_dev); free_netdev(net_dev);
#else
kfree(net_dev);
#endif
err_out: err_out:
RT28XX_PUT_DEVICE(dev_p); RT28XX_PUT_DEVICE(dev_p);
#if LINUX_VERSION_CODE < KERNEL_VERSION(2,5,0)
return (LONG)NULL;
#else
return -ENODEV; /* probe fail */ return -ENODEV; /* probe fail */
#endif // LINUX_VERSION_CODE //
} /* End of rt28xx_probe */ } /* End of rt28xx_probe */
...@@ -1495,40 +1438,6 @@ INT rt28xx_send_packets( ...@@ -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) void CfgInitHook(PRTMP_ADAPTER pAd)
{ {
pAd->bBroadComHT = TRUE; pAd->bBroadComHT = TRUE;
......
...@@ -49,15 +49,9 @@ extern ULONG RTDebugLevel; ...@@ -49,15 +49,9 @@ extern ULONG RTDebugLevel;
#define GROUP_KEY_NO 4 #define GROUP_KEY_NO 4
#if LINUX_VERSION_CODE >= KERNEL_VERSION(2,6,27)
#define IWE_STREAM_ADD_EVENT(_A, _B, _C, _D, _E) iwe_stream_add_event(_A, _B, _C, _D, _E) #define IWE_STREAM_ADD_EVENT(_A, _B, _C, _D, _E) iwe_stream_add_event(_A, _B, _C, _D, _E)
#define IWE_STREAM_ADD_POINT(_A, _B, _C, _D, _E) iwe_stream_add_point(_A, _B, _C, _D, _E) #define IWE_STREAM_ADD_POINT(_A, _B, _C, _D, _E) iwe_stream_add_point(_A, _B, _C, _D, _E)
#define IWE_STREAM_ADD_VALUE(_A, _B, _C, _D, _E, _F) iwe_stream_add_value(_A, _B, _C, _D, _E, _F) #define IWE_STREAM_ADD_VALUE(_A, _B, _C, _D, _E, _F) iwe_stream_add_value(_A, _B, _C, _D, _E, _F)
#else
#define IWE_STREAM_ADD_EVENT(_A, _B, _C, _D, _E) iwe_stream_add_event(_B, _C, _D, _E)
#define IWE_STREAM_ADD_POINT(_A, _B, _C, _D, _E) iwe_stream_add_point(_B, _C, _D, _E)
#define IWE_STREAM_ADD_VALUE(_A, _B, _C, _D, _E, _F) iwe_stream_add_value(_B, _C, _D, _E, _F)
#endif
extern UCHAR CipherWpa2Template[]; extern UCHAR CipherWpa2Template[];
extern UCHAR CipherWpaPskTkip[]; extern UCHAR CipherWpaPskTkip[];
...@@ -670,11 +664,9 @@ int rt_ioctl_siwmode(struct net_device *dev, ...@@ -670,11 +664,9 @@ int rt_ioctl_siwmode(struct net_device *dev,
case IW_MODE_INFRA: case IW_MODE_INFRA:
Set_NetworkType_Proc(pAdapter, "Infra"); Set_NetworkType_Proc(pAdapter, "Infra");
break; break;
#if (LINUX_VERSION_CODE > KERNEL_VERSION(2,4,20))
case IW_MODE_MONITOR: case IW_MODE_MONITOR:
Set_NetworkType_Proc(pAdapter, "Monitor"); Set_NetworkType_Proc(pAdapter, "Monitor");
break; break;
#endif
default: default:
DBGPRINT(RT_DEBUG_TRACE, ("===>rt_ioctl_siwmode::SIOCSIWMODE (unknown %d)\n", *mode)); DBGPRINT(RT_DEBUG_TRACE, ("===>rt_ioctl_siwmode::SIOCSIWMODE (unknown %d)\n", *mode));
return -EINVAL; return -EINVAL;
...@@ -715,12 +707,10 @@ int rt_ioctl_giwmode(struct net_device *dev, ...@@ -715,12 +707,10 @@ int rt_ioctl_giwmode(struct net_device *dev,
*mode = IW_MODE_ADHOC; *mode = IW_MODE_ADHOC;
else if (INFRA_ON(pAdapter)) else if (INFRA_ON(pAdapter))
*mode = IW_MODE_INFRA; *mode = IW_MODE_INFRA;
#if (LINUX_VERSION_CODE > KERNEL_VERSION(2,4,20))
else if (MONITOR_ON(pAdapter)) else if (MONITOR_ON(pAdapter))
{ {
*mode = IW_MODE_MONITOR; *mode = IW_MODE_MONITOR;
} }
#endif
else else
*mode = IW_MODE_AUTO; *mode = IW_MODE_AUTO;
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment