summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMarcelo Góes <vanquirius@gentoo.org>2008-05-20 02:18:53 +0000
committerMarcelo Góes <vanquirius@gentoo.org>2008-05-20 02:18:53 +0000
commitf35f6b87d497492159e15915960ea0df56d35620 (patch)
tree0ecc98304d9d3fdc046b6c8dab48a72fad757498 /sys-fs/vhba/files
parentAdd libmirage for bug 198672 - userspace cdemu. Thanks to Daniel Lin <ephemie... (diff)
downloadgentoo-2-f35f6b87d497492159e15915960ea0df56d35620.tar.gz
gentoo-2-f35f6b87d497492159e15915960ea0df56d35620.tar.bz2
gentoo-2-f35f6b87d497492159e15915960ea0df56d35620.zip
Add vhba for bug 198672 - userspace cdemu. Thanks to Daniel Lin <ephemient at gmail
dot com>, Daniel Fullmer <cgibreak at gmail dot com>, Sebastian Stammler <stammler at stud.tu-darmstadt.de>, Rafal Muzylo <galtgendo at o2 dot pl>, Jan Bessai <Jan.Bessai at gmx dot de>, Pham Ngoc Hai <pngochai at yahoo dot com>, Petr Sykora <petr.sykora at gmail dot com>, Dirk Best <fatplumber at gmx dot de>, Marcel Schmedes <sm at kleinreich dot de>, Vladi <vladimir.elisseev at gmail dot com>, Ambroz BIzjak <ambro at b4ever dot net> and anyone I missed. (Portage version: 2.1.4.4)
Diffstat (limited to 'sys-fs/vhba/files')
-rw-r--r--sys-fs/vhba/files/vhba-1.0.0-makefile.patch36
-rw-r--r--sys-fs/vhba/files/vhba-1.0.0-scatterlist.patch19
-rw-r--r--sys-fs/vhba/files/vhba-1.0.0-scsicmnd.patch98
3 files changed, 153 insertions, 0 deletions
diff --git a/sys-fs/vhba/files/vhba-1.0.0-makefile.patch b/sys-fs/vhba/files/vhba-1.0.0-makefile.patch
new file mode 100644
index 000000000000..289387005113
--- /dev/null
+++ b/sys-fs/vhba/files/vhba-1.0.0-makefile.patch
@@ -0,0 +1,36 @@
+--- vhba-module-1.0.0/Makefile 2007-12-20 02:56:57.000000000 +0100
++++ vhba-module-new/Makefile 2008-01-10 21:59:56.000000000 +0100
+@@ -1,21 +1,20 @@
+ VHBA_VERSION = 1.0.0
+ PACKAGE = vhba-module-$(VHBA_VERSION)
+
+-CFLAGS += -DVHBA_VERSION=\"$(VHBA_VERSION)\"
++EXTRA_CFLAGS += -DVHBA_VERSION=\"$(VHBA_VERSION)\"
+
+ obj-m += vhba.o
+
+ PWD ?= `pwd`
+ KDIR := /lib/modules/`uname -r`/build
+-KMAKE := $(MAKE) -C $(KDIR) M=$(PWD)
+
+ all: modules
+
+ modules:
+- $(KMAKE) modules
++ $(MAKE) -C $(KDIR) M=$(PWD) modules
+
+ module_install:
+- $(KMAKE) modules_install
++ $(MAKE) -C $(KDIR) M=$(PWD) modules_install
+
+ install: module_install
+
+@@ -24,7 +23,7 @@
+ cp Makefile $(distdir)
+
+ clean:
+- $(KMAKE) clean
++ $(MAKE) -C $(KDIR) M=$(PWD) clean
+ rm -fr $(PACKAGE)
+
+ dist: dist-gzip
diff --git a/sys-fs/vhba/files/vhba-1.0.0-scatterlist.patch b/sys-fs/vhba/files/vhba-1.0.0-scatterlist.patch
new file mode 100644
index 000000000000..5473ac3dd50e
--- /dev/null
+++ b/sys-fs/vhba/files/vhba-1.0.0-scatterlist.patch
@@ -0,0 +1,19 @@
+--- vhba-module-1.0.0/vhba.c 2007-12-20 02:56:57.000000000 +0100
++++ vhba-module-new/vhba.c 2008-01-06 08:49:18.000000000 +0100
+@@ -26,6 +26,7 @@
+ #include <linux/platform_device.h>
+ #include <linux/miscdevice.h>
+ #include <linux/poll.h>
++#include <linux/scatterlist.h>
+ #include <asm/uaccess.h>
+ #include <scsi/scsi.h>
+ #include <scsi/scsi_host.h>
+@@ -520,7 +521,7 @@
+ }
+ uaddr += len;
+
+- kaddr = kmap_atomic(sg[i].page, KM_USER0);
++ kaddr = kmap_atomic(sg_page(&sg[i]), KM_USER0);
+ memcpy(kaddr + sg[i].offset, kbuf, len);
+ kunmap_atomic(kaddr, KM_USER0);
+
diff --git a/sys-fs/vhba/files/vhba-1.0.0-scsicmnd.patch b/sys-fs/vhba/files/vhba-1.0.0-scsicmnd.patch
new file mode 100644
index 000000000000..bc8e64656dd6
--- /dev/null
+++ b/sys-fs/vhba/files/vhba-1.0.0-scsicmnd.patch
@@ -0,0 +1,98 @@
+--- vhba-module-org/vhba.c 2008-03-03 19:31:06.000000000 +0100
++++ vhba-module-1.0.0/vhba.c 2008-03-03 20:04:30.000000000 +0100
+@@ -425,11 +425,11 @@
+ ssize_t ret;
+
+ scmd_dbg(cmd, "request %lu, cdb 0x%x, bufflen %d, use_sg %d\n",
+- cmd->serial_number, cmd->cmnd[0], cmd->request_bufflen, cmd->use_sg);
++ cmd->serial_number, cmd->cmnd[0], cmd->sdb.length, cmd->sdb.table.nents);
+
+ ret = sizeof(vreq);
+ if (DATA_TO_DEVICE(cmd->sc_data_direction))
+- ret += cmd->request_bufflen;
++ ret += cmd->sdb.length;
+
+ if (ret > buf_len)
+ {
+@@ -442,7 +442,7 @@
+ vreq.lun = cmd->device->lun;
+ memcpy(vreq.cdb, cmd->cmnd, MAX_COMMAND_SIZE);
+ vreq.cdb_len = cmd->cmd_len;
+- vreq.data_len = cmd->request_bufflen;
++ vreq.data_len = cmd->sdb.length;
+
+ if (copy_to_user(buf, &vreq, sizeof(vreq)))
+ return -EFAULT;
+@@ -452,7 +452,7 @@
+ buf += sizeof(vreq);
+
+ /* XXX use_sg? */
+- if (copy_to_user(buf, cmd->request_buffer, vreq.data_len))
++ if (copy_to_user(buf, cmd->sdb.table.sgl, vreq.data_len))
+ return -EFAULT;
+ }
+
+@@ -464,7 +464,7 @@
+ ssize_t ret = 0;
+
+ scmd_dbg(cmd, "response %lu, status %x, data len %d, use_sg %d\n",
+- cmd->serial_number, res->status, res->data_len, cmd->use_sg);
++ cmd->serial_number, res->status, res->data_len, cmd->sdb.table.nents);
+
+ if (res->status)
+ {
+@@ -481,23 +481,23 @@
+
+ ret += res->data_len;
+ }
+- else if (DATA_FROM_DEVICE(cmd->sc_data_direction) && cmd->request_bufflen)
++ else if (DATA_FROM_DEVICE(cmd->sc_data_direction) && cmd->sdb.length)
+ {
+ size_t to_read;
+
+- if (res->data_len > cmd->request_bufflen)
++ if (res->data_len > cmd->sdb.length)
+ {
+- scmd_warn(cmd, "truncate data (%d < %d)\n", cmd->request_bufflen, res->data_len);
+- res->data_len = cmd->request_bufflen;
++ scmd_warn(cmd, "truncate data (%d < %d)\n", cmd->sdb.length, res->data_len);
++ res->data_len = cmd->sdb.length;
+ }
+
+ to_read = res->data_len;
+
+- if (cmd->use_sg)
++ if (cmd->sdb.table.nents)
+ {
+ unsigned char buf_stack[64];
+ unsigned char *kaddr, *uaddr, *kbuf;
+- struct scatterlist *sg = cmd->request_buffer;
++ struct scatterlist *sg = cmd->sdb.table.sgl;
+ int i;
+
+ uaddr = (unsigned char *) buf;
+@@ -507,7 +507,7 @@
+ else
+ kbuf = buf_stack;
+
+- for (i = 0; i < cmd->use_sg; i++)
++ for (i = 0; i < cmd->sdb.table.nents; i++)
+ {
+ size_t len = (sg[i].length < to_read) ? sg[i].length : to_read;
+
+@@ -534,13 +534,13 @@
+ }
+ else
+ {
+- if (copy_from_user(cmd->request_buffer, buf, res->data_len))
++ if (copy_from_user(cmd->sdb.table.sgl, buf, res->data_len))
+ return -EFAULT;
+
+ to_read -= res->data_len;
+ }
+
+- cmd->resid = to_read;
++ cmd->sdb.resid = to_read;
+
+ ret += res->data_len - to_read;
+ }