diff -ru '--exclude=.svn' /usr/src/vhba-1.2.1-2mdv2009.1//kat/have_scsi_macros.c ./kat/have_scsi_macros.c --- /usr/src/vhba-1.2.1-2mdv2009.1//kat/have_scsi_macros.c 2009-02-28 03:23:40.000000000 -0500 +++ ./kat/have_scsi_macros.c 2010-03-21 00:45:09.000000000 -0400 @@ -1,4 +1,3 @@ -#include <linux/autoconf.h> #include <scsi/scsi_cmnd.h> void testfunc (void); diff -ru '--exclude=.svn' /usr/src/vhba-1.2.1-2mdv2009.1//kat/scatterlist_has_page_link.c ./kat/scatterlist_has_page_link.c --- /usr/src/vhba-1.2.1-2mdv2009.1//kat/scatterlist_has_page_link.c 2009-02-28 03:23:40.000000000 -0500 +++ ./kat/scatterlist_has_page_link.c 2010-03-21 00:45:09.000000000 -0400 @@ -1,4 +1,3 @@ -#include <linux/autoconf.h> #include <linux/scatterlist.h> /* Note: scatterlist.page_link is used in kernel (2.6.24 <= version < X) */ diff -ru '--exclude=.svn' /usr/src/vhba-1.2.1-2mdv2009.1//Makefile ./Makefile --- /usr/src/vhba-1.2.1-2mdv2009.1//Makefile 2009-02-28 03:23:40.000000000 -0500 +++ ./Makefile 2010-03-21 00:45:09.000000000 -0400 @@ -12,6 +12,8 @@ KDIR := /lib/modules/$(KERNELRELEASE)/build KMAKE := $(MAKE) -C $(KDIR) M=$(PWD) +DOCS = AUTHORS ChangeLog COPYING INSTALL NEWS README + all: kernel.api.h modules kernel.api.h: kat/*.c @@ -35,7 +37,7 @@ dist-dir: rm -fr $(PACKAGE) mkdir $(PACKAGE) - cp vhba.c Makefile $(PACKAGE) + cp vhba.c Makefile $(DOCS) $(PACKAGE) mkdir $(PACKAGE)/kat cp -fr $(shell ls kat/*) $(PACKAGE)/kat diff -ru '--exclude=.svn' /usr/src/vhba-1.2.1-2mdv2009.1//vhba.c ./vhba.c --- /usr/src/vhba-1.2.1-2mdv2009.1//vhba.c 2009-02-28 03:23:40.000000000 -0500 +++ ./vhba.c 2010-03-21 00:45:09.000000000 -0400 @@ -1,7 +1,7 @@ /* * vhba.c * - * Copyright (C) 2007 Chia-I Wu <b90201047 AT ntu DOT edu DOT tw> + * Copyright (C) 2007-2010 Chia-I Wu <b90201047 AT ntu DOT edu DOT tw> * * This program is free software; you can redistribute it and/or * modify it under the terms of the GNU General Public License @@ -26,6 +26,9 @@ #include <linux/platform_device.h> #include <linux/miscdevice.h> #include <linux/poll.h> +#ifdef CONFIG_COMPAT +#include <linux/compat.h> +#endif #include <asm/uaccess.h> #include <scsi/scsi.h> #include <scsi/scsi_host.h> @@ -52,7 +55,7 @@ dev_warn(&(scmd)->device->sdev_gendev, fmt, ##a) -#define VHBA_MAX_SECTORS_PER_IO 128 +#define VHBA_MAX_SECTORS_PER_IO 256 #define VHBA_MAX_ID 32 #define VHBA_CAN_QUEUE 32 #define VHBA_INVALID_ID VHBA_MAX_ID @@ -671,7 +674,7 @@ return ret; } -static int vhba_ctl_ioctl (struct inode *inode, struct file *file, unsigned int cmd, unsigned long arg) +static long vhba_ctl_ioctl (struct file *file, unsigned int cmd, unsigned long arg) { struct vhba_device *vdev = file->private_data; struct vhba_host *vhost; @@ -704,6 +707,15 @@ return -ENOTTY; } +#ifdef CONFIG_COMPAT +static long vhba_ctl_compat_ioctl (struct file *file, unsigned int cmd, unsigned long arg) +{ + unsigned long compat_arg = (unsigned long)compat_ptr(arg); + + return vhba_ctl_ioctl(file, cmd, compat_arg); +} +#endif + static unsigned int vhba_ctl_poll(struct file *file, poll_table *wait) { struct vhba_device *vdev = file->private_data; @@ -781,7 +793,10 @@ .read = vhba_ctl_read, .write = vhba_ctl_write, .poll = vhba_ctl_poll, - .ioctl = vhba_ctl_ioctl, + .unlocked_ioctl = vhba_ctl_ioctl, +#ifdef CONFIG_COMPAT + .compat_ioctl = vhba_ctl_compat_ioctl, +#endif }; static struct miscdevice vhba_miscdev = {