r2763 - in trunk/kernel/source/kernel-source-2.6.11-2.6.11/debian: . patches patches/series

Andres Salomon dilinger-guest at costa.debian.org
Fri Oct 19 10:55:48 UTC 2007


Author: dilinger-guest
Date: 2005-03-21 10:38:36 +0100 (Mon, 21 Mar 2005)
New Revision: 2763

Added:
   trunk/kernel/source/kernel-source-2.6.11-2.6.11/debian/patches/amd64-int3-fix.patch
   trunk/kernel/source/kernel-source-2.6.11-2.6.11/debian/patches/amd64-outs.patch
   trunk/kernel/source/kernel-source-2.6.11-2.6.11/debian/patches/doc-post_halloween.patch
   trunk/kernel/source/kernel-source-2.6.11-2.6.11/debian/patches/docbook-allow-preprocessor-directives-between-kernel-doc-and-function.patch
   trunk/kernel/source/kernel-source-2.6.11-2.6.11/debian/patches/docbook-fix-function-parameter-descriptin-in-fbmem.patch
   trunk/kernel/source/kernel-source-2.6.11-2.6.11/debian/patches/docbook-move-kernel-doc-comment-next-to-function.patch
   trunk/kernel/source/kernel-source-2.6.11-2.6.11/debian/patches/drivers-add-scsi_changer.patch
   trunk/kernel/source/kernel-source-2.6.11-2.6.11/debian/patches/drivers-ide-__devinit.patch
   trunk/kernel/source/kernel-source-2.6.11-2.6.11/debian/patches/drivers-ide-dma-blacklist-toshiba.patch
   trunk/kernel/source/kernel-source-2.6.11-2.6.11/debian/patches/drivers-input-serio-8042-resume.patch
   trunk/kernel/source/kernel-source-2.6.11-2.6.11/debian/patches/fbdev-radeon-noaccel.patch
   trunk/kernel/source/kernel-source-2.6.11-2.6.11/debian/patches/fix-alpha-ext3-oops.patch
   trunk/kernel/source/kernel-source-2.6.11-2.6.11/debian/patches/fs-asfs.patch
   trunk/kernel/source/kernel-source-2.6.11-2.6.11/debian/patches/ia64-generic-nosmp.patch
   trunk/kernel/source/kernel-source-2.6.11-2.6.11/debian/patches/ia64-irq-affinity-upfix.patch
   trunk/kernel/source/kernel-source-2.6.11-2.6.11/debian/patches/modular-ide-pnp.patch
   trunk/kernel/source/kernel-source-2.6.11-2.6.11/debian/patches/modular-ide.patch
   trunk/kernel/source/kernel-source-2.6.11-2.6.11/debian/patches/modular-vesafb-3.patch
   trunk/kernel/source/kernel-source-2.6.11-2.6.11/debian/patches/modular-vesafb.patch
   trunk/kernel/source/kernel-source-2.6.11-2.6.11/debian/patches/patch-2.6.11.5.dpatch
   trunk/kernel/source/kernel-source-2.6.11-2.6.11/debian/patches/powerpc-calibrate-tau.patch
   trunk/kernel/source/kernel-source-2.6.11-2.6.11/debian/patches/powerpc-fix-power3-ftbfs.patch
   trunk/kernel/source/kernel-source-2.6.11-2.6.11/debian/patches/powerpc-g3-750cxe.patch
   trunk/kernel/source/kernel-source-2.6.11-2.6.11/debian/patches/powerpc-g4-l2-flush-errata.patch
   trunk/kernel/source/kernel-source-2.6.11-2.6.11/debian/patches/powerpc-mv643xx-enet.patch
   trunk/kernel/source/kernel-source-2.6.11-2.6.11/debian/patches/powerpc-mv643xx-eth-pegasos.patch
   trunk/kernel/source/kernel-source-2.6.11-2.6.11/debian/patches/powerpc-pmac-agp-sleep.patch
   trunk/kernel/source/kernel-source-2.6.11-2.6.11/debian/patches/powerpc-serial.patch
   trunk/kernel/source/kernel-source-2.6.11-2.6.11/debian/patches/powerpc-therm-adt746x-new-i2c-fix.patch
   trunk/kernel/source/kernel-source-2.6.11-2.6.11/debian/patches/remove-references-to-removed-drivers.patch
   trunk/kernel/source/kernel-source-2.6.11-2.6.11/debian/patches/sparc-sunsab-serial-lockup.patch
   trunk/kernel/source/kernel-source-2.6.11-2.6.11/debian/patches/sparc32-hypersparc-srmmu.patch
   trunk/kernel/source/kernel-source-2.6.11-2.6.11/debian/patches/sparc64-hme-lockup.patch
   trunk/kernel/source/kernel-source-2.6.11-2.6.11/debian/patches/sparc64-sb1500-clock-2.6.patch
   trunk/kernel/source/kernel-source-2.6.11-2.6.11/debian/patches/tty-locking-fixes9.patch
   trunk/kernel/source/kernel-source-2.6.11-2.6.11/debian/patches/x86-i486_emu.patch
Removed:
   trunk/kernel/source/kernel-source-2.6.11-2.6.11/debian/patches/amd64-int3-fix.dpatch
   trunk/kernel/source/kernel-source-2.6.11-2.6.11/debian/patches/amd64-outs.dpatch
   trunk/kernel/source/kernel-source-2.6.11-2.6.11/debian/patches/doc-post_halloween.dpatch
   trunk/kernel/source/kernel-source-2.6.11-2.6.11/debian/patches/docbook-allow-preprocessor-directives-between-kernel-doc-and-function.dpatch
   trunk/kernel/source/kernel-source-2.6.11-2.6.11/debian/patches/docbook-fix-function-parameter-descriptin-in-fbmem.dpatch
   trunk/kernel/source/kernel-source-2.6.11-2.6.11/debian/patches/docbook-move-kernel-doc-comment-next-to-function.dpatch
   trunk/kernel/source/kernel-source-2.6.11-2.6.11/debian/patches/drivers-add-scsi_changer.dpatch
   trunk/kernel/source/kernel-source-2.6.11-2.6.11/debian/patches/drivers-ide-__devinit.dpatch
   trunk/kernel/source/kernel-source-2.6.11-2.6.11/debian/patches/drivers-ide-dma-blacklist-toshiba.dpatch
   trunk/kernel/source/kernel-source-2.6.11-2.6.11/debian/patches/drivers-input-serio-8042-resume.dpatch
   trunk/kernel/source/kernel-source-2.6.11-2.6.11/debian/patches/fbdev-radeon-noaccel.dpatch
   trunk/kernel/source/kernel-source-2.6.11-2.6.11/debian/patches/fix-alpha-ext3-oops.dpatch
   trunk/kernel/source/kernel-source-2.6.11-2.6.11/debian/patches/fs-asfs.dpatch
   trunk/kernel/source/kernel-source-2.6.11-2.6.11/debian/patches/ia64-generic-nosmp.dpatch
   trunk/kernel/source/kernel-source-2.6.11-2.6.11/debian/patches/ia64-irq-affinity-upfix.dpatch
   trunk/kernel/source/kernel-source-2.6.11-2.6.11/debian/patches/modular-ide-pnp.dpatch
   trunk/kernel/source/kernel-source-2.6.11-2.6.11/debian/patches/modular-ide.dpatch
   trunk/kernel/source/kernel-source-2.6.11-2.6.11/debian/patches/modular-vesafb-3.dpatch
   trunk/kernel/source/kernel-source-2.6.11-2.6.11/debian/patches/modular-vesafb.dpatch
   trunk/kernel/source/kernel-source-2.6.11-2.6.11/debian/patches/patch-2.6.11.5
   trunk/kernel/source/kernel-source-2.6.11-2.6.11/debian/patches/powerpc-calibrate-tau.dpatch
   trunk/kernel/source/kernel-source-2.6.11-2.6.11/debian/patches/powerpc-fix-power3-ftbfs.dpatch
   trunk/kernel/source/kernel-source-2.6.11-2.6.11/debian/patches/powerpc-g3-750cxe.dpatch
   trunk/kernel/source/kernel-source-2.6.11-2.6.11/debian/patches/powerpc-g4-l2-flush-errata.dpatch
   trunk/kernel/source/kernel-source-2.6.11-2.6.11/debian/patches/powerpc-mv643xx-enet.dpatch
   trunk/kernel/source/kernel-source-2.6.11-2.6.11/debian/patches/powerpc-mv643xx-eth-pegasos.dpatch
   trunk/kernel/source/kernel-source-2.6.11-2.6.11/debian/patches/powerpc-pmac-agp-sleep.dpatch
   trunk/kernel/source/kernel-source-2.6.11-2.6.11/debian/patches/powerpc-serial.dpatch
   trunk/kernel/source/kernel-source-2.6.11-2.6.11/debian/patches/powerpc-therm-adt746x-new-i2c-fix.dpatch
   trunk/kernel/source/kernel-source-2.6.11-2.6.11/debian/patches/remove-references-to-removed-drivers.dpatch
   trunk/kernel/source/kernel-source-2.6.11-2.6.11/debian/patches/sparc-sunsab-serial-lockup.dpatch
   trunk/kernel/source/kernel-source-2.6.11-2.6.11/debian/patches/sparc32-hypersparc-srmmu.dpatch
   trunk/kernel/source/kernel-source-2.6.11-2.6.11/debian/patches/sparc64-hme-lockup.dpatch
   trunk/kernel/source/kernel-source-2.6.11-2.6.11/debian/patches/sparc64-sb1500-clock-2.6.dpatch
   trunk/kernel/source/kernel-source-2.6.11-2.6.11/debian/patches/tty-locking-fixes9.dpatch
   trunk/kernel/source/kernel-source-2.6.11-2.6.11/debian/patches/x86-i486_emu.dpatch
Modified:
   trunk/kernel/source/kernel-source-2.6.11-2.6.11/debian/changelog
   trunk/kernel/source/kernel-source-2.6.11-2.6.11/debian/patches/series/2.6.11-1
Log:
rename all dpatches to patches


Modified: trunk/kernel/source/kernel-source-2.6.11-2.6.11/debian/changelog
===================================================================
--- trunk/kernel/source/kernel-source-2.6.11-2.6.11/debian/changelog	2005-03-21 09:35:04 UTC (rev 2762)
+++ trunk/kernel/source/kernel-source-2.6.11-2.6.11/debian/changelog	2005-03-21 09:38:36 UTC (rev 2763)
@@ -83,6 +83,9 @@
     o Fix check for underflow
   (Andres Salomon).
 
+  * Drop dpatch crap, we weren't really using dpatch anyways
+  (Andres Salomon).
+
  -- Andres Salomon <dilinger at debian.org>  Mon, 21 Mar 2005 04:11:57 -0500
 
 kernel-source-2.6.10 (2.6.10-6) unstable; urgency=low

Deleted: trunk/kernel/source/kernel-source-2.6.11-2.6.11/debian/patches/amd64-int3-fix.dpatch
===================================================================
--- trunk/kernel/source/kernel-source-2.6.11-2.6.11/debian/patches/amd64-int3-fix.dpatch	2005-03-21 09:35:04 UTC (rev 2762)
+++ trunk/kernel/source/kernel-source-2.6.11-2.6.11/debian/patches/amd64-int3-fix.dpatch	2005-03-21 09:38:36 UTC (rev 2763)
@@ -1,23 +0,0 @@
-#! /bin/sh -e 
-## amd64-int3-fix.dpatch by <fschueler at gmx.net>
-##
-## All lines beginning with `## DP:' are a description of the patch.
-## DP: Description: Revert int3 handling
-## DP: Patch author: Andi Kleen <ak at muc.de>
-## DP: Upstream status: not yet committed to BK
-
-. $(dirname $0)/DPATCH
-
- at DPATCH@
-
---- kernel-source-2.6.11-2.6.11-orig/arch/x86_64/kernel/kprobes.c	2005-03-02 08:38:12.000000000 +0100
-+++ kernel-source-2.6.11-2.6.11/arch/x86_64/kernel/kprobes.c	2005-03-05 10:55:17.306986104 +0100
-@@ -307,6 +307,8 @@
- 	struct die_args *args = (struct die_args *)data;
- 	switch (val) {
- 	case DIE_INT3:
-+		if (args->regs->cs & 3)
-+			return NOTIFY_DONE;
- 		if (kprobe_handler(args->regs))
- 			return NOTIFY_STOP;
- 		break;

Copied: trunk/kernel/source/kernel-source-2.6.11-2.6.11/debian/patches/amd64-int3-fix.patch (from rev 2762, trunk/kernel/source/kernel-source-2.6.11-2.6.11/debian/patches/amd64-int3-fix.dpatch)

Deleted: trunk/kernel/source/kernel-source-2.6.11-2.6.11/debian/patches/amd64-outs.dpatch
===================================================================
--- trunk/kernel/source/kernel-source-2.6.11-2.6.11/debian/patches/amd64-outs.dpatch	2005-03-21 09:35:04 UTC (rev 2762)
+++ trunk/kernel/source/kernel-source-2.6.11-2.6.11/debian/patches/amd64-outs.dpatch	2005-03-21 09:38:36 UTC (rev 2763)
@@ -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)

Copied: trunk/kernel/source/kernel-source-2.6.11-2.6.11/debian/patches/amd64-outs.patch (from rev 2762, trunk/kernel/source/kernel-source-2.6.11-2.6.11/debian/patches/amd64-outs.dpatch)

Deleted: trunk/kernel/source/kernel-source-2.6.11-2.6.11/debian/patches/doc-post_halloween.dpatch
===================================================================
--- trunk/kernel/source/kernel-source-2.6.11-2.6.11/debian/patches/doc-post_halloween.dpatch	2005-03-21 09:35:04 UTC (rev 2762)
+++ trunk/kernel/source/kernel-source-2.6.11-2.6.11/debian/patches/doc-post_halloween.dpatch	2005-03-21 09:38:36 UTC (rev 2763)
@@ -1,1289 +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: add post-halloween-2.6.txt
-## DP: Patch author: unknown
-## DP: Upstream status: not submitted
-
-. $(dirname $0)/DPATCH
-
- at DPATCH@
-diff -urN kernel-source-2.6.6/Documentation/post-halloween-2.6.txt kernel-source-2.6.6-1/Documentation/post-halloween-2.6.txt
---- kernel-source-2.6.6/Documentation/post-halloween-2.6.txt	1970-01-01 10:00:00.000000000 +1000
-+++ kernel-source-2.6.6-1/Documentation/post-halloween-2.6.txt	2004-02-23 08:01:43.000000000 +1100
-@@ -0,0 +1,1274 @@
-+
-+                     The post-halloween document. v0.48
-+                        (aka, 2.6 - what to expect)
-+
-+                    Dave Jones <davej at codemonkey.org.uk>
-+
-+                          (Updated as of 2.6.0)
-+
-+This document explains some of the new functionality to be found in the 2.6
-+Linux kernel, some pitfalls you may encounter, and also points out some new
-+features which could really use testing.
-+Note, that "contact foo at bar.com" below also implies that you should also
-+cc: linux-kernel at vger.kernel.org.
-+
-+Latest version of this document can always be found at
-+http://www.codemonkey.org.uk/docs/post-halloween-2.6.txt
-+
-+Thanks to many [far too many to list] people for valuable feedback.
-+
-+Note, that this document is somewhat x86-centric, but most features
-+documented here affect all platforms anyway.
-+
-+Translations:
-+Spanish - http://www.terra.es/personal/diegocg/post-halloween-2.6.es.txt
-+German  - http://www.kubieziel.de/computer/halloween-german.html
-+Polish  - http://soltysiak.com/linux/post-halloween-2.6.pl.txt
-+pt_BR   - http://www.maluco.com.br/thiago/docs/post-halloween-2.6-pt_BR.txt
-+
-+
-+Applying patches.
-+~~~~~~~~~~~~~~~~~
-+- In 2.4 and previous kernels, the recommended way to apply patches was
-+  to use a command line such as ...
-+  gzip -cd patchXX.gz | patch -p0
-+  In 2.6, Linus started adding an extra path element to the diffs,
-+  so using -p1 in the untarred 'to be patched' directory is necessary.
-+
-+Reporting bugs.
-+~~~~~~~~~~~~~~~
-+Most large subsystems of the kernel have their own mailing list.
-+Mailing these with bug reports is always good. If in doubt, send
-+them to linux-kernel at vger.kernel.org
-+
-+    ACPI      - acpi-devel at lists.sourceforge.net
-+    Bluetooth - bluez-devel at lists.sourceforge.net
-+    Ext2      - ext2-devel at lists.sourceforge.net
-+    Firewire  - linux1394-devel at lists.sourceforge.net
-+    SCSI      - linux-scsi at vger.kernel.org
-+    USB       - linux-usb-users at lists.sourceforge.net
-+    XFS       - linux-xfs at oss.sgi.com
-+
-+Known gotchas.
-+~~~~~~~~~~~~~~
-+Certain known bugs are being reported over and over. Here are the
-+workarounds.
-+- Blank screen after decompressing kernel?
-+  Make sure your .config has
-+   CONFIG_INPUT=y
-+   CONFIG_VT=y
-+   CONFIG_VGA_CONSOLE=y
-+   CONFIG_VT_CONSOLE=y
-+  A lot of people have discovered that taking their .config from 2.4 and
-+  running make oldconfig to pick up new options leads to problems, notably
-+  with CONFIG_VT not being set.
-+- An additional bug biting some people is that NICs fail to receive packets
-+  (usually notable by a NIC not getting a DHCP lease for eg, despite being
-+   sent one by the server). Booting with "noapic" "acpi=off" or a combination
-+  of both fixes this for most people.
-+- (Possibly linked to above bug) VIA APIC routing is currently broken.
-+  boot with 'noapic'.
-+- Can't load any modules? You need updated tools (See modules section below).
-+- depmod reports Unresolved symbols?  depmod from modutils instead of
-+  depmod from module-init-tools is first in $PATH (might be different
-+  $PATHs as $USER and $ROOT)
-+
-+
-+Regressions.
-+~~~~~~~~~~~~
-+(Things not expected to work just yet)
-+- The hptraid/promise drivers for proprietary RAID formats are currently
-+  non functional, and will probably be converted to use device-mapper.
-+- Some filesystems still need work (Intermezzo, UFS, HFS, HPFS..)
-+  - UMSDOS fs is currently missing, pending rewrite.
-+  - EFS (has a blocksize problem, depending on the device that the
-+    filesystem is being mounted on)
-+- A number of drivers don't compile currently due to them needing various
-+  work to convert them to the new APIs
-+- The format of /proc/stat changed, which could break some
-+  applications that still depend on the old layout.
-+- Some people seem to have trouble running rpm, most notably Red Hat 9 users.
-+  This is a known bug of rpm.
-+  Workaround: run "export LD_ASSUME_KERNEL=2.2.5", before running rpm.
-+  This is thought to be a bug related to db4 and O_DIRECT interaction.
-+
-+
-+Stuff needing forward porting from 2.4.
-+~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
-+- HFSPlus
-+- SuperH 64
-+
-+
-+Removed features.
-+~~~~~~~~~~~~~~~~~
-+- khttpd is gone.
-+- Older Direct Rendering Manager (DRM) support (For XFree86 4.0)
-+  has been removed. Upgrade to XFree86 4.1.0 or higher.
-+- LVM1 has been removed. See Device-mapper below.
-+- The system call table is no longer exported. Any module that relied
-+  on this previously will no longer work.
-+- Soundmodem hamradio support has been removed. Its functionality
-+  has been superceded by a userspace replacement.
-+  http://www.baycom.org/~tom/ham/soundmodem
-+- Direct booting from floppy is no longer supported.
-+  You should now use a boot loader program such as syslinux instead.
-+  "make bzdisk" continues to work (now using syslinux).
-+- Callout tty devices (/dev/cua) have been deprecated since 2.1.90pre2.
-+  Support is now removed.
-+
-+
-+Deprecated/obsolete features.
-+~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
-+- devfs will be obsoleted in favour of udev (http://www.kernel.org/pub/linux/utils/kernel/hotplug/)
-+- boot time root= parsing changed.
-+  ramdisks are now ram<n> instead of rd<n> and cm206 is cm206cd (instead of
-+  cm206).
-+- usbdevfs will be going away in 2.7. The same filesystem can
-+  be mounted as 'usbfs' in recent 2.4 kernels, and in 2.5.52
-+  and above, which is what the filesystem will furthermore be
-+  known as.
-+- elvtune is deprecated (as are the ioctl's it used).
-+  Instead, the io scheduler tunables are exported in sysfs (see below)
-+  in the /sys/block/<device>/queue/iosched directory.
-+  Jens wrote a document explaining the tunables of the new scheduler at
-+  http://www.lib.uaa.alaska.edu/linux-kernel/archive/2002-Week-44/att-deadline-iosched.txt
-+- Using sysctls by numeric values is deprecated, and will go away
-+  in the next development series.
-+
-+
-+Modules.
-+~~~~~~~~
-+- The in-kernel module loader was reimplemented.
-+- You need replacement module utilities from
-+  http://www.kernel.org/pub/linux/kernel/people/rusty/modules/
-+- A backwards compatible set of module utilities is also available
-+  from the same URL in RPM format.
-+- Debian sarge/sid or Conectiva snapshot users can just use
-+  'apt-get install module-init-tools'
-+- Modules now free stuff marked with __init or __initdata.
-+- For Red Hat users, there's another pitfall in "/etc/rc.sysinit".
-+  During startup, the script sets up the binary used to dynamically load
-+  modules stored at "/proc/sys/kernel/modprobe". The initscript looks
-+  for "/proc/ksyms", but since it doesn't exist in 2.6 kernels, the
-+  binary used is "/sbin/true" instead.
-+
-+  This, eventually, will keep modules from working. Red Hat users will
-+  have to patch the "/etc/rc.sysinit" script to set
-+  "/proc/sys/kernel/modprobe" to "/sbin/modprobe", even
-+  when "/proc/ksyms" doesn't exist.
-+- Modules now have a .ko suffix instead of .o
-+- Some (older) versions of 'mkinitrd' don't search for modules
-+  that end with .ko, so update your mkinitrd if this is a problem.
-+
-+
-+Kernel build system.
-+~~~~~~~~~~~~~~~~~~~~
-+- The build system is much improved compared to 2.4.
-+  You should notice quicker builds, and less spontaneous rebuilds
-+  of files on subsequent builds from already built trees.
-+- There are new graphical config tools.
-+  "make xconfig" now requires the qt libraries.
-+  "make gconfig" uses gtk libraries.
-+- Make menuconfig/oldconfig has no user-visible changes other than speed,
-+  whilst numerous improvements have been made.
-+- Several new debug targets exist: 'allyesconfig' 'allnoconfig' 'allmodconfig'.
-+- Note: The new configuration system is not CML2 related.
-+- Also note: Whilst some ideas were taken from it, Keith Owens'
-+  kbuild-2.5 project was not integrated.
-+- "make" is now the preferred command, without a target; it does <arch-zimage>
-+  and modules.
-+- "make -jN" is now the preferred parallel-make execution.
-+  Do not bother to provide "MAKE=xxx"
-+- The build is now much less verbose.  If you want to see exactly what's
-+  going on, try "make V=1" or set KBUILD_VERBOSE=1 in your environment.
-+- 'make kernel/mm.o' will build the named file, provided a
-+  corresponding source exists. This also works for (non-composite)
-+  modules. (FIXME: broken for modules right now?)
-+- 'make kernel/' will compile all files in a subdirectory and below.
-+- There is no need to run 'make dep' at any stage.
-+- 'make help' provides a list of typical targets, including debugging targets.
-+- You can now build in a separate tree from the source by doing
-+  make O=builddir
-+
-+
-+IO subsystem.
-+~~~~~~~~~~~~~
-+- You should notice considerable throughput improvements over 2.4 due
-+  to much reworking of the block and the memory management layers.
-+- Report any regressions in this area to Jens Axboe <axboe at suse.de>
-+  and Andrew Morton <akpm at osdl.org>
-+- Two different IO elevators are available. The default is the
-+  anticipatory IO scheduler. You can select the deadline scheduler by
-+  booting with "elevator=deadline" on the kernel command line.
-+- For some workloads the anticipatory scheduler is around 10% slower
-+  than deadline. Most notably, database workloads which seek all over the
-+  disk performing reads and synchronous writes. Database folks will likely
-+  want to boot with elevator=deadline to get that last bit of performance back.
-+- Assorted changes throughout the block layer meant various block
-+  device drivers had a large scale cleanup whilst being updated to
-+  newer APIs.
-+- The size and alignment of O_DIRECT file IO requests now matches that
-+  of the device, not the filesystem.  Typically this means that you
-+  can perform O_DIRECT IO with 512-byte granularity rather than 4k.
-+  But if you rely upon this, your application will not work on 2.4 kernels
-+  and will not work on some devices.
-+
-+
-+block device size support.
-+~~~~~~~~~~~~~~~~~~~~~~~~~~
-+- Thanks to work done by Peter Chubb, block devices can now access up to
-+  16TB on 32-bit architectures, and up to 8EB on 64-bit architectures.
-+- To use the new BLKGETSZ64 ioctls, you'll need updated file-utils.
-+  (Currently only jfsutils 1.0.20 has this change, patches for other
-+   filesystems are still pending merging)
-+- The old 'struct statfs' is not able to describe large devices - the
-+  statfs() system call will now return -EOVERFLOW for such devices.
-+  A new system call called statfs64() with a new structure has been added
-+  to support large devices. It it unknown at time of writing how many
-+  userspace utilities have been converted to take advantage of this
-+  syscall when available.
-+
-+
-+POSIX ACLs & Extended attributes.
-+~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
-+- Userspace tools available at http://acl.bestbits.at
-+
-+
-+VM Changes.
-+~~~~~~~~~~~
-+- Version zero swap partitions are no longer supported (everything is
-+  using v1 now anyway - rerun mkswap if in doubt).
-+  Linux 2.0.x requires v0 swap space, Linux v2.1.117 and later
-+  support v1.  mkswap(8) can format swap space in either format.
-+- The actual 'reverse mappings' part of Rik van Riel's rmap vm was merged.
-+  VM behaviour under certain loads should improve.
-+- VM misbehaviour should be reported to linux-mm at kvack.org
-+- The VM explicitly checks for sparse swapfiles, and aborts if one is found.
-+- /proc/sys/vm/swappiness defines the kernel's preference for pagecache over
-+  mapped memory. Setting it to 100 (percent) makes it treat both types of
-+  memory equally. Setting it to zero makes the kernel very much prefer to
-+  reclaim plain pagecache rather than mapped-into-pagetables memory.
-+- The bdflush() syscall is now officially deprecated. The syscall
-+  does nothing, and prints a stern warning to users. The functionality
-+  is replaced by the pdflush daemons.
-+- Due to various changes, swap files should be just as fast as swap partitions.
-+- In 2.4, up to 64 swap files were possible. In 2.6, this number is reduced
-+  to 32.  Like 2.4, these files can be up to 64GB in size, though you will
-+  need a recent util-linux to have a mkswap utility that supports >2GB
-+
-+
-+Kernel preemption.
-+~~~~~~~~~~~~~~~~~~
-+- The much talked about preemption patches made it into 2.6.
-+  With this included you should notice much lower latencies especially
-+  in demanding multimedia applications. 
-+- Note, there are still cases where preemption must be temporarily disabled
-+  where we do not. These areas occur in places where per-CPU data is used.
-+- If you get "xxx exited with preempt count=n" messages in syslog,
-+  don't panic, these are non fatal, but are somewhat unclean.
-+  (Something is taking a lock, and exiting without unlocking)
-+- If you DO notice high latency with kernel preemption enabled in
-+  a specific code path, please report that to Andrew Morton <akpm at osdl.org>
-+  and Robert Love <rml at tech9.net>.
-+  The report should be something like "the latency in my xyz application
-+  hits xxx ms when I do foo but is normally yyy" where foo is an action
-+  like "unlink a huge directory tree".
-+
-+
-+Process scheduler improvements.
-+~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
-+- Another much talked about feature. Ingo Molnar reworked the process
-+  scheduler to use an O(1) algorithm.  In operation, you should notice
-+  no changes with low loads, and increased scalability with large numbers
-+  of processes, especially on large SMP systems.
-+- Scheduler is now Hyperthreading SMP aware and will disperse processes
-+  over physically different CPUs, instead of just over logical CPUs.
-+- Robert Love wrote various utilities for changing behaviour of the
-+  scheduler (binding processes to CPUs etc). You can find these tools at
-+  http://tech9.net/rml/schedutils
-+- The behavior of sched_yield() changed a lot.  A task that uses
-+  this system call should now expect to sleep for possibly a very
-+  long time.  Tasks that do not really desire to give up the
-+  processor for a while should probably not make heavy use of this
-+  function.  Unfortunately, some GUI programs (like Open Office)
-+  do make excessive use of this call and under load their
-+  performance is poor.  It seems this new 2.6 behavior is optimal
-+  but some user-space applications may need fixing.
-+- The above applies to use of yield() in the kernel, too.
-+- 2.6 adds system calls for manipulating a task's processor
-+  affinity: sched_getaffinity() and sched_setaffinity()
-+- Regressions to mingo at redhat.com and rml at tech9.net
-+- Debian users who encounter effects such as skips in mp3
-+  playback, jerky mouse movement may want to stop the
-+  X server from renicing itself to -10
-+  You can alter this permanently with 'dpkg-reconfigure xserver-common';
-+  if you elect not to have /etc/X11/Xwrapper.config managed by debconf,
-+  simply edit it directly.
-+- Balancing of IRQs between multiple CPUs should be handled using the
-+  irqbalance (http://people.redhat.com/arjanv/irqbalance/) program.
-+- David Mosberger maintains a webpage containing some current 'known gotchas'
-+  of the O(1) scheduler at http://www.hpl.hp.com/research/linux/kernel/o1.php
-+
-+
-+PCI.
-+~~~~
-+- PCI domain support has been added.  For most people, this just means that
-+  all PCI slot names are extended with "0000:" on the front, but for people
-+  with bigger servers it means they're able to access all their PCI devices.
-+- More hotplug drivers have been added, including a fake PCI hotplug driver
-+  so people without specialised hardware can test hotplug features.
-+
-+Random.
-+~~~~~~~
-+- /dev/hwrandom got support for some new hardware (now also backported to 2.4)
-+  such as the HW RNG on newer VIA Cyrix CPUs.
-+- rng-tools can be found at http://sourceforge.net/projects/gkernel
-+
-+
-+Fast userspace mutexes (Futexes).
-+~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
-+- Rusty Russell added functionality that allows userspace to have
-+  fast mutexes that only use syscalls when there is contention. Used by
-+  NPTL.
-+- Additional information on futexes can be found in Ulrich Dreppers
-+  paper on the subject at http://people.redhat.com/drepper/futex.pdf
-+- Bert Hubert has written some documentation on this functionality
-+  at http://ds9a.nl/futex-manpages
-+
-+
-+epoll
-+~~~~~
-+Davide Libenzi wrote an event based poll replacement that got
-+included in 2.6.  More info available at
-+http://www.xmailserver.org/linux-patches/nio-improve.html
-+http://lwn.net/Articles/13587/
-+
-+
-+Threading improvements.
-+~~~~~~~~~~~~~~~~~~~~~~~
-+- Ingo Molnar put a lot of work into threading improvements for 2.6.
-+  Some of the features of this work are:
-+  -  Generic pid allocator (arbitrary number of PIDs with no slowdown,
-+     unified pidhash).
-+  -  Thread Local Storage syscalls
-+  -  sys_clone() enhancements (CLONE_SETTLS, CLONE_PARENT_SETTID, CLONE_SETTID,
-+     CLONE_CLEARTID, CLONE_DETACHED)
-+  -  POSIX thread signals stuff (atomic signals, shared signals, etc.)
-+  -  Per-CPU GDT
-+  -  Threaded coredumping support
-+  -  sys_exit() speedups (O(1) exit)
-+  -  Generic, improved futexes, vcache
-+  -  New, threading related ptrace features
-+  -  exit/fork task cache
-+  -  /proc updates for threading
-+  -  API changes for threading.
-+- Users should notice a significant speedup in basic thread operations.
-+  This is true to a lesser extent even for old-threading userspace libraries 
-+  such as LinuxThreads.
-+- Regressions should go to Ingo Molnar <mingo at redhat.com> and
-+  phil-list at redhat.com.  Regressions could happen in the area of signal
-+  handling and related threading semantics, plus coredumping.
-+- Native Posix Threading Library (NPTL).
-+  Ulrich Drepper worked closely with Ingo on the threading enhancements, and
-+  developed a 1:1 model threading library. You can find out more about NPTL at
-+  http://people.redhat.com/drepper/nptl-design.pdf
-+
-+
-+Enhanced coredumping. 
-+~~~~~~~~~~~~~~~~~~~~~
-+- 2.6 offers you the ability to configure the way core files are
-+  named through a /proc/sys/kernel/core_pattern file.
-+  You can use various format identifiers in this name to affect
-+  how the core dump is named.
-+
-+    %p - insert pid into filename
-+    %u - insert current uid into filename
-+    %g - insert current gid into filename
-+    %s - insert signal that caused the coredump into the filename
-+    %t - insert UNIX time that the coredump occurred into filename
-+    %h - insert hostname where the coredump happened into filename
-+    %e - insert coredumping executable name into filename
-+
-+  You should ensure that the string does not exceed 64 bytes.
-+- Multithreaded processes can now dump core
-+
-+
-+Input layer.
-+~~~~~~~~~~~~
-+- Possibly the most visible change to the end user. If misconfigured,
-+  you'll find that your keyboard/mouse/other input device will no longer work.
-+  2.6 offers a much more flexible interface to devices such as keyboards.
-+- The downside is more confusing options.
-+  In the "Input device support" menu, be sure to enable at least the following.
-+
-+                    --- Input I/O drivers
-+                    < > Serial i/o support
-+                    < >   i8042 PC Keyboard controller
-+                    [ ] Keyboards
-+                    [ ] Mice
-+
-+  (Also choose the relevant keyboard/mouse from the list)
-+
-+- If you find your keyboard/mouse still don't work, edit the file
-+  drivers/input/serio/i8042.c, and replace the #undef DEBUG
-+  with a #define DEBUG, recompile and reinstall.
-+
-+  When you boot, you should now see a lot more debugging information.
-+  Forward this information to Vojtech Pavlik <vojtech at suse.cz>
-+
-+- If you use a KVM switcher, and experience problems, booting with the boot
-+  time argument 'psmouse_noext' should fix your problems.
-+- Users of multimedia keys without X will see changes in how the kernel
-+  handles those keys. People who customize keymaps or keycodes in 2.4
-+  may need to make some changes in 2.6
-+- Users wanting support for the PC speaker need to enable CONFIG_INPUT_PCSPKR,
-+  or you won't get a single beep.
-+- Synaptics touchpad users may be interested to check out
-+  http://w1.894.telia.com/~u89404340/touchpad/
-+- In 2.4 users of Japanese keyboards were able to type '|' or
-+  '\' characters without loading any custom keymap on the
-+  console.  With the keymap in 2.6, this is not possible
-+  anymore.  People with these keyboards have to load a keymap
-+  with loadkeys rebuilt from the source, since loadkeys in some
-+  vendor distributions cannot load keycodes larger than 127.
-+  There is a patch to fix this, but it has not been integrated
-+  (http://tinyurl.com/t75a).
-+
-+PnP layer.
-+~~~~~~~~~~
-+- Support for plug and play devices such as early ISAPnP cards has improved a
-+  lot in the 2.6 kernel. The new code behaves more closely to the code
-+  handling PCI devices (probe, remove etc callbacks), and also merges
-+  PnP BIOS access code.
-+- Report any regressions in plug & play functionality to
-+  Adam Belay <ambx1 at neo.rr.com>
-+
-+
-+ALSA.
-+~~~~~
-+- The advanced linux sound architecture was merged into 2.6.
-+  This offers considerably improved functionality over the older OSS drivers,
-+  but requires new userspace tools.
-+- Several distros have shipped ALSA for some time, so you may already have the
-+  necessary tools. If not, you can find them at http://www.alsa-project.org/
-+- ALSA can emulate OSS interface using the snd_pcm_oss/snd_pcm_mixer
-+  modules, if your card produces nothing but silence, you may need to run
-+  alsamixer to unmute channels wich /dev/mixer doesn't see
-+- Note that the OSS drivers are also still functional, and still present.
-+  Many features/fixes that went into 2.4 are still not applied to these
-+  drivers, and it's still unclear if they will remain when 2.6 ships.
-+  The long term goal is to get everyone moved over to (the superior) ALSA.
-+
-+
-+AGP.
-+~~~~
-+- The agpgart driver got a long overdue cleanup which involved
-+  splitting it into an agpgart core, and per-chipset drivers.
-+  You may need to adjust your modules configuration to autoload
-+  the chipset drivers on loading the agpgart module.
-+- Generic AGP 3.0 support is now included.
-+
-+DRI.
-+~~~~
-+- Direct rendering in 2.6 hasn't had much (if any?) testing on
-+  older versions of XFree86. Feedback on whether 4.1 works would
-+  be useful.
-+
-+
-+Faster system calls.
-+~~~~~~~~~~~~~~~~~~~~
-+- Systems that support the SYSENTER extension (Basically Intel Pentium-II
-+  and above, and AMD Athlons) now have a faster method of making the
-+  transition from userspace to kernelspace when a syscall is performed.
-+- Pentium Pro also has SYSENTER, but due to errata, is unusable.
-+- Without an updated glibc, this will not be noticable.
-+- VMWare 4 users may get crashes due to this.
-+  Zwane Mwaikambo wrote a patch for a "nosysenter" option which is worth
-+  googling for if there isn't a vmware update available.
-+- Regressions to torvalds at osdl.org and libc-alpha at sources.redhat.com
-+
-+
-+procps.
-+~~~~~~~
-+- The 2.6 /proc filesystems changed some statistics, which confuse older
-+  versions of procps. Rik van Riel and Robert Love have been maintaining a
-+  version of procps during the development of 2.6 which tracks changes to
-+  /proc which you can find at http://tech9.net/rml/procps/
-+- Alternatively, the procps by Albert Cahalan now supports the altered formats
-+  since v3.0.5  -- http://procps.sf.net/
-+- The /proc/meminfo format changed slightly which also broke gtop in strange
-+  ways. Likely this also broke some of the KDE/GNOME panel applets.
-+
-+
-+Framebuffer layer.
-+~~~~~~~~~~~~~~~~~~
-+- James Simmons has reworked the framebuffer/console layer considerably for
-+  2.6. Support for some cards is still lagging a little, but it should be
-+  functionally no different than previous incarnations.
-+- boot time arguments may have changed depending on your driver.
-+  an example of the change is..
-+    append = "video=radeon:1024x768-24 at 100"
-+  needs to become..
-+    append = "video=radeonfb:1024x768-24 at 100"
-+- Current userspace tools (fbset for eg) are not yet updated,
-+  and won't function as expected.
-+- The VESA framebuffer now enables MTRRs for the framebuffer memory range during
-+  initialisation (Note: PCI cards only).
-+  If you notice screen corruption, please report this, along with an lspci output,
-+  so your card can be blacklisted.
-+- Any problems should go to <jsimmons at infradead.org>
-+
-+
-+IDE.
-+~~~~
-+- The IDE code rewrite was subject to much criticism in early 2.5.x, which
-+  put off a lot of people from testing. This work was then subsequently
-+  dropped, and reverted back to a 2.4.18 IDE status.
-+  Since then additional work has occurred, but not to the extent
-+  of the first cleanup attempts.
-+- Known problems with the current IDE code. 
-+  o  Simplex IDE devices (eg Ali15x3) are missing DMA sometimes
-+  o  Most PCMCIA devices have unload races and may oops on eject
-+  o  Modular IDE does not yet work, modular IDE PCI modules sometimes
-+     oops on loading
-+  o  ide-scsi is completely broken in 2.6 currently. Known problem.
-+     If you need it either use 2.4 or fix it 8)
-+- IDE disk geometry translators like OnTrack, EZ Partition, Disk Manager
-+  are no longer autodetected. The only way forward is to remove the translator
-+  from the drive, and start over, or use boot parameters depending on the
-+  type of remapper used :-
-+    hdx=remap63   - add 63 to each sector (For OnTrack DM)
-+    hdx=remap     - remap 0->1 (For EZDrive)
-+- See also the CD Recording section for some important changes
-+  related to IDE CD writers.
-+
-+IDE TCQ.
-+~~~~~~~~
-+- Tagged command queueing for IDE devices has been included.
-+- Not all combinations of controllers & devices may like this,
-+  so handle with care.
-+  READ AS: ** Don't use IDE TCQ on any data you value.
-+  It's likely bad combinations will be blacklisted as and when discovered.
-+
-+- If you didn't choose the "TCQ on by default" option, you can enable
-+  it by using the command
-+
-+    echo "using_tcq:32" > /proc/ide/hdX/settings
-+
-+  (replacing 32 with 0 disables TCQ again).
-+
-+- Report success/failure stories to Jens Axboe <axboe at suse.de> with
-+  inclusion of hdparm -i /dev/hdX, and lspci output.
-+
-+
-+SCSI.
-+~~~~~
-+- Various SCSI drivers still need work, and don't even compile.
-+- Various drivers currently lack error handling.
-+  These drivers will cause warnings during compilation due to
-+  missing abort: & reset: functions.
-+- Note, that some drivers have had these members removed, but still
-+  lack error handling. Those noticed so far are ncr53c8xxx, sym53c8xx
-+- large dev_t support allowing thousands of disks to be
-+  supported (was 128 or 256 in the 2.4 series)
-+- major code cleanup, initially to support the block layer (bio)
-+  improvements have led to:
-+   - better throughput (?) [less double handling of data]
-+   - per HBA locks (there was a single io_request_lock in
-+     the 2.4 series)
-+   - more flexible interface to HBA drivers
-+   - better hotplug support, especially for USB mass storage
-+     and ieee1394 sbp2 devices [well it's work_in_progress]
-+- improved error processing and scanning code (support for
-+  large, sparse lun spaces)
-+- lots of scsi driver internals available via sysfs
-+
-+
-+v4l2.
-+~~~~~
-+- The video4linux API finally got its long awaited cleanup.
-+- xawtv, bttv and most other existing v4l tools are also compatible
-+  with the new v4l2 layer. You should notice no loss in functionality.
-+- See http://bytesex.org/v4l/ for more information.
-+
-+
-+Quota reworking.
-+~~~~~~~~~~~~~~~~
-+The new quota system needs new tools. Supports 32 bit uids.
-+http://www.sf.net/projects/linuxquota/
-+
-+
-+CD Recording.
-+~~~~~~~~~~~~~
-+- Jens Axboe added the ability to use DMA for writing CDs on
-+  ATAPI devices. Writing CDs should be much faster than it
-+  was in 2.4, and also less prone to buffer underruns and the like.
-+- With a recent cdrecord, you also no longer need ide-scsi in order to use
-+  an IDE CD writer.
-+- Ripping audio tracks off of CDs now also uses DMA and should be
-+  notably faster. You can also find an updated cdda2wav at:
-+  *.kernel.org/pub/linux/kernel/people/axboe/tools/
-+- Send good/bad reports of audio extraction with cdda2wav and burning with
-+  the cdrecord to Jens Axboe <axboe at suse.de>
-+- Currently only 'open by device name' works in cdrecord.
-+  cdrecord -dev=/dev/hdX -inq
-+- More info at http://lwn.net/Articles/13538/ & http://lwn.net/Articles/13160/
-+
-+
-+USB:
-+~~~~
-+- USB host controller drivers were renamed in 2.6. They are now
-+   uhci-hcd for UHCI controllers.
-+   ohci-hcd for OHCI controllers.
-+   ehci-hcd for EHCI (USB 2.0) controllers.
-+- Very little user visible changes, the only noticable 'major' change
-+  is that there is now only one UHCI driver. As noted elsewhere, usbdevfs 
-+  was renamed to usbfs.
-+- USB-storage has changed behaviour. A device which is disconnected and
-+  then reconnected is not reassociated with the old /dev node.
-+- USB storage also got several performance enhancements.
-+
-+- USB 'gadget' support.
-+  There's a new "USB Gadget" API supporting USB devices that
-+  run Linux inside.  Examples include PDAs, cable modems,
-+  and some printers.  That API is how the driver for the
-+  USB Device Controller (UDC) hardware talks with portable
-+  "gadget drivers".  A gadget driver is what makes that
-+  hardware act like a "network link" or a "printer".
-+		                                                                                           
-+  When you don't want to write a gadget driver in the kernel,
-+  then "gadgetfs" lets you do it in user mode programs.
-+  Each endpoint appears as a single file, so it's a lot
-+  simpler than "usbfs".  Currently it's purely synchronous,
-+  but it should be natural for someone to add AIO support.
-+		                                                                                           
-+  See http://www.linux-usb.org/gadget for more information
-+  about this API framework, including a pthreaded example
-+  "gadgetfs" program.  See the 2.6 kerneldoc for API info.
-+		
-+
-+Nanosecond stat:
-+~~~~~~~~~~~~~~~~
-+The stat64() syscall was changed to return jiffies granularity.
-+This allows make(1) to make better decisions on whether or not it
-+needs to recompile a file. Not all filesystems may support such precision.
-+
-+
-+Filesystems:
-+~~~~~~~~~~~~
-+A number of additional filesystems have made their way into 2.6.
-+Currently it supports: ext2, ext3, reiserfs, jfs, xfs, minix, romfs,
-+iso9660, udf, msdos, vfat, ntfs (ro), adfs, amiga ffs, apple macintosh hfs,
-+BeOS befs (ro), bfs, efs (ro), cramfs, free vxfs, os/2 hpfs, qnx4fs,
-+sysvfs, ufs.
-+Whilst these have had testing out of tree, the level of testing
-+after merging is unparalleled. Be wary of trusting data to immature
-+filesystems.  A number of new features and improvements have also
-+been made to the existing filesystems from 2.4.
-+
-+Reports of stress testing with the various tools available would
-+be beneficial.
-+
-+
-+Generic VFS changes.
-+~~~~~~~~~~~~~~~~~~~~
-+- Since Linux 2.5.1 it is possible to atomically move a subtree to
-+  another place. The usage is...
-+   mount --move olddir newdir
-+- Since 2.5.43, dmask=value sets the umask applied to directories only.
-+  The default is the umask of the current process.
-+  The fmask=value sets the umask applied to regular files only.
-+  Again, the default is the umask of the current process.
-+- Directories can now be marked as synchronous using chattr +S,
-+  so that all changes will be immediately written to disk.
-+  Note, this does not guarantee atomicity, at least not for all filesystems
-+  and for all operations.  You *can* be guaranteed that system calls will
-+  not return until the changes are on disk; note though that this does have
-+  has some significant performance impacts.
-+
-+
-+
-+devfs.
-+~~~~~~
-+- devfs was somewhat stripped down and a lot of duplicate functionality
-+  was removed. You now need to enable CONFIG_DEVPTS_FS=y and mount
-+  the devpts filesystem in the same manner you would if you were not
-+  using devfs.
-+
-+
-+EXT2.
-+~~~~~
-+- 2.5.49 included an extension to ext2 which will cause it to not attach
-+  buffer_head structures to file or directory pagecache at all, ever.
-+  This is for the big highmem machines.  It is enabled via the `-o nobh'
-+  mount option.
-+- The ext2 filesystem is now using finer-grained locking which yields reduced
-+  context switch rates and higher throughput on large SMP machines.
-+
-+
-+EXT3.
-+~~~~~
-+- The ext3 filesystem has gained indexed directory support, which offers
-+  considerable performance gains when used on filesystems with directories
-+  containing large numbers of files.
-+- In order to use the htree feature, you need at least version 1.32 of
-+  e2fsprogs.
-+- Existing filesystems can be converted using the command
-+
-+    tune2fs -O dir_index /dev/hdXXX
-+
-+- The latest e2fsprogs can be found at
-+  http://prdownloads.sourceforge.net/e2fsprogs
-+- The ext2 and ext3 filesystems have new file allocations policies (the "Orlov
-+  allocator") which will place subdirectories closer together on-disk.  This
-+  tends to mean that operations which touch many files in a directory tree are
-+  much faster if that tree was created under a 2.6 kernel.
-+
-+Reiserfs.
-+~~~~~~~~~
-+- Reiserfs now supports inode attributes such as immutable.
-+  (Also included in 2.4.17, so not really 'new').
-+- Relocated/non-standard size journal support (also backported
-+  to 2.4.22pre3)
-+- Support for writes larger than 4KB in size, which means speedups
-+  on large file writes, esp in append mode, should also be more
-+  SMP friendly.
-+- Variable blocksize support. (Ie, you can choose any blocksize
-+  in the range of 1024 .. PAGE_CACHE_SIZE, must be power of 2).
-+
-+
-+NFS.
-+~~~~
-+- Basic support has been added for NFSv4 (server and client)
-+- Additionally, kNFSD now supports transport over TCP.
-+  This experimental feature is also backported to 2.4.20
-+- Interoperability reports with other OS's would be useful.
-+- v1.0.3 of nfs-utils supports the newer 2.6 kernels change
-+  of kdev_t type. You can grab it at http://nfs.sourceforge.net
-+- Problems to nfs at lists.sourceforge.net
-+
-+
-+NTFS.
-+~~~~~
-+- A new, rewritten NTFS driver was merged for 2.6. It has the
-+  following main benefits over the old driver:
-+  - SMP and reentrant safe
-+  - support bigger than 4 kB cluster sizes
-+  - full support for sparse files on W2K/XP/W2K3
-+  - mmap() support
-+  - More stable, and much faster than the previous NTFS driver.
-+  - Still read-only, but with safe file overwrite support without changes
-+  to the file size
-+  - More information is available at http://linux-ntfs.sf.net
-+
-+
-+sysfs.
-+~~~~~~
-+In simple terms, the sysfs filesystem is a saner way for
-+drivers to export their innards than /proc.
-+This filesystem is always compiled in, and can be mounted
-+just like another virtual filesystem. No userspace tools
-+beyond cat(1) and echo(1) are needed. tree(1) is also good for
-+viewing its overall structure.
-+
-+    mount -t sysfs none /sys
-+
-+See Documentation/filesystems/sysfs.txt for more info.
-+
-+
-+JFS.
-+~~~~
-+IBM's JFS was merged for 2.6. (And backported to 2.4.20, but
-+it was still a new feature here first. You can read more about JFS at
-+http://www-124.ibm.com/developerworks/oss/jfs/index.html
-+
-+
-+XFS.
-+~~~~
-+The SGI XFS filesystem has been merged, and has a number of userspace
-+features. Users are encouraged to read http://oss.sgi.com/projects/xfs
-+for more information.
-+The various utilities for creating and manipulating XFS volumes can
-+be found on SGI's ftp server:
-+ftp://oss.sgi.com/projects/xfs/download/download/cmd_tars/xfsprogs-2.5.4.src.tar.gz
-+
-+
-+CIFS.
-+~~~~~
-+Support utilities and documentation for the common internet file system (CIFS)
-+can be found at http://us1.samba.org/samba/Linux_CIFS_client.html
-+
-+
-+FAT.
-+~~~~
-+CVF (Compressed VFAT) support has been removed. This means you
-+will no longer be able to access DriveSpace partitions.
-+
-+
-+HugeTLBfs.
-+~~~~~~~~~~
-+Files in this filesystem are backed by large pages if the CPU
-+supports them. See Documentation/vm/hugetlbpage.txt for more details.
-+
-+
-+Internal filesystems.
-+~~~~~~~~~~~~~~~~~~~~~
-+/proc/filesystems will contain several filesystems that are not
-+mountable in userspace, but are used internally by the kernel
-+to keep track of things. Amongst these filesystems are futexfs 
-+and eventpollfs.
-+
-+
-+Kernel Asynchronous I/O (AIO) Support
-+~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
-+Support for kernel AIO has been included in 2.6. 
-+
-+AIO enables even a single application thread to overlap I/O 
-+operations with other processing, by providing an interface
-+for submitting one or more i/o requests in one system call
-+(io_submit) without waiting for completion, and a separate 
-+interface (io_getevents) to reap completed i/o operations
-+associated with a given completion group.
-+
-+The following is a quick summary of what works today as 
-+expected:
-+- AIO read and write on raw (and O_DIRECT on blockdev)
-+- AIO read and write on files opened with O_DIRECT on
-+  ext2, ext3, jfs, xfs
-+
-+And what doesn't work as expected or is not currently 
-+supported:
-+- AIO read and write on files opened without O_DIRECT
-+  (i.e. normal buffered filesystem AIO). On ext2, ext3,
-+  jfs, xfs and nfs, these do not return an explicit
-+  error, but quietly default to synchronous or rather 
-+  non-AIO behaviour (i.e io_submit waits for i/o to complete 
-+  in these cases). For most other filesystems, -EINVAL is 
-+  reported.
-+- AIO fsync (not supported for any filesystem)
-+- AIO read and write on sockets (doesn't return an
-+  explicit error, but quietly defaults to synchronous
-+  or rather non-AIO behaviour)
-+
-+You need to install libaio-0.3.92 (available at 
-+http://www.kernel.org/pub/linux/kernel/people/bcrl/aio/) 
-+if you are writing AIO applications which use the native 
-+AIO interfaces.
-+
-+More info is available at http://lse.sf.net/io/aio.html
-+
-+
-+Profiling.
-+~~~~~~~~~~
-+- A system wide performance profiler (Oprofile) has been included in 2.6.
-+  With this option compiled in, you'll get an oprofilefs filesystem
-+  which you can mount, that the userspace utilities talk to.
-+  You can find out more at http://oprofile.sf.net/
-+- You need a fixed readprofile utility for 2.6.
-+  Present in util-linux as of 2.11z
-+
-+
-+
-+Improved BIOS table support.
-+~~~~~~~~~~~~~~~~~~~~~~~~~~~~
-+- Linux now supports various new BIOS extensions.
-+
-+
-+Simple boot flag support.
-+~~~~~~~~~~~~~~~~~~~~~~~~~
-+The SBF specification is an x86 BIOS extension that allows improved
-+system boot speeds. It does this by marking a CMOS field to say
-+"I booted okay, skip extensive POST next reboot".
-+Userspace tool is at http://www.codemonkey.org.uk/projects/sbf/sbf.c
-+More info on SBF is at http://www.microsoft.com/hwdev/resources/specs/simp_bios.asp
-+
-+
-+EDD Support.
-+~~~~~~~~~~~~
-+- Support for BIOS Enhanced Disk Drive Services (EDD) was added,
-+  which exports information on what the BIOS thinks is the boot
-+  drive and other useful info to /sys/firmware/edd
-+- Matt Domsch is interested in hearing success/fails on this code
-+  with some simple tests decribed at http://domsch.com/linux/edd30/results.html
-+
-+
-+Improved system monitoring.
-+~~~~~~~~~~~~~~~~~~~~~~~~~~~
-+- lm_sensors.
-+  - Shipped in vendors kernels for years, lm_sensors is now part of mainline.
-+    It does however have a different interface. (/sysfs instead of /proc
-+  - http://www.xs4all.nl/~thospel/ASIS/bin/psensors is a handy script
-+    for parsing the new sysfs fields.
-+- IPMI. (Intelligent Platform Management Interface)
-+  - IPMI is a standard for monitoring the hardware in a system.
-+  - Project home page: http://openipmi.sourceforge.net
-+  - Specification: http://www.intel.com/design/servers/ipmi/spec.htm
-+
-+
-+x86 CPU detection.
-+~~~~~~~~~~~~~~~~~~
-+- The CPU detection code got a pretty hefty shake up. To be certain your
-+  CPU has all relevant workarounds applied, be sure to check that it was
-+  detected correctly. cat /proc/cpuinfo will tell what the kernel thinks it is.
-+- Likewise, the x86 MTRR driver got a considerable makeover.
-+  Check that XFree86 sets up MTRRs in the same way it did in 2.4
-+  (Failures will get logged in /var/log/XFree86.log)
-+- Early PII Xeon processors and possibly other early PII processors
-+  require microcode updates either from the BIOS or the microcode driver
-+  to work around CPU bugs the O(1) scheduler exposes.
-+  You can find the relevant microcode tools at
-+  http://www.urbanmyth.org/microcode/
-+- Any regressions in both should go to mochel at osdl.org Cc: davej at codemonkey.org.uk
-+
-+
-+Extra tainting.
-+~~~~~~~~~~~~~~~
-+Running certain AMD processors in SMP boxes is out of spec, and will taint
-+the kernel with the 'S' flag.  Running 2 Athlon XPs for example may seem to
-+work fine, but may also introduce difficult to pin down bugs.
-+In time it's likely this tainting will be extended to cover other out of
-+spec cases.
-+
-+Additionally, the new modules interface will taint the kernel if you try
-+to 'force' a module to load with insmod -f.
-+
-+
-+Power management.
-+~~~~~~~~~~~~~~~~~
-+- 2.6 contains a more up to date snapshot of the ACPI driver. Should
-+  you experience any problems booting, try booting with the argument
-+  "acpi=off" to rule out any ACPI interaction. ACPI has a much more involved
-+  role in bringing the system up in 2.6 than it did in 2.4
-+- The old "acpismp=force" boot option is now obsolete, and will be ignored
-+  due to the old "mini ACPI" parser being removed.
-+- software suspend is still in development, and in need of more work.
-+  Use with SMP and/or PREEMPT not advised.
-+- The ACPI code will do basic sanity checks on the DMI structure in the BIOS
-+  to determine the date it was written. BIOSes older than year 2000 are
-+  assumed to be broken. In some circumstances, this assumption is wrong.
-+  If you see a message saying ACPI is disabled for this reason, try booting
-+  with acpi=force. If things work fine, send the output of dmidecode
-+  (http://www.nongnu.org/dmidecode/) to acpi-devel at lists.sf.net
-+  with an explanation of why your BIOS shouldn't be blacklisted.
-+
-+CPU frequency scaling.
-+~~~~~~~~~~~~~~~~~~~~~~
-+Certain processors have the facility to scale their voltage/clockspeed.
-+2.6 introduces an interface to this feature, see Documentation/cpufreq
-+for more information. This functionality also covers features like
-+Intel's speedstep, and the Powernow! feature present in mobile AMD Athlons.
-+In addition to x86 variants, this framework also supports various ARM CPUs.
-+You can find a userspace daemon that monitors battery life and
-+adjusts accordingly at: http://sourceforge.net/projects/cpufreqd
-+
-+
-+Background polling of MCE.
-+~~~~~~~~~~~~~~~~~~~~~~~~~~
-+The machine check handler has been extended so that it regularly polls
-+for any problems on AMD Athlon, and Intel Pentium 4 systems.
-+This may result in machine check exceptions occuring more frequently
-+than they did in 2.4 on out of spec systems (Overclocking/inadequate
-+cooling/underated PSU etc..).
-+
-+
-+LVM2 - DeviceMapper.
-+~~~~~~~~~~~~~~~~~~~~
-+The LVM1 code was removed wholesale, and replaced with a much better
-+designed 'device mapper'.
-+- This is backwards compatible with the LVM1 disk format.
-+- Device mapper does require new tools to manage volumes however.
-+  You can get these from ftp://ftp.sistina.com/pub/LVM2/tools/
-+
-+
-+Debugging options.
-+~~~~~~~~~~~~~~~~~~
-+During the stabilising period, it's likely that the debugging options
-+in the kernel hacking menu will trigger quite a few problems.
-+Please report any of these problems to linux-kernel at vger.kernel.org
-+rather than just disabling the relevant CONFIG_ options.
-+
-+Merging of kksymoops means that the kernel will now spit out
-+automatically decoded oopses (no more feeding them to ksymoops).
-+For this reason, you should always enable the option in the
-+kernel hacking menu labelled "Load all symbols for debugging/kksymoops".
-+
-+Testing with CONFIG_PREEMPT will also increase the amount of debug
-+code that gets enabled in the kernel. Kernel preemption gives us
-+the ability to do a whole slew of debugging checks like sleeping
-+with locks held, scheduling while atomic, exiting with locks held, etc.
-+
-+
-+Compiler issues.
-+~~~~~~~~~~~~~~~~
-+- The recommended compiler (for x86) is still 2.95.3.
-+- When compiled with a modern gcc (Ie gcc 3.x), 2.6 will use additional
-+  optimisations that 2.4 didn't. This may shake out compiler bugs that
-+  2.4 didn't expose.
-+- Do not use gcc 3.0.x on x86 due to a stack pointer handling bug.
-+- gcc 2.96 is not supported with CONFIG_FRAME_POINTER=y due to a stack
-+  pointer handling bug.
-+
-+
-+Security concerns.
-+~~~~~~~~~~~~~~~~~~
-+Several security issues solved in 2.4 may not yet be forward ported
-+to 2.6. For this reason 2.6.x kernels should not be tested on
-+untrusted systems.  Testing known 2.4 exploits and reporting results
-+is useful.
-+
-+SELinux.
-+~~~~~~~~
-+NSA Security-Enhanced Linux (SELinux) was merged in 2.6.
-+SELinux defaults to not being config'd in.  If you
-+config it in it defaults to enabled.  If you also config the bootparam
-+you can use that param to disable it, otherwise selinux=1 is redundant
-+as that's the default.
-+
-+You can obtain SELinux tools and an example policy configuration from
-+http://www.nsa.gov/selinux
-+
-+
-+
-+Networking.
-+~~~~~~~~~~~
-+- ebtables
-+  The bridging firewall code was merged. To manage these you'll
-+  need the ebtables tool available from
-+  http://users.pandora.be/bart.de.schuymer/ebtables/
-+  More on bridge-nf can be found at http://bridge.sourceforge.net
-+- Bridged packets can now be 'seen' by iptables.
-+- IPSec
-+  Linux finally has IPSec support in mainline.  Use the KAME tools port on
-+  http://sourceforge.net/projects/ipsec-tools
-+  For more info see http://www.lib.uaa.alaska.edu/linux-kernel/archive/2002-Week-44/1127.html
-+  Also Bert Hubert has a howto at http://lartc.org/howto/lartc.ipsec.html
-+  Additionally, ipsec-utils is at http://sourceforge.net/projects/ipsec-tools
-+  Herbert Xu also has patches against FreeSWAN 2.00 to allow its userspace
-+  to use the 2.6 IPSec functionality. They can be downloaded from
-+  http://gondor.apana.org.au/~herbert/freeswan/
-+  An additional HOWTO is at http://www.ipsec-howto.org
-+- Some applications may trigger the kernel to spit out warnings about
-+  'process xxx using obsolete setsockopt SO_BSDCOMPAT' .
-+  - Bind 9.2.2 checks for #ifdef SO_BSDCOMPAT in <asm/socket.h> correctly,
-+    so a recompile is all that is needed.
-+  - bind9-host from debian testing triggers, though the 'host' package doesn't.
-+  - process `snmpd' is using obsolete setsockopt SO_BSDCOMPAT
-+  - process `snmptrapd' is using obsolete setsockopt SO_BSDCOMPAT
-+  - ntop uses obsolete (PF_INET,SOCK_PACKET)
-+- Users of boxes with >1 NIC may find that for eg, eth0 and eth1 refer to
-+  the opposites of what they did in 2.4.   This is a bug that will be fixed
-+  before 2.6.0.  One option (or management workaround) for this is to use
-+  'nameif' to name Ethernet interfaces.  There is a HOWTO for doing this at
-+  <http://xenotime.net/linux/doc/network-interface-names.txt>
-+- Support for various new RFCs.
-+  - RFC3173 (IP Payload Compression).
-+  - RFC3041 (IPv6 Privacy Extensions).
-+  - RFC2473 (IPv6 in IPv6 tunnels).
-+  - RFC2960 (SCTP - see below).
-+- Linux reaches congestion collapse when subjected to heavy network load.
-+  NAPI fixes this amongst other things and therefore improving network
-+  performance.
-+  More info at http://www.cyberus.ca/~hadi/usenix-paper.tgz and
-+  ftp://robur.slu.se/pub/Linux/net-development/NAPI/
-+- IPVS (IP Virtual Server)
-+  http://www.linuxvirtualserver.org/
-+- RFC 2960 - SCTP (Stream Control Transmission Protocol)
-+  SCTP is an IP based, message oriented reliable transport protocol with
-+  congestion control, support for transparent multi-homing and multiple
-+  ordered streams of messages. RFC2960 defines the core protocol.
-+  More information about the protocol can be found at
-+    http://www.ietf.org/rfc/rfc2960.txt
-+  and about the Linux kernel implementation at
-+    http://lksctp.sourceforge.net
-+- ANSI/IEEE 802.2 LLC type 2 Support
-+  Full implementation of LLC 1 and 2 stack, used by Appletalk, IPX and Token
-+  Ring, also needed for the out of the tree, not yet functional NetBEUI
-+  stack and for the for Linux SNA.
-+                                                                                
-+  This is based on the stack released under the GPL by Procom Inc. for the
-+  2.0.30 Linux kernel.
-+
-+
-+Crypto
-+~~~~~~
-+- A generic crypto API has been merged, offering support for various
-+  algorithms (HMAC,MD4,MD5,SHA-1,SHA256,SHA384,SHA512,DES,Triple DES EDE,
-+  Blowfish, Twofish, Serpent, AES, CAST5, CAST6)
-+
-+- This functionality is used by IPSec and the crypto-loop.  It's possible
-+  that it will later also be available for use in userspace through a crypto
-+  device, possibly compatible with the OpenBSD crypto userspace.
-+
-+- The in-kernel loopback device can now do crypto using the CryptoAPI.
-+  May need new userspace tools.
-+
-+- A 2.4->2.6 cryptoloop migration guide is at http://clemens.endorphin.org/Cryptoloop_Migration_Guide.html
-+
-+Ports.
-+~~~~~~
-+- 2.6 features support for several new architectures.
-+  - x86-64 (AMD Hammer)
-+  - ppc64
-+  - UML (User mode Linux)
-+    See http://user-mode-linux.sf.net for more information.
-+  - uCLinux: m68k(w/o MMU), h8300 and v850.  sh also added a uCLinux option.
-+- The 64 bit s390x port was collapsed into a single port, appearing
-+  as a config option in the base s390 arch.
-+- In the opposite direction, arm26 was split out from arm.
-+- x86 architecture also got 'subarch' support to support 'strange' x86
-+  boxes (usually big boy toys). Currently supported subarchs include
-+  - ES7000
-+  - PC9800 (incomplete merge)
-+  - VISWS (Was in 2.4, but now maintained again)
-+  - Voyager. (http://www.hansenpartnership.com/voyager/)
-+
-+
-+- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
-+Revision history:
-+0.48 - gadgetfs
-+       cryptoloop howto URL.
-+       Mailing list pointers.
-+0.47 - Add futex paper URL.
-+       Correct libc-alpha mailing list.
-+       Jeff Garzik shouldn't get IRQ routing problems
-+       Clarify syslinux necessity for boot disks.
-+       Add depmod to common gotchas
-+       Add EFS regression
-+       Add mkinitrd note to modules section.
-+       Various grammar cleanups
-+       Mention tree(1) in sysfs section
-+       SELinux corrections.
-+       Duh, numerical sysctls are deprecated not syscalls.
-+       Document seperate build dir feature.
-+       /proc/stat changes broke more than just DOTS.
-+       Add Japanese keyboard issue to input section.
-+0.46 - Update akpm's email address.
-+       Mention LLC in the networking section.
-+       Added link to 2.6 migration guide.
-+0.45 - DEVFS is obsolete.
-+       Add pt_BR translation.
-+0.44 - lm_sensors.
-+       x86 subarch support.
-+       Add link to Joseph Pranevich's 2.6 doc.
-+       Mention chattr +S
-+       Update dmidecode URL
-+       Fix sbf.c URL
-+       Fix typos (s/proprietory/proprietary/)
-+       add URL to patched cdda2wav.
-+       Mention which filesystems does 2.6 actually supports.
-+       Add a small note about SELinux
-+       Add a few more RFCs which we now support in the Networking section
-+       Change IPVS to IPVS (IP Virtual Server)
-+       Mention additional encryption algorithms that crypto api supports
-+       Add a few things to TODO section
-+       Add URL to AIO.
-+       Polish translation URL added.
-+       Fix up a stray davej at suse.de that I missed.
-+       Update spanish translation URL.
-+0.43 - oprofile URL changed.
-+       Update Linus' email       
-+       Drop report of buggy Red Hat 3.2.2-5 gcc.
-+       Remove reference to Jens' hacked cdrecord, standard version is now ok.
-+       PC Speaker note added.
-+       Mention elevator=deadline for database folks.
-+       Merge two deprecated sections.
-+       Update URL to xfsprogs.
-+       Mention Conectiva module-init-tools
-+       Mention acpi=force, and DMI blacklist.
-+       DRI CFT on X4.1
-+       Pentium Pro SYSENTER is broken.
-+       Update Alans list of IDE bugs
-+       Add geometry translator workarounds.
-+       Mention swapfile limitations.
-+       Update Reiserfs new features.
-+       Move some features marked as 'deprecated' to 'removed'.
-+       Add 'needs forward porting' section.
-+       Pointer to synaptics touchpad driver webpage.
-+       Update ipsec utils URL.
-+       Mention usb-storage changes.
-+       Modules are now .ko instead of .o
-+       Mention how to change elevator on command line.
-+       Document statfs64()
-+       ext3 data=journal mode should now be fixed.
-+       Fix iosched pathname.
-+       Document USB changes.
-+       Add SCTP to Networking.
-+       s/2.5/2.6/ in most of the doc.
-+       Mention AIO.
-+       Add additional IPSEC howto URL.
-+       Deprecate numeric sysctls
-+0.42 - CONFIG_LOG_BUF_SHIFT is now sanity checked by Kconfig
-+       Hyperthreading scheduler improvements.
-+       ALSA OSS emulation.
-+       32bit uids in new quota.
-+       Not all filesystems support nanosecond stat.
-+       Note that NTFS still isn't R/W
-+       Mention CryptoLoop.
-+0.41 - V=0 is now default. Document V=1
-+       s/Redhat/Red Hat/ everywhere.
-+       Added vmware sysenter note.
-+       MTRR for vesafb
-+       Various grammar fixes.
-+       Selectable elevators.
-+       PCI domains
-+0.40 - Callout tty devices are removed.
-+       Added note about modules in Red Hat 9
-+0.39 - irqbalance note added.
-+       Added ntop, snmp tools obsolete messages.
-+       Added link to David Mosberger's O(1) page.
-+       Mention Herbert Xu's FreeSWAN patches.
-+       Add CONFIG_VGA_CONSOLE to the list of gotchas.
-+       Add note about 2.4 .config's to gotchas.
-+       Reword devpts note.
-+0.38 - Fixed URL to nameif
-+0.37 - devfs users now need to mount devpts.
-+       mention h8300 port.    
-+       mentioned NTFS rewrite.
-+0.36 - Include Doug Gilberts 'positive SCSI spin'.
-+       Mention NAPI.
-+       Reword the CPU bug workaround that the O(1) scheduler exposes.
-+       Added 'Known Gotchas' section
-+0.35 - Note about KDE panel applets.
-+       mount --move, dmask, fmask
-+       Removed note about oprofile utilities being underdeveloped.
-+       Mention ext2 locking, and ext2/ext3 orlov allocator.
-+0.34 - Remove people.redhat.com NPTL URLs on Ulrich Dreppers request.
-+       Added note about s390x going away.
-+       Various kbuild updates.
-+       Note about swap files.
-+       Added note about -p1 vs -p0
-+       Lots of typo fixes from Randy Dunlap.
-+       RPM from RH9 seems to have problems.
-+0.33 - Networking RFCs section added.
-+0.32 - Added Soundmodem userspace replacement URL.
-+0.31 - ext3 data=journal breakage noted.
-+0.30 - Athlon powernow is now supported.
-+0.29 - Mention NIC renumbering and ACPI/APIC NIC bugs. 
-+0.28 - SO_BSDCOMPAT obsolete messages, nfsutils.
-+0.27 - radeon -> radeonfb
-+0.26 - Added info about readprofile.
-+0.25 - Added cdrecord example. Added URL to Spanish translation.
-+0.1->0.24 - Unrecorded history
-+
-+- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
-+Other Links.
-+http://www.kernelnewbies.org/status/
-+http://bugzilla.kernel.org/
-+http://www.kniggit.net/wwol26.html
-+http://thomer.com/linux/migrate-to-2.6.html
-+
-+
-+TODO:  (Please mail me a few lines about these if you are
-+         the owner of these).
-+
-+ PCI IDs (new_id, agpgart try_unsupported)
-+ libsysfs
-+ kdev_t changes?
-+ ISDN rewrite?
-+ AFS
-+ DVB
-+ Hangcheck timer
-+ /proc/sysrq-trigger
-+ libata
-+ initramfs ?
-+

Copied: trunk/kernel/source/kernel-source-2.6.11-2.6.11/debian/patches/doc-post_halloween.patch (from rev 2762, trunk/kernel/source/kernel-source-2.6.11-2.6.11/debian/patches/doc-post_halloween.dpatch)

Deleted: trunk/kernel/source/kernel-source-2.6.11-2.6.11/debian/patches/docbook-allow-preprocessor-directives-between-kernel-doc-and-function.dpatch
===================================================================
--- trunk/kernel/source/kernel-source-2.6.11-2.6.11/debian/patches/docbook-allow-preprocessor-directives-between-kernel-doc-and-function.dpatch	2005-03-21 09:35:04 UTC (rev 2762)
+++ trunk/kernel/source/kernel-source-2.6.11-2.6.11/debian/patches/docbook-allow-preprocessor-directives-between-kernel-doc-and-function.dpatch	2005-03-21 09:38:36 UTC (rev 2763)
@@ -1,32 +0,0 @@
-
-From: Martin Waitz <tali at admingilde.org>
-
-Allow preprocessor directives between kernel-doc and function
-
-Signed-off-by: Martin Waitz <tali at admingilde.org>
-Signed-off-by: Andrew Morton <akpm at osdl.org>
----
-
- 25-akpm/scripts/kernel-doc |    4 ++--
- 1 files changed, 2 insertions(+), 2 deletions(-)
-
-diff -puN scripts/kernel-doc~docbook-allow-preprocessor-directives-between-kernel-doc-and-function scripts/kernel-doc
---- 25/scripts/kernel-doc~docbook-allow-preprocessor-directives-between-kernel-doc-and-function	Thu Mar  3 16:55:20 2005
-+++ 25-akpm/scripts/kernel-doc	Thu Mar  3 16:55:20 2005
-@@ -1578,13 +1578,13 @@ sub process_state3_function($$) { 
-     my $x = shift;
-     my $file = shift;
- 
--    if ($x =~ m#\s*/\*\s+MACDOC\s*#io) {
-+    if ($x =~ m#\s*/\*\s+MACDOC\s*#io || ($x =~ /^#/ && $x !~ /^#define/)) {
- 	# do nothing
-     }
-     elsif ($x =~ /([^\{]*)/) {
-         $prototype .= $1;
-     }
--    if (($x =~ /\{/) || ($x =~ /\#/) || ($x =~ /;/)) {
-+    if (($x =~ /\{/) || ($x =~ /\#define/) || ($x =~ /;/)) {
-         $prototype =~ s@/\*.*?\*/@@gos;	# strip comments.
- 	$prototype =~ s@[\r\n]+@ @gos; # strip newlines/cr's.
- 	$prototype =~ s@^\s+@@gos; # strip leading spaces
-_

Copied: trunk/kernel/source/kernel-source-2.6.11-2.6.11/debian/patches/docbook-allow-preprocessor-directives-between-kernel-doc-and-function.patch (from rev 2762, trunk/kernel/source/kernel-source-2.6.11-2.6.11/debian/patches/docbook-allow-preprocessor-directives-between-kernel-doc-and-function.dpatch)

Deleted: trunk/kernel/source/kernel-source-2.6.11-2.6.11/debian/patches/docbook-fix-function-parameter-descriptin-in-fbmem.dpatch
===================================================================
--- trunk/kernel/source/kernel-source-2.6.11-2.6.11/debian/patches/docbook-fix-function-parameter-descriptin-in-fbmem.dpatch	2005-03-21 09:35:04 UTC (rev 2762)
+++ trunk/kernel/source/kernel-source-2.6.11-2.6.11/debian/patches/docbook-fix-function-parameter-descriptin-in-fbmem.dpatch	2005-03-21 09:38:36 UTC (rev 2763)
@@ -1,30 +0,0 @@
-
-From: Martin Waitz <tali at admingilde.org>
-
-Fix function parameter descriptin in fbmem
-
-Signed-off-by: Martin Waitz <tali at admingilde.org>
-Signed-off-by: Andrew Morton <akpm at osdl.org>
----
-
- 25-akpm/drivers/video/fbmem.c |    7 ++++---
- 1 files changed, 4 insertions(+), 3 deletions(-)
-
-diff -puN drivers/video/fbmem.c~docbook-fix-function-parameter-descriptin-in-fbmem drivers/video/fbmem.c
---- 25/drivers/video/fbmem.c~docbook-fix-function-parameter-descriptin-in-fbmem	Thu Mar  3 16:55:25 2005
-+++ 25-akpm/drivers/video/fbmem.c	Thu Mar  3 16:55:25 2005
-@@ -1211,9 +1211,10 @@ static int ofonly;
- 
- /**
-  * fb_get_options - get kernel boot parameters
-- * @name - framebuffer name as it would appear in
-- *         the boot parameter line
-- *         (video=<name>:<options>)
-+ * @name:   framebuffer name as it would appear in
-+ *          the boot parameter line
-+ *          (video=<name>:<options>)
-+ * @option: the option will be stored here
-  *
-  * NOTE: Needed to maintain backwards compatibility
-  */
-_

Copied: trunk/kernel/source/kernel-source-2.6.11-2.6.11/debian/patches/docbook-fix-function-parameter-descriptin-in-fbmem.patch (from rev 2762, trunk/kernel/source/kernel-source-2.6.11-2.6.11/debian/patches/docbook-fix-function-parameter-descriptin-in-fbmem.dpatch)

Deleted: trunk/kernel/source/kernel-source-2.6.11-2.6.11/debian/patches/docbook-move-kernel-doc-comment-next-to-function.dpatch
===================================================================
--- trunk/kernel/source/kernel-source-2.6.11-2.6.11/debian/patches/docbook-move-kernel-doc-comment-next-to-function.dpatch	2005-03-21 09:35:04 UTC (rev 2762)
+++ trunk/kernel/source/kernel-source-2.6.11-2.6.11/debian/patches/docbook-move-kernel-doc-comment-next-to-function.dpatch	2005-03-21 09:38:36 UTC (rev 2763)
@@ -1,36 +0,0 @@
-
-From: Martin Waitz <tali at admingilde.org>
-
-Move kernel-doc comment next to function
-
-Signed-off-by: Martin Waitz <tali at admingilde.org>
-Signed-off-by: Andrew Morton <akpm at osdl.org>
----
-
- 25-akpm/drivers/video/fbmem.c |    6 +++---
- 1 files changed, 3 insertions(+), 3 deletions(-)
-
-diff -puN drivers/video/fbmem.c~docbook-move-kernel-doc-comment-next-to-function drivers/video/fbmem.c
---- 25/drivers/video/fbmem.c~docbook-move-kernel-doc-comment-next-to-function	Thu Mar  3 16:55:29 2005
-+++ 25-akpm/drivers/video/fbmem.c	Thu Mar  3 16:55:29 2005
-@@ -1248,6 +1248,9 @@ int fb_get_options(char *name, char **op
- 	return retval;
- }
- 
-+
-+extern const char *global_mode_option;
-+
- /**
-  *	video_setup - process command line options
-  *	@options: string of options
-@@ -1261,9 +1264,6 @@ int fb_get_options(char *name, char **op
-  *	Returns zero.
-  *
-  */
--
--extern const char *global_mode_option;
--
- int __init video_setup(char *options)
- {
- 	int i, global = 0;
-_

Copied: trunk/kernel/source/kernel-source-2.6.11-2.6.11/debian/patches/docbook-move-kernel-doc-comment-next-to-function.patch (from rev 2762, trunk/kernel/source/kernel-source-2.6.11-2.6.11/debian/patches/docbook-move-kernel-doc-comment-next-to-function.dpatch)

Deleted: trunk/kernel/source/kernel-source-2.6.11-2.6.11/debian/patches/drivers-add-scsi_changer.dpatch
===================================================================
--- trunk/kernel/source/kernel-source-2.6.11-2.6.11/debian/patches/drivers-add-scsi_changer.dpatch	2005-03-21 09:35:04 UTC (rev 2762)
+++ trunk/kernel/source/kernel-source-2.6.11-2.6.11/debian/patches/drivers-add-scsi_changer.dpatch	2005-03-21 09:38:36 UTC (rev 2763)
@@ -1,1484 +0,0 @@
-
-From: Gerd Knorr <kraxel at bytesex.org>
-
-This patch adds a device driver for scsi media changer devices (tape
-libraries for example).
-
-It exists for quite some time (since 2.2.x or so ...), is used by several
-people and also is in some vendor kernels (debian, suse, maybe others as
-well).  People bug be from time to time to submit it ;)
-
-Recently I went over it and did some 2.6 cleanups, module parameters and
-the like.  And now, finally, here it is.
-
-Signed-off-by: Gerd Knorr <kraxel at bytesex.org>
-Signed-off-by: Andrew Morton <akpm at osdl.org>
----
-
- 25-akpm/Documentation/scsi-changer.txt |  180 +++++
- 25-akpm/drivers/scsi/Kconfig           |   18 
- 25-akpm/drivers/scsi/Makefile          |    1 
- 25-akpm/drivers/scsi/ch.c              | 1020 +++++++++++++++++++++++++++++++++
- 25-akpm/include/linux/chio.h           |  168 +++++
- 25-akpm/include/linux/major.h          |    1 
- 25-akpm/include/scsi/scsi.h            |    3 
- 7 files changed, 1391 insertions(+)
-
-diff -puN /dev/null Documentation/scsi-changer.txt
---- /dev/null	Thu Apr 11 07:25:15 2002
-+++ 25-akpm/Documentation/scsi-changer.txt	Thu Feb 17 16:55:13 2005
-@@ -0,0 +1,180 @@
-+
-+README for the SCSI media changer driver
-+========================================
-+
-+This is a driver for SCSI Medium Changer devices, which are listed
-+with "Type: Medium Changer" in /proc/scsi/scsi.
-+
-+This is for *real* Jukeboxes.  It is *not* supported to work with
-+common small CD-ROM changers, neither one-lun-per-slot SCSI changers
-+nor IDE drives.
-+
-+Userland tools available from here:
-+	http://linux.bytesex.org/misc/changer.html
-+
-+
-+General Information
-+-------------------
-+
-+First some words about how changers work: A changer has 2 (possibly
-+more) SCSI ID's. One for the changer device which controls the robot,
-+and one for the device which actually reads and writes the data. The
-+later may be anything, a MOD, a CD-ROM, a tape or whatever. For the
-+changer device this is a "don't care", he *only* shuffles around the
-+media, nothing else.
-+
-+
-+The SCSI changer model is complex, compared to - for example - IDE-CD
-+changers. But it allows to handle nearly all possible cases. It knows
-+4 different types of changer elements:
-+
-+  media transport - this one shuffles around the media, i.e. the
-+                    transport arm.  Also known as "picker".
-+  storage         - a slot which can hold a media.
-+  import/export   - the same as above, but is accessable from outside,
-+                    i.e. there the operator (you !) can use this to
-+                    fill in and remove media from the changer.
-+		    Sometimes named "mailslot".
-+  data transfer   - this is the device which reads/writes, i.e. the
-+		    CD-ROM / Tape / whatever drive.
-+
-+None of these is limited to one: A huge Jukebox could have slots for
-+123 CD-ROM's, 5 CD-ROM readers (and therefore 6 SCSI ID's: the changer
-+and each CD-ROM) and 2 transport arms. No problem to handle.
-+
-+
-+How it is implemented
-+---------------------
-+
-+I implemented the driver as character device driver with a NetBSD-like
-+ioctl interface. Just grabbed NetBSD's header file and one of the
-+other linux SCSI device drivers as starting point. The interface
-+should be source code compatible with NetBSD. So if there is any
-+software (anybody knows ???) which supports a BSDish changer driver,
-+it should work with this driver too.
-+
-+Over time a few more ioctls where added, volume tag support for example
-+wasn't covered by the NetBSD ioctl API.
-+
-+
-+Current State
-+-------------
-+
-+Support for more than one transport arm is not implemented yet (and
-+nobody asked for it so far...).
-+
-+I test and use the driver myself with a 35 slot cdrom jukebox from
-+Grundig.  I got some reports telling it works ok with tape autoloaders
-+(Exabyte, HP and DEC).  Some People use this driver with amanda.  It
-+works fine with small (11 slots) and a huge (4 MOs, 88 slots)
-+magneto-optical Jukebox.  Probably with lots of other changers too, most
-+(but not all :-) people mail me only if it does *not* work...
-+
-+I don't have any device lists, neither black-list nor white-list.  Thus
-+it is quite useless to ask me whenever a specific device is supported or
-+not.  In theory every changer device which supports the SCSI-2 media
-+changer command set should work out-of-the-box with this driver.  If it
-+doesn't, it is a bug.  Either within the driver or within the firmware
-+of the changer device.
-+
-+
-+Using it
-+--------
-+
-+This is a character device with major number is 86, so use
-+"mknod /dev/sch0 c 86 0" to create the special file for the driver.
-+
-+If the module finds the changer, it prints some messages about the
-+device [ try "dmesg" if you don't see anything ] and should show up in
-+/proc/devices. If not....  some changers use ID ? / LUN 0 for the
-+device and ID ? / LUN 1 for the robot mechanism. But Linux does *not*
-+look for LUN's other than 0 as default, becauce there are to many
-+broken devices. So you can try:
-+
-+  1) echo "scsi add-single-device 0 0 ID 1" > /proc/scsi/scsi
-+     (replace ID with the SCSI-ID of the device)
-+  2) boot the kernel with "max_scsi_luns=1" on the command line
-+     (append="max_scsi_luns=1" in lilo.conf should do the trick)
-+
-+
-+Trouble?
-+--------
-+
-+If you insmod the driver with "insmod debug=1", it will be verbose and
-+prints a lot of stuff to the syslog.  Compiling the kernel with
-+CONFIG_SCSI_CONSTANTS=y improves the quality of the error messages alot
-+because the kernel will translate the error codes into human-readable
-+strings then.
-+
-+You can display these messages with the dmesg command (or check the
-+logfiles).  If you email me some question becauce of a problem with the
-+driver, please include these messages.
-+
-+
-+Insmod options
-+--------------
-+
-+debug=0/1
-+	Enable debug messages (see above, default: 0).
-+
-+verbose=0/1
-+	Be verbose (default: 1).
-+
-+init=0/1
-+	Send INITIALIZE ELEMENT STATUS command to the changer
-+	at insmod time (default: 1).
-+
-+timeout_init=<seconds>
-+	timeout for the INITIALIZE ELEMENT STATUS command
-+	(default: 3600).
-+
-+timeout_move=<seconds>
-+	timeout for all other commands (default: 120).
-+
-+dt_id=<id1>,<id2>,...
-+dt_lun=<lun1>,<lun2>,...
-+	These two allow to specify the SCSI ID and LUN for the data
-+	transfer elements.  You likely don't need this as the jukebox
-+	should provide this information.  But some devices don't ...
-+
-+vendor_firsts=
-+vendor_counts=
-+vendor_labels=
-+	These insmod options can be used to tell the driver that there
-+	are some vendor-specific element types.  Grundig for example
-+	does this.  Some jukeboxes have a printer to label fresh burned
-+	CDs, which is addressed as element 0xc000 (type 5).  To tell the
-+	driver about this vendor-specific element, use this:
-+		$ insmod ch			\
-+			vendor_firsts=0xc000	\
-+			vendor_counts=1		\
-+			vendor_labels=printer
-+	All three insmod options accept up to four comma-separated
-+	values, this way you can configure the element types 5-8.
-+	You likely need the SCSI specs for the device in question to
-+	find the correct values as they are not covered by the SCSI-2
-+	standard.
-+
-+
-+Credits
-+-------
-+
-+I wrote this driver using the famous mailing-patches-around-the-world
-+method.  With (more or less) help from:
-+
-+	Daniel Moehwald <moehwald at hdg.de>
-+	Dane Jasper <dane at sonic.net>
-+	R. Scott Bailey <sbailey at dsddi.eds.com>
-+	Jonathan Corbet <corbet at atd.ucar.edu>
-+
-+Special thanks go to
-+	Martin Kuehne <martin.kuehne at bnbt.de>
-+for a old, second-hand (but full functional) cdrom jukebox which I use
-+to develop/test driver and tools now.
-+
-+Have fun,
-+
-+   Gerd
-+
-+--
-+Gerd Knorr <kraxel at bytesex.org>
-diff -puN /dev/null drivers/scsi/ch.c
---- /dev/null	Thu Apr 11 07:25:15 2002
-+++ 25-akpm/drivers/scsi/ch.c	Thu Feb 17 16:55:14 2005
-@@ -0,0 +1,1020 @@
-+/*
-+ * SCSI Media Changer device driver for Linux 2.6
-+ *
-+ *     (c) 1996-2003 Gerd Knorr <kraxel at bytesex.org>
-+ *
-+ */
-+
-+#define VERSION "0.24"
-+
-+#include <linux/config.h>
-+#include <linux/module.h>
-+#include <linux/init.h>
-+#include <linux/fs.h>
-+#include <linux/kernel.h>
-+#include <linux/sched.h>
-+#include <linux/mm.h>
-+#include <linux/major.h>
-+#include <linux/string.h>
-+#include <linux/errno.h>
-+#include <linux/interrupt.h>
-+#include <linux/blkdev.h>
-+#include <linux/completion.h>
-+#include <linux/devfs_fs_kernel.h>
-+#include <linux/ioctl32.h>
-+#include <linux/compat.h>
-+#include <linux/chio.h>			/* here are all the ioctls */
-+
-+#include <scsi/scsi.h>
-+#include <scsi/scsi_cmnd.h>
-+#include <scsi/scsi_driver.h>
-+#include <scsi/scsi_ioctl.h>
-+#include <scsi/scsi_host.h>
-+#include <scsi/scsi_device.h>
-+#include <scsi/scsi_request.h>
-+#include <scsi/scsi_dbg.h>
-+
-+#define CH_DT_MAX       16
-+#define CH_TYPES        8
-+
-+MODULE_DESCRIPTION("device driver for scsi media changer devices");
-+MODULE_AUTHOR("Gerd Knorr <kraxel at bytesex.org>");
-+MODULE_LICENSE("GPL");
-+
-+static int init = 1;
-+module_param(init, int, 0444);
-+MODULE_PARM_DESC(init, \
-+    "initialize element status on driver load (default: on)");
-+
-+static int timeout_move = 300;
-+module_param(timeout_move, int, 0644);
-+MODULE_PARM_DESC(timeout_move,"timeout for move commands "
-+		 "(default: 300 seconds)");
-+
-+static int timeout_init = 3600;
-+module_param(timeout_init, int, 0644);
-+MODULE_PARM_DESC(timeout_init,"timeout for INITIALIZE ELEMENT STATUS "
-+		 "(default: 3600 seconds)");
-+
-+static int verbose = 1;
-+module_param(verbose, int, 0644);
-+MODULE_PARM_DESC(verbose,"be verbose (default: on)");
-+
-+static int debug = 0;
-+module_param(debug, int, 0644);
-+MODULE_PARM_DESC(debug,"enable/disable debug messages, also prints more "
-+		 "detailed sense codes on scsi errors (default: off)");
-+
-+static int dt_id[CH_DT_MAX] = { [ 0 ... (CH_DT_MAX-1) ] = -1 };
-+static int dt_lun[CH_DT_MAX];
-+module_param_array(dt_id,  int, NULL, 0444);
-+module_param_array(dt_lun, int, NULL, 0444);
-+
-+/* tell the driver about vendor-specific slots */
-+static int vendor_firsts[CH_TYPES-4];
-+static int vendor_counts[CH_TYPES-4];
-+module_param_array(vendor_firsts, int, NULL, 0444);
-+module_param_array(vendor_counts, int, NULL, 0444);
-+
-+static char *vendor_labels[CH_TYPES-4] = {
-+	"v0", "v1", "v2", "v3"
-+};
-+// module_param_string_array(vendor_labels, NULL, 0444);
-+
-+#define dprintk(fmt, arg...)    if (debug) \
-+        printk(KERN_DEBUG "%s: " fmt, ch->name, ##arg)
-+#define vprintk(fmt, arg...)    if (verbose) \
-+        printk(KERN_INFO "%s: " fmt, ch->name, ##arg)
-+
-+/* ------------------------------------------------------------------- */
-+
-+#define MAX_RETRIES   1
-+
-+static int  ch_probe(struct device *);
-+static int  ch_remove(struct device *);
-+static int  ch_open(struct inode * inode, struct file * filp);
-+static int  ch_release(struct inode * inode, struct file * filp);
-+static int  ch_ioctl(struct inode * inode, struct file * filp,
-+		     unsigned int cmd, unsigned long arg);
-+static long ch_ioctl_compat(struct file * filp,
-+			    unsigned int cmd, unsigned long arg);
-+
-+typedef struct {
-+	struct list_head    list;
-+	int                 minor;
-+	char                name[8];
-+	struct scsi_device  *device;
-+	struct scsi_device  **dt;        /* ptrs to data transfer elements */
-+	u_int               firsts[CH_TYPES];
-+	u_int               counts[CH_TYPES];
-+	u_int               unit_attention;
-+	u_int		    voltags;
-+	struct semaphore    lock;
-+} scsi_changer;
-+
-+static LIST_HEAD(ch_devlist);
-+static spinlock_t ch_devlist_lock = SPIN_LOCK_UNLOCKED;
-+static int ch_devcount;
-+
-+struct scsi_driver ch_template =
-+{
-+	.owner     	= THIS_MODULE,
-+	.gendrv     	= {
-+		.name	= "ch",
-+		.probe  = ch_probe,
-+		.remove = ch_remove,
-+	},
-+};
-+
-+static struct file_operations changer_fops =
-+{
-+	.owner        = THIS_MODULE,
-+	.open         = ch_open,
-+	.release      = ch_release,
-+	.ioctl        = ch_ioctl,
-+#ifdef CONFIG_COMPAT
-+	.compat_ioctl = ch_ioctl_compat,
-+#endif
-+};
-+
-+static struct {
-+	unsigned char  sense;
-+	unsigned char  asc;
-+	unsigned char  ascq;
-+	int	       errno;
-+} err[] = {
-+/* Just filled in what looks right. Hav'nt checked any standard paper for
-+   these errno assignments, so they may be wrong... */
-+	{
-+		.sense  = ILLEGAL_REQUEST,
-+		.asc    = 0x21,
-+		.ascq   = 0x01,
-+		.errno  = EBADSLT, /* Invalid element address */
-+	},{
-+		.sense  = ILLEGAL_REQUEST,
-+		.asc    = 0x28,
-+		.ascq   = 0x01,
-+		.errno  = EBADE,   /* Import or export element accessed */
-+	},{
-+		.sense  = ILLEGAL_REQUEST,
-+		.asc    = 0x3B,
-+		.ascq   = 0x0D,
-+		.errno  = EXFULL,  /* Medium destination element full */
-+	},{
-+		.sense  = ILLEGAL_REQUEST,
-+		.asc    = 0x3B,
-+		.ascq   = 0x0E,
-+		.errno  = EBADE,   /* Medium source element empty */
-+	},{
-+		.sense  = ILLEGAL_REQUEST,
-+		.asc    = 0x20,
-+		.ascq   = 0x00,
-+		.errno  = EBADRQC, /* Invalid command operation code */
-+	},{
-+	        /* end of list */
-+	}
-+};
-+
-+/* ------------------------------------------------------------------- */
-+
-+static int ch_find_errno(unsigned char *sense_buffer)
-+{
-+	int i,errno = 0;
-+
-+	/* Check to see if additional sense information is available */
-+	if (sense_buffer[7]  > 5 &&
-+	    sense_buffer[12] != 0) {
-+		for (i = 0; err[i].errno != 0; i++) {
-+			if (err[i].sense == sense_buffer[ 2] &&
-+			    err[i].asc   == sense_buffer[12] &&
-+			    err[i].ascq  == sense_buffer[13]) {
-+				errno = -err[i].errno;
-+				break;
-+			}
-+		}
-+	}
-+	if (errno == 0)
-+		errno = -EIO;
-+	return errno;
-+}
-+
-+static void
-+ch_request_done(struct scsi_cmnd *sc)
-+{
-+	sc->request->rq_status = RQ_SCSI_DONE; /* Busy, but indicate request done */
-+        if (sc->request->waiting != NULL)
-+		complete(sc->request->waiting);
-+}
-+
-+static int
-+ch_do_scsi(scsi_changer *ch, unsigned char *cmd,
-+	   void *buffer, unsigned buflength)
-+{
-+	int errno, retries = 0, timeout;
-+	DECLARE_COMPLETION(wait);
-+	struct scsi_request *sr;
-+
-+	sr = scsi_allocate_request(ch->device, GFP_KERNEL);
-+	if (NULL == sr)
-+		return -ENOMEM;
-+
-+ retry:
-+	errno = 0;
-+	if (debug) {
-+		dprintk("command: ");
-+		__scsi_print_command(cmd);
-+	}
-+
-+	sr->sr_request->waiting = &wait;
-+	timeout = (cmd[0] == INITIALIZE_ELEMENT_STATUS)
-+		? timeout_init : timeout_move;
-+	scsi_do_req(sr, cmd, buffer, buflength, ch_request_done,
-+		    timeout * HZ, MAX_RETRIES);
-+	wait_for_completion(&wait);
-+	sr->sr_request->waiting = NULL;
-+
-+	dprintk("result: 0x%x\n",sr->sr_result);
-+	if (driver_byte(sr->sr_result) != 0) {
-+		if (debug)
-+			scsi_print_req_sense(ch->name, sr);
-+		errno = ch_find_errno(sr->sr_sense_buffer);
-+
-+		switch(sr->sr_sense_buffer[2] & 0xf) {
-+		case UNIT_ATTENTION:
-+			ch->unit_attention = 1;
-+			if (retries++ < 3)
-+				goto retry;
-+			break;
-+		}
-+	}
-+	scsi_release_request(sr);
-+	return errno;
-+}
-+
-+/* ------------------------------------------------------------------------ */
-+
-+static int
-+ch_elem_to_typecode(scsi_changer *ch, u_int elem)
-+{
-+	int i;
-+
-+	for (i = 0; i < CH_TYPES; i++) {
-+		if (elem >= ch->firsts[i]  &&
-+		    elem <  ch->firsts[i] +
-+	            ch->counts[i])
-+			return i+1;
-+	}
-+	return 0;
-+}
-+
-+static int
-+ch_read_element_status(scsi_changer *ch, u_int elem, char *data)
-+{
-+	u_char  cmd[12];
-+	u_char  *buffer;
-+	int     result;
-+
-+	buffer = kmalloc(512, GFP_KERNEL);
-+	if(!buffer)
-+		return -ENOMEM;
-+
-+ retry:
-+	memset(cmd,0,sizeof(cmd));
-+	cmd[0] = READ_ELEMENT_STATUS;
-+	cmd[1] = (ch->device->lun << 5) |
-+		(ch->voltags ? 0x10 : 0) |
-+		ch_elem_to_typecode(ch,elem);
-+	cmd[2] = (elem >> 8) & 0xff;
-+	cmd[3] = elem        & 0xff;
-+	cmd[5] = 1;
-+	cmd[9] = 255;
-+	if (0 == (result = ch_do_scsi(ch, cmd, buffer, 256))) {
-+		if (((buffer[16] << 8) | buffer[17]) != elem) {
-+			dprintk("asked for element 0x%02x, got 0x%02x\n",
-+				elem,(buffer[16] << 8) | buffer[17]);
-+			kfree(buffer);
-+			return -EIO;
-+		}
-+		memcpy(data,buffer+16,16);
-+	} else {
-+		if (ch->voltags) {
-+			ch->voltags = 0;
-+			vprintk("device has no volume tag support%s\n","");
-+			goto retry;
-+		}
-+		dprintk("READ ELEMENT STATUS for element 0x%x failed\n",elem);
-+	}
-+	kfree(buffer);
-+	return result;
-+}
-+
-+static int
-+ch_init_elem(scsi_changer *ch)
-+{
-+	int err;
-+	u_char cmd[6];
-+
-+	vprintk("INITIALIZE ELEMENT STATUS, may take some time ...%s\n","");
-+	memset(cmd,0,sizeof(cmd));
-+	cmd[0] = INITIALIZE_ELEMENT_STATUS;
-+	cmd[1] = ch->device->lun << 5;
-+	err = ch_do_scsi(ch, cmd, NULL, 0);
-+	vprintk("... finished%s\n","");
-+	return err;
-+}
-+
-+static int
-+ch_readconfig(scsi_changer *ch)
-+{
-+	u_char  cmd[10], data[16];
-+	u_char  *buffer;
-+	int     result,id,lun,i;
-+	u_int   elem;
-+
-+	buffer = kmalloc(512, GFP_KERNEL);
-+	if (!buffer)
-+		return -ENOMEM;
-+	memset(buffer,0,512);
-+
-+	memset(cmd,0,sizeof(cmd));
-+	cmd[0] = MODE_SENSE;
-+	cmd[1] = ch->device->lun << 5;
-+	cmd[2] = 0x1d;
-+	cmd[4] = 255;
-+	result = ch_do_scsi(ch, cmd, buffer, 255);
-+	if (0 != result) {
-+		cmd[1] |= (1<<3);
-+		result  = ch_do_scsi(ch, cmd, buffer, 255);
-+	}
-+	if (0 == result) {
-+		ch->firsts[CHET_MT] =
-+			(buffer[buffer[3]+ 6] << 8) | buffer[buffer[3]+ 7];
-+		ch->counts[CHET_MT] =
-+			(buffer[buffer[3]+ 8] << 8) | buffer[buffer[3]+ 9];
-+		ch->firsts[CHET_ST] =
-+			(buffer[buffer[3]+10] << 8) | buffer[buffer[3]+11];
-+		ch->counts[CHET_ST] =
-+			(buffer[buffer[3]+12] << 8) | buffer[buffer[3]+13];
-+		ch->firsts[CHET_IE] =
-+			(buffer[buffer[3]+14] << 8) | buffer[buffer[3]+15];
-+		ch->counts[CHET_IE] =
-+			(buffer[buffer[3]+16] << 8) | buffer[buffer[3]+17];
-+		ch->firsts[CHET_DT] =
-+			(buffer[buffer[3]+18] << 8) | buffer[buffer[3]+19];
-+		ch->counts[CHET_DT] =
-+			(buffer[buffer[3]+20] << 8) | buffer[buffer[3]+21];
-+		vprintk("type #1 (mt): 0x%x+%d [medium transport]\n",
-+			ch->firsts[CHET_MT],
-+			ch->counts[CHET_MT]);
-+		vprintk("type #2 (st): 0x%x+%d [storage]\n",
-+			ch->firsts[CHET_ST],
-+			ch->counts[CHET_ST]);
-+		vprintk("type #3 (ie): 0x%x+%d [import/export]\n",
-+			ch->firsts[CHET_IE],
-+			ch->counts[CHET_IE]);
-+		vprintk("type #4 (dt): 0x%x+%d [data transfer]\n",
-+			ch->firsts[CHET_DT],
-+			ch->counts[CHET_DT]);
-+	} else {
-+		vprintk("reading element address assigment page failed!%s\n",
-+			"");
-+	}
-+
-+	/* vendor specific element types */
-+	for (i = 0; i < 4; i++) {
-+		if (0 == vendor_counts[i])
-+			continue;
-+		if (NULL == vendor_labels[i])
-+			continue;
-+		ch->firsts[CHET_V1+i] = vendor_firsts[i];
-+		ch->counts[CHET_V1+i] = vendor_counts[i];
-+		vprintk("type #%d (v%d): 0x%x+%d [%s, vendor specific]\n",
-+			i+5,i+1,vendor_firsts[i],vendor_counts[i],
-+			vendor_labels[i]);
-+	}
-+
-+	/* look up the devices of the data transfer elements */
-+	ch->dt = kmalloc(ch->counts[CHET_DT]*sizeof(struct scsi_device),
-+			 GFP_KERNEL);
-+	for (elem = 0; elem < ch->counts[CHET_DT]; elem++) {
-+		id  = -1;
-+		lun = 0;
-+		if (-1 != dt_id[elem]) {
-+			id  = dt_id[elem];
-+			lun = dt_lun[elem];
-+			vprintk("dt 0x%x: [insmod option] ",
-+				elem+ch->firsts[CHET_DT]);
-+		} else if (0 != ch_read_element_status
-+			   (ch,elem+ch->firsts[CHET_DT],data)) {
-+			vprintk("dt 0x%x: READ ELEMENT STATUS failed\n",
-+				elem+ch->firsts[CHET_DT]);
-+		} else {
-+			vprintk("dt 0x%x: ",elem+ch->firsts[CHET_DT]);
-+			if (data[6] & 0x80) {
-+				if (verbose)
-+					printk("not this SCSI bus\n");
-+				ch->dt[elem] = NULL;
-+			} else if (0 == (data[6] & 0x30)) {
-+				if (verbose)
-+					printk("ID/LUN unknown\n");
-+				ch->dt[elem] = NULL;
-+			} else {
-+				id  = ch->device->id;
-+				lun = 0;
-+				if (data[6] & 0x20) id  = data[7];
-+				if (data[6] & 0x10) lun = data[6] & 7;
-+			}
-+		}
-+		if (-1 != id) {
-+			if (verbose)
-+				printk("ID %i, LUN %i, ",id,lun);
-+			ch->dt[elem] =
-+				scsi_device_lookup(ch->device->host,
-+						   ch->device->channel,
-+						   id,lun);
-+			if (!ch->dt[elem]) {
-+				/* should not happen */
-+				if (verbose)
-+					printk("Huh? device not found!\n");
-+			} else {
-+				if (verbose)
-+					printk("name: %8.8s %16.16s %4.4s\n",
-+					       ch->dt[elem]->vendor,
-+					       ch->dt[elem]->model,
-+					       ch->dt[elem]->rev);
-+			}
-+		}
-+	}
-+	ch->voltags = 1;
-+	kfree(buffer);
-+
-+	return 0;
-+}
-+
-+/* ------------------------------------------------------------------------ */
-+
-+static int
-+ch_position(scsi_changer *ch, u_int trans, u_int elem, int rotate)
-+{
-+	u_char  cmd[10];
-+
-+	dprintk("position: 0x%x\n",elem);
-+	if (0 == trans)
-+		trans = ch->firsts[CHET_MT];
-+	memset(cmd,0,sizeof(cmd));
-+	cmd[0]  = POSITION_TO_ELEMENT;
-+	cmd[1]  = ch->device->lun << 5;
-+	cmd[2]  = (trans >> 8) & 0xff;
-+	cmd[3]  =  trans       & 0xff;
-+	cmd[4]  = (elem  >> 8) & 0xff;
-+	cmd[5]  =  elem        & 0xff;
-+	cmd[8]  = rotate ? 1 : 0;
-+	return ch_do_scsi(ch, cmd, NULL,0);
-+}
-+
-+static int
-+ch_move(scsi_changer *ch, u_int trans, u_int src, u_int dest, int rotate)
-+{
-+	u_char  cmd[12];
-+
-+	dprintk("move: 0x%x => 0x%x\n",src,dest);
-+	if (0 == trans)
-+		trans = ch->firsts[CHET_MT];
-+	memset(cmd,0,sizeof(cmd));
-+	cmd[0]  = MOVE_MEDIUM;
-+	cmd[1]  = ch->device->lun << 5;
-+	cmd[2]  = (trans >> 8) & 0xff;
-+	cmd[3]  =  trans       & 0xff;
-+	cmd[4]  = (src   >> 8) & 0xff;
-+	cmd[5]  =  src         & 0xff;
-+	cmd[6]  = (dest  >> 8) & 0xff;
-+	cmd[7]  =  dest        & 0xff;
-+	cmd[10] = rotate ? 1 : 0;
-+	return ch_do_scsi(ch, cmd, NULL,0);
-+}
-+
-+static int
-+ch_exchange(scsi_changer *ch, u_int trans, u_int src,
-+	    u_int dest1, u_int dest2, int rotate1, int rotate2)
-+{
-+	u_char  cmd[12];
-+
-+	dprintk("exchange: 0x%x => 0x%x => 0x%x\n",
-+		src,dest1,dest2);
-+	if (0 == trans)
-+		trans = ch->firsts[CHET_MT];
-+	memset(cmd,0,sizeof(cmd));
-+	cmd[0]  = EXCHANGE_MEDIUM;
-+	cmd[1]  = ch->device->lun << 5;
-+	cmd[2]  = (trans >> 8) & 0xff;
-+	cmd[3]  =  trans       & 0xff;
-+	cmd[4]  = (src   >> 8) & 0xff;
-+	cmd[5]  =  src         & 0xff;
-+	cmd[6]  = (dest1 >> 8) & 0xff;
-+	cmd[7]  =  dest1       & 0xff;
-+	cmd[8]  = (dest2 >> 8) & 0xff;
-+	cmd[9]  =  dest2       & 0xff;
-+	cmd[10] = (rotate1 ? 1 : 0) | (rotate2 ? 2 : 0);
-+
-+	return ch_do_scsi(ch, cmd, NULL,0);
-+}
-+
-+static void
-+ch_check_voltag(char *tag)
-+{
-+	int i;
-+
-+	for (i = 0; i < 32; i++) {
-+		/* restrict to ascii */
-+		if (tag[i] >= 0x7f || tag[i] < 0x20)
-+			tag[i] = ' ';
-+		/* don't allow search wildcards */
-+		if (tag[i] == '?' ||
-+		    tag[i] == '*')
-+			tag[i] = ' ';
-+	}
-+}
-+
-+static int
-+ch_set_voltag(scsi_changer *ch, u_int elem,
-+	      int alternate, int clear, u_char *tag)
-+{
-+	u_char  cmd[12];
-+	u_char  *buffer;
-+	int result;
-+
-+	buffer = kmalloc(512, GFP_KERNEL);
-+	if (!buffer)
-+		return -ENOMEM;
-+	memset(buffer,0,512);
-+
-+	dprintk("%s %s voltag: 0x%x => \"%s\"\n",
-+		clear     ? "clear"     : "set",
-+		alternate ? "alternate" : "primary",
-+		elem, tag);
-+	memset(cmd,0,sizeof(cmd));
-+	cmd[0]  = SEND_VOLUME_TAG;
-+	cmd[1] = (ch->device->lun << 5) |
-+		ch_elem_to_typecode(ch,elem);
-+	cmd[2] = (elem >> 8) & 0xff;
-+	cmd[3] = elem        & 0xff;
-+	cmd[5] = clear
-+		? (alternate ? 0x0d : 0x0c)
-+		: (alternate ? 0x0b : 0x0a);
-+
-+	cmd[9] = 255;
-+
-+	memcpy(buffer,tag,32);
-+	ch_check_voltag(buffer);
-+
-+	result = ch_do_scsi(ch, cmd, buffer, 256);
-+	kfree(buffer);
-+	return result;
-+}
-+
-+static int ch_gstatus(scsi_changer *ch, int type, unsigned char *dest)
-+{
-+	int retval = 0;
-+	u_char data[16];
-+	unsigned int i;
-+
-+	down(&ch->lock);
-+	for (i = 0; i < ch->counts[type]; i++) {
-+		if (0 != ch_read_element_status
-+		    (ch, ch->firsts[type]+i,data)) {
-+			retval = -EIO;
-+			break;
-+		}
-+		put_user(data[2], dest+i);
-+		if (data[2] & CESTATUS_EXCEPT)
-+			vprintk("element 0x%x: asc=0x%x, ascq=0x%x\n",
-+				ch->firsts[type]+i,
-+				(int)data[4],(int)data[5]);
-+		retval = ch_read_element_status
-+			(ch, ch->firsts[type]+i,data);
-+		if (0 != retval)
-+			break;
-+	}
-+	up(&ch->lock);
-+	return retval;
-+}
-+
-+/* ------------------------------------------------------------------------ */
-+
-+static int
-+ch_release(struct inode *inode, struct file *file)
-+{
-+	scsi_changer *ch = file->private_data;
-+
-+	scsi_device_put(ch->device);
-+	file->private_data = NULL;
-+	return 0;
-+}
-+
-+static int
-+ch_open(struct inode *inode, struct file *file)
-+{
-+	scsi_changer *tmp, *ch;
-+	int minor = iminor(inode);
-+
-+	spin_lock(&ch_devlist_lock);
-+	ch = NULL;
-+	list_for_each_entry(tmp,&ch_devlist,list) {
-+		if (tmp->minor == minor)
-+			ch = tmp;
-+	}
-+	if (NULL == ch || scsi_device_get(ch->device)) {
-+		spin_unlock(&ch_devlist_lock);
-+		return -ENXIO;
-+	}
-+	spin_unlock(&ch_devlist_lock);
-+
-+	file->private_data = ch;
-+	return 0;
-+}
-+
-+static int
-+ch_checkrange(scsi_changer *ch, unsigned int type, unsigned int unit)
-+{
-+	if (type >= CH_TYPES  ||  unit >= ch->counts[type])
-+		return -1;
-+	return 0;
-+}
-+
-+static int ch_ioctl(struct inode * inode, struct file * file,
-+		    unsigned int cmd, unsigned long arg)
-+{
-+	scsi_changer *ch = file->private_data;
-+	int retval;
-+
-+	switch (cmd) {
-+	case CHIOGPARAMS:
-+	{
-+		struct changer_params params;
-+
-+		params.cp_curpicker = 0;
-+		params.cp_npickers  = ch->counts[CHET_MT];
-+		params.cp_nslots    = ch->counts[CHET_ST];
-+		params.cp_nportals  = ch->counts[CHET_IE];
-+		params.cp_ndrives   = ch->counts[CHET_DT];
-+
-+		if (copy_to_user((void *) arg, &params, sizeof(params)))
-+			return -EFAULT;
-+		return 0;
-+	}
-+	case CHIOGVPARAMS:
-+	{
-+		struct changer_vendor_params vparams;
-+
-+		memset(&vparams,0,sizeof(vparams));
-+		if (ch->counts[CHET_V1]) {
-+			vparams.cvp_n1  = ch->counts[CHET_V1];
-+			strncpy(vparams.cvp_label1,vendor_labels[0],16);
-+		}
-+		if (ch->counts[CHET_V2]) {
-+			vparams.cvp_n2  = ch->counts[CHET_V2];
-+			strncpy(vparams.cvp_label2,vendor_labels[1],16);
-+		}
-+		if (ch->counts[CHET_V3]) {
-+			vparams.cvp_n3  = ch->counts[CHET_V3];
-+			strncpy(vparams.cvp_label3,vendor_labels[2],16);
-+		}
-+		if (ch->counts[CHET_V4]) {
-+			vparams.cvp_n4  = ch->counts[CHET_V4];
-+			strncpy(vparams.cvp_label4,vendor_labels[3],16);
-+		}
-+		if (copy_to_user((void *) arg, &vparams, sizeof(vparams)))
-+			return -EFAULT;
-+		return 0;
-+	}
-+
-+	case CHIOPOSITION:
-+	{
-+		struct changer_position pos;
-+
-+		if (copy_from_user(&pos, (void*)arg, sizeof (pos)))
-+			return -EFAULT;
-+
-+		if (0 != ch_checkrange(ch, pos.cp_type, pos.cp_unit)) {
-+			dprintk("CHIOPOSITION: invalid parameter%s\n","");
-+			return -EBADSLT;
-+		}
-+		down(&ch->lock);
-+		retval = ch_position(ch,0,
-+				     ch->firsts[pos.cp_type] + pos.cp_unit,
-+				     pos.cp_flags & CP_INVERT);
-+		up(&ch->lock);
-+		return retval;
-+	}
-+
-+	case CHIOMOVE:
-+	{
-+		struct changer_move mv;
-+
-+		if (copy_from_user(&mv, (void*)arg, sizeof (mv)))
-+			return -EFAULT;
-+
-+		if (0 != ch_checkrange(ch, mv.cm_fromtype, mv.cm_fromunit) ||
-+		    0 != ch_checkrange(ch, mv.cm_totype,   mv.cm_tounit  )) {
-+			dprintk("CHIOMOVE: invalid parameter%s\n","");
-+			return -EBADSLT;
-+		}
-+
-+		down(&ch->lock);
-+		retval = ch_move(ch,0,
-+				 ch->firsts[mv.cm_fromtype] + mv.cm_fromunit,
-+				 ch->firsts[mv.cm_totype]   + mv.cm_tounit,
-+				 mv.cm_flags & CM_INVERT);
-+		up(&ch->lock);
-+		return retval;
-+	}
-+
-+	case CHIOEXCHANGE:
-+	{
-+		struct changer_exchange mv;
-+
-+		if (copy_from_user(&mv, (void*)arg, sizeof (mv)))
-+			return -EFAULT;
-+
-+		if (0 != ch_checkrange(ch, mv.ce_srctype,  mv.ce_srcunit ) ||
-+		    0 != ch_checkrange(ch, mv.ce_fdsttype, mv.ce_fdstunit) ||
-+		    0 != ch_checkrange(ch, mv.ce_sdsttype, mv.ce_sdstunit)) {
-+			dprintk("CHIOEXCHANGE: invalid parameter%s\n","");
-+			return -EBADSLT;
-+		}
-+
-+		down(&ch->lock);
-+		retval = ch_exchange
-+			(ch,0,
-+			 ch->firsts[mv.ce_srctype]  + mv.ce_srcunit,
-+			 ch->firsts[mv.ce_fdsttype] + mv.ce_fdstunit,
-+			 ch->firsts[mv.ce_sdsttype] + mv.ce_sdstunit,
-+			 mv.ce_flags & CE_INVERT1, mv.ce_flags & CE_INVERT2);
-+		up(&ch->lock);
-+		return retval;
-+	}
-+
-+	case CHIOGSTATUS:
-+	{
-+		struct changer_element_status ces;
-+
-+		if (copy_from_user(&ces, (void*)arg, sizeof (ces)))
-+			return -EFAULT;
-+		if (ces.ces_type < 0 || ces.ces_type >= CH_TYPES)
-+			return -EINVAL;
-+
-+		return ch_gstatus(ch, ces.ces_type, ces.ces_data);
-+	}
-+
-+	case CHIOGELEM:
-+	{
-+		struct changer_get_element cge;
-+		u_char  cmd[12];
-+		u_char  *buffer;
-+		unsigned int elem;
-+		int     result,i;
-+
-+		if (copy_from_user(&cge, (void*)arg, sizeof (cge)))
-+			return -EFAULT;
-+
-+		if (0 != ch_checkrange(ch, cge.cge_type, cge.cge_unit))
-+			return -EINVAL;
-+		elem = ch->firsts[cge.cge_type] + cge.cge_unit;
-+
-+		buffer = kmalloc(512, GFP_KERNEL);
-+		if (!buffer)
-+			return -ENOMEM;
-+		down(&ch->lock);
-+
-+	voltag_retry:
-+		memset(cmd,0,sizeof(cmd));
-+		cmd[0] = READ_ELEMENT_STATUS;
-+		cmd[1] = (ch->device->lun << 5) |
-+			(ch->voltags ? 0x10 : 0) |
-+			ch_elem_to_typecode(ch,elem);
-+		cmd[2] = (elem >> 8) & 0xff;
-+		cmd[3] = elem        & 0xff;
-+		cmd[5] = 1;
-+		cmd[9] = 255;
-+
-+		if (0 == (result = ch_do_scsi(ch, cmd, buffer, 256))) {
-+			cge.cge_status = buffer[18];
-+			cge.cge_flags = 0;
-+			if (buffer[18] & CESTATUS_EXCEPT) {
-+				/* FIXME: fill cge_errno */
-+			}
-+			if (buffer[25] & 0x80) {
-+				cge.cge_flags |= CGE_SRC;
-+				if (buffer[25] & 0x40)
-+					cge.cge_flags |= CGE_INVERT;
-+				elem = (buffer[26]<<8) | buffer[27];
-+				for (i = 0; i < 4; i++) {
-+					if (elem >= ch->firsts[i] &&
-+					    elem <  ch->firsts[i] + ch->counts[i]) {
-+						cge.cge_srctype = i;
-+						cge.cge_srcunit = elem-ch->firsts[i];
-+					}
-+				}
-+			}
-+			if ((buffer[22] & 0x30) == 0x30) {
-+				cge.cge_flags |= CGE_IDLUN;
-+				cge.cge_id  = buffer[23];
-+				cge.cge_lun = buffer[22] & 7;
-+			}
-+			if (buffer[9] & 0x80) {
-+				cge.cge_flags |= CGE_PVOLTAG;
-+				memcpy(cge.cge_pvoltag,buffer+28,36);
-+			}
-+			if (buffer[9] & 0x40) {
-+				cge.cge_flags |= CGE_AVOLTAG;
-+				memcpy(cge.cge_avoltag,buffer+64,36);
-+			}
-+		} else if (ch->voltags) {
-+			ch->voltags = 0;
-+			vprintk("device has no volume tag support%s\n","");
-+			goto voltag_retry;
-+		}
-+		kfree(buffer);
-+		up(&ch->lock);
-+
-+		if (copy_to_user((void*)arg, &cge, sizeof (cge)))
-+			return -EFAULT;
-+		return result;
-+	}
-+
-+	case CHIOINITELEM:
-+	{
-+		down(&ch->lock);
-+		retval = ch_init_elem(ch);
-+		up(&ch->lock);
-+		return retval;
-+	}
-+
-+	case CHIOSVOLTAG:
-+	{
-+		struct changer_set_voltag csv;
-+		int elem;
-+
-+		if (copy_from_user(&csv, (void*)arg, sizeof(csv)))
-+			return -EFAULT;
-+
-+		if (0 != ch_checkrange(ch, csv.csv_type, csv.csv_unit)) {
-+			dprintk("CHIOSVOLTAG: invalid parameter%s\n","");
-+			return -EBADSLT;
-+		}
-+		elem = ch->firsts[csv.csv_type] + csv.csv_unit;
-+		down(&ch->lock);
-+		retval = ch_set_voltag(ch, elem,
-+				       csv.csv_flags & CSV_AVOLTAG,
-+				       csv.csv_flags & CSV_CLEARTAG,
-+				       csv.csv_voltag);
-+		up(&ch->lock);
-+		return retval;
-+	}
-+
-+	default:
-+		return scsi_ioctl(ch->device, cmd, (void*)arg);
-+
-+	}
-+}
-+
-+#ifdef CONFIG_COMPAT
-+
-+struct changer_element_status32 {
-+	int		ces_type;
-+	compat_uptr_t	ces_data;
-+};
-+#define CHIOGSTATUS32  _IOW('c', 8,struct changer_element_status32)
-+
-+static long ch_ioctl_compat(struct file * file,
-+			    unsigned int cmd, unsigned long arg)
-+{
-+	scsi_changer *ch = file->private_data;
-+
-+	switch (cmd) {
-+	case CHIOGPARAMS:
-+	case CHIOGVPARAMS:
-+	case CHIOPOSITION:
-+	case CHIOMOVE:
-+	case CHIOEXCHANGE:
-+	case CHIOGELEM:
-+	case CHIOINITELEM:
-+	case CHIOSVOLTAG:
-+		/* compatible */
-+		return ch_ioctl(NULL /* inode, unused */,
-+				file, cmd, arg);
-+	case CHIOGSTATUS32:
-+	{
-+		struct changer_element_status32 ces32;
-+		unsigned char *data;
-+
-+		if (copy_from_user(&ces32, (void*)arg, sizeof (ces32)))
-+			return -EFAULT;
-+		if (ces32.ces_type < 0 || ces32.ces_type >= CH_TYPES)
-+			return -EINVAL;
-+
-+		data = compat_ptr(ces32.ces_data);
-+		return ch_gstatus(ch, ces32.ces_type, data);
-+	}
-+	default:
-+		// return scsi_ioctl_compat(ch->device, cmd, (void*)arg);
-+		return -ENOIOCTLCMD;
-+
-+	}
-+}
-+#endif
-+
-+/* ------------------------------------------------------------------------ */
-+
-+static int ch_probe(struct device *dev)
-+{
-+	struct scsi_device *sd = to_scsi_device(dev);
-+	scsi_changer *ch;
-+
-+	if (sd->type != TYPE_MEDIUM_CHANGER)
-+		return -ENODEV;
-+
-+	ch = kmalloc(sizeof(*ch), GFP_KERNEL);
-+	if (NULL == ch)
-+		return -ENOMEM;
-+
-+	memset(ch,0,sizeof(*ch));
-+	ch->minor = ch_devcount;
-+	sprintf(ch->name,"ch%d",ch->minor);
-+	init_MUTEX(&ch->lock);
-+	ch->device = sd;
-+	ch_readconfig(ch);
-+	if (init)
-+		ch_init_elem(ch);
-+
-+	devfs_mk_cdev(MKDEV(SCSI_CHANGER_MAJOR,ch->minor),
-+		      S_IFCHR | S_IRUGO | S_IWUGO, ch->name);
-+
-+	printk(KERN_INFO "Attached scsi changer %s "
-+	       "at scsi%d, channel %d, id %d, lun %d\n",
-+	       ch->name, sd->host->host_no, sd->channel, sd->id, sd->lun);
-+
-+	spin_lock(&ch_devlist_lock);
-+	list_add_tail(&ch->list,&ch_devlist);
-+	ch_devcount++;
-+	spin_unlock(&ch_devlist_lock);
-+	return 0;
-+}
-+
-+static int ch_remove(struct device *dev)
-+{
-+	struct scsi_device *sd = to_scsi_device(dev);
-+	scsi_changer *tmp, *ch;
-+
-+	spin_lock(&ch_devlist_lock);
-+	ch = NULL;
-+	list_for_each_entry(tmp,&ch_devlist,list) {
-+		if (tmp->device == sd)
-+			ch = tmp;
-+	}
-+	BUG_ON(NULL == ch);
-+	list_del(&ch->list);
-+	spin_unlock(&ch_devlist_lock);
-+
-+	devfs_remove(ch->name);
-+	kfree(ch->dt);
-+	kfree(ch);
-+	ch_devcount--;
-+	return 0;
-+}
-+
-+static int __init init_ch_module(void)
-+{
-+	int rc;
-+
-+	printk(KERN_INFO "SCSI Media Changer driver v" VERSION " \n");
-+	rc = register_chrdev(SCSI_CHANGER_MAJOR,"ch",&changer_fops);
-+	if (rc < 0) {
-+		printk("Unable to get major %d for SCSI-Changer\n",
-+		       SCSI_CHANGER_MAJOR);
-+		return rc;
-+	}
-+	rc = scsi_register_driver(&ch_template.gendrv);
-+	if (rc < 0)
-+		goto fail1;
-+	return 0;
-+
-+ fail1:
-+	unregister_chrdev(SCSI_CHANGER_MAJOR, "ch");
-+	return rc;
-+}
-+
-+static void __exit exit_ch_module(void)
-+{
-+	scsi_unregister_driver(&ch_template.gendrv);
-+	unregister_chrdev(SCSI_CHANGER_MAJOR, "ch");
-+}
-+
-+module_init(init_ch_module);
-+module_exit(exit_ch_module);
-+
-+/*
-+ * Local variables:
-+ * c-basic-offset: 8
-+ * End:
-+ */
-diff -puN drivers/scsi/Kconfig~add-scsi-changer-driver drivers/scsi/Kconfig
---- 25/drivers/scsi/Kconfig~add-scsi-changer-driver	Thu Feb 17 16:55:13 2005
-+++ 25-akpm/drivers/scsi/Kconfig	Thu Feb 17 16:55:13 2005
-@@ -137,6 +137,24 @@ config CHR_DEV_SG
- 
- 	  If unsure, say N.
- 
-+config CHR_DEV_SCH
-+	tristate "SCSI media changer support"
-+	depends on SCSI
-+	---help---
-+	  This is a driver for SCSI media changers.  Most common devices are
-+	  tape libraries and MOD/CDROM jukeboxes.  *Real* jukeboxes, you
-+	  don't need this for those tiny 6-slot cdrom changers.  Media
-+	  changers are listed as "Type: Medium Changer" in /proc/scsi/scsi.
-+	  If you have such hardware and want to use it with linux, say Y
-+	  here.  Check <file:Documentation/scsi-changer.txt> for details.
-+
-+	  If you want to compile this as a module ( = code which can be
-+	  inserted in and removed from the running kernel whenever you want),
-+	  say M here and read <file:Documentation/modules.txt> and
-+	  <file:Documentation/scsi.txt>. The module will be called ch.o.
-+	  If unsure, say N.
-+
-+
- comment "Some SCSI devices (e.g. CD jukebox) support multiple LUNs"
- 	depends on SCSI
- 
-diff -puN drivers/scsi/Makefile~add-scsi-changer-driver drivers/scsi/Makefile
---- 25/drivers/scsi/Makefile~add-scsi-changer-driver	Thu Feb 17 16:55:13 2005
-+++ 25-akpm/drivers/scsi/Makefile	Thu Feb 17 16:55:13 2005
-@@ -141,6 +141,7 @@ obj-$(CONFIG_CHR_DEV_OSST)	+= osst.o
- obj-$(CONFIG_BLK_DEV_SD)	+= sd_mod.o
- obj-$(CONFIG_BLK_DEV_SR)	+= sr_mod.o
- obj-$(CONFIG_CHR_DEV_SG)	+= sg.o
-+obj-$(CONFIG_CHR_DEV_SCH)	+= ch.o
- 
- scsi_mod-y			+= scsi.o hosts.o scsi_ioctl.o constants.o \
- 				   scsicam.o scsi_error.o scsi_lib.o \
-diff -puN /dev/null include/linux/chio.h
---- /dev/null	Thu Apr 11 07:25:15 2002
-+++ 25-akpm/include/linux/chio.h	Thu Feb 17 16:55:14 2005
-@@ -0,0 +1,168 @@
-+/*
-+ * ioctl interface for the scsi media changer driver
-+ */
-+
-+/* changer element types */
-+#define CHET_MT   0	/* media transport element (robot) */
-+#define CHET_ST   1	/* storage element (media slots) */
-+#define CHET_IE   2	/* import/export element */
-+#define CHET_DT   3	/* data transfer element (tape/cdrom/whatever) */
-+#define CHET_V1   4	/* vendor specific #1 */
-+#define CHET_V2   5	/* vendor specific #2 */
-+#define CHET_V3   6	/* vendor specific #3 */
-+#define CHET_V4   7	/* vendor specific #4 */
-+
-+
-+/*
-+ * CHIOGPARAMS
-+ *    query changer properties
-+ *
-+ * CHIOVGPARAMS
-+ *    query vendor-specific element types
-+ *
-+ *    accessing elements works by specifing type and unit of the element.
-+ *    for eample, storage elements are addressed with type = CHET_ST and
-+ *    unit = 0 .. cp_nslots-1
-+ *
-+ */
-+struct changer_params {
-+	int cp_curpicker;  /* current transport element */
-+	int cp_npickers;   /* number of transport elements      (CHET_MT) */
-+	int cp_nslots;     /* number of storage elements        (CHET_ST) */
-+	int cp_nportals;   /* number of import/export elements  (CHET_IE) */
-+	int cp_ndrives;    /* number of data transfer elements  (CHET_DT) */
-+};
-+struct changer_vendor_params {
-+	int  cvp_n1;       /* number of vendor specific elems   (CHET_V1) */
-+	char cvp_label1[16];
-+	int  cvp_n2;       /* number of vendor specific elems   (CHET_V2) */
-+	char cvp_label2[16];
-+	int  cvp_n3;       /* number of vendor specific elems   (CHET_V3) */
-+	char cvp_label3[16];
-+	int  cvp_n4;       /* number of vendor specific elems   (CHET_V4) */
-+	char cvp_label4[16];
-+	int  reserved[8];
-+};
-+
-+
-+/*
-+ * CHIOMOVE
-+ *    move a medium from one element to another
-+ */
-+struct changer_move {
-+	int cm_fromtype;	/* type/unit of source element */
-+	int cm_fromunit;
-+	int cm_totype;	/* type/unit of destination element */
-+	int cm_tounit;
-+	int cm_flags;
-+};
-+#define CM_INVERT   1   /* flag: rotate media (for double-sided like MOD) */
-+
-+
-+/*
-+ * CHIOEXCHANGE
-+ *    move one medium from element #1 to element #2,
-+ *    and another one from element #2 to element #3.
-+ *    element #1 and #3 are allowed to be identical.
-+ */
-+struct changer_exchange {
-+	int ce_srctype;	    /* type/unit of element #1 */
-+	int ce_srcunit;
-+	int ce_fdsttype;    /* type/unit of element #2 */
-+	int ce_fdstunit;
-+	int ce_sdsttype;    /* type/unit of element #3 */
-+	int ce_sdstunit;
-+	int ce_flags;
-+};
-+#define CE_INVERT1   1
-+#define CE_INVERT2   2
-+
-+
-+/*
-+ * CHIOPOSITION
-+ *    move the transport element (robot arm) to a specific element.
-+ */
-+struct changer_position {
-+	int cp_type;
-+	int cp_unit;
-+	int cp_flags;
-+};
-+#define CP_INVERT   1
-+
-+
-+/*
-+ * CHIOGSTATUS
-+ *    get element status for all elements of a specific type
-+ */
-+struct changer_element_status {
-+	int             ces_type;
-+	unsigned char   *ces_data;
-+};
-+#define CESTATUS_FULL     0x01 /* full */
-+#define CESTATUS_IMPEXP   0x02	/* media was imported (inserted by sysop) */
-+#define CESTATUS_EXCEPT   0x04	/* error condition */
-+#define CESTATUS_ACCESS   0x08	/* access allowed */
-+#define CESTATUS_EXENAB   0x10	/* element can export media */
-+#define CESTATUS_INENAB   0x20	/* element can import media */
-+
-+
-+/*
-+ * CHIOGELEM
-+ *    get more detailed status informtion for a single element
-+ */
-+struct changer_get_element {
-+	int	cge_type;	 /* type/unit */
-+	int	cge_unit;
-+	int	cge_status;      /* status */
-+	int     cge_errno;       /* errno */
-+	int     cge_srctype;     /* source element of the last move/exchange */
-+	int     cge_srcunit;
-+	int     cge_id;          /* scsi id  (for data transfer elements) */
-+	int     cge_lun;         /* scsi lun (for data transfer elements) */
-+	char    cge_pvoltag[36]; /* primary volume tag */
-+	char    cge_avoltag[36]; /* alternate volume tag */
-+	int     cge_flags;
-+};
-+/* flags */
-+#define CGE_ERRNO     0x01       /* errno available       */
-+#define CGE_INVERT    0x02       /* media inverted        */
-+#define CGE_SRC       0x04       /* media src available   */
-+#define CGE_IDLUN     0x08       /* ID+LUN available      */
-+#define CGE_PVOLTAG   0x10       /* primary volume tag available */
-+#define CGE_AVOLTAG   0x20       /* alternate volume tag available */
-+
-+
-+/*
-+ * CHIOSVOLTAG
-+ *    set volume tag
-+ */
-+struct changer_set_voltag {
-+	int	csv_type;	 /* type/unit */
-+	int	csv_unit;
-+	char    csv_voltag[36];  /* volume tag */
-+	int     csv_flags;
-+};
-+#define CSV_PVOLTAG   0x01       /* primary volume tag */
-+#define CSV_AVOLTAG   0x02       /* alternate volume tag */
-+#define CSV_CLEARTAG  0x04       /* clear volume tag */
-+
-+/* ioctls */
-+#define CHIOMOVE       _IOW('c', 1,struct changer_move)
-+#define CHIOEXCHANGE   _IOW('c', 2,struct changer_exchange)
-+#define CHIOPOSITION   _IOW('c', 3,struct changer_position)
-+#define CHIOGPICKER    _IOR('c', 4,int)                        /* not impl. */
-+#define CHIOSPICKER    _IOW('c', 5,int)                        /* not impl. */
-+#define CHIOGPARAMS    _IOR('c', 6,struct changer_params)
-+#define CHIOGSTATUS    _IOW('c', 8,struct changer_element_status)
-+#define CHIOGELEM      _IOW('c',16,struct changer_get_element)
-+#define CHIOINITELEM   _IO('c',17)
-+#define CHIOSVOLTAG    _IOW('c',18,struct changer_set_voltag)
-+#define CHIOGVPARAMS   _IOR('c',19,struct changer_vendor_params)
-+
-+/* ---------------------------------------------------------------------- */
-+
-+/*
-+ * Local variables:
-+ * c-basic-offset: 8
-+ * End:
-+ */
-diff -puN include/linux/major.h~add-scsi-changer-driver include/linux/major.h
---- 25/include/linux/major.h~add-scsi-changer-driver	Thu Feb 17 16:55:13 2005
-+++ 25-akpm/include/linux/major.h	Thu Feb 17 16:55:14 2005
-@@ -101,6 +101,7 @@
- #define I2O_MAJOR		80	/* 80->87 */
- 
- #define SHMIQ_MAJOR		85   /* Linux/mips, SGI /dev/shmiq */
-+#define SCSI_CHANGER_MAJOR      86
- 
- #define IDE6_MAJOR		88
- #define IDE7_MAJOR		89
-diff -puN include/scsi/scsi.h~add-scsi-changer-driver include/scsi/scsi.h
---- 25/include/scsi/scsi.h~add-scsi-changer-driver	Thu Feb 17 16:55:13 2005
-+++ 25-akpm/include/scsi/scsi.h	Thu Feb 17 16:55:14 2005
-@@ -41,6 +41,7 @@ extern const char *const scsi_device_typ
- #define FORMAT_UNIT           0x04
- #define READ_BLOCK_LIMITS     0x05
- #define REASSIGN_BLOCKS       0x07
-+#define INITIALIZE_ELEMENT_STATUS 0x07
- #define READ_6                0x08
- #define WRITE_6               0x0a
- #define SEEK_6                0x0b
-@@ -65,6 +66,7 @@ extern const char *const scsi_device_typ
- #define READ_10               0x28
- #define WRITE_10              0x2a
- #define SEEK_10               0x2b
-+#define POSITION_TO_ELEMENT   0x2b
- #define WRITE_VERIFY          0x2e
- #define VERIFY                0x2f
- #define SEARCH_HIGH           0x30
-@@ -97,6 +99,7 @@ extern const char *const scsi_device_typ
- #define PERSISTENT_RESERVE_OUT 0x5f
- #define REPORT_LUNS           0xa0
- #define MOVE_MEDIUM           0xa5
-+#define EXCHANGE_MEDIUM       0xa6
- #define READ_12               0xa8
- #define WRITE_12              0xaa
- #define WRITE_VERIFY_12       0xae
-_

Copied: trunk/kernel/source/kernel-source-2.6.11-2.6.11/debian/patches/drivers-add-scsi_changer.patch (from rev 2762, trunk/kernel/source/kernel-source-2.6.11-2.6.11/debian/patches/drivers-add-scsi_changer.dpatch)

Deleted: trunk/kernel/source/kernel-source-2.6.11-2.6.11/debian/patches/drivers-ide-__devinit.dpatch
===================================================================
--- trunk/kernel/source/kernel-source-2.6.11-2.6.11/debian/patches/drivers-ide-__devinit.dpatch	2005-03-21 09:35:04 UTC (rev 2762)
+++ trunk/kernel/source/kernel-source-2.6.11-2.6.11/debian/patches/drivers-ide-__devinit.dpatch	2005-03-21 09:38:36 UTC (rev 2763)
@@ -1,446 +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: pci probe routines must be __devinit, not __init
-## DP: Patch author: Herbert Xu
-## DP: Upstream status: not submitted
-
-. $(dirname $0)/DPATCH
-
- at DPATCH@
---- 1.25/drivers/ide/pci/alim15x3.c	2004-06-15 18:29:40 +02:00
-+++ edited/drivers/ide/pci/alim15x3.c	2004-06-16 15:45:33 +02:00
-@@ -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;
---- 1.31/drivers/ide/pci/amd74xx.c	2004-06-01 19:55:04 +02:00
-+++ edited/drivers/ide/pci/amd74xx.c	2004-06-16 15:44:16 +02:00
-@@ -308,7 +308,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;
-@@ -412,7 +412,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;
- 
---- 1.9/drivers/ide/pci/cmd640.c	2004-02-01 19:06:55 +01:00
-+++ edited/drivers/ide/pci/cmd640.c	2004-06-16 15:44:17 +02:00
-@@ -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;
---- 1.22/drivers/ide/pci/cs5530.c	2004-06-15 18:29:40 +02:00
-+++ edited/drivers/ide/pci/cs5530.c	2004-06-16 15:49:00 +02:00
-@@ -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;
---- 1.17/drivers/ide/pci/cy82c693.c	2004-03-18 15:20:56 +01:00
-+++ edited/drivers/ide/pci/cy82c693.c	2004-06-16 15:44:17 +02:00
-@@ -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;
---- 1.18/drivers/ide/pci/it8172.c	2004-06-01 21:04:38 +02:00
-+++ edited/drivers/ide/pci/it8172.c	2004-06-16 15:48:50 +02:00
-@@ -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;
---- 1.19/drivers/ide/pci/ns87415.c	2004-06-15 18:29:40 +02:00
-+++ edited/drivers/ide/pci/ns87415.c	2004-06-16 15:48:42 +02:00
-@@ -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;
---- 1.18/drivers/ide/pci/opti621.c	2004-06-01 21:04:38 +02:00
-+++ edited/drivers/ide/pci/opti621.c	2004-06-16 15:48:02 +02:00
-@@ -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;
---- 1.19/drivers/ide/pci/sc1200.c	2004-06-15 18:29:40 +02:00
-+++ edited/drivers/ide/pci/sc1200.c	2004-06-16 15:47:38 +02:00
-@@ -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;
---- 1.29/drivers/ide/pci/serverworks.c	2004-06-01 21:04:38 +02:00
-+++ edited/drivers/ide/pci/serverworks.c	2004-06-16 15:44:17 +02:00
-@@ -341,7 +341,7 @@
- 	return __ide_dma_end(drive);
- }
- 
--static unsigned int __init init_chipset_svwks (struct pci_dev *dev, const char *name)
-+static unsigned int __devinit init_chipset_svwks (struct pci_dev *dev, const char *name)
- {
- 	unsigned int reg;
- 	u8 btr;
-@@ -442,7 +442,7 @@
- 	return (dev->irq) ? dev->irq : 0;
- }
- 
--static unsigned int __init ata66_svwks_svwks (ide_hwif_t *hwif)
-+static unsigned int __devinit ata66_svwks_svwks (ide_hwif_t *hwif)
- {
- 	return 1;
- }
-@@ -454,7 +454,7 @@
-  * Bit 14 clear = primary IDE channel does not have 80-pin cable.
-  * Bit 14 set   = primary IDE channel has 80-pin cable.
-  */
--static unsigned int __init ata66_svwks_dell (ide_hwif_t *hwif)
-+static unsigned int __devinit ata66_svwks_dell (ide_hwif_t *hwif)
- {
- 	struct pci_dev *dev = hwif->pci_dev;
- 	if (dev->subsystem_vendor == PCI_VENDOR_ID_DELL &&
-@@ -472,7 +472,7 @@
-  *
-  * WARNING: this only works on Alpine hardware!
-  */
--static unsigned int __init ata66_svwks_cobalt (ide_hwif_t *hwif)
-+static unsigned int __devinit ata66_svwks_cobalt (ide_hwif_t *hwif)
- {
- 	struct pci_dev *dev = hwif->pci_dev;
- 	if (dev->subsystem_vendor == PCI_VENDOR_ID_SUN &&
-@@ -483,7 +483,7 @@
- 	return 0;
- }
- 
--static unsigned int __init ata66_svwks (ide_hwif_t *hwif)
-+static unsigned int __devinit ata66_svwks (ide_hwif_t *hwif)
- {
- 	struct pci_dev *dev = hwif->pci_dev;
- 
-@@ -508,7 +508,7 @@
- }
- 
- #undef CAN_SW_DMA
--static void __init init_hwif_svwks (ide_hwif_t *hwif)
-+static void __devinit init_hwif_svwks (ide_hwif_t *hwif)
- {
- 	u8 dma_stat = 0;
- 
-@@ -556,7 +556,7 @@
- /*
-  * We allow the BM-DMA driver to only work on enabled interfaces.
-  */
--static void __init init_dma_svwks (ide_hwif_t *hwif, unsigned long dmabase)
-+static void __devinit init_dma_svwks (ide_hwif_t *hwif, unsigned long dmabase)
- {
- 	struct pci_dev *dev = hwif->pci_dev;
- 
-@@ -568,12 +568,12 @@
- 	ide_setup_dma(hwif, dmabase, 8);
- }
- 
--static int __init init_setup_svwks (struct pci_dev *dev, ide_pci_device_t *d)
-+static int __devinit init_setup_svwks (struct pci_dev *dev, ide_pci_device_t *d)
- {
- 	return ide_setup_pci_device(dev, d);
- }
- 
--static int __init init_setup_csb6 (struct pci_dev *dev, ide_pci_device_t *d)
-+static int __devinit init_setup_csb6 (struct pci_dev *dev, ide_pci_device_t *d)
- {
- 	if (!(PCI_FUNC(dev->devfn) & 1)) {
- 		d->bootable = NEVER_BOARD;
---- 1.27/drivers/ide/pci/sis5513.c	2004-06-15 18:29:40 +02:00
-+++ edited/drivers/ide/pci/sis5513.c	2004-06-16 15:47:18 +02:00
-@@ -726,7 +726,7 @@
- */
- 
- /* Chip detection and general config */
--static unsigned int __init init_chipset_sis5513 (struct pci_dev *dev, const char *name)
-+static unsigned int __devinit init_chipset_sis5513 (struct pci_dev *dev, const char *name)
- {
- 	struct pci_dev *host;
- 	int i = 0;
-@@ -879,7 +879,7 @@
- 	return 0;
- }
- 
--static unsigned int __init ata66_sis5513 (ide_hwif_t *hwif)
-+static unsigned int __devinit ata66_sis5513 (ide_hwif_t *hwif)
- {
- 	u8 ata66 = 0;
- 
-@@ -897,7 +897,7 @@
-         return ata66;
- }
- 
--static void __init init_hwif_sis5513 (ide_hwif_t *hwif)
-+static void __devinit init_hwif_sis5513 (ide_hwif_t *hwif)
- {
- 	hwif->autodma = 0;
- 
---- 1.20/drivers/ide/pci/sl82c105.c	2004-06-15 18:29:40 +02:00
-+++ edited/drivers/ide/pci/sl82c105.c	2004-06-16 15:47:12 +02:00
-@@ -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;
---- 1.22/drivers/ide/pci/slc90e66.c	2004-06-15 18:29:40 +02:00
-+++ edited/drivers/ide/pci/slc90e66.c	2004-06-16 15:47:02 +02:00
-@@ -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 */
---- 1.9/drivers/ide/pci/triflex.c	2004-06-15 18:29:40 +02:00
-+++ edited/drivers/ide/pci/triflex.c	2004-06-16 15:46:54 +02:00
-@@ -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;
---- 1.23/drivers/ide/pci/via82cxxx.c	2004-06-15 18:29:40 +02:00
-+++ edited/drivers/ide/pci/via82cxxx.c	2004-06-16 15:46:29 +02:00
-@@ -418,7 +418,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;
-@@ -579,7 +579,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;
- 

Copied: trunk/kernel/source/kernel-source-2.6.11-2.6.11/debian/patches/drivers-ide-__devinit.patch (from rev 2762, trunk/kernel/source/kernel-source-2.6.11-2.6.11/debian/patches/drivers-ide-__devinit.dpatch)

Deleted: trunk/kernel/source/kernel-source-2.6.11-2.6.11/debian/patches/drivers-ide-dma-blacklist-toshiba.dpatch
===================================================================
--- trunk/kernel/source/kernel-source-2.6.11-2.6.11/debian/patches/drivers-ide-dma-blacklist-toshiba.dpatch	2005-03-21 09:35:04 UTC (rev 2762)
+++ trunk/kernel/source/kernel-source-2.6.11-2.6.11/debian/patches/drivers-ide-dma-blacklist-toshiba.dpatch	2005-03-21 09:38:36 UTC (rev 2763)
@@ -1,21 +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: blacklist "TOSHIBA CD-ROM XM-1702BC" in drivers/ide/ide-dma.c
-## DP: Patch author: unknown
-## DP: Upstream status: not submitted
-
-. $(dirname $0)/DPATCH
-
- at DPATCH@
---- kernel-source-2.6.6/drivers/ide/ide-dma.c	2004-04-05 19:49:28.000000000 +1000
-+++ kernel-source-2.6.6-1/drivers/ide/ide-dma.c	2004-04-05 20:54:34.000000000 +1000
-@@ -125,6 +125,7 @@
- 	{ "HITACHI CDR-8335"	,	"ALL"		},
- 	{ "HITACHI CDR-8435"	,	"ALL"		},
- 	{ "Toshiba CD-ROM XM-6202B"	,	"ALL"		},
-+	{ "TOSHIBA CD-ROM XM-1702BC"	,	"ALL"		},
- 	{ "CD-532E-A"		,	"ALL"		},
- 	{ "E-IDE CD-ROM CR-840",	"ALL"		},
- 	{ "CD-ROM Drive/F5A",	"ALL"		},

Copied: trunk/kernel/source/kernel-source-2.6.11-2.6.11/debian/patches/drivers-ide-dma-blacklist-toshiba.patch (from rev 2762, trunk/kernel/source/kernel-source-2.6.11-2.6.11/debian/patches/drivers-ide-dma-blacklist-toshiba.dpatch)

Deleted: trunk/kernel/source/kernel-source-2.6.11-2.6.11/debian/patches/drivers-input-serio-8042-resume.dpatch
===================================================================
--- trunk/kernel/source/kernel-source-2.6.11-2.6.11/debian/patches/drivers-input-serio-8042-resume.dpatch	2005-03-21 09:35:04 UTC (rev 2762)
+++ trunk/kernel/source/kernel-source-2.6.11-2.6.11/debian/patches/drivers-input-serio-8042-resume.dpatch	2005-03-21 09:38:36 UTC (rev 2763)
@@ -1,101 +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: Fix suspend problem with i8042
-## DP: Patch author: Vojtech Pavlik <vojtech at suse.cz>
-## DP: Upstream status: Pending inclusion
-## DP: Patch source: Vojtech Pavlik <vojtech at suse.cz> via Debian Bug #280075
-
-. $(dirname $0)/DPATCH
-
- at DPATCH@
-#ChangeSet at 1.2016, 2005-03-10 20:36:51+01:00, vojtech at suse.cz
-#  input: Only write the CTR in i8042 resume function. Reading it is
-#         wrong, since it may (will) contain nonsensical data.
-#  
-#  Signed-off-by: Vojtech Pavlik <vojtech at suse.cz>
-#
-#
-# i8042.c |   48 ++++++++++++++++++++++++++++--------------------
-# 1 files changed, 28 insertions(+), 20 deletions(-)
-#
-#
-diff -Nru a/drivers/input/serio/i8042.c b/drivers/input/serio/i8042.c
---- a/drivers/input/serio/i8042.c	2005-03-10 20:37:22 +01:00
-+++ b/drivers/input/serio/i8042.c	2005-03-10 20:37:22 +01:00
-@@ -698,6 +698,26 @@
- 	i8042_interrupt(0, NULL, NULL);
- }
- 
-+static int i8042_ctl_test(void)
-+{
-+	unsigned char param;
-+
-+	if (!i8042_reset)
-+		return 0;
-+
-+	if (i8042_command(&param, I8042_CMD_CTL_TEST)) {
-+		printk(KERN_ERR "i8042.c: i8042 controller self test timeout.\n");
-+		return -1;
-+	}
-+
-+	if (param != I8042_RET_CTL_TEST) {
-+		printk(KERN_ERR "i8042.c: i8042 controller selftest failed. (%#x != %#x)\n",
-+			 param, I8042_RET_CTL_TEST);
-+		return -1;
-+	}
-+
-+	return 0;
-+}
- 
- /*
-  * i8042_controller init initializes the i8042 controller, and,
-@@ -719,21 +739,8 @@
- 		return -1;
- 	}
- 
--	if (i8042_reset) {
--
--		unsigned char param;
--
--		if (i8042_command(&param, I8042_CMD_CTL_TEST)) {
--			printk(KERN_ERR "i8042.c: i8042 controller self test timeout.\n");
--			return -1;
--		}
--
--		if (param != I8042_RET_CTL_TEST) {
--			printk(KERN_ERR "i8042.c: i8042 controller selftest failed. (%#x != %#x)\n",
--				 param, I8042_RET_CTL_TEST);
--			return -1;
--		}
--	}
-+	if (i8042_ctl_test())
-+		return -1;
- 
- /*
-  * Save the CTR for restoral on unload / reboot.
-@@ -808,9 +815,7 @@
-  * Reset the controller if requested.
-  */
- 
--	if (i8042_reset)
--		if (i8042_command(&param, I8042_CMD_CTL_TEST))
--			printk(KERN_ERR "i8042.c: i8042 controller reset timeout.\n");
-+	i8042_ctl_test();
- 
- /*
-  * Disable MUX mode if present.
-@@ -922,8 +927,11 @@
- 	if (level != RESUME_ENABLE)
- 		return 0;
- 
--	if (i8042_controller_init()) {
--		printk(KERN_ERR "i8042: resume failed\n");
-+	if (i8042_ctl_test())
-+		return -1;
-+
-+	if (i8042_command(&i8042_ctr, I8042_CMD_CTL_WCTR)) {
-+		printk(KERN_ERR "i8042: Can't write CTR\n");
- 		return -1;
- 	}

Copied: trunk/kernel/source/kernel-source-2.6.11-2.6.11/debian/patches/drivers-input-serio-8042-resume.patch (from rev 2762, trunk/kernel/source/kernel-source-2.6.11-2.6.11/debian/patches/drivers-input-serio-8042-resume.dpatch)

Deleted: trunk/kernel/source/kernel-source-2.6.11-2.6.11/debian/patches/fbdev-radeon-noaccel.dpatch
===================================================================
--- trunk/kernel/source/kernel-source-2.6.11-2.6.11/debian/patches/fbdev-radeon-noaccel.dpatch	2005-03-21 09:35:04 UTC (rev 2762)
+++ trunk/kernel/source/kernel-source-2.6.11-2.6.11/debian/patches/fbdev-radeon-noaccel.dpatch	2005-03-21 09:38:36 UTC (rev 2763)
@@ -1,29 +0,0 @@
-#! /bin/sh -e
-##
-## All lines beginning with `## DP:' are a description of the patch.
-## DP: Description: The patch below enhances the FBIOGET_FSCREENINFO ioctl.
-## DP: Description: It is used by the lcd_hack tool that Ben H wrote. Before
-## DP: Description: this fix accel is set to 0 and lcd_hack aborts. With it,
-## DP: Description: the tool works again.
-## DP: Patch author: Martin Habets <errandir_news at mph.eclipse.co.uk>
-## DP: Upstream status: approved by benh, no idea about upstream status
-
-. $(dirname $0)/DPATCH
-
- at DPATCH@
---- kernel-source-2.6.11-2.6.11-orig/drivers/video/aty/radeon_base.c	2005-03-02 08:37:54.000000000 +0100
-+++ kernel-source-2.6.11-2.6.11/drivers/video/aty/radeon_base.c	2005-03-05 10:37:19.668812008 +0100
-@@ -1832,8 +1832,12 @@
- 
- 	fb_alloc_cmap(&info->cmap, 256, 0);
- 
--	if (noaccel)
-+	if (noaccel) {
- 		info->flags |= FBINFO_HWACCEL_DISABLED;
-+		info->fix.accel = FB_ACCEL_NONE;
-+	} else {
-+		info->fix.accel = FB_ACCEL_ATI_RADEON;
-+	}
- 
-         return 0;
- }

Copied: trunk/kernel/source/kernel-source-2.6.11-2.6.11/debian/patches/fbdev-radeon-noaccel.patch (from rev 2762, trunk/kernel/source/kernel-source-2.6.11-2.6.11/debian/patches/fbdev-radeon-noaccel.dpatch)

Deleted: trunk/kernel/source/kernel-source-2.6.11-2.6.11/debian/patches/fix-alpha-ext3-oops.dpatch
===================================================================
--- trunk/kernel/source/kernel-source-2.6.11-2.6.11/debian/patches/fix-alpha-ext3-oops.dpatch	2005-03-21 09:35:04 UTC (rev 2762)
+++ trunk/kernel/source/kernel-source-2.6.11-2.6.11/debian/patches/fix-alpha-ext3-oops.dpatch	2005-03-21 09:38:36 UTC (rev 2763)
@@ -1,13 +0,0 @@
---- kernel-source-2.6.11-2.6.11-orig/fs/ext3/super.c	2005-03-02 08:38:38.000000000 +0100
-+++ kernel-source-2.6.11-2.6.11/fs/ext3/super.c	2005-03-05 10:41:47.530090904 +0100
-@@ -2487,6 +2487,10 @@
- static int __init init_ext3_fs(void)
- {
- 	int err = init_ext3_xattr();
-+	/* ugly hack to work around compiler bug */
-+#ifdef __alpha__
-+	printk(KERN_DEBUG "[%d] init_ext3_fs(), err = %d\n", __LINE__, err);
-+#endif
- 	if (err)
- 		return err;
- 	err = init_inodecache();

Copied: trunk/kernel/source/kernel-source-2.6.11-2.6.11/debian/patches/fix-alpha-ext3-oops.patch (from rev 2762, trunk/kernel/source/kernel-source-2.6.11-2.6.11/debian/patches/fix-alpha-ext3-oops.dpatch)

Deleted: trunk/kernel/source/kernel-source-2.6.11-2.6.11/debian/patches/fs-asfs.dpatch
===================================================================
--- trunk/kernel/source/kernel-source-2.6.11-2.6.11/debian/patches/fs-asfs.dpatch	2005-03-21 09:35:04 UTC (rev 2762)
+++ trunk/kernel/source/kernel-source-2.6.11-2.6.11/debian/patches/fs-asfs.dpatch	2005-03-21 09:38:36 UTC (rev 2763)
@@ -1,5026 +0,0 @@
-#! /bin/sh -e 
-## fs-asfs.dpatch by Sven Luther <luther at debian.org>
-##
-## All lines beginning with `## DP:' are a description of the patch.
-## DP: Description: add support for the Amiga SmartFilesystem (asfs), 1.0beta7
-## DP: Patch author: Marek Szyprowski <marek at amiga.pl>
-## DP: Upstream status: submitted but no reply
-## DP: Reference: http://home.elka.pw.edu.pl/~mszyprow/programy/asfs/
-
-. $(dirname $0)/DPATCH
-
- at DPATCH@
-diff -urN kernel-source-2.6.11-2.6.11-orig/Documentation/filesystems/00-INDEX kernel-source-2.6.11-2.6.11/Documentation/filesystems/00-INDEX
---- kernel-source-2.6.11-2.6.11-orig/Documentation/filesystems/00-INDEX	2005-03-02 08:38:33.000000000 +0100
-+++ kernel-source-2.6.11-2.6.11/Documentation/filesystems/00-INDEX	2005-03-04 18:37:12.317334816 +0100
-@@ -6,6 +6,8 @@
- 	- info and mount options for the Acorn Advanced Disc Filing System.
- affs.txt
- 	- info and mount options for the Amiga Fast File System.
-+asfs.txt
-+	- info and mount options for the Amiga Smart File System.
- bfs.txt
- 	- info for the SCO UnixWare Boot Filesystem (BFS).
- cifs.txt
-diff -urN kernel-source-2.6.11-2.6.11-orig/Documentation/filesystems/asfs.txt kernel-source-2.6.11-2.6.11/Documentation/filesystems/asfs.txt
---- kernel-source-2.6.11-2.6.11-orig/Documentation/filesystems/asfs.txt	1970-01-01 01:00:00.000000000 +0100
-+++ kernel-source-2.6.11-2.6.11/Documentation/filesystems/asfs.txt	2005-03-04 18:37:12.382324936 +0100
-@@ -0,0 +1,150 @@
-+
-+Amiga SmartFileSystem, Linux implementation
-+===========================================
-+
-+ASFS is a Amiga Smart FileSystem driver for Linux. It supports reading
-+files and directories. From version 1.0 there is also an experimental 
-+(almost full) write support. Experimental means that it hasn't been 
-+tested enough yet, so use it with care. Symbolic links (in AmigaOS
-+called soft links) are also supported read/write. Read notes below 
-+about symlinks support.
-+
-+
-+Unsupported features of Amiga SFS
-+================================
-+
-+ASFS currently does not support safe-delete feature of Amiga SFS 
-+filesystem. It simply deletes files instead of moving them to 
-+".recycled" directory. It also doesn't remove files from ".recycled" 
-+directory, when there is no space left on drive. 
-+
-+If there is no space left, you need to manually remove files from 
-+".recycled" directory. Also if you want to delete a file in a safe 
-+way, you need to move it to ".recycled" directory by hand.
-+
-+Because of all of above, the amount of free space on disk does not 
-+include space used by all files from ".recycled" directory.
-+
-+
-+Limitations
-+===========
-+
-+There is no Amiga protection bits into Linux permission bits tranlation
-+and vice versa. If you need this feature, mail me.
-+
-+ASFS will always keep some amount of blocks free. This means that you 
-+cannot fill the drive completely. It is because Amiga SFS uses some 
-+special methods of writing data (called safe write), which needs some
-+additional free space.
-+
-+File systems with unfinished transactions (this happens when system crashed
-+during writing data to disk on AmigaOS/MorphOS) will be mounted read-only
-+to protect data. The only way to fix such filesystem is to mount it under
-+AmigaOS or MorphOS.
-+
-+Do not try to mount and write to filesystem with errors. Bad things will
-+happen.
-+
-+
-+Mount options for the ASFS
-+==========================
-+
-+setuid=uid	
-+		This sets the owner of all files and directories in the file
-+		system to uid.
-+
-+setgid=gid	
-+		Same as above, but for gid.
-+
-+mode=mode	
-+		Sets the mode flags to the given (octal) value. Directories 
-+		will get an x permission if the corresponding r bit is set.
-+		The default mode is 0644, which means that everybody are allowed 
-+		to read files, but only root can write to them.
-+		(for directories this means also that search bits are set).
-+
-+prefix=path	
-+		Path will be prefixed to every absolute path name of symbolic 
-+		links on an ASFS/AFFS partition. Default = "/". (See below.)
-+
-+volume=name
-+		When symbolic links with an absolute path are created
-+		on an ASFS/AFFS partition, name will be prepended as the
-+		volume name. Default = "" (empty string). (See below.)
-+
-+lowercasevol
-+		Translate all volume names in symlinks to lower case.
-+		Disabled by default. (See below.)
-+
-+Symbolic links
-+==============
-+
-+Although the Amiga and Linux file systems resemble each other, there
-+are some, not always subtle, differences. One of them becomes apparent
-+with symbolic links. While Linux has a file system with exactly one
-+root directory, the Amiga has a separate root directory for each
-+file system (for example, partition, floppy disk, ...). With the Amiga,
-+these entities are called "volumes". They have symbolic names which
-+can be used to access them. Thus, symbolic links can point to a
-+different volume. ASFS turns the volume name into a directory name
-+and prepends the prefix path (see prefix option) to it. When option
-+"lowercasevol" is set, it also translates volume names to lower case.
-+If the volume name is the same as a name given in "volume" option,
-+it will be ignored and an absolute path will be created.
-+
-+Example:
-+You mount all your Amiga partitions under /amiga/<volume> (where
-+<volume> is the name of the volume), and you give options
-+`prefix="/amiga/",volume="Linux",lowercasevol' when mounting all your 
-+ASFS partitions. (They might be "User", "WB" and "Graphics", the mount 
-+points /amiga/user, /amiga/wb and /amiga/graphics). 
-+
-+A symbolic link referring to "USER:sc/include/dos/dos.h" will be 
-+translated to "/amiga/user/sc/include/dos/dos.h".
-+A symbolic link referring to "Linux:etc/fstab" will be translated to
-+"/etc/fstab".
-+If you create a symlink referring to "/amiga/graphics/data/pict.jpg",
-+it will be saved as "graphics:data/pict.jpg".
-+If you create a symlink referring to "/boot/System.map", it will be 
-+saved as "Linux:boot/System.map".
-+
-+
-+Other information
-+=================
-+
-+Supported block sizes are: 512, 1024, 2048 and 4096 bytes. Larger blocks
-+speed up almost everything at the expense of wasted disk space. The speed
-+gain above 4K seems not really worth the price, so you don't lose too
-+much here, either.
-+
-+This file system has been tested on Motorola PPC and 68k, as well as 
-+Intel x86 systems. I don't know, if it works on other Linux systems.
-+
-+This filesystem is in BETA STAGE. This means that driver MIGHT corrupt
-+or damage data on your disk. Remember! YOU USE IT ON YOUR OWN RISK! 
-+
-+I made almost all I could to minimalize this risk. On my systems several 
-+gigabytes has been succesfully copied from and to SFS disks. I would also 
-+appreciate any infomation if this filesystem works on your system or not. 
-+See next paragraph for my email.
-+
-+Some parts of this documentation has been adapted from AFFS driver docs.
-+
-+
-+Author, contact and copyright infos
-+===================================
-+
-+ASFS has been written by Marek 'March' Szyprowski <marek at amiga.pl>.
-+Mail me if you have any suggestions or found a bug.
-+
-+Copyright (C) 2003,2004  Marek 'March' Szyprowski <marek at amiga.pl>
-+
-+Thanks to Marcin Kurek (Morgoth/Dreamolers-CAPS) for help and parts 
-+of original amiga version of SmartFilesystem source code. 
-+
-+SmartFilesystem is copyrighted (C) 2003,2004 by: John Hendrikx, 
-+Ralph Schmidt, Emmanuel Lesueur, David Gerber and Marcin Kurek
-+
-+The ASFS driver is realased under the terms of of the GNU General 
-+Public License. See source code for more details.
-+
-diff -urN kernel-source-2.6.11-2.6.11-orig/fs/asfs/adminspace.c kernel-source-2.6.11-2.6.11/fs/asfs/adminspace.c
---- kernel-source-2.6.11-2.6.11-orig/fs/asfs/adminspace.c	1970-01-01 01:00:00.000000000 +0100
-+++ kernel-source-2.6.11-2.6.11/fs/asfs/adminspace.c	2005-03-04 18:37:12.447315056 +0100
-@@ -0,0 +1,446 @@
-+/*
-+ *
-+ * Amiga Smart File System, Linux implementation
-+ * version: 1.0beta7
-+ *
-+ * This file contains some parts of the original amiga version of 
-+ * SmartFilesystem source code.
-+ *
-+ * SmartFilesystem is copyrighted (C) 2003 by: John Hendrikx, 
-+ * Ralph Schmidt, Emmanuel Lesueur, David Gerber, and Marcin Kurek
-+ * 
-+ * Adapted and modified by Marek 'March' Szyprowski <marek at amiga.pl>
-+ *
-+ */
-+
-+#include <linux/types.h>
-+#include <linux/errno.h>
-+#include <linux/slab.h>
-+#include <linux/fs.h>
-+#include <linux/buffer_head.h>
-+#include <linux/vfs.h>
-+#include "asfs_fs.h"
-+#include "bitfuncs.h"
-+
-+#include <asm/byteorder.h>
-+
-+#ifdef CONFIG_ASFS_RW
-+
-+static int setfreeblocks(struct super_block *sb, u32 freeblocks)
-+{
-+	struct buffer_head *bh;
-+	if ((bh = asfs_breadcheck(sb, ASFS_SB(sb)->rootobjectcontainer, ASFS_OBJECTCONTAINER_ID))) {
-+		struct fsRootInfo *ri = (struct fsRootInfo *) ((u8 *) bh->b_data + sb->s_blocksize - sizeof(struct fsRootInfo));
-+		ASFS_SB(sb)->freeblocks = freeblocks;
-+		ri->freeblocks = cpu_to_be32(freeblocks);
-+		asfs_bstore(sb, bh);
-+		asfs_brelse(bh);
-+		return 0;
-+	}
-+	return -EIO;
-+}
-+
-+static inline int enoughspace(struct super_block *sb, u32 blocks)
-+{
-+	if (ASFS_SB(sb)->freeblocks - ASFS_ALWAYSFREE < blocks)
-+		return FALSE;
-+
-+	return TRUE;
-+}
-+
-+	/* Determines the amount of free blocks starting from block /block/.
-+	   If there are no blocks found or if there was an error -1 is returned,
-+	   otherwise this function will count the number of free blocks until
-+	   an allocated block is encountered or until maxneeded has been
-+	   exceeded. */
-+
-+static int availablespace(struct super_block *sb, u32 block, u32 maxneeded)
-+{
-+	struct buffer_head *bh = NULL;
-+	struct fsBitmap *b;
-+	u32 longs = ASFS_SB(sb)->blocks_inbitmap >> 5;
-+	u32 maxbitmapblock = ASFS_SB(sb)->bitmapbase + ASFS_SB(sb)->blocks_bitmap;
-+	int blocksfound = 0;
-+	u32 bitstart;
-+	int bitend;
-+	u32 nextblock = ASFS_SB(sb)->bitmapbase + block / ASFS_SB(sb)->blocks_inbitmap;
-+
-+	bitstart = block % ASFS_SB(sb)->blocks_inbitmap;
-+
-+	while (nextblock < maxbitmapblock && (bh = asfs_breadcheck(sb, nextblock++, ASFS_BITMAP_ID))) {
-+		b = (void *) bh->b_data;
-+
-+		if ((bitend = bmffz(b->bitmap, longs, bitstart)) >= 0) {
-+			blocksfound += bitend - bitstart;
-+			asfs_brelse(bh);
-+			return blocksfound;
-+		}
-+		blocksfound += ASFS_SB(sb)->blocks_inbitmap - bitstart;
-+		if (blocksfound >= maxneeded) {
-+			asfs_brelse(bh);
-+			return blocksfound;
-+		}
-+		bitstart = 0;
-+		asfs_brelse(bh);
-+	}
-+
-+	if (bh == NULL)
-+		return (-1);
-+
-+	return (blocksfound);
-+}
-+
-+int asfs_findspace(struct super_block *sb, u32 maxneeded, u32 start, u32 end, u32 * returned_block, u32 * returned_blocks)
-+{
-+	struct buffer_head *bh;
-+	u32 longs = ASFS_SB(sb)->blocks_inbitmap >> 5;
-+	u32 space = 0;
-+	u32 block;
-+	u32 bitmapblock = ASFS_SB(sb)->bitmapbase + start / ASFS_SB(sb)->blocks_inbitmap;
-+	u32 breakpoint;
-+	int bitstart, bitend;
-+	int reads;
-+
-+	if (enoughspace(sb, maxneeded) == FALSE) {
-+		*returned_block = 0;
-+		*returned_blocks = 0;
-+		return -ENOSPC;
-+	}
-+
-+	if (start >= ASFS_SB(sb)->totalblocks)
-+		start -= ASFS_SB(sb)->totalblocks;
-+
-+	if (end == 0)
-+		end = ASFS_SB(sb)->totalblocks;
-+
-+	reads = ((end - 1) / ASFS_SB(sb)->blocks_inbitmap) + 1 - start / ASFS_SB(sb)->blocks_inbitmap;
-+
-+	if (start >= end)
-+		reads += (ASFS_SB(sb)->totalblocks - 1) / ASFS_SB(sb)->blocks_inbitmap + 1;
-+
-+	breakpoint = (start < end ? end : ASFS_SB(sb)->totalblocks);
-+
-+	*returned_block = 0;
-+	*returned_blocks = 0;
-+
-+	bitend = start % ASFS_SB(sb)->blocks_inbitmap;
-+	block = start - bitend;
-+
-+	while ((bh = asfs_breadcheck(sb, bitmapblock++, ASFS_BITMAP_ID))) {
-+		struct fsBitmap *b = (void *) bh->b_data;
-+		u32 localbreakpoint = breakpoint - block;
-+
-+		if (localbreakpoint > ASFS_SB(sb)->blocks_inbitmap)
-+			localbreakpoint = ASFS_SB(sb)->blocks_inbitmap;
-+
-+		/* At this point space contains the amount of free blocks at
-+		   the end of the previous bitmap block.  If there are no
-+		   free blocks at the start of this bitmap block, space will
-+		   be set to zero, since in that case the space isn't adjacent. */
-+
-+		while ((bitstart = bmffo(b->bitmap, longs, bitend)) < ASFS_SB(sb)->blocks_inbitmap) {
-+			/* found the start of an empty space, now find out how large it is */
-+
-+			if (bitstart >= localbreakpoint)
-+				break;
-+
-+			if (bitstart != 0)
-+				space = 0;
-+
-+			bitend = bmffz(b->bitmap, longs, bitstart);
-+
-+			if (bitend > localbreakpoint)
-+				bitend = localbreakpoint;
-+
-+			space += bitend - bitstart;
-+
-+			if (*returned_blocks < space) {
-+				*returned_block = block + bitend - space;
-+				if (space >= maxneeded) {
-+					*returned_blocks = maxneeded;
-+					asfs_brelse(bh);
-+					return 0;
-+				}
-+				*returned_blocks = space;
-+			}
-+
-+			if (bitend >= localbreakpoint)
-+				break;
-+		}
-+
-+		if (--reads == 0)
-+			break;
-+
-+		/* no (more) empty spaces found in this block */
-+
-+		if (bitend != ASFS_SB(sb)->blocks_inbitmap)
-+			space = 0;
-+
-+		bitend = 0;
-+		block += ASFS_SB(sb)->blocks_inbitmap;
-+
-+		if (block >= ASFS_SB(sb)->totalblocks) {
-+			block = 0;
-+			space = 0;
-+			breakpoint = end;
-+			bitmapblock = ASFS_SB(sb)->bitmapbase;
-+		}
-+		asfs_brelse(bh);
-+	}
-+
-+	if (bh == NULL)
-+		return -EIO;
-+
-+	asfs_brelse(bh);
-+
-+	if (*returned_blocks == 0)
-+		return -ENOSPC;
-+	else
-+		return 0;
-+}
-+
-+int asfs_markspace(struct super_block *sb, u32 block, u32 blocks)
-+{
-+	int errorcode;
-+
-+	asfs_debug("markspace: Marking %d blocks from block %d\n", blocks, block);
-+
-+	if ((availablespace(sb, block, blocks)) < blocks) {
-+		printk("ASFS: Attempted to mark %d blocks from block %d, but some of them were already full!\n", blocks, block);
-+		return -EIO;
-+	}
-+
-+	if ((errorcode = setfreeblocks(sb, ASFS_SB(sb)->freeblocks - blocks)) == 0) {
-+		struct buffer_head *bh;
-+		u32 skipblocks = block / ASFS_SB(sb)->blocks_inbitmap;
-+		u32 longs = (sb->s_blocksize - sizeof(struct fsBitmap)) >> 2;
-+		u32 bitmapblock;
-+
-+		block -= skipblocks * ASFS_SB(sb)->blocks_inbitmap;
-+		bitmapblock = ASFS_SB(sb)->bitmapbase + skipblocks;
-+
-+		while (blocks > 0) {
-+			if ((bh = asfs_breadcheck(sb, bitmapblock++, ASFS_BITMAP_ID))) {
-+				struct fsBitmap *b = (void *) bh->b_data;
-+
-+				blocks -= bmclr(b->bitmap, longs, block, blocks);
-+				block = 0;
-+
-+				asfs_bstore(sb, bh);
-+				asfs_brelse(bh);
-+			} else
-+				return -EIO;
-+		}
-+	}
-+
-+	return (errorcode);
-+}
-+
-+	/* This function checks the bitmap and tries to locate at least /blocksneeded/
-+	   adjacent unused blocks.  If found it sets returned_block to the start block
-+	   and returns no error.  If not found, ERROR_DISK_IS_FULL is returned and
-+	   returned_block is set to zero.  Any other errors are returned as well. */
-+
-+static inline int internalfindspace(struct super_block *sb, u32 blocksneeded, u32 startblock, u32 endblock, u32 * returned_block)
-+{
-+	u32 blocks;
-+	int errorcode;
-+
-+	if ((errorcode = asfs_findspace(sb, blocksneeded, startblock, endblock, returned_block, &blocks)) == 0)
-+		if (blocks != blocksneeded)
-+			return -ENOSPC;
-+
-+	return errorcode;
-+}
-+
-+static int findandmarkspace(struct super_block *sb, u32 blocksneeded, u32 * returned_block)
-+{
-+	int errorcode;
-+
-+	if (enoughspace(sb, blocksneeded) != FALSE) {
-+		if ((errorcode = internalfindspace(sb, blocksneeded, 0, ASFS_SB(sb)->totalblocks, returned_block)) == 0)
-+			errorcode = asfs_markspace(sb, *returned_block, blocksneeded);
-+	} else
-+		errorcode = -ENOSPC;
-+
-+	return (errorcode);
-+}
-+
-+/* ************************** */
-+
-+int asfs_freespace(struct super_block *sb, u32 block, u32 blocks)
-+{
-+	int errorcode;
-+
-+	asfs_debug("freespace: Freeing %d blocks from block %d\n", blocks, block);
-+
-+	if ((errorcode = setfreeblocks(sb, ASFS_SB(sb)->freeblocks + blocks)) == 0) {
-+		struct buffer_head *bh;
-+		u32 skipblocks = block / ASFS_SB(sb)->blocks_inbitmap;
-+		u32 longs = (sb->s_blocksize - sizeof(struct fsBitmap)) >> 2;
-+		u32 bitmapblock;
-+
-+		block -= skipblocks * ASFS_SB(sb)->blocks_inbitmap;
-+		bitmapblock = ASFS_SB(sb)->bitmapbase + skipblocks;
-+
-+		while (blocks > 0) {
-+			if ((bh = asfs_breadcheck(sb, bitmapblock++, ASFS_BITMAP_ID))) {
-+				struct fsBitmap *b = (void *) bh->b_data;
-+
-+				blocks -= bmset(b->bitmap, longs, block, blocks);
-+				block = 0;
-+
-+				asfs_bstore(sb, bh);
-+				asfs_brelse(bh);
-+			} else
-+				return -EIO;
-+		}
-+	}
-+
-+	return (errorcode);
-+}
-+
-+/*************** admin space containers ****************/
-+
-+int asfs_allocadminspace(struct super_block *sb, u32 *returned_block)
-+{
-+	struct buffer_head *bh;
-+	u32 adminspaceblock = ASFS_SB(sb)->adminspacecontainer;
-+	int errorcode = -EIO;
-+
-+	asfs_debug("allocadminspace: allocating new block\n");
-+
-+	while ((bh = asfs_breadcheck(sb, adminspaceblock, ASFS_ADMINSPACECONTAINER_ID))) {
-+		struct fsAdminSpaceContainer *asc1 = (void *) bh->b_data;
-+		struct fsAdminSpace *as1 = asc1->adminspace;
-+		int adminspaces1 = (sb->s_blocksize - sizeof(struct fsAdminSpaceContainer)) / sizeof(struct fsAdminSpace);
-+
-+		while (adminspaces1-- > 0) {
-+			s16 bitoffset;
-+
-+			if (as1->space != 0 && (bitoffset = bfffz(be32_to_cpu(as1->bits), 0)) >= 0) {
-+				u32 emptyadminblock = be32_to_cpu(as1->space) + bitoffset;
-+				as1->bits |= cpu_to_be32(1 << (31 - bitoffset));
-+				asfs_bstore(sb, bh);
-+				*returned_block = emptyadminblock;
-+				asfs_brelse(bh);
-+				asfs_debug("allocadminspace: found block %d\n", *returned_block);
-+				return 0;
-+			}
-+			as1++;
-+		}
-+
-+		adminspaceblock = be32_to_cpu(asc1->next);
-+		asfs_brelse(bh);
-+
-+		if (adminspaceblock == 0) {
-+			u32 startblock;
-+
-+			asfs_debug("allocadminspace: allocating new adminspace area\n");
-+
-+			/* If we get here it means current adminspace areas are all filled.
-+			   We would now need to find a new area and create a fsAdminSpace
-+			   structure in one of the AdminSpaceContainer blocks.  If these
-+			   don't have any room left for new adminspace areas a new
-+			   AdminSpaceContainer would have to be created first which is
-+			   placed as the first block in the newly found admin area. */
-+
-+			adminspaceblock = ASFS_SB(sb)->adminspacecontainer;
-+
-+			if ((errorcode = findandmarkspace(sb, 32, &startblock)))
-+				return errorcode;
-+
-+			while ((bh = asfs_breadcheck(sb, adminspaceblock, ASFS_ADMINSPACECONTAINER_ID))) {
-+				struct fsAdminSpaceContainer *asc2 = (void *) bh->b_data;
-+				struct fsAdminSpace *as2 = asc2->adminspace;
-+				int adminspaces2 = (sb->s_blocksize - sizeof(struct fsAdminSpaceContainer)) / sizeof(struct fsAdminSpace);
-+
-+				while (adminspaces2-- > 0 && as2->space != 0)
-+					as2++;
-+
-+				if (adminspaces2 >= 0) {	/* Found a unused AdminSpace in this AdminSpaceContainer! */
-+					as2->space = cpu_to_be32(startblock);
-+					as2->bits = 0;
-+					asfs_bstore(sb, bh);
-+					asfs_brelse(bh);
-+					break;
-+				}
-+
-+				if (asc2->next == 0) {
-+					/* Oh-oh... we marked our new adminspace area in use, but we couldn't
-+					   find space to store a fsAdminSpace structure in the existing
-+					   fsAdminSpaceContainer blocks.  This means we need to create and
-+					   link a new fsAdminSpaceContainer as the first block in our newly
-+					   marked adminspace. */
-+
-+					asc2->next = cpu_to_be32(startblock);
-+					asfs_bstore(sb, bh);
-+					asfs_brelse(bh);
-+
-+					/* Now preparing new AdminSpaceContainer */
-+
-+					if ((bh = asfs_getzeroblk(sb, startblock)) == NULL)
-+						return -EIO;
-+
-+					asc2 = (void *) bh->b_data;
-+					asc2->bheader.id = cpu_to_be32(ASFS_ADMINSPACECONTAINER_ID);
-+					asc2->bheader.ownblock = cpu_to_be32(startblock);
-+					asc2->previous = cpu_to_be32(adminspaceblock);
-+					asc2->adminspace[0].space = cpu_to_be32(startblock);
-+					asc2->adminspace[0].bits = cpu_to_be32(0x80000000);
-+					asc2->bits = 32;
-+
-+					asfs_bstore(sb, bh);
-+					asfs_brelse(bh);
-+
-+					adminspaceblock = startblock;
-+					break;	/* Breaks through to outer loop! */
-+				}
-+				adminspaceblock = be32_to_cpu(asc2->next);
-+				asfs_brelse(bh);
-+			}
-+		}
-+	}
-+	return errorcode;
-+}
-+
-+int asfs_freeadminspace(struct super_block *sb, u32 block)
-+{
-+	struct buffer_head *bh;
-+	u32 adminspaceblock = ASFS_SB(sb)->adminspacecontainer;
-+
-+	asfs_debug("freeadminspace: Entry -- freeing block %d\n", block);
-+
-+	while ((bh = asfs_breadcheck(sb, adminspaceblock, ASFS_ADMINSPACECONTAINER_ID))) {
-+		struct fsAdminSpaceContainer *asc = (void *) bh->b_data;
-+		struct fsAdminSpace *as = asc->adminspace;
-+		int adminspaces = (sb->s_blocksize - sizeof(struct fsAdminSpaceContainer)) / sizeof(struct fsAdminSpace);
-+
-+		while (adminspaces-- > 0) {
-+			if (block >= be32_to_cpu(as->space) && block < be32_to_cpu(as->space) + 32) {
-+				s16 bitoffset = block - be32_to_cpu(as->space);
-+				asfs_debug("freeadminspace: Block to be freed is located in AdminSpaceContainer block at %d\n", adminspaceblock);
-+				as->bits &= cpu_to_be32(~(1 << (31 - bitoffset)));
-+				asfs_bstore(sb, bh);
-+				asfs_brelse(bh);
-+				return 0;
-+			}
-+			as++;
-+		}
-+
-+		if ((adminspaceblock = be32_to_cpu(asc->next)) == 0)
-+			break;
-+
-+		asfs_brelse(bh);
-+	}
-+
-+	if (bh != NULL) {
-+		asfs_brelse(bh);
-+		printk("ASFS: Unable to free an administration block. The block cannot be found.");
-+		return -ENOENT;
-+	}
-+
-+	return -EIO;
-+}
-+
-+#endif
-diff -urN kernel-source-2.6.11-2.6.11-orig/fs/asfs/asfs_fs.h kernel-source-2.6.11-2.6.11/fs/asfs/asfs_fs.h
---- kernel-source-2.6.11-2.6.11-orig/fs/asfs/asfs_fs.h	1970-01-01 01:00:00.000000000 +0100
-+++ kernel-source-2.6.11-2.6.11/fs/asfs/asfs_fs.h	2005-03-04 18:37:12.512305176 +0100
-@@ -0,0 +1,227 @@
-+#ifndef __LINUX_ASFS_FS_H
-+#define __LINUX_ASFS_FS_H
-+
-+#include <linux/types.h>
-+#include <linux/fs.h>
-+#include <linux/buffer_head.h>
-+#include <asm/byteorder.h>
-+#include <linux/amigasfs.h>
-+
-+#define asfs_debug(fmt,arg...) /* no debug at all */
-+//#define asfs_debug(fmt,arg...) printk(fmt,##arg)  /* general debug infos */
-+
-+#if !defined (__BIG_ENDIAN) && !defined (__LITTLE_ENDIAN)
-+#error Endianes must be known for ASFS to work. Sorry.
-+#endif
-+
-+#define ASFS_DEFAULT_UID 0
-+#define ASFS_DEFAULT_GID 0
-+#define ASFS_DEFAULT_MODE 0644	/* default permission bits for files, dirs have same permission, but with "x" set */
-+
-+/* Extent structure located in RAM (e.g. inside inode structure), 
-+   currently used to store last used extent */
-+
-+struct inramExtent {
-+	u32 startblock;	/* Block from begginig of the file */
-+	u32 key;
-+	u32 next;
-+	u16 blocks;
-+};
-+
-+/* inode in-kernel data */
-+
-+struct asfs_inode_info {
-+	u32 firstblock;
-+	u32 hashtable;
-+	int modified;
-+	loff_t mmu_private;
-+	struct inramExtent ext_cache;
-+	struct inode vfs_inode;
-+};
-+
-+/* short cut to get to the asfs specific inode data */
-+static inline struct asfs_inode_info *ASFS_I(struct inode *inode)
-+{
-+   return list_entry(inode, struct asfs_inode_info, vfs_inode);
-+}
-+
-+/* Amiga SFS superblock in-core data */
-+
-+struct asfs_sb_info {
-+	u32 totalblocks;
-+	u32 rootobjectcontainer;
-+	u32 extentbnoderoot;
-+	u32 objectnoderoot;
-+
-+	u32 adminspacecontainer;
-+	u32 bitmapbase;
-+	u32 freeblocks;
-+	u32 blocks_inbitmap;
-+	u32 blocks_bitmap;
-+	u32 block_rovingblockptr;
-+
-+	uid_t uid;
-+	gid_t gid;
-+	umode_t mode;
-+	u16 flags;
-+	char *prefix;
-+	char *root_volume;		/* Volume prefix for absolute symlinks. */
-+};
-+
-+/* short cut to get to the asfs specific sb data */
-+static inline struct asfs_sb_info *ASFS_SB(struct super_block *sb)
-+{
-+	return sb->s_fs_info;
-+}
-+ 
-+/* io inline code */
-+
-+u32 asfs_calcchecksum(void *block, u32 blocksize);
-+
-+static inline int
-+asfs_check_block(struct fsBlockHeader *block, u32 blocksize, u32 n, u32 id)
-+{
-+	if (asfs_calcchecksum(block, blocksize) ==
-+	    be32_to_cpu(((struct fsBlockHeader *) block)->checksum) &&
-+	    n == be32_to_cpu(((struct fsBlockHeader *) block)->ownblock) &&
-+	    id == be32_to_cpu(((struct fsBlockHeader *) block)->id))
-+		return TRUE;
-+	return FALSE;
-+}
-+
-+/* get fs structure from block and do some checks... */
-+static inline struct buffer_head *
-+asfs_breadcheck(struct super_block *sb, u32 n, u32 type)
-+{
-+	struct buffer_head *bh;
-+	if ((bh = sb_bread(sb, n))) {
-+		if (asfs_check_block ((void *)bh->b_data, sb->s_blocksize, n, type)) {
-+			return bh;	/* all okay */
-+		}
-+		brelse(bh);
-+	}
-+	return NULL;		/* error */
-+}
-+
-+static inline struct buffer_head *
-+asfs_getzeroblk(struct super_block *sb, int block)
-+{
-+	struct buffer_head *bh;
-+	bh = sb_getblk(sb, block);
-+	lock_buffer(bh);
-+	memset(bh->b_data, 0, sb->s_blocksize);
-+	set_buffer_uptodate(bh);
-+	unlock_buffer(bh);
-+	return bh;
-+}
-+
-+static inline void 
-+asfs_bstore(struct super_block *sb, struct buffer_head *bh)
-+{
-+	((struct fsBlockHeader *) (bh->b_data))->checksum =
-+	    cpu_to_be32(asfs_calcchecksum(bh->b_data, sb->s_blocksize));
-+	mark_buffer_dirty(bh);
-+}
-+
-+static inline void asfs_brelse(struct buffer_head *bh)
-+{
-+	brelse(bh);
-+}
-+
-+static inline void dec_count(struct inode *inode)
-+{
-+	inode->i_nlink--;
-+	mark_inode_dirty(inode);
-+}
-+
-+/* all prototypes */
-+
-+/* adminspace.c */
-+int asfs_allocadminspace(struct super_block *sb, u32 * block);
-+int asfs_freeadminspace(struct super_block *sb, u32 block);
-+int asfs_markspace(struct super_block *sb, u32 block, u32 blocks);
-+int asfs_freespace(struct super_block *sb, u32 block, u32 blocks);
-+int asfs_findspace(struct super_block *sb, u32 maxneeded, u32 start, u32 end,
-+	      u32 * returned_block, u32 * returned_blocks);
-+
-+/* dir.c */
-+int asfs_readdir(struct file *filp, void *dirent, filldir_t filldir);
-+struct dentry *asfs_lookup(struct inode *dir, struct dentry *dentry, struct nameidata *nd);
-+
-+/* extents.c */
-+int asfs_getextent(struct super_block *sb, u32 key, struct buffer_head **ret_bh,
-+	      struct fsExtentBNode **ret_ebn);
-+int asfs_deletebnode(struct super_block *sb, struct buffer_head *cb, u32 key);
-+int asfs_deleteextents(struct super_block *sb, u32 key);
-+int asfs_addblocks(struct super_block *sb, u16 blocks, u32 newspace,
-+	      u32 objectnode, u32 * io_lastextentbnode);
-+
-+/* file.c */
-+int asfs_readpage(struct file *file, struct page *page);
-+sector_t asfs_bmap(struct address_space *mapping, sector_t block);
-+int asfs_writepage(struct page *page, struct writeback_control *wbc);
-+int asfs_prepare_write(struct file *file, struct page *page, unsigned from,
-+		       unsigned to);
-+void asfs_truncate(struct inode *inode);
-+int asfs_file_open(struct inode *inode, struct file *filp);
-+int asfs_file_release(struct inode *inode, struct file *filp);
-+
-+/* inode.c */
-+struct inode *asfs_get_root_inode(struct super_block *sb);
-+void asfs_read_locked_inode(struct inode *inode, void *arg);
-+int asfs_create(struct inode *dir, struct dentry *dentry, int mode, struct nameidata *nd);
-+int asfs_mkdir(struct inode *dir, struct dentry *dentry, int mode);
-+int asfs_symlink(struct inode *dir, struct dentry *dentry, const char *symname);
-+int asfs_rmdir(struct inode *dir, struct dentry *dentry);
-+int asfs_unlink(struct inode *dir, struct dentry *dentry);
-+int asfs_rename(struct inode *old_dir, struct dentry *old_dentry,
-+		struct inode *new_dir, struct dentry *new_dentry);
-+int asfs_notify_change(struct dentry *dentry, struct iattr *attr);
-+
-+/* namei */
-+u8 asfs_lowerchar(u8 c);
-+int asfs_namecmp(u8 *s, u8 *ct, int casesensitive);
-+u16 asfs_hash(u8 *name, int casesensitive);
-+
-+/* nodes */
-+int asfs_getnode(struct super_block *sb, u32 nodeno,
-+	    struct buffer_head **ret_bh, struct fsObjectNode **ret_node);
-+int asfs_createnode(struct super_block *sb, struct buffer_head **returned_cb,
-+	       struct fsNode **returned_node, u32 * returned_nodeno);
-+int asfs_deletenode(struct super_block *sb, u32 objectnode);
-+
-+/* objects */
-+struct fsObject *asfs_nextobject(struct fsObject *obj);
-+struct fsObject *asfs_find_obj_by_name(struct super_block *sb,
-+		struct fsObjectContainer *objcont, u8 * name);
-+int asfs_readobject(struct super_block *sb, u32 objectnode,
-+	       struct buffer_head **cb, struct fsObject **returned_object);
-+int asfs_createobject(struct super_block *sb, struct buffer_head **io_cb,
-+		 struct fsObject **io_o, struct fsObject *src_o,
-+		 u8 * objname, int force);
-+int asfs_deleteobject(struct super_block *sb, struct buffer_head *cb,
-+		 struct fsObject *o);
-+int asfs_renameobject(struct super_block *sb, struct buffer_head *cb1,
-+		 struct fsObject *o1, struct buffer_head *cbparent,
-+		 struct fsObject *oparent, u8 * newname);
-+
-+int asfs_addblockstofile(struct super_block *sb, struct buffer_head *objcb,
-+		    struct fsObject *o, u32 blocks, u32 * newspace,
-+		    u32 * addedblocks);
-+int asfs_truncateblocksinfile(struct super_block *sb, struct buffer_head *bh,
-+			 struct fsObject *o, u32 newsize);
-+
-+/* super.c */
-+struct super_block *asfs_read_super(struct super_block *sb, void *data,
-+				    int silent);
-+void asfs_put_super(struct super_block *sb);
-+int asfs_statfs(struct super_block *sb, struct kstatfs *buf);
-+int asfs_remount(struct super_block *sb, int *flags, char *data);
-+struct inode *asfs_alloc_inode(struct super_block *sb);
-+void asfs_destroy_inode(struct inode *inode);
-+
-+/* symlink.c */
-+int asfs_symlink_readpage(struct file *file, struct page *page);
-+int asfs_write_symlink(struct inode *symfile, const char *symname);
-+
-+#endif
-diff -urN kernel-source-2.6.11-2.6.11-orig/fs/asfs/bitfuncs.c kernel-source-2.6.11-2.6.11/fs/asfs/bitfuncs.c
---- kernel-source-2.6.11-2.6.11-orig/fs/asfs/bitfuncs.c	1970-01-01 01:00:00.000000000 +0100
-+++ kernel-source-2.6.11-2.6.11/fs/asfs/bitfuncs.c	2005-03-04 18:37:12.514304872 +0100
-@@ -0,0 +1,171 @@
-+/*
-+ *
-+ * 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.
-+ *
-+ */
-+
-+#include <linux/types.h>
-+#include <asm/byteorder.h>
-+#include "bitfuncs.h"
-+
-+/* Bitmap (bm) functions:
-+   These functions perform bit-operations on regions of memory which
-+   are a multiple of 4 bytes in length. Bitmap is in bigendian byte order.
-+*/
-+
-+/* This function finds the first set bit in a region of memory starting
-+   with /bitoffset/.  The region of memory is /longs/ longs long.  It
-+   returns the bitoffset of the first set bit it finds. */
-+
-+int bmffo(u32 *bitmap, int longs, int bitoffset)
-+{
-+	u32 *scan = bitmap;
-+	int longoffset, bit;
-+
-+	longoffset = bitoffset >> 5;
-+	longs -= longoffset;
-+	scan += longoffset;
-+
-+	bitoffset = bitoffset & 0x1F;
-+
-+	if (bitoffset != 0) {
-+		if ((bit = bfffo(be32_to_cpu(*scan), bitoffset)) >= 0) {
-+			return (bit + ((scan - bitmap) << 5));
-+		}
-+		scan++;
-+		longs--;
-+	}
-+
-+	while (longs-- > 0) {
-+		if (*scan++ != 0) {
-+			return (bfffo(be32_to_cpu(*--scan), 0) + ((scan - bitmap) << 5));
-+		}
-+	}
-+
-+	return (-1);
-+}
-+
-+/* This function finds the first unset bit in a region of memory starting
-+   with /bitoffset/.  The region of memory is /longs/ longs long.  It
-+   returns the bitoffset of the first unset bit it finds. */
-+
-+int bmffz(u32 *bitmap, int longs, int bitoffset)
-+{
-+	u32 *scan = bitmap;
-+	int longoffset, bit;
-+
-+	longoffset = bitoffset >> 5;
-+	longs -= longoffset;
-+	scan += longoffset;
-+
-+	bitoffset = bitoffset & 0x1F;
-+
-+	if (bitoffset != 0) {
-+		if ((bit = bfffz(be32_to_cpu(*scan), bitoffset)) >= 0) {
-+			return (bit + ((scan - bitmap) << 5));
-+		}
-+		scan++;
-+		longs--;
-+	}
-+
-+	while (longs-- > 0) {
-+		if (*scan++ != 0xFFFFFFFF) {
-+			return (bfffz(be32_to_cpu(*--scan), 0) + ((scan - bitmap) << 5));
-+		}
-+	}
-+
-+	return (-1);
-+}
-+
-+/* This function clears /bits/ bits in a region of memory starting
-+   with /bitoffset/.  The region of memory is /longs/ longs long.  If
-+   the region of memory is too small to clear /bits/ bits then this
-+   function exits after having cleared all bits till the end of the
-+   memory region.  In any case it returns the number of bits which
-+   were actually cleared. */
-+
-+int bmclr(u32 *bitmap, int longs, int bitoffset, int bits)
-+{
-+	u32 *scan = bitmap;
-+	int longoffset;
-+	int orgbits = bits;
-+
-+	longoffset = bitoffset >> 5;
-+	longs -= longoffset;
-+	scan += longoffset;
-+
-+	bitoffset = bitoffset & 0x1F;
-+
-+	if (bitoffset != 0) {
-+		if (bits < 32) {
-+			*scan = cpu_to_be32(bfclr(be32_to_cpu(*scan), bitoffset, bits));
-+		} else {
-+			*scan = cpu_to_be32(bfclr(be32_to_cpu(*scan), bitoffset, 32));
-+		}
-+		scan++;
-+		longs--;
-+		bits -= 32 - bitoffset;
-+	}
-+
-+	while (bits > 0 && longs-- > 0) {
-+		if (bits > 31) {
-+			*scan++ = 0;
-+		} else {
-+			*scan = cpu_to_be32(bfclr(be32_to_cpu(*scan), 0, bits));
-+		}
-+		bits -= 32;
-+	}
-+
-+	if (bits <= 0) {
-+		return (orgbits);
-+	}
-+	return (orgbits - bits);
-+}
-+
-+/* This function sets /bits/ bits in a region of memory starting
-+   with /bitoffset/.  The region of memory is /longs/ longs long.  If
-+   the region of memory is too small to set /bits/ bits then this
-+   function exits after having set all bits till the end of the
-+   memory region.  In any case it returns the number of bits which
-+   were actually set. */
-+
-+int bmset(u32 *bitmap, int longs, int bitoffset, int bits)
-+{
-+	u32 *scan = bitmap;
-+	int longoffset;
-+	int orgbits = bits;
-+
-+	longoffset = bitoffset >> 5;
-+	longs -= longoffset;
-+	scan += longoffset;
-+
-+	bitoffset = bitoffset & 0x1F;
-+
-+	if (bitoffset != 0) {
-+		if (bits < 32) {
-+			*scan = cpu_to_be32(bfset(be32_to_cpu(*scan), bitoffset, bits));
-+		} else {
-+			*scan = cpu_to_be32(bfset(be32_to_cpu(*scan), bitoffset, 32));
-+		}
-+		scan++;
-+		longs--;
-+		bits -= 32 - bitoffset;
-+	}
-+
-+	while (bits > 0 && longs-- > 0) {
-+		if (bits > 31) {
-+			*scan++ = 0xFFFFFFFF;
-+		} else {
-+			*scan = cpu_to_be32(bfset(be32_to_cpu(*scan), 0, bits));
-+		}
-+		bits -= 32;
-+	}
-+
-+	if (bits <= 0) {
-+		return (orgbits);
-+	}
-+	return (orgbits - bits);
-+}
-diff -urN kernel-source-2.6.11-2.6.11-orig/fs/asfs/bitfuncs.h kernel-source-2.6.11-2.6.11/fs/asfs/bitfuncs.h
---- kernel-source-2.6.11-2.6.11-orig/fs/asfs/bitfuncs.h	1970-01-01 01:00:00.000000000 +0100
-+++ kernel-source-2.6.11-2.6.11/fs/asfs/bitfuncs.h	2005-03-04 18:37:12.582294536 +0100
-@@ -0,0 +1,58 @@
-+/*
-+ *
-+ * 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.
-+ *
-+ */
-+
-+#ifndef __BITFUNCS_H
-+#define __BITFUNCS_H
-+
-+#include <linux/types.h>
-+#include <asm/byteorder.h>
-+
-+#include <asm/bitops.h>
-+
-+/* Finds first set bit in /data/ starting at /bitoffset/.  This function
-+   considers the MSB to be the first bit. */
-+static inline int bfffo(u32 data, int bitoffset)
-+{
-+	u32 mask = 0xffffffff >> bitoffset;
-+	data &= mask;
-+	return data == 0 ? -1 : 32-fls(data);
-+}
-+
-+/* Finds first zero bit in /data/ starting at /bitoffset/.  This function
-+   considers the MSB to be the first bit. */
-+static inline int bfffz(u32 data, int bitoffset)
-+{
-+	return bfffo(~data, bitoffset);
-+}
-+
-+/* Sets /bits/ bits starting from /bitoffset/ in /data/.
-+   /bits/ must be between 1 and 32. */
-+static inline u32 bfset(u32 data, int bitoffset, int bits)
-+{
-+	u32 mask = ~((1 << (32 - bits)) - 1);
-+	mask >>= bitoffset;
-+	return data | mask;
-+}
-+
-+/* Clears /bits/ bits starting from /bitoffset/ in /data/.
-+   /bits/ must be between 1 and 32. */
-+static inline u32 bfclr(u32 data, int bitoffset, int bits)
-+{
-+	u32 mask = ~((1 << (32 - bits)) - 1);
-+	mask >>= bitoffset;
-+	return data & ~mask;
-+}
-+
-+/* bm??? functions assumes that in-memory bitmap is in bigendian byte order */
-+int bmffo(u32 *, int, int);
-+int bmffz(u32 *, int, int);
-+int bmclr(u32 *, int, int, int);
-+int bmset(u32 *, int, int, int);
-+
-+#endif
-diff -urN kernel-source-2.6.11-2.6.11-orig/fs/asfs/Changes kernel-source-2.6.11-2.6.11/fs/asfs/Changes
---- kernel-source-2.6.11-2.6.11-orig/fs/asfs/Changes	1970-01-01 01:00:00.000000000 +0100
-+++ kernel-source-2.6.11-2.6.11/fs/asfs/Changes	2005-03-04 18:37:12.584294232 +0100
-@@ -0,0 +1,101 @@
-+
-+Amiga Smart File System, Linux implementation
-+
-+Please direct bug reports to: marek at amiga.pl
-+
-+History:
-+
-+v1.0beta7 (25.06.2004)
-+- small changes in documentation
-+- code clean up: bitfuncs.c, super.c, inode.c, *.h, Makefile, added 
-+  asfs_ prefix to function names, made some functions static
-+  (big thanks to Christoph Hellwig for advice!)
-+- fixed minor bugs (inode leak in super.c, not-realesed buffer during 
-+  object renaming in inode.c)
-+- now files/dirs are created with global ownership/permission bits
-+
-+v1.0beta6 (04.06.2004)
-+- fixed: ASFS_SB(sb)->flags was always zero in 2.6.x code
-+
-+v1.0beta5 (07.05.2004)
-+- finally fixed a problem with file size attrib. not being written
-+  to disk
-+- fixed some problems with GCC 3.x and debug enabled
-+
-+v1.0beta4 (12.04.2004)
-+- removed dummy asfs_notify_change (this fixes major bug introduced
-+  in 1.0beta3 - file size wasn't written to disk) until it will 
-+  be implemented completely
-+
-+v1.0beta3 (22.03.2004) - still beta
-+- updated for 2.6.x kernels VFS changes
-+- code clean-up 
-+- added dummy asfs_notify_change (chmod now returns no errors)
-+- added symlinks write support
-+- fixed: ASFS_SB(sb)->flags was always zero
-+
-+v1.0beta2 (11.01.2004) - special version for Pegasos][ kernel
-+- separated read and write functions, can be compiled also
-+  as read-only fs
-+
-+v1.0beta1 (02.12.2003) - first public beta with write support
-+- added dentry hashing/comparing routines
-+- code clean-up
-+
-+v1.0aplha4 (30.11.2003) - preparing for first public beta
-+- fixed some problems with renaming/moving files
-+- fixed two major bugs, which didn't occur when fs was mounted
-+  on loopback device (newly allocated blocks were not written to
-+  disk and state bits were not set correctly on newly mapped file
-+  blocks)
-+- fixed many small bugs in io code (some buffers were not freed)
-+- added/modified sb locks in asfs_lookup and asfs_getblock
-+- fixed serious bug in file block allocation routines
-+
-+v1.0aplha3 (23.11.2003)
-+- added (hopefully) all byteswap code, should now work again on 
-+  little-endian systems (also with write support!)
-+- updated documentation
-+
-+v1.0alpha2 (13.11.2003) 
-+- now alocates file blocks in chunks during one request
-+- fixed some dead-locks, other fixes
-+
-+v1.0alpha (02.11.2003) - first working version with full write support
-+- too much to list it here ;)
-+
-+... (working on write support)
-+
-+v0.7 (12.10.2003) - internal realase
-+- added asfs_breadcheck, modified asfs_get_node, asfs_search_BTree, 
-+  no more from_be32/16 macros, other...
-+- code splitted into several files
-+
-+v0.6 (04.09.2003) - final read-only version
-+- added support for HashTables, directory scaning should be
-+  MUCH faster now
-+- added checking of block IDs before reading any data from block
-+
-+v0.5 (19.07.2003)
-+- added simple but effective extent cache - real speed-up 
-+  in reading large files
-+- added read support for symlinks - based on AFFS symlinks
-+
-+v0.4 (10.07.2003)
-+- third code clean-up (thanks to Roman Zippel for advice)
-+- now uses generic readpage and readinode routines
-+
-+v0.3beta (17.06.2003)
-+- second code clean-up
-+
-+v0.2beta2 (15.06.2003)
-+- fixed yet another stupid bug - driver can't read root block on little-endian systems
-+v0.2beta (15.06.2003)
-+- fixed stupid bug - now files have 'file' flag (S_IFREG) set...
-+- added mount options to set uid, gid and mode of files and dirs
-+- made hidden files & dirs really hidden (= not listed in directories)
-+- code clean-up
-+
-+v0.1beta (11.06.2003) 
-+- after many kernel crashes, finally got it! 
-+- first working read-only filesystem driver
-diff -urN kernel-source-2.6.11-2.6.11-orig/fs/asfs/dir.c kernel-source-2.6.11-2.6.11/fs/asfs/dir.c
---- kernel-source-2.6.11-2.6.11-orig/fs/asfs/dir.c	1970-01-01 01:00:00.000000000 +0100
-+++ kernel-source-2.6.11-2.6.11/fs/asfs/dir.c	2005-03-04 18:37:12.647284656 +0100
-@@ -0,0 +1,217 @@
-+/*
-+ *
-+ * Amiga Smart File System, Linux implementation
-+ * version: 1.0beta7
-+ *
-+ * Copyright (C) 2003,2004  Marek 'March' Szyprowski <marek at amiga.pl>
-+ *
-+ *
-+ * 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.
-+ *
-+ */
-+
-+#include <linux/types.h>
-+#include <linux/errno.h>
-+#include <linux/slab.h>
-+#include <linux/fs.h>
-+#include <linux/buffer_head.h>
-+#include <linux/vfs.h>
-+#include "asfs_fs.h"
-+
-+#include <asm/byteorder.h>
-+
-+extern struct dentry_operations asfs_dentry_operations;
-+
-+int asfs_readdir(struct file *filp, void *dirent, filldir_t filldir)
-+{
-+	struct inode *dir = filp->f_dentry->d_inode;
-+	struct super_block *sb = dir->i_sb;
-+	unsigned long f_pos;
-+	int stored = 0;
-+
-+	struct buffer_head *bh;
-+	struct fsObjectContainer *objcont;
-+	struct fsObject *obj;
-+	u32 block;
-+	int startnode;
-+	int add;
-+
-+	asfs_debug("asfs_readdir:\n");
-+
-+	if (filp->f_pos == ASFS_SB(sb)->totalblocks)
-+		return stored;
-+
-+	f_pos = filp->f_pos;
-+
-+	if (f_pos == 0) {
-+		filp->private_data = (void *)0;
-+		if (filldir(dirent, ".", 1, f_pos, dir->i_ino, DT_DIR) < 0)
-+			return 0;
-+		filp->f_pos = f_pos = 1;
-+		stored++;
-+	}
-+	if (f_pos == 1) {
-+		if (filldir(dirent, "..", 2, f_pos, parent_ino(filp->f_dentry), DT_DIR) < 0)
-+			return stored;
-+		filp->f_pos = f_pos = 2;
-+		stored++;
-+	}
-+
-+	if (ASFS_I(dir)->firstblock == 0) {	/* empty directory */
-+		filp->f_pos = ASFS_SB(sb)->totalblocks;
-+		ASFS_I(dir)->modified = 0;
-+		return stored;
-+	}
-+
-+	if (f_pos == 2) {	/* reading directory from its beginning */
-+		block = ASFS_I(dir)->firstblock;
-+		add = 1;
-+		startnode = 0;
-+	} else {
-+		startnode = (int)filp->private_data;
-+		add = 0;
-+		if (ASFS_I(dir)->modified == 0)
-+			block = f_pos;
-+		else
-+			block = ASFS_I(dir)->firstblock;
-+	}
-+
-+	do {
-+		if (!(bh = asfs_breadcheck(sb, block, ASFS_OBJECTCONTAINER_ID)))
-+			return stored;
-+		objcont = (struct fsObjectContainer *) bh->b_data;
-+		obj = &(objcont->object[0]);
-+
-+		while (be32_to_cpu(obj->objectnode) > 0 && 
-+		      ((char *)obj - (char *)objcont) + sizeof(struct fsObject) + 2 < sb->s_blocksize) {
-+
-+			if (!add && be32_to_cpu(obj->objectnode) == startnode)
-+				add++;
-+
-+			if (add && !(obj->bits & OTYPE_HIDDEN)) {
-+				unsigned int type;
-+				asfs_debug("ASFS: DirFilling: entry #%d \"%s\" (node %u offset %u), type %x\n", \
-+				           stored, obj->name, be32_to_cpu(obj->objectnode), block, obj->bits);
-+				filp->f_pos = block;
-+
-+				if (obj->bits & OTYPE_DIR)
-+					type = DT_DIR;
-+				else if (obj->bits & OTYPE_LINK && !(obj->bits & OTYPE_HARDLINK))
-+					type = DT_LNK;
-+				else
-+					type = DT_REG;
-+
-+				if (filldir(dirent, obj->name, strlen(obj->name), block, be32_to_cpu(obj->objectnode), type) < 0) {
-+					filp->private_data = (void *)be32_to_cpu(obj->objectnode);
-+					ASFS_I(dir)->modified = 0;
-+					asfs_debug("ASFS: DirFilling: to be continued...\n");
-+					asfs_brelse(bh);
-+					return stored;
-+				}
-+				stored++;
-+			}
-+			obj = asfs_nextobject(obj);
-+		}
-+		block = be32_to_cpu(objcont->next);
-+		asfs_brelse(bh);
-+
-+	} while (block != 0);
-+
-+	filp->f_pos = ASFS_SB(sb)->totalblocks;
-+	ASFS_I(dir)->modified = 0;
-+
-+	return stored;
-+}
-+
-+struct dentry *asfs_lookup(struct inode *dir, struct dentry *dentry, struct nameidata *nd)
-+{
-+	int res = -EACCES;       /* placeholder for "no data here" */
-+	struct inode *inode;
-+	struct super_block *sb = dir->i_sb;
-+	u8 *name = (u8 *) dentry->d_name.name;
-+	struct buffer_head *bh;
-+	struct fsObject *obj;
-+
-+	asfs_debug("asfs_lookup: (searching \"%s\"...) ", name);
-+
-+	lock_super(sb);
-+
-+	if (ASFS_I(dir)->hashtable != 0) {	/* hashtable block is available, quick search */
-+		struct fsObjectNode *node_p;
-+		struct buffer_head *node_bh;
-+		u32 node;
-+		u16 hash16;
-+
-+		asfs_debug("(quick search) ");
-+
-+		if (!(bh = asfs_breadcheck(sb, ASFS_I(dir)->hashtable, ASFS_HASHTABLE_ID))) {
-+			unlock_super(sb);
-+			return ERR_PTR(res);
-+		}
-+		hash16 = asfs_hash(name, ASFS_SB(sb)->flags & ASFS_ROOTBITS_CASESENSITIVE); 
-+		node = be32_to_cpu(((struct fsHashTable *) bh->b_data)->hashentry[HASHCHAIN(hash16)]);
-+		asfs_brelse(bh);
-+
-+		while (node != 0) {
-+			if (asfs_getnode(sb, node, &node_bh, &node_p) != 0)
-+				goto not_found;
-+			if (be16_to_cpu(node_p->hash16) == hash16) {
-+				if (!(bh = asfs_breadcheck(sb, be32_to_cpu(node_p->node.data), ASFS_OBJECTCONTAINER_ID))) {
-+					asfs_brelse(node_bh);
-+					unlock_super(sb);
-+					return ERR_PTR(res);
-+				}
-+				if ((obj = asfs_find_obj_by_name(sb, (struct fsObjectContainer *) bh->b_data, name)) != NULL) {
-+					asfs_brelse(node_bh);
-+					goto found_inode;
-+				}
-+				asfs_brelse(bh);
-+			}
-+			node = be32_to_cpu(node_p->next);
-+			asfs_brelse(node_bh);
-+		}
-+	} else { /* hashtable not available, long search */
-+		struct fsObjectContainer *objcont;
-+		u32 block;
-+
-+		asfs_debug("(long search) ");
-+
-+		block = ASFS_I(dir)->firstblock;
-+		while (block != 0) {
-+			if (!(bh = asfs_breadcheck(sb, block, ASFS_OBJECTCONTAINER_ID))) {
-+				unlock_super(sb);
-+				return ERR_PTR(res);
-+			}
-+			objcont = (struct fsObjectContainer *) bh->b_data;
-+			if ((obj = asfs_find_obj_by_name(sb, objcont, name)) != NULL)
-+				goto found_inode;
-+			block = be32_to_cpu(objcont->next);
-+			asfs_brelse(bh);
-+		}
-+	}
-+
-+not_found:
-+	unlock_super(sb);
-+	inode = NULL;
-+	asfs_debug("object not found.\n");
-+	if (0) {
-+found_inode:
-+		unlock_super(sb);
-+		if (!(inode = iget_locked(sb, be32_to_cpu(obj->objectnode)))) {
-+			asfs_debug("ASFS: Strange - no inode allocated.\n");
-+			return ERR_PTR(res);
-+		}
-+		if (inode->i_state & I_NEW) {
-+			asfs_read_locked_inode(inode, obj);
-+			unlock_new_inode(inode);
-+		}
-+		asfs_brelse(bh);
-+	}
-+	res = 0;
-+	dentry->d_op = &asfs_dentry_operations;
-+	d_add(dentry, inode);
-+	return ERR_PTR(res);
-+}
-diff -urN kernel-source-2.6.11-2.6.11-orig/fs/asfs/extents.c kernel-source-2.6.11-2.6.11/fs/asfs/extents.c
---- kernel-source-2.6.11-2.6.11-orig/fs/asfs/extents.c	1970-01-01 01:00:00.000000000 +0100
-+++ kernel-source-2.6.11-2.6.11/fs/asfs/extents.c	2005-03-04 18:37:12.713274624 +0100
-@@ -0,0 +1,586 @@
-+/*
-+ *
-+ * Amiga Smart File System, Linux implementation
-+ * version: 1.0beta7
-+ *
-+ * This file contains some parts of the original amiga version of 
-+ * SmartFilesystem source code.
-+ *
-+ * SmartFilesystem is copyrighted (C) 2003 by: John Hendrikx, 
-+ * Ralph Schmidt, Emmanuel Lesueur, David Gerber and Marcin Kurek
-+ * 
-+ * Adapted and modified by Marek 'March' Szyprowski <marek at amiga.pl>
-+ *
-+ */
-+
-+#include <linux/types.h>
-+#include <linux/errno.h>
-+#include <linux/slab.h>
-+#include <linux/fs.h>
-+#include <linux/buffer_head.h>
-+#include <linux/vfs.h>
-+#include "asfs_fs.h"
-+
-+#include <asm/byteorder.h>
-+
-+	/* This function looks for the BNode equal to the key.  If no
-+	   exact match is available then the BNode which is slightly
-+	   lower than key will be returned.  If no such BNode exists
-+	   either, then the first BNode in this block is returned.
-+
-+	   This function will return the first BNode even if there
-+	   are no BNode's at all in this block (this can only happen
-+	   for the Root of the tree).  Be sure to check if the Root
-+	   is not empty before calling this function. */
-+
-+static struct BNode *searchforbnode(u32 key, struct BTreeContainer *tc)
-+{
-+	struct BNode *tn;
-+	s16 n = be16_to_cpu(tc->nodecount) - 1;
-+
-+	tn = (struct BNode *) ((u8 *) tc->bnode + n * tc->nodesize);
-+	for (;;) {
-+		if (n <= 0 || key >= be32_to_cpu(tn->key))
-+			return tn;
-+
-+		tn = (struct BNode *) ((u8 *) tn - tc->nodesize);
-+		n--;
-+	}
-+}
-+
-+/* This function finds the BNode with the given key.  If no exact match can be
-+   found then this function will return either the next or previous closest
-+   match (don't rely on this).
-+
-+   If there were no BNode's at all, then *returned_bh will be NULL. */
-+
-+static int findbnode(struct super_block *sb, u32 key, struct buffer_head **returned_bh, struct BNode **returned_bnode)
-+{
-+	u32 rootblock = ASFS_SB(sb)->extentbnoderoot;
-+
-+	asfs_debug("findbnode: Looking for BNode with key %d\n", key);
-+
-+	while ((*returned_bh = asfs_breadcheck(sb, rootblock, ASFS_BNODECONTAINER_ID))) {
-+		struct fsBNodeContainer *bnc = (void *) (*returned_bh)->b_data;
-+		struct BTreeContainer *btc = &bnc->btc;
-+
-+		if (btc->nodecount == 0) {
-+			*returned_bnode = NULL;
-+			break;
-+		}
-+
-+		*returned_bnode = searchforbnode(key, btc);
-+		if (btc->isleaf == TRUE)
-+			break;
-+
-+		rootblock = be32_to_cpu((*returned_bnode)->data);
-+		asfs_brelse(*returned_bh);
-+	}
-+
-+	if (*returned_bh == NULL)
-+		return -EIO;
-+
-+	return 0;
-+}
-+
-+int asfs_getextent(struct super_block *sb, u32 key, struct buffer_head **ret_bh, struct fsExtentBNode **ret_ebn)
-+{
-+	int result;
-+	if ((result = findbnode(sb, key, ret_bh, (struct BNode **)ret_ebn)) == 0) 
-+		if (be32_to_cpu((*ret_ebn)->key) != key) {
-+			brelse(*ret_bh);
-+			*ret_bh = NULL;
-+			return -ENOENT;
-+		}
-+
-+	return result;
-+}
-+
-+#ifdef CONFIG_ASFS_RW
-+
-+	/* This routine inserts a node sorted into a BTreeContainer.  It does
-+	   this by starting at the end, and moving the nodes one by one to
-+	   a higher slot until the empty slot has the correct position for
-+	   this key.  Donot use this function on completely filled
-+	   BTreeContainers! */
-+
-+static struct BNode *insertbnode(u32 key, struct BTreeContainer *btc)
-+{
-+	struct BNode *bn;
-+	bn = (struct BNode *) ((u8 *) btc->bnode + btc->nodesize * (be16_to_cpu(btc->nodecount) - 1));
-+
-+	for (;;) {
-+		if (bn < btc->bnode || key > be32_to_cpu(bn->key)) {
-+			bn = (struct BNode *) ((u8 *) bn + btc->nodesize);
-+			bn->key = cpu_to_be32(key);
-+			btc->nodecount = cpu_to_be16(be16_to_cpu(btc->nodecount) + 1);
-+			break;
-+		} else 
-+			memmove((u8 *)bn + btc->nodesize, bn, btc->nodesize);
-+
-+		bn = (struct BNode *) ((u8 *) bn - btc->nodesize);
-+	}
-+
-+	return bn;
-+}
-+
-+static int getparentbtreecontainer(struct super_block *sb, struct buffer_head *bh, struct buffer_head **parent_bh)
-+{
-+	u32 rootblock = ASFS_SB(sb)->extentbnoderoot;
-+	u32 childkey = be32_to_cpu(((struct fsBNodeContainer *) bh->b_data)->btc.bnode[0].key);
-+	u32 childblock = be32_to_cpu(((struct fsBNodeContainer *) bh->b_data)->bheader.ownblock);
-+
-+	asfs_debug("getparentbtreecontainer: Getting parent of block %d\n", childblock);
-+
-+	/* This function gets the BTreeContainer parent of the passed in buffer_head. If
-+	   there is no parent this function sets dest_cont io_bh to NULL */
-+
-+	if (rootblock != childblock) {
-+		while ((*parent_bh = asfs_breadcheck(sb, rootblock, ASFS_BNODECONTAINER_ID))) {
-+			struct fsBNodeContainer *bnc = (void *) (*parent_bh)->b_data;
-+			struct BTreeContainer *btc = &bnc->btc;
-+			struct BNode *bn;
-+			s16 n = be16_to_cpu(btc->nodecount);
-+
-+			if (btc->isleaf == TRUE) {
-+				asfs_brelse(*parent_bh);
-+				break;
-+			}
-+
-+			while (n-- > 0)
-+				if (be32_to_cpu(btc->bnode[n].data) == childblock)
-+					return 0;	/* Found parent!! */
-+
-+			bn = searchforbnode(childkey, btc);	/* This searchforbnode() doesn't have to get EXACT key matches. */
-+			rootblock = be32_to_cpu(bn->data);
-+			asfs_brelse(*parent_bh);
-+		}
-+		if (*parent_bh == NULL)
-+			return -EIO;
-+	}
-+
-+	*parent_bh = NULL;
-+	return 0;
-+}
-+
-+/* Spits a btreecontainer. It realses passed in bh! */
-+
-+static int splitbtreecontainer(struct super_block *sb, struct buffer_head *bh)
-+{
-+	struct buffer_head *bhparent;
-+	struct BNode *bn;
-+	int errorcode;
-+
-+	asfs_debug("splitbtreecontainer: splitting block %u\n", be32_to_cpu(((struct fsBlockHeader *) bh->b_data)->ownblock));
-+
-+	if ((errorcode = getparentbtreecontainer(sb, bh, &bhparent)) == 0) {
-+		if (bhparent == NULL) {
-+			u32 newbcontblock;
-+			u32 bcontblock;
-+			/* We need to create Root tree-container - adding new level to extent tree */
-+
-+			asfs_debug("splitbtreecontainer: creating root tree-container.\n");
-+
-+			bhparent = bh;
-+			if ((errorcode = asfs_allocadminspace(sb, &newbcontblock)) == 0 && (bh = asfs_getzeroblk(sb, newbcontblock))) {
-+				struct fsBNodeContainer *bnc = (void *) bh->b_data;
-+				struct fsBNodeContainer *bncparent = (void *) bhparent->b_data;
-+				struct BTreeContainer *btcparent = &bncparent->btc;
-+
-+				bcontblock = be32_to_cpu(bncparent->bheader.ownblock);
-+				memcpy(bh->b_data, bhparent->b_data, sb->s_blocksize);
-+				bnc->bheader.ownblock = cpu_to_be32(newbcontblock);
-+				asfs_bstore(sb, bh);
-+
-+				memset(bhparent->b_data, '\0', sb->s_blocksize);	/* Not strictly needed, but makes things more clear. */
-+				bncparent->bheader.id = cpu_to_be32(ASFS_BNODECONTAINER_ID);
-+				bncparent->bheader.ownblock = cpu_to_be32(bcontblock);
-+				btcparent->isleaf = FALSE;
-+				btcparent->nodesize = sizeof(struct BNode);
-+				btcparent->nodecount = 0;
-+
-+				bn = insertbnode(0, btcparent);
-+				bn->data = cpu_to_be32(newbcontblock);
-+
-+				asfs_bstore(sb, bhparent);
-+			}
-+			if (bh == NULL)
-+				errorcode = -EIO;
-+		}
-+
-+		if (errorcode == 0) {
-+			struct fsBNodeContainer *bncparent = (void *) bhparent->b_data;
-+			struct BTreeContainer *btcparent = &bncparent->btc;
-+			int branches1 = (sb->s_blocksize - sizeof(struct fsBNodeContainer)) / btcparent->nodesize;
-+
-+			if (be16_to_cpu(btcparent->nodecount) == branches1) {
-+				/* We need to split the parent tree-container first! */
-+				if ((errorcode = splitbtreecontainer(sb, bhparent)) == 0) {
-+					/* bhparent might have changed after the split and has been released */
-+					if ((errorcode = getparentbtreecontainer(sb, bh, &bhparent)) == 0) {	
-+						bncparent = (void *) bhparent->b_data;
-+						btcparent = &bncparent->btc;
-+					}
-+				}
-+			}
-+
-+			if (errorcode == 0) {
-+				u32 newbcontblock;
-+				struct buffer_head *bhnew;
-+
-+				/* We can split this container and add it to the parent
-+				   because the parent has enough room. */
-+
-+				if ((errorcode = asfs_allocadminspace(sb, &newbcontblock)) == 0 && (bhnew = asfs_getzeroblk(sb, newbcontblock))) {
-+					struct fsBNodeContainer *bncnew = (void *) bhnew->b_data;
-+					struct BTreeContainer *btcnew = &bncnew->btc;
-+					struct fsBNodeContainer *bnc = (void *) bh->b_data;
-+					struct BTreeContainer *btc = &bnc->btc;
-+					int branches2 = (sb->s_blocksize - sizeof(struct fsBNodeContainer)) / btc->nodesize;
-+					u32 newkey;
-+
-+					bncnew->bheader.id = cpu_to_be32(ASFS_BNODECONTAINER_ID);
-+					bncnew->bheader.ownblock = cpu_to_be32(newbcontblock);
-+
-+					btcnew->isleaf = btc->isleaf;
-+					btcnew->nodesize = btc->nodesize;
-+
-+					btcnew->nodecount = cpu_to_be16(branches2 - branches2 / 2);
-+
-+					memcpy(btcnew->bnode, (u8 *) btc->bnode + branches2 / 2 * btc->nodesize, (branches2 - branches2 / 2) * btc->nodesize);
-+					newkey = be32_to_cpu(btcnew->bnode[0].key);
-+
-+					asfs_bstore(sb, bhnew);
-+					asfs_brelse(bhnew);
-+
-+					btc->nodecount = cpu_to_be16(branches2 / 2);
-+					asfs_bstore(sb, bh);
-+
-+					bn = insertbnode(newkey, btcparent);
-+					bn->data = cpu_to_be32(newbcontblock);
-+					asfs_bstore(sb, bhparent);
-+				}
-+			}
-+		}
-+		asfs_brelse(bhparent);
-+	}
-+	asfs_brelse(bh);
-+
-+	return errorcode;
-+}
-+
-+/* Returns created extentbnode - returned_bh need to saved and realesed in caller funkction! */
-+
-+int createextentbnode(struct super_block *sb, u32 key, struct buffer_head **returned_bh, struct BNode **returned_bnode)
-+{
-+	int errorcode;
-+
-+	asfs_debug("createbnode: Creating BNode with key %d\n", key);
-+
-+	while ((errorcode = findbnode(sb, key, returned_bh, returned_bnode)) == 0) {
-+		struct fsBNodeContainer *bnc = (void *) (*returned_bh)->b_data;
-+		struct BTreeContainer *btc = &bnc->btc;
-+		int extbranches = (sb->s_blocksize - sizeof(struct fsBNodeContainer)) / btc->nodesize;
-+
-+		asfs_debug("createbnode: findbnode found block %d\n", be32_to_cpu(((struct fsBlockHeader *) (*returned_bh)->b_data)->ownblock));
-+
-+		if (be16_to_cpu(btc->nodecount) < extbranches) {
-+			/* Simply insert new node in this BTreeContainer */
-+			asfs_debug("createbnode: Simple insert\n");
-+			*returned_bnode = insertbnode(key, btc);
-+			break;
-+		} else if ((errorcode = splitbtreecontainer(sb, *returned_bh)) != 0)
-+			break;
-+
-+		/* Loop and try insert it the normal way again :-) */
-+	}
-+
-+	return (errorcode);
-+}
-+
-+
-+/* This routine removes a node from a BTreeContainer indentified
-+   by its key.  If no such key exists this routine does nothing.
-+   It correctly handles empty BTreeContainers. */
-+
-+static void removebnode(u32 key, struct BTreeContainer *btc)
-+{
-+	struct BNode *bn = btc->bnode;
-+	int n = 0;
-+
-+	asfs_debug("removebnode: key %d\n", key);
-+
-+	while (n < be16_to_cpu(btc->nodecount)) {
-+		if (be32_to_cpu(bn->key) == key) {
-+			btc->nodecount = cpu_to_be16(be16_to_cpu(btc->nodecount) - 1);
-+			memmove(bn, (u8 *) bn + btc->nodesize, (be16_to_cpu(btc->nodecount) - n) * btc->nodesize);
-+			break;
-+		}
-+		bn = (struct BNode *) ((u8 *) bn + btc->nodesize);
-+		n++;
-+	}
-+}
-+
-+int asfs_deletebnode(struct super_block *sb, struct buffer_head *bh, u32 key)
-+{
-+	struct fsBNodeContainer *bnc1 = (void *) bh->b_data;
-+	struct BTreeContainer *btc = &bnc1->btc;
-+	u16 branches = (sb->s_blocksize - sizeof(struct fsBNodeContainer)) / btc->nodesize;
-+	int errorcode = 0;
-+
-+	/* Deletes specified internal node. */
-+
-+	removebnode(key, btc);
-+	asfs_bstore(sb, bh);
-+
-+	/* Now checks if the container still contains enough nodes,
-+	   and takes action accordingly. */
-+
-+	asfs_debug("deletebnode: branches = %d, btc->nodecount = %d\n", branches, be16_to_cpu(btc->nodecount));
-+
-+	if (be16_to_cpu(btc->nodecount) < (branches + 1) / 2) {
-+		struct buffer_head *bhparent;
-+		struct buffer_head *bhsec;
-+
-+		/* nodecount has become to low.  We need to merge this Container
-+		   with a neighbouring Container, or we need to steal a few nodes
-+		   from a neighbouring Container. */
-+
-+		/* We get the parent of the container here, so we can find out what
-+		   containers neighbour the container which currently hasn't got enough nodes. */
-+
-+		if ((errorcode = getparentbtreecontainer(sb, bh, &bhparent)) == 0) {
-+			if (bhparent != NULL) {
-+				struct fsBNodeContainer *bncparent = (void *) bhparent->b_data;
-+				struct BTreeContainer *btcparent = &bncparent->btc;
-+				s16 n;
-+
-+				asfs_debug("deletebnode: get parent returned block %d.\n", be32_to_cpu(((struct fsBlockHeader *) bhparent->b_data)->ownblock));
-+
-+				for (n = 0; n < be16_to_cpu(btcparent->nodecount); n++)
-+					if (btcparent->bnode[n].data == bnc1->bheader.ownblock)
-+						break;
-+				/* n is now the offset of our own bnode. */
-+
-+				if (n < be16_to_cpu(btcparent->nodecount) - 1) {	/* Check if we have a next neighbour. */
-+					asfs_debug("deletebnode: using next container - merging blocks %d and %d\n", be32_to_cpu(bnc1->bheader.ownblock), be32_to_cpu(btcparent->bnode[n+1].data));
-+
-+					if ((bhsec = asfs_breadcheck(sb, be32_to_cpu(btcparent->bnode[n + 1].data), ASFS_BNODECONTAINER_ID))) {
-+						struct fsBNodeContainer *bnc_next = (void *) bhsec->b_data;
-+						struct BTreeContainer *btc_next = &bnc_next->btc;
-+
-+						if (be16_to_cpu(btc_next->nodecount) + be16_to_cpu(btc->nodecount) > branches) {	/* Check if we need to steal nodes. */
-+							s16 nodestosteal = (be16_to_cpu(btc_next->nodecount) + be16_to_cpu(btc->nodecount)) / 2 - be16_to_cpu(btc->nodecount);
-+
-+							/* Merging them is not possible.  Steal a few nodes then. */
-+							memcpy((u8 *) btc->bnode + be16_to_cpu(btc->nodecount) * btc->nodesize, btc_next->bnode, nodestosteal * btc->nodesize);
-+							btc->nodecount = cpu_to_be16(be16_to_cpu(btc->nodecount) + nodestosteal);
-+							asfs_bstore(sb, bh);
-+
-+							memcpy(btc_next->bnode, (u8 *) btc_next->bnode + btc_next->nodesize * nodestosteal,
-+							       btc->nodesize * (be16_to_cpu(btc_next->nodecount) - nodestosteal));
-+							btc_next->nodecount = cpu_to_be16(be16_to_cpu(btc_next->nodecount) - nodestosteal);
-+							asfs_bstore(sb, bhsec);
-+
-+							btcparent->bnode[n + 1].key = btc_next->bnode[0].key;
-+							asfs_bstore(sb, bhparent);
-+						} else {	/* Merging is possible. */
-+							memcpy((u8 *) btc->bnode + btc->nodesize * be16_to_cpu(btc->nodecount), btc_next->bnode, btc->nodesize * be16_to_cpu(btc_next->nodecount));
-+							btc->nodecount = cpu_to_be16(be16_to_cpu(btc->nodecount) + be16_to_cpu(btc_next->nodecount));
-+							asfs_bstore(sb, bh);
-+
-+							if ((errorcode = asfs_freeadminspace(sb, be32_to_cpu(((struct fsBlockHeader *) bhsec->b_data)->ownblock))) == 0)
-+								errorcode = asfs_deletebnode(sb, bhparent, be32_to_cpu(btcparent->bnode[n + 1].key));
-+						}
-+						asfs_brelse(bhsec);
-+					}
-+				} else if (n > 0) {	/* Check if we have a previous neighbour. */
-+					asfs_debug("deletebnode: using prev container.\n");
-+
-+					if ((bhsec = asfs_breadcheck(sb, be32_to_cpu(btcparent->bnode[n - 1].data), ASFS_BNODECONTAINER_ID)) == 0) {
-+						struct fsBNodeContainer *bnc2 = (void *) bhsec->b_data;
-+						struct BTreeContainer *btc2 = &bnc2->btc;
-+
-+						if (be16_to_cpu(btc2->nodecount) + be16_to_cpu(btc->nodecount) > branches) {
-+							/* Merging them is not possible.  Steal a few nodes then. */
-+							s16 nodestosteal = (be16_to_cpu(btc2->nodecount) + be16_to_cpu(btc->nodecount)) / 2 - be16_to_cpu(btc->nodecount);
-+
-+							memmove((u8 *) btc->bnode + nodestosteal * btc->nodesize, btc->bnode, be16_to_cpu(btc->nodecount) * btc->nodesize);
-+							btc->nodecount = cpu_to_be16(be16_to_cpu(btc->nodecount) + nodestosteal);
-+							memcpy(btc->bnode, (u8 *) btc2->bnode + (be16_to_cpu(btc2->nodecount) - nodestosteal) * btc2->nodesize, nodestosteal * btc->nodesize);
-+
-+							asfs_bstore(sb, bh);
-+
-+							btc2->nodecount = cpu_to_be16(be16_to_cpu(btc2->nodecount) - nodestosteal);
-+							asfs_bstore(sb, bhsec);
-+
-+							btcparent->bnode[n].key = btc->bnode[0].key;
-+							asfs_bstore(sb, bhparent);
-+						} else {	/* Merging is possible. */
-+							memcpy((u8 *) btc2->bnode + be16_to_cpu(btc2->nodecount) * btc2->nodesize, btc->bnode, be16_to_cpu(btc->nodecount) * btc->nodesize);
-+							btc2->nodecount = cpu_to_be16(be16_to_cpu(btc2->nodecount) + be16_to_cpu(btc->nodecount));
-+							asfs_bstore(sb, bhsec);
-+
-+							if ((errorcode = asfs_freeadminspace(sb, be32_to_cpu(((struct fsBlockHeader *) bhsec->b_data)->ownblock))) == 0)
-+								errorcode = asfs_deletebnode(sb, bhparent, be32_to_cpu(btcparent->bnode[n].key));
-+						}
-+						asfs_brelse(bhsec);
-+					}
-+				}
-+				/*      else    
-+				   {
-+				   // Never happens, except for root and then we don't care.
-+				   } */
-+			} else if (btc->nodecount == 1) {
-+				/* No parent, so must be root. */
-+
-+				asfs_debug("deletebnode: no parent so must be root\n");
-+
-+				if (btc->isleaf == FALSE) {
-+					struct fsBNodeContainer *bnc3 = (void *) bh->b_data;
-+
-+					/* The current root has only 1 node.  We now copy the data of this node into the
-+					   root and promote that data to be the new root.  The rootblock number stays the
-+					   same that way. */
-+
-+					if ((bhsec = asfs_breadcheck(sb, be32_to_cpu(btc->bnode[0].data), ASFS_BNODECONTAINER_ID))) {
-+						u32 blockno = be32_to_cpu(((struct fsBlockHeader *) bh->b_data)->ownblock);
-+						memcpy(bh->b_data, bhsec->b_data, sb->s_blocksize);
-+						bnc3->bheader.ownblock = cpu_to_be32(blockno);
-+
-+						asfs_bstore(sb, bh);
-+						errorcode = asfs_freeadminspace(sb, be32_to_cpu(((struct fsBlockHeader *) bhsec->b_data)->ownblock));
-+						asfs_brelse(bhsec);
-+					} else
-+						errorcode = -EIO;
-+				}
-+				/* If not, then root contains leafs. */
-+			}
-+
-+			asfs_debug("deletebnode: almost done\n");
-+			/* otherwise, it must be the root, and the root is allowed
-+			   to contain less than the minimum amount of nodes. */
-+
-+		}
-+		if (bhparent != NULL)
-+			asfs_brelse(bhparent);
-+	}
-+
-+	return errorcode;
-+}
-+
-+   /* Deletes an fsExtentBNode structure by key and any fsExtentBNodes linked to it.
-+      This function DOES NOT fix the next pointer in a possible fsExtentBNode which
-+      might have been pointing to the first BNode we are deleting.  Make sure you check
-+      this yourself, if needed.
-+
-+      If key is zero, than this function does nothing. */
-+
-+int asfs_deleteextents(struct super_block *sb, u32 key)
-+{
-+	struct buffer_head *bh;
-+	struct fsExtentBNode *ebn;
-+	int errorcode = 0;
-+
-+	asfs_debug("deleteextents: Entry -- deleting extents from key %d\n", key);
-+
-+	while (key != 0 && (errorcode = findbnode(sb, key, &bh, (struct BNode **) &ebn)) == 0) {
-+		/* node to be deleted located. */
-+		key = be32_to_cpu(ebn->next);
-+		if ((errorcode = asfs_freespace(sb, be32_to_cpu(ebn->key), be16_to_cpu(ebn->blocks))) != 0)
-+			break;
-+
-+		if ((errorcode = asfs_deletebnode(sb, bh, be32_to_cpu(ebn->key))) != 0)
-+			break;
-+
-+		asfs_brelse(bh);
-+	}
-+
-+	return (errorcode);
-+}
-+
-+   /* This function adds /blocks/ blocks starting at block /newspace/ to a file
-+      identified by /objectnode/ and /lastextentbnode/.  /io_lastextentbnode/ can
-+      be zero if there is no ExtentBNode chain attached to this file yet.
-+      /blocks/ ranges from 1 to 8192.  To be able to extend Extents which are
-+      almost full, it is wise to make this value no higher than 8192 blocks.
-+      /io_lastextentbnode/ will contain the new lastextentbnode value when this
-+      function completes.
-+      If there was no chain yet, then this function will create a new one.  */
-+
-+int asfs_addblocks(struct super_block *sb, u16 blocks, u32 newspace, u32 objectnode, u32 *io_lastextentbnode)
-+{
-+	struct buffer_head *bh;
-+	struct fsExtentBNode *ebn;
-+	int errorcode = 0;
-+
-+	if (*io_lastextentbnode != 0) {
-+		/* There was already a ExtentBNode chain for this file.  Extending it. */
-+
-+		asfs_debug("  addblocks: Extending existing ExtentBNode chain.\n");
-+
-+		if ((errorcode = asfs_getextent(sb, *io_lastextentbnode, &bh, &ebn)) == 0) {
-+			if (be32_to_cpu(ebn->key) + be16_to_cpu(ebn->blocks) == newspace && be16_to_cpu(ebn->blocks) + blocks < 65536) {
-+				/* It is possible to extent the last ExtentBNode! */
-+				asfs_debug("  addblocks: Extending last ExtentBNode.\n");
-+
-+				ebn->blocks = cpu_to_be16(be16_to_cpu(ebn->blocks) + blocks);
-+
-+				asfs_bstore(sb, bh);
-+				asfs_brelse(bh);
-+			} else {
-+				/* It isn't possible to extent the last ExtentBNode so we create
-+				   a new one and link it to the last ExtentBNode. */
-+
-+				ebn->next = cpu_to_be32(newspace);
-+				asfs_bstore(sb, bh);
-+				asfs_brelse(bh);
-+
-+				if ((errorcode = createextentbnode(sb, newspace, &bh, (struct BNode **) &ebn)) == 0) {
-+					asfs_debug("  addblocks: Created new ExtentBNode.\n");
-+
-+					ebn->key = cpu_to_be32(newspace);
-+					ebn->prev = cpu_to_be32(*io_lastextentbnode);
-+					ebn->next = 0;
-+					ebn->blocks = cpu_to_be16(blocks);
-+
-+					*io_lastextentbnode = newspace;
-+
-+					asfs_bstore(sb, bh);
-+					asfs_brelse(bh);
-+
-+					ASFS_SB(sb)->block_rovingblockptr = newspace + blocks;
-+
-+	/* to be changed in the future */
-+/*					if (ASFS_SB(sb)->block_rovingblockptr >= ASFS_SB(sb)->totalblocks)
-+						ASFS_SB(sb)->block_rovingblockptr = 0;*/
-+				}
-+			}
-+		}
-+	} else {
-+		/* There is no ExtentBNode chain yet for this file.  Attaching one! */
-+		if ((errorcode = createextentbnode(sb, newspace, &bh, (struct BNode **) &ebn)) == 0) {
-+			asfs_debug("  addblocks: Created new ExtentBNode chain.\n");
-+
-+			ebn->key = cpu_to_be32(newspace);
-+			ebn->prev = cpu_to_be32(objectnode + 0x80000000);
-+			ebn->next = 0;
-+			ebn->blocks = cpu_to_be16(blocks);
-+
-+			*io_lastextentbnode = newspace;
-+
-+			asfs_bstore(sb, bh);
-+			asfs_brelse(bh);
-+
-+			ASFS_SB(sb)->block_rovingblockptr = newspace + blocks;
-+
-+/*			if (ASFS_SB(sb)->block_rovingblockptr >= ASFS_SB(sb)->totalblocks)
-+				ASFS_SB(sb)->block_rovingblockptr = 0;*/
-+		}
-+	}
-+
-+	asfs_debug("  addblocks: done.\n");
-+
-+	return errorcode;
-+}
-+#endif
-diff -urN kernel-source-2.6.11-2.6.11-orig/fs/asfs/file.c kernel-source-2.6.11-2.6.11/fs/asfs/file.c
---- kernel-source-2.6.11-2.6.11-orig/fs/asfs/file.c	1970-01-01 01:00:00.000000000 +0100
-+++ kernel-source-2.6.11-2.6.11/fs/asfs/file.c	2005-03-04 18:37:12.715274320 +0100
-@@ -0,0 +1,251 @@
-+/*
-+ *
-+ * Amiga Smart File System, Linux implementation
-+ * version: 1.0beta7
-+ *  
-+ * Copyright (C) 2003,2004  Marek 'March' Szyprowski <marek at amiga.pl>
-+ *
-+ *
-+ * 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.
-+ *
-+ */
-+
-+#include <linux/types.h>
-+#include <linux/errno.h>
-+#include <linux/slab.h>
-+#include <linux/fs.h>
-+#include <linux/pagemap.h>
-+#include <linux/buffer_head.h>
-+#include <linux/vfs.h>
-+#include "asfs_fs.h"
-+
-+#include <asm/byteorder.h>
-+
-+static int
-+asfs_get_block(struct inode *inode, sector_t block, struct buffer_head *bh_result, int create)
-+{
-+	struct buffer_head *ebn_bh;
-+	struct fsExtentBNode extent, *ebn_p;
-+	u32 filedata;
-+	unsigned long pos;
-+	struct super_block *sb = inode->i_sb;
-+#ifdef CONFIG_ASFS_RW
-+	int error;
-+	struct buffer_head *bh;
-+	struct fsObject *obj;
-+#endif
-+
-+	asfs_debug("ASFS: get_block(%lu, %ld, %d)\n", inode->i_ino, block, create);
-+
-+	if (block < 0) {
-+		printk(KERN_ERR "ASFS: asfsget_block: requested block (%ld) < 0!\n", block);
-+		return -EIO;
-+	} else if (block >= inode->i_blocks && !create) {
-+		printk(KERN_ERR "ASFS: asfsget_block: strange block request %ld!\n", block);
-+		return -EIO;
-+	} 
-+
-+	if (create)
-+#ifdef CONFIG_ASFS_RW
-+		ASFS_I(inode)->modified = TRUE;
-+#else
-+		return -EROFS;
-+#endif
-+
-+	if (block < inode->i_blocks)
-+		create = 0;
-+
-+	lock_super(sb);
-+
-+#ifdef CONFIG_ASFS_RW
-+	if (create) {
-+		int blockstoadd;
-+		u32 newspace, addedblocks;
-+
-+		blockstoadd = block - inode->i_blocks + 1;
-+
-+		if (blockstoadd < ASFS_BLOCKCHUNKS)
-+			blockstoadd = ASFS_BLOCKCHUNKS;
-+ 
-+		asfs_debug("ASFS get_block: Trying to add %d blocks to file\n", blockstoadd);
-+		
-+		if ((error = asfs_readobject(sb, inode->i_ino, &bh, &obj)) != 0) {
-+			unlock_super(sb);
-+			return error;
-+		}
-+
-+		if ((error = asfs_addblockstofile(sb, bh, obj, blockstoadd, &newspace, &addedblocks)) != 0) {
-+			asfs_brelse(bh);
-+			unlock_super(sb);
-+			return error;
-+		}
-+		ASFS_I(inode)->mmu_private += addedblocks * sb->s_blocksize;
-+		inode->i_blocks += addedblocks;
-+		ASFS_I(inode)->ext_cache.key = 0;
-+		ASFS_I(inode)->firstblock = be32_to_cpu(obj->object.file.data);
-+		asfs_brelse(bh);
-+	}
-+#endif
-+
-+	if (ASFS_I(inode)->ext_cache.key > 0 && ASFS_I(inode)->ext_cache.startblock <= block) {
-+		extent.key = ASFS_I(inode)->ext_cache.key;
-+		extent.next = ASFS_I(inode)->ext_cache.next;
-+		extent.blocks = ASFS_I(inode)->ext_cache.blocks;
-+		pos = ASFS_I(inode)->ext_cache.startblock;
-+	} else {
-+		if (asfs_getextent(inode->i_sb, ASFS_I(inode)->firstblock, &ebn_bh, &ebn_p) != 0) {
-+			unlock_super(sb);
-+			return -EIO;
-+		}
-+		extent.key = be32_to_cpu(ebn_p->key);
-+		extent.next = be32_to_cpu(ebn_p->next);
-+		extent.blocks = be16_to_cpu(ebn_p->blocks);
-+		pos = 0;
-+		asfs_brelse(ebn_bh);
-+	}
-+	ebn_p = &extent;
-+	filedata = ebn_p->next;
-+
-+	while (pos + ebn_p->blocks <= block && ebn_p->next != 0 && pos < inode->i_blocks) {
-+		pos += ebn_p->blocks;
-+		if (asfs_getextent(inode->i_sb, filedata, &ebn_bh, &ebn_p) != 0) {
-+			unlock_super(sb);
-+			return -EIO;
-+		}
-+		extent.key = be32_to_cpu(ebn_p->key);
-+		extent.next = be32_to_cpu(ebn_p->next);
-+		extent.blocks = be16_to_cpu(ebn_p->blocks);
-+		ebn_p = &extent;	
-+		filedata = ebn_p->next;
-+		asfs_brelse(ebn_bh);
-+	}
-+
-+	unlock_super(sb);
-+
-+	map_bh(bh_result, inode->i_sb, (sector_t) (ebn_p->key + block - pos));
-+
-+	if (create)
-+		set_buffer_new(bh_result);
-+
-+	asfs_debug("ASFS: get_block - mapped block %lu\n", ebn_p->key + block - pos);
-+
-+	ASFS_I(inode)->ext_cache.startblock = pos;
-+	ASFS_I(inode)->ext_cache.key = ebn_p->key;
-+	ASFS_I(inode)->ext_cache.next = ebn_p->next;
-+	ASFS_I(inode)->ext_cache.blocks = ebn_p->blocks;
-+
-+	return 0;
-+}
-+
-+int asfs_readpage(struct file *file, struct page *page)
-+{
-+	asfs_debug("ASFS: %s\n", __FUNCTION__);
-+	return block_read_full_page(page, asfs_get_block);
-+}
-+
-+sector_t asfs_bmap(struct address_space *mapping, sector_t block)
-+{
-+	asfs_debug("ASFS: %s\n", __FUNCTION__);
-+	return generic_block_bmap(mapping,block,asfs_get_block);
-+}
-+
-+#ifdef CONFIG_ASFS_RW
-+
-+int asfs_writepage(struct page *page, struct writeback_control *wbc)
-+{
-+	asfs_debug("ASFS: %s\n", __FUNCTION__);
-+	return block_write_full_page(page, asfs_get_block, wbc);
-+}
-+
-+int asfs_prepare_write(struct file *file, struct page *page, unsigned from, unsigned to)
-+{
-+	asfs_debug("ASFS: %s\n", __FUNCTION__);
-+	return cont_prepare_write(page, from, to, asfs_get_block, &ASFS_I(page->mapping->host)->mmu_private);
-+}
-+
-+void asfs_truncate(struct inode *inode)
-+{
-+	struct super_block *sb = inode->i_sb;
-+	struct buffer_head *bh;
-+	struct fsObject *obj;
-+
-+	asfs_debug("AFFS: truncate(inode=%d, oldsize=%u, newsize=%u)\n",
-+		 (u32)inode->i_ino, (u32)ASFS_I(inode)->mmu_private, (u32)inode->i_size);
-+
-+	if (inode->i_size > ASFS_I(inode)->mmu_private) {
-+		printk("ASFS: enlarging file is not supported yet\n");
-+		return;
-+	}
-+
-+	lock_super(sb);
-+
-+	if ((asfs_readobject(sb, inode->i_ino, &bh, &obj)) != 0) {
-+		unlock_super(sb);
-+		return;
-+	}
-+
-+	if (asfs_truncateblocksinfile(sb, bh, obj, inode->i_size) != 0) {
-+		asfs_brelse(bh);
-+		unlock_super(sb);
-+		return;
-+	}
-+		
-+	obj->object.file.size = cpu_to_be32(inode->i_size);
-+	ASFS_I(inode)->mmu_private = inode->i_size;
-+	ASFS_I(inode)->modified = TRUE;
-+	inode->i_blocks = (be32_to_cpu(obj->object.file.size) + sb->s_blocksize - 1) >> sb->s_blocksize_bits;
-+	asfs_bstore(sb, bh);
-+	asfs_brelse(bh);
-+
-+	unlock_super(sb);
-+}
-+
-+int asfs_file_open(struct inode *inode, struct file *filp)
-+{
-+	if (atomic_read(&filp->f_count) != 1)
-+		return 0;
-+	asfs_debug("ASFS: file open (node %d)\n", (int)inode->i_ino);
-+	return 0;
-+}
-+
-+int asfs_file_release(struct inode *inode, struct file *filp)
-+{
-+	int error = 0;
-+
-+	asfs_debug("ASFS: file release (node %d oc %d)\n", (int)inode->i_ino, atomic_read(&filp->f_count));
-+
-+	if (atomic_read(&filp->f_count) != 0)
-+		return 0;
-+
-+	if (ASFS_I(inode)->modified == TRUE) {
-+		struct buffer_head *bh;
-+		struct fsObject *obj;
-+		lock_super(inode->i_sb);
-+
-+		if ((error = asfs_readobject(inode->i_sb, inode->i_ino, &bh, &obj)) != 0) {
-+			unlock_super(inode->i_sb);
-+			return error;
-+		}
-+
-+		obj->datemodified = cpu_to_be32(inode->i_mtime.tv_sec - (365*8+2)*24*60*60);
-+		if (inode->i_mode & S_IFREG) {
-+			error = asfs_truncateblocksinfile(inode->i_sb, bh, obj, (u32)inode->i_size);
-+			obj->object.file.size = cpu_to_be32(inode->i_size);
-+			ASFS_I(inode)->mmu_private = inode->i_size;
-+			inode->i_blocks = (be32_to_cpu(obj->object.file.size) + inode->i_sb->s_blocksize - 1) >> inode->i_sb->s_blocksize_bits;
-+		}
-+		asfs_bstore(inode->i_sb, bh);
-+
-+		unlock_super(inode->i_sb);
-+
-+		asfs_brelse(bh);
-+	}
-+	ASFS_I(inode)->modified = FALSE;
-+
-+	return error;
-+}
-+
-+#endif
-diff -urN kernel-source-2.6.11-2.6.11-orig/fs/asfs/inode.c kernel-source-2.6.11-2.6.11/fs/asfs/inode.c
---- kernel-source-2.6.11-2.6.11-orig/fs/asfs/inode.c	1970-01-01 01:00:00.000000000 +0100
-+++ kernel-source-2.6.11-2.6.11/fs/asfs/inode.c	2005-03-04 18:37:12.778264744 +0100
-@@ -0,0 +1,414 @@
-+/*
-+ *
-+ * Amiga Smart File System, Linux implementation
-+ * version: 1.0beta7
-+ *  
-+ * Copyright (C) 2003,2004  Marek 'March' Szyprowski <marek at amiga.pl>
-+ *
-+ *
-+ * 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.
-+ *
-+ */
-+
-+#include <linux/types.h>
-+#include <linux/errno.h>
-+#include <linux/slab.h>
-+#include <linux/fs.h>
-+#include <linux/smp_lock.h>
-+#include <linux/time.h>
-+#include <linux/buffer_head.h>
-+#include <linux/vfs.h>
-+#include <linux/dirent.h>
-+#include "asfs_fs.h"
-+
-+#include <asm/byteorder.h>
-+
-+/* Mapping from our types to the kernel */
-+
-+static struct address_space_operations asfs_aops = {
-+	.readpage	= asfs_readpage,
-+	.sync_page	= block_sync_page,
-+	.bmap		= asfs_bmap,
-+#ifdef CONFIG_ASFS_RW
-+	.writepage	= asfs_writepage,
-+	.prepare_write = asfs_prepare_write,
-+	.commit_write = generic_commit_write,
-+#endif
-+};
-+
-+static struct file_operations asfs_file_operations = {
-+	.llseek		= generic_file_llseek,
-+	.read		= generic_file_read,
-+	.mmap		= generic_file_mmap,
-+#ifdef CONFIG_ASFS_RW
-+	.write		= generic_file_write,
-+	.open		= asfs_file_open,
-+	.release	= asfs_file_release,
-+	.fsync		= file_fsync,
-+#endif
-+};
-+
-+static struct file_operations asfs_dir_operations = {
-+	.read		= generic_read_dir,
-+	.readdir	= asfs_readdir,
-+};
-+
-+static struct inode_operations asfs_dir_inode_operations = {
-+	.lookup		= asfs_lookup,
-+#ifdef CONFIG_ASFS_RW
-+	.create		= asfs_create,
-+	.unlink		= asfs_unlink,
-+	.symlink	= asfs_symlink,
-+	.mkdir		= asfs_mkdir,
-+	.rmdir		= asfs_rmdir,
-+	.rename		= asfs_rename,
-+/*	.setattr	= asfs_notify_change,*/
-+#endif
-+};
-+
-+static struct inode_operations asfs_file_inode_operations = {
-+#ifdef CONFIG_ASFS_RW
-+	.truncate	= asfs_truncate,
-+/*	.setattr		= asfs_notify_change,*/
-+#endif
-+};
-+
-+static struct address_space_operations asfs_symlink_aops = {
-+	.readpage	= asfs_symlink_readpage,
-+};
-+
-+static struct inode_operations asfs_symlink_inode_operations = {
-+	.readlink	= page_readlink,
-+	.follow_link	= page_follow_link_light,
-+#ifdef CONFIG_ASFS_RW
-+/*	.setattr	= asfs_notify_change,*/
-+#endif
-+};
-+
-+void asfs_read_locked_inode(struct inode *inode, void *arg)
-+{
-+	struct super_block *sb = inode->i_sb;
-+	struct fsObject *obj = arg;
-+
-+	inode->i_mode = ASFS_SB(sb)->mode;
-+	inode->i_mtime.tv_sec = inode->i_atime.tv_sec = inode->i_ctime.tv_sec = be32_to_cpu(obj->datemodified) + (365*8+2)*24*60*60;  
-+	/* Linux: seconds since 01-01-1970, AmigaSFS: seconds since 01-01-1978 */
-+	inode->i_mtime.tv_nsec = inode->i_ctime.tv_nsec = inode->i_atime.tv_nsec = 0;
-+	inode->i_uid = ASFS_SB(sb)->uid;
-+	inode->i_gid = ASFS_SB(sb)->gid;
-+
-+	asfs_debug("asfs_read_inode2: Setting-up node %lu... ", inode->i_ino);
-+
-+	if (obj->bits & OTYPE_DIR) {
-+		asfs_debug("dir (FirstdirBlock: %u, HashTable %u)\n", \
-+		           be32_to_cpu(obj->object.dir.firstdirblock), be32_to_cpu(obj->object.dir.hashtable));
-+
-+		inode->i_size = 0;
-+		inode->i_op = &asfs_dir_inode_operations;
-+		inode->i_fop = &asfs_dir_operations;
-+		inode->i_mode |= S_IFDIR | ((inode->i_mode & 0400) ? 0100 : 0) | 
-+		              ((inode->i_mode & 0040) ? 0010 : 0) | ((inode->i_mode & 0004) ? 0001 : 0);
-+		ASFS_I(inode)->firstblock = be32_to_cpu(obj->object.dir.firstdirblock);
-+		ASFS_I(inode)->hashtable = be32_to_cpu(obj->object.dir.hashtable);
-+		ASFS_I(inode)->modified = 0;
-+	} else if (obj->bits & OTYPE_LINK && !(obj->bits & OTYPE_HARDLINK)) {
-+		asfs_debug("symlink\n");
-+		inode->i_size = 0;
-+		inode->i_op = &asfs_symlink_inode_operations;
-+		inode->i_mapping->a_ops = &asfs_symlink_aops;
-+		inode->i_mode |= S_IFLNK | S_IRWXUGO;
-+		ASFS_I(inode)->firstblock = be32_to_cpu(obj->object.file.data);
-+	} else {
-+		asfs_debug("file (Size: %u, FirstBlock: %u)\n", be32_to_cpu(obj->object.file.size), be32_to_cpu(obj->object.file.data));
-+		inode->i_size = be32_to_cpu(obj->object.file.size);
-+		inode->i_blocks = (be32_to_cpu(obj->object.file.size) + sb->s_blocksize - 1) >> sb->s_blocksize_bits;
-+		inode->i_op = &asfs_file_inode_operations;
-+		inode->i_fop = &asfs_file_operations;
-+		inode->i_mapping->a_ops = &asfs_aops;
-+		inode->i_mode |= S_IFREG;
-+		ASFS_I(inode)->firstblock = be32_to_cpu(obj->object.file.data);
-+		ASFS_I(inode)->ext_cache.startblock = 0;
-+		ASFS_I(inode)->ext_cache.key = 0;
-+		ASFS_I(inode)->mmu_private = inode->i_size;
-+	}
-+	return;	
-+}
-+
-+struct inode *asfs_get_root_inode(struct super_block *sb)
-+{
-+	struct inode *result = NULL;
-+	struct fsObject *obj;
-+	struct buffer_head *bh;
-+
-+	asfs_debug("asfs_get_root_inode\n");
-+
-+	if ((bh = asfs_breadcheck(sb, ASFS_SB(sb)->rootobjectcontainer, ASFS_OBJECTCONTAINER_ID))) {
-+		obj = &(((struct fsObjectContainer *)bh->b_data)->object[0]);
-+		if (be32_to_cpu(obj->objectnode) > 0)
-+			result = iget_locked(sb, be32_to_cpu(obj->objectnode));
-+
-+		if (result != NULL && result->i_state & I_NEW) {
-+			asfs_read_locked_inode(result, obj);
-+			unlock_new_inode(result);
-+		}
-+		asfs_brelse(bh);
-+	}
-+	return result;
-+}
-+
-+#ifdef CONFIG_ASFS_RW
-+
-+static void asfs_sync_dir_inode(struct inode *dir, struct fsObject *obj)
-+{
-+	ASFS_I(dir)->firstblock = be32_to_cpu(obj->object.dir.firstdirblock);
-+	ASFS_I(dir)->modified = 1;
-+	dir->i_mtime = dir->i_atime = dir->i_ctime = CURRENT_TIME;
-+	obj->datemodified = cpu_to_be32(dir->i_mtime.tv_sec - (365*8+2)*24*60*60);
-+}
-+
-+enum { it_file, it_dir, it_link };
-+
-+static int asfs_create_object(struct inode *dir, struct dentry *dentry, int mode, int type, const char *symname)
-+{
-+	int error;
-+	struct super_block *sb = dir->i_sb;
-+	struct inode *inode;
-+	struct buffer_head *bh, *dir_bh;
-+	struct fsObject obj_data, *dir_obj, *obj;
-+	u8 *name = (u8 *) dentry->d_name.name;
-+
-+	asfs_debug("asfs_create_obj %s in dir node %d\n", name, (int)dir->i_ino);
-+
-+	sb = dir->i_sb;
-+	inode = new_inode(sb);
-+	if (!inode)
-+		return -ENOMEM;
-+
-+	memset(&obj_data, 0, sizeof(struct fsObject));
-+
-+	obj_data.protection = cpu_to_be32(FIBF_READ|FIBF_WRITE|FIBF_EXECUTE|FIBF_DELETE);
-+	obj_data.datemodified = cpu_to_be32(inode->i_mtime.tv_sec - (365*8+2)*24*60*60);
-+	switch (type) {
-+	case it_dir:
-+		obj_data.bits = OTYPE_DIR;
-+		break;
-+	case it_link:
-+		obj_data.bits = OTYPE_LINK;
-+		break;
-+	default:
-+		break;
-+	}
-+
-+	lock_super(sb);
-+
-+	if ((error = asfs_readobject(sb, dir->i_ino, &dir_bh, &dir_obj)) != 0) {
-+		dec_count(inode);
-+		unlock_super(sb);
-+		return error;
-+	}
-+
-+	bh = dir_bh;
-+	obj = dir_obj;
-+
-+	if ((error = asfs_createobject(sb, &bh, &obj, &obj_data, name, FALSE)) != 0) {
-+		asfs_brelse(dir_bh);
-+		dec_count(inode);
-+		unlock_super(sb);
-+		return error;
-+	}
-+
-+	inode->i_ino = be32_to_cpu(obj->objectnode);
-+	inode->i_mtime = inode->i_atime = inode->i_ctime = CURRENT_TIME;
-+	inode->i_size = inode->i_blocks = inode->i_blksize = 0;
-+	inode->i_uid = dir->i_uid;
-+	inode->i_gid = dir->i_gid;
-+	inode->i_mode = mode | ASFS_SB(sb)->mode;
-+
-+	switch (type) {
-+	case it_dir:
-+		inode->i_mode |= S_IFDIR;
-+		inode->i_op = &asfs_dir_inode_operations;
-+		inode->i_fop = &asfs_dir_operations;
-+		ASFS_I(inode)->firstblock = be32_to_cpu(obj->object.dir.firstdirblock);
-+		ASFS_I(inode)->hashtable = be32_to_cpu(obj->object.dir.hashtable);
-+		ASFS_I(inode)->modified = 0;
-+		break;
-+	case it_file:
-+		inode->i_mode |= S_IFREG;
-+		inode->i_op = &asfs_file_inode_operations;
-+		inode->i_fop = &asfs_file_operations;
-+		inode->i_mapping->a_ops = &asfs_aops;
-+		ASFS_I(inode)->firstblock = be32_to_cpu(obj->object.file.data);
-+		ASFS_I(inode)->ext_cache.startblock = 0;
-+		ASFS_I(inode)->ext_cache.key = 0;
-+		ASFS_I(inode)->mmu_private = inode->i_size;
-+		break;
-+	case it_link:
-+		inode->i_mode = S_IFLNK | S_IRWXUGO;
-+		inode->i_op = &page_symlink_inode_operations;
-+		inode->i_mapping->a_ops = &asfs_symlink_aops;
-+		ASFS_I(inode)->firstblock = be32_to_cpu(obj->object.file.data);
-+		error = asfs_write_symlink(inode, symname);
-+		break;
-+	default:
-+		break;
-+	}
-+
-+	asfs_bstore(sb, bh);
-+	insert_inode_hash(inode);
-+	mark_inode_dirty(inode);
-+	d_instantiate(dentry, inode);
-+	asfs_sync_dir_inode(dir, dir_obj);
-+	asfs_bstore(sb, dir_bh); 
-+
-+	unlock_super(sb);
-+	asfs_brelse(bh);
-+	asfs_brelse(dir_bh);
-+	
-+	return error;
-+}
-+
-+int asfs_create(struct inode *dir, struct dentry *dentry, int mode, struct nameidata *nd)
-+{
-+	return asfs_create_object(dir, dentry, mode, it_file, NULL);
-+}
-+
-+int asfs_mkdir(struct inode *dir, struct dentry *dentry, int mode)
-+{
-+	return asfs_create_object(dir, dentry, mode, it_dir, NULL);
-+}
-+
-+int asfs_symlink(struct inode *dir, struct dentry *dentry, const char *symname)
-+{
-+	return asfs_create_object(dir, dentry, 0, it_link, symname);
-+}
-+
-+int asfs_rmdir(struct inode *dir, struct dentry *dentry)
-+{
-+	asfs_debug("ASFS: %s\n", __FUNCTION__);
-+
-+	if (ASFS_I(dentry->d_inode)->firstblock != 0)
-+		return -ENOTEMPTY;
-+	
-+	return asfs_unlink(dir, dentry);
-+}
-+
-+int asfs_unlink(struct inode *dir, struct dentry *dentry)
-+{
-+	struct inode *inode = dentry->d_inode;
-+	int error;
-+	struct super_block *sb = dir->i_sb;
-+	struct buffer_head *bh, *dir_bh;
-+	struct fsObject *dir_obj, *obj;
-+
-+	asfs_debug("ASFS: %s\n", __FUNCTION__);
-+
-+	lock_super(sb);
-+
-+	if ((error = asfs_readobject(sb, inode->i_ino, &bh, &obj)) != 0) {
-+		unlock_super(sb);
-+		return error;
-+	}
-+	if ((error = asfs_deleteobject(sb, bh, obj)) != 0) {
-+		asfs_brelse(bh);
-+		unlock_super(sb);
-+		return error;
-+	}
-+	asfs_brelse(bh);
-+
-+	/* directory data could change after removing the object */
-+	if ((error = asfs_readobject(sb, dir->i_ino, &dir_bh, &dir_obj)) != 0) {
-+		unlock_super(sb);
-+		return error;
-+	}
-+
-+	asfs_sync_dir_inode(dir, dir_obj);
-+	asfs_bstore(sb, dir_bh); 
-+
-+	dec_count(inode);
-+	unlock_super(sb);
-+	asfs_brelse(dir_bh);
-+
-+	return 0;
-+}
-+
-+int asfs_rename(struct inode *old_dir, struct dentry *old_dentry, struct inode *new_dir, struct dentry *new_dentry)
-+{
-+	struct super_block *sb = old_dir->i_sb;
-+	struct buffer_head *src_bh, *old_bh, *new_bh;
-+	int error;
-+	struct fsObject *src_obj, *old_obj, *new_obj;
-+
-+	asfs_debug("ASFS: rename (old=%u,\"%*s\" to new=%u,\"%*s\")\n",
-+		 (u32)old_dir->i_ino, (int)old_dentry->d_name.len, old_dentry->d_name.name,
-+		 (u32)new_dir->i_ino, (int)new_dentry->d_name.len, new_dentry->d_name.name);
-+
-+	/* Unlink destination if it already exists */
-+	if (new_dentry->d_inode) 
-+		if ((error = asfs_unlink(new_dir, new_dentry)) != 0)
-+			return error;
-+
-+	lock_super(sb);
-+
-+	if ((error = asfs_readobject(sb, old_dentry->d_inode->i_ino, &src_bh, &src_obj)) != 0) {
-+		unlock_super(sb);
-+		return error;
-+	}
-+	if ((error = asfs_readobject(sb, new_dir->i_ino, &new_bh, &new_obj)) != 0) {
-+		asfs_brelse(src_bh);
-+		unlock_super(sb);
-+		return error;
-+	}
-+
-+	if ((error = asfs_renameobject(sb, src_bh, src_obj, new_bh, new_obj, (u8 *) new_dentry->d_name.name)) != 0) {
-+		asfs_brelse(src_bh);
-+		asfs_brelse(new_bh);
-+		unlock_super(sb);
-+		return error;
-+	}
-+	asfs_brelse(src_bh);
-+	asfs_brelse(new_bh);
-+
-+	if ((error = asfs_readobject(sb, old_dir->i_ino, &old_bh, &old_obj)) != 0) {
-+		unlock_super(sb);
-+		return error;
-+	}
-+	if ((error = asfs_readobject(sb, new_dir->i_ino, &new_bh, &new_obj)) != 0) {
-+		asfs_brelse(old_bh);
-+		unlock_super(sb);
-+		return error;
-+	}
-+
-+	asfs_sync_dir_inode(old_dir, old_obj);
-+	asfs_sync_dir_inode(new_dir, new_obj);
-+
-+	asfs_bstore(sb, new_bh);	
-+	asfs_bstore(sb, old_bh);
-+
-+	unlock_super(sb);
-+	asfs_brelse(old_bh);
-+	asfs_brelse(new_bh);
-+
-+	mark_inode_dirty(old_dir);
-+	mark_inode_dirty(new_dir);
-+
-+	return 0;
-+}
-+
-+/*
-+int asfs_notify_change(struct dentry *dentry, struct iattr *attr)
-+{
-+	struct inode *inode = dentry->d_inode;
-+	int error = 0;
-+
-+	asfs_debug("ASFS: notify_change(%lu,0x%x)\n",inode->i_ino,attr->ia_valid);
-+
-+	error = inode_change_ok(inode,attr);
-+
-+	return error;
-+}
-+*/
-+#endif
-diff -urN kernel-source-2.6.11-2.6.11-orig/fs/asfs/Makefile kernel-source-2.6.11-2.6.11/fs/asfs/Makefile
---- kernel-source-2.6.11-2.6.11-orig/fs/asfs/Makefile	1970-01-01 01:00:00.000000000 +0100
-+++ kernel-source-2.6.11-2.6.11/fs/asfs/Makefile	2005-03-04 18:37:12.779264592 +0100
-@@ -0,0 +1,8 @@
-+#
-+# Makefile for the linux asfs filesystem routines.
-+#
-+
-+obj-$(CONFIG_ASFS_FS) += asfs.o
-+
-+asfs-y += dir.o extents.o file.o inode.o namei.o nodes.o objects.o super.o symlink.o
-+asfs-$(CONFIG_ASFS_RW) += adminspace.o bitfuncs.o 
-diff -urN kernel-source-2.6.11-2.6.11-orig/fs/asfs/namei.c kernel-source-2.6.11-2.6.11/fs/asfs/namei.c
---- kernel-source-2.6.11-2.6.11-orig/fs/asfs/namei.c	1970-01-01 01:00:00.000000000 +0100
-+++ kernel-source-2.6.11-2.6.11/fs/asfs/namei.c	2005-03-04 18:37:12.780264440 +0100
-@@ -0,0 +1,155 @@
-+/*
-+ *
-+ * Amiga Smart File System, Linux implementation
-+ * version: 1.0beta7
-+ *
-+ * Copyright (C) 2003,2004  Marek 'March' Szyprowski <marek at amiga.pl>
-+ *
-+ *
-+ * 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.
-+ *
-+ */
-+
-+#include <linux/types.h>
-+#include <linux/errno.h>
-+#include <linux/slab.h>
-+#include <linux/string.h>
-+#include <linux/fs.h>
-+#include <linux/buffer_head.h>
-+#include <linux/vfs.h>
-+#include <linux/string.h>
-+#include "asfs_fs.h"
-+
-+static inline u8 asfs_upperchar(u8 c)
-+{
-+	if ((c >= 224 && c <= 254 && c != 247) || (c >= 'a' && c <= 'z'))
-+		c -= 32;
-+	return (c);
-+}
-+
-+u8 asfs_lowerchar(u8 c)
-+{
-+	if ((c >= 192 && c <= 222 && c != 215) || (c >= 'A' && c <= 'Z'))
-+		c += 32;
-+	return (c);
-+}
-+
-+/* Check if the name is valid for a asfs object. */
-+
-+static inline int asfs_check_name(const u8 *name, int len)
-+{
-+	int i;
-+
-+	if (len > ASFS_MAXFN)
-+		return -ENAMETOOLONG;
-+
-+	for (i = 0; i < len; i++)
-+		if (name[i] < ' ' || name[i] == ':' || (name[i] > 0x7e && name[i] < 0xa0))
-+			return -EINVAL;
-+
-+	return 0;
-+}
-+
-+/* Note: the dentry argument is the parent dentry. */
-+
-+static int asfs_hash_dentry(struct dentry *dentry, struct qstr *qstr)
-+{
-+	struct super_block *sb = dentry->d_inode->i_sb;
-+	const u8 *name = qstr->name;
-+	unsigned long hash;
-+	int i;
-+
-+	i = asfs_check_name(qstr->name,qstr->len);
-+	if (i)
-+		return i;
-+
-+	hash = init_name_hash();
-+
-+	if (ASFS_SB(sb)->flags & ASFS_ROOTBITS_CASESENSITIVE)
-+		for (i=qstr->len; i > 0; name++, i--)
-+			hash = partial_name_hash(*name, hash);
-+	else
-+		for (i=qstr->len; i > 0; name++, i--)
-+			hash = partial_name_hash(asfs_upperchar(*name), hash);
-+
-+	qstr->hash = end_name_hash(hash);
-+
-+	return 0;
-+}
-+
-+static int asfs_compare_dentry(struct dentry *dentry, struct qstr *a, struct qstr *b)
-+{
-+	struct super_block *sb = dentry->d_inode->i_sb;
-+	const u8 *aname = a->name;
-+	const u8 *bname = b->name;
-+	int len;
-+
-+	/* 'a' is the qstr of an already existing dentry, so the name
-+	 * must be valid. 'b' must be validated first.
-+	 */
-+
-+	if (asfs_check_name(b->name,b->len))
-+		return 1;
-+
-+	if (a->len != b->len)
-+		return 1;
-+
-+	if (ASFS_SB(sb)->flags & ASFS_ROOTBITS_CASESENSITIVE) {
-+		for (len=a->len; len > 0; len--)
-+			if (*aname++ != *bname++)
-+				return 1;
-+	} else {
-+		for (len=a->len; len > 0; len--)
-+			if (asfs_upperchar(*aname++) != asfs_upperchar(*bname++))
-+				return 1;
-+	}
-+
-+	return 0;
-+}
-+
-+struct dentry_operations asfs_dentry_operations = {
-+	d_hash:		asfs_hash_dentry,
-+	d_compare:	asfs_compare_dentry,
-+};
-+
-+int asfs_namecmp(u8 *s, u8 *ct, int casesensitive)
-+{
-+	if (casesensitive) {
-+		while (*s == *ct && *ct != '\0' && *ct != '/') {
-+			s++;
-+			ct++;
-+		}
-+	} else {
-+		while (asfs_upperchar(*s) == asfs_upperchar(*ct) && *ct != '\0'
-+		       && *ct != '/') {
-+			s++;
-+			ct++;
-+		}
-+	}
-+	return (*s == '\0' && (*ct == '\0' || *ct == '/')) ? 0 : *ct - *s;
-+}
-+
-+u16 asfs_hash(u8 *name, int casesensitive)
-+{
-+	u16 hashval = 0;
-+	while (name[hashval] != 0 && name[hashval] != '/')
-+		hashval++;
-+	if (casesensitive) {
-+		u8 c = *name;
-+		while (c != 0 && c != '/') {
-+			hashval = hashval * 13 + c;
-+			c = *++name;
-+		}
-+	} else {
-+		u8 c = *name;
-+		while (c != 0 && c != '/') {
-+			hashval = hashval * 13 + asfs_upperchar(c);
-+			c = *++name;
-+		}
-+	}
-+	return hashval;
-+}
-+
-diff -urN kernel-source-2.6.11-2.6.11-orig/fs/asfs/nodes.c kernel-source-2.6.11-2.6.11/fs/asfs/nodes.c
---- kernel-source-2.6.11-2.6.11-orig/fs/asfs/nodes.c	1970-01-01 01:00:00.000000000 +0100
-+++ kernel-source-2.6.11-2.6.11/fs/asfs/nodes.c	2005-03-04 18:37:12.833256384 +0100
-@@ -0,0 +1,455 @@
-+/*
-+ *
-+ * Amiga Smart File System, Linux implementation
-+ * version: 1.0beta7
-+ *
-+ * This file contains some parts of the original amiga version of 
-+ * SmartFilesystem source code.
-+ *
-+ * SmartFilesystem is copyrighted (C) 2003 by: John Hendrikx, 
-+ * Ralph Schmidt, Emmanuel Lesueur, David Gerber and Marcin Kurek
-+ * 
-+ * Adapted and modified by Marek 'March' Szyprowski <marek at amiga.pl>
-+ *
-+ */
-+
-+#include <linux/types.h>
-+#include <linux/errno.h>
-+#include <linux/slab.h>
-+#include <linux/fs.h>
-+#include <linux/buffer_head.h>
-+#include <linux/vfs.h>
-+#include "asfs_fs.h"
-+
-+#include <asm/byteorder.h>
-+
-+/* Finds a specific node by number. */
-+int asfs_getnode(struct super_block *sb, u32 nodeno, struct buffer_head **ret_bh, struct fsObjectNode **ret_node)
-+{
-+	struct buffer_head *bh;
-+	struct fsNodeContainer *nodecont;
-+	u32 nodeindex = ASFS_SB(sb)->objectnoderoot;
-+
-+	while ((bh = asfs_breadcheck(sb, nodeindex, ASFS_NODECONTAINER_ID))) {
-+		nodecont = (struct fsNodeContainer *) bh->b_data;
-+
-+		if (be32_to_cpu(nodecont->nodes) == 1) {
-+			*ret_node = (struct fsObjectNode *) ((u8 *) nodecont->node + NODE_STRUCT_SIZE * (nodeno - be32_to_cpu(nodecont->nodenumber)));
-+			*ret_bh = bh;
-+			return 0;
-+		} else {
-+			u16 containerentry = (nodeno - be32_to_cpu(nodecont->nodenumber)) / be32_to_cpu(nodecont->nodes);
-+			nodeindex = be32_to_cpu(nodecont->node[containerentry]) >> (sb->s_blocksize_bits - ASFS_BLCKFACCURACY);
-+		}
-+		asfs_brelse(bh);
-+	}
-+	if (bh == NULL)
-+		return -EIO;
-+	return -ENOENT;
-+}
-+
-+#ifdef CONFIG_ASFS_RW
-+
-+	/* Looks for the parent of the passed-in buffer_head (fsNodeContainer)
-+	   starting from the root.  It returns an error if any error occured.
-+	   If error is 0 and io_bh is NULL as well, then there was no parent (ie,
-+	   you asked parent of the root).  Otherwise io_bh should contain the
-+	   parent of the passed-in NodeContainer. */
-+
-+static int parentnodecontainer(struct super_block *sb, struct buffer_head **io_bh)
-+{
-+	u32 noderoot = ASFS_SB(sb)->objectnoderoot;
-+	u32 childblock = be32_to_cpu(((struct fsBlockHeader *) (*io_bh)->b_data)->ownblock);
-+	u32 nodenumber = be32_to_cpu(((struct fsNodeContainer *) (*io_bh)->b_data)->nodenumber);
-+	int errorcode = 0;
-+
-+	if (noderoot == childblock) {
-+		*io_bh = NULL;
-+		return 0;
-+	}
-+
-+	while ((*io_bh = asfs_breadcheck(sb, noderoot, ASFS_NODECONTAINER_ID))) {
-+		struct fsNodeContainer *nc = (void *) (*io_bh)->b_data;
-+
-+		if (be32_to_cpu(nc->nodes) == 1) {
-+			/* We've descended the tree to a leaf NodeContainer, something
-+			   which should never happen if the passed-in io_bh had
-+			   contained a valid fsNodeContainer. */
-+			printk("ASFS: Failed to locate the parent NodeContainer - node tree is corrupted!\n");
-+			*io_bh = NULL;
-+			return -EIO;
-+		} else {
-+			u16 containerentry = (nodenumber - be32_to_cpu(nc->nodenumber)) / be32_to_cpu(nc->nodes);
-+			noderoot = be32_to_cpu(nc->node[containerentry]) >> (sb->s_blocksize_bits - ASFS_BLCKFACCURACY);
-+		}
-+
-+		if (noderoot == childblock)
-+			break;
-+
-+		asfs_brelse(*io_bh);
-+	}
-+
-+	if (*io_bh == NULL)
-+		return -EIO;
-+
-+	return errorcode;
-+}
-+
-+
-+static int isfull(struct super_block *sb, struct fsNodeContainer *nc)
-+{
-+	u32 *p = nc->node;
-+	s16 n = NODECONT_BLOCK_COUNT;
-+
-+	while (--n >= 0) {
-+		if (*p == 0 || (be32_to_cpu(*p) & 0x00000001) == 0) {
-+			break;
-+		}
-+		p++;
-+	}
-+
-+	return n < 0;
-+}
-+
-+static int markparentfull(struct super_block *sb, struct buffer_head *bh)
-+{
-+	u32 nodenumber = be32_to_cpu(((struct fsNodeContainer *) (bh->b_data))->nodenumber);
-+	int errorcode;
-+
-+	if ((errorcode = parentnodecontainer(sb, &bh)) == 0 && bh != 0) {
-+		struct fsNodeContainer *nc = (void *) bh->b_data;
-+		u16 containerentry = (nodenumber - be32_to_cpu(nc->nodenumber)) / be32_to_cpu(nc->nodes);
-+
-+		nc->node[containerentry] = cpu_to_be32(be32_to_cpu(nc->node[containerentry]) | 0x00000001);
-+
-+		asfs_bstore(sb, bh);
-+
-+		if (isfull(sb, nc)) {	/* This container now is full as well!  Mark the next higher up container too then! */
-+			return markparentfull(sb, bh);
-+		}
-+		asfs_brelse(bh);
-+	}
-+
-+	return errorcode;
-+}
-+
-+static int addnewnodelevel(struct super_block *sb, u16 nodesize)
-+{
-+	struct buffer_head *bh;
-+	u32 noderoot = ASFS_SB(sb)->objectnoderoot;
-+	int errorcode;
-+
-+	/* Adds a new level to the Node tree. */
-+
-+	asfs_debug("addnewnodelevel: Entry\n");
-+
-+	if ((bh = asfs_breadcheck(sb, noderoot, ASFS_NODECONTAINER_ID))) {
-+		struct buffer_head *newbh;
-+		u32 newblock;
-+
-+		if ((errorcode = asfs_allocadminspace(sb, &newblock)) == 0 && (newbh = asfs_getzeroblk(sb, newblock))) {
-+			struct fsNodeContainer *nc = (void *) bh->b_data;
-+			struct fsNodeContainer *newnc = (void *) newbh->b_data;
-+
-+			/* The newly allocated block will become a copy of the current root. */
-+
-+			newnc->bheader.id = cpu_to_be32(ASFS_NODECONTAINER_ID);
-+			newnc->bheader.ownblock = cpu_to_be32(newblock);
-+			newnc->nodenumber = nc->nodenumber;
-+			newnc->nodes = nc->nodes;
-+			memcpy(newnc->node, nc->node, sb->s_blocksize - sizeof(struct fsNodeContainer));
-+
-+			asfs_bstore(sb, newbh);
-+			asfs_brelse(newbh);
-+
-+			/* The current root will now be transformed into a new root. */
-+
-+			if (be32_to_cpu(nc->nodes) == 1)
-+				nc->nodes = cpu_to_be32((sb->s_blocksize - sizeof(struct fsNodeContainer)) / nodesize);
-+			else
-+				nc->nodes = cpu_to_be32(be32_to_cpu(nc->nodes) * NODECONT_BLOCK_COUNT);
-+
-+			nc->node[0] = cpu_to_be32((newblock << (sb->s_blocksize_bits - ASFS_BLCKFACCURACY)) + 1);	/* Tree is full from that point! */
-+			memset(&nc->node[1], 0, sb->s_blocksize - sizeof(struct fsNodeContainer) - 4);
-+
-+			asfs_bstore(sb, bh);
-+		}
-+		asfs_brelse(bh);
-+	} else
-+		errorcode = -EIO;
-+
-+	return errorcode;
-+}
-+
-+static int createnodecontainer(struct super_block *sb, u32 nodenumber, u32 nodes, u32 * returned_block)
-+{
-+	struct buffer_head *bh;
-+	int errorcode;
-+	u32 newblock;
-+
-+	asfs_debug("createnodecontainer: nodenumber = %u, nodes = %u\n", nodenumber, nodes);
-+
-+	if ((errorcode = asfs_allocadminspace(sb, &newblock)) == 0 && (bh = asfs_getzeroblk(sb, newblock))) {
-+		struct fsNodeContainer *nc = (void *) bh->b_data;
-+
-+		nc->bheader.id = cpu_to_be32(ASFS_NODECONTAINER_ID);
-+		nc->bheader.ownblock = cpu_to_be32(newblock);
-+
-+		nc->nodenumber = cpu_to_be32(nodenumber);
-+		nc->nodes = cpu_to_be32(nodes);
-+
-+		asfs_bstore(sb, bh);
-+		asfs_brelse(bh);
-+		*returned_block = newblock;
-+	}
-+
-+	return errorcode;
-+}
-+
-+	/* This function creates a new fsNode structure in a fsNodeContainer.  If needed
-+	   it will create a new fsNodeContainers and a new fsNodeIndexContainer. */
-+
-+int asfs_createnode(struct super_block *sb, struct buffer_head **returned_bh, struct fsNode **returned_node, u32 * returned_nodeno)
-+{
-+	u16 nodecount = (sb->s_blocksize - sizeof(struct fsNodeContainer)) / NODE_STRUCT_SIZE;
-+	u32 noderoot = ASFS_SB(sb)->objectnoderoot;
-+	u32 nodeindex = noderoot;
-+	int errorcode = 0;
-+
-+	while ((*returned_bh = asfs_breadcheck(sb, nodeindex, ASFS_NODECONTAINER_ID))) {
-+		struct fsNodeContainer *nc = (void *) (*returned_bh)->b_data;
-+
-+		if (be32_to_cpu(nc->nodes) == 1) {	/* Is it a leaf-container? */
-+			struct fsNode *n;
-+			s16 i = nodecount;
-+
-+			n = (struct fsNode *) nc->node;
-+
-+			while (i-- > 0) {
-+				if (n->data == 0)
-+					break;
-+
-+				n = (struct fsNode *) ((u8 *) n + NODE_STRUCT_SIZE);
-+			}
-+
-+			if (i >= 0) {
-+				/* Found an empty fsNode structure! */
-+				*returned_node = n;
-+				*returned_nodeno = be32_to_cpu(nc->nodenumber) + ((u8 *) n - (u8 *) nc->node) / NODE_STRUCT_SIZE;
-+
-+				asfs_debug("createnode: Created Node %d\n", *returned_nodeno);
-+
-+				/* Below we continue to look through the NodeContainer block.  We skip the entry
-+				   we found to be unused, and see if there are any more unused entries.  If we
-+				   do not find any more unused entries then this container is now full. */
-+
-+				n = (struct fsNode *) ((u8 *) n + NODE_STRUCT_SIZE);
-+
-+				while (i-- > 0) {
-+					if (n->data == 0)
-+						break;
-+
-+					n = (struct fsNode *) ((u8 *) n + NODE_STRUCT_SIZE);
-+				}
-+
-+				if (i < 0) {
-+					/* No more empty fsNode structures in this block.  Mark parent full. */
-+					errorcode = markparentfull(sb, *returned_bh);
-+				}
-+
-+				return errorcode;
-+			} else {
-+				/* What happened now is that we found a leaf-container which was
-+				   completely filled.  In practice this should only happen when there
-+				   is only a single NodeContainer (only this container), or when there
-+				   was an error in one of the full-bits in a higher level container. */
-+
-+				if (noderoot != nodeindex) {
-+					/*** Hmmm... it looks like there was a damaged full-bit or something.
-+					     In this case we'd probably better call markcontainerfull. */
-+
-+					printk("ASFS: Couldn't find empty Node in NodeContainer while NodeIndexContainer indicated there should be one!\n");
-+
-+					errorcode = -ENOSPC;
-+					break;
-+				} else {
-+					/* Container is completely filled. */
-+
-+					if ((errorcode = addnewnodelevel(sb, NODE_STRUCT_SIZE)) != 0)
-+						return errorcode;
-+
-+					nodeindex = noderoot;
-+				}
-+			}
-+		} else {	/* This isn't a leaf container */
-+			u32 *p = nc->node;
-+			s16 i = NODECONT_BLOCK_COUNT;
-+
-+			/* We've read a normal container */
-+
-+			while (i-- > 0) {
-+				if (*p != 0 && (be32_to_cpu(*p) & 0x00000001) == 0)
-+					break;
-+
-+				p++;
-+			}
-+
-+			if (i >= 0) {
-+				/* Found a not completely filled Container */
-+
-+				nodeindex = be32_to_cpu(*p) >> (sb->s_blocksize_bits - ASFS_BLCKFACCURACY);
-+			} else {
-+				/* Everything in the NodeIndexContainer was completely filled.  There possibly
-+				   are some unused pointers in this block however.  */
-+
-+				asfs_debug("createnode: NodeContainer at block has no empty Nodes.\n");
-+
-+				p = nc->node;
-+				i = NODECONT_BLOCK_COUNT;
-+
-+				while (i-- > 0) {
-+					if (*p == 0)
-+						break;
-+
-+					p++;
-+				}
-+
-+				if (i >= 0) {
-+					u32 newblock;
-+					u32 nodes;
-+
-+					/* Found an unused Container pointer */
-+
-+					if (be32_to_cpu(nc->nodes) == (sb->s_blocksize - sizeof(struct fsNodeContainer)) / NODE_STRUCT_SIZE) {
-+						nodes = 1;
-+					} else {
-+						nodes = be32_to_cpu(nc->nodes) / NODECONT_BLOCK_COUNT;
-+					}
-+
-+					if ((errorcode = createnodecontainer(sb, be32_to_cpu(nc->nodenumber) + (p - nc->node) * be32_to_cpu(nc->nodes), nodes, &newblock)) != 0) {
-+						break;
-+					}
-+
-+					*p = cpu_to_be32(newblock << (sb->s_blocksize_bits - ASFS_BLCKFACCURACY));
-+
-+					asfs_bstore(sb, *returned_bh);
-+				} else {
-+					/* Container is completely filled.  This must be the top-level NodeIndex container
-+					   as otherwise the full-bit would have been wrong! */
-+
-+					if ((errorcode = addnewnodelevel(sb, NODE_STRUCT_SIZE)) != 0)
-+						break;
-+
-+					nodeindex = noderoot;
-+				}
-+			}
-+		}
-+		asfs_brelse(*returned_bh);
-+	}
-+
-+	if (*returned_bh == NULL)
-+		return -EIO;
-+
-+	return (errorcode);
-+}
-+
-+static int markparentempty(struct super_block *sb, struct buffer_head *bh)
-+{
-+	u32 nodenumber = be32_to_cpu(((struct fsNodeContainer *) bh->b_data)->nodenumber);
-+	int errorcode;
-+
-+	if ((errorcode = parentnodecontainer(sb, &bh)) == 0 && bh != 0) {
-+		struct fsNodeContainer *nc = (void *) bh->b_data;
-+		int wasfull;
-+		u16 containerentry = (nodenumber - be32_to_cpu(nc->nodenumber)) / be32_to_cpu(nc->nodes);
-+
-+		wasfull = isfull(sb, nc);
-+
-+		nc->node[containerentry] = cpu_to_be32(be32_to_cpu(nc->node[containerentry]) & ~0x00000001);
-+
-+		asfs_bstore(sb, bh);
-+
-+		if (wasfull) {
-+			/* This container was completely full before!  Mark the next higher up container too then! */
-+			return markparentempty(sb, bh);
-+		}
-+		asfs_brelse(bh);
-+	}
-+
-+	return errorcode;
-+}
-+
-+static int freecontainer(struct super_block *sb, struct buffer_head *bh)
-+{
-+	u32 nodenumber = be32_to_cpu(((struct fsNodeContainer *) bh->b_data)->nodenumber);
-+	int errorcode;
-+
-+	if ((errorcode = parentnodecontainer(sb, &bh)) == 0 && bh != NULL) {	/* This line also prevents the freeing of the noderoot. */
-+		struct fsNodeContainer *nc = (void *) bh->b_data;
-+		u16 containerindex = (nodenumber - be32_to_cpu(nc->nodenumber)) / be32_to_cpu(nc->nodes);
-+
-+		if ((errorcode = asfs_freeadminspace(sb, be32_to_cpu(nc->node[containerindex]) >> (sb->s_blocksize_bits - ASFS_BLCKFACCURACY))) == 0) {
-+			u32 *p = nc->node;
-+			s16 n = NODECONT_BLOCK_COUNT;
-+
-+			nc->node[containerindex] = 0;
-+			asfs_bstore(sb, bh);
-+
-+			while (n-- > 0)
-+				if (*p++ != 0)
-+					break;
-+
-+			if (n < 0) {	/* This container is now completely empty!  Free this NodeIndexContainer too then! */
-+				return freecontainer(sb, bh);
-+			}
-+		}
-+		asfs_brelse(bh);
-+	}
-+
-+	return errorcode;
-+}
-+
-+static int internaldeletenode(struct super_block *sb, struct buffer_head *bh, struct fsNode *n)
-+{
-+	struct fsNodeContainer *nc = (void *) bh->b_data;
-+	u16 nodecount = (sb->s_blocksize - sizeof(struct fsNodeContainer)) / NODE_STRUCT_SIZE;
-+	s16 i = nodecount;
-+	s16 empty = 0;
-+	int errorcode = 0;
-+
-+	n->data = 0;
-+	n = (struct fsNode *) nc->node;
-+
-+	while (i-- > 0) {
-+		if (n->data == 0)
-+			empty++;
-+
-+		n = (struct fsNode *) ((u8 *) n + NODE_STRUCT_SIZE);
-+	}
-+
-+	asfs_bstore(sb, bh);
-+
-+	if (empty == 1)		/* NodeContainer was completely full before, so we need to mark it empty now. */
-+		errorcode = markparentempty(sb, bh);
-+	else if (empty == nodecount)	/* NodeContainer is now completely empty!  Free it! */
-+		errorcode = freecontainer(sb, bh);
-+
-+	return (errorcode);
-+}
-+
-+int asfs_deletenode(struct super_block *sb, u32 objectnode)
-+{
-+	struct buffer_head *bh;
-+	struct fsObjectNode *on;
-+	int errorcode;
-+
-+	asfs_debug("deletenode: Deleting Node %d\n", objectnode);
-+
-+	if ((errorcode = asfs_getnode(sb, objectnode, &bh, &on)) == 0)
-+		errorcode = internaldeletenode(sb, bh, (struct fsNode *) on);
-+
-+	asfs_brelse(bh);
-+	return (errorcode);
-+}
-+
-+#endif
-diff -urN kernel-source-2.6.11-2.6.11-orig/fs/asfs/objects.c kernel-source-2.6.11-2.6.11/fs/asfs/objects.c
---- kernel-source-2.6.11-2.6.11-orig/fs/asfs/objects.c	1970-01-01 01:00:00.000000000 +0100
-+++ kernel-source-2.6.11-2.6.11/fs/asfs/objects.c	2005-03-04 18:37:12.891247568 +0100
-@@ -0,0 +1,765 @@
-+/*
-+ *
-+ * Amiga Smart File System, Linux implementation
-+ * version: 1.0beta7
-+ *
-+ * This file contains some parts of the original amiga version of 
-+ * SmartFilesystem source code.
-+ *
-+ * SmartFilesystem is copyrighted (C) 2003 by: John Hendrikx, 
-+ * Ralph Schmidt, Emmanuel Lesueur, David Gerber, and Marcin Kurek
-+ * 
-+ * Adapted and modified by Marek 'March' Szyprowski <marek at amiga.pl>
-+ *
-+ */
-+
-+#include <linux/types.h>
-+#include <linux/errno.h>
-+#include <linux/slab.h>
-+#include <linux/fs.h>
-+#include <linux/buffer_head.h>
-+#include <linux/vfs.h>
-+#include "asfs_fs.h"
-+
-+#include <asm/byteorder.h>
-+
-+struct fsObject *asfs_nextobject(struct fsObject *obj)
-+{
-+	int i;
-+	u8 *p = obj->name;
-+
-+	for (i = 2; i > 0; p++)
-+		if (*p == '\0')
-+			i--;
-+	if ((p - (u8 *) obj) & 0x01)
-+		p++;
-+
-+	return ((struct fsObject *) p);
-+}
-+
-+struct fsObject *asfs_find_obj_by_name(struct super_block *sb, struct fsObjectContainer *objcont, u8 * name)
-+{
-+	struct fsObject *obj;
-+
-+	obj = &(objcont->object[0]);
-+	while (be32_to_cpu(obj->objectnode) > 0 && ((char *) obj - (char *) objcont) + sizeof(struct fsObject) + 2 < sb->s_blocksize) {
-+		if (asfs_namecmp(obj->name, name, ASFS_SB(sb)->flags & ASFS_ROOTBITS_CASESENSITIVE) == 0) {
-+			asfs_debug("Object found! Node %u, Name %s, Type %x, inCont %u\n", be32_to_cpu(obj->objectnode), obj->name, obj->bits, be32_to_cpu(objcont->bheader.ownblock));
-+			return obj;
-+		}
-+		obj = asfs_nextobject(obj);
-+	}
-+	return NULL;
-+}
-+
-+#ifdef CONFIG_ASFS_RW
-+
-+struct fsObject *find_obj_by_node(struct super_block *sb, struct fsObjectContainer *objcont, u32 objnode)
-+{
-+	struct fsObject *obj;
-+
-+	obj = &(objcont->object[0]);
-+	while (be32_to_cpu(obj->objectnode) > 0 && ((char *) obj - (char *) objcont) + sizeof(struct fsObject) + 2 < sb->s_blocksize) {
-+		if (be32_to_cpu(obj->objectnode) == objnode) {
-+			return obj;
-+		}
-+		obj = asfs_nextobject(obj);
-+	}
-+	return NULL;
-+}
-+
-+int asfs_readobject(struct super_block *sb, u32 objectnode, struct buffer_head **bh, struct fsObject **returned_object)
-+{
-+	struct fsObjectNode *on;
-+	int errorcode;
-+	u32 contblock;
-+
-+	asfs_debug("Seaching object - node %d\n", objectnode);
-+
-+	if ((errorcode = asfs_getnode(sb, objectnode, bh, &on)) != 0)
-+		return errorcode;
-+	contblock = be32_to_cpu(on->node.data);
-+	asfs_brelse(*bh);
-+
-+	if (contblock > 0 && (*bh = asfs_breadcheck(sb, contblock, ASFS_OBJECTCONTAINER_ID))) {
-+		*returned_object = find_obj_by_node(sb, (void *) (*bh)->b_data, objectnode);
-+		if (*returned_object == NULL) {
-+			brelse(*bh);
-+			*bh = NULL;
-+			return -ENOENT;
-+		}
-+		return 0;
-+	} else
-+		return -EIO;
-+}
-+
-+static int removeobjectcontainer(struct super_block *sb, struct buffer_head *bh)
-+{
-+	struct fsObjectContainer *oc = (void *) bh->b_data;
-+	int errorcode;
-+	struct buffer_head *block;
-+
-+	asfs_debug("removeobjectcontainer: block %u\n", be32_to_cpu(oc->bheader.ownblock));
-+
-+	if (oc->next != 0 && oc->next != oc->bheader.ownblock) {
-+		struct fsObjectContainer *next_oc;
-+
-+		if ((block = asfs_breadcheck(sb, be32_to_cpu(oc->next), ASFS_OBJECTCONTAINER_ID)) == NULL)
-+			return -EIO;
-+
-+		next_oc = (void *) block->b_data;
-+		next_oc->previous = oc->previous;
-+
-+		asfs_bstore(sb, block);
-+		asfs_brelse(block);
-+	}
-+
-+	if (oc->previous != 0 && oc->previous != oc->bheader.ownblock) {
-+		struct fsObjectContainer *previous_oc;
-+
-+		if ((block = asfs_breadcheck(sb, be32_to_cpu(oc->previous), ASFS_OBJECTCONTAINER_ID)) == NULL)
-+			return -EIO;
-+
-+		previous_oc = (void *) block->b_data;
-+		previous_oc->next = oc->next;
-+
-+		asfs_bstore(sb, block);
-+		asfs_brelse(block);
-+	} else {
-+		struct fsObject *parent_o;
-+
-+		if ((errorcode = asfs_readobject(sb, be32_to_cpu(oc->parent), &block, &parent_o)) != 0)
-+			return (errorcode);
-+
-+		parent_o->object.dir.firstdirblock = oc->next;
-+
-+		asfs_bstore(sb, block);
-+		asfs_brelse(block);
-+	}
-+
-+	if ((errorcode = asfs_freeadminspace(sb, be32_to_cpu(oc->bheader.ownblock))) != 0)
-+		return (errorcode);
-+
-+	return (0);
-+}
-+
-+static int setrecycledinfodiff(struct super_block *sb, s32 deletedfiles, s32 deletedblocks)
-+{
-+	struct buffer_head *bh;
-+
-+	if ((bh = asfs_breadcheck(sb, ASFS_SB(sb)->rootobjectcontainer, ASFS_OBJECTCONTAINER_ID))) {
-+		struct fsRootInfo *ri = (struct fsRootInfo *) ((u8 *) bh->b_data + sb->s_blocksize - sizeof(struct fsRootInfo));
-+
-+		ri->deletedfiles = cpu_to_be32(be32_to_cpu(ri->deletedfiles) + deletedfiles);
-+		ri->deletedblocks = cpu_to_be32(be32_to_cpu(ri->deletedblocks) + deletedblocks);
-+
-+		asfs_bstore(sb, bh);
-+		asfs_brelse(bh);
-+	} else
-+		return -EIO;
-+	return 0;
-+}
-+
-+	/* This function removes the fsObject structure passed in from the passed
-+	   buffer_head.  If the ObjectContainer becomes completely empty it will be 
-+	   delinked from the ObjectContainer chain and marked free for reuse.
-+	   This function doesn't delink the object from the hashchain! */
-+
-+static int simpleremoveobject(struct super_block *sb, struct buffer_head *bh, struct fsObject *o)
-+{
-+	struct fsObjectContainer *oc = (void *) bh->b_data;
-+	int errorcode = 0;
-+
-+	asfs_debug("simpleremoveobject:\n");
-+
-+	if (be32_to_cpu(oc->parent) == ASFS_RECYCLEDNODE) {
-+		/* This object is removed from the Recycled directory. */
-+		if ((errorcode = setrecycledinfodiff(sb, -1, -((be32_to_cpu(o->object.file.size) + sb->s_blocksize - 1) >> sb->s_blocksize_bits))) != 0)
-+			return errorcode;
-+	}
-+
-+	if ((asfs_nextobject(oc->object))->name[0] == '\0')
-+		errorcode = removeobjectcontainer(sb, bh);
-+	else {
-+		struct fsObject *nexto;
-+		int objlen;
-+
-+		nexto = asfs_nextobject(o);
-+		objlen = (u8 *) nexto - (u8 *) o;
-+
-+		memmove(o, nexto, sb->s_blocksize - ((u8 *) nexto - (u8 *) oc));
-+		memset((u8 *) oc + sb->s_blocksize - objlen, 0, objlen);
-+
-+		asfs_bstore(sb, bh);
-+	}
-+	return errorcode;
-+}
-+
-+/* This function delinks the passed in ObjectNode from its hash-chain.  Handy when deleting
-+   the object, or when renaming/moving it. */
-+
-+static int dehashobjectquick(struct super_block *sb, u32 objectnode, u8 *name, u32 parentobjectnode)
-+{
-+	struct fsObject *o;
-+	int errorcode;
-+	struct buffer_head *block;
-+
-+	asfs_debug("dehashobject: Delinking object %d (=ObjectNode) from hashchain. Parentnode = %d\n", objectnode, parentobjectnode);
-+
-+	if ((errorcode = asfs_readobject(sb, parentobjectnode, &block, &o)) == 0 && o->object.dir.hashtable != 0) {
-+		u32 hashtable = be32_to_cpu(o->object.dir.hashtable);
-+		asfs_brelse(block);
-+
-+		if ((block = asfs_breadcheck(sb, hashtable, ASFS_HASHTABLE_ID))) {
-+			struct buffer_head *node_bh;
-+			struct fsObjectNode *onptr, on;
-+			struct fsHashTable *ht = (void *) block->b_data;
-+			u32 nexthash;
-+
-+			if ((errorcode = asfs_getnode(sb, objectnode, &node_bh, &onptr)) == 0) {
-+				u16 hashchain;
-+
-+				asfs_debug("dehashobject: Read HashTable block of parent object of object to be delinked\n");
-+
-+				hashchain = HASHCHAIN(asfs_hash(name, ASFS_SB(sb)->flags & ASFS_ROOTBITS_CASESENSITIVE));
-+				nexthash = be32_to_cpu(ht->hashentry[hashchain]);
-+
-+				if (nexthash == objectnode) {
-+					/* The hashtable directly points to the fsObject to be delinked.  We simply
-+					   modify the Hashtable to point to the new nexthash entry. */
-+
-+					asfs_debug("dehashobject: The hashtable points directly to the to be delinked object\n");
-+
-+					ht->hashentry[hashchain] = onptr->next;
-+					asfs_bstore(sb, block);
-+				} else {
-+					struct fsObjectNode *onsearch = 0;
-+
-+					on = *onptr;
-+
-+					asfs_debug("dehashobject: Walking through hashchain\n");
-+
-+					while (nexthash != 0 && nexthash != objectnode) {
-+						asfs_brelse(node_bh);
-+						if ((errorcode = asfs_getnode(sb, nexthash, &node_bh, &onsearch)) != 0)
-+							break;
-+						nexthash = be32_to_cpu(onsearch->next);
-+					}
-+
-+					if (errorcode == 0) {
-+						if (nexthash != 0) {
-+							/* Previous fsObjectNode found in hash chain.  Modify the fsObjectNode to 'skip' the
-+							   ObjectNode which is being delinked from the hash chain. */
-+
-+							onsearch->next = on.next;
-+							asfs_bstore(sb, node_bh);
-+						} else {
-+							printk("ASFS: Hashchain of object %d is corrupt or incorrectly linked.", objectnode);
-+
-+							/*** This is strange.  We have been looking for the fsObjectNode which is located before the
-+							     passed in fsObjectNode in the hash-chain.  However, we never found the
-+							     fsObjectNode reffered to in the hash-chain!  Has to be somekind
-+							     of internal error... */
-+
-+							errorcode = -ENOENT;
-+						}
-+					}
-+				}
-+				asfs_brelse(node_bh);
-+			}
-+			asfs_brelse(block);
-+		}
-+	}
-+	return errorcode;
-+}
-+
-+
-+	/* This function removes an object from any directory.  It takes care
-+	   of delinking the object from the hashchain and also frees the
-+	   objectnode number. */
-+
-+static int removeobject(struct super_block *sb, struct buffer_head *bh, struct fsObject *o)
-+{
-+	struct fsObjectContainer *oc = (void *) bh->b_data;
-+	int errorcode;
-+
-+	asfs_debug("removeobject\n");
-+
-+	if ((errorcode = dehashobjectquick(sb, be32_to_cpu(o->objectnode), o->name, be32_to_cpu(oc->parent))) == 0) {
-+		u32 objectnode = be32_to_cpu(o->objectnode);
-+
-+		if ((errorcode = simpleremoveobject(sb, bh, o)) == 0)
-+			errorcode = asfs_deletenode(sb, objectnode);
-+	}
-+
-+	return (errorcode);
-+}
-+
-+	/* This function deletes the specified object. */
-+int asfs_deleteobject(struct super_block *sb, struct buffer_head *bh, struct fsObject *o)
-+{
-+	int errorcode = 0;
-+
-+	asfs_debug("deleteobject: Entry -- deleting object %d (%s)\n", be32_to_cpu(o->objectnode), o->name);
-+
-+	if ((o->bits & OTYPE_DIR) == 0 || o->object.dir.firstdirblock == 0) {
-+		u8 bits = o->bits;
-+		u32 hashblckno = be32_to_cpu(o->object.dir.hashtable);
-+		u32 extentbnode = be32_to_cpu(o->object.file.data);
-+
-+		if ((errorcode = removeobject(sb, bh, o)) == 0) {
-+			if ((bits & OTYPE_LINK) != 0) {
-+				asfs_debug("deleteobject: Object is soft link!\n");
-+				errorcode = asfs_freeadminspace(sb, extentbnode);
-+			} else if ((bits & OTYPE_DIR) != 0) {
-+				asfs_debug("deleteobject: Object is a directory!\n");
-+				errorcode = asfs_freeadminspace(sb, hashblckno);
-+			} else {
-+				asfs_debug("deleteobject: Object is a file\n");
-+				if (extentbnode != 0)
-+					errorcode = asfs_deleteextents(sb, extentbnode);
-+			}
-+		}
-+	}
-+
-+	return (errorcode);
-+}
-+
-+	/* This function takes a HashBlock pointer, an ObjectNode and an ObjectName.
-+	   If there is a hashblock, then this function will correctly link the object
-+	   into the hashchain.  If there isn't a hashblock (=0) then this function
-+	   does nothing.  */
-+
-+static int hashobject(struct super_block *sb, u32 hashblock, struct fsObjectNode *on, u32 nodeno, u8 *objectname)
-+{
-+	struct buffer_head *hash_bh;
-+
-+	asfs_debug("hashobject, using hashblock %d\n", hashblock);
-+	if (hashblock == 0)
-+		return 0;
-+
-+	if ((hash_bh = asfs_breadcheck(sb, hashblock, ASFS_HASHTABLE_ID))) {
-+		struct fsHashTable *ht = (void *) hash_bh->b_data;
-+		u32 nexthash;
-+		u16 hashvalue, hashchain;
-+
-+		hashvalue = asfs_hash(objectname, ASFS_SB(sb)->flags & ASFS_ROOTBITS_CASESENSITIVE);
-+		hashchain = HASHCHAIN(hashvalue);
-+		nexthash = be32_to_cpu(ht->hashentry[hashchain]);
-+
-+		ht->hashentry[hashchain] = cpu_to_be32(nodeno);
-+
-+		asfs_bstore(sb, hash_bh);
-+		asfs_brelse(hash_bh);
-+
-+		on->next = cpu_to_be32(nexthash);
-+		on->hash16 = cpu_to_be16(hashvalue);
-+	} else
-+		return -EIO;
-+
-+	return 0;
-+}
-+
-+	/* This function returns a pointer to the first unused byte in
-+	   an ObjectContainer. */
-+
-+static u8 *emptyspaceinobjectcontainer(struct super_block *sb, struct fsObjectContainer *oc)
-+{
-+	struct fsObject *o = oc->object;
-+	u8 *endadr;
-+
-+	endadr = (u8 *) oc + sb->s_blocksize - sizeof(struct fsObject) - 2;
-+
-+	while ((u8 *) o < endadr && o->name[0] != 0)
-+		o = asfs_nextobject(o);
-+
-+	return (u8 *) o;
-+}
-+
-+	/* This function will look in the directory indicated by io_o
-+	   for an ObjectContainer block which contains bytesneeded free
-+	   bytes.  If none is found then this function simply creates a
-+	   new ObjectContainer and adds that to the indicated directory. */
-+
-+static int findobjectspace(struct super_block *sb, struct buffer_head **io_bh, struct fsObject **io_o, u32 bytesneeded)
-+{
-+	struct buffer_head *bhparent = *io_bh;
-+	struct fsObject *oparent = *io_o;
-+	struct buffer_head *bh;
-+	u32 nextblock = be32_to_cpu(oparent->object.dir.firstdirblock);
-+	int errorcode = 0;
-+
-+	asfs_debug("findobjectspace: Looking for %u bytes in directory with ObjectNode number %d (in block %d)\n", bytesneeded, be32_to_cpu((*io_o)->objectnode),
-+		   be32_to_cpu(((struct fsBlockHeader *) (*io_bh)->b_data)->ownblock));
-+
-+	while (nextblock != 0 && (bh = asfs_breadcheck(sb, nextblock, ASFS_OBJECTCONTAINER_ID))) {
-+		struct fsObjectContainer *oc = (void *) bh->b_data;
-+		u8 *emptyspace;
-+
-+		/* We need to find out how much free space this ObjectContainer has */
-+
-+		emptyspace = emptyspaceinobjectcontainer(sb, oc);
-+
-+		if ((u8 *) oc + sb->s_blocksize - emptyspace >= bytesneeded) {
-+			/* We found enough space in one of the ObjectContainer blocks!!
-+			   We return a struct fsObject *. */
-+			*io_bh = bh;
-+			*io_o = (struct fsObject *) emptyspace;
-+			break;
-+		}
-+		nextblock = be32_to_cpu(oc->next);
-+		asfs_brelse(bh);
-+	}
-+
-+	if (nextblock == 0) {
-+		u32 newcontblock;
-+		/* If we get here, we traversed the *entire* directory (ough!) and found no empty
-+		   space large enough for our entry.  We allocate new space and add it to this
-+		   directory. */
-+
-+		if ((errorcode = asfs_allocadminspace(sb, &newcontblock)) == 0 && (bh = asfs_getzeroblk(sb, newcontblock))) {
-+			struct fsObjectContainer *oc = (void *) bh->b_data;
-+			struct buffer_head *bhnext;
-+
-+			asfs_debug("findobjectspace: No room was found, allocated new block at %u\n", newcontblock);
-+
-+			/* Allocated new block.  We will now link it to the START of the directory chain
-+			   so the new free space can be found quickly when more entries need to be added. */
-+
-+			oc->bheader.id = cpu_to_be32(ASFS_OBJECTCONTAINER_ID);
-+			oc->bheader.ownblock = cpu_to_be32(newcontblock);
-+			oc->parent = oparent->objectnode;
-+			oc->next = oparent->object.dir.firstdirblock;
-+			oc->previous = 0;
-+
-+			oparent->object.dir.firstdirblock = cpu_to_be32(newcontblock);
-+
-+			asfs_bstore(sb, bhparent);
-+
-+			if (oc->next != 0 && (bhnext = asfs_breadcheck(sb, be32_to_cpu(oc->next), ASFS_OBJECTCONTAINER_ID))) {
-+				struct fsObjectContainer *ocnext = (void *) bhnext->b_data;
-+				ocnext->previous = cpu_to_be32(newcontblock);
-+				asfs_bstore(sb, bhnext);
-+				asfs_brelse(bhnext);
-+			}
-+
-+			*io_bh = bh;
-+			*io_o = oc->object;
-+		}
-+	}
-+
-+	asfs_debug("findobjectspace: new object will be in container block %u\n", be32_to_cpu(((struct fsBlockHeader *) (*io_bh)->b_data)->ownblock));
-+
-+	return (errorcode);
-+}
-+
-+/* io_bh & io_o refer to the direct parent of the new object.  Objectname is the
-+	name of the new object (name only). Does not realese io_bh !!! */
-+
-+int asfs_createobject(struct super_block *sb, struct buffer_head **io_bh, struct fsObject **io_o, struct fsObject *src_o, u8 *objectname, int force)
-+{
-+	int errorcode;
-+	u32 object_size;
-+	u32 hashblock = be32_to_cpu((*io_o)->object.dir.hashtable);
-+
-+	asfs_debug("createobject: Creating object '%s' in dir '%s'.\n", objectname, (*io_o)->name);
-+
-+	if (!force && ASFS_SB(sb)->freeblocks < ASFS_ALWAYSFREE)
-+		return -ENOSPC;
-+
-+	if (!force && be32_to_cpu((*io_o)->objectnode) == ASFS_RECYCLEDNODE)
-+		return -EINVAL;
-+
-+	object_size = sizeof(struct fsObject) + strlen(objectname) + 2;
-+
-+	if ((errorcode = findobjectspace(sb, io_bh, io_o, object_size)) == 0) {
-+		struct fsObject *o2 = *io_o;
-+		u8 *name = o2->name;
-+		u8 *objname = objectname;
-+		struct buffer_head *node_bh;
-+		struct fsObjectNode *on;
-+		u32 nodeno;
-+
-+		**io_o = *src_o;	/* Copying whole object data... */
-+
-+		while (*objname != 0)	/* Copying name */
-+			*name++ = *objname++;
-+
-+		*name++ = 0;
-+		*name = 0;	/* zero byte for comment */
-+
-+		if (o2->objectnode != 0)	/* ObjectNode reuse or creation */
-+			errorcode = asfs_getnode(sb, o2->objectnode, &node_bh, &on);
-+		else {
-+			if ((errorcode = asfs_createnode(sb, &node_bh, (struct fsNode **) &on, &nodeno)) == 0) {
-+				on->hash16 = cpu_to_be16(asfs_hash(o2->name, ASFS_SB(sb)->flags & ASFS_ROOTBITS_CASESENSITIVE));
-+				o2->objectnode = cpu_to_be32(nodeno);
-+			}
-+			asfs_debug("createnode returned with errorcode: %d\n", errorcode);
-+		}
-+
-+		if (errorcode == 0) {	/* in io_bh there is a container with created object */
-+			on->node.data = ((struct fsBlockHeader *) (*io_bh)->b_data)->ownblock;
-+			if ((errorcode = hashobject(sb, hashblock, on, be32_to_cpu(o2->objectnode), objectname)) == 0) {
-+				asfs_bstore(sb, node_bh);
-+				asfs_brelse(node_bh);
-+			} else
-+				errorcode = -EIO;
-+		}
-+
-+		if (errorcode == 0) {	/* HashBlock reuse or creation:*/
-+
-+			if ((o2->bits & OTYPE_DIR) != 0 && o2->object.dir.hashtable == 0) {
-+				struct buffer_head *hashbh;
-+				u32 hashblock;
-+
-+				asfs_debug("creating Hashblock\n");
-+
-+				if ((errorcode = asfs_allocadminspace(sb, &hashblock)) == 0 && (hashbh = asfs_getzeroblk(sb, hashblock))) {	    
-+					struct fsHashTable *ht = (void *) hashbh->b_data;
-+
-+					o2->object.dir.hashtable = cpu_to_be32(hashblock);
-+
-+					ht->bheader.id = cpu_to_be32(ASFS_HASHTABLE_ID);
-+					ht->bheader.ownblock = cpu_to_be32(hashblock);
-+					ht->parent = o2->objectnode;
-+
-+					asfs_bstore(sb, hashbh);
-+					asfs_brelse(hashbh);
-+				}
-+			}
-+		}
-+
-+		if (errorcode == 0) {	/* SoftLink creation: */
-+			if ((o2->bits & (OTYPE_LINK | OTYPE_HARDLINK)) == OTYPE_LINK && o2->object.file.data == 0) {
-+				struct buffer_head *bh2;
-+				u32 slinkblock;
-+
-+				if ((errorcode = asfs_allocadminspace(sb, &slinkblock)) == 0 && (bh2 = asfs_getzeroblk(sb, slinkblock))) {
-+					struct fsSoftLink *sl = (void *) bh2->b_data;
-+					o2->object.file.data = cpu_to_be32(slinkblock);
-+					sl->bheader.id = cpu_to_be32(ASFS_SOFTLINK_ID);
-+					sl->bheader.ownblock = cpu_to_be32(slinkblock);
-+					sl->parent = o2->objectnode;
-+					sl->next = 0;
-+					sl->previous = 0;
-+					asfs_bstore(sb, bh2);
-+					asfs_brelse(bh2);
-+				}
-+			}
-+		}
-+	}
-+	asfs_debug("createobject: done.\n");
-+
-+	return (errorcode);
-+}
-+
-+	/* This function extends the file object 'o' with a number  of blocks 
-+		(hopefully, if any blocks has been found!). Only new Extents will 
-+      be created -- the size of the file will not be altered, and changing 
-+		it is left up to the caller.  If the file did not have any blocks 
-+		yet, then the o->object.file.data will be set to the first (new) 
-+		ExtentBNode. It returns the number of added blocks through 
-+		addedblocks pointer */
-+
-+int asfs_addblockstofile(struct super_block *sb, struct buffer_head *objbh, struct fsObject *o, u32 blocks, u32 * newspace, u32 * addedblocks)
-+{
-+	u32 lastextentbnode;
-+	int errorcode = 0;
-+	struct fsExtentBNode *ebnp;
-+	struct buffer_head *block = NULL;
-+
-+
-+	asfs_debug("extendblocksinfile: Trying to increasing number of blocks by %d.\n", blocks);
-+
-+	lastextentbnode = be32_to_cpu(o->object.file.data);
-+
-+	if (lastextentbnode != 0) {
-+		while (lastextentbnode != 0 && errorcode == 0) {
-+			if (block != NULL)
-+				asfs_brelse(block);
-+			errorcode = asfs_getextent(sb, lastextentbnode, &block, &ebnp);
-+			lastextentbnode = be32_to_cpu(ebnp->next);
-+		}
-+		lastextentbnode = be32_to_cpu(ebnp->key);
-+	}
-+
-+	if (errorcode == 0) {
-+		u32 searchstart;
-+
-+		u32 found_block;
-+		u32 found_blocks;
-+
-+		*addedblocks = 0;
-+		*newspace = 0;
-+
-+		if (lastextentbnode != 0)
-+			searchstart = be32_to_cpu(ebnp->key) + be16_to_cpu(ebnp->blocks);
-+		else
-+			searchstart = 0; //ASFS_SB(sb)->block_rovingblockptr;
-+
-+		if ((errorcode = asfs_findspace(sb, blocks, searchstart, searchstart, &found_block, &found_blocks)) != 0) {
-+			asfs_brelse(block);
-+			asfs_debug("extendblocksinfile: findspace returned %s\n", errorcode == -ENOSPC ? "ENOSPC" : "error");
-+			return errorcode;
-+		}
-+
-+		blocks = found_blocks;
-+		errorcode = asfs_markspace(sb, found_block, found_blocks);
-+		*addedblocks = found_blocks;
-+		*newspace = found_block;
-+
-+		asfs_debug("extendblocksinfile: block = %u, lastextentbnode = %u, extentblocks = %d\n", found_block, lastextentbnode, blocks);
-+
-+		if ((errorcode = asfs_addblocks(sb, blocks, found_block, be32_to_cpu(o->objectnode), &lastextentbnode)) != 0) {
-+			asfs_debug("extendblocksinfile: addblocks returned errorcode %d\n", errorcode);
-+			return errorcode;
-+		}
-+
-+		if (o->object.file.data == 0)
-+			o->object.file.data = cpu_to_be32(lastextentbnode);
-+	}
-+
-+	if (block)
-+		asfs_brelse(block);
-+	asfs_bstore(sb, objbh);
-+
-+	asfs_debug("addblockstofile: done. added %d blocks\n", *addedblocks);
-+
-+	return errorcode;
-+}
-+
-+	/* The Object indicated by bh1 & o1, gets renamed to newname and placed
-+	   in the directory indicated by bhparent & oparent. */
-+
-+int asfs_renameobject(struct super_block *sb, struct buffer_head *bh1, struct fsObject *o1, struct buffer_head *bhparent, struct fsObject *oparent, u8 * newname)
-+{
-+	struct fsObject object;
-+	u32 oldparentnode = be32_to_cpu(((struct fsObjectContainer *) bh1->b_data)->parent);
-+	u8 oldname[107];
-+	int errorcode;
-+
-+	asfs_debug("renameobject: Renaming '%s' to '%s' in dir '%s'\n", o1->name, newname, oparent->name);
-+
-+	object = *o1;
-+	strcpy(oldname, o1->name);
-+
-+	if ((errorcode = dehashobjectquick(sb, be32_to_cpu(o1->objectnode), o1->name, oldparentnode)) == 0) {
-+		u32 parentobjectnode = be32_to_cpu(oparent->objectnode);
-+
-+		if ((errorcode = simpleremoveobject(sb, bh1, o1)) == 0) {
-+			struct buffer_head *bh2 = bhparent;
-+			struct fsObject *o2;
-+
-+			/* oparent might changed after simpleremoveobject */
-+			oparent = o2 = find_obj_by_node(sb, (struct fsObjectContainer *) bhparent->b_data, parentobjectnode);
-+
-+			/* In goes the Parent bh & o, out comes the New object's bh & o :-) */
-+			if ((errorcode = asfs_createobject(sb, &bh2, &o2, &object, newname, TRUE)) == 0) {
-+				asfs_bstore(sb, bh2);
-+				if (be32_to_cpu(oparent->objectnode) == ASFS_RECYCLEDNODE) {
-+					asfs_debug("renameobject: Updating recycled dir info\n");
-+					if ((errorcode = setrecycledinfodiff(sb, 1, (be32_to_cpu(o2->object.file.size) + sb->s_blocksize - 1) >> sb->s_blocksize_bits)) != 0) {
-+						brelse(bh2);
-+						return errorcode;
-+					}
-+				}
-+				brelse(bh2);
-+				asfs_debug("renameobject: Succesfully created & stored new object.\n");
-+			} else { /* recreate object in old place, maybe this will not fail, but who knows... */
-+				asfs_debug("renameobject: Creating new object failed. Trying to recreate it in source directory.\n");
-+				if (asfs_readobject(sb, oldparentnode, &bh1, &o1) == 0) {
-+					struct buffer_head *bh2 = bh1;
-+					if (asfs_createobject(sb, &bh2, &o1, &object, oldname, TRUE) == 0) {
-+						asfs_bstore(sb, bh2);
-+						if (oldparentnode == ASFS_RECYCLEDNODE) {
-+							asfs_debug("renameobject: Updating recycled dir info\n");
-+							setrecycledinfodiff(sb, 1, (be32_to_cpu(o1->object.file.size) + sb->s_blocksize - 1) >> sb->s_blocksize_bits);
-+						}
-+						brelse(bh2);
-+					}
-+					brelse(bh1);
-+				}
-+			}
-+		}
-+	}
-+	return errorcode;
-+}
-+
-+		/* Truncates the specified file to /newsize/ bytes */
-+
-+int asfs_truncateblocksinfile(struct super_block *sb, struct buffer_head *bh, struct fsObject *o, u32 newsize)
-+{
-+	struct buffer_head *ebh;
-+	struct fsExtentBNode *ebn;
-+	int errorcode;
-+	u32 pos = 0;
-+	u32 newblocks = (newsize + sb->s_blocksize - 1) >> sb->s_blocksize_bits;
-+	u32 filedata = be32_to_cpu(o->object.file.data);
-+	u32 eprev, ekey;
-+	u16 eblocks;
-+
-+	asfs_debug("trucateblocksinfile: newsize %u\n", newsize);
-+
-+	if (filedata == 0)
-+		return 0;
-+
-+	for (;;) {
-+		if ((errorcode = asfs_getextent(sb, filedata, &ebh, &ebn)) != 0)
-+			return errorcode;
-+		if (pos + be16_to_cpu(ebn->blocks) >= newblocks)
-+			break;
-+		pos += be16_to_cpu(ebn->blocks);
-+		if ((filedata = be32_to_cpu(ebn->next)) == 0)
-+			break;
-+		asfs_brelse(ebh);
-+	};
-+
-+	eblocks = newblocks - pos;
-+	ekey = be32_to_cpu(ebn->key);
-+	eprev = be32_to_cpu(ebn->prev);
-+
-+	if (be16_to_cpu(ebn->blocks) < eblocks) {
-+		printk("ASFS: Extent chain is too short or damaged!\n");
-+		asfs_brelse(ebh);
-+		return -ENOENT;
-+	}
-+	if (be16_to_cpu(ebn->blocks) - eblocks > 0 && (errorcode = asfs_freespace(sb, be32_to_cpu(ebn->key) + eblocks, be16_to_cpu(ebn->blocks) - eblocks)) != 0) {
-+		asfs_brelse(ebh);
-+		return errorcode;
-+	}
-+	if (be32_to_cpu(ebn->next) > 0 && (errorcode = asfs_deleteextents(sb, be32_to_cpu(ebn->next))) != 0) {
-+		asfs_brelse(ebh);
-+		return errorcode;
-+	}
-+	ebn->blocks = cpu_to_be16(eblocks);
-+	ebn->next = 0;
-+	asfs_bstore(sb, ebh);
-+
-+	if (eblocks == 0) {
-+		if (eprev & MSB_MASK) {
-+			o->object.file.data = 0;
-+			asfs_bstore(sb, bh);
-+		} else {
-+			struct buffer_head *ebhp;
-+			struct fsExtentBNode *ebnp;
-+
-+			if ((errorcode = asfs_getextent(sb, eprev & !MSB_MASK, &ebhp, &ebnp)) != 0) {
-+				asfs_brelse(ebh);
-+				return errorcode;
-+			}
-+
-+			ebnp->next = 0;
-+			asfs_bstore(sb, ebhp);
-+			asfs_brelse(ebhp);
-+		}
-+		if ((errorcode = asfs_deletebnode(sb, ebh, ekey)) != 0) {
-+			asfs_brelse(ebh);
-+			return errorcode;
-+		}
-+	}
-+	asfs_brelse(ebh);
-+
-+	return 0;
-+}
-+#endif
-diff -urN kernel-source-2.6.11-2.6.11-orig/fs/asfs/super.c kernel-source-2.6.11-2.6.11/fs/asfs/super.c
---- kernel-source-2.6.11-2.6.11-orig/fs/asfs/super.c	1970-01-01 01:00:00.000000000 +0100
-+++ kernel-source-2.6.11-2.6.11/fs/asfs/super.c	2005-03-04 18:37:12.946239208 +0100
-@@ -0,0 +1,437 @@
-+/*
-+ *
-+ * Amiga Smart File System, Linux implementation
-+ *
-+ * version: 1.0beta7 for 2.6.x kernel
-+ *  
-+ * Copyright (C) 2003,2004  Marek 'March' Szyprowski <marek at amiga.pl>
-+ *
-+ *
-+ * Thanks to Marcin Kurek (Morgoth/Dreamolers-CAPS) for help and parts 
-+ * of original amiga version of SmartFilesystem source code. 
-+ *
-+ * SmartFilesystem is copyrighted (C) 2003 by: John Hendrikx, 
-+ * Ralph Schmidt, Emmanuel Lesueur, David Gerber and Marcin Kurek
-+ * 
-+ *
-+ * ASFS is based on the Amiga FFS filesystem for Linux
-+ * Copyright (C) 1993  Ray Burr
-+ * Copyright (C) 1996  Hans-Joachim Widmaier
-+ *
-+ * Earlier versions were based on the Linux implementation of 
-+ * the ROMFS file system
-+ * Copyright (C) 1997-1999  Janos Farkas <chexum at shadow.banki.hu>
-+ *
-+ * ASFS used some parts of the smbfs filesystem:
-+ * Copyright (C) 1995, 1996 by Paal-Kr. Engstad and Volker Lendecke
-+ * Copyright (C) 1997 by Volker Lendecke
-+ *
-+ * and parts of the Minix filesystem additionally
-+ * Copyright (C) 1991, 1992  Linus Torvalds
-+ * Copyright (C) 1996  Gertjan van Wingerde 
-+ *
-+ *
-+ * 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.
-+ *
-+ */
-+
-+/* todo:
-+ * - remove bugs
-+ * - add missing features (maybe safe-delete, other...)
-+ * - create other fs tools like mkfs.asfs and fsck.asfs, some data-recovery tools
-+ */
-+
-+#define ASFS_VERSION "1.0beta7 (25.06.2004)"
-+
-+#include <linux/module.h>
-+#include <linux/types.h>
-+#include <linux/errno.h>
-+#include <linux/slab.h>
-+#include <linux/fs.h>
-+#include <linux/init.h>
-+#include <linux/smp_lock.h>
-+#include <linux/buffer_head.h>
-+#include <linux/vfs.h>
-+#include <linux/parser.h>
-+#include "asfs_fs.h"
-+
-+#include <asm/byteorder.h>
-+#include <asm/uaccess.h>
-+
-+u32 asfs_calcchecksum(void *block, u32 blocksize)
-+{
-+	u32 *data = block, checksum = 1;
-+	while (blocksize > 0) {
-+		checksum += be32_to_cpu(*data++);
-+		blocksize -= 4;
-+	}
-+	checksum -= be32_to_cpu(((struct fsBlockHeader *)block)->checksum);
-+	return -checksum;
-+}
-+
-+static struct super_operations asfs_ops = {
-+	.alloc_inode	= asfs_alloc_inode,
-+	.destroy_inode	= asfs_destroy_inode,
-+	.put_super		= asfs_put_super,
-+	.statfs			= asfs_statfs,
-+#ifdef CONFIG_ASFS_RW
-+	.remount_fs		= asfs_remount,
-+#endif
-+};
-+
-+extern struct dentry_operations asfs_dentry_operations;
-+
-+enum {
-+	Opt_mode, Opt_setgid, Opt_setuid, Opt_prefix, Opt_volume, 
-+	Opt_lcvol, Opt_ignore, Opt_err,
-+};
-+
-+static match_table_t tokens = {
-+	{Opt_mode, "mode=%o"},
-+	{Opt_setgid, "setgid=%u"},
-+	{Opt_setuid, "setuid=%u"},
-+	{Opt_prefix, "prefix=%s"},
-+	{Opt_volume, "volume=%s"},
-+	{Opt_lcvol, "lowercasevol"},
-+	{Opt_ignore, "grpquota"},
-+	{Opt_ignore, "noquota"},
-+	{Opt_ignore, "quota"},
-+	{Opt_ignore, "usrquota"},
-+	{Opt_err, NULL},
-+};
-+
-+static int asfs_parse_options(char *options, struct super_block *sb)
-+{
-+	char *p;
-+	substring_t args[MAX_OPT_ARGS];
-+
-+	if (!options)
-+		return 1;
-+	while ((p = strsep(&options, ",")) != NULL) {
-+		int token, option;
-+		if (!*p)
-+			continue;
-+		token = match_token(p, tokens, args);
-+
-+		switch (token) {
-+		case Opt_mode:
-+			if (match_octal(&args[0], &option))
-+				goto no_arg;
-+			ASFS_SB(sb)->mode = option & 0777;
-+			break;
-+		case Opt_setgid:
-+			if (match_int(&args[0], &option))
-+				goto no_arg;
-+			ASFS_SB(sb)->gid = option;
-+			break;
-+		case Opt_setuid:
-+			if (match_int(&args[0], &option))
-+				goto no_arg;
-+			ASFS_SB(sb)->uid = option;
-+			break;
-+		case Opt_prefix:
-+			if (ASFS_SB(sb)->prefix) {
-+				kfree(ASFS_SB(sb)->prefix);
-+				ASFS_SB(sb)->prefix = NULL;
-+			}
-+			ASFS_SB(sb)->prefix = match_strdup(&args[0]);
-+			if (! ASFS_SB(sb)->prefix)
-+				return 0;
-+			break;
-+		case Opt_volume:
-+			if (ASFS_SB(sb)->root_volume) {
-+				kfree(ASFS_SB(sb)->root_volume);
-+				ASFS_SB(sb)->root_volume = NULL;
-+			}
-+			ASFS_SB(sb)->root_volume = match_strdup(&args[0]);
-+			if (! ASFS_SB(sb)->root_volume)
-+				return 0;
-+			break;
-+		case Opt_lcvol:
-+			ASFS_SB(sb)->flags |= ASFS_VOL_LOWERCASE;
-+			break;
-+		case Opt_ignore:
-+		 	/* Silently ignore the quota options */
-+			break;
-+		default:
-+no_arg:
-+			printk("ASFS: Unrecognized mount option \"%s\" "
-+					"or missing value\n", p);
-+			return 0;
-+		}
-+	}
-+	return 1;
-+}
-+
-+static int asfs_fill_super(struct super_block *sb, void *data, int silent)
-+{
-+	struct asfs_sb_info *sbi;
-+	struct buffer_head *bh;
-+	struct fsRootBlock *rootblock;
-+	struct inode *rootinode;
-+
-+	sbi = kmalloc(sizeof(struct asfs_sb_info), GFP_KERNEL);
-+	if (!sbi)
-+		return -ENOMEM;
-+	sb->s_fs_info = sbi;
-+
-+	/* Fill in defaults */
-+	ASFS_SB(sb)->uid = ASFS_DEFAULT_UID;
-+	ASFS_SB(sb)->gid = ASFS_DEFAULT_GID;
-+	ASFS_SB(sb)->mode = ASFS_DEFAULT_MODE;
-+	ASFS_SB(sb)->prefix = NULL;
-+	ASFS_SB(sb)->root_volume = NULL;
-+	ASFS_SB(sb)->flags = 0;
-+
-+	if (!asfs_parse_options(data, sb)) {
-+		printk(KERN_ERR "ASFS: Error parsing options\n");
-+		return -EINVAL;
-+	}
-+
-+	if (!sb_set_blocksize(sb, 512))
-+		return -EINVAL;
-+	sb->s_maxbytes = ASFS_MAXFILESIZE;
-+
-+	bh = sb_bread(sb, 0);
-+	if (!bh) {
-+		printk(KERN_ERR "ASFS: unable to read superblock\n");
-+		return -EINVAL;
-+	}
-+
-+	rootblock = (struct fsRootBlock *)bh->b_data;
-+
-+	if (be32_to_cpu(rootblock->bheader.id) == ASFS_ROOTID && 
-+		be16_to_cpu(rootblock->version) == ASFS_STRUCTURE_VERISON) {
-+
-+		sb->s_blocksize = be32_to_cpu(rootblock->blocksize);
-+		ASFS_SB(sb)->totalblocks = be32_to_cpu(rootblock->totalblocks);
-+		ASFS_SB(sb)->rootobjectcontainer = be32_to_cpu(rootblock->rootobjectcontainer);
-+		ASFS_SB(sb)->extentbnoderoot = be32_to_cpu(rootblock->extentbnoderoot);
-+		ASFS_SB(sb)->objectnoderoot = be32_to_cpu(rootblock->objectnoderoot);
-+		ASFS_SB(sb)->flags |= 0xff & rootblock->bits;
-+		ASFS_SB(sb)->adminspacecontainer = be32_to_cpu(rootblock->adminspacecontainer);
-+		ASFS_SB(sb)->bitmapbase = be32_to_cpu(rootblock->bitmapbase);
-+		ASFS_SB(sb)->blocks_inbitmap = (sb->s_blocksize - sizeof(struct fsBitmap))<<3;  /* must be a multiple of 32 !! */
-+		ASFS_SB(sb)->blocks_bitmap = (ASFS_SB(sb)->totalblocks + ASFS_SB(sb)->blocks_inbitmap - 1) / ASFS_SB(sb)->blocks_inbitmap;
-+		ASFS_SB(sb)->block_rovingblockptr = 0;
-+		asfs_brelse(bh);
-+
-+		if (!sb_set_blocksize(sb, sb->s_blocksize)) {
-+			printk(KERN_ERR "ASFS: Found Amiga SFS RootBlock on dev %s, but blocksize %ld is not supported!\n", \
-+			       sb->s_id, sb->s_blocksize);
-+			return -EINVAL;
-+		}
-+
-+		bh = sb_bread(sb, 0);
-+		if (!bh) {
-+			printk(KERN_ERR "ASFS: unable to read superblock\n");
-+			goto out;
-+		}
-+		rootblock = (struct fsRootBlock *)bh->b_data;
-+
-+		if (asfs_check_block((void *)rootblock, sb->s_blocksize, 0, ASFS_ROOTID)) {
-+#ifdef CONFIG_ASFS_RW
-+			struct buffer_head *tmpbh;
-+			if ((tmpbh = asfs_breadcheck(sb, ASFS_SB(sb)->rootobjectcontainer, ASFS_OBJECTCONTAINER_ID))) {
-+				struct fsRootInfo *ri = (struct fsRootInfo *)((u8 *)tmpbh->b_data + sb->s_blocksize - sizeof(struct fsRootInfo));
-+				ASFS_SB(sb)->freeblocks = be32_to_cpu(ri->freeblocks);
-+				asfs_brelse(tmpbh);
-+			} else
-+				ASFS_SB(sb)->freeblocks = 0;
-+
-+			if ((tmpbh = asfs_breadcheck(sb, ASFS_SB(sb)->rootobjectcontainer+2, ASFS_TRANSACTIONFAILURE_ID))) {
-+				printk(KERN_NOTICE "VFS: Found Amiga SFS RootBlock on dev %s, but it has unfinished transaction. Mounting read-only.\n", sb->s_id);
-+				ASFS_SB(sb)->flags |= ASFS_READONLY;
-+				asfs_brelse(tmpbh);
-+			}
-+
-+			if ((tmpbh = asfs_breadcheck(sb, ASFS_SB(sb)->totalblocks-1, ASFS_ROOTID)) == NULL) {
-+				printk(KERN_NOTICE "VFS: Found Amiga SFS RootBlock on dev %s, but there is no second RootBlock! Mounting read-only.\n", sb->s_id);
-+				ASFS_SB(sb)->flags |= ASFS_READONLY;
-+				asfs_brelse(tmpbh);
-+			}
-+			if (!(ASFS_SB(sb)->flags & ASFS_READONLY))
-+				printk(KERN_NOTICE "VFS: Found Amiga SFS RootBlock on dev %s.\n", sb->s_id);
-+#else
-+			ASFS_SB(sb)->freeblocks = 0;
-+			ASFS_SB(sb)->flags |= ASFS_READONLY;
-+			printk(KERN_NOTICE "VFS: Found Amiga SFS RootBlock on dev %s.\n", sb->s_id);
-+#endif
-+		} else {
-+			if (!silent)
-+				printk(KERN_ERR "VFS: Found Amiga SFS RootBlock on dev %s, but it has checksum error!\n", \
-+				       sb->s_id);
-+			goto out;
-+		}
-+	} else {
-+		if (!silent)
-+			printk(KERN_ERR "VFS: Can't find a valid Amiga SFS filesystem on dev %s.\n", \
-+			       sb->s_id);
-+		goto out;
-+	}
-+
-+	asfs_brelse(bh);
-+
-+	sb->s_magic = ASFS_MAGIC;
-+	sb->s_flags |= MS_NODEV | MS_NOSUID;
-+	if (ASFS_SB(sb)->flags & ASFS_READONLY) 
-+		sb->s_flags |= MS_RDONLY;
-+	sb->s_op = &asfs_ops;
-+
-+	if ((rootinode = asfs_get_root_inode(sb))) {
-+		if ((sb->s_root = d_alloc_root(rootinode))) {
-+			sb->s_root->d_op = &asfs_dentry_operations;
-+			return 0;
-+		}
-+		iput(rootinode);
-+	}
-+	return -EINVAL;
-+
-+out:
-+	asfs_brelse(bh);
-+	return -EINVAL;
-+
-+}
-+
-+#ifdef CONFIG_ASFS_RW
-+int asfs_remount(struct super_block *sb, int *flags, char *data)
-+{
-+	asfs_debug("ASFS: remount (flags=0x%x, opts=\"%s\")\n",*flags,data);
-+
-+	if (!asfs_parse_options(data,sb))
-+		return -EINVAL;
-+
-+	if ((*flags & MS_RDONLY) == (sb->s_flags & MS_RDONLY))
-+		return 0;
-+
-+	if (*flags & MS_RDONLY) {
-+		sb->s_flags |= MS_RDONLY;
-+	} else if (!(ASFS_SB(sb)->flags & ASFS_READONLY)) {
-+		sb->s_flags &= ~MS_RDONLY;
-+	} else {
-+		printk("VFS: Can't remount Amiga SFS on dev %s read/write because of errors.", sb->s_id);
-+		return -EINVAL;
-+	}
-+	return 0;
-+}
-+#endif
-+
-+void asfs_put_super(struct super_block *sb)
-+{
-+	struct asfs_sb_info *sbi = ASFS_SB(sb);
-+
-+	if (ASFS_SB(sb)->prefix)
-+		kfree(ASFS_SB(sb)->prefix);
-+	if (ASFS_SB(sb)->root_volume)
-+		kfree(ASFS_SB(sb)->root_volume);
-+
-+	kfree(sbi);
-+	sb->s_fs_info = NULL;
-+	return;
-+}
-+
-+/* That's simple too. */
-+int asfs_statfs(struct super_block *sb, struct kstatfs *buf)
-+{
-+	buf->f_type = ASFS_MAGIC;
-+	buf->f_bsize = sb->s_blocksize;
-+	buf->f_bfree = buf->f_bavail = ASFS_SB(sb)->freeblocks;
-+	buf->f_blocks = ASFS_SB(sb)->totalblocks;
-+	buf->f_namelen = ASFS_MAXFN;
-+	return 0;
-+}
-+
-+/* --- new in 2.6.x --- */
-+static kmem_cache_t * asfs_inode_cachep;
-+
-+struct inode *asfs_alloc_inode(struct super_block *sb)
-+{
-+	struct asfs_inode_info *ei;
-+	ei = (struct asfs_inode_info *)kmem_cache_alloc(asfs_inode_cachep, SLAB_KERNEL);
-+	if (!ei)
-+		return NULL;
-+	return &ei->vfs_inode;
-+}
-+
-+void asfs_destroy_inode(struct inode *inode)
-+{
-+	kmem_cache_free(asfs_inode_cachep, ASFS_I(inode));
-+}
-+
-+static void init_once(void * foo, kmem_cache_t * cachep, unsigned long flags)
-+{
-+	struct asfs_inode_info *ei = (struct asfs_inode_info *) foo;
-+
-+	if ((flags & (SLAB_CTOR_VERIFY|SLAB_CTOR_CONSTRUCTOR)) ==
-+	    SLAB_CTOR_CONSTRUCTOR) {
-+		inode_init_once(&ei->vfs_inode);
-+	}
-+}
-+
-+static int init_inodecache(void)
-+{
-+	asfs_inode_cachep = kmem_cache_create("asfs_inode_cache",
-+					     sizeof(struct asfs_inode_info),
-+					     0, SLAB_HWCACHE_ALIGN|SLAB_RECLAIM_ACCOUNT,
-+					     init_once, NULL);
-+	if (asfs_inode_cachep == NULL)
-+		return -ENOMEM;
-+	return 0;
-+}
-+
-+static void destroy_inodecache(void)
-+{
-+	if (kmem_cache_destroy(asfs_inode_cachep))
-+		printk(KERN_INFO "asfs_inode_cache: not all structures were freed\n");
-+}
-+
-+static struct super_block *asfs_get_sb(struct file_system_type *fs_type,
-+	int flags, const char *dev_name, void *data)
-+{
-+	return get_sb_bdev(fs_type, flags, dev_name, data, asfs_fill_super);
-+}
-+
-+static struct file_system_type asfs_fs_type = {
-+	.owner		= THIS_MODULE,
-+	.name		= "asfs",
-+	.get_sb		= asfs_get_sb,
-+	.kill_sb	= kill_block_super,
-+	.fs_flags	= FS_REQUIRES_DEV,
-+};
-+
-+static int __init init_asfs_fs(void)
-+{
-+	int err = init_inodecache();
-+	if (err)
-+		goto out1;
-+	err = register_filesystem(&asfs_fs_type);
-+	if (err)
-+		goto out;
-+	return 0;
-+out:
-+	destroy_inodecache();
-+out1:
-+	return err;
-+}
-+
-+static void __exit exit_asfs_fs(void)
-+{
-+	unregister_filesystem(&asfs_fs_type);
-+	destroy_inodecache();
-+}
-+
-+/* Yes, works even as a module... :) */
-+
-+#ifdef CONFIG_ASFS_RW
-+MODULE_DESCRIPTION("Amiga Smart File System (read/write) support for Linux kernel 2.6.x v" ASFS_VERSION);
-+#else
-+MODULE_DESCRIPTION("Amiga Smart File System (read-only) support for Linux kernel 2.6.x v" ASFS_VERSION);
-+#endif
-+MODULE_LICENSE("GPL");
-+MODULE_AUTHOR("Marek Szyprowski <marek at amiga.pl>");
-+
-+module_init(init_asfs_fs)
-+module_exit(exit_asfs_fs)
-diff -urN kernel-source-2.6.11-2.6.11-orig/fs/asfs/symlink.c kernel-source-2.6.11-2.6.11/fs/asfs/symlink.c
---- kernel-source-2.6.11-2.6.11-orig/fs/asfs/symlink.c	1970-01-01 01:00:00.000000000 +0100
-+++ kernel-source-2.6.11-2.6.11/fs/asfs/symlink.c	2005-03-04 18:37:12.947239056 +0100
-@@ -0,0 +1,165 @@
-+/*
-+ *
-+ * Amiga Smart File System, Linux implementation
-+ * version: 1.0beta7
-+ *  
-+ * Copyright (C) 2003,2004  Marek 'March' Szyprowski <marek at amiga.pl>
-+ *
-+ *
-+ * 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.
-+ *
-+ */
-+
-+#include <linux/types.h>
-+#include <linux/errno.h>
-+#include <linux/slab.h>
-+#include <linux/fs.h>
-+#include <linux/buffer_head.h>
-+#include <linux/vfs.h>
-+#include <linux/pagemap.h>
-+#include "asfs_fs.h"
-+
-+#include <asm/byteorder.h>
-+#include <asm/uaccess.h>
-+
-+int asfs_symlink_readpage(struct file *file, struct page *page)
-+{
-+	struct buffer_head *bh;
-+	struct fsSoftLink *slinkcont;
-+	struct inode *inode = page->mapping->host;
-+	struct super_block *sb = inode->i_sb;
-+	char *link = kmap(page);
-+	int i = 0, j = 0;
-+	char c, lc = 0, *prefix, *lf, *p;
-+
-+	if (!(bh = asfs_breadcheck(sb, ASFS_I(inode)->firstblock, ASFS_SOFTLINK_ID))) {
-+		SetPageError(page);
-+		kunmap(page);
-+		unlock_page(page);
-+		return -EIO;
-+	}
-+	slinkcont = (struct fsSoftLink *) bh->b_data;
-+
-+	lf = slinkcont->string;
-+	prefix = ASFS_SB(sb)->prefix ? ASFS_SB(sb)->prefix : "/";
-+
-+	if ((p = strchr(lf,':'))) {	/* Handle assign or volume name */
-+		if (ASFS_SB(sb)->root_volume &&
-+		    strncmp(lf, ASFS_SB(sb)->root_volume, strlen(ASFS_SB(sb)->root_volume)) == 0) {
-+			/* global root volume name found */
-+			link[i++] = '/';
-+			lf = p+1;
-+		} else {
-+			/* adding volume prefix */ 
-+			while (i < 1023 && (c = prefix[i]))
-+				link[i++] = c;
-+			if (ASFS_SB(sb)->flags & ASFS_VOL_LOWERCASE) {
-+				while (i < 1023 && lf[j] != ':')
-+					link[i++] = asfs_lowerchar(lf[j++]);
-+			} else {
-+				while (i < 1023 && lf[j] != ':')
-+					link[i++] = lf[j++];
-+			}
-+			if (i < 1023)
-+				link[i++] = '/';
-+			j++;
-+		}
-+		lc = '/';
-+	}
-+
-+	while (i < 1023 && (c = lf[j])) {
-+		if (c == '/' && lc == '/' && i < 1020) {	/* parent dir */
-+			link[i++] = '.';
-+			link[i++] = '.';
-+		}
-+		link[i++] = c;
-+		lc = c;
-+		j++;
-+	}
-+	link[i] = '\0';
-+	SetPageUptodate(page);
-+	kunmap(page);
-+	unlock_page(page);
-+	asfs_brelse(bh);
-+	return 0;
-+}
-+
-+#ifdef CONFIG_ASFS_RW
-+
-+int asfs_write_symlink(struct inode *symfile, const char *symname)
-+{
-+	struct super_block *sb = symfile->i_sb;
-+	struct buffer_head *bh;
-+	struct fsSoftLink *slinkcont;
-+	char *p, c, lc;
-+	int i, maxlen, pflen;
-+
-+	asfs_debug("asfs_write_symlink %s to node %d\n", symname, (int)symfile->i_ino);
-+
-+	if (!(bh = asfs_breadcheck(sb, ASFS_I(symfile)->firstblock, ASFS_SOFTLINK_ID))) {
-+		unlock_super(sb);
-+		return -EIO;
-+	}
-+	slinkcont = (struct fsSoftLink *) bh->b_data;
-+
-+	/* translating symlink target path */
-+
-+	maxlen = sb->s_blocksize - sizeof(struct fsSoftLink) - 2;
-+	i  = 0;
-+	p  = slinkcont->string;
-+	lc = '/';
-+
-+	if (*symname == '/') {
-+		while (*symname == '/')
-+			symname++;
-+		if (ASFS_SB(sb)->prefix &&
-+		    strncmp(symname-1, ASFS_SB(sb)->prefix, (pflen = strlen(ASFS_SB(sb)->prefix))) == 0) {
-+			/* found volume prefix, ommiting it */
-+			symname += pflen;
-+			while ((c = *symname++) != '/' && c != '\0') {
-+				*p++ = c;
-+				i++;
-+			}
-+			*p++ = ':';
-+		} else if (ASFS_SB(sb)->root_volume) {	/* adding root volume name */
-+			while (ASFS_SB(sb)->root_volume[i])
-+				*p++ = ASFS_SB(sb)->root_volume[i++];
-+			*p++ = ':';
-+		} else {	/* do nothing */
-+			*p++ = '/';
-+		}
-+		i++;
-+	}
-+
-+	while (i < maxlen && (c = *symname++)) {
-+		if (c == '.' && lc == '/' && *symname == '.' && symname[1] == '/') {
-+			*p++ = '/';
-+			i++;
-+			symname += 2;
-+			lc = '/';
-+		} else if (c == '.' && lc == '/' && *symname == '/') {
-+			symname++;
-+			lc = '/';
-+		} else {
-+			*p++ = c;
-+			lc   = c;
-+			i++;
-+		}
-+		if (lc == '/')
-+			while (*symname == '/')
-+				symname++;
-+	}
-+	*p = 0;
-+
-+	asfs_bstore(sb, bh);
-+	asfs_brelse(bh);
-+
-+	unlock_super(sb);
-+	
-+	return 0;
-+}
-+
-+#endif
-diff -urN kernel-source-2.6.11-2.6.11-orig/fs/Kconfig kernel-source-2.6.11-2.6.11/fs/Kconfig
---- kernel-source-2.6.11-2.6.11-orig/fs/Kconfig	2005-03-02 08:38:10.000000000 +0100
-+++ kernel-source-2.6.11-2.6.11/fs/Kconfig	2005-03-04 18:37:13.115213520 +0100
-@@ -921,6 +921,37 @@
- 	  To compile this file system support as a module, choose M here: the
- 	  module will be called affs.  If unsure, say N.
- 
-+config ASFS_FS
-+	tristate "Amiga SFS file system support (EXPERIMENTAL)"
-+	depends on EXPERIMENTAL
-+	help
-+
-+	  The Amiga Smart FileSystem (SFS) is the file system used on hard 
-+	  disks by Amiga(tm) and MorphOS(tm) systems.  Say Y if you want 
-+	  to be able to read files from an Amiga SFS partition on your hard 
-+	  drive.
-+
-+	  For more information read <file:Documentation/filesystems/asfs.txt>
-+
-+	  To compile this file system support as a module, choose M here: the
-+	  module will be called asfs.
-+
-+	  If unsure, say N.
-+
-+config ASFS_RW
-+	bool "Amiga SFS write support (DANGEROUS)"
-+	depends on ASFS_FS
-+	help
-+
-+	  If you say Y here, you will be able to write to ASFS file
-+	  systems as well as read from them. The read-write support in ASFS
-+	  is in beta stage. This means that useing it to write files to SFS 
-+	  partitions is DANGEROUS and COULD corrupt the filesystem.
-+
-+	  For more information read <file:Documentation/filesystems/asfs.txt>
-+
-+	  If unsure, say N.
-+
- config HFS_FS
- 	tristate "Apple Macintosh file system support (EXPERIMENTAL)"
- 	depends on EXPERIMENTAL
-diff -urN kernel-source-2.6.11-2.6.11-orig/fs/Makefile kernel-source-2.6.11-2.6.11/fs/Makefile
---- kernel-source-2.6.11-2.6.11-orig/fs/Makefile	2005-03-02 08:38:10.000000000 +0100
-+++ kernel-source-2.6.11-2.6.11/fs/Makefile	2005-03-04 18:37:13.116213368 +0100
-@@ -81,6 +81,7 @@
- obj-$(CONFIG_JFFS_FS)		+= jffs/
- obj-$(CONFIG_JFFS2_FS)		+= jffs2/
- obj-$(CONFIG_AFFS_FS)		+= affs/
-+obj-$(CONFIG_ASFS_FS)		+= asfs/
- obj-$(CONFIG_ROMFS_FS)		+= romfs/
- obj-$(CONFIG_QNX4FS_FS)		+= qnx4/
- obj-$(CONFIG_AUTOFS_FS)		+= autofs/
-diff -urN kernel-source-2.6.11-2.6.11-orig/include/linux/amigasfs.h kernel-source-2.6.11-2.6.11/include/linux/amigasfs.h
---- kernel-source-2.6.11-2.6.11-orig/include/linux/amigasfs.h	1970-01-01 01:00:00.000000000 +0100
-+++ kernel-source-2.6.11-2.6.11/include/linux/amigasfs.h	2005-03-04 18:37:13.169205312 +0100
-@@ -0,0 +1,276 @@
-+#ifndef __LINUX_AMIGASFS_H
-+#define __LINUX_AMIGASFS_H
-+
-+#include <linux/types.h>
-+
-+/* some helper macros... */
-+#define ASFS_MAKE_ID(a,b,c,d) (((a)&0xff)<<24|((b)&0xff)<<16|((c)&0xff)<<8|((d)&0xff))
-+
-+/* Amiga SFS block IDs */
-+#define ASFS_ROOTID                 ASFS_MAKE_ID('S','F','S','\0')
-+#define ASFS_OBJECTCONTAINER_ID     ASFS_MAKE_ID('O','B','J','C')
-+#define ASFS_BNODECONTAINER_ID      ASFS_MAKE_ID('B','N','D','C')
-+#define ASFS_NODECONTAINER_ID       ASFS_MAKE_ID('N','D','C',' ')
-+#define ASFS_HASHTABLE_ID           ASFS_MAKE_ID('H','T','A','B')
-+#define ASFS_SOFTLINK_ID            ASFS_MAKE_ID('S','L','N','K')
-+#define ASFS_ADMINSPACECONTAINER_ID ASFS_MAKE_ID('A','D','M','C')
-+#define ASFS_BITMAP_ID              ASFS_MAKE_ID('B','T','M','P')
-+#define ASFS_TRANSACTIONFAILURE_ID  ASFS_MAKE_ID('T','R','F','A')
-+
-+/* Amiga SFS defines and magic values */
-+
-+#define ASFS_MAGIC 0xa0ff
-+#define ASFS_MAXFN (105u)
-+#define ASFS_MAXFILESIZE 0x8FFFFFFE
-+
-+#define ASFS_STRUCTURE_VERISON (3)
-+#define ASFS_BLCKFACCURACY	(5)
-+
-+#define ASFS_ROOTBITS_CASESENSITIVE (128)
-+#define ASFS_READONLY (512)
-+#define ASFS_VOL_LOWERCASE (1024)
-+
-+#define ASFS_ROOTNODE   (1)
-+#define ASFS_RECYCLEDNODE (2)
-+
-+#define OTYPE_HIDDEN      (1)
-+#define OTYPE_HARDLINK    (32)
-+#define OTYPE_LINK        (64)
-+#define OTYPE_DIR         (128)
-+
-+#define MSB_MASK (1ul << 31)
-+
-+#define NODE_STRUCT_SIZE (10)	/* (sizeof(struct fsObjectNode)) */
-+#define NODECONT_BLOCK_COUNT ((sb->s_blocksize - sizeof(struct fsNodeContainer)) / sizeof(u32))
-+
-+#define ASFS_ALWAYSFREE (16)		/* keep this amount of blocks free */
-+
-+#define ASFS_BLOCKCHUNKS (16)		/* try to allocate this number of blocks in one request */
-+
-+#ifndef TRUE
-+#define TRUE		1
-+#endif
-+#ifndef FALSE
-+#define FALSE		0
-+#endif
-+
-+/* amigados protection bits */
-+
-+#define FIBB_SCRIPT    6	/* program is a script (execute) file */
-+#define FIBB_PURE      5	/* program is reentrant and rexecutable */
-+#define FIBB_ARCHIVE   4	/* cleared whenever file is changed */
-+#define FIBB_READ      3	/* ignored by old filesystem */
-+#define FIBB_WRITE     2	/* ignored by old filesystem */
-+#define FIBB_EXECUTE   1	/* ignored by system, used by Shell */
-+#define FIBB_DELETE    0	/* prevent file from being deleted */
-+
-+#define FIBF_SCRIPT    (1<<FIBB_SCRIPT)
-+#define FIBF_PURE      (1<<FIBB_PURE)
-+#define FIBF_ARCHIVE   (1<<FIBB_ARCHIVE)
-+#define FIBF_READ      (1<<FIBB_READ)
-+#define FIBF_WRITE     (1<<FIBB_WRITE)
-+#define FIBF_EXECUTE   (1<<FIBB_EXECUTE)
-+#define FIBF_DELETE    (1<<FIBB_DELETE)
-+
-+/* name hashing macro */
-+
-+#define HASHCHAIN(x) (u16)(x % (u16)(((sb->s_blocksize) - sizeof(struct fsHashTable))>>2))
-+
-+/* Each block has its own header with checksum and id, its called fsBlockHeader */
-+
-+struct fsBlockHeader {
-+	u32 id;			/* 4 character id string of this block */
-+	u32 checksum;		/* The checksum */
-+	u32 ownblock;		/* The blocknumber of the block this block is stored at */
-+};
-+
-+/* On-disk "super block", called fsRootBlock */
-+
-+struct fsRootBlock {
-+	struct fsBlockHeader bheader;
-+
-+	u16 version;		/* Version number of the filesystem block structure */
-+	u16 sequencenumber;	/* The Root with the highest sequencenumber is valid */
-+
-+	u32 datecreated;	/* Creation date (when first formatted).  Cannot be changed. */
-+	u8 bits;		/* various settings, see defines below. */
-+	u8 pad1;
-+	u16 pad2;
-+
-+	u32 reserved1[2];
-+
-+	u32 firstbyteh;		/* The first byte of our partition from the start of the */
-+	u32 firstbyte;		/* disk.  firstbyteh = upper 32 bits, firstbyte = lower 32 bits. */
-+
-+	u32 lastbyteh;		/* The last byte of our partition, excluding this one. */
-+	u32 lastbyte;
-+
-+	u32 totalblocks;	/* size of this partition in blocks */
-+	u32 blocksize;		/* blocksize used */
-+
-+	u32 reserved2[2];
-+	u32 reserved3[8];
-+
-+	u32 bitmapbase;		/* location of the bitmap */
-+	u32 adminspacecontainer;	/* location of first adminspace container */
-+	u32 rootobjectcontainer;	/* location of the root objectcontainer */
-+	u32 extentbnoderoot;	/* location of the root of the extentbnode B-tree */
-+	u32 objectnoderoot;	/* location of the root of the objectnode tree */
-+
-+	u32 reserved4[3];
-+};
-+
-+/* On disk inode, called fsObject */
-+
-+struct fsObject {
-+	u16 owneruid;
-+	u16 ownergid;
-+	u32 objectnode;
-+	u32 protection;
-+
-+	union {
-+		struct {
-+			u32 data;
-+			u32 size;
-+		} file;
-+
-+		struct {
-+			u32 hashtable;	/* for directories & root, 0 means no hashblock */
-+			u32 firstdirblock;
-+		} dir;
-+	} object;
-+
-+	u32 datemodified;
-+	u8 bits;
-+
-+	u8 name[0];
-+	u8 comment[0];
-+};
-+
-+/* On disk block containging a number of fsObjects */
-+
-+struct fsObjectContainer {
-+	struct fsBlockHeader bheader;
-+
-+	u32 parent;
-+	u32 next;
-+	u32 previous;		/* 0 for the first block in the directory chain */
-+
-+	struct fsObject object[0];
-+};
-+
-+/* BTree structures, used to collect file data position on disk */
-+
-+struct fsExtentBNode {
-+	u32 key;		/* data! */
-+	u32 next;
-+	u32 prev;
-+	u16 blocks;		/* The size in blocks of the region this Extent controls */
-+};
-+
-+struct BNode {
-+	u32 key;
-+	u32 data;
-+};
-+
-+struct BTreeContainer {
-+	u16 nodecount;
-+	u8 isleaf;
-+	u8 nodesize;		/* Must be a multiple of 2 */
-+
-+	struct BNode bnode[0];
-+};
-+
-+/* On disk block with BTreeContainer */
-+
-+struct fsBNodeContainer {
-+	struct fsBlockHeader bheader;
-+	struct BTreeContainer btc;
-+};
-+
-+/* On disk block  with soft link data */
-+
-+struct fsSoftLink {
-+	struct fsBlockHeader bheader;
-+	u32 parent;
-+	u32 next;
-+	u32 previous;
-+	u8 string[0];
-+};
-+
-+/* On disk block with hashtable data */
-+
-+struct fsHashTable {
-+	struct fsBlockHeader bheader;
-+	u32 parent;
-+	u32 hashentry[0];
-+};
-+
-+/* On disk block with node index and some helper structures */
-+
-+struct fsNodeContainer {
-+	struct fsBlockHeader bheader;
-+	u32 nodenumber;
-+	u32 nodes;
-+	u32 node[0];
-+};
-+
-+struct fsNode {
-+	u32 data;
-+};
-+
-+struct fsObjectNode {
-+	struct fsNode node;
-+	u32 next;
-+	u16 hash16;
-+} __attribute__ ((packed));
-+
-+/* Some adminspace and bitmap block structures */
-+
-+struct fsAdminSpace {
-+	u32 space;
-+	u32 bits;		
-+/* Set bits are used blocks, bit 31 is	the first block in the AdminSpace. */
-+};
-+
-+struct fsAdminSpaceContainer {
-+	struct fsBlockHeader bheader;
-+
-+	u32 next;
-+	u32 previous;
-+
-+	u8 bits;
-+	u8 pad1;
-+	u16 pad2;
-+
-+	struct fsAdminSpace adminspace[0];
-+};
-+
-+struct fsBitmap {
-+	struct fsBlockHeader bheader;
-+
-+	u32 bitmap[0];
-+
-+/* Bits are 1 if the block is free, and 0 if full.
-+   Bitmap must consist of an integral number of longwords. */
-+};
-+
-+/* The fsRootInfo structure has all kinds of information about the format
-+   of the disk. */
-+
-+struct fsRootInfo {
-+	u32 deletedblocks;	/* Amount in blocks which deleted files consume. */
-+	u32 deletedfiles;	/* Number of deleted files in recycled. */
-+	u32 freeblocks;		/* Cached number of free blocks on disk. */
-+
-+	u32 datecreated;
-+
-+	u32 lastallocatedblock;	/* Block which was most recently allocated */
-+	u32 lastallocatedadminspace;	/* AdminSpaceContainer which most recently was used to allocate a block */
-+	u32 lastallocatedextentnode;	/* ExtentNode which was most recently created */
-+	u32 lastallocatedobjectnode;	/* ObjectNode which was most recently created */
-+
-+	u32 rovingpointer;
-+};
-+
-+#endif

Copied: trunk/kernel/source/kernel-source-2.6.11-2.6.11/debian/patches/fs-asfs.patch (from rev 2762, trunk/kernel/source/kernel-source-2.6.11-2.6.11/debian/patches/fs-asfs.dpatch)

Deleted: trunk/kernel/source/kernel-source-2.6.11-2.6.11/debian/patches/ia64-generic-nosmp.dpatch
===================================================================
--- trunk/kernel/source/kernel-source-2.6.11-2.6.11/debian/patches/ia64-generic-nosmp.dpatch	2005-03-21 09:35:04 UTC (rev 2762)
+++ trunk/kernel/source/kernel-source-2.6.11-2.6.11/debian/patches/ia64-generic-nosmp.dpatch	2005-03-21 09:38:36 UTC (rev 2763)
@@ -1,305 +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-ia64-test-2.6.12-20050313.orig/arch/ia64/kernel/Makefile linux-ia64-test-2.6.12-20050313/arch/ia64/kernel/Makefile
---- linux-ia64-test-2.6.12-20050313.orig/arch/ia64/kernel/Makefile	2005-03-13 02:13:58.000000000 -0700
-+++ linux-ia64-test-2.6.12-20050313/arch/ia64/kernel/Makefile	2005-03-13 14:50:14.846175482 -0700
-@@ -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-ia64-test-2.6.12-20050313.orig/arch/ia64/kernel/acpi.c linux-ia64-test-2.6.12-20050313/arch/ia64/kernel/acpi.c
---- linux-ia64-test-2.6.12-20050313.orig/arch/ia64/kernel/acpi.c	2005-03-13 02:01:26.000000000 -0700
-+++ linux-ia64-test-2.6.12-20050313/arch/ia64/kernel/acpi.c	2005-03-13 15:13:33.340298975 -0700
-@@ -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-ia64-test-2.6.12-20050313.orig/arch/ia64/kernel/numa.c linux-ia64-test-2.6.12-20050313/arch/ia64/kernel/numa.c
---- linux-ia64-test-2.6.12-20050313.orig/arch/ia64/kernel/numa.c	1969-12-31 17:00:00.000000000 -0700
-+++ linux-ia64-test-2.6.12-20050313/arch/ia64/kernel/numa.c	2005-03-13 15:13:09.472135205 -0700
-@@ -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-ia64-test-2.6.12-20050313.orig/arch/ia64/kernel/smpboot.c linux-ia64-test-2.6.12-20050313/arch/ia64/kernel/smpboot.c
---- linux-ia64-test-2.6.12-20050313.orig/arch/ia64/kernel/smpboot.c	2005-03-13 01:55:51.000000000 -0700
-+++ linux-ia64-test-2.6.12-20050313/arch/ia64/kernel/smpboot.c	2005-03-13 15:00:51.576636432 -0700
-@@ -520,47 +520,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-ia64-test-2.6.12-20050313.orig/arch/ia64/mm/discontig.c linux-ia64-test-2.6.12-20050313/arch/ia64/mm/discontig.c
---- linux-ia64-test-2.6.12-20050313.orig/arch/ia64/mm/discontig.c	2005-03-13 02:10:32.000000000 -0700
-+++ linux-ia64-test-2.6.12-20050313/arch/ia64/mm/discontig.c	2005-03-13 15:13:24.740689706 -0700
-@@ -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-ia64-test-2.6.12-20050313.orig/include/asm-ia64/sn/sn_cpuid.h linux-ia64-test-2.6.12-20050313/include/asm-ia64/sn/sn_cpuid.h
---- linux-ia64-test-2.6.12-20050313.orig/include/asm-ia64/sn/sn_cpuid.h	2005-03-13 01:53:39.000000000 -0700
-+++ linux-ia64-test-2.6.12-20050313/include/asm-ia64/sn/sn_cpuid.h	2005-03-13 15:00:42.341284983 -0700
-@@ -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)
- 
- /*
---- linux-2.6.11/include/asm-ia64/smp.h.orig	2005-03-13 17:09:03.471073456 -0700
-+++ linux-2.6.11/include/asm-ia64/smp.h	2005-03-13 17:09:16.935917041 -0700
-@@ -126,6 +126,7 @@
- #else
- 
- #define cpu_logical_id(cpuid)		0
-+#define cpu_physical_id(i)     ((ia64_getreg(_IA64_REG_CR_LID) >> 16) & 0xffff)
- 
- #endif /* CONFIG_SMP */
- #endif /* _ASM_IA64_SMP_H */

Copied: trunk/kernel/source/kernel-source-2.6.11-2.6.11/debian/patches/ia64-generic-nosmp.patch (from rev 2762, trunk/kernel/source/kernel-source-2.6.11-2.6.11/debian/patches/ia64-generic-nosmp.dpatch)

Deleted: trunk/kernel/source/kernel-source-2.6.11-2.6.11/debian/patches/ia64-irq-affinity-upfix.dpatch
===================================================================
--- trunk/kernel/source/kernel-source-2.6.11-2.6.11/debian/patches/ia64-irq-affinity-upfix.dpatch	2005-03-21 09:35:04 UTC (rev 2762)
+++ trunk/kernel/source/kernel-source-2.6.11-2.6.11/debian/patches/ia64-irq-affinity-upfix.dpatch	2005-03-21 09:38:36 UTC (rev 2763)
@@ -1,27 +0,0 @@
-#! /bin/sh -e
-## DP: Description: Add a no-op set_irq_affinity_info() for non-SMP
-## DP: Patch author: dann frazier <dannf at hp.com>
-## DP: Upstream status: Submitted
-
-. $(dirname $0)/DPATCH
-
- at DPATCH@
-This patch defines a no-op set_irq_affinity_info() when CONFIG_SMP is not set,
-fixing a linking error in sn_set_affinity_irq().
-
-Signed-off-by: dann frazier <dannf at hp.com>
-
---- kernel-source-2.6.11-2.6.11-orig/arch/ia64/kernel/irq.c	2005-03-02 08:38:25.000000000 +0100
-+++ kernel-source-2.6.11-2.6.11/arch/ia64/kernel/irq.c	2005-03-05 10:45:07.250728752 +0100
-@@ -133,7 +133,10 @@
- 	}
- }
- 
--
-+#else /* !CONFIG_SMP */
-+void set_irq_affinity_info (unsigned int irq, int hwid, int redir)
-+{
-+}
- #endif /* CONFIG_SMP */
- 
- #ifdef CONFIG_HOTPLUG_CPU

Copied: trunk/kernel/source/kernel-source-2.6.11-2.6.11/debian/patches/ia64-irq-affinity-upfix.patch (from rev 2762, trunk/kernel/source/kernel-source-2.6.11-2.6.11/debian/patches/ia64-irq-affinity-upfix.dpatch)

Deleted: trunk/kernel/source/kernel-source-2.6.11-2.6.11/debian/patches/modular-ide-pnp.dpatch
===================================================================
--- trunk/kernel/source/kernel-source-2.6.11-2.6.11/debian/patches/modular-ide-pnp.dpatch	2005-03-21 09:35:04 UTC (rev 2762)
+++ trunk/kernel/source/kernel-source-2.6.11-2.6.11/debian/patches/modular-ide-pnp.dpatch	2005-03-21 09:38:36 UTC (rev 2763)
@@ -1,77 +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: Allow modular built of ide-pnp
-## DP: Patch author: Herbert Xu, Christoph Hellwig
-## DP: Upstream status: submitted
-
-. $(dirname $0)/DPATCH
-
- at DPATCH@
---- 1.49/drivers/ide/Kconfig	2004-06-18 08:43:53 +02:00
-+++ edited/drivers/ide/Kconfig	2004-06-19 12:25:46 +02:00
-@@ -316,7 +316,7 @@
- 	  Otherwise say N.
- 
- config BLK_DEV_IDEPNP
--	bool "PNP EIDE support"
-+	tristate "PNP EIDE support"
- 	depends on PNP
- 	help
- 	  If you have a PnP (Plug and Play) compatible EIDE card and
---- 1.21/drivers/ide/Makefile	2004-06-18 08:43:53 +02:00
-+++ edited/drivers/ide/Makefile	2004-06-19 12:42:49 +02:00
-@@ -23,7 +23,6 @@
- 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
- 
- # built-in only drivers from arm/
- ide-core-$(CONFIG_IDE_ARM)		+= arm/ide_arm.o
-@@ -44,6 +43,7 @@
- 
- obj-$(CONFIG_BLK_DEV_IDE)		+= ide-core.o
- obj-$(CONFIG_IDE_GENERIC)		+= ide-generic.o
-+obj-$(CONFIG_BLK_DEV_IDEPNP)		+= ide-pnp.o
- 
- obj-$(CONFIG_BLK_DEV_IDEDISK)		+= ide-disk.o
- obj-$(CONFIG_BLK_DEV_IDECD)		+= ide-cd.o
---- 1.9/drivers/ide/ide-pnp.c	2004-06-15 18:31:45 +02:00
-+++ edited/drivers/ide/ide-pnp.c	2004-06-19 12:34:27 +02:00
-@@ -69,7 +69,21 @@
- 	.remove		= idepnp_remove,
- };
- 
--void __init pnpide_init(void)
-+int __init pnpide_init(void)
- {
--	pnp_register_driver(&idepnp_driver);
-+	return pnp_register_driver(&idepnp_driver);
- }
-+
-+#ifdef MODULE
-+static void __exit pnpide_exit(void)
-+{
-+       pnp_unregister_driver(&idepnp_driver);
-+}
-+
-+module_init(pnpide_init);
-+module_exit(pnpide_exit);
-+#endif
-+
-+MODULE_AUTHOR("Andrey Panin");
-+MODULE_DESCRIPTION("Enabler for ISAPNP IDE devices");
-+MODULE_LICENSE("GPL");
---- 1.150/drivers/ide/ide.c	2004-06-15 18:31:12 +02:00
-+++ edited/drivers/ide/ide.c	2004-06-19 12:29:44 +02:00
-@@ -1954,7 +1954,7 @@
- 	return 1;
- }
- 
--extern void pnpide_init(void);
-+extern int pnpide_init(void);
- extern void h8300_ide_init(void);
- 
- /*

Copied: trunk/kernel/source/kernel-source-2.6.11-2.6.11/debian/patches/modular-ide-pnp.patch (from rev 2762, trunk/kernel/source/kernel-source-2.6.11-2.6.11/debian/patches/modular-ide-pnp.dpatch)

Deleted: trunk/kernel/source/kernel-source-2.6.11-2.6.11/debian/patches/modular-ide.dpatch
===================================================================
--- trunk/kernel/source/kernel-source-2.6.11-2.6.11/debian/patches/modular-ide.dpatch	2005-03-21 09:35:04 UTC (rev 2762)
+++ trunk/kernel/source/kernel-source-2.6.11-2.6.11/debian/patches/modular-ide.dpatch	2005-03-21 09:38:36 UTC (rev 2763)
@@ -1,128 +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: fix IDE modularisation
-## DP: Patch author: Herbert Xu
-## DP: Upstream status: rejected
-
-. $(dirname $0)/DPATCH
-
- at DPATCH@
---- 1.3/drivers/ide/ide-generic.c	2004-02-22 18:36:17 +01:00
-+++ edited/drivers/ide/ide-generic.c	2004-06-16 15:44:16 +02:00
-@@ -11,9 +11,14 @@
- #include <linux/init.h>
- #include <linux/module.h>
- #include <linux/ide.h>
-+#include <linux/config.h>
- 
- static int __init ide_generic_init(void)
- {
-+#ifdef CONFIG_BLK_DEV_IDEPCI
-+	ide_scan_pcibus();
-+#endif
-+
- 	if (ide_hwifs[0].io_ports[IDE_DATA_OFFSET])
- 		ide_get_lock(NULL, NULL); /* for atari only */
- 
---- 1.150/drivers/ide/ide.c	2004-06-15 18:31:12 +02:00
-+++ edited/drivers/ide/ide.c	2004-06-16 15:44:16 +02:00
-@@ -175,10 +175,11 @@
- static int initializing;	/* set while initializing built-in drivers */
- 
- DECLARE_MUTEX(ide_cfg_sem);
-+EXPORT_SYMBOL(ide_cfg_sem);
-  __cacheline_aligned_in_smp DEFINE_SPINLOCK(ide_lock);
- 
- #ifdef CONFIG_BLK_DEV_IDEPCI
--static int ide_scan_direction; /* THIS was formerly 2.2.x pci=reverse */
-+int ide_scan_direction;		/* THIS was formerly 2.2.x pci=reverse */
- #endif
- 
- #ifdef CONFIG_IDEDMA_AUTO
-@@ -1317,6 +1318,8 @@
- 
- EXPORT_SYMBOL(system_bus_clock);
- 
-+EXPORT_SYMBOL(ide_add_generic_settings);
-+
- /*
-  *	Locking is badly broken here - since way back.  That sucker is
-  * root-only, but that's not an excuse...  The real question is what
-@@ -1962,9 +1965,9 @@
-  */
- static void __init probe_for_hwifs (void)
- {
--#ifdef CONFIG_BLK_DEV_IDEPCI
--	ide_scan_pcibus(ide_scan_direction);
--#endif /* CONFIG_BLK_DEV_IDEPCI */
-+#if defined(CONFIG_BLK_DEV_IDEPCI) && !defined(MODULE)
-+	ide_scan_pcibus();
-+#endif /* CONFIG_BLK_DEV_IDEPCI && !MODULE */
- 
- #ifdef CONFIG_ETRAX_IDE
- 	{
---- 1.25/drivers/ide/setup-pci.c	2004-06-01 21:04:38 +02:00
-+++ edited/drivers/ide/setup-pci.c	2004-06-16 15:44:18 +02:00
-@@ -837,7 +837,7 @@
-  *	boot up the pci layer takes over the job.
-  */
-  
--static int __init ide_scan_pcidev(struct pci_dev *dev)
-+static int ide_scan_pcidev(struct pci_dev *dev)
- {
- 	struct list_head *l;
- 	struct pci_driver *d;
-@@ -863,21 +863,23 @@
- 
- /**
-  *	ide_scan_pcibus		-	perform the initial IDE driver scan
-- *	@scan_direction: set for reverse order scanning
-  *
-  *	Perform the initial bus rather than driver ordered scan of the
-  *	PCI drivers. After this all IDE pci handling becomes standard
-  *	module ordering not traditionally ordered.
-  */
-  	
--void __init ide_scan_pcibus (int scan_direction)
-+void ide_scan_pcibus(void)
- {
- 	struct pci_dev *dev = NULL;
- 	struct pci_driver *d;
- 	struct list_head *l, *n;
- 
-+	if (!pre_init)
-+		return;
-+
- 	pre_init = 0;
--	if (!scan_direction) {
-+	if (!ide_scan_direction) {
- 		while ((dev = pci_find_device(PCI_ANY_ID, PCI_ANY_ID, dev)) != NULL) {
- 			ide_scan_pcidev(dev);
- 		}
-@@ -899,3 +901,5 @@
- 		pci_register_driver(d);
- 	}
- }
-+
-+EXPORT_SYMBOL_GPL(ide_scan_pcibus);
---- 1.124/include/linux/ide.h	2004-06-05 21:58:33 +02:00
-+++ edited/include/linux/ide.h	2004-06-16 15:44:18 +02:00
-@@ -1128,6 +1128,7 @@
- extern	ide_hwif_t	ide_hwifs[];		/* master data repository */
- #endif
- extern int noautodma;
-+extern int ide_scan_direction;
- 
- extern int ide_end_request (ide_drive_t *drive, int uptodate, int nrsecs);
- 
-@@ -1337,7 +1338,7 @@
- 
- extern int ideprobe_init(void);
- 
--extern void ide_scan_pcibus(int scan_direction) __init;
-+extern void ide_scan_pcibus(void);
- extern int ide_pci_register_driver(struct pci_driver *driver);
- extern void ide_pci_unregister_driver(struct pci_driver *driver);
- void ide_pci_setup_ports(struct pci_dev *, struct ide_pci_device_s *, int, ata_index_t *);

Copied: trunk/kernel/source/kernel-source-2.6.11-2.6.11/debian/patches/modular-ide.patch (from rev 2762, trunk/kernel/source/kernel-source-2.6.11-2.6.11/debian/patches/modular-ide.dpatch)

Deleted: trunk/kernel/source/kernel-source-2.6.11-2.6.11/debian/patches/modular-vesafb-3.dpatch
===================================================================
--- trunk/kernel/source/kernel-source-2.6.11-2.6.11/debian/patches/modular-vesafb-3.dpatch	2005-03-21 09:35:04 UTC (rev 2762)
+++ trunk/kernel/source/kernel-source-2.6.11-2.6.11/debian/patches/modular-vesafb-3.dpatch	2005-03-21 09:38:36 UTC (rev 2763)
@@ -1,110 +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: modularised VESA FB
-## DP: Patch author: unknown
-## DP: Upstream status: not submitted
-
-. $(dirname $0)/DPATCH
-
- at DPATCH@
---- kernel-source-2.6.6/drivers/video/Kconfig	2004-05-10 19:48:01.000000000 +1000
-+++ kernel-source-2.6.6-1/drivers/video/Kconfig	2004-05-10 22:21:43.000000000 +1000
-@@ -283,7 +283,7 @@
- 	  cards. Say Y if you have one of those.
- 
- config FB_VESA
--	bool "VESA VGA graphics support"
-+	tristate "VESA VGA graphics support"
- 	depends on FB && (X86 || X86_64)
- 	help
- 	  This is the frame buffer device driver for generic VESA 2.0
-
---- a/drivers/video/vesafb.c	2004-10-18 17:53:11.000000000 -0400
-+++ b/drivers/video/vesafb.c	2004-10-23 01:58:33.000000000 -0400
-@@ -19,6 +19,7 @@
- #include <linux/fb.h>
- #include <linux/ioport.h>
- #include <linux/init.h>
-+#include <linux/moduleparam.h>
- #ifdef __i386__
- #include <video/edid.h>
- #endif
-@@ -49,6 +50,7 @@
- 
- static int             inverse   = 0;
- static int             mtrr      = 1;
-+static int             mtrr_hdl;
- static int	       vram_remap __initdata = 0; /* Set amount of memory to be used */
- static int        vram_total __initdata = 0; /* Set total amount of memory */
- static int             pmi_setpal = 0;	/* pmi for palette changes ??? */
-@@ -56,6 +58,9 @@
- static void            (*pmi_start)(void);
- static void            (*pmi_pal)(void);
- 
-+static char	       *options;
-+module_param(options, charp, 0);
-+
- /* --------------------------------------------------------------------- */
- 
- static int vesafb_pan_display(struct fb_var_screeninfo *var,
-@@ -221,6 +226,8 @@
- 	struct fb_info *info;
- 	int i, err;
- 
-+	vesafb_setup(options);
-+
- 	if (screen_info.orig_video_isVGA != VIDEO_TYPE_VLFB)
- 		return -ENXIO;
- 
-@@ -368,7 +375,7 @@
-                 	temp_size &= (temp_size - 1);
-                         
-                 /* Try and find a power of two to add */
--		while (temp_size && mtrr_add(vesafb_fix.smem_start, temp_size, MTRR_TYPE_WRCOMB, 1)==-EINVAL) {
-+		while (temp_size && (mtrr_hdl = mtrr_add(vesafb_fix.smem_start, temp_size, MTRR_TYPE_WRCOMB, 1)) == -EINVAL) {
- 			temp_size >>= 1;
- 		}
- 	}
-@@ -390,6 +397,7 @@
- 	}
- 	printk(KERN_INFO "fb%d: %s frame buffer device\n",
- 	       info->node, info->fix.id);
-+	dev_set_drvdata(device, info);
- 	return 0;
- err:
- 	framebuffer_release(info);
-@@ -397,6 +405,17 @@
- 	return err;
- }
- 
-+static void __exit vesafb_remove(struct device *device)
-+{
-+	struct fb_info *info = dev_get_drvdata(device);
-+
-+	unregister_framebuffer(info);
-+	if (mtrr && mtrr_hdl >= 0)
-+		mtrr_del(mtrr_hdl, 0, 0);
-+	iounmap(info->screen_base);
-+	release_mem_region(vesafb_fix.smem_start, vesafb_fix.smem_len);
-+}
-+
- static struct device_driver vesafb_driver = {
- 	.name	= "vesafb",
- 	.bus	= &platform_bus_type,
-@@ -424,7 +443,14 @@
- 	}
- 	return ret;
- }
-+
-+static void __exit vesafb_exit(void)
-+{
-+	platform_device_unregister(&vesafb_device);
-+	driver_unregister(&vesafb_driver);
-+}
- module_init(vesafb_init);
-+module_exit(vesafb_exit);
- 
- /*
-  * Overrides for Emacs so that we follow Linus's tabbing style.

Copied: trunk/kernel/source/kernel-source-2.6.11-2.6.11/debian/patches/modular-vesafb-3.patch (from rev 2762, trunk/kernel/source/kernel-source-2.6.11-2.6.11/debian/patches/modular-vesafb-3.dpatch)

Deleted: trunk/kernel/source/kernel-source-2.6.11-2.6.11/debian/patches/modular-vesafb.dpatch
===================================================================
--- trunk/kernel/source/kernel-source-2.6.11-2.6.11/debian/patches/modular-vesafb.dpatch	2005-03-21 09:35:04 UTC (rev 2762)
+++ trunk/kernel/source/kernel-source-2.6.11-2.6.11/debian/patches/modular-vesafb.dpatch	2005-03-21 09:38:36 UTC (rev 2763)
@@ -1,210 +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: modularised VESA FB
-## DP: Patch author: initial author unknown, fixed up by Andres Salomon
-## DP: Upstream status: not submitted
-
-. $(dirname $0)/DPATCH
-
- at DPATCH@
-
-* modified files
-
---- orig/drivers/video/Kconfig
-+++ mod/drivers/video/Kconfig
-@@ -329,7 +329,7 @@
- 	  cards. Say Y if you have one of those.
- 
- config FB_VESA
--	bool "VESA VGA graphics support"
-+	tristate "VESA VGA graphics support"
- 	depends on FB && (X86 || X86_64)
- 	help
- 	  This is the frame buffer device driver for generic VESA 2.0
-
-
---- orig/drivers/video/vesafb.c
-+++ mod/drivers/video/vesafb.c
-@@ -28,6 +28,12 @@
- #define dac_reg	(0x3c8)
- #define dac_val	(0x3c9)
- 
-+struct vesafb_info
-+{
-+	u32 pseudo_palette[256];
-+	int mtrr_hdl;
-+};
-+
- /* --------------------------------------------------------------------- */
- 
- static struct fb_var_screeninfo vesafb_defined __initdata = {
-@@ -47,17 +53,34 @@
- 	.accel	= FB_ACCEL_NONE,
- };
- 
--static int             inverse   = 0;
--static int             mtrr      = 1;
-+static int             mtrr __initdata = 1;
- static int	       vram_remap __initdata = 0; /* Set amount of memory to be used */
- static int	       vram_total __initdata = 0; /* Set total amount of memory */
- static int             pmi_setpal = 0;	/* pmi for palette changes ??? */
-+static int             redraw __initdata = 0;
- static int             ypan       = 0;  /* 0..nothing, 1..ypan, 2..ywrap */
-+static int             ywrap __initdata = 0;
- static unsigned short  *pmi_base  = NULL;
- static void            (*pmi_start)(void);
- static void            (*pmi_pal)(void);
- static int             depth;
- 
-+module_param(redraw, bool, 0);
-+module_param(ypan, bool, 0);
-+module_param(ywrap, bool, 0);
-+module_param_named(vgapal, pmi_setpal, invbool, 0);
-+MODULE_PARM_DESC(vgapal, "Use VGA for setting palette (default)");
-+module_param_named(pmipal, pmi_setpal, bool, 0);
-+MODULE_PARM_DESC(pmipal, "Use PMI for setting palette");
-+module_param(mtrr, bool, 0);
-+MODULE_PARM_DESC(mtrr, "Enable MTRR support (default)");
-+module_param_named(nomtrr, mtrr, invbool, 0);
-+MODULE_PARM_DESC(nomtrr, "Disable MTRR support");
-+module_param(vram_remap, int, 0);
-+MODULE_PARM_DESC(vram_remap, "Set total amount of memory to be used");
-+module_param(vram_total, int, 0);
-+MODULE_PARM_DESC(vram_total, "Total amount of memory");
-+
- /* --------------------------------------------------------------------- */
- 
- static int vesafb_pan_display(struct fb_var_screeninfo *var,
-@@ -185,6 +208,7 @@
- 	.fb_cursor	= soft_cursor,
- };
- 
-+#ifndef MODULE
- int __init vesafb_setup(char *options)
- {
- 	char *this_opt;
-@@ -195,9 +219,7 @@
- 	while ((this_opt = strsep(&options, ",")) != NULL) {
- 		if (!*this_opt) continue;
- 		
--		if (! strcmp(this_opt, "inverse"))
--			inverse=1;
--		else if (! strcmp(this_opt, "redraw"))
-+		if (! strcmp(this_opt, "redraw"))
- 			ypan=0;
- 		else if (! strcmp(this_opt, "ypan"))
- 			ypan=1;
-@@ -218,11 +240,13 @@
- 	}
- 	return 0;
- }
-+#endif
- 
- static int __init vesafb_probe(struct device *device)
- {
- 	struct platform_device *dev = to_platform_device(device);
- 	struct fb_info *info;
-+	struct vesafb_info *vfb_info;
- 	int i, err;
- 	unsigned int size_vmode;
- 	unsigned int size_remap;
-@@ -280,13 +304,14 @@
- 		   spaces our resource handlers simply don't know about */
- 	}
- 
--	info = framebuffer_alloc(sizeof(u32) * 256, &dev->dev);
-+	info = framebuffer_alloc(sizeof(struct vesafb_info), &dev->dev);
- 	if (!info) {
- 		release_mem_region(vesafb_fix.smem_start, vesafb_fix.smem_len);
- 		return -ENOMEM;
- 	}
--	info->pseudo_palette = info->par;
--	info->par = NULL;
-+	vfb_info = (struct vesafb_info *) info->par;
-+	vfb_info->mtrr_hdl = -1;
-+	info->pseudo_palette = vfb_info->pseudo_palette;
- 
-         info->screen_base = ioremap(vesafb_fix.smem_start, vesafb_fix.smem_len);
- 	if (!info->screen_base) {
-@@ -395,7 +420,7 @@
-                 	temp_size &= (temp_size - 1);
-                         
-                 /* Try and find a power of two to add */
--		while (temp_size && mtrr_add(vesafb_fix.smem_start, temp_size, MTRR_TYPE_WRCOMB, 1)==-EINVAL) {
-+		while (temp_size && (vfb_info->mtrr_hdl = mtrr_add(vesafb_fix.smem_start, temp_size, MTRR_TYPE_WRCOMB, 1)) == -EINVAL) {
- 			temp_size >>= 1;
- 		}
- 	}
-@@ -417,6 +442,7 @@
- 	}
- 	printk(KERN_INFO "fb%d: %s frame buffer device\n",
- 	       info->node, info->fix.id);
-+	dev_set_drvdata(device, info);
- 	return 0;
- err:
- 	framebuffer_release(info);
-@@ -424,10 +450,24 @@
- 	return err;
- }
- 
-+static void __exit vesafb_remove(struct device *device)
-+{
-+	struct fb_info *info = dev_get_drvdata(device);
-+	struct vesafb_info *vfb_info = (struct vesafb_info *) info->par;
-+
-+	unregister_framebuffer(info);
-+	if (vfb_info->mtrr_hdl >= 0)
-+		mtrr_del(vfb_info->mtrr_hdl, 0, 0);
-+	iounmap(info->screen_base);
-+	framebuffer_release(info);
-+	release_mem_region(vesafb_fix.smem_start, vesafb_fix.smem_len);
-+}
-+
- static struct device_driver vesafb_driver = {
- 	.name	= "vesafb",
- 	.bus	= &platform_bus_type,
- 	.probe	= vesafb_probe,
-+	.remove = vesafb_remove,
- };
- 
- static struct platform_device vesafb_device = {
-@@ -437,11 +477,18 @@
- int __init vesafb_init(void)
- {
- 	int ret;
-+#ifndef MODULE
- 	char *option = NULL;
- 
- 	/* ignore error return of fb_get_options */
- 	fb_get_options("vesafb", &option);
- 	vesafb_setup(option);
-+#else
-+	if (redraw)
-+		ypan = 0;
-+	if (ywrap)
-+		ypan = 2;
-+#endif
- 	ret = driver_register(&vesafb_driver);
- 
- 	if (!ret) {
-@@ -451,7 +498,15 @@
- 	}
- 	return ret;
- }
-+
-+static void __exit vesafb_exit(void)
-+{
-+	platform_device_unregister(&vesafb_device);
-+	driver_unregister(&vesafb_driver);
-+}
-+
- module_init(vesafb_init);
-+module_exit(vesafb_exit);
- 
- /*
-  * Overrides for Emacs so that we follow Linus's tabbing style.
-
-
-

Copied: trunk/kernel/source/kernel-source-2.6.11-2.6.11/debian/patches/modular-vesafb.patch (from rev 2762, trunk/kernel/source/kernel-source-2.6.11-2.6.11/debian/patches/modular-vesafb.dpatch)

Deleted: trunk/kernel/source/kernel-source-2.6.11-2.6.11/debian/patches/patch-2.6.11.5
===================================================================
--- trunk/kernel/source/kernel-source-2.6.11-2.6.11/debian/patches/patch-2.6.11.5	2005-03-21 09:35:04 UTC (rev 2762)
+++ trunk/kernel/source/kernel-source-2.6.11-2.6.11/debian/patches/patch-2.6.11.5	2005-03-21 09:38:36 UTC (rev 2763)
@@ -1,722 +0,0 @@
-diff -Nru a/arch/ppc/oprofile/op_model_fsl_booke.c b/arch/ppc/oprofile/op_model_fsl_booke.c
---- a/arch/ppc/oprofile/op_model_fsl_booke.c	2005-03-18 22:35:10 -08:00
-+++ b/arch/ppc/oprofile/op_model_fsl_booke.c	2005-03-18 22:35:10 -08:00
-@@ -150,7 +150,6 @@
- 	int is_kernel;
- 	int val;
- 	int i;
--	unsigned int cpu = smp_processor_id();
- 
- 	/* set the PMM bit (see comment below) */
- 	mtmsr(mfmsr() | MSR_PMM);
-@@ -162,7 +161,7 @@
- 		val = ctr_read(i);
- 		if (val < 0) {
- 			if (oprofile_running && ctr[i].enabled) {
--				oprofile_add_sample(pc, is_kernel, i, cpu);
-+				oprofile_add_pc(pc, is_kernel, i);
- 				ctr_write(i, reset_value[i]);
- 			} else {
- 				ctr_write(i, 0);
-diff -Nru a/arch/ppc/platforms/4xx/ebony.h b/arch/ppc/platforms/4xx/ebony.h
---- a/arch/ppc/platforms/4xx/ebony.h	2005-03-18 22:35:10 -08:00
-+++ b/arch/ppc/platforms/4xx/ebony.h	2005-03-18 22:35:10 -08:00
-@@ -61,8 +61,8 @@
-  */
- 
- /* OpenBIOS defined UART mappings, used before early_serial_setup */
--#define UART0_IO_BASE	(u8 *) 0xE0000200
--#define UART1_IO_BASE	(u8 *) 0xE0000300
-+#define UART0_IO_BASE	0xE0000200
-+#define UART1_IO_BASE	0xE0000300
- 
- /* external Epson SG-615P */
- #define BASE_BAUD	691200
-diff -Nru a/arch/ppc/platforms/4xx/luan.h b/arch/ppc/platforms/4xx/luan.h
---- a/arch/ppc/platforms/4xx/luan.h	2005-03-18 22:35:10 -08:00
-+++ b/arch/ppc/platforms/4xx/luan.h	2005-03-18 22:35:10 -08:00
-@@ -47,9 +47,9 @@
- #define RS_TABLE_SIZE	3
- 
- /* PIBS defined UART mappings, used before early_serial_setup */
--#define UART0_IO_BASE	(u8 *) 0xa0000200
--#define UART1_IO_BASE	(u8 *) 0xa0000300
--#define UART2_IO_BASE	(u8 *) 0xa0000600
-+#define UART0_IO_BASE	0xa0000200
-+#define UART1_IO_BASE	0xa0000300
-+#define UART2_IO_BASE	0xa0000600
- 
- #define BASE_BAUD	11059200
- #define STD_UART_OP(num)					\
-diff -Nru a/arch/ppc/platforms/4xx/ocotea.h b/arch/ppc/platforms/4xx/ocotea.h
---- a/arch/ppc/platforms/4xx/ocotea.h	2005-03-18 22:35:10 -08:00
-+++ b/arch/ppc/platforms/4xx/ocotea.h	2005-03-18 22:35:10 -08:00
-@@ -56,8 +56,8 @@
- #define RS_TABLE_SIZE	2
- 
- /* OpenBIOS defined UART mappings, used before early_serial_setup */
--#define UART0_IO_BASE	(u8 *) 0xE0000200
--#define UART1_IO_BASE	(u8 *) 0xE0000300
-+#define UART0_IO_BASE	0xE0000200
-+#define UART1_IO_BASE	0xE0000300
- 
- #define BASE_BAUD	11059200/16
- #define STD_UART_OP(num)					\
-diff -Nru a/drivers/char/drm/drm_ioctl.c b/drivers/char/drm/drm_ioctl.c
---- a/drivers/char/drm/drm_ioctl.c	2005-03-18 22:35:10 -08:00
-+++ b/drivers/char/drm/drm_ioctl.c	2005-03-18 22:35:10 -08:00
-@@ -326,6 +326,8 @@
- 
- 	DRM_COPY_FROM_USER_IOCTL(sv, argp, sizeof(sv));
- 
-+	memset(&version, 0, sizeof(version));
-+
- 	dev->driver->version(&version);
- 	retv.drm_di_major = DRM_IF_MAJOR;
- 	retv.drm_di_minor = DRM_IF_MINOR;
-diff -Nru a/drivers/input/serio/i8042-x86ia64io.h b/drivers/input/serio/i8042-x86ia64io.h
---- a/drivers/input/serio/i8042-x86ia64io.h	2005-03-18 22:35:10 -08:00
-+++ b/drivers/input/serio/i8042-x86ia64io.h	2005-03-18 22:35:10 -08:00
-@@ -88,7 +88,7 @@
- };
- #endif
- 
--#ifdef CONFIG_ACPI
-+#if defined(__ia64__) && defined(CONFIG_ACPI)
- #include <linux/acpi.h>
- #include <acpi/acpi_bus.h>
- 
-@@ -281,7 +281,7 @@
- 	i8042_kbd_irq = I8042_MAP_IRQ(1);
- 	i8042_aux_irq = I8042_MAP_IRQ(12);
- 
--#ifdef CONFIG_ACPI
-+#if defined(__ia64__) && defined(CONFIG_ACPI)
- 	if (i8042_acpi_init())
- 		return -1;
- #endif
-@@ -300,7 +300,7 @@
- 
- static inline void i8042_platform_exit(void)
- {
--#ifdef CONFIG_ACPI
-+#if defined(__ia64__) && defined(CONFIG_ACPI)
- 	i8042_acpi_exit();
- #endif
- }
-diff -Nru a/drivers/md/raid6altivec.uc b/drivers/md/raid6altivec.uc
---- a/drivers/md/raid6altivec.uc	2005-03-18 22:35:10 -08:00
-+++ b/drivers/md/raid6altivec.uc	2005-03-18 22:35:10 -08:00
-@@ -108,7 +108,11 @@
- int raid6_have_altivec(void)
- {
- 	/* This assumes either all CPUs have Altivec or none does */
-+#ifdef CONFIG_PPC64
- 	return cur_cpu_spec->cpu_features & CPU_FTR_ALTIVEC;
-+#else
-+	return cur_cpu_spec[0]->cpu_features & CPU_FTR_ALTIVEC;
-+#endif
- }
- #endif
- 
-diff -Nru a/drivers/media/video/adv7170.c b/drivers/media/video/adv7170.c
---- a/drivers/media/video/adv7170.c	2005-03-18 22:35:10 -08:00
-+++ b/drivers/media/video/adv7170.c	2005-03-18 22:35:10 -08:00
-@@ -130,7 +130,7 @@
- 		u8 block_data[32];
- 
- 		msg.addr = client->addr;
--		msg.flags = client->flags;
-+		msg.flags = 0;
- 		while (len >= 2) {
- 			msg.buf = (char *) block_data;
- 			msg.len = 0;
-diff -Nru a/drivers/media/video/adv7175.c b/drivers/media/video/adv7175.c
---- a/drivers/media/video/adv7175.c	2005-03-18 22:35:10 -08:00
-+++ b/drivers/media/video/adv7175.c	2005-03-18 22:35:10 -08:00
-@@ -126,7 +126,7 @@
- 		u8 block_data[32];
- 
- 		msg.addr = client->addr;
--		msg.flags = client->flags;
-+		msg.flags = 0;
- 		while (len >= 2) {
- 			msg.buf = (char *) block_data;
- 			msg.len = 0;
-diff -Nru a/drivers/media/video/bt819.c b/drivers/media/video/bt819.c
---- a/drivers/media/video/bt819.c	2005-03-18 22:35:10 -08:00
-+++ b/drivers/media/video/bt819.c	2005-03-18 22:35:10 -08:00
-@@ -146,7 +146,7 @@
- 		u8 block_data[32];
- 
- 		msg.addr = client->addr;
--		msg.flags = client->flags;
-+		msg.flags = 0;
- 		while (len >= 2) {
- 			msg.buf = (char *) block_data;
- 			msg.len = 0;
-diff -Nru a/drivers/media/video/saa7110.c b/drivers/media/video/saa7110.c
---- a/drivers/media/video/saa7110.c	2005-03-18 22:35:10 -08:00
-+++ b/drivers/media/video/saa7110.c	2005-03-18 22:35:10 -08:00
-@@ -60,8 +60,10 @@
- 
- #define	I2C_SAA7110		0x9C	/* or 0x9E */
- 
-+#define SAA7110_NR_REG		0x35
-+
- struct saa7110 {
--	unsigned char reg[54];
-+	u8 reg[SAA7110_NR_REG];
- 
- 	int norm;
- 	int input;
-@@ -95,31 +97,28 @@
- 		     unsigned int       len)
- {
- 	int ret = -1;
--	u8 reg = *data++;
-+	u8 reg = *data;		/* first register to write to */
- 
--	len--;
-+	/* Sanity check */
-+	if (reg + (len - 1) > SAA7110_NR_REG)
-+		return ret;
- 
- 	/* the saa7110 has an autoincrement function, use it if
- 	 * the adapter understands raw I2C */
- 	if (i2c_check_functionality(client->adapter, I2C_FUNC_I2C)) {
- 		struct saa7110 *decoder = i2c_get_clientdata(client);
- 		struct i2c_msg msg;
--		u8 block_data[54];
- 
--		msg.len = 0;
--		msg.buf = (char *) block_data;
-+		msg.len = len;
-+		msg.buf = (char *) data;
- 		msg.addr = client->addr;
--		msg.flags = client->flags;
--		while (len >= 1) {
--			msg.len = 0;
--			block_data[msg.len++] = reg;
--			while (len-- >= 1 && msg.len < 54)
--				block_data[msg.len++] =
--				    decoder->reg[reg++] = *data++;
--			ret = i2c_transfer(client->adapter, &msg, 1);
--		}
-+		msg.flags = 0;
-+		ret = i2c_transfer(client->adapter, &msg, 1);
-+
-+		/* Cache the written data */
-+		memcpy(decoder->reg + reg, data + 1, len - 1);
- 	} else {
--		while (len-- >= 1) {
-+		for (++data, --len; len; len--) {
- 			if ((ret = saa7110_write(client, reg++,
- 						 *data++)) < 0)
- 				break;
-@@ -192,7 +191,7 @@
- 	return 0;
- }
- 
--static const unsigned char initseq[] = {
-+static const unsigned char initseq[1 + SAA7110_NR_REG] = {
- 	0, 0x4C, 0x3C, 0x0D, 0xEF, 0xBD, 0xF2, 0x03, 0x00,
- 	/* 0x08 */ 0xF8, 0xF8, 0x60, 0x60, 0x00, 0x86, 0x18, 0x90,
- 	/* 0x10 */ 0x00, 0x59, 0x40, 0x46, 0x42, 0x1A, 0xFF, 0xDA,
-diff -Nru a/drivers/media/video/saa7114.c b/drivers/media/video/saa7114.c
---- a/drivers/media/video/saa7114.c	2005-03-18 22:35:10 -08:00
-+++ b/drivers/media/video/saa7114.c	2005-03-18 22:35:10 -08:00
-@@ -163,7 +163,7 @@
- 		u8 block_data[32];
- 
- 		msg.addr = client->addr;
--		msg.flags = client->flags;
-+		msg.flags = 0;
- 		while (len >= 2) {
- 			msg.buf = (char *) block_data;
- 			msg.len = 0;
-diff -Nru a/drivers/media/video/saa7185.c b/drivers/media/video/saa7185.c
---- a/drivers/media/video/saa7185.c	2005-03-18 22:35:10 -08:00
-+++ b/drivers/media/video/saa7185.c	2005-03-18 22:35:10 -08:00
-@@ -118,7 +118,7 @@
- 		u8 block_data[32];
- 
- 		msg.addr = client->addr;
--		msg.flags = client->flags;
-+		msg.flags = 0;
- 		while (len >= 2) {
- 			msg.buf = (char *) block_data;
- 			msg.len = 0;
-diff -Nru a/drivers/net/amd8111e.c b/drivers/net/amd8111e.c
---- a/drivers/net/amd8111e.c	2005-03-18 22:35:10 -08:00
-+++ b/drivers/net/amd8111e.c	2005-03-18 22:35:10 -08:00
-@@ -1381,6 +1381,8 @@
- 
- 	if(amd8111e_restart(dev)){
- 		spin_unlock_irq(&lp->lock);
-+		if (dev->irq)
-+			free_irq(dev->irq, dev);
- 		return -ENOMEM;
- 	}
- 	/* Start ipg timer */
-diff -Nru a/drivers/net/ppp_async.c b/drivers/net/ppp_async.c
---- a/drivers/net/ppp_async.c	2005-03-18 22:35:10 -08:00
-+++ b/drivers/net/ppp_async.c	2005-03-18 22:35:10 -08:00
-@@ -1000,7 +1000,7 @@
- 	data += 4;
- 	dlen -= 4;
- 	/* data[0] is code, data[1] is length */
--	while (dlen >= 2 && dlen >= data[1]) {
-+	while (dlen >= 2 && dlen >= data[1] && data[1] >= 2) {
- 		switch (data[0]) {
- 		case LCP_MRU:
- 			val = (data[2] << 8) + data[3];
-diff -Nru a/drivers/net/r8169.c b/drivers/net/r8169.c
---- a/drivers/net/r8169.c	2005-03-18 22:35:10 -08:00
-+++ b/drivers/net/r8169.c	2005-03-18 22:35:10 -08:00
-@@ -1683,16 +1683,19 @@
- 	rtl8169_make_unusable_by_asic(desc);
- }
- 
--static inline void rtl8169_return_to_asic(struct RxDesc *desc, int rx_buf_sz)
-+static inline void rtl8169_mark_to_asic(struct RxDesc *desc, u32 rx_buf_sz)
- {
--	desc->opts1 |= cpu_to_le32(DescOwn + rx_buf_sz);
-+	u32 eor = le32_to_cpu(desc->opts1) & RingEnd;
-+
-+	desc->opts1 = cpu_to_le32(DescOwn | eor | rx_buf_sz);
- }
- 
--static inline void rtl8169_give_to_asic(struct RxDesc *desc, dma_addr_t mapping,
--					int rx_buf_sz)
-+static inline void rtl8169_map_to_asic(struct RxDesc *desc, dma_addr_t mapping,
-+				       u32 rx_buf_sz)
- {
- 	desc->addr = cpu_to_le64(mapping);
--	desc->opts1 |= cpu_to_le32(DescOwn + rx_buf_sz);
-+	wmb();
-+	rtl8169_mark_to_asic(desc, rx_buf_sz);
- }
- 
- static int rtl8169_alloc_rx_skb(struct pci_dev *pdev, struct sk_buff **sk_buff,
-@@ -1712,7 +1715,7 @@
- 	mapping = pci_map_single(pdev, skb->tail, rx_buf_sz,
- 				 PCI_DMA_FROMDEVICE);
- 
--	rtl8169_give_to_asic(desc, mapping, rx_buf_sz);
-+	rtl8169_map_to_asic(desc, mapping, rx_buf_sz);
- 
- out:
- 	return ret;
-@@ -2150,7 +2153,7 @@
- 			skb_reserve(skb, NET_IP_ALIGN);
- 			eth_copy_and_sum(skb, sk_buff[0]->tail, pkt_size, 0);
- 			*sk_buff = skb;
--			rtl8169_return_to_asic(desc, rx_buf_sz);
-+			rtl8169_mark_to_asic(desc, rx_buf_sz);
- 			ret = 0;
- 		}
- 	}
-diff -Nru a/drivers/net/sis900.c b/drivers/net/sis900.c
---- a/drivers/net/sis900.c	2005-03-18 22:35:10 -08:00
-+++ b/drivers/net/sis900.c	2005-03-18 22:35:10 -08:00
-@@ -236,7 +236,7 @@
- 	signature = (u16) read_eeprom(ioaddr, EEPROMSignature);    
- 	if (signature == 0xffff || signature == 0x0000) {
- 		printk (KERN_INFO "%s: Error EERPOM read %x\n", 
--			net_dev->name, signature);
-+			pci_name(pci_dev), signature);
- 		return 0;
- 	}
- 
-@@ -268,7 +268,7 @@
- 	if (!isa_bridge)
- 		isa_bridge = pci_get_device(PCI_VENDOR_ID_SI, 0x0018, isa_bridge);
- 	if (!isa_bridge) {
--		printk("%s: Can not find ISA bridge\n", net_dev->name);
-+		printk("%s: Can not find ISA bridge\n", pci_name(pci_dev));
- 		return 0;
- 	}
- 	pci_read_config_byte(isa_bridge, 0x48, &reg);
-@@ -456,10 +456,6 @@
- 	net_dev->tx_timeout = sis900_tx_timeout;
- 	net_dev->watchdog_timeo = TX_TIMEOUT;
- 	net_dev->ethtool_ops = &sis900_ethtool_ops;
--	
--	ret = register_netdev(net_dev);
--	if (ret)
--		goto err_unmap_rx;
- 		
- 	/* Get Mac address according to the chip revision */
- 	pci_read_config_byte(pci_dev, PCI_CLASS_REVISION, &revision);
-@@ -476,7 +472,7 @@
- 
- 	if (ret == 0) {
- 		ret = -ENODEV;
--		goto err_out_unregister;
-+		goto err_unmap_rx;
- 	}
- 	
- 	/* 630ET : set the mii access mode as software-mode */
-@@ -486,7 +482,7 @@
- 	/* probe for mii transceiver */
- 	if (sis900_mii_probe(net_dev) == 0) {
- 		ret = -ENODEV;
--		goto err_out_unregister;
-+		goto err_unmap_rx;
- 	}
- 
- 	/* save our host bridge revision */
-@@ -496,6 +492,10 @@
- 		pci_dev_put(dev);
- 	}
- 
-+	ret = register_netdev(net_dev);
-+	if (ret)
-+		goto err_unmap_rx;
-+
- 	/* print some information about our NIC */
- 	printk(KERN_INFO "%s: %s at %#lx, IRQ %d, ", net_dev->name,
- 	       card_name, ioaddr, net_dev->irq);
-@@ -505,8 +505,6 @@
- 
- 	return 0;
- 
-- err_out_unregister:
-- 	unregister_netdev(net_dev);
-  err_unmap_rx:
- 	pci_free_consistent(pci_dev, RX_TOTAL_SIZE, sis_priv->rx_ring,
- 		sis_priv->rx_ring_dma);
-@@ -533,6 +531,7 @@
- static int __init sis900_mii_probe(struct net_device * net_dev)
- {
- 	struct sis900_private * sis_priv = net_dev->priv;
-+	const char *dev_name = pci_name(sis_priv->pci_dev);
- 	u16 poll_bit = MII_STAT_LINK, status = 0;
- 	unsigned long timeout = jiffies + 5 * HZ;
- 	int phy_addr;
-@@ -582,21 +581,20 @@
- 					mii_phy->phy_types =
- 					    (mii_status & (MII_STAT_CAN_TX_FDX | MII_STAT_CAN_TX)) ? LAN : HOME;
- 				printk(KERN_INFO "%s: %s transceiver found at address %d.\n",
--				       net_dev->name, mii_chip_table[i].name,
-+				       dev_name, mii_chip_table[i].name,
- 				       phy_addr);
- 				break;
- 			}
- 			
- 		if( !mii_chip_table[i].phy_id1 ) {
- 			printk(KERN_INFO "%s: Unknown PHY transceiver found at address %d.\n",
--			       net_dev->name, phy_addr);
-+			       dev_name, phy_addr);
- 			mii_phy->phy_types = UNKNOWN;
- 		}
- 	}
- 	
- 	if (sis_priv->mii == NULL) {
--		printk(KERN_INFO "%s: No MII transceivers found!\n",
--			net_dev->name);
-+		printk(KERN_INFO "%s: No MII transceivers found!\n", dev_name);
- 		return 0;
- 	}
- 
-@@ -621,7 +619,7 @@
- 			poll_bit ^= (mdio_read(net_dev, sis_priv->cur_phy, MII_STATUS) & poll_bit);
- 			if (time_after_eq(jiffies, timeout)) {
- 				printk(KERN_WARNING "%s: reset phy and link down now\n",
--					net_dev->name);
-+				       dev_name);
- 				return -ETIME;
- 			}
- 		}
-@@ -691,7 +689,7 @@
- 		sis_priv->mii = default_phy;
- 		sis_priv->cur_phy = default_phy->phy_addr;
- 		printk(KERN_INFO "%s: Using transceiver found at address %d as default\n",
--					net_dev->name,sis_priv->cur_phy);
-+		       pci_name(sis_priv->pci_dev), sis_priv->cur_phy);
- 	}
- 	
- 	status = mdio_read(net_dev, sis_priv->cur_phy, MII_CONTROL);
-diff -Nru a/drivers/net/tun.c b/drivers/net/tun.c
---- a/drivers/net/tun.c	2005-03-18 22:35:10 -08:00
-+++ b/drivers/net/tun.c	2005-03-18 22:35:10 -08:00
-@@ -229,7 +229,7 @@
- 	size_t len = count;
- 
- 	if (!(tun->flags & TUN_NO_PI)) {
--		if ((len -= sizeof(pi)) > len)
-+		if ((len -= sizeof(pi)) > count)
- 			return -EINVAL;
- 
- 		if(memcpy_fromiovec((void *)&pi, iv, sizeof(pi)))
-diff -Nru a/drivers/net/via-rhine.c b/drivers/net/via-rhine.c
---- a/drivers/net/via-rhine.c	2005-03-18 22:35:10 -08:00
-+++ b/drivers/net/via-rhine.c	2005-03-18 22:35:10 -08:00
-@@ -1197,8 +1197,10 @@
- 		       dev->name, rp->pdev->irq);
- 
- 	rc = alloc_ring(dev);
--	if (rc)
-+	if (rc) {
-+		free_irq(rp->pdev->irq, dev);
- 		return rc;
-+	}
- 	alloc_rbufs(dev);
- 	alloc_tbufs(dev);
- 	rhine_chip_reset(dev);
-@@ -1898,6 +1900,9 @@
- 	struct net_device *dev = pci_get_drvdata(pdev);
- 	struct rhine_private *rp = netdev_priv(dev);
- 	void __iomem *ioaddr = rp->base;
-+
-+	if (!(rp->quirks & rqWOL))
-+		return; /* Nothing to do for non-WOL adapters */
- 
- 	rhine_power_init(dev);
- 
-diff -Nru a/drivers/net/wan/hd6457x.c b/drivers/net/wan/hd6457x.c
---- a/drivers/net/wan/hd6457x.c	2005-03-18 22:35:10 -08:00
-+++ b/drivers/net/wan/hd6457x.c	2005-03-18 22:35:10 -08:00
-@@ -315,7 +315,7 @@
- #endif
- 	stats->rx_packets++;
- 	stats->rx_bytes += skb->len;
--	skb->dev->last_rx = jiffies;
-+	dev->last_rx = jiffies;
- 	skb->protocol = hdlc_type_trans(skb, dev);
- 	netif_rx(skb);
- }
-diff -Nru a/drivers/pci/hotplug/pciehp_ctrl.c b/drivers/pci/hotplug/pciehp_ctrl.c
---- a/drivers/pci/hotplug/pciehp_ctrl.c	2005-03-18 22:35:10 -08:00
-+++ b/drivers/pci/hotplug/pciehp_ctrl.c	2005-03-18 22:35:10 -08:00
-@@ -1354,10 +1354,11 @@
- 				dbg("PCI Bridge Hot-Remove s:b:d:f(%02x:%02x:%02x:%02x)\n", 
- 					ctrl->seg, func->bus, func->device, func->function);
- 				bridge_slot_remove(func);
--			} else
-+			} else {
- 				dbg("PCI Function Hot-Remove s:b:d:f(%02x:%02x:%02x:%02x)\n", 
- 					ctrl->seg, func->bus, func->device, func->function);
- 				slot_remove(func);
-+			}
- 
- 			func = pciehp_slot_find(ctrl->slot_bus, device, 0);
- 		}
-diff -Nru a/fs/cramfs/inode.c b/fs/cramfs/inode.c
---- a/fs/cramfs/inode.c	2005-03-18 22:35:10 -08:00
-+++ b/fs/cramfs/inode.c	2005-03-18 22:35:10 -08:00
-@@ -70,6 +70,7 @@
- 			inode->i_data.a_ops = &cramfs_aops;
- 		} else {
- 			inode->i_size = 0;
-+			inode->i_blocks = 0;
- 			init_special_inode(inode, inode->i_mode,
- 				old_decode_dev(cramfs_inode->size));
- 		}
-diff -Nru a/fs/eventpoll.c b/fs/eventpoll.c
---- a/fs/eventpoll.c	2005-03-18 22:35:10 -08:00
-+++ b/fs/eventpoll.c	2005-03-18 22:35:10 -08:00
-@@ -619,6 +619,7 @@
- 	return error;
- }
- 
-+#define MAX_EVENTS (INT_MAX / sizeof(struct epoll_event))
- 
- /*
-  * Implement the event wait interface for the eventpoll file. It is the kernel
-@@ -635,7 +636,7 @@
- 		     current, epfd, events, maxevents, timeout));
- 
- 	/* The maximum number of event must be greater than zero */
--	if (maxevents <= 0)
-+	if (maxevents <= 0 || maxevents > MAX_EVENTS)
- 		return -EINVAL;
- 
- 	/* Verify that the area passed by the user is writeable */
-diff -Nru a/fs/exec.c b/fs/exec.c
---- a/fs/exec.c	2005-03-18 22:35:10 -08:00
-+++ b/fs/exec.c	2005-03-18 22:35:10 -08:00
-@@ -814,7 +814,7 @@
- {
- 	/* buf must be at least sizeof(tsk->comm) in size */
- 	task_lock(tsk);
--	memcpy(buf, tsk->comm, sizeof(tsk->comm));
-+	strncpy(buf, tsk->comm, sizeof(tsk->comm));
- 	task_unlock(tsk);
- }
- 
-diff -Nru a/kernel/signal.c b/kernel/signal.c
---- a/kernel/signal.c	2005-03-18 22:35:10 -08:00
-+++ b/kernel/signal.c	2005-03-18 22:35:10 -08:00
-@@ -1728,6 +1728,7 @@
- 			 * with another processor delivering a stop signal,
- 			 * then the SIGCONT that wakes us up should clear it.
- 			 */
-+			read_unlock(&tasklist_lock);
- 			return 0;
- 		}
- 
-diff -Nru a/net/ipv4/fib_hash.c b/net/ipv4/fib_hash.c
---- a/net/ipv4/fib_hash.c	2005-03-18 22:35:10 -08:00
-+++ b/net/ipv4/fib_hash.c	2005-03-18 22:35:10 -08:00
-@@ -919,13 +919,23 @@
- 	return fa;
- }
- 
-+static struct fib_alias *fib_get_idx(struct seq_file *seq, loff_t pos)
-+{
-+	struct fib_alias *fa = fib_get_first(seq);
-+
-+	if (fa)
-+		while (pos && (fa = fib_get_next(seq)))
-+			--pos;
-+	return pos ? NULL : fa;
-+}
-+
- static void *fib_seq_start(struct seq_file *seq, loff_t *pos)
- {
- 	void *v = NULL;
- 
- 	read_lock(&fib_hash_lock);
- 	if (ip_fib_main_table)
--		v = *pos ? fib_get_next(seq) : SEQ_START_TOKEN;
-+		v = *pos ? fib_get_idx(seq, *pos - 1) : SEQ_START_TOKEN;
- 	return v;
- }
- 
-diff -Nru a/net/ipv4/tcp_timer.c b/net/ipv4/tcp_timer.c
---- a/net/ipv4/tcp_timer.c	2005-03-18 22:35:10 -08:00
-+++ b/net/ipv4/tcp_timer.c	2005-03-18 22:35:10 -08:00
-@@ -38,6 +38,7 @@
- 
- #ifdef TCP_DEBUG
- const char tcp_timer_bug_msg[] = KERN_DEBUG "tcpbug: unknown timer value\n";
-+EXPORT_SYMBOL(tcp_timer_bug_msg);
- #endif
- 
- /*
-diff -Nru a/net/netrom/nr_in.c b/net/netrom/nr_in.c
---- a/net/netrom/nr_in.c	2005-03-18 22:35:10 -08:00
-+++ b/net/netrom/nr_in.c	2005-03-18 22:35:10 -08:00
-@@ -74,7 +74,6 @@
- static int nr_state1_machine(struct sock *sk, struct sk_buff *skb,
- 	int frametype)
- {
--	bh_lock_sock(sk);
- 	switch (frametype) {
- 	case NR_CONNACK: {
- 		nr_cb *nr = nr_sk(sk);
-@@ -103,8 +102,6 @@
- 	default:
- 		break;
- 	}
--	bh_unlock_sock(sk);
--
- 	return 0;
- }
- 
-@@ -116,7 +113,6 @@
- static int nr_state2_machine(struct sock *sk, struct sk_buff *skb,
- 	int frametype)
- {
--	bh_lock_sock(sk);
- 	switch (frametype) {
- 	case NR_CONNACK | NR_CHOKE_FLAG:
- 		nr_disconnect(sk, ECONNRESET);
-@@ -132,8 +128,6 @@
- 	default:
- 		break;
- 	}
--	bh_unlock_sock(sk);
--
- 	return 0;
- }
- 
-@@ -154,7 +148,6 @@
- 	nr = skb->data[18];
- 	ns = skb->data[17];
- 
--	bh_lock_sock(sk);
- 	switch (frametype) {
- 	case NR_CONNREQ:
- 		nr_write_internal(sk, NR_CONNACK);
-@@ -265,8 +258,6 @@
- 	default:
- 		break;
- 	}
--	bh_unlock_sock(sk);
--
- 	return queued;
- }
- 
-diff -Nru a/net/xfrm/xfrm_state.c b/net/xfrm/xfrm_state.c
---- a/net/xfrm/xfrm_state.c	2005-03-18 22:35:10 -08:00
-+++ b/net/xfrm/xfrm_state.c	2005-03-18 22:35:10 -08:00
-@@ -609,7 +609,7 @@
- 
- 	for (i = 0; i < XFRM_DST_HSIZE; i++) {
- 		list_for_each_entry(x, xfrm_state_bydst+i, bydst) {
--			if (x->km.seq == seq) {
-+			if (x->km.seq == seq && x->km.state == XFRM_STATE_ACQ) {
- 				xfrm_state_hold(x);
- 				return x;
- 			}
-diff -Nru a/sound/pci/ac97/ac97_codec.c b/sound/pci/ac97/ac97_codec.c
---- a/sound/pci/ac97/ac97_codec.c	2005-03-18 22:35:10 -08:00
-+++ b/sound/pci/ac97/ac97_codec.c	2005-03-18 22:35:10 -08:00
-@@ -1185,7 +1185,7 @@
- /*
-  * create mute switch(es) for normal stereo controls
-  */
--static int snd_ac97_cmute_new(snd_card_t *card, char *name, int reg, ac97_t *ac97)
-+static int snd_ac97_cmute_new_stereo(snd_card_t *card, char *name, int reg, int check_stereo, ac97_t *ac97)
- {
- 	snd_kcontrol_t *kctl;
- 	int err;
-@@ -1196,7 +1196,7 @@
- 
- 	mute_mask = 0x8000;
- 	val = snd_ac97_read(ac97, reg);
--	if (ac97->flags & AC97_STEREO_MUTES) {
-+	if (check_stereo || (ac97->flags & AC97_STEREO_MUTES)) {
- 		/* check whether both mute bits work */
- 		val1 = val | 0x8080;
- 		snd_ac97_write(ac97, reg, val1);
-@@ -1254,7 +1254,7 @@
- /*
-  * create a mute-switch and a volume for normal stereo/mono controls
-  */
--static int snd_ac97_cmix_new(snd_card_t *card, const char *pfx, int reg, ac97_t *ac97)
-+static int snd_ac97_cmix_new_stereo(snd_card_t *card, const char *pfx, int reg, int check_stereo, ac97_t *ac97)
- {
- 	int err;
- 	char name[44];
-@@ -1265,7 +1265,7 @@
- 
- 	if (snd_ac97_try_bit(ac97, reg, 15)) {
- 		sprintf(name, "%s Switch", pfx);
--		if ((err = snd_ac97_cmute_new(card, name, reg, ac97)) < 0)
-+		if ((err = snd_ac97_cmute_new_stereo(card, name, reg, check_stereo, ac97)) < 0)
- 			return err;
- 	}
- 	check_volume_resolution(ac97, reg, &lo_max, &hi_max);
-@@ -1277,6 +1277,8 @@
- 	return 0;
- }
- 
-+#define snd_ac97_cmix_new(card, pfx, reg, ac97)	snd_ac97_cmix_new_stereo(card, pfx, reg, 0, ac97)
-+#define snd_ac97_cmute_new(card, name, reg, ac97)	snd_ac97_cmute_new_stereo(card, name, reg, 0, ac97)
- 
- static unsigned int snd_ac97_determine_spdif_rates(ac97_t *ac97);
- 
-@@ -1327,7 +1329,8 @@
- 
- 	/* build surround controls */
- 	if (snd_ac97_try_volume_mix(ac97, AC97_SURROUND_MASTER)) {
--		if ((err = snd_ac97_cmix_new(card, "Surround Playback", AC97_SURROUND_MASTER, ac97)) < 0)
-+		/* Surround Master (0x38) is with stereo mutes */
-+		if ((err = snd_ac97_cmix_new_stereo(card, "Surround Playback", AC97_SURROUND_MASTER, 1, ac97)) < 0)
- 			return err;
- 	}
- 

Copied: trunk/kernel/source/kernel-source-2.6.11-2.6.11/debian/patches/patch-2.6.11.5.dpatch (from rev 2759, trunk/kernel/source/kernel-source-2.6.11-2.6.11/debian/patches/patch-2.6.11.5)

Deleted: trunk/kernel/source/kernel-source-2.6.11-2.6.11/debian/patches/powerpc-calibrate-tau.dpatch
===================================================================
--- trunk/kernel/source/kernel-source-2.6.11-2.6.11/debian/patches/powerpc-calibrate-tau.dpatch	2005-03-21 09:35:04 UTC (rev 2762)
+++ trunk/kernel/source/kernel-source-2.6.11-2.6.11/debian/patches/powerpc-calibrate-tau.dpatch	2005-03-21 09:38:36 UTC (rev 2763)
@@ -1,79 +0,0 @@
-#! /bin/sh -e 
-##
-## All lines beginning with `## DP:' are a description of the patch.
-## DP: Description: Adds support TAU calibration on G3 processors
-## DP: Patch author: Nicolas DET <nd at bplan-gmbh.de>
-## DP: Upstream status: submitted
-
-. $(dirname $0)/DPATCH
-
- at DPATCH@
---- linux-2.6.11.orig/arch/ppc/Kconfig	2005-03-02 08:38:33.000000000 +0100
-+++ linux-2.6.11_nico/arch/ppc/Kconfig	2005-03-04 15:52:54.784745784 +0100
-@@ -182,6 +182,24 @@
- 
- 	  If in doubt, say N here.
- 
-+config TAU_CALIBRATED
-+        bool "The CPU sensor has been calibrated."
-+	depends on TAU
-+	help
-+	   Enable it you got the real temperature with an external sensor
-+	   and you know the offset between the one advertised by the CPU
-+	   and the real one
-+
-+config TAU_CALIBRATED_VALUE
-+	int "Offset of the themal sensor"
-+	depends on TAU_CALIBRATED
-+	default "0"
-+	help
-+	  This is the offset of the thermal sensor compare to the real value
-+	  For example, if you get 27°C in /proc/cpuinfo (uncalibrated) and
-+	  you know real one is 53°C, then you should set 26 as offset.
-+	  value = Real val - CPU val;
-+
- config MATH_EMULATION
- 	bool "Math emulation"
- 	depends on 4xx || 8xx || E500
---- linux-2.6.11.orig/arch/ppc/kernel/setup.c	2005-03-02 08:38:26.000000000 +0100
-+++ linux-2.6.11_nico/arch/ppc/kernel/setup.c	2005-03-04 15:55:57.649946048 +0100
-@@ -198,17 +198,25 @@
- 
- #ifdef CONFIG_TAU
- 	if (cur_cpu_spec[i]->cpu_features & CPU_FTR_TAU) {
-+#ifdef CONFIG_TAU_CALIBRATED
-+		int is_calibrated	= 1;
-+		int temp_offset		= CONFIG_TAU_CALIBRATED_VALUE;
-+#else
-+		int is_calibrated 	= 0;
-+		int temp_offset		= 0;
-+#endif
- #ifdef CONFIG_TAU_AVERAGE
- 		/* more straightforward, but potentially misleading */
--		seq_printf(m,  "temperature \t: %u C (uncalibrated)\n",
--			   cpu_temp(i));
-+		seq_printf(m,  "temperature \t: %u C %s- average\n",
-+			   cpu_temp(i) + temp_offset,  is_calibrated ? "" : "(uncalibrated) " );
- #else
- 		/* show the actual temp sensor range */
- 		u32 temp;
- 		temp = cpu_temp_both(i);
--		seq_printf(m, "temperature \t: %u-%u C (uncalibrated)\n",
--			   temp & 0xff, temp >> 16);
--#endif
-+		seq_printf(m, "temperature \t: %u-%u C %s\n",
-+			   (temp & 0xff) + temp_offset, (temp >> 16) + temp_offset, is_calibrated ? "" : "(uncalibrated)" );
-+
-+#endif /* CONFIG_TAU_AVERAGE */
- 	}
- #endif /* CONFIG_TAU */
- 
-@@ -486,7 +494,7 @@
- {
- 	struct device_node *prom_stdout;
- 	char *name;
--	int offset;
-+	int offset = 0;
- 
- 	if (of_stdout_device == NULL)
- 		return -ENODEV;

Copied: trunk/kernel/source/kernel-source-2.6.11-2.6.11/debian/patches/powerpc-calibrate-tau.patch (from rev 2762, trunk/kernel/source/kernel-source-2.6.11-2.6.11/debian/patches/powerpc-calibrate-tau.dpatch)

Deleted: trunk/kernel/source/kernel-source-2.6.11-2.6.11/debian/patches/powerpc-fix-power3-ftbfs.dpatch
===================================================================
--- trunk/kernel/source/kernel-source-2.6.11-2.6.11/debian/patches/powerpc-fix-power3-ftbfs.dpatch	2005-03-21 09:35:04 UTC (rev 2762)
+++ trunk/kernel/source/kernel-source-2.6.11-2.6.11/debian/patches/powerpc-fix-power3-ftbfs.dpatch	2005-03-21 09:38:36 UTC (rev 2763)
@@ -1,27 +0,0 @@
-#! /bin/sh -e 
-##
-## All lines beginning with `## DP:' are a description of the patch.
-## DP: Description: Works around a broken build system, namely the
-## DP: Description: simple bootloader on power 3/4.
-## DP: Misc: Pulled from the ubuntu tree.
-## DP: Patch author: fabbione at ubuntu.com
-## DP: Upstream status: FTBFS fix, guess it will be fixed upstream too
-
-. $(dirname $0)/DPATCH
-
- at DPATCH@
-diff -urNad linux-source-2.6.10-2.6.10/arch/ppc/boot/simple/misc-prep.c /usr/src/dpatchtemp/dpep.cQRwcC/linux-source-2.6.10-2.6.10/arch/ppc/boot/simple/misc-prep.c
---- linux-source-2.6.10-2.6.10/arch/ppc/boot/simple/misc-prep.c	2004-12-24 22:33:51.000000000 +0100
-+++ /usr/src/dpatchtemp/dpep.cQRwcC/linux-source-2.6.10-2.6.10/arch/ppc/boot/simple/misc-prep.c	2004-12-28 10:43:29.838010536 +0100
-@@ -152,9 +152,11 @@
- 		hold_residual->VitalProductData.Reserved5 = 0xdeadbeef;
- 	}
- 
-+#if defined(CONFIG_6xx)
- 	/* Now go and clear out the BATs and ensure that our MSR is
- 	 * correct .*/
- 	disable_6xx_mmu();
-+#endif
- 
- 	/* Make r3 be a pointer to the residual data. */
- 	return (unsigned long)hold_residual;

Copied: trunk/kernel/source/kernel-source-2.6.11-2.6.11/debian/patches/powerpc-fix-power3-ftbfs.patch (from rev 2762, trunk/kernel/source/kernel-source-2.6.11-2.6.11/debian/patches/powerpc-fix-power3-ftbfs.dpatch)

Deleted: trunk/kernel/source/kernel-source-2.6.11-2.6.11/debian/patches/powerpc-g3-750cxe.dpatch
===================================================================
--- trunk/kernel/source/kernel-source-2.6.11-2.6.11/debian/patches/powerpc-g3-750cxe.dpatch	2005-03-21 09:35:04 UTC (rev 2762)
+++ trunk/kernel/source/kernel-source-2.6.11-2.6.11/debian/patches/powerpc-g3-750cxe.dpatch	2005-03-21 09:38:36 UTC (rev 2763)
@@ -1,68 +0,0 @@
-#! /bin/sh -e 
-##
-## All lines beginning with `## DP:' are a description of the patch.
-## DP: Description: Adds support for 750CXe rev 3.1, prv 0008 3311 (previously recognized as 745/755).
-## DP: Patch author: Nicolas DET <nd at bplan-gmbh.de>
-## DP: Upstream status: submitted
-
-. $(dirname $0)/DPATCH
-
- at DPATCH@
---- linux-2.6.11.orig/arch/ppc/kernel/cputable.c	2005-03-02 08:38:09.000000000 +0100
-+++ linux-2.6.11_nico/arch/ppc/kernel/cputable.c	2005-03-04 15:39:11.032975088 +0100
-@@ -198,20 +198,6 @@
- 		.num_pmcs		= 4,
- 		.cpu_setup		= __setup_cpu_750
- 	},
--	{	/* 745/755 */
--		.pvr_mask		= 0xfffff000,
--		.pvr_value		= 0x00083000,
--		.cpu_name		= "745/755",
--		.cpu_features		= CPU_FTR_COMMON |
--			CPU_FTR_SPLIT_ID_CACHE | CPU_FTR_MAYBE_CAN_DOZE |
--			CPU_FTR_USE_TB | CPU_FTR_L2CR | CPU_FTR_TAU |
--			CPU_FTR_HPTE_TABLE | CPU_FTR_MAYBE_CAN_NAP,
--		.cpu_user_features	= COMMON_PPC,
--		.icache_bsize		= 32,
--		.dcache_bsize		= 32,
--		.num_pmcs		= 4,
--		.cpu_setup		= __setup_cpu_750
--	},
- 	{	/* 750CX (80100 and 8010x?) */
- 		.pvr_mask		= 0xfffffff0,
- 		.pvr_value		= 0x00080100,
-@@ -254,6 +240,34 @@
- 		.num_pmcs		= 4,
- 		.cpu_setup		= __setup_cpu_750cx
- 	},
-+	{	/* 750CXe (00082311 or 00083311) revision 3.1 / 3.1 pre_GA */
-+		.pvr_mask		= 0xffff0fff,
-+		.pvr_value		= 0x00080311,
-+		.cpu_name		= "750CXe rev 3.1",
-+		.cpu_features		= CPU_FTR_COMMON |
-+			CPU_FTR_SPLIT_ID_CACHE | CPU_FTR_MAYBE_CAN_DOZE |
-+			CPU_FTR_USE_TB | CPU_FTR_L2CR | CPU_FTR_TAU |
-+			CPU_FTR_HPTE_TABLE | CPU_FTR_MAYBE_CAN_NAP,
-+		.cpu_user_features	= COMMON_PPC,
-+		.icache_bsize		= 32,
-+		.dcache_bsize		= 32,
-+		.num_pmcs		= 4,
-+		.cpu_setup		= __setup_cpu_750cx
-+	},
-+	{	/* 745/755 */
-+		.pvr_mask		= 0xfffff000,
-+		.pvr_value		= 0x00083000,
-+		.cpu_name		= "745/755",
-+		.cpu_features		= CPU_FTR_COMMON |
-+			CPU_FTR_SPLIT_ID_CACHE | CPU_FTR_MAYBE_CAN_DOZE |
-+			CPU_FTR_USE_TB | CPU_FTR_L2CR | CPU_FTR_TAU |
-+			CPU_FTR_HPTE_TABLE | CPU_FTR_MAYBE_CAN_NAP,
-+		.cpu_user_features	= COMMON_PPC,
-+		.icache_bsize		= 32,
-+		.dcache_bsize		= 32,
-+		.num_pmcs		= 4,
-+		.cpu_setup		= __setup_cpu_750
-+	},
- 	{	/* 750FX rev 1.x */
- 		.pvr_mask		= 0xffffff00,
- 		.pvr_value		= 0x70000100,

Copied: trunk/kernel/source/kernel-source-2.6.11-2.6.11/debian/patches/powerpc-g3-750cxe.patch (from rev 2762, trunk/kernel/source/kernel-source-2.6.11-2.6.11/debian/patches/powerpc-g3-750cxe.dpatch)

Deleted: trunk/kernel/source/kernel-source-2.6.11-2.6.11/debian/patches/powerpc-g4-l2-flush-errata.dpatch
===================================================================
--- trunk/kernel/source/kernel-source-2.6.11-2.6.11/debian/patches/powerpc-g4-l2-flush-errata.dpatch	2005-03-21 09:35:04 UTC (rev 2762)
+++ trunk/kernel/source/kernel-source-2.6.11-2.6.11/debian/patches/powerpc-g4-l2-flush-errata.dpatch	2005-03-21 09:38:36 UTC (rev 2763)
@@ -1,260 +0,0 @@
-#! /bin/sh -e 
-##
-## All lines beginning with `## DP:' are a description of the patch.
-## DP: Description: Fixes g4 l2 cache flush and MSR erratas.
-## DP: Patch author: Sven Luther <luther at debian.org>
-## DP: Upstream status: under review by benh.
-
-. $(dirname $0)/DPATCH
-
- at DPATCH@
-diff -urN kernel-source-2.6.11-2.6.11-orig/arch/ppc/kernel/cputable.c kernel-source-2.6.11-2.6.11/arch/ppc/kernel/cputable.c
---- kernel-source-2.6.11-2.6.11-orig/arch/ppc/kernel/cputable.c	2005-03-02 08:38:09.000000000 +0100
-+++ kernel-source-2.6.11-2.6.11/arch/ppc/kernel/cputable.c	2005-03-04 18:31:46.617848664 +0100
-@@ -380,7 +380,7 @@
- 			CPU_FTR_SPLIT_ID_CACHE | CPU_FTR_USE_TB |
- 			CPU_FTR_L2CR | CPU_FTR_ALTIVEC_COMP | CPU_FTR_L3CR |
- 			CPU_FTR_HPTE_TABLE | CPU_FTR_SPEC7450 |
--			CPU_FTR_NEED_COHERENT,
-+			CPU_FTR_NEED_COHERENT | CPU_FTR_HWFLUSH_L2_CACHE,
- 		.cpu_user_features	= COMMON_PPC | PPC_FEATURE_ALTIVEC_COMP,
- 		.icache_bsize		= 32,
- 		.dcache_bsize		= 32,
-@@ -397,7 +397,7 @@
- 			CPU_FTR_ALTIVEC_COMP | CPU_FTR_L3CR |
- 			CPU_FTR_HPTE_TABLE | CPU_FTR_SPEC7450 |
- 			CPU_FTR_NAP_DISABLE_L2_PR | CPU_FTR_L3_DISABLE_NAP |
--			CPU_FTR_NEED_COHERENT,
-+			CPU_FTR_NEED_COHERENT | CPU_FTR_HWFLUSH_L2_CACHE,
- 		.cpu_user_features	= COMMON_PPC | PPC_FEATURE_ALTIVEC_COMP,
- 		.icache_bsize		= 32,
- 		.dcache_bsize		= 32,
-@@ -413,7 +413,8 @@
- 			CPU_FTR_MAYBE_CAN_NAP | CPU_FTR_L2CR |
- 			CPU_FTR_ALTIVEC_COMP | CPU_FTR_L3CR |
- 			CPU_FTR_HPTE_TABLE | CPU_FTR_SPEC7450 |
--			CPU_FTR_NAP_DISABLE_L2_PR | CPU_FTR_NEED_COHERENT,
-+			CPU_FTR_NAP_DISABLE_L2_PR | CPU_FTR_NEED_COHERENT |
-+			CPU_FTR_HWFLUSH_L2_CACHE,
- 		.cpu_user_features	= COMMON_PPC | PPC_FEATURE_ALTIVEC_COMP,
- 		.icache_bsize		= 32,
- 		.dcache_bsize		= 32,
-@@ -428,7 +429,8 @@
- 			CPU_FTR_SPLIT_ID_CACHE | CPU_FTR_USE_TB |
- 			CPU_FTR_L2CR | CPU_FTR_ALTIVEC_COMP | CPU_FTR_L3CR |
- 			CPU_FTR_HPTE_TABLE | CPU_FTR_SPEC7450 |
--			CPU_FTR_HAS_HIGH_BATS | CPU_FTR_NEED_COHERENT,
-+			CPU_FTR_HAS_HIGH_BATS | CPU_FTR_NEED_COHERENT |
-+			CPU_FTR_HWFLUSH_L2_CACHE,
- 		.cpu_user_features	= COMMON_PPC | PPC_FEATURE_ALTIVEC_COMP,
- 		.icache_bsize		= 32,
- 		.dcache_bsize		= 32,
-@@ -445,7 +447,8 @@
- 			CPU_FTR_ALTIVEC_COMP | CPU_FTR_L3CR |
- 			CPU_FTR_HPTE_TABLE | CPU_FTR_SPEC7450 |
- 			CPU_FTR_NAP_DISABLE_L2_PR | CPU_FTR_L3_DISABLE_NAP |
--			CPU_FTR_NEED_COHERENT | CPU_FTR_HAS_HIGH_BATS,
-+			CPU_FTR_NEED_COHERENT | CPU_FTR_HAS_HIGH_BATS |
-+			CPU_FTR_HWFLUSH_L2_CACHE,
- 		.cpu_user_features	= COMMON_PPC | PPC_FEATURE_ALTIVEC_COMP,
- 		.icache_bsize		= 32,
- 		.dcache_bsize		= 32,
-@@ -462,7 +465,7 @@
- 			CPU_FTR_ALTIVEC_COMP | CPU_FTR_L3CR |
- 			CPU_FTR_HPTE_TABLE | CPU_FTR_SPEC7450 |
- 			CPU_FTR_NAP_DISABLE_L2_PR | CPU_FTR_HAS_HIGH_BATS |
--			CPU_FTR_NEED_COHERENT,
-+			CPU_FTR_NEED_COHERENT | CPU_FTR_HWFLUSH_L2_CACHE,
- 		.cpu_user_features	= COMMON_PPC | PPC_FEATURE_ALTIVEC_COMP,
- 		.icache_bsize		= 32,
- 		.dcache_bsize		= 32,
-@@ -479,7 +482,8 @@
- 			CPU_FTR_ALTIVEC_COMP | CPU_FTR_L3CR |
- 			CPU_FTR_HPTE_TABLE | CPU_FTR_SPEC7450 |
- 			CPU_FTR_NAP_DISABLE_L2_PR | CPU_FTR_HAS_HIGH_BATS |
--			CPU_FTR_NEED_COHERENT | CPU_FTR_NO_BTIC,
-+			CPU_FTR_NEED_COHERENT | CPU_FTR_NO_BTIC |
-+			CPU_FTR_HWFLUSH_L2_CACHE,
- 		.cpu_user_features	= COMMON_PPC | PPC_FEATURE_ALTIVEC_COMP,
- 		.icache_bsize		= 32,
- 		.dcache_bsize		= 32,
-@@ -496,7 +500,8 @@
- 			CPU_FTR_ALTIVEC_COMP | CPU_FTR_L3CR |
- 			CPU_FTR_HPTE_TABLE | CPU_FTR_SPEC7450 |
- 			CPU_FTR_NAP_DISABLE_L2_PR | CPU_FTR_HAS_HIGH_BATS |
--			CPU_FTR_NEED_COHERENT | CPU_FTR_NO_BTIC,
-+			CPU_FTR_NEED_COHERENT | CPU_FTR_NO_BTIC |
-+			CPU_FTR_HWFLUSH_L2_CACHE,
- 		.cpu_user_features	= COMMON_PPC | PPC_FEATURE_ALTIVEC_COMP,
- 		.icache_bsize		= 32,
- 		.dcache_bsize		= 32,
-@@ -513,7 +518,7 @@
- 			CPU_FTR_ALTIVEC_COMP | CPU_FTR_L3CR |
- 			CPU_FTR_HPTE_TABLE | CPU_FTR_SPEC7450 |
- 			CPU_FTR_NAP_DISABLE_L2_PR | CPU_FTR_HAS_HIGH_BATS |
--			CPU_FTR_NEED_COHERENT,
-+			CPU_FTR_NEED_COHERENT | CPU_FTR_HWFLUSH_L2_CACHE,
- 		.cpu_user_features	= COMMON_PPC | PPC_FEATURE_ALTIVEC_COMP,
- 		.icache_bsize		= 32,
- 		.dcache_bsize		= 32,
-@@ -529,7 +534,8 @@
- 			CPU_FTR_MAYBE_CAN_NAP | CPU_FTR_L2CR |
- 			CPU_FTR_ALTIVEC_COMP | CPU_FTR_HPTE_TABLE |
- 			CPU_FTR_SPEC7450 | CPU_FTR_NAP_DISABLE_L2_PR |
--			CPU_FTR_HAS_HIGH_BATS | CPU_FTR_NEED_COHERENT,
-+			CPU_FTR_HAS_HIGH_BATS | CPU_FTR_NEED_COHERENT |
-+			CPU_FTR_HWFLUSH_L2_CACHE,
- 		.cpu_user_features	= COMMON_PPC | PPC_FEATURE_ALTIVEC_COMP,
- 		.icache_bsize		= 32,
- 		.dcache_bsize		= 32,
-diff -urN kernel-source-2.6.11-2.6.11-orig/arch/ppc/kernel/l2cr.S kernel-source-2.6.11-2.6.11/arch/ppc/kernel/l2cr.S
---- kernel-source-2.6.11-2.6.11-orig/arch/ppc/kernel/l2cr.S	2005-03-02 08:38:10.000000000 +0100
-+++ kernel-source-2.6.11-2.6.11/arch/ppc/kernel/l2cr.S	2005-03-04 18:31:46.864811120 +0100
-@@ -19,7 +19,7 @@
- /*
- 	Thur, Dec. 12, 1998.
- 	- First public release, contributed by PowerLogix.
--	***********
-+
- 	Sat, Aug. 7, 1999.
- 	- Terry: Made sure code disabled interrupts before running. (Previously
- 			it was assumed interrupts were already disabled).
-@@ -27,16 +27,19 @@
- 			instead of 2MB.  (Prob. only 3 is necessary).
- 	- Terry: Updated for workaround to HID0[DPM] processor bug
- 			during global invalidates.
--	***********
-+
- 	Thu, July 13, 2000.
- 	- Terry: Added isync to correct for an errata.
- 
--	22 August 2001.
-+	We, August 22, 2001.
- 	- DanM: Finally added the 7450 patch I've had for the past
- 		several months.  The L2CR is similar, but I'm going
- 		to assume the user of this functions knows what they
- 		are doing.
- 
-+	Thu, June 17, 2004.
-+	- JPAN: Fixed 745X L3 cache enablement routine, also use HW flush assist.
-+	
- 	Author:	Terry Greeniaus (tgree at phys.ualberta.ca)
- 	Please e-mail updates to this file to me, thanks!
- */
-@@ -155,9 +158,7 @@
- 	       Don't do this unless you accomodate all processor variations.
- 	       The bit moved on the 7450.....
- 	  ****/
--
--	/* TODO: use HW flush assist when available */
--
-+BEGIN_FTR_SECTION
- 	lis	r4,0x0002
- 	mtctr	r4
- 	li	r4,0
-@@ -176,7 +177,23 @@
- 	dcbf	0,r4
- 	addi	r4,r4,32		/* Go to start of next cache line */
- 	bdnz	1b
-+END_FTR_SECTION_IFCLR(CPU_FTR_HWFLUSH_L2_CACHE)
- 
-+BEGIN_FTR_SECTION
-+	/* Use HW flush assist, MPC7447A errata #3 */
-+	oris	r4,r4,0x0010	/* Set L2CR[IONLY/11] = 1 */
-+	oris	r4,r4,0x0001	/* Set L2CR[DONLY/15] = 1 */
-+	mtspr   L2CR,r4		/* Lock the L2	*/
-+	sync
-+	ori	r4,r4,0x0800	/* Set L2CR[L2HWF/20] = 1 */
-+	mtspr   L2CR,r4		/* Flush the L2 */
-+1:	
-+	mfspr	r4,L2CR
-+	andi.	r4,r4,0x0800	/* L2HWF still set? */
-+	bne	1b
-+	sync	/* sync to clear the store queues before L3 flush (UM step 5)*/
-+END_FTR_SECTION_IFSET(CPU_FTR_HWFLUSH_L2_CACHE)
-+	
- 2:
- 	/* Set up the L2CR configuration bits (and switch L2 off) */
- 	/* CPU errata: Make sure the mtspr below is already in the
-@@ -293,17 +310,18 @@
- 
- 	/* Flush the cache.
- 	 */
--
--	/* TODO: use HW flush assist */
--
--	lis	r4,0x0008
--	mtctr	r4
--	li	r4,0
--1:
--	lwzx	r0,r0,r4
--	dcbf	0,r4
--	addi	r4,r4,32		/* Go to start of next cache line */
--	bdnz	1b
-+	/* use HW flush assist. (UM 3.6.3.1.5) */
-+	mfspr	r4, SPRN_L3CR
-+	oris	r4,r4,0x0040	/* Set L3CR[L3IO/9] = 1. */
-+	ori	r4,r4,0x0040	/* Set L3CR[L3DO/29] = 1.*/
-+	mtspr	1018,r4		/* Lock the L3 by making IONLY and DONLY */
-+	ori	r4,r4,0x0800	/* Set L3CR[L3HWF/20] for hardware flush */
-+	mtspr	SPRN_L3CR,r4
-+flush_745x_L3_poll:
-+	mfspr	r4,SPRN_L3CR
-+	rlwinm.	r4,r4,0,20,20
-+	bne	flush_745x_L3_poll
-+	sync	/* Clear the store queues per procedure (UM step 8) */
- 
- 2:
- 	/* Set up the L3CR configuration bits (and switch L3 off) */
-@@ -349,8 +367,8 @@
- 	cmplwi	r5,0
- 	beq	4f
- 
--	/* Enable the cache */
--	oris	r3,r3,(L3CR_L3E | L3CR_L3CLKEN)@h
-+	/* enable L3 clock */
-+	oris	r3,r3,(L3CR_L3CLKEN)@h
- 	mtspr	SPRN_L3CR,r3
- 	sync
- 
-@@ -358,6 +376,15 @@
- 	li	r0,256
- 	mtctr	r0
- 1:	bdnz	1b
-+	
-+	/* Clear MSSSR0 which may cause parity error */
-+	xor	r5,r5,r5
-+	mtspr	1015, r5
-+	
-+	/* Enable L3 cache */
-+	oris	r3,r3,(L3CR_L3E)@h
-+	mtspr	SPRN_L3CR,r3
-+	sync
- 
- 	/* Restore MSR (restores EE and DR bits to original state) */
- 4:	SYNC
-diff -urN kernel-source-2.6.11-2.6.11-orig/arch/ppc/kernel/traps.c kernel-source-2.6.11-2.6.11/arch/ppc/kernel/traps.c
---- kernel-source-2.6.11-2.6.11-orig/arch/ppc/kernel/traps.c	2005-03-02 08:37:50.000000000 +0100
-+++ kernel-source-2.6.11-2.6.11/arch/ppc/kernel/traps.c	2005-03-04 18:31:46.867810664 +0100
-@@ -307,7 +307,9 @@
- 	case 0x80000:
- 		printk("Machine check signal\n");
- 		break;
--	case 0:		/* for 601 */
-+	case 0:		/* for 601 and 744x */
-+		printk("Transfer error ack signal if 601, or MCP if 744x \n");
-+		break;
- 	case 0x40000:
- 	case 0x140000:	/* 7450 MSS error and TEA */
- 		printk("Transfer error ack signal\n");
-diff -urN kernel-source-2.6.11-2.6.11-orig/include/asm-ppc/cputable.h kernel-source-2.6.11-2.6.11/include/asm-ppc/cputable.h
---- kernel-source-2.6.11-2.6.11-orig/include/asm-ppc/cputable.h	2005-03-02 08:38:07.000000000 +0100
-+++ kernel-source-2.6.11-2.6.11/include/asm-ppc/cputable.h	2005-03-04 18:31:46.942799264 +0100
-@@ -83,6 +83,7 @@
- #define CPU_FTR_HAS_HIGH_BATS		0x00010000
- #define CPU_FTR_NEED_COHERENT           0x00020000
- #define CPU_FTR_NO_BTIC			0x00040000
-+#define CPU_FTR_HWFLUSH_L2_CACHE	0x00080000
- 
- #ifdef __ASSEMBLY__
- 

Copied: trunk/kernel/source/kernel-source-2.6.11-2.6.11/debian/patches/powerpc-g4-l2-flush-errata.patch (from rev 2762, trunk/kernel/source/kernel-source-2.6.11-2.6.11/debian/patches/powerpc-g4-l2-flush-errata.dpatch)

Deleted: trunk/kernel/source/kernel-source-2.6.11-2.6.11/debian/patches/powerpc-mv643xx-enet.dpatch
===================================================================
--- trunk/kernel/source/kernel-source-2.6.11-2.6.11/debian/patches/powerpc-mv643xx-enet.dpatch	2005-03-21 09:35:04 UTC (rev 2762)
+++ trunk/kernel/source/kernel-source-2.6.11-2.6.11/debian/patches/powerpc-mv643xx-enet.dpatch	2005-03-21 09:38:36 UTC (rev 2763)
@@ -1,5296 +0,0 @@
-#! /bin/sh -e 
-##
-## All lines beginning with `## DP:' are a description of the patch.
-## DP: Description: Cleans arch-dependency of mv643xx_eth driver.
-## DP: Patch authors: Dale Farnsworth <dale at farnsworth.org>
-## DP: Upstream status: planned for 2.6.12.
-## DP: BK URL: bk://dfarnsworth.bkbits.net/linux-2.5-mv643xx-enet
-
-. $(dirname $0)/DPATCH
-
- at DPATCH@
---- kernel-source-2.6.11/drivers/net/Kconfig	2005-03-02 08:38:25.000000000 +0100
-+++ kernel-source-2.6.11-marvell/drivers/net/Kconfig	2005-03-07 20:36:43.000000000 +0100
-@@ -2094,10 +2094,11 @@
- 
- config MV643XX_ETH
- 	tristate "MV-643XX Ethernet support"
--	depends on MOMENCO_OCELOT_C || MOMENCO_JAGUAR_ATX
-+	depends on MOMENCO_OCELOT_C || MOMENCO_JAGUAR_ATX || MV64360 || PPC_MULTIPLATFORM
- 	help
- 	  This driver supports the gigabit Ethernet on the Marvell MV643XX
--	  chipset which is used in the Momenco Ocelot C and Jaguar ATX.
-+	  chipset which is used in the Momenco Ocelot C and Jaguar ATX and
-+	  Pegasos II, amongst other PPC and MIPS boards.
- 
- config MV643XX_ETH_0
- 	bool "MV-643XX Port 0"
---- kernel-source-2.6.11/drivers/net/mv643xx_eth.c	2005-03-02 08:38:01.000000000 +0100
-+++ kernel-source-2.6.11-marvell/drivers/net/mv643xx_eth.c	2005-03-08 20:23:20.000000000 +0100
-@@ -1,5 +1,5 @@
- /*
-- * drivers/net/mv64340_eth.c - Driver for MV64340X ethernet ports
-+ * drivers/net/mv643xx_eth.c - Driver for MV643XX ethernet ports
-  * Copyright (C) 2002 Matthew Dharm <mdharm at momenco.com>
-  *
-  * Based on the 64360 driver from:
-@@ -10,6 +10,12 @@
-  *
-  * Copyright (C) 2003 Ralf Baechle <ralf at linux-mips.org>
-  *
-+ * Copyright (C) 2004-2005 MontaVista Software, Inc.
-+ *			   Dale Farnsworth <dale at farnsworth.org>
-+ *
-+ * Copyright (C) 2004 Steven J. Hill <sjhill1 at rockwellcollins.com>
-+ *				     <sjhill at realitydiluted.com>
-+ *
-  * 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
-@@ -24,80 +30,100 @@
-  * along with this program; if not, write to the Free Software
-  * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA  02111-1307, USA.
-  */
--#include <linux/config.h>
--#include <linux/version.h>
--#include <linux/module.h>
--#include <linux/kernel.h>
--#include <linux/config.h>
--#include <linux/sched.h>
--#include <linux/ptrace.h>
--#include <linux/fcntl.h>
--#include <linux/ioport.h>
--#include <linux/interrupt.h>
--#include <linux/slab.h>
--#include <linux/string.h>
--#include <linux/errno.h>
--#include <linux/ip.h>
- #include <linux/init.h>
--#include <linux/in.h>
--#include <linux/pci.h>
--#include <linux/workqueue.h>
--#include <asm/smp.h>
--#include <linux/skbuff.h>
-+#include <linux/dma-mapping.h>
- #include <linux/tcp.h>
--#include <linux/netdevice.h>
-+#include <linux/udp.h>
- #include <linux/etherdevice.h>
--#include <net/ip.h>
- 
- #include <linux/bitops.h>
-+#include <linux/delay.h>
-+#include <linux/ethtool.h>
- #include <asm/io.h>
- #include <asm/types.h>
- #include <asm/pgtable.h>
- #include <asm/system.h>
-+#include <asm/delay.h>
- #include "mv643xx_eth.h"
- 
- /*
-- * The first part is the high level driver of the gigE ethernet ports. 
-+ * The first part is the high level driver of the gigE ethernet ports.
-  */
- 
--/* Definition for configuring driver */
--#undef MV64340_RX_QUEUE_FILL_ON_TASK
--
- /* Constants */
--#define EXTRA_BYTES 32
--#define WRAP       ETH_HLEN + 2 + 4 + 16
--#define BUFFER_MTU dev->mtu + WRAP
-+#define VLAN_HLEN		4
-+#define FCS_LEN			4
-+#define WRAP			NET_IP_ALIGN + ETH_HLEN + VLAN_HLEN + FCS_LEN
-+#define RX_SKB_SIZE		((dev->mtu + WRAP + 7) & ~0x7)
-+
- #define INT_CAUSE_UNMASK_ALL		0x0007ffff
- #define INT_CAUSE_UNMASK_ALL_EXT	0x0011ffff
--#ifdef MV64340_RX_FILL_ON_TASK
-+#ifdef MV643XX_RX_QUEUE_FILL_ON_TASK
- #define INT_CAUSE_MASK_ALL		0x00000000
- #define INT_CAUSE_CHECK_BITS		INT_CAUSE_UNMASK_ALL
- #define INT_CAUSE_CHECK_BITS_EXT	INT_CAUSE_UNMASK_ALL_EXT
- #endif
- 
-+#ifdef MV643XX_CHECKSUM_OFFLOAD_TX
-+#define MAX_DESCS_PER_SKB	(MAX_SKB_FRAGS + 1)
-+#else
-+#define MAX_DESCS_PER_SKB	1
-+#endif
-+
-+#define PHY_WAIT_ITERATIONS	1000	/* 1000 iterations * 10uS = 10mS max */
-+#define PHY_WAIT_MICRO_SECONDS	10
-+
- /* Static function declarations */
--static int mv64340_eth_real_open(struct net_device *);
--static int mv64340_eth_real_stop(struct net_device *);
--static int mv64340_eth_change_mtu(struct net_device *, int);
--static struct net_device_stats *mv64340_eth_get_stats(struct net_device *);
-+static int eth_port_link_is_up(unsigned int eth_port_num);
-+static void eth_port_uc_addr_get(struct net_device *dev,
-+						unsigned char *MacAddr);
-+static int mv643xx_eth_real_open(struct net_device *);
-+static int mv643xx_eth_real_stop(struct net_device *);
-+static int mv643xx_eth_change_mtu(struct net_device *, int);
-+static struct net_device_stats *mv643xx_eth_get_stats(struct net_device *);
- static void eth_port_init_mac_tables(unsigned int eth_port_num);
--#ifdef MV64340_NAPI
--static int mv64340_poll(struct net_device *dev, int *budget);
-+#ifdef MV643XX_NAPI
-+static int mv643xx_poll(struct net_device *dev, int *budget);
- #endif
-+static void ethernet_phy_set(unsigned int eth_port_num, int phy_addr);
-+static int ethernet_phy_detect(unsigned int eth_port_num);
-+static struct ethtool_ops mv643xx_ethtool_ops;
-+
-+static char mv643xx_driver_name[] = "mv643xx_eth";
-+static char mv643xx_driver_version[] = "1.0";
-+
-+static void __iomem *mv643xx_eth_shared_base;
-+
-+/* used to protect MV643XX_ETH_SMI_REG, which is shared across ports */
-+static spinlock_t mv643xx_eth_phy_lock = SPIN_LOCK_UNLOCKED;
-+
-+static inline u32 mv_read(int offset)
-+{
-+	void *__iomem reg_base;
-+
-+	reg_base = mv643xx_eth_shared_base - MV643XX_ETH_SHARED_REGS;
-+
-+	return readl(reg_base + offset);
-+}
-+
-+static inline void mv_write(int offset, u32 data)
-+{
-+	void * __iomem reg_base;
- 
--unsigned char prom_mac_addr_base[6];
--unsigned long mv64340_sram_base;
-+	reg_base = mv643xx_eth_shared_base - MV643XX_ETH_SHARED_REGS;
-+	writel(data, reg_base + offset);
-+}
- 
- /*
-  * Changes MTU (maximum transfer unit) of the gigabit ethenret port
-  *
-- * Input : pointer to ethernet interface network device structure
-- *         new mtu size 
-- * Output : 0 upon success, -EINVAL upon failure
-+ * Input :	pointer to ethernet interface network device structure
-+ *		new mtu size
-+ * Output :	0 upon success, -EINVAL upon failure
-  */
--static int mv64340_eth_change_mtu(struct net_device *dev, int new_mtu)
-+static int mv643xx_eth_change_mtu(struct net_device *dev, int new_mtu)
- {
--	struct mv64340_private *mp = netdev_priv(dev);
-+	struct mv643xx_private *mp = netdev_priv(dev);
- 	unsigned long flags;
- 
- 	spin_lock_irqsave(&mp->lock, flags);
-@@ -108,21 +134,21 @@
- 	}
- 
- 	dev->mtu = new_mtu;
--	/* 
-+	/*
- 	 * Stop then re-open the interface. This will allocate RX skb's with
- 	 * the new MTU.
- 	 * There is a possible danger that the open will not successed, due
- 	 * to memory is full, which might fail the open function.
- 	 */
- 	if (netif_running(dev)) {
--		if (mv64340_eth_real_stop(dev))
-+		if (mv643xx_eth_real_stop(dev))
- 			printk(KERN_ERR
--			       "%s: Fatal error on stopping device\n",
--			       dev->name);
--		if (mv64340_eth_real_open(dev))
-+				"%s: Fatal error on stopping device\n",
-+				dev->name);
-+		if (mv643xx_eth_real_open(dev))
- 			printk(KERN_ERR
--			       "%s: Fatal error on opening device\n",
--			       dev->name);
-+				"%s: Fatal error on opening device\n",
-+				dev->name);
- 	}
- 
- 	spin_unlock_irqrestore(&mp->lock, flags);
-@@ -130,17 +156,17 @@
- }
- 
- /*
-- * mv64340_eth_rx_task
-- *								       
-+ * mv643xx_eth_rx_task
-+ *
-  * Fills / refills RX queue on a certain gigabit ethernet port
-  *
-- * Input : pointer to ethernet interface network device structure
-- * Output : N/A
-+ * Input :	pointer to ethernet interface network device structure
-+ * Output :	N/A
-  */
--static void mv64340_eth_rx_task(void *data)
-+static void mv643xx_eth_rx_task(void *data)
- {
--	struct net_device *dev = (struct net_device *) data;
--	struct mv64340_private *mp = netdev_priv(dev);
-+	struct net_device *dev = (struct net_device *)data;
-+	struct mv643xx_private *mp = netdev_priv(dev);
- 	struct pkt_info pkt_info;
- 	struct sk_buff *skb;
- 
-@@ -148,28 +174,18 @@
- 		panic("%s: Error in test_set_bit / clear_bit", dev->name);
- 
- 	while (mp->rx_ring_skbs < (mp->rx_ring_size - 5)) {
--		/* The +8 for buffer allignment and another 32 byte extra */
--
--		skb = dev_alloc_skb(BUFFER_MTU + 8 + EXTRA_BYTES);
-+		skb = dev_alloc_skb(RX_SKB_SIZE);
- 		if (!skb)
--			/* Better luck next time */
- 			break;
- 		mp->rx_ring_skbs++;
- 		pkt_info.cmd_sts = ETH_RX_ENABLE_INTERRUPT;
--		pkt_info.byte_cnt = dev->mtu + ETH_HLEN + 4 + 2 + EXTRA_BYTES;
--		/* Allign buffer to 8 bytes */
--		if (pkt_info.byte_cnt & ~0x7) {
--			pkt_info.byte_cnt &= ~0x7;
--			pkt_info.byte_cnt += 8;
--		}
--		pkt_info.buf_ptr =
--		    pci_map_single(0, skb->data,
--				   dev->mtu + ETH_HLEN + 4 + 2 + EXTRA_BYTES,
--				   PCI_DMA_FROMDEVICE);
-+		pkt_info.byte_cnt = RX_SKB_SIZE;
-+		pkt_info.buf_ptr = dma_map_single(NULL, skb->data, RX_SKB_SIZE,
-+							DMA_FROM_DEVICE);
- 		pkt_info.return_info = skb;
- 		if (eth_rx_return_buff(mp, &pkt_info) != ETH_OK) {
- 			printk(KERN_ERR
--			       "%s: Error allocating RX Ring\n", dev->name);
-+				"%s: Error allocating RX Ring\n", dev->name);
- 			break;
- 		}
- 		skb_reserve(skb, 2);
-@@ -186,46 +202,45 @@
- 		add_timer(&mp->timeout);
- 		mp->rx_timer_flag = 1;
- 	}
--#if MV64340_RX_QUEUE_FILL_ON_TASK
-+#ifdef MV643XX_RX_QUEUE_FILL_ON_TASK
- 	else {
- 		/* Return interrupts */
--		MV_WRITE(MV64340_ETH_INTERRUPT_MASK_REG(mp->port_num),
--			 INT_CAUSE_UNMASK_ALL);
-+		mv_write(MV643XX_ETH_INTERRUPT_MASK_REG(mp->port_num),
-+							INT_CAUSE_UNMASK_ALL);
- 	}
- #endif
- }
- 
- /*
-- * mv64340_eth_rx_task_timer_wrapper
-- *								       
-+ * mv643xx_eth_rx_task_timer_wrapper
-+ *
-  * Timer routine to wake up RX queue filling task. This function is
-  * used only in case the RX queue is empty, and all alloc_skb has
-  * failed (due to out of memory event).
-  *
-- * Input : pointer to ethernet interface network device structure
-- * Output : N/A
-+ * Input :	pointer to ethernet interface network device structure
-+ * Output :	N/A
-  */
--static void mv64340_eth_rx_task_timer_wrapper(unsigned long data)
-+static void mv643xx_eth_rx_task_timer_wrapper(unsigned long data)
- {
--	struct net_device *dev = (struct net_device *) data;
--	struct mv64340_private *mp = netdev_priv(dev);
-+	struct net_device *dev = (struct net_device *)data;
-+	struct mv643xx_private *mp = netdev_priv(dev);
- 
- 	mp->rx_timer_flag = 0;
--	mv64340_eth_rx_task((void *) data);
-+	mv643xx_eth_rx_task((void *)data);
- }
- 
--
- /*
-- * mv64340_eth_update_mac_address
-- *								       
-+ * mv643xx_eth_update_mac_address
-+ *
-  * Update the MAC address of the port in the address table
-  *
-- * Input : pointer to ethernet interface network device structure
-- * Output : N/A
-+ * Input :	pointer to ethernet interface network device structure
-+ * Output :	N/A
-  */
--static void mv64340_eth_update_mac_address(struct net_device *dev)
-+static void mv643xx_eth_update_mac_address(struct net_device *dev)
- {
--	struct mv64340_private *mp = netdev_priv(dev);
-+	struct mv643xx_private *mp = netdev_priv(dev);
- 	unsigned int port_num = mp->port_num;
- 
- 	eth_port_init_mac_tables(port_num);
-@@ -234,64 +249,59 @@
- }
- 
- /*
-- * mv64340_eth_set_rx_mode
-- *								       
-+ * mv643xx_eth_set_rx_mode
-+ *
-  * Change from promiscuos to regular rx mode
-  *
-- * Input : pointer to ethernet interface network device structure
-- * Output : N/A
-+ * Input :	pointer to ethernet interface network device structure
-+ * Output :	N/A
-  */
--static void mv64340_eth_set_rx_mode(struct net_device *dev)
-+static void mv643xx_eth_set_rx_mode(struct net_device *dev)
- {
--	struct mv64340_private *mp = netdev_priv(dev);
-+	struct mv643xx_private *mp = netdev_priv(dev);
-+	u32 config_reg;
- 
--	if (dev->flags & IFF_PROMISC) {
--		ethernet_set_config_reg
--		    (mp->port_num,
--		     ethernet_get_config_reg(mp->port_num) |
--		     ETH_UNICAST_PROMISCUOUS_MODE);
--	} else {
--		ethernet_set_config_reg
--		    (mp->port_num,
--		     ethernet_get_config_reg(mp->port_num) &
--		     ~(unsigned int) ETH_UNICAST_PROMISCUOUS_MODE);
--	}
-+	config_reg = ethernet_get_config_reg(mp->port_num);
-+	if (dev->flags & IFF_PROMISC)
-+		config_reg |= (u32) MV643XX_ETH_UNICAST_PROMISCUOUS_MODE;
-+	else
-+		config_reg &= ~(u32) MV643XX_ETH_UNICAST_PROMISCUOUS_MODE;
-+	ethernet_set_config_reg(mp->port_num, config_reg);
- }
- 
--
- /*
-- * mv64340_eth_set_mac_address
-- *								       
-+ * mv643xx_eth_set_mac_address
-+ *
-  * Change the interface's mac address.
-  * No special hardware thing should be done because interface is always
-  * put in promiscuous mode.
-  *
-- * Input : pointer to ethernet interface network device structure and
-- *         a pointer to the designated entry to be added to the cache.
-- * Output : zero upon success, negative upon failure
-+ * Input :	pointer to ethernet interface network device structure and
-+ *		a pointer to the designated entry to be added to the cache.
-+ * Output :	zero upon success, negative upon failure
-  */
--static int mv64340_eth_set_mac_address(struct net_device *dev, void *addr)
-+static int mv643xx_eth_set_mac_address(struct net_device *dev, void *addr)
- {
- 	int i;
- 
- 	for (i = 0; i < 6; i++)
- 		/* +2 is for the offset of the HW addr type */
--		dev->dev_addr[i] = ((unsigned char *) addr)[i + 2];
--	mv64340_eth_update_mac_address(dev);
-+		dev->dev_addr[i] = ((unsigned char *)addr)[i + 2];
-+	mv643xx_eth_update_mac_address(dev);
- 	return 0;
- }
- 
- /*
-- * mv64340_eth_tx_timeout
-- *								       
-+ * mv643xx_eth_tx_timeout
-+ *
-  * Called upon a timeout on transmitting a packet
-  *
-- * Input : pointer to ethernet interface network device structure.
-- * Output : N/A
-+ * Input :	pointer to ethernet interface network device structure.
-+ * Output :	N/A
-  */
--static void mv64340_eth_tx_timeout(struct net_device *dev)
-+static void mv643xx_eth_tx_timeout(struct net_device *dev)
- {
--	struct mv64340_private *mp = netdev_priv(dev);
-+	struct mv643xx_private *mp = netdev_priv(dev);
- 
- 	printk(KERN_INFO "%s: TX timeout  ", dev->name);
- 
-@@ -300,31 +310,31 @@
- }
- 
- /*
-- * mv64340_eth_tx_timeout_task
-+ * mv643xx_eth_tx_timeout_task
-  *
-  * Actual routine to reset the adapter when a timeout on Tx has occurred
-  */
--static void mv64340_eth_tx_timeout_task(struct net_device *dev)
-+static void mv643xx_eth_tx_timeout_task(struct net_device *dev)
- {
--        struct mv64340_private *mp = netdev_priv(dev);
-+	struct mv643xx_private *mp = netdev_priv(dev);
- 
--        netif_device_detach(dev);
--        eth_port_reset(mp->port_num);
--        eth_port_start(mp);
--        netif_device_attach(dev);
-+	netif_device_detach(dev);
-+	eth_port_reset(mp->port_num);
-+	eth_port_start(mp);
-+	netif_device_attach(dev);
- }
- 
- /*
-- * mv64340_eth_free_tx_queue
-+ * mv643xx_eth_free_tx_queue
-  *
-- * Input : dev - a pointer to the required interface
-+ * Input :	dev - a pointer to the required interface
-  *
-- * Output : 0 if was able to release skb , nonzero otherwise
-+ * Output :	0 if was able to release skb , nonzero otherwise
-  */
--static int mv64340_eth_free_tx_queue(struct net_device *dev,
--			      unsigned int eth_int_cause_ext)
-+static int mv643xx_eth_free_tx_queue(struct net_device *dev,
-+					unsigned int eth_int_cause_ext)
- {
--	struct mv64340_private *mp = netdev_priv(dev);
-+	struct mv643xx_private *mp = netdev_priv(dev);
- 	struct net_device_stats *stats = &mp->stats;
- 	struct pkt_info pkt_info;
- 	int released = 1;
-@@ -341,33 +351,36 @@
- 			stats->tx_errors++;
- 		}
- 
--		/* 
-+		/*
- 		 * If return_info is different than 0, release the skb.
- 		 * The case where return_info is not 0 is only in case
- 		 * when transmitted a scatter/gather packet, where only
- 		 * last skb releases the whole chain.
- 		 */
- 		if (pkt_info.return_info) {
--			dev_kfree_skb_irq((struct sk_buff *)
--					  pkt_info.return_info);
--			released = 0;
- 			if (skb_shinfo(pkt_info.return_info)->nr_frags)
--				pci_unmap_page(NULL, pkt_info.buf_ptr,
--					pkt_info.byte_cnt, PCI_DMA_TODEVICE);
-+				dma_unmap_page(NULL, pkt_info.buf_ptr,
-+						pkt_info.byte_cnt,
-+						DMA_TO_DEVICE);
-+			else
-+				dma_unmap_single(NULL, pkt_info.buf_ptr,
-+						pkt_info.byte_cnt,
-+						DMA_TO_DEVICE);
- 
--			if (mp->tx_ring_skbs != 1)
--				mp->tx_ring_skbs--;
--		} else 
--			pci_unmap_page(NULL, pkt_info.buf_ptr,
--					pkt_info.byte_cnt, PCI_DMA_TODEVICE);
--
--		/* 
--		 * Decrement the number of outstanding skbs counter on
--		 * the TX queue.
--		 */
--		if (mp->tx_ring_skbs == 0)
--			panic("ERROR - TX outstanding SKBs counter is corrupted");
-+			dev_kfree_skb_irq(pkt_info.return_info);
-+			released = 0;
- 
-+			/*
-+			 * Decrement the number of outstanding skbs counter on
-+			 * the TX queue.
-+			 */
-+			if (mp->tx_ring_skbs == 0)
-+				panic("ERROR - TX outstanding SKBs"
-+						" counter is corrupted");
-+			mp->tx_ring_skbs--;
-+		} else
-+			dma_unmap_page(NULL, pkt_info.buf_ptr,
-+					pkt_info.byte_cnt, DMA_TO_DEVICE);
- 	}
- 
- 	spin_unlock(&mp->lock);
-@@ -376,60 +389,59 @@
- }
- 
- /*
-- * mv64340_eth_receive
-+ * mv643xx_eth_receive
-  *
-  * This function is forward packets that are received from the port's
-  * queues toward kernel core or FastRoute them to another interface.
-  *
-- * Input : dev - a pointer to the required interface
-- *         max - maximum number to receive (0 means unlimted)
-+ * Input :	dev - a pointer to the required interface
-+ *		max - maximum number to receive (0 means unlimted)
-  *
-- * Output : number of served packets
-+ * Output :	number of served packets
-  */
--#ifdef MV64340_NAPI
--static int mv64340_eth_receive_queue(struct net_device *dev, unsigned int max,
--								int budget)
-+#ifdef MV643XX_NAPI
-+static int mv643xx_eth_receive_queue(struct net_device *dev, int budget)
- #else
--static int mv64340_eth_receive_queue(struct net_device *dev, unsigned int max)
-+static int mv643xx_eth_receive_queue(struct net_device *dev)
- #endif
- {
--	struct mv64340_private *mp = netdev_priv(dev);
-+	struct mv643xx_private *mp = netdev_priv(dev);
- 	struct net_device_stats *stats = &mp->stats;
- 	unsigned int received_packets = 0;
- 	struct sk_buff *skb;
- 	struct pkt_info pkt_info;
- 
--#ifdef MV64340_NAPI
-+#ifdef MV643XX_NAPI
- 	while (eth_port_receive(mp, &pkt_info) == ETH_OK && budget > 0) {
- #else
--	while ((--max) && eth_port_receive(mp, &pkt_info) == ETH_OK) {
-+	while (eth_port_receive(mp, &pkt_info) == ETH_OK) {
- #endif
- 		mp->rx_ring_skbs--;
- 		received_packets++;
--#ifdef MV64340_NAPI
-+#ifdef MV643XX_NAPI
- 		budget--;
- #endif
- 		/* Update statistics. Note byte count includes 4 byte CRC count */
- 		stats->rx_packets++;
- 		stats->rx_bytes += pkt_info.byte_cnt;
--		skb = (struct sk_buff *) pkt_info.return_info;
-+		skb = pkt_info.return_info;
- 		/*
- 		 * In case received a packet without first / last bits on OR
- 		 * the error summary bit is on, the packets needs to be dropeed.
- 		 */
- 		if (((pkt_info.cmd_sts
--		      & (ETH_RX_FIRST_DESC | ETH_RX_LAST_DESC)) !=
--		     (ETH_RX_FIRST_DESC | ETH_RX_LAST_DESC))
--		    || (pkt_info.cmd_sts & ETH_ERROR_SUMMARY)) {
-+				& (ETH_RX_FIRST_DESC | ETH_RX_LAST_DESC)) !=
-+					(ETH_RX_FIRST_DESC | ETH_RX_LAST_DESC))
-+				|| (pkt_info.cmd_sts & ETH_ERROR_SUMMARY)) {
- 			stats->rx_dropped++;
- 			if ((pkt_info.cmd_sts & (ETH_RX_FIRST_DESC |
--						 ETH_RX_LAST_DESC)) !=
--			    (ETH_RX_FIRST_DESC | ETH_RX_LAST_DESC)) {
-+							ETH_RX_LAST_DESC)) !=
-+				(ETH_RX_FIRST_DESC | ETH_RX_LAST_DESC)) {
- 				if (net_ratelimit())
- 					printk(KERN_ERR
--					       "%s: Received packet spread on multiple"
--					       " descriptors\n",
--					       dev->name);
-+						"%s: Received packet spread "
-+						"on multiple descriptors\n",
-+						dev->name);
- 			}
- 			if (pkt_info.cmd_sts & ETH_ERROR_SUMMARY)
- 				stats->rx_errors++;
-@@ -445,11 +457,11 @@
- 
- 			if (pkt_info.cmd_sts & ETH_LAYER_4_CHECKSUM_OK) {
- 				skb->ip_summed = CHECKSUM_UNNECESSARY;
--				skb->csum = htons((pkt_info.cmd_sts
--							& 0x0007fff8) >> 3);
-+				skb->csum = htons(
-+					(pkt_info.cmd_sts & 0x0007fff8) >> 3);
- 			}
- 			skb->protocol = eth_type_trans(skb, dev);
--#ifdef MV64340_NAPI
-+#ifdef MV643XX_NAPI
- 			netif_receive_skb(skb);
- #else
- 			netif_rx(skb);
-@@ -461,74 +473,74 @@
- }
- 
- /*
-- * mv64340_eth_int_handler
-+ * mv643xx_eth_int_handler
-  *
-  * Main interrupt handler for the gigbit ethernet ports
-  *
-- * Input : irq - irq number (not used)
-- *         dev_id - a pointer to the required interface's data structure
-- *         regs   - not used
-- * Output : N/A
-+ * Input :	irq	- irq number (not used)
-+ *		dev_id	- a pointer to the required interface's data structure
-+ *		regs	- not used
-+ * Output :	N/A
-  */
- 
--static irqreturn_t mv64340_eth_int_handler(int irq, void *dev_id,
--	struct pt_regs *regs)
-+static irqreturn_t mv643xx_eth_int_handler(int irq, void *dev_id,
-+							struct pt_regs *regs)
- {
--	struct net_device *dev = (struct net_device *) dev_id;
--	struct mv64340_private *mp = netdev_priv(dev);
-+	struct net_device *dev = (struct net_device *)dev_id;
-+	struct mv643xx_private *mp = netdev_priv(dev);
- 	u32 eth_int_cause, eth_int_cause_ext = 0;
- 	unsigned int port_num = mp->port_num;
- 
- 	/* Read interrupt cause registers */
--	eth_int_cause = MV_READ(MV64340_ETH_INTERRUPT_CAUSE_REG(port_num)) &
--			INT_CAUSE_UNMASK_ALL;
-+	eth_int_cause = mv_read(MV643XX_ETH_INTERRUPT_CAUSE_REG(port_num)) &
-+						INT_CAUSE_UNMASK_ALL;
- 
- 	if (eth_int_cause & BIT1)
--		eth_int_cause_ext =
--		MV_READ(MV64340_ETH_INTERRUPT_CAUSE_EXTEND_REG(port_num)) &
--		INT_CAUSE_UNMASK_ALL_EXT;
-+		eth_int_cause_ext = mv_read(
-+			MV643XX_ETH_INTERRUPT_CAUSE_EXTEND_REG(port_num)) &
-+						INT_CAUSE_UNMASK_ALL_EXT;
- 
--#ifdef MV64340_NAPI
-+#ifdef MV643XX_NAPI
- 	if (!(eth_int_cause & 0x0007fffd)) {
--	/* Dont ack the Rx interrupt */
-+		/* Dont ack the Rx interrupt */
- #endif
- 		/*
--	 	 * Clear specific ethernet port intrerrupt registers by
-+		 * Clear specific ethernet port intrerrupt registers by
- 		 * acknowleding relevant bits.
- 		 */
--		MV_WRITE(MV64340_ETH_INTERRUPT_CAUSE_REG(port_num),
--			 ~eth_int_cause);
-+		mv_write(MV643XX_ETH_INTERRUPT_CAUSE_REG(port_num),
-+							~eth_int_cause);
- 		if (eth_int_cause_ext != 0x0)
--			MV_WRITE(MV64340_ETH_INTERRUPT_CAUSE_EXTEND_REG(port_num),
--				 ~eth_int_cause_ext);
-+			mv_write(MV643XX_ETH_INTERRUPT_CAUSE_EXTEND_REG
-+					(port_num), ~eth_int_cause_ext);
- 
- 		/* UDP change : We may need this */
- 		if ((eth_int_cause_ext & 0x0000ffff) &&
--		    (mv64340_eth_free_tx_queue(dev, eth_int_cause_ext) == 0) &&
--		    (MV64340_TX_QUEUE_SIZE > mp->tx_ring_skbs + 1))
--                                         netif_wake_queue(dev);
--#ifdef MV64340_NAPI
-+		    (mv643xx_eth_free_tx_queue(dev, eth_int_cause_ext) == 0) &&
-+		    (mp->tx_ring_size > mp->tx_ring_skbs + MAX_DESCS_PER_SKB))
-+			netif_wake_queue(dev);
-+#ifdef MV643XX_NAPI
- 	} else {
- 		if (netif_rx_schedule_prep(dev)) {
- 			/* Mask all the interrupts */
--			MV_WRITE(MV64340_ETH_INTERRUPT_MASK_REG(port_num),0);
--			MV_WRITE(MV64340_ETH_INTERRUPT_EXTEND_MASK_REG(port_num), 0);
-+			mv_write(MV643XX_ETH_INTERRUPT_MASK_REG(port_num), 0);
-+			mv_write(MV643XX_ETH_INTERRUPT_EXTEND_MASK_REG
-+								(port_num), 0);
- 			__netif_rx_schedule(dev);
- 		}
- #else
--		{
- 		if (eth_int_cause & (BIT2 | BIT11))
--			mv64340_eth_receive_queue(dev, 0);
-+			mv643xx_eth_receive_queue(dev, 0);
- 
- 		/*
--		 * After forwarded received packets to upper layer,  add a task
-+		 * After forwarded received packets to upper layer, add a task
- 		 * in an interrupts enabled context that refills the RX ring
- 		 * with skb's.
- 		 */
--#if MV64340_RX_QUEUE_FILL_ON_TASK
-+#ifdef MV643XX_RX_QUEUE_FILL_ON_TASK
- 		/* Unmask all interrupts on ethernet port */
--		MV_WRITE(MV64340_ETH_INTERRUPT_MASK_REG(port_num),
--		         INT_CAUSE_MASK_ALL);
-+		mv_write(MV643XX_ETH_INTERRUPT_MASK_REG(port_num),
-+							INT_CAUSE_MASK_ALL);
- 		queue_task(&mp->rx_task, &tq_immediate);
- 		mark_bh(IMMEDIATE_BH);
- #else
-@@ -538,25 +550,15 @@
- 	}
- 	/* PHY status changed */
- 	if (eth_int_cause_ext & (BIT16 | BIT20)) {
--		unsigned int phy_reg_data;
--
--		/* Check Link status on ethernet port */
--		eth_port_read_smi_reg(port_num, 1, &phy_reg_data);
--		if (!(phy_reg_data & 0x20)) {
--			netif_stop_queue(dev);
--		} else {
-+		if (eth_port_link_is_up(port_num)) {
-+			netif_carrier_on(dev);
- 			netif_wake_queue(dev);
--
--			/*
--			 * Start all TX queues on ethernet port. This is good in
--			 * case of previous packets where not transmitted, due
--			 * to link down and this command re-enables all TX
--			 * queues.
--			 * Note that it is possible to get a TX resource error
--			 * interrupt after issuing this, since not all TX queues
--			 * are enabled, or has anything to send.
--			 */
--			MV_WRITE(MV64340_ETH_TRANSMIT_QUEUE_COMMAND_REG(port_num), 1);
-+			/* Start TX queue */
-+			mv_write(MV643XX_ETH_TRANSMIT_QUEUE_COMMAND_REG
-+								(port_num), 1);
-+		} else {
-+			netif_carrier_off(dev);
-+			netif_stop_queue(dev);
- 		}
- 	}
- 
-@@ -570,7 +572,7 @@
- 	return IRQ_HANDLED;
- }
- 
--#ifdef MV64340_COAL
-+#ifdef MV643XX_COAL
- 
- /*
-  * eth_port_set_rx_coal - Sets coalescing interrupt mechanism on RX path
-@@ -584,9 +586,9 @@
-  *	, and the required delay of the interrupt in usec.
-  *
-  * INPUT:
-- *	unsigned int eth_port_num      Ethernet port number
-- *	unsigned int t_clk        t_clk of the MV-643xx chip in HZ units
-- *	unsigned int delay       Delay in usec
-+ *	unsigned int eth_port_num	Ethernet port number
-+ *	unsigned int t_clk		t_clk of the MV-643xx chip in HZ units
-+ *	unsigned int delay		Delay in usec
-  *
-  * OUTPUT:
-  *	Interrupt coalescing mechanism value is set in MV-643xx chip.
-@@ -596,15 +598,15 @@
-  *
-  */
- static unsigned int eth_port_set_rx_coal(unsigned int eth_port_num,
--	unsigned int t_clk, unsigned int delay)
-+					unsigned int t_clk, unsigned int delay)
- {
- 	unsigned int coal = ((t_clk / 1000000) * delay) / 64;
- 
- 	/* Set RX Coalescing mechanism */
--	MV_WRITE(MV64340_ETH_SDMA_CONFIG_REG(eth_port_num),
--		 ((coal & 0x3fff) << 8) |
--		 (MV_READ(MV64340_ETH_SDMA_CONFIG_REG(eth_port_num))
--		  & 0xffc000ff));
-+	mv_write(MV643XX_ETH_SDMA_CONFIG_REG(eth_port_num),
-+		((coal & 0x3fff) << 8) |
-+		(mv_read(MV643XX_ETH_SDMA_CONFIG_REG(eth_port_num))
-+			& 0xffc000ff));
- 
- 	return coal;
- }
-@@ -618,13 +620,13 @@
-  *	This parameter is a timeout counter, that counts in 64 t_clk
-  *	chunks ; that when timeout event occurs a maskable interrupt
-  *	occurs.
-- *	The parameter is calculated using the t_cLK frequency of the 
-+ *	The parameter is calculated using the t_cLK frequency of the
-  *	MV-643xx chip and the required delay in the interrupt in uSec
-  *
-  * INPUT:
-- *	unsigned int eth_port_num      Ethernet port number
-- *	unsigned int t_clk        t_clk of the MV-643xx chip in HZ units
-- *	unsigned int delay       Delay in uSeconds
-+ *	unsigned int eth_port_num	Ethernet port number
-+ *	unsigned int t_clk		t_clk of the MV-643xx chip in HZ units
-+ *	unsigned int delay		Delay in uSeconds
-  *
-  * OUTPUT:
-  *	Interrupt coalescing mechanism value is set in MV-643xx chip.
-@@ -634,48 +636,48 @@
-  *
-  */
- static unsigned int eth_port_set_tx_coal(unsigned int eth_port_num,
--	unsigned int t_clk, unsigned int delay)
-+					unsigned int t_clk, unsigned int delay)
- {
- 	unsigned int coal;
- 	coal = ((t_clk / 1000000) * delay) / 64;
- 	/* Set TX Coalescing mechanism */
--	MV_WRITE(MV64340_ETH_TX_FIFO_URGENT_THRESHOLD_REG(eth_port_num),
--		 coal << 4);
-+	mv_write(MV643XX_ETH_TX_FIFO_URGENT_THRESHOLD_REG(eth_port_num),
-+								coal << 4);
- 	return coal;
- }
- 
- /*
-- * mv64340_eth_open
-+ * mv643xx_eth_open
-  *
-  * This function is called when openning the network device. The function
-  * should initialize all the hardware, initialize cyclic Rx/Tx
-  * descriptors chain and buffers and allocate an IRQ to the network
-  * device.
-  *
-- * Input : a pointer to the network device structure
-+ * Input :	a pointer to the network device structure
-  *
-- * Output : zero of success , nonzero if fails.
-+ * Output :	zero of success , nonzero if fails.
-  */
- 
--static int mv64340_eth_open(struct net_device *dev)
-+static int mv643xx_eth_open(struct net_device *dev)
- {
--	struct mv64340_private *mp = netdev_priv(dev);
-+	struct mv643xx_private *mp = netdev_priv(dev);
- 	unsigned int port_num = mp->port_num;
--	int err = err;
-+	int err;
- 
- 	spin_lock_irq(&mp->lock);
- 
--	err = request_irq(dev->irq, mv64340_eth_int_handler,
--	                  SA_INTERRUPT | SA_SAMPLE_RANDOM, dev->name, dev);
-+	err = request_irq(dev->irq, mv643xx_eth_int_handler,
-+		SA_SHIRQ | SA_SAMPLE_RANDOM, dev->name, dev);
- 
- 	if (err) {
--		printk(KERN_ERR "Can not assign IRQ number to MV64340_eth%d\n",
--		       port_num);
-+		printk(KERN_ERR "Can not assign IRQ number to MV643XX_eth%d\n",
-+								port_num);
- 		err = -EAGAIN;
- 		goto out;
- 	}
- 
--	if (mv64340_eth_real_open(dev)) {
-+	if (mv643xx_eth_real_open(dev)) {
- 		printk("%s: Error opening interface\n", dev->name);
- 		err = -EBUSY;
- 		goto out_free;
-@@ -698,66 +700,35 @@
-  * ether_init_rx_desc_ring - Curve a Rx chain desc list and buffer in memory.
-  *
-  * DESCRIPTION:
-- *       This function prepares a Rx chained list of descriptors and packet 
-- *       buffers in a form of a ring. The routine must be called after port 
-- *       initialization routine and before port start routine. 
-- *       The Ethernet SDMA engine uses CPU bus addresses to access the various 
-- *       devices in the system (i.e. DRAM). This function uses the ethernet 
-- *       struct 'virtual to physical' routine (set by the user) to set the ring 
-- *       with physical addresses.
-+ *	This function prepares a Rx chained list of descriptors and packet
-+ *	buffers in a form of a ring. The routine must be called after port
-+ *	initialization routine and before port start routine.
-+ *	The Ethernet SDMA engine uses CPU bus addresses to access the various
-+ *	devices in the system (i.e. DRAM). This function uses the ethernet
-+ *	struct 'virtual to physical' routine (set by the user) to set the ring
-+ *	with physical addresses.
-  *
-  * INPUT:
-- *	struct mv64340_private   *mp   Ethernet Port Control srtuct. 
-- *      int 			rx_desc_num       Number of Rx descriptors
-- *      int 			rx_buff_size      Size of Rx buffer
-- *      unsigned int    rx_desc_base_addr  Rx descriptors memory area base addr.
-- *      unsigned int    rx_buff_base_addr  Rx buffer memory area base addr.
-+ *	struct mv643xx_private *mp	Ethernet Port Control srtuct.
-  *
-  * OUTPUT:
-- *      The routine updates the Ethernet port control struct with information 
-- *      regarding the Rx descriptors and buffers.
-+ *	The routine updates the Ethernet port control struct with information
-+ *	regarding the Rx descriptors and buffers.
-  *
-  * RETURN:
-- *      false if the given descriptors memory area is not aligned according to
-- *      Ethernet SDMA specifications.
-- *      true otherwise.
-+ *	None.
-  */
--static int ether_init_rx_desc_ring(struct mv64340_private * mp,
--	unsigned long rx_buff_base_addr)
-+static void ether_init_rx_desc_ring(struct mv643xx_private *mp)
- {
--	unsigned long buffer_addr = rx_buff_base_addr;
- 	volatile struct eth_rx_desc *p_rx_desc;
- 	int rx_desc_num = mp->rx_ring_size;
--	unsigned long rx_desc_base_addr = (unsigned long) mp->p_rx_desc_area;
--	int rx_buff_size = 1536;	/* Dummy, will be replaced later */
- 	int i;
- 
--	p_rx_desc = (struct eth_rx_desc *) rx_desc_base_addr;
--
--	/* Rx desc Must be 4LW aligned (i.e. Descriptor_Address[3:0]=0000). */
--	if (rx_buff_base_addr & 0xf)
--		return 0;
--
--	/* Rx buffers are limited to 64K bytes and Minimum size is 8 bytes  */
--	if ((rx_buff_size < 8) || (rx_buff_size > RX_BUFFER_MAX_SIZE))
--		return 0;
--
--	/* Rx buffers must be 64-bit aligned.       */
--	if ((rx_buff_base_addr + rx_buff_size) & 0x7)
--		return 0;
--
--	/* initialize the Rx descriptors ring */
-+	/* initialize the next_desc_ptr links in the Rx descriptors ring */
-+	p_rx_desc = (struct eth_rx_desc *)mp->p_rx_desc_area;
- 	for (i = 0; i < rx_desc_num; i++) {
--		p_rx_desc[i].buf_size = rx_buff_size;
--		p_rx_desc[i].byte_cnt = 0x0000;
--		p_rx_desc[i].cmd_sts =
--			ETH_BUFFER_OWNED_BY_DMA | ETH_RX_ENABLE_INTERRUPT;
- 		p_rx_desc[i].next_desc_ptr = mp->rx_desc_dma +
- 			((i + 1) % rx_desc_num) * sizeof(struct eth_rx_desc);
--		p_rx_desc[i].buf_ptr = buffer_addr;
--
--		mp->rx_skb[i] = NULL;
--		buffer_addr += rx_buff_size;
- 	}
- 
- 	/* Save Rx desc pointer to driver struct. */
-@@ -766,293 +737,288 @@
- 
- 	mp->rx_desc_area_size = rx_desc_num * sizeof(struct eth_rx_desc);
- 
-+	/* Add the queue to the list of RX queues of this port */
- 	mp->port_rx_queue_command |= 1;
--
--	return 1;
- }
- 
- /*
-  * ether_init_tx_desc_ring - Curve a Tx chain desc list and buffer in memory.
-  *
-  * DESCRIPTION:
-- *       This function prepares a Tx chained list of descriptors and packet 
-- *       buffers in a form of a ring. The routine must be called after port 
-- *       initialization routine and before port start routine. 
-- *       The Ethernet SDMA engine uses CPU bus addresses to access the various 
-- *       devices in the system (i.e. DRAM). This function uses the ethernet 
-- *       struct 'virtual to physical' routine (set by the user) to set the ring 
-- *       with physical addresses.
-+ *	This function prepares a Tx chained list of descriptors and packet
-+ *	buffers in a form of a ring. The routine must be called after port
-+ *	initialization routine and before port start routine.
-+ *	The Ethernet SDMA engine uses CPU bus addresses to access the various
-+ *	devices in the system (i.e. DRAM). This function uses the ethernet
-+ *	struct 'virtual to physical' routine (set by the user) to set the ring
-+ *	with physical addresses.
-  *
-  * INPUT:
-- *	struct mv64340_private   *mp   Ethernet Port Control srtuct. 
-- *      int 		tx_desc_num        Number of Tx descriptors
-- *      int 		tx_buff_size	   Size of Tx buffer
-- *      unsigned int    tx_desc_base_addr  Tx descriptors memory area base addr.
-+ *	struct mv643xx_private *mp	Ethernet Port Control srtuct.
-  *
-  * OUTPUT:
-- *      The routine updates the Ethernet port control struct with information 
-- *      regarding the Tx descriptors and buffers.
-+ *	The routine updates the Ethernet port control struct with information
-+ *	regarding the Tx descriptors and buffers.
-  *
-  * RETURN:
-- *      false if the given descriptors memory area is not aligned according to
-- *      Ethernet SDMA specifications.
-- *      true otherwise.
-+ *	None.
-  */
--static int ether_init_tx_desc_ring(struct mv64340_private *mp)
-+static void ether_init_tx_desc_ring(struct mv643xx_private *mp)
- {
--	unsigned long tx_desc_base_addr = (unsigned long) mp->p_tx_desc_area;
- 	int tx_desc_num = mp->tx_ring_size;
- 	struct eth_tx_desc *p_tx_desc;
- 	int i;
- 
--	/* Tx desc Must be 4LW aligned (i.e. Descriptor_Address[3:0]=0000). */
--	if (tx_desc_base_addr & 0xf)
--		return 0;
--
--	/* save the first desc pointer to link with the last descriptor */
--	p_tx_desc = (struct eth_tx_desc *) tx_desc_base_addr;
--
--	/* Initialize the Tx descriptors ring */
-+	/* Initialize the next_desc_ptr links in the Tx descriptors ring */
-+	p_tx_desc = (struct eth_tx_desc *)mp->p_tx_desc_area;
- 	for (i = 0; i < tx_desc_num; i++) {
--		p_tx_desc[i].byte_cnt	= 0x0000;
--		p_tx_desc[i].l4i_chk	= 0x0000;
--		p_tx_desc[i].cmd_sts	= 0x00000000;
- 		p_tx_desc[i].next_desc_ptr = mp->tx_desc_dma +
- 			((i + 1) % tx_desc_num) * sizeof(struct eth_tx_desc);
--		p_tx_desc[i].buf_ptr	= 0x00000000;
--		mp->tx_skb[i]		= NULL;
- 	}
- 
--	/* Set Tx desc pointer in driver struct. */
- 	mp->tx_curr_desc_q = 0;
- 	mp->tx_used_desc_q = 0;
--#ifdef MV64340_CHECKSUM_OFFLOAD_TX
--        mp->tx_first_desc_q = 0;
-+#ifdef MV643XX_CHECKSUM_OFFLOAD_TX
-+	mp->tx_first_desc_q = 0;
- #endif
--	/* Init Tx ring base and size parameters */
--	mp->tx_desc_area_size	= tx_desc_num * sizeof(struct eth_tx_desc);
-+
-+	mp->tx_desc_area_size = tx_desc_num * sizeof(struct eth_tx_desc);
- 
- 	/* Add the queue to the list of Tx queues of this port */
- 	mp->port_tx_queue_command |= 1;
--
--	return 1;
- }
- 
--/* Helper function for mv64340_eth_open */
--static int mv64340_eth_real_open(struct net_device *dev)
-+/* Helper function for mv643xx_eth_open */
-+static int mv643xx_eth_real_open(struct net_device *dev)
- {
--	struct mv64340_private *mp = netdev_priv(dev);
-+	struct mv643xx_private *mp = netdev_priv(dev);
- 	unsigned int port_num = mp->port_num;
--	u32 phy_reg_data;
- 	unsigned int size;
- 
- 	/* Stop RX Queues */
--	MV_WRITE(MV64340_ETH_RECEIVE_QUEUE_COMMAND_REG(port_num),
--		 0x0000ff00);
-+	mv_write(MV643XX_ETH_RECEIVE_QUEUE_COMMAND_REG(port_num), 0x0000ff00);
- 
- 	/* Clear the ethernet port interrupts */
--	MV_WRITE(MV64340_ETH_INTERRUPT_CAUSE_REG(port_num), 0);
--	MV_WRITE(MV64340_ETH_INTERRUPT_CAUSE_EXTEND_REG(port_num), 0);
-+	mv_write(MV643XX_ETH_INTERRUPT_CAUSE_REG(port_num), 0);
-+	mv_write(MV643XX_ETH_INTERRUPT_CAUSE_EXTEND_REG(port_num), 0);
- 
- 	/* Unmask RX buffer and TX end interrupt */
--	MV_WRITE(MV64340_ETH_INTERRUPT_MASK_REG(port_num),
--		 INT_CAUSE_UNMASK_ALL);
-+	mv_write(MV643XX_ETH_INTERRUPT_MASK_REG(port_num),
-+						INT_CAUSE_UNMASK_ALL);
- 
- 	/* Unmask phy and link status changes interrupts */
--	MV_WRITE(MV64340_ETH_INTERRUPT_EXTEND_MASK_REG(port_num),
--		 INT_CAUSE_UNMASK_ALL_EXT);
-+	mv_write(MV643XX_ETH_INTERRUPT_EXTEND_MASK_REG(port_num),
-+						INT_CAUSE_UNMASK_ALL_EXT);
- 
- 	/* Set the MAC Address */
- 	memcpy(mp->port_mac_addr, dev->dev_addr, 6);
- 
- 	eth_port_init(mp);
- 
--	INIT_WORK(&mp->rx_task, (void (*)(void *)) mv64340_eth_rx_task, dev);
-+	INIT_WORK(&mp->rx_task, (void (*)(void *))mv643xx_eth_rx_task, dev);
- 
- 	memset(&mp->timeout, 0, sizeof(struct timer_list));
--	mp->timeout.function = mv64340_eth_rx_task_timer_wrapper;
--	mp->timeout.data = (unsigned long) dev;
-+	mp->timeout.function = mv643xx_eth_rx_task_timer_wrapper;
-+	mp->timeout.data = (unsigned long)dev;
- 
- 	mp->rx_task_busy = 0;
- 	mp->rx_timer_flag = 0;
- 
-+	/* Allocate RX and TX skb rings */
-+	mp->rx_skb = kmalloc(sizeof(*mp->rx_skb) * mp->rx_ring_size,
-+								GFP_KERNEL);
-+	if (!mp->rx_skb) {
-+		printk(KERN_ERR "%s: Cannot allocate Rx skb ring\n", dev->name);
-+		return -ENOMEM;
-+	}
-+	mp->tx_skb = kmalloc(sizeof(*mp->tx_skb) * mp->tx_ring_size,
-+								GFP_KERNEL);
-+	if (!mp->tx_skb) {
-+		printk(KERN_ERR "%s: Cannot allocate Tx skb ring\n", dev->name);
-+		kfree(mp->rx_skb);
-+		return -ENOMEM;
-+	}
-+
- 	/* Allocate TX ring */
- 	mp->tx_ring_skbs = 0;
--	mp->tx_ring_size = MV64340_TX_QUEUE_SIZE;
- 	size = mp->tx_ring_size * sizeof(struct eth_tx_desc);
- 	mp->tx_desc_area_size = size;
- 
--	/* Assumes allocated ring is 16 bytes alligned */
--	mp->p_tx_desc_area = pci_alloc_consistent(NULL, size, &mp->tx_desc_dma);
-+	if (mp->tx_sram_size) {
-+		mp->p_tx_desc_area = ioremap(mp->tx_sram_addr,
-+							mp->tx_sram_size);
-+		mp->tx_desc_dma = mp->tx_sram_addr;
-+	} else
-+		mp->p_tx_desc_area = dma_alloc_coherent(NULL, size,
-+							&mp->tx_desc_dma,
-+							GFP_KERNEL);
-+
- 	if (!mp->p_tx_desc_area) {
- 		printk(KERN_ERR "%s: Cannot allocate Tx Ring (size %d bytes)\n",
--		       dev->name, size);
-+							dev->name, size);
-+		kfree(mp->rx_skb);
-+		kfree(mp->tx_skb);
- 		return -ENOMEM;
- 	}
--	memset((void *) mp->p_tx_desc_area, 0, mp->tx_desc_area_size);
-+	BUG_ON((u32) mp->p_tx_desc_area & 0xf);	/* check 16-byte alignment */
-+	memset((void *)mp->p_tx_desc_area, 0, mp->tx_desc_area_size);
- 
--	/* Dummy will be replaced upon real tx */
- 	ether_init_tx_desc_ring(mp);
- 
- 	/* Allocate RX ring */
--	/* Meantime RX Ring are fixed - but must be configurable by user */
--	mp->rx_ring_size = MV64340_RX_QUEUE_SIZE;
- 	mp->rx_ring_skbs = 0;
- 	size = mp->rx_ring_size * sizeof(struct eth_rx_desc);
- 	mp->rx_desc_area_size = size;
- 
--	/* Assumes allocated ring is 16 bytes aligned */
--
--	mp->p_rx_desc_area = pci_alloc_consistent(NULL, size, &mp->rx_desc_dma);
-+	if (mp->rx_sram_size) {
-+		mp->p_rx_desc_area = ioremap(mp->rx_sram_addr,
-+							mp->rx_sram_size);
-+		mp->rx_desc_dma = mp->rx_sram_addr;
-+	} else
-+		mp->p_rx_desc_area = dma_alloc_coherent(NULL, size,
-+							&mp->rx_desc_dma,
-+							GFP_KERNEL);
- 
- 	if (!mp->p_rx_desc_area) {
- 		printk(KERN_ERR "%s: Cannot allocate Rx ring (size %d bytes)\n",
--		       dev->name, size);
-+							dev->name, size);
- 		printk(KERN_ERR "%s: Freeing previously allocated TX queues...",
--		       dev->name);
--		pci_free_consistent(0, mp->tx_desc_area_size,
--				    (void *) mp->p_tx_desc_area,
--				    mp->tx_desc_dma);
-+							dev->name);
-+		if (mp->rx_sram_size)
-+			iounmap(mp->p_rx_desc_area);
-+		else
-+			dma_free_coherent(NULL, mp->tx_desc_area_size,
-+					mp->p_tx_desc_area, mp->tx_desc_dma);
-+		kfree(mp->rx_skb);
-+		kfree(mp->tx_skb);
- 		return -ENOMEM;
- 	}
--	memset(mp->p_rx_desc_area, 0, size);
-+	memset((void *)mp->p_rx_desc_area, 0, size);
- 
--	if (!(ether_init_rx_desc_ring(mp, 0)))
--		panic("%s: Error initializing RX Ring", dev->name);
-+	ether_init_rx_desc_ring(mp);
- 
--	mv64340_eth_rx_task(dev);	/* Fill RX ring with skb's */
-+	mv643xx_eth_rx_task(dev);	/* Fill RX ring with skb's */
- 
- 	eth_port_start(mp);
- 
- 	/* Interrupt Coalescing */
- 
--#ifdef MV64340_COAL
-+#ifdef MV643XX_COAL
- 	mp->rx_int_coal =
--		eth_port_set_rx_coal(port_num, 133000000, MV64340_RX_COAL);
-+		eth_port_set_rx_coal(port_num, 133000000, MV643XX_RX_COAL);
- #endif
- 
- 	mp->tx_int_coal =
--		eth_port_set_tx_coal (port_num, 133000000, MV64340_TX_COAL);  
-+		eth_port_set_tx_coal(port_num, 133000000, MV643XX_TX_COAL);
- 
--	/* Increase the Rx side buffer size */
--
--	MV_WRITE (MV64340_ETH_PORT_SERIAL_CONTROL_REG(port_num), (0x5 << 17) |
--			(MV_READ(MV64340_ETH_PORT_SERIAL_CONTROL_REG(port_num))
--					& 0xfff1ffff));
--
--	/* Check Link status on phy */
--	eth_port_read_smi_reg(port_num, 1, &phy_reg_data);
--	if (!(phy_reg_data & 0x20))
--		netif_stop_queue(dev);
--	else
--		netif_start_queue(dev);
-+	netif_start_queue(dev);
- 
- 	return 0;
- }
- 
--static void mv64340_eth_free_tx_rings(struct net_device *dev)
-+static void mv643xx_eth_free_tx_rings(struct net_device *dev)
- {
--	struct mv64340_private *mp = netdev_priv(dev);
-+	struct mv643xx_private *mp = netdev_priv(dev);
- 	unsigned int port_num = mp->port_num;
- 	unsigned int curr;
- 
- 	/* Stop Tx Queues */
--	MV_WRITE(MV64340_ETH_TRANSMIT_QUEUE_COMMAND_REG(port_num),
--		 0x0000ff00);
-+	mv_write(MV643XX_ETH_TRANSMIT_QUEUE_COMMAND_REG(port_num), 0x0000ff00);
- 
--	/* Free TX rings */
- 	/* Free outstanding skb's on TX rings */
--	for (curr = 0;
--	     (mp->tx_ring_skbs) && (curr < MV64340_TX_QUEUE_SIZE);
--	     curr++) {
-+	for (curr = 0; mp->tx_ring_skbs && curr < mp->tx_ring_size; curr++) {
- 		if (mp->tx_skb[curr]) {
- 			dev_kfree_skb(mp->tx_skb[curr]);
- 			mp->tx_ring_skbs--;
- 		}
- 	}
--	if (mp->tx_ring_skbs != 0)
-+	if (mp->tx_ring_skbs)
- 		printk("%s: Error on Tx descriptor free - could not free %d"
--		     " descriptors\n", dev->name,
--		     mp->tx_ring_skbs);
--	pci_free_consistent(0, mp->tx_desc_area_size,
--			    (void *) mp->p_tx_desc_area, mp->tx_desc_dma);
-+				" descriptors\n", dev->name, mp->tx_ring_skbs);
-+
-+	/* Free TX ring */
-+	if (mp->tx_sram_size)
-+		iounmap(mp->p_tx_desc_area);
-+	else
-+		dma_free_coherent(NULL, mp->tx_desc_area_size,
-+				mp->p_tx_desc_area, mp->tx_desc_dma);
- }
- 
--static void mv64340_eth_free_rx_rings(struct net_device *dev)
-+static void mv643xx_eth_free_rx_rings(struct net_device *dev)
- {
--	struct mv64340_private *mp = netdev_priv(dev);
-+	struct mv643xx_private *mp = netdev_priv(dev);
- 	unsigned int port_num = mp->port_num;
- 	int curr;
- 
- 	/* Stop RX Queues */
--	MV_WRITE(MV64340_ETH_RECEIVE_QUEUE_COMMAND_REG(port_num),
--		 0x0000ff00);
-+	mv_write(MV643XX_ETH_RECEIVE_QUEUE_COMMAND_REG(port_num), 0x0000ff00);
- 
--	/* Free RX rings */
- 	/* Free preallocated skb's on RX rings */
--	for (curr = 0;
--		mp->rx_ring_skbs && (curr < MV64340_RX_QUEUE_SIZE);
--		curr++) {
-+	for (curr = 0; mp->rx_ring_skbs && curr < mp->rx_ring_size; curr++) {
- 		if (mp->rx_skb[curr]) {
- 			dev_kfree_skb(mp->rx_skb[curr]);
- 			mp->rx_ring_skbs--;
- 		}
- 	}
- 
--	if (mp->rx_ring_skbs != 0)
-+	if (mp->rx_ring_skbs)
- 		printk(KERN_ERR
--		       "%s: Error in freeing Rx Ring. %d skb's still"
--		       " stuck in RX Ring - ignoring them\n", dev->name,
--		       mp->rx_ring_skbs);
--	pci_free_consistent(0, mp->rx_desc_area_size,
--			    (void *) mp->p_rx_desc_area,
--			    mp->rx_desc_dma);
-+			"%s: Error in freeing Rx Ring. %d skb's still"
-+			" stuck in RX Ring - ignoring them\n", dev->name,
-+			mp->rx_ring_skbs);
-+	/* Free RX ring */
-+	if (mp->rx_sram_size)
-+		iounmap(mp->p_rx_desc_area);
-+	else
-+		dma_free_coherent(NULL, mp->rx_desc_area_size,
-+				mp->p_rx_desc_area, mp->rx_desc_dma);
- }
- 
- /*
-- * mv64340_eth_stop
-+ * mv643xx_eth_stop
-  *
-- * This function is used when closing the network device. 
-- * It updates the hardware, 
-+ * This function is used when closing the network device.
-+ * It updates the hardware,
-  * release all memory that holds buffers and descriptors and release the IRQ.
-- * Input : a pointer to the device structure
-- * Output : zero if success , nonzero if fails
-+ * Input :	a pointer to the device structure
-+ * Output :	zero if success , nonzero if fails
-  */
- 
--/* Helper function for mv64340_eth_stop */
-+/* Helper function for mv643xx_eth_stop */
- 
--static int mv64340_eth_real_stop(struct net_device *dev)
-+static int mv643xx_eth_real_stop(struct net_device *dev)
- {
--	struct mv64340_private *mp = netdev_priv(dev);
-+	struct mv643xx_private *mp = netdev_priv(dev);
- 	unsigned int port_num = mp->port_num;
- 
-+	netif_carrier_off(dev);
- 	netif_stop_queue(dev);
- 
--	mv64340_eth_free_tx_rings(dev);
--	mv64340_eth_free_rx_rings(dev);
-+	mv643xx_eth_free_tx_rings(dev);
-+	mv643xx_eth_free_rx_rings(dev);
- 
- 	eth_port_reset(mp->port_num);
- 
- 	/* Disable ethernet port interrupts */
--	MV_WRITE(MV64340_ETH_INTERRUPT_CAUSE_REG(port_num), 0);
--	MV_WRITE(MV64340_ETH_INTERRUPT_CAUSE_EXTEND_REG(port_num), 0);
-+	mv_write(MV643XX_ETH_INTERRUPT_CAUSE_REG(port_num), 0);
-+	mv_write(MV643XX_ETH_INTERRUPT_CAUSE_EXTEND_REG(port_num), 0);
- 
- 	/* Mask RX buffer and TX end interrupt */
--	MV_WRITE(MV64340_ETH_INTERRUPT_MASK_REG(port_num), 0);
-+	mv_write(MV643XX_ETH_INTERRUPT_MASK_REG(port_num), 0);
- 
- 	/* Mask phy and link status changes interrupts */
--	MV_WRITE(MV64340_ETH_INTERRUPT_EXTEND_MASK_REG(port_num), 0);
-+	mv_write(MV643XX_ETH_INTERRUPT_EXTEND_MASK_REG(port_num), 0);
- 
- 	return 0;
- }
- 
--static int mv64340_eth_stop(struct net_device *dev)
-+static int mv643xx_eth_stop(struct net_device *dev)
- {
--	struct mv64340_private *mp = netdev_priv(dev);
-+	struct mv643xx_private *mp = netdev_priv(dev);
- 
- 	spin_lock_irq(&mp->lock);
- 
--	mv64340_eth_real_stop(dev);
-+	mv643xx_eth_real_stop(dev);
- 
- 	free_irq(dev->irq, dev);
- 	spin_unlock_irq(&mp->lock);
-@@ -1060,59 +1026,64 @@
- 	return 0;
- }
- 
--#ifdef MV64340_NAPI
--static void mv64340_tx(struct net_device *dev)
-+#ifdef MV643XX_NAPI
-+static void mv643xx_tx(struct net_device *dev)
- {
--	struct mv64340_private *mp = netdev_priv(dev);
--        struct pkt_info pkt_info;
-+	struct mv643xx_private *mp = netdev_priv(dev);
-+	struct pkt_info pkt_info;
- 
- 	while (eth_tx_return_desc(mp, &pkt_info) == ETH_OK) {
- 		if (pkt_info.return_info) {
--			dev_kfree_skb_irq((struct sk_buff *)
--                                                  pkt_info.return_info);
--			if (skb_shinfo(pkt_info.return_info)->nr_frags) 
--                                 pci_unmap_page(NULL, pkt_info.buf_ptr,
--                                             pkt_info.byte_cnt,
--                                             PCI_DMA_TODEVICE);
--
--                         if (mp->tx_ring_skbs != 1)
--                                  mp->tx_ring_skbs--;
--                } else 
--                       pci_unmap_page(NULL, pkt_info.buf_ptr, pkt_info.byte_cnt,
--                                      PCI_DMA_TODEVICE);
-+			if (skb_shinfo(pkt_info.return_info)->nr_frags)
-+				dma_unmap_page(NULL, pkt_info.buf_ptr,
-+						pkt_info.byte_cnt,
-+						DMA_TO_DEVICE);
-+			else
-+				dma_unmap_single(NULL, pkt_info.buf_ptr,
-+						pkt_info.byte_cnt,
-+						DMA_TO_DEVICE);
-+
-+			dev_kfree_skb_irq(pkt_info.return_info);
-+
-+			if (mp->tx_ring_skbs)
-+				mp->tx_ring_skbs--;
-+		} else
-+			dma_unmap_page(NULL, pkt_info.buf_ptr,
-+					pkt_info.byte_cnt, DMA_TO_DEVICE);
- 	}
- 
- 	if (netif_queue_stopped(dev) &&
--            MV64340_TX_QUEUE_SIZE > mp->tx_ring_skbs + 1)
--                       netif_wake_queue(dev);
-+			mp->tx_ring_size > mp->tx_ring_skbs + MAX_DESCS_PER_SKB)
-+		netif_wake_queue(dev);
- }
- 
- /*
-- * mv64340_poll
-+ * mv643xx_poll
-  *
-  * This function is used in case of NAPI
-  */
--static int mv64340_poll(struct net_device *dev, int *budget)
-+static int mv643xx_poll(struct net_device *dev, int *budget)
- {
--	struct mv64340_private *mp = netdev_priv(dev);
--	int	done = 1, orig_budget, work_done;
-+	struct mv643xx_private *mp = netdev_priv(dev);
-+	int done = 1, orig_budget, work_done;
- 	unsigned int port_num = mp->port_num;
- 	unsigned long flags;
- 
--#ifdef MV64340_TX_FAST_REFILL
-+#ifdef MV643XX_TX_FAST_REFILL
- 	if (++mp->tx_clean_threshold > 5) {
- 		spin_lock_irqsave(&mp->lock, flags);
--		mv64340_tx(dev);
-+		mv643xx_tx(dev);
- 		mp->tx_clean_threshold = 0;
- 		spin_unlock_irqrestore(&mp->lock, flags);
- 	}
- #endif
- 
--	if ((u32)(MV_READ(MV64340_ETH_RX_CURRENT_QUEUE_DESC_PTR_0(port_num)))                                      != (u32)mp->rx_used_desc_q) {
-+	if ((mv_read(MV643XX_ETH_RX_CURRENT_QUEUE_DESC_PTR_0(port_num)))
-+						!= (u32) mp->rx_used_desc_q) {
- 		orig_budget = *budget;
- 		if (orig_budget > dev->quota)
- 			orig_budget = dev->quota;
--		work_done = mv64340_eth_receive_queue(dev, 0, orig_budget);
-+		work_done = mv643xx_eth_receive_queue(dev, orig_budget);
- 		mp->rx_task.func(dev);
- 		*budget -= work_done;
- 		dev->quota -= work_done;
-@@ -1123,12 +1094,12 @@
- 	if (done) {
- 		spin_lock_irqsave(&mp->lock, flags);
- 		__netif_rx_complete(dev);
--		MV_WRITE(MV64340_ETH_INTERRUPT_CAUSE_REG(port_num),0);
--                MV_WRITE(MV64340_ETH_INTERRUPT_CAUSE_EXTEND_REG(port_num),0);
--		MV_WRITE(MV64340_ETH_INTERRUPT_MASK_REG(port_num), 
-+		mv_write(MV643XX_ETH_INTERRUPT_CAUSE_REG(port_num), 0);
-+		mv_write(MV643XX_ETH_INTERRUPT_CAUSE_EXTEND_REG(port_num), 0);
-+		mv_write(MV643XX_ETH_INTERRUPT_MASK_REG(port_num),
- 						INT_CAUSE_UNMASK_ALL);
--		MV_WRITE(MV64340_ETH_INTERRUPT_EXTEND_MASK_REG(port_num),
--				                 INT_CAUSE_UNMASK_ALL_EXT);
-+		mv_write(MV643XX_ETH_INTERRUPT_EXTEND_MASK_REG(port_num),
-+						INT_CAUSE_UNMASK_ALL_EXT);
- 		spin_unlock_irqrestore(&mp->lock, flags);
- 	}
- 
-@@ -1137,19 +1108,19 @@
- #endif
- 
- /*
-- * mv64340_eth_start_xmit
-+ * mv643xx_eth_start_xmit
-  *
-- * This function is queues a packet in the Tx descriptor for 
-+ * This function is queues a packet in the Tx descriptor for
-  * required port.
-  *
-- * Input : skb - a pointer to socket buffer
-- *         dev - a pointer to the required port
-+ * Input :	skb - a pointer to socket buffer
-+ *		dev - a pointer to the required port
-  *
-- * Output : zero upon success
-+ * Output :	zero upon success
-  */
--static int mv64340_eth_start_xmit(struct sk_buff *skb, struct net_device *dev)
-+static int mv643xx_eth_start_xmit(struct sk_buff *skb, struct net_device *dev)
- {
--	struct mv64340_private *mp = netdev_priv(dev);
-+	struct mv643xx_private *mp = netdev_priv(dev);
- 	struct net_device_stats *stats = &mp->stats;
- 	ETH_FUNC_RET_STATUS status;
- 	unsigned long flags;
-@@ -1157,119 +1128,195 @@
- 
- 	if (netif_queue_stopped(dev)) {
- 		printk(KERN_ERR
--		       "%s: Tried sending packet when interface is stopped\n",
--		       dev->name);
-+			"%s: Tried sending packet when interface is stopped\n",
-+			dev->name);
- 		return 1;
- 	}
- 
- 	/* This is a hard error, log it. */
--	if ((MV64340_TX_QUEUE_SIZE - mp->tx_ring_skbs) <=
--	    (skb_shinfo(skb)->nr_frags + 1)) {
-+	if ((mp->tx_ring_size - mp->tx_ring_skbs) <=
-+					(skb_shinfo(skb)->nr_frags + 1)) {
- 		netif_stop_queue(dev);
- 		printk(KERN_ERR
--		       "%s: Bug in mv64340_eth - Trying to transmit when"
--		       " queue full !\n", dev->name);
-+			"%s: Bug in mv643xx_eth - Trying to transmit when"
-+			" queue full !\n", dev->name);
- 		return 1;
- 	}
- 
- 	/* Paranoid check - this shouldn't happen */
- 	if (skb == NULL) {
- 		stats->tx_dropped++;
-+		printk(KERN_ERR "mv64320_eth paranoid check failed\n");
- 		return 1;
- 	}
- 
- 	spin_lock_irqsave(&mp->lock, flags);
- 
- 	/* Update packet info data structure -- DMA owned, first last */
--#ifdef MV64340_CHECKSUM_OFFLOAD_TX
--	if (!skb_shinfo(skb)->nr_frags || (skb_shinfo(skb)->nr_frags > 3)) {
--#endif
--		pkt_info.cmd_sts = ETH_TX_ENABLE_INTERRUPT |
--	    	                   ETH_TX_FIRST_DESC | ETH_TX_LAST_DESC;
-+#ifdef MV643XX_CHECKSUM_OFFLOAD_TX
-+	if (!skb_shinfo(skb)->nr_frags) {
-+linear:
-+		if (skb->ip_summed != CHECKSUM_HW) {
-+			pkt_info.cmd_sts = ETH_TX_ENABLE_INTERRUPT |
-+					ETH_TX_FIRST_DESC | ETH_TX_LAST_DESC;
-+			pkt_info.l4i_chk = 0;
-+		} else {
-+			u32 ipheader = skb->nh.iph->ihl << 11;
- 
-+			pkt_info.cmd_sts = ETH_TX_ENABLE_INTERRUPT |
-+					ETH_TX_FIRST_DESC | ETH_TX_LAST_DESC |
-+					ETH_GEN_TCP_UDP_CHECKSUM |
-+					ETH_GEN_IP_V_4_CHECKSUM | ipheader;
-+			/* CPU already calculated pseudo header checksum. */
-+			if (skb->nh.iph->protocol == IPPROTO_UDP) {
-+				pkt_info.cmd_sts |= ETH_UDP_FRAME;
-+				pkt_info.l4i_chk = skb->h.uh->check;
-+			} else if (skb->nh.iph->protocol == IPPROTO_TCP)
-+				pkt_info.l4i_chk = skb->h.th->check;
-+			else {
-+				printk(KERN_ERR
-+					"%s: chksum proto != TCP or UDP\n",
-+					dev->name);
-+				spin_unlock_irqrestore(&mp->lock, flags);
-+				return 1;
-+			}
-+		}
- 		pkt_info.byte_cnt = skb->len;
--		pkt_info.buf_ptr = pci_map_single(0, skb->data, skb->len,
--		                                  PCI_DMA_TODEVICE);
--
--
-+		pkt_info.buf_ptr = dma_map_single(NULL, skb->data, skb->len,
-+							DMA_TO_DEVICE);
- 		pkt_info.return_info = skb;
-+		mp->tx_ring_skbs++;
- 		status = eth_port_send(mp, &pkt_info);
- 		if ((status == ETH_ERROR) || (status == ETH_QUEUE_FULL))
- 			printk(KERN_ERR "%s: Error on transmitting packet\n",
--				       dev->name);
--		mp->tx_ring_skbs++;
--#ifdef MV64340_CHECKSUM_OFFLOAD_TX
-+								dev->name);
-+		stats->tx_bytes += pkt_info.byte_cnt;
- 	} else {
--		unsigned int    frag;
--		u32		ipheader;
-+		unsigned int frag;
-+		u32 ipheader;
- 
--                /* first frag which is skb header */
--                pkt_info.byte_cnt = skb_headlen(skb);
--                pkt_info.buf_ptr = pci_map_single(0, skb->data,
--                                        skb_headlen(skb), PCI_DMA_TODEVICE);
--                pkt_info.return_info = 0;
--                ipheader = skb->nh.iph->ihl << 11;
--                pkt_info.cmd_sts = ETH_TX_FIRST_DESC | 
--					ETH_GEN_TCP_UDP_CHECKSUM |
--					ETH_GEN_IP_V_4_CHECKSUM |
--                                        ipheader;
--		/* CPU already calculated pseudo header checksum. So, use it */
--                pkt_info.l4i_chk = skb->h.th->check;
--                status = eth_port_send(mp, &pkt_info);
-+		/* Since hardware can't handle unaligned fragments smaller
-+		 * than 9 bytes, if we find any, we linearize the skb
-+		 * and start again.  When I've seen it, it's always been
-+		 * the first frag (probably near the end of the page),
-+		 * but we check all frags to be safe.
-+		 */
-+		for (frag = 0; frag < skb_shinfo(skb)->nr_frags; frag++) {
-+			skb_frag_t *fragp;
-+
-+			fragp = &skb_shinfo(skb)->frags[frag];
-+			if (fragp->size <= 8 && fragp->page_offset & 0x7) {
-+				skb_linearize(skb, GFP_ATOMIC);
-+				printk(KERN_DEBUG "%s: unaligned tiny fragment"
-+						"%d of %d, fixed\n",
-+						dev->name, frag,
-+						skb_shinfo(skb)->nr_frags);
-+				goto linear;
-+			}
-+		}
-+
-+		/* first frag which is skb header */
-+		pkt_info.byte_cnt = skb_headlen(skb);
-+		pkt_info.buf_ptr = dma_map_single(NULL, skb->data,
-+							skb_headlen(skb),
-+							DMA_TO_DEVICE);
-+		pkt_info.l4i_chk = 0;
-+		pkt_info.return_info = 0;
-+		pkt_info.cmd_sts = ETH_TX_FIRST_DESC;
-+
-+		if (skb->ip_summed == CHECKSUM_HW) {
-+			ipheader = skb->nh.iph->ihl << 11;
-+			pkt_info.cmd_sts |= ETH_GEN_TCP_UDP_CHECKSUM |
-+					ETH_GEN_IP_V_4_CHECKSUM | ipheader;
-+			/* CPU already calculated pseudo header checksum. */
-+			if (skb->nh.iph->protocol == IPPROTO_UDP) {
-+				pkt_info.cmd_sts |= ETH_UDP_FRAME;
-+				pkt_info.l4i_chk = skb->h.uh->check;
-+			} else if (skb->nh.iph->protocol == IPPROTO_TCP)
-+				pkt_info.l4i_chk = skb->h.th->check;
-+			else {
-+				printk(KERN_ERR
-+					"%s: chksum proto != TCP or UDP\n",
-+					dev->name);
-+				spin_unlock_irqrestore(&mp->lock, flags);
-+				return 1;
-+			}
-+		}
-+
-+		status = eth_port_send(mp, &pkt_info);
- 		if (status != ETH_OK) {
--	                if ((status == ETH_ERROR))
--        	                printk(KERN_ERR "%s: Error on transmitting packet\n", dev->name);
--	                if (status == ETH_QUEUE_FULL)
--        	                printk("Error on Queue Full \n");
--                	if (status == ETH_QUEUE_LAST_RESOURCE)
--                        	printk("Tx resource error \n");
-+			if ((status == ETH_ERROR))
-+				printk(KERN_ERR
-+					"%s: Error on transmitting packet\n",
-+					dev->name);
-+			if (status == ETH_QUEUE_FULL)
-+				printk("Error on Queue Full \n");
-+			if (status == ETH_QUEUE_LAST_RESOURCE)
-+				printk("Tx resource error \n");
- 		}
-+		stats->tx_bytes += pkt_info.byte_cnt;
-+
-+		/* Check for the remaining frags */
-+		for (frag = 0; frag < skb_shinfo(skb)->nr_frags; frag++) {
-+			skb_frag_t *this_frag = &skb_shinfo(skb)->frags[frag];
-+			pkt_info.l4i_chk = 0x0000;
-+			pkt_info.cmd_sts = 0x00000000;
-+
-+			/* Last Frag enables interrupt and frees the skb */
-+			if (frag == (skb_shinfo(skb)->nr_frags - 1)) {
-+				pkt_info.cmd_sts |= ETH_TX_ENABLE_INTERRUPT |
-+							ETH_TX_LAST_DESC;
-+				pkt_info.return_info = skb;
-+				mp->tx_ring_skbs++;
-+			} else {
-+				pkt_info.return_info = 0;
-+			}
-+			pkt_info.l4i_chk = 0;
-+			pkt_info.byte_cnt = this_frag->size;
- 
--                /* Check for the remaining frags */
--                for (frag = 0; frag < skb_shinfo(skb)->nr_frags; frag++) {
--                        skb_frag_t *this_frag = &skb_shinfo(skb)->frags[frag];
--                        pkt_info.l4i_chk = 0x0000;
--                        pkt_info.cmd_sts = 0x00000000;
--
--                        /* Last Frag enables interrupt and frees the skb */
--                        if (frag == (skb_shinfo(skb)->nr_frags - 1)) {
--                                pkt_info.cmd_sts |= ETH_TX_ENABLE_INTERRUPT |
--                                                        ETH_TX_LAST_DESC;
--                                pkt_info.return_info = skb;
--                                mp->tx_ring_skbs++;
--                        }
--                        else {
--                                pkt_info.return_info = 0;
--                        }
--                        pkt_info.byte_cnt = this_frag->size;
--                        if (this_frag->size < 8)
--                                printk("%d : \n", skb_shinfo(skb)->nr_frags);
--
--                        pkt_info.buf_ptr = pci_map_page(NULL, this_frag->page,
--                                        this_frag->page_offset,
--                                        this_frag->size, PCI_DMA_TODEVICE);
-+			pkt_info.buf_ptr = dma_map_page(NULL, this_frag->page,
-+							this_frag->page_offset,
-+							this_frag->size,
-+							DMA_TO_DEVICE);
- 
--                        status = eth_port_send(mp, &pkt_info);
-+			status = eth_port_send(mp, &pkt_info);
- 
- 			if (status != ETH_OK) {
--	                        if ((status == ETH_ERROR))
--        	                        printk(KERN_ERR "%s: Error on transmitting packet\n", dev->name);
-+				if ((status == ETH_ERROR))
-+					printk(KERN_ERR "%s: Error on "
-+							"transmitting packet\n",
-+							dev->name);
- 
--       		                 if (status == ETH_QUEUE_LAST_RESOURCE)
--                	                printk("Tx resource error \n");
-+				if (status == ETH_QUEUE_LAST_RESOURCE)
-+					printk("Tx resource error \n");
- 
--                        	if (status == ETH_QUEUE_FULL)
--                                	printk("Queue is full \n");
-+				if (status == ETH_QUEUE_FULL)
-+					printk("Queue is full \n");
- 			}
--                }
--        }
-+			stats->tx_bytes += pkt_info.byte_cnt;
-+		}
-+	}
-+#else
-+	pkt_info.cmd_sts = ETH_TX_ENABLE_INTERRUPT | ETH_TX_FIRST_DESC |
-+							ETH_TX_LAST_DESC;
-+	pkt_info.l4i_chk = 0;
-+	pkt_info.byte_cnt = skb->len;
-+	pkt_info.buf_ptr = dma_map_single(NULL, skb->data, skb->len,
-+								DMA_TO_DEVICE);
-+	pkt_info.return_info = skb;
-+	mp->tx_ring_skbs++;
-+	status = eth_port_send(mp, &pkt_info);
-+	if ((status == ETH_ERROR) || (status == ETH_QUEUE_FULL))
-+		printk(KERN_ERR "%s: Error on transmitting packet\n",
-+								dev->name);
-+	stats->tx_bytes += pkt_info.byte_cnt;
- #endif
- 
- 	/* Check if TX queue can handle another skb. If not, then
- 	 * signal higher layers to stop requesting TX
- 	 */
--	if (MV64340_TX_QUEUE_SIZE <= (mp->tx_ring_skbs + 1))
--		/* 
-+	if (mp->tx_ring_size <= (mp->tx_ring_skbs + MAX_DESCS_PER_SKB))
-+		/*
- 		 * Stop getting skb's from upper layers.
- 		 * Getting skb's from upper layers will be enabled again after
- 		 * packets are released.
-@@ -1277,7 +1324,6 @@
- 		netif_stop_queue(dev);
- 
- 	/* Update statistics and start of transmittion time */
--	stats->tx_bytes += skb->len;
- 	stats->tx_packets++;
- 	dev->trans_start = jiffies;
- 
-@@ -1287,214 +1333,304 @@
- }
- 
- /*
-- * mv64340_eth_get_stats
-+ * mv643xx_eth_get_stats
-  *
-  * Returns a pointer to the interface statistics.
-  *
-- * Input : dev - a pointer to the required interface
-+ * Input :	dev - a pointer to the required interface
-  *
-- * Output : a pointer to the interface's statistics
-+ * Output :	a pointer to the interface's statistics
-  */
- 
--static struct net_device_stats *mv64340_eth_get_stats(struct net_device *dev)
-+static struct net_device_stats *mv643xx_eth_get_stats(struct net_device *dev)
- {
--	struct mv64340_private *mp = netdev_priv(dev);
-+	struct mv643xx_private *mp = netdev_priv(dev);
- 
- 	return &mp->stats;
- }
- 
- /*/
-- * mv64340_eth_init
-- *								       
-- * First function called after registering the network device. 
-- * It's purpose is to initialize the device as an ethernet device, 
-- * fill the structure that was given in registration with pointers
-- * to functions, and setting the MAC address of the interface
-+ * mv643xx_eth_probe
-  *
-- * Input : number of port to initialize
-- * Output : -ENONMEM if failed , 0 if success
-- */
--static struct net_device *mv64340_eth_init(int port_num)
--{
--	struct mv64340_private *mp;
-+ * First function called after registering the network device.
-+ * It's purpose is to initialize the device as an ethernet device,
-+ * fill the ethernet device structure with pointers * to functions,
-+ * and set the MAC address of the interface
-+ *
-+ * Input :	struct device *
-+ * Output :	-ENOMEM if failed , 0 if success
-+ */
-+static int mv643xx_eth_probe(struct device *ddev)
-+{
-+	struct platform_device *pdev = to_platform_device(ddev);
-+	struct mv643xx_eth_platform_data *pd;
-+	int port_num = pdev->id;
-+	struct mv643xx_private *mp;
- 	struct net_device *dev;
-+	u8 *p;
-+	struct resource *res;
- 	int err;
- 
--	dev = alloc_etherdev(sizeof(struct mv64340_private));
-+	dev = alloc_etherdev(sizeof(struct mv643xx_private));
- 	if (!dev)
--		return NULL;
-+		return -ENOMEM;
-+
-+	dev_set_drvdata(ddev, dev);
- 
- 	mp = netdev_priv(dev);
- 
--	dev->irq = ETH_PORT0_IRQ_NUM + port_num;
-+	res = platform_get_resource(pdev, IORESOURCE_IRQ, 0);
-+	BUG_ON(!res);
-+	dev->irq = res->start;
- 
--	dev->open = mv64340_eth_open;
--	dev->stop = mv64340_eth_stop;
--	dev->hard_start_xmit = mv64340_eth_start_xmit;
--	dev->get_stats = mv64340_eth_get_stats;
--	dev->set_mac_address = mv64340_eth_set_mac_address;
--	dev->set_multicast_list = mv64340_eth_set_rx_mode;
-+	mp->port_num = port_num;
-+
-+	dev->open = mv643xx_eth_open;
-+	dev->stop = mv643xx_eth_stop;
-+	dev->hard_start_xmit = mv643xx_eth_start_xmit;
-+	dev->get_stats = mv643xx_eth_get_stats;
-+	dev->set_mac_address = mv643xx_eth_set_mac_address;
-+	dev->set_multicast_list = mv643xx_eth_set_rx_mode;
- 
- 	/* No need to Tx Timeout */
--	dev->tx_timeout = mv64340_eth_tx_timeout;
--#ifdef MV64340_NAPI
--        dev->poll = mv64340_poll;
--        dev->weight = 64;
-+	dev->tx_timeout = mv643xx_eth_tx_timeout;
-+#ifdef MV643XX_NAPI
-+	dev->poll = mv643xx_poll;
-+	dev->weight = 64;
- #endif
- 
- 	dev->watchdog_timeo = 2 * HZ;
--	dev->tx_queue_len = MV64340_TX_QUEUE_SIZE;
-+	dev->tx_queue_len = mp->tx_ring_size;
- 	dev->base_addr = 0;
--	dev->change_mtu = mv64340_eth_change_mtu;
-+	dev->change_mtu = mv643xx_eth_change_mtu;
-+	SET_ETHTOOL_OPS(dev, &mv643xx_ethtool_ops);
- 
--#ifdef MV64340_CHECKSUM_OFFLOAD_TX
-+#ifdef MV643XX_CHECKSUM_OFFLOAD_TX
- #ifdef MAX_SKB_FRAGS
- #ifndef CONFIG_JAGUAR_DMALOW
--        /*
--         * Zero copy can only work if we use Discovery II memory. Else, we will
--         * have to map the buffers to ISA memory which is only 16 MB
--         */
--        dev->features = NETIF_F_SG | NETIF_F_IP_CSUM | NETIF_F_HW_CSUM;
-+	/*
-+	 * Zero copy can only work if we use Discovery II memory. Else, we will
-+	 * have to map the buffers to ISA memory which is only 16 MB
-+	 */
-+	dev->features = NETIF_F_SG | NETIF_F_IP_CSUM | NETIF_F_HW_CSUM;
- #endif
- #endif
- #endif
- 
--	mp->port_num = port_num;
--
- 	/* Configure the timeout task */
--        INIT_WORK(&mp->tx_timeout_task,
--                  (void (*)(void *))mv64340_eth_tx_timeout_task, dev);
-+	INIT_WORK(&mp->tx_timeout_task,
-+			(void (*)(void *))mv643xx_eth_tx_timeout_task, dev);
- 
- 	spin_lock_init(&mp->lock);
- 
--	/* set MAC addresses */
--	memcpy(dev->dev_addr, prom_mac_addr_base, 6);
--	dev->dev_addr[5] += port_num;
-+	/* set default config values */
-+	eth_port_uc_addr_get(dev, dev->dev_addr);
-+	mp->port_config = MV643XX_ETH_PORT_CONFIG_DEFAULT_VALUE;
-+	mp->port_config_extend = MV643XX_ETH_PORT_CONFIG_EXTEND_DEFAULT_VALUE;
-+	mp->port_sdma_config = MV643XX_ETH_PORT_SDMA_CONFIG_DEFAULT_VALUE;
-+	mp->port_serial_control = MV643XX_ETH_PORT_SERIAL_CONTROL_DEFAULT_VALUE;
-+	mp->rx_ring_size = MV643XX_ETH_PORT_DEFAULT_RECEIVE_QUEUE_SIZE;
-+	mp->tx_ring_size = MV643XX_ETH_PORT_DEFAULT_TRANSMIT_QUEUE_SIZE;
-+
-+	pd = pdev->dev.platform_data;
-+	if (pd) {
-+		if (pd->mac_addr != NULL)
-+			memcpy(dev->dev_addr, pd->mac_addr, 6);
-+
-+		if (pd->phy_addr || pd->force_phy_addr)
-+			ethernet_phy_set(port_num, pd->phy_addr);
-+
-+		if (pd->port_config || pd->force_port_config)
-+			mp->port_config = pd->port_config;
-+
-+		if (pd->port_config_extend || pd->force_port_config_extend)
-+			mp->port_config_extend = pd->port_config_extend;
-+
-+		if (pd->port_sdma_config || pd->force_port_sdma_config)
-+			mp->port_sdma_config = pd->port_sdma_config;
-+
-+		if (pd->port_serial_control || pd->force_port_serial_control)
-+			mp->port_serial_control = pd->port_serial_control;
-+
-+		if (pd->rx_queue_size)
-+			mp->rx_ring_size = pd->rx_queue_size;
-+
-+		if (pd->tx_queue_size)
-+			mp->tx_ring_size = pd->tx_queue_size;
-+
-+		if (pd->tx_sram_size) {
-+			mp->tx_sram_size = pd->tx_sram_size;
-+			mp->tx_sram_addr = pd->tx_sram_addr;
-+		}
-+
-+		if (pd->rx_sram_size) {
-+			mp->rx_sram_size = pd->rx_sram_size;
-+			mp->rx_sram_addr = pd->rx_sram_addr;
-+		}
-+	}
-+
-+	err = ethernet_phy_detect(port_num);
-+	if (err) {
-+		pr_debug("MV643xx ethernet port %d: "
-+					"No PHY detected at addr %d\n",
-+					port_num, ethernet_phy_get(port_num));
-+		return err;
-+	}
- 
- 	err = register_netdev(dev);
- 	if (err)
--		goto out_free_dev;
-+		goto out;
- 
--	printk(KERN_NOTICE "%s: port %d with MAC address %02x:%02x:%02x:%02x:%02x:%02x\n",
--		dev->name, port_num,
--		dev->dev_addr[0], dev->dev_addr[1], dev->dev_addr[2],
--		dev->dev_addr[3], dev->dev_addr[4], dev->dev_addr[5]);
-+	p = dev->dev_addr;
-+	printk(KERN_NOTICE
-+		"%s: port %d with MAC address %02x:%02x:%02x:%02x:%02x:%02x\n",
-+		dev->name, port_num, p[0], p[1], p[2], p[3], p[4], p[5]);
- 
- 	if (dev->features & NETIF_F_SG)
--		printk("Scatter Gather Enabled  ");
-+		printk(KERN_NOTICE "%s: Scatter Gather Enabled\n", dev->name);
- 
- 	if (dev->features & NETIF_F_IP_CSUM)
--		printk("TX TCP/IP Checksumming Supported  \n");
-+		printk(KERN_NOTICE "%s: TX TCP/IP Checksumming Supported\n",
-+								dev->name);
-+
-+#ifdef MV643XX_CHECKSUM_OFFLOAD_TX
-+	printk(KERN_NOTICE "%s: RX TCP/UDP Checksum Offload ON \n", dev->name);
-+#endif
- 
--	printk("RX TCP/UDP Checksum Offload ON, \n");
--	printk("TX and RX Interrupt Coalescing ON \n");
-+#ifdef MV643XX_COAL
-+	printk(KERN_NOTICE "%s: TX and RX Interrupt Coalescing ON \n",
-+								dev->name);
-+#endif
- 
--#ifdef MV64340_NAPI
--	printk("RX NAPI Enabled \n");
-+#ifdef MV643XX_NAPI
-+	printk(KERN_NOTICE "%s: RX NAPI Enabled \n", dev->name);
- #endif
- 
--	return dev;
-+	return 0;
- 
--out_free_dev:
-+out:
- 	free_netdev(dev);
- 
--	return NULL;
-+	return err;
- }
- 
--static void mv64340_eth_remove(struct net_device *dev)
-+static int mv643xx_eth_remove(struct device *ddev)
- {
--	struct mv64340_private *mp = netdev_priv(dev);
-+	struct net_device *dev = dev_get_drvdata(ddev);
- 
- 	unregister_netdev(dev);
- 	flush_scheduled_work();
-+
- 	free_netdev(dev);
-+	dev_set_drvdata(ddev, NULL);
-+	return 0;
-+}
-+
-+static int mv643xx_eth_shared_probe(struct device *ddev)
-+{
-+	struct platform_device *pdev = to_platform_device(ddev);
-+	struct resource *res;
-+
-+	printk(KERN_NOTICE "MV-643xx 10/100/1000 Ethernet Driver\n");
-+
-+	res = platform_get_resource(pdev, IORESOURCE_MEM, 0);
-+	if (res == NULL)
-+		return -ENODEV;
-+
-+	mv643xx_eth_shared_base = ioremap(res->start,
-+						MV643XX_ETH_SHARED_REGS_SIZE);
-+	if (mv643xx_eth_shared_base == NULL)
-+		return -ENOMEM;
-+
-+	return 0;
-+
-+}
-+
-+static int mv643xx_eth_shared_remove(struct device *ddev)
-+{
-+	iounmap(mv643xx_eth_shared_base);
-+	mv643xx_eth_shared_base = NULL;
-+
-+	return 0;
- }
- 
--static struct net_device *mv64340_dev0;
--static struct net_device *mv64340_dev1;
--static struct net_device *mv64340_dev2;
-+static struct device_driver mv643xx_eth_driver = {
-+	.name = MV643XX_ETH_NAME,
-+	.bus = &platform_bus_type,
-+	.probe = mv643xx_eth_probe,
-+	.remove = mv643xx_eth_remove,
-+};
-+
-+static struct device_driver mv643xx_eth_shared_driver = {
-+	.name = MV643XX_ETH_SHARED_NAME,
-+	.bus = &platform_bus_type,
-+	.probe = mv643xx_eth_shared_probe,
-+	.remove = mv643xx_eth_shared_remove,
-+};
- 
- /*
-- * mv64340_init_module
-+ * mv643xx_init_module
-  *
-  * Registers the network drivers into the Linux kernel
-  *
-- * Input : N/A
-+ * Input :	N/A
-  *
-- * Output : N/A
-+ * Output :	N/A
-  */
--static int __init mv64340_init_module(void)
-+static int __init mv643xx_init_module(void)
- {
--	printk(KERN_NOTICE "MV-643xx 10/100/1000 Ethernet Driver\n");
-+	int rc;
- 
--#ifdef CONFIG_MV643XX_ETH_0
--	mv64340_dev0 = mv64340_eth_init(0);
--	if (!mv64340_dev0) {
--		printk(KERN_ERR
--		       "Error registering MV-64360 ethernet port 0\n");
--	}
--#endif
--#ifdef CONFIG_MV643XX_ETH_1
--	mv64340_dev1 = mv64340_eth_init(1);
--	if (!mv64340_dev1) {
--		printk(KERN_ERR
--		       "Error registering MV-64360 ethernet port 1\n");
--	}
--#endif
--#ifdef CONFIG_MV643XX_ETH_2
--	mv64340_dev2 = mv64340_eth_init(2);
--	if (!mv64340_dev2) {
--		printk(KERN_ERR
--		       "Error registering MV-64360 ethernet port 2\n");
-+	rc = driver_register(&mv643xx_eth_shared_driver);
-+	if (!rc) {
-+		rc = driver_register(&mv643xx_eth_driver);
-+		if (rc)
-+			driver_unregister(&mv643xx_eth_shared_driver);
- 	}
--#endif
--	return 0;
-+	return rc;
- }
- 
- /*
-- * mv64340_cleanup_module
-+ * mv643xx_cleanup_module
-  *
-  * Registers the network drivers into the Linux kernel
-  *
-- * Input : N/A
-+ * Input :	N/A
-  *
-- * Output : N/A
-+ * Output :	N/A
-  */
--static void __exit mv64340_cleanup_module(void)
-+static void __exit mv643xx_cleanup_module(void)
- {
--	if (mv64340_dev2)
--		mv64340_eth_remove(mv64340_dev2);
--	if (mv64340_dev1)
--		mv64340_eth_remove(mv64340_dev1);
--	if (mv64340_dev0)
--		mv64340_eth_remove(mv64340_dev0);
-+	driver_unregister(&mv643xx_eth_driver);
-+	driver_unregister(&mv643xx_eth_shared_driver);
- }
- 
--module_init(mv64340_init_module);
--module_exit(mv64340_cleanup_module);
-+module_init(mv643xx_init_module);
-+module_exit(mv643xx_cleanup_module);
- 
- MODULE_LICENSE("GPL");
--MODULE_AUTHOR("Rabeeh Khoury, Assaf Hoffman, Matthew Dharm and Manish Lachwani");
--MODULE_DESCRIPTION("Ethernet driver for Marvell MV64340");
-+MODULE_AUTHOR(	"Rabeeh Khoury, Assaf Hoffman, Matthew Dharm, Manish Lachwani"
-+		" and Dale Farnsworth");
-+MODULE_DESCRIPTION("Ethernet driver for Marvell MV643XX");
- 
- /*
-- *  The second part is the low level driver of the gigE ethernet ports.
-+ * The second part is the low level driver of the gigE ethernet ports.
-  */
- 
- /*
-  * Marvell's Gigabit Ethernet controller low level driver
-  *
-  * DESCRIPTION:
-- *       This file introduce low level API to Marvell's Gigabit Ethernet
-+ *	This file introduce low level API to Marvell's Gigabit Ethernet
-  *		controller. This Gigabit Ethernet Controller driver API controls
-  *		1) Operations (i.e. port init, start, reset etc').
-  *		2) Data flow (i.e. port send, receive etc').
-  *		Each Gigabit Ethernet port is controlled via
-- *              struct mv64340_private.
-+ *		struct mv643xx_private.
-  *		This struct includes user configuration information as well as
-  *		driver internal data needed for its operations.
-  *
-- *		Supported Features:  
-+ *		Supported Features:
-  *		- This low level driver is OS independent. Allocating memory for
-  *		  the descriptor rings and buffers are not within the scope of
-  *		  this driver.
-@@ -1511,12 +1647,12 @@
-  *		- PHY access and control API.
-  *		- Port control register configuration API.
-  *		- Full control over Unicast and Multicast MAC configurations.
-- *								   
-+ *
-  *		Operation flow:
-  *
-  *		Initialization phase
-- *		This phase complete the initialization of the the mv64340_private
-- *		struct. 
-+ *		This phase complete the initialization of the the
-+ *		mv643xx_private struct.
-  *		User information regarding port configuration has to be set
-  *		prior to calling the port initialization routine.
-  *
-@@ -1525,7 +1661,7 @@
-  *		access to DRAM and internal SRAM memory spaces.
-  *
-  *		Driver ring initialization
-- *		Allocating memory for the descriptor rings and buffers is not 
-+ *		Allocating memory for the descriptor rings and buffers is not
-  *		within the scope of this driver. Thus, the user is required to
-  *		allocate memory for the descriptors ring and buffers. Those
-  *		memory parameters are used by the Rx and Tx ring initialization
-@@ -1533,49 +1669,50 @@
-  *		of a ring.
-  *		Note: Pay special attention to alignment issues when using
-  *		cached descriptors/buffers. In this phase the driver store
-- *		information in the mv64340_private struct regarding each queue
-+ *		information in the mv643xx_private struct regarding each queue
-  *		ring.
-  *
-- *		Driver start 
-+ *		Driver start
-  *		This phase prepares the Ethernet port for Rx and Tx activity.
-- *		It uses the information stored in the mv64340_private struct to 
-+ *		It uses the information stored in the mv643xx_private struct to
-  *		initialize the various port registers.
-  *
-  *		Data flow:
-  *		All packet references to/from the driver are done using
-- *              struct pkt_info.
-- *		This struct is a unified struct used with Rx and Tx operations. 
-+ *		struct pkt_info.
-+ *		This struct is a unified struct used with Rx and Tx operations.
-  *		This way the user is not required to be familiar with neither
-  *		Tx nor Rx descriptors structures.
-  *		The driver's descriptors rings are management by indexes.
-  *		Those indexes controls the ring resources and used to indicate
-  *		a SW resource error:
-- *		'current' 
-- *		This index points to the current available resource for use. For 
-- *		example in Rx process this index will point to the descriptor  
-- *		that will be passed to the user upon calling the receive routine.
-- *		In Tx process, this index will point to the descriptor
-+ *		'current'
-+ *		This index points to the current available resource for use. For
-+ *		example in Rx process this index will point to the descriptor
-+ *		that will be passed to the user upon calling the receive
-+ *		routine.  In Tx process, this index will point to the descriptor
-  *		that will be assigned with the user packet info and transmitted.
-- *		'used'    
-- *		This index points to the descriptor that need to restore its 
-+ *		'used'
-+ *		This index points to the descriptor that need to restore its
-  *		resources. For example in Rx process, using the Rx buffer return
-  *		API will attach the buffer returned in packet info to the
-  *		descriptor pointed by 'used'. In Tx process, using the Tx
-  *		descriptor return will merely return the user packet info with
-- *		the command status of  the transmitted buffer pointed by the
-+ *		the command status of the transmitted buffer pointed by the
-  *		'used' index. Nevertheless, it is essential to use this routine
-  *		to update the 'used' index.
-  *		'first'
-- *		This index supports Tx Scatter-Gather. It points to the first 
-- *		descriptor of a packet assembled of multiple buffers. For example
-- *		when in middle of Such packet we have a Tx resource error the 
-- *		'curr' index get the value of 'first' to indicate that the ring 
-- *		returned to its state before trying to transmit this packet.
-+ *		This index supports Tx Scatter-Gather. It points to the first
-+ *		descriptor of a packet assembled of multiple buffers. For
-+ *		example when in middle of Such packet we have a Tx resource
-+ *		error the 'curr' index get the value of 'first' to indicate
-+ *		that the ring returned to its state before trying to transmit
-+ *		this packet.
-  *
-  *		Receive operation:
-  *		The eth_port_receive API set the packet information struct,
-- *		passed by the caller, with received information from the 
-- *		'current' SDMA descriptor. 
-+ *		passed by the caller, with received information from the
-+ *		'current' SDMA descriptor.
-  *		It is the user responsibility to return this resource back
-  *		to the Rx descriptor ring to enable the reuse of this source.
-  *		Return Rx resource is done using the eth_rx_return_buff API.
-@@ -1596,27 +1733,21 @@
-  *
-  *		EXTERNAL INTERFACE
-  *
-- *       Prior to calling the initialization routine eth_port_init() the user
-- *	 must set the following fields under mv64340_private struct:
-- *       port_num             User Ethernet port number.
-- *       port_mac_addr[6]	    User defined port MAC address.
-- *       port_config          User port configuration value.
-- *       port_config_extend    User port config extend value.
-- *       port_sdma_config      User port SDMA config value.
-- *       port_serial_control   User port serial control value.
-- *
-- *       This driver introduce a set of default values:
-- *       PORT_CONFIG_VALUE           Default port configuration value
-- *       PORT_CONFIG_EXTEND_VALUE    Default port extend configuration value
-- *       PORT_SDMA_CONFIG_VALUE      Default sdma control value
-- *       PORT_SERIAL_CONTROL_VALUE   Default port serial control value
-+ *	Prior to calling the initialization routine eth_port_init() the user
-+ *	must set the following fields under mv643xx_private struct:
-+ *	port_num		User Ethernet port number.
-+ *	port_mac_addr[6]	User defined port MAC address.
-+ *	port_config		User port configuration value.
-+ *	port_config_extend	User port config extend value.
-+ *	port_sdma_config	User port SDMA config value.
-+ *	port_serial_control	User port serial control value.
-  *
-  *		This driver data flow is done using the struct pkt_info which
-- *              is a unified struct for Rx and Tx operations:
-+ *		is a unified struct for Rx and Tx operations:
-  *
-  *		byte_cnt	Tx/Rx descriptor buffer byte count.
-  *		l4i_chk		CPU provided TCP Checksum. For Tx operation
-- *                              only.
-+ *				only.
-  *		cmd_sts		Tx/Rx descriptor command status.
-  *		buf_ptr		Tx/Rx descriptor buffer pointer.
-  *		return_info	Tx/Rx user resource return information.
-@@ -1625,70 +1756,44 @@
- /* defines */
- /* SDMA command macros */
- #define ETH_ENABLE_TX_QUEUE(eth_port) \
--	MV_WRITE(MV64340_ETH_TRANSMIT_QUEUE_COMMAND_REG(eth_port), 1)
--
--#define ETH_DISABLE_TX_QUEUE(eth_port) \
--	MV_WRITE(MV64340_ETH_TRANSMIT_QUEUE_COMMAND_REG(eth_port),	\
--	         (1 << 8))
--
--#define ETH_ENABLE_RX_QUEUE(rx_queue, eth_port) \
--	MV_WRITE(MV64340_ETH_RECEIVE_QUEUE_COMMAND_REG(eth_port),	\
--	         (1 << rx_queue))
--
--#define ETH_DISABLE_RX_QUEUE(rx_queue, eth_port) \
--	MV_WRITE(MV64340_ETH_RECEIVE_QUEUE_COMMAND_REG(eth_port),	\
--	         (1 << (8 + rx_queue)))
--
--#define LINK_UP_TIMEOUT		100000
--#define PHY_BUSY_TIMEOUT	10000000
-+	mv_write(MV643XX_ETH_TRANSMIT_QUEUE_COMMAND_REG(eth_port), 1)
- 
- /* locals */
- 
- /* PHY routines */
- static int ethernet_phy_get(unsigned int eth_port_num);
-+static void ethernet_phy_set(unsigned int eth_port_num, int phy_addr);
- 
- /* Ethernet Port routines */
- static int eth_port_uc_addr(unsigned int eth_port_num, unsigned char uc_nibble,
--	int option);
-+								int option);
- 
- /*
-  * eth_port_init - Initialize the Ethernet port driver
-  *
-  * DESCRIPTION:
-- *       This function prepares the ethernet port to start its activity:
-- *       1) Completes the ethernet port driver struct initialization toward port
-- *           start routine.
-- *       2) Resets the device to a quiescent state in case of warm reboot.
-- *       3) Enable SDMA access to all four DRAM banks as well as internal SRAM.
-- *       4) Clean MAC tables. The reset status of those tables is unknown.
-- *       5) Set PHY address. 
-- *       Note: Call this routine prior to eth_port_start routine and after
-- *       setting user values in the user fields of Ethernet port control
-- *       struct.
-+ *	This function prepares the ethernet port to start its activity:
-+ *	1) Completes the ethernet port driver struct initialization toward port
-+ *		start routine.
-+ *	2) Resets the device to a quiescent state in case of warm reboot.
-+ *	3) Enable SDMA access to all four DRAM banks as well as internal SRAM.
-+ *	4) Clean MAC tables. The reset status of those tables is unknown.
-+ *	5) Set PHY address.
-+ *	Note: Call this routine prior to eth_port_start routine and after
-+ *	setting user values in the user fields of Ethernet port control
-+ *	struct.
-  *
-  * INPUT:
-- *       struct mv64340_private *mp   Ethernet port control struct
-+ *	struct mv643xx_private *mp	Ethernet port control struct
-  *
-  * OUTPUT:
-- *       See description.
-+ *	See description.
-  *
-  * RETURN:
-- *       None.
-+ *	None.
-  */
--static void eth_port_init(struct mv64340_private * mp)
-+static void eth_port_init(struct mv643xx_private *mp)
- {
--	mp->port_config = PORT_CONFIG_VALUE;
--	mp->port_config_extend = PORT_CONFIG_EXTEND_VALUE;
--#if defined(__BIG_ENDIAN)
--	mp->port_sdma_config = PORT_SDMA_CONFIG_VALUE;
--#elif defined(__LITTLE_ENDIAN)
--	mp->port_sdma_config = PORT_SDMA_CONFIG_VALUE |
--		ETH_BLM_RX_NO_SWAP | ETH_BLM_TX_NO_SWAP;
--#else
--#error One of __LITTLE_ENDIAN or __BIG_ENDIAN must be defined!
--#endif
--	mp->port_serial_control = PORT_SERIAL_CONTROL_VALUE;
--
- 	mp->port_rx_queue_command = 0;
- 	mp->port_tx_queue_command = 0;
- 
-@@ -1706,77 +1811,73 @@
-  * eth_port_start - Start the Ethernet port activity.
-  *
-  * DESCRIPTION:
-- *       This routine prepares the Ethernet port for Rx and Tx activity:
-- *       1. Initialize Tx and Rx Current Descriptor Pointer for each queue that
-- *          has been initialized a descriptor's ring (using
-- *          ether_init_tx_desc_ring for Tx and ether_init_rx_desc_ring for Rx)
-- *       2. Initialize and enable the Ethernet configuration port by writing to
-- *          the port's configuration and command registers.
-- *       3. Initialize and enable the SDMA by writing to the SDMA's 
-- *          configuration and command registers.  After completing these steps,
-- *          the ethernet port SDMA can starts to perform Rx and Tx activities.
-+ *	This routine prepares the Ethernet port for Rx and Tx activity:
-+ *	 1. Initialize Tx and Rx Current Descriptor Pointer for each queue that
-+ *	    has been initialized a descriptor's ring (using
-+ *	    ether_init_tx_desc_ring for Tx and ether_init_rx_desc_ring for Rx)
-+ *	 2. Initialize and enable the Ethernet configuration port by writing to
-+ *	    the port's configuration and command registers.
-+ *	 3. Initialize and enable the SDMA by writing to the SDMA's
-+ *	    configuration and command registers.  After completing these steps,
-+ *	    the ethernet port SDMA can starts to perform Rx and Tx activities.
-  *
-- *       Note: Each Rx and Tx queue descriptor's list must be initialized prior
-- *       to calling this function (use ether_init_tx_desc_ring for Tx queues
-- *       and ether_init_rx_desc_ring for Rx queues).
-+ *	Note: Each Rx and Tx queue descriptor's list must be initialized prior
-+ *	to calling this function (use ether_init_tx_desc_ring for Tx queues
-+ *	and ether_init_rx_desc_ring for Rx queues).
-  *
-  * INPUT:
-- *       struct mv64340_private 	*mp   Ethernet port control struct
-+ *	struct mv643xx_private *mp	Ethernet port control struct
-  *
-  * OUTPUT:
-- *       Ethernet port is ready to receive and transmit.
-+ *	Ethernet port is ready to receive and transmit.
-  *
-  * RETURN:
-- *       false if the port PHY is not up.
-- *       true otherwise.
-+ *	None.
-  */
--static int eth_port_start(struct mv64340_private *mp)
-+static void eth_port_start(struct mv643xx_private *mp)
- {
--	unsigned int eth_port_num = mp->port_num;
-+	unsigned int port_num = mp->port_num;
- 	int tx_curr_desc, rx_curr_desc;
--	unsigned int phy_reg_data;
- 
- 	/* Assignment of Tx CTRP of given queue */
- 	tx_curr_desc = mp->tx_curr_desc_q;
--	MV_WRITE(MV64340_ETH_TX_CURRENT_QUEUE_DESC_PTR_0(eth_port_num),
--	         (struct eth_tx_desc *) mp->tx_desc_dma + tx_curr_desc);
-+	mv_write(MV643XX_ETH_TX_CURRENT_QUEUE_DESC_PTR_0(port_num),
-+		(u32)((struct eth_tx_desc *)mp->tx_desc_dma + tx_curr_desc));
- 
- 	/* Assignment of Rx CRDP of given queue */
- 	rx_curr_desc = mp->rx_curr_desc_q;
--	MV_WRITE(MV64340_ETH_RX_CURRENT_QUEUE_DESC_PTR_0(eth_port_num),
--		 (struct eth_rx_desc *) mp->rx_desc_dma + rx_curr_desc);
-+	mv_write(MV643XX_ETH_RX_CURRENT_QUEUE_DESC_PTR_0(port_num),
-+		(u32)((struct eth_rx_desc *)mp->rx_desc_dma + rx_curr_desc));
- 
- 	/* Add the assigned Ethernet address to the port's address table */
--	eth_port_uc_addr_set(mp->port_num, mp->port_mac_addr);
-+	eth_port_uc_addr_set(port_num, mp->port_mac_addr);
- 
- 	/* Assign port configuration and command. */
--	MV_WRITE(MV64340_ETH_PORT_CONFIG_REG(eth_port_num),
--		 mp->port_config);
-+	mv_write(MV643XX_ETH_PORT_CONFIG_REG(port_num), mp->port_config);
- 
--	MV_WRITE(MV64340_ETH_PORT_CONFIG_EXTEND_REG(eth_port_num),
--		 mp->port_config_extend);
-+	mv_write(MV643XX_ETH_PORT_CONFIG_EXTEND_REG(port_num),
-+						mp->port_config_extend);
- 
--	MV_WRITE(MV64340_ETH_PORT_SERIAL_CONTROL_REG(eth_port_num),
--		 mp->port_serial_control);
- 
--	MV_SET_REG_BITS(MV64340_ETH_PORT_SERIAL_CONTROL_REG(eth_port_num),
--			ETH_SERIAL_PORT_ENABLE);
-+	/* Increase the Rx side buffer size if supporting GigE */
-+	if (mp->port_serial_control & MV643XX_ETH_SET_GMII_SPEED_TO_1000)
-+		mv_write(MV643XX_ETH_PORT_SERIAL_CONTROL_REG(port_num),
-+			(mp->port_serial_control & 0xfff1ffff) | (0x5 << 17));
-+	else
-+		mv_write(MV643XX_ETH_PORT_SERIAL_CONTROL_REG(port_num),
-+						mp->port_serial_control);
-+
-+	mv_write(MV643XX_ETH_PORT_SERIAL_CONTROL_REG(port_num),
-+		mv_read(MV643XX_ETH_PORT_SERIAL_CONTROL_REG(port_num)) |
-+						MV643XX_ETH_SERIAL_PORT_ENABLE);
- 
- 	/* Assign port SDMA configuration */
--	MV_WRITE(MV64340_ETH_SDMA_CONFIG_REG(eth_port_num),
--		 mp->port_sdma_config);
-+	mv_write(MV643XX_ETH_SDMA_CONFIG_REG(port_num),
-+							mp->port_sdma_config);
- 
- 	/* Enable port Rx. */
--	MV_WRITE(MV64340_ETH_RECEIVE_QUEUE_COMMAND_REG(eth_port_num),
--		 mp->port_rx_queue_command);
--
--	/* Check if link is up */
--	eth_port_read_smi_reg(eth_port_num, 1, &phy_reg_data);
--
--	if (!(phy_reg_data & 0x20))
--		return 0;
--
--	return 1;
-+	mv_write(MV643XX_ETH_RECEIVE_QUEUE_COMMAND_REG(port_num),
-+						mp->port_rx_queue_command);
- }
- 
- /*
-@@ -1786,29 +1887,29 @@
-  *		This function Set the port Ethernet MAC address.
-  *
-  * INPUT:
-- *	unsigned int eth_port_num     Port number.
-- *	char *        p_addr		Address to be set 
-+ *	unsigned int	eth_port_num	Port number.
-+ *	char *		p_addr		Address to be set
-  *
-  * OUTPUT:
-- *	Set MAC address low and high registers. also calls eth_port_uc_addr() 
-- *       To set the unicast table with the proper information.
-+ *	Set MAC address low and high registers. also calls eth_port_uc_addr()
-+ *	To set the unicast table with the proper information.
-  *
-  * RETURN:
-  *	N/A.
-  *
-  */
- static void eth_port_uc_addr_set(unsigned int eth_port_num,
--				 unsigned char *p_addr)
-+							unsigned char *p_addr)
- {
- 	unsigned int mac_h;
- 	unsigned int mac_l;
- 
- 	mac_l = (p_addr[4] << 8) | (p_addr[5]);
--	mac_h = (p_addr[0] << 24) | (p_addr[1] << 16) |
--	    (p_addr[2] << 8) | (p_addr[3] << 0);
-+	mac_h = (p_addr[0] << 24) | (p_addr[1] << 16) | (p_addr[2] << 8) |
-+							(p_addr[3] << 0);
- 
--	MV_WRITE(MV64340_ETH_MAC_ADDR_LOW(eth_port_num), mac_l);
--	MV_WRITE(MV64340_ETH_MAC_ADDR_HIGH(eth_port_num), mac_h);
-+	mv_write(MV643XX_ETH_MAC_ADDR_LOW(eth_port_num), mac_l);
-+	mv_write(MV643XX_ETH_MAC_ADDR_HIGH(eth_port_num), mac_h);
- 
- 	/* Accept frames of this address */
- 	eth_port_uc_addr(eth_port_num, p_addr[5], ACCEPT_MAC_ADDR);
-@@ -1817,29 +1918,64 @@
- }
- 
- /*
-+ * eth_port_uc_addr_get - This function retrieves the port Unicast address
-+ * (MAC address) from the ethernet hw registers.
-+ *
-+ * DESCRIPTION:
-+ *		This function retrieves the port Ethernet MAC address.
-+ *
-+ * INPUT:
-+ *	unsigned int	eth_port_num	Port number.
-+ *	char		*MacAddr	pointer where the MAC address is stored
-+ *
-+ * OUTPUT:
-+ *	Copy the MAC address to the location pointed to by MacAddr
-+ *
-+ * RETURN:
-+ *	N/A.
-+ *
-+ */
-+static void eth_port_uc_addr_get(struct net_device *dev, unsigned char *p_addr)
-+{
-+	struct mv643xx_private *mp = netdev_priv(dev);
-+	unsigned int mac_h;
-+	unsigned int mac_l;
-+
-+	mac_h = mv_read(MV643XX_ETH_MAC_ADDR_HIGH(mp->port_num));
-+	mac_l = mv_read(MV643XX_ETH_MAC_ADDR_LOW(mp->port_num));
-+
-+	p_addr[0] = (mac_h >> 24) & 0xff;
-+	p_addr[1] = (mac_h >> 16) & 0xff;
-+	p_addr[2] = (mac_h >> 8) & 0xff;
-+	p_addr[3] = mac_h & 0xff;
-+	p_addr[4] = (mac_l >> 8) & 0xff;
-+	p_addr[5] = mac_l & 0xff;
-+}
-+
-+/*
-  * eth_port_uc_addr - This function Set the port unicast address table
-  *
-  * DESCRIPTION:
-- *	This function locates the proper entry in the Unicast table for the 
-- *	specified MAC nibble and sets its properties according to function 
-+ *	This function locates the proper entry in the Unicast table for the
-+ *	specified MAC nibble and sets its properties according to function
-  *	parameters.
-  *
-  * INPUT:
-- *	unsigned int 	eth_port_num      Port number.
-- *	unsigned char uc_nibble		Unicast MAC Address last nibble. 
-- *	int 			option      0 = Add, 1 = remove address.
-+ *	unsigned int	eth_port_num	Port number.
-+ *	unsigned char	uc_nibble	Unicast MAC Address last nibble.
-+ *	int 		option		0 = Add, 1 = remove address.
-  *
-  * OUTPUT:
-  *	This function add/removes MAC addresses from the port unicast address
-- *	table. 
-+ *	table.
-  *
-  * RETURN:
-  *	true is output succeeded.
-  *	false if option parameter is invalid.
-  *
-  */
--static int eth_port_uc_addr(unsigned int eth_port_num,
--	unsigned char uc_nibble, int option)
-+static int eth_port_uc_addr(unsigned int eth_port_num, unsigned char uc_nibble,
-+								int option)
- {
- 	unsigned int unicast_reg;
- 	unsigned int tbl_offset;
-@@ -1852,29 +1988,26 @@
- 
- 	switch (option) {
- 	case REJECT_MAC_ADDR:
--		/* Clear accepts frame bit at specified unicast DA table entry */
--		unicast_reg = MV_READ((MV64340_ETH_DA_FILTER_UNICAST_TABLE_BASE
--				  (eth_port_num) + tbl_offset));
-+		/* Clear accepts frame bit at given unicast DA table entry */
-+		unicast_reg = mv_read((MV643XX_ETH_DA_FILTER_UNICAST_TABLE_BASE
-+						(eth_port_num) + tbl_offset));
- 
- 		unicast_reg &= (0x0E << (8 * reg_offset));
- 
--		MV_WRITE(
--			 (MV64340_ETH_DA_FILTER_UNICAST_TABLE_BASE
--			  (eth_port_num) + tbl_offset), unicast_reg);
-+		mv_write((MV643XX_ETH_DA_FILTER_UNICAST_TABLE_BASE
-+				(eth_port_num) + tbl_offset), unicast_reg);
- 		break;
- 
- 	case ACCEPT_MAC_ADDR:
- 		/* Set accepts frame bit at unicast DA filter table entry */
- 		unicast_reg =
--		    MV_READ(
--				 (MV64340_ETH_DA_FILTER_UNICAST_TABLE_BASE
--				  (eth_port_num) + tbl_offset));
-+			mv_read((MV643XX_ETH_DA_FILTER_UNICAST_TABLE_BASE
-+						(eth_port_num) + tbl_offset));
- 
- 		unicast_reg |= (0x01 << (8 * reg_offset));
- 
--		MV_WRITE(
--			 (MV64340_ETH_DA_FILTER_UNICAST_TABLE_BASE
--			  (eth_port_num) + tbl_offset), unicast_reg);
-+		mv_write((MV643XX_ETH_DA_FILTER_UNICAST_TABLE_BASE
-+				(eth_port_num) + tbl_offset), unicast_reg);
- 
- 		break;
- 
-@@ -1889,17 +2022,17 @@
-  * eth_port_init_mac_tables - Clear all entrance in the UC, SMC and OMC tables
-  *
-  * DESCRIPTION:
-- *       Go through all the DA filter tables (Unicast, Special Multicast &
-- *       Other Multicast) and set each entry to 0.
-+ *	Go through all the DA filter tables (Unicast, Special Multicast &
-+ *	Other Multicast) and set each entry to 0.
-  *
-  * INPUT:
-- *	unsigned int    eth_port_num   Ethernet Port number.
-+ *	unsigned int	eth_port_num	Ethernet Port number.
-  *
-  * OUTPUT:
-- *       Multicast and Unicast packets are rejected.
-+ *	Multicast and Unicast packets are rejected.
-  *
-  * RETURN:
-- *       None.
-+ *	None.
-  */
- static void eth_port_init_mac_tables(unsigned int eth_port_num)
- {
-@@ -1907,18 +2040,16 @@
- 
- 	/* Clear DA filter unicast table (Ex_dFUT) */
- 	for (table_index = 0; table_index <= 0xC; table_index += 4)
--		MV_WRITE(
--			 (MV64340_ETH_DA_FILTER_UNICAST_TABLE_BASE
--			  (eth_port_num) + table_index), 0);
-+		mv_write((MV643XX_ETH_DA_FILTER_UNICAST_TABLE_BASE
-+					(eth_port_num) + table_index), 0);
- 
- 	for (table_index = 0; table_index <= 0xFC; table_index += 4) {
- 		/* Clear DA filter special multicast table (Ex_dFSMT) */
--		MV_WRITE(
--			 (MV64340_ETH_DA_FILTER_SPECIAL_MULTICAST_TABLE_BASE
--			  (eth_port_num) + table_index), 0);
-+		mv_write((MV643XX_ETH_DA_FILTER_SPECIAL_MULTICAST_TABLE_BASE
-+					(eth_port_num) + table_index), 0);
- 		/* Clear DA filter other multicast table (Ex_dFOMT) */
--		MV_WRITE((MV64340_ETH_DA_FILTER_OTHER_MULTICAST_TABLE_BASE
--			  (eth_port_num) + table_index), 0);
-+		mv_write((MV643XX_ETH_DA_FILTER_OTHER_MULTICAST_TABLE_BASE
-+					(eth_port_num) + table_index), 0);
- 	}
- }
- 
-@@ -1926,17 +2057,17 @@
-  * eth_clear_mib_counters - Clear all MIB counters
-  *
-  * DESCRIPTION:
-- *       This function clears all MIB counters of a specific ethernet port.
-- *       A read from the MIB counter will reset the counter.
-+ *	This function clears all MIB counters of a specific ethernet port.
-+ *	A read from the MIB counter will reset the counter.
-  *
-  * INPUT:
-- *	unsigned int    eth_port_num   Ethernet Port number.
-+ *	unsigned int	eth_port_num	Ethernet Port number.
-  *
-  * OUTPUT:
-- *       After reading all MIB counters, the counters resets.
-+ *	After reading all MIB counters, the counters resets.
-  *
-  * RETURN:
-- *       MIB counter value.
-+ *	MIB counter value.
-  *
-  */
- static void eth_clear_mib_counters(unsigned int eth_port_num)
-@@ -1944,72 +2075,155 @@
- 	int i;
- 
- 	/* Perform dummy reads from MIB counters */
--	for (i = ETH_MIB_GOOD_OCTETS_RECEIVED_LOW; i < ETH_MIB_LATE_COLLISION; i += 4)
--		MV_READ(MV64340_ETH_MIB_COUNTERS_BASE(eth_port_num) + i);
-+	for (i = ETH_MIB_GOOD_OCTETS_RECEIVED_LOW; i < ETH_MIB_LATE_COLLISION;
-+									i += 4)
-+		mv_read(MV643XX_ETH_MIB_COUNTERS_BASE(eth_port_num) + i);
-+}
-+
-+static inline u32 read_mib(struct mv643xx_private *mp, int offset)
-+{
-+	return mv_read(MV643XX_ETH_MIB_COUNTERS_BASE(mp->port_num) + offset);
- }
- 
-+static void eth_update_mib_counters(struct mv643xx_private *mp)
-+{
-+	struct mv643xx_mib_counters *p = &mp->mib_counters;
-+	int offset;
-+
-+	p->good_octets_received +=
-+		read_mib(mp, ETH_MIB_GOOD_OCTETS_RECEIVED_LOW);
-+	p->good_octets_received +=
-+		(u64)read_mib(mp, ETH_MIB_GOOD_OCTETS_RECEIVED_HIGH) << 32;
-+
-+	for (offset = ETH_MIB_BAD_OCTETS_RECEIVED;
-+			offset <= ETH_MIB_FRAMES_1024_TO_MAX_OCTETS;
-+			offset += 4)
-+		*(u32 *)((char *)p + offset) = read_mib(mp, offset);
-+
-+	p->good_octets_sent += read_mib(mp, ETH_MIB_GOOD_OCTETS_SENT_LOW);
-+	p->good_octets_sent +=
-+		(u64)read_mib(mp, ETH_MIB_GOOD_OCTETS_SENT_HIGH) << 32;
-+
-+	for (offset = ETH_MIB_GOOD_FRAMES_SENT;
-+			offset <= ETH_MIB_LATE_COLLISION;
-+			offset += 4)
-+		*(u32 *)((char *)p + offset) = read_mib(mp, offset);
-+}
-+
-+/*
-+ * ethernet_phy_detect - Detect whether a phy is present
-+ *
-+ * DESCRIPTION:
-+ *	This function tests whether there is a PHY present on
-+ *	the specified port.
-+ *
-+ * INPUT:
-+ *	unsigned int	eth_port_num	Ethernet Port number.
-+ *
-+ * OUTPUT:
-+ *	None
-+ *
-+ * RETURN:
-+ *	0 on success
-+ *	-ENODEV on failure
-+ *
-+ */
-+static int ethernet_phy_detect(unsigned int port_num)
-+{
-+	unsigned int phy_reg_data0;
-+	int auto_neg;
-+
-+	eth_port_read_smi_reg(port_num, 0, &phy_reg_data0);
-+	auto_neg = phy_reg_data0 & 0x1000;
-+	phy_reg_data0 ^= 0x1000;	/* invert auto_neg */
-+	eth_port_write_smi_reg(port_num, 0, phy_reg_data0);
-+
-+	eth_port_read_smi_reg(port_num, 0, &phy_reg_data0);
-+	if ((phy_reg_data0 & 0x1000) == auto_neg)
-+		return -ENODEV;				/* change didn't take */
-+
-+	phy_reg_data0 ^= 0x1000;
-+	eth_port_write_smi_reg(port_num, 0, phy_reg_data0);
-+	return 0;
-+}
- 
- /*
-  * ethernet_phy_get - Get the ethernet port PHY address.
-  *
-  * DESCRIPTION:
-- *       This routine returns the given ethernet port PHY address.
-+ *	This routine returns the given ethernet port PHY address.
-  *
-  * INPUT:
-- *		unsigned int   eth_port_num   Ethernet Port number.
-+ *	unsigned int	eth_port_num	Ethernet Port number.
-  *
-  * OUTPUT:
-- *       None.
-+ *	None.
-  *
-  * RETURN:
-- *       PHY address.
-+ *	PHY address.
-  *
-  */
- static int ethernet_phy_get(unsigned int eth_port_num)
- {
- 	unsigned int reg_data;
- 
--	reg_data = MV_READ(MV64340_ETH_PHY_ADDR_REG);
-+	reg_data = mv_read(MV643XX_ETH_PHY_ADDR_REG);
- 
- 	return ((reg_data >> (5 * eth_port_num)) & 0x1f);
- }
- 
- /*
-+ * ethernet_phy_set - Set the ethernet port PHY address.
-+ *
-+ * DESCRIPTION:
-+ *	This routine sets the given ethernet port PHY address.
-+ *
-+ * INPUT:
-+ *	unsigned int	eth_port_num	Ethernet Port number.
-+ *	int		phy_addr	PHY address.
-+ *
-+ * OUTPUT:
-+ *	None.
-+ *
-+ * RETURN:
-+ *	None.
-+ *
-+ */
-+static void ethernet_phy_set(unsigned int eth_port_num, int phy_addr)
-+{
-+	u32 reg_data;
-+	int addr_shift = 5 * eth_port_num;
-+
-+	reg_data = mv_read(MV643XX_ETH_PHY_ADDR_REG);
-+	reg_data &= ~(0x1f << addr_shift);
-+	reg_data |= (phy_addr & 0x1f) << addr_shift;
-+	mv_write(MV643XX_ETH_PHY_ADDR_REG, reg_data);
-+}
-+
-+/*
-  * ethernet_phy_reset - Reset Ethernet port PHY.
-  *
-  * DESCRIPTION:
-- *       This routine utilize the SMI interface to reset the ethernet port PHY.
-- *       The routine waits until the link is up again or link up is timeout.
-+ *	This routine utilizes the SMI interface to reset the ethernet port PHY.
-  *
-  * INPUT:
-- *	unsigned int   eth_port_num   Ethernet Port number.
-+ *	unsigned int	eth_port_num	Ethernet Port number.
-  *
-  * OUTPUT:
-- *       The ethernet port PHY renew its link.
-+ *	The PHY is reset.
-  *
-  * RETURN:
-- *       None.
-+ *	None.
-  *
-  */
--static int ethernet_phy_reset(unsigned int eth_port_num)
-+static void ethernet_phy_reset(unsigned int eth_port_num)
- {
--	unsigned int time_out = 50;
- 	unsigned int phy_reg_data;
- 
- 	/* Reset the PHY */
- 	eth_port_read_smi_reg(eth_port_num, 0, &phy_reg_data);
- 	phy_reg_data |= 0x8000;	/* Set bit 15 to reset the PHY */
- 	eth_port_write_smi_reg(eth_port_num, 0, phy_reg_data);
--
--	/* Poll on the PHY LINK */
--	do {
--		eth_port_read_smi_reg(eth_port_num, 1, &phy_reg_data);
--
--		if (time_out-- == 0)
--			return 0;
--	} while (!(phy_reg_data & 0x20));
--
--	return 1;
- }
- 
- /*
-@@ -2017,381 +2231,358 @@
-  *
-  * DESCRIPTION:
-  * 	This routine resets the chip by aborting any SDMA engine activity and
-- *      clearing the MIB counters. The Receiver and the Transmit unit are in 
-- *      idle state after this command is performed and the port is disabled.
-+ *	clearing the MIB counters. The Receiver and the Transmit unit are in
-+ *	idle state after this command is performed and the port is disabled.
-  *
-  * INPUT:
-- *	unsigned int   eth_port_num   Ethernet Port number.
-+ *	unsigned int	eth_port_num	Ethernet Port number.
-  *
-  * OUTPUT:
-- *       Channel activity is halted.
-+ *	Channel activity is halted.
-  *
-  * RETURN:
-- *       None.
-+ *	None.
-  *
-  */
--static void eth_port_reset(unsigned int eth_port_num)
-+static void eth_port_reset(unsigned int port_num)
- {
- 	unsigned int reg_data;
- 
- 	/* Stop Tx port activity. Check port Tx activity. */
--	reg_data =
--	    MV_READ(MV64340_ETH_TRANSMIT_QUEUE_COMMAND_REG(eth_port_num));
-+	reg_data = mv_read(MV643XX_ETH_TRANSMIT_QUEUE_COMMAND_REG(port_num));
- 
- 	if (reg_data & 0xFF) {
- 		/* Issue stop command for active channels only */
--		MV_WRITE(MV64340_ETH_TRANSMIT_QUEUE_COMMAND_REG
--			 (eth_port_num), (reg_data << 8));
-+		mv_write(MV643XX_ETH_TRANSMIT_QUEUE_COMMAND_REG(port_num),
-+							(reg_data << 8));
- 
- 		/* Wait for all Tx activity to terminate. */
--		do {
--			/* Check port cause register that all Tx queues are stopped */
--			reg_data =
--			    MV_READ
--			    (MV64340_ETH_TRANSMIT_QUEUE_COMMAND_REG
--			     (eth_port_num));
--		}
--		while (reg_data & 0xFF);
-+		/* Check port cause register that all Tx queues are stopped */
-+		while (mv_read(MV643XX_ETH_TRANSMIT_QUEUE_COMMAND_REG(port_num))
-+									& 0xFF)
-+			udelay(10);
- 	}
- 
- 	/* Stop Rx port activity. Check port Rx activity. */
--	reg_data =
--	    MV_READ(MV64340_ETH_RECEIVE_QUEUE_COMMAND_REG
--			 (eth_port_num));
-+	reg_data = mv_read(MV643XX_ETH_RECEIVE_QUEUE_COMMAND_REG(port_num));
- 
- 	if (reg_data & 0xFF) {
- 		/* Issue stop command for active channels only */
--		MV_WRITE(MV64340_ETH_RECEIVE_QUEUE_COMMAND_REG
--			 (eth_port_num), (reg_data << 8));
-+		mv_write(MV643XX_ETH_RECEIVE_QUEUE_COMMAND_REG(port_num),
-+							(reg_data << 8));
- 
- 		/* Wait for all Rx activity to terminate. */
--		do {
--			/* Check port cause register that all Rx queues are stopped */
--			reg_data =
--			    MV_READ
--			    (MV64340_ETH_RECEIVE_QUEUE_COMMAND_REG
--			     (eth_port_num));
--		}
--		while (reg_data & 0xFF);
-+		/* Check port cause register that all Rx queues are stopped */
-+		while (mv_read(MV643XX_ETH_RECEIVE_QUEUE_COMMAND_REG(port_num))
-+									& 0xFF)
-+			udelay(10);
- 	}
- 
--
- 	/* Clear all MIB counters */
--	eth_clear_mib_counters(eth_port_num);
-+	eth_clear_mib_counters(port_num);
- 
- 	/* Reset the Enable bit in the Configuration Register */
--	reg_data =
--	    MV_READ(MV64340_ETH_PORT_SERIAL_CONTROL_REG (eth_port_num));
--	reg_data &= ~ETH_SERIAL_PORT_ENABLE;
--	MV_WRITE(MV64340_ETH_PORT_SERIAL_CONTROL_REG(eth_port_num), reg_data);
--
--	return;
-+	reg_data = mv_read(MV643XX_ETH_PORT_SERIAL_CONTROL_REG(port_num));
-+	reg_data &= ~MV643XX_ETH_SERIAL_PORT_ENABLE;
-+	mv_write(MV643XX_ETH_PORT_SERIAL_CONTROL_REG(port_num), reg_data);
- }
- 
- /*
-  * ethernet_set_config_reg - Set specified bits in configuration register.
-  *
-  * DESCRIPTION:
-- *       This function sets specified bits in the given ethernet 
-- *       configuration register. 
-+ *	This function sets specified bits in the given ethernet
-+ *	configuration register.
-  *
-  * INPUT:
-- *	unsigned int   eth_port_num   Ethernet Port number.
-- *      unsigned int    value   32 bit value.
-+ *	unsigned int	eth_port_num	Ethernet Port number.
-+ *	unsigned int	value		32 bit value.
-  *
-  * OUTPUT:
-- *      The set bits in the value parameter are set in the configuration 
-- *      register.
-+ *	The set bits in the value parameter are set in the configuration
-+ *	register.
-  *
-  * RETURN:
-- *      None.
-+ *	None.
-  *
-  */
- static void ethernet_set_config_reg(unsigned int eth_port_num,
--				    unsigned int value)
-+							unsigned int value)
- {
- 	unsigned int eth_config_reg;
- 
--	eth_config_reg =
--	    MV_READ(MV64340_ETH_PORT_CONFIG_REG(eth_port_num));
-+	eth_config_reg = mv_read(MV643XX_ETH_PORT_CONFIG_REG(eth_port_num));
- 	eth_config_reg |= value;
--	MV_WRITE(MV64340_ETH_PORT_CONFIG_REG(eth_port_num),
--		 eth_config_reg);
-+	mv_write(MV643XX_ETH_PORT_CONFIG_REG(eth_port_num), eth_config_reg);
-+}
-+
-+static int eth_port_autoneg_supported(unsigned int eth_port_num)
-+{
-+	unsigned int phy_reg_data0;
-+
-+	eth_port_read_smi_reg(eth_port_num, 0, &phy_reg_data0);
-+
-+	return phy_reg_data0 & 0x1000;
-+}
-+
-+static int eth_port_link_is_up(unsigned int eth_port_num)
-+{
-+	unsigned int phy_reg_data1;
-+
-+	eth_port_read_smi_reg(eth_port_num, 1, &phy_reg_data1);
-+
-+	if (eth_port_autoneg_supported(eth_port_num)) {
-+		if (phy_reg_data1 & 0x20)	/* auto-neg complete */
-+			return 1;
-+	} else if (phy_reg_data1 & 0x4)		/* link up */
-+		return 1;
-+
-+	return 0;
- }
- 
- /*
-  * ethernet_get_config_reg - Get the port configuration register
-  *
-  * DESCRIPTION:
-- *       This function returns the configuration register value of the given 
-- *       ethernet port.
-+ *	This function returns the configuration register value of the given
-+ *	ethernet port.
-  *
-  * INPUT:
-- *	unsigned int   eth_port_num   Ethernet Port number.
-+ *	unsigned int	eth_port_num	Ethernet Port number.
-  *
-  * OUTPUT:
-- *       None.
-+ *	None.
-  *
-  * RETURN:
-- *       Port configuration register value.
-+ *	Port configuration register value.
-  */
- static unsigned int ethernet_get_config_reg(unsigned int eth_port_num)
- {
- 	unsigned int eth_config_reg;
- 
--	eth_config_reg = MV_READ(MV64340_ETH_PORT_CONFIG_EXTEND_REG
--				      (eth_port_num));
-+	eth_config_reg = mv_read(MV643XX_ETH_PORT_CONFIG_EXTEND_REG
-+								(eth_port_num));
- 	return eth_config_reg;
- }
- 
--
- /*
-  * eth_port_read_smi_reg - Read PHY registers
-  *
-  * DESCRIPTION:
-- *       This routine utilize the SMI interface to interact with the PHY in 
-- *       order to perform PHY register read.
-+ *	This routine utilize the SMI interface to interact with the PHY in
-+ *	order to perform PHY register read.
-  *
-  * INPUT:
-- *	unsigned int   eth_port_num   Ethernet Port number.
-- *       unsigned int   phy_reg   PHY register address offset.
-- *       unsigned int   *value   Register value buffer.
-+ *	unsigned int	port_num	Ethernet Port number.
-+ *	unsigned int	phy_reg		PHY register address offset.
-+ *	unsigned int	*value		Register value buffer.
-  *
-  * OUTPUT:
-- *       Write the value of a specified PHY register into given buffer.
-+ *	Write the value of a specified PHY register into given buffer.
-  *
-  * RETURN:
-- *       false if the PHY is busy or read data is not in valid state.
-- *       true otherwise.
-+ *	false if the PHY is busy or read data is not in valid state.
-+ *	true otherwise.
-  *
-  */
--static int eth_port_read_smi_reg(unsigned int eth_port_num,
--	unsigned int phy_reg, unsigned int *value)
-+static void eth_port_read_smi_reg(unsigned int port_num,
-+				unsigned int phy_reg, unsigned int *value)
- {
--	int phy_addr = ethernet_phy_get(eth_port_num);
--	unsigned int time_out = PHY_BUSY_TIMEOUT;
--	unsigned int reg_value;
--
--	/* first check that it is not busy */
--	do {
--		reg_value = MV_READ(MV64340_ETH_SMI_REG);
--		if (time_out-- == 0)
--			return 0;
--	} while (reg_value & ETH_SMI_BUSY);
--
--	/* not busy */
--
--	MV_WRITE(MV64340_ETH_SMI_REG,
--		 (phy_addr << 16) | (phy_reg << 21) | ETH_SMI_OPCODE_READ);
--
--	time_out = PHY_BUSY_TIMEOUT;	/* initialize the time out var again */
-+	int phy_addr = ethernet_phy_get(port_num);
-+	unsigned long flags;
-+	int i;
- 
--	do {
--		reg_value = MV_READ(MV64340_ETH_SMI_REG);
--		if (time_out-- == 0)
--			return 0;
--	} while (reg_value & ETH_SMI_READ_VALID);
-+	/* the SMI register is a shared resource */
-+	spin_lock_irqsave(&mv643xx_eth_phy_lock, flags);
- 
--	/* Wait for the data to update in the SMI register */
--	for (time_out = 0; time_out < PHY_BUSY_TIMEOUT; time_out++);
-+	/* wait for the SMI register to become available */
-+	for (i = 0; mv_read(MV643XX_ETH_SMI_REG) & ETH_SMI_BUSY; i++) {
-+		if (i == PHY_WAIT_ITERATIONS) {
-+			printk("mv643xx PHY busy timeout, port %d\n", port_num);
-+			goto out;
-+		}
-+		udelay(PHY_WAIT_MICRO_SECONDS);
-+	}
- 
--	reg_value = MV_READ(MV64340_ETH_SMI_REG);
-+	mv_write(MV643XX_ETH_SMI_REG,
-+		(phy_addr << 16) | (phy_reg << 21) | ETH_SMI_OPCODE_READ);
- 
--	*value = reg_value & 0xffff;
-+	/* now wait for the data to be valid */
-+	for (i = 0; !(mv_read(MV643XX_ETH_SMI_REG) & ETH_SMI_READ_VALID); i++) {
-+		if (i == PHY_WAIT_ITERATIONS) {
-+			printk("mv643xx PHY read timeout, port %d\n", port_num);
-+			goto out;
-+		}
-+		udelay(PHY_WAIT_MICRO_SECONDS);
-+	}
- 
--	return 1;
-+	*value = mv_read(MV643XX_ETH_SMI_REG) & 0xffff;
-+out:
-+	spin_unlock_irqrestore(&mv643xx_eth_phy_lock, flags);
- }
- 
- /*
-  * eth_port_write_smi_reg - Write to PHY registers
-  *
-  * DESCRIPTION:
-- *       This routine utilize the SMI interface to interact with the PHY in 
-- *       order to perform writes to PHY registers.
-+ *	This routine utilize the SMI interface to interact with the PHY in
-+ *	order to perform writes to PHY registers.
-  *
-  * INPUT:
-- *	unsigned int   eth_port_num   Ethernet Port number.
-- *      unsigned int   phy_reg   PHY register address offset.
-- *      unsigned int    value   Register value.
-+ *	unsigned int	eth_port_num	Ethernet Port number.
-+ *	unsigned int	phy_reg		PHY register address offset.
-+ *	unsigned int	value		Register value.
-  *
-  * OUTPUT:
-- *      Write the given value to the specified PHY register.
-+ *	Write the given value to the specified PHY register.
-  *
-  * RETURN:
-- *      false if the PHY is busy.
-- *      true otherwise.
-+ *	false if the PHY is busy.
-+ *	true otherwise.
-  *
-  */
--static int eth_port_write_smi_reg(unsigned int eth_port_num,
--	unsigned int phy_reg, unsigned int value)
-+static void eth_port_write_smi_reg(unsigned int eth_port_num,
-+				   unsigned int phy_reg, unsigned int value)
- {
--	unsigned int time_out = PHY_BUSY_TIMEOUT;
--	unsigned int reg_value;
- 	int phy_addr;
-+	int i;
-+	unsigned long flags;
- 
- 	phy_addr = ethernet_phy_get(eth_port_num);
- 
--	/* first check that it is not busy */
--	do {
--		reg_value = MV_READ(MV64340_ETH_SMI_REG);
--		if (time_out-- == 0)
--			return 0;
--	} while (reg_value & ETH_SMI_BUSY);
--
--	/* not busy */
--	MV_WRITE(MV64340_ETH_SMI_REG, (phy_addr << 16) | (phy_reg << 21) |
--		 ETH_SMI_OPCODE_WRITE | (value & 0xffff));
-+	/* the SMI register is a shared resource */
-+	spin_lock_irqsave(&mv643xx_eth_phy_lock, flags);
- 
--	return 1;
-+	/* wait for the SMI register to become available */
-+	for (i = 0; mv_read(MV643XX_ETH_SMI_REG) & ETH_SMI_BUSY; i++) {
-+		if (i == PHY_WAIT_ITERATIONS) {
-+			printk("mv643xx PHY busy timeout, port %d\n",
-+								eth_port_num);
-+			goto out;
-+		}
-+		udelay(PHY_WAIT_MICRO_SECONDS);
-+	}
-+
-+	mv_write(MV643XX_ETH_SMI_REG, (phy_addr << 16) | (phy_reg << 21) |
-+				ETH_SMI_OPCODE_WRITE | (value & 0xffff));
-+out:
-+	spin_unlock_irqrestore(&mv643xx_eth_phy_lock, flags);
- }
- 
- /*
-  * eth_port_send - Send an Ethernet packet
-  *
-  * DESCRIPTION:
-- *	This routine send a given packet described by p_pktinfo parameter. It 
-- *      supports transmitting of a packet spaned over multiple buffers. The 
-- *      routine updates 'curr' and 'first' indexes according to the packet 
-- *      segment passed to the routine. In case the packet segment is first, 
-- *      the 'first' index is update. In any case, the 'curr' index is updated. 
-- *      If the routine get into Tx resource error it assigns 'curr' index as 
-- *      'first'. This way the function can abort Tx process of multiple 
-- *      descriptors per packet.
-+ *	This routine send a given packet described by p_pktinfo parameter. It
-+ *	supports transmitting of a packet spaned over multiple buffers. The
-+ *	routine updates 'curr' and 'first' indexes according to the packet
-+ *	segment passed to the routine. In case the packet segment is first,
-+ *	the 'first' index is update. In any case, the 'curr' index is updated.
-+ *	If the routine get into Tx resource error it assigns 'curr' index as
-+ *	'first'. This way the function can abort Tx process of multiple
-+ *	descriptors per packet.
-  *
-  * INPUT:
-- *	struct mv64340_private   *mp   Ethernet Port Control srtuct. 
-- *	struct pkt_info        *p_pkt_info       User packet buffer.
-+ *	struct mv643xx_private	*mp		Ethernet Port Control srtuct.
-+ *	struct pkt_info		*p_pkt_info	User packet buffer.
-  *
-  * OUTPUT:
-- *	Tx ring 'curr' and 'first' indexes are updated. 
-+ *	Tx ring 'curr' and 'first' indexes are updated.
-  *
-  * RETURN:
-- *      ETH_QUEUE_FULL in case of Tx resource error.
-+ *	ETH_QUEUE_FULL in case of Tx resource error.
-  *	ETH_ERROR in case the routine can not access Tx desc ring.
-  *	ETH_QUEUE_LAST_RESOURCE if the routine uses the last Tx resource.
-- *      ETH_OK otherwise.
-+ *	ETH_OK otherwise.
-  *
-  */
--#ifdef  MV64340_CHECKSUM_OFFLOAD_TX
-+#ifdef MV643XX_CHECKSUM_OFFLOAD_TX
- /*
-  * Modified to include the first descriptor pointer in case of SG
-  */
--static ETH_FUNC_RET_STATUS eth_port_send(struct mv64340_private * mp,
--                                         struct pkt_info * p_pkt_info)
-+static ETH_FUNC_RET_STATUS eth_port_send(struct mv643xx_private *mp,
-+					 struct pkt_info *p_pkt_info)
- {
- 	int tx_desc_curr, tx_desc_used, tx_first_desc, tx_next_desc;
--	volatile struct eth_tx_desc *current_descriptor;
--	volatile struct eth_tx_desc *first_descriptor;
--	u32 command_status, first_chip_ptr;
-+	struct eth_tx_desc *current_descriptor;
-+	struct eth_tx_desc *first_descriptor;
-+	u32 command;
- 
- 	/* Do not process Tx ring in case of Tx ring resource error */
- 	if (mp->tx_resource_err)
- 		return ETH_QUEUE_FULL;
- 
-+	/*
-+	 * The hardware requires that each buffer that is <= 8 bytes
-+	 * in length must be aligned on an 8 byte boundary.
-+	 */
-+	if (p_pkt_info->byte_cnt <= 8 && p_pkt_info->buf_ptr & 0x7) {
-+		printk(KERN_ERR
-+			"mv643xx_eth port %d: packet size <= 8 problem\n",
-+			mp->port_num);
-+		return ETH_ERROR;
-+	}
-+
- 	/* Get the Tx Desc ring indexes */
- 	tx_desc_curr = mp->tx_curr_desc_q;
- 	tx_desc_used = mp->tx_used_desc_q;
- 
- 	current_descriptor = &mp->p_tx_desc_area[tx_desc_curr];
--	if (current_descriptor == NULL)
--		return ETH_ERROR;
- 
--	tx_next_desc = (tx_desc_curr + 1) % MV64340_TX_QUEUE_SIZE;
--	command_status = p_pkt_info->cmd_sts | ETH_ZERO_PADDING | ETH_GEN_CRC;
-+	tx_next_desc = (tx_desc_curr + 1) % mp->tx_ring_size;
-+
-+	current_descriptor->buf_ptr = p_pkt_info->buf_ptr;
-+	current_descriptor->byte_cnt = p_pkt_info->byte_cnt;
-+	current_descriptor->l4i_chk = p_pkt_info->l4i_chk;
-+	mp->tx_skb[tx_desc_curr] = p_pkt_info->return_info;
- 
--	if (command_status & ETH_TX_FIRST_DESC) {
-+	command = p_pkt_info->cmd_sts | ETH_ZERO_PADDING | ETH_GEN_CRC |
-+							ETH_BUFFER_OWNED_BY_DMA;
-+	if (command & ETH_TX_FIRST_DESC) {
- 		tx_first_desc = tx_desc_curr;
- 		mp->tx_first_desc_q = tx_first_desc;
-+		first_descriptor = current_descriptor;
-+		mp->tx_first_command = command;
-+	} else {
-+		tx_first_desc = mp->tx_first_desc_q;
-+		first_descriptor = &mp->p_tx_desc_area[tx_first_desc];
-+		BUG_ON(first_descriptor == NULL);
-+		current_descriptor->cmd_sts = command;
-+	}
- 
--                /* fill first descriptor */
--                first_descriptor = &mp->p_tx_desc_area[tx_desc_curr];
--                first_descriptor->l4i_chk = p_pkt_info->l4i_chk;
--                first_descriptor->cmd_sts = command_status;
--                first_descriptor->byte_cnt = p_pkt_info->byte_cnt;
--                first_descriptor->buf_ptr = p_pkt_info->buf_ptr;
--                first_descriptor->next_desc_ptr = mp->tx_desc_dma +
--			tx_next_desc * sizeof(struct eth_tx_desc);
-+	if (command & ETH_TX_LAST_DESC) {
- 		wmb();
--        } else {
--                tx_first_desc = mp->tx_first_desc_q;
--                first_descriptor = &mp->p_tx_desc_area[tx_first_desc];
--                if (first_descriptor == NULL) {
--                        printk("First desc is NULL !!\n");
--                        return ETH_ERROR;
--                }
--                if (command_status & ETH_TX_LAST_DESC)
--                        current_descriptor->next_desc_ptr = 0x00000000;
--                else {
--                        command_status |= ETH_BUFFER_OWNED_BY_DMA;
--                        current_descriptor->next_desc_ptr = mp->tx_desc_dma +
--				tx_next_desc * sizeof(struct eth_tx_desc);
--                }
--        }
--
--        if (p_pkt_info->byte_cnt < 8) {
--                printk(" < 8 problem \n");
--                return ETH_ERROR;
--        }
--
--        current_descriptor->buf_ptr = p_pkt_info->buf_ptr;
--        current_descriptor->byte_cnt = p_pkt_info->byte_cnt;
--        current_descriptor->l4i_chk = p_pkt_info->l4i_chk;
--        current_descriptor->cmd_sts = command_status;
--
--        mp->tx_skb[tx_desc_curr] = (struct sk_buff*) p_pkt_info->return_info;
--
--        wmb();
--
--        /* Set last desc with DMA ownership and interrupt enable. */
--        if (command_status & ETH_TX_LAST_DESC) {
--                current_descriptor->cmd_sts = command_status |
--                                        ETH_TX_ENABLE_INTERRUPT |
--                                        ETH_BUFFER_OWNED_BY_DMA;
-+		first_descriptor->cmd_sts = mp->tx_first_command;
- 
--		if (!(command_status & ETH_TX_FIRST_DESC))
--			first_descriptor->cmd_sts |= ETH_BUFFER_OWNED_BY_DMA;
- 		wmb();
--
--		first_chip_ptr = MV_READ(MV64340_ETH_CURRENT_SERVED_TX_DESC_PTR(mp->port_num));
--
--		/* Apply send command */
--		if (first_chip_ptr == 0x00000000)
--			MV_WRITE(MV64340_ETH_TX_CURRENT_QUEUE_DESC_PTR_0(mp->port_num), (struct eth_tx_desc *) mp->tx_desc_dma + tx_first_desc);
--
--                ETH_ENABLE_TX_QUEUE(mp->port_num);
-+		ETH_ENABLE_TX_QUEUE(mp->port_num);
- 
- 		/*
- 		 * Finish Tx packet. Update first desc in case of Tx resource
- 		 * error */
--                tx_first_desc = tx_next_desc;
--                mp->tx_first_desc_q = tx_first_desc;
--	} else {
--		if (! (command_status & ETH_TX_FIRST_DESC) ) {
--			current_descriptor->cmd_sts = command_status;
--			wmb();
--		}
-+		tx_first_desc = tx_next_desc;
-+		mp->tx_first_desc_q = tx_first_desc;
- 	}
- 
--        /* Check for ring index overlap in the Tx desc ring */
--        if (tx_next_desc == tx_desc_used) {
--                mp->tx_resource_err = 1;
--                mp->tx_curr_desc_q = tx_first_desc;
-+	/* Check for ring index overlap in the Tx desc ring */
-+	if (tx_next_desc == tx_desc_used) {
-+		mp->tx_resource_err = 1;
-+		mp->tx_curr_desc_q = tx_first_desc;
- 
--                return ETH_QUEUE_LAST_RESOURCE;
-+		return ETH_QUEUE_LAST_RESOURCE;
- 	}
- 
--        mp->tx_curr_desc_q = tx_next_desc;
--        wmb();
-+	mp->tx_curr_desc_q = tx_next_desc;
- 
--        return ETH_OK;
-+	return ETH_OK;
- }
- #else
--static ETH_FUNC_RET_STATUS eth_port_send(struct mv64340_private * mp,
--					 struct pkt_info * p_pkt_info)
-+static ETH_FUNC_RET_STATUS eth_port_send(struct mv643xx_private *mp,
-+					 struct pkt_info *p_pkt_info)
- {
- 	int tx_desc_curr;
- 	int tx_desc_used;
--	volatile struct eth_tx_desc* current_descriptor;
-+	struct eth_tx_desc *current_descriptor;
- 	unsigned int command_status;
- 
- 	/* Do not process Tx ring in case of Tx ring resource error */
-@@ -2403,39 +2594,24 @@
- 	tx_desc_used = mp->tx_used_desc_q;
- 	current_descriptor = &mp->p_tx_desc_area[tx_desc_curr];
- 
--	if (current_descriptor == NULL)
--		return ETH_ERROR;
--
- 	command_status = p_pkt_info->cmd_sts | ETH_ZERO_PADDING | ETH_GEN_CRC;
--
--/* XXX Is this for real ?!?!? */
--	/* Buffers with a payload smaller than 8 bytes must be aligned to a
--	 * 64-bit boundary. We use the memory allocated for Tx descriptor.
--	 * This memory is located in TX_BUF_OFFSET_IN_DESC offset within the
--	 * Tx descriptor. */
--	if (p_pkt_info->byte_cnt <= 8) {
--		printk(KERN_ERR
--		       "You have failed in the < 8 bytes errata - fixme\n");
--		return ETH_ERROR;
--	}
- 	current_descriptor->buf_ptr = p_pkt_info->buf_ptr;
- 	current_descriptor->byte_cnt = p_pkt_info->byte_cnt;
--	mp->tx_skb[tx_desc_curr] = (struct sk_buff *) p_pkt_info->return_info;
--
--	mb();
-+	mp->tx_skb[tx_desc_curr] = p_pkt_info->return_info;
- 
- 	/* Set last desc with DMA ownership and interrupt enable. */
-+	wmb();
- 	current_descriptor->cmd_sts = command_status |
- 			ETH_BUFFER_OWNED_BY_DMA | ETH_TX_ENABLE_INTERRUPT;
- 
--	/* Apply send command */
-+	wmb();
- 	ETH_ENABLE_TX_QUEUE(mp->port_num);
- 
- 	/* Finish Tx packet. Update first desc in case of Tx resource error */
--	tx_desc_curr = (tx_desc_curr + 1) % MV64340_TX_QUEUE_SIZE;
-+	tx_desc_curr = (tx_desc_curr + 1) % mp->tx_ring_size;
- 
- 	/* Update the current descriptor */
-- 	mp->tx_curr_desc_q = tx_desc_curr;
-+	mp->tx_curr_desc_q = tx_desc_curr;
- 
- 	/* Check for ring index overlap in the Tx desc ring */
- 	if (tx_desc_curr == tx_desc_used) {
-@@ -2452,62 +2628,55 @@
-  *
-  * DESCRIPTION:
-  *	This routine returns the transmitted packet information to the caller.
-- *      It uses the 'first' index to support Tx desc return in case a transmit 
-- *      of a packet spanned over multiple buffer still in process.
-- *      In case the Tx queue was in "resource error" condition, where there are 
-- *      no available Tx resources, the function resets the resource error flag.
-+ *	It uses the 'first' index to support Tx desc return in case a transmit
-+ *	of a packet spanned over multiple buffer still in process.
-+ *	In case the Tx queue was in "resource error" condition, where there are
-+ *	no available Tx resources, the function resets the resource error flag.
-  *
-  * INPUT:
-- *	struct mv64340_private   *mp   Ethernet Port Control srtuct. 
-- *	struct pkt_info        *p_pkt_info       User packet buffer.
-+ *	struct mv643xx_private	*mp		Ethernet Port Control srtuct.
-+ *	struct pkt_info		*p_pkt_info	User packet buffer.
-  *
-  * OUTPUT:
-- *	Tx ring 'first' and 'used' indexes are updated. 
-+ *	Tx ring 'first' and 'used' indexes are updated.
-  *
-  * RETURN:
-  *	ETH_ERROR in case the routine can not access Tx desc ring.
-- *      ETH_RETRY in case there is transmission in process.
-+ *	ETH_RETRY in case there is transmission in process.
-  *	ETH_END_OF_JOB if the routine has nothing to release.
-- *      ETH_OK otherwise.
-+ *	ETH_OK otherwise.
-  *
-  */
--static ETH_FUNC_RET_STATUS eth_tx_return_desc(struct mv64340_private * mp,
--					      struct pkt_info * p_pkt_info)
-+static ETH_FUNC_RET_STATUS eth_tx_return_desc(struct mv643xx_private *mp,
-+						struct pkt_info *p_pkt_info)
- {
--	int tx_desc_used, tx_desc_curr;
--#ifdef MV64340_CHECKSUM_OFFLOAD_TX
--        int tx_first_desc;
-+	int tx_desc_used;
-+#ifdef MV643XX_CHECKSUM_OFFLOAD_TX
-+	int tx_busy_desc = mp->tx_first_desc_q;
-+#else
-+	int tx_busy_desc = mp->tx_curr_desc_q;
- #endif
--	volatile struct eth_tx_desc *p_tx_desc_used;
-+	struct eth_tx_desc *p_tx_desc_used;
- 	unsigned int command_status;
- 
- 	/* Get the Tx Desc ring indexes */
--	tx_desc_curr = mp->tx_curr_desc_q;
- 	tx_desc_used = mp->tx_used_desc_q;
--#ifdef MV64340_CHECKSUM_OFFLOAD_TX
--        tx_first_desc = mp->tx_first_desc_q;
--#endif
-+
- 	p_tx_desc_used = &mp->p_tx_desc_area[tx_desc_used];
- 
--	/* XXX Sanity check */
-+	/* Sanity check */
- 	if (p_tx_desc_used == NULL)
- 		return ETH_ERROR;
- 
-+	/* Stop release. About to overlap the current available Tx descriptor */
-+	if (tx_desc_used == tx_busy_desc && !mp->tx_resource_err)
-+		return ETH_END_OF_JOB;
-+
- 	command_status = p_tx_desc_used->cmd_sts;
- 
- 	/* Still transmitting... */
--#ifndef MV64340_CHECKSUM_OFFLOAD_TX
- 	if (command_status & (ETH_BUFFER_OWNED_BY_DMA))
- 		return ETH_RETRY;
--#endif
--	/* Stop release. About to overlap the current available Tx descriptor */
--#ifdef MV64340_CHECKSUM_OFFLOAD_TX
--	if (tx_desc_used == tx_first_desc && !mp->tx_resource_err)
--		return ETH_END_OF_JOB;
--#else
--	if (tx_desc_used == tx_desc_curr && !mp->tx_resource_err)
--		return ETH_END_OF_JOB;
--#endif
- 
- 	/* Pass the packet information to the caller */
- 	p_pkt_info->cmd_sts = command_status;
-@@ -2515,7 +2684,7 @@
- 	mp->tx_skb[tx_desc_used] = NULL;
- 
- 	/* Update the next descriptor to release. */
--	mp->tx_used_desc_q = (tx_desc_used + 1) % MV64340_TX_QUEUE_SIZE;
-+	mp->tx_used_desc_q = (tx_desc_used + 1) % mp->tx_ring_size;
- 
- 	/* Any Tx return cancels the Tx resource error status */
- 	mp->tx_resource_err = 0;
-@@ -2527,30 +2696,30 @@
-  * eth_port_receive - Get received information from Rx ring.
-  *
-  * DESCRIPTION:
-- * 	This routine returns the received data to the caller. There is no 
-- *	data copying during routine operation. All information is returned 
-- *	using pointer to packet information struct passed from the caller. 
-- *      If the routine exhausts	Rx ring resources then the resource error flag 
-- *      is set.  
-+ * 	This routine returns the received data to the caller. There is no
-+ *	data copying during routine operation. All information is returned
-+ *	using pointer to packet information struct passed from the caller.
-+ *	If the routine exhausts Rx ring resources then the resource error flag
-+ *	is set.
-  *
-  * INPUT:
-- *	struct mv64340_private   *mp   Ethernet Port Control srtuct. 
-- *	struct pkt_info        *p_pkt_info       User packet buffer.
-+ *	struct mv643xx_private	*mp		Ethernet Port Control srtuct.
-+ *	struct pkt_info		*p_pkt_info	User packet buffer.
-  *
-  * OUTPUT:
-- *	Rx ring current and used indexes are updated. 
-+ *	Rx ring current and used indexes are updated.
-  *
-  * RETURN:
-  *	ETH_ERROR in case the routine can not access Rx desc ring.
-  *	ETH_QUEUE_FULL if Rx ring resources are exhausted.
-  *	ETH_END_OF_JOB if there is no received data.
-- *      ETH_OK otherwise.
-+ *	ETH_OK otherwise.
-  */
--static ETH_FUNC_RET_STATUS eth_port_receive(struct mv64340_private * mp,
--					    struct pkt_info * p_pkt_info)
-+static ETH_FUNC_RET_STATUS eth_port_receive(struct mv643xx_private *mp,
-+						struct pkt_info *p_pkt_info)
- {
- 	int rx_next_curr_desc, rx_curr_desc, rx_used_desc;
--	volatile struct eth_rx_desc * p_rx_desc;
-+	volatile struct eth_rx_desc *p_rx_desc;
- 	unsigned int command_status;
- 
- 	/* Do not process Rx ring in case of Rx ring resource error */
-@@ -2565,6 +2734,7 @@
- 
- 	/* The following parameters are used to save readings from memory */
- 	command_status = p_rx_desc->cmd_sts;
-+	rmb();
- 
- 	/* Nothing to receive... */
- 	if (command_status & (ETH_BUFFER_OWNED_BY_DMA))
-@@ -2577,18 +2747,17 @@
- 	p_pkt_info->l4i_chk = p_rx_desc->buf_size;
- 
- 	/* Clean the return info field to indicate that the packet has been */
--	/* moved to the upper layers                                        */
-+	/* moved to the upper layers					    */
- 	mp->rx_skb[rx_curr_desc] = NULL;
- 
- 	/* Update current index in data structure */
--	rx_next_curr_desc = (rx_curr_desc + 1) % MV64340_RX_QUEUE_SIZE;
-+	rx_next_curr_desc = (rx_curr_desc + 1) % mp->rx_ring_size;
- 	mp->rx_curr_desc_q = rx_next_curr_desc;
- 
- 	/* Rx descriptors exhausted. Set the Rx ring resource error flag */
- 	if (rx_next_curr_desc == rx_used_desc)
- 		mp->rx_resource_err = 1;
- 
--	mb();
- 	return ETH_OK;
- }
- 
-@@ -2596,27 +2765,27 @@
-  * eth_rx_return_buff - Returns a Rx buffer back to the Rx ring.
-  *
-  * DESCRIPTION:
-- *	This routine returns a Rx buffer back to the Rx ring. It retrieves the 
-- *      next 'used' descriptor and attached the returned buffer to it.
-- *      In case the Rx ring was in "resource error" condition, where there are 
-- *      no available Rx resources, the function resets the resource error flag.
-+ *	This routine returns a Rx buffer back to the Rx ring. It retrieves the
-+ *	next 'used' descriptor and attached the returned buffer to it.
-+ *	In case the Rx ring was in "resource error" condition, where there are
-+ *	no available Rx resources, the function resets the resource error flag.
-  *
-  * INPUT:
-- *	struct mv64340_private *mp   Ethernet Port Control srtuct. 
-- *      struct pkt_info        *p_pkt_info   Information on the returned buffer.
-+ *	struct mv643xx_private	*mp		Ethernet Port Control srtuct.
-+ *	struct pkt_info		*p_pkt_info	Information on returned buffer.
-  *
-  * OUTPUT:
-  *	New available Rx resource in Rx descriptor ring.
-  *
-  * RETURN:
-  *	ETH_ERROR in case the routine can not access Rx desc ring.
-- *      ETH_OK otherwise.
-+ *	ETH_OK otherwise.
-  */
--static ETH_FUNC_RET_STATUS eth_rx_return_buff(struct mv64340_private * mp,
--	struct pkt_info * p_pkt_info)
-+static ETH_FUNC_RET_STATUS eth_rx_return_buff(struct mv643xx_private *mp,
-+						struct pkt_info *p_pkt_info)
- {
- 	int used_rx_desc;	/* Where to return Rx resource */
--	volatile struct eth_rx_desc* p_used_rx_desc;
-+	volatile struct eth_rx_desc *p_used_rx_desc;
- 
- 	/* Get 'used' Rx descriptor */
- 	used_rx_desc = mp->rx_used_desc_q;
-@@ -2627,20 +2796,240 @@
- 	mp->rx_skb[used_rx_desc] = p_pkt_info->return_info;
- 
- 	/* Flush the write pipe */
--	mb();
- 
- 	/* Return the descriptor to DMA ownership */
-+	wmb();
- 	p_used_rx_desc->cmd_sts =
--		ETH_BUFFER_OWNED_BY_DMA | ETH_RX_ENABLE_INTERRUPT;
--
--	/* Flush descriptor and CPU pipe */
--	mb();
-+			ETH_BUFFER_OWNED_BY_DMA | ETH_RX_ENABLE_INTERRUPT;
-+	wmb();
- 
- 	/* Move the used descriptor pointer to the next descriptor */
--	mp->rx_used_desc_q = (used_rx_desc + 1) % MV64340_RX_QUEUE_SIZE;
-+	mp->rx_used_desc_q = (used_rx_desc + 1) % mp->rx_ring_size;
- 
- 	/* Any Rx return cancels the Rx resource error status */
- 	mp->rx_resource_err = 0;
- 
- 	return ETH_OK;
- }
-+
-+/************* Begin ethtool support *************************/
-+
-+struct mv643xx_stats {
-+	char stat_string[ETH_GSTRING_LEN];
-+	int sizeof_stat;
-+	int stat_offset;
-+};
-+
-+#define MV643XX_STAT(m) sizeof(((struct mv643xx_private *)0)->m), \
-+		      offsetof(struct mv643xx_private, m)
-+
-+static const struct mv643xx_stats mv643xx_gstrings_stats[] = {
-+	{ "rx_packets", MV643XX_STAT(stats.rx_packets) },
-+	{ "tx_packets", MV643XX_STAT(stats.tx_packets) },
-+	{ "rx_bytes", MV643XX_STAT(stats.rx_bytes) },
-+	{ "tx_bytes", MV643XX_STAT(stats.tx_bytes) },
-+	{ "rx_errors", MV643XX_STAT(stats.rx_errors) },
-+	{ "tx_errors", MV643XX_STAT(stats.tx_errors) },
-+	{ "rx_dropped", MV643XX_STAT(stats.rx_dropped) },
-+	{ "tx_dropped", MV643XX_STAT(stats.tx_dropped) },
-+	{ "good_octets_received", MV643XX_STAT(mib_counters.good_octets_received) },
-+	{ "bad_octets_received", MV643XX_STAT(mib_counters.bad_octets_received) },
-+	{ "internal_mac_transmit_err", MV643XX_STAT(mib_counters.internal_mac_transmit_err) },
-+	{ "good_frames_received", MV643XX_STAT(mib_counters.good_frames_received) },
-+	{ "bad_frames_received", MV643XX_STAT(mib_counters.bad_frames_received) },
-+	{ "broadcast_frames_received", MV643XX_STAT(mib_counters.broadcast_frames_received) },
-+	{ "multicast_frames_received", MV643XX_STAT(mib_counters.multicast_frames_received) },
-+	{ "frames_64_octets", MV643XX_STAT(mib_counters.frames_64_octets) },
-+	{ "frames_65_to_127_octets", MV643XX_STAT(mib_counters.frames_65_to_127_octets) },
-+	{ "frames_128_to_255_octets", MV643XX_STAT(mib_counters.frames_128_to_255_octets) },
-+	{ "frames_256_to_511_octets", MV643XX_STAT(mib_counters.frames_256_to_511_octets) },
-+	{ "frames_512_to_1023_octets", MV643XX_STAT(mib_counters.frames_512_to_1023_octets) },
-+	{ "frames_1024_to_max_octets", MV643XX_STAT(mib_counters.frames_1024_to_max_octets) },
-+	{ "good_octets_sent", MV643XX_STAT(mib_counters.good_octets_sent) },
-+	{ "good_frames_sent", MV643XX_STAT(mib_counters.good_frames_sent) },
-+	{ "excessive_collision", MV643XX_STAT(mib_counters.excessive_collision) },
-+	{ "multicast_frames_sent", MV643XX_STAT(mib_counters.multicast_frames_sent) },
-+	{ "broadcast_frames_sent", MV643XX_STAT(mib_counters.broadcast_frames_sent) },
-+	{ "unrec_mac_control_received", MV643XX_STAT(mib_counters.unrec_mac_control_received) },
-+	{ "fc_sent", MV643XX_STAT(mib_counters.fc_sent) },
-+	{ "good_fc_received", MV643XX_STAT(mib_counters.good_fc_received) },
-+	{ "bad_fc_received", MV643XX_STAT(mib_counters.bad_fc_received) },
-+	{ "undersize_received", MV643XX_STAT(mib_counters.undersize_received) },
-+	{ "fragments_received", MV643XX_STAT(mib_counters.fragments_received) },
-+	{ "oversize_received", MV643XX_STAT(mib_counters.oversize_received) },
-+	{ "jabber_received", MV643XX_STAT(mib_counters.jabber_received) },
-+	{ "mac_receive_error", MV643XX_STAT(mib_counters.mac_receive_error) },
-+	{ "bad_crc_event", MV643XX_STAT(mib_counters.bad_crc_event) },
-+	{ "collision", MV643XX_STAT(mib_counters.collision) },
-+	{ "late_collision", MV643XX_STAT(mib_counters.late_collision) },
-+};
-+
-+#define MV643XX_STATS_LEN	\
-+	sizeof(mv643xx_gstrings_stats) / sizeof(struct mv643xx_stats)
-+
-+static int
-+mv643xx_get_settings(struct net_device *netdev, struct ethtool_cmd *ecmd)
-+{
-+	struct mv643xx_private *mp = netdev->priv;
-+	int port_num = mp->port_num;
-+	int autoneg = eth_port_autoneg_supported(port_num);
-+	int mode_10_bit;
-+	int auto_duplex;
-+	int half_duplex = 0;
-+	int full_duplex = 0;
-+	int auto_speed;
-+	int speed_10 = 0;
-+	int speed_100 = 0;
-+	int speed_1000 = 0;
-+
-+	u32 pcs = mv_read(MV643XX_ETH_PORT_SERIAL_CONTROL_REG(port_num));
-+	u32 psr = mv_read(MV643XX_ETH_PORT_STATUS_REG(port_num));
-+
-+	mode_10_bit = psr & MV643XX_ETH_PORT_STATUS_MODE_10_BIT;
-+
-+	if (mode_10_bit) {
-+		ecmd->supported = SUPPORTED_10baseT_Half;
-+	} else {
-+		ecmd->supported = (SUPPORTED_10baseT_Half		|
-+				   SUPPORTED_10baseT_Full		|
-+				   SUPPORTED_100baseT_Half		|
-+				   SUPPORTED_100baseT_Full		|
-+				   SUPPORTED_1000baseT_Full		|
-+				   (autoneg ? SUPPORTED_Autoneg : 0)	|
-+				   SUPPORTED_TP);
-+
-+		auto_duplex = !(pcs & MV643XX_ETH_DISABLE_AUTO_NEG_FOR_DUPLX);
-+		auto_speed = !(pcs & MV643XX_ETH_DISABLE_AUTO_NEG_SPEED_GMII);
-+
-+		ecmd->advertising = ADVERTISED_TP;
-+
-+		if (autoneg) {
-+			ecmd->advertising |= ADVERTISED_Autoneg;
-+
-+			if (auto_duplex) {
-+				half_duplex = 1;
-+				full_duplex = 1;
-+			} else {
-+				if (pcs & MV643XX_ETH_SET_FULL_DUPLEX_MODE)
-+					full_duplex = 1;
-+				else
-+					half_duplex = 1;
-+			}
-+
-+			if (auto_speed) {
-+				speed_10 = 1;
-+				speed_100 = 1;
-+				speed_1000 = 1;
-+			} else {
-+				if (pcs & MV643XX_ETH_SET_GMII_SPEED_TO_1000)
-+					speed_1000 = 1;
-+				else if (pcs & MV643XX_ETH_SET_MII_SPEED_TO_100)
-+					speed_100 = 1;
-+				else
-+					speed_10 = 1;
-+			}
-+
-+			if (speed_10 & half_duplex)
-+				ecmd->advertising |= ADVERTISED_10baseT_Half;
-+			if (speed_10 & full_duplex)
-+				ecmd->advertising |= ADVERTISED_10baseT_Full;
-+			if (speed_100 & half_duplex)
-+				ecmd->advertising |= ADVERTISED_100baseT_Half;
-+			if (speed_100 & full_duplex)
-+				ecmd->advertising |= ADVERTISED_100baseT_Full;
-+			if (speed_1000)
-+				ecmd->advertising |= ADVERTISED_1000baseT_Full;
-+		}
-+	}
-+
-+	ecmd->port = PORT_TP;
-+	ecmd->phy_address = ethernet_phy_get(port_num);
-+
-+	ecmd->transceiver = XCVR_EXTERNAL;
-+
-+	if (netif_carrier_ok(netdev)) {
-+		if (mode_10_bit)
-+			ecmd->speed = SPEED_10;
-+		else {
-+			if (psr & MV643XX_ETH_PORT_STATUS_GMII_1000)
-+				ecmd->speed = SPEED_1000;
-+			else if (psr & MV643XX_ETH_PORT_STATUS_MII_100)
-+				ecmd->speed = SPEED_100;
-+			else
-+				ecmd->speed = SPEED_10;
-+		}
-+
-+		if (psr & MV643XX_ETH_PORT_STATUS_FULL_DUPLEX)
-+			ecmd->duplex = DUPLEX_FULL;
-+		else
-+			ecmd->duplex = DUPLEX_HALF;
-+	} else {
-+		ecmd->speed = -1;
-+		ecmd->duplex = -1;
-+	}
-+
-+	ecmd->autoneg = autoneg ? AUTONEG_ENABLE : AUTONEG_DISABLE;
-+	return 0;
-+}
-+
-+static void
-+mv643xx_get_drvinfo(struct net_device *netdev,
-+                       struct ethtool_drvinfo *drvinfo)
-+{
-+	strncpy(drvinfo->driver,  mv643xx_driver_name, 32);
-+	strncpy(drvinfo->version, mv643xx_driver_version, 32);
-+	strncpy(drvinfo->fw_version, "N/A", 32);
-+	strncpy(drvinfo->bus_info, "mv643xx", 32);
-+	drvinfo->n_stats = MV643XX_STATS_LEN;
-+}
-+
-+static int 
-+mv643xx_get_stats_count(struct net_device *netdev)
-+{
-+	return MV643XX_STATS_LEN;
-+}
-+
-+static void 
-+mv643xx_get_ethtool_stats(struct net_device *netdev, 
-+		struct ethtool_stats *stats, uint64_t *data)
-+{
-+	struct mv643xx_private *mp = netdev->priv;
-+	int i;
-+
-+	eth_update_mib_counters(mp);
-+
-+	for(i = 0; i < MV643XX_STATS_LEN; i++) {
-+		char *p = (char *)mp+mv643xx_gstrings_stats[i].stat_offset;	
-+		data[i] = (mv643xx_gstrings_stats[i].sizeof_stat == 
-+			sizeof(uint64_t)) ? *(uint64_t *)p : *(uint32_t *)p;
-+	}
-+}
-+
-+static void 
-+mv643xx_get_strings(struct net_device *netdev, uint32_t stringset, uint8_t *data)
-+{
-+	int i;
-+
-+	switch(stringset) {
-+	case ETH_SS_STATS:
-+		for (i=0; i < MV643XX_STATS_LEN; i++) {
-+			memcpy(data + i * ETH_GSTRING_LEN, 
-+			mv643xx_gstrings_stats[i].stat_string,
-+			ETH_GSTRING_LEN);
-+		}
-+		break;
-+	}
-+}
-+
-+static struct ethtool_ops mv643xx_ethtool_ops = {
-+	.get_settings           = mv643xx_get_settings,
-+	.get_drvinfo            = mv643xx_get_drvinfo,
-+	.get_link               = ethtool_op_get_link,
-+	.get_sg			= ethtool_op_get_sg,
-+	.set_sg			= ethtool_op_set_sg,
-+	.get_strings            = mv643xx_get_strings,
-+	.get_stats_count        = mv643xx_get_stats_count,
-+	.get_ethtool_stats      = mv643xx_get_ethtool_stats,
-+};
-+
-+/************* End ethtool support *************************/
---- kernel-source-2.6.11/drivers/net/mv643xx_eth.h	2005-03-02 08:38:09.000000000 +0100
-+++ kernel-source-2.6.11-marvell/drivers/net/mv643xx_eth.h	2005-03-08 10:09:01.000000000 +0100
-@@ -1,5 +1,5 @@
--#ifndef __MV64340_ETH_H__
--#define __MV64340_ETH_H__
-+#ifndef __MV643XX_ETH_H__
-+#define __MV643XX_ETH_H__
- 
- #include <linux/version.h>
- #include <linux/module.h>
-@@ -46,17 +46,16 @@
-  *  The first part is the high level driver of the gigE ethernet ports.
-  */
- 
--#define ETH_PORT0_IRQ_NUM 48			/* main high register, bit0 */
--#define ETH_PORT1_IRQ_NUM ETH_PORT0_IRQ_NUM+1	/* main high register, bit1 */
--#define ETH_PORT2_IRQ_NUM ETH_PORT0_IRQ_NUM+2	/* main high register, bit1 */
--
--/* Checksum offload for Tx works */
--#define  MV64340_CHECKSUM_OFFLOAD_TX
--#define	 MV64340_NAPI
--#define	 MV64340_TX_FAST_REFILL
--#undef	 MV64340_COAL
-+/* Checksum offload for Tx works for most packets, but
-+ * fails if previous packet sent did not use hw csum
-+ */
-+#undef	MV643XX_CHECKSUM_OFFLOAD_TX
-+#define	MV643XX_NAPI
-+#define	MV643XX_TX_FAST_REFILL
-+#undef	MV643XX_RX_QUEUE_FILL_ON_TASK	/* Does not work, yet */
-+#undef	MV643XX_COAL
- 
--/* 
-+/*
-  * Number of RX / TX descriptors on RX / TX rings.
-  * Note that allocating RX descriptors is done by allocating the RX
-  * ring AND a preallocated RX buffers (skb's) for each descriptor.
-@@ -65,89 +64,35 @@
-  */
- 
- /* Default TX ring size is 1000 descriptors */
--#define MV64340_TX_QUEUE_SIZE 1000
-+#define MV643XX_DEFAULT_TX_QUEUE_SIZE 1000
- 
- /* Default RX ring size is 400 descriptors */
--#define MV64340_RX_QUEUE_SIZE 400
-+#define MV643XX_DEFAULT_RX_QUEUE_SIZE 400
- 
--#define MV64340_TX_COAL 100
--#ifdef MV64340_COAL
--#define MV64340_RX_COAL 100
-+#define MV643XX_TX_COAL 100
-+#ifdef MV643XX_COAL
-+#define MV643XX_RX_COAL 100
- #endif
- 
--
- /*
-- * The second part is the low level driver of the gigE ethernet ports.   *
-+ * The second part is the low level driver of the gigE ethernet ports.
-  */
- 
--
- /*
-- * Header File for : MV-643xx network interface header 
-+ * Header File for : MV-643xx network interface header
-  *
-  * DESCRIPTION:
-- *       This header file contains macros typedefs and function declaration for
-- *       the Marvell Gig Bit Ethernet Controller. 
-+ *	This header file contains macros typedefs and function declaration for
-+ *	the Marvell Gig Bit Ethernet Controller.
-  *
-  * DEPENDENCIES:
-- *       None.
-+ *	None.
-  *
-  */
- 
--/* Default port configuration value */
--#define PORT_CONFIG_VALUE                       \
--             ETH_UNICAST_NORMAL_MODE		|   \
--             ETH_DEFAULT_RX_QUEUE_0		|   \
--             ETH_DEFAULT_RX_ARP_QUEUE_0		|   \
--             ETH_RECEIVE_BC_IF_NOT_IP_OR_ARP	|   \
--             ETH_RECEIVE_BC_IF_IP		|   \
--             ETH_RECEIVE_BC_IF_ARP 		|   \
--             ETH_CAPTURE_TCP_FRAMES_DIS		|   \
--             ETH_CAPTURE_UDP_FRAMES_DIS		|   \
--             ETH_DEFAULT_RX_TCP_QUEUE_0		|   \
--             ETH_DEFAULT_RX_UDP_QUEUE_0		|   \
--             ETH_DEFAULT_RX_BPDU_QUEUE_0
--
--/* Default port extend configuration value */
--#define PORT_CONFIG_EXTEND_VALUE		\
--             ETH_SPAN_BPDU_PACKETS_AS_NORMAL	|   \
--             ETH_PARTITION_DISABLE
--
--
--/* Default sdma control value */
--#define PORT_SDMA_CONFIG_VALUE			\
--			 ETH_RX_BURST_SIZE_16_64BIT 	|	\
--			 GT_ETH_IPG_INT_RX(0) 		|	\
--			 ETH_TX_BURST_SIZE_16_64BIT;
--
--#define GT_ETH_IPG_INT_RX(value)                \
--            ((value & 0x3fff) << 8)
--
--/* Default port serial control value */
--#define PORT_SERIAL_CONTROL_VALUE		\
--			ETH_FORCE_LINK_PASS 			|	\
--			ETH_ENABLE_AUTO_NEG_FOR_DUPLX		|	\
--			ETH_DISABLE_AUTO_NEG_FOR_FLOW_CTRL 	|	\
--			ETH_ADV_SYMMETRIC_FLOW_CTRL 		|	\
--			ETH_FORCE_FC_MODE_NO_PAUSE_DIS_TX 	|	\
--			ETH_FORCE_BP_MODE_NO_JAM 		|	\
--			BIT9 					|	\
--			ETH_DO_NOT_FORCE_LINK_FAIL 		|	\
--			ETH_RETRANSMIT_16_ATTEMPTS 		|	\
--			ETH_ENABLE_AUTO_NEG_SPEED_GMII	 	|	\
--			ETH_DTE_ADV_0 				|	\
--			ETH_DISABLE_AUTO_NEG_BYPASS		|	\
--			ETH_AUTO_NEG_NO_CHANGE 			|	\
--			ETH_MAX_RX_PACKET_9700BYTE 		|	\
--			ETH_CLR_EXT_LOOPBACK 			|	\
--			ETH_SET_FULL_DUPLEX_MODE 		|	\
--			ETH_ENABLE_FLOW_CTRL_TX_RX_IN_FULL_DUPLEX
--
--#define RX_BUFFER_MAX_SIZE  0x4000000
--#define TX_BUFFER_MAX_SIZE  0x4000000
--
- /* MAC accepet/reject macros */
--#define ACCEPT_MAC_ADDR	    0
--#define REJECT_MAC_ADDR	    1
-+#define ACCEPT_MAC_ADDR				0
-+#define REJECT_MAC_ADDR				1
- 
- /* Buffer offset from buffer pointer */
- #define RX_BUF_OFFSET				0x2
-@@ -155,277 +100,132 @@
- /* Gigabit Ethernet Unit Global Registers */
- 
- /* MIB Counters register definitions */
--#define ETH_MIB_GOOD_OCTETS_RECEIVED_LOW   0x0
--#define ETH_MIB_GOOD_OCTETS_RECEIVED_HIGH  0x4
--#define ETH_MIB_BAD_OCTETS_RECEIVED        0x8
--#define ETH_MIB_INTERNAL_MAC_TRANSMIT_ERR  0xc
--#define ETH_MIB_GOOD_FRAMES_RECEIVED       0x10
--#define ETH_MIB_BAD_FRAMES_RECEIVED        0x14
--#define ETH_MIB_BROADCAST_FRAMES_RECEIVED  0x18
--#define ETH_MIB_MULTICAST_FRAMES_RECEIVED  0x1c
--#define ETH_MIB_FRAMES_64_OCTETS           0x20
--#define ETH_MIB_FRAMES_65_TO_127_OCTETS    0x24
--#define ETH_MIB_FRAMES_128_TO_255_OCTETS   0x28
--#define ETH_MIB_FRAMES_256_TO_511_OCTETS   0x2c
--#define ETH_MIB_FRAMES_512_TO_1023_OCTETS  0x30
--#define ETH_MIB_FRAMES_1024_TO_MAX_OCTETS  0x34
--#define ETH_MIB_GOOD_OCTETS_SENT_LOW       0x38
--#define ETH_MIB_GOOD_OCTETS_SENT_HIGH      0x3c
--#define ETH_MIB_GOOD_FRAMES_SENT           0x40
--#define ETH_MIB_EXCESSIVE_COLLISION        0x44
--#define ETH_MIB_MULTICAST_FRAMES_SENT      0x48
--#define ETH_MIB_BROADCAST_FRAMES_SENT      0x4c
--#define ETH_MIB_UNREC_MAC_CONTROL_RECEIVED 0x50
--#define ETH_MIB_FC_SENT                    0x54
--#define ETH_MIB_GOOD_FC_RECEIVED           0x58
--#define ETH_MIB_BAD_FC_RECEIVED            0x5c
--#define ETH_MIB_UNDERSIZE_RECEIVED         0x60
--#define ETH_MIB_FRAGMENTS_RECEIVED         0x64
--#define ETH_MIB_OVERSIZE_RECEIVED          0x68
--#define ETH_MIB_JABBER_RECEIVED            0x6c
--#define ETH_MIB_MAC_RECEIVE_ERROR          0x70
--#define ETH_MIB_BAD_CRC_EVENT              0x74
--#define ETH_MIB_COLLISION                  0x78
--#define ETH_MIB_LATE_COLLISION             0x7c
-+#define ETH_MIB_GOOD_OCTETS_RECEIVED_LOW	0x0
-+#define ETH_MIB_GOOD_OCTETS_RECEIVED_HIGH	0x4
-+#define ETH_MIB_BAD_OCTETS_RECEIVED		0x8
-+#define ETH_MIB_INTERNAL_MAC_TRANSMIT_ERR	0xc
-+#define ETH_MIB_GOOD_FRAMES_RECEIVED		0x10
-+#define ETH_MIB_BAD_FRAMES_RECEIVED		0x14
-+#define ETH_MIB_BROADCAST_FRAMES_RECEIVED	0x18
-+#define ETH_MIB_MULTICAST_FRAMES_RECEIVED	0x1c
-+#define ETH_MIB_FRAMES_64_OCTETS		0x20
-+#define ETH_MIB_FRAMES_65_TO_127_OCTETS		0x24
-+#define ETH_MIB_FRAMES_128_TO_255_OCTETS	0x28
-+#define ETH_MIB_FRAMES_256_TO_511_OCTETS	0x2c
-+#define ETH_MIB_FRAMES_512_TO_1023_OCTETS	0x30
-+#define ETH_MIB_FRAMES_1024_TO_MAX_OCTETS	0x34
-+#define ETH_MIB_GOOD_OCTETS_SENT_LOW		0x38
-+#define ETH_MIB_GOOD_OCTETS_SENT_HIGH		0x3c
-+#define ETH_MIB_GOOD_FRAMES_SENT		0x40
-+#define ETH_MIB_EXCESSIVE_COLLISION		0x44
-+#define ETH_MIB_MULTICAST_FRAMES_SENT		0x48
-+#define ETH_MIB_BROADCAST_FRAMES_SENT		0x4c
-+#define ETH_MIB_UNREC_MAC_CONTROL_RECEIVED	0x50
-+#define ETH_MIB_FC_SENT				0x54
-+#define ETH_MIB_GOOD_FC_RECEIVED		0x58
-+#define ETH_MIB_BAD_FC_RECEIVED			0x5c
-+#define ETH_MIB_UNDERSIZE_RECEIVED		0x60
-+#define ETH_MIB_FRAGMENTS_RECEIVED		0x64
-+#define ETH_MIB_OVERSIZE_RECEIVED		0x68
-+#define ETH_MIB_JABBER_RECEIVED			0x6c
-+#define ETH_MIB_MAC_RECEIVE_ERROR		0x70
-+#define ETH_MIB_BAD_CRC_EVENT			0x74
-+#define ETH_MIB_COLLISION			0x78
-+#define ETH_MIB_LATE_COLLISION			0x7c
- 
- /* Port serial status reg (PSR) */
--#define ETH_INTERFACE_GMII_MII                          0
--#define ETH_INTERFACE_PCM                               BIT0
--#define ETH_LINK_IS_DOWN                                0
--#define ETH_LINK_IS_UP                                  BIT1
--#define ETH_PORT_AT_HALF_DUPLEX                         0
--#define ETH_PORT_AT_FULL_DUPLEX                         BIT2
--#define ETH_RX_FLOW_CTRL_DISABLED                       0
--#define ETH_RX_FLOW_CTRL_ENBALED                        BIT3
--#define ETH_GMII_SPEED_100_10                           0
--#define ETH_GMII_SPEED_1000                             BIT4
--#define ETH_MII_SPEED_10                                0
--#define ETH_MII_SPEED_100                               BIT5
--#define ETH_NO_TX                                       0
--#define ETH_TX_IN_PROGRESS                              BIT7
--#define ETH_BYPASS_NO_ACTIVE                            0
--#define ETH_BYPASS_ACTIVE                               BIT8
--#define ETH_PORT_NOT_AT_PARTITION_STATE                 0
--#define ETH_PORT_AT_PARTITION_STATE                     BIT9
--#define ETH_PORT_TX_FIFO_NOT_EMPTY                      0
--#define ETH_PORT_TX_FIFO_EMPTY                          BIT10
--
--
--/* These macros describes the Port configuration reg (Px_cR) bits */
--#define ETH_UNICAST_NORMAL_MODE                         0
--#define ETH_UNICAST_PROMISCUOUS_MODE                    BIT0
--#define ETH_DEFAULT_RX_QUEUE_0                          0
--#define ETH_DEFAULT_RX_QUEUE_1                          BIT1
--#define ETH_DEFAULT_RX_QUEUE_2                          BIT2
--#define ETH_DEFAULT_RX_QUEUE_3                          (BIT2 | BIT1)
--#define ETH_DEFAULT_RX_QUEUE_4                          BIT3
--#define ETH_DEFAULT_RX_QUEUE_5                          (BIT3 | BIT1)
--#define ETH_DEFAULT_RX_QUEUE_6                          (BIT3 | BIT2)
--#define ETH_DEFAULT_RX_QUEUE_7                          (BIT3 | BIT2 | BIT1)
--#define ETH_DEFAULT_RX_ARP_QUEUE_0                      0
--#define ETH_DEFAULT_RX_ARP_QUEUE_1                      BIT4
--#define ETH_DEFAULT_RX_ARP_QUEUE_2                      BIT5
--#define ETH_DEFAULT_RX_ARP_QUEUE_3                      (BIT5 | BIT4)
--#define ETH_DEFAULT_RX_ARP_QUEUE_4                      BIT6
--#define ETH_DEFAULT_RX_ARP_QUEUE_5                      (BIT6 | BIT4)
--#define ETH_DEFAULT_RX_ARP_QUEUE_6                      (BIT6 | BIT5)
--#define ETH_DEFAULT_RX_ARP_QUEUE_7                      (BIT6 | BIT5 | BIT4)
--#define ETH_RECEIVE_BC_IF_NOT_IP_OR_ARP                 0
--#define ETH_REJECT_BC_IF_NOT_IP_OR_ARP                  BIT7
--#define ETH_RECEIVE_BC_IF_IP                            0
--#define ETH_REJECT_BC_IF_IP                             BIT8
--#define ETH_RECEIVE_BC_IF_ARP                           0
--#define ETH_REJECT_BC_IF_ARP                            BIT9
--#define ETH_TX_AM_NO_UPDATE_ERROR_SUMMARY               BIT12
--#define ETH_CAPTURE_TCP_FRAMES_DIS                      0
--#define ETH_CAPTURE_TCP_FRAMES_EN                       BIT14
--#define ETH_CAPTURE_UDP_FRAMES_DIS                      0
--#define ETH_CAPTURE_UDP_FRAMES_EN                       BIT15
--#define ETH_DEFAULT_RX_TCP_QUEUE_0                      0
--#define ETH_DEFAULT_RX_TCP_QUEUE_1                      BIT16
--#define ETH_DEFAULT_RX_TCP_QUEUE_2                      BIT17
--#define ETH_DEFAULT_RX_TCP_QUEUE_3                      (BIT17 | BIT16)
--#define ETH_DEFAULT_RX_TCP_QUEUE_4                      BIT18
--#define ETH_DEFAULT_RX_TCP_QUEUE_5                      (BIT18 | BIT16)
--#define ETH_DEFAULT_RX_TCP_QUEUE_6                      (BIT18 | BIT17)
--#define ETH_DEFAULT_RX_TCP_QUEUE_7                      (BIT18 | BIT17 | BIT16)
--#define ETH_DEFAULT_RX_UDP_QUEUE_0                      0
--#define ETH_DEFAULT_RX_UDP_QUEUE_1                      BIT19
--#define ETH_DEFAULT_RX_UDP_QUEUE_2                      BIT20
--#define ETH_DEFAULT_RX_UDP_QUEUE_3                      (BIT20 | BIT19)
--#define ETH_DEFAULT_RX_UDP_QUEUE_4                      (BIT21
--#define ETH_DEFAULT_RX_UDP_QUEUE_5                      (BIT21 | BIT19)
--#define ETH_DEFAULT_RX_UDP_QUEUE_6                      (BIT21 | BIT20)
--#define ETH_DEFAULT_RX_UDP_QUEUE_7                      (BIT21 | BIT20 | BIT19)
--#define ETH_DEFAULT_RX_BPDU_QUEUE_0                      0
--#define ETH_DEFAULT_RX_BPDU_QUEUE_1                     BIT22
--#define ETH_DEFAULT_RX_BPDU_QUEUE_2                     BIT23
--#define ETH_DEFAULT_RX_BPDU_QUEUE_3                     (BIT23 | BIT22)
--#define ETH_DEFAULT_RX_BPDU_QUEUE_4                     BIT24
--#define ETH_DEFAULT_RX_BPDU_QUEUE_5                     (BIT24 | BIT22)
--#define ETH_DEFAULT_RX_BPDU_QUEUE_6                     (BIT24 | BIT23)
--#define ETH_DEFAULT_RX_BPDU_QUEUE_7                     (BIT24 | BIT23 | BIT22)
--
--
--/* These macros describes the Port configuration extend reg (Px_cXR) bits*/
--#define ETH_CLASSIFY_EN                                 BIT0
--#define ETH_SPAN_BPDU_PACKETS_AS_NORMAL                 0
--#define ETH_SPAN_BPDU_PACKETS_TO_RX_QUEUE_7             BIT1
--#define ETH_PARTITION_DISABLE                           0
--#define ETH_PARTITION_ENABLE                            BIT2
--
--
--/* Tx/Rx queue command reg (RQCR/TQCR)*/
--#define ETH_QUEUE_0_ENABLE                              BIT0
--#define ETH_QUEUE_1_ENABLE                              BIT1
--#define ETH_QUEUE_2_ENABLE                              BIT2
--#define ETH_QUEUE_3_ENABLE                              BIT3
--#define ETH_QUEUE_4_ENABLE                              BIT4
--#define ETH_QUEUE_5_ENABLE                              BIT5
--#define ETH_QUEUE_6_ENABLE                              BIT6
--#define ETH_QUEUE_7_ENABLE                              BIT7
--#define ETH_QUEUE_0_DISABLE                             BIT8
--#define ETH_QUEUE_1_DISABLE                             BIT9
--#define ETH_QUEUE_2_DISABLE                             BIT10
--#define ETH_QUEUE_3_DISABLE                             BIT11
--#define ETH_QUEUE_4_DISABLE                             BIT12
--#define ETH_QUEUE_5_DISABLE                             BIT13
--#define ETH_QUEUE_6_DISABLE                             BIT14
--#define ETH_QUEUE_7_DISABLE                             BIT15
--
--
--/* These macros describes the Port Sdma configuration reg (SDCR) bits */
--#define ETH_RIFB                                        BIT0
--#define ETH_RX_BURST_SIZE_1_64BIT                       0
--#define ETH_RX_BURST_SIZE_2_64BIT                       BIT1
--#define ETH_RX_BURST_SIZE_4_64BIT                       BIT2
--#define ETH_RX_BURST_SIZE_8_64BIT                       (BIT2 | BIT1)
--#define ETH_RX_BURST_SIZE_16_64BIT                      BIT3
--#define ETH_BLM_RX_NO_SWAP                              BIT4
--#define ETH_BLM_RX_BYTE_SWAP                            0
--#define ETH_BLM_TX_NO_SWAP                              BIT5
--#define ETH_BLM_TX_BYTE_SWAP                            0
--#define ETH_DESCRIPTORS_BYTE_SWAP                       BIT6
--#define ETH_DESCRIPTORS_NO_SWAP                         0
--#define ETH_TX_BURST_SIZE_1_64BIT                       0
--#define ETH_TX_BURST_SIZE_2_64BIT                       BIT22
--#define ETH_TX_BURST_SIZE_4_64BIT                       BIT23
--#define ETH_TX_BURST_SIZE_8_64BIT                       (BIT23 | BIT22)
--#define ETH_TX_BURST_SIZE_16_64BIT                      BIT24
--
--
--
--/* These macros describes the Port serial control reg (PSCR) bits */
--#define ETH_SERIAL_PORT_DISABLE                         0
--#define ETH_SERIAL_PORT_ENABLE                          BIT0
--#define ETH_FORCE_LINK_PASS                             BIT1
--#define ETH_DO_NOT_FORCE_LINK_PASS                      0
--#define ETH_ENABLE_AUTO_NEG_FOR_DUPLX                   0
--#define ETH_DISABLE_AUTO_NEG_FOR_DUPLX                  BIT2
--#define ETH_ENABLE_AUTO_NEG_FOR_FLOW_CTRL               0
--#define ETH_DISABLE_AUTO_NEG_FOR_FLOW_CTRL              BIT3
--#define ETH_ADV_NO_FLOW_CTRL                            0
--#define ETH_ADV_SYMMETRIC_FLOW_CTRL                     BIT4
--#define ETH_FORCE_FC_MODE_NO_PAUSE_DIS_TX               0
--#define ETH_FORCE_FC_MODE_TX_PAUSE_DIS                  BIT5
--#define ETH_FORCE_BP_MODE_NO_JAM                        0
--#define ETH_FORCE_BP_MODE_JAM_TX                        BIT7
--#define ETH_FORCE_BP_MODE_JAM_TX_ON_RX_ERR              BIT8
--#define ETH_FORCE_LINK_FAIL                             0
--#define ETH_DO_NOT_FORCE_LINK_FAIL                      BIT10
--#define ETH_RETRANSMIT_16_ATTEMPTS                      0
--#define ETH_RETRANSMIT_FOREVER                          BIT11
--#define ETH_DISABLE_AUTO_NEG_SPEED_GMII                 BIT13
--#define ETH_ENABLE_AUTO_NEG_SPEED_GMII                  0
--#define ETH_DTE_ADV_0                                   0
--#define ETH_DTE_ADV_1                                   BIT14
--#define ETH_DISABLE_AUTO_NEG_BYPASS                     0
--#define ETH_ENABLE_AUTO_NEG_BYPASS                      BIT15
--#define ETH_AUTO_NEG_NO_CHANGE                          0
--#define ETH_RESTART_AUTO_NEG                            BIT16
--#define ETH_MAX_RX_PACKET_1518BYTE                      0
--#define ETH_MAX_RX_PACKET_1522BYTE                      BIT17
--#define ETH_MAX_RX_PACKET_1552BYTE                      BIT18
--#define ETH_MAX_RX_PACKET_9022BYTE                      (BIT18 | BIT17)
--#define ETH_MAX_RX_PACKET_9192BYTE                      BIT19
--#define ETH_MAX_RX_PACKET_9700BYTE                      (BIT19 | BIT17)
--#define ETH_SET_EXT_LOOPBACK                            BIT20
--#define ETH_CLR_EXT_LOOPBACK                            0
--#define ETH_SET_FULL_DUPLEX_MODE                        BIT21
--#define ETH_SET_HALF_DUPLEX_MODE                        0
--#define ETH_ENABLE_FLOW_CTRL_TX_RX_IN_FULL_DUPLEX       BIT22
--#define ETH_DISABLE_FLOW_CTRL_TX_RX_IN_FULL_DUPLEX      0
--#define ETH_SET_GMII_SPEED_TO_10_100                    0
--#define ETH_SET_GMII_SPEED_TO_1000                      BIT23
--#define ETH_SET_MII_SPEED_TO_10                         0
--#define ETH_SET_MII_SPEED_TO_100                        BIT24
--
-+#define ETH_INTERFACE_GMII_MII			0
-+#define ETH_INTERFACE_PCM			BIT0
-+#define ETH_LINK_IS_DOWN			0
-+#define ETH_LINK_IS_UP				BIT1
-+#define ETH_PORT_AT_HALF_DUPLEX			0
-+#define ETH_PORT_AT_FULL_DUPLEX			BIT2
-+#define ETH_RX_FLOW_CTRL_DISABLED		0
-+#define ETH_RX_FLOW_CTRL_ENBALED		BIT3
-+#define ETH_GMII_SPEED_100_10			0
-+#define ETH_GMII_SPEED_1000			BIT4
-+#define ETH_MII_SPEED_10			0
-+#define ETH_MII_SPEED_100			BIT5
-+#define ETH_NO_TX				0
-+#define ETH_TX_IN_PROGRESS			BIT7
-+#define ETH_BYPASS_NO_ACTIVE			0
-+#define ETH_BYPASS_ACTIVE			BIT8
-+#define ETH_PORT_NOT_AT_PARTITION_STATE		0
-+#define ETH_PORT_AT_PARTITION_STATE		BIT9
-+#define ETH_PORT_TX_FIFO_NOT_EMPTY		0
-+#define ETH_PORT_TX_FIFO_EMPTY			BIT10
-+
-+#define ETH_DEFAULT_RX_BPDU_QUEUE_3		(BIT23 | BIT22)
-+#define ETH_DEFAULT_RX_BPDU_QUEUE_4		BIT24
-+#define ETH_DEFAULT_RX_BPDU_QUEUE_5		(BIT24 | BIT22)
-+#define ETH_DEFAULT_RX_BPDU_QUEUE_6		(BIT24 | BIT23)
-+#define ETH_DEFAULT_RX_BPDU_QUEUE_7		(BIT24 | BIT23 | BIT22)
- 
- /* SMI reg */
--#define ETH_SMI_BUSY        	BIT28	/* 0 - Write, 1 - Read          */
--#define ETH_SMI_READ_VALID  	BIT27	/* 0 - Write, 1 - Read          */
-+#define ETH_SMI_BUSY		BIT28	/* 0 - Write, 1 - Read		*/
-+#define ETH_SMI_READ_VALID	BIT27	/* 0 - Write, 1 - Read		*/
- #define ETH_SMI_OPCODE_WRITE	0	/* Completion of Read operation */
--#define ETH_SMI_OPCODE_READ 	BIT26	/* Operation is in progress             */
-+#define ETH_SMI_OPCODE_READ 	BIT26	/* Operation is in progress	*/
- 
- /* SDMA command status fields macros */
- 
- /* Tx & Rx descriptors status */
--#define ETH_ERROR_SUMMARY                   (BIT0)
-+#define ETH_ERROR_SUMMARY			(BIT0)
- 
- /* Tx & Rx descriptors command */
--#define ETH_BUFFER_OWNED_BY_DMA             (BIT31)
-+#define ETH_BUFFER_OWNED_BY_DMA			(BIT31)
- 
- /* Tx descriptors status */
--#define ETH_LC_ERROR                        (0	  )
--#define ETH_UR_ERROR                        (BIT1 )
--#define ETH_RL_ERROR                        (BIT2 )
--#define ETH_LLC_SNAP_FORMAT                 (BIT9 )
-+#define ETH_LC_ERROR				(0    )
-+#define ETH_UR_ERROR				(BIT1 )
-+#define ETH_RL_ERROR				(BIT2 )
-+#define ETH_LLC_SNAP_FORMAT			(BIT9 )
- 
- /* Rx descriptors status */
--#define ETH_CRC_ERROR                       (0	  )
--#define ETH_OVERRUN_ERROR                   (BIT1 )
--#define ETH_MAX_FRAME_LENGTH_ERROR          (BIT2 )
--#define ETH_RESOURCE_ERROR                  ((BIT2 | BIT1))
--#define ETH_VLAN_TAGGED                     (BIT19)
--#define ETH_BPDU_FRAME                      (BIT20)
--#define ETH_TCP_FRAME_OVER_IP_V_4           (0    )
--#define ETH_UDP_FRAME_OVER_IP_V_4           (BIT21)
--#define ETH_OTHER_FRAME_TYPE                (BIT22)
--#define ETH_LAYER_2_IS_ETH_V_2              (BIT23)
--#define ETH_FRAME_TYPE_IP_V_4               (BIT24)
--#define ETH_FRAME_HEADER_OK                 (BIT25)
--#define ETH_RX_LAST_DESC                    (BIT26)
--#define ETH_RX_FIRST_DESC                   (BIT27)
--#define ETH_UNKNOWN_DESTINATION_ADDR        (BIT28)
--#define ETH_RX_ENABLE_INTERRUPT             (BIT29)
--#define ETH_LAYER_4_CHECKSUM_OK             (BIT30)
-+#define ETH_CRC_ERROR				(0    )
-+#define ETH_OVERRUN_ERROR			(BIT1 )
-+#define ETH_MAX_FRAME_LENGTH_ERROR		(BIT2 )
-+#define ETH_RESOURCE_ERROR			((BIT2 | BIT1))
-+#define ETH_VLAN_TAGGED				(BIT19)
-+#define ETH_BPDU_FRAME				(BIT20)
-+#define ETH_TCP_FRAME_OVER_IP_V_4		(0    )
-+#define ETH_UDP_FRAME_OVER_IP_V_4		(BIT21)
-+#define ETH_OTHER_FRAME_TYPE			(BIT22)
-+#define ETH_LAYER_2_IS_ETH_V_2			(BIT23)
-+#define ETH_FRAME_TYPE_IP_V_4			(BIT24)
-+#define ETH_FRAME_HEADER_OK			(BIT25)
-+#define ETH_RX_LAST_DESC			(BIT26)
-+#define ETH_RX_FIRST_DESC			(BIT27)
-+#define ETH_UNKNOWN_DESTINATION_ADDR		(BIT28)
-+#define ETH_RX_ENABLE_INTERRUPT			(BIT29)
-+#define ETH_LAYER_4_CHECKSUM_OK			(BIT30)
- 
- /* Rx descriptors byte count */
--#define ETH_FRAME_FRAGMENTED                (BIT2)
-+#define ETH_FRAME_FRAGMENTED			(BIT2)
- 
- /* Tx descriptors command */
- #define ETH_LAYER_4_CHECKSUM_FIRST_DESC		(BIT10)
--#define ETH_FRAME_SET_TO_VLAN               (BIT15)
--#define ETH_TCP_FRAME                       (0	  )
--#define ETH_UDP_FRAME                       (BIT16)
--#define ETH_GEN_TCP_UDP_CHECKSUM            (BIT17)
--#define ETH_GEN_IP_V_4_CHECKSUM             (BIT18)
--#define ETH_ZERO_PADDING                    (BIT19)
--#define ETH_TX_LAST_DESC                    (BIT20)
--#define ETH_TX_FIRST_DESC                   (BIT21)
--#define ETH_GEN_CRC                         (BIT22)
--#define ETH_TX_ENABLE_INTERRUPT             (BIT23)
--#define ETH_AUTO_MODE                       (BIT30)
-+#define ETH_FRAME_SET_TO_VLAN			(BIT15)
-+#define ETH_TCP_FRAME				(0    )
-+#define ETH_UDP_FRAME				(BIT16)
-+#define ETH_GEN_TCP_UDP_CHECKSUM		(BIT17)
-+#define ETH_GEN_IP_V_4_CHECKSUM			(BIT18)
-+#define ETH_ZERO_PADDING			(BIT19)
-+#define ETH_TX_LAST_DESC			(BIT20)
-+#define ETH_TX_FIRST_DESC			(BIT21)
-+#define ETH_GEN_CRC				(BIT22)
-+#define ETH_TX_ENABLE_INTERRUPT			(BIT23)
-+#define ETH_AUTO_MODE				(BIT30)
- 
- /* typedefs */
- 
- typedef enum _eth_func_ret_status {
--	ETH_OK,			/* Returned as expected.                    */
--	ETH_ERROR,		/* Fundamental error.                       */
--	ETH_RETRY,		/* Could not process request. Try later.    */
--	ETH_END_OF_JOB,		/* Ring has nothing to process.             */
--	ETH_QUEUE_FULL,		/* Ring resource error.                     */
--	ETH_QUEUE_LAST_RESOURCE	/* Ring resources about to exhaust.         */
-+	ETH_OK,			/* Returned as expected.		*/
-+	ETH_ERROR,		/* Fundamental error.			*/
-+	ETH_RETRY,		/* Could not process request. Try later.*/
-+	ETH_END_OF_JOB,		/* Ring has nothing to process.		*/
-+	ETH_QUEUE_FULL,		/* Ring resource error.			*/
-+	ETH_QUEUE_LAST_RESOURCE	/* Ring resources about to exhaust.	*/
- } ETH_FUNC_RET_STATUS;
- 
- typedef enum _eth_target {
-@@ -441,66 +241,103 @@
-  */
- #if defined(__BIG_ENDIAN)
- struct eth_rx_desc {
--	u16	byte_cnt;	/* Descriptor buffer byte count     */
--	u16	buf_size;	/* Buffer size                      */
--	u32	cmd_sts;	/* Descriptor command status        */
--	u32	next_desc_ptr;	/* Next descriptor pointer          */
--	u32	buf_ptr;	/* Descriptor buffer pointer        */
-+	u16 byte_cnt;		/* Descriptor buffer byte count		*/
-+	u16 buf_size;		/* Buffer size				*/
-+	u32 cmd_sts;		/* Descriptor command status		*/
-+	u32 next_desc_ptr;	/* Next descriptor pointer		*/
-+	u32 buf_ptr;		/* Descriptor buffer pointer		*/
- };
- 
- struct eth_tx_desc {
--	u16	byte_cnt;	/* buffer byte count */
--	u16	l4i_chk;	/* CPU provided TCP checksum */
--	u32	cmd_sts;	/* Command/status field */
--	u32	next_desc_ptr;	/* Pointer to next descriptor */
--	u32	buf_ptr;	/* pointer to buffer for this descriptor */
-+	u16 byte_cnt;		/* buffer byte count			*/
-+	u16 l4i_chk;		/* CPU provided TCP checksum		*/
-+	u32 cmd_sts;		/* Command/status field			*/
-+	u32 next_desc_ptr;	/* Pointer to next descriptor		*/
-+	u32 buf_ptr;		/* pointer to buffer for this descriptor*/
- };
- 
- #elif defined(__LITTLE_ENDIAN)
- struct eth_rx_desc {
--	u32	cmd_sts;	/* Descriptor command status        */
--	u16	buf_size;	/* Buffer size                      */
--	u16	byte_cnt;	/* Descriptor buffer byte count     */
--	u32	buf_ptr;	/* Descriptor buffer pointer        */
--	u32	next_desc_ptr;	/* Next descriptor pointer          */
-+	u32 cmd_sts;		/* Descriptor command status		*/
-+	u16 buf_size;		/* Buffer size				*/
-+	u16 byte_cnt;		/* Descriptor buffer byte count		*/
-+	u32 buf_ptr;		/* Descriptor buffer pointer		*/
-+	u32 next_desc_ptr;	/* Next descriptor pointer		*/
- };
- 
- struct eth_tx_desc {
--	u32	cmd_sts;	/* Command/status field */
--	u16	l4i_chk;	/* CPU provided TCP checksum */
--	u16	byte_cnt;	/* buffer byte count */
--	u32	buf_ptr;	/* pointer to buffer for this descriptor */
--	u32	next_desc_ptr;	/* Pointer to next descriptor */
-+	u32 cmd_sts;		/* Command/status field			*/
-+	u16 l4i_chk;		/* CPU provided TCP checksum		*/
-+	u16 byte_cnt;		/* buffer byte count			*/
-+	u32 buf_ptr;		/* pointer to buffer for this descriptor*/
-+	u32 next_desc_ptr;	/* Pointer to next descriptor		*/
- };
- #else
- #error One of __BIG_ENDIAN or __LITTLE_ENDIAN must be defined
- #endif
- 
--/* Unified struct for Rx and Tx operations. The user is not required to */
--/* be familier with neither Tx nor Rx descriptors.                       */
-+/* Unified struct for Rx and Tx operations. The user is not required to	*/
-+/* be familier with neither Tx nor Rx descriptors.			*/
- struct pkt_info {
--	unsigned short	byte_cnt;	/* Descriptor buffer byte count     */
--	unsigned short	l4i_chk;	/* Tx CPU provided TCP Checksum     */
--	unsigned int	cmd_sts;	/* Descriptor command status        */
--	dma_addr_t	buf_ptr;	/* Descriptor buffer pointer        */
--	struct sk_buff	* return_info;	/* User resource return information */
-+	unsigned short byte_cnt;	/* Descriptor buffer byte count	*/
-+	unsigned short l4i_chk;		/* Tx CPU provided TCP Checksum	*/
-+	unsigned int cmd_sts;		/* Descriptor command status	*/
-+	dma_addr_t buf_ptr;		/* Descriptor buffer pointer	*/
-+	struct sk_buff *return_info;	/* User resource return information */
- };
- 
--
- /* Ethernet port specific infomation */
- 
--struct mv64340_private {
--	int	port_num;		/* User Ethernet port number */
--	u8	port_mac_addr[6];	/* User defined port MAC address. */
--	u32	port_config;		/* User port configuration value */
--	u32	port_config_extend;	/* User port config extend value */
--	u32	port_sdma_config;	/* User port SDMA config value */
--	u32	port_serial_control;	/* User port serial control value */
--	u32	port_tx_queue_command;	/* Port active Tx queues summary */
--	u32	port_rx_queue_command;	/* Port active Rx queues summary */
-+struct mv643xx_mib_counters {
-+	u64 good_octets_received;
-+	u32 bad_octets_received;
-+	u32 internal_mac_transmit_err;
-+	u32 good_frames_received;
-+	u32 bad_frames_received;
-+	u32 broadcast_frames_received;
-+	u32 multicast_frames_received;
-+	u32 frames_64_octets;
-+	u32 frames_65_to_127_octets;
-+	u32 frames_128_to_255_octets;
-+	u32 frames_256_to_511_octets;
-+	u32 frames_512_to_1023_octets;
-+	u32 frames_1024_to_max_octets;
-+	u64 good_octets_sent;
-+	u32 good_frames_sent;
-+	u32 excessive_collision;
-+	u32 multicast_frames_sent;
-+	u32 broadcast_frames_sent;
-+	u32 unrec_mac_control_received;
-+	u32 fc_sent;
-+	u32 good_fc_received;
-+	u32 bad_fc_received;
-+	u32 undersize_received;
-+	u32 fragments_received;
-+	u32 oversize_received;
-+	u32 jabber_received;
-+	u32 mac_receive_error;
-+	u32 bad_crc_event;
-+	u32 collision;
-+	u32 late_collision;
-+};
-+
-+struct mv643xx_private {
-+	int port_num;			/* User Ethernet port number	*/
-+	u8 port_mac_addr[6];		/* User defined port MAC address.*/
-+	u32 port_config;		/* User port configuration value*/
-+	u32 port_config_extend;		/* User port config extend value*/
-+	u32 port_sdma_config;		/* User port SDMA config value	*/
-+	u32 port_serial_control;	/* User port serial control value */
-+	u32 port_tx_queue_command;	/* Port active Tx queues summary*/
-+	u32 port_rx_queue_command;	/* Port active Rx queues summary*/
-+
-+	u32 rx_sram_addr;		/* Base address of rx sram area */
-+	u32 rx_sram_size;		/* Size of rx sram area		*/
-+	u32 tx_sram_addr;		/* Base address of tx sram area */
-+	u32 tx_sram_size;		/* Size of tx sram area		*/
- 
--	int	rx_resource_err;	/* Rx ring resource error flag */
--	int	tx_resource_err;	/* Tx ring resource error flag */
-+	int rx_resource_err;		/* Rx ring resource error flag */
-+	int tx_resource_err;		/* Tx ring resource error flag */
- 
- 	/* Tx/Rx rings managment indexes fields. For driver use */
- 
-@@ -509,30 +346,32 @@
- 
- 	/* Next available and first returning Tx resource */
- 	int tx_curr_desc_q, tx_used_desc_q;
--#ifdef MV64340_CHECKSUM_OFFLOAD_TX
--        int tx_first_desc_q;
-+#ifdef MV643XX_CHECKSUM_OFFLOAD_TX
-+	int tx_first_desc_q;
-+	u32 tx_first_command;
- #endif
- 
--#ifdef MV64340_TX_FAST_REFILL
--	u32	tx_clean_threshold;
-+#ifdef MV643XX_TX_FAST_REFILL
-+	u32 tx_clean_threshold;
- #endif
- 
--	volatile struct eth_rx_desc	* p_rx_desc_area;
--	dma_addr_t			rx_desc_dma;
--	unsigned int			rx_desc_area_size;
--	struct sk_buff			* rx_skb[MV64340_RX_QUEUE_SIZE];
--
--	volatile struct eth_tx_desc	* p_tx_desc_area;
--	dma_addr_t			tx_desc_dma;
--	unsigned int			tx_desc_area_size;
--	struct sk_buff			* tx_skb[MV64340_TX_QUEUE_SIZE];
-+	struct eth_rx_desc *p_rx_desc_area;
-+	dma_addr_t rx_desc_dma;
-+	unsigned int rx_desc_area_size;
-+	struct sk_buff **rx_skb;
-+
-+	struct eth_tx_desc *p_tx_desc_area;
-+	dma_addr_t tx_desc_dma;
-+	unsigned int tx_desc_area_size;
-+	struct sk_buff **tx_skb;
- 
--	struct work_struct		tx_timeout_task;
-+	struct work_struct tx_timeout_task;
- 
- 	/*
--	 * Former struct mv64340_eth_priv members start here
-+	 * Former struct mv643xx_eth_priv members start here
- 	 */
- 	struct net_device_stats stats;
-+	struct mv643xx_mib_counters mib_counters;
- 	spinlock_t lock;
- 	/* Size of Tx Ring per queue */
- 	unsigned int tx_ring_size;
-@@ -544,13 +383,13 @@
- 	unsigned int rx_ring_skbs;
- 
- 	/*
--	 * rx_task used to fill RX ring out of bottom half context 
-+	 * rx_task used to fill RX ring out of bottom half context
- 	 */
- 	struct work_struct rx_task;
- 
--	/* 
--	 * Used in case RX Ring is empty, which can be caused when 
--	 * system does not have resources (skb's) 
-+	/*
-+	 * Used in case RX Ring is empty, which can be caused when
-+	 * system does not have resources (skb's)
- 	 */
- 	struct timer_list timeout;
- 	long rx_task_busy __attribute__ ((aligned(SMP_CACHE_BYTES)));
-@@ -563,9 +402,9 @@
- /* ethernet.h API list */
- 
- /* Port operation control routines */
--static void eth_port_init(struct mv64340_private *mp);
-+static void eth_port_init(struct mv643xx_private *mp);
- static void eth_port_reset(unsigned int eth_port_num);
--static int eth_port_start(struct mv64340_private *mp);
-+static void eth_port_start(struct mv643xx_private *mp);
- 
- static void ethernet_set_config_reg(unsigned int eth_port_num,
- 				    unsigned int value);
-@@ -576,26 +415,24 @@
- 				 unsigned char *p_addr);
- 
- /* PHY and MIB routines */
--static int ethernet_phy_reset(unsigned int eth_port_num);
-+static void ethernet_phy_reset(unsigned int eth_port_num);
-+
-+static void eth_port_write_smi_reg(unsigned int eth_port_num,
-+				   unsigned int phy_reg, unsigned int value);
- 
--static int eth_port_write_smi_reg(unsigned int eth_port_num,
--				   unsigned int phy_reg,
--				   unsigned int value);
--
--static int eth_port_read_smi_reg(unsigned int eth_port_num,
--				  unsigned int phy_reg,
--				  unsigned int *value);
-+static void eth_port_read_smi_reg(unsigned int eth_port_num,
-+				  unsigned int phy_reg, unsigned int *value);
- 
- static void eth_clear_mib_counters(unsigned int eth_port_num);
- 
- /* Port data flow control routines */
--static ETH_FUNC_RET_STATUS eth_port_send(struct mv64340_private *mp,
--					 struct pkt_info * p_pkt_info);
--static ETH_FUNC_RET_STATUS eth_tx_return_desc(struct mv64340_private *mp,
--					      struct pkt_info * p_pkt_info);
--static ETH_FUNC_RET_STATUS eth_port_receive(struct mv64340_private *mp,
--					    struct pkt_info * p_pkt_info);
--static ETH_FUNC_RET_STATUS eth_rx_return_buff(struct mv64340_private *mp,
--					      struct pkt_info * p_pkt_info);
-+static ETH_FUNC_RET_STATUS eth_port_send(struct mv643xx_private *mp,
-+					 struct pkt_info *p_pkt_info);
-+static ETH_FUNC_RET_STATUS eth_tx_return_desc(struct mv643xx_private *mp,
-+					      struct pkt_info *p_pkt_info);
-+static ETH_FUNC_RET_STATUS eth_port_receive(struct mv643xx_private *mp,
-+					    struct pkt_info *p_pkt_info);
-+static ETH_FUNC_RET_STATUS eth_rx_return_buff(struct mv643xx_private *mp,
-+					      struct pkt_info *p_pkt_info);
- 
--#endif  /* __MV64340_ETH_H__ */
-+#endif				/* __MV643XX_ETH_H__ */
---- kernel-source-2.6.11/include/linux/mv643xx.h	2005-03-02 08:38:18.000000000 +0100
-+++ kernel-source-2.6.11-marvell/include/linux/mv643xx.h	2005-03-08 10:08:28.000000000 +0100
-@@ -1,5 +1,5 @@
- /*
-- * mv64340.h - MV-64340 Internal registers definition file.
-+ * mv643xx.h - MV-643XX Internal registers definition file.
-  *
-  * Copyright 2002 Momentum Computer, Inc.
-  * 	Author: Matthew Dharm <mdharm at momenco.com>
-@@ -10,8 +10,8 @@
-  * Free Software Foundation;  either version 2 of the  License, or (at your
-  * option) any later version.
-  */
--#ifndef __ASM_MV64340_H
--#define __ASM_MV64340_H
-+#ifndef __ASM_MV643XX_H
-+#define __ASM_MV643XX_H
- 
- #ifdef __MIPS__
- #include <asm/addrspace.h>
-@@ -662,116 +662,119 @@
- /*        Ethernet Unit Registers  		*/
- /****************************************/
- 
--#define MV64340_ETH_PHY_ADDR_REG                                    0x2000
--#define MV64340_ETH_SMI_REG                                         0x2004
--#define MV64340_ETH_UNIT_DEFAULT_ADDR_REG                           0x2008
--#define MV64340_ETH_UNIT_DEFAULTID_REG                              0x200c
--#define MV64340_ETH_UNIT_INTERRUPT_CAUSE_REG                        0x2080
--#define MV64340_ETH_UNIT_INTERRUPT_MASK_REG                         0x2084
--#define MV64340_ETH_UNIT_INTERNAL_USE_REG                           0x24fc
--#define MV64340_ETH_UNIT_ERROR_ADDR_REG                             0x2094
--#define MV64340_ETH_BAR_0                                           0x2200
--#define MV64340_ETH_BAR_1                                           0x2208
--#define MV64340_ETH_BAR_2                                           0x2210
--#define MV64340_ETH_BAR_3                                           0x2218
--#define MV64340_ETH_BAR_4                                           0x2220
--#define MV64340_ETH_BAR_5                                           0x2228
--#define MV64340_ETH_SIZE_REG_0                                      0x2204
--#define MV64340_ETH_SIZE_REG_1                                      0x220c
--#define MV64340_ETH_SIZE_REG_2                                      0x2214
--#define MV64340_ETH_SIZE_REG_3                                      0x221c
--#define MV64340_ETH_SIZE_REG_4                                      0x2224
--#define MV64340_ETH_SIZE_REG_5                                      0x222c
--#define MV64340_ETH_HEADERS_RETARGET_BASE_REG                       0x2230
--#define MV64340_ETH_HEADERS_RETARGET_CONTROL_REG                    0x2234
--#define MV64340_ETH_HIGH_ADDR_REMAP_REG_0                           0x2280
--#define MV64340_ETH_HIGH_ADDR_REMAP_REG_1                           0x2284
--#define MV64340_ETH_HIGH_ADDR_REMAP_REG_2                           0x2288
--#define MV64340_ETH_HIGH_ADDR_REMAP_REG_3                           0x228c
--#define MV64340_ETH_BASE_ADDR_ENABLE_REG                            0x2290
--#define MV64340_ETH_ACCESS_PROTECTION_REG(port)                    (0x2294 + (port<<2))
--#define MV64340_ETH_MIB_COUNTERS_BASE(port)                        (0x3000 + (port<<7))
--#define MV64340_ETH_PORT_CONFIG_REG(port)                          (0x2400 + (port<<10))
--#define MV64340_ETH_PORT_CONFIG_EXTEND_REG(port)                   (0x2404 + (port<<10))
--#define MV64340_ETH_MII_SERIAL_PARAMETRS_REG(port)                 (0x2408 + (port<<10))
--#define MV64340_ETH_GMII_SERIAL_PARAMETRS_REG(port)                (0x240c + (port<<10))
--#define MV64340_ETH_VLAN_ETHERTYPE_REG(port)                       (0x2410 + (port<<10))
--#define MV64340_ETH_MAC_ADDR_LOW(port)                             (0x2414 + (port<<10))
--#define MV64340_ETH_MAC_ADDR_HIGH(port)                            (0x2418 + (port<<10))
--#define MV64340_ETH_SDMA_CONFIG_REG(port)                          (0x241c + (port<<10))
--#define MV64340_ETH_DSCP_0(port)                                   (0x2420 + (port<<10))
--#define MV64340_ETH_DSCP_1(port)                                   (0x2424 + (port<<10))
--#define MV64340_ETH_DSCP_2(port)                                   (0x2428 + (port<<10))
--#define MV64340_ETH_DSCP_3(port)                                   (0x242c + (port<<10))
--#define MV64340_ETH_DSCP_4(port)                                   (0x2430 + (port<<10))
--#define MV64340_ETH_DSCP_5(port)                                   (0x2434 + (port<<10))
--#define MV64340_ETH_DSCP_6(port)                                   (0x2438 + (port<<10))
--#define MV64340_ETH_PORT_SERIAL_CONTROL_REG(port)                  (0x243c + (port<<10))
--#define MV64340_ETH_VLAN_PRIORITY_TAG_TO_PRIORITY(port)            (0x2440 + (port<<10))
--#define MV64340_ETH_PORT_STATUS_REG(port)                          (0x2444 + (port<<10))
--#define MV64340_ETH_TRANSMIT_QUEUE_COMMAND_REG(port)               (0x2448 + (port<<10))
--#define MV64340_ETH_TX_QUEUE_FIXED_PRIORITY(port)                  (0x244c + (port<<10))
--#define MV64340_ETH_PORT_TX_TOKEN_BUCKET_RATE_CONFIG(port)         (0x2450 + (port<<10))
--#define MV64340_ETH_MAXIMUM_TRANSMIT_UNIT(port)                    (0x2458 + (port<<10))
--#define MV64340_ETH_PORT_MAXIMUM_TOKEN_BUCKET_SIZE(port)           (0x245c + (port<<10))
--#define MV64340_ETH_INTERRUPT_CAUSE_REG(port)                      (0x2460 + (port<<10))
--#define MV64340_ETH_INTERRUPT_CAUSE_EXTEND_REG(port)               (0x2464 + (port<<10))
--#define MV64340_ETH_INTERRUPT_MASK_REG(port)                       (0x2468 + (port<<10))
--#define MV64340_ETH_INTERRUPT_EXTEND_MASK_REG(port)                (0x246c + (port<<10))
--#define MV64340_ETH_RX_FIFO_URGENT_THRESHOLD_REG(port)             (0x2470 + (port<<10))
--#define MV64340_ETH_TX_FIFO_URGENT_THRESHOLD_REG(port)             (0x2474 + (port<<10))
--#define MV64340_ETH_RX_MINIMAL_FRAME_SIZE_REG(port)                (0x247c + (port<<10))
--#define MV64340_ETH_RX_DISCARDED_FRAMES_COUNTER(port)              (0x2484 + (port<<10)
--#define MV64340_ETH_PORT_DEBUG_0_REG(port)                         (0x248c + (port<<10))
--#define MV64340_ETH_PORT_DEBUG_1_REG(port)                         (0x2490 + (port<<10))
--#define MV64340_ETH_PORT_INTERNAL_ADDR_ERROR_REG(port)             (0x2494 + (port<<10))
--#define MV64340_ETH_INTERNAL_USE_REG(port)                         (0x24fc + (port<<10))
--#define MV64340_ETH_RECEIVE_QUEUE_COMMAND_REG(port)                (0x2680 + (port<<10))
--#define MV64340_ETH_CURRENT_SERVED_TX_DESC_PTR(port)               (0x2684 + (port<<10))      
--#define MV64340_ETH_RX_CURRENT_QUEUE_DESC_PTR_0(port)              (0x260c + (port<<10))     
--#define MV64340_ETH_RX_CURRENT_QUEUE_DESC_PTR_1(port)              (0x261c + (port<<10))     
--#define MV64340_ETH_RX_CURRENT_QUEUE_DESC_PTR_2(port)              (0x262c + (port<<10))     
--#define MV64340_ETH_RX_CURRENT_QUEUE_DESC_PTR_3(port)              (0x263c + (port<<10))     
--#define MV64340_ETH_RX_CURRENT_QUEUE_DESC_PTR_4(port)              (0x264c + (port<<10))     
--#define MV64340_ETH_RX_CURRENT_QUEUE_DESC_PTR_5(port)              (0x265c + (port<<10))     
--#define MV64340_ETH_RX_CURRENT_QUEUE_DESC_PTR_6(port)              (0x266c + (port<<10))     
--#define MV64340_ETH_RX_CURRENT_QUEUE_DESC_PTR_7(port)              (0x267c + (port<<10))     
--#define MV64340_ETH_TX_CURRENT_QUEUE_DESC_PTR_0(port)              (0x26c0 + (port<<10))     
--#define MV64340_ETH_TX_CURRENT_QUEUE_DESC_PTR_1(port)              (0x26c4 + (port<<10))     
--#define MV64340_ETH_TX_CURRENT_QUEUE_DESC_PTR_2(port)              (0x26c8 + (port<<10))     
--#define MV64340_ETH_TX_CURRENT_QUEUE_DESC_PTR_3(port)              (0x26cc + (port<<10))     
--#define MV64340_ETH_TX_CURRENT_QUEUE_DESC_PTR_4(port)              (0x26d0 + (port<<10))     
--#define MV64340_ETH_TX_CURRENT_QUEUE_DESC_PTR_5(port)              (0x26d4 + (port<<10))     
--#define MV64340_ETH_TX_CURRENT_QUEUE_DESC_PTR_6(port)              (0x26d8 + (port<<10))     
--#define MV64340_ETH_TX_CURRENT_QUEUE_DESC_PTR_7(port)              (0x26dc + (port<<10))     
--#define MV64340_ETH_TX_QUEUE_0_TOKEN_BUCKET_COUNT(port)            (0x2700 + (port<<10))
--#define MV64340_ETH_TX_QUEUE_1_TOKEN_BUCKET_COUNT(port)            (0x2710 + (port<<10))
--#define MV64340_ETH_TX_QUEUE_2_TOKEN_BUCKET_COUNT(port)            (0x2720 + (port<<10))
--#define MV64340_ETH_TX_QUEUE_3_TOKEN_BUCKET_COUNT(port)            (0x2730 + (port<<10))
--#define MV64340_ETH_TX_QUEUE_4_TOKEN_BUCKET_COUNT(port)            (0x2740 + (port<<10))
--#define MV64340_ETH_TX_QUEUE_5_TOKEN_BUCKET_COUNT(port)            (0x2750 + (port<<10))
--#define MV64340_ETH_TX_QUEUE_6_TOKEN_BUCKET_COUNT(port)            (0x2760 + (port<<10))
--#define MV64340_ETH_TX_QUEUE_7_TOKEN_BUCKET_COUNT(port)            (0x2770 + (port<<10))
--#define MV64340_ETH_TX_QUEUE_0_TOKEN_BUCKET_CONFIG(port)           (0x2704 + (port<<10))
--#define MV64340_ETH_TX_QUEUE_1_TOKEN_BUCKET_CONFIG(port)           (0x2714 + (port<<10))
--#define MV64340_ETH_TX_QUEUE_2_TOKEN_BUCKET_CONFIG(port)           (0x2724 + (port<<10))
--#define MV64340_ETH_TX_QUEUE_3_TOKEN_BUCKET_CONFIG(port)           (0x2734 + (port<<10))
--#define MV64340_ETH_TX_QUEUE_4_TOKEN_BUCKET_CONFIG(port)           (0x2744 + (port<<10))
--#define MV64340_ETH_TX_QUEUE_5_TOKEN_BUCKET_CONFIG(port)           (0x2754 + (port<<10))
--#define MV64340_ETH_TX_QUEUE_6_TOKEN_BUCKET_CONFIG(port)           (0x2764 + (port<<10))
--#define MV64340_ETH_TX_QUEUE_7_TOKEN_BUCKET_CONFIG(port)           (0x2774 + (port<<10))
--#define MV64340_ETH_TX_QUEUE_0_ARBITER_CONFIG(port)                (0x2708 + (port<<10))
--#define MV64340_ETH_TX_QUEUE_1_ARBITER_CONFIG(port)                (0x2718 + (port<<10))
--#define MV64340_ETH_TX_QUEUE_2_ARBITER_CONFIG(port)                (0x2728 + (port<<10))
--#define MV64340_ETH_TX_QUEUE_3_ARBITER_CONFIG(port)                (0x2738 + (port<<10))
--#define MV64340_ETH_TX_QUEUE_4_ARBITER_CONFIG(port)                (0x2748 + (port<<10))
--#define MV64340_ETH_TX_QUEUE_5_ARBITER_CONFIG(port)                (0x2758 + (port<<10))
--#define MV64340_ETH_TX_QUEUE_6_ARBITER_CONFIG(port)                (0x2768 + (port<<10))
--#define MV64340_ETH_TX_QUEUE_7_ARBITER_CONFIG(port)                (0x2778 + (port<<10))
--#define MV64340_ETH_PORT_TX_TOKEN_BUCKET_COUNT(port)               (0x2780 + (port<<10))
--#define MV64340_ETH_DA_FILTER_SPECIAL_MULTICAST_TABLE_BASE(port)   (0x3400 + (port<<10))
--#define MV64340_ETH_DA_FILTER_OTHER_MULTICAST_TABLE_BASE(port)     (0x3500 + (port<<10))
--#define MV64340_ETH_DA_FILTER_UNICAST_TABLE_BASE(port)             (0x3600 + (port<<10))
-+#define MV643XX_ETH_SHARED_REGS                                     0x2000
-+#define MV643XX_ETH_SHARED_REGS_SIZE                                0x2000
-+
-+#define MV643XX_ETH_PHY_ADDR_REG                                    0x2000
-+#define MV643XX_ETH_SMI_REG                                         0x2004
-+#define MV643XX_ETH_UNIT_DEFAULT_ADDR_REG                           0x2008
-+#define MV643XX_ETH_UNIT_DEFAULTID_REG                              0x200c
-+#define MV643XX_ETH_UNIT_INTERRUPT_CAUSE_REG                        0x2080
-+#define MV643XX_ETH_UNIT_INTERRUPT_MASK_REG                         0x2084
-+#define MV643XX_ETH_UNIT_INTERNAL_USE_REG                           0x24fc
-+#define MV643XX_ETH_UNIT_ERROR_ADDR_REG                             0x2094
-+#define MV643XX_ETH_BAR_0                                           0x2200
-+#define MV643XX_ETH_BAR_1                                           0x2208
-+#define MV643XX_ETH_BAR_2                                           0x2210
-+#define MV643XX_ETH_BAR_3                                           0x2218
-+#define MV643XX_ETH_BAR_4                                           0x2220
-+#define MV643XX_ETH_BAR_5                                           0x2228
-+#define MV643XX_ETH_SIZE_REG_0                                      0x2204
-+#define MV643XX_ETH_SIZE_REG_1                                      0x220c
-+#define MV643XX_ETH_SIZE_REG_2                                      0x2214
-+#define MV643XX_ETH_SIZE_REG_3                                      0x221c
-+#define MV643XX_ETH_SIZE_REG_4                                      0x2224
-+#define MV643XX_ETH_SIZE_REG_5                                      0x222c
-+#define MV643XX_ETH_HEADERS_RETARGET_BASE_REG                       0x2230
-+#define MV643XX_ETH_HEADERS_RETARGET_CONTROL_REG                    0x2234
-+#define MV643XX_ETH_HIGH_ADDR_REMAP_REG_0                           0x2280
-+#define MV643XX_ETH_HIGH_ADDR_REMAP_REG_1                           0x2284
-+#define MV643XX_ETH_HIGH_ADDR_REMAP_REG_2                           0x2288
-+#define MV643XX_ETH_HIGH_ADDR_REMAP_REG_3                           0x228c
-+#define MV643XX_ETH_BASE_ADDR_ENABLE_REG                            0x2290
-+#define MV643XX_ETH_ACCESS_PROTECTION_REG(port)                    (0x2294 + (port<<2))
-+#define MV643XX_ETH_MIB_COUNTERS_BASE(port)                        (0x3000 + (port<<7))
-+#define MV643XX_ETH_PORT_CONFIG_REG(port)                          (0x2400 + (port<<10))
-+#define MV643XX_ETH_PORT_CONFIG_EXTEND_REG(port)                   (0x2404 + (port<<10))
-+#define MV643XX_ETH_MII_SERIAL_PARAMETRS_REG(port)                 (0x2408 + (port<<10))
-+#define MV643XX_ETH_GMII_SERIAL_PARAMETRS_REG(port)                (0x240c + (port<<10))
-+#define MV643XX_ETH_VLAN_ETHERTYPE_REG(port)                       (0x2410 + (port<<10))
-+#define MV643XX_ETH_MAC_ADDR_LOW(port)                             (0x2414 + (port<<10))
-+#define MV643XX_ETH_MAC_ADDR_HIGH(port)                            (0x2418 + (port<<10))
-+#define MV643XX_ETH_SDMA_CONFIG_REG(port)                          (0x241c + (port<<10))
-+#define MV643XX_ETH_DSCP_0(port)                                   (0x2420 + (port<<10))
-+#define MV643XX_ETH_DSCP_1(port)                                   (0x2424 + (port<<10))
-+#define MV643XX_ETH_DSCP_2(port)                                   (0x2428 + (port<<10))
-+#define MV643XX_ETH_DSCP_3(port)                                   (0x242c + (port<<10))
-+#define MV643XX_ETH_DSCP_4(port)                                   (0x2430 + (port<<10))
-+#define MV643XX_ETH_DSCP_5(port)                                   (0x2434 + (port<<10))
-+#define MV643XX_ETH_DSCP_6(port)                                   (0x2438 + (port<<10))
-+#define MV643XX_ETH_PORT_SERIAL_CONTROL_REG(port)                  (0x243c + (port<<10))
-+#define MV643XX_ETH_VLAN_PRIORITY_TAG_TO_PRIORITY(port)            (0x2440 + (port<<10))
-+#define MV643XX_ETH_PORT_STATUS_REG(port)                          (0x2444 + (port<<10))
-+#define MV643XX_ETH_TRANSMIT_QUEUE_COMMAND_REG(port)               (0x2448 + (port<<10))
-+#define MV643XX_ETH_TX_QUEUE_FIXED_PRIORITY(port)                  (0x244c + (port<<10))
-+#define MV643XX_ETH_PORT_TX_TOKEN_BUCKET_RATE_CONFIG(port)         (0x2450 + (port<<10))
-+#define MV643XX_ETH_MAXIMUM_TRANSMIT_UNIT(port)                    (0x2458 + (port<<10))
-+#define MV643XX_ETH_PORT_MAXIMUM_TOKEN_BUCKET_SIZE(port)           (0x245c + (port<<10))
-+#define MV643XX_ETH_INTERRUPT_CAUSE_REG(port)                      (0x2460 + (port<<10))
-+#define MV643XX_ETH_INTERRUPT_CAUSE_EXTEND_REG(port)               (0x2464 + (port<<10))
-+#define MV643XX_ETH_INTERRUPT_MASK_REG(port)                       (0x2468 + (port<<10))
-+#define MV643XX_ETH_INTERRUPT_EXTEND_MASK_REG(port)                (0x246c + (port<<10))
-+#define MV643XX_ETH_RX_FIFO_URGENT_THRESHOLD_REG(port)             (0x2470 + (port<<10))
-+#define MV643XX_ETH_TX_FIFO_URGENT_THRESHOLD_REG(port)             (0x2474 + (port<<10))
-+#define MV643XX_ETH_RX_MINIMAL_FRAME_SIZE_REG(port)                (0x247c + (port<<10))
-+#define MV643XX_ETH_RX_DISCARDED_FRAMES_COUNTER(port)              (0x2484 + (port<<10)
-+#define MV643XX_ETH_PORT_DEBUG_0_REG(port)                         (0x248c + (port<<10))
-+#define MV643XX_ETH_PORT_DEBUG_1_REG(port)                         (0x2490 + (port<<10))
-+#define MV643XX_ETH_PORT_INTERNAL_ADDR_ERROR_REG(port)             (0x2494 + (port<<10))
-+#define MV643XX_ETH_INTERNAL_USE_REG(port)                         (0x24fc + (port<<10))
-+#define MV643XX_ETH_RECEIVE_QUEUE_COMMAND_REG(port)                (0x2680 + (port<<10))
-+#define MV643XX_ETH_CURRENT_SERVED_TX_DESC_PTR(port)               (0x2684 + (port<<10))      
-+#define MV643XX_ETH_RX_CURRENT_QUEUE_DESC_PTR_0(port)              (0x260c + (port<<10))     
-+#define MV643XX_ETH_RX_CURRENT_QUEUE_DESC_PTR_1(port)              (0x261c + (port<<10))     
-+#define MV643XX_ETH_RX_CURRENT_QUEUE_DESC_PTR_2(port)              (0x262c + (port<<10))     
-+#define MV643XX_ETH_RX_CURRENT_QUEUE_DESC_PTR_3(port)              (0x263c + (port<<10))     
-+#define MV643XX_ETH_RX_CURRENT_QUEUE_DESC_PTR_4(port)              (0x264c + (port<<10))     
-+#define MV643XX_ETH_RX_CURRENT_QUEUE_DESC_PTR_5(port)              (0x265c + (port<<10))     
-+#define MV643XX_ETH_RX_CURRENT_QUEUE_DESC_PTR_6(port)              (0x266c + (port<<10))     
-+#define MV643XX_ETH_RX_CURRENT_QUEUE_DESC_PTR_7(port)              (0x267c + (port<<10))     
-+#define MV643XX_ETH_TX_CURRENT_QUEUE_DESC_PTR_0(port)              (0x26c0 + (port<<10))     
-+#define MV643XX_ETH_TX_CURRENT_QUEUE_DESC_PTR_1(port)              (0x26c4 + (port<<10))     
-+#define MV643XX_ETH_TX_CURRENT_QUEUE_DESC_PTR_2(port)              (0x26c8 + (port<<10))     
-+#define MV643XX_ETH_TX_CURRENT_QUEUE_DESC_PTR_3(port)              (0x26cc + (port<<10))     
-+#define MV643XX_ETH_TX_CURRENT_QUEUE_DESC_PTR_4(port)              (0x26d0 + (port<<10))     
-+#define MV643XX_ETH_TX_CURRENT_QUEUE_DESC_PTR_5(port)              (0x26d4 + (port<<10))     
-+#define MV643XX_ETH_TX_CURRENT_QUEUE_DESC_PTR_6(port)              (0x26d8 + (port<<10))     
-+#define MV643XX_ETH_TX_CURRENT_QUEUE_DESC_PTR_7(port)              (0x26dc + (port<<10))     
-+#define MV643XX_ETH_TX_QUEUE_0_TOKEN_BUCKET_COUNT(port)            (0x2700 + (port<<10))
-+#define MV643XX_ETH_TX_QUEUE_1_TOKEN_BUCKET_COUNT(port)            (0x2710 + (port<<10))
-+#define MV643XX_ETH_TX_QUEUE_2_TOKEN_BUCKET_COUNT(port)            (0x2720 + (port<<10))
-+#define MV643XX_ETH_TX_QUEUE_3_TOKEN_BUCKET_COUNT(port)            (0x2730 + (port<<10))
-+#define MV643XX_ETH_TX_QUEUE_4_TOKEN_BUCKET_COUNT(port)            (0x2740 + (port<<10))
-+#define MV643XX_ETH_TX_QUEUE_5_TOKEN_BUCKET_COUNT(port)            (0x2750 + (port<<10))
-+#define MV643XX_ETH_TX_QUEUE_6_TOKEN_BUCKET_COUNT(port)            (0x2760 + (port<<10))
-+#define MV643XX_ETH_TX_QUEUE_7_TOKEN_BUCKET_COUNT(port)            (0x2770 + (port<<10))
-+#define MV643XX_ETH_TX_QUEUE_0_TOKEN_BUCKET_CONFIG(port)           (0x2704 + (port<<10))
-+#define MV643XX_ETH_TX_QUEUE_1_TOKEN_BUCKET_CONFIG(port)           (0x2714 + (port<<10))
-+#define MV643XX_ETH_TX_QUEUE_2_TOKEN_BUCKET_CONFIG(port)           (0x2724 + (port<<10))
-+#define MV643XX_ETH_TX_QUEUE_3_TOKEN_BUCKET_CONFIG(port)           (0x2734 + (port<<10))
-+#define MV643XX_ETH_TX_QUEUE_4_TOKEN_BUCKET_CONFIG(port)           (0x2744 + (port<<10))
-+#define MV643XX_ETH_TX_QUEUE_5_TOKEN_BUCKET_CONFIG(port)           (0x2754 + (port<<10))
-+#define MV643XX_ETH_TX_QUEUE_6_TOKEN_BUCKET_CONFIG(port)           (0x2764 + (port<<10))
-+#define MV643XX_ETH_TX_QUEUE_7_TOKEN_BUCKET_CONFIG(port)           (0x2774 + (port<<10))
-+#define MV643XX_ETH_TX_QUEUE_0_ARBITER_CONFIG(port)                (0x2708 + (port<<10))
-+#define MV643XX_ETH_TX_QUEUE_1_ARBITER_CONFIG(port)                (0x2718 + (port<<10))
-+#define MV643XX_ETH_TX_QUEUE_2_ARBITER_CONFIG(port)                (0x2728 + (port<<10))
-+#define MV643XX_ETH_TX_QUEUE_3_ARBITER_CONFIG(port)                (0x2738 + (port<<10))
-+#define MV643XX_ETH_TX_QUEUE_4_ARBITER_CONFIG(port)                (0x2748 + (port<<10))
-+#define MV643XX_ETH_TX_QUEUE_5_ARBITER_CONFIG(port)                (0x2758 + (port<<10))
-+#define MV643XX_ETH_TX_QUEUE_6_ARBITER_CONFIG(port)                (0x2768 + (port<<10))
-+#define MV643XX_ETH_TX_QUEUE_7_ARBITER_CONFIG(port)                (0x2778 + (port<<10))
-+#define MV643XX_ETH_PORT_TX_TOKEN_BUCKET_COUNT(port)               (0x2780 + (port<<10))
-+#define MV643XX_ETH_DA_FILTER_SPECIAL_MULTICAST_TABLE_BASE(port)   (0x3400 + (port<<10))
-+#define MV643XX_ETH_DA_FILTER_OTHER_MULTICAST_TABLE_BASE(port)     (0x3500 + (port<<10))
-+#define MV643XX_ETH_DA_FILTER_UNICAST_TABLE_BASE(port)             (0x3600 + (port<<10))
- 
- /*******************************************/
- /*          CUNIT  Registers               */
-@@ -1085,4 +1088,221 @@
- 	u32	brg_clk_freq;
- };
- 
--#endif /* __ASM_MV64340_H */
-+/* These macros describe Ethernet Port configuration reg (Px_cR) bits */
-+#define MV643XX_ETH_UNICAST_NORMAL_MODE		0
-+#define MV643XX_ETH_UNICAST_PROMISCUOUS_MODE	(1<<0)
-+#define MV643XX_ETH_DEFAULT_RX_QUEUE_0		0
-+#define MV643XX_ETH_DEFAULT_RX_QUEUE_1		(1<<1)
-+#define MV643XX_ETH_DEFAULT_RX_QUEUE_2		(1<<2)
-+#define MV643XX_ETH_DEFAULT_RX_QUEUE_3		((1<<2) | (1<<1))
-+#define MV643XX_ETH_DEFAULT_RX_QUEUE_4		(1<<3)
-+#define MV643XX_ETH_DEFAULT_RX_QUEUE_5		((1<<3) | (1<<1))
-+#define MV643XX_ETH_DEFAULT_RX_QUEUE_6		((1<<3) | (1<<2))
-+#define MV643XX_ETH_DEFAULT_RX_QUEUE_7		((1<<3) | (1<<2) | (1<<1))
-+#define MV643XX_ETH_DEFAULT_RX_ARP_QUEUE_0	0
-+#define MV643XX_ETH_DEFAULT_RX_ARP_QUEUE_1	(1<<4)
-+#define MV643XX_ETH_DEFAULT_RX_ARP_QUEUE_2	(1<<5)
-+#define MV643XX_ETH_DEFAULT_RX_ARP_QUEUE_3	((1<<5) | (1<<4))
-+#define MV643XX_ETH_DEFAULT_RX_ARP_QUEUE_4	(1<<6)
-+#define MV643XX_ETH_DEFAULT_RX_ARP_QUEUE_5	((1<<6) | (1<<4))
-+#define MV643XX_ETH_DEFAULT_RX_ARP_QUEUE_6	((1<<6) | (1<<5))
-+#define MV643XX_ETH_DEFAULT_RX_ARP_QUEUE_7	((1<<6) | (1<<5) | (1<<4))
-+#define MV643XX_ETH_RECEIVE_BC_IF_NOT_IP_OR_ARP	0
-+#define MV643XX_ETH_REJECT_BC_IF_NOT_IP_OR_ARP	(1<<7)
-+#define MV643XX_ETH_RECEIVE_BC_IF_IP		0
-+#define MV643XX_ETH_REJECT_BC_IF_IP		(1<<8)
-+#define MV643XX_ETH_RECEIVE_BC_IF_ARP		0
-+#define MV643XX_ETH_REJECT_BC_IF_ARP		(1<<9)
-+#define MV643XX_ETH_TX_AM_NO_UPDATE_ERROR_SUMMARY (1<<12)
-+#define MV643XX_ETH_CAPTURE_TCP_FRAMES_DIS	0
-+#define MV643XX_ETH_CAPTURE_TCP_FRAMES_EN	(1<<14)
-+#define MV643XX_ETH_CAPTURE_UDP_FRAMES_DIS	0
-+#define MV643XX_ETH_CAPTURE_UDP_FRAMES_EN	(1<<15)
-+#define MV643XX_ETH_DEFAULT_RX_TCP_QUEUE_0	0
-+#define MV643XX_ETH_DEFAULT_RX_TCP_QUEUE_1	(1<<16)
-+#define MV643XX_ETH_DEFAULT_RX_TCP_QUEUE_2	(1<<17)
-+#define MV643XX_ETH_DEFAULT_RX_TCP_QUEUE_3	((1<<17) | (1<<16))
-+#define MV643XX_ETH_DEFAULT_RX_TCP_QUEUE_4	(1<<18)
-+#define MV643XX_ETH_DEFAULT_RX_TCP_QUEUE_5	((1<<18) | (1<<16))
-+#define MV643XX_ETH_DEFAULT_RX_TCP_QUEUE_6	((1<<18) | (1<<17))
-+#define MV643XX_ETH_DEFAULT_RX_TCP_QUEUE_7	((1<<18) | (1<<17) | (1<<16))
-+#define MV643XX_ETH_DEFAULT_RX_UDP_QUEUE_0	0
-+#define MV643XX_ETH_DEFAULT_RX_UDP_QUEUE_1	(1<<19)
-+#define MV643XX_ETH_DEFAULT_RX_UDP_QUEUE_2	(1<<20)
-+#define MV643XX_ETH_DEFAULT_RX_UDP_QUEUE_3	((1<<20) | (1<<19))
-+#define MV643XX_ETH_DEFAULT_RX_UDP_QUEUE_4	((1<<21)
-+#define MV643XX_ETH_DEFAULT_RX_UDP_QUEUE_5	((1<<21) | (1<<19))
-+#define MV643XX_ETH_DEFAULT_RX_UDP_QUEUE_6	((1<<21) | (1<<20))
-+#define MV643XX_ETH_DEFAULT_RX_UDP_QUEUE_7	((1<<21) | (1<<20) | (1<<19))
-+#define MV643XX_ETH_DEFAULT_RX_BPDU_QUEUE_0	0
-+#define MV643XX_ETH_DEFAULT_RX_BPDU_QUEUE_1	(1<<22)
-+#define MV643XX_ETH_DEFAULT_RX_BPDU_QUEUE_2	(1<<23)
-+#define MV643XX_ETH_DEFAULT_RX_BPDU_QUEUE_3	((1<<23) | (1<<22))
-+#define MV643XX_ETH_DEFAULT_RX_BPDU_QUEUE_4	(1<<24)
-+#define MV643XX_ETH_DEFAULT_RX_BPDU_QUEUE_5	((1<<24) | (1<<22))
-+#define MV643XX_ETH_DEFAULT_RX_BPDU_QUEUE_6	((1<<24) | (1<<23))
-+#define MV643XX_ETH_DEFAULT_RX_BPDU_QUEUE_7	((1<<24) | (1<<23) | (1<<22))
-+
-+#define	MV643XX_ETH_PORT_CONFIG_DEFAULT_VALUE			\
-+		MV643XX_ETH_UNICAST_NORMAL_MODE		|	\
-+		MV643XX_ETH_DEFAULT_RX_QUEUE_0		|	\
-+		MV643XX_ETH_DEFAULT_RX_ARP_QUEUE_0	|	\
-+		MV643XX_ETH_RECEIVE_BC_IF_NOT_IP_OR_ARP	|	\
-+		MV643XX_ETH_RECEIVE_BC_IF_IP		|	\
-+		MV643XX_ETH_RECEIVE_BC_IF_ARP		|	\
-+		MV643XX_ETH_CAPTURE_TCP_FRAMES_DIS	|	\
-+		MV643XX_ETH_CAPTURE_UDP_FRAMES_DIS	|	\
-+		MV643XX_ETH_DEFAULT_RX_TCP_QUEUE_0	|	\
-+		MV643XX_ETH_DEFAULT_RX_UDP_QUEUE_0	|	\
-+		MV643XX_ETH_DEFAULT_RX_BPDU_QUEUE_0
-+
-+/* These macros describe Ethernet Port configuration extend reg (Px_cXR) bits*/
-+#define MV643XX_ETH_CLASSIFY_EN				(1<<0)
-+#define MV643XX_ETH_SPAN_BPDU_PACKETS_AS_NORMAL		0
-+#define MV643XX_ETH_SPAN_BPDU_PACKETS_TO_RX_QUEUE_7	(1<<1)
-+#define MV643XX_ETH_PARTITION_DISABLE			0
-+#define MV643XX_ETH_PARTITION_ENABLE			(1<<2)
-+
-+#define	MV643XX_ETH_PORT_CONFIG_EXTEND_DEFAULT_VALUE		\
-+		MV643XX_ETH_SPAN_BPDU_PACKETS_AS_NORMAL	|	\
-+		MV643XX_ETH_PARTITION_DISABLE
-+
-+/* These macros describe Ethernet Port Sdma configuration reg (SDCR) bits */
-+#define MV643XX_ETH_RIFB			(1<<0)
-+#define MV643XX_ETH_RX_BURST_SIZE_1_64BIT		0
-+#define MV643XX_ETH_RX_BURST_SIZE_2_64BIT		(1<<1)
-+#define MV643XX_ETH_RX_BURST_SIZE_4_64BIT		(1<<2)
-+#define MV643XX_ETH_RX_BURST_SIZE_8_64BIT		((1<<2) | (1<<1))
-+#define MV643XX_ETH_RX_BURST_SIZE_16_64BIT		(1<<3)
-+#define MV643XX_ETH_BLM_RX_NO_SWAP			(1<<4)
-+#define MV643XX_ETH_BLM_RX_BYTE_SWAP			0
-+#define MV643XX_ETH_BLM_TX_NO_SWAP			(1<<5)
-+#define MV643XX_ETH_BLM_TX_BYTE_SWAP			0
-+#define MV643XX_ETH_DESCRIPTORS_BYTE_SWAP		(1<<6)
-+#define MV643XX_ETH_DESCRIPTORS_NO_SWAP			0
-+#define MV643XX_ETH_TX_BURST_SIZE_1_64BIT		0
-+#define MV643XX_ETH_TX_BURST_SIZE_2_64BIT		(1<<22)
-+#define MV643XX_ETH_TX_BURST_SIZE_4_64BIT		(1<<23)
-+#define MV643XX_ETH_TX_BURST_SIZE_8_64BIT		((1<<23) | (1<<22))
-+#define MV643XX_ETH_TX_BURST_SIZE_16_64BIT		(1<<24)
-+
-+#define	MV643XX_ETH_IPG_INT_RX(value) ((value & 0x3fff) << 8)
-+
-+#define	MV643XX_ETH_PORT_SDMA_CONFIG_DEFAULT_VALUE		\
-+		MV643XX_ETH_RX_BURST_SIZE_4_64BIT	|	\
-+		MV643XX_ETH_IPG_INT_RX(0)		|	\
-+		MV643XX_ETH_TX_BURST_SIZE_4_64BIT
-+
-+/* These macros describe Ethernet Port serial control reg (PSCR) bits */
-+#define MV643XX_ETH_SERIAL_PORT_DISABLE			0
-+#define MV643XX_ETH_SERIAL_PORT_ENABLE			(1<<0)
-+#define MV643XX_ETH_FORCE_LINK_PASS			(1<<1)
-+#define MV643XX_ETH_DO_NOT_FORCE_LINK_PASS		0
-+#define MV643XX_ETH_ENABLE_AUTO_NEG_FOR_DUPLX		0
-+#define MV643XX_ETH_DISABLE_AUTO_NEG_FOR_DUPLX		(1<<2)
-+#define MV643XX_ETH_ENABLE_AUTO_NEG_FOR_FLOW_CTRL	0
-+#define MV643XX_ETH_DISABLE_AUTO_NEG_FOR_FLOW_CTRL	(1<<3)
-+#define MV643XX_ETH_ADV_NO_FLOW_CTRL			0
-+#define MV643XX_ETH_ADV_SYMMETRIC_FLOW_CTRL		(1<<4)
-+#define MV643XX_ETH_FORCE_FC_MODE_NO_PAUSE_DIS_TX	0
-+#define MV643XX_ETH_FORCE_FC_MODE_TX_PAUSE_DIS		(1<<5)
-+#define MV643XX_ETH_FORCE_BP_MODE_NO_JAM		0
-+#define MV643XX_ETH_FORCE_BP_MODE_JAM_TX		(1<<7)
-+#define MV643XX_ETH_FORCE_BP_MODE_JAM_TX_ON_RX_ERR	(1<<8)
-+#define MV643XX_ETH_FORCE_LINK_FAIL			0
-+#define MV643XX_ETH_DO_NOT_FORCE_LINK_FAIL		(1<<10)
-+#define MV643XX_ETH_RETRANSMIT_16_ATTEMPTS		0
-+#define MV643XX_ETH_RETRANSMIT_FOREVER			(1<<11)
-+#define MV643XX_ETH_DISABLE_AUTO_NEG_SPEED_GMII		(1<<13)
-+#define MV643XX_ETH_ENABLE_AUTO_NEG_SPEED_GMII		0
-+#define MV643XX_ETH_DTE_ADV_0				0
-+#define MV643XX_ETH_DTE_ADV_1				(1<<14)
-+#define MV643XX_ETH_DISABLE_AUTO_NEG_BYPASS		0
-+#define MV643XX_ETH_ENABLE_AUTO_NEG_BYPASS		(1<<15)
-+#define MV643XX_ETH_AUTO_NEG_NO_CHANGE			0
-+#define MV643XX_ETH_RESTART_AUTO_NEG			(1<<16)
-+#define MV643XX_ETH_MAX_RX_PACKET_1518BYTE		0
-+#define MV643XX_ETH_MAX_RX_PACKET_1522BYTE		(1<<17)
-+#define MV643XX_ETH_MAX_RX_PACKET_1552BYTE		(1<<18)
-+#define MV643XX_ETH_MAX_RX_PACKET_9022BYTE		((1<<18) | (1<<17))
-+#define MV643XX_ETH_MAX_RX_PACKET_9192BYTE		(1<<19)
-+#define MV643XX_ETH_MAX_RX_PACKET_9700BYTE		((1<<19) | (1<<17))
-+#define MV643XX_ETH_SET_EXT_LOOPBACK			(1<<20)
-+#define MV643XX_ETH_CLR_EXT_LOOPBACK			0
-+#define MV643XX_ETH_SET_FULL_DUPLEX_MODE		(1<<21)
-+#define MV643XX_ETH_SET_HALF_DUPLEX_MODE		0
-+#define MV643XX_ETH_ENABLE_FLOW_CTRL_TX_RX_IN_FULL_DUPLEX (1<<22)
-+#define MV643XX_ETH_DISABLE_FLOW_CTRL_TX_RX_IN_FULL_DUPLEX 0
-+#define MV643XX_ETH_SET_GMII_SPEED_TO_10_100		0
-+#define MV643XX_ETH_SET_GMII_SPEED_TO_1000		(1<<23)
-+#define MV643XX_ETH_SET_MII_SPEED_TO_10			0
-+#define MV643XX_ETH_SET_MII_SPEED_TO_100		(1<<24)
-+
-+#define	MV643XX_ETH_PORT_SERIAL_CONTROL_DEFAULT_VALUE		\
-+		MV643XX_ETH_DO_NOT_FORCE_LINK_PASS	|	\
-+		MV643XX_ETH_ENABLE_AUTO_NEG_FOR_DUPLX	|	\
-+		MV643XX_ETH_DISABLE_AUTO_NEG_FOR_FLOW_CTRL |	\
-+		MV643XX_ETH_ADV_SYMMETRIC_FLOW_CTRL	|	\
-+		MV643XX_ETH_FORCE_FC_MODE_NO_PAUSE_DIS_TX |	\
-+		MV643XX_ETH_FORCE_BP_MODE_NO_JAM	|	\
-+		(1<<9)	/* reserved */			|	\
-+		MV643XX_ETH_DO_NOT_FORCE_LINK_FAIL	|	\
-+		MV643XX_ETH_RETRANSMIT_16_ATTEMPTS	|	\
-+		MV643XX_ETH_ENABLE_AUTO_NEG_SPEED_GMII	|	\
-+		MV643XX_ETH_DTE_ADV_0			|	\
-+		MV643XX_ETH_DISABLE_AUTO_NEG_BYPASS	|	\
-+		MV643XX_ETH_AUTO_NEG_NO_CHANGE		|	\
-+		MV643XX_ETH_MAX_RX_PACKET_9700BYTE	|	\
-+		MV643XX_ETH_CLR_EXT_LOOPBACK		|	\
-+		MV643XX_ETH_SET_FULL_DUPLEX_MODE	|	\
-+		MV643XX_ETH_ENABLE_FLOW_CTRL_TX_RX_IN_FULL_DUPLEX
-+
-+/* These macros describe Ethernet Serial Status reg (PSR) bits */
-+#define MV643XX_ETH_PORT_STATUS_MODE_10_BIT		(1<<0)
-+#define MV643XX_ETH_PORT_STATUS_LINK_UP			(1<<1)
-+#define MV643XX_ETH_PORT_STATUS_FULL_DUPLEX		(1<<2)
-+#define MV643XX_ETH_PORT_STATUS_FLOW_CONTROL		(1<<3)
-+#define MV643XX_ETH_PORT_STATUS_GMII_1000		(1<<4)
-+#define MV643XX_ETH_PORT_STATUS_MII_100			(1<<5)
-+/* PSR bit 6 is undocumented */
-+#define MV643XX_ETH_PORT_STATUS_TX_IN_PROGRESS		(1<<7)
-+#define MV643XX_ETH_PORT_STATUS_AUTONEG_BYPASSED	(1<<8)
-+#define MV643XX_ETH_PORT_STATUS_PARTITION		(1<<9)
-+#define MV643XX_ETH_PORT_STATUS_TX_FIFO_EMPTY		(1<<10)
-+/* PSR bits 11-31 are reserved */
-+
-+#define	MV643XX_ETH_PORT_DEFAULT_TRANSMIT_QUEUE_SIZE	800
-+#define	MV643XX_ETH_PORT_DEFAULT_RECEIVE_QUEUE_SIZE	400
-+
-+#define MV643XX_ETH_DESC_SIZE				64
-+
-+#define MV643XX_ETH_SHARED_NAME	"mv643xx_eth_shared"
-+#define MV643XX_ETH_NAME	"mv643xx_eth"
-+
-+struct mv643xx_eth_platform_data {
-+	/* 
-+	 * Non-values for mac_addr, phy_addr, port_config, etc.
-+	 * override the default value.  Setting the corresponding
-+	 * force_* field, causes the default value to be overridden
-+	 * even when zero.
-+	 */
-+	unsigned int	force_phy_addr:1;
-+	unsigned int	force_port_config:1;
-+	unsigned int	force_port_config_extend:1;
-+	unsigned int	force_port_sdma_config:1;
-+	unsigned int	force_port_serial_control:1;
-+	int		phy_addr;
-+	char		*mac_addr;	/* pointer to mac address */
-+	u32		port_config;
-+	u32		port_config_extend;
-+	u32		port_sdma_config;
-+	u32		port_serial_control;
-+	u32		tx_queue_size;
-+	u32		rx_queue_size;
-+	u32		tx_sram_addr;
-+	u32		tx_sram_size;
-+	u32		rx_sram_addr;
-+	u32		rx_sram_size;
-+};
-+
-+#endif /* __ASM_MV643XX_H */

Copied: trunk/kernel/source/kernel-source-2.6.11-2.6.11/debian/patches/powerpc-mv643xx-enet.patch (from rev 2762, trunk/kernel/source/kernel-source-2.6.11-2.6.11/debian/patches/powerpc-mv643xx-enet.dpatch)

Deleted: trunk/kernel/source/kernel-source-2.6.11-2.6.11/debian/patches/powerpc-mv643xx-eth-pegasos.dpatch
===================================================================
--- trunk/kernel/source/kernel-source-2.6.11-2.6.11/debian/patches/powerpc-mv643xx-eth-pegasos.dpatch	2005-03-21 09:35:04 UTC (rev 2762)
+++ trunk/kernel/source/kernel-source-2.6.11-2.6.11/debian/patches/powerpc-mv643xx-eth-pegasos.dpatch	2005-03-21 09:38:36 UTC (rev 2763)
@@ -1,126 +0,0 @@
-#! /bin/sh -e 
-##
-## All lines beginning with `## DP:' are a description of the patch.
-## DP: Description: Powerpc/pegasos platform suport for mv643xx_eth gigabit ethernet driver.
-## DP: Patch authors: Dale Farnsworth <dale at farnsworth.org>, Sven Luther <sl at bplan-gmbh.de>
-## DP: Upstream status: submitted, planned for 2.6.12
-
-. $(dirname $0)/DPATCH
-
- at DPATCH@
---- linux-2.6.11/arch/ppc/platforms/Makefile	2005-03-02 08:38:33.000000000 +0100
-+++ linux-2.6.11-pegasos/arch/ppc/platforms/Makefile	2005-03-16 19:43:43.464210680 +0100
-@@ -12,7 +12,8 @@
- obj-$(CONFIG_PPC_PMAC)		+= pmac_pic.o pmac_setup.o pmac_time.o \
- 					pmac_feature.o pmac_pci.o pmac_sleep.o \
- 					pmac_low_i2c.o pmac_cache.o
--obj-$(CONFIG_PPC_CHRP)		+= chrp_setup.o chrp_time.o chrp_pci.o
-+obj-$(CONFIG_PPC_CHRP)		+= chrp_setup.o chrp_time.o chrp_pci.o \
-+					chrp_pegasos_eth.o
- obj-$(CONFIG_PPC_PREP)		+= prep_pci.o prep_setup.o
- ifeq ($(CONFIG_PPC_PMAC),y)
- obj-$(CONFIG_NVRAM)		+= pmac_nvram.o
---- linux-2.6.11/arch/ppc/platforms/chrp_pegasos_eth.c	1970-01-01 01:00:00.000000000 +0100
-+++ linux-2.6.11-pegasos/arch/ppc/platforms/chrp_pegasos_eth.c	2005-03-16 19:43:34.375592360 +0100
-@@ -0,0 +1,101 @@
-+/*
-+ *  arch/ppc/platforms/chrp_pegasos_eth.c
-+ *
-+ *  Copyright (C) 2005 Sven Luther <sl at bplan-gmbh.de> 
-+ *  Thanks to :
-+ *	Dale Farnsworth <dale at farnsworth.org>
-+ *	Mark A. Greer <mgreer at mvista.com>
-+ *	Nicolas DET <nd at bplan-gmbh.de>
-+ *	Benjamin Herrenschmidt <benh at kernel.crashing.org>
-+ *  And anyone else who helped me on this.
-+ */
-+
-+#include <linux/types.h>
-+#include <linux/init.h>
-+#include <linux/ioport.h>
-+#include <linux/device.h>
-+#include <linux/mv643xx.h>
-+#include <linux/pci.h>
-+
-+/* Pegasos 2 specific Marvell MV 64361 gigabit ethernet port setup */
-+static struct resource mv643xx_eth_shared_resources[] = {
-+	[0] = {
-+		.name	= "ethernet shared base",
-+		.start	= 0xf1000000 + MV643XX_ETH_SHARED_REGS,
-+		.end	= 0xf1000000 + MV643XX_ETH_SHARED_REGS +
-+					MV643XX_ETH_SHARED_REGS_SIZE - 1,
-+		.flags	= IORESOURCE_MEM,
-+	},
-+};
-+
-+static struct platform_device mv643xx_eth_shared_device = {
-+	.name		= MV643XX_ETH_SHARED_NAME,
-+	.id		= 0,
-+	.num_resources	= ARRAY_SIZE(mv643xx_eth_shared_resources),
-+	.resource	= mv643xx_eth_shared_resources,
-+};
-+
-+static struct resource mv643xx_eth0_resources[] = {
-+	[0] = {
-+		.name	= "eth0 irq",
-+		.start	= 9,
-+		.end	= 9,
-+		.flags	= IORESOURCE_IRQ,
-+	},
-+};
-+
-+static struct mv643xx_eth_platform_data eth0_pd;
-+
-+static struct platform_device eth0_device = {
-+	.name		= MV643XX_ETH_NAME,
-+	.id		= 0,
-+	.num_resources	= ARRAY_SIZE(mv643xx_eth0_resources),
-+	.resource	= mv643xx_eth0_resources,
-+	.dev = {
-+		.platform_data = &eth0_pd,
-+	},
-+};
-+
-+static struct resource mv643xx_eth1_resources[] = {
-+	[0] = {
-+		.name	= "eth1 irq",
-+		.start	= 9,
-+		.end	= 9,
-+		.flags	= IORESOURCE_IRQ,
-+	},
-+};
-+
-+static struct mv643xx_eth_platform_data eth1_pd;
-+
-+static struct platform_device eth1_device = {
-+	.name		= MV643XX_ETH_NAME,
-+	.id		= 1,
-+	.num_resources	= ARRAY_SIZE(mv643xx_eth1_resources),
-+	.resource	= mv643xx_eth1_resources,
-+	.dev = {
-+		.platform_data = &eth1_pd,
-+	},
-+};
-+
-+static struct platform_device *mv643xx_eth_pd_devs[] __initdata = {
-+	&mv643xx_eth_shared_device,
-+	&eth0_device,
-+	&eth1_device,
-+};
-+
-+
-+int 
-+mv643xx_eth_add_pds(void)
-+{
-+	int ret = 0;
-+	static struct pci_device_id pci_marvell_mv64360[] = {
-+		{ PCI_DEVICE(PCI_VENDOR_ID_MARVELL, PCI_DEVICE_ID_MARVELL_MV64360) },
-+		{ }
-+	};
-+
-+	if (pci_dev_present(pci_marvell_mv64360)) {
-+		ret = platform_add_devices(mv643xx_eth_pd_devs, ARRAY_SIZE(mv643xx_eth_pd_devs));
-+	}
-+	return ret;
-+}
-+device_initcall(mv643xx_eth_add_pds);

Copied: trunk/kernel/source/kernel-source-2.6.11-2.6.11/debian/patches/powerpc-mv643xx-eth-pegasos.patch (from rev 2762, trunk/kernel/source/kernel-source-2.6.11-2.6.11/debian/patches/powerpc-mv643xx-eth-pegasos.dpatch)

Deleted: trunk/kernel/source/kernel-source-2.6.11-2.6.11/debian/patches/powerpc-pmac-agp-sleep.dpatch
===================================================================
--- trunk/kernel/source/kernel-source-2.6.11-2.6.11/debian/patches/powerpc-pmac-agp-sleep.dpatch	2005-03-21 09:35:04 UTC (rev 2762)
+++ trunk/kernel/source/kernel-source-2.6.11-2.6.11/debian/patches/powerpc-pmac-agp-sleep.dpatch	2005-03-21 09:38:36 UTC (rev 2763)
@@ -1,156 +0,0 @@
-#! /bin/sh -e
-##
-## All lines beginning with `## DP:' are a description of the patch.
-## DP: Description: [PATCH] ppc32: uninorth-agp suspend support
-## DP: This patch adds suspend/resume support to the Apple UniNorth AGP bridge to
-## DP: make sure AGP is properly disabled when the machine goes to sleep.  Without
-## DP: this, the r300 based laptops will fail to wakeup from sleep when using the
-## DP: new experimental r300 DRI driver.  It should also improve reliablility in
-## DP: general with other chips.
-## DP: Unfortunately, uninorth-agp is just a "sibling" of the video chip on the
-## DP: PCI bus, and thus ends up beeing called either before the video chip
-## DP: suspend routine, or after, depending on the HW layout or other random
-## DP: things.
-## DP: To make sure the device side of AGP is always disabled first and that we
-## DP: never touch the device after having put it into D2 state (which can be
-## DP: deadly), I also need the separate patch to radeonfb and aty128fb which will
-## DP: make them disabled their own side if not already done by the bridge driver.
-## DP: Signed-off-by: Benjamin Herrenschmidt <benh at kernel.crashing.org>
-## DP: Signed-off-by: Paul Mackerras <paulus at samba.org>
-## DP: Signed-off-by: Andrew Morton <akpm at osdl.org>
-## DP: Signed-off-by: Linus Torvalds <torvalds at osdl.org>
-## DP: Patch author: Benjamin Herrenschmidt <benh at kernel.crashing.org>
-## DP: Upstream status: backport
-## DP: URL: http://linux.bkbits.net:8080/linux-2.6/cset@42307fe1_IGeH1Vsciya0MYbowgWzg?nav=index.html|src/|src/drivers|src/drivers/char|src/drivers/char/agp|related/drivers/char/agp/uninorth-agp.c
-
-. $(dirname $0)/DPATCH
-
- at DPATCH@
-diff -Naru a/drivers/char/agp/uninorth-agp.c b/drivers/char/agp/uninorth-agp.c
---- a/drivers/char/agp/uninorth-agp.c	2005-03-13 07:00:18 -08:00
-+++ b/drivers/char/agp/uninorth-agp.c	2005-03-13 07:00:18 -08:00
-@@ -6,6 +6,7 @@
- #include <linux/init.h>
- #include <linux/pagemap.h>
- #include <linux/agp_backend.h>
-+#include <linux/delay.h>
- #include <asm/uninorth.h>
- #include <asm/pci-bridge.h>
- #include "agp.h"
-@@ -51,6 +52,11 @@
- 
- static void uninorth_cleanup(void)
- {
-+	u32 tmp;
-+
-+	pci_read_config_dword(agp_bridge->dev, UNI_N_CFG_GART_CTRL, &tmp);
-+	if (!(tmp & UNI_N_CFG_GART_ENABLE))
-+		return;
- 	pci_write_config_dword(agp_bridge->dev, UNI_N_CFG_GART_CTRL,
- 			UNI_N_CFG_GART_ENABLE | UNI_N_CFG_GART_INVAL);
- 	pci_write_config_dword(agp_bridge->dev, UNI_N_CFG_GART_CTRL,
-@@ -155,6 +161,62 @@
- 	uninorth_tlbflush(NULL);
- }
- 
-+#ifdef CONFIG_PM
-+static int agp_uninorth_suspend(struct pci_dev *pdev, pm_message_t state)
-+{
-+	u32 cmd;
-+	u8 agp;
-+	struct pci_dev *device = NULL;
-+
-+	if (state != PMSG_SUSPEND)
-+		return 0;
-+
-+	/* turn off AGP on the video chip, if it was enabled */
-+	for_each_pci_dev(device) {
-+		/* Don't touch the bridge yet, device first */
-+		if (device == pdev)
-+			continue;
-+		/* Only deal with devices on the same bus here, no Mac has a P2P
-+		 * bridge on the AGP port, and mucking around the entire PCI
-+		 * tree is source of problems on some machines because of a bug
-+		 * in some versions of pci_find_capability() when hitting a dead
-+		 * device
-+		 */
-+		if (device->bus != pdev->bus)
-+			continue;
-+		agp = pci_find_capability(device, PCI_CAP_ID_AGP);
-+		if (!agp)
-+			continue;
-+		pci_read_config_dword(device, agp + PCI_AGP_COMMAND, &cmd);
-+		if (!(cmd & PCI_AGP_COMMAND_AGP))
-+			continue;
-+		printk("uninorth-agp: disabling AGP on device %s\n",
-+				pci_name(device));
-+		cmd &= ~PCI_AGP_COMMAND_AGP;
-+		pci_write_config_dword(device, agp + PCI_AGP_COMMAND, cmd);
-+	}
-+
-+	/* turn off AGP on the bridge */
-+	agp = pci_find_capability(pdev, PCI_CAP_ID_AGP);
-+	pci_read_config_dword(pdev, agp + PCI_AGP_COMMAND, &cmd);
-+	if (cmd & PCI_AGP_COMMAND_AGP) {
-+		printk("uninorth-agp: disabling AGP on bridge %s\n",
-+				pci_name(pdev));
-+		cmd &= ~PCI_AGP_COMMAND_AGP;
-+		pci_write_config_dword(pdev, agp + PCI_AGP_COMMAND, cmd);
-+	}
-+	/* turn off the GART */
-+	uninorth_cleanup();
-+
-+	return 0;
-+}
-+
-+static int agp_uninorth_resume(struct pci_dev *pdev)
-+{
-+	return 0;
-+}
-+#endif
-+
- static int uninorth_create_gatt_table(void)
- {
- 	char *table;
-@@ -369,6 +431,10 @@
- 	.id_table	= agp_uninorth_pci_table,
- 	.probe		= agp_uninorth_probe,
- 	.remove		= agp_uninorth_remove,
-+#ifdef CONFIG_PM
-+	.suspend	= agp_uninorth_suspend,
-+	.resume		= agp_uninorth_resume,
-+#endif
- };
- 
- static int __init agp_uninorth_init(void)
-# This is a BitKeeper generated diff -Nru style patch.
-#
-# ChangeSet
-#   2005/03/10 09:12:01-08:00 benh at kernel.crashing.org 
-#   [PATCH] ppc32: uninorth-agp suspend support
-#   
-#   This patch adds suspend/resume support to the Apple UniNorth AGP bridge to
-#   make sure AGP is properly disabled when the machine goes to sleep.  Without
-#   this, the r300 based laptops will fail to wakeup from sleep when using the
-#   new experimental r300 DRI driver.  It should also improve reliablility in
-#   general with other chips.
-#   
-#   Unfortunately, uninorth-agp is just a "sibling" of the video chip on the
-#   PCI bus, and thus ends up beeing called either before the video chip
-#   suspend routine, or after, depending on the HW layout or other random
-#   things.
-#   
-#   To make sure the device side of AGP is always disabled first and that we
-#   never touch the device after having put it into D2 state (which can be
-#   deadly), I also need the separate patch to radeonfb and aty128fb which will
-#   make them disabled their own side if not already done by the bridge driver.
-#   
-#   Signed-off-by: Benjamin Herrenschmidt <benh at kernel.crashing.org>
-#   Signed-off-by: Paul Mackerras <paulus at samba.org>
-#   Signed-off-by: Andrew Morton <akpm at osdl.org>
-#   Signed-off-by: Linus Torvalds <torvalds at osdl.org>
-# 
-# drivers/char/agp/uninorth-agp.c
-#   2005/03/10 00:39:08-08:00 benh at kernel.crashing.org +66 -0
-#   ppc32: uninorth-agp suspend support
-# 

Copied: trunk/kernel/source/kernel-source-2.6.11-2.6.11/debian/patches/powerpc-pmac-agp-sleep.patch (from rev 2762, trunk/kernel/source/kernel-source-2.6.11-2.6.11/debian/patches/powerpc-pmac-agp-sleep.dpatch)

Deleted: trunk/kernel/source/kernel-source-2.6.11-2.6.11/debian/patches/powerpc-serial.dpatch
===================================================================
--- trunk/kernel/source/kernel-source-2.6.11-2.6.11/debian/patches/powerpc-serial.dpatch	2005-03-21 09:35:04 UTC (rev 2762)
+++ trunk/kernel/source/kernel-source-2.6.11-2.6.11/debian/patches/powerpc-serial.dpatch	2005-03-21 09:38:36 UTC (rev 2763)
@@ -1,51 +0,0 @@
-#! /bin/sh -e 
-##
-## All lines beginning with `## DP:' are a description of the patch.
-## DP: Description: Disables legacy serial driver on powermacs.
-## DP: Patch author: Sven Luther <luther at debian.org> 
-## DP: Patch author: adapted from the SuSE kernel tree.
-## DP: Upstream status: workaround hack waiting for a clean legacy device solution.
-
-. $(dirname $0)/DPATCH
-
- at DPATCH@
-diff -urN kernel-source-2.6.11-2.6.11-orig/drivers/serial/8250.c kernel-source-2.6.11-2.6.11/drivers/serial/8250.c
---- kernel-source-2.6.11-2.6.11-orig/drivers/serial/8250.c	2005-03-02 08:37:47.000000000 +0100
-+++ kernel-source-2.6.11-2.6.11/drivers/serial/8250.c	2005-03-04 18:22:44.297293920 +0100
-@@ -46,6 +46,10 @@
- 
- #include "8250.h"
- 
-+#ifdef CONFIG_PPC_MULTIPLATFORM
-+#include <asm/processor.h>
-+#endif
-+
- /*
-  * Configuration:
-  *   share_irqs - whether we pass SA_SHIRQ to request_irq().  This option
-@@ -2151,6 +2155,12 @@
- 
- static int __init serial8250_console_init(void)
- {
-+#ifdef CONFIG_PPC_MULTIPLATFORM
-+	if(_machine == _MACH_Pmac) {
-+		printk("%s: nothing to do on PowerMac\n",__FUNCTION__);
-+		return -ENODEV;
-+	}
-+#endif
- 	serial8250_isa_init_ports();
- 	register_console(&serial8250_console);
- 	return 0;
-@@ -2482,6 +2492,12 @@
- {
- 	int ret, i;
- 
-+#ifdef CONFIG_PPC_MULTIPLATFORM
-+	if(_machine == _MACH_Pmac) {
-+		printk("%s: nothing to do on PowerMac\n",__FUNCTION__);
-+		return -ENODEV;
-+	}
-+#endif
- 	printk(KERN_INFO "Serial: 8250/16550 driver $Revision: 1.90 $ "
- 		"%d ports, IRQ sharing %sabled\n", (int) UART_NR,
- 		share_irqs ? "en" : "dis");

Copied: trunk/kernel/source/kernel-source-2.6.11-2.6.11/debian/patches/powerpc-serial.patch (from rev 2762, trunk/kernel/source/kernel-source-2.6.11-2.6.11/debian/patches/powerpc-serial.dpatch)

Deleted: trunk/kernel/source/kernel-source-2.6.11-2.6.11/debian/patches/powerpc-therm-adt746x-new-i2c-fix.dpatch
===================================================================
--- trunk/kernel/source/kernel-source-2.6.11-2.6.11/debian/patches/powerpc-therm-adt746x-new-i2c-fix.dpatch	2005-03-21 09:35:04 UTC (rev 2762)
+++ trunk/kernel/source/kernel-source-2.6.11-2.6.11/debian/patches/powerpc-therm-adt746x-new-i2c-fix.dpatch	2005-03-21 09:38:36 UTC (rev 2763)
@@ -1,29 +0,0 @@
-#! /bin/sh -e 
-##
-## All lines beginning with `## DP:' are a description of the patch.
-## DP: Description: Fixes new powerbook thermostat i2c bus detection
-## DP: Patch author: Colin Leroy <colin at colino.net>
-## DP: Upstream status: submitted
-
-. $(dirname $0)/DPATCH
-
- at DPATCH@
---- kernel-2.6.11-orig/drivers/macintosh/therm_adt746x.c	2005-03-07 09:03:58.000000000 +0100
-+++ kernel-2.6.11/drivers/macintosh/therm_adt746x.c	2005-03-07 09:04:35.000000000 +0100
-@@ -548,7 +548,15 @@
- 	prop = (u32 *)get_property(np, "reg", NULL);
- 	if (!prop)
- 		return -ENODEV;
--	therm_bus = ((*prop) >> 8) & 0x0f;
-+	
-+	/* look for bus either by path or using "reg" */
-+	if (strstr(np->full_name, "/i2c-bus@") != NULL) {
-+		const char *tmp_bus = (strstr(np->full_name, "/i2c-bus@") + 9);
-+		therm_bus = tmp_bus[0]-'0';
-+	} else {
-+		therm_bus = ((*prop) >> 8) & 0x0f;
-+	}
-+	
- 	therm_address = ((*prop) & 0xff) >> 1;
- 
- 	printk(KERN_INFO "adt746x: Thermostat bus: %d, address: 0x%02x, "

Copied: trunk/kernel/source/kernel-source-2.6.11-2.6.11/debian/patches/powerpc-therm-adt746x-new-i2c-fix.patch (from rev 2762, trunk/kernel/source/kernel-source-2.6.11-2.6.11/debian/patches/powerpc-therm-adt746x-new-i2c-fix.dpatch)

Deleted: trunk/kernel/source/kernel-source-2.6.11-2.6.11/debian/patches/remove-references-to-removed-drivers.dpatch
===================================================================
--- trunk/kernel/source/kernel-source-2.6.11-2.6.11/debian/patches/remove-references-to-removed-drivers.dpatch	2005-03-21 09:35:04 UTC (rev 2762)
+++ trunk/kernel/source/kernel-source-2.6.11-2.6.11/debian/patches/remove-references-to-removed-drivers.dpatch	2005-03-21 09:38:36 UTC (rev 2763)
@@ -1,653 +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: remove non-free bits
-## DP: Patch author: unknown
-## DP: Upstream status: not submitted
-
-. $(dirname $0)/DPATCH
-
- at DPATCH@
-diff -urN kernel-source-2.6.6/arch/alpha/defconfig kernel-source-2.6.6-1/arch/alpha/defconfig
---- kernel-source-2.6.6/arch/alpha/defconfig	2004-04-05 19:49:22.000000000 +1000
-+++ kernel-source-2.6.6-1/arch/alpha/defconfig	2004-04-05 20:54:15.000000000 +1000
-@@ -492,7 +492,6 @@
- # CONFIG_B44 is not set
- # CONFIG_FORCEDETH is not set
- # CONFIG_CS89x0 is not set
--# CONFIG_DGRS is not set
- # CONFIG_EEPRO100 is not set
- # CONFIG_E100 is not set
- # CONFIG_LNE390 is not set
-diff -urN kernel-source-2.6.6/arch/i386/defconfig kernel-source-2.6.6-1/arch/i386/defconfig
---- kernel-source-2.6.6/arch/i386/defconfig	2004-04-05 19:49:22.000000000 +1000
-+++ kernel-source-2.6.6-1/arch/i386/defconfig	2004-04-05 20:54:17.000000000 +1000
-@@ -624,7 +624,6 @@
- # CONFIG_B44 is not set
- # CONFIG_FORCEDETH is not set
- # CONFIG_CS89x0 is not set
--# CONFIG_DGRS is not set
- # CONFIG_EEPRO100 is not set
- # CONFIG_E100 is not set
- # CONFIG_FEALNX is not set
-@@ -646,7 +645,6 @@
- #
- # Ethernet (1000 Mbit)
- #
--# CONFIG_ACENIC is not set
- # CONFIG_DL2K is not set
- # CONFIG_E1000 is not set
- # CONFIG_NS83820 is not set
-@@ -1027,7 +1025,6 @@
- #
- # USB Multimedia devices
- #
--# CONFIG_USB_DABUSB is not set
- 
- #
- # Video4Linux support is needed for USB Multimedia device support
-diff -urN kernel-source-2.6.6/arch/ia64/defconfig kernel-source-2.6.6-1/arch/ia64/defconfig
---- kernel-source-2.6.6/arch/ia64/defconfig	2004-05-10 19:47:46.000000000 +1000
-+++ kernel-source-2.6.6-1/arch/ia64/defconfig	2004-05-10 22:21:10.000000000 +1000
-@@ -439,7 +439,6 @@
- # CONFIG_ADAPTEC_STARFIRE is not set
- # CONFIG_B44 is not set
- # CONFIG_FORCEDETH is not set
--# CONFIG_DGRS is not set
- CONFIG_EEPRO100=m
- # CONFIG_EEPRO100_PIO is not set
- CONFIG_E100=m
-@@ -456,7 +455,6 @@
- #
- # Ethernet (1000 Mbit)
- #
--# CONFIG_ACENIC is not set
- # CONFIG_DL2K is not set
- CONFIG_E1000=y
- # CONFIG_E1000_NAPI is not set
-@@ -865,7 +863,6 @@
- #
- # USB Multimedia devices
- #
--# CONFIG_USB_DABUSB is not set
- 
- #
- # Video4Linux support is needed for USB Multimedia device support
-diff -urN kernel-source-2.6.6/arch/parisc/defconfig kernel-source-2.6.6-1/arch/parisc/defconfig
---- kernel-source-2.6.6/arch/parisc/defconfig	2004-05-10 19:47:49.000000000 +1000
-+++ kernel-source-2.6.6-1/arch/parisc/defconfig	2004-05-10 22:21:17.000000000 +1000
-@@ -366,7 +366,6 @@
- #
- # Ethernet (1000 Mbit)
- #
--# CONFIG_ACENIC is not set
- CONFIG_DL2K=y
- # CONFIG_E1000 is not set
- # CONFIG_NS83820 is not set
-@@ -703,7 +702,6 @@
- #
- # USB Multimedia devices
- #
--# CONFIG_USB_DABUSB is not set
- 
- #
- # Video4Linux support is needed for USB Multimedia device support
-diff -urN kernel-source-2.6.6/arch/ppc/defconfig kernel-source-2.6.6-1/arch/ppc/defconfig
---- kernel-source-2.6.6/arch/ppc/defconfig	2004-05-10 19:47:49.000000000 +1000
-+++ kernel-source-2.6.6-1/arch/ppc/defconfig	2004-05-10 22:21:17.000000000 +1000
-@@ -559,7 +558,6 @@
- # CONFIG_B44 is not set
- # CONFIG_FORCEDETH is not set
- # CONFIG_CS89x0 is not set
--# CONFIG_DGRS is not set
- # CONFIG_EEPRO100 is not set
- # CONFIG_E100 is not set
- # CONFIG_FEALNX is not set
-@@ -577,7 +576,6 @@
- #
- # Ethernet (1000 Mbit)
- #
--# CONFIG_ACENIC is not set
- # CONFIG_DL2K is not set
- # CONFIG_E1000 is not set
- # CONFIG_NS83820 is not set
-@@ -1080,7 +1078,6 @@
- #
- # USB Multimedia devices
- #
--# CONFIG_USB_DABUSB is not set
- 
- #
- # Video4Linux support is needed for USB Multimedia device support
-diff -urN kernel-source-2.6.6/arch/ppc64/defconfig kernel-source-2.6.6-1/arch/ppc64/defconfig
---- kernel-source-2.6.6/arch/ppc64/defconfig	2004-05-10 19:47:49.000000000 +1000
-+++ kernel-source-2.6.6-1/arch/ppc64/defconfig	2004-05-10 22:21:18.000000000 +1000
-@@ -459,7 +459,6 @@
- # CONFIG_ADAPTEC_STARFIRE is not set
- # CONFIG_B44 is not set
- # CONFIG_FORCEDETH is not set
--# CONFIG_DGRS is not set
- # CONFIG_EEPRO100 is not set
- CONFIG_E100=y
- # CONFIG_E100_NAPI is not set
-@@ -476,8 +475,6 @@
- #
- # Ethernet (1000 Mbit)
- #
--CONFIG_ACENIC=y
--CONFIG_ACENIC_OMIT_TIGON_I=y
- # CONFIG_DL2K is not set
- CONFIG_E1000=y
- # CONFIG_E1000_NAPI is not set
-diff -urN kernel-source-2.6.6/arch/sparc64/defconfig kernel-source-2.6.6-1/arch/sparc64/defconfig
---- kernel-source-2.6.6/arch/sparc64/defconfig	2004-05-10 19:47:50.000000000 +1000
-+++ kernel-source-2.6.6-1/arch/sparc64/defconfig	2004-05-10 22:21:21.000000000 +1000
-@@ -840,7 +840,6 @@
- CONFIG_ADAPTEC_STARFIRE_NAPI=y
- CONFIG_B44=m
- CONFIG_FORCEDETH=m
--CONFIG_DGRS=m
- CONFIG_EEPRO100=m
- # CONFIG_EEPRO100_PIO is not set
- CONFIG_E100=m
-@@ -864,8 +863,6 @@
- #
- # Ethernet (1000 Mbit)
- #
--CONFIG_ACENIC=m
--# CONFIG_ACENIC_OMIT_TIGON_I is not set
- CONFIG_DL2K=m
- CONFIG_E1000=m
- CONFIG_E1000_NAPI=y
-@@ -1579,7 +1576,6 @@
- #
- # USB Multimedia devices
- #
--# CONFIG_USB_DABUSB is not set
- # CONFIG_USB_VICAM is not set
- # CONFIG_USB_DSBR is not set
- # CONFIG_USB_IBMCAM is not set
-diff -urN kernel-source-2.6.6/arch/x86_64/defconfig kernel-source-2.6.6-1/arch/x86_64/defconfig
---- kernel-source-2.6.6/arch/x86_64/defconfig	2004-05-10 19:47:50.000000000 +1000
-+++ kernel-source-2.6.6-1/arch/x86_64/defconfig	2004-05-10 22:21:22.000000000 +1000
-@@ -437,7 +436,6 @@
- # CONFIG_ADAPTEC_STARFIRE is not set
- # CONFIG_B44 is not set
- CONFIG_FORCEDETH=y
--# CONFIG_DGRS is not set
- # CONFIG_EEPRO100 is not set
- # CONFIG_E100 is not set
- # CONFIG_FEALNX is not set
-@@ -457,7 +456,6 @@
- #
- # Ethernet (1000 Mbit)
- #
--# CONFIG_ACENIC is not set
- # CONFIG_DL2K is not set
- CONFIG_E1000=y
- # CONFIG_E1000_NAPI is not set
-diff -urN kernel-source-2.6.6/drivers/net/tokenring/Kconfig kernel-source-2.6.6-1/drivers/net/tokenring/Kconfig
---- kernel-source-2.6.6/drivers/net/tokenring/Kconfig	2004-03-11 13:55:24.000000000 +1100
-+++ kernel-source-2.6.6-1/drivers/net/tokenring/Kconfig	2004-01-14 20:00:15.000000000 +1100
-@@ -165,21 +165,5 @@
- 	  To compile this driver as a module, choose M here: the module will be
- 	  called madgemc.
- 
--config SMCTR
--	tristate "SMC ISA/MCA adapter support"
--	depends on TR && (ISA || MCA_LEGACY) && (BROKEN || !64BIT)
--	---help---
--	  This is support for the ISA and MCA SMC Token Ring cards,
--	  specifically SMC TokenCard Elite (8115T) and SMC TokenCard Elite/A
--	  (8115T/A) adapters.
--
--	  If you have such an adapter and would like to use it, say Y or M and
--	  read the Token-Ring mini-HOWTO, available from
--	  <http://www.tldp.org/docs.html#howto> and the file
--	  <file:Documentation/networking/smctr.txt>.
--
--	  To compile this driver as a module, choose M here: the module will be
--	  called smctr.
--
- endmenu
- 
-diff -urN kernel-source-2.6.6/drivers/scsi/Kconfig kernel-source-2.6.6-1/drivers/scsi/Kconfig
---- kernel-source-2.6.6/drivers/scsi/Kconfig	2004-05-10 19:47:58.000000000 +1000
-+++ kernel-source-2.6.6-1/drivers/scsi/Kconfig	2004-05-10 22:21:38.000000000 +1000
-@@ -1259,8 +1277,6 @@
- 	  To compile this driver as a module, choose M here: the
- 	  module will be called qlogicpti.
- 
--source "drivers/scsi/qla2xxx/Kconfig"
--
- config SCSI_SEAGATE
- 	tristate "Seagate ST-02 and Future Domain TMC-8xx SCSI support"
- 	depends on X86 && ISA && SCSI && BROKEN
-diff -urN kernel-source-2.6.6/drivers/scsi/Makefile kernel-source-2.6.6-1/drivers/scsi/Makefile
---- kernel-source-2.6.6/drivers/scsi/Makefile	2004-05-10 19:47:58.000000000 +1000
-+++ kernel-source-2.6.6-1/drivers/scsi/Makefile	2004-05-10 22:21:38.000000000 +1000
-@@ -80,7 +80,6 @@
- obj-$(CONFIG_SCSI_QLOGIC_ISP)	+= qlogicisp.o 
- obj-$(CONFIG_SCSI_QLOGIC_FC)	+= qlogicfc.o 
- obj-$(CONFIG_SCSI_QLOGIC_1280)	+= qla1280.o 
--obj-$(CONFIG_SCSI_QLA2XXX)	+= qla2xxx/
- obj-$(CONFIG_SCSI_PAS16)	+= pas16.o
- obj-$(CONFIG_SCSI_SEAGATE)	+= seagate.o
- obj-$(CONFIG_SCSI_FD_8xx)	+= seagate.o
-diff -urN kernel-source-2.6.6/drivers/usb/media/Kconfig kernel-source-2.6.6-1/drivers/usb/media/Kconfig
---- kernel-source-2.6.6/drivers/usb/media/Kconfig	2004-05-10 19:48:01.000000000 +1000
-+++ kernel-source-2.6.6-1/drivers/usb/media/Kconfig	2004-05-10 22:21:43.000000000 +1000
-@@ -4,20 +4,6 @@
- comment "USB Multimedia devices"
- 	depends on USB
- 
--config USB_DABUSB
--	tristate "DABUSB driver"
--	depends on USB
--	---help---
--	  A Digital Audio Broadcasting (DAB) Receiver for USB and Linux
--	  brought to you by the DAB-Team
--	  <http://wwwbode.cs.tum.edu/Par/arch/dab/>.  This driver can be taken
--	  as an example for URB-based bulk, control, and isochronous
--	  transactions. URB's are explained in
--	  <file:Documentation/usb/URB.txt>.
--
--	  To compile this driver as a module, choose M here: the
--	  module will be called dabusb.
--
- comment "Video4Linux support is needed for USB Multimedia device support"
- 	depends on USB && VIDEO_DEV=n
- 
-diff -urN kernel-source-2.6.6/drivers/usb/serial/Kconfig kernel-source-2.6.6-1/drivers/usb/serial/Kconfig
---- kernel-source-2.6.6/drivers/usb/serial/Kconfig	2004-03-11 13:55:37.000000000 +1100
-+++ kernel-source-2.6.6-1/drivers/usb/serial/Kconfig	2003-11-24 20:51:58.000000000 +1100
-@@ -219,84 +219,6 @@
- 	  To compile this driver as a module, choose M here: the
- 	  module will be called keyspan.
- 
--config USB_SERIAL_KEYSPAN_MPR
--	bool "USB Keyspan MPR Firmware"
--	depends on USB_SERIAL_KEYSPAN
--	help
--	  Say Y here to include firmware for the Keyspan MPR converter.
--
--config USB_SERIAL_KEYSPAN_USA28
--	bool "USB Keyspan USA-28 Firmware"
--	depends on USB_SERIAL_KEYSPAN
--	help
--	  Say Y here to include firmware for the USA-28 converter.
--
--config USB_SERIAL_KEYSPAN_USA28X
--	bool "USB Keyspan USA-28X Firmware"
--	depends on USB_SERIAL_KEYSPAN
--	help
--	  Say Y here to include firmware for the USA-28X converter.
--	  Be sure you have a USA-28X, there are also 28XA and 28XB
--	  models, the label underneath has the actual part number.
--
--config USB_SERIAL_KEYSPAN_USA28XA
--	bool "USB Keyspan USA-28XA Firmware"
--	depends on USB_SERIAL_KEYSPAN
--	help
--	  Say Y here to include firmware for the USA-28XA converter.
--	  Be sure you have a USA-28XA, there are also 28X and 28XB
--	  models, the label underneath has the actual part number.
--
--config USB_SERIAL_KEYSPAN_USA28XB
--	bool "USB Keyspan USA-28XB Firmware"
--	depends on USB_SERIAL_KEYSPAN
--	help
--	  Say Y here to include firmware for the USA-28XB converter.
--	  Be sure you have a USA-28XB, there are also 28X and 28XA
--	  models, the label underneath has the actual part number.
--
--config USB_SERIAL_KEYSPAN_USA19
--	bool "USB Keyspan USA-19 Firmware"
--	depends on USB_SERIAL_KEYSPAN
--	help
--	  Say Y here to include firmware for the USA-19 converter.
--
--config USB_SERIAL_KEYSPAN_USA18X
--	bool "USB Keyspan USA-18X Firmware"
--	depends on USB_SERIAL_KEYSPAN
--	help
--	  Say Y here to include firmware for the USA-18X converter.
--
--config USB_SERIAL_KEYSPAN_USA19W
--	bool "USB Keyspan USA-19W Firmware"
--	depends on USB_SERIAL_KEYSPAN
--	help
--	  Say Y here to include firmware for the USA-19W converter.
--
--config USB_SERIAL_KEYSPAN_USA19QW
--	bool "USB Keyspan USA-19QW Firmware"
--	depends on USB_SERIAL_KEYSPAN
--	help
--	  Say Y here to include firmware for the USA-19QW converter.
--
--config USB_SERIAL_KEYSPAN_USA19QI
--	bool "USB Keyspan USA-19QI Firmware"
--	depends on USB_SERIAL_KEYSPAN
--	help
--	  Say Y here to include firmware for the USA-19QI converter.
--
--config USB_SERIAL_KEYSPAN_USA49W
--	bool "USB Keyspan USA-49W Firmware"
--	depends on USB_SERIAL_KEYSPAN
--	help
--	  Say Y here to include firmware for the USA-49W converter.
--
--config USB_SERIAL_KEYSPAN_USA49WLC
--	bool "USB Keyspan USA-49WLC Firmware"
--	depends on USB_SERIAL_KEYSPAN
--	help
--	  Say Y here to include firmware for the USA-49WLC converter.
--
- config USB_SERIAL_KLSI
- 	tristate "USB KL5KUSB105 (Palmconnect) Driver (EXPERIMENTAL)"
- 	depends on USB_SERIAL && EXPERIMENTAL
---- kernel-source-2.6.6/drivers/net/Kconfig	2004-05-10 19:47:54.000000000 +1000
-+++ kernel-source-2.6.6-1/drivers/net/Kconfig	2004-05-11 22:25:31.000000000 +1000
-@@ -1383,21 +1383,6 @@
- 	tristate "TOSHIBA TC35815 Ethernet support"
- 	depends on NET_PCI && PCI && TOSHIBA_JMR3927
- 
--config DGRS
--	tristate "Digi Intl. RightSwitch SE-X support"
--	depends on NET_PCI && (PCI || EISA)
--	---help---
--	  This is support for the Digi International RightSwitch series of
--	  PCI/EISA Ethernet switch cards. These include the SE-4 and the SE-6
--	  models.  If you have a network card of this type, say Y and read the
--	  Ethernet-HOWTO, available from
--	  <http://www.tldp.org/docs.html#howto>.  More specific
--	  information is contained in <file:Documentation/networking/dgrs.txt>.
--
--	  To compile this driver as a module, choose M here and read
--	  <file:Documentation/networking/net-modules.txt>.  The module
--	  will be called dgrs.
--
- config EEPRO100
- 	tristate "EtherExpressPro/100 support (eepro100, original Becker driver)"
- 	depends on NET_PCI && PCI
-@@ -1877,33 +1862,6 @@
- menu "Ethernet (1000 Mbit)"
- 	depends on NETDEVICES
- 
--config ACENIC
--	tristate "Alteon AceNIC/3Com 3C985/NetGear GA620 Gigabit support"
--	depends on PCI
--	---help---
--	  Say Y here if you have an Alteon AceNIC, 3Com 3C985(B), NetGear
--	  GA620, SGI Gigabit or Farallon PN9000-SX PCI Gigabit Ethernet
--	  adapter. The driver allows for using the Jumbo Frame option (9000
--	  bytes/frame) however it requires that your switches can handle this
--	  as well. To enable Jumbo Frames, add `mtu 9000' to your ifconfig
--	  line.
--
--	  To compile this driver as a module, choose M here: the
--	  module will be called acenic.
--
--config ACENIC_OMIT_TIGON_I
--	bool "Omit support for old Tigon I based AceNICs"
--	depends on ACENIC
--	help
--	  Say Y here if you only have Tigon II based AceNICs and want to leave
--	  out support for the older Tigon I based cards which are no longer
--	  being sold (ie. the original Alteon AceNIC and 3Com 3C985 (non B
--	  version)).  This will reduce the size of the driver object by
--	  app. 100KB.  If you are not sure whether your card is a Tigon I or a
--	  Tigon II, say N here.
--
--	  The safe and default value for this is N.
--
- config DL2K
- 	tristate "D-Link DL2000-based Gigabit Ethernet support"
- 	depends on PCI
---- kernel-source-2.6.7-2.6.7/arch/i386/defconfig	2004-06-21 14:41:04.955084080 +0200
-+++ kernel-source-2.6.7-2.6.7/arch/i386/defconfig.pruned	2004-06-21 14:47:18.767076968 +0200
-@@ -1055,8 +1055,6 @@
- #
- # USB Miscellaneous drivers
- #
--# 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
---- kernel-source-2.6.7-2.6.7/arch/sparc64/defconfig	2004-06-21 14:41:04.992082099 +0200
-+++ kernel-source-2.6.7-2.6.7/arch/sparc64/defconfig.pruned	2004-06-21 14:47:21.073953542 +0200
-@@ -1668,8 +1668,6 @@
- #
- # USB Miscellaneous drivers
- #
--CONFIG_USB_EMI62=m
--CONFIG_USB_EMI26=m
- # CONFIG_USB_TIGL is not set
- CONFIG_USB_AUERSWALD=m
- CONFIG_USB_RIO500=m
---- kernel-source-2.6.7-2.6.7/arch/ppc/configs/common_defconfig	2004-06-16 07:19:03.000000000 +0200
-+++ kernel-source-2.6.7-2.6.7/arch/ppc/configs/common_defconfig.pruned	2004-06-21 14:47:22.053901111 +0200
-@@ -1138,8 +1138,6 @@
- #
- # USB Miscellaneous drivers
- #
--# 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
---- kernel-source-2.6.7-2.6.7/arch/ppc/configs/sandpoint_defconfig	2004-06-16 07:19:22.000000000 +0200
-+++ kernel-source-2.6.7-2.6.7/arch/ppc/configs/sandpoint_defconfig.pruned	2004-06-21 14:47:22.672867994 +0200
-@@ -601,8 +601,6 @@
- #
- # USB Miscellaneous drivers
- #
--# 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
---- kernel-source-2.6.7-2.6.7/arch/ppc/configs/lopec_defconfig	2004-06-16 07:19:37.000000000 +0200
-+++ kernel-source-2.6.7-2.6.7/arch/ppc/configs/lopec_defconfig.pruned	2004-06-21 14:47:23.263836374 +0200
-@@ -682,8 +682,6 @@
- #
- # USB Miscellaneous drivers
- #
--# 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
---- kernel-source-2.6.7-2.6.7/arch/ppc/configs/pmac_defconfig	2004-06-16 07:20:03.000000000 +0200
-+++ kernel-source-2.6.7-2.6.7/arch/ppc/configs/pmac_defconfig.pruned	2004-06-21 14:47:23.837805665 +0200
-@@ -1170,8 +1170,6 @@
- #
- # USB Miscellaneous drivers
- #
--# 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
---- kernel-source-2.6.7-2.6.7/arch/ppc/defconfig	2004-06-21 14:41:04.976082956 +0200
-+++ kernel-source-2.6.7-2.6.7/arch/ppc/defconfig.pruned	2004-06-21 14:47:24.352778112 +0200
-@@ -1141,8 +1141,6 @@
- #
- # USB Miscellaneous drivers
- #
--# 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
---- kernel-source-2.6.7-2.6.7/arch/mips/configs/rm200_defconfig	2004-06-16 07:19:03.000000000 +0200
-+++ kernel-source-2.6.7-2.6.7/arch/mips/configs/rm200_defconfig.pruned	2004-06-21 14:47:24.842751896 +0200
-@@ -1007,8 +1007,6 @@
- #
- # USB Miscellaneous drivers
- #
--# CONFIG_USB_EMI62 is not set
--# CONFIG_USB_EMI26 is not set
- CONFIG_USB_TIGL=m
- CONFIG_USB_AUERSWALD=m
- CONFIG_USB_RIO500=m
---- kernel-source-2.6.7-2.6.7/arch/ia64/configs/zx1_defconfig	2004-06-16 07:19:37.000000000 +0200
-+++ kernel-source-2.6.7-2.6.7/arch/ia64/configs/zx1_defconfig.pruned	2004-06-21 14:47:25.322726216 +0200
-@@ -1022,8 +1022,6 @@
- #
- # USB Miscellaneous drivers
- #
--# 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
---- kernel-source-2.6.7-2.6.7/arch/ia64/defconfig	2004-06-21 14:41:04.966083491 +0200
-+++ kernel-source-2.6.7-2.6.7/arch/ia64/defconfig.pruned	2004-06-21 14:47:25.802700535 +0200
-@@ -892,8 +892,6 @@
- #
- # USB Miscellaneous drivers
- #
--# 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
---- kernel-source-2.6.7-2.6.7/arch/ppc64/configs/g5_defconfig	2004-06-16 07:18:56.000000000 +0200
-+++ kernel-source-2.6.7-2.6.7/arch/ppc64/configs/g5_defconfig.pruned	2004-06-21 14:47:26.301673838 +0200
-@@ -951,8 +951,6 @@
- #
- # USB Miscellaneous drivers
- #
--# 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
---- kernel-source-2.6.7-2.6.7/arch/ppc64/configs/pSeries_defconfig	2004-06-16 07:20:03.000000000 +0200
-+++ kernel-source-2.6.7-2.6.7/arch/ppc64/configs/pSeries_defconfig.pruned	2004-06-21 14:47:26.805646874 +0200
-@@ -874,8 +874,6 @@
- #
- # USB Miscellaneous drivers
- #
--# 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
---- kernel-source-2.6.7-2.6.7/arch/ppc64/defconfig	2004-06-21 14:41:04.983082581 +0200
-+++ kernel-source-2.6.7-2.6.7/arch/ppc64/defconfig.pruned	2004-06-21 14:47:27.271621943 +0200
-@@ -874,8 +874,6 @@
- #
- # USB Miscellaneous drivers
- #
--# 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
---- kernel-source-2.6.7-2.6.7/arch/arm/configs/lpd7a404_defconfig	2004-06-16 07:18:57.000000000 +0200
-+++ kernel-source-2.6.7-2.6.7/arch/arm/configs/lpd7a404_defconfig.pruned	2004-06-21 14:47:27.781594657 +0200
-@@ -817,8 +817,6 @@
- #
- # USB Miscellaneous drivers
- #
--# 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
---- kernel-source-2.6.7-2.6.7/arch/parisc/configs/c3000_defconfig	2004-06-16 07:19:36.000000000 +0200
-+++ kernel-source-2.6.7-2.6.7/arch/parisc/configs/c3000_defconfig.pruned	2004-06-21 14:47:28.271568442 +0200
-@@ -874,8 +874,6 @@
- #
- # USB Miscellaneous drivers
- #
--# 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
---- kernel-source-2.6.7-2.6.7/arch/parisc/defconfig	2004-06-21 14:41:04.968083384 +0200
-+++ kernel-source-2.6.7-2.6.7/arch/parisc/defconfig.pruned	2004-06-21 14:47:28.753542654 +0200
-@@ -731,8 +731,6 @@
- #
- # USB Miscellaneous drivers
- #
--# 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
---- kernel-source-2.6.7-2.6.7/arch/x86_64/defconfig	2004-06-21 14:41:04.993082046 +0200
-+++ kernel-source-2.6.7-2.6.7/arch/x86_64/defconfig.pruned	2004-06-21 14:47:29.261515476 +0200
-@@ -769,8 +769,6 @@
- #
- # USB Miscellaneous drivers
- #
--# 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
---- kernel-source-2.6.7-2.6.7/drivers/usb/misc/Kconfig~	2004-06-16 07:20:04.000000000 +0200
-+++ kernel-source-2.6.7-2.6.7/drivers/usb/misc/Kconfig	2004-06-21 14:42:39.229036608 +0200
-@@ -4,34 +4,6 @@
- comment "USB Miscellaneous drivers"
- 	depends on USB
- 
--config USB_EMI62
--	tristate "EMI 6|2m USB Audio interface support"
--	depends on USB
--	---help---
--	  This driver loads firmware to Emagic EMI 6|2m low latency USB
--	  Audio and Midi interface.
--
--	  After firmware load the device is handled with standard linux
--	  USB Audio driver.
--
--	  This code is also available as a module ( = code which can be
--	  inserted in and removed from the running kernel whenever you want).
--	  The module will be called audio. If you want to compile it as a
--	  module, say M here and read <file:Documentation/kbuild/modules.txt>.
--
--config USB_EMI26
--	tristate "EMI 2|6 USB Audio interface support"
--	depends on USB
--	---help---
--	  This driver loads firmware to Emagic EMI 2|6 low latency USB
--	  Audio interface.
--
--	  After firmware load the device is handled with standard linux
--	  USB Audio driver.
--
--	  To compile this driver as a module, choose M here: the
--	  module will be called emi26.
--
- config USB_TIGL
- 	tristate "Texas Instruments Graph Link USB (aka SilverLink) cable support"
- 	depends on USB
---- kernel-source-2.6.7-2.6.7/drivers/usb/misc/Makefile	2004-06-16 07:19:35.000000000 +0200
-+++ kernel-source-2.6.7-2.6.7/drivers/usb/misc/Makefile.pruned	2004-06-21 14:47:29.790487173 +0200
-@@ -5,8 +5,6 @@
- 
- obj-$(CONFIG_USB_AUERSWALD)	+= auerswald.o
- obj-$(CONFIG_USB_CYTHERM)	+= cytherm.o
--obj-$(CONFIG_USB_EMI26)		+= emi26.o
--obj-$(CONFIG_USB_EMI62)		+= emi62.o
- obj-$(CONFIG_USB_LCD)		+= usblcd.o
- obj-$(CONFIG_USB_LED)		+= usbled.o
- obj-$(CONFIG_USB_LEGOTOWER)	+= legousbtower.o
---- kernel-source-2.6.7-2.6.7/drivers/usb/Makefile	2004-06-16 07:20:04.000000000 +0200
-+++ kernel-source-2.6.7-2.6.7/drivers/usb/Makefile.pruned	2004-06-21 14:47:30.625442500 +0200
-@@ -56,8 +56,6 @@
- 
- obj-$(CONFIG_USB_AUERSWALD)	+= misc/
- obj-$(CONFIG_USB_CYTHERM)	+= misc/
--obj-$(CONFIG_USB_EMI26)		+= misc/
--obj-$(CONFIG_USB_EMI62)		+= misc/
- obj-$(CONFIG_USB_LCD)		+= misc/
- obj-$(CONFIG_USB_LED)		+= misc/
- obj-$(CONFIG_USB_LEGOTOWER)	+= misc/

Copied: trunk/kernel/source/kernel-source-2.6.11-2.6.11/debian/patches/remove-references-to-removed-drivers.patch (from rev 2762, trunk/kernel/source/kernel-source-2.6.11-2.6.11/debian/patches/remove-references-to-removed-drivers.dpatch)

Modified: trunk/kernel/source/kernel-source-2.6.11-2.6.11/debian/patches/series/2.6.11-1
===================================================================
--- trunk/kernel/source/kernel-source-2.6.11-2.6.11/debian/patches/series/2.6.11-1	2005-03-21 09:35:04 UTC (rev 2762)
+++ trunk/kernel/source/kernel-source-2.6.11-2.6.11/debian/patches/series/2.6.11-1	2005-03-21 09:38:36 UTC (rev 2763)
@@ -1,34 +1,34 @@
-+ doc-post_halloween.dpatch
-+ powerpc-fix-power3-ftbfs.dpatch
-+ powerpc-serial.dpatch
-+ powerpc-g4-l2-flush-errata.dpatch
-+ fs-asfs.dpatch
-+ modular-vesafb.dpatch
-+ drivers-ide-dma-blacklist-toshiba.dpatch
-+ sparc64-sb1500-clock-2.6.dpatch
-+ powerpc-g3-750cxe.dpatch
-+ powerpc-calibrate-tau.dpatch
-+ fbdev-radeon-noaccel.dpatch
-+ sparc32-hypersparc-srmmu.dpatch
-+ fix-alpha-ext3-oops.dpatch
-+ ia64-irq-affinity-upfix.dpatch
-+ tty-locking-fixes9.dpatch
-+ sparc64-hme-lockup.dpatch
-+ amd64-int3-fix.dpatch
-+ docbook-allow-preprocessor-directives-between-kernel-doc-and-function.dpatch
-+ docbook-fix-function-parameter-descriptin-in-fbmem.dpatch
-+ docbook-move-kernel-doc-comment-next-to-function.dpatch
-+ drivers-add-scsi_changer.dpatch
-+ modular-ide-pnp.dpatch
-+ x86-i486_emu.dpatch
-+ powerpc-therm-adt746x-new-i2c-fix.dpatch
-+ powerpc-mv643xx-enet.dpatch
-+ powerpc-mv643xx-eth-pegasos.dpatch
-+ modular-ide.dpatch
-+ drivers-ide-__devinit.dpatch
-+ sparc-sunsab-serial-lockup.dpatch
-+ powerpc-pmac-agp-sleep.dpatch
-+ ia64-generic-nosmp.dpatch
-+ amd64-outs.dpatch
-+ drivers-input-serio-8042-resume.dpatch
-+ patch-2.6.11.5
++ doc-post_halloween.patch
++ powerpc-fix-power3-ftbfs.patch
++ powerpc-serial.patch
++ powerpc-g4-l2-flush-errata.patch
++ fs-asfs.patch
++ modular-vesafb.patch
++ drivers-ide-dma-blacklist-toshiba.patch
++ sparc64-sb1500-clock-2.6.patch
++ powerpc-g3-750cxe.patch
++ powerpc-calibrate-tau.patch
++ fbdev-radeon-noaccel.patch
++ sparc32-hypersparc-srmmu.patch
++ fix-alpha-ext3-oops.patch
++ ia64-irq-affinity-upfix.patch
++ tty-locking-fixes9.patch
++ sparc64-hme-lockup.patch
++ amd64-int3-fix.patch
++ docbook-allow-preprocessor-directives-between-kernel-doc-and-function.patch
++ docbook-fix-function-parameter-descriptin-in-fbmem.patch
++ docbook-move-kernel-doc-comment-next-to-function.patch
++ drivers-add-scsi_changer.patch
++ modular-ide-pnp.patch
++ x86-i486_emu.patch
++ powerpc-therm-adt746x-new-i2c-fix.patch
++ powerpc-mv643xx-enet.patch
++ powerpc-mv643xx-eth-pegasos.patch
++ modular-ide.patch
++ drivers-ide-__devinit.patch
++ sparc-sunsab-serial-lockup.patch
++ powerpc-pmac-agp-sleep.patch
++ ia64-generic-nosmp.patch
++ amd64-outs.patch
++ drivers-input-serio-8042-resume.patch
++ patch-2.6.11.5.patch

Deleted: trunk/kernel/source/kernel-source-2.6.11-2.6.11/debian/patches/sparc-sunsab-serial-lockup.dpatch
===================================================================
--- trunk/kernel/source/kernel-source-2.6.11-2.6.11/debian/patches/sparc-sunsab-serial-lockup.dpatch	2005-03-21 09:35:04 UTC (rev 2762)
+++ trunk/kernel/source/kernel-source-2.6.11-2.6.11/debian/patches/sparc-sunsab-serial-lockup.dpatch	2005-03-21 09:38:36 UTC (rev 2763)
@@ -1,68 +0,0 @@
-# This patch eliminates a serial console lockup when booting on
-# a machine with sunsab serial controller, found on Sun hardware
-# (Ultra 5/10). It has been confirmed working by Frans Pop and
-# myself and submitted upstream for review/comments. See 
-#
-# http://marc.theaimsgroup.com/?l=linux-sparc&m=111042459728561&w=2
-#
-# for details.
-#
-# -- Jurij Smakov <jurij at wooyd.org>  Thu, 10 Mar 2005 23:46:51 -0500
-diff -aur a/drivers/serial/sunsab.c b/drivers/serial/sunsab.c
---- a/drivers/serial/sunsab.c	2005-03-02 02:38:07.000000000 -0500
-+++ b/drivers/serial/sunsab.c	2005-03-09 19:44:51.000000000 -0500
-@@ -295,20 +295,22 @@
- static void check_status(struct uart_sunsab_port *up,
- 			 union sab82532_irq_status *stat)
- {
--	if (stat->sreg.isr0 & SAB82532_ISR0_CDSC)
--		uart_handle_dcd_change(&up->port,
-+	if (test_bit(SAB82532_MODEM_STATUS, &up->irqflags)) {
-+		if (stat->sreg.isr0 & SAB82532_ISR0_CDSC)
-+			uart_handle_dcd_change(&up->port,
- 				       !(readb(&up->regs->r.vstr) & SAB82532_VSTR_CD));
- 
--	if (stat->sreg.isr1 & SAB82532_ISR1_CSC)
--		uart_handle_cts_change(&up->port,
-+		if (stat->sreg.isr1 & SAB82532_ISR1_CSC)
-+			uart_handle_cts_change(&up->port,
- 				       (readb(&up->regs->r.star) & SAB82532_STAR_CTS));
- 
--	if ((readb(&up->regs->r.pvr) & up->pvr_dsr_bit) ^ up->dsr) {
--		up->dsr = (readb(&up->regs->r.pvr) & up->pvr_dsr_bit) ? 0 : 1;
--		up->port.icount.dsr++;
--	}
-+		if ((readb(&up->regs->r.pvr) & up->pvr_dsr_bit) ^ up->dsr) {
-+			up->dsr = (readb(&up->regs->r.pvr) & up->pvr_dsr_bit) ? 0 : 1;
-+			up->port.icount.dsr++;
-+		}
- 
--	wake_up_interruptible(&up->port.info->delta_msr_wait);
-+		wake_up_interruptible(&up->port.info->delta_msr_wait);
-+	}
- }
- 
- static irqreturn_t sunsab_interrupt(int irq, void *dev_id, struct pt_regs *regs)
-@@ -788,6 +790,11 @@
- 
- 	spin_lock_irqsave(&up->port.lock, flags);
- 	sunsab_convert_to_sab(up, termios->c_cflag, termios->c_iflag, baud);
-+        if (UART_ENABLE_MS(&up->port, termios->c_cflag))
-+                set_bit(SAB82532_MODEM_STATUS, &up->irqflags);
-+        else
-+                clear_bit(SAB82532_MODEM_STATUS, &up->irqflags);
-+	uart_update_timeout(port, termios->c_cflag, baud);
- 	spin_unlock_irqrestore(&up->port.lock, flags);
- }
- 
-diff -aur a/drivers/serial/sunsab.h b/drivers/serial/sunsab.h
---- a/drivers/serial/sunsab.h	2005-03-02 02:38:33.000000000 -0500
-+++ b/drivers/serial/sunsab.h	2005-03-09 19:44:51.000000000 -0500
-@@ -126,6 +126,7 @@
- /* irqflags bits */
- #define SAB82532_ALLS			0x00000001
- #define SAB82532_XPR			0x00000002
-+#define SAB82532_MODEM_STATUS		0x00000004
- 
- /* RFIFO Status Byte */
- #define SAB82532_RSTAT_PE		0x80

Copied: trunk/kernel/source/kernel-source-2.6.11-2.6.11/debian/patches/sparc-sunsab-serial-lockup.patch (from rev 2762, trunk/kernel/source/kernel-source-2.6.11-2.6.11/debian/patches/sparc-sunsab-serial-lockup.dpatch)

Deleted: trunk/kernel/source/kernel-source-2.6.11-2.6.11/debian/patches/sparc32-hypersparc-srmmu.dpatch
===================================================================
--- trunk/kernel/source/kernel-source-2.6.11-2.6.11/debian/patches/sparc32-hypersparc-srmmu.dpatch	2005-03-21 09:35:04 UTC (rev 2762)
+++ trunk/kernel/source/kernel-source-2.6.11-2.6.11/debian/patches/sparc32-hypersparc-srmmu.dpatch	2005-03-21 09:38:36 UTC (rev 2763)
@@ -1,10 +0,0 @@
---- kernel-source-2.6.11-2.6.11-orig//arch/sparc/mm/srmmu.c	2005-03-02 08:38:10.000000000 +0100
-+++ kernel-source-2.6.11-2.6.11/arch/sparc/mm/srmmu.c	2005-03-05 10:39:38.677679448 +0100
-@@ -1464,7 +1464,6 @@
- static void __init init_hypersparc(void)
- {
- 	srmmu_name = "ROSS HyperSparc";
--	srmmu_modtype = HyperSparc;
- 
- 	init_vac_layout();
- 

Copied: trunk/kernel/source/kernel-source-2.6.11-2.6.11/debian/patches/sparc32-hypersparc-srmmu.patch (from rev 2762, trunk/kernel/source/kernel-source-2.6.11-2.6.11/debian/patches/sparc32-hypersparc-srmmu.dpatch)

Deleted: trunk/kernel/source/kernel-source-2.6.11-2.6.11/debian/patches/sparc64-hme-lockup.dpatch
===================================================================
--- trunk/kernel/source/kernel-source-2.6.11-2.6.11/debian/patches/sparc64-hme-lockup.dpatch	2005-03-21 09:35:04 UTC (rev 2762)
+++ trunk/kernel/source/kernel-source-2.6.11-2.6.11/debian/patches/sparc64-hme-lockup.dpatch	2005-03-21 09:38:36 UTC (rev 2763)
@@ -1,20 +0,0 @@
-# origin: Debian (bcollins)
-# cset: n/a
-# inclusion: not suitable for upstream
-# revision date: 2004-10-08
-
-Seemingly only on the onboard hme's on the Ultra 1E (enterprise) models
-(as the non-E models have an onboard le)... it's a strange lockup problem
-that requires a reboot to fix.  This one-liner is a band-aid that seems
-to take care of it... a possible weirdo timing bug. --Uzi
-
---- kernel-source-2.6.11-2.6.11-orig/drivers/net/sunhme.c	2005-03-02 08:37:55.000000000 +0100
-+++ kernel-source-2.6.11-2.6.11/drivers/net/sunhme.c	2005-03-05 10:48:16.704927336 +0100
-@@ -1990,6 +1990,7 @@
- 	}
- 	hp->tx_old = elem;
- 	TXD((">"));
-+	udelay(1);
- 
- 	if (netif_queue_stopped(dev) &&
- 	    TX_BUFFS_AVAIL(hp) > (MAX_SKB_FRAGS + 1))

Copied: trunk/kernel/source/kernel-source-2.6.11-2.6.11/debian/patches/sparc64-hme-lockup.patch (from rev 2762, trunk/kernel/source/kernel-source-2.6.11-2.6.11/debian/patches/sparc64-hme-lockup.dpatch)

Deleted: trunk/kernel/source/kernel-source-2.6.11-2.6.11/debian/patches/sparc64-sb1500-clock-2.6.dpatch
===================================================================
--- trunk/kernel/source/kernel-source-2.6.11-2.6.11/debian/patches/sparc64-sb1500-clock-2.6.dpatch	2005-03-21 09:35:04 UTC (rev 2762)
+++ trunk/kernel/source/kernel-source-2.6.11-2.6.11/debian/patches/sparc64-sb1500-clock-2.6.dpatch	2005-03-21 09:38:36 UTC (rev 2763)
@@ -1,43 +0,0 @@
-# This is a BitKeeper generated diff -Nru style patch.
-#
-# ChangeSet
-#   2005/03/02 14:03:27-08:00 davem at nuts.davemloft.net 
-#   [SPARC64]: Accept 'm5823' clock chip as seen on SB1500.
-#   
-#   Signed-off-by: David S. Miller <davem at davemloft.net>
-# 
-# arch/sparc64/kernel/time.c
-#   2005/03/02 14:02:54-08:00 davem at nuts.davemloft.net +5 -2
-#   [SPARC64]: Accept 'm5823' clock chip as seen on SB1500.
-# 
-diff -Nru a/arch/sparc64/kernel/time.c b/arch/sparc64/kernel/time.c
---- a/arch/sparc64/kernel/time.c	2005-03-02 14:04:56 -08:00
-+++ b/arch/sparc64/kernel/time.c	2005-03-02 14:04:56 -08:00
-@@ -779,6 +779,7 @@
- 		    strcmp(model, "mk48t59") &&
- 		    strcmp(model, "m5819") &&
- 		    strcmp(model, "m5819p") &&
-+		    strcmp(model, "m5823") &&
- 		    strcmp(model, "ds1287")) {
- 			if (cbus != NULL) {
- 				prom_printf("clock_probe: Central bus lacks timer chip.\n");
-@@ -838,7 +839,8 @@
- 
- 			if (!strcmp(model, "ds1287") ||
- 			    !strcmp(model, "m5819") ||
--			    !strcmp(model, "m5819p")) {
-+			    !strcmp(model, "m5819p") ||
-+			    !strcmp(model, "m5823")) {
- 				ds1287_regs = edev->resource[0].start;
- 			} else {
- 				mstk48t59_regs = edev->resource[0].start;
-@@ -859,7 +861,8 @@
- 			}
- 			if (!strcmp(model, "ds1287") ||
- 			    !strcmp(model, "m5819") ||
--			    !strcmp(model, "m5819p")) {
-+			    !strcmp(model, "m5819p") ||
-+			    !strcmp(model, "m5823")) {
- 				ds1287_regs = isadev->resource.start;
- 			} else {
- 				mstk48t59_regs = isadev->resource.start;

Copied: trunk/kernel/source/kernel-source-2.6.11-2.6.11/debian/patches/sparc64-sb1500-clock-2.6.patch (from rev 2762, trunk/kernel/source/kernel-source-2.6.11-2.6.11/debian/patches/sparc64-sb1500-clock-2.6.dpatch)

Deleted: trunk/kernel/source/kernel-source-2.6.11-2.6.11/debian/patches/tty-locking-fixes9.dpatch
===================================================================
--- trunk/kernel/source/kernel-source-2.6.11-2.6.11/debian/patches/tty-locking-fixes9.dpatch	2005-03-21 09:35:04 UTC (rev 2762)
+++ trunk/kernel/source/kernel-source-2.6.11-2.6.11/debian/patches/tty-locking-fixes9.dpatch	2005-03-21 09:38:36 UTC (rev 2763)
@@ -1,12 +0,0 @@
---- kernel-source-2.6.11-2.6.11-orig/drivers/serial/serial_core.c	2005-03-02 08:37:50.000000000 +0100
-+++ kernel-source-2.6.11-2.6.11/drivers/serial/serial_core.c	2005-03-05 10:46:43.417109240 +0100
-@@ -108,7 +108,8 @@
- static void uart_tasklet_action(unsigned long data)
- {
- 	struct uart_state *state = (struct uart_state *)data;
--	tty_wakeup(state->info->tty);
-+	if (state->info->tty)
-+		tty_wakeup(state->info->tty);
- }
- 
- static inline void

Copied: trunk/kernel/source/kernel-source-2.6.11-2.6.11/debian/patches/tty-locking-fixes9.patch (from rev 2762, trunk/kernel/source/kernel-source-2.6.11-2.6.11/debian/patches/tty-locking-fixes9.dpatch)

Deleted: trunk/kernel/source/kernel-source-2.6.11-2.6.11/debian/patches/x86-i486_emu.dpatch
===================================================================
--- trunk/kernel/source/kernel-source-2.6.11-2.6.11/debian/patches/x86-i486_emu.dpatch	2005-03-21 09:35:04 UTC (rev 2762)
+++ trunk/kernel/source/kernel-source-2.6.11-2.6.11/debian/patches/x86-i486_emu.dpatch	2005-03-21 09:38:36 UTC (rev 2763)
@@ -1,528 +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: 486 emulation
-## DP: Patch author: Willy Tarreau
-## DP: Upstream status: submitted, needs more work
-
-. $(dirname $0)/DPATCH
-
- at DPATCH@
-diff -urN kernel-source-2.6.6/arch/i386/Kconfig kernel-source-2.6.6-1/arch/i386/Kconfig
---- kernel-source-2.6.6/arch/i386/Kconfig	2004-05-10 19:47:45.000000000 +1000
-+++ kernel-source-2.6.6-1/arch/i386/Kconfig	2004-05-10 22:21:08.000000000 +1000
-@@ -341,6 +341,41 @@
- 	  This is really intended for distributors who need more
- 	  generic optimizations.
- 
-+config X86_EMU486
-+       bool "486 emulation"
-+       help
-+          When used on a 386, Linux can emulate 3 instructions from the 486
-+          set.  This allows user space programs compiled for 486 to run on a
-+          386 without crashing with a SIGILL. As any emulation, performance
-+          will be very low, but since these instruction are not often used,
-+          this might not hurt.  The emulated instructions are:
-+             - bswap (does the same as htonl())
-+             - cmpxchg (used in multi-threading, mutex locking)
-+             - xadd (rarely used)
-+
-+          Note that this can also allow Step-A 486's to correctly run
-+          multi-thread applications since cmpxchg has a wrong opcode on this
-+          early CPU.
-+
-+          Don't use this to enable multi-threading on an SMP machine, the lock
-+          atomicity can't be guaranted!
-+
-+          Although it's highly preferable that you only execute programs
-+          targetted for your CPU, it may happen that, consecutively to a
-+          hardware replacement, or during rescue of a damaged system, you have
-+          to execute such programs on an inadapted processor.  In this case,
-+          this option will help you get your programs working, even if they
-+          will be slower.
-+
-+          It is recommended that you say N here in any case, except for the
-+          kernels that you will use on your rescue disks.
-+ 
-+          This option should not be left on by default, because it means that
-+          you execute a program not targetted for your CPU.  You should
-+          recompile your applications whenever possible.
-+
-+          If you are not sure, say N.
-+
- endif
- 
- #
-@@ -454,6 +489,7 @@
- 
- config SMP
- 	bool "Symmetric multi-processing support"
-+	depends on !X86_EMU486
- 	---help---
- 	  This enables support for systems with more than one CPU. If you have
- 	  a system with only one CPU, like most personal computers, say N. If
-diff -urN kernel-source-2.6.6/arch/i386/kernel/Makefile kernel-source-2.6.6-1/arch/i386/kernel/Makefile
---- kernel-source-2.6.6/arch/i386/kernel/Makefile	2004-05-10 19:47:45.000000000 +1000
-+++ kernel-source-2.6.6-1/arch/i386/kernel/Makefile	2004-05-10 22:21:08.000000000 +1000
-@@ -29,6 +29,7 @@
- obj-$(CONFIG_MODULES)		+= module.o
- obj-y				+= sysenter.o vsyscall.o
- obj-$(CONFIG_ACPI_SRAT) 	+= srat.o
-+obj-$(CONFIG_X86_EMU486)	+= emu.o
- obj-$(CONFIG_HPET_TIMER) 	+= time_hpet.o
- obj-$(CONFIG_EFI) 		+= efi.o efi_stub.o
- obj-$(CONFIG_EARLY_PRINTK)	+= early_printk.o
-diff -urN kernel-source-2.6.6/arch/i386/kernel/emu.c kernel-source-2.6.6-1/arch/i386/kernel/emu.c
---- kernel-source-2.6.6/arch/i386/kernel/emu.c	1970-01-01 10:00:00.000000000 +1000
-+++ kernel-source-2.6.6-1/arch/i386/kernel/emu.c	2003-08-01 20:21:31.000000000 +1000
-@@ -0,0 +1,434 @@
-+/*
-+ *  linux/arch/i386/emu.c
-+ *
-+ *  Copyright (C) 2002  Willy Tarreau
-+ */
-+
-+#include <linux/config.h>
-+#include <linux/sched.h>
-+#include <linux/linkage.h>
-+#include <linux/preempt.h>
-+#include <linux/ptrace.h>
-+#include <linux/types.h>
-+
-+#include <asm/uaccess.h>
-+#include <asm/segment.h>
-+
-+asmlinkage void do_general_protection(struct pt_regs *regs, long error_code);
-+asmlinkage void do_invalid_op(struct pt_regs *regs, long error_code);
-+
-+/* gives the address of any register member in a struct pt_regs */
-+static const int reg_ofs[8] = {
-+	(int)&((struct pt_regs *)0)->eax,
-+	(int)&((struct pt_regs *)0)->ecx,
-+	(int)&((struct pt_regs *)0)->edx,
-+	(int)&((struct pt_regs *)0)->ebx,
-+	(int)&((struct pt_regs *)0)->esp,
-+	(int)&((struct pt_regs *)0)->ebp,
-+	(int)&((struct pt_regs *)0)->esi,
-+	(int)&((struct pt_regs *)0)->edi
-+};
-+
-+#define REG_PTR(regs, reg) ((unsigned long *)(((void *)(regs)) + reg_ofs[reg]))
-+
-+/* This code can be used to allow old 386's to hopefully correctly execute some
-+ * code which was originally compiled for a 486, and to allow CMOV-disabled
-+ * processors to emulate CMOV instructions. In user space, only 3 instructions
-+ * have been added between the 386 the 486 :
-+ *    - BSWAP reg		performs exactly htonl())
-+ *    - CMPXCHG reg/mem, reg	used for mutex locking
-+ *    - XADD reg/mem, reg	not encountered yet.
-+ *
-+ * Warning: this will NEVER allow a kernel compiled for a 486 to boot on a 386,
-+ * neither will it allow a CMOV-optimized kernel to run on a processor without
-+ * CMOV ! It will only help to port programs, or save you on a rescue disk, but
-+ * for performance's sake, it's far better to recompile.
-+ *
-+ * Tests patterns have been submitted to this code on a 386, and it now seems
-+ * OK. If you think you've found a bug, please report it to
-+ * Willy Tarreau <willy at meta-x.org>.
-+ */
-+
-+/* [modrm_address] returns a pointer to a user-space location by decoding the
-+ * mod/rm byte and the bytes at <from>, which point to the mod/reg/rm byte.
-+ * This must only be called if modrm indicates memory and not register. The
-+ * <from> parameter is updated when bytes are read.
-+ * NOTE: this code has some ugly lines, which produce a better assembler output
-+ * than the "cleaner" version.
-+ */
-+static void *modrm_address(struct pt_regs *regs, u8 **from,
-+                           int bit32, int modrm)
-+{
-+	u32 offset = 0;
-+	u8 sib, mod, rm;
-+
-+	/* better optimization to compute them here, even
-+	 * if rm is not always used
-+	 */
-+	rm = modrm & 7;
-+	mod = modrm & 0xC0;
-+
-+	if (bit32) {  /* 32-bits addressing mode (default) */
-+		if (mod == 0 && rm == 5) /* 32 bits offset and nothing more */
-+			return (void *)*((u32*)*from)++;
-+		
-+		if (rm == 4) {
-+			/* SIB byte is present and must be used */
-+			sib = *(*from)++; /* SS(7-6) IDX(5-3) BASE(2-0) */
-+
-+			/* index * scale */
-+			if (((sib >> 3) & 7) != 4)
-+				offset += *REG_PTR(regs, (sib >> 3) & 7) << (sib >> 6);
-+
-+			rm = (sib & 7); /* base replaces rm from now */
-+			if (mod == 0 && rm == 5) /* base off32 + scaled index */
-+				return (void *)offset + *((u32*)*from)++;
-+		}
-+
-+		/* base register */
-+		offset += *REG_PTR(regs, rm);
-+	
-+		if (mod) {
-+			if (mod & 0x80) /* 32 bits unsigned offset */
-+				offset += *((u32*)*from)++;
-+			else  /* 0x40: 8 bits signed offset */
-+				offset += *((s8*)*from)++;
-+		}
-+
-+		return (void *)offset;
-+
-+	} else { /* 16-bits addressing mode */
-+		/* handle special case now */
-+		if (mod == 0 && rm == 6) /* 16 bits offset */
-+			return (void *)(u32)*((u16*)*from)++;
-+
-+		if ((rm & 4) == 0)
-+			offset += (rm & 2) ? regs->ebp : regs->ebx;
-+		if (rm < 6)
-+			offset += (rm & 1) ? regs->edi : regs->esi;
-+		else if (rm == 6)  /* bp */
-+			offset += regs->ebp;
-+		else if (rm == 7)  /* bx */
-+			offset += regs->ebx;
-+
-+		/* now, let's include 8/16 bits offset */
-+		if (mod) {
-+			if (mod & 0x80) /* 16 bits unsigned offset */
-+				offset += *((u16*)*from)++;
-+			else  /* 0x40: 8 bits signed offset */
-+				offset += *((s8*)*from)++;
-+		}
-+		return (void *)(offset & 0xFFFF);
-+	}
-+}
-+
-+
-+/*
-+ * skip_modrm() computes the EIP value of next instruction from the
-+ * pointer <from> which points to the first byte after the mod/rm byte.
-+ * Its purpose is to implement a fast alternative to modrm_address()
-+ * when offset value is not needed.
-+ */
-+static inline void *skip_modrm(u8 *from, int bit32, int modrm)
-+{
-+    	u8 mod,rm;
-+
-+	/* better optimization to compute them here, even
-+	 * if rm is not always used
-+	 */
-+	rm = modrm & 7;
-+	mod = modrm & 0xC0;
-+
-+	/* most common case first : registers */
-+	if (mod == 0xC0)
-+		return from;
-+
-+	if (bit32) { /* 32 bits addressing mode (default) */
-+		if (rm == 4)	/* SIB byte : rm becomes base */
-+			rm = (*from++ & 7);
-+		if (mod == 0x00) {
-+			if (rm == 5)  /* 32 bits offset and nothing more */
-+				return from + 4;
-+			else
-+				return from;
-+		}
-+	}
-+	else { /* 16 bits mode */
-+		if (mod == 0x00) {
-+			if (rm == 6)  /* 16 bits offset and nothing more */
-+				return from + 2;
-+			else
-+				return from;
-+		}
-+	}
-+
-+	if (mod & 0x80)
-+		return from + (2 * (bit32 + 1)); /* + 2 or 4 bytes */
-+	else
-+		return from + 1;
-+}
-+
-+
-+/* [reg_address] returns a pointer to a register in the regs struct, depending
-+ * on <w> (byte/word) and reg. Since the caller knows about <w>, it's
-+ * responsible for understanding the result as a byte, word or dword pointer.
-+ * Only the 3 lower bits of <reg> are meaningful, higher ones are ignored.
-+ */
-+static inline void *reg_address(struct pt_regs *regs, char w, u8 reg)
-+{
-+	if (w)
-+		/* 16/32 bits mode */
-+		return REG_PTR(regs, reg & 7);
-+	else
-+		/* 8 bits mode : al,cl,dl,bl,ah,ch,dh,bh */
-+		return ((reg & 4) >> 2) + (u8*)REG_PTR(regs, reg & 3);
-+
-+	/* this is set just to prevent the compiler from complaining */
-+	return NULL;
-+}
-+
-+/* [do_emu] is called by exception 6 after an invalid opcode has been
-+ * encountered. It will decode the prefixes and the instruction code, to try
-+ * to emulate it, and will send a SIGILL or SIGSEGV to the process if not
-+ * possible.
-+ * REP/REPN prefixes are not supported anymore because it didn't make sense
-+ * to emulate instructions prefixed with such opcodes since no arch-specific
-+ * instruction start by one of them. At most, they will be the start of newer
-+ * arch-specific instructions (SSE ?).
-+ */
-+asmlinkage void do_emu(struct pt_regs *regs, long error_code)
-+{
-+	enum {
-+		PREFIX_ES   = 1,
-+		PREFIX_CS   = 2,
-+		PREFIX_SS   = 4,
-+		PREFIX_DS   = 8,
-+		PREFIX_FS   = 16,
-+		PREFIX_GS   = 32,
-+		PREFIX_SEG  = 63,  /* any seg */
-+		PREFIX_D32  = 64,
-+		PREFIX_A32  = 128,
-+		PREFIX_LOCK = 256,
-+	} prefixes = 0;
-+
-+	u32 *src, *dst;
-+	u8 *eip;
-+
-+	preempt_disable();
-+	eip = (u8*)regs->eip;
-+
-+#ifdef BENCH_CPU_EXCEPTION_BUT_NOT_THE_CODE
-+	regs->eip += 3;
-+	goto out;
-+#endif
-+	/* we'll first read all known opcode prefixes, and discard obviously
-+	   invalid combinations.*/
-+	while (1) {
-+		/* prefix for CMOV, BSWAP, CMPXCHG, XADD */
-+		if (*eip == 0x0F) {
-+			eip++;
-+
-+			/* we'll verify if this is a BSWAP opcode, main source of SIGILL on 386's */
-+			if ((*eip & 0xF8) == 0xC8) {  /* BSWAP */
-+				u8 reg;
-+
-+				reg = *eip++ & 0x07;
-+				src = reg_address(regs, 1, reg);
-+				
-+				__asm__ __volatile__ (
-+						      "xchgb %%al, %%ah\n\t"
-+						      "roll $16, %%eax\n\t"
-+						      "xchgb %%al, %%ah\n\t"
-+						      : "=a" (*(u32*)src)
-+						      : "a" (*(u32*)src));
-+				regs->eip = (u32)eip;
-+				goto out;
-+			}
-+
-+
-+			/* we'll also try to emulate the CMPXCHG instruction (used in mutex locks).
-+			   This instruction is often locked, but it's not possible to put a lock
-+			   here. Anyway, I don't believe that there are lots of multiprocessors
-+			   386 out there ...
-+			*/
-+			if ((*eip & 0xFE) == 0xB0) {  /* CMPXCHG */
-+				u8 w, reg, modrm;
-+
-+				w = *eip & 1;
-+				modrm = *(eip + 1);
-+				eip += 2; /* skips all the opcodes */
-+
-+				reg = (modrm >> 3) & 7;
-+				
-+				dst = reg_address(regs, w, reg);
-+				if ((modrm & 0xC0) == 0xC0) /* register to register */
-+					src = reg_address(regs, w, modrm);
-+				else {
-+					src = modrm_address(regs, &eip, !(prefixes & PREFIX_A32), modrm);
-+					/* we must verify that src is valid for this task */
-+					if ((prefixes & (PREFIX_FS | PREFIX_GS)) ||
-+					    verify_area(VERIFY_WRITE, (void *)src, (w?((prefixes & PREFIX_D32)?2:4):1))) {
-+						do_general_protection(regs, error_code);
-+					    goto out;
-+					}
-+				}
-+				
-+				if (!w) { /* 8 bits operands */
-+					if ((u8)regs->eax == *(u8*)src) {
-+						*(u8*)src = *(u8*)dst;
-+						regs->eflags |= X86_EFLAGS_ZF;  /* set Zero Flag */
-+					}
-+					else {
-+						*(u8*)&(regs->eax) = *(u8*)src;
-+						regs->eflags &= ~X86_EFLAGS_ZF;  /* clear Zero Flag */
-+					}
-+				}
-+				else if (!(prefixes & PREFIX_D32)) { /* 32 bits operands */
-+					if ((u32)regs->eax == *(u32*)src) {
-+						*(u32*)src = *(u32*)dst;
-+						regs->eflags |= X86_EFLAGS_ZF;  /* set Zero Flag */
-+					}
-+					else {
-+						regs->eax = *(u32*)src;
-+						regs->eflags &= ~X86_EFLAGS_ZF;  /* clear Zero Flag */
-+					}
-+				}
-+				else { /* 16 bits operands */
-+					if ((u16)regs->eax == *(u16*)src) {
-+						*(u16*)src = *(u16*)dst;
-+						regs->eflags |= X86_EFLAGS_ZF;  /* set Zero Flag */
-+					}
-+					else {
-+						*(u16*)&regs->eax = *(u16*)src;
-+						regs->eflags &= ~X86_EFLAGS_ZF;  /* clear Zero Flag */
-+					}
-+				}
-+				regs->eip = (u32)eip;
-+				goto out;
-+			}
-+
-+			/* we'll also try to emulate the XADD instruction (not very common) */
-+			if ((*eip & 0xFE) == 0xC0) {  /* XADD */
-+				u8 w, reg, modrm;
-+				u32 op1, op2;
-+
-+				w = *eip & 1;
-+				modrm = *(eip + 1);
-+				eip += 2; /* skips all the opcodes */
-+
-+				reg = (modrm >> 3) & 7;
-+				
-+				dst = reg_address(regs, w, reg);
-+				if ((modrm & 0xC0) == 0xC0) /* register to register */
-+					src = reg_address(regs, w, modrm);
-+				else {
-+					src = modrm_address(regs, &eip, !(prefixes & PREFIX_A32), modrm);
-+					/* we must verify that src is valid for this task */
-+					if ((prefixes & (PREFIX_FS | PREFIX_GS)) ||
-+					    verify_area(VERIFY_WRITE, (void *)src, (w?((prefixes & PREFIX_D32)?2:4):1))) {
-+						do_general_protection(regs, error_code);
-+						goto out;
-+					}
-+				}
-+				
-+				if (!w) { /* 8 bits operands */
-+					op1 = *(u8*)src;
-+					op2 = *(u8*)dst;
-+					*(u8*)src = op1 + op2;
-+					*(u8*)dst = op1;
-+				}
-+				else if (!(prefixes & PREFIX_D32)) { /* 32 bits operands */
-+					op1 = *(u32*)src;
-+					op2 = *(u32*)dst;
-+					*(u32*)src = op1 + op2;
-+					*(u32*)dst = op1;
-+				}
-+				else { /* 16 bits operands */
-+					op1 = *(u16*)src;
-+					op2 = *(u16*)dst;
-+					*(u16*)src = op1 + op2;
-+					*(u16*)dst = op1;
-+				}
-+				regs->eip = (u32)eip;
-+				goto out;
-+			}
-+		} /* if (*eip == 0x0F) */
-+		else if ((*eip & 0xfc) == 0x64) {
-+			switch (*eip) {
-+			case 0x66: /* Operand switches 16/32 bits */
-+				if (prefixes & PREFIX_D32)
-+					goto invalid_opcode;
-+				prefixes |= PREFIX_D32;
-+				eip++;
-+				continue;
-+			case 0x67: /* Address switches 16/32 bits */
-+				if (prefixes & PREFIX_A32)
-+					goto invalid_opcode;
-+				prefixes |= PREFIX_A32;
-+				eip++;
-+				continue;
-+			case 0x64: /* FS: */
-+				if (prefixes & PREFIX_SEG)
-+					goto invalid_opcode;
-+				prefixes |= PREFIX_FS;
-+				eip++;
-+				continue;
-+			case 0x65: /* GS: */
-+				if (prefixes & PREFIX_SEG)
-+					goto invalid_opcode;
-+				prefixes |= PREFIX_GS;
-+				eip++;
-+				continue;
-+			}
-+		}
-+		else if (*eip == 0xf0) { /* lock */
-+			if (prefixes & PREFIX_LOCK)
-+				goto invalid_opcode;
-+			prefixes |= PREFIX_LOCK;
-+				eip++;
-+				continue;
-+		}
-+		else if ((*eip & 0xe7) == 0x26) {
-+			switch (*eip) {
-+			case 0x26: /* ES: */
-+				if (prefixes & PREFIX_SEG)
-+					goto invalid_opcode;
-+				prefixes |= PREFIX_ES;
-+				eip++;
-+				continue;
-+			case 0x2E: /* CS: */
-+				if (prefixes & PREFIX_SEG)
-+					goto invalid_opcode;
-+				prefixes |= PREFIX_CS;
-+				eip++;
-+				continue;
-+			case 0x36: /* SS: */
-+				if (prefixes & PREFIX_SEG)
-+					goto invalid_opcode;
-+				prefixes |= PREFIX_SS;
-+				eip++;
-+				continue;
-+			case 0x3E: /* DS: */
-+				if (prefixes & PREFIX_SEG)
-+					goto invalid_opcode;
-+				prefixes |= PREFIX_DS;
-+				eip++;
-+				continue;
-+			}
-+		}
-+		/* if this opcode has not been processed, it's not a prefix. */
-+		break;
-+	}
-+
-+	/* it's a case we can't handle. Unknown opcode or too many prefixes. */
-+invalid_opcode:
-+	preempt_enable();
-+#ifdef CONFIG_CPU_EMU486_DEBUG
-+	printk(KERN_DEBUG "do_emu() : invalid opcode detected @%p : %02x %02x ...\n", eip, eip[0], eip[1]);
-+#endif
-+	do_invalid_op(regs, error_code);
-+	return;
-+
-+out:
-+	preempt_enable();
-+}
-diff -urN kernel-source-2.6.6/arch/i386/kernel/entry.S kernel-source-2.6.6-1/arch/i386/kernel/entry.S
---- kernel-source-2.6.6/arch/i386/kernel/entry.S	2004-05-10 19:47:45.000000000 +1000
-+++ kernel-source-2.6.6-1/arch/i386/kernel/entry.S	2004-05-10 22:21:09.000000000 +1000
-@@ -527,7 +527,11 @@
- 
- ENTRY(invalid_op)
- 	pushl $0
-+#ifdef CONFIG_X86_EMU486
-+	pushl $do_emu
-+#else
- 	pushl $do_invalid_op
-+#endif
- 	jmp error_code
- 
- ENTRY(coprocessor_segment_overrun)

Copied: trunk/kernel/source/kernel-source-2.6.11-2.6.11/debian/patches/x86-i486_emu.patch (from rev 2762, trunk/kernel/source/kernel-source-2.6.11-2.6.11/debian/patches/x86-i486_emu.dpatch)




More information about the Kernel-svn-changes mailing list