diff -Naur VT6655-Linux-117-src-CPUPlatform-SAE.orig/VT6655-Linux-117-src-CPUPlatform-SAE/viawget/driver/device.h VT6655-Linux-117-src-CPUPlatform-SAE.hardy/VT6655-Linux-117-src-CPUPlatform-SAE/viawget/driver/device.h
--- VT6655-Linux-117-src-CPUPlatform-SAE.orig/VT6655-Linux-117-src-CPUPlatform-SAE/viawget/driver/device.h	2006-08-30 17:03:10.000000000 -0500
+++ VT6655-Linux-117-src-CPUPlatform-SAE.hardy/VT6655-Linux-117-src-CPUPlatform-SAE/viawget/driver/device.h	2008-05-08 11:17:25.000000000 -0500
@@ -56,7 +56,6 @@
 #include <linux/sched.h>
 #include <asm/io.h>
 #include <linux/if.h>
-#include <linux/config.h>
 #include <asm/uaccess.h>
 #include <linux/proc_fs.h>
 #include <linux/inetdevice.h>
diff -Naur VT6655-Linux-117-src-CPUPlatform-SAE.orig/VT6655-Linux-117-src-CPUPlatform-SAE/viawget/driver/device_main.c VT6655-Linux-117-src-CPUPlatform-SAE.hardy/VT6655-Linux-117-src-CPUPlatform-SAE/viawget/driver/device_main.c
--- VT6655-Linux-117-src-CPUPlatform-SAE.orig/VT6655-Linux-117-src-CPUPlatform-SAE/viawget/driver/device_main.c	2006-10-16 19:56:52.000000000 -0500
+++ VT6655-Linux-117-src-CPUPlatform-SAE.hardy/VT6655-Linux-117-src-CPUPlatform-SAE/viawget/driver/device_main.c	2008-05-08 12:14:44.000000000 -0500
@@ -126,6 +126,8 @@
 #include "rf.h"
 #endif
 
+#include "skbcompat.h"
+
 // #ifdef PRIVATE_OBJ
 //#if !defined(__DEVICE_EXP_H)
 //#include "device_exp.h"
@@ -150,10 +152,17 @@
 MODULE_DESCRIPTION("VIA Networking Solomon-A/B/G Wireless LAN Adapter Driver"); 
 #endif
 
+#if LINUX_VERSION_CODE >= KERNEL_VERSION(2,6,22)
+  #define DEVICE_PARAM(N,D) \
+        static int N[MAX_UINTS]=OPTION_DEFAULT;\
+	module_param_array(N, int, NULL, 0);\
+        MODULE_PARM_DESC(N,D);
+#else
 #define DEVICE_PARAM(N,D) \
         static const int N[MAX_UINTS]=OPTION_DEFAULT;\
         MODULE_PARM(N, "1-" __MODULE_STRING(MAX_UINTS) "i");\
         MODULE_PARM_DESC(N, D);
+#endif
 
 #define RX_DESC_MIN0     16
 #define RX_DESC_MAX0     128
@@ -892,9 +901,11 @@
         return -ENODEV;
     }
     
+#if LINUX_VERSION_CODE < KERNEL_VERSION(2,6,24)
+    SET_MODULE_OWNER(dev);
+#endif        
 #if LINUX_VERSION_CODE >= KERNEL_VERSION(2,6,0)
     // Chain it all together 
-    SET_MODULE_OWNER(dev);
     SET_NETDEV_DEV(dev, &pcid->dev);
 #endif        
     
@@ -982,7 +993,9 @@
     dev->do_ioctl           = device_ioctl;
     
 #ifdef WIRELESS_EXT
+#if WIRELESS_EXT < 13
 	dev->get_wireless_stats = iwctl_get_wireless_stats;
+#endif
 #if WIRELESS_EXT > 12
 	dev->wireless_handlers = (struct iw_handler_def *)&iwctl_handler_def;
 //	netdev->wireless_handlers = NULL;	
@@ -1636,7 +1649,7 @@
 #else
                     skb = pTD->pTDInfo->skb;
 	                skb->dev = pDevice->apdev;
-	                skb->mac.raw = skb->data;
+			skb_reset_mac_header(skb);
 	                skb->pkt_type = PACKET_OTHERHOST;
     	            //skb->protocol = htons(ETH_P_802_2);
 	                memset(skb->cb, 0, sizeof(skb->cb));
@@ -1756,7 +1769,7 @@
     }
 
 #ifndef PRIVATE_OBJ
-    i=request_irq(pDevice->pcid->irq, &device_intr, SA_SHIRQ, dev->name, dev);
+    i=request_irq(pDevice->pcid->irq, &device_intr, IRQF_SHARED, dev->name, dev);
     if (i)
         return i;
 #endif
@@ -3372,7 +3385,11 @@
     int ret;
     
 
+#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    
diff -Naur VT6655-Linux-117-src-CPUPlatform-SAE.orig/VT6655-Linux-117-src-CPUPlatform-SAE/viawget/driver/dpc.c VT6655-Linux-117-src-CPUPlatform-SAE.hardy/VT6655-Linux-117-src-CPUPlatform-SAE/viawget/driver/dpc.c
--- VT6655-Linux-117-src-CPUPlatform-SAE.orig/VT6655-Linux-117-src-CPUPlatform-SAE/viawget/driver/dpc.c	2006-03-15 19:44:52.000000000 -0600
+++ VT6655-Linux-117-src-CPUPlatform-SAE.hardy/VT6655-Linux-117-src-CPUPlatform-SAE/viawget/driver/dpc.c	2008-05-08 11:17:25.000000000 -0500
@@ -93,6 +93,8 @@
 #include "aes_ccmp.h"
 #endif
 
+#include "skbcompat.h"
+
 /*---------------------  Static Definitions -------------------------*/
 
 /*---------------------  Static Classes  ----------------------------*/
@@ -644,7 +646,7 @@
                 ref_skb_add_offset(skb->skb, 4);
                 ref_skb_set_dev(pDevice->apdev, skb->skb);
                 skb_put(skb->skb, FrameSize);
-	            skb->mac.raw = skb->data;
+		skb_reset_mac_header(skb);
 	            *(skb->pkt_type) = PACKET_OTHERHOST;
     	        *(skb->protocol) = htons(ETH_P_802_2);
 	            memset(skb->cb, 0, sizeof(skb->cb));
@@ -653,7 +655,7 @@
 	            skb->data += 4;
 	            skb->tail += 4;
                 skb_put(skb, FrameSize);
-	            skb->mac.raw = skb->data;
+		skb_reset_mac_header(skb);
 	            skb->pkt_type = PACKET_OTHERHOST;
     	        skb->protocol = htons(ETH_P_802_2);
 	            memset(skb->cb, 0, sizeof(skb->cb));
@@ -763,7 +765,7 @@
             ref_skb_add_offset(skb->skb, (cbIVOffset + 4));
             ref_skb_set_dev(pDevice->apdev, skb->skb);
             skb_put(skb->skb, FrameSize);
-            skb->mac.raw = skb->data;
+		skb_reset_mac_header(skb);
             *(skb->pkt_type) = PACKET_OTHERHOST;
 	        *(skb->protocol) = htons(ETH_P_802_2);
             memset(skb->cb, 0, sizeof(skb->cb));
@@ -772,7 +774,7 @@
             skb->data +=  (cbIVOffset + 4);
             skb->tail +=  (cbIVOffset + 4);
             skb_put(skb, FrameSize);
-            skb->mac.raw = skb->data;
+		skb_reset_mac_header(skb);
             skb->pkt_type = PACKET_OTHERHOST;
             skb->protocol = htons(ETH_P_802_2);
             memset(skb->cb, 0, sizeof(skb->cb));
@@ -871,7 +873,7 @@
                      wpahdr->req_ie_len = 0;
                      skb_put(pDevice->skb, sizeof(viawget_wpa_header));
                      pDevice->skb->dev = pDevice->wpadev;
-                     pDevice->skb->mac.raw = pDevice->skb->data;
+                     skb_reset_mac_header(pDevice->skb);
                      pDevice->skb->pkt_type = PACKET_HOST;
                      pDevice->skb->protocol = htons(ETH_P_802_2);
                      memset(pDevice->skb->cb, 0, sizeof(pDevice->skb->cb));
diff -Naur VT6655-Linux-117-src-CPUPlatform-SAE.orig/VT6655-Linux-117-src-CPUPlatform-SAE/viawget/driver/iwctl.c VT6655-Linux-117-src-CPUPlatform-SAE.hardy/VT6655-Linux-117-src-CPUPlatform-SAE/viawget/driver/iwctl.c
--- VT6655-Linux-117-src-CPUPlatform-SAE.orig/VT6655-Linux-117-src-CPUPlatform-SAE/viawget/driver/iwctl.c	2006-08-02 11:49:50.000000000 -0500
+++ VT6655-Linux-117-src-CPUPlatform-SAE.hardy/VT6655-Linux-117-src-CPUPlatform-SAE/viawget/driver/iwctl.c	2008-05-08 11:17:25.000000000 -0500
@@ -766,7 +766,7 @@
         pItemSSID->byElementID = WLAN_EID_SSID;
 		memcpy(pItemSSID->abySSID, extra, wrq->length);
 	    DEVICE_PRT(MSG_LEVEL_DEBUG, KERN_INFO "set essid = %s \n", pItemSSID->abySSID);
-		pItemSSID->len = wrq->length - 1;
+		pItemSSID->len = wrq->length;
 	}
     if (pDevice->flags & DEVICE_FLAGS_OPENED) {
 	    pDevice->bCommit = TRUE;
diff -Naur VT6655-Linux-117-src-CPUPlatform-SAE.orig/VT6655-Linux-117-src-CPUPlatform-SAE/viawget/driver/Makefile VT6655-Linux-117-src-CPUPlatform-SAE.hardy/VT6655-Linux-117-src-CPUPlatform-SAE/viawget/driver/Makefile
--- VT6655-Linux-117-src-CPUPlatform-SAE.orig/VT6655-Linux-117-src-CPUPlatform-SAE/viawget/driver/Makefile	2006-08-03 14:28:36.000000000 -0500
+++ VT6655-Linux-117-src-CPUPlatform-SAE.hardy/VT6655-Linux-117-src-CPUPlatform-SAE/viawget/driver/Makefile	2008-05-08 11:56:20.000000000 -0500
@@ -62,20 +62,20 @@
       vntwifi.c IEEE11h.c
 
 ifeq ($(IO_MAP), 1)
-  CFLAGS += -DIO_MAP
+  EXTRA_CFLAGS += -DIO_MAP
 endif            
 
 ifeq ($(HOSTAP), 1)
-  CFLAGS += -DHOSTAP
+  EXTRA_CFLAGS += -DHOSTAP
 endif
 
 ifeq ($(PRIV_OBJ), 1)
-  CFLAGS += -DPRIVATE_OBJ
+  EXTRA_CFLAGS += -DPRIVATE_OBJ
 endif	
 
-CFLAGS += -I$(PWD) -I$(PWD)/../include -I$(PWD)/../solomon      	
+EXTRA_CFLAGS += -I$(PWD) -I$(PWD)/../include -I$(PWD)/../solomon      	
 
-CFLAGS +=  -I$(PWD)/include -I$(PWD)/solomon      	
+EXTRA_CFLAGS +=  -I$(PWD)/include -I$(PWD)/solomon      	
 
 # build rule
 ifeq ($(KVER), 2.6)
@@ -96,7 +96,7 @@
 	vntwifi.o IEEE11h.o
 
 .c.o:
-	$(CC) $(CFLAGS) -o $@ $<
+	$(CC) $(CFLAGS) $(EXTRA_CFLAGS) -o $@ $<
 
 default:
 	make -C $(KSRC) SUBDIRS=$(shell pwd) modules
@@ -132,16 +132,16 @@
 CC := $(foreach cc, $(CC), $(test_cc))
 CC := $(firstword $(CC))
 
-CFLAGS += -Wall -DLINUX -D__KERNEL__ -DMODULE  -DEXPORT_SYMTAB -D__NO_VERSION__ -O2 -pipe
-CFLAGS += -I$(KSRC)/include -Wstrict-prototypes -fomit-frame-pointer -fno-strict-aliasing
-CFLAGS += $(shell [ -f $(KSRC)/include/linux/modversions.h ] && \
+EXTRA_CFLAGS += -Wall -DLINUX -D__KERNEL__ -DMODULE  -DEXPORT_SYMTAB -D__NO_VERSION__ -O2 -pipe
+EXTRA_CFLAGS += -I$(KSRC)/include -Wstrict-prototypes -fomit-frame-pointer -fno-strict-aliasing
+EXTRA_CFLAGS += $(shell [ -f $(KSRC)/include/linux/modversions.h ] && \
             echo "-DMODVERSIONS -include $(KSRC)/include/linux/modversions.h")
             
 .SILENT: $(TARGET) clean            
             
 
 # look for SMP in config.h
-SMP := $(shell $(CC) $(CFLAGS) -E -dM $(CONFIG_FILE) | \
+SMP := $(shell $(CC) $(CFLAGS) $(EXTRA_CFLAGS) -E -dM $(CONFIG_FILE) | \
          grep CONFIG_SMP | awk '{ print $$3 }')
          
 ifneq ($(SMP),1)
@@ -150,12 +150,12 @@
 
 
 ifeq ($(SMP), 1)
-  CFLAGS += -D__SMP__
+  EXTRA_CFLAGS += -D__SMP__
 endif
 
 
 ifeq ($(PRIV_OBJ), 1)
-  CFLAGS += -DPRIVATE_OBJ
+  EXTRA_CFLAGS += -DPRIVATE_OBJ
   TARGET = x86g_up.o
   
 ifeq ($(SMP), 1)
@@ -168,7 +168,7 @@
 # check x86_64
 SUBARCH := $(shell uname -m)
 ifeq ($(SUBARCH),x86_64)
-    CFLAGS += -mcmodel=kernel -mno-red-zone
+    EXTRA_CFLAGS += -mcmodel=kernel -mno-red-zone
 endif
 
 
diff -Naur VT6655-Linux-117-src-CPUPlatform-SAE.orig/VT6655-Linux-117-src-CPUPlatform-SAE/viawget/driver/skbcompat.h VT6655-Linux-117-src-CPUPlatform-SAE.hardy/VT6655-Linux-117-src-CPUPlatform-SAE/viawget/driver/skbcompat.h
--- VT6655-Linux-117-src-CPUPlatform-SAE.orig/VT6655-Linux-117-src-CPUPlatform-SAE/viawget/driver/skbcompat.h	1969-12-31 18:00:00.000000000 -0600
+++ VT6655-Linux-117-src-CPUPlatform-SAE.hardy/VT6655-Linux-117-src-CPUPlatform-SAE/viawget/driver/skbcompat.h	2008-05-08 11:17:25.000000000 -0500
@@ -0,0 +1,11 @@
+#if !defined(__SKB_COMPAT__)
+#define __SKB_COMPAT__
+
+#if LINUX_VERSION_CODE < KERNEL_VERSION(2,6,22)
+#include <linux/skbuff.h>
+static inline void skb_reset_mac_header(struct sk_buff *skb) {
+	skb->mac.raw = skb->data;
+}
+#endif
+
+#endif
diff -Naur VT6655-Linux-117-src-CPUPlatform-SAE.orig/VT6655-Linux-117-src-CPUPlatform-SAE/viawget/driver/wmgr.c VT6655-Linux-117-src-CPUPlatform-SAE.hardy/VT6655-Linux-117-src-CPUPlatform-SAE/viawget/driver/wmgr.c
--- VT6655-Linux-117-src-CPUPlatform-SAE.orig/VT6655-Linux-117-src-CPUPlatform-SAE/viawget/driver/wmgr.c	2006-09-20 15:33:28.000000000 -0500
+++ VT6655-Linux-117-src-CPUPlatform-SAE.hardy/VT6655-Linux-117-src-CPUPlatform-SAE/viawget/driver/wmgr.c	2008-05-08 11:17:25.000000000 -0500
@@ -117,6 +117,9 @@
 #if !defined(__IOWPA_H__)
 #include "iowpa.h"
 #endif
+
+#include "skbcompat.h"
+
 /*---------------------  Static Definitions -------------------------*/
 
 
@@ -1090,7 +1093,7 @@
                        );                
                 skb_put(pDevice->skb, sizeof(viawget_wpa_header) + wpahdr->resp_ie_len + wpahdr->req_ie_len);
                 pDevice->skb->dev = pDevice->wpadev;
-                pDevice->skb->mac.raw = pDevice->skb->data;
+		skb_reset_mac_header(pDevice->skb);
                 pDevice->skb->pkt_type = PACKET_HOST;
                 pDevice->skb->protocol = htons(ETH_P_802_2);
                 memset(pDevice->skb->cb, 0, sizeof(pDevice->skb->cb));
@@ -1673,7 +1676,7 @@
              wpahdr->req_ie_len = 0;
              skb_put(pDevice->skb, sizeof(viawget_wpa_header));
              pDevice->skb->dev = pDevice->wpadev;
-             pDevice->skb->mac.raw = pDevice->skb->data;
+		skb_reset_mac_header(pDevice->skb);
              pDevice->skb->pkt_type = PACKET_HOST;
              pDevice->skb->protocol = htons(ETH_P_802_2);
              memset(pDevice->skb->cb, 0, sizeof(pDevice->skb->cb));
@@ -1749,7 +1752,7 @@
                  wpahdr->req_ie_len = 0;
                  skb_put(pDevice->skb, sizeof(viawget_wpa_header));
                  pDevice->skb->dev = pDevice->wpadev;
-                 pDevice->skb->mac.raw = pDevice->skb->data;
+		skb_reset_mac_header(pDevice->skb);
                  pDevice->skb->pkt_type = PACKET_HOST;
                  pDevice->skb->protocol = htons(ETH_P_802_2);
                  memset(pDevice->skb->cb, 0, sizeof(pDevice->skb->cb));
diff -Naur VT6655-Linux-117-src-CPUPlatform-SAE.orig/VT6655-Linux-117-src-CPUPlatform-SAE/viawget/driver/wpactl.c VT6655-Linux-117-src-CPUPlatform-SAE.hardy/VT6655-Linux-117-src-CPUPlatform-SAE/viawget/driver/wpactl.c
--- VT6655-Linux-117-src-CPUPlatform-SAE.orig/VT6655-Linux-117-src-CPUPlatform-SAE/viawget/driver/wpactl.c	2006-08-14 15:16:42.000000000 -0500
+++ VT6655-Linux-117-src-CPUPlatform-SAE.hardy/VT6655-Linux-117-src-CPUPlatform-SAE/viawget/driver/wpactl.c	2008-05-08 11:17:25.000000000 -0500
@@ -140,7 +140,11 @@
 	sprintf(pDevice->wpadev->name, "%swpa", dev->name);
 	
 #if (LINUX_VERSION_CODE >= KERNEL_VERSION(2,6,0))
+	#if (LINUX_VERSION_CODE >= KERNEL_VERSION(2,6,22))
+		SET_NETDEV_DEV(pDevice->wpadev, &dev->dev);
+	#else
 	SET_NETDEV_DEV(pDevice->wpadev, dev->class_dev.dev);
+	#endif
 	pDevice->wpadev->destructor = free_netdev;	
 #endif
 	ret = register_netdevice(pDevice->wpadev);
@@ -183,10 +187,16 @@
     }        
 
     if (pDevice->wpadev) {
+#if LINUX_VERSION_CODE >= KERNEL_VERSION(2,6,22)
+	unregister_netdevice(pDevice->wpadev);
+	DEVICE_PRT(MSG_LEVEL_DEBUG, KERN_INFO "%s: Netdevice %s unregistered\n",
+		pDevice->dev->name, pDevice->wpadev->name);
+#else
 		if (unregister_netdevice(pDevice->wpadev) == 0) {
             DEVICE_PRT(MSG_LEVEL_DEBUG, KERN_INFO "%s: Netdevice %s unregistered\n",
 	        pDevice->dev->name, pDevice->wpadev->name);
 	    }    
+#endif
 
 #if (LINUX_VERSION_CODE < KERNEL_VERSION(2,4,23))
         kfree(pDevice->wpadev);
diff -Naur VT6655-Linux-117-src-CPUPlatform-SAE.orig/VT6655-Linux-117-src-CPUPlatform-SAE/viawget/include/device_cfg.h VT6655-Linux-117-src-CPUPlatform-SAE.hardy/VT6655-Linux-117-src-CPUPlatform-SAE/viawget/include/device_cfg.h
--- VT6655-Linux-117-src-CPUPlatform-SAE.orig/VT6655-Linux-117-src-CPUPlatform-SAE/viawget/include/device_cfg.h	2006-07-31 10:51:58.000000000 -0500
+++ VT6655-Linux-117-src-CPUPlatform-SAE.hardy/VT6655-Linux-117-src-CPUPlatform-SAE/viawget/include/device_cfg.h	2008-05-08 11:17:25.000000000 -0500
@@ -23,7 +23,6 @@
 #ifndef __DEVICE_CONFIG_H
 #define __DEVICE_CONFIG_H
 
-#include <linux/config.h>
 #include <linux/types.h>
 
 #if !defined(__TTYPE_H__)

