diff -dPNur rr64x-linux-src-v1.0/inc/linux/Makefile.def rr64x-linux-src-v1.0-ds/inc/linux/Makefile.def
--- rr64x-linux-src-v1.0/inc/linux/Makefile.def	2010-01-13 10:28:08.000000000 +0100
+++ rr64x-linux-src-v1.0-ds/inc/linux/Makefile.def	2012-02-16 22:47:48.336664397 +0100
@@ -74,19 +74,24 @@
 KERNELDIR := /lib/modules/$(shell uname -r)/build
 endif
 
-KERNEL_VER := 2.$(shell expr `grep LINUX_VERSION_CODE $(KERNELDIR)/include/linux/version.h | cut -d\  -f3` / 256 % 256)
+KERNEL_VER := $(shell uname -r | cut -f1 -d.)
+ifneq ($(KERNEL_VER), 3)
+KERNEL_VER := $(shell uname -r | cut -f1-2 -d.)
+endif
 
 ifeq ($(KERNEL_VER),)
 $(error Cannot find kernel version. Check $(KERNELDIR)/include/linux/version.h.)
 endif
 
+ifneq ($(KERNEL_VER), 3)
 ifneq ($(KERNEL_VER), 2.6)
 ifneq ($(KERNEL_VER), 2.4)
-$(error Only kernel 2.4/2.6 is supported but you use $(KERNEL_VER))
+$(error Only kernel 2.4/2.6/3 is supported but you use $(KERNEL_VER))
+endif
 endif
 endif
 
-ifeq ($(KERNEL_VER), 2.6)
+ifeq ($(KERNEL_VER), $(filter $(KERNEL_VER),3 2.6))
 
 TARGET := $(TARGETNAME).ko
 
diff -dPNur rr64x-linux-src-v1.0/osm/linux/install.sh rr64x-linux-src-v1.0-ds/osm/linux/install.sh
--- rr64x-linux-src-v1.0/osm/linux/install.sh	2010-01-13 10:28:10.000000000 +0100
+++ rr64x-linux-src-v1.0-ds/osm/linux/install.sh	2012-02-16 22:49:07.384978455 +0100
@@ -5,6 +5,8 @@
 
 PWD=`pwd`
 
+echo ${KERNEL_VER}
+
 case ${KERNEL_VER} in
 	2.4 )
 	OBJ=o
@@ -14,6 +16,10 @@
 	OBJ=ko
 	MODVER=`modinfo -F vermagic ${PWD}/${TARGETNAME}.${OBJ} | cut -d' ' -f1`
 	;;
+       3 )
+       OBJ=ko
+       MODVER=`modinfo -F vermagic ${PWD}/${TARGETNAME}.${OBJ} | cut -d' ' -f1`
+       ;;
 esac
 
 if test "${MODVER}" = "" ; then
diff -dPNur rr64x-linux-src-v1.0/osm/linux/os_linux.c rr64x-linux-src-v1.0-ds/osm/linux/os_linux.c
--- rr64x-linux-src-v1.0/osm/linux/os_linux.c	2010-01-13 10:28:09.000000000 +0100
+++ rr64x-linux-src-v1.0-ds/osm/linux/os_linux.c	2012-02-16 22:43:01.953846546 +0100
@@ -260,7 +260,7 @@
 					struct block_device *bdev = bdget(MKDEV(major[i], minor));
 					if (bdev &&
 #if LINUX_VERSION_CODE >= KERNEL_VERSION(2,6,28)
-						blkdev_get(bdev, FMODE_READ)
+						blkdev_get(bdev, FMODE_READ, NULL)
 #else 
 						blkdev_get(bdev, FMODE_READ, 0 __BDEV_RAW)
 #endif
diff -dPNur rr64x-linux-src-v1.0/osm/linux/osm_linux.c rr64x-linux-src-v1.0-ds/osm/linux/osm_linux.c
--- rr64x-linux-src-v1.0/osm/linux/osm_linux.c	2010-01-13 10:28:09.000000000 +0100
+++ rr64x-linux-src-v1.0-ds/osm/linux/osm_linux.c	2012-02-16 22:44:14.094256286 +0100
@@ -922,7 +922,7 @@
 	}
 }
 
-static int hpt_queuecommand (Scsi_Cmnd * SCpnt, void (*done) (Scsi_Cmnd *))
+static int hpt_queuecommand_lck (Scsi_Cmnd * SCpnt, void (*done) (Scsi_Cmnd *))
 {
 	struct Scsi_Host *phost = sc_host(SCpnt);
 	PVBUS_EXT vbus_ext = get_vbus_ext(phost);
@@ -1456,6 +1456,12 @@
 	return 0;
 }
 
+#ifdef DEF_SCSI_QCMD
+DEF_SCSI_QCMD(hpt_queuecommand)
+#else
+#define hpt_queuecommand hpt_queuecommand_lck
+#endif
+
 static int hpt_reset (Scsi_Cmnd *SCpnt)
 {
 	PVBUS_EXT vbus_ext = get_vbus_ext(sc_host(SCpnt));
diff -dPNur rr64x-linux-src-v1.0/osm/linux/osm_linux.h rr64x-linux-src-v1.0-ds/osm/linux/osm_linux.h
--- rr64x-linux-src-v1.0/osm/linux/osm_linux.h	2010-01-13 10:28:09.000000000 +0100
+++ rr64x-linux-src-v1.0-ds/osm/linux/osm_linux.h	2012-02-16 22:42:08.160045853 +0100
@@ -8,9 +8,12 @@
 
 /* system headers */
 
+/*
 #ifndef AUTOCONF_INCLUDED
 #include <linux/config.h>
 #endif
+*/
+
 
 #include <linux/version.h>
 
diff -dPNur rr64x-linux-src-v1.0/osm/linux/patch.sh rr64x-linux-src-v1.0-ds/osm/linux/patch.sh
--- rr64x-linux-src-v1.0/osm/linux/patch.sh	2010-01-13 10:28:09.000000000 +0100
+++ rr64x-linux-src-v1.0-ds/osm/linux/patch.sh	2012-02-16 22:45:10.601024277 +0100
@@ -143,7 +143,7 @@
 		fi
 	fi
 	;;
-	2.6 )
+	2.6 | 3.0 )
 	cd ${HPT_ROOT}/lib/linux/free-${ARCH}-regparm0
 	ld -r -o ${ARCH}-${TARGETNAME}.obj ${TARGETMODS}
 	mv ${ARCH}-${TARGETNAME}.obj $KERNELDIR/drivers/scsi/${TARGETNAME}/	
