From dff1dc8caaa42774ea82201cb3698b70f1f173c9 Mon Sep 17 00:00:00 2001 From: Solomon Peachy Date: Mon, 27 Oct 2008 11:13:57 -0400 Subject: [PATCH] Staging: wlan-ng: Delete PCI/PLX/PCMCIA-specific code. Also delete a large pile of code that existed to support <2.6 kernels. Signed-off-by: Solomon Peachy Signed-off-by: Greg Kroah-Hartman --- drivers/staging/wlan-ng/hfa384x.h | 268 ---------------- drivers/staging/wlan-ng/hfa384x_usb.c | 5 - drivers/staging/wlan-ng/prism2_usb.c | 58 +--- drivers/staging/wlan-ng/prism2mgmt.c | 128 -------- drivers/staging/wlan-ng/prism2mgmt.h | 4 - drivers/staging/wlan-ng/prism2mib.c | 19 -- drivers/staging/wlan-ng/prism2sta.c | 124 +------- drivers/staging/wlan-ng/version.h | 8 - drivers/staging/wlan-ng/wlan_compat.h | 423 +------------------------- 9 files changed, 9 insertions(+), 1028 deletions(-) diff --git a/drivers/staging/wlan-ng/hfa384x.h b/drivers/staging/wlan-ng/hfa384x.h index 0dfb8ce9aae7..d079868d9743 100644 --- a/drivers/staging/wlan-ng/hfa384x.h +++ b/drivers/staging/wlan-ng/hfa384x.h @@ -205,40 +205,6 @@ #define HFA384x_DLSTATE_FLASHWRITEPENDING 4 #define HFA384x_DLSTATE_GENESIS 5 -/*--- Register I/O offsets --------------------------*/ -#if ((WLAN_HOSTIF == WLAN_PCMCIA) || (WLAN_HOSTIF == WLAN_PLX)) - -#define HFA384x_CMD_OFF (0x00) -#define HFA384x_PARAM0_OFF (0x02) -#define HFA384x_PARAM1_OFF (0x04) -#define HFA384x_PARAM2_OFF (0x06) -#define HFA384x_STATUS_OFF (0x08) -#define HFA384x_RESP0_OFF (0x0A) -#define HFA384x_RESP1_OFF (0x0C) -#define HFA384x_RESP2_OFF (0x0E) -#define HFA384x_INFOFID_OFF (0x10) -#define HFA384x_RXFID_OFF (0x20) -#define HFA384x_ALLOCFID_OFF (0x22) -#define HFA384x_TXCOMPLFID_OFF (0x24) -#define HFA384x_SELECT0_OFF (0x18) -#define HFA384x_OFFSET0_OFF (0x1C) -#define HFA384x_DATA0_OFF (0x36) -#define HFA384x_SELECT1_OFF (0x1A) -#define HFA384x_OFFSET1_OFF (0x1E) -#define HFA384x_DATA1_OFF (0x38) -#define HFA384x_EVSTAT_OFF (0x30) -#define HFA384x_INTEN_OFF (0x32) -#define HFA384x_EVACK_OFF (0x34) -#define HFA384x_CONTROL_OFF (0x14) -#define HFA384x_SWSUPPORT0_OFF (0x28) -#define HFA384x_SWSUPPORT1_OFF (0x2A) -#define HFA384x_SWSUPPORT2_OFF (0x2C) -#define HFA384x_AUXPAGE_OFF (0x3A) -#define HFA384x_AUXOFFSET_OFF (0x3C) -#define HFA384x_AUXDATA_OFF (0x3E) - -#elif (WLAN_HOSTIF == WLAN_PCI || WLAN_HOSTIF == WLAN_USB) - #define HFA384x_CMD_OFF (0x00) #define HFA384x_PARAM0_OFF (0x04) #define HFA384x_PARAM1_OFF (0x08) @@ -279,8 +245,6 @@ #define HFA384x_PCI_M1_LEN_OFF (0xa8) #define HFA384x_PCI_M1_CTL_OFF (0xac) -#endif - /*--- Register Field Masks --------------------------*/ #define HFA384x_CMD_BUSY ((UINT16)BIT15) #define HFA384x_CMD_AINFO ((UINT16)(BIT14 | BIT13 | BIT12 | BIT11 | BIT10 | BIT9 | BIT8)) @@ -1986,7 +1950,6 @@ typedef struct hfa384x_InfFrame hfa384x_infodata_t info; } __WLAN_ATTRIB_PACK__ hfa384x_InfFrame_t; -#if (WLAN_HOSTIF == WLAN_USB) /*-------------------------------------------------------------------- USB Packet structures and constants. --------------------------------------------------------------------*/ @@ -2138,8 +2101,6 @@ typedef union hfa384x_usbin { UINT8 boguspad[3000]; } __WLAN_ATTRIB_PACK__ hfa384x_usbin_t; -#endif /* WLAN_USB */ - /*-------------------------------------------------------------------- PD record structures. --------------------------------------------------------------------*/ @@ -2397,8 +2358,6 @@ typedef struct hfa384x_statusresult UINT16 resp2; } hfa384x_cmdresult_t; -#if (WLAN_HOSTIF == WLAN_USB) - /* USB Control Exchange (CTLX): * A queue of the structure below is maintained for all of the * Request/Response type USB packets supported by Prism2. @@ -2467,7 +2426,6 @@ typedef struct hfa384x_usbctlxq struct list_head completing; struct list_head reapable; } hfa384x_usbctlxq_t; -#endif typedef struct hfa484x_metacmd { @@ -2477,12 +2435,6 @@ typedef struct hfa484x_metacmd UINT16 parm1; UINT16 parm2; -#if 0 //XXX cmd irq stuff - UINT16 bulkid; /* what RID/FID to copy down. */ - int bulklen; /* how much to copy from BAP */ - char *bulkdata; /* And to where? */ -#endif - hfa384x_cmdresult_t result; } hfa384x_metacmd_t; @@ -2523,12 +2475,6 @@ typedef struct prism2sta_accesslist typedef struct hfa384x { -#if (WLAN_HOSTIF != WLAN_USB) - /* Resource config */ - UINT32 iobase; - char __iomem *membase; - UINT32 irq; -#else /* USB support data */ struct usb_device *usb; struct urb rx_urb; @@ -2560,16 +2506,6 @@ typedef struct hfa384x int endp_in; int endp_out; -#endif /* !USB */ - -#if (WLAN_HOSTIF == WLAN_PCMCIA) -#if LINUX_VERSION_CODE > KERNEL_VERSION(2,6,16) - struct pcmcia_device *pdev; -#else - dev_link_t *link; -#endif - dev_node_t node; -#endif int sniff_fcs; int sniff_channel; @@ -2582,34 +2518,12 @@ typedef struct hfa384x UINT32 state; UINT32 isap; UINT8 port_enabled[HFA384x_NUMPORTS_MAX]; -#if (WLAN_HOSTIF != WLAN_USB) - UINT auxen; - UINT isram16; -#endif /* !USB */ /* Download support */ UINT dlstate; hfa384x_downloadbuffer_t bufinfo; UINT16 dltimeout; -#if (WLAN_HOSTIF != WLAN_USB) - spinlock_t cmdlock; - volatile int cmdflag; /* wait queue flag */ - hfa384x_metacmd_t *cmddata; /* for our async callback */ - - /* BAP support */ - spinlock_t baplock; - struct tasklet_struct bap_tasklet; - - /* MAC buffer ids */ - UINT16 txfid_head; - UINT16 txfid_tail; - UINT txfid_N; - UINT16 txfid_queue[HFA384x_DRVR_FIDSTACKLEN_MAX]; - UINT16 infofid; - struct semaphore infofid_sem; -#endif /* !USB */ - int scanflag; /* to signal scan comlete */ int join_ap; /* are we joined to a specific ap */ int join_retries; /* number of join retries till we fail */ @@ -2687,19 +2601,10 @@ typedef struct hfa384x /*=============================================================*/ /*--- Function Declarations -----------------------------------*/ /*=============================================================*/ -#if (WLAN_HOSTIF == WLAN_USB) void hfa384x_create( hfa384x_t *hw, struct usb_device *usb); -#else -void -hfa384x_create( - hfa384x_t *hw, - UINT irq, - UINT32 iobase, - UINT8 __iomem *membase); -#endif void hfa384x_destroy(hfa384x_t *hw); @@ -2785,7 +2690,6 @@ hfa384x_drvr_setconfig32(hfa384x_t *hw, UINT16 rid, UINT32 val) return hfa384x_drvr_setconfig(hw, rid, &value, sizeof(value)); } -#if (WLAN_HOSTIF == WLAN_USB) int hfa384x_drvr_getconfig_async(hfa384x_t *hw, UINT16 rid, @@ -2799,16 +2703,6 @@ hfa384x_drvr_setconfig_async(hfa384x_t *hw, UINT16 len, ctlx_usercb_t usercb, void *usercb_data); -#else -static inline int -hfa384x_drvr_setconfig_async(hfa384x_t *hw, UINT16 rid, void *buf, UINT16 len, - void *ptr1, void *ptr2) -{ - (void)ptr1; - (void)ptr2; - return hfa384x_drvr_setconfig(hw, rid, buf, len); -} -#endif static inline int hfa384x_drvr_setconfig16_async(hfa384x_t *hw, UINT16 rid, UINT16 val) @@ -2900,168 +2794,6 @@ hfa384x_copy_to_aux( void *buf, UINT len); -#if (WLAN_HOSTIF != WLAN_USB) - -/* - HFA384x is a LITTLE ENDIAN part. - - the get/setreg functions implicitly byte-swap the data to LE. - the _noswap variants do not perform a byte-swap on the data. -*/ - -static inline UINT16 -__hfa384x_getreg(hfa384x_t *hw, UINT reg); - -static inline void -__hfa384x_setreg(hfa384x_t *hw, UINT16 val, UINT reg); - -static inline UINT16 -__hfa384x_getreg_noswap(hfa384x_t *hw, UINT reg); - -static inline void -__hfa384x_setreg_noswap(hfa384x_t *hw, UINT16 val, UINT reg); - -#ifdef REVERSE_ENDIAN -#define hfa384x_getreg __hfa384x_getreg_noswap -#define hfa384x_setreg __hfa384x_setreg_noswap -#define hfa384x_getreg_noswap __hfa384x_getreg -#define hfa384x_setreg_noswap __hfa384x_setreg -#else -#define hfa384x_getreg __hfa384x_getreg -#define hfa384x_setreg __hfa384x_setreg -#define hfa384x_getreg_noswap __hfa384x_getreg_noswap -#define hfa384x_setreg_noswap __hfa384x_setreg_noswap -#endif - -/*---------------------------------------------------------------- -* hfa384x_getreg -* -* Retrieve the value of one of the MAC registers. Done here -* because different PRISM2 MAC parts use different buses and such. -* NOTE: This function returns the value in HOST ORDER!!!!!! -* -* Arguments: -* hw MAC part structure -* reg Register identifier (offset for I/O based i/f) -* -* Returns: -* Value from the register in HOST ORDER!!!! -----------------------------------------------------------------*/ -static inline UINT16 -__hfa384x_getreg(hfa384x_t *hw, UINT reg) -{ -/* printk(KERN_DEBUG "Reading from 0x%0x\n", hw->membase + reg); */ -#if ((WLAN_HOSTIF == WLAN_PCMCIA) || (WLAN_HOSTIF == WLAN_PLX)) - return wlan_inw_le16_to_cpu(hw->iobase+reg); -#elif (WLAN_HOSTIF == WLAN_PCI) - return __le16_to_cpu(readw(hw->membase + reg)); -#endif -} - -/*---------------------------------------------------------------- -* hfa384x_setreg -* -* Set the value of one of the MAC registers. Done here -* because different PRISM2 MAC parts use different buses and such. -* NOTE: This function assumes the value is in HOST ORDER!!!!!! -* -* Arguments: -* hw MAC part structure -* val Value, in HOST ORDER!!, to put in the register -* reg Register identifier (offset for I/O based i/f) -* -* Returns: -* Nothing -----------------------------------------------------------------*/ -static inline void -__hfa384x_setreg(hfa384x_t *hw, UINT16 val, UINT reg) -{ -#if ((WLAN_HOSTIF == WLAN_PCMCIA) || (WLAN_HOSTIF == WLAN_PLX)) - wlan_outw_cpu_to_le16( val, hw->iobase + reg); - return; -#elif (WLAN_HOSTIF == WLAN_PCI) - writew(__cpu_to_le16(val), hw->membase + reg); - return; -#endif -} - - -/*---------------------------------------------------------------- -* hfa384x_getreg_noswap -* -* Retrieve the value of one of the MAC registers. Done here -* because different PRISM2 MAC parts use different buses and such. -* -* Arguments: -* hw MAC part structure -* reg Register identifier (offset for I/O based i/f) -* -* Returns: -* Value from the register. -----------------------------------------------------------------*/ -static inline UINT16 -__hfa384x_getreg_noswap(hfa384x_t *hw, UINT reg) -{ -#if ((WLAN_HOSTIF == WLAN_PCMCIA) || (WLAN_HOSTIF == WLAN_PLX)) - return wlan_inw(hw->iobase+reg); -#elif (WLAN_HOSTIF == WLAN_PCI) - return readw(hw->membase + reg); -#endif -} - - -/*---------------------------------------------------------------- -* hfa384x_setreg_noswap -* -* Set the value of one of the MAC registers. Done here -* because different PRISM2 MAC parts use different buses and such. -* -* Arguments: -* hw MAC part structure -* val Value to put in the register -* reg Register identifier (offset for I/O based i/f) -* -* Returns: -* Nothing -----------------------------------------------------------------*/ -static inline void -__hfa384x_setreg_noswap(hfa384x_t *hw, UINT16 val, UINT reg) -{ -#if ((WLAN_HOSTIF == WLAN_PCMCIA) || (WLAN_HOSTIF == WLAN_PLX)) - wlan_outw( val, hw->iobase + reg); - return; -#elif (WLAN_HOSTIF == WLAN_PCI) - writew(val, hw->membase + reg); - return; -#endif -} - - -static inline void hfa384x_events_all(hfa384x_t *hw) -{ - hfa384x_setreg(hw, - HFA384x_INT_NORMAL -#ifdef CMD_IRQ - | HFA384x_INTEN_CMD_SET(1) -#endif - , - HFA384x_INTEN); - -} - -static inline void hfa384x_events_nobap(hfa384x_t *hw) -{ - hfa384x_setreg(hw, - (HFA384x_INT_NORMAL & ~HFA384x_INT_BAP_OP) -#ifdef CMD_IRQ - | HFA384x_INTEN_CMD_SET(1) -#endif - , - HFA384x_INTEN); - -} - -#endif /* WLAN_HOSTIF != WLAN_USB */ #endif /* __KERNEL__ */ #endif /* _HFA384x_H */ diff --git a/drivers/staging/wlan-ng/hfa384x_usb.c b/drivers/staging/wlan-ng/hfa384x_usb.c index db0c502f5d90..376ba58fcb99 100644 --- a/drivers/staging/wlan-ng/hfa384x_usb.c +++ b/drivers/staging/wlan-ng/hfa384x_usb.c @@ -136,11 +136,6 @@ #include "wlan_compat.h" -#if (WLAN_HOSTIF != WLAN_USB) -#error "This file is specific to USB" -#endif - - #if LINUX_VERSION_CODE < KERNEL_VERSION(2,6,10) static int wait_for_completion_interruptible(struct completion *x) diff --git a/drivers/staging/wlan-ng/prism2_usb.c b/drivers/staging/wlan-ng/prism2_usb.c index e45be2374503..f1ae3714440a 100644 --- a/drivers/staging/wlan-ng/prism2_usb.c +++ b/drivers/staging/wlan-ng/prism2_usb.c @@ -1,13 +1,8 @@ -#define WLAN_HOSTIF WLAN_USB #include "hfa384x_usb.c" #include "prism2mgmt.c" #include "prism2mib.c" #include "prism2sta.c" -#if (LINUX_VERSION_CODE < KERNEL_VERSION(2,4,0)) -#error "prism2_usb requires at least a 2.4.x kernel!" -#endif - #define PRISM_USB_DEVICE(vid, pid, name) \ USB_DEVICE(vid, pid), \ .driver_info = (unsigned long) name @@ -80,23 +75,11 @@ MODULE_DEVICE_TABLE(usb, usb_prism_tbl); * I'm not sure, assume it's interrupt. * ----------------------------------------------------------------*/ -#if (LINUX_VERSION_CODE < KERNEL_VERSION(2,5,0)) -static void __devinit *prism2sta_probe_usb( - struct usb_device *dev, - unsigned int ifnum, - const struct usb_device_id *id) -#else static int prism2sta_probe_usb( struct usb_interface *interface, const struct usb_device_id *id) -#endif { - -#if (LINUX_VERSION_CODE < KERNEL_VERSION(2,5,0)) - struct usb_interface *interface; -#else struct usb_device *dev; -#endif wlandevice_t *wlandev = NULL; hfa384x_t *hw = NULL; @@ -104,12 +87,7 @@ static int prism2sta_probe_usb( DBFENTER; -#if (LINUX_VERSION_CODE < KERNEL_VERSION(2,5,0)) - interface = &dev->actconfig->interface[ifnum]; -#else dev = interface_to_usbdev(interface); -#endif - if ((wlandev = create_wlan()) == NULL) { WLAN_LOG_ERROR("%s: Memory allocation failure.\n", dev_info); @@ -131,9 +109,7 @@ static int prism2sta_probe_usb( /* Register the wlandev, this gets us a name and registers the * linux netdevice. */ -#if (LINUX_VERSION_CODE >= KERNEL_VERSION(2,6,0)) SET_NETDEV_DEV(wlandev->netdev, &(interface->dev)); -#endif if ( register_wlandev(wlandev) != 0 ) { WLAN_LOG_ERROR("%s: register_wlandev() failed.\n", dev_info); result = -EIO; @@ -156,9 +132,6 @@ static int prism2sta_probe_usb( } } -#ifndef NEW_MODULE_CODE - usb_inc_dev_use(dev); -#endif #if (LINUX_VERSION_CODE >= KERNEL_VERSION(2,6,15)) usb_get_dev(dev); #endif @@ -175,12 +148,8 @@ static int prism2sta_probe_usb( done: DBFEXIT; -#if (LINUX_VERSION_CODE < KERNEL_VERSION(2,5,0)) - return wlandev; -#else usb_set_intfdata(interface, wlandev); return result; -#endif } @@ -203,25 +172,14 @@ static int prism2sta_probe_usb( * Call context: * process ----------------------------------------------------------------*/ -#if (LINUX_VERSION_CODE < KERNEL_VERSION(2,5,0)) -static void __devexit -prism2sta_disconnect_usb(struct usb_device *dev, void *ptr) -#else static void prism2sta_disconnect_usb(struct usb_interface *interface) -#endif { -#if (LINUX_VERSION_CODE >= KERNEL_VERSION(2,5,0)) wlandevice_t *wlandev; -#else - wlandevice_t *wlandev = (wlandevice_t*)ptr; -#endif DBFENTER; -#if (LINUX_VERSION_CODE >= KERNEL_VERSION(2,5,0)) wlandev = (wlandevice_t *) usb_get_intfdata(interface); -#endif if ( wlandev != NULL ) { LIST_HEAD(cleanlist); @@ -296,9 +254,6 @@ prism2sta_disconnect_usb(struct usb_interface *interface) unregister_wlandev(wlandev); wlan_unsetup(wlandev); -#ifndef NEW_MODULE_CODE - usb_dec_dev_use(hw->usb); -#endif #if (LINUX_VERSION_CODE >= KERNEL_VERSION(2,6,15)) usb_put_dev(hw->usb); #endif @@ -311,15 +266,13 @@ prism2sta_disconnect_usb(struct usb_interface *interface) exit: -#if (LINUX_VERSION_CODE >= KERNEL_VERSION(2,5,0)) usb_set_intfdata(interface, NULL); -#endif DBFEXIT; } static struct usb_driver prism2_usb_driver = { -#if (LINUX_VERSION_CODE > KERNEL_VERSION(2,4,19)) && (LINUX_VERSION_CODE < KERNEL_VERSION(2,6,16)) +#if (LINUX_VERSION_CODE < KERNEL_VERSION(2,6,16)) .owner = THIS_MODULE, #endif .name = "prism2_usb", @@ -329,15 +282,10 @@ static struct usb_driver prism2_usb_driver = { /* fops, minor? */ }; -#ifdef MODULE - static int __init prism2usb_init(void) { DBFENTER; - WLAN_LOG_NOTICE("%s Loaded\n", version); - WLAN_LOG_NOTICE("dev_info is: %s\n", dev_info); - /* This call will result in calls to prism2sta_probe_usb. */ return usb_register(&prism2_usb_driver); @@ -350,12 +298,8 @@ static void __exit prism2usb_cleanup(void) usb_deregister(&prism2_usb_driver); - printk(KERN_NOTICE "%s Unloaded\n", version); - DBFEXIT; }; module_init(prism2usb_init); module_exit(prism2usb_cleanup); - -#endif // module diff --git a/drivers/staging/wlan-ng/prism2mgmt.c b/drivers/staging/wlan-ng/prism2mgmt.c index c975025b6ae0..f850cf8607c1 100644 --- a/drivers/staging/wlan-ng/prism2mgmt.c +++ b/drivers/staging/wlan-ng/prism2mgmt.c @@ -79,19 +79,7 @@ #include #include #include - -#if (WLAN_HOSTIF == WLAN_USB) #include -#endif - -#if (WLAN_HOSTIF == WLAN_PCMCIA) -#include -#include -#include -#include -#include -#include -#endif #include "wlan_compat.h" @@ -1766,30 +1754,11 @@ int prism2mgmt_auxport_state(wlandevice_t *wlandev, void *msgp) { p80211msg_p2req_auxport_state_t *msg = msgp; -#if (WLAN_HOSTIF != WLAN_USB) - hfa384x_t *hw = wlandev->priv; - DBFENTER; - - msg->resultcode.status = P80211ENUM_msgitem_status_data_ok; - if (msg->enable.data == P80211ENUM_truth_true) { - if ( hfa384x_cmd_aux_enable(hw, 0) ) { - msg->resultcode.data = P80211ENUM_resultcode_implementation_failure; - } else { - msg->resultcode.data = P80211ENUM_resultcode_success; - } - } else { - hfa384x_cmd_aux_disable(hw); - msg->resultcode.data = P80211ENUM_resultcode_success; - } - -#else /* !USB */ DBFENTER; msg->resultcode.status = P80211ENUM_msgitem_status_data_ok; msg->resultcode.data = P80211ENUM_resultcode_not_supported; -#endif /* WLAN_HOSTIF != WLAN_USB */ - DBFEXIT; return 0; } @@ -1817,43 +1786,12 @@ int prism2mgmt_auxport_state(wlandevice_t *wlandev, void *msgp) ----------------------------------------------------------------*/ int prism2mgmt_auxport_read(wlandevice_t *wlandev, void *msgp) { -#if (WLAN_HOSTIF != WLAN_USB) - hfa384x_t *hw = wlandev->priv; - p80211msg_p2req_auxport_read_t *msg = msgp; - UINT32 addr; - UINT32 len; - UINT8* buf; - UINT32 maxlen = sizeof(msg->data.data); - DBFENTER; - - if ( hw->auxen ) { - addr = msg->addr.data; - len = msg->len.data; - buf = msg->data.data; - if ( len <= maxlen ) { /* max read/write size */ - hfa384x_copy_from_aux(hw, addr, HFA384x_AUX_CTL_EXTDS, buf, len); - msg->resultcode.data = P80211ENUM_resultcode_success; - } else { - WLAN_LOG_DEBUG(1,"Attempt to read > maxlen from auxport.\n"); - msg->resultcode.data = P80211ENUM_resultcode_refused; - } - - } else { - msg->resultcode.data = P80211ENUM_resultcode_refused; - } - msg->data.status = P80211ENUM_msgitem_status_data_ok; - msg->resultcode.status = P80211ENUM_msgitem_status_data_ok; - - DBFEXIT; - return 0; -#else DBFENTER; WLAN_LOG_ERROR("prism2mgmt_auxport_read: Not supported on USB.\n"); DBFEXIT; return 0; -#endif } @@ -1879,40 +1817,10 @@ int prism2mgmt_auxport_read(wlandevice_t *wlandev, void *msgp) ----------------------------------------------------------------*/ int prism2mgmt_auxport_write(wlandevice_t *wlandev, void *msgp) { -#if (WLAN_HOSTIF != WLAN_USB) - hfa384x_t *hw = wlandev->priv; - p80211msg_p2req_auxport_write_t *msg = msgp; - UINT32 addr; - UINT32 len; - UINT8* buf; - UINT32 maxlen = sizeof(msg->data.data); - DBFENTER; - - if ( hw->auxen ) { - addr = msg->addr.data; - len = msg->len.data; - buf = msg->data.data; - if ( len <= maxlen ) { /* max read/write size */ - hfa384x_copy_to_aux(hw, addr, HFA384x_AUX_CTL_EXTDS, buf, len); - } else { - WLAN_LOG_DEBUG(1,"Attempt to write > maxlen from auxport.\n"); - msg->resultcode.data = P80211ENUM_resultcode_refused; - } - - } else { - msg->resultcode.data = P80211ENUM_resultcode_refused; - } - msg->data.status = P80211ENUM_msgitem_status_data_ok; - msg->resultcode.status = P80211ENUM_msgitem_status_data_ok; - - DBFEXIT; - return 0; -#else DBFENTER; WLAN_LOG_ERROR("prism2mgmt_auxport_read: Not supported on USB.\n"); DBFEXIT; return 0; -#endif } /*---------------------------------------------------------------- @@ -2386,48 +2294,12 @@ int prism2mgmt_dump_state(wlandevice_t *wlandev, void *msgp) p80211msg_p2req_dump_state_t *msg = msgp; int result = 0; -#if (WLAN_HOSTIF != WLAN_USB) - hfa384x_t *hw = wlandev->priv; - UINT16 auxbuf[15]; - DBFENTER; - - WLAN_LOG_NOTICE("prism2 driver and hardware state:\n"); - if ( (result = hfa384x_cmd_aux_enable(hw, 0)) ) { - WLAN_LOG_ERROR("aux_enable failed, result=%d\n", result); - goto failed; - } - hfa384x_copy_from_aux(hw, - 0x01e2, - HFA384x_AUX_CTL_EXTDS, - auxbuf, - sizeof(auxbuf)); - hfa384x_cmd_aux_disable(hw); - WLAN_LOG_NOTICE(" cmac: FreeBlocks=%d\n", auxbuf[5]); - WLAN_LOG_NOTICE(" cmac: IntEn=0x%02x EvStat=0x%02x\n", - hfa384x_getreg(hw, HFA384x_INTEN), - hfa384x_getreg(hw, HFA384x_EVSTAT)); - - #ifdef USE_FID_STACK - WLAN_LOG_NOTICE(" drvr: txfid_top=%d stacksize=%d\n", - hw->txfid_top,HFA384x_DRVR_FIDSTACKLEN_MAX); - #else - WLAN_LOG_NOTICE(" drvr: txfid_head=%d txfid_tail=%d txfid_N=%d\n", - hw->txfid_head, hw->txfid_tail, hw->txfid_N); - #endif - - msg->resultcode.status = P80211ENUM_msgitem_status_data_ok; - msg->resultcode.data = P80211ENUM_resultcode_success; - -#else /* (WLAN_HOSTIF == WLAN_USB) */ - DBFENTER; msg->resultcode.status = P80211ENUM_msgitem_status_data_ok; msg->resultcode.data = P80211ENUM_resultcode_not_supported; goto failed; -#endif /* (WLAN_HOSTIF != WLAN_USB) */ - failed: DBFEXIT; return result; diff --git a/drivers/staging/wlan-ng/prism2mgmt.h b/drivers/staging/wlan-ng/prism2mgmt.h index 733fd999c928..3ccacc4b32a6 100644 --- a/drivers/staging/wlan-ng/prism2mgmt.h +++ b/drivers/staging/wlan-ng/prism2mgmt.h @@ -73,10 +73,6 @@ /*=============================================================*/ /*------ Static variable externs ------------------------------*/ -#if (WLAN_HOSTIF != WLAN_USB) -extern int prism2_bap_timeout; -extern int prism2_irq_evread_max; -#endif extern int prism2_debug; extern int prism2_reset_holdtime; extern int prism2_reset_settletime; diff --git a/drivers/staging/wlan-ng/prism2mib.c b/drivers/staging/wlan-ng/prism2mib.c index eac06f793d81..eb1b2e610f7a 100644 --- a/drivers/staging/wlan-ng/prism2mib.c +++ b/drivers/staging/wlan-ng/prism2mib.c @@ -69,26 +69,7 @@ #include #include #include - -#include "wlan_compat.h" - -//#if (WLAN_HOSTIF == WLAN_PCMCIA) -//#include -//#include -//#include -//#include -//#include -//#include -//#endif -// -//#if ((WLAN_HOSTIF == WLAN_PLX) || (WLAN_HOSTIF == WLAN_PCI)) -//#include -//#include -//endif - -//#if (WLAN_HOSTIF == WLAN_USB) #include -//#endif /*================================================================*/ /* Project Includes */ diff --git a/drivers/staging/wlan-ng/prism2sta.c b/drivers/staging/wlan-ng/prism2sta.c index 18aa15f9e417..397143eceff1 100644 --- a/drivers/staging/wlan-ng/prism2sta.c +++ b/drivers/staging/wlan-ng/prism2sta.c @@ -83,22 +83,8 @@ #include #include -#if (WLAN_HOSTIF == WLAN_PCMCIA) -#include -#include -#include -#include -#include -#include -#endif - #include "wlan_compat.h" -#if ((WLAN_HOSTIF == WLAN_PLX) || (WLAN_HOSTIF == WLAN_PCI)) -#include -#include -#endif - /*================================================================*/ /* Project Includes */ @@ -126,34 +112,9 @@ /*================================================================*/ /* Local Static Definitions */ -#if (WLAN_HOSTIF == WLAN_PCMCIA) -#define DRIVER_SUFFIX "_cs" -#elif (WLAN_HOSTIF == WLAN_PLX) -#define DRIVER_SUFFIX "_plx" -typedef char* dev_info_t; -#elif (WLAN_HOSTIF == WLAN_PCI) -#define DRIVER_SUFFIX "_pci" -typedef char* dev_info_t; -#elif (WLAN_HOSTIF == WLAN_USB) -#define DRIVER_SUFFIX "_usb" typedef char* dev_info_t; -#else -#error "HOSTIF unsupported or undefined!" -#endif - -static char *version = "prism2" DRIVER_SUFFIX ".o: " WLAN_RELEASE; -static dev_info_t dev_info = "prism2" DRIVER_SUFFIX; - -#if (WLAN_HOSTIF == WLAN_PLX || WLAN_HOSTIF == WLAN_PCI) -#ifdef CONFIG_PM -static int prism2sta_suspend_pci(struct pci_dev *pdev, pm_message_t state); -static int prism2sta_resume_pci(struct pci_dev *pdev); -#endif -#endif -#if (WLAN_HOSTIF == WLAN_PCI) - -#endif /* WLAN_PCI */ +static dev_info_t dev_info = "prism2_usb"; static wlandevice_t *create_wlan(void); @@ -163,16 +124,7 @@ static wlandevice_t *create_wlan(void); int prism2_reset_holdtime=30; /* Reset hold time in ms */ int prism2_reset_settletime=100; /* Reset settle time in ms */ -#if (WLAN_HOSTIF == WLAN_USB) static int prism2_doreset=0; /* Do a reset at init? */ -#else -static int prism2_doreset=1; /* Do a reset at init? */ -int prism2_bap_timeout=1000; /* BAP timeout */ -int prism2_irq_evread_max=20; /* Maximum number of - * ev_reads (loops) - * in irq handler - */ -#endif #ifdef WLAN_INCLUDE_DEBUG int prism2_debug=0; @@ -188,13 +140,6 @@ MODULE_PARM_DESC( prism2_reset_holdtime, "reset hold time in ms"); module_param( prism2_reset_settletime, int, 0644); MODULE_PARM_DESC( prism2_reset_settletime, "reset settle time in ms"); -#if (WLAN_HOSTIF != WLAN_USB) -module_param( prism2_bap_timeout, int, 0644); -MODULE_PARM_DESC(prism2_bap_timeout, "BufferAccessPath Timeout in 10*n us"); -module_param( prism2_irq_evread_max, int, 0644); -MODULE_PARM_DESC( prism2_irq_evread_max, "Maximim number of event reads in interrupt handler"); -#endif - MODULE_LICENSE("Dual MPL/GPL"); /*================================================================*/ @@ -299,10 +244,6 @@ static int prism2sta_open(wlandevice_t *wlandev) { DBFENTER; -#ifdef ANCIENT_MODULE_CODE - MOD_INC_USE_COUNT; -#endif - /* We don't currently have to do anything else. * The setup of the MAC should be subsequently completed via * the mlme commands. @@ -341,10 +282,6 @@ static int prism2sta_close(wlandevice_t *wlandev) { DBFENTER; -#ifdef ANCIENT_MODULE_CODE - MOD_DEC_USE_COUNT; -#endif - /* We don't currently have to do anything else. * Higher layers know we're not ready from dev->start==0 and * dev->tbusy==1. Our rx path knows to not pass up received @@ -679,9 +616,6 @@ UINT32 prism2sta_ifstate(wlandevice_t *wlandev, UINT32 ifstate) * Initialize the device+driver sufficiently * for firmware loading. */ -#if (WLAN_HOSTIF != WLAN_USB) - result=hfa384x_cmd_initialize(hw); -#else if ((result=hfa384x_drvr_start(hw))) { WLAN_LOG_ERROR( "hfa384x_drvr_start() failed," @@ -691,7 +625,6 @@ UINT32 prism2sta_ifstate(wlandevice_t *wlandev, UINT32 ifstate) wlandev->msdstate = WLAN_MSD_HWPRESENT; break; } -#endif wlandev->msdstate = WLAN_MSD_FWLOAD; result = P80211ENUM_resultcode_success; break; @@ -2253,41 +2186,6 @@ void prism2sta_ev_alloc(wlandevice_t *wlandev) return; } -#if (WLAN_HOSTIF == WLAN_PLX || WLAN_HOSTIF == WLAN_PCI) -#ifdef CONFIG_PM -static int prism2sta_suspend_pci(struct pci_dev *pdev, pm_message_t state) -{ - wlandevice_t *wlandev; - - wlandev = (wlandevice_t *) pci_get_drvdata(pdev); - - /* reset hardware */ - if (wlandev) { - prism2sta_ifstate(wlandev, P80211ENUM_ifstate_disable); - p80211_suspend(wlandev); - } - - // call a netif_device_detach(wlandev->netdev) ? - - return 0; -} - -static int prism2sta_resume_pci (struct pci_dev *pdev) -{ - wlandevice_t *wlandev; - - wlandev = (wlandevice_t *) pci_get_drvdata(pdev); - - if (wlandev) { - prism2sta_ifstate(wlandev, P80211ENUM_ifstate_disable); - p80211_resume(wlandev); - } - - return 0; -} -#endif -#endif - /*---------------------------------------------------------------- * create_wlan * @@ -2376,20 +2274,9 @@ prism2sta_proc_read( // XXX 0x0001 for prism2.5/3, 0x0000 for prism2. hwtype = BIT0; -#if (WLAN_HOSTIF != WLAN_USB) - if (hw->isram16) - hwtype |= BIT1; -#endif - -#if (WLAN_HOSTIF == WLAN_PCI) - hwtype |= BIT2; -#endif - -#define PRISM2_CVS_ID "$Id: prism2sta.c 1826 2007-03-19 15:37:00Z pizza $" - - p += sprintf(p, "# %s version %s (%s) '%s'\n\n", + p += sprintf(p, "# %s version %s (%s)\n\n", dev_info, - WLAN_RELEASE, WLAN_BUILD_DATE, PRISM2_CVS_ID); + WLAN_RELEASE, WLAN_BUILD_DATE); p += sprintf(p, "# nic h/w: id=0x%02x %d.%d.%d\n", hw->ident_nic.id, hw->ident_nic.major, @@ -2409,11 +2296,6 @@ prism2sta_proc_read( hw->ident_sta_fw.minor, hw->ident_sta_fw.variant); } -#if (WLAN_HOSTIF != WLAN_USB) - p += sprintf(p, "# initial nic hw type, needed for SSF ramdl\n"); - p += sprintf(p, "initnichw=%04x\n", hwtype); -#endif - exit: DBFEXIT; return (p - page); diff --git a/drivers/staging/wlan-ng/version.h b/drivers/staging/wlan-ng/version.h index 305f88239446..86190a18aed5 100644 --- a/drivers/staging/wlan-ng/version.h +++ b/drivers/staging/wlan-ng/version.h @@ -49,14 +49,6 @@ #define KERNEL_VERSION(a,b,c) (((a) << 16) + ((b) << 8) + (c)) #endif -/* WLAN_HOSTIF (generally set on the command line, not detected) */ -#define WLAN_NONE 0 -#define WLAN_PCMCIA 1 -#define WLAN_ISA 2 -#define WLAN_PCI 3 -#define WLAN_USB 4 -#define WLAN_PLX 5 -#define WLAN_SLAVE 6 #define WLAN_RELEASE "0.2.8" #define WLAN_RELEASE_CODE 0x000208 #define WLAN_BUILD_DATE "Thu Oct 2 11:04:42 PDT 2008" diff --git a/drivers/staging/wlan-ng/wlan_compat.h b/drivers/staging/wlan-ng/wlan_compat.h index 59dfa8f84cbe..772d1a39bc3e 100644 --- a/drivers/staging/wlan-ng/wlan_compat.h +++ b/drivers/staging/wlan-ng/wlan_compat.h @@ -48,112 +48,12 @@ #ifndef _WLAN_COMPAT_H #define _WLAN_COMPAT_H -/*=============================================================*/ -/*------ Establish Platform Identity --------------------------*/ -/*=============================================================*/ -/* Key macros: */ -/* WLAN_CPU_FAMILY */ - #define WLAN_Ix86 1 - #define WLAN_PPC 2 - #define WLAN_Ix96 3 - #define WLAN_ARM 4 - #define WLAN_ALPHA 5 - #define WLAN_MIPS 6 - #define WLAN_HPPA 7 - #define WLAN_SPARC 8 - #define WLAN_SH 9 - #define WLAN_x86_64 10 -/* WLAN_SYSARCH */ - #define WLAN_PCAT 1 - #define WLAN_MBX 2 - #define WLAN_RPX 3 - #define WLAN_LWARCH 4 - #define WLAN_PMAC 5 - #define WLAN_SKIFF 6 - #define WLAN_BITSY 7 - #define WLAN_ALPHAARCH 7 - #define WLAN_MIPSARCH 9 - #define WLAN_HPPAARCH 10 - #define WLAN_SPARCARCH 11 - #define WLAN_SHARCH 12 - -/* Note: the PLX HOSTIF above refers to some vendors implementations for */ -/* PCI. It's a PLX chip that is a PCI to PCMCIA adapter, but it */ -/* isn't a real PCMCIA host interface adapter providing all the */ -/* card&socket services. */ - -#if (defined(CONFIG_PPC) || defined(CONFIG_8xx) || defined(__powerpc__)) -#ifndef __ppc__ -#define __ppc__ -#endif -#endif - #if defined(__KERNEL__) #ifndef AUTOCONF_INCLUDED #include #endif -#if defined(__x86_64__) - #define WLAN_CPU_FAMILY WLAN_x86_64 - #define WLAN_SYSARCH WLAN_PCAT -#elif defined(__i386__) || defined(__i486__) || defined(__i586__) || defined(__i686__) - #define WLAN_CPU_FAMILY WLAN_Ix86 - #define WLAN_SYSARCH WLAN_PCAT -#elif defined(__ppc__) - #define WLAN_CPU_FAMILY WLAN_PPC - #if defined(CONFIG_MBX) - #define WLAN_SYSARCH WLAN_MBX - #elif defined(CONFIG_RPXLITE) - #define WLAN_SYSARCH WLAN_RPX - #elif defined(CONFIG_RPXCLASSIC) - #define WLAN_SYSARCH WLAN_RPX - #else - #define WLAN_SYSARCH WLAN_PMAC - #endif -#elif defined(__arm__) - #define WLAN_CPU_FAMILY WLAN_ARM - #define WLAN_SYSARCH WLAN_SKIFF -#elif defined(__alpha__) - #define WLAN_CPU_FAMILY WLAN_ALPHA - #define WLAN_SYSARCH WLAN_ALPHAARCH -#elif defined(__mips__) - #define WLAN_CPU_FAMILY WLAN_MIPS - #define WLAN_SYSARCH WLAN_MIPSARCH -#elif defined(__hppa__) - #define WLAN_CPU_FAMILY WLAN_HPPA - #define WLAN_SYSARCH WLAN_HPPAARCH -#elif defined(__sparc__) - #define WLAN_CPU_FAMILY WLAN_SPARC - #define WLAN_SYSARCH WLAN_SPARC -#elif defined(__sh__) - #define WLAN_CPU_FAMILY WLAN_SH - #define WLAN_SYSARCH WLAN_SHARCH - #ifndef __LITTLE_ENDIAN__ - #define __LITTLE_ENDIAN__ - #endif -#else - #error "No CPU identified!" -#endif -#endif /* __KERNEL__ */ - -/* - Some big endian machines implicitly do all I/O in little endian mode. - - In particular: - Linux/PPC on PowerMacs (PCI) - Arm/Intel Xscale (PCI) - - This may also affect PLX boards and other BE &| PPC platforms; - as new ones are discovered, add them below. -*/ - -#if defined(WLAN_HOSTIF) -#if ((WLAN_HOSTIF == WLAN_PCI) || (WLAN_HOSTIF == WLAN_PLX)) -#if ((WLAN_SYSARCH == WLAN_SKIFF) || (WLAN_SYSARCH == WLAN_PMAC) || (WLAN_SYSARCH == WLAN_SPARC)) -#define REVERSE_ENDIAN -#endif -#endif #endif /*=============================================================*/ @@ -234,15 +134,10 @@ typedef int64_t INT64; #define KERNEL_VERSION(a,b,c) (((a) << 16) + ((b) << 8) + (c)) #endif -#if (LINUX_VERSION_CODE >= KERNEL_VERSION(2,6,0)) -# if (LINUX_VERSION_CODE > KERNEL_VERSION(2,6,8)) -# include -# else -# include -# endif -#elif defined(__KERNEL__) -# define PREEMPT_MASK (0x000000FFUL) -# define preempt_count() (0UL) +#if (LINUX_VERSION_CODE > KERNEL_VERSION(2,6,8)) +# include +#else +# include #endif #define WLAN_LOG_ERROR(x,args...) printk(KERN_ERR "%s: " x , __func__ , ##args); @@ -281,7 +176,7 @@ typedef int64_t INT64; #if defined(__KERNEL__) -#if ((LINUX_VERSION_CODE < KERNEL_VERSION(2,5,0)) || (LINUX_VERSION_CODE >= KERNEL_VERSION(2,6,19))) +#if (LINUX_VERSION_CODE >= KERNEL_VERSION(2,6,19)) #define URB_ONLY_CALLBACK #endif @@ -295,35 +190,13 @@ typedef int64_t INT64; # define del_singleshot_timer_sync(a) del_timer_sync(a) #endif -#if (LINUX_VERSION_CODE >= KERNEL_VERSION(2,4,17)) #define CONFIG_NETLINK 1 -#endif - -#if (LINUX_VERSION_CODE >= KERNEL_VERSION(2,4,0)) -#define kfree_s(a, b) kfree((a)) -#endif - -#if (LINUX_VERSION_CODE < KERNEL_VERSION(2,2,18)) -#ifndef init_waitqueue_head -#if (LINUX_VERSION_CODE < KERNEL_VERSION(2,0,16)) -#define init_waitqueue_head(p) (*(p) = NULL) -#else -#define init_waitqueue_head(p) init_waitqueue(p) -#endif -typedef struct wait_queue *wait_queue_head_t; -typedef struct wait_queue wait_queue_t; -#define set_current_state(b) { current->state = (b); mb(); } -#define init_waitqueue_entry(a, b) { (a)->task = current; } -#endif -#endif #ifndef wait_event_interruptible_timeout // retval == 0; signal met; we're good. // retval < 0; interrupted by signal. // retval > 0; timed out. -#if (LINUX_VERSION_CODE >= KERNEL_VERSION(2,4,0)) // fixme? - #define __wait_event_interruptible_timeout(wq, condition, ret) \ do { \ wait_queue_t __wait; \ @@ -347,34 +220,6 @@ do { \ remove_wait_queue(&wq, &__wait); \ } while (0) -#else // 2.2 - - -#define __wait_event_interruptible_timeout(wq, condition, ret) \ -do { \ - struct wait_queue __wait; \ - \ - __wait.task = current; \ - add_wait_queue(&wq, &__wait); \ - for (;;) { \ - current->state = TASK_INTERRUPTIBLE; \ - if (condition) \ - break; \ - if (!signal_pending(current)) { \ - ret = schedule_timeout(ret); \ - if (!ret) \ - break; \ - continue; \ - } \ - ret = -ERESTARTSYS; \ - break; \ - } \ - current->state = TASK_RUNNING; \ - remove_wait_queue(&wq, &__wait); \ -} while (0) - -#endif // version >= 2.4 - #define wait_event_interruptible_timeout(wq, condition, timeout) \ ({ \ long __ret = timeout; \ @@ -385,181 +230,14 @@ do { \ #endif -#if (LINUX_VERSION_CODE < KERNEL_VERSION(2,4,20)) -#ifdef _LINUX_LIST_H - -static inline void list_move_tail(struct list_head *list, - struct list_head *head) -{ - __list_del(list->prev, list->next); - list_add_tail(list, head); -} - -static inline void __list_splice(struct list_head *list, - struct list_head *head) -{ - struct list_head *first = list->next; - struct list_head *last = list->prev; - struct list_head *at = head->next; - - first->prev = head; - head->next = first; - - last->next = at; - at->prev = last; -} - -static inline void list_move(struct list_head *list, struct list_head *head) -{ - __list_del(list->prev, list->next); - list_add(list, head); -} - -static inline void list_splice_init(struct list_head *list, - struct list_head *head) -{ - if (!list_empty(list)) { - __list_splice(list, head); - INIT_LIST_HEAD(list); - } -} - - -#endif // LIST_H -#endif - -#if (LINUX_VERSION_CODE < KERNEL_VERSION(2,1,90)) -#define spin_lock(l) do { } while (0) -#define spin_unlock(l) do { } while (0) -#define spin_lock_irqsave(l,f) do { save_flags(f); cli(); } while (0) -#define spin_unlock_irqrestore(l,f) do { restore_flags(f); } while (0) -#define spin_lock_init(s) do { } while (0) -#define spin_trylock(l) (1) -typedef int spinlock_t; -#endif - -#if (LINUX_VERSION_CODE < KERNEL_VERSION(2,4,0)) // XXX ??? -#define spin_lock_bh spin_lock -#endif - -#if (LINUX_VERSION_CODE < KERNEL_VERSION(2,4,0)) -#ifdef CONFIG_SMP -#define spin_is_locked(x) (*(volatile char *)(&(x)->lock) <= 0) -#else -#define spin_is_locked(l) (0) -#endif -#endif - -#if (LINUX_VERSION_CODE < KERNEL_VERSION(2,4,28)) -#define __user -#define __iomem -#endif - -#ifdef _LINUX_PROC_FS_H -#if (LINUX_VERSION_CODE < KERNEL_VERSION(2,3,25)) - -extern inline struct proc_dir_entry * -create_proc_read_entry(const char *name, mode_t mode, - struct proc_dir_entry *base, - read_proc_t *read_proc, void *data) -{ - struct proc_dir_entry *res = create_proc_entry(name, mode, base); - if (res) { - res->read_proc = read_proc; - res->data = data; - } - return res; -} -#endif - -#if (LINUX_VERSION_CODE < KERNEL_VERSION(2,3,29)) -#ifndef proc_mkdir -#define proc_mkdir(name, root) create_proc_entry(name, S_IFDIR, root) -#endif -#endif -#endif /* _LINUX_PROC_FS_H */ - -#if (LINUX_VERSION_CODE < KERNEL_VERSION(2,5,0)) -#ifndef INIT_TQUEUE -#define PREPARE_TQUEUE(_tq, _routine, _data) \ - do { \ - (_tq)->routine = _routine; \ - (_tq)->data = _data; \ - } while (0) -#define INIT_TQUEUE(_tq, _routine, _data) \ - do { \ - INIT_LIST_HEAD(&(_tq)->list); \ - (_tq)->sync = 0; \ - PREPARE_TQUEUE((_tq), (_routine), (_data)); \ - } while (0) -#endif - -#ifndef container_of -#define container_of(ptr, type, member) ({ \ - const typeof( ((type *)0)->member ) *__mptr = (ptr); \ - (type *)( (char *)__mptr - offsetof(type,member) );}) -#endif - -#ifndef INIT_WORK -#define work_struct tq_struct - -#if (LINUX_VERSION_CODE < KERNEL_VERSION(2,4,0)) -#define schedule_work(a) queue_task(a, &tq_scheduler) -#else -#define schedule_work(a) schedule_task(a) -#endif - -#define flush_scheduled_work flush_scheduled_tasks -#define INIT_WORK2(_wq, _routine) INIT_TQUEUE(_wq, (void (*)(void *))_routine, _wq) -#endif - -#else // >= 2.5 kernel - #if LINUX_VERSION_CODE < KERNEL_VERSION(2,6,20) #define INIT_WORK2(_wq, _routine) INIT_WORK(_wq, (void (*)(void *))_routine, _wq) #else #define INIT_WORK2(_wq, _routine) INIT_WORK(_wq, _routine) #endif -#endif // >= 2.5 kernel - -#if (LINUX_VERSION_CODE < KERNEL_VERSION(2,3,38)) -typedef struct device netdevice_t; -#elif (LINUX_VERSION_CODE < KERNEL_VERSION(2,4,4)) -typedef struct net_device netdevice_t; -#else #undef netdevice_t typedef struct net_device netdevice_t; -#endif - -#ifdef WIRELESS_EXT -#if (WIRELESS_EXT < 13) -struct iw_request_info -{ - __u16 cmd; /* Wireless Extension command */ - __u16 flags; /* More to come ;-) */ -}; -#endif -#endif - - -#if (LINUX_VERSION_CODE < KERNEL_VERSION(2,1,18)) -#define MODULE_PARM(a,b) extern int __bogus_decl -#define MODULE_AUTHOR(a) extern int __bogus_decl -#define MODULE_DESCRIPTION(a) extern int __bogus_decl -#define MODULE_SUPPORTED_DEVICE(a) extern int __bogus_decl -#undef GET_USE_COUNT -#define GET_USE_COUNT(m) mod_use_count_ -#endif - -#ifndef MODULE_OWNER -#define MODULE_OWNER(a) extern int __bogus_decl -#define ANCIENT_MODULE_CODE -#endif - -#ifndef MODULE_LICENSE -#define MODULE_LICENSE(m) extern int __bogus_decl -#endif /* TODO: Do we care about this? */ #ifndef MODULE_DEVICE_TABLE @@ -569,34 +247,6 @@ struct iw_request_info #define wlan_minutes2ticks(a) ((a)*(wlan_ticks_per_sec * 60)) #define wlan_seconds2ticks(a) ((a)*(wlan_ticks_per_sec)) -#if (LINUX_VERSION_CODE > KERNEL_VERSION(2,5,47)) -#define NEW_MODULE_CODE -#ifdef ANCIENT_MODULE_CODE -#undef ANCIENT_MODULE_CODE -#endif -#elif (LINUX_VERSION_CODE < KERNEL_VERSION(2,4,25)) -#define module_param(name, type, perm) \ - static inline void *__check_existence_##name(void) { return &name; } \ - MODULE_PARM(name, _MODULE_PARM_STRING_ ## type) - -#define _MODULE_PARM_STRING_byte "b" -#define _MODULE_PARM_STRING_short "h" -#define _MODULE_PARM_STRING_ushort "h" -#define _MODULE_PARM_STRING_int "i" -#define _MODULE_PARM_STRING_uint "i" -#define _MODULE_PARM_STRING_long "l" -#define _MODULE_PARM_STRING_ulong "l" -#define _MODULE_PARM_STRING_bool "i" -#endif - -/* linux < 2.5.69 */ -#ifndef IRQ_NONE -typedef void irqreturn_t; -#define IRQ_NONE -#define IRQ_HANDLED -#define IRQ_RETVAL(x) -#endif - #ifndef in_atomic #define in_atomic() 0 #endif @@ -621,18 +271,10 @@ typedef u32 pm_message_t; #define hotplug_path "/etc/hotplug/wlan.agent" #endif -#if (LINUX_VERSION_CODE < KERNEL_VERSION(2,6,0)) -#define free_netdev(x) kfree(x) -#endif - #if (LINUX_VERSION_CODE < KERNEL_VERSION(2,6,9)) #define eth_hdr(x) (x)->mac.ethernet #endif -#if (LINUX_VERSION_CODE < KERNEL_VERSION(2,4,0)) -#define del_timer_sync(a) del_timer(a) -#endif - #ifndef might_sleep #define might_sleep(a) do { } while (0) #endif @@ -642,45 +284,6 @@ typedef u32 pm_message_t; #undef SIOETHTOOL #endif -// pcmcia-cs stuff -#if ((LINUX_VERSION_CODE < KERNEL_VERSION(2,5,68)) && \ - !defined(pcmcia_access_configuration_register)) -#define pcmcia_access_configuration_register(handle, reg) \ - CardServices(AccessConfigurationRegister, handle, reg) -#define pcmcia_register_client(handle, reg) \ - CardServices(RegisterClient, handle, reg) -#define pcmcia_deregister_client(handle) \ - CardServices(DeregisterClient, handle) -#define pcmcia_get_first_tuple(handle, tuple) \ - CardServices(GetFirstTuple, handle, tuple) -#define pcmcia_get_next_tuple(handle, tuple) \ - CardServices(GetNextTuple, handle, tuple) -#define pcmcia_get_tuple_data(handle, tuple) \ - CardServices(GetTupleData, handle, tuple) -#define pcmcia_parse_tuple(handle, tuple, parse) \ - CardServices(ParseTuple, handle, tuple, parse) -#define pcmcia_get_configuration_info(handle, config) \ - CardServices(GetConfigurationInfo, handle, config) -#define pcmcia_request_io(handle, req) \ - CardServices(RequestIO, handle, req) -#define pcmcia_request_irq(handle, req) \ - CardServices(RequestIRQ, handle, req) -#define pcmcia_request_configuration(handle, req) \ - CardServices(RequestConfiguration, handle, req) -#define pcmcia_release_configuration(handle) \ - CardServices(ReleaseConfiguration, handle) -#define pcmcia_release_io(handle, req) \ - CardServices(ReleaseIO, handle, req) -#define pcmcia_release_irq(handle, req) \ - CardServices(ReleaseIRQ, handle, req) -#define pcmcia_release_window(win) \ - CardServices(ReleaseWindow, win) -#define pcmcia_get_card_services_info(info) \ - CardServices(GetCardServicesInfo, info) -#define pcmcia_report_error(handle, err) \ - CardServices(ReportError, handle, err) -#endif - #endif /* __KERNEL__ */ /*=============================================================*/ @@ -692,22 +295,6 @@ typedef u32 pm_message_t; #define host2ieee16(n) __cpu_to_le16(n) #define host2ieee32(n) __cpu_to_le32(n) -#if (WLAN_CPU_FAMILY != WLAN_MIPS) -typedef UINT32 phys_t; -#endif - -#if (WLAN_CPU_FAMILY == WLAN_PPC) - #define wlan_inw(a) in_be16((unsigned short *)((a)+_IO_BASE)) - #define wlan_inw_le16_to_cpu(a) inw((a)) - #define wlan_outw(v,a) out_be16((unsigned short *)((a)+_IO_BASE), (v)) - #define wlan_outw_cpu_to_le16(v,a) outw((v),(a)) -#else - #define wlan_inw(a) inw((a)) - #define wlan_inw_le16_to_cpu(a) __cpu_to_le16(inw((a))) - #define wlan_outw(v,a) outw((v),(a)) - #define wlan_outw_cpu_to_le16(v,a) outw(__cpu_to_le16((v)),(a)) -#endif - /*=============================================================*/ /*--- General Macros ------------------------------------------*/ /*=============================================================*/ -- 2.20.1