diff -u 1.23/kcompat.h 1.23_2.6.22/kcompat.h
--- 1.23/kcompat.h	2005-08-23 21:37:06.000000000 -0400
+++ 1.23_2.6.22/kcompat.h	2007-08-27 15:54:38.973829550 -0400
@@ -165,7 +165,7 @@
     struct pci_dev *pcimap[PCI_MAX_NUM_NICS];
 };
 
-static inline int pci_module_init(struct pci_driver *drv)
+static inline int pci_register_driver(struct pci_driver *drv)
 {
     struct pci_dev *pdev;
     struct pci_device_id *pcid;
diff -u 1.23/Makefile 1.23_2.6.22/Makefile
--- 1.23/Makefile	2005-07-22 04:54:04.000000000 -0400
+++ 1.23_2.6.22/Makefile	2007-08-27 15:20:07.394806518 -0400
@@ -1,4 +1,9 @@
 DEBUG = 0
+PATCHKERNEL2618 = 0 
+ifeq ($(PATCHKERNEL2618), 1)
+  CFLAGS += -DPATCHKERNEL2618
+endif
+
 
 KSP :=  /lib/modules/$(shell uname -r)/build \
 	/usr/src/linux-$(shell uname -r) \
diff -u 1.23/velocity_cfg.h 1.23_2.6.22/velocity_cfg.h
--- 1.23/velocity_cfg.h	2005-08-23 21:50:44.000000000 -0400
+++ 1.23_2.6.22/velocity_cfg.h	2007-08-27 15:20:07.394806518 -0400
@@ -31,7 +31,10 @@
 #ifndef __VELOCITY_CFG_H__
 #define __VELOCITY_CFG_H__
 
+#include <linux/version.h>
+#if LINUX_VERSION_CODE < KERNEL_VERSION(2,6,18)
 #include <linux/config.h>
+#endif
 #include <linux/types.h>
 
 typedef
diff -u 1.23/velocity.h 1.23_2.6.22/velocity.h
--- 1.23/velocity.h	2005-07-22 04:54:04.000000000 -0400
+++ 1.23_2.6.22/velocity.h	2007-08-27 15:20:07.394806518 -0400
@@ -54,7 +54,10 @@
 #include <asm/io.h>
 
 #include <linux/if.h>
+#include <linux/version.h>
+#if LINUX_VERSION_CODE < KERNEL_VERSION(2,6,18)
 #include <linux/config.h>
+#endif
 #include <asm/uaccess.h>
 #include <linux/proc_fs.h>
 #include <linux/inetdevice.h>
diff -u 1.23/velocity_main.c 1.23_2.6.22/velocity_main.c
--- 1.23/velocity_main.c	2005-07-22 04:57:16.000000000 -0400
+++ 1.23_2.6.22/velocity_main.c	2007-08-27 15:55:08.974282141 -0400
@@ -51,10 +51,17 @@
 MODULE_LICENSE("GPL");
 MODULE_DESCRIPTION("VIA Networking Velocity Family Gigabit Ethernet Adapter Driver");
 
+#if LINUX_VERSION_CODE >= KERNEL_VERSION(2,6,16)
+#define VELOCITY_PARAM(N,D) \
+        static int N[MAX_UINTS]=OPTION_DEFAULT;\
+        module_param_array(N, int, NULL, 0);\
+        MODULE_PARM_DESC(N, D);
+#else
 #define VELOCITY_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_MIN     64
 #define RX_DESC_MAX     255
@@ -1352,7 +1359,15 @@
 
     if (skb->len < ETH_ZLEN) {
         // packet size is less than 60 bytes
+#if LINUX_VERSION_CODE < KERNEL_VERSION(2,6,18)
+#ifdef PATCHKERNEL2618
+        skb_linearize(skb);
+#else
         skb_linearize(skb, GFP_ATOMIC);
+#endif
+#else
+        skb_linearize(skb);
+#endif
         memcpy(pTDInfo->buf, skb->data, skb->len);
         VELOCITY_SET_TD_PACKET_SIZE(pTD, ETH_ZLEN);
 
@@ -1378,7 +1393,15 @@
             pTDInfo->skb = skb;
             if (nfrags > 6) {
                 // elements > 7 ==> copy to a buffer
-                skb_linearize(skb, GFP_ATOMIC);
+#if LINUX_VERSION_CODE < KERNEL_VERSION(2,6,18)
+#ifdef PATCHKERNEL2618 
+        skb_linearize(skb);
+#else
+        skb_linearize(skb, GFP_ATOMIC);
+#endif
+#else
+        skb_linearize(skb);
+#endif
                 memcpy(pTDInfo->buf, skb->data, skb->len);
                 VELOCITY_SET_TD_PACKET_SIZE(pTD, skb->len);
 
@@ -1446,10 +1469,15 @@
     }
 
 #ifdef VELOCITY_TX_CSUM_SUPPORT
+#if LINUX_VERSION_CODE < KERNEL_VERSION(2,6,19)
     if ( (pInfo->hw.flags & VELOCITY_FLAGS_TX_CSUM) &&
          (skb->ip_summed == CHECKSUM_HW) )
+#else
+if ( (pInfo->hw.flags & VELOCITY_FLAGS_TX_CSUM) &&
+         (skb->ip_summed == CHECKSUM_PARTIAL) )
+#endif
     {
-        struct iphdr* ip = skb->nh.iph;
+        struct iphdr* ip = ip_hdr(skb);
 
         if (ip->protocol == IPPROTO_TCP) {
             // request TCP checksum calculation
@@ -1657,7 +1685,7 @@
 static int __init velocity_init_module(void)
 {
     int ret;
-    ret=pci_module_init(&velocity_driver);
+    ret=pci_register_driver(&velocity_driver);
 
 #if LINUX_VERSION_CODE >= KERNEL_VERSION(2,4,9)
 #ifdef CONFIG_PM
@@ -1957,7 +1985,11 @@
 #endif
             if(pci_dev_driver(pcid) == &velocity_driver) {
                 if (pci_get_drvdata(pcid))
+#if LINUX_VERSION_CODE >= KERNEL_VERSION(2,6,15)
+                    velocity_suspend(pcid, PMSG_SUSPEND);
+#else
                     velocity_suspend(pcid, 3);
+#endif
             }
         }
     }
@@ -2001,7 +2033,11 @@
         velocity_save_pci_context(pInfo, &pInfo->pci_context);
         velocity_shutdown(&pInfo->hw);
         pci_disable_device(pcid);
+#if LINUX_VERSION_CODE >= KERNEL_VERSION(2,6,15)
+        power_status = pci_set_power_state(pcid, pci_choose_state(pcid,state));
+#else
         power_status = pci_set_power_state(pcid, state);
+#endif
     }
 #else
     pci_disable_device(pcid);

