Skip to content

Commit

Permalink
Staging: vt6656: remove dependency on kernel version
Browse files Browse the repository at this point in the history
Signed-off-by: Alexander Beregalov <a.beregalov@gmail.com>
Acked-by: Bartlomiej Zolnierkiewicz <bzolnier@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
  • Loading branch information
Alexander Beregalov authored and Greg Kroah-Hartman committed Sep 15, 2009
1 parent 560a9be commit edb3a95
Show file tree
Hide file tree
Showing 10 changed files with 0 additions and 584 deletions.
9 changes: 0 additions & 9 deletions drivers/staging/vt6656/bssdb.c
Original file line number Diff line number Diff line change
Expand Up @@ -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));
Expand Down Expand Up @@ -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));
Expand Down
5 changes: 0 additions & 5 deletions drivers/staging/vt6656/device.h
Original file line number Diff line number Diff line change
Expand Up @@ -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>
Expand Down
4 changes: 0 additions & 4 deletions drivers/staging/vt6656/device_cfg.h
Original file line number Diff line number Diff line change
Expand Up @@ -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__)
Expand Down
15 changes: 0 additions & 15 deletions drivers/staging/vt6656/dpc.c
Original file line number Diff line number Diff line change
Expand Up @@ -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));
Expand Down Expand Up @@ -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));
Expand Down Expand Up @@ -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));
Expand Down
56 changes: 0 additions & 56 deletions drivers/staging/vt6656/iwctl.c
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand All @@ -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;
Expand All @@ -376,23 +364,15 @@ 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;
if(f < 0)f = 0;
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;
Expand Down Expand Up @@ -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;
Expand All @@ -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;
Expand All @@ -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)
Expand All @@ -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
Expand All @@ -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
}


Expand All @@ -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
Expand Down
Loading

0 comments on commit edb3a95

Please sign in to comment.