Commit edb3a950 authored by Alexander Beregalov's avatar Alexander Beregalov Committed by Greg Kroah-Hartman

Staging: vt6656: remove dependency on kernel version

Signed-off-by: default avatarAlexander Beregalov <a.beregalov@gmail.com>
Acked-by: default avatarBartlomiej Zolnierkiewicz <bzolnier@gmail.com>
Signed-off-by: default avatarGreg Kroah-Hartman <gregkh@suse.de>
parent 560a9be8
......@@ -1300,12 +1300,7 @@ if((pMgmt->eCurrState!=WMAC_STATE_ASSOC) &&
wpahdr->req_ie_len = 0;
skb_put(pDevice->skb, sizeof(viawget_wpa_header));
pDevice->skb->dev = pDevice->wpadev;
//2008-4-3 modify by Chester for wpa
#if LINUX_VERSION_CODE >= KERNEL_VERSION(2,6,22)
pDevice->skb->mac_header = pDevice->skb->data;
#else
pDevice->skb->mac.raw = pDevice->skb->data;
#endif
pDevice->skb->pkt_type = PACKET_HOST;
pDevice->skb->protocol = htons(ETH_P_802_2);
memset(pDevice->skb->cb, 0, sizeof(pDevice->skb->cb));
......@@ -1345,11 +1340,7 @@ DBG_PRT(MSG_LEVEL_DEBUG, KERN_INFO "bIsRoaming %d, !\n", pDevice->bIsRoaming );
wpahdr->req_ie_len = 0;
skb_put(pDevice->skb, sizeof(viawget_wpa_header));
pDevice->skb->dev = pDevice->wpadev;
#if LINUX_VERSION_CODE >= KERNEL_VERSION(2,6,22)
pDevice->skb->mac_header = pDevice->skb->data;
#else
pDevice->skb->mac.raw = pDevice->skb->data;
#endif
pDevice->skb->pkt_type = PACKET_HOST;
pDevice->skb->protocol = htons(ETH_P_802_2);
memset(pDevice->skb->cb, 0, sizeof(pDevice->skb->cb));
......
......@@ -57,11 +57,6 @@
#include <linux/sched.h>
#include <linux/if.h>
#include <linux/rtnetlink.h>//James
#if LINUX_VERSION_CODE < KERNEL_VERSION(2,6,18)
#include <linux/config.h>
#endif
#include <linux/proc_fs.h>
#include <linux/inetdevice.h>
#include <linux/reboot.h>
......
......@@ -27,10 +27,6 @@
#ifndef __DEVICE_CONFIG_H
#define __DEVICE_CONFIG_H
#if LINUX_VERSION_CODE < KERNEL_VERSION(2,6,18)
#include <linux/config.h>
#endif
#include <linux/types.h>
#if !defined(__TTYPE_H__)
......
......@@ -674,12 +674,7 @@ RXbBulkInProcessData (
skb->data += 8;
skb->tail += 8;
skb_put(skb, FrameSize);
//2008-4-3 modify by Chester for wpa
#if LINUX_VERSION_CODE >= KERNEL_VERSION(2,6,22)
skb->mac_header = skb->data;
#else
skb->mac.raw = skb->data;
#endif
skb->pkt_type = PACKET_OTHERHOST;
skb->protocol = htons(ETH_P_802_2);
memset(skb->cb, 0, sizeof(skb->cb));
......@@ -836,12 +831,7 @@ RXbBulkInProcessData (
skb->data += (cbIVOffset + 8);
skb->tail += (cbIVOffset + 8);
skb_put(skb, FrameSize);
//2008-4-3 modify by Chester for wpa
#if LINUX_VERSION_CODE >= KERNEL_VERSION(2,6,22)
skb->mac_header = skb->data;
#else
skb->mac.raw = skb->data;
#endif
skb->pkt_type = PACKET_OTHERHOST;
skb->protocol = htons(ETH_P_802_2);
memset(skb->cb, 0, sizeof(skb->cb));
......@@ -961,12 +951,7 @@ RXbBulkInProcessData (
wpahdr->req_ie_len = 0;
skb_put(pDevice->skb, sizeof(viawget_wpa_header));
pDevice->skb->dev = pDevice->wpadev;
//2008-4-3 modify by Chester for wpa
#if LINUX_VERSION_CODE >= KERNEL_VERSION(2,6,22)
pDevice->skb->mac_header = pDevice->skb->data;
#else
pDevice->skb->mac.raw = pDevice->skb->data;
#endif
pDevice->skb->pkt_type = PACKET_HOST;
pDevice->skb->protocol = htons(ETH_P_802_2);
memset(pDevice->skb->cb, 0, sizeof(pDevice->skb->cb));
......
......@@ -337,22 +337,14 @@ int iwctl_giwscan(struct net_device *dev,
iwe.cmd = SIOCGIWAP;
iwe.u.ap_addr.sa_family = ARPHRD_ETHER;
memcpy(iwe.u.ap_addr.sa_data, pBSS->abyBSSID, WLAN_BSSID_LEN);
#if LINUX_VERSION_CODE >= KERNEL_VERSION(2,6,27) //mike add
current_ev = iwe_stream_add_event(info,current_ev,end_buf, &iwe, IW_EV_ADDR_LEN);
#else
current_ev = iwe_stream_add_event(current_ev,end_buf, &iwe, IW_EV_ADDR_LEN);
#endif
//ADD ssid
memset(&iwe, 0, sizeof(iwe));
iwe.cmd = SIOCGIWESSID;
pItemSSID = (PWLAN_IE_SSID)pBSS->abySSID;
iwe.u.data.length = pItemSSID->len;
iwe.u.data.flags = 1;
#if LINUX_VERSION_CODE >= KERNEL_VERSION(2,6,27) //mike add
current_ev = iwe_stream_add_point(info,current_ev,end_buf, &iwe, pItemSSID->abySSID);
#else
current_ev = iwe_stream_add_point(current_ev,end_buf, &iwe, pItemSSID->abySSID);
#endif
//ADD mode
memset(&iwe, 0, sizeof(iwe));
iwe.cmd = SIOCGIWMODE;
......@@ -363,11 +355,7 @@ int iwctl_giwscan(struct net_device *dev,
iwe.u.mode = IW_MODE_ADHOC;
}
iwe.len = IW_EV_UINT_LEN;
#if LINUX_VERSION_CODE >= KERNEL_VERSION(2,6,27) //mike add
current_ev = iwe_stream_add_event(info,current_ev, end_buf, &iwe, IW_EV_UINT_LEN);
#else
current_ev = iwe_stream_add_event(current_ev, end_buf, &iwe, IW_EV_UINT_LEN);
#endif
//ADD frequency
pSuppRates = (PWLAN_IE_SUPP_RATES)pBSS->abySuppRates;
pExtSuppRates = (PWLAN_IE_SUPP_RATES)pBSS->abyExtSuppRates;
......@@ -376,11 +364,7 @@ int iwctl_giwscan(struct net_device *dev,
iwe.u.freq.m = pBSS->uChannel;
iwe.u.freq.e = 0;
iwe.u.freq.i = 0;
#if LINUX_VERSION_CODE >= KERNEL_VERSION(2,6,27) //mike add
current_ev = iwe_stream_add_event(info,current_ev,end_buf, &iwe, IW_EV_FREQ_LEN);
#else
current_ev = iwe_stream_add_event(current_ev,end_buf, &iwe, IW_EV_FREQ_LEN);
#endif
//2008-0409-04, <Add> by Einsn Liu
{
int f = (int)pBSS->uChannel - 1;
......@@ -388,11 +372,7 @@ int iwctl_giwscan(struct net_device *dev,
iwe.u.freq.m = frequency_list[f] * 100000;
iwe.u.freq.e = 1;
}
#if LINUX_VERSION_CODE >= KERNEL_VERSION(2,6,27) //mike add
current_ev = iwe_stream_add_event(info,current_ev,end_buf, &iwe, IW_EV_FREQ_LEN);
#else
current_ev = iwe_stream_add_event(current_ev,end_buf, &iwe, IW_EV_FREQ_LEN);
#endif
//ADD quality
memset(&iwe, 0, sizeof(iwe));
iwe.cmd = IWEVQUAL;
......@@ -442,11 +422,7 @@ int iwctl_giwscan(struct net_device *dev,
iwe.u.qual.qual = 0;
}
*/
#if LINUX_VERSION_CODE >= KERNEL_VERSION(2,6,27) //mike add
current_ev = iwe_stream_add_event(info,current_ev, end_buf, &iwe, IW_EV_QUAL_LEN);
#else
current_ev = iwe_stream_add_event(current_ev, end_buf, &iwe, IW_EV_QUAL_LEN);
#endif
//ADD encryption
memset(&iwe, 0, sizeof(iwe));
iwe.cmd = SIOCGIWENCODE;
......@@ -456,11 +432,7 @@ int iwctl_giwscan(struct net_device *dev,
}else {
iwe.u.data.flags = IW_ENCODE_DISABLED;
}
#if LINUX_VERSION_CODE >= KERNEL_VERSION(2,6,27) //mike add
current_ev = iwe_stream_add_point(info,current_ev,end_buf, &iwe, pItemSSID->abySSID);
#else
current_ev = iwe_stream_add_point(current_ev,end_buf, &iwe, pItemSSID->abySSID);
#endif
memset(&iwe, 0, sizeof(iwe));
iwe.cmd = SIOCGIWRATE;
......@@ -472,22 +444,14 @@ int iwctl_giwscan(struct net_device *dev,
break;
// Bit rate given in 500 kb/s units (+ 0x80)
iwe.u.bitrate.value = ((pSuppRates->abyRates[kk] & 0x7f) * 500000);
#if LINUX_VERSION_CODE >= KERNEL_VERSION(2,6,27) //mike add
current_val = iwe_stream_add_value(info,current_ev, current_val, end_buf, &iwe, IW_EV_PARAM_LEN);
#else
current_val = iwe_stream_add_value(current_ev, current_val, end_buf, &iwe, IW_EV_PARAM_LEN);
#endif
}
for (kk = 0 ; kk < 8 ; kk++) {
if (pExtSuppRates->abyRates[kk] == 0)
break;
// Bit rate given in 500 kb/s units (+ 0x80)
iwe.u.bitrate.value = ((pExtSuppRates->abyRates[kk] & 0x7f) * 500000);
#if LINUX_VERSION_CODE >= KERNEL_VERSION(2,6,27) //mike add
current_val = iwe_stream_add_value(info,current_ev, current_val, end_buf, &iwe, IW_EV_PARAM_LEN);
#else
current_val = iwe_stream_add_value(current_ev, current_val, end_buf, &iwe, IW_EV_PARAM_LEN);
#endif
}
if((current_val - current_ev) > IW_EV_LCP_LEN)
......@@ -498,33 +462,21 @@ int iwctl_giwscan(struct net_device *dev,
iwe.cmd = IWEVCUSTOM;
sprintf(buf, "bcn_int=%d", pBSS->wBeaconInterval);
iwe.u.data.length = strlen(buf);
#if LINUX_VERSION_CODE >= KERNEL_VERSION(2,6,27) //mike add
current_ev = iwe_stream_add_point(info,current_ev, end_buf, &iwe, buf);
#else
current_ev = iwe_stream_add_point(current_ev, end_buf, &iwe, buf);
#endif
#if WIRELESS_EXT > 17
if ((pBSS->wWPALen > 0) && (pBSS->wWPALen <= MAX_WPA_IE_LEN)) {
memset(&iwe, 0, sizeof(iwe));
iwe.cmd = IWEVGENIE;
iwe.u.data.length = pBSS->wWPALen;
#if LINUX_VERSION_CODE >= KERNEL_VERSION(2,6,27) //mike add
current_ev = iwe_stream_add_point(info,current_ev, end_buf, &iwe, pBSS->byWPAIE);
#else
current_ev = iwe_stream_add_point(current_ev, end_buf, &iwe, pBSS->byWPAIE);
#endif
}
if ((pBSS->wRSNLen > 0) && (pBSS->wRSNLen <= MAX_WPA_IE_LEN)) {
memset(&iwe, 0, sizeof(iwe));
iwe.cmd = IWEVGENIE;
iwe.u.data.length = pBSS->wRSNLen;
#if LINUX_VERSION_CODE >= KERNEL_VERSION(2,6,27) //mike add
current_ev = iwe_stream_add_point(info,current_ev, end_buf, &iwe, pBSS->byRSNIE);
#else
current_ev = iwe_stream_add_point(current_ev, end_buf, &iwe, pBSS->byRSNIE);
#endif
}
#else // WIRELESS_EXT > 17
......@@ -537,11 +489,7 @@ int iwctl_giwscan(struct net_device *dev,
p += sprintf(p, "%02x", pBSS->byWPAIE[ii]);
}
iwe.u.data.length = strlen(buf);
#if LINUX_VERSION_CODE >= KERNEL_VERSION(2,6,27) //mike add
current_ev = iwe_stream_add_point(info,current_ev, end_buf, &iwe, buf);
#else
current_ev = iwe_stream_add_point(current_ev, end_buf, &iwe, buf);
#endif
}
......@@ -554,11 +502,7 @@ int iwctl_giwscan(struct net_device *dev,
p += sprintf(p, "%02x", pBSS->byRSNIE[ii]);
}
iwe.u.data.length = strlen(buf);
#if LINUX_VERSION_CODE >= KERNEL_VERSION(2,6,27) //mike add
current_ev = iwe_stream_add_point(info,current_ev, end_buf, &iwe, buf);
#else
current_ev = iwe_stream_add_point(current_ev, end_buf, &iwe, buf);
#endif
}
#endif
#endif
......
......@@ -70,246 +70,14 @@ typedef void irqreturn_t;
#endif
#if LINUX_VERSION_CODE >= KERNEL_VERSION(2,6,0)
#define vntwusb_submit_urb(val) usb_submit_urb(val, GFP_ATOMIC)
#define vntwusb_alloc_urb(val) usb_alloc_urb(val, GFP_ATOMIC)
#else
#define vntwusb_alloc_urb(val) usb_alloc_urb(val)
#define vntwusb_submit_urb(val) usb_submit_urb(val)
#endif
#if LINUX_VERSION_CODE >= KERNEL_VERSION(2,6,10)
#define vntwusb_unlink_urb(val) usb_kill_urb(val)
#else
#define vntwusb_unlink_urb(val) usb_unlink_urb(val)
#endif
#if LINUX_VERSION_CODE < KERNEL_VERSION(2,2,18)
typedef unsigned long dma_addr_t;
typedef struct wait_queue *wait_queue_head_t;
#define init_waitqueue_head(x) *(x)=NULL
#define set_current_state(status) { current->state = (status); mb(); }
#ifdef MODULE
#define module_init(fn) int init_module (void) { return fn(); }
#define module_exit(fn) void cleanup_module(void) { return fn(); }
#else /* MODULE */
#define module_init(fn) int e100_probe (void) { return fn(); }
#define module_exit(fn) /* NOTHING */
#endif /* MODULE */
#endif /* LINUX_VERSION_CODE < KERNEL_VERSION(2,2,18) */
#if LINUX_VERSION_CODE < KERNEL_VERSION(2,3,0)
#ifdef MODVERSIONS
#include <linux/modversions.h>
#endif
#include <linux/types.h>
#include <linux/pci.h>
#include <linux/slab.h>
#include <asm/io.h>
#define pci_resource_start(dev, bar) \
(((dev)->base_address[(bar)] & PCI_BASE_ADDRESS_SPACE_IO) ? \
((dev)->base_address[(bar)] & PCI_BASE_ADDRESS_IO_MASK) : \
((dev)->base_address[(bar)] & PCI_BASE_ADDRESS_MEM_MASK))
static inline int pci_enable_device(struct pci_dev *dev) { return 0; }
#define __constant_cpu_to_le32 cpu_to_le32
#define __constant_cpu_to_le16 cpu_to_le16
#define PCI_DMA_TODEVICE 1
#define PCI_DMA_FROMDEVICE 2
extern inline void *pci_alloc_consistent (struct pci_dev *dev,
size_t size,
dma_addr_t *dma_handle) {
void *vaddr = kmalloc(size, GFP_ATOMIC);
if(vaddr != NULL) {
*dma_handle = virt_to_bus(vaddr);
}
return vaddr;
}
#define pci_dma_sync_single(dev,dma_handle,size,direction) do{} while(0)
#define pci_dma_supported(dev, addr_mask) (1)
#define pci_free_consistent(dev, size, cpu_addr, dma_handle) kfree(cpu_addr)
#define pci_map_single(dev, addr, size, direction) virt_to_bus(addr)
#define pci_unmap_single(dev, dma_handle, size, direction) do{} while(0)
#define spin_lock_bh spin_lock_irq
#define spin_unlock_bh spin_unlock_irq
#define del_timer_sync(timer) del_timer(timer)
#define net_device device
#define netif_start_queue(dev) ( clear_bit(0, &(dev)->tbusy))
#define netif_stop_queue(dev) ( set_bit(0, &(dev)->tbusy))
#define netif_wake_queue(dev) { clear_bit(0, &(dev)->tbusy); \
mark_bh(NET_BH); }
#define netif_running(dev) ( test_bit(0, &(dev)->start))
#define netif_queue_stopped(dev) ( test_bit(0, &(dev)->tbusy))
#define netif_device_attach(dev) \
do{ (dev)->start = 1; netif_start_queue(dev); } while (0)
#define netif_device_detach(dev) \
do{ (dev)->start = 0; netif_stop_queue(dev); } while (0)
#define dev_kfree_skb_irq(skb) dev_kfree_skb(skb)
#define netif_carrier_on(dev) do {} while (0)
#define netif_carrier_off(dev) do {} while (0)
#define PCI_ANY_ID (~0U)
struct pci_device_id {
unsigned int vendor, device;
unsigned int subvendor, subdevice;
unsigned int class, classmask;
unsigned long driver_data;
};
#define MODULE_DEVICE_TABLE(bus, dev_table)
#define PCI_MAX_NUM_NICS 256
struct pci_driver {
char *name;
struct pci_device_id *id_table;
int (*probe)(struct pci_dev *dev, const struct pci_device_id *id);
void (*remove)(struct pci_dev *dev);
void (*suspend)(struct pci_dev *dev);
void (*resume)(struct pci_dev *dev);
struct pci_dev *pcimap[PCI_MAX_NUM_NICS];
};
static inline int pci_module_init(struct pci_driver *drv)
{
struct pci_dev *pdev;
struct pci_device_id *pcid;
uint16_t subvendor, subdevice;
int board_count = 0;
/* walk the global pci device list looking for matches */
for (pdev = pci_devices; pdev && (board_count < PCI_MAX_NUM_NICS); pdev = pdev->next) {
pcid = &drv->id_table[0];
pci_read_config_word(pdev, PCI_SUBSYSTEM_VENDOR_ID, &subvendor);
pci_read_config_word(pdev, PCI_SUBSYSTEM_ID, &subdevice);
while (pcid->vendor != 0) {
if (((pcid->vendor == pdev->vendor) || (pcid->vendor == PCI_ANY_ID)) &&
((pcid->device == pdev->device) || (pcid->device == PCI_ANY_ID)) &&
((pcid->subvendor == subvendor) || (pcid->subvendor == PCI_ANY_ID)) &&
((pcid->subdevice == subdevice) || (pcid->subdevice == PCI_ANY_ID))) {
if (drv->probe(pdev, pcid) == 0) {
drv->pcimap[board_count] = pdev;
board_count++;
}
break;
}
pcid++;
}
}
if (board_count < PCI_MAX_NUM_NICS) {
drv->pcimap[board_count] = NULL;
}
return (board_count > 0) ? 0 : -ENODEV;
}
static inline void pci_unregister_driver(struct pci_driver *drv)
{
int i;
for (i = 0; i < PCI_MAX_NUM_NICS; i++) {
if (!drv->pcimap[i])
break;
drv->remove(drv->pcimap[i]);
}
}
#define pci_set_drvdata(pcid, data)
#define pci_get_drvdata(pcid) ({ \
PSDevice pInfo; \
for (pInfo = pDevice_Infos; \
pInfo; pInfo = pInfo->next) { \
if (pInfo->pcid == pcid) \
break; \
} \
pInfo; })
#endif /* LINUX_VERSION_CODE < KERNEL_VERSION(2,3,0) */
#if LINUX_VERSION_CODE < KERNEL_VERSION(2,4,5)
#define skb_linearize(skb, gfp_mask) ({ \
struct sk_buff *tmp_skb; \
tmp_skb = skb; \
skb = skb_copy(tmp_skb, gfp_mask); \
dev_kfree_skb_irq(tmp_skb); })
#endif /* LINUX_VERSION_CODE < KERNEL_VERSION(2,4,5) */
#ifndef MODULE_LICESEN
#define MODULE_LICESEN(x)
#endif
#if LINUX_VERSION_CODE < KERNEL_VERSION(2,4,6)
#include <linux/types.h>
#include <linux/pci.h>
#if LINUX_VERSION_CODE < KERNEL_VERSION(2,4,2)
static inline int pci_set_power_state(struct pci_dev* pcid, int state) { return 0; }
#endif
#define PMCSR 0xe0
#define PM_ENABLE_BIT 0x0100
#define PM_CLEAR_BIT 0x8000
#define PM_STATE_MASK 0xFFFC
#define PM_STATE_D1 0x0001
static inline int
pci_enable_wake(struct pci_dev *dev, u32 state, int enable)
{
u16 p_state;
pci_read_config_word(dev, PMCSR, &p_state);
pci_write_config_word(dev, PMCSR, p_state | PM_CLEAR_BIT);
if (enable == 0) {
p_state &= ~PM_ENABLE_BIT;
} else {
p_state |= PM_ENABLE_BIT;
}
p_state &= PM_STATE_MASK;
p_state |= state;
pci_write_config_word(dev, PMCSR, p_state);
return 0;
}
#endif /* LINUX_VERSION_CODE < KERNEL_VERSION(2,4,6) */
#endif
This diff is collapsed.
......@@ -86,49 +86,6 @@ static int msglevel =MSG_LEVEL_INFO;
/*--------------------- Static Variables --------------------------*/
/*--------------------- Static Functions --------------------------*/
//2007-0508-02<Add>by MikeLiu
#if (LINUX_VERSION_CODE >= KERNEL_VERSION(2,6,0))&&(LINUX_VERSION_CODE < KERNEL_VERSION(2,6,20))
static
VOID
s_nsInterruptUsbIoCompleteRead(
IN struct urb *urb,
IN struct pt_regs *regs
);
static
VOID
s_nsBulkInUsbIoCompleteRead(
IN struct urb *urb,
IN struct pt_regs *regs
);
static
VOID
s_nsBulkOutIoCompleteWrite(
IN struct urb *urb,
IN struct pt_regs *regs
);
static
VOID
s_nsControlInUsbIoCompleteRead(
IN struct urb *urb,
IN struct pt_regs *regs
);
static
VOID
s_nsControlInUsbIoCompleteWrite(
IN struct urb *urb,
IN struct pt_regs *regs
);
#else
static
VOID
s_nsInterruptUsbIoCompleteRead(
......@@ -162,9 +119,6 @@ s_nsControlInUsbIoCompleteWrite(
IN struct urb *urb
);
#endif
/*--------------------- Export Variables --------------------------*/
/*--------------------- Export Functions --------------------------*/
......@@ -338,23 +292,11 @@ PIPEnsControlIn(
return ntStatus;
}
//2007-0508-03<Add>by MikeLiu
#if (LINUX_VERSION_CODE >= KERNEL_VERSION(2,6,0))&&(LINUX_VERSION_CODE < KERNEL_VERSION(2,6,20))
static
VOID
s_nsControlInUsbIoCompleteWrite(
IN struct urb *urb,
IN struct pt_regs *regs
)
#else
static
VOID
s_nsControlInUsbIoCompleteWrite(
IN struct urb *urb
)
#endif
{
PSDevice pDevice;
......@@ -391,23 +333,11 @@ s_nsControlInUsbIoCompleteWrite(
* Return Value: STATUS_INSUFFICIENT_RESOURCES or result of IoCallDriver
*
*/
//2007-0508-04<Add>by MikeLiu
#if (LINUX_VERSION_CODE >= KERNEL_VERSION(2,6,0))&&(LINUX_VERSION_CODE < KERNEL_VERSION(2,6,20))
static
VOID
s_nsControlInUsbIoCompleteRead(
IN struct urb *urb,
IN struct pt_regs *regs
)
#else
static
VOID
s_nsControlInUsbIoCompleteRead(
IN struct urb *urb
)
#endif
{
PSDevice pDevice;
......@@ -488,10 +418,7 @@ PIPEnsInterruptRead(
);
#else
//2008-0526-01<Add>by MikeLiu
#if LINUX_VERSION_CODE >= KERNEL_VERSION(2,6,23)
pDevice->pInterruptURB->interval = pDevice->int_interval;
#endif
usb_fill_bulk_urb(pDevice->pInterruptURB,
pDevice->usb,
......@@ -503,19 +430,10 @@ usb_fill_bulk_urb(pDevice->pInterruptURB,
#endif
#endif
#if LINUX_VERSION_CODE >= KERNEL_VERSION(2,6,0)
if ((ntStatus = vntwusb_submit_urb(pDevice->pInterruptURB)) != 0) {
DBG_PRT(MSG_LEVEL_DEBUG, KERN_INFO"Submit int URB failed %d\n", ntStatus);
}
#else
if (pDevice->bEventAvailable == FALSE) {
if ((ntStatus = vntwusb_submit_urb(pDevice->pInterruptURB)) != 0) {
DBG_PRT(MSG_LEVEL_DEBUG, KERN_INFO"Submit int URB failed %d\n", ntStatus);
}
}
#endif
DBG_PRT(MSG_LEVEL_DEBUG, KERN_INFO"<----s_nsStartInterruptUsbRead Return(%x)\n",ntStatus);
return ntStatus;
}
......@@ -535,23 +453,12 @@ usb_fill_bulk_urb(pDevice->pInterruptURB,
* Return Value: STATUS_INSUFFICIENT_RESOURCES or result of IoCallDriver
*
*/
//2007-0508-05<Add>by MikeLiu
#if (LINUX_VERSION_CODE >= KERNEL_VERSION(2,6,0))&&(LINUX_VERSION_CODE < KERNEL_VERSION(2,6,20))
static
VOID
s_nsInterruptUsbIoCompleteRead(
IN struct urb *urb,
IN struct pt_regs *regs
)
#else
static
VOID
s_nsInterruptUsbIoCompleteRead(
IN struct urb *urb
)
#endif
{
PSDevice pDevice;
NTSTATUS ntStatus;
......@@ -603,18 +510,9 @@ s_nsInterruptUsbIoCompleteRead(
if (pDevice->fKillEventPollingThread != TRUE) {
#if 0 //reserve int URB submit
#if LINUX_VERSION_CODE >= KERNEL_VERSION(2,6,0)
if ((ntStatus = vntwusb_submit_urb(urb)) != 0) {
DBG_PRT(MSG_LEVEL_DEBUG, KERN_INFO"Re-Submit int URB failed %d\n", ntStatus);
}
#else
if (pDevice->bEventAvailable == FALSE) {
if ((ntStatus = vntwusb_submit_urb(urb)) != 0) {
DBG_PRT(MSG_LEVEL_DEBUG, KERN_INFO"Re-Submit int URB failed %d\n", ntStatus);
}
}
#endif
#else //replace int URB submit by bulk transfer
#ifdef Safe_Close
usb_fill_bulk_urb(pDevice->pInterruptURB,
......@@ -625,18 +523,10 @@ s_nsInterruptUsbIoCompleteRead(
s_nsInterruptUsbIoCompleteRead,
pDevice);
#if LINUX_VERSION_CODE >= KERNEL_VERSION(2,6,0)
if ((ntStatus = vntwusb_submit_urb(pDevice->pInterruptURB)) != 0) {
DBG_PRT(MSG_LEVEL_DEBUG, KERN_INFO"Submit int URB failed %d\n", ntStatus);
}
#else
if (pDevice->bEventAvailable == FALSE) {
if ((ntStatus = vntwusb_submit_urb(pDevice->pInterruptURB)) != 0) {
DBG_PRT(MSG_LEVEL_DEBUG, KERN_INFO"Submit int URB failed %d\n", ntStatus);
}
}
#endif
#else
tasklet_schedule(&pDevice->EventWorkItem);
#endif
......@@ -725,23 +615,12 @@ PIPEnsBulkInUsbRead(
* Return Value: STATUS_INSUFFICIENT_RESOURCES or result of IoCallDriver
*
*/
//2007-0508-06<Add>by MikeLiu
#if (LINUX_VERSION_CODE >= KERNEL_VERSION(2,6,0))&&(LINUX_VERSION_CODE < KERNEL_VERSION(2,6,20))
static
VOID
s_nsBulkInUsbIoCompleteRead(
IN struct urb *urb,
IN struct pt_regs *regs
)
#else
static
VOID
s_nsBulkInUsbIoCompleteRead(
IN struct urb *urb
)
#endif
{
PRCB pRCB = (PRCB)urb->context;
PSDevice pDevice = (PSDevice)pRCB->pDevice;
......@@ -895,22 +774,11 @@ PIPEnsSendBulkOut(
* (IofCompleteRequest) to stop working on the irp.
*
*/
//2007-0508-07<Add>by MikeLiu
#if (LINUX_VERSION_CODE >= KERNEL_VERSION(2,6,0))&&(LINUX_VERSION_CODE < KERNEL_VERSION(2,6,20))
static
VOID
s_nsBulkOutIoCompleteWrite(
IN struct urb *urb,
IN struct pt_regs *regs
)
#else
static
VOID
s_nsBulkOutIoCompleteWrite(
IN struct urb *urb
)
#endif
{
PSDevice pDevice;
NTSTATUS status;
......
......@@ -524,12 +524,7 @@ vRunCommand(
(pMgmt->uScanChannel < CB_MAX_CHANNEL_24G)) {
s_vProbeChannel(pDevice);
spin_unlock_irq(&pDevice->lock);
//2008-0526-02<Add>by MikeLiu
#if LINUX_VERSION_CODE >= KERNEL_VERSION(2,6,23)
vCommandTimerWait((HANDLE)pDevice, 100);
#else
vCommandTimerWait((HANDLE)pDevice, WCMD_ACTIVE_SCAN_TIME);
#endif
return;
} else {
spin_unlock_irq(&pDevice->lock);
......
......@@ -1053,12 +1053,7 @@ s_vMgrRxAssocResponse(
);
skb_put(pDevice->skb, sizeof(viawget_wpa_header) + wpahdr->resp_ie_len + wpahdr->req_ie_len);
pDevice->skb->dev = pDevice->wpadev;
//2008-4-3 modify by Chester for wpa
#if LINUX_VERSION_CODE >= KERNEL_VERSION(2,6,22)
pDevice->skb->mac_header = pDevice->skb->data;
#else
pDevice->skb->mac.raw = pDevice->skb->data;
#endif
pDevice->skb->pkt_type = PACKET_HOST;
pDevice->skb->protocol = htons(ETH_P_802_2);
memset(pDevice->skb->cb, 0, sizeof(pDevice->skb->cb));
......@@ -1697,12 +1692,7 @@ s_vMgrRxDisassociation(
wpahdr->req_ie_len = 0;
skb_put(pDevice->skb, sizeof(viawget_wpa_header));
pDevice->skb->dev = pDevice->wpadev;
//2008-4-3 modify by Chester for wpa
#if LINUX_VERSION_CODE >= KERNEL_VERSION(2,6,22)
pDevice->skb->mac_header = pDevice->skb->data;
#else
pDevice->skb->mac.raw = pDevice->skb->data;
#endif
pDevice->skb->pkt_type = PACKET_HOST;
pDevice->skb->protocol = htons(ETH_P_802_2);
memset(pDevice->skb->cb, 0, sizeof(pDevice->skb->cb));
......@@ -1805,12 +1795,7 @@ s_vMgrRxDeauthentication(
wpahdr->req_ie_len = 0;
skb_put(pDevice->skb, sizeof(viawget_wpa_header));
pDevice->skb->dev = pDevice->wpadev;
//2008-4-3 modify by Chester for wpa
#if LINUX_VERSION_CODE >= KERNEL_VERSION(2,6,22)
pDevice->skb->mac_header = pDevice->skb->data;
#else
pDevice->skb->mac.raw = pDevice->skb->data;
#endif
pDevice->skb->pkt_type = PACKET_HOST;
pDevice->skb->protocol = htons(ETH_P_802_2);
memset(pDevice->skb->cb, 0, sizeof(pDevice->skb->cb));
......
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