r4002 - in people/waldi/kernel/linux-2.6: . debian debian/arch debian/arch/i386 debian/arch/s390 debian/bin debian/lib debian/lib/python debian/patches-debian debian/patches-debian/series debian/templates

Bastian Blank waldi at costa.debian.org
Sun Aug 21 15:28:28 UTC 2005


Author: waldi
Date: 2005-08-21 15:28:27 +0000 (Sun, 21 Aug 2005)
New Revision: 4002

Added:
   people/waldi/kernel/linux-2.6/debian/lib/
   people/waldi/kernel/linux-2.6/debian/lib/python/
   people/waldi/kernel/linux-2.6/debian/lib/python/debian_linux.py
   people/waldi/kernel/linux-2.6/debian/patches-debian/drivers-s390-net-klist.patch
   people/waldi/kernel/linux-2.6/debian/patches-debian/powerpc-ppc64-vio-data.patch
   people/waldi/kernel/linux-2.6/debian/patches-debian/series/2.6.12+2.6.13-rc6-1
Removed:
   people/waldi/kernel/linux-2.6/debian/patches-debian/amd64-outs.patch
   people/waldi/kernel/linux-2.6/debian/patches-debian/drivers-ide-__devinit.patch
   people/waldi/kernel/linux-2.6/debian/patches-debian/ia64-generic-nosmp.patch
   people/waldi/kernel/linux-2.6/debian/patches-debian/patch-2.6.12.1
   people/waldi/kernel/linux-2.6/debian/patches-debian/patch-2.6.12.2
   people/waldi/kernel/linux-2.6/debian/patches-debian/patch-2.6.12.3
   people/waldi/kernel/linux-2.6/debian/patches-debian/patch-2.6.12.4
   people/waldi/kernel/linux-2.6/debian/patches-debian/patch-2.6.12.5
   people/waldi/kernel/linux-2.6/debian/patches-debian/powerpc-ppc64-ibmvscsi.patch
   people/waldi/kernel/linux-2.6/debian/patches-debian/series/2.6.12-1
   people/waldi/kernel/linux-2.6/debian/patches-debian/series/2.6.12-2
   people/waldi/kernel/linux-2.6/debian/patches-debian/series/2.6.12-3
Modified:
   people/waldi/kernel/linux-2.6/
   people/waldi/kernel/linux-2.6/debian/arch/config
   people/waldi/kernel/linux-2.6/debian/arch/i386/config.386
   people/waldi/kernel/linux-2.6/debian/arch/s390/config
   people/waldi/kernel/linux-2.6/debian/bin/gencontrol.py
   people/waldi/kernel/linux-2.6/debian/changelog
   people/waldi/kernel/linux-2.6/debian/patches-debian/drivers-scsi-megaraid_splitup.patch
   people/waldi/kernel/linux-2.6/debian/patches-debian/modular-ide-pnp.patch
   people/waldi/kernel/linux-2.6/debian/patches-debian/remove-references-to-removed-drivers.patch
   people/waldi/kernel/linux-2.6/debian/rules
   people/waldi/kernel/linux-2.6/debian/rules.real
   people/waldi/kernel/linux-2.6/debian/templates/control.tree.in
Log:
Merge /trunk/kernel/source/linux-2.6.



Property changes on: people/waldi/kernel/linux-2.6
___________________________________________________________________
Name: svk:merge
   - 510b9475-24dd-0310-9b6c-e0eefe99d49f:/trunk/kernel/linux-2.6:3961
   + 510b9475-24dd-0310-9b6c-e0eefe99d49f:/trunk/kernel/linux-2.6:4001

Modified: people/waldi/kernel/linux-2.6/debian/arch/config
===================================================================
--- people/waldi/kernel/linux-2.6/debian/arch/config	2005-08-21 15:17:11 UTC (rev 4001)
+++ people/waldi/kernel/linux-2.6/debian/arch/config	2005-08-21 15:28:27 UTC (rev 4002)
@@ -145,8 +145,10 @@
 CONFIG_CRAMFS=y
 CONFIG_NFS_FS=m
 CONFIG_NFS_V3=y
+CONFIG_NFS_V3_ACL=y
 CONFIG_NFSD=m
 CONFIG_NFSD_V3=y
+CONFIG_NFSD_V3_ACL=y
 CONFIG_NFSD_TCP=y
 CONFIG_LOCKD=m
 CONFIG_LOCKD_V4=y

Modified: people/waldi/kernel/linux-2.6/debian/arch/i386/config.386
===================================================================
--- people/waldi/kernel/linux-2.6/debian/arch/i386/config.386	2005-08-21 15:17:11 UTC (rev 4001)
+++ people/waldi/kernel/linux-2.6/debian/arch/i386/config.386	2005-08-21 15:28:27 UTC (rev 4002)
@@ -1,4 +1,4 @@
-CONFIG_CC_OPTIMIZE_FOR_SIZE=y
+# CONFIG_CC_OPTIMIZE_FOR_SIZE is not set
 CONFIG_M386=y
 # CONFIG_M686 is not set
 # CONFIG_MK7 is not set

Modified: people/waldi/kernel/linux-2.6/debian/arch/s390/config
===================================================================
--- people/waldi/kernel/linux-2.6/debian/arch/s390/config	2005-08-21 15:17:11 UTC (rev 4001)
+++ people/waldi/kernel/linux-2.6/debian/arch/s390/config	2005-08-21 15:28:27 UTC (rev 4002)
@@ -92,6 +92,7 @@
 CONFIG_S390_TAPE_BLOCK=y
 CONFIG_S390_TAPE_34XX=m
 CONFIG_VMLOGRDR=m
+CONFIG_VMCP=m
 CONFIG_MONREADER=m
 CONFIG_Z90CRYPT=m
 CONFIG_PACKET=y
@@ -107,6 +108,7 @@
 CONFIG_INET_AH=m
 CONFIG_INET_ESP=m
 CONFIG_IP_TCPDIAG=y
+# CONFIG_TCP_CONG_ADVANCED is not set
 CONFIG_IP_TCPDIAG_IPV6=y
 CONFIG_IPV6=y
 # CONFIG_IPV6_PRIVACY is not set
@@ -208,6 +210,7 @@
 # CONFIG_NETCONSOLE is not set
 CONFIG_EXT2_FS=y
 # CONFIG_EXT2_FS_XATTR is not set
+# CONFIG_EXT2_FS_XIP is not set
 CONFIG_EXT3_FS=y
 # CONFIG_EXT3_FS_SECURITY is not set
 CONFIG_JBD=y
@@ -218,6 +221,7 @@
 # CONFIG_XFS_SECURITY is not set
 # CONFIG_MINIX_FS is not set
 # CONFIG_ROMFS_FS is not set
+CONFIG_INOTIFY=y
 CONFIG_QUOTA=y
 # CONFIG_QFMT_V1 is not set
 CONFIG_QFMT_V2=y
@@ -331,3 +335,4 @@
 # CONFIG_CRYPTO_TEST is not set
 # CONFIG_CRC_CCITT is not set
 CONFIG_CRC32=m
+CONFIG_KEXEC=y

Modified: people/waldi/kernel/linux-2.6/debian/bin/gencontrol.py
===================================================================
--- people/waldi/kernel/linux-2.6/debian/bin/gencontrol.py	2005-08-21 15:17:11 UTC (rev 4001)
+++ people/waldi/kernel/linux-2.6/debian/bin/gencontrol.py	2005-08-21 15:28:27 UTC (rev 4002)
@@ -1,148 +1,27 @@
 #!/usr/bin/env python
 import os, os.path, re, sys, textwrap, ConfigParser
+sys.path.append("debian/lib/python")
+from debian_linux import *
 
-config_name = "defines"
-
-class schema_item_boolean(object):
-    def __call__(self, i):
-        i = i.strip().lower()
-        if i in ("true", "1"):
-            return True
-        if i in ("false", "0"):
-            return False
-        raise Error
-
-class schema_item_integer(object):
-    def __call__(self, i):
-        return int(i)
-
-class schema_item_list(object):
-    def __call__(self, i):
-        return re.split("\s+", i.strip())
-
-class schema_item_string(object):
-    def __call__(self, i):
-        return str(i)
-
-class config(dict):
-    schema = {
-        'abiname': schema_item_string,
-        'arches': schema_item_list,
-        'available': schema_item_boolean,
-        'class': schema_item_string,
-        'depends': schema_item_string,
-        'desc': schema_item_string,
-        'flavours': schema_item_list,
-        'kpkg-subarch': schema_item_string,
-        'longclass': schema_item_string,
-        'subarches': schema_item_list,
-        'suggests': schema_item_string,
-    }
-
-    def __init__(self):
-        self._read_base()
-#        import pprint
-#        pprint.pprint(dict(self))
-
-    def _read_arch(self, arch, base):
-        file = "debian/arch/%s/%s" % (arch, config_name)
-        c = config_parser(self.schema)
-        c.read(file)
-        t = c.items_convert('base')
-        base.update(t)
-        self[arch] = t
-        subarches = t.get('subarches', [])
-        for subarch in subarches:
-            raise RuntimeError
-        flavours = t.get('flavours', None)
-        if flavours:
-            for flavour in flavours:
-                self._read_flavour(arch, 'none', flavour, c)
-            subarches.append('none')
-        t['subarches'] = subarches
-
-    def _read_base(self):
-        file = "debian/arch/%s" % config_name
-        c = config_parser(self.schema)
-        c.read(file)
-        t1 = c.items_convert('base')
-        self['base'] = t1
-        for arch in t1['arches']:
-            try:
-                t2 = c.items_convert(arch)
-                avail = t2.get('available', True)
-            except ConfigParser.NoSectionError:
-                t2 = {}
-                avail = True
-            if avail:
-                self._read_arch(arch, t2)
-            else:
-                self[arch] = t2
-
-    def _read_flavour(self, arch, subarch, flavour, c):
-        try:
-            t = c.items_convert(flavour)
-        except ConfigParser.NoSectionError:
-            try:
-                t = c.items_convert("%s-none-%s" % (arch, flavour))
-            except ConfigParser.NoSectionError:
-                #raise RuntimeError("Don't find config for %s-none-%s!" % (arch, flavour))
-                t = {}
-        self["%s-%s-%s" % (arch, subarch, flavour)] = t
-
-class config_parser(object, ConfigParser.ConfigParser):
-    def __init__(self, schema):
-        ConfigParser.ConfigParser.__init__(self)
-        self.schema = schema
-
-    def items_convert(self, section):
-        items = self.items(section)
-        ret = {}
-        for key, value in items:
-            convert = self.schema[key]()
-            ret[key] = convert(value)
-        return ret
-
-class entry(dict):
-    __slots__ = ('_list')
-
-    def __init__(self):
-        super(entry, self).__init__()
-        self._list = []
-
-    def __delitem__(self, key):
-        super(entry, self).__delitem__(key)
-        self._list.remove(key)
-
-    def __setitem__(self, key, value):
-        super(entry, self).__setitem__(key, value)
-        if key.startswith('_'):
-            return
-        if key not in self._list:
-            if 'Description' in self._list:
-                self._list.insert(len(self._list)-1, key)
-            else:
-                self._list.append(key)
-
-    def iterkeys(self):
-        for i in self._list:
-            yield i
-
-    def iteritems(self):
-        for i in self._list:
-            yield (i, self[i])
-
-class wrap(textwrap.TextWrapper):
-    wordsep_re = re.compile(
-        r'(\s+|'                                  # any whitespace
-        r'(?<=[\w\!\"\'\&\.\,\?])-{2,}(?=\w))')   # em-dash
-
 def read_changelog():
     r = re.compile(r"""
 ^
 (
     (?P<header>
-        (?P<header_source>\w[-+0-9a-z.]+)\ \((?P<header_version>[^\(\)\ \t]+)\)((\s+[-0-9a-zA-Z]+)+)\;
+        (?P<header_source>
+            \w[-+0-9a-z.]+
+        )
+        \ 
+        \(
+        (?P<header_version>
+            [^\(\)\ \t]+
+        )
+        \)
+        \s+
+        (?P<header_distribution>
+            [-0-9a-zA-Z]+
+        )
+        \;
     )
 )
 """, re.VERBOSE)
@@ -158,8 +37,9 @@
             continue
         if match.group('header'):
             e = entry()
+            e['Distribution'] = match.group('header_distribution')
             e['Source'] = match.group('header_source')
-            e['Version'] = match.group('header_version')
+            e['Version'] = parse_version(match.group('header_version'))
             entries.append(e)
     return entries
 
@@ -196,7 +76,31 @@
     return read_rfc822(file("debian/templates/control.%s.in" % name))
 
 def parse_version(version):
-    match = re.match("^(?P<source>(?P<version>(?P<major>\d+\.\d+)\..+?)-(?P<debian>[^-]+))$", version)
+    version_re = ur"""
+^
+(?P<source>
+    (?:
+        \d+\.\d+\.\d+\+
+    )?
+    (?P<upstream>
+        (?P<version>
+            (?P<major>\d+\.\d+)
+            \.
+            \d+
+        )
+        (?:
+            -
+            (?P<modifier>
+                .+?
+            )
+        )?
+    )
+    -
+    (?P<debian>[^-]+)
+)
+$
+"""
+    match = re.match(version_re, version, re.X)
     return match.groupdict()
 
 def process_depends(key, e, in_e, vars):
@@ -269,10 +173,10 @@
 
 def process_real_tree(in_entry, changelog, vars):
     entry = process_package(in_entry, vars)
-    tmp = changelog[0]['Source']
+    tmp = changelog[0]['Version']['upstream']
     versions = []
     for i in changelog:
-        if i['Source'] != tmp:
+        if i['Version']['upstream'] != tmp:
             break
         versions.insert(0, i['Version'])
     for i in (('Depends', 'Provides')):
@@ -281,9 +185,10 @@
         if tmp:
             value.extend([j.strip() for j in tmp.split(',')])
         if i == 'Depends':
-            value.append(' | '.join(["linux-source-%(version)s (= %(source)s)" % parse_version(v) for v in versions]))
+            value.append("linux-patch-debian-%(version)s (= %(source)s)" % changelog[0]['Version'])
+            value.append(' | '.join(["linux-source-%(version)s (= %(source)s)" % v for v in versions]))
         elif i == 'Provides':
-            value.extend(["linux-tree-%(source)s" % parse_version(v) for v in versions])
+            value.extend(["linux-tree-%(source)s" % v for v in versions])
         entry[i] = ', '.join(value)
     return entry
 
@@ -293,8 +198,7 @@
     return re.sub(r'@([a-z_]+)@', subst, s)
 
 def vars_changelog(vars, changelog):
-    version = parse_version(changelog[0]['Version'])
-    vars['srcver'] = version['source']
+    version = changelog[0]['Version']
     vars['version'] = version['version']
     vars['major'] = version['major']
     return vars
@@ -327,13 +231,19 @@
     vars = {}
     vars = vars_changelog(vars, changelog)
 
-    version = vars['version']
-    source_version = vars['srcver']
-
     c = config()
 
     vars.update(c['base'])
 
+    version = changelog[0]['Version']
+    if version['modifier'] is not None:
+        abiname = version['modifier']
+        kpkg_abiname = ""
+        vars['abiname'] = abiname
+    else:
+        abiname = c['base']['abiname']
+        kpkg_abiname = "-%s" % abiname
+
     arches = {}
     subarches_architecture = {}
     for arch in c['base']['arches']:
@@ -379,7 +289,11 @@
     image = read_template("image")
     image_latest = read_template("image.latest")
 
-    makeflags = ["VERSION='%s'" % version, "SOURCE_VERSION='%s'" % source_version]
+    makeflags = [
+        "VERSION='%s'" % version['version'],
+        "SOURCE_VERSION='%s'" % version['source'],
+        "UPSTREAM_VERSION='%s'" % version['upstream'],
+    ]
     cmds_binary_indep = []
     cmds_binary_indep.append(("$(MAKE) -f debian/rules.real binary-indep %s" % ' '.join(makeflags),))
     makefile.append(("binary-indep:", cmds_binary_indep))
@@ -420,7 +334,11 @@
                 makefile.append(("%s-%s-%s:: %s-%s-%s-real" % (i, arch, subarch_text, i, arch, subarch_text), None))
 
             subarch_makeflags = arch_makeflags[:]
-            subarch_makeflags.extend(["SUBARCH='%s'" % subarch_text, "ABINAME='%s'" % subarch_vars['abiname']])
+            subarch_makeflags.extend([
+                "SUBARCH='%s'" % subarch_text,
+                "ABINAME='%s'" % abiname,
+                "KPKG_ABINAME='%s'" % kpkg_abiname,
+            ])
             subarch_makeflags_clean = subarch_makeflags[:]
             if subarch_vars.has_key('kpkg-subarch'):
                 subarch_makeflags.append("KPKG_SUBARCH='%s'" % subarch_vars['kpkg-subarch'])
@@ -490,7 +408,7 @@
         for i in extra_pn[arch]:
             tmp = []
             if i.has_key('X-Version-Overwrite-Epoch'):
-                    tmp.append("-v1:%s" % source_version)
+                    tmp.append("-v1:%s" % version['source'])
             cmds.append("$(MAKE) -f debian/rules.real install-dummy DH_OPTIONS='-p%s' GENCONTROL_ARGS='%s'" % (i['Package'], ' '.join(tmp)))
         makefile.append(("binary-arch-%s:: binary-arch-%s-extra" % (arch, arch), None))
         makefile.append(("binary-arch-%s-extra:" % arch, cmds))

Modified: people/waldi/kernel/linux-2.6/debian/changelog
===================================================================
--- people/waldi/kernel/linux-2.6/debian/changelog	2005-08-21 15:17:11 UTC (rev 4001)
+++ people/waldi/kernel/linux-2.6/debian/changelog	2005-08-21 15:28:27 UTC (rev 4002)
@@ -1,3 +1,12 @@
+linux-2.6 (2.6.12+2.6.13-rc6-1) UNRELEASED; urgency=low
+
+  [ Simon Horman ]
+  * - Unset CC_OPTIMIZE_FOR_SIZE in i386 config,
+      it breaks iproute's (and other netlink users) ability
+      to set routes. (closes: #322723) 
+
+ -- Simon Horman <horms at debian.org>  Sun, 21 Aug 2005 10:55:12 +0900
+
 linux-2.6 (2.6.12-6) UNRELEASED; urgency=low
 
   * [powerpc]

Added: people/waldi/kernel/linux-2.6/debian/lib/python/debian_linux.py
===================================================================
--- people/waldi/kernel/linux-2.6/debian/lib/python/debian_linux.py	2005-08-21 15:17:11 UTC (rev 4001)
+++ people/waldi/kernel/linux-2.6/debian/lib/python/debian_linux.py	2005-08-21 15:28:27 UTC (rev 4002)
@@ -0,0 +1,136 @@
+import os, os.path, re, sys, textwrap, ConfigParser
+
+config_name = "defines"
+
+class schema_item_boolean(object):
+    def __call__(self, i):
+        i = i.strip().lower()
+        if i in ("true", "1"):
+            return True
+        if i in ("false", "0"):
+            return False
+        raise Error
+
+class schema_item_integer(object):
+    def __call__(self, i):
+        return int(i)
+
+class schema_item_list(object):
+    def __call__(self, i):
+        return re.split("\s+", i.strip())
+
+class schema_item_string(object):
+    def __call__(self, i):
+        return str(i)
+
+class config(dict):
+    schema = {
+        'abiname': schema_item_string,
+        'arches': schema_item_list,
+        'available': schema_item_boolean,
+        'class': schema_item_string,
+        'depends': schema_item_string,
+        'desc': schema_item_string,
+        'flavours': schema_item_list,
+        'kpkg-subarch': schema_item_string,
+        'longclass': schema_item_string,
+        'subarches': schema_item_list,
+        'suggests': schema_item_string,
+    }
+
+    def __init__(self):
+        self._read_base()
+
+    def _read_arch(self, arch, base):
+        file = "debian/arch/%s/%s" % (arch, config_name)
+        c = config_parser(self.schema)
+        c.read(file)
+        t = c.items_convert('base')
+        base.update(t)
+        self[arch] = t
+        subarches = t.get('subarches', [])
+        for subarch in subarches:
+            raise RuntimeError
+        flavours = t.get('flavours', None)
+        if flavours:
+            for flavour in flavours:
+                self._read_flavour(arch, 'none', flavour, c)
+            subarches.append('none')
+        t['subarches'] = subarches
+
+    def _read_base(self):
+        file = "debian/arch/%s" % config_name
+        c = config_parser(self.schema)
+        c.read(file)
+        t1 = c.items_convert('base')
+        self['base'] = t1
+        for arch in t1['arches']:
+            try:
+                t2 = c.items_convert(arch)
+                avail = t2.get('available', True)
+            except ConfigParser.NoSectionError:
+                t2 = {}
+                avail = True
+            if avail:
+                self._read_arch(arch, t2)
+            else:
+                self[arch] = t2
+
+    def _read_flavour(self, arch, subarch, flavour, c):
+        try:
+            t = c.items_convert(flavour)
+        except ConfigParser.NoSectionError:
+            try:
+                t = c.items_convert("%s-none-%s" % (arch, flavour))
+            except ConfigParser.NoSectionError:
+                #raise RuntimeError("Don't find config for %s-none-%s!" % (arch, flavour))
+                t = {}
+        self["%s-%s-%s" % (arch, subarch, flavour)] = t
+
+class config_parser(object, ConfigParser.ConfigParser):
+    def __init__(self, schema):
+        ConfigParser.ConfigParser.__init__(self)
+        self.schema = schema
+
+    def items_convert(self, section):
+        items = self.items(section)
+        ret = {}
+        for key, value in items:
+            convert = self.schema[key]()
+            ret[key] = convert(value)
+        return ret
+
+class entry(dict):
+    __slots__ = ('_list')
+
+    def __init__(self):
+        super(entry, self).__init__()
+        self._list = []
+
+    def __delitem__(self, key):
+        super(entry, self).__delitem__(key)
+        self._list.remove(key)
+
+    def __setitem__(self, key, value):
+        super(entry, self).__setitem__(key, value)
+        if key.startswith('_'):
+            return
+        if key not in self._list:
+            if 'Description' in self._list:
+                self._list.insert(len(self._list)-1, key)
+            else:
+                self._list.append(key)
+
+    def iterkeys(self):
+        for i in self._list:
+            yield i
+
+    def iteritems(self):
+        for i in self._list:
+            yield (i, self[i])
+
+class wrap(textwrap.TextWrapper):
+    wordsep_re = re.compile(
+        r'(\s+|'                                  # any whitespace
+        r'(?<=[\w\!\"\'\&\.\,\?])-{2,}(?=\w))')   # em-dash
+

Deleted: people/waldi/kernel/linux-2.6/debian/patches-debian/amd64-outs.patch
===================================================================
--- people/waldi/kernel/linux-2.6/debian/patches-debian/amd64-outs.patch	2005-08-21 15:17:11 UTC (rev 4001)
+++ people/waldi/kernel/linux-2.6/debian/patches-debian/amd64-outs.patch	2005-08-21 15:28:27 UTC (rev 4002)
@@ -1,24 +0,0 @@
-#! /bin/sh -e 
-## <PATCHNAME>.dpatch by <PATCH_AUTHOR at EMAI>
-##
-## All lines beginning with `## DP:' are a description of the patch.
-## DP: Description: [CAN-2005-0204]: AMD64, allows local users to write to privileged IO ports via OUTS instruction
-## DP: Patch author: Suresh Siddha (suresh.b.siddha at intel.com)
-## DP: Upstream status: unknown
-## DP: URL: https://bugzilla.redhat.com/bugzilla/show_bug.cgi?id=146244
-## DP: Patch source: Micah Anderson <micah at riseup.net> (debian-kernel)
-
-. $(dirname $0)/DPATCH
-
- at DPATCH@
---- linux-2.6.9/include/asm-x86_64/desc.h	2005-01-30 20:08:12.799247944 -0800
-+++ linux-2.6.9/include/asm-x86_64/desc.h	2005-01-30 20:08:12.799247944 -0800
-@@ -128,7 +128,7 @@
- { 
- 	set_tssldt_descriptor(&cpu_gdt_table[cpu][GDT_ENTRY_TSS], (unsigned long)addr, 
- 			      DESC_TSS,
--			      sizeof(struct tss_struct) - 1);
-+			      IO_BITMAP_OFFSET + IO_BITMAP_BYTES + 7);
- } 
- 
- static inline void set_ldt_desc(unsigned cpu, void *addr, int size)

Deleted: people/waldi/kernel/linux-2.6/debian/patches-debian/drivers-ide-__devinit.patch
===================================================================
--- people/waldi/kernel/linux-2.6/debian/patches-debian/drivers-ide-__devinit.patch	2005-08-21 15:17:11 UTC (rev 4001)
+++ people/waldi/kernel/linux-2.6/debian/patches-debian/drivers-ide-__devinit.patch	2005-08-21 15:28:27 UTC (rev 4002)
@@ -1,340 +0,0 @@
-## DP: Upstream status: submitted
-diff -aurN a/drivers/ide/pci/alim15x3.c b/drivers/ide/pci/alim15x3.c
---- a/drivers/ide/pci/alim15x3.c	2005-06-06 11:22:29.000000000 -0400
-+++ b/drivers/ide/pci/alim15x3.c	2005-06-15 22:01:23.000000000 -0400
-@@ -583,7 +583,7 @@
-  *	appropriate also sets up the 1533 southbridge.
-  */
-   
--static unsigned int __init init_chipset_ali15x3 (struct pci_dev *dev, const char *name)
-+static unsigned int __devinit init_chipset_ali15x3 (struct pci_dev *dev, const char *name)
- {
- 	unsigned long flags;
- 	u8 tmpbyte;
-@@ -677,7 +677,7 @@
-  *	FIXME: frobs bits that are not defined on newer ALi devicea
-  */
- 
--static unsigned int __init ata66_ali15x3 (ide_hwif_t *hwif)
-+static unsigned int __devinit ata66_ali15x3 (ide_hwif_t *hwif)
- {
- 	struct pci_dev *dev	= hwif->pci_dev;
- 	unsigned int ata66	= 0;
-@@ -748,7 +748,7 @@
-  *	Initialize the IDE structure side of the ALi 15x3 driver.
-  */
-  
--static void __init init_hwif_common_ali15x3 (ide_hwif_t *hwif)
-+static void __devinit init_hwif_common_ali15x3 (ide_hwif_t *hwif)
- {
- 	hwif->autodma = 0;
- 	hwif->tuneproc = &ali15x3_tune_drive;
-@@ -794,7 +794,7 @@
-  *	Sparc systems
-  */
- 
--static void __init init_hwif_ali15x3 (ide_hwif_t *hwif)
-+static void __devinit init_hwif_ali15x3 (ide_hwif_t *hwif)
- {
- 	u8 ideic, inmir;
- 	s8 irq_routing_table[] = { -1,  9, 3, 10, 4,  5, 7,  6,
-@@ -847,7 +847,7 @@
-  *	the actual work.
-  */
- 
--static void __init init_dma_ali15x3 (ide_hwif_t *hwif, unsigned long dmabase)
-+static void __devinit init_dma_ali15x3 (ide_hwif_t *hwif, unsigned long dmabase)
- {
- 	if (m5229_revision < 0x20)
- 		return;
-diff -aurN a/drivers/ide/pci/amd74xx.c b/drivers/ide/pci/amd74xx.c
---- a/drivers/ide/pci/amd74xx.c	2005-06-06 11:22:29.000000000 -0400
-+++ b/drivers/ide/pci/amd74xx.c	2005-06-15 22:01:23.000000000 -0400
-@@ -309,7 +309,7 @@
-  * and initialize its drive independent registers.
-  */
- 
--static unsigned int __init init_chipset_amd74xx(struct pci_dev *dev, const char *name)
-+static unsigned int __devinit init_chipset_amd74xx(struct pci_dev *dev, const char *name)
- {
- 	unsigned char t;
- 	unsigned int u;
-@@ -413,7 +413,7 @@
- 	return dev->irq;
- }
- 
--static void __init init_hwif_amd74xx(ide_hwif_t *hwif)
-+static void __devinit init_hwif_amd74xx(ide_hwif_t *hwif)
- {
- 	int i;
- 
-diff -aurN a/drivers/ide/pci/cmd640.c b/drivers/ide/pci/cmd640.c
---- a/drivers/ide/pci/cmd640.c	2005-06-06 11:22:29.000000000 -0400
-+++ b/drivers/ide/pci/cmd640.c	2005-06-15 22:01:23.000000000 -0400
-@@ -278,7 +278,7 @@
- 	spin_unlock_irqrestore(&ide_lock, flags);
- }
- 
--static int __init match_pci_cmd640_device (void)
-+static int __devinit match_pci_cmd640_device (void)
- {
- 	const u8 ven_dev[4] = {0x95, 0x10, 0x40, 0x06};
- 	unsigned int i;
-@@ -298,7 +298,7 @@
- /*
-  * Probe for CMD640x -- pci method 1
-  */
--static int __init probe_for_cmd640_pci1 (void)
-+static int __devinit probe_for_cmd640_pci1 (void)
- {
- 	__get_cmd640_reg = get_cmd640_reg_pci1;
- 	__put_cmd640_reg = put_cmd640_reg_pci1;
-@@ -314,7 +314,7 @@
- /*
-  * Probe for CMD640x -- pci method 2
-  */
--static int __init probe_for_cmd640_pci2 (void)
-+static int __devinit probe_for_cmd640_pci2 (void)
- {
- 	__get_cmd640_reg = get_cmd640_reg_pci2;
- 	__put_cmd640_reg = put_cmd640_reg_pci2;
-@@ -328,7 +328,7 @@
- /*
-  * Probe for CMD640x -- vlb
-  */
--static int __init probe_for_cmd640_vlb (void)
-+static int __devinit probe_for_cmd640_vlb (void)
- {
- 	u8 b;
- 
-@@ -349,7 +349,7 @@
-  *  Returns 1 if an IDE interface/drive exists at 0x170,
-  *  Returns 0 otherwise.
-  */
--static int __init secondary_port_responding (void)
-+static int __devinit secondary_port_responding (void)
- {
- 	unsigned long flags;
- 
-@@ -392,7 +392,7 @@
-  * Check whether prefetch is on for a drive,
-  * and initialize the unmask flags for safe operation.
-  */
--static void __init check_prefetch (unsigned int index)
-+static void __devinit check_prefetch (unsigned int index)
- {
- 	ide_drive_t *drive = cmd_drives[index];
- 	u8 b = get_cmd640_reg(prefetch_regs[index]);
-@@ -413,7 +413,7 @@
- /*
-  * Figure out which devices we control
-  */
--static void __init setup_device_ptrs (void)
-+static void __devinit setup_device_ptrs (void)
- {
- 	unsigned int i;
- 
-@@ -495,7 +495,7 @@
- /*
-  * This routine retrieves the initial drive timings from the chipset.
-  */
--static void __init retrieve_drive_counts (unsigned int index)
-+static void __devinit retrieve_drive_counts (unsigned int index)
- {
- 	u8 b;
- 
-@@ -716,7 +716,7 @@
- /*
-  * Probe for a cmd640 chipset, and initialize it if found.  Called from ide.c
-  */
--int __init ide_probe_for_cmd640x (void)
-+int __devinit ide_probe_for_cmd640x (void)
- {
- #ifdef CONFIG_BLK_DEV_CMD640_ENHANCED
- 	int second_port_toggled = 0;
-diff -aurN a/drivers/ide/pci/cs5530.c b/drivers/ide/pci/cs5530.c
---- a/drivers/ide/pci/cs5530.c	2005-06-06 11:22:29.000000000 -0400
-+++ b/drivers/ide/pci/cs5530.c	2005-06-15 22:01:23.000000000 -0400
-@@ -217,7 +217,7 @@
-  *	Initialize the cs5530 bridge for reliable IDE DMA operation.
-  */
- 
--static unsigned int __init init_chipset_cs5530 (struct pci_dev *dev, const char *name)
-+static unsigned int __devinit init_chipset_cs5530 (struct pci_dev *dev, const char *name)
- {
- 	struct pci_dev *master_0 = NULL, *cs5530_0 = NULL;
- 	unsigned long flags;
-@@ -308,7 +308,7 @@
-  *	performs channel-specific pre-initialization before drive probing.
-  */
- 
--static void __init init_hwif_cs5530 (ide_hwif_t *hwif)
-+static void __devinit init_hwif_cs5530 (ide_hwif_t *hwif)
- {
- 	unsigned long basereg;
- 	u32 d0_timings;
-diff -aurN a/drivers/ide/pci/cy82c693.c b/drivers/ide/pci/cy82c693.c
---- a/drivers/ide/pci/cy82c693.c	2005-06-06 11:22:29.000000000 -0400
-+++ b/drivers/ide/pci/cy82c693.c	2005-06-15 22:01:23.000000000 -0400
-@@ -391,7 +391,7 @@
- /*
-  * this function is called during init and is used to setup the cy82c693 chip
-  */
--static unsigned int __init init_chipset_cy82c693(struct pci_dev *dev, const char *name)
-+static unsigned int __devinit init_chipset_cy82c693(struct pci_dev *dev, const char *name)
- {
- 	if (PCI_FUNC(dev->devfn) != 1)
- 		return 0;
-@@ -443,7 +443,7 @@
- /*
-  * the init function - called for each ide channel once
-  */
--static void __init init_hwif_cy82c693(ide_hwif_t *hwif)
-+static void __devinit init_hwif_cy82c693(ide_hwif_t *hwif)
- {
- 	hwif->autodma = 0;
- 
-@@ -467,9 +467,9 @@
- 	hwif->drives[1].autodma = hwif->autodma;
- }
- 
--static __initdata ide_hwif_t *primary;
-+static __devinitdata ide_hwif_t *primary;
- 
--void __init init_iops_cy82c693(ide_hwif_t *hwif)
-+void __devinit init_iops_cy82c693(ide_hwif_t *hwif)
- {
- 	if (PCI_FUNC(hwif->pci_dev->devfn) == 1)
- 		primary = hwif;
-diff -aurN a/drivers/ide/pci/it8172.c b/drivers/ide/pci/it8172.c
---- a/drivers/ide/pci/it8172.c	2005-06-06 11:22:29.000000000 -0400
-+++ b/drivers/ide/pci/it8172.c	2005-06-15 22:01:23.000000000 -0400
-@@ -216,7 +216,7 @@
- 	return 0;
- }
- 
--static unsigned int __init init_chipset_it8172 (struct pci_dev *dev, const char *name)
-+static unsigned int __devinit init_chipset_it8172 (struct pci_dev *dev, const char *name)
- {
- 	unsigned char progif;
-     
-@@ -230,7 +230,7 @@
- }
- 
- 
--static void __init init_hwif_it8172 (ide_hwif_t *hwif)
-+static void __devinit init_hwif_it8172 (ide_hwif_t *hwif)
- {
- 	struct pci_dev* dev = hwif->pci_dev;
- 	unsigned long cmdBase, ctrlBase;
-diff -aurN a/drivers/ide/pci/ns87415.c b/drivers/ide/pci/ns87415.c
---- a/drivers/ide/pci/ns87415.c	2005-06-06 11:22:29.000000000 -0400
-+++ b/drivers/ide/pci/ns87415.c	2005-06-15 22:01:23.000000000 -0400
-@@ -195,7 +195,7 @@
- 	return __ide_dma_check(drive);
- }
- 
--static void __init init_hwif_ns87415 (ide_hwif_t *hwif)
-+static void __devinit init_hwif_ns87415 (ide_hwif_t *hwif)
- {
- 	struct pci_dev *dev = hwif->pci_dev;
- 	unsigned int ctrl, using_inta;
-diff -aurN a/drivers/ide/pci/opti621.c b/drivers/ide/pci/opti621.c
---- a/drivers/ide/pci/opti621.c	2005-06-06 11:22:29.000000000 -0400
-+++ b/drivers/ide/pci/opti621.c	2005-06-15 22:01:23.000000000 -0400
-@@ -326,7 +326,7 @@
- /*
-  * init_hwif_opti621() is called once for each hwif found at boot.
-  */
--static void __init init_hwif_opti621 (ide_hwif_t *hwif)
-+static void __devinit init_hwif_opti621 (ide_hwif_t *hwif)
- {
- 	hwif->autodma = 0;
- 	hwif->drives[0].drive_data = PIO_DONT_KNOW;
-diff -aurN a/drivers/ide/pci/sc1200.c b/drivers/ide/pci/sc1200.c
---- a/drivers/ide/pci/sc1200.c	2005-06-06 11:22:29.000000000 -0400
-+++ b/drivers/ide/pci/sc1200.c	2005-06-15 22:01:23.000000000 -0400
-@@ -459,7 +459,7 @@
-  * This gets invoked by the IDE driver once for each channel,
-  * and performs channel-specific pre-initialization before drive probing.
-  */
--static void __init init_hwif_sc1200 (ide_hwif_t *hwif)
-+static void __devinit init_hwif_sc1200 (ide_hwif_t *hwif)
- {
- 	if (hwif->mate)
- 		hwif->serialized = hwif->mate->serialized = 1;
-diff -aurN a/drivers/ide/pci/sl82c105.c b/drivers/ide/pci/sl82c105.c
---- a/drivers/ide/pci/sl82c105.c	2005-06-06 11:22:29.000000000 -0400
-+++ b/drivers/ide/pci/sl82c105.c	2005-06-15 22:01:23.000000000 -0400
-@@ -386,7 +386,7 @@
-  * channel 0 here at least, but channel 1 has to be enabled by
-  * firmware or arch code. We still set both to 16 bits mode.
-  */
--static unsigned int __init init_chipset_sl82c105(struct pci_dev *dev, const char *msg)
-+static unsigned int __devinit init_chipset_sl82c105(struct pci_dev *dev, const char *msg)
- {
- 	u32 val;
- 
-@@ -399,7 +399,7 @@
- 	return dev->irq;
- }
- 
--static void __init init_dma_sl82c105(ide_hwif_t *hwif, unsigned long dma_base)
-+static void __devinit init_dma_sl82c105(ide_hwif_t *hwif, unsigned long dma_base)
- {
- 	unsigned int rev;
- 	u8 dma_state;
-@@ -431,7 +431,7 @@
-  * Initialise the chip
-  */
- 
--static void __init init_hwif_sl82c105(ide_hwif_t *hwif)
-+static void __devinit init_hwif_sl82c105(ide_hwif_t *hwif)
- {
- 	struct pci_dev *dev = hwif->pci_dev;
- 	u32 val;
-diff -aurN a/drivers/ide/pci/slc90e66.c b/drivers/ide/pci/slc90e66.c
---- a/drivers/ide/pci/slc90e66.c	2005-06-06 11:22:29.000000000 -0400
-+++ b/drivers/ide/pci/slc90e66.c	2005-06-15 22:01:23.000000000 -0400
-@@ -196,7 +196,7 @@
- }
- #endif /* CONFIG_BLK_DEV_IDEDMA */
- 
--static void __init init_hwif_slc90e66 (ide_hwif_t *hwif)
-+static void __devinit init_hwif_slc90e66 (ide_hwif_t *hwif)
- {
- 	u8 reg47 = 0;
- 	u8 mask = hwif->channel ? 0x01 : 0x02;  /* bit0:Primary */
-diff -aurN a/drivers/ide/pci/triflex.c b/drivers/ide/pci/triflex.c
---- a/drivers/ide/pci/triflex.c	2005-06-06 11:22:29.000000000 -0400
-+++ b/drivers/ide/pci/triflex.c	2005-06-15 22:01:23.000000000 -0400
-@@ -130,7 +130,7 @@
- 	return hwif->ide_dma_off_quietly(drive);
- }
- 
--static void __init init_hwif_triflex(ide_hwif_t *hwif)
-+static void __devinit init_hwif_triflex(ide_hwif_t *hwif)
- {
- 	hwif->tuneproc = &triflex_tune_drive;
- 	hwif->speedproc = &triflex_tune_chipset;
-diff -aurN a/drivers/ide/pci/via82cxxx.c b/drivers/ide/pci/via82cxxx.c
---- a/drivers/ide/pci/via82cxxx.c	2005-06-06 11:22:29.000000000 -0400
-+++ b/drivers/ide/pci/via82cxxx.c	2005-06-15 22:01:23.000000000 -0400
-@@ -415,7 +415,7 @@
-  *	and initialize its drive independent registers.
-  */
- 
--static unsigned int __init init_chipset_via82cxxx(struct pci_dev *dev, const char *name)
-+static unsigned int __devinit init_chipset_via82cxxx(struct pci_dev *dev, const char *name)
- {
- 	struct pci_dev *isa = NULL;
- 	u8 t, v;
-@@ -576,7 +576,7 @@
- 	return 0;
- }
- 
--static void __init init_hwif_via82cxxx(ide_hwif_t *hwif)
-+static void __devinit init_hwif_via82cxxx(ide_hwif_t *hwif)
- {
- 	int i;
- 

Added: people/waldi/kernel/linux-2.6/debian/patches-debian/drivers-s390-net-klist.patch
===================================================================
(Binary files differ)


Property changes on: people/waldi/kernel/linux-2.6/debian/patches-debian/drivers-s390-net-klist.patch
___________________________________________________________________
Name: svn:mime-type
   + message/rfc822

Modified: people/waldi/kernel/linux-2.6/debian/patches-debian/drivers-scsi-megaraid_splitup.patch
===================================================================
--- people/waldi/kernel/linux-2.6/debian/patches-debian/drivers-scsi-megaraid_splitup.patch	2005-08-21 15:17:11 UTC (rev 4001)
+++ people/waldi/kernel/linux-2.6/debian/patches-debian/drivers-scsi-megaraid_splitup.patch	2005-08-21 15:28:27 UTC (rev 4002)
@@ -48,7 +48,7 @@
  {
  	struct Scsi_Host *host;
  	adapter_t *adapter;
-@@ -5033,37 +5033,25 @@
+@@ -5033,35 +5033,23 @@
  }
  
  static struct pci_device_id megaraid_pci_tbl[] = {
@@ -79,9 +79,7 @@
 -	.probe		= megaraid_probe_one,
 +	.probe		= megaraid_legacy_probe_one,
  	.remove		= __devexit_p(megaraid_remove_one),
- 	.driver		= {
- 		.shutdown = megaraid_shutdown,
- 	},
+ 	.shutdown	= megaraid_shutdown,
  };
  
 -static int __init megaraid_init(void)

Deleted: people/waldi/kernel/linux-2.6/debian/patches-debian/ia64-generic-nosmp.patch
===================================================================
--- people/waldi/kernel/linux-2.6/debian/patches-debian/ia64-generic-nosmp.patch	2005-08-21 15:17:11 UTC (rev 4001)
+++ people/waldi/kernel/linux-2.6/debian/patches-debian/ia64-generic-nosmp.patch	2005-08-21 15:28:27 UTC (rev 4002)
@@ -1,306 +0,0 @@
-#! /bin/sh -e
-## DP: Description: Fix ia64 generic UP builds
-## DP: Patch author: Jesse Barnes <jbarnes at engr.sgi.com>, dann frazier <dannf at debian.org>
-## DP: Upstream status: Submitted
-
-. $(dirname $0)/DPATCH
-
- at DPATCH@
-
-diff -urN linux-2.6.12.orig/arch/ia64/kernel/Makefile linux-2.6.12/arch/ia64/kernel/Makefile
---- linux-2.6.12.orig/arch/ia64/kernel/Makefile	2005-06-17 13:48:29.000000000 -0600
-+++ linux-2.6.12/arch/ia64/kernel/Makefile	2005-06-18 22:14:35.000000000 -0600
-@@ -17,6 +17,7 @@
- obj-$(CONFIG_IOSAPIC)		+= iosapic.o
- obj-$(CONFIG_MODULES)		+= module.o
- obj-$(CONFIG_SMP)		+= smp.o smpboot.o domain.o
-+obj-$(CONFIG_NUMA)		+= numa.o
- obj-$(CONFIG_PERFMON)		+= perfmon_default_smpl.o
- obj-$(CONFIG_IA64_CYCLONE)	+= cyclone.o
- obj-$(CONFIG_IA64_MCA_RECOVERY)	+= mca_recovery.o
-diff -urN linux-2.6.12.orig/arch/ia64/kernel/acpi.c linux-2.6.12/arch/ia64/kernel/acpi.c
---- linux-2.6.12.orig/arch/ia64/kernel/acpi.c	2005-06-17 13:48:29.000000000 -0600
-+++ linux-2.6.12/arch/ia64/kernel/acpi.c	2005-06-18 22:14:35.000000000 -0600
-@@ -642,9 +642,11 @@
- 			if (smp_boot_data.cpu_phys_id[cpu] != hard_smp_processor_id())
- 				node_cpuid[i++].phys_id = smp_boot_data.cpu_phys_id[cpu];
- 	}
--	build_cpu_to_node_map();
- # endif
- #endif
-+#ifdef CONFIG_ACPI_NUMA
-+	build_cpu_to_node_map();
-+#endif
- 	/* Make boot-up look pretty */
- 	printk(KERN_INFO "%d CPUs available, %d CPUs total\n", available_cpus, total_cpus);
- 	return 0;
-diff -urN linux-2.6.12.orig/arch/ia64/kernel/numa.c linux-2.6.12/arch/ia64/kernel/numa.c
---- linux-2.6.12.orig/arch/ia64/kernel/numa.c	1969-12-31 17:00:00.000000000 -0700
-+++ linux-2.6.12/arch/ia64/kernel/numa.c	2005-06-18 22:14:35.000000000 -0600
-@@ -0,0 +1,57 @@
-+/*
-+ * This program is free software; you can redistribute it and/or modify
-+ * it under the terms of the GNU General Public License as published by
-+ * the Free Software Foundation; either version 2 of the License, or
-+ * (at your option) any later version.
-+ *
-+ * This program is distributed in the hope that it will be useful,
-+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
-+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
-+ * GNU General Public License for more details.
-+ *
-+ * You should have received a copy of the GNU General Public License
-+ * along with this program; if not, write to the Free Software
-+ * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
-+ *
-+ * ia64 kernel NUMA specific stuff
-+ *
-+ * Copyright (C) 2002 Erich Focht <efocht at ess.nec.de>
-+ * Copyright (C) 2004 Silicon Graphics, Inc.
-+ *   Jesse Barnes <jbarnes at sgi.com>
-+ */
-+#include <linux/config.h>
-+#include <linux/topology.h>
-+#include <linux/module.h>
-+#include <asm/processor.h>
-+#include <asm/smp.h>
-+
-+u8 cpu_to_node_map[NR_CPUS] __cacheline_aligned;
-+EXPORT_SYMBOL(cpu_to_node_map);
-+
-+cpumask_t node_to_cpu_mask[MAX_NUMNODES] __cacheline_aligned;
-+
-+/**
-+ * build_cpu_to_node_map - setup cpu to node and node to cpumask arrays
-+ *
-+ * Build cpu to node mapping and initialize the per node cpu masks using
-+ * info from the node_cpuid array handed to us by ACPI.
-+ */
-+void __init build_cpu_to_node_map(void)
-+{
-+	int cpu, i, node;
-+
-+	for(node=0; node < MAX_NUMNODES; node++)
-+		cpus_clear(node_to_cpu_mask[node]);
-+
-+	for(cpu = 0; cpu < NR_CPUS; ++cpu) {
-+		node = -1;
-+		for (i = 0; i < NR_CPUS; ++i)
-+			if (cpu_physical_id(cpu) == node_cpuid[i].phys_id) {
-+				node = node_cpuid[i].nid;
-+				break;
-+			}
-+		cpu_to_node_map[cpu] = (node >= 0) ? node : 0;
-+		if (node >= 0)
-+			cpu_set(cpu, node_to_cpu_mask[node]);
-+	}
-+}
-diff -urN linux-2.6.12.orig/arch/ia64/kernel/smpboot.c linux-2.6.12/arch/ia64/kernel/smpboot.c
---- linux-2.6.12.orig/arch/ia64/kernel/smpboot.c	2005-06-17 13:48:29.000000000 -0600
-+++ linux-2.6.12/arch/ia64/kernel/smpboot.c	2005-06-18 22:14:35.000000000 -0600
-@@ -524,47 +524,6 @@
- 	}
- }
- 
--#ifdef CONFIG_NUMA
--
--/* on which node is each logical CPU (one cacheline even for 64 CPUs) */
--u8 cpu_to_node_map[NR_CPUS] __cacheline_aligned;
--EXPORT_SYMBOL(cpu_to_node_map);
--/* which logical CPUs are on which nodes */
--cpumask_t node_to_cpu_mask[MAX_NUMNODES] __cacheline_aligned;
--
--/*
-- * Build cpu to node mapping and initialize the per node cpu masks.
-- */
--void __init
--build_cpu_to_node_map (void)
--{
--	int cpu, i, node;
--
--	for(node=0; node<MAX_NUMNODES; node++)
--		cpus_clear(node_to_cpu_mask[node]);
--	for(cpu = 0; cpu < NR_CPUS; ++cpu) {
--		/*
--		 * All Itanium NUMA platforms I know use ACPI, so maybe we
--		 * can drop this ifdef completely.                    [EF]
--		 */
--#ifdef CONFIG_ACPI_NUMA
--		node = -1;
--		for (i = 0; i < NR_CPUS; ++i)
--			if (cpu_physical_id(cpu) == node_cpuid[i].phys_id) {
--				node = node_cpuid[i].nid;
--				break;
--			}
--#else
--#		error Fixme: Dunno how to build CPU-to-node map.
--#endif
--		cpu_to_node_map[cpu] = (node >= 0) ? node : 0;
--		if (node >= 0)
--			cpu_set(cpu, node_to_cpu_mask[node]);
--	}
--}
--
--#endif /* CONFIG_NUMA */
--
- /*
-  * Cycle through the APs sending Wakeup IPIs to boot each.
-  */
-diff -urN linux-2.6.12.orig/arch/ia64/mm/discontig.c linux-2.6.12/arch/ia64/mm/discontig.c
---- linux-2.6.12.orig/arch/ia64/mm/discontig.c	2005-06-17 13:48:29.000000000 -0600
-+++ linux-2.6.12/arch/ia64/mm/discontig.c	2005-06-18 22:14:35.000000000 -0600
-@@ -274,6 +274,33 @@
- }
- 
- /**
-+ * per_cpu_node_setup - setup per-cpu areas on each node
-+ * @cpu_data: per-cpu area on this node
-+ * @node: node to setup
-+ *
-+ * Copy the static per-cpu data into the region we just set aside and then
-+ * setup __per_cpu_offset for each CPU on this node.  Return a pointer to
-+ * the end of the area.
-+ */
-+static void *per_cpu_node_setup(void *cpu_data, int node)
-+{
-+#ifdef CONFIG_SMP
-+	int cpu;
-+
-+	for (cpu = 0; cpu < NR_CPUS; cpu++) {
-+		if (node == node_cpuid[cpu].nid) {
-+			memcpy(__va(cpu_data), __phys_per_cpu_start,
-+			       __per_cpu_end - __per_cpu_start);
-+			__per_cpu_offset[cpu] = (char*)__va(cpu_data) -
-+				__per_cpu_start;
-+			cpu_data += PERCPU_PAGE_SIZE;
-+		}
-+	}
-+#endif
-+	return cpu_data;
-+}
-+
-+/**
-  * find_pernode_space - allocate memory for memory map and per-node structures
-  * @start: physical start of range
-  * @len: length of range
-@@ -304,7 +331,7 @@
- static int __init find_pernode_space(unsigned long start, unsigned long len,
- 				     int node)
- {
--	unsigned long epfn, cpu, cpus, phys_cpus;
-+	unsigned long epfn, cpus, phys_cpus;
- 	unsigned long pernodesize = 0, pernode, pages, mapsize;
- 	void *cpu_data;
- 	struct bootmem_data *bdp = &mem_data[node].bootmem_data;
-@@ -357,20 +384,7 @@
- 		mem_data[node].pgdat->bdata = bdp;
- 		pernode += L1_CACHE_ALIGN(sizeof(pg_data_t));
- 
--		/*
--		 * Copy the static per-cpu data into the region we
--		 * just set aside and then setup __per_cpu_offset
--		 * for each CPU on this node.
--		 */
--		for (cpu = 0; cpu < NR_CPUS; cpu++) {
--			if (node == node_cpuid[cpu].nid) {
--				memcpy(__va(cpu_data), __phys_per_cpu_start,
--				       __per_cpu_end - __per_cpu_start);
--				__per_cpu_offset[cpu] = (char*)__va(cpu_data) -
--					__per_cpu_start;
--				cpu_data += PERCPU_PAGE_SIZE;
--			}
--		}
-+		cpu_data = per_cpu_node_setup(cpu_data, node);
- 	}
- 
- 	return 0;
-@@ -436,8 +450,8 @@
-  */
- static void __init initialize_pernode_data(void)
- {
--	int cpu, node;
- 	pg_data_t *pgdat_list[MAX_NUMNODES];
-+	int cpu, node;
- 
- 	for_each_online_node(node)
- 		pgdat_list[node] = mem_data[node].pgdat;
-@@ -447,12 +461,22 @@
- 		memcpy(mem_data[node].node_data->pg_data_ptrs, pgdat_list,
- 		       sizeof(pgdat_list));
- 	}
--
-+#ifdef CONFIG_SMP
- 	/* Set the node_data pointer for each per-cpu struct */
- 	for (cpu = 0; cpu < NR_CPUS; cpu++) {
- 		node = node_cpuid[cpu].nid;
- 		per_cpu(cpu_info, cpu).node_data = mem_data[node].node_data;
- 	}
-+#else
-+	{
-+		struct cpuinfo_ia64 *cpu0_cpu_info;
-+		cpu = 0;
-+		node = node_cpuid[cpu].nid;
-+		cpu0_cpu_info = (struct cpuinfo_ia64 *)(__phys_per_cpu_start +
-+			((char *)&per_cpu__cpu_info - __per_cpu_start));
-+		cpu0_cpu_info->node_data = mem_data[node].node_data;
-+	}
-+#endif /* CONFIG_SMP */
- }
- 
- /**
-@@ -519,6 +543,7 @@
- 	find_initrd();
- }
- 
-+#ifdef CONFIG_SMP
- /**
-  * per_cpu_init - setup per-cpu variables
-  *
-@@ -529,15 +554,15 @@
- {
- 	int cpu;
- 
--	if (smp_processor_id() == 0) {
--		for (cpu = 0; cpu < NR_CPUS; cpu++) {
--			per_cpu(local_per_cpu_offset, cpu) =
--				__per_cpu_offset[cpu];
--		}
--	}
-+	if (smp_processor_id() != 0)
-+		return __per_cpu_start + __per_cpu_offset[smp_processor_id()];
-+
-+	for (cpu = 0; cpu < NR_CPUS; cpu++)
-+		per_cpu(local_per_cpu_offset, cpu) = __per_cpu_offset[cpu];
- 
- 	return __per_cpu_start + __per_cpu_offset[smp_processor_id()];
- }
-+#endif /* CONFIG_SMP */
- 
- /**
-  * show_mem - give short summary of memory stats
-diff -urN linux-2.6.12.orig/include/asm-ia64/sn/arch.h linux-2.6.12/include/asm-ia64/sn/arch.h
---- linux-2.6.12.orig/include/asm-ia64/sn/arch.h	2005-06-17 13:48:29.000000000 -0600
-+++ linux-2.6.12/include/asm-ia64/sn/arch.h	2005-06-18 22:15:39.000000000 -0600
-@@ -11,6 +11,7 @@
- #ifndef _ASM_IA64_SN_ARCH_H
- #define _ASM_IA64_SN_ARCH_H
- 
-+#include <linux/numa.h>
- #include <asm/types.h>
- #include <asm/percpu.h>
- #include <asm/sn/types.h>
-diff -urN linux-2.6.12.orig/include/asm-ia64/sn/sn_cpuid.h linux-2.6.12/include/asm-ia64/sn/sn_cpuid.h
---- linux-2.6.12.orig/include/asm-ia64/sn/sn_cpuid.h	2005-06-17 13:48:29.000000000 -0600
-+++ linux-2.6.12/include/asm-ia64/sn/sn_cpuid.h	2005-06-18 22:14:35.000000000 -0600
-@@ -81,11 +81,6 @@
-  *
-  */
- 
--#ifndef CONFIG_SMP
--#define cpu_physical_id(cpuid)			((ia64_getreg(_IA64_REG_CR_LID) >> 16) & 0xffff)
--#endif
--
--
- #define get_node_number(addr)			NASID_GET(addr)
- 
- /*

Modified: people/waldi/kernel/linux-2.6/debian/patches-debian/modular-ide-pnp.patch
===================================================================
--- people/waldi/kernel/linux-2.6/debian/patches-debian/modular-ide-pnp.patch	2005-08-21 15:17:11 UTC (rev 4001)
+++ people/waldi/kernel/linux-2.6/debian/patches-debian/modular-ide-pnp.patch	2005-08-21 15:28:27 UTC (rev 4002)
@@ -18,9 +18,8 @@
 diff -aurN a/drivers/ide/Makefile b/drivers/ide/Makefile
 --- a/drivers/ide/Makefile	2005-06-06 11:22:29.000000000 -0400
 +++ b/drivers/ide/Makefile	2005-06-15 22:15:06.000000000 -0400
-@@ -22,7 +22,6 @@
+@@ -23,6 +23,5 @@
  ide-core-$(CONFIG_BLK_DEV_IDEDMA)	+= ide-dma.o
- ide-core-$(CONFIG_BLK_DEV_IDE_TCQ)	+= ide-tcq.o
  ide-core-$(CONFIG_PROC_FS)		+= ide-proc.o
 -ide-core-$(CONFIG_BLK_DEV_IDEPNP)	+= ide-pnp.o
  

Deleted: people/waldi/kernel/linux-2.6/debian/patches-debian/patch-2.6.12.1
===================================================================
--- people/waldi/kernel/linux-2.6/debian/patches-debian/patch-2.6.12.1	2005-08-21 15:17:11 UTC (rev 4001)
+++ people/waldi/kernel/linux-2.6/debian/patches-debian/patch-2.6.12.1	2005-08-21 15:28:27 UTC (rev 4002)
@@ -1,93 +0,0 @@
-diff --git a/arch/ia64/kernel/ptrace.c b/arch/ia64/kernel/ptrace.c
---- a/arch/ia64/kernel/ptrace.c
-+++ b/arch/ia64/kernel/ptrace.c
-@@ -945,6 +945,13 @@ access_uarea (struct task_struct *child,
- 				*data = (pt->cr_ipsr & IPSR_MASK);
- 			return 0;
- 
-+		      case PT_AR_RSC:
-+			if (write_access)
-+				pt->ar_rsc = *data | (3 << 2); /* force PL3 */
-+			else
-+				*data = pt->ar_rsc;
-+			return 0;
-+
- 		      case PT_AR_RNAT:
- 			urbs_end = ia64_get_user_rbs_end(child, pt, NULL);
- 			rnat_addr = (long) ia64_rse_rnat_addr((long *)
-@@ -996,9 +1003,6 @@ access_uarea (struct task_struct *child,
- 		      case PT_AR_BSPSTORE:
- 			ptr = pt_reg_addr(pt, ar_bspstore);
- 			break;
--		      case PT_AR_RSC:
--			ptr = pt_reg_addr(pt, ar_rsc);
--			break;
- 		      case PT_AR_UNAT:
- 			ptr = pt_reg_addr(pt, ar_unat);
- 			break;
-@@ -1234,7 +1238,7 @@ ptrace_getregs (struct task_struct *chil
- static long
- ptrace_setregs (struct task_struct *child, struct pt_all_user_regs __user *ppr)
- {
--	unsigned long psr, ec, lc, rnat, bsp, cfm, nat_bits, val = 0;
-+	unsigned long psr, rsc, ec, lc, rnat, bsp, cfm, nat_bits, val = 0;
- 	struct unw_frame_info info;
- 	struct switch_stack *sw;
- 	struct ia64_fpreg fpval;
-@@ -1267,7 +1271,7 @@ ptrace_setregs (struct task_struct *chil
- 	/* app regs */
- 
- 	retval |= __get_user(pt->ar_pfs, &ppr->ar[PT_AUR_PFS]);
--	retval |= __get_user(pt->ar_rsc, &ppr->ar[PT_AUR_RSC]);
-+	retval |= __get_user(rsc, &ppr->ar[PT_AUR_RSC]);
- 	retval |= __get_user(pt->ar_bspstore, &ppr->ar[PT_AUR_BSPSTORE]);
- 	retval |= __get_user(pt->ar_unat, &ppr->ar[PT_AUR_UNAT]);
- 	retval |= __get_user(pt->ar_ccv, &ppr->ar[PT_AUR_CCV]);
-@@ -1365,6 +1369,7 @@ ptrace_setregs (struct task_struct *chil
- 	retval |= __get_user(nat_bits, &ppr->nat);
- 
- 	retval |= access_uarea(child, PT_CR_IPSR, &psr, 1);
-+	retval |= access_uarea(child, PT_AR_RSC, &rsc, 1);
- 	retval |= access_uarea(child, PT_AR_EC, &ec, 1);
- 	retval |= access_uarea(child, PT_AR_LC, &lc, 1);
- 	retval |= access_uarea(child, PT_AR_RNAT, &rnat, 1);
-diff --git a/arch/ia64/kernel/signal.c b/arch/ia64/kernel/signal.c
---- a/arch/ia64/kernel/signal.c
-+++ b/arch/ia64/kernel/signal.c
-@@ -94,7 +94,7 @@ sys_sigaltstack (const stack_t __user *u
- static long
- restore_sigcontext (struct sigcontext __user *sc, struct sigscratch *scr)
- {
--	unsigned long ip, flags, nat, um, cfm;
-+	unsigned long ip, flags, nat, um, cfm, rsc;
- 	long err;
- 
- 	/* Always make any pending restarted system calls return -EINTR */
-@@ -106,7 +106,7 @@ restore_sigcontext (struct sigcontext __
- 	err |= __get_user(ip, &sc->sc_ip);			/* instruction pointer */
- 	err |= __get_user(cfm, &sc->sc_cfm);
- 	err |= __get_user(um, &sc->sc_um);			/* user mask */
--	err |= __get_user(scr->pt.ar_rsc, &sc->sc_ar_rsc);
-+	err |= __get_user(rsc, &sc->sc_ar_rsc);
- 	err |= __get_user(scr->pt.ar_unat, &sc->sc_ar_unat);
- 	err |= __get_user(scr->pt.ar_fpsr, &sc->sc_ar_fpsr);
- 	err |= __get_user(scr->pt.ar_pfs, &sc->sc_ar_pfs);
-@@ -119,6 +119,7 @@ restore_sigcontext (struct sigcontext __
- 	err |= __copy_from_user(&scr->pt.r15, &sc->sc_gr[15], 8);	/* r15 */
- 
- 	scr->pt.cr_ifs = cfm | (1UL << 63);
-+	scr->pt.ar_rsc = rsc | (3 << 2); /* force PL3 */
- 
- 	/* establish new instruction pointer: */
- 	scr->pt.cr_iip = ip & ~0x3UL;
-diff --git a/fs/exec.c b/fs/exec.c
---- a/fs/exec.c
-+++ b/fs/exec.c
-@@ -649,6 +649,7 @@ static inline int de_thread(struct task_
- 	}
- 	sig->group_exit_task = NULL;
- 	sig->notify_count = 0;
-+	sig->real_timer.data = (unsigned long)current;
- 	spin_unlock_irq(lock);
- 
- 	/*

Deleted: people/waldi/kernel/linux-2.6/debian/patches-debian/patch-2.6.12.2
===================================================================
--- people/waldi/kernel/linux-2.6/debian/patches-debian/patch-2.6.12.2	2005-08-21 15:17:11 UTC (rev 4001)
+++ people/waldi/kernel/linux-2.6/debian/patches-debian/patch-2.6.12.2	2005-08-21 15:28:27 UTC (rev 4002)
@@ -1,172 +0,0 @@
-diff --git a/drivers/acpi/pci_irq.c b/drivers/acpi/pci_irq.c
---- a/drivers/acpi/pci_irq.c
-+++ b/drivers/acpi/pci_irq.c
-@@ -435,6 +435,7 @@ acpi_pci_irq_enable (
- 		/* Interrupt Line values above 0xF are forbidden */
- 		if (dev->irq >= 0 && (dev->irq <= 0xF)) {
- 			printk(" - using IRQ %d\n", dev->irq);
-+			acpi_register_gsi(dev->irq, ACPI_LEVEL_SENSITIVE, ACPI_ACTIVE_LOW);
- 			return_VALUE(0);
- 		}
- 		else {
-diff --git a/drivers/net/e1000/e1000_main.c b/drivers/net/e1000/e1000_main.c
---- a/drivers/net/e1000/e1000_main.c
-+++ b/drivers/net/e1000/e1000_main.c
-@@ -2307,6 +2307,7 @@ e1000_xmit_frame(struct sk_buff *skb, st
- 	tso = e1000_tso(adapter, skb);
- 	if (tso < 0) {
- 		dev_kfree_skb_any(skb);
-+		spin_unlock_irqrestore(&adapter->tx_lock, flags);
- 		return NETDEV_TX_OK;
- 	}
- 
-diff --git a/drivers/pci/pci-driver.c b/drivers/pci/pci-driver.c
---- a/drivers/pci/pci-driver.c
-+++ b/drivers/pci/pci-driver.c
-@@ -396,7 +396,7 @@ int pci_register_driver(struct pci_drive
- 	/* FIXME, once all of the existing PCI drivers have been fixed to set
- 	 * the pci shutdown function, this test can go away. */
- 	if (!drv->driver.shutdown)
--		drv->driver.shutdown = pci_device_shutdown,
-+		drv->driver.shutdown = pci_device_shutdown;
- 	drv->driver.owner = drv->owner;
- 	drv->driver.kobj.ktype = &pci_driver_kobj_type;
- 	pci_init_dynids(&drv->dynids);
-diff --git a/include/asm-i386/string.h b/include/asm-i386/string.h
---- a/include/asm-i386/string.h
-+++ b/include/asm-i386/string.h
-@@ -116,7 +116,8 @@ __asm__ __volatile__(
- 	"orb $1,%%al\n"
- 	"3:"
- 	:"=a" (__res), "=&S" (d0), "=&D" (d1)
--		     :"1" (cs),"2" (ct));
-+	:"1" (cs),"2" (ct)
-+	:"memory");
- return __res;
- }
- 
-@@ -138,8 +139,9 @@ __asm__ __volatile__(
- 	"3:\tsbbl %%eax,%%eax\n\t"
- 	"orb $1,%%al\n"
- 	"4:"
--		     :"=a" (__res), "=&S" (d0), "=&D" (d1), "=&c" (d2)
--		     :"1" (cs),"2" (ct),"3" (count));
-+	:"=a" (__res), "=&S" (d0), "=&D" (d1), "=&c" (d2)
-+	:"1" (cs),"2" (ct),"3" (count)
-+	:"memory");
- return __res;
- }
- 
-@@ -158,7 +160,9 @@ __asm__ __volatile__(
- 	"movl $1,%1\n"
- 	"2:\tmovl %1,%0\n\t"
- 	"decl %0"
--	:"=a" (__res), "=&S" (d0) : "1" (s),"0" (c));
-+	:"=a" (__res), "=&S" (d0)
-+	:"1" (s),"0" (c)
-+	:"memory");
- return __res;
- }
- 
-@@ -175,7 +179,9 @@ __asm__ __volatile__(
- 	"leal -1(%%esi),%0\n"
- 	"2:\ttestb %%al,%%al\n\t"
- 	"jne 1b"
--	:"=g" (__res), "=&S" (d0), "=&a" (d1) :"0" (0),"1" (s),"2" (c));
-+	:"=g" (__res), "=&S" (d0), "=&a" (d1)
-+	:"0" (0),"1" (s),"2" (c)
-+	:"memory");
- return __res;
- }
- 
-@@ -189,7 +195,9 @@ __asm__ __volatile__(
- 	"scasb\n\t"
- 	"notl %0\n\t"
- 	"decl %0"
--	:"=c" (__res), "=&D" (d0) :"1" (s),"a" (0), "0" (0xffffffffu));
-+	:"=c" (__res), "=&D" (d0)
-+	:"1" (s),"a" (0), "0" (0xffffffffu)
-+	:"memory");
- return __res;
- }
- 
-@@ -333,7 +341,9 @@ __asm__ __volatile__(
- 	"je 1f\n\t"
- 	"movl $1,%0\n"
- 	"1:\tdecl %0"
--	:"=D" (__res), "=&c" (d0) : "a" (c),"0" (cs),"1" (count));
-+	:"=D" (__res), "=&c" (d0)
-+	:"a" (c),"0" (cs),"1" (count)
-+	:"memory");
- return __res;
- }
- 
-@@ -369,7 +379,7 @@ __asm__ __volatile__(
- 	"je 2f\n\t"
- 	"stosb\n"
- 	"2:"
--	: "=&c" (d0), "=&D" (d1)
-+	:"=&c" (d0), "=&D" (d1)
- 	:"a" (c), "q" (count), "0" (count/4), "1" ((long) s)
- 	:"memory");
- return (s);	
-@@ -392,7 +402,8 @@ __asm__ __volatile__(
- 	"jne 1b\n"
- 	"3:\tsubl %2,%0"
- 	:"=a" (__res), "=&d" (d0)
--	:"c" (s),"1" (count));
-+	:"c" (s),"1" (count)
-+	:"memory");
- return __res;
- }
- /* end of additional stuff */
-@@ -473,7 +484,8 @@ static inline void * memscan(void * addr
- 		"dec %%edi\n"
- 		"1:"
- 		: "=D" (addr), "=c" (size)
--		: "0" (addr), "1" (size), "a" (c));
-+		: "0" (addr), "1" (size), "a" (c)
-+		: "memory");
- 	return addr;
- }
- 
-diff --git a/mm/memory.c b/mm/memory.c
---- a/mm/memory.c
-+++ b/mm/memory.c
-@@ -1164,7 +1164,7 @@ int remap_pfn_range(struct vm_area_struc
- {
- 	pgd_t *pgd;
- 	unsigned long next;
--	unsigned long end = addr + size;
-+	unsigned long end = addr + PAGE_ALIGN(size);
- 	struct mm_struct *mm = vma->vm_mm;
- 	int err;
- 
-diff --git a/net/netlink/af_netlink.c b/net/netlink/af_netlink.c
---- a/net/netlink/af_netlink.c
-+++ b/net/netlink/af_netlink.c
-@@ -315,8 +315,8 @@ err:
- static void netlink_remove(struct sock *sk)
- {
- 	netlink_table_grab();
--	nl_table[sk->sk_protocol].hash.entries--;
--	sk_del_node_init(sk);
-+	if (sk_del_node_init(sk))
-+		nl_table[sk->sk_protocol].hash.entries--;
- 	if (nlk_sk(sk)->groups)
- 		__sk_del_bind_node(sk);
- 	netlink_table_ungrab();
-@@ -429,7 +429,12 @@ retry:
- 	err = netlink_insert(sk, pid);
- 	if (err == -EADDRINUSE)
- 		goto retry;
--	return 0;
-+
-+	/* If 2 threads race to autobind, that is fine.  */
-+	if (err == -EBUSY)
-+		err = 0;
-+
-+	return err;
- }
- 
- static inline int netlink_capable(struct socket *sock, unsigned int flag) 

Deleted: people/waldi/kernel/linux-2.6/debian/patches-debian/patch-2.6.12.3
===================================================================
--- people/waldi/kernel/linux-2.6/debian/patches-debian/patch-2.6.12.3	2005-08-21 15:17:11 UTC (rev 4001)
+++ people/waldi/kernel/linux-2.6/debian/patches-debian/patch-2.6.12.3	2005-08-21 15:28:27 UTC (rev 4002)
@@ -1,640 +0,0 @@
-diff --git a/arch/ppc/kernel/time.c b/arch/ppc/kernel/time.c
---- a/arch/ppc/kernel/time.c
-+++ b/arch/ppc/kernel/time.c
-@@ -89,6 +89,9 @@ unsigned long tb_to_ns_scale;
- 
- extern unsigned long wall_jiffies;
- 
-+/* used for timezone offset */
-+static long timezone_offset;
-+
- DEFINE_SPINLOCK(rtc_lock);
- 
- EXPORT_SYMBOL(rtc_lock);
-@@ -170,7 +173,7 @@ void timer_interrupt(struct pt_regs * re
- 		     xtime.tv_sec - last_rtc_update >= 659 &&
- 		     abs((xtime.tv_nsec / 1000) - (1000000-1000000/HZ)) < 500000/HZ &&
- 		     jiffies - wall_jiffies == 1) {
--		  	if (ppc_md.set_rtc_time(xtime.tv_sec+1 + time_offset) == 0)
-+		  	if (ppc_md.set_rtc_time(xtime.tv_sec+1 + timezone_offset) == 0)
- 				last_rtc_update = xtime.tv_sec+1;
- 			else
- 				/* Try again one minute later */
-@@ -286,7 +289,7 @@ void __init time_init(void)
- 	unsigned old_stamp, stamp, elapsed;
- 
-         if (ppc_md.time_init != NULL)
--                time_offset = ppc_md.time_init();
-+                timezone_offset = ppc_md.time_init();
- 
- 	if (__USE_RTC()) {
- 		/* 601 processor: dec counts down by 128 every 128ns */
-@@ -331,10 +334,10 @@ void __init time_init(void)
- 	set_dec(tb_ticks_per_jiffy);
- 
- 	/* If platform provided a timezone (pmac), we correct the time */
--        if (time_offset) {
--		sys_tz.tz_minuteswest = -time_offset / 60;
-+        if (timezone_offset) {
-+		sys_tz.tz_minuteswest = -timezone_offset / 60;
- 		sys_tz.tz_dsttime = 0;
--		xtime.tv_sec -= time_offset;
-+		xtime.tv_sec -= timezone_offset;
-         }
-         set_normalized_timespec(&wall_to_monotonic,
-                                 -xtime.tv_sec, -xtime.tv_nsec);
-diff --git a/arch/um/kernel/process.c b/arch/um/kernel/process.c
---- a/arch/um/kernel/process.c
-+++ b/arch/um/kernel/process.c
-@@ -130,7 +130,7 @@ int start_fork_tramp(void *thread_arg, u
- 	return(arg.pid);
- }
- 
--static int ptrace_child(void)
-+static int ptrace_child(void *arg)
- {
- 	int ret;
- 	int pid = os_getpid(), ppid = getppid();
-@@ -159,16 +159,20 @@ static int ptrace_child(void)
- 	_exit(ret);
- }
- 
--static int start_ptraced_child(void)
-+static int start_ptraced_child(void **stack_out)
- {
-+	void *stack;
-+	unsigned long sp;
- 	int pid, n, status;
- 	
--	pid = fork();
--	if(pid == 0)
--		ptrace_child();
--
-+	stack = mmap(NULL, PAGE_SIZE, PROT_READ | PROT_WRITE | PROT_EXEC,
-+		     MAP_PRIVATE | MAP_ANONYMOUS, -1, 0);
-+	if(stack == MAP_FAILED)
-+		panic("check_ptrace : mmap failed, errno = %d", errno);
-+	sp = (unsigned long) stack + PAGE_SIZE - sizeof(void *);
-+	pid = clone(ptrace_child, (void *) sp, SIGCHLD, NULL);
- 	if(pid < 0)
--		panic("check_ptrace : fork failed, errno = %d", errno);
-+		panic("check_ptrace : clone failed, errno = %d", errno);
- 	CATCH_EINTR(n = waitpid(pid, &status, WUNTRACED));
- 	if(n < 0)
- 		panic("check_ptrace : wait failed, errno = %d", errno);
-@@ -176,6 +180,7 @@ static int start_ptraced_child(void)
- 		panic("check_ptrace : expected SIGSTOP, got status = %d",
- 		      status);
- 
-+	*stack_out = stack;
- 	return(pid);
- }
- 
-@@ -183,12 +188,12 @@ static int start_ptraced_child(void)
-  * just avoid using sysemu, not panic, but only if SYSEMU features are broken.
-  * So only for SYSEMU features we test mustpanic, while normal host features
-  * must work anyway!*/
--static int stop_ptraced_child(int pid, int exitcode, int mustexit)
-+static int stop_ptraced_child(int pid, void *stack, int exitcode, int mustpanic)
- {
- 	int status, n, ret = 0;
- 
- 	if(ptrace(PTRACE_CONT, pid, 0, 0) < 0)
--		panic("stop_ptraced_child : ptrace failed, errno = %d", errno);
-+		panic("check_ptrace : ptrace failed, errno = %d", errno);
- 	CATCH_EINTR(n = waitpid(pid, &status, 0));
- 	if(!WIFEXITED(status) || (WEXITSTATUS(status) != exitcode)) {
- 		int exit_with = WEXITSTATUS(status);
-@@ -199,13 +204,15 @@ static int stop_ptraced_child(int pid, i
- 		printk("check_ptrace : child exited with exitcode %d, while "
- 		      "expecting %d; status 0x%x", exit_with,
- 		      exitcode, status);
--		if (mustexit)
-+		if (mustpanic)
- 			panic("\n");
- 		else
- 			printk("\n");
- 		ret = -1;
- 	}
- 
-+	if(munmap(stack, PAGE_SIZE) < 0)
-+		panic("check_ptrace : munmap failed, errno = %d", errno);
- 	return ret;
- }
- 
-@@ -227,11 +234,12 @@ __uml_setup("nosysemu", nosysemu_cmd_par
- 
- static void __init check_sysemu(void)
- {
-+	void *stack;
- 	int pid, syscall, n, status, count=0;
- 
- 	printk("Checking syscall emulation patch for ptrace...");
- 	sysemu_supported = 0;
--	pid = start_ptraced_child();
-+	pid = start_ptraced_child(&stack);
- 
- 	if(ptrace(PTRACE_SYSEMU, pid, 0, 0) < 0)
- 		goto fail;
-@@ -249,7 +257,7 @@ static void __init check_sysemu(void)
- 		panic("check_sysemu : failed to modify system "
- 		      "call return, errno = %d", errno);
- 
--	if (stop_ptraced_child(pid, 0, 0) < 0)
-+	if (stop_ptraced_child(pid, stack, 0, 0) < 0)
- 		goto fail_stopped;
- 
- 	sysemu_supported = 1;
-@@ -257,7 +265,7 @@ static void __init check_sysemu(void)
- 	set_using_sysemu(!force_sysemu_disabled);
- 
- 	printk("Checking advanced syscall emulation patch for ptrace...");
--	pid = start_ptraced_child();
-+	pid = start_ptraced_child(&stack);
- 	while(1){
- 		count++;
- 		if(ptrace(PTRACE_SYSEMU_SINGLESTEP, pid, 0, 0) < 0)
-@@ -282,7 +290,7 @@ static void __init check_sysemu(void)
- 			break;
- 		}
- 	}
--	if (stop_ptraced_child(pid, 0, 0) < 0)
-+	if (stop_ptraced_child(pid, stack, 0, 0) < 0)
- 		goto fail_stopped;
- 
- 	sysemu_supported = 2;
-@@ -293,17 +301,18 @@ static void __init check_sysemu(void)
- 	return;
- 
- fail:
--	stop_ptraced_child(pid, 1, 0);
-+	stop_ptraced_child(pid, stack, 1, 0);
- fail_stopped:
- 	printk("missing\n");
- }
- 
- void __init check_ptrace(void)
- {
-+	void *stack;
- 	int pid, syscall, n, status;
- 
- 	printk("Checking that ptrace can change system call numbers...");
--	pid = start_ptraced_child();
-+	pid = start_ptraced_child(&stack);
- 
- 	if (ptrace(PTRACE_OLDSETOPTIONS, pid, 0, (void *)PTRACE_O_TRACESYSGOOD) < 0)
- 		panic("check_ptrace: PTRACE_SETOPTIONS failed, errno = %d", errno);
-@@ -330,7 +339,7 @@ void __init check_ptrace(void)
- 			break;
- 		}
- 	}
--	stop_ptraced_child(pid, 0, 1);
-+	stop_ptraced_child(pid, stack, 0, 1);
- 	printk("OK\n");
- 	check_sysemu();
- }
-@@ -362,10 +371,11 @@ void forward_pending_sigio(int target)
- static inline int check_skas3_ptrace_support(void)
- {
- 	struct ptrace_faultinfo fi;
-+	void *stack;
- 	int pid, n, ret = 1;
- 
- 	printf("Checking for the skas3 patch in the host...");
--	pid = start_ptraced_child();
-+	pid = start_ptraced_child(&stack);
- 
- 	n = ptrace(PTRACE_FAULTINFO, pid, 0, &fi);
- 	if (n < 0) {
-@@ -380,7 +390,7 @@ static inline int check_skas3_ptrace_sup
- 	}
- 
- 	init_registers(pid);
--	stop_ptraced_child(pid, 1, 1);
-+	stop_ptraced_child(pid, stack, 1, 1);
- 
- 	return(ret);
- }
-diff --git a/drivers/acpi/pci_irq.c b/drivers/acpi/pci_irq.c
---- a/drivers/acpi/pci_irq.c
-+++ b/drivers/acpi/pci_irq.c
-@@ -433,7 +433,7 @@ acpi_pci_irq_enable (
- 		printk(KERN_WARNING PREFIX "PCI Interrupt %s[%c]: no GSI",
- 			pci_name(dev), ('A' + pin));
- 		/* Interrupt Line values above 0xF are forbidden */
--		if (dev->irq >= 0 && (dev->irq <= 0xF)) {
-+		if (dev->irq > 0 && (dev->irq <= 0xF)) {
- 			printk(" - using IRQ %d\n", dev->irq);
- 			acpi_register_gsi(dev->irq, ACPI_LEVEL_SENSITIVE, ACPI_ACTIVE_LOW);
- 			return_VALUE(0);
-diff --git a/drivers/char/tpm/tpm.c b/drivers/char/tpm/tpm.c
---- a/drivers/char/tpm/tpm.c
-+++ b/drivers/char/tpm/tpm.c
-@@ -32,12 +32,6 @@
- 
- #define	TPM_BUFSIZE			2048
- 
--/* PCI configuration addresses */
--#define	PCI_GEN_PMCON_1			0xA0
--#define	PCI_GEN1_DEC			0xE4
--#define	PCI_LPC_EN			0xE6
--#define	PCI_GEN2_DEC			0xEC
--
- static LIST_HEAD(tpm_chip_list);
- static DEFINE_SPINLOCK(driver_lock);
- static int dev_mask[32];
-@@ -61,72 +55,6 @@ void tpm_time_expired(unsigned long ptr)
- EXPORT_SYMBOL_GPL(tpm_time_expired);
- 
- /*
-- * Initialize the LPC bus and enable the TPM ports
-- */
--int tpm_lpc_bus_init(struct pci_dev *pci_dev, u16 base)
--{
--	u32 lpcenable, tmp;
--	int is_lpcm = 0;
--
--	switch (pci_dev->vendor) {
--	case PCI_VENDOR_ID_INTEL:
--		switch (pci_dev->device) {
--		case PCI_DEVICE_ID_INTEL_82801CA_12:
--		case PCI_DEVICE_ID_INTEL_82801DB_12:
--			is_lpcm = 1;
--			break;
--		}
--		/* init ICH (enable LPC) */
--		pci_read_config_dword(pci_dev, PCI_GEN1_DEC, &lpcenable);
--		lpcenable |= 0x20000000;
--		pci_write_config_dword(pci_dev, PCI_GEN1_DEC, lpcenable);
--
--		if (is_lpcm) {
--			pci_read_config_dword(pci_dev, PCI_GEN1_DEC,
--					      &lpcenable);
--			if ((lpcenable & 0x20000000) == 0) {
--				dev_err(&pci_dev->dev,
--					"cannot enable LPC\n");
--				return -ENODEV;
--			}
--		}
--
--		/* initialize TPM registers */
--		pci_read_config_dword(pci_dev, PCI_GEN2_DEC, &tmp);
--
--		if (!is_lpcm)
--			tmp = (tmp & 0xFFFF0000) | (base & 0xFFF0);
--		else
--			tmp =
--			    (tmp & 0xFFFF0000) | (base & 0xFFF0) |
--			    0x00000001;
--
--		pci_write_config_dword(pci_dev, PCI_GEN2_DEC, tmp);
--
--		if (is_lpcm) {
--			pci_read_config_dword(pci_dev, PCI_GEN_PMCON_1,
--					      &tmp);
--			tmp |= 0x00000004;	/* enable CLKRUN */
--			pci_write_config_dword(pci_dev, PCI_GEN_PMCON_1,
--					       tmp);
--		}
--		tpm_write_index(0x0D, 0x55);	/* unlock 4F */
--		tpm_write_index(0x0A, 0x00);	/* int disable */
--		tpm_write_index(0x08, base);	/* base addr lo */
--		tpm_write_index(0x09, (base & 0xFF00) >> 8);	/* base addr hi */
--		tpm_write_index(0x0D, 0xAA);	/* lock 4F */
--		break;
--	case PCI_VENDOR_ID_AMD:
--		/* nothing yet */
--		break;
--	}
--
--	return 0;
--}
--
--EXPORT_SYMBOL_GPL(tpm_lpc_bus_init);
--
--/*
-  * Internal kernel interface to transmit TPM commands
-  */
- static ssize_t tpm_transmit(struct tpm_chip *chip, const char *buf,
-@@ -590,10 +518,6 @@ int tpm_pm_resume(struct pci_dev *pci_de
- 	if (chip == NULL)
- 		return -ENODEV;
- 
--	spin_lock(&driver_lock);
--	tpm_lpc_bus_init(pci_dev, chip->vendor->base);
--	spin_unlock(&driver_lock);
--
- 	return 0;
- }
- 
-diff --git a/drivers/char/tpm/tpm.h b/drivers/char/tpm/tpm.h
---- a/drivers/char/tpm/tpm.h
-+++ b/drivers/char/tpm/tpm.h
-@@ -79,8 +79,6 @@ static inline void tpm_write_index(int i
- }
- 
- extern void tpm_time_expired(unsigned long);
--extern int tpm_lpc_bus_init(struct pci_dev *, u16);
--
- extern int tpm_register_hardware(struct pci_dev *,
- 				 struct tpm_vendor_specific *);
- extern int tpm_open(struct inode *, struct file *);
-diff --git a/drivers/char/tpm/tpm_atmel.c b/drivers/char/tpm/tpm_atmel.c
---- a/drivers/char/tpm/tpm_atmel.c
-+++ b/drivers/char/tpm/tpm_atmel.c
-@@ -22,7 +22,10 @@
- #include "tpm.h"
- 
- /* Atmel definitions */
--#define	TPM_ATML_BASE			0x400
-+enum tpm_atmel_addr {
-+	TPM_ATMEL_BASE_ADDR_LO = 0x08,
-+	TPM_ATMEL_BASE_ADDR_HI = 0x09
-+};
- 
- /* write status bits */
- #define	ATML_STATUS_ABORT		0x01
-@@ -127,7 +130,6 @@ static struct tpm_vendor_specific tpm_at
- 	.cancel = tpm_atml_cancel,
- 	.req_complete_mask = ATML_STATUS_BUSY | ATML_STATUS_DATA_AVAIL,
- 	.req_complete_val = ATML_STATUS_DATA_AVAIL,
--	.base = TPM_ATML_BASE,
- 	.miscdev = { .fops = &atmel_ops, },
- };
- 
-@@ -136,14 +138,16 @@ static int __devinit tpm_atml_init(struc
- {
- 	u8 version[4];
- 	int rc = 0;
-+	int lo, hi;
- 
- 	if (pci_enable_device(pci_dev))
- 		return -EIO;
- 
--	if (tpm_lpc_bus_init(pci_dev, TPM_ATML_BASE)) {
--		rc = -ENODEV;
--		goto out_err;
--	}
-+	lo = tpm_read_index( TPM_ATMEL_BASE_ADDR_LO );
-+	hi = tpm_read_index( TPM_ATMEL_BASE_ADDR_HI );
-+
-+	tpm_atmel.base = (hi<<8)|lo;
-+	dev_dbg( &pci_dev->dev, "Operating with base: 0x%x\n", tpm_atmel.base);
- 
- 	/* verify that it is an Atmel part */
- 	if (tpm_read_index(4) != 'A' || tpm_read_index(5) != 'T'
-diff --git a/drivers/char/tpm/tpm_nsc.c b/drivers/char/tpm/tpm_nsc.c
---- a/drivers/char/tpm/tpm_nsc.c
-+++ b/drivers/char/tpm/tpm_nsc.c
-@@ -24,6 +24,10 @@
- /* National definitions */
- #define	TPM_NSC_BASE			0x360
- #define	TPM_NSC_IRQ			0x07
-+#define	TPM_NSC_BASE0_HI		0x60
-+#define	TPM_NSC_BASE0_LO		0x61
-+#define	TPM_NSC_BASE1_HI		0x62
-+#define	TPM_NSC_BASE1_LO		0x63
- 
- #define	NSC_LDN_INDEX			0x07
- #define	NSC_SID_INDEX			0x20
-@@ -234,7 +238,6 @@ static struct tpm_vendor_specific tpm_ns
- 	.cancel = tpm_nsc_cancel,
- 	.req_complete_mask = NSC_STATUS_OBF,
- 	.req_complete_val = NSC_STATUS_OBF,
--	.base = TPM_NSC_BASE,
- 	.miscdev = { .fops = &nsc_ops, },
- 	
- };
-@@ -243,15 +246,16 @@ static int __devinit tpm_nsc_init(struct
- 				  const struct pci_device_id *pci_id)
- {
- 	int rc = 0;
-+	int lo, hi;
-+
-+	hi = tpm_read_index(TPM_NSC_BASE0_HI);
-+	lo = tpm_read_index(TPM_NSC_BASE0_LO);
-+
-+	tpm_nsc.base = (hi<<8) | lo;
- 
- 	if (pci_enable_device(pci_dev))
- 		return -EIO;
- 
--	if (tpm_lpc_bus_init(pci_dev, TPM_NSC_BASE)) {
--		rc = -ENODEV;
--		goto out_err;
--	}
--
- 	/* verify that it is a National part (SID) */
- 	if (tpm_read_index(NSC_SID_INDEX) != 0xEF) {
- 		rc = -ENODEV;
-diff --git a/drivers/char/tty_ioctl.c b/drivers/char/tty_ioctl.c
---- a/drivers/char/tty_ioctl.c
-+++ b/drivers/char/tty_ioctl.c
-@@ -476,11 +476,11 @@ int n_tty_ioctl(struct tty_struct * tty,
- 			ld = tty_ldisc_ref(tty);
- 			switch (arg) {
- 			case TCIFLUSH:
--				if (ld->flush_buffer)
-+				if (ld && ld->flush_buffer)
- 					ld->flush_buffer(tty);
- 				break;
- 			case TCIOFLUSH:
--				if (ld->flush_buffer)
-+				if (ld && ld->flush_buffer)
- 					ld->flush_buffer(tty);
- 				/* fall through */
- 			case TCOFLUSH:
-diff --git a/drivers/media/video/cx88/cx88-video.c b/drivers/media/video/cx88/cx88-video.c
---- a/drivers/media/video/cx88/cx88-video.c
-+++ b/drivers/media/video/cx88/cx88-video.c
-@@ -261,7 +261,7 @@ static struct cx88_ctrl cx8800_ctls[] = 
- 			.default_value = 0,
- 			.type          = V4L2_CTRL_TYPE_INTEGER,
- 		},
--		.off                   = 0,
-+		.off                   = 128,
- 		.reg                   = MO_HUE,
- 		.mask                  = 0x00ff,
- 		.shift                 = 0,
-diff --git a/drivers/net/hamradio/Kconfig b/drivers/net/hamradio/Kconfig
---- a/drivers/net/hamradio/Kconfig
-+++ b/drivers/net/hamradio/Kconfig
-@@ -17,7 +17,7 @@ config MKISS
- 
- config 6PACK
- 	tristate "Serial port 6PACK driver"
--	depends on AX25 && BROKEN_ON_SMP
-+	depends on AX25
- 	---help---
- 	  6pack is a transmission protocol for the data exchange between your
- 	  PC and your TNC (the Terminal Node Controller acts as a kind of
-diff --git a/drivers/net/shaper.c b/drivers/net/shaper.c
---- a/drivers/net/shaper.c
-+++ b/drivers/net/shaper.c
-@@ -135,10 +135,8 @@ static int shaper_start_xmit(struct sk_b
- {
- 	struct shaper *shaper = dev->priv;
-  	struct sk_buff *ptr;
--   
--	if (down_trylock(&shaper->sem))
--		return -1;
- 
-+	spin_lock(&shaper->lock);
-  	ptr=shaper->sendq.prev;
-  	
-  	/*
-@@ -232,7 +230,7 @@ static int shaper_start_xmit(struct sk_b
-                 shaper->stats.collisions++;
-  	}
- 	shaper_kick(shaper);
--	up(&shaper->sem);
-+	spin_unlock(&shaper->lock);
-  	return 0;
- }
- 
-@@ -271,11 +269,9 @@ static void shaper_timer(unsigned long d
- {
- 	struct shaper *shaper = (struct shaper *)data;
- 
--	if (!down_trylock(&shaper->sem)) {
--		shaper_kick(shaper);
--		up(&shaper->sem);
--	} else
--		mod_timer(&shaper->timer, jiffies);
-+	spin_lock(&shaper->lock);
-+	shaper_kick(shaper);
-+	spin_unlock(&shaper->lock);
- }
- 
- /*
-@@ -332,21 +328,6 @@ static void shaper_kick(struct shaper *s
- 
- 
- /*
-- *	Flush the shaper queues on a closedown
-- */
-- 
--static void shaper_flush(struct shaper *shaper)
--{
--	struct sk_buff *skb;
--
--	down(&shaper->sem);
--	while((skb=skb_dequeue(&shaper->sendq))!=NULL)
--		dev_kfree_skb(skb);
--	shaper_kick(shaper);
--	up(&shaper->sem);
--}
--
--/*
-  *	Bring the interface up. We just disallow this until a 
-  *	bind.
-  */
-@@ -375,7 +356,15 @@ static int shaper_open(struct net_device
- static int shaper_close(struct net_device *dev)
- {
- 	struct shaper *shaper=dev->priv;
--	shaper_flush(shaper);
-+	struct sk_buff *skb;
-+
-+	while ((skb = skb_dequeue(&shaper->sendq)) != NULL)
-+		dev_kfree_skb(skb);
-+
-+	spin_lock_bh(&shaper->lock);
-+	shaper_kick(shaper);
-+	spin_unlock_bh(&shaper->lock);
-+
- 	del_timer_sync(&shaper->timer);
- 	return 0;
- }
-@@ -576,6 +565,7 @@ static void shaper_init_priv(struct net_
- 	init_timer(&sh->timer);
- 	sh->timer.function=shaper_timer;
- 	sh->timer.data=(unsigned long)sh;
-+	spin_lock_init(&sh->lock);
- }
- 
- /*
-diff --git a/fs/char_dev.c b/fs/char_dev.c
---- a/fs/char_dev.c
-+++ b/fs/char_dev.c
-@@ -139,7 +139,7 @@ __unregister_chrdev_region(unsigned majo
- 	struct char_device_struct *cd = NULL, **cp;
- 	int i = major_to_index(major);
- 
--	up(&chrdevs_lock);
-+	down(&chrdevs_lock);
- 	for (cp = &chrdevs[i]; *cp; cp = &(*cp)->next)
- 		if ((*cp)->major == major &&
- 		    (*cp)->baseminor == baseminor &&
-diff --git a/include/linux/if_shaper.h b/include/linux/if_shaper.h
---- a/include/linux/if_shaper.h
-+++ b/include/linux/if_shaper.h
-@@ -23,7 +23,7 @@ struct shaper
- 	__u32 shapeclock;
- 	unsigned long recovery;	/* Time we can next clock a packet out on
- 				   an empty queue */
--	struct semaphore sem;
-+	spinlock_t lock;
-         struct net_device_stats stats;
- 	struct net_device *dev;
- 	int  (*hard_start_xmit) (struct sk_buff *skb,
-diff --git a/net/ipv4/ip_output.c b/net/ipv4/ip_output.c
---- a/net/ipv4/ip_output.c
-+++ b/net/ipv4/ip_output.c
-@@ -111,7 +111,6 @@ static int ip_dev_loopback_xmit(struct s
- #ifdef CONFIG_NETFILTER_DEBUG
- 	nf_debug_ip_loopback_xmit(newskb);
- #endif
--	nf_reset(newskb);
- 	netif_rx(newskb);
- 	return 0;
- }
-@@ -196,8 +195,6 @@ static inline int ip_finish_output2(stru
- 	nf_debug_ip_finish_output2(skb);
- #endif /*CONFIG_NETFILTER_DEBUG*/
- 
--	nf_reset(skb);
--
- 	if (hh) {
- 		int hh_alen;
- 
-diff --git a/net/ipv4/netfilter/ip_conntrack_standalone.c b/net/ipv4/netfilter/ip_conntrack_standalone.c
---- a/net/ipv4/netfilter/ip_conntrack_standalone.c
-+++ b/net/ipv4/netfilter/ip_conntrack_standalone.c
-@@ -432,6 +432,13 @@ static unsigned int ip_conntrack_defrag(
- 				        const struct net_device *out,
- 				        int (*okfn)(struct sk_buff *))
- {
-+#if !defined(CONFIG_IP_NF_NAT) && !defined(CONFIG_IP_NF_NAT_MODULE)
-+	/* Previously seen (loopback)?  Ignore.  Do this before
-+           fragment check. */
-+	if ((*pskb)->nfct)
-+		return NF_ACCEPT;
-+#endif
-+
- 	/* Gather fragments. */
- 	if ((*pskb)->nh.iph->frag_off & htons(IP_MF|IP_OFFSET)) {
- 		*pskb = ip_ct_gather_frags(*pskb,
-diff --git a/net/packet/af_packet.c b/net/packet/af_packet.c
---- a/net/packet/af_packet.c
-+++ b/net/packet/af_packet.c
-@@ -274,6 +274,9 @@ static int packet_rcv_spkt(struct sk_buf
- 	dst_release(skb->dst);
- 	skb->dst = NULL;
- 
-+	/* drop conntrack reference */
-+	nf_reset(skb);
-+
- 	spkt = (struct sockaddr_pkt*)skb->cb;
- 
- 	skb_push(skb, skb->data-skb->mac.raw);
-@@ -517,6 +520,9 @@ static int packet_rcv(struct sk_buff *sk
- 	dst_release(skb->dst);
- 	skb->dst = NULL;
- 
-+	/* drop conntrack reference */
-+	nf_reset(skb);
-+
- 	spin_lock(&sk->sk_receive_queue.lock);
- 	po->stats.tp_packets++;
- 	__skb_queue_tail(&sk->sk_receive_queue, skb);

Deleted: people/waldi/kernel/linux-2.6/debian/patches-debian/patch-2.6.12.4
===================================================================
--- people/waldi/kernel/linux-2.6/debian/patches-debian/patch-2.6.12.4	2005-08-21 15:17:11 UTC (rev 4001)
+++ people/waldi/kernel/linux-2.6/debian/patches-debian/patch-2.6.12.4	2005-08-21 15:28:27 UTC (rev 4002)
@@ -1,194 +0,0 @@
-diff --git a/arch/i386/kernel/cpu/cpufreq/powernow-k8.c b/arch/i386/kernel/cpu/cpufreq/powernow-k8.c
---- a/arch/i386/kernel/cpu/cpufreq/powernow-k8.c
-+++ b/arch/i386/kernel/cpu/cpufreq/powernow-k8.c
-@@ -44,7 +44,7 @@
- 
- #define PFX "powernow-k8: "
- #define BFX PFX "BIOS error: "
--#define VERSION "version 1.40.2"
-+#define VERSION "version 1.40.4"
- #include "powernow-k8.h"
- 
- /* serialize freq changes  */
-@@ -978,7 +978,7 @@ static int __init powernowk8_cpu_init(st
- {
- 	struct powernow_k8_data *data;
- 	cpumask_t oldmask = CPU_MASK_ALL;
--	int rc;
-+	int rc, i;
- 
- 	if (!check_supported_cpu(pol->cpu))
- 		return -ENODEV;
-@@ -1064,7 +1064,9 @@ static int __init powernowk8_cpu_init(st
- 	printk("cpu_init done, current fid 0x%x, vid 0x%x\n",
- 	       data->currfid, data->currvid);
- 
--	powernow_data[pol->cpu] = data;
-+	for_each_cpu_mask(i, cpu_core_map[pol->cpu]) {
-+		powernow_data[i] = data;
-+	}
- 
- 	return 0;
- 
-diff --git a/arch/i386/kernel/process.c b/arch/i386/kernel/process.c
---- a/arch/i386/kernel/process.c
-+++ b/arch/i386/kernel/process.c
-@@ -827,6 +827,8 @@ asmlinkage int sys_get_thread_area(struc
- 	if (idx < GDT_ENTRY_TLS_MIN || idx > GDT_ENTRY_TLS_MAX)
- 		return -EINVAL;
- 
-+	memset(&info, 0, sizeof(info));
-+
- 	desc = current->thread.tls_array + idx - GDT_ENTRY_TLS_MIN;
- 
- 	info.entry_number = idx;
-diff --git a/arch/x86_64/ia32/syscall32.c b/arch/x86_64/ia32/syscall32.c
---- a/arch/x86_64/ia32/syscall32.c
-+++ b/arch/x86_64/ia32/syscall32.c
-@@ -57,6 +57,7 @@ int syscall32_setup_pages(struct linux_b
- 	int npages = (VSYSCALL32_END - VSYSCALL32_BASE) >> PAGE_SHIFT;
- 	struct vm_area_struct *vma;
- 	struct mm_struct *mm = current->mm;
-+	int ret;
- 
- 	vma = kmem_cache_alloc(vm_area_cachep, SLAB_KERNEL);
- 	if (!vma)
-@@ -78,7 +79,11 @@ int syscall32_setup_pages(struct linux_b
- 	vma->vm_mm = mm;
- 
- 	down_write(&mm->mmap_sem);
--	insert_vm_struct(mm, vma);
-+	if ((ret = insert_vm_struct(mm, vma))) {
-+		up_write(&mm->mmap_sem);
-+		kmem_cache_free(vm_area_cachep, vma);
-+		return ret;
-+	}
- 	mm->total_vm += npages;
- 	up_write(&mm->mmap_sem);
- 	return 0;
-diff --git a/drivers/char/rocket.c b/drivers/char/rocket.c
---- a/drivers/char/rocket.c
-+++ b/drivers/char/rocket.c
-@@ -277,7 +277,7 @@ static void rp_do_receive(struct r_port 
- 		ToRecv = space;
- 
- 	if (ToRecv <= 0)
--		return;
-+		goto done;
- 
- 	/*
- 	 * if status indicates there are errored characters in the
-@@ -359,6 +359,7 @@ static void rp_do_receive(struct r_port 
- 	}
- 	/*  Push the data up to the tty layer */
- 	ld->receive_buf(tty, tty->flip.char_buf, tty->flip.flag_buf, count);
-+done:
- 	tty_ldisc_deref(ld);
- }
- 
-diff --git a/fs/bio.c b/fs/bio.c
---- a/fs/bio.c
-+++ b/fs/bio.c
-@@ -261,6 +261,7 @@ inline void __bio_clone(struct bio *bio,
- 	 */
- 	bio->bi_vcnt = bio_src->bi_vcnt;
- 	bio->bi_size = bio_src->bi_size;
-+	bio->bi_idx = bio_src->bi_idx;
- 	bio_phys_segments(q, bio);
- 	bio_hw_segments(q, bio);
- }
-diff --git a/include/linux/skbuff.h b/include/linux/skbuff.h
---- a/include/linux/skbuff.h
-+++ b/include/linux/skbuff.h
-@@ -1192,7 +1192,7 @@ static inline void *skb_header_pointer(c
- {
- 	int hlen = skb_headlen(skb);
- 
--	if (offset + len <= hlen)
-+	if (hlen - offset >= len)
- 		return skb->data + offset;
- 
- 	if (skb_copy_bits(skb, offset, buffer, len) < 0)
-diff --git a/net/8021q/vlan.c b/net/8021q/vlan.c
---- a/net/8021q/vlan.c
-+++ b/net/8021q/vlan.c
-@@ -578,6 +578,14 @@ static int vlan_device_event(struct noti
- 			if (!vlandev)
- 				continue;
- 
-+			if (netif_carrier_ok(dev)) {
-+				if (!netif_carrier_ok(vlandev))
-+					netif_carrier_on(vlandev);
-+			} else {
-+				if (netif_carrier_ok(vlandev))
-+					netif_carrier_off(vlandev);
-+			}
-+
- 			if ((vlandev->state & VLAN_LINK_STATE_MASK) != flgs) {
- 				vlandev->state = (vlandev->state &~ VLAN_LINK_STATE_MASK) 
- 					| flgs;
-diff --git a/net/ipv4/netfilter/ip_conntrack_core.c b/net/ipv4/netfilter/ip_conntrack_core.c
---- a/net/ipv4/netfilter/ip_conntrack_core.c
-+++ b/net/ipv4/netfilter/ip_conntrack_core.c
-@@ -1124,6 +1124,9 @@ void ip_conntrack_cleanup(void)
- 		schedule();
- 		goto i_see_dead_people;
- 	}
-+	/* wait until all references to ip_conntrack_untracked are dropped */
-+	while (atomic_read(&ip_conntrack_untracked.ct_general.use) > 1)
-+		schedule();
- 
- 	kmem_cache_destroy(ip_conntrack_cachep);
- 	kmem_cache_destroy(ip_conntrack_expect_cachep);
-diff --git a/net/ipv4/netfilter/ip_nat_proto_tcp.c b/net/ipv4/netfilter/ip_nat_proto_tcp.c
---- a/net/ipv4/netfilter/ip_nat_proto_tcp.c
-+++ b/net/ipv4/netfilter/ip_nat_proto_tcp.c
-@@ -40,7 +40,8 @@ tcp_unique_tuple(struct ip_conntrack_tup
- 		 enum ip_nat_manip_type maniptype,
- 		 const struct ip_conntrack *conntrack)
- {
--	static u_int16_t port, *portptr;
-+	static u_int16_t port;
-+	u_int16_t *portptr;
- 	unsigned int range_size, min, i;
- 
- 	if (maniptype == IP_NAT_MANIP_SRC)
-diff --git a/net/ipv4/netfilter/ip_nat_proto_udp.c b/net/ipv4/netfilter/ip_nat_proto_udp.c
---- a/net/ipv4/netfilter/ip_nat_proto_udp.c
-+++ b/net/ipv4/netfilter/ip_nat_proto_udp.c
-@@ -41,7 +41,8 @@ udp_unique_tuple(struct ip_conntrack_tup
- 		 enum ip_nat_manip_type maniptype,
- 		 const struct ip_conntrack *conntrack)
- {
--	static u_int16_t port, *portptr;
-+	static u_int16_t port;
-+	u_int16_t *portptr;
- 	unsigned int range_size, min, i;
- 
- 	if (maniptype == IP_NAT_MANIP_SRC)
-diff --git a/net/ipv6/netfilter/ip6_queue.c b/net/ipv6/netfilter/ip6_queue.c
---- a/net/ipv6/netfilter/ip6_queue.c
-+++ b/net/ipv6/netfilter/ip6_queue.c
-@@ -76,7 +76,9 @@ static DECLARE_MUTEX(ipqnl_sem);
- static void
- ipq_issue_verdict(struct ipq_queue_entry *entry, int verdict)
- {
-+	local_bh_disable();
- 	nf_reinject(entry->skb, entry->info, verdict);
-+	local_bh_enable();
- 	kfree(entry);
- }
- 
-diff --git a/net/xfrm/xfrm_user.c b/net/xfrm/xfrm_user.c
---- a/net/xfrm/xfrm_user.c
-+++ b/net/xfrm/xfrm_user.c
-@@ -1180,6 +1180,9 @@ static struct xfrm_policy *xfrm_compile_
- 	if (nr > XFRM_MAX_DEPTH)
- 		return NULL;
- 
-+	if (p->dir > XFRM_POLICY_OUT)
-+		return NULL;
-+
- 	xp = xfrm_policy_alloc(GFP_KERNEL);
- 	if (xp == NULL) {
- 		*dir = -ENOBUFS;

Deleted: people/waldi/kernel/linux-2.6/debian/patches-debian/patch-2.6.12.5
===================================================================
--- people/waldi/kernel/linux-2.6/debian/patches-debian/patch-2.6.12.5	2005-08-21 15:17:11 UTC (rev 4001)
+++ people/waldi/kernel/linux-2.6/debian/patches-debian/patch-2.6.12.5	2005-08-21 15:28:27 UTC (rev 4002)
@@ -1,352 +0,0 @@
-diff --git a/arch/ppc64/boot/zlib.c b/arch/ppc64/boot/zlib.c
---- a/arch/ppc64/boot/zlib.c
-+++ b/arch/ppc64/boot/zlib.c
-@@ -1307,7 +1307,7 @@ local int huft_build(
-   {
-     *t = (inflate_huft *)Z_NULL;
-     *m = 0;
--    return Z_OK;
-+    return Z_DATA_ERROR;
-   }
- 
- 
-@@ -1351,6 +1351,7 @@ local int huft_build(
-     if ((j = *p++) != 0)
-       v[x[j]++] = i;
-   } while (++i < n);
-+  n = x[g];			/* set n to length of v */
- 
- 
-   /* Generate the Huffman codes and for each, make the table entries */
-diff --git a/arch/x86_64/kernel/setup.c b/arch/x86_64/kernel/setup.c
---- a/arch/x86_64/kernel/setup.c
-+++ b/arch/x86_64/kernel/setup.c
-@@ -729,8 +729,6 @@ static void __init amd_detect_cmp(struct
- 	int cpu = smp_processor_id();
- 	int node = 0;
- 	unsigned bits;
--	if (c->x86_num_cores == 1)
--		return;
- 
- 	bits = 0;
- 	while ((1 << bits) < c->x86_num_cores)
-diff --git a/arch/x86_64/kernel/smp.c b/arch/x86_64/kernel/smp.c
---- a/arch/x86_64/kernel/smp.c
-+++ b/arch/x86_64/kernel/smp.c
-@@ -284,6 +284,71 @@ struct call_data_struct {
- static struct call_data_struct * call_data;
- 
- /*
-+ * this function sends a 'generic call function' IPI to one other CPU
-+ * in the system.
-+ */
-+static void __smp_call_function_single (int cpu, void (*func) (void *info), void *info,
-+				int nonatomic, int wait)
-+{
-+	struct call_data_struct data;
-+	int cpus = 1;
-+
-+	data.func = func;
-+	data.info = info;
-+	atomic_set(&data.started, 0);
-+	data.wait = wait;
-+	if (wait)
-+		atomic_set(&data.finished, 0);
-+
-+	call_data = &data;
-+	wmb();
-+	/* Send a message to all other CPUs and wait for them to respond */
-+	send_IPI_mask(cpumask_of_cpu(cpu), CALL_FUNCTION_VECTOR);
-+
-+	/* Wait for response */
-+	while (atomic_read(&data.started) != cpus)
-+		cpu_relax();
-+
-+	if (!wait)
-+		return;
-+
-+	while (atomic_read(&data.finished) != cpus)
-+		cpu_relax();
-+}
-+
-+/*
-+ * Run a function on another CPU
-+ *  <func>	The function to run. This must be fast and non-blocking.
-+ *  <info>	An arbitrary pointer to pass to the function.
-+ *  <nonatomic>	Currently unused.
-+ *  <wait>	If true, wait until function has completed on other CPUs.
-+ *  [RETURNS]   0 on success, else a negative status code.
-+ *
-+ * Does not return until the remote CPU is nearly ready to execute <func>
-+ * or is or has executed.
-+ */
-+
-+int smp_call_function_single (int cpu, void (*func) (void *info), void *info, 
-+	int nonatomic, int wait)
-+{
-+	
-+	int me = get_cpu(); /* prevent preemption and reschedule on another processor */
-+
-+	if (cpu == me) {
-+		printk("%s: trying to call self\n", __func__);
-+		put_cpu();
-+		return -EBUSY;
-+	}
-+	spin_lock_bh(&call_lock);
-+
-+	__smp_call_function_single(cpu, func,info,nonatomic,wait);	
-+
-+	spin_unlock_bh(&call_lock);
-+	put_cpu();
-+	return 0;
-+}
-+
-+/*
-  * this function sends a 'generic call function' IPI to all other CPUs
-  * in the system.
-  */
-diff --git a/arch/x86_64/kernel/smpboot.c b/arch/x86_64/kernel/smpboot.c
---- a/arch/x86_64/kernel/smpboot.c
-+++ b/arch/x86_64/kernel/smpboot.c
-@@ -202,9 +202,6 @@ static __cpuinit void sync_master(void *
- {
- 	unsigned long flags, i;
- 
--	if (smp_processor_id() != boot_cpu_id)
--		return;
--
- 	go[MASTER] = 0;
- 
- 	local_irq_save(flags);
-@@ -253,7 +250,7 @@ get_delta(long *rt, long *master)
- 	return tcenter - best_tm;
- }
- 
--static __cpuinit void sync_tsc(void)
-+static __cpuinit void sync_tsc(unsigned int master)
- {
- 	int i, done = 0;
- 	long delta, adj, adjust_latency = 0;
-@@ -267,9 +264,17 @@ static __cpuinit void sync_tsc(void)
- 	} t[NUM_ROUNDS] __cpuinitdata;
- #endif
- 
-+	printk(KERN_INFO "CPU %d: Syncing TSC to CPU %u.\n",
-+		smp_processor_id(), master);
-+
- 	go[MASTER] = 1;
- 
--	smp_call_function(sync_master, NULL, 1, 0);
-+	/* It is dangerous to broadcast IPI as cpus are coming up,
-+	 * as they may not be ready to accept them.  So since
-+	 * we only need to send the ipi to the boot cpu direct
-+	 * the message, and avoid the race.
-+	 */
-+	smp_call_function_single(master, sync_master, NULL, 1, 0);
- 
- 	while (go[MASTER])	/* wait for master to be ready */
- 		no_cpu_relax();
-@@ -313,16 +318,14 @@ static __cpuinit void sync_tsc(void)
- 	printk(KERN_INFO
- 	       "CPU %d: synchronized TSC with CPU %u (last diff %ld cycles, "
- 	       "maxerr %lu cycles)\n",
--	       smp_processor_id(), boot_cpu_id, delta, rt);
-+	       smp_processor_id(), master, delta, rt);
- }
- 
- static void __cpuinit tsc_sync_wait(void)
- {
- 	if (notscsync || !cpu_has_tsc)
- 		return;
--	printk(KERN_INFO "CPU %d: Syncing TSC to CPU %u.\n", smp_processor_id(),
--			boot_cpu_id);
--	sync_tsc();
-+	sync_tsc(0);
- }
- 
- static __init int notscsync_setup(char *s)
-diff --git a/fs/isofs/compress.c b/fs/isofs/compress.c
---- a/fs/isofs/compress.c
-+++ b/fs/isofs/compress.c
-@@ -129,8 +129,14 @@ static int zisofs_readpage(struct file *
- 	cend = le32_to_cpu(*(__le32 *)(bh->b_data + (blockendptr & bufmask)));
- 	brelse(bh);
- 
-+	if (cstart > cend)
-+		goto eio;
-+		
- 	csize = cend-cstart;
- 
-+	if (csize > deflateBound(1UL << zisofs_block_shift))
-+		goto eio;
-+
- 	/* Now page[] contains an array of pages, any of which can be NULL,
- 	   and the locks on which we hold.  We should now read the data and
- 	   release the pages.  If the pages are NULL the decompressed data
-diff --git a/include/asm-x86_64/smp.h b/include/asm-x86_64/smp.h
---- a/include/asm-x86_64/smp.h
-+++ b/include/asm-x86_64/smp.h
-@@ -46,6 +46,8 @@ extern int pic_mode;
- extern int smp_num_siblings;
- extern void smp_flush_tlb(void);
- extern void smp_message_irq(int cpl, void *dev_id, struct pt_regs *regs);
-+extern int smp_call_function_single (int cpuid, void (*func) (void *info), void *info,
-+				     int retry, int wait);
- extern void smp_send_reschedule(int cpu);
- extern void smp_invalidate_rcv(void);		/* Process an NMI */
- extern void zap_low_mappings(void);
-diff --git a/include/linux/zlib.h b/include/linux/zlib.h
---- a/include/linux/zlib.h
-+++ b/include/linux/zlib.h
-@@ -506,6 +506,11 @@ extern int zlib_deflateReset (z_streamp 
-    stream state was inconsistent (such as zalloc or state being NULL).
- */
- 
-+static inline unsigned long deflateBound(unsigned long s)
-+{
-+	return s + ((s + 7) >> 3) + ((s + 63) >> 6) + 11;
-+}
-+
- extern int zlib_deflateParams (z_streamp strm, int level, int strategy);
- /*
-      Dynamically update the compression level and compression strategy.  The
-diff --git a/kernel/module.c b/kernel/module.c
---- a/kernel/module.c
-+++ b/kernel/module.c
-@@ -249,13 +249,18 @@ static inline unsigned int block_size(in
- /* Created by linker magic */
- extern char __per_cpu_start[], __per_cpu_end[];
- 
--static void *percpu_modalloc(unsigned long size, unsigned long align)
-+static void *percpu_modalloc(unsigned long size, unsigned long align,
-+			     const char *name)
- {
- 	unsigned long extra;
- 	unsigned int i;
- 	void *ptr;
- 
--	BUG_ON(align > SMP_CACHE_BYTES);
-+	if (align > SMP_CACHE_BYTES) {
-+		printk(KERN_WARNING "%s: per-cpu alignment %li > %i\n",
-+		       name, align, SMP_CACHE_BYTES);
-+		align = SMP_CACHE_BYTES;
-+	}
- 
- 	ptr = __per_cpu_start;
- 	for (i = 0; i < pcpu_num_used; ptr += block_size(pcpu_size[i]), i++) {
-@@ -347,7 +352,8 @@ static int percpu_modinit(void)
- }	
- __initcall(percpu_modinit);
- #else /* ... !CONFIG_SMP */
--static inline void *percpu_modalloc(unsigned long size, unsigned long align)
-+static inline void *percpu_modalloc(unsigned long size, unsigned long align,
-+				    const char *name)
- {
- 	return NULL;
- }
-@@ -1554,7 +1560,8 @@ static struct module *load_module(void _
- 	if (pcpuindex) {
- 		/* We have a special allocation for this section. */
- 		percpu = percpu_modalloc(sechdrs[pcpuindex].sh_size,
--					 sechdrs[pcpuindex].sh_addralign);
-+					 sechdrs[pcpuindex].sh_addralign,
-+					 mod->name);
- 		if (!percpu) {
- 			err = -ENOMEM;
- 			goto free_mod;
-diff --git a/lib/inflate.c b/lib/inflate.c
---- a/lib/inflate.c
-+++ b/lib/inflate.c
-@@ -326,7 +326,7 @@ DEBG("huft1 ");
-   {
-     *t = (struct huft *)NULL;
-     *m = 0;
--    return 0;
-+    return 2;
-   }
- 
- DEBG("huft2 ");
-@@ -374,6 +374,7 @@ DEBG("huft5 ");
-     if ((j = *p++) != 0)
-       v[x[j]++] = i;
-   } while (++i < n);
-+  n = x[g];                   /* set n to length of v */
- 
- DEBG("h6 ");
- 
-@@ -410,12 +411,13 @@ DEBG1("1 ");
- DEBG1("2 ");
-           f -= a + 1;           /* deduct codes from patterns left */
-           xp = c + k;
--          while (++j < z)       /* try smaller tables up to z bits */
--          {
--            if ((f <<= 1) <= *++xp)
--              break;            /* enough codes to use up j bits */
--            f -= *xp;           /* else deduct codes from patterns */
--          }
-+          if (j < z)
-+            while (++j < z)       /* try smaller tables up to z bits */
-+            {
-+              if ((f <<= 1) <= *++xp)
-+                break;            /* enough codes to use up j bits */
-+              f -= *xp;           /* else deduct codes from patterns */
-+            }
-         }
- DEBG1("3 ");
-         z = 1 << j;             /* table entries for j-bit table */
-diff --git a/lib/zlib_inflate/inftrees.c b/lib/zlib_inflate/inftrees.c
---- a/lib/zlib_inflate/inftrees.c
-+++ b/lib/zlib_inflate/inftrees.c
-@@ -141,7 +141,7 @@ static int huft_build(
-   {
-     *t = NULL;
-     *m = 0;
--    return Z_OK;
-+    return Z_DATA_ERROR;
-   }
- 
- 
-diff --git a/mm/mempolicy.c b/mm/mempolicy.c
---- a/mm/mempolicy.c
-+++ b/mm/mempolicy.c
-@@ -409,7 +409,7 @@ asmlinkage long sys_set_mempolicy(int mo
- 	struct mempolicy *new;
- 	DECLARE_BITMAP(nodes, MAX_NUMNODES);
- 
--	if (mode > MPOL_MAX)
-+	if (mode < 0 || mode > MPOL_MAX)
- 		return -EINVAL;
- 	err = get_nodes(nodes, nmask, maxnode, mode);
- 	if (err)
-diff --git a/security/keys/keyring.c b/security/keys/keyring.c
---- a/security/keys/keyring.c
-+++ b/security/keys/keyring.c
-@@ -188,7 +188,11 @@ static void keyring_destroy(struct key *
- 
- 	if (keyring->description) {
- 		write_lock(&keyring_name_lock);
--		list_del(&keyring->type_data.link);
-+
-+		if (keyring->type_data.link.next != NULL &&
-+		    !list_empty(&keyring->type_data.link))
-+			list_del(&keyring->type_data.link);
-+
- 		write_unlock(&keyring_name_lock);
- 	}
- 
-diff --git a/security/keys/process_keys.c b/security/keys/process_keys.c
---- a/security/keys/process_keys.c
-+++ b/security/keys/process_keys.c
-@@ -641,7 +641,7 @@ long join_session_keyring(const char *na
- 		keyring = keyring_alloc(name, tsk->uid, tsk->gid, 0, NULL);
- 		if (IS_ERR(keyring)) {
- 			ret = PTR_ERR(keyring);
--			goto error;
-+			goto error2;
- 		}
- 	}
- 	else if (IS_ERR(keyring)) {
--
-To unsubscribe from this list: send the line "unsubscribe linux-kernel-announce" in
-the body of a message to majordomo at vger.kernel.org
-More majordomo info at  http://vger.kernel.org/majordomo-info.html

Deleted: people/waldi/kernel/linux-2.6/debian/patches-debian/powerpc-ppc64-ibmvscsi.patch
===================================================================
--- people/waldi/kernel/linux-2.6/debian/patches-debian/powerpc-ppc64-ibmvscsi.patch	2005-08-21 15:17:11 UTC (rev 4001)
+++ people/waldi/kernel/linux-2.6/debian/patches-debian/powerpc-ppc64-ibmvscsi.patch	2005-08-21 15:28:27 UTC (rev 4002)
@@ -1,2868 +0,0 @@
-#! /bin/sh -e 
-##
-## All lines beginning with `## DP:' are a description of the patch.
-## DP: Description: Enables IBM eServer i/pSeries Virtual SCSI Target Driver 
-## DP: Description: Needed for i/pSeries with logical partitions (LPAR).
-## DP: Patch author: Dave Boutcher (boutcher at us.ibm.com)
-## DP: Upstream status: unknown, sent to me by Cajus Pollmeier.
-
-diff -aurN a/drivers/scsi/Kconfig b/drivers/scsi/Kconfig
---- a/drivers/scsi/Kconfig	2005-06-17 15:48:29.000000000 -0400
-+++ b/drivers/scsi/Kconfig	2005-06-18 12:02:58.000000000 -0400
-@@ -813,6 +813,14 @@
- 	  To compile this driver as a module, choose M here: the
- 	  module will be called ibmvscsic.
- 
-+config SCSI_IBMVSCSIS
-+        tristate "IBM Virtual SCSI Server support"
-+        depends on PPC_PSERIES
-+        help
-+          This is the IBM Virtual SCSI Server
-+          To compile this driver as a module, choose M here: the
-+          module will be called ibmvscsis.
-+
- config SCSI_INITIO
- 	tristate "Initio 9100U(W) support"
- 	depends on PCI && SCSI
-diff -aurN a/drivers/scsi/ibmvscsi/Makefile b/drivers/scsi/ibmvscsi/Makefile
---- a/drivers/scsi/ibmvscsi/Makefile	2005-06-17 15:48:29.000000000 -0400
-+++ b/drivers/scsi/ibmvscsi/Makefile	2005-06-18 12:02:58.000000000 -0400
-@@ -3,3 +3,5 @@
- ibmvscsic-y			+= ibmvscsi.o
- ibmvscsic-$(CONFIG_PPC_ISERIES)	+= iseries_vscsi.o 
- ibmvscsic-$(CONFIG_PPC_PSERIES)	+= rpa_vscsi.o 
-+
-+obj-$(CONFIG_SCSI_IBMVSCSIS)    += ibmvscsis.o
-diff -aurN a/drivers/scsi/ibmvscsi/ibmvscsis.c b/drivers/scsi/ibmvscsi/ibmvscsis.c
---- a/drivers/scsi/ibmvscsi/ibmvscsis.c	1969-12-31 19:00:00.000000000 -0500
-+++ b/drivers/scsi/ibmvscsi/ibmvscsis.c	2005-06-18 12:02:58.000000000 -0400
-@@ -0,0 +1,2818 @@
-+/**************************************************************************/
-+/* -*- -linux- -*-                                                        */
-+/* IBM eServer i/pSeries Virtual SCSI Target Driver                       */
-+/* Copyright (C) 2003 Dave Boutcher (boutcher at us.ibm.com) IBM Corp.       */
-+/*                                                                        */
-+/*  This program is free software; you can redistribute it and/or modify  */
-+/*  it under the terms of the GNU General Public License as published by  */
-+/*  the Free Software Foundation; either version 2 of the License, or     */
-+/*  (at your option) any later version.                                   */
-+/*                                                                        */
-+/*  This program is distributed in the hope that it will be useful,       */
-+/*  but WITHOUT ANY WARRANTY; without even the implied warranty of        */
-+/*  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the         */
-+/*  GNU General Public License for more details.                          */
-+/*                                                                        */
-+/*  You should have received a copy of the GNU General Public License     */
-+/*  along with this program; if not, write to the Free Software           */
-+/*  Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  */
-+/*                                                                   USA  */
-+/*                                                                        */
-+/* This module contains the eServer virtual SCSI target code.  The driver */
-+/* takes SRP requests from the virtual SCSI client (the linux version is  */
-+/* int ibmvscsi.c, but there can be other clients, like AIX or OF) and    */
-+/* passes them on to real devices in this system.                         */
-+/*                                                                        */
-+/* The basic hierarchy (and somewhat the organization of this file) is    */
-+/* that SCSI CDBs are in SRPs are in CRQs.                                */
-+/*                                                                        */
-+/**************************************************************************/
-+/*
-+  TODO:
-+  - Support redirecting SRP SCSI requests to a real SCSI driver
-+*/
-+#include <linux/init.h>
-+#include <linux/module.h>
-+#include <linux/kernel.h>
-+#include <linux/interrupt.h>
-+#include <linux/list.h>
-+#include <linux/pagemap.h>
-+#include <linux/dma-mapping.h>
-+#include <linux/sched.h>
-+#include <linux/blkdev.h>
-+#include <linux/fs.h>
-+#include <linux/bio.h>
-+
-+#include <asm/hvcall.h>
-+#include <asm/vio.h>
-+#include <asm/iommu.h>
-+
-+#include "../scsi.h"
-+#include "viosrp.h"
-+
-+#define IBMVSCSIS_VERSION "1.2"
-+
-+MODULE_DESCRIPTION("IBM Virtual SCSI Target");
-+MODULE_AUTHOR("Dave Boutcher");
-+MODULE_LICENSE("GPL");
-+MODULE_VERSION(IBMVSCSIS_VERSION);
-+
-+static int ibmvscsis_debug = 0;
-+
-+/* These are fixed and come from the device tree...we
-+ * just store them here to save getting them every time.
-+ */
-+static char system_id[64] = "";
-+static char partition_name[97] = "UNKNOWN";
-+static unsigned int partition_number = -1;
-+
-+/*
-+ * Quick macro to enable/disable interrupts
-+ * TODO: move to vio.h to be common with ibmvscsi.c
-+ */
-+#define h_vio_signal(ua, mode) \
-+  plpar_hcall_norets(H_VIO_SIGNAL, ua, mode)
-+
-+/* 
-+ * These are indexes into the following table, and have to match!!!
-+ */
-+#define SENSE_SUCCESS       0
-+#define SENSE_ABORT         1
-+#define SENSE_INVALID_ID    2
-+#define SENSE_DEVICE_FAULT  3
-+#define SENSE_DEVICE_BUSY   4
-+#define SENSE_UNIT_OFFLINE  5
-+#define SENSE_INVALID_CMD   6
-+#define SENSE_INTERMEDIATE  7
-+#define SENSE_WRITE_PROT    8
-+#define SENSE_INVALID_FIELD 9
-+
-+#define TARGET_MAX_NAME_LEN 128
-+
-+static unsigned char ibmvscsis_sense_data[][3] = {
-+/*
-+ * Sense key lookup table
-+ * Format: SenseKey,AdditionalSenseCode,AdditionalSenseCodeQualifier
-+ * Adapted from 3w-xxxx.h
-+ */
-+	{0x00, 0x00, 0x00},	/* Success           */
-+	{0x0b, 0x00, 0x00},	/* Aborted command   */
-+	{0x0b, 0x14, 0x00},	/* ID not found      */
-+	{0x04, 0x00, 0x00},	/* Device fault      */
-+	{0x0b, 0x00, 0x00},	/* Device busy       */
-+	{0x02, 0x04, 0x00},	/* Unit offline      */
-+	{0x05, 0x20, 0x00},	/* Invalid Command   */
-+	{0x10, 0x00, 0x00},	/* Intermediate      */
-+	{0x07, 0x27, 0x00},	/* Write Protected   */
-+	{0x05, 0x24, 0x00},	/* Invalid field     */
-+};
-+
-+/*
-+ * SCSI defined structure for inquiry data
-+ * TODO: Seral number is currently messed up if you do
-+ *       scsiinfo.  I'm not sure why and I think it comes out of 
-+ *       here
-+ */
-+struct inquiry_data {
-+	u8 qual_type;
-+	u8 rmb_reserve;
-+	u8 version;
-+	u8 aerc_naca_hisup_format;
-+	u8 addl_len;
-+	u8 sccs_reserved;
-+	u8 bque_encserv_vs_multip_mchngr_reserved;
-+	u8 reladr_reserved_linked_cmdqueue_vs;
-+	char vendor[8];
-+	char product[16];
-+	char revision[4];
-+	char vendor_specific[20];
-+	char reserved1[2];
-+	char version_descriptor[16];
-+	char reserved2[22];
-+	char unique[158];
-+};
-+
-+extern int vio_num_address_cells;
-+
-+/* 
-+ * an RPA command/response transport queue.  This is our structure
-+ * that points to the actual queue.  feel free to modify this structure
-+ * as needed
-+ */
-+struct crq_queue {
-+	struct viosrp_crq *msgs;
-+	int size, cur;
-+	dma_addr_t msg_token;
-+	spinlock_t lock;
-+};
-+
-+/*
-+ * This structure tracks our fundamental unit of work.  Whenever
-+ * an SRP Information Unit (IU) arrives, we track all the good stuff
-+ * here
-+ */
-+struct iu_entry {
-+	union viosrp_iu *iu;
-+	struct server_adapter *adapter;
-+	struct list_head next;
-+	dma_addr_t iu_token;
-+	int aborted;
-+	struct {
-+		dma_addr_t remote_token;
-+		char *data_buffer;
-+		dma_addr_t data_token;
-+		long data_len;
-+		struct vdev *vd;
-+		char in_use:1;
-+		char diunder:1;
-+		char diover:1;
-+		char dounder:1;
-+		char doover:1;
-+		char write:1;
-+		char linked:1;
-+		int data_out_residual_count;
-+		int data_in_residual_count;
-+		int ioerr;
-+	} req;
-+};
-+
-+/* 
-+ * a pool of ius for use 
-+ */
-+struct iu_pool {
-+	spinlock_t lock;
-+	struct list_head iu_entries;
-+	struct iu_entry *list;
-+	union viosrp_iu *iu_storage;
-+	dma_addr_t iu_token;
-+	u32 size;
-+};
-+
-+/*
-+ * Represents a single device that someone told us about
-+ * that we treat as a LUN
-+ */
-+struct vdev {
-+	struct list_head list;
-+	char type;		/* 'B' for block, 'S' for SCSI */
-+	atomic_t refcount;
-+	int disabled;
-+	u64 lun;
-+	struct kobject kobj;
-+	struct {
-+		char device_name[TARGET_MAX_NAME_LEN];
-+		struct block_device *bdev;
-+		long blksize;
-+		long lastlba;
-+		int ro;
-+	} b;
-+};
-+
-+/*
-+ * Represents a bus.  target #'s in SCSI are 6 bits long,
-+ * so you can have 64 targets per bus
-+ */
-+#define TARGETS_PER_BUS (64)
-+#define BUS_PER_ADAPTER (8)
-+struct vbus {
-+	struct vdev *vdev[TARGETS_PER_BUS];
-+	atomic_t num_targets;
-+	struct kobject kobj;
-+	int bus_num;
-+};
-+
-+/*
-+ * Buffer cache
-+ */
-+struct dma_buffer {
-+	dma_addr_t token;
-+	char *addr;
-+	size_t len;
-+};
-+#define DMA_BUFFER_CACHE_SIZE (16)
-+#define DMA_BUFFER_INIT_COUNT (4)
-+#define DMA_BUFFER_INIT_LEN (PAGE_SIZE*16)
-+
-+/* all driver data associated with a host adapter */
-+struct server_adapter {
-+	struct device *dev;
-+	struct vio_dev *dma_dev;
-+	struct crq_queue queue;
-+	struct work_struct crq_task;
-+	struct tasklet_struct endio_tasklet;
-+	struct iu_pool pool;
-+	spinlock_t lock;
-+	struct bio *bio_done;
-+	struct bio *bio_donetail;
-+	struct list_head inflight;
-+	struct vbus *vbus[8];
-+	int nvdevs;
-+	char name[32];
-+	unsigned long liobn;
-+	unsigned long riobn;
-+
-+	atomic_t num_buses;
-+	struct kobject stats_kobj;
-+
-+	/* This ugly expression allocates a bit array of 
-+	 * in-use flags large enough for the number of buffers
-+	 */
-+	unsigned long dma_buffer_use[(DMA_BUFFER_CACHE_SIZE +
-+				      sizeof(unsigned long) - 1)
-+				     / sizeof(unsigned long)];
-+	struct dma_buffer dma_buffer[DMA_BUFFER_CACHE_SIZE];
-+
-+	/* Statistics only */
-+	atomic_t iu_count;	/* number allocated */
-+	atomic_t bio_count;	/* number allocated */
-+	atomic_t crq_processed;
-+	atomic_t interrupts;
-+	atomic_t read_processed;
-+	atomic_t write_processed;
-+	atomic_t buffers_allocated;
-+	atomic_t errors;
-+};
-+
-+/* 
-+ * Forward declarations
-+ */
-+static long send_rsp(struct iu_entry *iue, int status);
-+
-+/*
-+ * The following are lifted from usb.h
-+ */
-+#define DEBUG 1
-+#ifdef DEBUG
-+#define dbg(format, arg...) if (ibmvscsis_debug) printk(KERN_WARNING __FILE__ ": " format , ## arg)
-+#else
-+#define dbg(format, arg...) do {} while (0)
-+#endif
-+#define err(format, arg...) printk(KERN_ERR "ibmvscsis: " format , ## arg)
-+#define info(format, arg...) printk(KERN_INFO "ibmvscsis: " format  , ## arg)
-+#define warn(format, arg...) printk(KERN_WARNING "ibmvscsis: " format , ## arg)
-+
-+/* ==============================================================
-+ * Utility Routines
-+ * ==============================================================
-+ */
-+/*
-+ * return an 8 byte lun given a bus, target, lun.  
-+ * Today this only supports single level luns.  Should we add a level or a
-+ * 64 bit LUN as input to support multi-level luns?
-+ */
-+u64 make_lun(unsigned int bus, unsigned int target, unsigned int lun)
-+{
-+	u16 result = (0x8000 |
-+		      ((target & 0x003f) << 8) |
-+		      ((bus & 0x0007) << 5) | (lun & 0x001f));
-+	return ((u64) result) << 48;
-+}
-+
-+/*
-+ * Given an 8 byte LUN, return the first level bus/target/lun.
-+ * Today this doesn't support multi-level LUNs
-+ */
-+#define GETBUS(x) ((int)((((u64)(x)) >> 53) & 0x0007))
-+#define GETTARGET(x) ((int)((((u64)(x)) >> 56) & 0x003f))
-+#define GETLUN(x) ((int)((((u64)(x)) >> 48) & 0x001f))
-+
-+static u8 getcontrolbyte(u8 * cdb)
-+{
-+	return cdb[COMMAND_SIZE(cdb[0]) - 1];
-+}
-+
-+static u8 getlink(struct iu_entry *iue)
-+{
-+	return (getcontrolbyte(iue->iu->srp.cmd.cdb) & 0x01);
-+}
-+
-+/*
-+ * Given an SRP, figure out the data in length
-+ */
-+static int did_len(struct srp_cmd *cmd)
-+{
-+	struct memory_descriptor *md;
-+	struct indirect_descriptor *id;
-+	int offset = cmd->additional_cdb_len * 4;
-+
-+	switch (cmd->data_out_format) {
-+	case SRP_NO_BUFFER:
-+		offset += 0;
-+		break;
-+	case SRP_DIRECT_BUFFER:
-+		offset += sizeof(struct memory_descriptor);
-+		break;
-+	case SRP_INDIRECT_BUFFER:
-+		offset += sizeof(struct indirect_descriptor)
-+		    +
-+		    ((cmd->data_out_count -
-+		      1) * sizeof(struct memory_descriptor));
-+		break;
-+	default:
-+		err("client error. Invalid data_out_format %d\n",
-+		    cmd->data_out_format);
-+		return 0;
-+	}
-+
-+	switch (cmd->data_in_format) {
-+	case SRP_NO_BUFFER:
-+		return 0;
-+	case SRP_DIRECT_BUFFER:
-+		md = (struct memory_descriptor *)(cmd->additional_data +
-+						  offset);
-+		return md->length;
-+	case SRP_INDIRECT_BUFFER:
-+		id = (struct indirect_descriptor *)(cmd->additional_data +
-+						    offset);
-+		return id->total_length;
-+	default:
-+		err("client error.  Invalid data_in_format %d\n",
-+		    cmd->data_in_format);
-+		return 0;
-+	}
-+}
-+
-+/* 
-+ * We keep a pool of IUs, this routine builds the pool.  The pool is 
-+ * per-adapter.  The size of the pool is negotiated as part of the SRP
-+ * login, where we negotiate the number of requests (IUs) the client
-+ * can send us.  This routine is not synchronized.
-+ */
-+static int initialize_iu_pool(struct server_adapter *adapter, int size)
-+{
-+	struct iu_pool *pool = &adapter->pool;
-+	int i;
-+
-+	pool->size = size;
-+	pool->lock = SPIN_LOCK_UNLOCKED;
-+	INIT_LIST_HEAD(&pool->iu_entries);
-+
-+	pool->list = kmalloc(pool->size * sizeof(*pool->list), GFP_KERNEL);
-+	if (!pool->list) {
-+		err("Error: Cannot allocate memory for IU list\n");
-+		return -ENOMEM;
-+	}
-+	memset(pool->list, 0x00, pool->size * sizeof(*pool->list));
-+
-+	pool->iu_storage =
-+	    dma_alloc_coherent(adapter->dev,
-+			       pool->size * sizeof(*pool->iu_storage),
-+			       &pool->iu_token, 0);
-+	if (!pool->iu_storage) {
-+		err("Error: Cannot allocate memory for IU pool\n");
-+		kfree(pool->list);
-+		return -ENOMEM;
-+	}
-+
-+	for (i = 0; i < pool->size; ++i) {
-+		pool->list[i].iu = pool->iu_storage + i;
-+		pool->list[i].iu_token =
-+		    pool->iu_token + sizeof(*pool->iu_storage) * i;
-+		pool->list[i].adapter = adapter;
-+		list_add_tail(&pool->list[i].next, &pool->iu_entries);
-+	}
-+
-+	return 0;
-+}
-+
-+/*
-+ * Free the pool we allocated in initialize_iu_pool
-+ */
-+static void release_iu_pool(struct server_adapter *adapter)
-+{
-+	struct iu_pool *pool = &adapter->pool;
-+	int i, in_use = 0;
-+	for (i = 0; i < pool->size; ++i)
-+		if (pool->list[i].req.in_use)
-+			++in_use;
-+	if (in_use)
-+		err("Releasing event pool with %d events still in use?\n", 
-+		    in_use);
-+	kfree(pool->list);
-+	dma_free_coherent(adapter->dev, pool->size * sizeof(*pool->iu_storage),
-+			  pool->iu_storage, pool->iu_token);
-+}
-+
-+/*
-+ * Get an IU from the pool.  Return NULL of the pool is empty.  This
-+ * routine is syncronized by a lock.  The routine sets all the important
-+ * fields to 0
-+ */
-+static struct iu_entry *get_iu(struct server_adapter *adapter)
-+{
-+	struct iu_entry *e;
-+	unsigned long flags;
-+
-+	spin_lock_irqsave(&adapter->pool.lock, flags);
-+	if (!list_empty(&adapter->pool.iu_entries)) {
-+		e = list_entry(adapter->pool.iu_entries.next, struct iu_entry,
-+			       next);
-+		list_del(adapter->pool.iu_entries.next);
-+
-+		if (e->req.in_use) {
-+			err("Found in-use iue in free pool!");
-+		}
-+
-+		memset(&e->req, 0x00, sizeof(e->req));
-+
-+		e->req.in_use = 1;
-+	} else {
-+		e = NULL;
-+	}
-+
-+	spin_unlock_irqrestore(&adapter->pool.lock, flags);
-+	atomic_inc(&adapter->iu_count);
-+	return e;
-+}
-+
-+/* 
-+ * Return an IU to the pool.  This routine is synchronized
-+ */
-+static void free_iu(struct iu_entry *iue)
-+{
-+	unsigned long flags;
-+	if (iue->req.vd) {
-+		atomic_dec(&iue->req.vd->refcount);
-+	}
-+
-+	spin_lock_irqsave(&iue->adapter->pool.lock, flags);
-+	if (iue->req.in_use == 0) {
-+		warn("Internal error, freeing iue twice!\n");
-+	} else {
-+		iue->req.in_use = 0;
-+		list_add_tail(&iue->next, &iue->adapter->pool.iu_entries);
-+	}
-+	spin_unlock_irqrestore(&iue->adapter->pool.lock, flags);
-+	atomic_dec(&iue->adapter->iu_count);
-+}
-+
-+/*
-+ * Get a CRQ from the inter-partition queue.
-+ */
-+static struct viosrp_crq *crq_queue_next_crq(struct crq_queue *queue)
-+{
-+	struct viosrp_crq *crq;
-+	unsigned long flags;
-+
-+	spin_lock_irqsave(&queue->lock, flags);
-+	crq = &queue->msgs[queue->cur];
-+	if (crq->valid & 0x80) {
-+		if (++queue->cur == queue->size)
-+			queue->cur = 0;
-+	} else
-+		crq = NULL;
-+	spin_unlock_irqrestore(&queue->lock, flags);
-+
-+	return crq;
-+}
-+
-+/* 
-+ * Make the RDMA hypervisor call.  There should be a better way to do this
-+ * than inline assembler.
-+ * TODO: Fix the inline assembler
-+ */
-+static long h_copy_rdma(long length,
-+			unsigned long sliobn, unsigned long slioba,
-+			unsigned long dliobn, unsigned long dlioba)
-+{
-+	long lpar_rc = 0;
-+	__asm__ __volatile__(" li 3,0x110 \n\t"
-+			     " mr 4, %1 \n\t"
-+			     " mr 5, %2 \n\t"
-+			     " mr 6, %3 \n\t"
-+			     " mr 7, %4 \n\t"
-+			     " mr 8, %5 \n\t"
-+			     " .long 0x44000022 \n\t"
-+			     " mr %0, 3 \n\t":"=&r"(lpar_rc)
-+			     :"r"(length), "r"(sliobn), "r"(slioba),
-+			     "r"(dliobn), "r"(dlioba)
-+			     :"r0", "r3", "r4", "r5", "r6", "r7", "r8", "cr0",
-+			     "cr1", "ctr", "xer", "memory");
-+	return lpar_rc;
-+}
-+
-+/*
-+ * Send an SRP to another partition using the CRQ.
-+ */
-+static int send_srp(struct iu_entry *iue, u64 length)
-+{
-+	long rc, rc1;
-+	union {
-+		struct viosrp_crq cooked;
-+		u64 raw[2];
-+	} crq;
-+
-+	/* First copy the SRP */
-+	rc = h_copy_rdma(length,
-+			 iue->adapter->liobn,
-+			 iue->iu_token,
-+			 iue->adapter->riobn, iue->req.remote_token);
-+
-+	if (rc) {
-+		err("Error %ld transferring data to client\n", rc);
-+	}
-+
-+	crq.cooked.valid = 0x80;
-+	crq.cooked.format = VIOSRP_SRP_FORMAT;
-+	crq.cooked.reserved = 0x00;
-+	crq.cooked.timeout = 0x00;
-+	crq.cooked.IU_length = length;
-+	crq.cooked.IU_data_ptr = iue->iu->srp.generic.tag;
-+
-+	if (rc == 0) {
-+		crq.cooked.status = 0x99;	/* TODO: is this right? */
-+	} else {
-+		crq.cooked.status = 0x00;
-+	}
-+
-+	rc1 =
-+	    plpar_hcall_norets(H_SEND_CRQ, iue->adapter->dma_dev->unit_address,
-+			       crq.raw[0], crq.raw[1]);
-+
-+	if (rc1) {
-+		err("Error %ld sending response to client\n", rc1);
-+		return rc1;
-+	}
-+
-+	return rc;
-+}
-+
-+/*
-+ * Send data to a single SRP memory descriptor
-+ * Returns amount of data sent, or negative value on error
-+ */
-+static long send_md_data(dma_addr_t stoken, int len,
-+			 struct memory_descriptor *md,
-+			 struct server_adapter *adapter)
-+{
-+	int tosend;
-+	long rc;
-+
-+	if (len < md->length)
-+		tosend = len;
-+	else
-+		tosend = md->length;
-+
-+	rc = h_copy_rdma(tosend,
-+			 adapter->liobn,
-+			 stoken, adapter->riobn, md->virtual_address);
-+
-+	if (rc != H_Success) {
-+		err(" Error %ld transferring data to client\n", rc);
-+		return -1;
-+	}
-+
-+	return tosend;
-+}
-+
-+/*
-+ * Send data to the SRP data_in buffers
-+ * Returns amount of data sent, or negative value on error
-+ */
-+static long send_cmd_data(dma_addr_t stoken, int len, struct iu_entry *iue)
-+{
-+	struct srp_cmd *cmd = &iue->iu->srp.cmd;
-+	struct memory_descriptor *md;
-+	struct indirect_descriptor *id;
-+	int offset = 0;
-+	int total_length = 0;
-+	int i;
-+	int thislen;
-+	int bytes;
-+	int sentlen = 0;
-+
-+	offset = cmd->additional_cdb_len * 4;
-+
-+	switch (cmd->data_out_format) {
-+	case SRP_NO_BUFFER:
-+		offset += 0;
-+		break;
-+	case SRP_DIRECT_BUFFER:
-+		offset += sizeof(struct memory_descriptor);
-+		break;
-+	case SRP_INDIRECT_BUFFER:
-+		offset += sizeof(struct indirect_descriptor)
-+		    +
-+		    ((cmd->data_out_count -
-+		      1) * sizeof(struct memory_descriptor));
-+		break;
-+	default:
-+		err("client error: Invalid data_out_format %d\n",
-+		    cmd->data_out_format);
-+		return 0;
-+	}
-+
-+	switch (cmd->data_in_format) {
-+	case SRP_NO_BUFFER:
-+		return 0;
-+	case SRP_DIRECT_BUFFER:
-+		md = (struct memory_descriptor *)(cmd->additional_data +
-+						  offset);
-+		sentlen = send_md_data(stoken, len, md, iue->adapter);
-+		len -= sentlen;
-+		if (len) {
-+			iue->req.diover = 1;
-+			iue->req.data_in_residual_count = len;
-+		}
-+		return sentlen;
-+	}
-+
-+	if (cmd->data_in_format != SRP_INDIRECT_BUFFER) {
-+		err("client error Invalid data_in_format %d\n",
-+		    cmd->data_in_format);
-+		return 0;
-+	}
-+
-+	id = (struct indirect_descriptor *)(cmd->additional_data + offset);
-+
-+	total_length = id->total_length;
-+
-+	/* Work through the partial memory descriptor list */
-+	for (i = 0; ((i < cmd->data_in_count) && (len)); i++) {
-+		if (len > id->list[i].length) {
-+			thislen = id->list[i].length;
-+		} else {
-+			thislen = len;
-+		}
-+
-+		bytes =
-+		    send_md_data(stoken + sentlen, thislen, id->list + i,
-+				 iue->adapter);
-+		if (bytes < 0)
-+			return bytes;
-+
-+		if (bytes != thislen) {
-+			warn("Error: Tried to send %d, sent %d\n", thislen,
-+			     bytes);
-+		}
-+
-+		sentlen += bytes;
-+		total_length -= bytes;
-+		len -= bytes;
-+	}
-+
-+	if (len) {
-+		iue->req.diover = 1;
-+		iue->req.data_in_residual_count = len;
-+	}
-+
-+	return sentlen;
-+}
-+
-+/*
-+ * Get data from the other partition from a single SRP memory descriptor
-+ * Returns amount of data sent, or negative value on error
-+ */
-+static long get_md_data(dma_addr_t ttoken, int len,
-+			struct memory_descriptor *md,
-+			struct server_adapter *adapter)
-+{
-+	int toget;
-+	long rc;
-+
-+	if (len < md->length)
-+		toget = len;
-+	else
-+		toget = md->length;
-+
-+	rc = h_copy_rdma(toget,
-+			 adapter->riobn,
-+			 md->virtual_address, adapter->liobn, ttoken);
-+
-+	if (rc != H_Success) {
-+		err("Error %ld transferring data to client\n", rc);
-+		return -1;
-+	}
-+
-+	return toget;
-+}
-+
-+/*
-+ * Get data from an SRP data in area.
-+ * Returns amount of data sent, or negative value on error
-+ */
-+static long get_cmd_data(dma_addr_t stoken, int len, struct iu_entry *iue)
-+{
-+	struct srp_cmd *cmd = &iue->iu->srp.cmd;
-+	struct memory_descriptor *md;
-+	struct indirect_descriptor *id;
-+	int offset = 0;
-+	int total_length = 0;
-+	int i;
-+	int thislen;
-+	int bytes;
-+	int sentlen = 0;
-+
-+	offset = cmd->additional_cdb_len * 4;
-+
-+	switch (cmd->data_out_format) {
-+	case SRP_NO_BUFFER:
-+		return 0;
-+		break;
-+	case SRP_DIRECT_BUFFER:
-+		md = (struct memory_descriptor *)(cmd->additional_data +
-+						  offset);
-+		return get_md_data(stoken, len, md, iue->adapter);
-+		break;
-+	}
-+
-+	if (cmd->data_out_format != SRP_INDIRECT_BUFFER) {
-+		err("client error: Invalid data_out_format %d\n",
-+		    cmd->data_out_format);
-+		return 0;
-+	}
-+
-+	id = (struct indirect_descriptor *)(cmd->additional_data + offset);
-+
-+	total_length = id->total_length;
-+
-+	/* Work through the partial memory descriptor list */
-+	for (i = 0; ((i < cmd->data_out_count) && (len)); i++) {
-+		if (len > id->list[i].length) {
-+			thislen = id->list[i].length;
-+		} else {
-+			thislen = len;
-+		}
-+
-+		bytes =
-+		    get_md_data(stoken + sentlen, thislen, id->list + i,
-+				iue->adapter);
-+		if (bytes < 0)
-+			return bytes;
-+
-+		if (bytes != thislen) {
-+			err("Partial data sent to client (%d/%d)\n", bytes, thislen);
-+		}
-+
-+		sentlen += bytes;
-+		total_length -= bytes;
-+		len -= bytes;
-+	}
-+
-+	return sentlen;
-+}
-+
-+/*
-+ * Get some data buffers to start.  This doesn't lock the adapter structure!
-+ */
-+static void init_data_buffer(struct server_adapter *adapter)
-+{
-+	int i;
-+
-+	for (i = 0; i < DMA_BUFFER_INIT_COUNT; i++) {
-+		if (adapter->dma_buffer[i].addr == NULL) {
-+			adapter->dma_buffer[i].addr = (char *)
-+			    dma_alloc_coherent(adapter->dev,
-+					       DMA_BUFFER_INIT_LEN,
-+					       &adapter->dma_buffer[i].token,
-+					       0);
-+			adapter->dma_buffer[i].len = DMA_BUFFER_INIT_LEN;
-+			dbg("data buf %p token %8.8x, len %ld\n",
-+			    adapter->dma_buffer[i].addr,
-+			    adapter->dma_buffer[i].token,
-+			    adapter->dma_buffer[i].len);
-+			atomic_inc(&adapter->buffers_allocated);
-+		}
-+	}
-+
-+	return;
-+}
-+
-+/*
-+ * Get a memory buffer that includes a mapped TCE.  
-+ */
-+static void get_data_buffer(char **buffer, dma_addr_t * data_token, size_t len,
-+			    struct server_adapter *adapter)
-+{
-+	int i;
-+
-+	for (i = 0; i < DMA_BUFFER_CACHE_SIZE; i++) {
-+		if ((adapter->dma_buffer[i].addr) &&
-+		    (adapter->dma_buffer[i].len >= len) &&
-+		    (!test_and_set_bit(i, adapter->dma_buffer_use))) {
-+			*buffer = adapter->dma_buffer[i].addr;
-+			*data_token = adapter->dma_buffer[i].token;
-+			return;
-+		}
-+	}
-+
-+	/* Couldn't get a buffer!  Try and get a new one */
-+	*buffer = (char *)dma_alloc_coherent(adapter->dev, len, data_token, 0);
-+	atomic_inc(&adapter->buffers_allocated);
-+	dbg("get:  %p, %8.8x, %ld\n", *buffer, *data_token, len);
-+	return;
-+}
-+
-+/*
-+ * Free a memory buffer that includes a mapped TCE.  
-+ */
-+static void free_data_buffer(char *buffer, dma_addr_t data_token, size_t len,
-+			     struct server_adapter *adapter)
-+{
-+	int i;
-+
-+	/* First see if this buffer is already in the cache */
-+	for (i = 0; i < DMA_BUFFER_CACHE_SIZE; i++) {
-+		if (adapter->dma_buffer[i].addr == buffer) {
-+			if (adapter->dma_buffer[i].token != data_token) {
-+				err("Inconsistent data buffer pool info!\n");
-+			}
-+			if (!test_and_clear_bit(i, adapter->dma_buffer_use)) {
-+				err("Freeing data buffer twice!\n");
-+			}
-+			return;
-+		}
-+	}
-+
-+	/* See if there is an empty slot in our list */
-+	for (i = 0; i < DMA_BUFFER_CACHE_SIZE; i++) {
-+		if (!test_and_set_bit(i, adapter->dma_buffer_use)) {
-+			if (adapter->dma_buffer[i].addr == NULL) {
-+				adapter->dma_buffer[i].addr = buffer;
-+				adapter->dma_buffer[i].token = data_token;
-+				adapter->dma_buffer[i].len = len;
-+				clear_bit(i, adapter->dma_buffer_use);
-+				return;
-+			} else {
-+				clear_bit(i, adapter->dma_buffer_use);
-+			}
-+		}
-+	}
-+
-+	/* Now see if there is a smaller buffer we should throw out */
-+	for (i = 0; i < DMA_BUFFER_CACHE_SIZE; i++) {
-+		if (!test_and_set_bit(i, adapter->dma_buffer_use)) {
-+			if (adapter->dma_buffer[i].len < len) {
-+				dbg("fre1: %p, %8.8x, %ld\n",
-+				    adapter->dma_buffer[i].addr,
-+				    adapter->dma_buffer[i].token,
-+				    adapter->dma_buffer[i].len);
-+
-+				dma_free_coherent(adapter->dev,
-+						  adapter->dma_buffer[i].len,
-+						  adapter->dma_buffer[i].addr,
-+						  adapter->dma_buffer[i].token);
-+
-+				atomic_dec(&adapter->buffers_allocated);
-+
-+				adapter->dma_buffer[i].addr = buffer;
-+				adapter->dma_buffer[i].token = data_token;
-+				adapter->dma_buffer[i].len = len;
-+				clear_bit(i, adapter->dma_buffer_use);
-+				return;
-+			} else {
-+				clear_bit(i, adapter->dma_buffer_use);
-+			}
-+		}
-+	}
-+
-+	/* No space to cache this.  Give it back to the kernel */
-+	dbg("fre2: %p, %8.8x, %ld\n", buffer, data_token, len);
-+	dma_free_coherent(adapter->dev, len, buffer, data_token);
-+	atomic_dec(&adapter->buffers_allocated);
-+}
-+
-+/*
-+ * Release all the data buffers
-+ */
-+static void release_data_buffer(struct server_adapter *adapter)
-+{
-+	int i;
-+	int free_in_use = 0;
-+
-+	for (i = 0; i < DMA_BUFFER_INIT_COUNT; i++) {
-+		if (adapter->dma_buffer[i].addr != NULL) {
-+			if (test_bit(i, adapter->dma_buffer_use)) {
-+				free_in_use++;
-+			}
-+			dma_free_coherent(adapter->dev,
-+					  adapter->dma_buffer[i].len,
-+					  adapter->dma_buffer[i].addr,
-+					  adapter->dma_buffer[i].token);
-+
-+			atomic_dec(&adapter->buffers_allocated);
-+		}
-+	}
-+
-+	if (free_in_use) {
-+		err("Freeing %d in-use data buffers\n", free_in_use);
-+	}
-+	return;
-+}
-+
-+/*
-+ * the routine that gets called on end_io of our bios.  We basically
-+ * schedule the processing to be done in our task, since we don't want
-+ * do things like RDMA in someone else's interrupt handler
-+ *
-+ * Each iu request may result in multiple bio requests.  only proceed
-+ * when all the bio requests have done.
-+ */
-+static int ibmvscsis_end_io(struct bio *bio, unsigned int nbytes, int error)
-+{
-+	struct iu_entry *iue = (struct iu_entry *)bio->bi_private;
-+	struct server_adapter *adapter = iue->adapter;
-+	unsigned long flags;
-+
-+	if (bio->bi_size)
-+		return 1;
-+
-+	if (!test_bit(BIO_UPTODATE, &bio->bi_flags)) {
-+		iue->req.ioerr = 1;
-+	};
-+
-+	/* Add the bio to the done queue */
-+	spin_lock_irqsave(&adapter->lock, flags);
-+	if (adapter->bio_donetail) {
-+		adapter->bio_donetail->bi_next = bio;
-+		adapter->bio_donetail = bio;
-+	} else
-+		adapter->bio_done = adapter->bio_donetail = bio;
-+	bio->bi_next = NULL;
-+	spin_unlock_irqrestore(&adapter->lock, flags);
-+
-+	/* Schedule the task */
-+	tasklet_schedule(&adapter->endio_tasklet);
-+
-+	return 0;
-+}
-+
-+/*
-+ * Find the vdev structure from the LUN field in an SRP IUE
-+ * Note that this routine bumps a refcount field in the vdev.
-+ * Normally this is done when free_iu is called.
-+ */
-+static struct vdev *find_device(struct iu_entry *iue)
-+{
-+	u16 *lun = (u16 *) & iue->iu->srp.cmd.lun;
-+	u32 bus = (lun[0] & 0x00E0) >> 5;
-+	u32 target = (lun[0] & 0x3F00) >> 8;
-+	u32 slun = (lun[0] & 0x001F);
-+	struct vdev *vd;
-+	unsigned long flags;
-+
-+	/* If asking for a lun other than 0, return nope */
-+	if (slun) {
-+		return NULL;
-+	}
-+
-+	/* Only from SRP CMD */
-+	if (iue->iu->srp.generic.type != SRP_CMD_TYPE)
-+		return NULL;
-+
-+	/* if not a recognized LUN format, return NULL */
-+	if ((lun[0] & 0xC000) != 0x8000)
-+		return NULL;
-+
-+	spin_lock_irqsave(&iue->adapter->lock, flags);
-+	if (iue->adapter->vbus[bus] == NULL) {
-+		spin_unlock_irqrestore(&iue->adapter->lock, flags);
-+		return NULL;
-+	}
-+
-+	vd = iue->adapter->vbus[bus]->vdev[target];
-+
-+	if ((vd == NULL) || (vd->disabled)) {
-+		spin_unlock_irqrestore(&iue->adapter->lock, flags);
-+		return NULL;
-+	}
-+
-+	if (vd) {
-+		atomic_inc(&vd->refcount);
-+	}
-+	spin_unlock_irqrestore(&iue->adapter->lock, flags);
-+
-+	return vd;
-+}
-+
-+/*
-+ * Process BH buffer completions.  When the end_io routine gets called 
-+ * we queue the bio on an internal queue and start a task to process them
-+ */
-+static void endio_task(unsigned long data)
-+{
-+	struct server_adapter *adapter = (struct server_adapter *)data;
-+	struct iu_entry *iue= NULL;
-+	struct bio *bio;
-+	int bytes;
-+	unsigned long flags;
-+
-+	do {
-+		spin_lock_irqsave(&adapter->lock, flags);
-+		if ((bio = adapter->bio_done)) {
-+			if (bio == adapter->bio_donetail)
-+				adapter->bio_donetail = NULL;
-+			adapter->bio_done = bio->bi_next;
-+			bio->bi_next = NULL;
-+		}
-+		if (bio) {
-+			/* Remove this iue from the in-flight list */
-+			iue = (struct iu_entry *)bio->bi_private;
-+			if (!iue->req.in_use) {
-+				err("Internal error! freed iue in bio!!!\n");
-+				spin_unlock_irqrestore(&adapter->lock, flags);
-+				return;
-+			}
-+				
-+			list_del(&iue->next);
-+		}
-+
-+		spin_unlock_irqrestore(&adapter->lock, flags);
-+
-+		if (bio) {
-+			/* Send back the SRP and data if this request was NOT
-+			 * aborted 
-+			 */
-+			if (!iue->aborted) {
-+
-+				if (!iue->req.ioerr) {
-+					/* return data if this was a read */
-+					if (!iue->req.write) {
-+						bytes =
-+						    send_cmd_data(iue->req.
-+								  data_token,
-+								  iue->req.
-+								  data_len,
-+								  iue);
-+						if (bytes != iue->req.data_len) {
-+							err("Error sending data "
-+							    "on response "
-+							    "(tried %d, sent %d\n", 
-+							    bio->bi_size, bytes);
-+							send_rsp(iue,
-+								 SENSE_ABORT);
-+						} else {
-+							send_rsp(iue,
-+								 SENSE_SUCCESS);
-+						}
-+					} else {
-+						send_rsp(iue, SENSE_SUCCESS);
-+					}
-+				} else {
-+					err("Block operation failed\n");
-+					/*print_command(iue->iu->srp.cmd.cdb);*/
-+					send_rsp(iue, SENSE_DEVICE_FAULT);
-+				}
-+			}
-+
-+			spin_lock_irqsave(&adapter->lock, flags);
-+			free_data_buffer(iue->req.data_buffer,
-+					 iue->req.data_token, iue->req.data_len,
-+					 adapter);
-+			spin_unlock_irqrestore(&adapter->lock, flags);
-+
-+			free_iu(iue);
-+
-+			bio_put(bio);
-+			atomic_dec(&adapter->bio_count);
-+		}
-+	} while (bio);
-+}
-+
-+/* ==============================================================
-+ * SCSI Command Emulation Routines
-+ * ==============================================================
-+ */
-+
-+/*
-+ * Process an inquiry SCSI Command
-+ */
-+static void process_inquiry(struct iu_entry *iue)
-+{
-+	struct inquiry_data *id;
-+	dma_addr_t data_token;
-+	u8 *raw_id;
-+	int bytes;
-+
-+	id = (struct inquiry_data *)dma_alloc_coherent(iue->adapter->dev,
-+						       sizeof(*id),
-+						       &data_token, 0);
-+	raw_id = (u8 *)id;
-+	memset(id, 0x00, sizeof(*id));
-+
-+	/* If we have a valid device */
-+	if (iue->req.vd) {
-+		/* Standard inquiry page */
-+		if ((iue->iu->srp.cmd.cdb[1] == 0x00) &&
-+		    (iue->iu->srp.cmd.cdb[2] == 0x00)) {
-+			dbg("  inquiry returning device\n");
-+			id->qual_type = 0x00;	/* Direct Access    */
-+			id->rmb_reserve = 0x00;	/* TODO: CD is removable  */
-+			id->version = 0x84;	/* ISO/IE                 */
-+			id->aerc_naca_hisup_format = 0x22;/* naca & fmt 0x02 */
-+			id->addl_len = sizeof(*id) - 4;	
-+			id->bque_encserv_vs_multip_mchngr_reserved = 0x00;
-+			id->reladr_reserved_linked_cmdqueue_vs = 0x02;/*CMDQ*/
-+			memcpy(id->vendor, "IBM     ", 8);
-+			memcpy(id->product, "VSCSI blkdev    ", 16);
-+			memcpy(id->revision, "0001", 4);
-+			snprintf(id->unique,sizeof(id->unique),
-+				 "IBM-VSCSI-%s-P%d-%x-%d-%d-%d\n",
-+				 system_id,
-+				 partition_number,
-+				 iue->adapter->dma_dev->unit_address,
-+				 GETBUS(iue->req.vd->lun),
-+				 GETTARGET(iue->req.vd->lun),
-+				 GETLUN(iue->req.vd->lun));
-+		} else if ((iue->iu->srp.cmd.cdb[1] == 0x01) &&
-+			   (iue->iu->srp.cmd.cdb[2] == 0x00)) {
-+			/* Supported VPD pages */
-+			raw_id[0] = 0x00; /* qualifier & type */
-+			raw_id[1] = 0x80; /* page */
-+			raw_id[2] = 0x00; /* reserved */
-+			raw_id[3] = 0x03; /* length */
-+			raw_id[4] = 0x00; /* page 0 */
-+			raw_id[5] = 0x80; /* serial number page */
-+		} else if ((iue->iu->srp.cmd.cdb[1] == 0x01) &&
-+			   (iue->iu->srp.cmd.cdb[2] == 0x80)) {
-+			/* serial number page */
-+			raw_id[0] = 0x00; /* qualifier & type */
-+			raw_id[1] = 0x80; /* page */
-+			raw_id[2] = 0x00; /* reserved */
-+			snprintf((char *)(raw_id+4),
-+				 sizeof(*id)-4,
-+				 "IBM-VSCSI-%s-P%d-%x-%d-%d-%d\n",
-+				 system_id,
-+				 partition_number,
-+				 iue->adapter->dma_dev->unit_address,
-+				 GETBUS(iue->req.vd->lun),
-+				 GETTARGET(iue->req.vd->lun),
-+				 GETLUN(iue->req.vd->lun));
-+			raw_id[3] = strlen((char *)raw_id+4);
-+		} else {
-+			/* Some unsupported data */
-+			send_rsp(iue, SENSE_INVALID_FIELD);
-+			free_iu(iue);
-+			return;
-+		}
-+	} else {
-+		dbg("  inquiry returning no device\n");
-+		id->qual_type = 0x7F;	/* Not supported, no device */
-+	}
-+
-+	bytes = send_cmd_data(data_token, sizeof(*id), iue);
-+
-+	dma_free_coherent(iue->adapter->dev, sizeof(*id), id, data_token);
-+
-+	if (bytes < 0) {
-+		send_rsp(iue, SENSE_DEVICE_FAULT);
-+	} else {
-+		send_rsp(iue, SENSE_SUCCESS);
-+	}
-+
-+	free_iu(iue);
-+}
-+
-+/*
-+ * Handle an I/O.  Called by WRITE6, WRITE10, etc
-+ */
-+static void process_rw(char *cmd, int rw, struct iu_entry *iue, long lba,
-+		       long len)
-+{
-+	char *buffer;
-+	struct bio *bio;
-+	int bytes;
-+	int num_biovec;
-+	int cur_biovec;
-+	long flags;
-+
-+	dbg("%s %16.16lx[%d:%d:%d][%s] lba %ld len %ld reladr %d link %d\n",
-+	    cmd,
-+	    iue->iu->srp.cmd.lun,
-+	    GETBUS(iue->iu->srp.cmd.lun),
-+	    GETTARGET(iue->iu->srp.cmd.lun),
-+	    GETLUN(iue->iu->srp.cmd.lun),
-+	    iue->req.vd->b.device_name,
-+	    lba,
-+	    len / iue->req.vd->b.blksize,
-+	    iue->iu->srp.cmd.cdb[1] & 0x01, iue->req.linked);
-+
-+	if (rw == WRITE) {
-+		atomic_inc(&iue->adapter->write_processed);
-+	} else if (rw == READ) {
-+		atomic_inc(&iue->adapter->read_processed);
-+	} else {
-+		err("Major internal error...rw not read or write\n");
-+		send_rsp(iue, SENSE_DEVICE_FAULT);
-+
-+		free_iu(iue);
-+		return;
-+	}
-+
-+	if (len == 0) {
-+		warn("Zero length I/O\n");
-+		send_rsp(iue, SENSE_INVALID_CMD);
-+
-+		free_iu(iue);
-+		return;
-+	}
-+
-+	/* Writing to a read-only device */
-+	if ((rw == WRITE) && (iue->req.vd->b.ro)) {
-+		warn("WRITE to read-only device\n");
-+		send_rsp(iue, SENSE_WRITE_PROT);
-+
-+		free_iu(iue);
-+		return;
-+	}
-+
-+	get_data_buffer(&buffer, &iue->req.data_token, len, iue->adapter);
-+	iue->req.data_buffer = buffer;
-+	iue->req.data_len = len;
-+	if (buffer == NULL) {
-+		err("Not able to get a data buffer (%lu pages)\n",
-+		    len / PAGE_SIZE);
-+		send_rsp(iue, SENSE_DEVICE_FAULT);
-+
-+		free_iu(iue);
-+		return;
-+	}
-+
-+	/* if reladr */
-+	if (iue->iu->srp.cmd.cdb[1] & 0x01) {
-+		lba = lba + iue->req.vd->b.lastlba;
-+	}
-+
-+	/* If this command is linked, Keep this lba */
-+	if (iue->req.linked) {
-+		iue->req.vd->b.lastlba = lba;
-+	} else {
-+		iue->req.vd->b.lastlba = 0;
-+	}
-+
-+	if (rw == WRITE) {
-+		iue->req.write = 1;
-+		/* Get the data */
-+		bytes = get_cmd_data(iue->req.data_token, len, iue);
-+		if (bytes != len) {
-+			err("Error transferring data\n");
-+			send_rsp(iue, SENSE_DEVICE_FAULT);
-+
-+			free_iu(iue);
-+			return;
-+		}
-+	}
-+
-+	num_biovec = (len - 1) / PAGE_CACHE_SIZE + 1;
-+
-+	bio = bio_alloc(GFP_ATOMIC, num_biovec);
-+	if (!bio) {
-+		/* Ouch.  couldn't get a bio.  Mark this I/O as 
-+		 * in error, then decrement the outstanding bio.
-+		 * If there are still outstanding bio, they will send
-+		 * the error and free the IU.  If there are none, we
-+		 * should do it here
-+		 */
-+		iue->req.ioerr = 1;
-+		err("Not able to allocate a bio\n");
-+		send_rsp(iue, SENSE_DEVICE_FAULT);
-+		free_iu(iue);
-+		return;
-+	}
-+
-+	iue->aborted = 0;
-+	spin_lock_irqsave(&iue->adapter->lock, flags);
-+	list_add_tail(&iue->next, &iue->adapter->inflight);
-+	spin_unlock_irqrestore(&iue->adapter->lock, flags);
-+
-+	atomic_inc(&iue->adapter->bio_count);
-+	bio->bi_size = len;
-+	bio->bi_bdev = iue->req.vd->b.bdev;
-+	bio->bi_sector = lba;
-+	bio->bi_end_io = &ibmvscsis_end_io;
-+	bio->bi_private = iue;
-+	bio->bi_rw = (rw == WRITE) ? 1 : 0;
-+	bio->bi_phys_segments = 1;
-+	bio->bi_hw_segments = 1;
-+
-+	/* This all assumes that the buffers we get are page-aligned */
-+	for (cur_biovec = 0; cur_biovec < num_biovec; cur_biovec++) {
-+		long thislen;
-+
-+		if (len > PAGE_CACHE_SIZE) {
-+			thislen = PAGE_CACHE_SIZE;
-+		} else {
-+			thislen = len;
-+		}
-+
-+		bio->bi_io_vec[cur_biovec].bv_page = virt_to_page(buffer);
-+		bio->bi_io_vec[cur_biovec].bv_len = thislen;
-+		bio->bi_io_vec[cur_biovec].bv_offset =
-+		    (unsigned long)buffer & (PAGE_SIZE - 1);
-+		bio->bi_vcnt++;
-+
-+		len -= thislen;
-+		buffer += thislen;
-+	}
-+	generic_make_request(bio);
-+}
-+
-+/*
-+ * Process a READ6
-+ */
-+static void processRead6(struct iu_entry *iue)
-+{
-+	long lba = (*((u32 *) (iue->iu->srp.cmd.cdb))) & 0x001FFFFF;
-+	long len = iue->iu->srp.cmd.cdb[4];
-+
-+	/* Length of 0 indicates 256 */
-+	if (len == 0) {
-+		len = 256;
-+	}
-+
-+	len = len * iue->req.vd->b.blksize;
-+
-+	process_rw("Read6", READ, iue, lba, len);
-+}
-+
-+/*
-+ * Process a READ10
-+ */
-+static void processRead10(struct iu_entry *iue)
-+{
-+	long lba = *((u32 *) (iue->iu->srp.cmd.cdb + 2));
-+	long len =
-+	    *((u16 *) (iue->iu->srp.cmd.cdb + 7)) * iue->req.vd->b.blksize;
-+
-+	process_rw("Read10", READ, iue, lba, len);
-+}
-+
-+/*
-+ * Process a READ10
-+ */
-+static void processRead12(struct iu_entry *iue)
-+{
-+	long lba = *((u32 *) (iue->iu->srp.cmd.cdb + 2));
-+	long len =
-+	    *((u32 *) (iue->iu->srp.cmd.cdb + 6)) * iue->req.vd->b.blksize;
-+
-+	process_rw("Read12", READ, iue, lba, len);
-+}
-+
-+static void processWrite6(struct iu_entry *iue)
-+{
-+	long lba = (*((u32 *) (iue->iu->srp.cmd.cdb))) & 0x001FFFFF;
-+	long len = iue->iu->srp.cmd.cdb[4];
-+
-+	/* Length of 0 indicates 256 */
-+	if (len == 0) {
-+		len = 256;
-+	}
-+
-+	len = len * iue->req.vd->b.blksize;
-+
-+	process_rw("Write6", WRITE, iue, lba, len);
-+}
-+
-+static void processWrite10(struct iu_entry *iue)
-+{
-+	long lba = *((u32 *) (iue->iu->srp.cmd.cdb + 2));
-+	long len =
-+	    *((u16 *) (iue->iu->srp.cmd.cdb + 7)) * iue->req.vd->b.blksize;
-+
-+	process_rw("Write10", WRITE, iue, lba, len);
-+}
-+
-+static void processWrite12(struct iu_entry *iue)
-+{
-+	long lba = *((u32 *) (iue->iu->srp.cmd.cdb + 2));
-+	long len =
-+	    *((u32 *) (iue->iu->srp.cmd.cdb + 6)) * iue->req.vd->b.blksize;
-+
-+	process_rw("Write12", WRITE, iue, lba, len);
-+}
-+
-+/*
-+ * Handle Read Capacity
-+ */
-+static void processReadCapacity(struct iu_entry *iue)
-+{
-+	struct ReadCapacityData {
-+		u32 blocks;
-+		u32 blocksize;
-+	} *cap;
-+	dma_addr_t data_token;
-+	int bytes;
-+
-+	cap = (struct ReadCapacityData *)dma_alloc_coherent(iue->adapter->dev,
-+							    sizeof(*cap),
-+							    &data_token, 0);
-+
-+	/* return block size and last valid block */
-+	cap->blocksize = iue->req.vd->b.blksize;
-+	cap->blocks = iue->req.vd->b.bdev->bd_inode->i_size
-+	    / iue->req.vd->b.blksize 
-+	    - 1;
-+
-+	info("Reporting capacity as %u block of size %u\n", cap->blocks,
-+	     cap->blocksize);
-+
-+	bytes = send_cmd_data(data_token, sizeof(*cap), iue);
-+
-+	dma_free_coherent(iue->adapter->dev, sizeof(*cap), cap, data_token);
-+
-+	if (bytes != sizeof(*cap)) {
-+		err("Error sending read capacity data. bytes %d, wanted %ld\n",
-+		    bytes, sizeof(*cap));
-+	}
-+
-+	send_rsp(iue, SENSE_SUCCESS);
-+
-+	free_iu(iue);
-+}
-+
-+/*
-+ * Process Mode Sense
-+ * TODO: I know scsiinfo asks for a bunch of mode pages not implemented here.
-+ *       Also, we need to act differently for virtual disk and virtual CD
-+ */
-+#define MODE_SENSE_BUFFER_SIZE (512)
-+static void processModeSense(struct iu_entry *iue)
-+{
-+	dma_addr_t data_token;
-+	int bytes;
-+
-+	u8 *mode = (u8 *) dma_alloc_coherent(iue->adapter->dev,
-+					     MODE_SENSE_BUFFER_SIZE,
-+					     &data_token, 0);
-+	/* which page */
-+	switch (iue->iu->srp.cmd.cdb[2]) {
-+	case 0:
-+	case 0x3f:
-+		mode[1] = 0x00;	/* Default medium */
-+		if (iue->req.vd->b.ro) {
-+			mode[2] = 0x80;	/* device specific  */
-+		} else {
-+			mode[2] = 0x00;	/* device specific  */
-+		}
-+		/* note the DPOFUA bit is set to zero! */
-+		mode[3] = 0x08;	/* block descriptor length */
-+		*((u32 *) & mode[4]) = iue->req.vd->b.bdev->bd_inode->i_size /
-+		    iue->req.vd->b.blksize;
-+		*((u32 *) & mode[8]) = iue->req.vd->b.blksize;
-+		bytes = mode[0] = 12;	/* length */
-+		break;
-+
-+	case 0x08:		/* Cache page */
-+		/* length should be 4 */
-+		if (iue->iu->srp.cmd.cdb[4] != 4
-+		    && iue->iu->srp.cmd.cdb[4] != 0x20) {
-+			send_rsp(iue, SENSE_INVALID_CMD);
-+			dma_free_coherent(iue->adapter->dev,
-+					  MODE_SENSE_BUFFER_SIZE,
-+					  mode, data_token);
-+			free_iu(iue);
-+			return;
-+		}
-+
-+		mode[1] = 0x00;	/* Default medium */
-+		if (iue->req.vd->b.ro) {
-+			mode[2] = 0x80;	/* device specific */
-+		} else {
-+			mode[2] = 0x00;	/* device specific */
-+		}
-+		/* note the DPOFUA bit is set to zero! */
-+		mode[3] = 0x08;	/* block descriptor length */
-+		*((u32 *) & mode[4]) = iue->req.vd->b.bdev->bd_inode->i_size /
-+		    iue->req.vd->b.blksize;
-+		*((u32 *) & mode[8]) = iue->req.vd->b.blksize;
-+
-+		/* Cache page */
-+		mode[12] = 0x08;	/* page */
-+		mode[13] = 0x12;	/* page length */
-+		mode[14] = 0x01;	/* no cache (0x04 for read/write cache) */
-+
-+		bytes = mode[0] = 12 + mode[13];	/* length */
-+		break;
-+	default:
-+		warn("Request for unknown mode page %d\n",
-+		     iue->iu->srp.cmd.cdb[2]);
-+		send_rsp(iue, SENSE_INVALID_CMD);
-+		dma_free_coherent(iue->adapter->dev,
-+				  MODE_SENSE_BUFFER_SIZE, mode, data_token);
-+		free_iu(iue);
-+		return;
-+	}
-+
-+	bytes = send_cmd_data(data_token, bytes, iue);
-+
-+	dma_free_coherent(iue->adapter->dev,
-+			  MODE_SENSE_BUFFER_SIZE, mode, data_token);
-+
-+	send_rsp(iue, SENSE_SUCCESS);
-+
-+	free_iu(iue);
-+	return;
-+}
-+
-+/*
-+ * Report LUNS command.
-+ */
-+static void processReportLUNs(struct iu_entry *iue)
-+{
-+	int listsize = did_len(&iue->iu->srp.cmd);
-+	dma_addr_t data_token;
-+	int index = 2;		/* Start after the two entries (length and LUN0) */
-+	int bus;
-+	int target;
-+	int bytes;
-+	unsigned long flags;
-+
-+	u64 *lunlist = (u64 *) dma_alloc_coherent(iue->adapter->dev,
-+						  listsize,
-+						  &data_token, 0);
-+
-+	memset(lunlist, 0x00, listsize);
-+
-+	/* work out list size in units of u64 */
-+	listsize = listsize / 8;
-+
-+	if (listsize < 1) {
-+		send_rsp(iue, SENSE_INVALID_CMD);
-+		free_iu(iue);
-+	}
-+
-+	spin_lock_irqsave(&iue->adapter->lock, flags);
-+
-+	/* send lunlist of size 1 when requesting lun is not all zeros */
-+	if (iue->iu->srp.cmd.lun != 0x0LL) {
-+		*lunlist = ((u64) 1 * 8) << 32;
-+		goto send_lunlist;
-+	}
-+
-+	/* return the total number of luns plus LUN0 in bytes */
-+	*lunlist = (((u64) ((iue->adapter->nvdevs + 1) * 8)) << 32);
-+
-+	dbg("reporting %d luns\n", iue->adapter->nvdevs + 1);
-+	/* loop through the bus */
-+	for (bus = 0; bus < BUS_PER_ADAPTER; bus++) {
-+		/* If this bus exists */
-+		if (iue->adapter->vbus[bus]) {
-+			/* loop through the targets */
-+			for (target = 0; target < TARGETS_PER_BUS; target++) {
-+				/* If the target exists */
-+				if (iue->adapter->vbus[bus]->vdev[target]) {
-+					if ((index < listsize) &&
-+					    (!iue->adapter->vbus[bus]->
-+					     vdev[target]->disabled)) {
-+						lunlist[index++] =
-+						    iue->adapter->vbus[bus]->
-+						    vdev[target]->lun;
-+						dbg("  lun %16.16lx\n",
-+						    iue->adapter->vbus[bus]->
-+						    vdev[target]->lun);
-+					}
-+				}
-+			}
-+		}
-+	}
-+
-+      send_lunlist:
-+	spin_unlock_irqrestore(&iue->adapter->lock, flags);
-+
-+	bytes = send_cmd_data(data_token, (index * 8), iue);
-+
-+	dma_free_coherent(iue->adapter->dev, listsize * 8, lunlist, data_token);
-+
-+	if (bytes != (index * 8)) {
-+		err("Error sending report luns data. bytes %d, wanted %d\n",
-+		    bytes, index * 4);
-+		send_rsp(iue, SENSE_ABORT);
-+	} else {
-+		send_rsp(iue, SENSE_SUCCESS);
-+	}
-+
-+	free_iu(iue);
-+	return;
-+}
-+
-+/*
-+ * Process an IU.  
-+ *
-+ * Note that THIS routine is responsible for returning the IU from the pool
-+ * The current assumption is that all the process routines called from here
-+ * are, in turn, responsible for freeing the IU
-+ */
-+static void process_cmd(struct iu_entry *iue)
-+{
-+	union viosrp_iu *iu = iue->iu;
-+
-+	iue->req.vd = find_device(iue);
-+
-+	if ((iue->req.vd == NULL) &&
-+	    (iu->srp.cmd.cdb[0] != REPORT_LUNS) &&
-+	    (iu->srp.cmd.cdb[0] != INQUIRY)) {
-+		dbg("Cmd %2.2x for unknown LUN %16.16lx\n",
-+		    iu->srp.cmd.cdb[0], iue->iu->srp.cmd.lun);
-+		send_rsp(iue, SENSE_INVALID_ID);
-+		free_iu(iue);
-+		return;
-+	}
-+
-+	iue->req.linked = getlink(iue);
-+
-+	switch (iu->srp.cmd.cdb[0]) {
-+	case READ_6:
-+		processRead6(iue);
-+		break;
-+	case READ_10:
-+		processRead10(iue);
-+		break;
-+	case READ_12:
-+		processRead12(iue);
-+		break;
-+	case WRITE_6:
-+		processWrite6(iue);
-+		break;
-+	case WRITE_10:
-+		processWrite10(iue);
-+		break;
-+	case WRITE_12:
-+		processWrite12(iue);
-+		break;
-+	case REPORT_LUNS:
-+		dbg("REPORT LUNS lun %16.16lx\n", iue->iu->srp.cmd.lun);
-+		processReportLUNs(iue);
-+		break;
-+	case INQUIRY:
-+		dbg("INQUIRY lun %16.16lx\n", iue->iu->srp.cmd.lun);
-+		process_inquiry(iue);
-+		break;
-+	case READ_CAPACITY:
-+		dbg("READ CAPACITY lun %16.16lx\n", iue->iu->srp.cmd.lun);
-+		processReadCapacity(iue);
-+		break;
-+	case MODE_SENSE:
-+		dbg("MODE SENSE lun %16.16lx\n", iue->iu->srp.cmd.lun);
-+		processModeSense(iue);
-+		break;
-+	case TEST_UNIT_READY:
-+		/* we already know the device exists */
-+		dbg("TEST UNIT READY lun %16.16lx\n", iue->iu->srp.cmd.lun);
-+		send_rsp(iue, SENSE_SUCCESS);
-+		free_iu(iue);
-+		break;
-+	case START_STOP:
-+		/* just respond OK */
-+		dbg("START_STOP lun %16.16lx\n", iue->iu->srp.cmd.lun);
-+		send_rsp(iue, SENSE_SUCCESS);
-+		free_iu(iue);
-+		break;
-+	default:
-+		warn("Unsupported SCSI Command 0x%2.2x\n", iu->srp.cmd.cdb[0]);
-+		send_rsp(iue, SENSE_INVALID_CMD);
-+		free_iu(iue);
-+	}
-+}
-+
-+u16 send_adapter_info(struct iu_entry *iue,
-+		      dma_addr_t remote_buffer, u16 length)
-+{
-+	dma_addr_t data_token;
-+	struct mad_adapter_info_data *info =
-+	    (struct mad_adapter_info_data *)dma_alloc_coherent(iue->adapter->
-+							       dev,
-+							       sizeof(*info),
-+							       &data_token, 0);
-+
-+	dbg("in send_adapter_info\n ");
-+	if ((info) && (!dma_mapping_error(data_token))) {
-+		int rc;
-+		memset(info, 0x00, sizeof(*info));
-+
-+		dbg("building adapter_info\n ");
-+		strcpy(info->srp_version, "1.6a");
-+		strncpy(info->partition_name, partition_name,
-+			sizeof(info->partition_name));
-+		info->partition_number = partition_number;
-+		info->mad_version = 1;
-+		info->os_type = 3;
-+
-+		rc = h_copy_rdma(sizeof(*info),
-+				 iue->adapter->liobn,
-+				 data_token,
-+				 iue->adapter->riobn,
-+				 remote_buffer);
-+
-+		dma_free_coherent(iue->adapter->dev,
-+				  sizeof(*info), info, data_token);
-+
-+		if (rc != H_Success) {
-+			err("Error sending adapter info rc %d\n",rc);
-+			return 1;
-+		}
-+	} else {
-+		dbg("bad dma_alloc_cohereint in adapter_info\n ");
-+		return 1;
-+	}
-+	return 0;
-+
-+}
-+
-+/* ==============================================================
-+ * SRP Processing Routines
-+ * ==============================================================
-+ */
-+/*
-+ * Process an incoming SRP Login request
-+ */
-+static void process_login(struct iu_entry *iue)
-+{
-+	union viosrp_iu *iu = iue->iu;
-+	u64 tag = iu->srp.generic.tag;
-+
-+	/* TODO handle case that requested size is wrong and buffer format is wrong */
-+	memset(iu, 0x00, sizeof(struct srp_login_rsp));
-+	iu->srp.login_rsp.type = SRP_LOGIN_RSP_TYPE;
-+	iu->srp.login_rsp.request_limit_delta = iue->adapter->pool.size;
-+	iu->srp.login_rsp.tag = tag;
-+	iu->srp.login_rsp.max_initiator_to_target_iulen = sizeof(union srp_iu);
-+	iu->srp.login_rsp.max_target_to_initiator_iulen = sizeof(union srp_iu);
-+	iu->srp.login_rsp.supported_buffer_formats = 0x0006;	/* direct and indirect */
-+	iu->srp.login_rsp.multi_channel_result = 0x00;	/* TODO fix if we were already logged in */
-+
-+	send_srp(iue, sizeof(iu->srp.login_rsp));
-+}
-+
-+/*
-+ * Send an SRP response that includes sense data
-+ */
-+static long send_rsp(struct iu_entry *iue, int status)
-+{
-+	u8 *sense = iue->iu->srp.rsp.sense_and_response_data;
-+	u64 tag = iue->iu->srp.generic.tag;
-+	union viosrp_iu *iu = iue->iu;
-+
-+	if (status != SENSE_SUCCESS) {
-+		atomic_inc(&iue->adapter->errors);
-+	}
-+
-+	/* If the linked bit is on and status is good */
-+	if ((iue->req.linked) && (status == SENSE_SUCCESS)) {
-+		status = SENSE_INTERMEDIATE;
-+	}
-+
-+	memset(iu, 0x00, sizeof(struct srp_rsp));
-+	iu->srp.rsp.type = SRP_RSP_TYPE;
-+	iu->srp.rsp.request_limit_delta = 1;
-+	iu->srp.rsp.tag = tag;
-+
-+	iu->srp.rsp.diunder = iue->req.diunder;
-+	iu->srp.rsp.diover = iue->req.diover;
-+	iu->srp.rsp.dounder = iue->req.dounder;
-+	iu->srp.rsp.doover = iue->req.doover;
-+
-+	iu->srp.rsp.data_in_residual_count = iue->req.data_in_residual_count;
-+	iu->srp.rsp.data_out_residual_count = iue->req.data_out_residual_count;
-+
-+	iu->srp.rsp.rspvalid = 0;
-+
-+	iu->srp.rsp.response_data_list_length = 0;
-+
-+	if (status) {
-+		iu->srp.rsp.status = SAM_STAT_CHECK_CONDITION;
-+		iu->srp.rsp.snsvalid = 1;
-+		iu->srp.rsp.sense_data_list_length = 18;	/* TODO be smarter about this */
-+
-+		/* Valid bit and 'current errors' */
-+		sense[0] = (0x1 << 7 | 0x70);
-+
-+		/* Sense key */
-+		sense[2] = ibmvscsis_sense_data[status][0];
-+
-+		/* Additional sense length */
-+		sense[7] = 0xa;	/* 10 bytes */
-+
-+		/* Additional sense code */
-+		sense[12] = ibmvscsis_sense_data[status][1];
-+
-+		/* Additional sense code qualifier */
-+		sense[13] = ibmvscsis_sense_data[status][2];
-+	} else {
-+		iu->srp.rsp.status = 0;
-+	}
-+
-+	send_srp(iue, sizeof(iu->srp.rsp));
-+
-+	return 0;
-+}
-+
-+static void process_device_reset(struct iu_entry *iue)
-+{
-+	struct iu_entry *tmp_iue;
-+	unsigned long flags;
-+	union viosrp_iu *iu = iue->iu;
-+
-+	info("device reset for lun %16.16lx\n", iu->srp.tsk_mgmt.lun);
-+
-+	spin_lock_irqsave(&iue->adapter->lock, flags);
-+
-+	list_for_each_entry(tmp_iue, &iue->adapter->inflight, next) {
-+		if (iu->srp.tsk_mgmt.lun == tmp_iue->iu->srp.cmd.lun) {
-+			{
-+				tmp_iue->aborted = 1;
-+			}
-+		}
-+
-+	}
-+
-+	spin_unlock_irqrestore(&iue->adapter->lock, flags);
-+	send_rsp(iue, SENSE_SUCCESS);
-+}
-+
-+static void process_abort(struct iu_entry *iue)
-+{
-+	struct iu_entry *tmp_iue;
-+	unsigned long flags;
-+	union viosrp_iu *iu = iue->iu;
-+
-+	info("aborting task with tag %16.16lx, lun %16.16lx\n",
-+	     iu->srp.tsk_mgmt.managed_task_tag, iu->srp.tsk_mgmt.lun);
-+
-+	spin_lock_irqsave(&iue->adapter->lock, flags);
-+
-+	list_for_each_entry(tmp_iue, &iue->adapter->inflight, next) {
-+		if (tmp_iue->iu->srp.cmd.tag ==
-+		    iu->srp.tsk_mgmt.managed_task_tag) {
-+			{
-+				tmp_iue->aborted = 1;
-+				info("abort successful\n");
-+				spin_unlock_irqrestore(&iue->adapter->lock,
-+						       flags);
-+				send_rsp(iue, SENSE_SUCCESS);
-+				return;
-+			}
-+		}
-+	}
-+	info("unable to abort cmd\n");
-+
-+	spin_unlock_irqrestore(&iue->adapter->lock, flags);
-+	send_rsp(iue, SENSE_INVALID_ID);
-+}
-+
-+static void process_tsk_mgmt(struct iu_entry *iue)
-+{
-+	union viosrp_iu *iu = iue->iu;
-+
-+	if (iu->srp.tsk_mgmt.task_mgmt_flags == 0x01) {
-+		process_abort(iue);
-+	} else if (iu->srp.tsk_mgmt.task_mgmt_flags == 0x08) {
-+		process_device_reset(iue);
-+	} else {
-+		send_rsp(iue, SENSE_INVALID_CMD);
-+	}
-+}
-+
-+static void process_iu(struct viosrp_crq *crq, struct server_adapter *adapter)
-+{
-+	struct iu_entry *iue = get_iu(adapter);
-+	union viosrp_iu *iu;
-+	int queued = 0;
-+	long rc;
-+
-+	if (iue == NULL) {
-+		/* TODO Yikes! */
-+		warn("Error getting IU from pool, other side exceeded limit\n");
-+		return;
-+	}
-+
-+	iue->req.remote_token = crq->IU_data_ptr;
-+
-+	rc = h_copy_rdma(crq->IU_length,
-+			 iue->adapter->riobn,
-+			 iue->req.remote_token, adapter->liobn, iue->iu_token);
-+
-+	iu = iue->iu;
-+
-+	if (rc) {
-+		err("Error %ld transferring data to client\n", rc);
-+	}
-+
-+	if (crq->format == VIOSRP_MAD_FORMAT) {
-+		switch (iu->mad.empty_iu.common.type) {
-+		case VIOSRP_EMPTY_IU_TYPE:
-+			warn("Unsupported EMPTY MAD IU\n");
-+			break;
-+		case VIOSRP_ERROR_LOG_TYPE:
-+			warn("Unsupported ERROR LOG MAD IU\n");
-+			iu->mad.error_log.common.status = 1;
-+			send_srp(iue, sizeof(iu->mad.error_log));
-+			break;
-+		case VIOSRP_ADAPTER_INFO_TYPE:
-+			iu->mad.adapter_info.common.status =
-+			    send_adapter_info(iue,
-+					      iu->mad.adapter_info.buffer,
-+					      iu->mad.adapter_info.common.
-+					      length);
-+
-+			send_srp(iue, sizeof(iu->mad.adapter_info));
-+			break;
-+		case VIOSRP_HOST_CONFIG_TYPE:
-+			iu->mad.host_config.common.status = 1;
-+			send_srp(iue, sizeof(iu->mad.host_config));
-+			break;
-+		default:
-+			warn("Unsupported MAD type %d\n", iu->srp.generic.type);
-+		}
-+	} else {
-+		switch (iu->srp.generic.type) {
-+		case SRP_LOGIN_REQ_TYPE:
-+			dbg("SRP LOGIN\n");
-+			process_login(iue);
-+			break;
-+		case SRP_LOGIN_RSP_TYPE:
-+			warn("Unsupported LOGIN_RSP SRP IU\n");
-+			break;
-+		case SRP_I_LOGOUT_TYPE:
-+			warn("Unsupported I_LOGOUT SRP IU\n");
-+			break;
-+		case SRP_T_LOGOUT_TYPE:
-+			warn("Unsupported T_LOGOUT SRP IU\n");
-+			break;
-+		case SRP_TSK_MGMT_TYPE:
-+			process_tsk_mgmt(iue);
-+			break;
-+		case SRP_CMD_TYPE:
-+			process_cmd(iue);
-+			queued = 1;
-+			break;
-+		case SRP_RSP_TYPE:
-+			warn("Unsupported RSP SRP IU\n");
-+			break;
-+		case SRP_CRED_REQ_TYPE:
-+			warn("Unsupported CRED_REQ SRP IU\n");
-+			break;
-+		case SRP_CRED_RSP_TYPE:
-+			warn("Unsupported CRED_RSP SRP IU\n");
-+			break;
-+		case SRP_AER_REQ_TYPE:
-+			warn("Unsupported AER_REQ SRP IU\n");
-+			break;
-+		case SRP_AER_RSP_TYPE:
-+			warn("Unsupported AER_RSP SRP IU\n");
-+			break;
-+		default:
-+			warn("Unsupported SRP type %d\n", iu->srp.generic.type);
-+		}
-+	}
-+
-+	/* 
-+	 * If no one has queued the IU for further work, free it 
-+	 * Note that this is kind of an ugly design based on setting
-+	 * this variable up above in cases where the routine we call
-+	 * is responsible for freeing the IU
-+	 */
-+	if (!queued)
-+		free_iu(iue);
-+}
-+
-+/* ==============================================================
-+ * CRQ Processing Routines
-+ * ==============================================================
-+ */
-+
-+/*
-+ * Handle a CRQ event
-+ */
-+static void handle_crq(struct viosrp_crq *crq, struct server_adapter *adapter)
-+{
-+	switch (crq->valid) {
-+	case 0xC0:		/* initialization */
-+		switch (crq->format) {
-+		case 0x01:
-+			info("Client just initialized\n");
-+			plpar_hcall_norets(H_SEND_CRQ,
-+					   adapter->dma_dev->unit_address,
-+					   0xC002000000000000, 0);
-+			break;
-+		case 0x02:
-+			info("Client initialization complete\n");
-+			break;
-+		default:
-+			err("Client error: Unknwn msg format %d\n", 
-+			    crq->format);
-+		}
-+		return;
-+	case 0xFF:		/* transport event */
-+		info("Client closed\n");
-+		return;
-+	case 0x80:		/* real payload */
-+		{
-+			switch (crq->format) {
-+			case VIOSRP_SRP_FORMAT:
-+			case VIOSRP_MAD_FORMAT:
-+				process_iu(crq, adapter);
-+				break;
-+			case VIOSRP_OS400_FORMAT:
-+				warn("Unsupported OS400 format CRQ\n");
-+				break;
-+
-+			case VIOSRP_AIX_FORMAT:
-+				warn("Unsupported AIX format CRQ\n");
-+				break;
-+
-+			case VIOSRP_LINUX_FORMAT:
-+				warn("Unsupported LINUX format CRQ\n");
-+				break;
-+
-+			case VIOSRP_INLINE_FORMAT:
-+				warn("Unsupported _INLINE_ format CRQ\n");
-+				break;
-+
-+			default:
-+				err("Client error: Unsupported  msg format %d\n", 
-+				    crq->format);
-+			}
-+		}
-+		break;
-+	default:
-+		err("Client error: unknown message type 0x%02x!?\n",
-+		    crq->valid);
-+		return;
-+	}
-+
-+}
-+
-+/*
-+ * Task to handle CRQs and completions
-+ */
-+static void crq_task(void *data)
-+{
-+	struct server_adapter *adapter = (struct server_adapter *)data;
-+	struct viosrp_crq *crq;
-+	long rc;
-+	int done = 0;
-+
-+	while (!done) {
-+
-+		/* Loop through and process CRQs */
-+		while ((crq = crq_queue_next_crq(&adapter->queue)) != NULL) {
-+			atomic_inc(&adapter->crq_processed);
-+			handle_crq(crq, adapter);
-+			crq->valid = 0x00;
-+		}
-+
-+		rc = h_vio_signal(adapter->dma_dev->unit_address, 1);
-+		if (rc != 0) {
-+			err("Error %ld enabling interrupts!!!\n", rc);
-+		}
-+		if ((crq = crq_queue_next_crq(&adapter->queue)) != NULL) {
-+			rc = h_vio_signal(adapter->dma_dev->unit_address, 0);
-+			if (rc != 0) {
-+				err("Error %ld enabling interrupts!!!\n", rc);
-+			}
-+			handle_crq(crq, adapter);
-+			crq->valid = 0x00;
-+		} else {
-+			done = 1;
-+		}
-+	}
-+}
-+
-+/*
-+ * Handle the interrupt that occurs when something is placed on our CRQ
-+ */
-+static irqreturn_t handle_interrupt(int irq, void *dev_instance,
-+				    struct pt_regs *regs)
-+{
-+	struct server_adapter *adapter = (struct server_adapter *)dev_instance;
-+	long rc;
-+
-+	rc = h_vio_signal(adapter->dma_dev->unit_address, 0);
-+	if (rc != 0) {
-+		err(" Error %ld disabling interrupts!!!\n", rc);
-+	}
-+
-+	atomic_inc(&adapter->interrupts);
-+
-+	kblockd_schedule_work(&adapter->crq_task);
-+
-+	return IRQ_HANDLED;
-+}
-+
-+/* 
-+ * Initialize our CRQ
-+ * return zero on success, non-zero on failure 
-+ */
-+static int initialize_crq_queue(struct crq_queue *queue,
-+				struct server_adapter *adapter)
-+{
-+	int rc;
-+
-+	queue->msgs = (struct viosrp_crq *)get_zeroed_page(GFP_KERNEL);
-+	if (!queue->msgs)
-+		goto malloc_failed;
-+	queue->size = PAGE_SIZE / sizeof(*queue->msgs);
-+
-+	queue->msg_token = dma_map_single(adapter->dev, queue->msgs,
-+					  queue->size * sizeof(*queue->msgs),
-+					  DMA_BIDIRECTIONAL);
-+
-+	if (dma_mapping_error(queue->msg_token))
-+		goto map_failed;
-+
-+	rc = plpar_hcall_norets(H_REG_CRQ, adapter->dma_dev->unit_address,
-+				queue->msg_token, PAGE_SIZE);
-+	
-+	if ((rc != 0) && (rc != 2)) {
-+		err("Error 0x%x opening virtual adapter\n", rc);
-+		goto reg_crq_failed;
-+	}
-+
-+	if (request_irq
-+	    (adapter->dma_dev->irq, &handle_interrupt, SA_INTERRUPT,
-+	     "ibmvscsis", adapter) != 0)
-+		goto req_irq_failed;
-+
-+	rc = h_vio_signal(adapter->dma_dev->unit_address, 1);
-+	if (rc != 0) {
-+		err("Error %d enabling interrupts!!!\n", rc);
-+		goto req_irq_failed;
-+	}
-+
-+	plpar_hcall_norets(H_SEND_CRQ, adapter->dma_dev->unit_address,
-+				   0xC001000000000000, 0);
-+
-+	queue->cur = 0;
-+	queue->lock = SPIN_LOCK_UNLOCKED;
-+
-+	return 0;
-+
-+      req_irq_failed:
-+	do {
-+		rc = plpar_hcall_norets(H_FREE_CRQ, adapter->dma_dev->unit_address);
-+	} while ((rc == H_Busy) || (H_isLongBusy(rc)));
-+	
-+      reg_crq_failed:
-+	dma_unmap_single(adapter->dev, queue->msg_token,
-+			 queue->size * sizeof(*queue->msgs), DMA_BIDIRECTIONAL);
-+      map_failed:
-+	free_page((unsigned long)queue->msgs);
-+      malloc_failed:
-+	return -1;
-+}
-+
-+/*
-+ * Release the CRQ
-+ */
-+static void release_crq_queue(struct crq_queue *queue,
-+			      struct server_adapter *adapter)
-+{
-+	int rc;
-+
-+	info("releasing adapter\n");
-+	free_irq(adapter->dma_dev->irq, adapter);
-+	do {
-+		rc = plpar_hcall_norets(H_FREE_CRQ, adapter->dma_dev->unit_address);
-+	} while ((rc == H_Busy) || (H_isLongBusy(rc)));
-+	dma_unmap_single(adapter->dev, queue->msg_token,
-+			 queue->size * sizeof(*queue->msgs), DMA_BIDIRECTIONAL);
-+	free_page((unsigned long)queue->msgs);
-+}
-+
-+/* ==============================================================
-+ * Module Management
-+ * ==============================================================
-+ */
-+/*
-+ * Add a block device as a SCSI LUN
-+ */
-+static int activate_block_device(struct vdev *vdev)
-+{
-+	struct block_device *bdev;
-+	char *name = vdev->b.device_name;
-+	int ro = vdev->b.ro;
-+
-+	bdev = open_bdev_excl(name, ro, activate_block_device);
-+	if (IS_ERR(bdev))
-+		return PTR_ERR(bdev);;
-+
-+	vdev->b.bdev = bdev;
-+	vdev->disabled = 0;
-+
-+	info("Activating block device %s as %sLUN 0x%lx\n",
-+	     name, ro ? "read only " : "", vdev->lun);
-+
-+	return 0;
-+}
-+
-+static void deactivate_block_device(struct vdev *vdev)
-+{
-+	info("Deactivating block device, LUN 0x%lx\n", vdev->lun);
-+
-+	/* Wait while any users of this device finish.  Note there should
-+	 * be no new users, since we have marked this disabled
-+	 *
-+	 * We just poll here, since we are blocking write
-+	 */
-+	while (atomic_read(&vdev->refcount)) {
-+		schedule_timeout(HZ / 4);	/* 1/4 second */
-+	}
-+
-+	vdev->disabled = 1;
-+	close_bdev_excl(vdev->b.bdev);
-+}
-+
-+
-+#define ATTR(_type, _name, _mode)      \
-+struct attribute vscsi_##_type##_##_name##_attr = {               \
-+.name = __stringify(_name), .mode = _mode, .owner = THIS_MODULE \
-+};
-+
-+static struct kobj_type ktype_vscsi_target;
-+static struct kobj_type ktype_vscsi_bus;
-+static struct kobj_type ktype_vscsi_stats;
-+
-+static void set_num_targets(struct vbus* vbus, long value)
-+{
-+	struct device *dev = 
-+		container_of(vbus->kobj.parent, struct device , kobj);
-+	struct server_adapter *adapter = (struct server_adapter *)to_vio_dev(dev)->driver_data;
-+	int cur_num_targets = atomic_read(&vbus->num_targets);
-+	unsigned long flags;
-+
-+	spin_lock_irqsave(&adapter->lock, flags);
-+
-+	if (cur_num_targets < value) { //growing
-+		int i;
-+		for (i = cur_num_targets; i < value; i++) {
-+			vbus->vdev[i] = (struct vdev *)
-+				kmalloc(sizeof(struct vdev), GFP_KERNEL);
-+			if (!vbus->vdev[i]) {
-+				spin_unlock_irqrestore(&adapter->lock, flags);
-+				err("Couldn't allocate target memory %d\n", i);
-+				return;
-+			}
-+			memset(vbus->vdev[i], 0x00, sizeof(struct vdev));
-+
-+			vbus->vdev[i]->lun = make_lun(vbus->bus_num, i, 0);
-+			vbus->vdev[i]->b.blksize = 512;
-+			vbus->vdev[i]->disabled = 1;
-+
-+			vbus->vdev[i]->kobj.parent = &vbus->kobj;
-+			sprintf(vbus->vdev[i]->kobj.name, "target%d", i);
-+			vbus->vdev[i]->kobj.ktype = &ktype_vscsi_target;
-+			kobject_register(&vbus->vdev[i]->kobj);
-+			adapter->nvdevs++;
-+			atomic_inc(&vbus->num_targets);
-+		}
-+	} else { //shrinking
-+		int i;
-+		for (i = cur_num_targets - 1; i >= value; i--)
-+		{
-+			if (!vbus->vdev[i]->disabled) {
-+				spin_unlock_irqrestore(&adapter->lock, flags);
-+				err("Can't remove active target %d\n", i);
-+				return;
-+			}
-+
-+			kobject_unregister(&vbus->vdev[i]->kobj);
-+
-+			kfree(vbus->vdev[i]);
-+
-+			adapter->nvdevs--;
-+			atomic_dec(&vbus->num_targets);
-+		}
-+	}
-+	spin_unlock_irqrestore(&adapter->lock, flags);
-+}
-+
-+static void set_num_buses(struct device *dev, long value)
-+{
-+	struct server_adapter *adapter = (struct server_adapter *)to_vio_dev(dev)->driver_data;
-+	int cur_num_buses = atomic_read(&adapter->num_buses);
-+	unsigned long flags= 0L;
-+
-+
-+	if (cur_num_buses < value) { // growing
-+		int i;
-+		for (i = cur_num_buses; i < value; i++) {
-+			adapter->vbus[i] = (struct vbus *)
-+				kmalloc(sizeof(struct vbus), GFP_KERNEL);
-+			if (!adapter->vbus[i]) {
-+				spin_unlock_irqrestore(&adapter->lock, flags);
-+				err("Couldn't allocate bus %d memory\n", i);
-+				return;
-+			}
-+			memset(adapter->vbus[i], 0x00, sizeof(struct vbus));
-+
-+			spin_lock_irqsave(&adapter->lock, flags);
-+
-+			adapter->vbus[i]->bus_num = i;
-+
-+			adapter->vbus[i]->kobj.parent = &dev->kobj;
-+			sprintf(adapter->vbus[i]->kobj.name, "bus%d", i);
-+			adapter->vbus[i]->kobj.ktype = &ktype_vscsi_bus; 
-+			kobject_register(&adapter->vbus[i]->kobj);
-+			
-+			atomic_inc(&adapter->num_buses);
-+			spin_unlock_irqrestore(&adapter->lock, flags);
-+
-+			set_num_targets(adapter->vbus[i], 1);
-+		}
-+
-+	} else if (cur_num_buses > value) { //shrinking
-+		int i, j, active_target;
-+		for (i = cur_num_buses - 1; i >= value; i--) {
-+			active_target = -1;
-+			for (j = 0; j < TARGETS_PER_BUS; j++) {
-+				if (adapter->vbus[i]->vdev[j] && 
-+				    !adapter->vbus[i]->vdev[j]->disabled) {
-+					active_target = j;
-+					break;
-+				}
-+			}
-+			if (active_target != -1) {
-+				err("Can't remove bus%d, target%d active\n", 
-+					i, active_target);
-+				return ;
-+			}
-+
-+			set_num_targets(adapter->vbus[i], 0);
-+
-+			spin_lock_irqsave(&adapter->lock, flags);
-+			atomic_dec(&adapter->num_buses);
-+			kobject_unregister(&adapter->vbus[i]->kobj);
-+			kfree(adapter->vbus[i]);
-+			adapter->vbus[i] = NULL;
-+			spin_unlock_irqrestore(&adapter->lock, flags);
-+		}
-+	}
-+}
-+
-+
-+/* Target sysfs stuff */
-+static ATTR(target, type, 0644);
-+static ATTR(target, device, 0644);
-+static ATTR(target, active, 0644);
-+static ATTR(target, ro, 0644);
-+
-+static ssize_t vscsi_target_show(struct kobject * kobj, struct attribute * attr, char * buf)
-+{
-+	struct vdev *vdev = container_of(kobj, struct vdev, kobj);
-+	struct device *dev = container_of(kobj->parent->parent, struct device, kobj);
-+	struct server_adapter *adapter = (struct server_adapter *)to_vio_dev(dev)->driver_data;
-+	unsigned long flags;
-+	ssize_t returned= (ssize_t)0;
-+
-+	spin_lock_irqsave(&adapter->lock, flags);
-+
-+	if (attr == &vscsi_target_type_attr)
-+		returned = sprintf(buf, "%c\n", vdev->type);
-+	else if (attr == &vscsi_target_device_attr)
-+		returned = sprintf(buf, "%s\n", vdev->b.device_name);
-+	else if (attr == &vscsi_target_active_attr)
-+		returned = sprintf(buf, "%d\n", !vdev->disabled);
-+	else if (attr == &vscsi_target_ro_attr)
-+		returned = sprintf(buf, "%d\n", vdev->b.ro);
-+	else {
-+		spin_unlock_irqrestore(&adapter->lock, flags);
-+		BUG();
-+	}
-+
-+	spin_unlock_irqrestore(&adapter->lock, flags);
-+
-+	return returned;
-+}
-+
-+static ssize_t vscsi_target_store(struct kobject * kobj, struct attribute * attr, const char * buf, size_t count)
-+{
-+	struct vdev *vdev = container_of(kobj, struct vdev, kobj);
-+	struct device *dev = container_of(kobj->parent->parent, struct device, kobj);
-+	struct server_adapter *adapter = (struct server_adapter *)to_vio_dev(dev)->driver_data;
-+	long flags;
-+	long value = simple_strtol(buf, NULL, 10);
-+
-+	if (attr != &vscsi_target_active_attr && !vdev->disabled) {
-+		err("Error: Can't modify properties while target is active.\n");
-+		return -EPERM;
-+	}
-+
-+	if (attr == &vscsi_target_type_attr) {
-+		if (buf[0] == 'B' ||  buf[0] == 'b')
-+			vdev->type = 'B';
-+		else if (buf[0] == 'S' || buf[0] == 's') {
-+			// TODO
-+			err ("SCSI mode not supported yet\n");		
-+			return -EINVAL;
-+		} else 
-+			return -EINVAL;
-+	} else if (attr == &vscsi_target_device_attr) {
-+		int i;
-+		spin_lock_irqsave(&adapter->lock, flags);
-+		i  = strlcpy(vdev->b.device_name, buf, TARGET_MAX_NAME_LEN);
-+		for (; i >= 0; i--)
-+			if (vdev->b.device_name[i] == '\n')
-+				vdev->b.device_name[i] = '\0';
-+		spin_unlock_irqrestore(&adapter->lock, flags);
-+	} else if (attr == &vscsi_target_active_attr) {
-+		if (value) {
-+			int rc;
-+			if (!vdev->disabled) {
-+				warn("Warning: Target was already active\n");
-+				return -EINVAL;
-+			}
-+			if (vdev->type == '\0') {
-+				err("Error: Type not specified\n");
-+				return -EPERM;
-+			}
-+			rc = activate_block_device(vdev);
-+			if (rc) {
-+				err("Error opening block device=%d\n", rc);
-+				return rc;
-+			}
-+		} else {
-+			if (!vdev->disabled) 
-+				deactivate_block_device(vdev);
-+		}
-+	} else if (attr == &vscsi_target_ro_attr)
-+		vdev->b.ro = value > 0 ? 1 : 0;
-+	else 
-+		BUG();
-+
-+	return count;
-+}
-+
-+static struct attribute * vscsi_target_attrs[] = {
-+	&vscsi_target_type_attr,
-+	&vscsi_target_device_attr,
-+	&vscsi_target_active_attr,
-+	&vscsi_target_ro_attr,
-+	NULL,
-+};
-+
-+static struct sysfs_ops vscsi_target_ops = {
-+	.show   = vscsi_target_show,
-+	.store  = vscsi_target_store,
-+};
-+
-+static struct kobj_type ktype_vscsi_target = {
-+	.release        = NULL,
-+	.sysfs_ops      = &vscsi_target_ops, 
-+	.default_attrs  = vscsi_target_attrs,
-+};
-+
-+
-+
-+/* Bus sysfs stuff */
-+static ssize_t vscsi_bus_show(struct kobject * kobj, struct attribute * attr, char * buf)
-+{
-+	struct vbus *vbus = container_of(kobj, struct vbus, kobj);
-+	return sprintf(buf, "%d\n", atomic_read(&vbus->num_targets));
-+}
-+
-+static ssize_t vscsi_bus_store(struct kobject * kobj, struct attribute * attr, 
-+const char * buf, size_t count)
-+{
-+	struct vbus *vbus = container_of(kobj, struct vbus, kobj);
-+	long value = simple_strtol(buf, NULL, 10);
-+	
-+	if (value < 0 || value > TARGETS_PER_BUS)
-+		return -EINVAL;
-+	
-+	set_num_targets(vbus, value);
-+
-+	return count;
-+}
-+
-+
-+static ATTR(bus, num_targets, 0644);
-+
-+static struct attribute * vscsi_bus_attrs[] = {
-+	&vscsi_bus_num_targets_attr,
-+	NULL,
-+};
-+
-+static struct sysfs_ops vscsi_bus_ops = {
-+	.show   = vscsi_bus_show,
-+	.store  = vscsi_bus_store,
-+};
-+
-+static struct kobj_type ktype_vscsi_bus = {
-+	.release        = NULL,
-+	.sysfs_ops      = &vscsi_bus_ops, 
-+	.default_attrs  = vscsi_bus_attrs,
-+};
-+
-+
-+/* Device attributes */
-+static ssize_t vscsi_dev_bus_show(struct device * dev, char * buf)
-+{
-+	struct server_adapter *adapter = (struct server_adapter *)to_vio_dev(dev)->driver_data;
-+
-+	return sprintf(buf, "%d\n", atomic_read(&adapter->num_buses));
-+}
-+
-+static ssize_t vscsi_dev_bus_store(struct device * dev, const char * buf, size_t count)
-+{
-+	long value = simple_strtol(buf, NULL, 10);
-+	
-+	if (value < 0 || value > BUS_PER_ADAPTER)
-+		return -EINVAL;
-+
-+	set_num_buses(dev, value);
-+	return count;
-+}
-+
-+static DEVICE_ATTR(num_buses, 0644, vscsi_dev_bus_show, vscsi_dev_bus_store);
-+
-+
-+/* Stats kobj stuff */
-+
-+static ATTR(stats, interrupts, 0444);
-+static ATTR(stats, read_ops, 0444);
-+static ATTR(stats, write_ops, 0444);
-+static ATTR(stats, crq_msgs, 0444);
-+static ATTR(stats, iu_allocs, 0444);
-+static ATTR(stats, bio_allocs, 0444);
-+static ATTR(stats, buf_allocs, 0444);
-+static ATTR(stats, errors, 0444);
-+
-+static struct attribute * vscsi_stats_attrs[] = {
-+	&vscsi_stats_interrupts_attr,
-+	&vscsi_stats_read_ops_attr,
-+	&vscsi_stats_write_ops_attr,
-+	&vscsi_stats_crq_msgs_attr,
-+	&vscsi_stats_iu_allocs_attr,
-+	&vscsi_stats_bio_allocs_attr,
-+	&vscsi_stats_buf_allocs_attr,
-+	&vscsi_stats_errors_attr,
-+	NULL,
-+};
-+
-+
-+static ssize_t vscsi_stats_show(struct kobject * kobj, struct attribute * attr, char * buf)
-+{
-+	struct server_adapter *adapter= container_of(kobj, struct server_adapter, stats_kobj);
-+	if (attr == &vscsi_stats_interrupts_attr)
-+		return sprintf(buf, "%d\n", 
-+		 atomic_read(&adapter->interrupts));
-+	if (attr == &vscsi_stats_read_ops_attr)
-+		return sprintf(buf, "%d\n", 
-+		 atomic_read(&adapter->read_processed));
-+	if (attr == &vscsi_stats_write_ops_attr)
-+		return sprintf(buf, "%d\n", 
-+		 atomic_read(&adapter->write_processed));
-+	if (attr == &vscsi_stats_crq_msgs_attr)
-+		return sprintf(buf, "%d\n", 
-+		 atomic_read(&adapter->crq_processed));
-+	if (attr == &vscsi_stats_iu_allocs_attr)
-+		return sprintf(buf, "%d\n", 
-+		 atomic_read(&adapter->iu_count));
-+	if (attr == &vscsi_stats_bio_allocs_attr)
-+		return sprintf(buf, "%d\n", 
-+		 atomic_read(&adapter->bio_count));
-+	if (attr == &vscsi_stats_buf_allocs_attr)
-+		return sprintf(buf, "%d\n", 
-+		 atomic_read(&adapter->buffers_allocated));
-+	if (attr == &vscsi_stats_errors_attr)
-+		return sprintf(buf, "%d\n", 
-+		 atomic_read(&adapter->errors));
-+	
-+	BUG();
-+	return 0;
-+}
-+
-+static struct sysfs_ops vscsi_stats_ops = {
-+	.show   = vscsi_stats_show,
-+	.store  = NULL,
-+};
-+
-+static struct kobj_type ktype_vscsi_stats = {
-+	.release        = NULL,
-+	.sysfs_ops      = &vscsi_stats_ops, 
-+	.default_attrs  = vscsi_stats_attrs,
-+};
-+
-+
-+static int ibmvscsis_probe(struct vio_dev *dev, const struct vio_device_id *id)
-+{
-+	struct server_adapter *adapter;
-+	int rc;
-+	unsigned int *dma_window;
-+	unsigned int dma_window_property_size;
-+
-+	adapter = kmalloc(sizeof(*adapter), GFP_KERNEL);
-+	if (!adapter) {
-+		err("couldn't allocate adapter memory\n");
-+		return -1;
-+	}
-+	memset(adapter, 0x00, sizeof(*adapter));
-+	adapter->dma_dev = dev;
-+	adapter->dev = &dev->dev;
-+	dev->driver_data = adapter;
-+	sprintf(adapter->name, "%x", dev->unit_address);
-+	adapter->lock = SPIN_LOCK_UNLOCKED;
-+
-+	dma_window =
-+	    (unsigned int *)vio_get_attribute(dev, "ibm,my-dma-window",
-+					      &dma_window_property_size);
-+	if (!dma_window) {
-+		warn("Couldn't find ibm,my-dma-window property\n");
-+	}
-+
-+	adapter->liobn = dma_window[0];
-+	/* RPA docs say that #address-cells is always 1 for virtual
-+	   devices, but some older boxes' OF returns 2.  This should
-+	   be removed by GA, unless there is legacy OFs that still
-+	   have 2 or 3 for #address-cells */
-+	/*adapter->riobn = dma_window[2+vio_num_address_cells]; */
-+
-+	/* This is just an ugly kludge. Remove as soon as the OF for all
-+	   machines actually follow the spec and encodes the offset field
-+	   as phys-encode (that is, #address-cells wide) */
-+	if (dma_window_property_size == 24) {
-+		adapter->riobn = dma_window[3];
-+	} else if (dma_window_property_size == 40) {
-+		adapter->riobn = dma_window[5];
-+	} else {
-+		warn("Invalid size of ibm,my-dma-window=%i\n",
-+		     dma_window_property_size);
-+	}
-+
-+	INIT_WORK(&adapter->crq_task, crq_task, adapter);
-+
-+	tasklet_init(&adapter->endio_tasklet,
-+		     endio_task, (unsigned long)adapter);
-+
-+	INIT_LIST_HEAD(&adapter->inflight);
-+
-+	/* Initialize the buffer cache */
-+	init_data_buffer(adapter);
-+
-+	/* Arbitrarily support 16 IUs right now */
-+	rc = initialize_iu_pool(adapter, 16);
-+	if (rc) {
-+		kfree(adapter);
-+		return rc;
-+	}
-+
-+	rc = initialize_crq_queue(&adapter->queue, adapter);
-+	if (rc != 0) {
-+		kfree(adapter);
-+		return rc;
-+	}
-+
-+	set_num_buses(&dev->dev, 1);
-+	device_create_file(&dev->dev, &dev_attr_num_buses);
-+
-+	adapter->stats_kobj.parent = &dev->dev.kobj;
-+	strcpy(adapter->stats_kobj.name, "stats");
-+	adapter->stats_kobj.ktype = & ktype_vscsi_stats;
-+	kobject_register(&adapter->stats_kobj);
-+
-+	return 0;
-+}
-+
-+static int ibmvscsis_remove(struct vio_dev *dev)
-+{
-+	int bus;
-+	int target;
-+	unsigned long flags;
-+	struct server_adapter *adapter =
-+	    (struct server_adapter *)dev->driver_data;
-+
-+	spin_lock_irqsave(&adapter->lock, flags);
-+
-+	/* 
-+	 * Loop through the bus
-+	 */
-+	for (bus = 0; bus < BUS_PER_ADAPTER; bus++) {
-+		/* If this bus exists */
-+		if (adapter->vbus[bus]) {
-+			/* loop through the targets */
-+			for (target = 0; target < TARGETS_PER_BUS; target++) {
-+				/* If the target exists */
-+				if (adapter->vbus[bus]->vdev[target] &&
-+				    !adapter->vbus[bus]->vdev[target]
-+				     ->disabled) {
-+					deactivate_block_device(adapter->
-+					 vbus[bus]->vdev[target]);
-+				}
-+			}
-+			spin_unlock_irqrestore(&adapter->lock, flags);
-+			set_num_targets(adapter->vbus[bus], 0);
-+			spin_lock_irqsave(&adapter->lock, flags);
-+		}
-+	}
-+
-+	spin_unlock_irqrestore(&adapter->lock, flags);
-+	set_num_buses(adapter->dev, 0);
-+	release_crq_queue(&adapter->queue, adapter);
-+
-+	release_iu_pool(adapter);
-+
-+	release_data_buffer(adapter);
-+
-+	kobject_unregister(&adapter->stats_kobj);
-+	device_remove_file(&dev->dev, &dev_attr_num_buses);
-+
-+	kfree(adapter);
-+
-+	return 0;
-+}
-+
-+static struct vio_device_id ibmvscsis_device_table[] __devinitdata = {
-+	{"v-scsi-host", "IBM,v-scsi-host"},
-+	{0,}
-+};
-+
-+MODULE_DEVICE_TABLE(vio, ibmvscsis_device_table);
-+
-+static struct vio_driver ibmvscsis_driver = {
-+	.name = "ibmvscsis",
-+	.id_table = ibmvscsis_device_table,
-+	.probe = ibmvscsis_probe,
-+	.remove = ibmvscsis_remove,
-+};
-+
-+static int mod_init(void)
-+{
-+	struct device_node *rootdn;
-+	char *ppartition_name;
-+	char *psystem_id;
-+	char *pmodel;
-+	unsigned int *p_number_ptr;
-+	int rc;
-+
-+	/* Retrieve information about this partition */
-+	rootdn = find_path_device("/");
-+	if (rootdn) {
-+		pmodel = get_property(rootdn, "model", NULL);
-+		psystem_id = get_property(rootdn, "system-id", NULL);
-+		if (pmodel && psystem_id) 
-+			snprintf(system_id,sizeof(system_id),
-+				 "%s-%s",
-+				 pmodel, psystem_id);
-+		ppartition_name =
-+			get_property(rootdn, "ibm,partition-name", NULL);
-+		if (ppartition_name)
-+			strncpy(partition_name, ppartition_name,
-+				sizeof(partition_name));
-+		p_number_ptr =
-+			(unsigned int *)get_property(rootdn, "ibm,partition-no",
-+						     NULL);
-+		if (p_number_ptr)
-+			partition_number = *p_number_ptr;
-+	}
-+
-+	info("initialized version "IBMVSCSIS_VERSION"\n");
-+
-+	rc = vio_register_driver(&ibmvscsis_driver);
-+
-+	if (rc) {
-+		warn("rc %d from vio_register_driver\n", rc);
-+	}
-+
-+	return rc;
-+}
-+
-+static void mod_exit(void)
-+{
-+	info("terminated\n");
-+
-+	vio_unregister_driver(&ibmvscsis_driver);
-+}
-+
-+module_init(mod_init);
-+module_exit(mod_exit);
-diff -aurN a/include/asm-ppc64/vio.h b/include/asm-ppc64/vio.h
---- a/include/asm-ppc64/vio.h	2005-06-17 15:48:29.000000000 -0400
-+++ b/include/asm-ppc64/vio.h	2005-06-18 12:02:58.000000000 -0400
-@@ -91,6 +91,7 @@
- 	char *type;
- 	uint32_t unit_address;	
- 	unsigned int irq;
-+	void *driver_data;
- 
- 	struct device dev;
- };

Added: people/waldi/kernel/linux-2.6/debian/patches-debian/powerpc-ppc64-vio-data.patch
===================================================================
--- people/waldi/kernel/linux-2.6/debian/patches-debian/powerpc-ppc64-vio-data.patch	2005-08-21 15:17:11 UTC (rev 4001)
+++ people/waldi/kernel/linux-2.6/debian/patches-debian/powerpc-ppc64-vio-data.patch	2005-08-21 15:28:27 UTC (rev 4002)
@@ -0,0 +1,18 @@
+#! /bin/sh -e 
+##
+## All lines beginning with `## DP:' are a description of the patch.
+## DP: Description: Add driver_data member to vio_dev.
+## DP: Patch author: Bastian Blank <waldi at debian.org>
+## DP: Upstream status: unknown
+
+diff -aurN a/include/asm-ppc64/vio.h b/include/asm-ppc64/vio.h
+--- a/include/asm-ppc64/vio.h	2005-06-17 15:48:29.000000000 -0400
++++ b/include/asm-ppc64/vio.h	2005-06-18 12:02:58.000000000 -0400
+@@ -91,6 +91,7 @@
+ 	char *type;
+ 	uint32_t unit_address;	
+ 	unsigned int irq;
++	void *driver_data;
+ 
+ 	struct device dev;
+ };

Modified: people/waldi/kernel/linux-2.6/debian/patches-debian/remove-references-to-removed-drivers.patch
===================================================================
--- people/waldi/kernel/linux-2.6/debian/patches-debian/remove-references-to-removed-drivers.patch	2005-08-21 15:17:11 UTC (rev 4001)
+++ people/waldi/kernel/linux-2.6/debian/patches-debian/remove-references-to-removed-drivers.patch	2005-08-21 15:28:27 UTC (rev 4002)
@@ -74,9 +74,9 @@
  #
 -# CONFIG_USB_EMI62 is not set
 -# CONFIG_USB_EMI26 is not set
- # CONFIG_USB_TIGL is not set
  # CONFIG_USB_AUERSWALD is not set
  # CONFIG_USB_RIO500 is not set
+ # CONFIG_USB_LEGOTOWER is not set
 diff -aurN a/arch/ia64/defconfig b/arch/ia64/defconfig
 --- a/arch/ia64/defconfig	2005-06-17 15:48:29.000000000 -0400
 +++ b/arch/ia64/defconfig	2005-06-18 16:28:03.000000000 -0400
@@ -86,8 +86,8 @@
  # CONFIG_FORCEDETH is not set
 -# CONFIG_DGRS is not set
  CONFIG_EEPRO100=m
- # CONFIG_EEPRO100_PIO is not set
  CONFIG_E100=m
+ # CONFIG_FEALNX is not set
 @@ -500,7 +499,6 @@
  #
  # Ethernet (1000 Mbit)
@@ -110,9 +110,9 @@
  #
 -# CONFIG_USB_EMI62 is not set
 -# CONFIG_USB_EMI26 is not set
- # CONFIG_USB_TIGL is not set
  # CONFIG_USB_AUERSWALD is not set
  # CONFIG_USB_RIO500 is not set
+ # CONFIG_USB_LEGOTOWER is not set
 diff -aurN a/arch/mips/configs/rm200_defconfig b/arch/mips/configs/rm200_defconfig
 --- a/arch/mips/configs/rm200_defconfig	2005-06-17 15:48:29.000000000 -0400
 +++ b/arch/mips/configs/rm200_defconfig	2005-06-18 16:27:28.000000000 -0400
@@ -134,9 +134,9 @@
  #
 -# CONFIG_USB_EMI62 is not set
 -# CONFIG_USB_EMI26 is not set
- # CONFIG_USB_TIGL is not set
  # CONFIG_USB_AUERSWALD is not set
  # CONFIG_USB_RIO500 is not set
+ # CONFIG_USB_LEGOTOWER is not set
 diff -aurN a/arch/ppc/configs/lopec_defconfig b/arch/ppc/configs/lopec_defconfig
 --- a/arch/ppc/configs/lopec_defconfig	2005-06-17 15:48:29.000000000 -0400
 +++ b/arch/ppc/configs/lopec_defconfig	2005-06-18 16:25:01.000000000 -0400
@@ -280,7 +280,7 @@
  CONFIG_FORCEDETH=y
 -# CONFIG_DGRS is not set
  # CONFIG_EEPRO100 is not set
- # CONFIG_E100 is not set
+ CONFIG_E100=y
  # CONFIG_FEALNX is not set
 @@ -550,7 +549,6 @@
  #
@@ -307,18 +307,6 @@
  # CONFIG_USB_AUERSWALD is not set
  # CONFIG_USB_RIO500 is not set
  # CONFIG_USB_LEGOTOWER is not set
-diff -aurN a/drivers/usb/Makefile b/drivers/usb/Makefile
---- a/drivers/usb/Makefile	2005-06-17 15:48:29.000000000 -0400
-+++ b/drivers/usb/Makefile	2005-06-18 16:32:12.000000000 -0400
-@@ -59,8 +59,6 @@
- 
- obj-$(CONFIG_USB_AUERSWALD)	+= misc/
- obj-$(CONFIG_USB_CYTHERM)	+= misc/
--obj-$(CONFIG_USB_EMI26)		+= misc/
--obj-$(CONFIG_USB_EMI62)		+= misc/
- obj-$(CONFIG_USB_IDMOUSE)	+= misc/
- obj-$(CONFIG_USB_LCD)		+= misc/
- obj-$(CONFIG_USB_LED)		+= misc/
 diff -aurN a/drivers/usb/misc/Kconfig b/drivers/usb/misc/Kconfig
 --- a/drivers/usb/misc/Kconfig	2005-06-18 11:23:01.000000000 -0400
 +++ b/drivers/usb/misc/Kconfig	2005-06-18 16:31:32.000000000 -0400
@@ -342,9 +330,8 @@
  config USB_AUERSWALD
  	tristate "USB Auerswald ISDN support (EXPERIMENTAL)"
  	depends on USB && EXPERIMENTAL
-diff -aurN a/drivers/usb/misc/Makefile b/drivers/usb/misc/Makefile
---- a/drivers/usb/misc/Makefile	2005-06-18 11:23:01.000000000 -0400
-+++ b/drivers/usb/misc/Makefile	2005-06-18 16:31:47.000000000 -0400
+--- linux-2.6.13/drivers/usb/misc/Makefile.orig	2005-08-06 11:56:51.000000000 +0200
++++ linux-2.6.13/drivers/usb/misc/Makefile	2005-08-06 11:58:37.000000000 +0200
 @@ -5,7 +5,6 @@
  
  obj-$(CONFIG_USB_AUERSWALD)	+= auerswald.o
@@ -352,11 +339,4 @@
 -obj-$(CONFIG_USB_EMI26)		+= emi26.o
  obj-$(CONFIG_USB_IDMOUSE)	+= idmouse.o
  obj-$(CONFIG_USB_LCD)		+= usblcd.o
- obj-$(CONFIG_USB_LED)		+= usbled.o
-@@ -16,4 +15,4 @@
- obj-$(CONFIG_USB_TEST)		+= usbtest.o
- obj-$(CONFIG_USB_USS720)	+= uss720.o
- 
--obj-$(CONFIG_USB_SISUSBVGA)	+= sisusbvga/
-\ No newline at end of file
-+obj-$(CONFIG_USB_SISUSBVGA)	+= sisusbvga/
+ obj-$(CONFIG_USB_LD)		+= ldusb.o

Added: people/waldi/kernel/linux-2.6/debian/patches-debian/series/2.6.12+2.6.13-rc6-1
===================================================================
--- people/waldi/kernel/linux-2.6/debian/patches-debian/series/2.6.12+2.6.13-rc6-1	2005-08-21 15:17:11 UTC (rev 4001)
+++ people/waldi/kernel/linux-2.6/debian/patches-debian/series/2.6.12+2.6.13-rc6-1	2005-08-21 15:28:27 UTC (rev 4002)
@@ -0,0 +1,21 @@
++ amd64-int3-fix.patch
++ drivers-ide-dma-blacklist-toshiba.patch
++ drivers-scsi-megaraid_splitup.patch
++ drivers-s390-net-klist.patch
++ fbdev-radeon-noaccel.patch
++ fs-asfs-2.patch
++ ia64-irq-affinity-upfix.patch
++ modular-ide.patch
++ modular-ide-pnp.patch
++ powerpc-calibrate-tau.patch
++ powerpc-fix-power3-ftbfs.patch
++ powerpc-g3-750cxe.patch
++ powerpc-g4-l2-flush-errata.patch
++ powerpc-mkvmlinuz-support.patch
++ powerpc-pmac-cache-power34-fix.patch
++ powerpc-ppc64-vio-data.patch
++ powerpc-serial.patch
++ qla2xxx-removed.patch
++ remove-references-to-removed-drivers.patch
++ sparc64-hme-lockup.patch
++ tty-locking-fixes9.patch

Deleted: people/waldi/kernel/linux-2.6/debian/patches-debian/series/2.6.12-1
===================================================================
--- people/waldi/kernel/linux-2.6/debian/patches-debian/series/2.6.12-1	2005-08-21 15:17:11 UTC (rev 4001)
+++ people/waldi/kernel/linux-2.6/debian/patches-debian/series/2.6.12-1	2005-08-21 15:28:27 UTC (rev 4002)
@@ -1,27 +0,0 @@
-+ amd64-int3-fix.patch
-+ drivers-add-scsi_changer.patch
-+ drivers-ide-__devinit.patch
-+ drivers-ide-dma-blacklist-toshiba.patch
-+ drivers-scsi-megaraid_splitup.patch
-+ fbdev-radeon-noaccel.patch
-+ fs-asfs-2.patch
-+ ia64-irq-affinity-upfix.patch
-+ modular-ide-pnp.patch
-+ modular-ide.patch
-+ modular-vesafb.patch
-+ powerpc-calibrate-tau.patch
-+ powerpc-fix-power3-ftbfs.patch
-+ powerpc-g3-750cxe.patch
-+ powerpc-pmac-cache-power34-fix.patch
-+ powerpc-serial.patch
-+ qla2xxx-removed.patch
-+ remove-references-to-removed-drivers.patch
-+ tty-locking-fixes9.patch
-+ ia64-generic-nosmp.patch
-+ patch-2.6.12.1
-+ powerpc-ppc64-biarch-override.patch
-+ patch-2.6.12.2
-+ powerpc-mkvmlinuz-support.patch
-+ patch-2.6.12.3
-+ sparc64-hme-lockup.patch
-+ powerpc-g4-l2-flush-errata.patch

Deleted: people/waldi/kernel/linux-2.6/debian/patches-debian/series/2.6.12-2
===================================================================
--- people/waldi/kernel/linux-2.6/debian/patches-debian/series/2.6.12-2	2005-08-21 15:17:11 UTC (rev 4001)
+++ people/waldi/kernel/linux-2.6/debian/patches-debian/series/2.6.12-2	2005-08-21 15:28:27 UTC (rev 4002)
@@ -1 +0,0 @@
-+ patch-2.6.12.4

Deleted: people/waldi/kernel/linux-2.6/debian/patches-debian/series/2.6.12-3
===================================================================
--- people/waldi/kernel/linux-2.6/debian/patches-debian/series/2.6.12-3	2005-08-21 15:17:11 UTC (rev 4001)
+++ people/waldi/kernel/linux-2.6/debian/patches-debian/series/2.6.12-3	2005-08-21 15:28:27 UTC (rev 4002)
@@ -1 +0,0 @@
-+ patch-2.6.12.5

Modified: people/waldi/kernel/linux-2.6/debian/rules
===================================================================
--- people/waldi/kernel/linux-2.6/debian/rules	2005-08-21 15:17:11 UTC (rev 4001)
+++ people/waldi/kernel/linux-2.6/debian/rules	2005-08-21 15:28:27 UTC (rev 4002)
@@ -6,7 +6,7 @@
 DEB_HOST_ARCH  := $(shell dpkg-architecture -qDEB_HOST_ARCH)
 DEB_BUILD_ARCH := $(shell dpkg-architecture -qDEB_BUILD_ARCH)
 srcver   := $(shell dpkg-parsechangelog | awk '/^Version:/ {print $$2}')
-VERSION  := $(word 1,$(subst -, ,$(srcver)))
+VERSION  := $(shell echo $(srcver) | sed -e 's,-[^-]*$$,,')
 MAJOR    := $(word 1,$(subst ., ,$(VERSION))).$(word 2,$(subst ., ,$(VERSION)))
 
 include debian/rules.defs
@@ -38,11 +38,14 @@
 		exit 1; \
 	fi
 
+maintainerclean:
+	rm -rf $(filter-out debian, $(wildcard *))
+
 clean: unpatch
 	dh_testdir
 	rm -f version.Debian
 	cd debian; rm -f *.kpatches.arch
-	rm -rf $(BUILD_DIR) $(STAMPS_DIR)
+	rm -rf $(BUILD_DIR) $(STAMPS_DIR) debian/lib/python/*.pyc
 	dh_clean
 
 binary-indep:

Modified: people/waldi/kernel/linux-2.6/debian/rules.real
===================================================================
--- people/waldi/kernel/linux-2.6/debian/rules.real	2005-08-21 15:17:11 UTC (rev 4001)
+++ people/waldi/kernel/linux-2.6/debian/rules.real	2005-08-21 15:28:27 UTC (rev 4002)
@@ -40,11 +40,11 @@
 # replaced by the flavour for which the command is run. 
 #
 kpkg_header := HEADER_CLEAN_HOOK='$(CURDIR)/$(BUILD_DIR)/header-install-$(ARCH)-$(SUBARCH)'
-kpkg_header += make-kpkg --append-to-version $(append)-$(ABINAME)
+kpkg_header += make-kpkg --append-to-version "$(append)$(KPKG_ABINAME)"
 kpkg_header += --arch $(ARCH)
 kpkg_header += --stem linux
 kpkg_header += --config defconfig
-kpkg_image := make-kpkg --append-to-version -$(ABINAME)-$(FLAVOUR)
+kpkg_image := make-kpkg --append-to-version "$(KPKG_ABINAME)-$(FLAVOUR)"
 kpkg_image += --arch $(ARCH)
 kpkg_image += --stem linux
 kpkg_image += --initrd
@@ -124,13 +124,13 @@
 #	Flavour config file must be present
 	cat $(basedir)/config.$(FLAVOUR) >> $@			 
 
-$(BUILD_DIR)/linux-source-$(VERSION).tar.bz2: SOURCE_DIR=$(BUILD_DIR)/source
-$(BUILD_DIR)/linux-source-$(VERSION).tar.bz2: DIR = $(BUILD_DIR)/linux-source-$(VERSION)
-$(BUILD_DIR)/linux-source-$(VERSION).tar.bz2: $(STAMPS_DIR)/source
+$(BUILD_DIR)/linux-source-$(UPSTREAM_VERSION).tar.bz2: SOURCE_DIR=$(BUILD_DIR)/source
+$(BUILD_DIR)/linux-source-$(UPSTREAM_VERSION).tar.bz2: DIR = $(BUILD_DIR)/linux-source-$(VERSION)
+$(BUILD_DIR)/linux-source-$(UPSTREAM_VERSION).tar.bz2: $(STAMPS_DIR)/source
 	rm -rf $@ $(DIR)
 	cp -al $(SOURCE_DIR) $(DIR)
 	chmod -R u+rw,go=rX $(DIR)
-	cd $(BUILD_DIR); tar -cjf linux-source-$(VERSION).tar.bz2 linux-source-$(VERSION)
+	cd $(BUILD_DIR); tar -cjf linux-source-$(UPSTREAM_VERSION).tar.bz2 linux-source-$(UPSTREAM_VERSION)
 	rm -rf $(DIR)
 
 srcfiles := $(filter-out debian, $(wildcard *))
@@ -287,7 +287,7 @@
 	$(MAKE) -f debian/rules.real install-base DH_OPTIONS=$(DH_OPTIONS)
 
 install-source: DH_OPTIONS = -plinux-source-$(VERSION)
-install-source: $(BUILD_DIR)/linux-source-$(VERSION).tar.bz2
+install-source: $(BUILD_DIR)/linux-source-$(UPSTREAM_VERSION).tar.bz2
 	dh_testdir
 	dh_testroot
 	dh_install $(DH_OPTIONS) $< /usr/src

Modified: people/waldi/kernel/linux-2.6/debian/templates/control.tree.in
===================================================================
--- people/waldi/kernel/linux-2.6/debian/templates/control.tree.in	2005-08-21 15:17:11 UTC (rev 4001)
+++ people/waldi/kernel/linux-2.6/debian/templates/control.tree.in	2005-08-21 15:28:27 UTC (rev 4002)
@@ -2,7 +2,6 @@
 Architecture: all
 Section: devel
 Priority: optional
-Depends: linux-patch-debian- at version@ (= @srcver@)
 Description: Linux kernel source tree for building Debian kernel images
  This meta package is used as a build dependency of Debian
  linux-image packages to prevent a version discrepancy between




More information about the Kernel-svn-changes mailing list