All of lore.kernel.org
 help / color / mirror / Atom feed
From: Forest Bond <forest@alittletooquiet.net>
To: Greg KH <greg@kroah.com>
Cc: Larry Finger <Larry.Finger@lwfinger.net>,
	"John W. Linville" <linville@tuxdriver.com>,
	Johannes Berg <johannes@sipsolutions.net>,
	Marcel Holtmann <marcel@holtmann.org>,
	linux-wireless@vger.kernel.org, Dan Williams <dcbw@redhat.com>
Subject: [PATCH 8/8] vt6655: Remove LINUX_VERSION_CODE preprocessor conditionals.
Date: Sat, 25 Apr 2009 10:32:46 -0400	[thread overview]
Message-ID: <20090425143246.GH11201@storm.local.network> (raw)
In-Reply-To: <20090425001405.GB23173@kroah.com>

[-- Attachment #1: Type: text/plain, Size: 32313 bytes --]

vt6655: Remove LINUX_VERSION_CODE preprocessor conditionals.

Signed-off-by: Forest Bond <forest@alittletooquiet.net>
---
 drivers/staging/vt6655/bssdb.c       |    5 -
 drivers/staging/vt6655/device_main.c |   84 +-------------
 drivers/staging/vt6655/dpc.c         |   24 +----
 drivers/staging/vt6655/iwctl.c       |   78 ++-----------
 drivers/staging/vt6655/kcompat.h     |  218 ----------------------------------
 drivers/staging/vt6655/wmgr.c        |   16 +--
 6 files changed, 16 insertions(+), 409 deletions(-)

diff --git a/drivers/staging/vt6655/bssdb.c b/drivers/staging/vt6655/bssdb.c
index 27b46d7..841e161 100644
--- a/drivers/staging/vt6655/bssdb.c
+++ b/drivers/staging/vt6655/bssdb.c
@@ -1335,12 +1335,7 @@ start:
              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));
diff --git a/drivers/staging/vt6655/device_main.c b/drivers/staging/vt6655/device_main.c
index ca198a2..68ce094 100644
--- a/drivers/staging/vt6655/device_main.c
+++ b/drivers/staging/vt6655/device_main.c
@@ -367,7 +367,6 @@ static void device_set_multi(struct net_device *dev);
 static int  device_close(struct net_device *dev);
 static int  device_ioctl(struct net_device *dev, struct ifreq *rq, int cmd);
 
-#if LINUX_VERSION_CODE >= KERNEL_VERSION(2,4,9)
 #ifdef CONFIG_PM
 static int device_notify_reboot(struct notifier_block *, unsigned long event, void *ptr);
 static int viawget_suspend(struct pci_dev *pcid, u32 state);
@@ -378,7 +377,6 @@ struct notifier_block device_notifier = {
         priority:       0
 };
 #endif
-#endif 
 
 #endif // #ifndef PRIVATE_OBJ
 
@@ -948,12 +946,7 @@ static BOOL device_release_WPADEV(PSDevice pDevice)
                  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));
@@ -984,23 +977,14 @@ device_found1(struct pci_dev *pcid, const struct pci_device_id *ent)
     struct net_device*  dev = NULL;
     PCHIP_INFO  pChip_info = (PCHIP_INFO)ent->driver_data;
     PSDevice    pDevice;
-#if LINUX_VERSION_CODE >= KERNEL_VERSION(2,6,0)    
     int         rc;
-#endif    
-//#if LINUX_VERSION_CODE >= KERNEL_VERSION(2,6,23)
- //  BYTE            fake_mac[U_ETHER_ADDR_LEN] = {0x00, 0x00, 0x00, 0x00, 0x00, 0x01};//fake MAC address
-//#endif
     if (device_nics ++>= MAX_UINTS) {
         printk(KERN_NOTICE DEVICE_NAME ": already found %d NICs\n", device_nics);
         return -ENODEV;
     }
     
 
-#if LINUX_VERSION_CODE >= KERNEL_VERSION(2,6,0)
     dev = alloc_etherdev(sizeof(DEVICE_INFO));
-#else
-    dev = init_etherdev(dev, 0);
-#endif    
 
     pDevice = (PSDevice) netdev_priv(dev);
     
@@ -1009,11 +993,9 @@ device_found1(struct pci_dev *pcid, const struct pci_device_id *ent)
         return -ENODEV;
     }
     
-#if LINUX_VERSION_CODE >= KERNEL_VERSION(2,6,0)
     // Chain it all together 
    // SET_MODULE_OWNER(dev);
     SET_NETDEV_DEV(dev, &pcid->dev);
-#endif        
     
     if (bFirst) {
         printk(KERN_NOTICE "%s Ver. %s\n",DEVICE_FULL_DRV_NAM, DEVICE_VERSION);
@@ -1106,21 +1088,12 @@ device_found1(struct pci_dev *pcid, const struct pci_device_id *ent)
 
 
 
-#if LINUX_VERSION_CODE >= KERNEL_VERSION(2,6,0)
     rc = pci_request_regions(pcid, DEVICE_NAME);
     if (rc) {
         printk(KERN_ERR DEVICE_NAME ": Failed to find PCI device\n");
         device_free_info(pDevice);
         return -ENODEV;        
     }
-#else
-    if (check_region(pDevice->ioaddr, pDevice->io_size)) {
-        printk(KERN_ERR DEVICE_NAME ": Failed to find PCI device\n");
-        device_free_info(pDevice);
-        return -ENODEV;                
-    }
-    request_region(pDevice->ioaddr, pDevice->io_size, DEVICE_NAME);    
-#endif
     
     dev->base_addr = pDevice->ioaddr;
 #ifdef	PLICE_DEBUG
@@ -1177,10 +1150,6 @@ device_found1(struct pci_dev *pcid, const struct pci_device_id *ent)
 #endif /* WIRELESS_EXT > 12 */
 #endif /* WIRELESS_EXT */        
 
- //  #if LINUX_VERSION_CODE >= KERNEL_VERSION(2,6,23)
-  //  memcpy(pDevice->dev->dev_addr, fake_mac, U_ETHER_ADDR_LEN); //use fake mac address
- //  #endif
-#if LINUX_VERSION_CODE >= KERNEL_VERSION(2,6,0)
     rc = register_netdev(dev);
     if (rc)
     {
@@ -1188,7 +1157,6 @@ device_found1(struct pci_dev *pcid, const struct pci_device_id *ent)
         device_free_info(pDevice);
         return -ENODEV;          
     }
-#endif    
 //2008-07-21-01<Add>by MikeLiu
 //register wpadev
    if(wpa_set_wpadev(pDevice, 1)!=0) {
@@ -1355,17 +1323,10 @@ device_release_WPADEV(pDevice);
     if (pDevice->PortOffset)
         iounmap((PVOID)pDevice->PortOffset);
 
-#if LINUX_VERSION_CODE >= KERNEL_VERSION(2,6,0)
     if (pDevice->pcid)   
         pci_release_regions(pDevice->pcid);
     if (dev)                
         free_netdev(dev);
-#else
-    if (pDevice->ioaddr)
-        release_region(pDevice->ioaddr,pDevice->io_size);
-    if (dev)        
-        kfree(dev);
-#endif
 
     if (pDevice->pcid) {
         pci_set_drvdata(pDevice->pcid,NULL);
@@ -1880,11 +1841,7 @@ static int device_tx_srv(PSDevice pDevice, UINT uIdx) {
 #else
                     skb = pTD->pTDInfo->skb;
 	                skb->dev = pDevice->apdev;
-#if LINUX_VERSION_CODE >= KERNEL_VERSION(2,6,22)
-			skb->mac_header = skb->data;
-#else
-			skb->mac.raw = skb->data;
-#endif
+			        skb->mac_header = skb->data;
 	                skb->pkt_type = PACKET_OTHERHOST;
     	            //skb->protocol = htons(ETH_P_802_2);
 	                memset(skb->cb, 0, sizeof(skb->cb));
@@ -2064,11 +2021,7 @@ static int  device_open(struct net_device *dev) {
     }
 //2008-5-13 <add> by chester
 #ifndef PRIVATE_OBJ
-#if LINUX_VERSION_CODE > KERNEL_VERSION(2,6,16)
     i=request_irq(pDevice->pcid->irq, &device_intr, IRQF_SHARED, dev->name, dev);
-#else
-    i=request_irq(pDevice->pcid->irq, &device_intr, (unsigned long)SA_SHIRQ, dev->name, dev);
-#endif
     if (i)
         return i;
 #endif
@@ -2188,12 +2141,6 @@ DEVICE_PRT(MSG_LEVEL_DEBUG, KERN_INFO "call MACvIntEnable\n");
     } 
     pDevice->flags |=DEVICE_FLAGS_OPENED;       
     
-#ifndef PRIVATE_OBJ    
-#if LINUX_VERSION_CODE < KERNEL_VERSION(2,6,0)
-    MOD_INC_USE_COUNT;
-#endif    
-#endif
-
     DEVICE_PRT(MSG_LEVEL_DEBUG, KERN_INFO "device_open success.. \n");
     return 0;
 }
@@ -2258,11 +2205,6 @@ device_release_WPADEV(pDevice);
 //PLICE_DEBUG->
 	//tasklet_kill(&pDevice->RxMngWorkItem);
 //PLICE_DEBUG<-
-#ifndef PRIVATE_OBJ    
-#if LINUX_VERSION_CODE < KERNEL_VERSION(2,6,0)
-    MOD_DEC_USE_COUNT;
-#endif
-#endif    
     DEVICE_PRT(MSG_LEVEL_DEBUG, KERN_INFO "device_close.. \n");
     return 0;
 }
@@ -3948,12 +3890,10 @@ static struct pci_driver device_driver = {
         id_table:   device_id_table,
         probe:      device_found1,
         remove:     device_remove1,
-#if LINUX_VERSION_CODE >= KERNEL_VERSION(2,4,9)
 #ifdef CONFIG_PM
         suspend:    viawget_suspend,
         resume:     viawget_resume,
 #endif
-#endif
 }; 
 
 static int __init device_init_module(void)
@@ -3963,17 +3903,11 @@ static int __init device_init_module(void)
 
 //    ret=pci_module_init(&device_driver);
 	//ret = pcie_port_service_register(&device_driver);
-#if LINUX_VERSION_CODE >= KERNEL_VERSION(2,6,22)
 	ret = pci_register_driver(&device_driver);
-#else
-	ret = pci_module_init(&device_driver);
-#endif
-#if LINUX_VERSION_CODE >= KERNEL_VERSION(2,4,9)
 #ifdef CONFIG_PM    
     if(ret >= 0)
         register_reboot_notifier(&device_notifier);
 #endif  
-#endif
 
     return ret;
 }
@@ -3982,11 +3916,9 @@ static void __exit device_cleanup_module(void)
 {
 
 	    
-#if LINUX_VERSION_CODE >= KERNEL_VERSION(2,4,9)
 #ifdef CONFIG_PM    
     unregister_reboot_notifier(&device_notifier);
 #endif  
-#endif
     pci_unregister_driver(&device_driver);
     
 }
@@ -3995,7 +3927,6 @@ module_init(device_init_module);
 module_exit(device_cleanup_module);
 
 
-#if LINUX_VERSION_CODE >= KERNEL_VERSION(2,4,9)
 #ifdef CONFIG_PM
 static int
 device_notify_reboot(struct notifier_block *nb, unsigned long event, void *p)
@@ -4005,11 +3936,7 @@ device_notify_reboot(struct notifier_block *nb, unsigned long event, void *p)
     case SYS_DOWN:
     case SYS_HALT:
     case SYS_POWER_OFF:
-#if LINUX_VERSION_CODE >= KERNEL_VERSION(2,6,0)
         while ((pdev = pci_get_device(PCI_ANY_ID, PCI_ANY_ID, pdev)) != NULL) {
-#else
-        pci_for_each_dev(pdev) {
-#endif    
             if(pci_dev_driver(pdev) == &device_driver) {
                 if (pci_get_drvdata(pdev))
                     viawget_suspend(pdev, 3);
@@ -4029,11 +3956,7 @@ viawget_suspend(struct pci_dev *pcid, u32 state)
     
     netif_stop_queue(pDevice->dev);   
     spin_lock_irq(&pDevice->lock);
-#if LINUX_VERSION_CODE >= KERNEL_VERSION(2,6,10)    
     pci_save_state(pcid);
-#else
-    pci_save_state(pcid, pDevice->pci_state);    
-#endif    
     del_timer(&pDevice->sTimerCommand);    
     del_timer(&pMgmt->sTimerSecondCallback);
     pDevice->cbFreeCmdQueue = CMD_Q_SIZE;
@@ -4061,11 +3984,7 @@ viawget_resume(struct pci_dev *pcid)
     
     power_status = pci_set_power_state(pcid, 0);
     power_status = pci_enable_wake(pcid, 0, 0);
-#if LINUX_VERSION_CODE >= KERNEL_VERSION(2,6,10)        
     pci_restore_state(pcid);  
-#else    
-    pci_restore_state(pcid, pDevice->pci_state);      
-#endif    
     if (netif_running(pDevice->dev)) {
         spin_lock_irq(&pDevice->lock);
         MACvRestoreContext(pDevice->PortOffset, pDevice->abyMacContext);
@@ -4094,7 +4013,6 @@ viawget_resume(struct pci_dev *pcid)
 }
 
 #endif
-#endif
 
 #endif //#ifndef PRIVATE_OBJ
 
diff --git a/drivers/staging/vt6655/dpc.c b/drivers/staging/vt6655/dpc.c
index f8424bd..75496a7 100644
--- a/drivers/staging/vt6655/dpc.c
+++ b/drivers/staging/vt6655/dpc.c
@@ -709,11 +709,7 @@ device_receive_frame (
                 ref_skb_add_offset(skb->skb, 4);
                 ref_skb_set_dev(pDevice->apdev, skb->skb);
                 skb_put(skb->skb, FrameSize);
-#if	LINUX_VERSION_CODE	> KERNEL_VERSION(2,6,21)
 	            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));
@@ -722,11 +718,7 @@ device_receive_frame (
 	            skb->data += 4;
 	            skb->tail += 4;
                      skb_put(skb, FrameSize);
-#if	LINUX_VERSION_CODE > KERNEL_VERSION (2,6,21)
 	            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));
@@ -858,11 +850,7 @@ device_receive_frame (
             ref_skb_add_offset(skb->skb, (cbIVOffset + 4));
             ref_skb_set_dev(pDevice->apdev, skb->skb);
             skb_put(skb->skb, FrameSize);
-#if	LINUX_VERSION_CODE	> KERNEL_VERSION(2,6,21)
 			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));
@@ -871,11 +859,7 @@ device_receive_frame (
             skb->data +=  (cbIVOffset + 4);
             skb->tail +=  (cbIVOffset + 4);
             skb_put(skb, FrameSize);
-#if	LINUX_VERSION_CODE	> KERNEL_VERSION(2,6,21)
            skb->mac_header = skb->data;
-#else
-	skb->mac.raw = skb->data;
-#endif
 
 	skb->pkt_type = PACKET_OTHERHOST;
             skb->protocol = htons(ETH_P_802_2);
@@ -998,12 +982,8 @@ device_receive_frame (
                      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,21)
-		pDevice->skb->mac_header = pDevice->skb->data;
-#else
-		pDevice->skb->mac.raw=pDevice->skb->data;
-#endif
-			pDevice->skb->pkt_type = PACKET_HOST;
+                     pDevice->skb->mac_header = pDevice->skb->data;
+                     pDevice->skb->pkt_type = PACKET_HOST;
                      pDevice->skb->protocol = htons(ETH_P_802_2);
                      memset(pDevice->skb->cb, 0, sizeof(pDevice->skb->cb));
                      netif_rx(pDevice->skb);
diff --git a/drivers/staging/vt6655/iwctl.c b/drivers/staging/vt6655/iwctl.c
index d8d72c6..c538fa5 100644
--- a/drivers/staging/vt6655/iwctl.c
+++ b/drivers/staging/vt6655/iwctl.c
@@ -307,22 +307,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
+            current_ev = iwe_stream_add_event(info,current_ev,end_buf, &iwe, IW_EV_ADDR_LEN);
                  //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
+            current_ev = iwe_stream_add_point(info,current_ev,end_buf, &iwe, pItemSSID->abySSID);
 		//ADD mode	
 		    memset(&iwe, 0, sizeof(iwe));
 		    iwe.cmd = SIOCGIWMODE;
@@ -333,11 +325,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
+            current_ev = iwe_stream_add_event(info,current_ev, end_buf, &iwe,  IW_EV_UINT_LEN);
            //ADD frequency 
             pSuppRates = (PWLAN_IE_SUPP_RATES)pBSS->abySuppRates;
             pExtSuppRates = (PWLAN_IE_SUPP_RATES)pBSS->abyExtSuppRates;
@@ -346,11 +334,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
+            current_ev = iwe_stream_add_event(info,current_ev,end_buf, &iwe, IW_EV_FREQ_LEN);
 
 
             //2008-0409-04, <Add> by Einsn Liu
@@ -360,11 +344,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
+            current_ev = iwe_stream_add_event(info,current_ev,end_buf, &iwe, IW_EV_FREQ_LEN);
        		//ADD quality
             memset(&iwe, 0, sizeof(iwe));       		
 	        iwe.cmd = IWEVQUAL;
@@ -382,11 +362,7 @@ int iwctl_giwscan(struct net_device *dev,
 			iwe.u.qual.updated=7;
 			
 	      //  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
+            current_ev = iwe_stream_add_event(info,current_ev, end_buf, &iwe, IW_EV_QUAL_LEN);
        		
             memset(&iwe, 0, sizeof(iwe));
             iwe.cmd = SIOCGIWENCODE;
@@ -396,11 +372,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;
@@ -412,22 +384,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
+                current_val = iwe_stream_add_value(info,current_ev, current_val, end_buf, &iwe, IW_EV_PARAM_LEN);
 			}
        		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	
+                current_val = iwe_stream_add_value(info,current_ev, current_val, end_buf, &iwe, IW_EV_PARAM_LEN);
 	        }
 	        	        
 	        if((current_val - current_ev) > IW_EV_LCP_LEN)
@@ -438,33 +402,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
+            current_ev = iwe_stream_add_point(info,current_ev, end_buf, &iwe, buf);
             
 #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 
@@ -477,11 +429,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
+                current_ev = iwe_stream_add_point(info,current_ev, end_buf, &iwe, buf);
 		    }    
                                 
                                 
@@ -494,11 +442,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
+                current_ev = iwe_stream_add_point(info,current_ev, end_buf, &iwe, buf);
 		    }
 #endif		    
 #endif		        
diff --git a/drivers/staging/vt6655/kcompat.h b/drivers/staging/vt6655/kcompat.h
index a35959c..5923e14 100644
--- a/drivers/staging/vt6655/kcompat.h
+++ b/drivers/staging/vt6655/kcompat.h
@@ -74,229 +74,11 @@ typedef void irqreturn_t;
 
 #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) 
-{
-	1112	
-	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
 
diff --git a/drivers/staging/vt6655/wmgr.c b/drivers/staging/vt6655/wmgr.c
index 3b253b0..29fd0f2 100644
--- a/drivers/staging/vt6655/wmgr.c
+++ b/drivers/staging/vt6655/wmgr.c
@@ -1125,11 +1125,7 @@ s_vMgrRxAssocResponse(
                        );                
                 skb_put(pDevice->skb, sizeof(viawget_wpa_header) + wpahdr->resp_ie_len + wpahdr->req_ie_len);
                 pDevice->skb->dev = pDevice->wpadev;
-#if	LINUX_VERSION_CODE	> KERNEL_VERSION(2,6,21)
-		pDevice->skb->mac_header = pDevice->skb->data;
-#else
-		pDevice->skb->mac.raw = pDevice->skb->data;
-#endif
+                pDevice->skb->mac_header = pDevice->skb->data;
                 pDevice->skb->pkt_type = PACKET_HOST;
                 pDevice->skb->protocol = htons(ETH_P_802_2);
                 memset(pDevice->skb->cb, 0, sizeof(pDevice->skb->cb));
@@ -1765,11 +1761,7 @@ s_vMgrRxDisassociation(
              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,21)
 	         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);
@@ -1857,11 +1849,7 @@ s_vMgrRxDeauthentication(
                  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,21)
-	        pDevice->skb->mac_header = pDevice->skb->data;
-#else
-		pDevice->skb->mac.raw = pDevice->skb->data;
-#endif
+                 pDevice->skb->mac_header = pDevice->skb->data;
                  pDevice->skb->pkt_type = PACKET_HOST;
                  pDevice->skb->protocol = htons(ETH_P_802_2);
                  memset(pDevice->skb->cb, 0, sizeof(pDevice->skb->cb));
-- 
1.5.4.3


-- 
Forest Bond
http://www.alittletooquiet.net
http://www.pytagsfs.org

[-- Attachment #2: Digital signature --]
[-- Type: application/pgp-signature, Size: 189 bytes --]

  parent reply	other threads:[~2009-04-25 14:33 UTC|newest]

Thread overview: 38+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2009-04-14 10:52 [PATCH] Add vt6656 driver to drivers/staging Forest Bond
2009-04-14 11:07 ` Johannes Berg
2009-04-14 11:39   ` Forest Bond
2009-04-14 11:48     ` Johannes Berg
2009-04-14 12:28       ` Marcel Holtmann
2009-04-14 12:43         ` Johannes Berg
2009-04-14 13:02           ` John W. Linville
2009-04-14 14:19             ` Forest Bond
2009-04-15  1:10               ` Greg KH
2009-04-15  1:51                 ` Forest Bond
2009-04-19 17:09                   ` Forest Bond
2009-04-19 19:52                     ` Larry Finger
2009-04-19 20:01                       ` Forest Bond
2009-04-19 22:32                         ` Greg KH
2009-04-24 11:03                           ` Forest Bond
2009-04-24 14:44                             ` Larry Finger
2009-04-24 14:54                               ` Forest Bond
2009-04-24 22:58                             ` Greg KH
2009-04-25  0:08                               ` Forest Bond
2009-04-25  0:14                                 ` Greg KH
2009-04-25 14:31                                   ` [PATCH 2/8] Add includes to drivers/staging/vt6655 Forest Bond
2009-04-25 14:31                                   ` [PATCH 3/8] Integrate drivers/staging/vt6655 into build system Forest Bond
2009-04-25 14:32                                   ` [PATCH 4/8] Add necessary EXTRA_CFLAGS to drivers/staging/vt6655/Makefile Forest Bond
2009-04-25 14:32                                   ` [PATCH 5/8] Build vt6655.ko, not viawget.ko Forest Bond
2009-04-25 14:32                                   ` [PATCH 6/8] drivers/staging/vt6655/device_main.c: Drop obsolete fsuid/fsgid accesses Forest Bond
2009-04-25 14:32                                   ` [PATCH 7/8] vt6655: Replace net_device->priv accesses with netdev_priv calls Forest Bond
2009-05-01  0:03                                     ` Forest Bond
2009-04-25 14:32                                   ` Forest Bond [this message]
2009-04-15 15:43                 ` [PATCH] Add vt6656 driver to drivers/staging Dan Williams
2009-04-16  2:51                   ` Greg KH
2009-04-15 13:19               ` John W. Linville
2009-04-14 14:52             ` Forest Bond
     [not found]             ` <18916.37868.64939.574249@gargle.gargle.HOWL>
2009-04-14 15:26               ` John W. Linville
2009-06-01 16:35 ` Gábor Stefanik
2009-06-01 16:52   ` Forest Bond
2009-06-08 17:08     ` Olivier Blin
2009-06-08 17:45       ` Forest Bond
2009-06-08 18:01         ` Olivier Blin

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20090425143246.GH11201@storm.local.network \
    --to=forest@alittletooquiet.net \
    --cc=Larry.Finger@lwfinger.net \
    --cc=dcbw@redhat.com \
    --cc=greg@kroah.com \
    --cc=johannes@sipsolutions.net \
    --cc=linux-wireless@vger.kernel.org \
    --cc=linville@tuxdriver.com \
    --cc=marcel@holtmann.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.