Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

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

Staging: vt6656: remove dependency on kernel version

parent 560a9be8
Loading
Loading
Loading
Loading
+0 −9
Original line number Diff line number Diff line
@@ -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));
+0 −5
Original line number Diff line number Diff line
@@ -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>
+0 −4
Original line number Diff line number Diff line
@@ -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__)
+0 −15
Original line number Diff line number Diff line
@@ -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));
+0 −56
Original line number Diff line number Diff line
@@ -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
Loading