Skip to contentSkip to conversation

Staging: otus: remove dependence on kernel version

PATCH New Alexander Beregalov 1 participant 1 message Dec 7, 2008 Staging

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 Staging: otus: remove dependence on kernel version

Dependence on kernel version is not needed anymore if we are in mainline now.

---

 drivers/staging/otus/ioctl.c    |   22 --------------
 drivers/staging/otus/usbdrv.c   |   61 ---------------------------------------
 drivers/staging/otus/usbdrv.h   |    9 +----
 drivers/staging/otus/wrap_pkt.c |    4 --
 drivers/staging/otus/wrap_usb.c |    4 --
 drivers/staging/otus/wwrap.c    |   57 ------------------------------------
 drivers/staging/otus/zdcompat.h |   54 ----------------------------------
 drivers/staging/otus/zdusb.c    |   56 -----------------------------------
 8 files changed, 2 insertions(+), 265 deletions(-)
drivers/staging/otus/ioctl.c +0 -22
index 3bc420a..69e51b6 100644
@@ -309,9 +309,7 @@ char *usbdrv_translate_scan(struct net_device *dev,
     iwe.u.ap_addr.sa_family = ARPHRD_ETHER;
     memcpy(iwe.u.ap_addr.sa_data, list->bssid, ETH_ALEN);
     current_ev = iwe_stream_add_event(
-#if (LINUX_VERSION_CODE >= KERNEL_VERSION(2,6,27))
 	info,
-#endif
 	current_ev,
 	end_buf, &iwe, IW_EV_ADDR_LEN);
 
@@ -332,9 +330,7 @@ char *usbdrv_translate_scan(struct net_device *dev,
     iwe.cmd = SIOCGIWESSID;
     iwe.u.data.flags = 1;
     current_ev = iwe_stream_add_point(
-#if (LINUX_VERSION_CODE >= KERNEL_VERSION(2,6,27))
 	info,
-#endif
 	current_ev, end_buf, &iwe, &list->ssid[2]);
 
     /* Ran out of buffer */
@@ -355,9 +351,7 @@ char *usbdrv_translate_scan(struct net_device *dev,
         else
             iwe.u.mode = IW_MODE_ADHOC;
         current_ev = iwe_stream_add_event(
-#if (LINUX_VERSION_CODE >= KERNEL_VERSION(2,6,27))
 		info,
-#endif
 		current_ev, end_buf, &iwe, IW_EV_UINT_LEN);
     }
 
@@ -389,9 +383,7 @@ char *usbdrv_translate_scan(struct net_device *dev,
     }
     iwe.u.freq.e = 6;
     current_ev = iwe_stream_add_event(
-#if (LINUX_VERSION_CODE >= KERNEL_VERSION(2,6,27))
 	info,
-#endif
     	current_ev, end_buf, &iwe, IW_EV_FREQ_LEN);
 
     /* Ran out of buffer */
@@ -412,9 +404,7 @@ char *usbdrv_translate_scan(struct net_device *dev,
     iwe.u.qual.noise = 0;
     iwe.u.qual.qual = list->signalQuality;
     current_ev = iwe_stream_add_event(
-#if (LINUX_VERSION_CODE >= KERNEL_VERSION(2,6,27))
 	info,
-#endif
 	current_ev, end_buf, &iwe, IW_EV_QUAL_LEN);
 
     /* Ran out of buffer */
@@ -435,9 +425,7 @@ char *usbdrv_translate_scan(struct net_device *dev,
 
     iwe.u.data.length = 0;
     current_ev = iwe_stream_add_point(
-#if (LINUX_VERSION_CODE >= KERNEL_VERSION(2,6,27))
 	info,
-#endif
 	current_ev, end_buf, &iwe, list->ssid);
 
     /* Ran out of buffer */
@@ -462,9 +450,7 @@ char *usbdrv_translate_scan(struct net_device *dev,
         iwe.u.bitrate.value = ((list->supportedRates[i+2] & 0x7f) * 500000);
 /* Add new value to event */
         current_val = iwe_stream_add_value(
-#if (LINUX_VERSION_CODE >= KERNEL_VERSION(2,6,27))
 		info,
-#endif
 		current_ev, current_val, end_buf, &iwe, IW_EV_PARAM_LEN);
 
         /* Ran out of buffer */
@@ -482,9 +468,7 @@ char *usbdrv_translate_scan(struct net_device *dev,
         iwe.u.bitrate.value = ((list->extSupportedRates[i+2] & 0x7f) * 500000);
 /* Add new value to event */
         current_val = iwe_stream_add_value(
-#if (LINUX_VERSION_CODE >= KERNEL_VERSION(2,6,27))
 		info,
-#endif
 		current_ev, current_val, end_buf, &iwe, IW_EV_PARAM_LEN);
 
         /* Ran out of buffer */
@@ -506,9 +490,7 @@ char *usbdrv_translate_scan(struct net_device *dev,
     snprintf(buf, sizeof(buf), "bcn_int=%d", (list->beaconInterval[1] << 8) + list->beaconInterval[0]);
     iwe.u.data.length = strlen(buf);
     current_ev = iwe_stream_add_point(
-#if (LINUX_VERSION_CODE >= KERNEL_VERSION(2,6,27))
 		info,
-#endif
 		current_ev, end_buf, &iwe, buf);
 
     /* Ran out of buffer */
@@ -537,9 +519,7 @@ char *usbdrv_translate_scan(struct net_device *dev,
 
         if (iwe.u.data.length != 0)
             current_ev = iwe_stream_add_point(
-#if (LINUX_VERSION_CODE >= KERNEL_VERSION(2,6,27))
 		info,
-#endif
 		current_ev, end_buf, &iwe, buf);
 
         /* Ran out of buffer */
@@ -563,9 +543,7 @@ char *usbdrv_translate_scan(struct net_device *dev,
                 rsn_leader, sizeof(rsn_leader)-1);
             if (iwe.u.data.length != 0)
                 current_ev = iwe_stream_add_point(
-#if (LINUX_VERSION_CODE >= KERNEL_VERSION(2,6,27))
 			info,
-#endif
 			current_ev, end_buf,  &iwe, buf);
 
             /* Ran out of buffer */
drivers/staging/otus/usbdrv.c +0 -61

166 lines not on this page · raw message

drivers/staging/otus/usbdrv.h +2 -7
index 6e41881..a11b3b3 100644
@@ -35,15 +35,10 @@
 #include <linux/netdevice.h>
 #include <linux/etherdevice.h>
 #include <linux/skbuff.h>
-#include <linux/version.h>
-#include <asm/uaccess.h>
+#include <linux/uaccess.h>
 #include <linux/wireless.h>
 #include <linux/if_arp.h>
-#include <asm/io.h>
-
-#if (LINUX_VERSION_CODE < KERNEL_VERSION(2,5,0))
-    #include <asm/div64.h>
-#endif
+#include <linux/io.h>
 
 #include "zdcompat.h"
 
drivers/staging/otus/wrap_pkt.c +0 -4
index f2dda4b..bd3481b 100644
@@ -65,11 +65,7 @@ void zfLnxRecv80211(zdev_t* dev, zbuf_t* buf, struct zsAdditionInfo* addInfo)
                 if(skb1 != NULL)
                 {
                     skb1->dev = dev;
-                #if (LINUX_VERSION_CODE < KERNEL_VERSION(2,6,22))
-	            skb1->mac.raw = skb1->data;
-                #else
                     skb1->mac_header = skb1->data;
-                #endif
 	            skb1->ip_summed = CHECKSUM_NONE;
 	            skb1->pkt_type = PACKET_OTHERHOST;
 	            skb1->protocol = __constant_htons(0x0019);  /* ETH_P_80211_RAW */
drivers/staging/otus/wrap_usb.c +0 -4
index 93c0ece..64d6d1c 100644
@@ -144,11 +144,7 @@ void zfwUsbCmd(zdev_t* dev, u8_t endpt, u32_t* cmd, u16_t cmdLen)
     if (ret != 0)
     {
         usb_free_urb(macp->RegOutUrb);
-#if LINUX_VERSION_CODE >= KERNEL_VERSION(2,5,0) /* tune me! */
         macp->RegOutUrb = usb_alloc_urb(0, GFP_ATOMIC);
-#else
-        macp->RegOutUrb = usb_alloc_urb(0);
-#endif
         ret = zfLnxUsbWriteReg(dev, cmd, cmdLen);
     }
 }
drivers/staging/otus/wwrap.c +0 -57

148 lines not on this page · raw message

drivers/staging/otus/zdcompat.h +0 -54

80 lines not on this page · raw message

drivers/staging/otus/zdusb.c +0 -56

142 lines not on this page · raw message