[kernel] r9767 - in dists/sid/linux-2.6/debian: . arch arch/_vserver arch/_xen arch/alpha arch/alpha/vserver arch/amd64 arch/amd64/vserver arch/amd64/xen arch/amd64/xen-vserver arch/arm arch/armel arch/hppa arch/i386 arch/i386/vserver arch/i386/xen arch/i386/xen-vserver arch/ia64 arch/ia64/vserver arch/m68k arch/mips arch/mipsel arch/powerpc arch/powerpc/vserver arch/s390 arch/s390/vserver arch/sparc arch/sparc/vserver bin config config/alpha config/alpha/vserver config/amd64 config/amd64/vserver config/amd64/xen config/amd64/xen-vserver config/arm config/armel config/featureset-vserver config/featureset-xen config/featureset-xen-vserver config/hppa config/i386 config/i386/vserver config/i386/xen config/i386/xen-vserver config/ia64 config/ia64/vserver config/m68k config/mips config/mipsel config/powerpc config/powerpc/vserver config/s390 config/s390/vserver config/sparc config/sparc/vserver lib/python/debian_linux modules patches/bugfix patches/bugfix/all patches/bugfix/all/stable patches/bugfix/alpha patches/bugfix/arm patches/bugfix/hppa patches/bugfix/mips patches/bugfix/powerpc patches/bugfix/sparc patches/debian patches/debian/dfsg patches/features patches/features/all patches/features/all/vserver patches/features/all/xen patches/features/alpha patches/features/arm patches/features/mips patches/series templates templates/image.plain.bug templates/temp.image.plain

Maximilian Attems maks at alioth.debian.org
Mon Nov 26 20:06:56 UTC 2007


Author: maks
Date: Mon Nov 26 20:06:56 2007
New Revision: 9767

Log:
cp linus-2.6 2.6.23 to sid, open trunk for 2.6.24-rcX


Added:
   dists/sid/linux-2.6/debian/config/
   dists/sid/linux-2.6/debian/config/alpha/
   dists/sid/linux-2.6/debian/config/alpha/config
   dists/sid/linux-2.6/debian/config/alpha/config.alpha-generic
   dists/sid/linux-2.6/debian/config/alpha/config.alpha-legacy
   dists/sid/linux-2.6/debian/config/alpha/config.alpha-smp
   dists/sid/linux-2.6/debian/config/alpha/defines
   dists/sid/linux-2.6/debian/config/alpha/vserver/
   dists/sid/linux-2.6/debian/config/alpha/vserver/defines
   dists/sid/linux-2.6/debian/config/amd64/
   dists/sid/linux-2.6/debian/config/amd64/config
   dists/sid/linux-2.6/debian/config/amd64/config.amd64
   dists/sid/linux-2.6/debian/config/amd64/defines
   dists/sid/linux-2.6/debian/config/amd64/vserver/
   dists/sid/linux-2.6/debian/config/amd64/vserver/defines
   dists/sid/linux-2.6/debian/config/amd64/xen/
   dists/sid/linux-2.6/debian/config/amd64/xen-vserver/
   dists/sid/linux-2.6/debian/config/amd64/xen-vserver/defines
   dists/sid/linux-2.6/debian/config/amd64/xen/config
   dists/sid/linux-2.6/debian/config/amd64/xen/defines
   dists/sid/linux-2.6/debian/config/arm/
   dists/sid/linux-2.6/debian/config/arm/config
   dists/sid/linux-2.6/debian/config/arm/config.footbridge
   dists/sid/linux-2.6/debian/config/arm/config.iop32x
   dists/sid/linux-2.6/debian/config/arm/config.ixp4xx
   dists/sid/linux-2.6/debian/config/arm/config.versatile
   dists/sid/linux-2.6/debian/config/arm/defines
   dists/sid/linux-2.6/debian/config/armel/
   dists/sid/linux-2.6/debian/config/armel/config
   dists/sid/linux-2.6/debian/config/armel/defines
   dists/sid/linux-2.6/debian/config/config
   dists/sid/linux-2.6/debian/config/defines
   dists/sid/linux-2.6/debian/config/featureset-vserver/
   dists/sid/linux-2.6/debian/config/featureset-vserver/config
   dists/sid/linux-2.6/debian/config/featureset-xen/
   dists/sid/linux-2.6/debian/config/featureset-xen-vserver/
   dists/sid/linux-2.6/debian/config/featureset-xen-vserver/defines
   dists/sid/linux-2.6/debian/config/featureset-xen/config
   dists/sid/linux-2.6/debian/config/hppa/
   dists/sid/linux-2.6/debian/config/hppa/config
   dists/sid/linux-2.6/debian/config/hppa/config.parisc
   dists/sid/linux-2.6/debian/config/hppa/config.parisc-smp
   dists/sid/linux-2.6/debian/config/hppa/config.parisc64
   dists/sid/linux-2.6/debian/config/hppa/config.parisc64-smp
   dists/sid/linux-2.6/debian/config/hppa/defines
   dists/sid/linux-2.6/debian/config/i386/
   dists/sid/linux-2.6/debian/config/i386/config
   dists/sid/linux-2.6/debian/config/i386/config.486
   dists/sid/linux-2.6/debian/config/i386/config.686
   dists/sid/linux-2.6/debian/config/i386/config.686-bigmem
   dists/sid/linux-2.6/debian/config/i386/defines
   dists/sid/linux-2.6/debian/config/i386/vserver/
   dists/sid/linux-2.6/debian/config/i386/vserver/defines
   dists/sid/linux-2.6/debian/config/i386/xen/
   dists/sid/linux-2.6/debian/config/i386/xen-vserver/
   dists/sid/linux-2.6/debian/config/i386/xen-vserver/defines
   dists/sid/linux-2.6/debian/config/i386/xen/defines
   dists/sid/linux-2.6/debian/config/ia64/
   dists/sid/linux-2.6/debian/config/ia64/config
   dists/sid/linux-2.6/debian/config/ia64/config.itanium
   dists/sid/linux-2.6/debian/config/ia64/config.mckinley
   dists/sid/linux-2.6/debian/config/ia64/defines
   dists/sid/linux-2.6/debian/config/ia64/vserver/
   dists/sid/linux-2.6/debian/config/ia64/vserver/defines
   dists/sid/linux-2.6/debian/config/m68k/
   dists/sid/linux-2.6/debian/config/m68k/README.build
   dists/sid/linux-2.6/debian/config/m68k/config
   dists/sid/linux-2.6/debian/config/m68k/config.amiga
   dists/sid/linux-2.6/debian/config/m68k/config.atari
   dists/sid/linux-2.6/debian/config/m68k/config.bvme6000
   dists/sid/linux-2.6/debian/config/m68k/config.hp
   dists/sid/linux-2.6/debian/config/m68k/config.mac
   dists/sid/linux-2.6/debian/config/m68k/config.mvme147
   dists/sid/linux-2.6/debian/config/m68k/config.mvme16x
   dists/sid/linux-2.6/debian/config/m68k/config.q40
   dists/sid/linux-2.6/debian/config/m68k/config.sun3
   dists/sid/linux-2.6/debian/config/m68k/defines
   dists/sid/linux-2.6/debian/config/mips/
   dists/sid/linux-2.6/debian/config/mips/config
   dists/sid/linux-2.6/debian/config/mips/config.4kc-malta
   dists/sid/linux-2.6/debian/config/mips/config.5kc-malta
   dists/sid/linux-2.6/debian/config/mips/config.qemu
   dists/sid/linux-2.6/debian/config/mips/config.r4k-ip22
   dists/sid/linux-2.6/debian/config/mips/config.r5k-ip32
   dists/sid/linux-2.6/debian/config/mips/config.sb1-bcm91250a
   dists/sid/linux-2.6/debian/config/mips/config.sb1a-bcm91480b
   dists/sid/linux-2.6/debian/config/mips/defines
   dists/sid/linux-2.6/debian/config/mipsel/
   dists/sid/linux-2.6/debian/config/mipsel/config
   dists/sid/linux-2.6/debian/config/mipsel/config.4kc-malta
   dists/sid/linux-2.6/debian/config/mipsel/config.5kc-malta
   dists/sid/linux-2.6/debian/config/mipsel/config.qemu
   dists/sid/linux-2.6/debian/config/mipsel/config.r5k-cobalt
   dists/sid/linux-2.6/debian/config/mipsel/config.sb1-bcm91250a
   dists/sid/linux-2.6/debian/config/mipsel/config.sb1a-bcm91480b
   dists/sid/linux-2.6/debian/config/mipsel/defines
   dists/sid/linux-2.6/debian/config/powerpc/
   dists/sid/linux-2.6/debian/config/powerpc/config
   dists/sid/linux-2.6/debian/config/powerpc/config.apus
   dists/sid/linux-2.6/debian/config/powerpc/config.powerpc
   dists/sid/linux-2.6/debian/config/powerpc/config.powerpc-miboot
   dists/sid/linux-2.6/debian/config/powerpc/config.powerpc-smp
   dists/sid/linux-2.6/debian/config/powerpc/config.powerpc64
   dists/sid/linux-2.6/debian/config/powerpc/config.prep
   dists/sid/linux-2.6/debian/config/powerpc/defines
   dists/sid/linux-2.6/debian/config/powerpc/modules
   dists/sid/linux-2.6/debian/config/powerpc/modules.README
   dists/sid/linux-2.6/debian/config/powerpc/modules.powerpc
   dists/sid/linux-2.6/debian/config/powerpc/modules.powerpc-miboot
   dists/sid/linux-2.6/debian/config/powerpc/modules.powerpc64
   dists/sid/linux-2.6/debian/config/powerpc/vserver/
   dists/sid/linux-2.6/debian/config/powerpc/vserver/defines
   dists/sid/linux-2.6/debian/config/s390/
   dists/sid/linux-2.6/debian/config/s390/config
   dists/sid/linux-2.6/debian/config/s390/config.s390
   dists/sid/linux-2.6/debian/config/s390/config.s390-tape
   dists/sid/linux-2.6/debian/config/s390/config.s390x
   dists/sid/linux-2.6/debian/config/s390/defines
   dists/sid/linux-2.6/debian/config/s390/vserver/
   dists/sid/linux-2.6/debian/config/s390/vserver/defines
   dists/sid/linux-2.6/debian/config/sparc/
   dists/sid/linux-2.6/debian/config/sparc/config
   dists/sid/linux-2.6/debian/config/sparc/config.sparc32
   dists/sid/linux-2.6/debian/config/sparc/config.sparc64
   dists/sid/linux-2.6/debian/config/sparc/config.sparc64-smp
   dists/sid/linux-2.6/debian/config/sparc/defines
   dists/sid/linux-2.6/debian/config/sparc/vserver/
   dists/sid/linux-2.6/debian/config/sparc/vserver/defines
   dists/sid/linux-2.6/debian/lib/python/debian_linux/patches.py
   dists/sid/linux-2.6/debian/patches/bugfix/all/2.6.23.1
   dists/sid/linux-2.6/debian/patches/bugfix/all/git-ieee1394.patch
   dists/sid/linux-2.6/debian/patches/bugfix/all/stable/2.6.23.2.patch
   dists/sid/linux-2.6/debian/patches/bugfix/all/stable/2.6.23.3.patch
   dists/sid/linux-2.6/debian/patches/bugfix/all/stable/2.6.23.4.patch
   dists/sid/linux-2.6/debian/patches/bugfix/all/stable/2.6.23.5.patch
   dists/sid/linux-2.6/debian/patches/bugfix/all/stable/2.6.23.6.patch
   dists/sid/linux-2.6/debian/patches/bugfix/all/stable/2.6.23.7.patch
   dists/sid/linux-2.6/debian/patches/bugfix/all/stable/2.6.23.8.patch
   dists/sid/linux-2.6/debian/patches/bugfix/alpha/asm-subarchs.patch
   dists/sid/linux-2.6/debian/patches/bugfix/alpha/srm-env-fixes.patch
   dists/sid/linux-2.6/debian/patches/bugfix/arm/binutils-notes.patch
   dists/sid/linux-2.6/debian/patches/bugfix/arm/disable-bcm43xx.patch
   dists/sid/linux-2.6/debian/patches/bugfix/arm/disable-chelsio_t3.patch
   dists/sid/linux-2.6/debian/patches/bugfix/arm/disable-dvb_b2c2_flexcop.patch
   dists/sid/linux-2.6/debian/patches/bugfix/arm/disable-dvb_budget.patch
   dists/sid/linux-2.6/debian/patches/bugfix/arm/disable-netxen_nic.patch
   dists/sid/linux-2.6/debian/patches/bugfix/arm/disable-scsi_acard.patch
   dists/sid/linux-2.6/debian/patches/bugfix/arm/disable-video_bt848.patch
   dists/sid/linux-2.6/debian/patches/bugfix/fdomain-pci-id-table.patch
   dists/sid/linux-2.6/debian/patches/bugfix/mips/bcm1480-pci-build-fix.patch
   dists/sid/linux-2.6/debian/patches/bugfix/mips/ip22-fix-eisa-interrupt-setup.patch
   dists/sid/linux-2.6/debian/patches/bugfix/mips/ip22-fix-eprom-access.patch
   dists/sid/linux-2.6/debian/patches/bugfix/powerpc/drivers_macintosh-broken.patch
   dists/sid/linux-2.6/debian/patches/bugfix/powerpc/interrupt-alignement.patch
   dists/sid/linux-2.6/debian/patches/bugfix/serial_core-suspend_oops.patch
   dists/sid/linux-2.6/debian/patches/bugfix/serial_cs-resume.patch
   dists/sid/linux-2.6/debian/patches/bugfix/sparc/bus-id-size.patch
   dists/sid/linux-2.6/debian/patches/bugfix/sparc/compat-alloc-user-space-alignment.patch
   dists/sid/linux-2.6/debian/patches/bugfix/sparc/sunblade1k-boot-fix.patch
   dists/sid/linux-2.6/debian/patches/bugfix/sparc/t1k-cpu-lockup.patch
   dists/sid/linux-2.6/debian/patches/debian/dfsg/drivers-atm.patch
   dists/sid/linux-2.6/debian/patches/debian/dfsg/drivers-char-computone.patch
   dists/sid/linux-2.6/debian/patches/debian/dfsg/drivers-media-dvb-ttusb-budget.patch
   dists/sid/linux-2.6/debian/patches/debian/dfsg/drivers-net-acenic-remove.patch
   dists/sid/linux-2.6/debian/patches/debian/dfsg/drivers-net-bnx2-disable.patch
   dists/sid/linux-2.6/debian/patches/debian/dfsg/drivers-net-hamradio-yam.patch
   dists/sid/linux-2.6/debian/patches/debian/dfsg/drivers-net-myri.patch
   dists/sid/linux-2.6/debian/patches/debian/dfsg/drivers-net-tg3-fix-simple.patch
   dists/sid/linux-2.6/debian/patches/debian/dfsg/drivers-net-tg3-mark.patch
   dists/sid/linux-2.6/debian/patches/debian/dfsg/drivers-net-tg3-remove.patch
   dists/sid/linux-2.6/debian/patches/debian/dfsg/drivers-scsi-qlogicpti.patch
   dists/sid/linux-2.6/debian/patches/debian/dfsg/drivers-usb-serial-keyspan-remove.patch
   dists/sid/linux-2.6/debian/patches/debian/dfsg/sound-pci.patch
   dists/sid/linux-2.6/debian/patches/features/all/e1000e-20070806.patch
   dists/sid/linux-2.6/debian/patches/features/all/e1000e-fixes.patch
   dists/sid/linux-2.6/debian/patches/features/all/fs-asfs.patch
   dists/sid/linux-2.6/debian/patches/features/all/v7-iwlwifi-add-iwlwifi-wireless-drivers.patch
   dists/sid/linux-2.6/debian/patches/features/all/vserver/vs2.2.0-rc5.patch
   dists/sid/linux-2.6/debian/patches/features/alpha/titan-video.patch
   dists/sid/linux-2.6/debian/patches/features/arm/n2100-set-fan.patch
   dists/sid/linux-2.6/debian/patches/features/f75375-new-style-bindings.patch
   dists/sid/linux-2.6/debian/patches/features/f75375-set-fans-platform-data.patch
   dists/sid/linux-2.6/debian/patches/series/1~experimental.1
   dists/sid/linux-2.6/debian/patches/series/1~experimental.1-extra
   dists/sid/linux-2.6/debian/patches/series/orig-0
   dists/sid/linux-2.6/debian/templates/control.headers.featureset.in
   dists/sid/linux-2.6/debian/templates/control.libc-dev.in
   dists/sid/linux-2.6/debian/templates/image.plain.bug/include-1cmdline
Removed:
   dists/sid/linux-2.6/debian/arch/_vserver/config
   dists/sid/linux-2.6/debian/arch/_xen/config
   dists/sid/linux-2.6/debian/arch/alpha/Makefile.inc
   dists/sid/linux-2.6/debian/arch/alpha/abi-3.alpha-generic
   dists/sid/linux-2.6/debian/arch/alpha/abi-3.alpha-legacy
   dists/sid/linux-2.6/debian/arch/alpha/abi-3.alpha-smp
   dists/sid/linux-2.6/debian/arch/alpha/config
   dists/sid/linux-2.6/debian/arch/alpha/config.alpha-generic
   dists/sid/linux-2.6/debian/arch/alpha/config.alpha-legacy
   dists/sid/linux-2.6/debian/arch/alpha/config.alpha-smp
   dists/sid/linux-2.6/debian/arch/alpha/defines
   dists/sid/linux-2.6/debian/arch/alpha/vserver/abi-3.alpha
   dists/sid/linux-2.6/debian/arch/alpha/vserver/defines
   dists/sid/linux-2.6/debian/arch/amd64/Makefile.inc
   dists/sid/linux-2.6/debian/arch/amd64/abi-3.amd64
   dists/sid/linux-2.6/debian/arch/amd64/config
   dists/sid/linux-2.6/debian/arch/amd64/config.amd64
   dists/sid/linux-2.6/debian/arch/amd64/defines
   dists/sid/linux-2.6/debian/arch/amd64/vserver/abi-3.amd64
   dists/sid/linux-2.6/debian/arch/amd64/vserver/defines
   dists/sid/linux-2.6/debian/arch/amd64/xen-vserver/defines
   dists/sid/linux-2.6/debian/arch/amd64/xen/config
   dists/sid/linux-2.6/debian/arch/amd64/xen/defines
   dists/sid/linux-2.6/debian/arch/arm/Makefile.inc
   dists/sid/linux-2.6/debian/arch/arm/abi-3.footbridge
   dists/sid/linux-2.6/debian/arch/arm/abi-3.iop32x
   dists/sid/linux-2.6/debian/arch/arm/abi-3.ixp4xx
   dists/sid/linux-2.6/debian/arch/arm/config
   dists/sid/linux-2.6/debian/arch/arm/config.footbridge
   dists/sid/linux-2.6/debian/arch/arm/config.iop32x
   dists/sid/linux-2.6/debian/arch/arm/config.ixp4xx
   dists/sid/linux-2.6/debian/arch/arm/config.versatile
   dists/sid/linux-2.6/debian/arch/arm/defines
   dists/sid/linux-2.6/debian/arch/armel/config
   dists/sid/linux-2.6/debian/arch/armel/defines
   dists/sid/linux-2.6/debian/arch/config
   dists/sid/linux-2.6/debian/arch/defines
   dists/sid/linux-2.6/debian/arch/hppa/Makefile.inc
   dists/sid/linux-2.6/debian/arch/hppa/abi-3.parisc
   dists/sid/linux-2.6/debian/arch/hppa/abi-3.parisc-smp
   dists/sid/linux-2.6/debian/arch/hppa/abi-3.parisc64
   dists/sid/linux-2.6/debian/arch/hppa/abi-3.parisc64-smp
   dists/sid/linux-2.6/debian/arch/hppa/config
   dists/sid/linux-2.6/debian/arch/hppa/config.parisc
   dists/sid/linux-2.6/debian/arch/hppa/config.parisc-smp
   dists/sid/linux-2.6/debian/arch/hppa/config.parisc64
   dists/sid/linux-2.6/debian/arch/hppa/config.parisc64-smp
   dists/sid/linux-2.6/debian/arch/hppa/defines
   dists/sid/linux-2.6/debian/arch/i386/abi-3.486
   dists/sid/linux-2.6/debian/arch/i386/abi-3.686
   dists/sid/linux-2.6/debian/arch/i386/abi-3.686-bigmem
   dists/sid/linux-2.6/debian/arch/i386/abi-3.amd64
   dists/sid/linux-2.6/debian/arch/i386/abi-3.k7
   dists/sid/linux-2.6/debian/arch/i386/config
   dists/sid/linux-2.6/debian/arch/i386/config.486
   dists/sid/linux-2.6/debian/arch/i386/config.686
   dists/sid/linux-2.6/debian/arch/i386/config.686-bigmem
   dists/sid/linux-2.6/debian/arch/i386/config.k7
   dists/sid/linux-2.6/debian/arch/i386/defines
   dists/sid/linux-2.6/debian/arch/i386/vserver/abi-3.686
   dists/sid/linux-2.6/debian/arch/i386/vserver/abi-3.k7
   dists/sid/linux-2.6/debian/arch/i386/vserver/defines
   dists/sid/linux-2.6/debian/arch/i386/xen-vserver/defines
   dists/sid/linux-2.6/debian/arch/i386/xen/config
   dists/sid/linux-2.6/debian/arch/i386/xen/defines
   dists/sid/linux-2.6/debian/arch/ia64/Makefile.inc
   dists/sid/linux-2.6/debian/arch/ia64/abi-3.itanium
   dists/sid/linux-2.6/debian/arch/ia64/abi-3.mckinley
   dists/sid/linux-2.6/debian/arch/ia64/config
   dists/sid/linux-2.6/debian/arch/ia64/config.itanium
   dists/sid/linux-2.6/debian/arch/ia64/config.mckinley
   dists/sid/linux-2.6/debian/arch/ia64/defines
   dists/sid/linux-2.6/debian/arch/ia64/vserver/abi-3.itanium
   dists/sid/linux-2.6/debian/arch/ia64/vserver/abi-3.mckinley
   dists/sid/linux-2.6/debian/arch/ia64/vserver/defines
   dists/sid/linux-2.6/debian/arch/m68k/Makefile.inc
   dists/sid/linux-2.6/debian/arch/m68k/README.build
   dists/sid/linux-2.6/debian/arch/m68k/abi-3.amiga
   dists/sid/linux-2.6/debian/arch/m68k/abi-3.atari
   dists/sid/linux-2.6/debian/arch/m68k/abi-3.mac
   dists/sid/linux-2.6/debian/arch/m68k/config
   dists/sid/linux-2.6/debian/arch/m68k/config.amiga
   dists/sid/linux-2.6/debian/arch/m68k/config.atari
   dists/sid/linux-2.6/debian/arch/m68k/config.bvme6000
   dists/sid/linux-2.6/debian/arch/m68k/config.hp
   dists/sid/linux-2.6/debian/arch/m68k/config.mac
   dists/sid/linux-2.6/debian/arch/m68k/config.mvme147
   dists/sid/linux-2.6/debian/arch/m68k/config.mvme16x
   dists/sid/linux-2.6/debian/arch/m68k/config.q40
   dists/sid/linux-2.6/debian/arch/m68k/config.sun3
   dists/sid/linux-2.6/debian/arch/m68k/defines
   dists/sid/linux-2.6/debian/arch/mips/Makefile.inc
   dists/sid/linux-2.6/debian/arch/mips/abi-3.4kc-malta
   dists/sid/linux-2.6/debian/arch/mips/abi-3.qemu
   dists/sid/linux-2.6/debian/arch/mips/abi-3.r4k-ip22
   dists/sid/linux-2.6/debian/arch/mips/abi-3.r5k-ip32
   dists/sid/linux-2.6/debian/arch/mips/abi-3.sb1-bcm91250a
   dists/sid/linux-2.6/debian/arch/mips/abi-3.sb1a-bcm91480b
   dists/sid/linux-2.6/debian/arch/mips/config
   dists/sid/linux-2.6/debian/arch/mips/config.4kc-malta
   dists/sid/linux-2.6/debian/arch/mips/config.qemu
   dists/sid/linux-2.6/debian/arch/mips/config.r4k-ip22
   dists/sid/linux-2.6/debian/arch/mips/config.r5k-ip32
   dists/sid/linux-2.6/debian/arch/mips/config.sb1-bcm91250a
   dists/sid/linux-2.6/debian/arch/mips/config.sb1a-bcm91480b
   dists/sid/linux-2.6/debian/arch/mips/defines
   dists/sid/linux-2.6/debian/arch/mipsel/Makefile.inc
   dists/sid/linux-2.6/debian/arch/mipsel/abi-3.4kc-malta
   dists/sid/linux-2.6/debian/arch/mipsel/abi-3.qemu
   dists/sid/linux-2.6/debian/arch/mipsel/abi-3.r5k-cobalt
   dists/sid/linux-2.6/debian/arch/mipsel/abi-3.sb1-bcm91250a
   dists/sid/linux-2.6/debian/arch/mipsel/abi-3.sb1a-bcm91480b
   dists/sid/linux-2.6/debian/arch/mipsel/config
   dists/sid/linux-2.6/debian/arch/mipsel/config.4kc-malta
   dists/sid/linux-2.6/debian/arch/mipsel/config.qemu
   dists/sid/linux-2.6/debian/arch/mipsel/config.r5k-cobalt
   dists/sid/linux-2.6/debian/arch/mipsel/config.sb1-bcm91250a
   dists/sid/linux-2.6/debian/arch/mipsel/config.sb1a-bcm91480b
   dists/sid/linux-2.6/debian/arch/mipsel/defines
   dists/sid/linux-2.6/debian/arch/powerpc/Makefile.inc
   dists/sid/linux-2.6/debian/arch/powerpc/abi-3.powerpc
   dists/sid/linux-2.6/debian/arch/powerpc/abi-3.powerpc-miboot
   dists/sid/linux-2.6/debian/arch/powerpc/abi-3.powerpc-smp
   dists/sid/linux-2.6/debian/arch/powerpc/abi-3.powerpc64
   dists/sid/linux-2.6/debian/arch/powerpc/config
   dists/sid/linux-2.6/debian/arch/powerpc/config.apus
   dists/sid/linux-2.6/debian/arch/powerpc/config.powerpc
   dists/sid/linux-2.6/debian/arch/powerpc/config.powerpc-miboot
   dists/sid/linux-2.6/debian/arch/powerpc/config.powerpc-smp
   dists/sid/linux-2.6/debian/arch/powerpc/config.powerpc64
   dists/sid/linux-2.6/debian/arch/powerpc/config.prep
   dists/sid/linux-2.6/debian/arch/powerpc/defines
   dists/sid/linux-2.6/debian/arch/powerpc/modules
   dists/sid/linux-2.6/debian/arch/powerpc/modules.README
   dists/sid/linux-2.6/debian/arch/powerpc/modules.powerpc
   dists/sid/linux-2.6/debian/arch/powerpc/modules.powerpc-miboot
   dists/sid/linux-2.6/debian/arch/powerpc/modules.powerpc64
   dists/sid/linux-2.6/debian/arch/powerpc/vserver/abi-3.powerpc
   dists/sid/linux-2.6/debian/arch/powerpc/vserver/abi-3.powerpc64
   dists/sid/linux-2.6/debian/arch/powerpc/vserver/defines
   dists/sid/linux-2.6/debian/arch/s390/Makefile.inc
   dists/sid/linux-2.6/debian/arch/s390/abi-3.s390
   dists/sid/linux-2.6/debian/arch/s390/abi-3.s390x
   dists/sid/linux-2.6/debian/arch/s390/config
   dists/sid/linux-2.6/debian/arch/s390/config.s390
   dists/sid/linux-2.6/debian/arch/s390/config.s390-tape
   dists/sid/linux-2.6/debian/arch/s390/config.s390x
   dists/sid/linux-2.6/debian/arch/s390/defines
   dists/sid/linux-2.6/debian/arch/s390/vserver/abi-3.s390x
   dists/sid/linux-2.6/debian/arch/s390/vserver/defines
   dists/sid/linux-2.6/debian/arch/sparc/Makefile.inc
   dists/sid/linux-2.6/debian/arch/sparc/abi-3.sparc64
   dists/sid/linux-2.6/debian/arch/sparc/abi-3.sparc64-smp
   dists/sid/linux-2.6/debian/arch/sparc/config
   dists/sid/linux-2.6/debian/arch/sparc/config.sparc32
   dists/sid/linux-2.6/debian/arch/sparc/config.sparc64
   dists/sid/linux-2.6/debian/arch/sparc/config.sparc64-smp
   dists/sid/linux-2.6/debian/arch/sparc/defines
   dists/sid/linux-2.6/debian/arch/sparc/vserver/abi-3.sparc64
   dists/sid/linux-2.6/debian/arch/sparc/vserver/defines
   dists/sid/linux-2.6/debian/bin/sparc32-image-postproc
   dists/sid/linux-2.6/debian/patches/bugfix/2.6.22.1
   dists/sid/linux-2.6/debian/patches/bugfix/2.6.22.10
   dists/sid/linux-2.6/debian/patches/bugfix/2.6.22.11
   dists/sid/linux-2.6/debian/patches/bugfix/2.6.22.12-rc1
   dists/sid/linux-2.6/debian/patches/bugfix/2.6.22.2
   dists/sid/linux-2.6/debian/patches/bugfix/2.6.22.3
   dists/sid/linux-2.6/debian/patches/bugfix/2.6.22.4
   dists/sid/linux-2.6/debian/patches/bugfix/2.6.22.5
   dists/sid/linux-2.6/debian/patches/bugfix/2.6.22.6
   dists/sid/linux-2.6/debian/patches/bugfix/2.6.22.7
   dists/sid/linux-2.6/debian/patches/bugfix/2.6.22.8
   dists/sid/linux-2.6/debian/patches/bugfix/2.6.22.9
   dists/sid/linux-2.6/debian/patches/bugfix/all/fix-some-cases-of-missed-ipv6-dad.patch
   dists/sid/linux-2.6/debian/patches/bugfix/alpha/request_irq-retval.patch
   dists/sid/linux-2.6/debian/patches/bugfix/arm/disable-broken-config-options-1.patch
   dists/sid/linux-2.6/debian/patches/bugfix/arm/nas100d-pata-artop-single-port.patch
   dists/sid/linux-2.6/debian/patches/bugfix/arm/rtc-rs5c372-n2100.patch
   dists/sid/linux-2.6/debian/patches/bugfix/hppa/use-generic-compat_sys_getdents.patch
   dists/sid/linux-2.6/debian/patches/bugfix/mips/64bit-tulip.patch
   dists/sid/linux-2.6/debian/patches/bugfix/mips/fix-build-elf64.patch
   dists/sid/linux-2.6/debian/patches/bugfix/mips/i8259-disable-method.patch
   dists/sid/linux-2.6/debian/patches/bugfix/mips/ide-scan.patch
   dists/sid/linux-2.6/debian/patches/bugfix/mips/ip22-fix-argument-order.patch
   dists/sid/linux-2.6/debian/patches/bugfix/mips/ip22-fix-second-hpc-check.patch
   dists/sid/linux-2.6/debian/patches/bugfix/mips/ip22-zilog-console.patch
   dists/sid/linux-2.6/debian/patches/bugfix/mips/sgi-ioc3.patch
   dists/sid/linux-2.6/debian/patches/bugfix/powerpc/i8042-pegasos.patch
   dists/sid/linux-2.6/debian/patches/bugfix/sparc/sun4u-pci-config-space.patch
   dists/sid/linux-2.6/debian/patches/debian/dfsg/drivers-usb-serial-keyspan.patch
   dists/sid/linux-2.6/debian/patches/features/all/vserver/vs2.2.0.5.patch
   dists/sid/linux-2.6/debian/patches/features/all/xen/README
   dists/sid/linux-2.6/debian/patches/features/all/xen/gen-patch
   dists/sid/linux-2.6/debian/patches/features/all/xen/gen-patch-vserver-update
   dists/sid/linux-2.6/debian/patches/features/mips/qemu-vga.patch
   dists/sid/linux-2.6/debian/patches/features/mips/sb1-duart.patch
   dists/sid/linux-2.6/debian/patches/series/1
   dists/sid/linux-2.6/debian/patches/series/1-extra
   dists/sid/linux-2.6/debian/patches/series/2
   dists/sid/linux-2.6/debian/patches/series/2-extra
   dists/sid/linux-2.6/debian/patches/series/3
   dists/sid/linux-2.6/debian/patches/series/4
   dists/sid/linux-2.6/debian/patches/series/5
   dists/sid/linux-2.6/debian/patches/series/6
   dists/sid/linux-2.6/debian/patches/series/6-extra
   dists/sid/linux-2.6/debian/patches/series/orig-1
   dists/sid/linux-2.6/debian/templates/control.headers.subarch.in
Modified:
   dists/sid/linux-2.6/debian/README.Debian
   dists/sid/linux-2.6/debian/bin/abicheck.py
   dists/sid/linux-2.6/debian/bin/abiupdate.py
   dists/sid/linux-2.6/debian/bin/gencontrol.py
   dists/sid/linux-2.6/debian/bin/genorig.py
   dists/sid/linux-2.6/debian/bin/kconfig.py
   dists/sid/linux-2.6/debian/changelog
   dists/sid/linux-2.6/debian/lib/python/debian_linux/config.py
   dists/sid/linux-2.6/debian/lib/python/debian_linux/debian.py
   dists/sid/linux-2.6/debian/lib/python/debian_linux/gencontrol.py
   dists/sid/linux-2.6/debian/lib/python/debian_linux/utils.py
   dists/sid/linux-2.6/debian/modules/gencontrol.py
   dists/sid/linux-2.6/debian/modules/rules.include
   dists/sid/linux-2.6/debian/patches/debian/dfsg/drivers-media-video-dabus.patch
   dists/sid/linux-2.6/debian/patches/debian/dfsg/drivers-net-dgrs.patch
   dists/sid/linux-2.6/debian/patches/debian/dfsg/drivers-net-tokenring-3c359-smctr.patch
   dists/sid/linux-2.6/debian/patches/debian/dfsg/files-1
   dists/sid/linux-2.6/debian/patches/debian/drivers-ata-ata_piix-postpone-pata.patch
   dists/sid/linux-2.6/debian/patches/debian/powerpc-mkvmlinuz-support-powerpc.patch
   dists/sid/linux-2.6/debian/patches/debian/scripts-kconfig-reportoldconfig.patch
   dists/sid/linux-2.6/debian/patches/features/arm/ixp4xx-net-driver-improve-mac-handling.patch
   dists/sid/linux-2.6/debian/patches/features/arm/ixp4xx-npe-driver-0.3.1.patch
   dists/sid/linux-2.6/debian/patches/features/fintek-f75375.patch
   dists/sid/linux-2.6/debian/rules
   dists/sid/linux-2.6/debian/rules.real
   dists/sid/linux-2.6/debian/templates/control.headers.arch.in
   dists/sid/linux-2.6/debian/templates/control.headers.in
   dists/sid/linux-2.6/debian/templates/control.main.in
   dists/sid/linux-2.6/debian/templates/control.source.in
   dists/sid/linux-2.6/debian/templates/control.support.in
   dists/sid/linux-2.6/debian/templates/patch.apply.in
   dists/sid/linux-2.6/debian/templates/temp.image.plain/postinst
   dists/sid/linux-2.6/debian/templates/temp.image.plain/postrm
   dists/sid/linux-2.6/debian/templates/temp.image.plain/preinst
   dists/sid/linux-2.6/debian/templates/temp.image.plain/prerm

Modified: dists/sid/linux-2.6/debian/README.Debian
==============================================================================
--- dists/sid/linux-2.6/debian/README.Debian	(original)
+++ dists/sid/linux-2.6/debian/README.Debian	Mon Nov 26 20:06:56 2007
@@ -36,12 +36,6 @@
 If your PS/2 mouse does not work, make sure that the modules psmouse and
 mousedev are loaded.
 
-mem= on 2.4.19 and later
-------------------------
-mem=xxxM can no longer be used to enlarge the RAM that the kernel uses.
-You must specify the exact memory map.  For example, Compaq Proliant users
-can specify mem=48M at 16M if they have 64M of memory.
-
 Non-free bits removed
 ---------------------
 * Keyspan firmware, driver disabled

Modified: dists/sid/linux-2.6/debian/bin/abicheck.py
==============================================================================
--- dists/sid/linux-2.6/debian/bin/abicheck.py	(original)
+++ dists/sid/linux-2.6/debian/bin/abicheck.py	Mon Nov 26 20:06:56 2007
@@ -1,19 +1,18 @@
-#!/usr/bin/env python2.4
+#!/usr/bin/env python
 
 import sys
+sys.path.append('debian/lib/python')
+
 from debian_linux.abi import *
-from debian_linux.config import *
+from debian_linux.config import ConfigCoreDump
 
 class checker(object):
-    def __init__(self, dir, arch, subarch, flavour):
-        self.arch, self.subarch, self.flavour = arch, subarch, flavour
-        self.config = ConfigReaderCore(["debian/arch"])
+    def __init__(self, dir, arch, featureset, flavour):
+        self.arch, self.featureset, self.flavour = arch, featureset, flavour
+        self.config = ConfigCoreDump(fp = file("debian/config.defines.dump"))
         self.filename_new = "%s/Module.symvers" % dir
         abiname = self.config['abi',]['abiname']
-        if subarch == 'none':
-            self.filename_ref = "debian/arch/%s/abi-%s.%s" % (arch, abiname, flavour)
-        else:
-            self.filename_ref = "debian/arch/%s/%s/abi-%s.%s" % (arch, subarch, abiname, flavour)
+        self.filename_ref = "debian/abi/%s/%s_%s_%s" % (abiname, arch, featureset, flavour)
 
     def __call__(self, out):
         ret = 0
@@ -88,7 +87,7 @@
         return ret
 
     def _ignore(self, add, change, remove):
-        config = self.config.merge('abi', self.arch, self.subarch, self.flavour)
+        config = self.config.merge('abi', self.arch, self.featureset, self.flavour)
         ignores = config.get('ignore-changes', None)
         if ignores is None:
             return set()

Modified: dists/sid/linux-2.6/debian/bin/abiupdate.py
==============================================================================
--- dists/sid/linux-2.6/debian/bin/abiupdate.py	(original)
+++ dists/sid/linux-2.6/debian/bin/abiupdate.py	Mon Nov 26 20:06:56 2007
@@ -1,4 +1,4 @@
-#!/usr/bin/env python2.4
+#!/usr/bin/env python
 
 import sys
 sys.path.append(sys.path[0] + "/../lib/python")
@@ -28,14 +28,14 @@
 class main(object):
     dir = None
 
-    def __init__(self, url, url_config = None, arch = None, subarch = None, flavour = None):
+    def __init__(self, url, url_config = None, arch = None, featureset = None, flavour = None):
         self.log = sys.stdout.write
 
         self.url = self.url_config = url
         if url_config is not None:
             self.url_config = url_config
         self.override_arch = arch
-        self.override_subarch = subarch
+        self.override_featureset = featureset
         self.override_flavour = flavour
 
         changelog = Changelog(version = VersionLinux)
@@ -47,7 +47,7 @@
         self.version = changelog.version.linux_version
         self.version_source = changelog.version.complete
 
-        local_config = ConfigReaderCore(["debian/arch"])
+        local_config = ConfigCoreDump(fp = file("debian/config.defines.dump"))
 
         self.abiname = local_config['abi',]['abiname']
         self.version_abi = self.version + '-' + self.abiname
@@ -72,11 +72,7 @@
         os.system("dpkg-deb --extract %s %s" % (filename, base_out))
         return base_out
 
-    def get_abi(self, arch, subarch, flavour):
-        if subarch == 'none':
-            prefix = flavour
-        else:
-            prefix = subarch + '-' + flavour
+    def get_abi(self, arch, prefix):
         filename = "linux-headers-%s-%s_%s_%s.deb" % (self.version_abi, prefix, self.version_source, arch)
         f = self.retrieve_package(self.url, filename)
         d = self.extract_package(f, "linux-headers-%s_%s" % (prefix, arch))
@@ -89,8 +85,8 @@
         filename = "linux-support-%s_%s_all.deb" % (self.version_abi, self.version_source)
         f = self.retrieve_package(self.url_config, filename)
         d = self.extract_package(f, "linux-support")
-        dir = d + "/usr/src/linux-support-" + self.version_abi + "/arch"
-        config = ConfigReaderCore([dir])
+        c = d + "/usr/src/linux-support-" + self.version_abi + "/config.defines.dump"
+        config = ConfigCoreDump(fp = file(c))
         shutil.rmtree(d)
         return config
 
@@ -106,40 +102,49 @@
             f_out.write(r)
         return filename_out
 
-    def save_abi(self, symbols, arch, subarch, flavour):
-        out = "debian/arch/%s" % arch
-        if subarch != 'none':
-            out += "/%s" % subarch
-        out += "/abi-%s.%s" % (self.abiname, flavour)
+    def save_abi(self, symbols, arch, featureset, flavour):
+        dir = "debian/abi/%s" % self.abiname
+        if not os.path.exists(dir):
+            os.makedirs(dir)
+        out = "%s/%s_%s_%s" % (dir, arch, featureset, flavour)
         symbols.write(file(out, 'w'))
 
     def update_arch(self, config, arch):
-        if self.override_subarch:
-            subarches = [self.override_subarch]
+        if self.override_featureset:
+            featuresets = [self.override_featureset]
         else:
-            subarches = config[('base', arch)]['subarches']
-        for subarch in subarches:
-            self.update_subarch(config, arch, subarch)
-
-    def update_subarch(self, config, arch, subarch):
-        config_entry = config[('base', arch, subarch)]
-        if not config_entry.get('modules', True):
+            featuresets = config[('base', arch)]['featuresets']
+        for featureset in featuresets:
+            self.update_featureset(config, arch, featureset)
+
+    def update_featureset(self, config, arch, featureset):
+        config_base = config.merge('base', arch, featureset)
+
+        if not config_base.get('enabled', True):
             return
+
         if self.override_flavour:
             flavours = [self.override_flavour]
         else:
-            flavours = config_entry['flavours']
+            flavours = config_base['flavours']
         for flavour in flavours:
-            self.update_flavour(config, arch, subarch, flavour)
+            self.update_flavour(config, arch, featureset, flavour)
 
-    def update_flavour(self, config, arch, subarch, flavour):
-        config_entry = config[('base', arch, subarch, flavour)]
-        if not config_entry.get('modules', True):
+    def update_flavour(self, config, arch, featureset, flavour):
+        config_base = config.merge('base', arch, featureset, flavour)
+
+        if not config_base.get('modules', True):
             return
-        self.log("Updating ABI for arch %s, subarch %s, flavour %s: " % (arch, subarch, flavour))
+
+        self.log("Updating ABI for arch %s, featureset %s, flavour %s: " % (arch, featureset, flavour))
         try:
-            abi = self.get_abi(arch, subarch, flavour)
-            self.save_abi(abi, arch, subarch, flavour)
+            if featureset == 'none':
+                localversion = flavour
+            else:
+                localversion = featureset + '-' + flavour
+
+            abi = self.get_abi(arch, localversion)
+            self.save_abi(abi, arch, featureset, flavour)
             self.log("Ok.\n")
         except KeyboardInterrupt:
             self.log("Interrupted!\n")
@@ -160,7 +165,7 @@
     if len(args) >= 1:
         kw['arch'] =args[0]
     if len(args) >= 2:
-        kw['subarch'] =args[1]
+        kw['featureset'] =args[1]
     if len(args) >= 3:
         kw['flavour'] =args[2]
 

Modified: dists/sid/linux-2.6/debian/bin/gencontrol.py
==============================================================================
--- dists/sid/linux-2.6/debian/bin/gencontrol.py	(original)
+++ dists/sid/linux-2.6/debian/bin/gencontrol.py	Mon Nov 26 20:06:56 2007
@@ -1,14 +1,18 @@
-#!/usr/bin/env python2.4
+#!/usr/bin/env python
+
 import os, sys
 sys.path.append("debian/lib/python")
 
-from debian_linux.gencontrol import Gencontrol as Base
+from debian_linux.config import ConfigCoreHierarchy
 from debian_linux.debian import *
+from debian_linux.gencontrol import Gencontrol as Base
+from debian_linux.utils import Templates
 
 class Gencontrol(Base):
-    def __init__(self):
-        super(Gencontrol, self).__init__()
+    def __init__(self, config_dirs = ["debian/config"], template_dirs = ["debian/templates"]):
+        super(Gencontrol, self).__init__(ConfigCoreHierarchy(config_dirs), Templates(template_dirs))
         self.process_changelog()
+        self.config_dirs = config_dirs
 
     def do_main_setup(self, vars, makeflags, extra):
         super(Gencontrol, self).do_main_setup(vars, makeflags, extra)
@@ -23,11 +27,20 @@
         packages.extend(self.process_packages(self.templates["control.support"], self.vars))
 
     def do_arch_setup(self, vars, makeflags, arch, extra):
+        config_base = self.config.get(('base', arch), {})
         vars.update(self.config.get(('image', arch), {}))
+        config_libc_dev = self.config.get(('libc-dev', arch), {})
+        arch = config_libc_dev.get('arch', None)
+        if arch is None:
+            arch = config_base.get('kernel-arch')
+        makeflags['LIBC_DEV_ARCH'] = arch
 
     def do_arch_packages(self, packages, makefile, arch, vars, makeflags, extra):
         headers_arch = self.templates["control.headers.arch"]
         packages_headers_arch = self.process_packages(headers_arch, vars)
+
+        libc_dev = self.templates["control.libc-dev"]
+        packages_headers_arch[0:0] = self.process_packages(libc_dev, {})
         
         extra['headers_arch_depends'] = packages_headers_arch[-1]['Depends'] = PackageRelation()
 
@@ -40,17 +53,13 @@
                 package['Architecture'] = [arch]
                 packages.append(package)
 
-        cmds_binary_arch = []
-        cmds_binary_arch.append(("$(MAKE) -f debian/rules.real binary-arch-arch %s" % makeflags))
-        cmds_source = []
-        cmds_source.append(("$(MAKE) -f debian/rules.real source-arch %s" % makeflags,))
-        makefile.append(("binary-arch-%s-real:" % arch, cmds_binary_arch))
-        makefile.append(("build-%s-real:" % arch))
-        makefile.append(("setup-%s-real:" % arch))
-        makefile.append(("source-%s-real:" % arch, cmds_source))
+        cmds_binary_arch = ["$(MAKE) -f debian/rules.real binary-arch-arch %s" % makeflags]
+        cmds_source = ["$(MAKE) -f debian/rules.real source-arch %s" % makeflags]
+        makefile.add('binary-arch_%s_real' % arch, cmds = cmds_binary_arch)
+        makefile.add('source_%s_real' % arch, cmds = cmds_source)
 
-    def do_subarch_setup(self, vars, makeflags, arch, subarch, extra):
-        vars.update(self.config.get(('image', arch, subarch), {}))
+    def do_featureset_setup(self, vars, makeflags, arch, featureset, extra):
+        vars.update(self.config.get(('image', arch, featureset), {}))
         vars['localversion_headers'] = vars['localversion']
         for i in (
             ('kernel-header-dirs', 'KERNEL_HEADER_DIRS'),
@@ -59,9 +68,9 @@
             if vars.has_key(i[0]):
                 makeflags[i[1]] = vars[i[0]]
 
-    def do_subarch_packages(self, packages, makefile, arch, subarch, vars, makeflags, extra):
-        headers_subarch = self.templates["control.headers.subarch"]
-        package_headers = self.process_package(headers_subarch[0], vars)
+    def do_featureset_packages(self, packages, makefile, arch, featureset, vars, makeflags, extra):
+        headers_featureset = self.templates["control.headers.featureset"]
+        package_headers = self.process_package(headers_featureset[0], vars)
 
         name = package_headers['Package']
         if packages.has_key(name):
@@ -71,21 +80,16 @@
             package_headers['Architecture'] = [arch]
             packages.append(package_headers)
 
-        cmds_binary_arch = []
-        cmds_binary_arch.append(("$(MAKE) -f debian/rules.real binary-arch-subarch %s" % makeflags,))
-        cmds_source = []
-        cmds_source.append(("$(MAKE) -f debian/rules.real source-subarch %s" % makeflags,))
-        makefile.append(("binary-arch-%s-%s-real:" % (arch, subarch), cmds_binary_arch))
-        makefile.append("build-%s-%s-real:" % (arch, subarch))
-        makefile.append(("setup-%s-%s-real:" % (arch, subarch)))
-        makefile.append(("source-%s-%s-real:" % (arch, subarch), cmds_source))
+        cmds_binary_arch = ["$(MAKE) -f debian/rules.real binary-arch-featureset %s" % makeflags]
+        cmds_source = ["$(MAKE) -f debian/rules.real source-featureset %s" % makeflags]
+        makefile.add('binary-arch_%s_%s_real' % (arch, featureset), cmds = cmds_binary_arch)
+        makefile.add('source_%s_%s_real' % (arch, featureset), cmds = cmds_source)
 
-    def do_flavour_setup(self, vars, makeflags, arch, subarch, flavour, extra):
-        vars.update(self.config.get(('image', arch, subarch, flavour), {}))
+    def do_flavour_setup(self, vars, makeflags, arch, featureset, flavour, extra):
+        vars.update(self.config.get(('image', arch, featureset, flavour), {}))
         for i in (
             ('cflags', 'CFLAGS'),
             ('compiler', 'COMPILER'),
-            ('image-postproc', 'IMAGE_POSTPROC'),
             ('initramfs', 'INITRAMFS',),
             ('kernel-arch', 'KERNEL_ARCH'),
             ('kernel-header-dirs', 'KERNEL_HEADER_DIRS'),
@@ -98,11 +102,11 @@
             if vars.has_key(i[0]):
                 makeflags[i[1]] = vars[i[0]]
 
-    def do_flavour_packages(self, packages, makefile, arch, subarch, flavour, vars, makeflags, extra):
+    def do_flavour_packages(self, packages, makefile, arch, featureset, flavour, vars, makeflags, extra):
         headers = self.templates["control.headers"]
 
-        config_entry_base = self.config.merge('base', arch, subarch, flavour)
-        config_entry_relations = self.config.merge('relations', arch, subarch, flavour)
+        config_entry_base = self.config.merge('base', arch, featureset, flavour)
+        config_entry_relations = self.config.merge('relations', arch, featureset, flavour)
 
         compiler = config_entry_base.get('compiler', 'gcc')
         relations_compiler = PackageRelation(config_entry_relations[compiler])
@@ -118,7 +122,7 @@
         }
         if vars.get('initramfs', True):
             generators = vars['initramfs-generators']
-            config_entry_commands_initramfs = self.config.merge('commands-image-initramfs-generators', arch, subarch, flavour)
+            config_entry_commands_initramfs = self.config.merge('commands-image-initramfs-generators', arch, featureset, flavour)
             commands = [config_entry_commands_initramfs[i] for i in generators if config_entry_commands_initramfs.has_key(i)]
             makeflags['INITRD_CMD'] = ' '.join(commands)
             l_depends = PackageRelationGroup()
@@ -140,14 +144,15 @@
         elif vars['type'] == 'plain-xen':
             image = self.templates["control.image.type-modulesextra"]
             build_modules = True
-            config_entry_xen = self.config.merge('xen', arch, subarch, flavour)
-            p = self.process_packages(self.templates['control.xen-linux-system'], vars)
-            l = package_relation_group()
-            for version in config_entry_xen['versions']:
-                l.append("xen-hypervisor-%s-%s" % (version, config_entry_xen['flavour']))
-            makeflags['XEN_VERSIONS'] = ' '.join(['%s-%s' % (i, config_entry_xen['flavour']) for i in config_entry_xen['versions']])
-            p[0]['Depends'].append(l)
-            packages_dummy.extend(p)
+            config_entry_xen = self.config.merge('xen', arch, featureset, flavour)
+            if config_entry_xen.get('dom0-support', True):
+                p = self.process_packages(self.templates['control.xen-linux-system'], vars)
+                l = PackageRelationGroup()
+                for version in config_entry_xen['versions']:
+                    l.append("xen-hypervisor-%s-%s" % (version, config_entry_xen['flavour']))
+                makeflags['XEN_VERSIONS'] = ' '.join(['%s-%s' % (i, config_entry_xen['flavour']) for i in config_entry_xen['versions']])
+                p[0]['Depends'].append(l)
+                packages_dummy.extend(p)
         else:
             build_modules = True
             image = self.templates["control.image.type-%s" % vars['type']]
@@ -180,37 +185,57 @@
                 j = self.substitute(self.templates["image.xen.%s" % i], vars)
                 file("debian/%s.%s" % (packages_own[0]['Package'], i), 'w').write(j)
 
-        def get_config(default, *entry_name):
+        def get_config(*entry_name):
             entry_real = ('image',) + entry_name
             entry = self.config.get(entry_real, None)
             if entry is None:
-                return default
-            configs = entry.get('configs', None)
+                return None
+            return entry.get('configs', None)
+
+        def check_config_default(fail, f):
+            for d in self.config_dirs[::-1]:
+                f1 = d + '/' + f
+                if os.path.exists(f1):
+                    return [f1]
+            if fail:
+                raise RuntimeError("%s unavailable" % f)
+            return []
+
+        def check_config_files(files):
+            ret = []
+            for f in files:
+                for d in self.config_dirs[::-1]:
+                    f1 = d + '/' + f
+                    if os.path.exists(f1):
+                        ret.append(f1)
+                        break
+                else:
+                    raise RuntimeError("%s unavailable" % f)
+            return ret
+
+        def check_config(default, fail, *entry_name):
+            configs = get_config(*entry_name)
             if configs is None:
-                return default
-            return configs
+                return check_config_default(fail, default)
+            return check_config_files(configs)
 
-        kconfig = ['config']
-        kconfig.extend(get_config(["%s/config" % arch], arch))
-        if subarch == 'none':
-            kconfig.extend(get_config(["%s/config.%s" % (arch, flavour)], arch, subarch, flavour))
-        else:
-            kconfig.extend(get_config(["%s/%s/config" % (arch, subarch)], arch, subarch))
-            kconfig.extend(get_config(["%s/%s/config.%s" % (arch, subarch, flavour)], arch, subarch, flavour))
+        kconfig = check_config('config', True)
+        kconfig.extend(check_config("%s/config" % arch, True, arch))
+        kconfig.extend(check_config("%s/config.%s" % (arch, flavour), False, arch, None, flavour))
+        kconfig.extend(check_config("featureset-%s/config" % featureset, False, None, featureset))
+        kconfig.extend(check_config("%s/%s/config" % (arch, featureset), False, arch, featureset))
+        kconfig.extend(check_config("%s/%s/config.%s" % (arch, featureset, flavour), False, arch, featureset, flavour))
         makeflags['KCONFIG'] = ' '.join(kconfig)
 
         cmds_binary_arch = []
-        cmds_binary_arch.append(("$(MAKE) -f debian/rules.real binary-arch-flavour %s" % makeflags,))
+        cmds_binary_arch.append("$(MAKE) -f debian/rules.real binary-arch-flavour %s" % makeflags)
         if packages_dummy:
-            cmds_binary_arch.append(("$(MAKE) -f debian/rules.real install-dummy DH_OPTIONS='%s' %s" % (' '.join(["-p%s" % i['Package'] for i in packages_dummy]), makeflags),))
-        cmds_build = []
-        cmds_build.append(("$(MAKE) -f debian/rules.real build %s" % makeflags,))
-        cmds_setup = []
-        cmds_setup.append(("$(MAKE) -f debian/rules.real setup-flavour %s" % makeflags,))
-        makefile.append(("binary-arch-%s-%s-%s-real:" % (arch, subarch, flavour), cmds_binary_arch))
-        makefile.append(("build-%s-%s-%s-real:" % (arch, subarch, flavour), cmds_build))
-        makefile.append(("setup-%s-%s-%s-real:" % (arch, subarch, flavour), cmds_setup))
-        makefile.append(("source-%s-%s-%s-real:" % (arch, subarch, flavour)))
+            cmds_binary_arch.append("$(MAKE) -f debian/rules.real install-dummy DH_OPTIONS='%s' %s" % (' '.join(["-p%s" % i['Package'] for i in packages_dummy]), makeflags))
+        cmds_build = ["$(MAKE) -f debian/rules.real build %s" % makeflags]
+        cmds_setup = ["$(MAKE) -f debian/rules.real setup-flavour %s" % makeflags]
+        makefile.add('binary-arch_%s_%s_%s_real' % (arch, featureset, flavour), cmds = cmds_binary_arch)
+        makefile.add('build_%s_%s_%s_real' % (arch, featureset, flavour), cmds = cmds_build)
+        makefile.add('setup_%s_%s_%s_real' % (arch, featureset, flavour), cmds = cmds_setup)
 
     def do_extra(self, packages, makefile):
         apply = self.templates['patch.apply']
@@ -244,6 +269,7 @@
         else:
             self.abiname = '-%s' % self.config['abi',]['abiname']
         self.vars = self.process_version_linux(self.version, self.abiname)
+        self.config['version',] = {'source': self.version.complete, 'abiname': self.abiname}
 
     def process_real_image(self, in_entry, relations, config, vars):
         entry = self.process_package(in_entry, vars)
@@ -272,5 +298,14 @@
             entry[i] = value
         return entry
 
+    def write(self, packages, makefile):
+        self.write_config()
+        super(Gencontrol, self).write(packages, makefile)
+
+    def write_config(self):
+        f = file("debian/config.defines.dump", 'w')
+        self.config.dump(f)
+        f.close()
+
 if __name__ == '__main__':
     Gencontrol()()

Modified: dists/sid/linux-2.6/debian/bin/genorig.py
==============================================================================
--- dists/sid/linux-2.6/debian/bin/genorig.py	(original)
+++ dists/sid/linux-2.6/debian/bin/genorig.py	Mon Nov 26 20:06:56 2007
@@ -4,32 +4,44 @@
 sys.path.append("debian/lib/python")
 
 import os, os.path, re, shutil
-from debian_linux.debian import Changelog
+from debian_linux.debian import Changelog, VersionLinux
+from debian_linux.patches import PatchSeries
 
-class main(object):
-    def __init__(self, input_tar, input_patch = None):
+class Main(object):
+    def __init__(self, input_tar, input_patch, override_version):
         self.log = sys.stdout.write
 
         self.input_tar = input_tar
         self.input_patch = input_patch
 
-        changelog = Changelog()[0]
+        changelog = Changelog(version = VersionLinux)[0]
         source = changelog.source
-        version = changelog.version.upstream
-        self.orig = '%s-%s' % (source, version)
-        self.orig_tar = '%s_%s.orig.tar.gz' % (source, version)
+        version = changelog.version
+
+        if override_version:
+            version = VersionLinux('%s-undef' % override_version)
+
+        self.version_dfsg = version.linux_dfsg
+        if self.version_dfsg is None:
+            self.version_dfsg = '0'
+
+        self.log('Using source name %s, version %s, dfsg %s\n' % (source, version.upstream, self.version_dfsg))
+
+        self.orig = '%s-%s' % (source, version.upstream)
+        self.orig_tar = '%s_%s.orig.tar.gz' % (source, version.upstream)
 
     def __call__(self):
         import tempfile
         self.dir = tempfile.mkdtemp(prefix = 'genorig', dir = 'debian')
         try:
-            self.extract()
-            self.patch()
+            self.upstream_extract()
+            self.upstream_patch()
+            self.debian_patch()
             self.tar()
         finally:
             shutil.rmtree(self.dir)
 
-    def extract(self):
+    def upstream_extract(self):
         self.log("Extracting tarball %s\n" % self.input_tar)
         match = re.match(r'(^|.*/)(?P<dir>linux-\d+\.\d+\.\d+(-\S+)?)\.tar(\.(?P<extension>(bz2|gz)))?$', self.input_tar)
         if not match:
@@ -43,7 +55,7 @@
             raise RuntimeError("Can't extract tarball")
         os.rename(os.path.join(self.dir, match.group('dir')), os.path.join(self.dir, self.orig))
 
-    def patch(self):
+    def upstream_patch(self):
         if self.input_patch is None:
             return
         self.log("Patching source with %s\n" % self.input_patch)
@@ -62,6 +74,13 @@
         if os.spawnv(os.P_WAIT, '/bin/sh', ['sh', '-c', ' '.join(cmdline)]):
             raise RuntimeError("Can't patch source")
 
+    def debian_patch(self):
+        name = "orig-" + self.version_dfsg
+        self.log("Patching source with debian patch (series %s)\n" % name)
+        fp = file("debian/patches/series/" + name)
+        series = PatchSeries(name, "debian/patches", fp)
+        series(dir = os.path.join(self.dir, self.orig))
+
     def tar(self):
         out = os.path.join("../orig", self.orig_tar)
         try:
@@ -73,9 +92,26 @@
         except OSError: pass
         self.log("Generate tarball %s\n" % out)
         cmdline = ['tar -czf', out, '-C', self.dir, self.orig]
-        if os.spawnv(os.P_WAIT, '/bin/sh', ['sh', '-c', ' '.join(cmdline)]):
-            raise RuntimeError("Can't patch source")
-        os.chmod(out, 0644)
+        try:
+            if os.spawnv(os.P_WAIT, '/bin/sh', ['sh', '-c', ' '.join(cmdline)]):
+                raise RuntimeError("Can't patch source")
+            os.chmod(out, 0644)
+        except:
+            try:
+                os.unlink(out)
+            except OSError:
+                pass
+            raise
 
 if __name__ == '__main__':
-    main(*sys.argv[1:])()
+    from optparse import OptionParser
+    parser = OptionParser(usage = "%prog [OPTION]... TAR [PATCH]")
+    parser.add_option("-V", "--override-version", dest = "override_version", help = "Override version", metavar = "VERSION")
+    options, args = parser.parse_args()
+
+    input_tar = args[0]
+    input_patch = None
+    if len(args) > 1:
+        input_patch = args[1]
+
+    Main(input_tar, input_patch, options.override_version)()

Modified: dists/sid/linux-2.6/debian/bin/kconfig.py
==============================================================================
--- dists/sid/linux-2.6/debian/bin/kconfig.py	(original)
+++ dists/sid/linux-2.6/debian/bin/kconfig.py	Mon Nov 26 20:06:56 2007
@@ -1,11 +1,9 @@
-#!/usr/bin/env python2.4
+#!/usr/bin/env python
 
 import optparse, os.path, sys
 from debian_linux.kconfig import *
 
 def merge(output, *config):
-    config = [os.path.join('debian/arch', c) for c in config]
-
     kconfig = KconfigFile()
     for c in config:
         kconfig.read(file(c))

Modified: dists/sid/linux-2.6/debian/changelog
==============================================================================
--- dists/sid/linux-2.6/debian/changelog	(original)
+++ dists/sid/linux-2.6/debian/changelog	Mon Nov 26 20:06:56 2007
@@ -1,3 +1,247 @@
+linux-2.6 (2.6.23-1~experimental.1) UNRELEASED; urgency=low
+
+  * New upstream release (closes: #447682).
+
+  [ maximilian attems ]
+  * [ppc] Enable for powerpc config the ams (Apple Motion Sensor).
+    (closes: #426210)
+  * Add to linux-doc the missing toplevel text files.
+    (closes: #360876, #438697)
+  * Set CONFIG_BLK_DEV_IO_TRACE for blktrace(8) support. (closes: #418442)
+  * ipw2200: Enable IPW2200_RADIOTAP and IPW2200_PROMISCUOUS for optional
+    rtap interface. (closes: #432555)
+  * Enable in topconfig NF_CT_PROTO_UDPLITE, NETFILTER_XT_TARGET_TRACE,
+    NETFILTER_XT_MATCH_CONNLIMIT, NETFILTER_XT_MATCH_U32, SENSORS_ABITUGURU3,
+    SENSORS_LM93, SENSORS_DME1737, SENSORS_THMC50, DVB_USB_AF9005,
+    DVB_USB_AF9005_REMOTE, CRC7, I2C_TAOS_EVM, DS1682, SENSORS_TSL2550,
+    SPI_LM70_LLP, SPI_TLE62X0, W1_SLAVE_DS2760, TUNER_TEA5761, NET_9P,
+    DM_MULTIPATH_RDAC, NET_SCH_RR, EEPROM_93CX6, PPPOL2TP, CRYPTO_HW, UIO,
+    UIO_CIF, SND_CS5530, RTL8187, PC300TOO, TCG_TIS, SCSI_SAS_ATA.
+  * [i386] Enable lguest.
+  * [amd64, i386] Enable VIDEO_OUTPUT_CONTROL, NETDEVICES_MULTIQUEUE.
+  * linux-image bugscript add cmdline.
+  * [amd64, i386, ia64]: Enable DMIID, ACPI_PROC_EVENT.
+  * Enable TCG_TPM various userspace accesses it. (closes: #439020)
+  * Add and enable IWLWIFI.
+  * Add git-ieee1394.patch for latest firewire fixes.
+  * [ipv6] Enable IPV6_MULTIPLE_TABLES, IPV6_SUBTREES. (closes: #441226)
+  * Add and enable E1000E.
+  * Add stable release 2.6.23.1:
+    - libata: sata_mv: more S/G fixes
+
+  [ Martin Michlmayr ]
+  * [mips] Add a bcm1480 PCI build fix.
+  * Update Riku Voipio's Fintek F75375/SP driver to the latest version.
+  * [arm/iop32x] Set the fan on Thecus N2100 to full speed (Riku Voipio).
+  * [arm/iop32x] Remove the IPv6 and filesystem info from the config file
+    so we will get the values from the main config file.  This should
+    enable NFSv4 and ip6tables support requested by Wouter Verhelst.
+  * [arm/iop32x] Remove even more options to receive the default options.
+  * [arm/ixp4xx] Remove a lot of options to receive the default options.
+  * [mips/r4k-ip22] Remove a lot of options to receive the default options.
+    This will enable ISCSI requested by Martin Zobel-Helas.
+  * [mips/r5k-ip32] Remove a lot of options to receive the default options.
+    This will enable PCI Ethernet devices requested by Giuseppe Sacco.
+  * [mipsel/r5k-cobalt] Remove a lot of options to receive the default
+    options.
+  * [mipsel/r5k-cobalt] Enable the modern Cobalt LEDs driver.
+  * [arm/iop32x] Enable Intel IOP ADMA support.
+  * [arm] Mark BCM43XX as broken on ARM.
+  * [mips/r4k-ip22] Disable EARLY PRINTK because it breaks serial console.
+  * [mips] Add some IP22 fixes from Thomas Bogendoerfer:
+    - Fix broken EISA interrupt setup by switching to generic i8259
+    - Fix broken eeprom access by using __raw_readl/__raw_writel
+
+  [ Bastian Blank ]
+  * Add unpriviledged only Xen support.
+  * [i386] Drop k7 images.
+  * Drop maybe IETF document. (closes: #423040)
+  * Drop drivers because of binary only firmwares:
+    - DABUSB driver
+    - COPS LocalTalk PC support
+    - Digi Intl. RightSwitch SE-X support
+    - 3Com 3C359 Token Link Velocity XL adapter support
+    - SMC ISA/MCA adapter support
+    - EMI 6|2m USB Audio interface support
+    - EMI 2|6 USB Audio interface support
+    - Computone IntelliPort Plus serial support
+  * Remove binary only firmwares for:
+    - Alteon AceNIC/3Com 3C985/NetGear GA620 Gigabit support
+    - Broadcom Tigon3 support
+    - USB Keyspan USA-xxx Serial Driver
+    - Korg 1212 IO
+    - ESS Allegro/Maestro3
+    - Yamaha YMF724/740/744/754
+    - Technotrend/Hauppauge Nova-USB devices
+    - YAM driver for AX.25
+    - MyriCOM Gigabit Ethernet support
+    - PTI Qlogic, ISP Driver
+    - Cirrus Logic (Sound Fusion) CS4280/CS461x/CS462x/CS463x
+    - Madge Ambassador (Collage PCI 155 Server)
+    - PCA-200E support
+    - SBA-200E support
+    - Broadcom NetXtremeII support
+  * Disable now broken drivers:
+    - Alteon AceNIC/3Com 3C985/NetGear GA620 Gigabit support
+    - USB Keyspan USA-xxx Serial Driver
+    - Technotrend/Hauppauge Nova-USB devices
+    - YAM driver for AX.25
+    - MyriCOM Gigabit Ethernet support
+    - PTI Qlogic, ISP Driver
+    - Cirrus Logic (Sound Fusion) CS4280/CS461x/CS462x/CS463x
+    - Madge Ambassador (Collage PCI 155 Server)
+    - PCA-200E support
+    - SBA-200E support
+    - Broadcom NetXtremeII support
+  * Add -common to common header package names.
+  * Drop provides from common header packages.
+  * Update plain image type.
+  * Put only a config dump into linux-support.
+
+  [ Aurelien Jarno ]
+  * [mips, mipsel] Add a 64-bit image (5kc-malta) for the MIPS Malta board.
+    (closes: #435677)
+    [sparc] Enable r8169 module on sparc64 and sparc64-smp flavours (closes:
+    #431977)
+
+  [ Frederik Schüler ]
+  * Move all PATA options into the global config file, exept PATA_ARTOP
+    (arm/ixp4xx) and PATA_MPC52xx (powerpc).
+  * Move new global options into the global config file
+  * Clean up new amd64 options
+
+  [ dann frazier ]
+  * [ia64] Re-enable various unintentionally disabled config options
+  * Enable hugetlbfs on i386, amd64, sparc64 and powerpc64. Closes: #450939
+
+  [ Bastian Blank ]
+  * Add stable release 2.6.23.2:
+    - BLOCK: Fix bad sharing of tag busy list on queues with shared tag maps
+    - fix tmpfs BUG and AOP_WRITEPAGE_ACTIVATE
+    - Fix compat futex hangs.
+    - sched: keep utime/stime monotonic
+    - fix the softlockup watchdog to actually work
+    - splice: fix double kunmap() in vmsplice copy path
+    - writeback: don't propagate AOP_WRITEPAGE_ACTIVATE
+    - SLUB: Fix memory leak by not reusing cpu_slab
+    - HOWTO: update ja_JP/HOWTO with latest changes
+    - fix param_sysfs_builtin name length check
+    - param_sysfs_builtin memchr argument fix
+    - Remove broken ptrace() special-case code from file mapping
+    - locks: fix possible infinite loop in posix deadlock detection
+    - lockdep: fix mismatched lockdep_depth/curr_chain_hash
+  * Add stable release 2.6.23.3:
+    - revert "x86_64: allocate sparsemem memmap above 4G"
+    - x86: fix TSC clock source calibration error
+    - x86 setup: sizeof() is unsigned, unbreak comparisons
+    - x86 setup: handle boot loaders which set up the stack incorrectly
+    - x86: fix global_flush_tlb() bug
+    - xfs: eagerly remove vmap mappings to avoid upsetting Xen
+    - xen: fix incorrect vcpu_register_vcpu_info hypercall argument
+    - xen: deal with stale cr3 values when unpinning pagetables
+    - xen: add batch completion callbacks
+    - UML - kill subprocesses on exit
+    - UML - stop using libc asm/user.h
+    - UML - Fix kernel vs libc symbols clash
+    - UML - Stop using libc asm/page.h
+    - POWERPC: Make sure to of_node_get() the result of pci_device_to_OF_node()
+    - POWERPC: Fix handling of stfiwx math emulation
+    - MIPS: R1: Fix hazard barriers to make kernels work on R2 also.
+    - MIPS: MT: Fix bug in multithreaded kernels.
+    - Fix sparc64 MAP_FIXED handling of framebuffer mmaps
+    - Fix sparc64 niagara optimized RAID xor asm
+  * Add stable release 2.6.23.4:
+    - mac80211: make ieee802_11_parse_elems return void
+    - mac80211: only honor IW_SCAN_THIS_ESSID in STA, IBSS, and AP modes
+    - mac80211: honor IW_SCAN_THIS_ESSID in siwscan ioctl
+    - mac80211: store SSID in sta_bss_list
+    - mac80211: store channel info in sta_bss_list
+    - mac80211: reorder association debug output
+    - ieee80211: fix TKIP QoS bug
+    - NETFILTER: nf_conntrack_tcp: fix connection reopening
+    - Fix netlink timeouts.
+    - Fix crypto_alloc_comp() error checking.
+    - Fix SET_VLAN_INGRESS_PRIORITY_CMD error return.
+    - Fix VLAN address syncing.
+    - Fix endianness bug in U32 classifier.
+    - Fix TEQL oops.
+    - Fix error returns in sys_socketpair()
+    - softmac: fix wext MLME request reason code endianness
+    - Fix kernel_accept() return handling.
+    - TCP: Fix size calculation in sk_stream_alloc_pskb
+    - Fix SKB_WITH_OVERHEAD calculations.
+    - Fix 9P protocol build
+    - Fix advertised packet scheduler timer resolution
+    - Add get_unaligned to ieee80211_get_radiotap_len
+    - mac80211: Improve sanity checks on injected packets
+    - mac80211: filter locally-originated multicast frames
+  * Add stable release 2.6.23.5:
+    - zd1211rw, fix oops when ejecting install media
+    - rtl8187: Fix more frag bit checking, rts duration calc
+    - ipw2100: send WEXT scan events
+    - zd1201: avoid null ptr access of skb->dev
+    - sky2: fix power settings on Yukon XL
+    - sky2: ethtool register reserved area blackout
+    - sky2: status ring race fix
+    - skge: XM PHY handling fixes
+    - Fix L2TP oopses.
+    - TG3: Fix performance regression on 5705.
+    - forcedeth: add MCP77 device IDs
+    - forcedeth msi bugfix
+    - ehea: 64K page kernel support fix
+    - libertas: fix endianness breakage
+    - libertas: more endianness breakage
+  * Add stable release 2.6.23.6:
+    - ACPI: suspend: Wrong order of GPE restore.
+    - ACPI: sleep: Fix GPE suspend cleanup
+    - libata: backport ATA_FLAG_NO_SRST and ATA_FLAG_ASSUME_ATA, part 2
+    - libata: backport ATA_FLAG_NO_SRST and ATA_FLAG_ASSUME_ATA
+    - libata: add HTS542525K9SA00 to NCQ blacklist
+    - radeon: set the address to access the GART table on the CPU side correctly
+    - Char: moxa, fix and optimise empty timer
+    - Char: rocket, fix dynamic_dev tty
+    - hptiop: avoid buffer overflow when returning sense data
+    - ide: Fix cs5535 driver accessing beyond array boundary
+    - ide: Fix siimage driver accessing beyond array boundary
+    - ide: Add ide_get_paired_drive() helper
+    - ide: fix serverworks.c UDMA regression
+    - i4l: fix random freezes with AVM B1 drivers
+    - i4l: Fix random hard freeze with AVM c4 card
+    - ALSA: hda-codec - Add array terminator for dmic in STAC codec
+    - USB: usbserial - fix potential deadlock between write() and IRQ
+    - USB: add URB_FREE_BUFFER to permissible flags
+    - USB: mutual exclusion for EHCI init and port resets
+    - usb-gadget-ether: prevent oops caused by error interrupt race
+    - USB: remove USB_QUIRK_NO_AUTOSUSPEND
+    - MSI: Use correct data offset for 32-bit MSI in read_msi_msg()
+    - md: raid5: fix clearing of biofill operations
+    - md: fix an unsigned compare to allow creation of bitmaps with v1.0 metadata
+    - dm: fix thaw_bdev
+    - dm delay: fix status
+    - libata: sync NCQ blacklist with upstream
+    - ALSA: hdsp - Fix zero division
+    - ALSA: emu10k1 - Fix memory corruption
+    - ALSA: Fix build error without CONFIG_HAS_DMA
+    - ALSA: fix selector unit bug affecting some USB speakerphones
+    - ALSA: hda-codec - Avoid zero NID in line_out_pins[] of STAC codecs
+    - IB/mthca: Use mmiowb() to avoid firmware commands getting jumbled up
+    - IB/uverbs: Fix checking of userspace object ownership
+    - hwmon/lm87: Disable VID when it should be
+    - hwmon/lm87: Fix a division by zero
+    - hwmon/w83627hf: Don't assume bank 0
+    - hwmon/w83627hf: Fix setting fan min right after driver load
+    - i915: fix vbl swap allocation size.
+    - POWERPC: Fix platinumfb framebuffer
+  * Add stable release 2.6.23.7:
+    - NFS: Fix a writeback race...
+    - ocfs2: fix write() performance regression
+    - minixfs: limit minixfs printks on corrupted dir i_size (CVE-2006-6058)
+  * Add stable release 2.6.23.8:
+    - wait_task_stopped: Check p->exit_state instead of TASK_TRACED (CVE-2007-5500)
+    - TCP: Make sure write_queue_from does not begin with NULL ptr (CVE-2007-5501)
+
+ -- maximilian attems <maks at debian.org>  Sun, 25 Nov 2007 15:48:01 +0100
+
 linux-2.6 (2.6.22-6) unstable; urgency=low
 
   [ Martin Michlmayr ]
@@ -380,7 +624,9 @@
     Lichtenheld <djpig at debian.org> for build fix.
 
   [ Christian T. Steigies ]
-  * add module.lds to kernel headers
+  * Add module.lds to kernel headers
+  * Enable INPUT_UINPUT on mac
+  * Add 2.6.22 patches from linux-m68k CVS
 
   [ dann frazier ]
   * Enable vserver flavour for ia64 (closes: #423232)

Added: dists/sid/linux-2.6/debian/config/alpha/config
==============================================================================
--- (empty file)
+++ dists/sid/linux-2.6/debian/config/alpha/config	Mon Nov 26 20:06:56 2007
@@ -0,0 +1,1365 @@
+CONFIG_ALPHA=y
+CONFIG_64BIT=y
+CONFIG_RWSEM_XCHGADD_ALGORITHM=y
+CONFIG_GENERIC_ISA_DMA=y
+# CONFIG_GENERIC_IOMAP is not set
+# CONFIG_IKCONFIG is not set
+# CONFIG_KALLSYMS_ALL is not set
+CONFIG_ALPHA_GENERIC=y
+# CONFIG_ALPHA_ALCOR is not set
+# CONFIG_ALPHA_XL is not set
+# CONFIG_ALPHA_BOOK1 is not set
+# CONFIG_ALPHA_AVANTI_CH is not set
+# CONFIG_ALPHA_CABRIOLET is not set
+# CONFIG_ALPHA_DP264 is not set
+# CONFIG_ALPHA_EB164 is not set
+# CONFIG_ALPHA_EB64P_CH is not set
+# CONFIG_ALPHA_EB66 is not set
+# CONFIG_ALPHA_EB66P is not set
+# CONFIG_ALPHA_EIGER is not set
+# CONFIG_ALPHA_JENSEN is not set
+# CONFIG_ALPHA_LX164 is not set
+# CONFIG_ALPHA_LYNX is not set
+# CONFIG_ALPHA_MARVEL is not set
+# CONFIG_ALPHA_MIATA is not set
+# CONFIG_ALPHA_MIKASA is not set
+# CONFIG_ALPHA_NAUTILUS is not set
+# CONFIG_ALPHA_NONAME_CH is not set
+# CONFIG_ALPHA_NORITAKE is not set
+# CONFIG_ALPHA_PC164 is not set
+# CONFIG_ALPHA_P2K is not set
+# CONFIG_ALPHA_RAWHIDE is not set
+# CONFIG_ALPHA_RUFFIAN is not set
+# CONFIG_ALPHA_RX164 is not set
+# CONFIG_ALPHA_SX164 is not set
+# CONFIG_ALPHA_SABLE is not set
+# CONFIG_ALPHA_SHARK is not set
+# CONFIG_ALPHA_TAKARA is not set
+# CONFIG_ALPHA_TITAN is not set
+# CONFIG_ALPHA_WILDFIRE is not set
+CONFIG_ISA=y
+CONFIG_ISA_DMA_API=y
+CONFIG_PCI=y
+CONFIG_PCI_DOMAINS=y
+CONFIG_ALPHA_CORE_AGP=y
+CONFIG_ALPHA_BROKEN_IRQ_MASK=y
+CONFIG_EISA=y
+# CONFIG_DISCONTIGMEM is not set
+# CONFIG_VERBOSE_MCHECK is not set
+# CONFIG_PCI_DEBUG is not set
+CONFIG_EISA_PCI_EISA=y
+CONFIG_EISA_VIRTUAL_ROOT=y
+CONFIG_EISA_NAMES=y
+CONFIG_PCCARD=m
+CONFIG_PCMCIA_DEBUG=y
+CONFIG_PCMCIA=m
+CONFIG_CARDBUS=y
+CONFIG_YENTA=m
+CONFIG_PD6729=m
+CONFIG_I82092=m
+CONFIG_I82365=m
+CONFIG_TCIC=m
+CONFIG_PCCARD_NONSTATIC=m
+CONFIG_SRM_ENV=m
+CONFIG_BINFMT_AOUT=m
+CONFIG_OSF4_COMPAT=y
+CONFIG_BINFMT_EM86=m
+CONFIG_STANDALONE=y
+# CONFIG_DEBUG_DRIVER is not set
+CONFIG_MTD=m
+# CONFIG_MTD_DEBUG is not set
+CONFIG_MTD_CONCAT=m
+CONFIG_MTD_PARTITIONS=y
+CONFIG_MTD_REDBOOT_PARTS=m
+CONFIG_MTD_REDBOOT_DIRECTORY_BLOCK=-1
+CONFIG_MTD_REDBOOT_PARTS_UNALLOCATED=y
+CONFIG_MTD_REDBOOT_PARTS_READONLY=y
+CONFIG_MTD_CMDLINE_PARTS=y
+CONFIG_MTD_CHAR=m
+CONFIG_MTD_BLOCK=m
+CONFIG_MTD_BLOCK_RO=m
+CONFIG_FTL=m
+CONFIG_NFTL=m
+CONFIG_NFTL_RW=y
+CONFIG_INFTL=m
+CONFIG_MTD_CFI=m
+CONFIG_MTD_JEDECPROBE=m
+CONFIG_MTD_GEN_PROBE=m
+CONFIG_MTD_CFI_ADV_OPTIONS=y
+# CONFIG_MTD_CFI_NOSWAP is not set
+CONFIG_MTD_CFI_BE_BYTE_SWAP=y
+# CONFIG_MTD_CFI_LE_BYTE_SWAP is not set
+CONFIG_MTD_CFI_GEOMETRY=y
+CONFIG_MTD_MAP_BANK_WIDTH_1=y
+CONFIG_MTD_MAP_BANK_WIDTH_2=y
+CONFIG_MTD_MAP_BANK_WIDTH_4=y
+CONFIG_MTD_MAP_BANK_WIDTH_8=y
+CONFIG_MTD_MAP_BANK_WIDTH_16=y
+CONFIG_MTD_MAP_BANK_WIDTH_32=y
+CONFIG_MTD_CFI_I1=y
+CONFIG_MTD_CFI_I2=y
+CONFIG_MTD_CFI_I4=y
+CONFIG_MTD_CFI_I8=y
+CONFIG_MTD_CFI_INTELEXT=m
+CONFIG_MTD_CFI_AMDSTD=m
+CONFIG_MTD_CFI_AMDSTD_RETRY=0
+CONFIG_MTD_CFI_STAA=m
+CONFIG_MTD_CFI_UTIL=m
+CONFIG_MTD_RAM=m
+CONFIG_MTD_ROM=m
+CONFIG_MTD_ABSENT=m
+CONFIG_MTD_COMPLEX_MAPPINGS=y
+CONFIG_MTD_PHYSMAP=m
+CONFIG_MTD_PHYSMAP_START=0x8000000
+CONFIG_MTD_PHYSMAP_LEN=0x4000000
+CONFIG_MTD_PHYSMAP_BANKWIDTH=2
+CONFIG_MTD_PCI=m
+CONFIG_MTD_PMC551=m
+# CONFIG_MTD_PMC551_BUGFIX is not set
+# CONFIG_MTD_PMC551_DEBUG is not set
+CONFIG_MTD_SLRAM=m
+CONFIG_MTD_PHRAM=m
+CONFIG_MTD_MTDRAM=m
+CONFIG_MTDRAM_TOTAL_SIZE=4096
+CONFIG_MTDRAM_ERASE_SIZE=128
+CONFIG_MTD_BLKMTD=m
+CONFIG_MTD_BLOCK2MTD=m
+CONFIG_MTD_DOC2000=m
+CONFIG_MTD_DOC2001=m
+CONFIG_MTD_DOC2001PLUS=m
+CONFIG_MTD_DOCPROBE=m
+CONFIG_MTD_DOCECC=m
+CONFIG_MTD_DOCPROBE_ADVANCED=y
+CONFIG_MTD_DOCPROBE_ADDRESS=0x0000
+CONFIG_MTD_DOCPROBE_HIGH=y
+CONFIG_MTD_DOCPROBE_55AA=y
+CONFIG_MTD_NAND=m
+# CONFIG_MTD_NAND_VERIFY_WRITE is not set
+CONFIG_MTD_NAND_IDS=m
+# CONFIG_MTD_NAND_DISKONCHIP is not set
+CONFIG_MTD_NAND_NANDSIM=y
+CONFIG_PNP=y
+# CONFIG_PNP_DEBUG is not set
+CONFIG_ISAPNP=y
+CONFIG_BLK_DEV_FD=m
+CONFIG_BLK_DEV_XD=m
+CONFIG_PARIDE=m
+CONFIG_PARIDE_PD=m
+CONFIG_PARIDE_PCD=m
+CONFIG_PARIDE_PF=m
+CONFIG_PARIDE_PT=m
+CONFIG_PARIDE_PG=m
+CONFIG_PARIDE_ATEN=m
+CONFIG_PARIDE_BPCK=m
+CONFIG_PARIDE_COMM=m
+CONFIG_PARIDE_DSTR=m
+CONFIG_PARIDE_FIT2=m
+CONFIG_PARIDE_FIT3=m
+CONFIG_PARIDE_EPAT=m
+CONFIG_PARIDE_EPATC8=y
+CONFIG_PARIDE_EPIA=m
+CONFIG_PARIDE_FRIQ=m
+CONFIG_PARIDE_FRPW=m
+CONFIG_PARIDE_KBIC=m
+CONFIG_PARIDE_KTTI=m
+CONFIG_PARIDE_ON20=m
+CONFIG_PARIDE_ON26=m
+CONFIG_BLK_CPQ_DA=m
+CONFIG_BLK_CPQ_CISS_DA=m
+CONFIG_CISS_SCSI_TAPE=y
+CONFIG_BLK_DEV_DAC960=m
+CONFIG_BLK_DEV_UMEM=m
+CONFIG_BLK_DEV_LOOP=m
+CONFIG_BLK_DEV_CRYPTOLOOP=m
+CONFIG_BLK_DEV_NBD=m
+CONFIG_BLK_DEV_SX8=m
+# CONFIG_BLK_DEV_UB is not set
+CONFIG_BLK_DEV_RAM_SIZE=8192
+CONFIG_BLK_DEV_INITRD=y
+CONFIG_CDROM_PKTCDVD=m
+CONFIG_CDROM_PKTCDVD_BUFFERS=8
+CONFIG_CDROM_PKTCDVD_WCACHE=y
+CONFIG_ATA_OVER_ETH=m
+CONFIG_IDE=m
+CONFIG_IDE_MAX_HWIFS=4
+CONFIG_BLK_DEV_IDE=m
+# CONFIG_BLK_DEV_IDE_SATA is not set
+CONFIG_BLK_DEV_IDEDISK=m
+# CONFIG_IDEDISK_MULTI_MODE is not set
+CONFIG_BLK_DEV_IDECS=m
+CONFIG_BLK_DEV_IDECD=m
+CONFIG_BLK_DEV_IDETAPE=m
+CONFIG_BLK_DEV_IDEFLOPPY=m
+CONFIG_IDE_GENERIC=m
+CONFIG_BLK_DEV_IDEPCI=y
+CONFIG_IDEPCI_SHARE_IRQ=y
+# CONFIG_BLK_DEV_OFFBOARD is not set
+CONFIG_BLK_DEV_GENERIC=m
+CONFIG_BLK_DEV_OPTI621=m
+CONFIG_BLK_DEV_IDEDMA_PCI=y
+# CONFIG_BLK_DEV_IDEDMA_FORCED is not set
+# CONFIG_IDEDMA_ONLYDISK is not set
+CONFIG_BLK_DEV_AEC62XX=m
+CONFIG_BLK_DEV_ALI15X3=m
+# CONFIG_WDC_ALI15X3 is not set
+CONFIG_BLK_DEV_AMD74XX=m
+CONFIG_BLK_DEV_CMD64X=m
+CONFIG_BLK_DEV_TRIFLEX=m
+CONFIG_BLK_DEV_CY82C693=m
+CONFIG_BLK_DEV_CS5520=m
+CONFIG_BLK_DEV_CS5530=m
+CONFIG_BLK_DEV_HPT34X=m
+CONFIG_HPT34X_AUTODMA=y
+CONFIG_BLK_DEV_HPT366=m
+CONFIG_BLK_DEV_SC1200=m
+CONFIG_BLK_DEV_PIIX=m
+CONFIG_BLK_DEV_NS87415=m
+CONFIG_BLK_DEV_PDC202XX_OLD=m
+CONFIG_PDC202XX_BURST=y
+CONFIG_BLK_DEV_PDC202XX_NEW=m
+CONFIG_BLK_DEV_SVWKS=m
+CONFIG_BLK_DEV_SIIMAGE=m
+CONFIG_BLK_DEV_SLC90E66=m
+CONFIG_BLK_DEV_TRM290=m
+CONFIG_BLK_DEV_VIA82CXXX=m
+# CONFIG_IDE_ARM is not set
+CONFIG_IDE_CHIPSETS=y
+CONFIG_BLK_DEV_4DRIVES=y
+CONFIG_BLK_DEV_ALI14XX=m
+CONFIG_BLK_DEV_DTC2278=m
+CONFIG_BLK_DEV_HT6560B=m
+CONFIG_BLK_DEV_QD65XX=m
+CONFIG_BLK_DEV_UMC8672=m
+CONFIG_BLK_DEV_IDEDMA=y
+# CONFIG_IDEDMA_IVB is not set
+# CONFIG_BLK_DEV_HD is not set
+CONFIG_AIC7XXX_CMDS_PER_DEVICE=8
+CONFIG_SCSI_IN2000=m
+CONFIG_SCSI_ARCMSR=m
+CONFIG_MEGARAID_NEWGEN=y
+CONFIG_MEGARAID_MM=m
+CONFIG_MEGARAID_MAILBOX=m
+CONFIG_MEGARAID_LEGACY=m
+CONFIG_SCSI_BUSLOGIC=m
+CONFIG_SCSI_OMIT_FLASHPOINT=y
+CONFIG_SCSI_DMX3191D=m
+CONFIG_SCSI_DTC3280=m
+CONFIG_SCSI_EATA=m
+CONFIG_SCSI_EATA_TAGGED_QUEUE=y
+CONFIG_SCSI_EATA_LINKED_COMMANDS=y
+CONFIG_SCSI_EATA_MAX_TAGS=16
+CONFIG_SCSI_FUTURE_DOMAIN=m
+CONFIG_SCSI_GDTH=m
+CONFIG_SCSI_GENERIC_NCR5380=m
+CONFIG_SCSI_GENERIC_NCR5380_MMIO=m
+CONFIG_SCSI_GENERIC_NCR53C400=y
+CONFIG_SCSI_IPS=m
+CONFIG_SCSI_INITIO=m
+CONFIG_SCSI_INIA100=m
+CONFIG_SCSI_PPA=m
+CONFIG_SCSI_IMM=m
+CONFIG_SCSI_IZIP_EPP16=y
+CONFIG_SCSI_IZIP_SLOW_CTR=y
+CONFIG_SCSI_NCR53C406A=m
+CONFIG_SCSI_SYM53C8XX_2=m
+CONFIG_SCSI_SYM53C8XX_DMA_ADDRESSING_MODE=1
+CONFIG_SCSI_SYM53C8XX_DEFAULT_TAGS=16
+CONFIG_SCSI_SYM53C8XX_MAX_TAGS=64
+CONFIG_SCSI_IPR=m
+CONFIG_SCSI_IPR_TRACE=y
+CONFIG_SCSI_IPR_DUMP=y
+CONFIG_SCSI_PAS16=m
+CONFIG_SCSI_PSI240I=m
+CONFIG_SCSI_QLOGIC_FAS=m
+CONFIG_SCSI_QLOGIC_FC=m
+CONFIG_SCSI_QLOGIC_FC_FIRMWARE=y
+CONFIG_SCSI_QLOGIC_1280=m
+CONFIG_SCSI_QLOGIC_1280_1040=y
+CONFIG_SCSI_LPFC=m
+CONFIG_SCSI_SIM710=m
+CONFIG_SCSI_SYM53C416=m
+CONFIG_SCSI_DC395x=m
+CONFIG_SCSI_DC390T=m
+CONFIG_SCSI_T128=m
+CONFIG_SCSI_U14_34F=m
+CONFIG_SCSI_U14_34F_TAGGED_QUEUE=y
+CONFIG_SCSI_U14_34F_LINKED_COMMANDS=y
+CONFIG_SCSI_U14_34F_MAX_TAGS=8
+CONFIG_SCSI_DEBUG=m
+CONFIG_PCMCIA_FDOMAIN=m
+CONFIG_PCMCIA_QLOGIC=m
+CONFIG_PCMCIA_SYM53C500=m
+CONFIG_I2O=m
+CONFIG_I2O_CONFIG=m
+CONFIG_I2O_BLOCK=m
+CONFIG_I2O_SCSI=m
+CONFIG_I2O_PROC=m
+# CONFIG_IP_PNP is not set
+# CONFIG_IP_TCPDIAG is not set
+# CONFIG_IP_TCPDIAG_IPV6 is not set
+CONFIG_BRIDGE_NETFILTER=y
+CONFIG_DECNET_NF_GRABULATOR=m
+CONFIG_BRIDGE_NF_EBTABLES=m
+CONFIG_BRIDGE_EBT_BROUTE=m
+CONFIG_BRIDGE_EBT_T_FILTER=m
+CONFIG_BRIDGE_EBT_T_NAT=m
+CONFIG_BRIDGE_EBT_802_3=m
+CONFIG_BRIDGE_EBT_AMONG=m
+CONFIG_BRIDGE_EBT_ARP=m
+CONFIG_BRIDGE_EBT_IP=m
+CONFIG_BRIDGE_EBT_LIMIT=m
+CONFIG_BRIDGE_EBT_MARK=m
+CONFIG_BRIDGE_EBT_PKTTYPE=m
+CONFIG_BRIDGE_EBT_STP=m
+CONFIG_BRIDGE_EBT_VLAN=m
+CONFIG_BRIDGE_EBT_ARPREPLY=m
+CONFIG_BRIDGE_EBT_DNAT=m
+CONFIG_BRIDGE_EBT_MARK_T=m
+CONFIG_BRIDGE_EBT_REDIRECT=m
+CONFIG_BRIDGE_EBT_SNAT=m
+CONFIG_BRIDGE_EBT_LOG=m
+CONFIG_BRIDGE_EBT_ULOG=m
+CONFIG_IP_SCTP=m
+# CONFIG_SCTP_DBG_MSG is not set
+# CONFIG_SCTP_DBG_OBJCNT is not set
+# CONFIG_SCTP_HMAC_NONE is not set
+CONFIG_ATM=y
+CONFIG_ATM_CLIP=y
+# CONFIG_ATM_CLIP_NO_ICMP is not set
+CONFIG_ATM_LANE=m
+CONFIG_ATM_MPOA=m
+CONFIG_ATM_BR2684=m
+# CONFIG_ATM_BR2684_IPFILTER is not set
+CONFIG_BRIDGE=m
+CONFIG_DECNET=m
+# CONFIG_DECNET_ROUTER is not set
+CONFIG_LLC=y
+CONFIG_LLC2=m
+CONFIG_IPX=m
+# CONFIG_IPX_INTERN is not set
+CONFIG_ATALK=m
+CONFIG_DEV_APPLETALK=y
+CONFIG_LTPC=m
+CONFIG_IPDDP=m
+CONFIG_IPDDP_ENCAP=y
+CONFIG_IPDDP_DECAP=y
+CONFIG_X25=m
+CONFIG_LAPB=m
+CONFIG_ECONET=m
+CONFIG_ECONET_AUNUDP=y
+CONFIG_ECONET_NATIVE=y
+CONFIG_WAN_ROUTER=m
+CONFIG_NETPOLL=y
+CONFIG_NETPOLL_TRAP=y
+CONFIG_NET_POLL_CONTROLLER=y
+CONFIG_HAMRADIO=y
+CONFIG_AX25=m
+# CONFIG_AX25_DAMA_SLAVE is not set
+CONFIG_NETROM=m
+CONFIG_ROSE=m
+CONFIG_BPQETHER=m
+CONFIG_SCC=m
+# CONFIG_SCC_DELAY is not set
+# CONFIG_SCC_TRXECHO is not set
+CONFIG_BAYCOM_SER_FDX=m
+CONFIG_BAYCOM_SER_HDX=m
+CONFIG_BAYCOM_PAR=m
+CONFIG_YAM=m
+CONFIG_IRDA=m
+CONFIG_IRLAN=m
+CONFIG_IRNET=m
+CONFIG_IRCOMM=m
+CONFIG_IRDA_ULTRA=y
+CONFIG_IRDA_CACHE_LAST_LSAP=y
+CONFIG_IRDA_FAST_RR=y
+# CONFIG_IRDA_DEBUG is not set
+CONFIG_IRTTY_SIR=m
+CONFIG_DONGLE=y
+CONFIG_ESI_DONGLE=m
+CONFIG_ACTISYS_DONGLE=m
+CONFIG_TEKRAM_DONGLE=m
+CONFIG_LITELINK_DONGLE=m
+CONFIG_MA600_DONGLE=m
+CONFIG_GIRBIL_DONGLE=m
+CONFIG_MCP2120_DONGLE=m
+CONFIG_OLD_BELKIN_DONGLE=m
+CONFIG_ACT200L_DONGLE=m
+CONFIG_USB_IRDA=m
+CONFIG_SIGMATEL_FIR=m
+CONFIG_NSC_FIR=m
+CONFIG_WINBOND_FIR=m
+CONFIG_SMC_IRCC_FIR=m
+CONFIG_ALI_FIR=m
+CONFIG_VLSI_FIR=m
+CONFIG_VIA_FIR=m
+CONFIG_BT=m
+CONFIG_BT_L2CAP=m
+CONFIG_BT_SCO=m
+CONFIG_BT_RFCOMM=m
+CONFIG_BT_RFCOMM_TTY=y
+CONFIG_BT_BNEP=m
+CONFIG_BT_BNEP_MC_FILTER=y
+CONFIG_BT_BNEP_PROTO_FILTER=y
+CONFIG_BT_CMTP=m
+CONFIG_BT_HIDP=m
+CONFIG_BT_HCIUSB=m
+CONFIG_BT_HCIUSB_SCO=y
+CONFIG_BT_HCIUART=m
+CONFIG_BT_HCIUART_H4=y
+CONFIG_BT_HCIUART_BCSP=y
+CONFIG_BT_HCIBCM203X=m
+CONFIG_BT_HCIBPA10X=m
+CONFIG_BT_HCIBFUSB=m
+CONFIG_BT_HCIDTL1=m
+CONFIG_BT_HCIBT3C=m
+CONFIG_BT_HCIBLUECARD=m
+CONFIG_BT_HCIBTUART=m
+CONFIG_BT_HCIVHCI=m
+CONFIG_DUMMY=m
+CONFIG_NET_SB1000=m
+CONFIG_ARCNET=m
+CONFIG_ARCNET_1201=m
+CONFIG_ARCNET_1051=m
+CONFIG_ARCNET_RAW=m
+CONFIG_ARCNET_CAP=m
+CONFIG_ARCNET_COM90xx=m
+CONFIG_ARCNET_COM90xxIO=m
+CONFIG_ARCNET_RIM_I=m
+CONFIG_ARCNET_COM20020=m
+CONFIG_ARCNET_COM20020_ISA=m
+CONFIG_ARCNET_COM20020_PCI=m
+CONFIG_HAPPYMEAL=m
+CONFIG_SUNGEM=m
+CONFIG_NET_VENDOR_3COM=y
+CONFIG_EL1=m
+CONFIG_EL2=m
+CONFIG_ELPLUS=m
+CONFIG_EL16=m
+CONFIG_EL3=m
+CONFIG_3C515=m
+CONFIG_VORTEX=m
+CONFIG_TYPHOON=m
+CONFIG_LANCE=m
+CONFIG_NET_VENDOR_SMC=y
+CONFIG_WD80x3=m
+CONFIG_ULTRA=m
+CONFIG_ULTRA32=m
+CONFIG_SMC9194=m
+CONFIG_NET_VENDOR_RACAL=y
+CONFIG_NI52=m
+CONFIG_NI65=m
+CONFIG_NET_TULIP=y
+CONFIG_DE2104X=m
+CONFIG_TULIP=m
+# CONFIG_TULIP_MWI is not set
+# CONFIG_TULIP_MMIO is not set
+CONFIG_DE4X5=m
+CONFIG_WINBOND_840=m
+CONFIG_DM9102=m
+CONFIG_PCMCIA_XIRCOM=m
+CONFIG_AT1700=m
+CONFIG_DEPCA=m
+CONFIG_HP100=m
+CONFIG_NET_ISA=y
+CONFIG_E2100=m
+CONFIG_EWRK3=m
+CONFIG_EEXPRESS=m
+CONFIG_EEXPRESS_PRO=m
+CONFIG_HPLAN_PLUS=m
+CONFIG_HPLAN=m
+CONFIG_LP486E=m
+CONFIG_ETH16I=m
+CONFIG_NE2000=m
+CONFIG_ZNET=m
+CONFIG_SEEQ8005=m
+CONFIG_NET_PCI=y
+CONFIG_PCNET32=m
+CONFIG_AMD8111_ETH=m
+CONFIG_ADAPTEC_STARFIRE=m
+CONFIG_AC3200=m
+CONFIG_APRICOT=m
+CONFIG_B44=m
+CONFIG_FORCEDETH=m
+CONFIG_CS89x0=m
+CONFIG_EEPRO100=m
+CONFIG_E100=m
+CONFIG_LNE390=m
+CONFIG_FEALNX=m
+CONFIG_NATSEMI=m
+CONFIG_NE2K_PCI=m
+CONFIG_NE3210=m
+CONFIG_ES3210=m
+CONFIG_8139CP=m
+CONFIG_8139TOO=m
+# CONFIG_8139TOO_PIO is not set
+CONFIG_8139TOO_TUNE_TWISTER=y
+CONFIG_8139TOO_8129=y
+# CONFIG_8139_OLD_RX_RESET is not set
+CONFIG_SIS900=m
+CONFIG_EPIC100=m
+CONFIG_SUNDANCE=m
+# CONFIG_SUNDANCE_MMIO is not set
+CONFIG_VIA_RHINE=m
+# CONFIG_VIA_RHINE_MMIO is not set
+CONFIG_DE600=m
+CONFIG_DE620=m
+CONFIG_DL2K=m
+CONFIG_E1000=m
+CONFIG_NS83820=m
+CONFIG_HAMACHI=m
+CONFIG_YELLOWFIN=m
+CONFIG_R8169=m
+CONFIG_R8169_VLAN=y
+CONFIG_VIA_VELOCITY=m
+CONFIG_TIGON3=m
+CONFIG_BNX2=m
+CONFIG_IXGB=m
+CONFIG_S2IO=m
+CONFIG_WLAN_PRE80211=y
+CONFIG_STRIP=m
+CONFIG_WAVELAN=m
+CONFIG_PCMCIA_WAVELAN=m
+CONFIG_PCMCIA_NETWAVE=m
+CONFIG_WLAN_80211=y
+CONFIG_PCMCIA_RAYCS=m
+CONFIG_HERMES=m
+CONFIG_PLX_HERMES=m
+CONFIG_TMD_HERMES=m
+CONFIG_PCI_HERMES=m
+CONFIG_ATMEL=m
+CONFIG_PCI_ATMEL=m
+CONFIG_PCMCIA_HERMES=m
+CONFIG_AIRO_CS=m
+CONFIG_PCMCIA_ATMEL=m
+CONFIG_PCMCIA_WL3501=m
+CONFIG_PRISM54=m
+CONFIG_NET_PCMCIA=y
+CONFIG_PCMCIA_3C589=m
+CONFIG_PCMCIA_3C574=m
+CONFIG_PCMCIA_FMVJ18X=m
+CONFIG_PCMCIA_PCNET=m
+CONFIG_PCMCIA_NMCLAN=m
+CONFIG_PCMCIA_SMC91C92=m
+CONFIG_PCMCIA_XIRC2PS=m
+CONFIG_PCMCIA_AXNET=m
+CONFIG_ARCNET_COM20020_CS=m
+CONFIG_WAN=y
+CONFIG_HOSTESS_SV11=m
+CONFIG_COSA=m
+CONFIG_DSCC4=m
+CONFIG_DSCC4_PCISYNC=y
+CONFIG_DSCC4_PCI_RST=y
+CONFIG_LANMEDIA=m
+CONFIG_SEALEVEL_4021=m
+CONFIG_PCI200SYN=m
+CONFIG_WANXL=m
+CONFIG_PC300=m
+CONFIG_PC300_MLPPP=y
+CONFIG_N2=m
+CONFIG_C101=m
+CONFIG_FARSYNC=m
+CONFIG_DLCI=m
+CONFIG_DLCI_MAX=8
+CONFIG_SDLA=m
+CONFIG_CYCLADES_SYNC=m
+CONFIG_CYCLOMX_X25=y
+CONFIG_LAPBETHER=m
+CONFIG_X25_ASY=m
+CONFIG_ATM_DRIVERS=y
+CONFIG_ATM_TCP=m
+CONFIG_ATM_LANAI=m
+CONFIG_ATM_ENI=m
+# CONFIG_ATM_ENI_DEBUG is not set
+# CONFIG_ATM_ENI_TUNE_BURST is not set
+CONFIG_ATM_FIRESTREAM=m
+CONFIG_ATM_ZATM=m
+# CONFIG_ATM_ZATM_DEBUG is not set
+CONFIG_ATM_IDT77252=m
+# CONFIG_ATM_IDT77252_DEBUG is not set
+# CONFIG_ATM_IDT77252_RCV_ALL is not set
+CONFIG_ATM_IDT77252_USE_SUNI=y
+CONFIG_ATM_AMBASSADOR=m
+# CONFIG_ATM_AMBASSADOR_DEBUG is not set
+CONFIG_ATM_HORIZON=m
+# CONFIG_ATM_HORIZON_DEBUG is not set
+CONFIG_ATM_FORE200E_MAYBE=m
+CONFIG_ATM_FORE200E_PCA=y
+CONFIG_ATM_FORE200E_PCA_DEFAULT_FW=y
+# CONFIG_ATM_FORE200E_USE_TASKLET is not set
+CONFIG_ATM_FORE200E_TX_RETRY=16
+CONFIG_ATM_FORE200E_DEBUG=0
+CONFIG_ATM_FORE200E=m
+CONFIG_ATM_HE=m
+CONFIG_ATM_HE_USE_SUNI=y
+CONFIG_FDDI=y
+CONFIG_DEFXX=m
+CONFIG_SKFP=m
+CONFIG_HIPPI=y
+CONFIG_ROADRUNNER=m
+# CONFIG_ROADRUNNER_LARGE_RINGS is not set
+CONFIG_PLIP=m
+CONFIG_PPP=m
+CONFIG_PPP_MULTILINK=y
+CONFIG_PPP_FILTER=y
+CONFIG_PPP_ASYNC=m
+CONFIG_PPP_SYNC_TTY=m
+CONFIG_PPP_DEFLATE=m
+CONFIG_PPP_BSDCOMP=m
+CONFIG_PPPOE=m
+CONFIG_PPPOATM=m
+CONFIG_SLIP=m
+CONFIG_SLIP_COMPRESSED=y
+CONFIG_SLIP_SMART=y
+# CONFIG_SLIP_MODE_SLIP6 is not set
+CONFIG_NET_FC=y
+CONFIG_SHAPER=m
+CONFIG_NETCONSOLE=m
+CONFIG_ISDN=m
+CONFIG_ISDN_I4L=m
+CONFIG_ISDN_PPP=y
+CONFIG_ISDN_PPP_VJ=y
+CONFIG_ISDN_MPP=y
+CONFIG_IPPP_FILTER=y
+CONFIG_ISDN_PPP_BSDCOMP=m
+CONFIG_ISDN_AUDIO=y
+CONFIG_ISDN_TTY_FAX=y
+CONFIG_ISDN_X25=y
+CONFIG_ISDN_DIVERSION=m
+CONFIG_ISDN_DRV_HISAX=m
+CONFIG_HISAX_EURO=y
+CONFIG_DE_AOC=y
+# CONFIG_HISAX_NO_SENDCOMPLETE is not set
+# CONFIG_HISAX_NO_LLC is not set
+# CONFIG_HISAX_NO_KEYPAD is not set
+CONFIG_HISAX_1TR6=y
+CONFIG_HISAX_NI1=y
+CONFIG_HISAX_MAX_CARDS=8
+CONFIG_HISAX_16_0=y
+CONFIG_HISAX_16_3=y
+CONFIG_HISAX_TELESPCI=y
+CONFIG_HISAX_S0BOX=y
+CONFIG_HISAX_AVM_A1=y
+CONFIG_HISAX_FRITZPCI=y
+CONFIG_HISAX_AVM_A1_PCMCIA=y
+CONFIG_HISAX_ELSA=y
+CONFIG_HISAX_IX1MICROR2=y
+CONFIG_HISAX_DIEHLDIVA=y
+CONFIG_HISAX_ASUSCOM=y
+CONFIG_HISAX_TELEINT=y
+CONFIG_HISAX_HFCS=y
+CONFIG_HISAX_SEDLBAUER=y
+CONFIG_HISAX_SPORTSTER=y
+CONFIG_HISAX_MIC=y
+CONFIG_HISAX_NETJET=y
+CONFIG_HISAX_NETJET_U=y
+CONFIG_HISAX_NICCY=y
+CONFIG_HISAX_ISURF=y
+CONFIG_HISAX_HSTSAPHIR=y
+CONFIG_HISAX_BKM_A4T=y
+CONFIG_HISAX_SCT_QUADRO=y
+CONFIG_HISAX_GAZEL=y
+CONFIG_HISAX_HFC_PCI=y
+CONFIG_HISAX_W6692=y
+CONFIG_HISAX_HFC_SX=y
+CONFIG_HISAX_ENTERNOW_PCI=y
+# CONFIG_HISAX_DEBUG is not set
+CONFIG_HISAX_SEDLBAUER_CS=m
+CONFIG_HISAX_ELSA_CS=m
+CONFIG_HISAX_AVM_A1_CS=m
+CONFIG_HISAX_TELES_CS=m
+CONFIG_HISAX_ST5481=m
+CONFIG_HISAX_HFCUSB=m
+CONFIG_HISAX_HFC4S8S=m
+CONFIG_HISAX_FRITZ_PCIPNP=m
+CONFIG_HISAX_HDLC=y
+CONFIG_ISDN_DRV_ICN=m
+CONFIG_ISDN_DRV_PCBIT=m
+CONFIG_ISDN_DRV_SC=m
+CONFIG_ISDN_DRV_ACT2000=m
+CONFIG_ISDN_CAPI=m
+CONFIG_ISDN_DRV_AVMB1_VERBOSE_REASON=y
+CONFIG_ISDN_CAPI_MIDDLEWARE=y
+CONFIG_ISDN_CAPI_CAPI20=m
+CONFIG_ISDN_CAPI_CAPIFS_BOOL=y
+CONFIG_ISDN_CAPI_CAPIFS=m
+CONFIG_ISDN_CAPI_CAPIDRV=m
+CONFIG_CAPI_AVM=y
+CONFIG_ISDN_DRV_AVMB1_B1ISA=m
+CONFIG_ISDN_DRV_AVMB1_B1PCI=m
+CONFIG_ISDN_DRV_AVMB1_B1PCIV4=y
+CONFIG_ISDN_DRV_AVMB1_T1ISA=m
+CONFIG_ISDN_DRV_AVMB1_B1PCMCIA=m
+CONFIG_ISDN_DRV_AVMB1_AVM_CS=m
+CONFIG_ISDN_DRV_AVMB1_T1PCI=m
+CONFIG_ISDN_DRV_AVMB1_C4=m
+CONFIG_CAPI_EICON=y
+CONFIG_ISDN_DIVAS=m
+CONFIG_ISDN_DIVAS_BRIPCI=y
+CONFIG_ISDN_DIVAS_PRIPCI=y
+CONFIG_ISDN_DIVAS_DIVACAPI=m
+CONFIG_ISDN_DIVAS_USERIDI=m
+CONFIG_ISDN_DIVAS_MAINT=m
+CONFIG_PHONE=m
+CONFIG_PHONE_IXJ=m
+CONFIG_PHONE_IXJ_PCMCIA=m
+CONFIG_INPUT=y
+CONFIG_INPUT_MOUSEDEV=y
+CONFIG_INPUT_MOUSEDEV_PSAUX=y
+CONFIG_INPUT_MOUSEDEV_SCREEN_X=1024
+CONFIG_INPUT_MOUSEDEV_SCREEN_Y=768
+CONFIG_INPUT_JOYDEV=m
+CONFIG_INPUT_TSDEV=m
+CONFIG_INPUT_TSDEV_SCREEN_X=240
+CONFIG_INPUT_TSDEV_SCREEN_Y=320
+CONFIG_INPUT_EVDEV=m
+CONFIG_INPUT_KEYBOARD=y
+CONFIG_KEYBOARD_ATKBD=y
+CONFIG_KEYBOARD_SUNKBD=m
+CONFIG_KEYBOARD_LKKBD=m
+CONFIG_KEYBOARD_XTKBD=m
+CONFIG_KEYBOARD_NEWTON=m
+CONFIG_INPUT_MOUSE=y
+CONFIG_MOUSE_PS2=m
+CONFIG_MOUSE_SERIAL=m
+CONFIG_MOUSE_INPORT=m
+# CONFIG_MOUSE_ATIXL is not set
+CONFIG_MOUSE_LOGIBM=m
+CONFIG_MOUSE_PC110PAD=m
+CONFIG_MOUSE_VSXXXAA=m
+CONFIG_INPUT_JOYSTICK=y
+CONFIG_JOYSTICK_ANALOG=m
+CONFIG_JOYSTICK_A3D=m
+CONFIG_JOYSTICK_ADI=m
+CONFIG_JOYSTICK_COBRA=m
+CONFIG_JOYSTICK_GF2K=m
+CONFIG_JOYSTICK_GRIP=m
+CONFIG_JOYSTICK_GRIP_MP=m
+CONFIG_JOYSTICK_GUILLEMOT=m
+CONFIG_JOYSTICK_INTERACT=m
+CONFIG_JOYSTICK_SIDEWINDER=m
+CONFIG_JOYSTICK_TMDC=m
+CONFIG_JOYSTICK_IFORCE=m
+CONFIG_JOYSTICK_IFORCE_USB=y
+CONFIG_JOYSTICK_IFORCE_232=y
+CONFIG_JOYSTICK_WARRIOR=m
+CONFIG_JOYSTICK_MAGELLAN=m
+CONFIG_JOYSTICK_SPACEORB=m
+CONFIG_JOYSTICK_SPACEBALL=m
+CONFIG_JOYSTICK_STINGER=m
+CONFIG_JOYSTICK_TWIDJOY=m
+CONFIG_JOYSTICK_DB9=m
+CONFIG_JOYSTICK_GAMECON=m
+CONFIG_JOYSTICK_TURBOGRAFX=m
+CONFIG_JOYSTICK_JOYDUMP=m
+CONFIG_JOYSTICK_XPAD=m
+CONFIG_INPUT_TABLET=y
+CONFIG_TABLET_USB_ACECAD=m
+CONFIG_TABLET_USB_AIPTEK=m
+CONFIG_TABLET_USB_GTCO=m
+CONFIG_TABLET_USB_KBTAB=m
+CONFIG_TABLET_USB_WACOM=m
+CONFIG_INPUT_TOUCHSCREEN=y
+CONFIG_TOUCHSCREEN_GUNZE=m
+CONFIG_TOUCHSCREEN_ELO=m
+CONFIG_TOUCHSCREEN_MTOUCH=m
+CONFIG_TOUCHSCREEN_MK712=m
+CONFIG_TOUCHSCREEN_USB_COMPOSITE=m
+CONFIG_INPUT_MISC=y
+CONFIG_INPUT_PCSPKR=m
+CONFIG_INPUT_UINPUT=m
+CONFIG_SERIO=y
+CONFIG_SERIO_I8042=y
+CONFIG_SERIO_SERPORT=m
+CONFIG_SERIO_PARKBD=m
+CONFIG_SERIO_PCIPS2=m
+CONFIG_SERIO_LIBPS2=y
+CONFIG_SERIO_RAW=m
+CONFIG_GAMEPORT=m
+CONFIG_GAMEPORT_NS558=m
+CONFIG_GAMEPORT_L4=m
+CONFIG_GAMEPORT_EMU10K1=m
+CONFIG_GAMEPORT_FM801=m
+CONFIG_VT=y
+CONFIG_VT_CONSOLE=y
+CONFIG_HW_CONSOLE=y
+# CONFIG_SERIAL_NONSTANDARD is not set
+CONFIG_ROCKETPORT=m
+CONFIG_CYCLADES=m
+# CONFIG_CYZ_INTR is not set
+CONFIG_MOXA_SMARTIO=m
+CONFIG_ISI=m
+CONFIG_SYNCLINK=m
+CONFIG_SYNCLINKMP=m
+CONFIG_N_HDLC=m
+CONFIG_SPECIALIX=m
+# CONFIG_SPECIALIX_RTSCTS is not set
+CONFIG_SX=m
+CONFIG_STALDRV=y
+CONFIG_SERIAL_8250=y
+CONFIG_SERIAL_8250_CONSOLE=y
+CONFIG_SERIAL_8250_CS=m
+CONFIG_SERIAL_8250_NR_UARTS=16
+CONFIG_SERIAL_8250_EXTENDED=y
+CONFIG_SERIAL_8250_MANY_PORTS=y
+CONFIG_SERIAL_8250_SHARE_IRQ=y
+# CONFIG_SERIAL_8250_DETECT_IRQ is not set
+CONFIG_SERIAL_8250_MULTIPORT=y
+CONFIG_SERIAL_8250_RSA=y
+CONFIG_SERIAL_CORE=y
+CONFIG_SERIAL_CORE_CONSOLE=y
+CONFIG_SERIAL_JSM=m
+CONFIG_PRINTER=m
+# CONFIG_LP_CONSOLE is not set
+CONFIG_PPDEV=m
+CONFIG_TIPAR=m
+CONFIG_IPMI_HANDLER=m
+# CONFIG_IPMI_PANIC_EVENT is not set
+CONFIG_IPMI_DEVICE_INTERFACE=m
+CONFIG_IPMI_SI=m
+CONFIG_IPMI_WATCHDOG=m
+CONFIG_IPMI_POWEROFF=m
+CONFIG_WATCHDOG=y
+# CONFIG_WATCHDOG_NOWAYOUT is not set
+CONFIG_SOFT_WATCHDOG=m
+CONFIG_PCWATCHDOG=m
+CONFIG_MIXCOMWD=m
+CONFIG_WDT=m
+CONFIG_WDT_501=y
+CONFIG_PCIPCWATCHDOG=m
+CONFIG_WDTPCI=m
+CONFIG_WDT_501_PCI=y
+CONFIG_USBPCWATCHDOG=m
+CONFIG_RTC=m
+CONFIG_GEN_RTC=m
+CONFIG_GEN_RTC_X=y
+CONFIG_DTLK=m
+CONFIG_R3964=m
+CONFIG_APPLICOM=m
+CONFIG_AGP=m
+CONFIG_AGP_ALPHA_CORE=m
+CONFIG_AGP_SIS=m
+CONFIG_DRM=m
+CONFIG_DRM_TDFX=m
+CONFIG_DRM_R128=m
+CONFIG_DRM_RADEON=m
+CONFIG_DRM_MGA=m
+CONFIG_DRM_SIS=m
+CONFIG_SYNCLINK_CS=m
+CONFIG_RAW_DRIVER=m
+CONFIG_MAX_RAW_DEVS=256
+CONFIG_I2C=m
+CONFIG_I2C_CHARDEV=m
+CONFIG_I2C_ALGOBIT=m
+CONFIG_I2C_ALGOPCF=m
+CONFIG_I2C_ALGOPCA=m
+CONFIG_I2C_ALI1535=m
+CONFIG_I2C_ALI1563=m
+CONFIG_I2C_ALI15X3=m
+CONFIG_I2C_AMD756=m
+# CONFIG_I2C_AMD756_S4882 is not set
+CONFIG_I2C_AMD8111=m
+CONFIG_I2C_I801=m
+CONFIG_I2C_I810=m
+CONFIG_I2C_PIIX4=m
+CONFIG_I2C_NFORCE2=m
+CONFIG_I2C_PARPORT=m
+CONFIG_I2C_PARPORT_LIGHT=m
+CONFIG_I2C_PROSAVAGE=m
+CONFIG_I2C_SAVAGE4=m
+CONFIG_SCx200_ACB=m
+CONFIG_I2C_SIS5595=m
+CONFIG_I2C_SIS630=m
+CONFIG_I2C_SIS96X=m
+CONFIG_I2C_STUB=m
+CONFIG_I2C_VIA=m
+CONFIG_I2C_VIAPRO=m
+CONFIG_I2C_VOODOO3=m
+CONFIG_I2C_PCA_ISA=m
+CONFIG_SENSORS_ADM1021=m
+CONFIG_SENSORS_ADM1025=m
+CONFIG_SENSORS_ADM1026=m
+CONFIG_SENSORS_ADM1031=m
+CONFIG_SENSORS_ASB100=m
+CONFIG_SENSORS_DS1621=m
+CONFIG_SENSORS_FSCHER=m
+CONFIG_SENSORS_FSCPOS=m
+CONFIG_SENSORS_GL518SM=m
+CONFIG_SENSORS_GL520SM=m
+CONFIG_SENSORS_IT87=m
+CONFIG_SENSORS_LM63=m
+CONFIG_SENSORS_LM75=m
+CONFIG_SENSORS_LM77=m
+CONFIG_SENSORS_LM78=m
+CONFIG_SENSORS_LM80=m
+CONFIG_SENSORS_LM83=m
+CONFIG_SENSORS_LM85=m
+CONFIG_SENSORS_LM87=m
+CONFIG_SENSORS_LM90=m
+CONFIG_SENSORS_LM92=m
+CONFIG_SENSORS_MAX1619=m
+CONFIG_SENSORS_PC87360=m
+CONFIG_SENSORS_SMSC47B397=m
+CONFIG_SENSORS_SIS5595=m
+CONFIG_SENSORS_SMSC47M1=m
+CONFIG_SENSORS_VIA686A=m
+CONFIG_SENSORS_W83781D=m
+CONFIG_SENSORS_W83L785TS=m
+CONFIG_SENSORS_W83627HF=m
+CONFIG_SENSORS_DS1337=m
+CONFIG_SENSORS_EEPROM=m
+CONFIG_SENSORS_PCF8574=m
+CONFIG_SENSORS_PCF8591=m
+# CONFIG_I2C_DEBUG_CORE is not set
+# CONFIG_I2C_DEBUG_ALGO is not set
+# CONFIG_I2C_DEBUG_BUS is not set
+# CONFIG_I2C_DEBUG_CHIP is not set
+CONFIG_RADIO_CADET=m
+CONFIG_RADIO_RTRACK=m
+CONFIG_RADIO_RTRACK2=m
+CONFIG_RADIO_AZTECH=m
+CONFIG_RADIO_GEMTEK=m
+CONFIG_RADIO_GEMTEK_PCI=m
+CONFIG_RADIO_MAXIRADIO=m
+CONFIG_RADIO_MAESTRO=m
+CONFIG_RADIO_SF16FMI=m
+CONFIG_RADIO_SF16FMR2=m
+CONFIG_RADIO_TERRATEC=m
+CONFIG_RADIO_TRUST=m
+CONFIG_RADIO_TYPHOON=m
+CONFIG_RADIO_TYPHOON_PROC_FS=y
+CONFIG_RADIO_ZOLTRIX=m
+CONFIG_DVB_CORE=m
+CONFIG_VIDEO_SAA7146=m
+CONFIG_VIDEO_SAA7146_VV=m
+CONFIG_VIDEO_TUNER=m
+CONFIG_VIDEO_BUF=m
+CONFIG_VIDEO_BUF_DVB=m
+CONFIG_VIDEO_BTCX=m
+CONFIG_VIDEO_IR=m
+CONFIG_VIDEO_TVEEPROM=m
+CONFIG_FB=y
+CONFIG_FB_CFB_IMAGEBLIT=m
+# CONFIG_FB_MACMODES is not set
+CONFIG_FB_MODE_HELPERS=y
+CONFIG_FB_TILEBLITTING=y
+CONFIG_FB_CIRRUS=m
+CONFIG_FB_PM2=m
+CONFIG_FB_PM2_FIFO_DISCONNECT=y
+CONFIG_FB_CYBER2000=m
+# CONFIG_FB_ASILIANT is not set
+# CONFIG_FB_IMSTT is not set
+CONFIG_FB_TGA=m
+CONFIG_FB_NVIDIA=m
+# CONFIG_FB_NVIDIA_I2C is not set
+# CONFIG_FB_RIVA is not set
+# CONFIG_FB_RIVA_I2C is not set
+# CONFIG_FB_RIVA_DEBUG is not set
+CONFIG_FB_MATROX=m
+CONFIG_FB_MATROX_MILLENIUM=y
+CONFIG_FB_MATROX_MYSTIQUE=y
+CONFIG_FB_MATROX_G=y
+CONFIG_FB_MATROX_I2C=m
+CONFIG_FB_MATROX_MAVEN=m
+CONFIG_FB_MATROX_MULTIHEAD=y
+CONFIG_FB_RADEON=m
+CONFIG_FB_RADEON_I2C=y
+# CONFIG_FB_RADEON_DEBUG is not set
+CONFIG_FB_ATY128=m
+CONFIG_FB_ATY=m
+CONFIG_FB_ATY_CT=y
+# CONFIG_FB_ATY_GENERIC_LCD is not set
+CONFIG_FB_ATY_GX=y
+CONFIG_FB_SAVAGE=m
+# CONFIG_FB_SAVAGE_I2C is not set
+# CONFIG_FB_SAVAGE_ACCEL is not set
+CONFIG_FB_SIS=m
+CONFIG_FB_SIS_300=y
+CONFIG_FB_SIS_315=y
+CONFIG_FB_NEOMAGIC=m
+CONFIG_FB_KYRO=m
+CONFIG_FB_3DFX=m
+CONFIG_FB_3DFX_ACCEL=y
+CONFIG_FB_VOODOO1=m
+CONFIG_FB_TRIDENT=m
+CONFIG_FB_TRIDENT_ACCEL=y
+CONFIG_FB_S1D13XXX=m
+CONFIG_FB_VIRTUAL=m
+CONFIG_VGA_CONSOLE=y
+CONFIG_MDA_CONSOLE=m
+CONFIG_DUMMY_CONSOLE=y
+CONFIG_FRAMEBUFFER_CONSOLE=m
+# CONFIG_FONTS is not set
+CONFIG_FONT_8x8=y
+CONFIG_FONT_8x16=y
+# CONFIG_LOGO is not set
+CONFIG_BACKLIGHT_LCD_SUPPORT=y
+CONFIG_LCD_CLASS_DEVICE=m
+CONFIG_SOUND=m
+CONFIG_SND=m
+CONFIG_SND_TIMER=m
+CONFIG_SND_PCM=m
+CONFIG_SND_HWDEP=m
+CONFIG_SND_SEQUENCER=m
+CONFIG_SND_SEQ_DUMMY=m
+CONFIG_SND_OSSEMUL=y
+CONFIG_SND_MIXER_OSS=m
+CONFIG_SND_PCM_OSS=m
+CONFIG_SND_SEQUENCER_OSS=y
+CONFIG_SND_RTCTIMER=m
+# CONFIG_SND_VERBOSE_PRINTK is not set
+# CONFIG_SND_DEBUG is not set
+CONFIG_SND_GENERIC_PM=y
+CONFIG_SND_MPU401_UART=m
+CONFIG_SND_OPL3_LIB=m
+CONFIG_SND_OPL4_LIB=m
+CONFIG_SND_VX_LIB=m
+CONFIG_SND_DUMMY=m
+CONFIG_SND_VIRMIDI=m
+CONFIG_SND_MTPAV=m
+CONFIG_SND_SERIAL_U16550=m
+CONFIG_SND_MPU401=m
+CONFIG_SND_AD1848_LIB=m
+CONFIG_SND_CS4231_LIB=m
+CONFIG_SND_AD1816A=m
+CONFIG_SND_AD1848=m
+CONFIG_SND_CS4231=m
+CONFIG_SND_CS4232=m
+CONFIG_SND_CS4236=m
+CONFIG_SND_ES968=m
+CONFIG_SND_ES1688=m
+CONFIG_SND_ES18XX=m
+CONFIG_SND_GUS_SYNTH=m
+CONFIG_SND_GUSCLASSIC=m
+CONFIG_SND_GUSEXTREME=m
+CONFIG_SND_GUSMAX=m
+CONFIG_SND_INTERWAVE=m
+CONFIG_SND_INTERWAVE_STB=m
+CONFIG_SND_OPTI92X_AD1848=m
+CONFIG_SND_OPTI92X_CS4231=m
+CONFIG_SND_OPTI93X=m
+CONFIG_SND_SB8=m
+CONFIG_SND_SB16=m
+CONFIG_SND_SBAWE=m
+CONFIG_SND_SB16_CSP=y
+CONFIG_SND_WAVEFRONT=m
+CONFIG_SND_ALS100=m
+CONFIG_SND_AZT2320=m
+CONFIG_SND_CMI8330=m
+CONFIG_SND_DT019X=m
+CONFIG_SND_OPL3SA2=m
+CONFIG_SND_SGALAXY=m
+CONFIG_SND_SSCAPE=m
+CONFIG_SND_AC97_CODEC=m
+CONFIG_SND_ALI5451=m
+CONFIG_SND_ATIIXP=m
+CONFIG_SND_ATIIXP_MODEM=m
+CONFIG_SND_AU8810=m
+CONFIG_SND_AU8820=m
+CONFIG_SND_AU8830=m
+CONFIG_SND_AZT3328=m
+CONFIG_SND_BT87X=m
+# CONFIG_SND_BT87X_OVERCLOCK is not set
+CONFIG_SND_CS46XX=m
+CONFIG_SND_CS46XX_NEW_DSP=y
+CONFIG_SND_CS4281=m
+CONFIG_SND_EMU10K1=m
+CONFIG_SND_EMU10K1X=m
+CONFIG_SND_CA0106=m
+CONFIG_SND_KORG1212=m
+CONFIG_SND_MIXART=m
+CONFIG_SND_NM256=m
+CONFIG_SND_RME32=m
+CONFIG_SND_RME96=m
+CONFIG_SND_RME9652=m
+CONFIG_SND_HDSP=m
+CONFIG_SND_TRIDENT=m
+CONFIG_SND_YMFPCI=m
+CONFIG_SND_ALS4000=m
+CONFIG_SND_CMIPCI=m
+CONFIG_SND_ENS1370=m
+CONFIG_SND_ENS1371=m
+CONFIG_SND_ES1938=m
+CONFIG_SND_ES1968=m
+CONFIG_SND_MAESTRO3=m
+CONFIG_SND_FM801=m
+CONFIG_SND_FM801_TEA575X_BOOL=y
+CONFIG_SND_FM801_TEA575X=m
+CONFIG_SND_ICE1712=m
+CONFIG_SND_ICE1724=m
+CONFIG_SND_INTEL8X0=m
+CONFIG_SND_INTEL8X0M=m
+CONFIG_SND_SONICVIBES=m
+CONFIG_SND_VIA82XX=m
+CONFIG_SND_VIA82XX_MODEM=m
+CONFIG_SND_VX222=m
+CONFIG_SND_HDA_INTEL=m
+CONFIG_SND_USB_AUDIO=m
+CONFIG_SND_USB_USX2Y=m
+CONFIG_SND_VXP440=m
+CONFIG_SOUND_PRIME=m
+CONFIG_SOUND_CMPCI=m
+CONFIG_SOUND_CS4281=m
+CONFIG_SOUND_ES1370=m
+CONFIG_SOUND_ESSSOLO1=m
+CONFIG_SOUND_MAESTRO=m
+CONFIG_SOUND_MAESTRO3=m
+CONFIG_SOUND_SONICVIBES=m
+CONFIG_SOUND_TRIDENT=m
+# CONFIG_SOUND_MSNDCLAS is not set
+# CONFIG_SOUND_MSNDPIN is not set
+CONFIG_SOUND_OSS=m
+# CONFIG_SOUND_TRACEINIT is not set
+# CONFIG_SOUND_DMAP is not set
+CONFIG_SOUND_SGALAXY=m
+CONFIG_SOUND_SSCAPE=m
+CONFIG_SOUND_GUS=m
+CONFIG_SOUND_GUS16=y
+CONFIG_SOUND_GUSMAX=y
+CONFIG_SOUND_VMIDI=m
+CONFIG_SOUND_TRIX=m
+CONFIG_SOUND_MSS=m
+CONFIG_SOUND_MPU401=m
+CONFIG_SOUND_MAD16=m
+CONFIG_MAD16_OLDCARD=y
+CONFIG_SOUND_PAS=m
+CONFIG_SOUND_PSS=m
+CONFIG_PSS_MIXER=y
+CONFIG_SOUND_SB=m
+CONFIG_SOUND_AWE32_SYNTH=m
+CONFIG_SOUND_WAVEFRONT=m
+CONFIG_SOUND_MAUI=m
+CONFIG_SOUND_YM3812=m
+CONFIG_SOUND_OPL3SA1=m
+CONFIG_SOUND_YMFPCI=m
+# CONFIG_SOUND_YMFPCI_LEGACY is not set
+CONFIG_SOUND_UART6850=m
+CONFIG_SOUND_AEDSP16=m
+CONFIG_SC6600=y
+CONFIG_SC6600_JOY=y
+CONFIG_SC6600_CDROM=4
+CONFIG_SC6600_CDROMBASE=0x0
+CONFIG_AEDSP16_MSS=y
+# CONFIG_AEDSP16_SBPRO is not set
+CONFIG_SOUND_KAHLUA=m
+CONFIG_SOUND_ALI5455=m
+CONFIG_SOUND_FORTE=m
+CONFIG_SOUND_RME96XX=m
+CONFIG_SOUND_AD1980=m
+CONFIG_USB_ARCH_HAS_HCD=y
+CONFIG_USB_ARCH_HAS_OHCI=y
+CONFIG_USB=m
+# CONFIG_USB_DEBUG is not set
+CONFIG_USB_DEVICEFS=y
+# CONFIG_USB_DYNAMIC_MINORS is not set
+# CONFIG_USB_OTG is not set
+CONFIG_USB_EHCI_HCD=m
+CONFIG_USB_EHCI_SPLIT_ISO=y
+CONFIG_USB_EHCI_ROOT_HUB_TT=y
+CONFIG_USB_OHCI_HCD=m
+CONFIG_USB_OHCI_LITTLE_ENDIAN=y
+CONFIG_USB_UHCI_HCD=m
+CONFIG_USB_SL811_HCD=m
+CONFIG_USB_SL811_CS=m
+CONFIG_USB_ACM=m
+CONFIG_USB_PRINTER=m
+CONFIG_USB_STORAGE=m
+# CONFIG_USB_STORAGE_DEBUG is not set
+CONFIG_USB_STORAGE_DATAFAB=y
+CONFIG_USB_STORAGE_FREECOM=y
+CONFIG_USB_STORAGE_ISD200=y
+CONFIG_USB_STORAGE_DPCM=y
+# CONFIG_USB_STORAGE_USBAT is not set
+CONFIG_USB_STORAGE_SDDR09=y
+CONFIG_USB_STORAGE_SDDR55=y
+CONFIG_USB_STORAGE_JUMPSHOT=y
+CONFIG_USB_HID=m
+# CONFIG_HID_FF is not set
+CONFIG_USB_HIDDEV=y
+CONFIG_USB_KBD=m
+CONFIG_USB_MOUSE=m
+CONFIG_USB_MDC800=m
+CONFIG_USB_MICROTEK=m
+CONFIG_USB_VICAM=m
+CONFIG_USB_DSBR=m
+CONFIG_USB_IBMCAM=m
+CONFIG_USB_KONICAWC=m
+CONFIG_USB_OV511=m
+CONFIG_USB_SE401=m
+CONFIG_USB_SN9C102=m
+CONFIG_USB_STV680=m
+CONFIG_USB_W9968CF=m
+CONFIG_USB_PWC=m
+CONFIG_USB_CATC=m
+CONFIG_USB_KAWETH=m
+CONFIG_USB_PEGASUS=m
+CONFIG_USB_RTL8150=m
+CONFIG_USB_USBNET=m
+CONFIG_USB_ALI_M5632=y
+CONFIG_USB_AN2720=y
+CONFIG_USB_BELKIN=y
+CONFIG_USB_ARMLINUX=y
+CONFIG_USB_EPSON2888=y
+CONFIG_USB_ZD1201=m
+CONFIG_USB_USS720=m
+CONFIG_USB_AUERSWALD=m
+CONFIG_USB_RIO500=m
+CONFIG_USB_LEGOTOWER=m
+CONFIG_USB_LCD=m
+CONFIG_USB_LED=m
+CONFIG_USB_CYTHERM=m
+CONFIG_USB_PHIDGETKIT=m
+CONFIG_USB_PHIDGETSERVO=m
+CONFIG_USB_IDMOUSE=m
+CONFIG_USB_SISUSBVGA=m
+CONFIG_USB_TEST=m
+CONFIG_USB_ATM=m
+CONFIG_USB_SPEEDTOUCH=m
+CONFIG_USB_GADGET=m
+# CONFIG_USB_GADGET_DEBUG_FILES is not set
+CONFIG_USB_GADGET_NET2280=y
+CONFIG_USB_NET2280=m
+# CONFIG_USB_GADGET_PXA2XX is not set
+# CONFIG_USB_GADGET_GOKU is not set
+# CONFIG_USB_GADGET_LH7A40X is not set
+# CONFIG_USB_GADGET_OMAP is not set
+# CONFIG_USB_GADGET_DUMMY_HCD is not set
+CONFIG_USB_GADGET_DUALSPEED=y
+CONFIG_USB_ZERO=m
+CONFIG_USB_ETH=m
+CONFIG_USB_ETH_RNDIS=y
+CONFIG_USB_GADGETFS=m
+CONFIG_USB_FILE_STORAGE=m
+# CONFIG_USB_FILE_STORAGE_TEST is not set
+CONFIG_USB_G_SERIAL=m
+CONFIG_MMC=m
+# CONFIG_MMC_DEBUG is not set
+CONFIG_MMC_BLOCK=m
+CONFIG_MMC_WBSD=m
+CONFIG_EXT2_FS=y
+CONFIG_JBD=m
+CONFIG_FS_MBCACHE=y
+CONFIG_XFS_RT=y
+CONFIG_ADFS_FS=m
+# CONFIG_ADFS_FS_RW is not set
+CONFIG_AFFS_FS=m
+CONFIG_HFS_FS=m
+CONFIG_HFSPLUS_FS=m
+CONFIG_BEFS_FS=m
+# CONFIG_BEFS_DEBUG is not set
+CONFIG_BFS_FS=m
+CONFIG_EFS_FS=m
+CONFIG_JFFS2_FS=m
+CONFIG_JFFS2_FS_DEBUG=0
+# CONFIG_JFFS2_FS_NAND is not set
+CONFIG_JFFS2_FS_NOR_ECC=y
+# CONFIG_JFFS2_COMPRESSION_OPTIONS is not set
+CONFIG_JFFS2_ZLIB=y
+CONFIG_JFFS2_RTIME=y
+# CONFIG_JFFS2_RUBIN is not set
+CONFIG_VXFS_FS=m
+CONFIG_HPFS_FS=m
+CONFIG_QNX4FS_FS=m
+CONFIG_SYSV_FS=m
+CONFIG_UFS_FS=m
+# CONFIG_UFS_FS_WRITE is not set
+CONFIG_SUNRPC_GSS=m
+CONFIG_RPCSEC_GSS_KRB5=m
+CONFIG_RPCSEC_GSS_SPKM3=m
+CONFIG_SMB_FS=m
+# CONFIG_SMB_NLS_DEFAULT is not set
+CONFIG_CIFS=m
+# CONFIG_CIFS_STATS is not set
+# CONFIG_CIFS_XATTR is not set
+# CONFIG_CIFS_EXPERIMENTAL is not set
+CONFIG_NCP_FS=m
+# CONFIG_NCPFS_PACKET_SIGNING is not set
+# CONFIG_NCPFS_IOCTL_LOCKING is not set
+# CONFIG_NCPFS_STRONG is not set
+CONFIG_NCPFS_NFS_NS=y
+CONFIG_NCPFS_OS2_NS=y
+# CONFIG_NCPFS_SMALLDOS is not set
+CONFIG_NCPFS_NLS=y
+CONFIG_NCPFS_EXTRAS=y
+CONFIG_CODA_FS=m
+# CONFIG_CODA_FS_OLD_API is not set
+CONFIG_AFS_FS=m
+# CONFIG_AFS_DEBUG is not set
+CONFIG_ACORN_PARTITION=y
+# CONFIG_ACORN_PARTITION_CUMANA is not set
+# CONFIG_ACORN_PARTITION_EESOX is not set
+CONFIG_ACORN_PARTITION_ICS=y
+# CONFIG_ACORN_PARTITION_ADFS is not set
+# CONFIG_ACORN_PARTITION_POWERTEC is not set
+CONFIG_ACORN_PARTITION_RISCIX=y
+CONFIG_OSF_PARTITION=y
+CONFIG_AMIGA_PARTITION=y
+CONFIG_ATARI_PARTITION=y
+CONFIG_MAC_PARTITION=y
+CONFIG_BSD_DISKLABEL=y
+CONFIG_MINIX_SUBPARTITION=y
+CONFIG_SOLARIS_X86_PARTITION=y
+CONFIG_UNIXWARE_DISKLABEL=y
+CONFIG_LDM_PARTITION=y
+# CONFIG_LDM_DEBUG is not set
+CONFIG_SGI_PARTITION=y
+CONFIG_ULTRIX_PARTITION=y
+CONFIG_SUN_PARTITION=y
+# CONFIG_EFI_PARTITION is not set
+CONFIG_PROFILING=y
+CONFIG_OPROFILE=m
+CONFIG_DEBUG_KERNEL=y
+CONFIG_MAGIC_SYSRQ=y
+CONFIG_LOG_BUF_SHIFT=14
+# CONFIG_SCHEDSTATS is not set
+# CONFIG_DEBUG_SLAB is not set
+# CONFIG_DEBUG_SPINLOCK is not set
+# CONFIG_DEBUG_SPINLOCK_SLEEP is not set
+# CONFIG_DEBUG_KOBJECT is not set
+# CONFIG_DEBUG_INFO is not set
+CONFIG_EARLY_PRINTK=y
+# CONFIG_DEBUG_RWLOCK is not set
+# CONFIG_DEBUG_SEMAPHORE is not set
+CONFIG_CRC_CCITT=m
+CONFIG_CRC32=m
+# CONFIG_MTD_OTP is not set
+# CONFIG_ARCH_DISCONTIGMEM_ENABLE is not set
+CONFIG_JFFS2_FS_WRITEBUFFER=y
+CONFIG_CC_OPTIMIZE_FOR_SIZE=y
+# CONFIG_IPW2100 is not set
+CONFIG_SERIAL_8250_RUNTIME_UARTS=4
+CONFIG_SENSORS_F71805F=m
+CONFIG_ESPSERIAL=m
+CONFIG_MOXA_INTELLIO=m
+CONFIG_BLK_DEV_IDEPNP=y
+CONFIG_AGP_VIA=m
+CONFIG_SND_ADLIB=m
+CONFIG_SND_MIRO=m
+CONFIG_MTD_XIP=y
+CONFIG_DMASCC=m
+CONFIG_IRPORT_SIR=m
+CONFIG_DONGLE_OLD=y
+CONFIG_ESI_DONGLE_OLD=m
+CONFIG_ACTISYS_DONGLE_OLD=m
+CONFIG_TEKRAM_DONGLE_OLD=m
+CONFIG_GIRBIL_DONGLE_OLD=m
+CONFIG_LITELINK_DONGLE_OLD=m
+CONFIG_MCP2120_DONGLE_OLD=m
+CONFIG_OLD_BELKIN_DONGLE_OLD=m
+CONFIG_ACT200L_DONGLE_OLD=m
+CONFIG_MA600_DONGLE_OLD=m
+CONFIG_NI5010=m
+CONFIG_PCMCIA_XIRTULIP=m
+CONFIG_ISDN_DRV_LOOP=m
+CONFIG_HYSDN=m
+CONFIG_HYSDN_CAPI=y
+CONFIG_COMPUTONE=m
+# CONFIG_DIGIEPCA is not set
+CONFIG_ESPSERIAL=m
+CONFIG_MOXA_INTELLIO=m
+CONFIG_RISCOM8=m
+# CONFIG_RIO is not set
+CONFIG_STALLION=m
+CONFIG_ISTALLION=m
+CONFIG_I2C_ELEKTOR=m
+CONFIG_MATHEMU=y
+# CONFIG_AUDIT is not set

Added: dists/sid/linux-2.6/debian/config/alpha/config.alpha-generic
==============================================================================
--- (empty file)
+++ dists/sid/linux-2.6/debian/config/alpha/config.alpha-generic	Mon Nov 26 20:06:56 2007
@@ -0,0 +1,3 @@
+CONFIG_BROKEN_ON_SMP=y
+# CONFIG_SMP is not set
+# CONFIG_ALPHA_LEGACY_START_ADDRESS is not set

Added: dists/sid/linux-2.6/debian/config/alpha/config.alpha-legacy
==============================================================================
--- (empty file)
+++ dists/sid/linux-2.6/debian/config/alpha/config.alpha-legacy	Mon Nov 26 20:06:56 2007
@@ -0,0 +1,3 @@
+CONFIG_BROKEN_ON_SMP=y
+# CONFIG_SMP is not set
+CONFIG_ALPHA_LEGACY_START_ADDRESS=y

Added: dists/sid/linux-2.6/debian/config/alpha/config.alpha-smp
==============================================================================
--- (empty file)
+++ dists/sid/linux-2.6/debian/config/alpha/config.alpha-smp	Mon Nov 26 20:06:56 2007
@@ -0,0 +1,4 @@
+CONFIG_SMP=y
+CONFIG_NR_CPUS=64
+# CONFIG_ALPHA_LEGACY_START_ADDRESS is not set
+CONFIG_SCSI=y

Added: dists/sid/linux-2.6/debian/config/alpha/defines
==============================================================================
--- (empty file)
+++ dists/sid/linux-2.6/debian/config/alpha/defines	Mon Nov 26 20:06:56 2007
@@ -0,0 +1,19 @@
+[base]
+featuresets:
+ vserver
+flavours: alpha-generic alpha-smp alpha-legacy
+kernel-arch: alpha
+kernel-header-dirs: alpha
+
+[image]
+suggests: aboot, fdutils
+type: kernel-package
+
+[alpha-generic_base]
+class: Alpha
+
+[alpha-smp_base]
+class: Alpha SMP
+
+[alpha-legacy_base]
+class: Alpha Legacy

Added: dists/sid/linux-2.6/debian/config/alpha/vserver/defines
==============================================================================
--- (empty file)
+++ dists/sid/linux-2.6/debian/config/alpha/vserver/defines	Mon Nov 26 20:06:56 2007
@@ -0,0 +1,11 @@
+[base]
+flavours: alpha
+
+[image]
+recommends: util-vserver
+
+[alpha_base]
+class: Alpha
+
+[alpha_image]
+configs: alpha/config.alpha-generic

Added: dists/sid/linux-2.6/debian/config/amd64/config
==============================================================================
--- (empty file)
+++ dists/sid/linux-2.6/debian/config/amd64/config	Mon Nov 26 20:06:56 2007
@@ -0,0 +1,1391 @@
+CONFIG_X86_64=y
+CONFIG_64BIT=y
+CONFIG_SEMAPHORE_SLEEPERS=y
+CONFIG_X86=y
+CONFIG_ZONE_DMA32=y
+CONFIG_RWSEM_GENERIC_SPINLOCK=y
+CONFIG_X86_CMPXCHG=y
+CONFIG_GENERIC_ISA_DMA=y
+CONFIG_GENERIC_IOMAP=y
+CONFIG_DMI=y
+CONFIG_DMIID=y
+CONFIG_IKCONFIG=y
+CONFIG_IKCONFIG_PROC=y
+# CONFIG_KALLSYMS_ALL is not set
+CONFIG_X86_TSC=y
+CONFIG_X86_GOOD_APIC=y
+CONFIG_MICROCODE=m
+CONFIG_X86_MSR=m
+CONFIG_X86_CPUID=m
+CONFIG_X86_IO_APIC=y
+CONFIG_X86_LOCAL_APIC=y
+CONFIG_MTRR=y
+CONFIG_HPET_TIMER=y
+CONFIG_X86_PM_TIMER=y
+CONFIG_SWIOTLB=y
+CONFIG_X86_MCE=y
+CONFIG_X86_MCE_INTEL=y
+# CONFIG_CC_STACKPROTECTOR is not set
+CONFIG_GENERIC_HARDIRQS=y
+CONFIG_GENERIC_IRQ_PROBE=y
+CONFIG_ISA_DMA_API=y
+CONFIG_PM=y
+# CONFIG_PM_DEBUG is not set
+CONFIG_SUSPEND=y
+CONFIG_HIBERNATION=y
+CONFIG_PM_STD_PARTITION=""
+CONFIG_ACPI=y
+CONFIG_ACPI_SLEEP=y
+CONFIG_ACPI_PROCFS=y
+CONFIG_ACPI_PROC_EVENT=y
+CONFIG_ACPI_AC=m
+CONFIG_ACPI_BATTERY=m
+CONFIG_ACPI_BUTTON=m
+CONFIG_ACPI_VIDEO=m
+CONFIG_ACPI_FAN=m
+CONFIG_ACPI_PROCESSOR=m
+CONFIG_ACPI_THERMAL=m
+CONFIG_ACPI_ASUS=m
+# CONFIG_SONYPI_COMPAT is not set
+CONFIG_THINKPAD_ACPI=m
+# CONFIG_THINKPAD_ACPI_DEBUG is not set
+CONFIG_THINKPAD_ACPI_BAY=y
+CONFIG_ACPI_TOSHIBA=m
+CONFIG_ACPI_BLACKLIST_YEAR=0
+# CONFIG_ACPI_DEBUG is not set
+CONFIG_ACPI_EC=y
+CONFIG_ACPI_POWER=y
+CONFIG_ACPI_SYSTEM=y
+CONFIG_ACPI_CONTAINER=m
+CONFIG_CPU_FREQ=y
+CONFIG_CPU_FREQ_TABLE=m
+# CONFIG_CPU_FREQ_DEBUG is not set
+CONFIG_CPU_FREQ_STAT=m
+CONFIG_CPU_FREQ_DEFAULT_GOV_PERFORMANCE=y
+# CONFIG_CPU_FREQ_DEFAULT_GOV_USERSPACE is not set
+CONFIG_CPU_FREQ_GOV_PERFORMANCE=y
+CONFIG_CPU_FREQ_GOV_POWERSAVE=m
+CONFIG_CPU_FREQ_GOV_USERSPACE=m
+CONFIG_CPU_FREQ_GOV_ONDEMAND=m
+CONFIG_CPU_FREQ_GOV_CONSERVATIVE=m
+CONFIG_X86_POWERNOW_K8=m
+CONFIG_X86_POWERNOW_K8_ACPI=y
+CONFIG_X86_SPEEDSTEP_CENTRINO=m
+CONFIG_X86_ACPI_CPUFREQ=m
+# CONFIG_X86_ACPI_CPUFREQ_PROC_INTF is not set
+# CONFIG_X86_SPEEDSTEP_LIB is not set
+CONFIG_PCI=y
+CONFIG_PCI_DIRECT=y
+CONFIG_PCI_MMCONFIG=y
+CONFIG_PCIEPORTBUS=y
+CONFIG_HOTPLUG_PCI_PCIE=m
+# CONFIG_HOTPLUG_PCI_PCIE_POLL_EVENT_MODE is not set
+# CONFIG_PCI_DEBUG is not set
+CONFIG_PCCARD=m
+# CONFIG_PCMCIA_DEBUG is not set
+CONFIG_PCMCIA=m
+CONFIG_CARDBUS=y
+CONFIG_YENTA=m
+CONFIG_PD6729=m
+CONFIG_I82092=m
+CONFIG_TCIC=m
+CONFIG_PCCARD_NONSTATIC=m
+CONFIG_HOTPLUG_PCI=m
+CONFIG_HOTPLUG_PCI_FAKE=m
+CONFIG_HOTPLUG_PCI_ACPI=m
+CONFIG_HOTPLUG_PCI_ACPI_IBM=m
+CONFIG_HOTPLUG_PCI_CPCI_ZT5550=m
+CONFIG_HOTPLUG_PCI_CPCI_GENERIC=m
+CONFIG_HOTPLUG_PCI_SHPC=m
+CONFIG_IA32_EMULATION=y
+CONFIG_IA32_AOUT=y
+CONFIG_COMPAT=y
+CONFIG_SYSVIPC_COMPAT=y
+CONFIG_UID16=y
+CONFIG_STANDALONE=y
+# CONFIG_DEBUG_DRIVER is not set
+CONFIG_MTD=m
+# CONFIG_MTD_DEBUG is not set
+CONFIG_MTD_CONCAT=m
+CONFIG_MTD_PARTITIONS=y
+CONFIG_MTD_REDBOOT_PARTS=m
+CONFIG_MTD_REDBOOT_DIRECTORY_BLOCK=-1
+# CONFIG_MTD_REDBOOT_PARTS_UNALLOCATED is not set
+# CONFIG_MTD_REDBOOT_PARTS_READONLY is not set
+# CONFIG_MTD_CMDLINE_PARTS is not set
+CONFIG_MTD_CHAR=m
+CONFIG_MTD_BLOCK=m
+CONFIG_MTD_BLOCK_RO=m
+CONFIG_FTL=m
+CONFIG_NFTL=m
+CONFIG_NFTL_RW=y
+CONFIG_INFTL=m
+CONFIG_MTD_CFI=m
+CONFIG_MTD_JEDECPROBE=m
+CONFIG_MTD_GEN_PROBE=m
+# CONFIG_MTD_CFI_ADV_OPTIONS is not set
+CONFIG_MTD_MAP_BANK_WIDTH_1=y
+CONFIG_MTD_MAP_BANK_WIDTH_2=y
+CONFIG_MTD_MAP_BANK_WIDTH_4=y
+# CONFIG_MTD_MAP_BANK_WIDTH_8 is not set
+# CONFIG_MTD_MAP_BANK_WIDTH_16 is not set
+# CONFIG_MTD_MAP_BANK_WIDTH_32 is not set
+CONFIG_MTD_CFI_I1=y
+CONFIG_MTD_CFI_I2=y
+# CONFIG_MTD_CFI_I4 is not set
+# CONFIG_MTD_CFI_I8 is not set
+CONFIG_MTD_CFI_INTELEXT=m
+CONFIG_MTD_CFI_AMDSTD=m
+CONFIG_MTD_CFI_STAA=m
+CONFIG_MTD_CFI_UTIL=m
+CONFIG_MTD_RAM=m
+CONFIG_MTD_ROM=m
+CONFIG_MTD_ABSENT=m
+CONFIG_MTD_COMPLEX_MAPPINGS=y
+CONFIG_MTD_PHYSMAP=m
+CONFIG_MTD_PHYSMAP_START=0x8000000
+CONFIG_MTD_PHYSMAP_LEN=0x4000000
+CONFIG_MTD_PHYSMAP_BANKWIDTH=2
+CONFIG_MTD_PNC2000=m
+CONFIG_MTD_SC520CDP=m
+CONFIG_MTD_NETSC520=m
+CONFIG_MTD_TS5500=m
+CONFIG_MTD_SBC_GXX=m
+# CONFIG_MTD_AMD76XROM is not set
+# CONFIG_MTD_ICHXROM is not set
+# CONFIG_MTD_SCB2_FLASH is not set
+CONFIG_MTD_NETtel=m
+CONFIG_MTD_DILNETPC=m
+CONFIG_MTD_DILNETPC_BOOTSIZE=0x80000
+# CONFIG_MTD_L440GX is not set
+CONFIG_MTD_PCI=m
+CONFIG_MTD_PMC551=m
+# CONFIG_MTD_PMC551_BUGFIX is not set
+# CONFIG_MTD_PMC551_DEBUG is not set
+CONFIG_MTD_SLRAM=m
+CONFIG_MTD_PHRAM=m
+CONFIG_MTD_MTDRAM=m
+CONFIG_MTDRAM_TOTAL_SIZE=4096
+CONFIG_MTDRAM_ERASE_SIZE=128
+CONFIG_MTD_BLOCK2MTD=m
+CONFIG_MTD_DOC2000=m
+CONFIG_MTD_DOC2001=m
+CONFIG_MTD_DOC2001PLUS=m
+CONFIG_MTD_DOCPROBE=m
+CONFIG_MTD_DOCECC=m
+# CONFIG_MTD_DOCPROBE_ADVANCED is not set
+CONFIG_MTD_DOCPROBE_ADDRESS=0
+CONFIG_MTD_NAND=m
+# CONFIG_MTD_NAND_VERIFY_WRITE is not set
+CONFIG_MTD_NAND_IDS=m
+CONFIG_MTD_NAND_DISKONCHIP=m
+# CONFIG_MTD_NAND_DISKONCHIP_PROBE_ADVANCED is not set
+CONFIG_MTD_NAND_DISKONCHIP_PROBE_ADDRESS=0
+# CONFIG_MTD_NAND_DISKONCHIP_BBTWRITE is not set
+# CONFIG_MTD_NAND_NANDSIM is not set
+CONFIG_MTD_NAND_PLATFORM=m
+
+CONFIG_PNP=y
+CONFIG_PNP_DEBUG=y
+CONFIG_PNPACPI=y
+CONFIG_BLK_DEV_FD=m
+CONFIG_PARIDE=m
+CONFIG_PARIDE_PD=m
+CONFIG_PARIDE_PCD=m
+CONFIG_PARIDE_PF=m
+CONFIG_PARIDE_PT=m
+CONFIG_PARIDE_PG=m
+CONFIG_PARIDE_ATEN=m
+CONFIG_PARIDE_BPCK=m
+CONFIG_PARIDE_COMM=m
+CONFIG_PARIDE_DSTR=m
+CONFIG_PARIDE_FIT2=m
+CONFIG_PARIDE_FIT3=m
+CONFIG_PARIDE_EPAT=m
+# CONFIG_PARIDE_EPATC8 is not set
+CONFIG_PARIDE_EPIA=m
+CONFIG_PARIDE_FRIQ=m
+CONFIG_PARIDE_FRPW=m
+CONFIG_PARIDE_KBIC=m
+CONFIG_PARIDE_KTTI=m
+CONFIG_PARIDE_ON20=m
+CONFIG_PARIDE_ON26=m
+CONFIG_BLK_CPQ_DA=m
+CONFIG_BLK_CPQ_CISS_DA=m
+CONFIG_CISS_SCSI_TAPE=y
+CONFIG_BLK_DEV_DAC960=m
+CONFIG_BLK_DEV_UMEM=m
+CONFIG_BLK_DEV_LOOP=m
+CONFIG_BLK_DEV_CRYPTOLOOP=m
+CONFIG_BLK_DEV_NBD=m
+CONFIG_BLK_DEV_SX8=m
+# CONFIG_BLK_DEV_UB is not set
+CONFIG_BLK_DEV_RAM_SIZE=65536
+CONFIG_BLK_DEV_INITRD=y
+CONFIG_LBD=y
+CONFIG_CDROM_PKTCDVD=m
+CONFIG_CDROM_PKTCDVD_BUFFERS=8
+# CONFIG_CDROM_PKTCDVD_WCACHE is not set
+CONFIG_ATA_OVER_ETH=m
+CONFIG_IDE=m
+CONFIG_BLK_DEV_IDE=m
+# CONFIG_BLK_DEV_IDE_SATA is not set
+# CONFIG_BLK_DEV_HD_IDE is not set
+CONFIG_BLK_DEV_IDEDISK=m
+# CONFIG_IDEDISK_MULTI_MODE is not set
+CONFIG_BLK_DEV_IDECS=m
+CONFIG_BLK_DEV_IDECD=m
+CONFIG_BLK_DEV_IDETAPE=m
+CONFIG_BLK_DEV_IDEFLOPPY=m
+CONFIG_IDE_GENERIC=m
+CONFIG_BLK_DEV_CMD640=y
+# CONFIG_BLK_DEV_CMD640_ENHANCED is not set
+CONFIG_BLK_DEV_IDEPCI=y
+CONFIG_IDEPCI_SHARE_IRQ=y
+# CONFIG_BLK_DEV_OFFBOARD is not set
+CONFIG_BLK_DEV_GENERIC=m
+CONFIG_BLK_DEV_JMICRON=m
+CONFIG_BLK_DEV_OPTI621=m
+CONFIG_BLK_DEV_RZ1000=m
+CONFIG_BLK_DEV_IDEDMA_PCI=y
+# CONFIG_BLK_DEV_IDEDMA_FORCED is not set
+# CONFIG_IDEDMA_ONLYDISK is not set
+CONFIG_BLK_DEV_AEC62XX=m
+CONFIG_BLK_DEV_ALI15X3=m
+# CONFIG_WDC_ALI15X3 is not set
+CONFIG_BLK_DEV_AMD74XX=m
+CONFIG_BLK_DEV_ATIIXP=m
+CONFIG_BLK_DEV_CMD64X=m
+CONFIG_BLK_DEV_TRIFLEX=m
+CONFIG_BLK_DEV_CY82C693=m
+CONFIG_BLK_DEV_CS5520=m
+CONFIG_BLK_DEV_CS5530=m
+CONFIG_BLK_DEV_HPT34X=m
+# CONFIG_HPT34X_AUTODMA is not set
+CONFIG_BLK_DEV_HPT366=m
+CONFIG_BLK_DEV_SC1200=m
+CONFIG_BLK_DEV_PIIX=m
+CONFIG_BLK_DEV_NS87415=m
+CONFIG_BLK_DEV_PDC202XX_OLD=m
+CONFIG_PDC202XX_BURST=y
+CONFIG_BLK_DEV_PDC202XX_NEW=m
+CONFIG_BLK_DEV_SVWKS=m
+CONFIG_BLK_DEV_SIIMAGE=m
+CONFIG_BLK_DEV_SIS5513=m
+CONFIG_BLK_DEV_SLC90E66=m
+CONFIG_BLK_DEV_TRM290=m
+CONFIG_BLK_DEV_VIA82CXXX=m
+# CONFIG_IDE_ARM is not set
+CONFIG_BLK_DEV_IDEDMA=y
+# CONFIG_IDEDMA_IVB is not set
+# CONFIG_BLK_DEV_HD is not set
+CONFIG_AIC7XXX_CMDS_PER_DEVICE=8
+CONFIG_MEGARAID_NEWGEN=y
+CONFIG_MEGARAID_MM=m
+CONFIG_MEGARAID_MAILBOX=m
+CONFIG_MEGARAID_LEGACY=m
+CONFIG_SCSI_BUSLOGIC=m
+# CONFIG_SCSI_OMIT_FLASHPOINT is not set
+CONFIG_SCSI_DMX3191D=m
+CONFIG_SCSI_EATA=m
+CONFIG_SCSI_EATA_TAGGED_QUEUE=y
+CONFIG_SCSI_EATA_LINKED_COMMANDS=y
+CONFIG_SCSI_EATA_MAX_TAGS=16
+CONFIG_SCSI_FUTURE_DOMAIN=m
+CONFIG_SCSI_GDTH=m
+CONFIG_SCSI_IPS=m
+CONFIG_SCSI_INITIO=m
+CONFIG_SCSI_INIA100=m
+CONFIG_SCSI_PPA=m
+CONFIG_SCSI_IMM=m
+# CONFIG_SCSI_IZIP_EPP16 is not set
+# CONFIG_SCSI_IZIP_SLOW_CTR is not set
+CONFIG_SCSI_SYM53C8XX_2=m
+CONFIG_SCSI_SYM53C8XX_DMA_ADDRESSING_MODE=1
+CONFIG_SCSI_SYM53C8XX_DEFAULT_TAGS=16
+CONFIG_SCSI_SYM53C8XX_MAX_TAGS=64
+CONFIG_SCSI_IPR=m
+# CONFIG_SCSI_IPR_TRACE is not set
+# CONFIG_SCSI_IPR_DUMP is not set
+CONFIG_SCSI_QLOGIC_FC=m
+CONFIG_SCSI_QLOGIC_FC_FIRMWARE=y
+CONFIG_SCSI_QLOGIC_1280=m
+CONFIG_SCSI_LPFC=m
+CONFIG_SCSI_DC395x=m
+CONFIG_SCSI_DC390T=m
+CONFIG_SCSI_DEBUG=m
+CONFIG_PCMCIA_FDOMAIN=m
+CONFIG_PCMCIA_QLOGIC=m
+CONFIG_PCMCIA_SYM53C500=m
+CONFIG_I2O=m
+CONFIG_I2O_CONFIG=m
+CONFIG_I2O_BLOCK=m
+CONFIG_I2O_SCSI=m
+CONFIG_I2O_PROC=m
+# CONFIG_IP_PNP is not set
+CONFIG_IP_SCTP=m
+# CONFIG_SCTP_DBG_MSG is not set
+# CONFIG_SCTP_DBG_OBJCNT is not set
+# CONFIG_SCTP_HMAC_NONE is not set
+CONFIG_ATM=y
+CONFIG_ATM_CLIP=y
+# CONFIG_ATM_CLIP_NO_ICMP is not set
+CONFIG_ATM_LANE=m
+CONFIG_ATM_MPOA=m
+CONFIG_ATM_BR2684=m
+# CONFIG_ATM_BR2684_IPFILTER is not set
+CONFIG_BRIDGE=m
+CONFIG_DECNET=m
+# CONFIG_DECNET_ROUTER is not set
+CONFIG_LLC=y
+CONFIG_LLC2=m
+CONFIG_IPX=m
+# CONFIG_IPX_INTERN is not set
+CONFIG_ATALK=m
+CONFIG_IPDDP=m
+CONFIG_IPDDP_ENCAP=y
+CONFIG_IPDDP_DECAP=y
+CONFIG_X25=m
+CONFIG_LAPB=m
+CONFIG_ECONET=m
+CONFIG_ECONET_AUNUDP=y
+CONFIG_ECONET_NATIVE=y
+CONFIG_WAN_ROUTER=m
+CONFIG_NETPOLL=y
+# CONFIG_NETPOLL_TRAP is not set
+CONFIG_NET_POLL_CONTROLLER=y
+CONFIG_HAMRADIO=y
+CONFIG_AX25=m
+# CONFIG_AX25_DAMA_SLAVE is not set
+CONFIG_NETROM=m
+CONFIG_ROSE=m
+CONFIG_BPQETHER=m
+CONFIG_BAYCOM_SER_FDX=m
+CONFIG_BAYCOM_SER_HDX=m
+CONFIG_BAYCOM_PAR=m
+CONFIG_YAM=m
+CONFIG_IRDA=m
+CONFIG_IRLAN=m
+CONFIG_IRNET=m
+CONFIG_IRCOMM=m
+# CONFIG_IRDA_ULTRA is not set
+CONFIG_IRDA_CACHE_LAST_LSAP=y
+CONFIG_IRDA_FAST_RR=y
+CONFIG_IRDA_DEBUG=y
+CONFIG_IRTTY_SIR=m
+CONFIG_DONGLE=y
+CONFIG_ESI_DONGLE=m
+CONFIG_ACTISYS_DONGLE=m
+CONFIG_TEKRAM_DONGLE=m
+CONFIG_LITELINK_DONGLE=m
+CONFIG_MA600_DONGLE=m
+CONFIG_GIRBIL_DONGLE=m
+CONFIG_MCP2120_DONGLE=m
+CONFIG_OLD_BELKIN_DONGLE=m
+CONFIG_ACT200L_DONGLE=m
+CONFIG_KINGSUN_DONGLE=m
+
+CONFIG_USB_IRDA=m
+CONFIG_SIGMATEL_FIR=m
+CONFIG_NSC_FIR=m
+CONFIG_WINBOND_FIR=m
+CONFIG_SMC_IRCC_FIR=m
+CONFIG_ALI_FIR=m
+CONFIG_VLSI_FIR=m
+CONFIG_VIA_FIR=m
+CONFIG_BT=m
+CONFIG_BT_L2CAP=m
+CONFIG_BT_SCO=m
+CONFIG_BT_RFCOMM=m
+CONFIG_BT_RFCOMM_TTY=y
+CONFIG_BT_BNEP=m
+CONFIG_BT_BNEP_MC_FILTER=y
+CONFIG_BT_BNEP_PROTO_FILTER=y
+CONFIG_BT_CMTP=m
+CONFIG_BT_HIDP=m
+CONFIG_BT_HCIUSB=m
+CONFIG_BT_HCIUSB_SCO=y
+CONFIG_BT_HCIUART=m
+CONFIG_BT_HCIUART_H4=y
+CONFIG_BT_HCIUART_BCSP=y
+CONFIG_BT_HCIBCM203X=m
+CONFIG_BT_HCIBPA10X=m
+CONFIG_BT_HCIBFUSB=m
+CONFIG_BT_HCIDTL1=m
+CONFIG_BT_HCIBT3C=m
+CONFIG_BT_HCIBLUECARD=m
+CONFIG_BT_HCIBTUART=m
+CONFIG_BT_HCIVHCI=m
+CONFIG_AF_RXRPC=m
+# CONFIG_AF_RXRPC_DEBUG is not set
+CONFIG_RXKAD=m
+
+CONFIG_DUMMY=m
+CONFIG_NET_SB1000=m
+CONFIG_ARCNET=m
+CONFIG_ARCNET_1201=m
+CONFIG_ARCNET_1051=m
+CONFIG_ARCNET_RAW=m
+CONFIG_ARCNET_CAP=m
+CONFIG_ARCNET_COM90xx=m
+CONFIG_ARCNET_COM90xxIO=m
+CONFIG_ARCNET_RIM_I=m
+CONFIG_ARCNET_COM20020=m
+CONFIG_ARCNET_COM20020_PCI=m
+CONFIG_HAPPYMEAL=m
+CONFIG_SUNGEM=m
+CONFIG_NET_VENDOR_3COM=y
+CONFIG_VORTEX=m
+CONFIG_TYPHOON=m
+CONFIG_NET_TULIP=y
+CONFIG_DE2104X=m
+CONFIG_TULIP=m
+# CONFIG_TULIP_MWI is not set
+# CONFIG_TULIP_MMIO is not set
+CONFIG_DE4X5=m
+CONFIG_WINBOND_840=m
+CONFIG_DM9102=m
+CONFIG_PCMCIA_XIRCOM=m
+CONFIG_HP100=m
+CONFIG_NET_PCI=y
+CONFIG_PCNET32=m
+CONFIG_AMD8111_ETH=m
+CONFIG_ADAPTEC_STARFIRE=m
+CONFIG_B44=m
+CONFIG_FORCEDETH=m
+CONFIG_EEPRO100=m
+CONFIG_E100=m
+CONFIG_FEALNX=m
+CONFIG_NATSEMI=m
+CONFIG_NE2K_PCI=m
+CONFIG_8139CP=m
+CONFIG_8139TOO=m
+# CONFIG_8139TOO_PIO is not set
+CONFIG_8139TOO_TUNE_TWISTER=y
+CONFIG_8139TOO_8129=y
+# CONFIG_8139_OLD_RX_RESET is not set
+CONFIG_SIS900=m
+CONFIG_EPIC100=m
+CONFIG_SUNDANCE=m
+# CONFIG_SUNDANCE_MMIO is not set
+CONFIG_VIA_RHINE=m
+# CONFIG_VIA_RHINE_MMIO is not set
+CONFIG_DL2K=m
+CONFIG_E1000=m
+CONFIG_NS83820=m
+CONFIG_HAMACHI=m
+CONFIG_YELLOWFIN=m
+CONFIG_R8169=m
+CONFIG_VIA_VELOCITY=m
+CONFIG_TIGON3=m
+CONFIG_BNX2=m
+CONFIG_IXGB=m
+CONFIG_S2IO=m
+CONFIG_WLAN_PRE80211=y
+CONFIG_STRIP=m
+CONFIG_PCMCIA_WAVELAN=m
+CONFIG_PCMCIA_NETWAVE=m
+CONFIG_WLAN_80211=y
+CONFIG_PCMCIA_RAYCS=m
+CONFIG_HERMES=m
+CONFIG_PLX_HERMES=m
+CONFIG_TMD_HERMES=m
+CONFIG_PCI_HERMES=m
+CONFIG_ATMEL=m
+CONFIG_PCI_ATMEL=m
+CONFIG_PCMCIA_HERMES=m
+CONFIG_AIRO_CS=m
+CONFIG_PCMCIA_ATMEL=m
+CONFIG_PCMCIA_WL3501=m
+CONFIG_PRISM54=m
+CONFIG_NET_PCMCIA=y
+CONFIG_PCMCIA_3C589=m
+CONFIG_PCMCIA_3C574=m
+CONFIG_PCMCIA_FMVJ18X=m
+CONFIG_PCMCIA_PCNET=m
+CONFIG_PCMCIA_NMCLAN=m
+CONFIG_PCMCIA_SMC91C92=m
+CONFIG_PCMCIA_XIRC2PS=m
+CONFIG_PCMCIA_AXNET=m
+CONFIG_ARCNET_COM20020_CS=m
+CONFIG_WAN=y
+CONFIG_DSCC4=m
+CONFIG_DSCC4_PCISYNC=y
+CONFIG_DSCC4_PCI_RST=y
+CONFIG_LANMEDIA=m
+CONFIG_PCI200SYN=m
+CONFIG_WANXL=m
+CONFIG_PC300=m
+CONFIG_PC300_MLPPP=y
+CONFIG_FARSYNC=m
+CONFIG_DLCI=m
+CONFIG_DLCI_MAX=8
+CONFIG_CYCLADES_SYNC=m
+CONFIG_CYCLOMX_X25=y
+CONFIG_LAPBETHER=m
+CONFIG_X25_ASY=m
+CONFIG_SBNI=m
+# CONFIG_SBNI_MULTILINE is not set
+CONFIG_ATM_DRIVERS=y
+CONFIG_ATM_TCP=m
+CONFIG_ATM_LANAI=m
+CONFIG_ATM_ENI=m
+# CONFIG_ATM_ENI_DEBUG is not set
+# CONFIG_ATM_ENI_TUNE_BURST is not set
+CONFIG_ATM_FIRESTREAM=m
+CONFIG_ATM_ZATM=m
+# CONFIG_ATM_ZATM_DEBUG is not set
+CONFIG_ATM_IDT77252=m
+# CONFIG_ATM_IDT77252_DEBUG is not set
+# CONFIG_ATM_IDT77252_RCV_ALL is not set
+CONFIG_ATM_IDT77252_USE_SUNI=y
+CONFIG_ATM_AMBASSADOR=m
+# CONFIG_ATM_AMBASSADOR_DEBUG is not set
+CONFIG_ATM_HORIZON=m
+# CONFIG_ATM_HORIZON_DEBUG is not set
+CONFIG_ATM_FORE200E_MAYBE=m
+CONFIG_ATM_FORE200E_PCA=y
+CONFIG_ATM_FORE200E_PCA_DEFAULT_FW=y
+# CONFIG_ATM_FORE200E_USE_TASKLET is not set
+CONFIG_ATM_FORE200E_TX_RETRY=16
+CONFIG_ATM_FORE200E_DEBUG=0
+CONFIG_ATM_FORE200E=m
+CONFIG_ATM_HE=m
+CONFIG_ATM_HE_USE_SUNI=y
+CONFIG_FDDI=y
+CONFIG_DEFXX=m
+CONFIG_SKFP=m
+CONFIG_HIPPI=y
+CONFIG_ROADRUNNER=m
+# CONFIG_ROADRUNNER_LARGE_RINGS is not set
+CONFIG_PLIP=m
+CONFIG_PPP=m
+CONFIG_PPP_MULTILINK=y
+CONFIG_PPP_FILTER=y
+CONFIG_PPP_ASYNC=m
+CONFIG_PPP_SYNC_TTY=m
+CONFIG_PPP_DEFLATE=m
+CONFIG_PPP_BSDCOMP=m
+CONFIG_PPPOE=m
+CONFIG_PPPOATM=m
+CONFIG_SLIP=m
+CONFIG_SLIP_COMPRESSED=y
+CONFIG_SLIP_SMART=y
+# CONFIG_SLIP_MODE_SLIP6 is not set
+CONFIG_NET_FC=y
+CONFIG_SHAPER=m
+CONFIG_NETCONSOLE=m
+CONFIG_ISDN=m
+CONFIG_ISDN_I4L=m
+CONFIG_ISDN_PPP=y
+CONFIG_ISDN_PPP_VJ=y
+CONFIG_ISDN_MPP=y
+CONFIG_IPPP_FILTER=y
+CONFIG_ISDN_PPP_BSDCOMP=m
+CONFIG_ISDN_AUDIO=y
+CONFIG_ISDN_TTY_FAX=y
+CONFIG_ISDN_X25=y
+CONFIG_ISDN_DIVERSION=m
+CONFIG_ISDN_DRV_HISAX=m
+CONFIG_HISAX_EURO=y
+CONFIG_DE_AOC=y
+# CONFIG_HISAX_NO_SENDCOMPLETE is not set
+# CONFIG_HISAX_NO_LLC is not set
+# CONFIG_HISAX_NO_KEYPAD is not set
+CONFIG_HISAX_1TR6=y
+CONFIG_HISAX_NI1=y
+CONFIG_HISAX_MAX_CARDS=8
+CONFIG_HISAX_16_3=y
+CONFIG_HISAX_TELESPCI=y
+CONFIG_HISAX_S0BOX=y
+CONFIG_HISAX_FRITZPCI=y
+CONFIG_HISAX_AVM_A1_PCMCIA=y
+CONFIG_HISAX_ELSA=y
+CONFIG_HISAX_DIEHLDIVA=y
+CONFIG_HISAX_SEDLBAUER=y
+CONFIG_HISAX_NETJET=y
+CONFIG_HISAX_NETJET_U=y
+CONFIG_HISAX_NICCY=y
+CONFIG_HISAX_BKM_A4T=y
+CONFIG_HISAX_SCT_QUADRO=y
+CONFIG_HISAX_GAZEL=y
+CONFIG_HISAX_HFC_PCI=y
+CONFIG_HISAX_W6692=y
+CONFIG_HISAX_HFC_SX=y
+CONFIG_HISAX_ENTERNOW_PCI=y
+# CONFIG_HISAX_DEBUG is not set
+CONFIG_HISAX_SEDLBAUER_CS=m
+CONFIG_HISAX_ELSA_CS=m
+CONFIG_HISAX_AVM_A1_CS=m
+CONFIG_HISAX_TELES_CS=m
+CONFIG_HISAX_ST5481=m
+CONFIG_HISAX_HFCUSB=m
+CONFIG_HISAX_HFC4S8S=m
+CONFIG_HISAX_FRITZ_PCIPNP=m
+CONFIG_HISAX_HDLC=y
+CONFIG_ISDN_CAPI=m
+CONFIG_ISDN_DRV_AVMB1_VERBOSE_REASON=y
+CONFIG_CAPI_TRACE=y
+CONFIG_ISDN_CAPI_MIDDLEWARE=y
+CONFIG_ISDN_CAPI_CAPI20=m
+CONFIG_ISDN_CAPI_CAPIFS_BOOL=y
+CONFIG_ISDN_CAPI_CAPIFS=m
+CONFIG_ISDN_CAPI_CAPIDRV=m
+CONFIG_CAPI_AVM=y
+CONFIG_ISDN_DRV_AVMB1_B1PCI=m
+CONFIG_ISDN_DRV_AVMB1_B1PCIV4=y
+CONFIG_ISDN_DRV_AVMB1_B1PCMCIA=m
+CONFIG_ISDN_DRV_AVMB1_AVM_CS=m
+CONFIG_ISDN_DRV_AVMB1_T1PCI=m
+CONFIG_ISDN_DRV_AVMB1_C4=m
+CONFIG_CAPI_EICON=y
+CONFIG_ISDN_DIVAS=m
+CONFIG_ISDN_DIVAS_BRIPCI=y
+CONFIG_ISDN_DIVAS_PRIPCI=y
+CONFIG_ISDN_DIVAS_DIVACAPI=m
+CONFIG_ISDN_DIVAS_USERIDI=m
+CONFIG_ISDN_DIVAS_MAINT=m
+CONFIG_PHONE=m
+CONFIG_PHONE_IXJ=m
+CONFIG_PHONE_IXJ_PCMCIA=m
+CONFIG_INPUT=y
+CONFIG_INPUT_MOUSEDEV=y
+CONFIG_INPUT_MOUSEDEV_PSAUX=y
+CONFIG_INPUT_MOUSEDEV_SCREEN_X=1024
+CONFIG_INPUT_MOUSEDEV_SCREEN_Y=768
+CONFIG_INPUT_JOYDEV=m
+CONFIG_INPUT_TSDEV=m
+CONFIG_INPUT_TSDEV_SCREEN_X=240
+CONFIG_INPUT_TSDEV_SCREEN_Y=320
+CONFIG_INPUT_EVDEV=m
+CONFIG_INPUT_KEYBOARD=y
+CONFIG_KEYBOARD_ATKBD=y
+CONFIG_KEYBOARD_SUNKBD=m
+CONFIG_KEYBOARD_LKKBD=m
+CONFIG_KEYBOARD_XTKBD=m
+CONFIG_KEYBOARD_NEWTON=m
+CONFIG_INPUT_MOUSE=y
+CONFIG_MOUSE_PS2=m
+CONFIG_MOUSE_SERIAL=m
+CONFIG_MOUSE_APPLETOUCH=m
+CONFIG_MOUSE_VSXXXAA=m
+CONFIG_INPUT_JOYSTICK=y
+CONFIG_JOYSTICK_ANALOG=m
+CONFIG_JOYSTICK_A3D=m
+CONFIG_JOYSTICK_ADI=m
+CONFIG_JOYSTICK_COBRA=m
+CONFIG_JOYSTICK_GF2K=m
+CONFIG_JOYSTICK_GRIP=m
+CONFIG_JOYSTICK_GRIP_MP=m
+CONFIG_JOYSTICK_GUILLEMOT=m
+CONFIG_JOYSTICK_INTERACT=m
+CONFIG_JOYSTICK_SIDEWINDER=m
+CONFIG_JOYSTICK_TMDC=m
+CONFIG_JOYSTICK_IFORCE=m
+CONFIG_JOYSTICK_IFORCE_USB=y
+CONFIG_JOYSTICK_IFORCE_232=y
+CONFIG_JOYSTICK_WARRIOR=m
+CONFIG_JOYSTICK_MAGELLAN=m
+CONFIG_JOYSTICK_SPACEORB=m
+CONFIG_JOYSTICK_SPACEBALL=m
+CONFIG_JOYSTICK_STINGER=m
+CONFIG_JOYSTICK_TWIDJOY=m
+CONFIG_JOYSTICK_DB9=m
+CONFIG_JOYSTICK_GAMECON=m
+CONFIG_JOYSTICK_TURBOGRAFX=m
+CONFIG_JOYSTICK_JOYDUMP=m
+CONFIG_JOYSTICK_XPAD=m
+CONFIG_INPUT_TABLET=y
+CONFIG_TABLET_USB_ACECAD=m
+CONFIG_TABLET_USB_AIPTEK=m
+CONFIG_TABLET_USB_GTCO=m
+CONFIG_TABLET_USB_KBTAB=m
+CONFIG_TABLET_USB_WACOM=m
+CONFIG_INPUT_TOUCHSCREEN=y
+CONFIG_TOUCHSCREEN_GUNZE=m
+CONFIG_TOUCHSCREEN_ELO=m
+CONFIG_TOUCHSCREEN_MTOUCH=m
+CONFIG_TOUCHSCREEN_MK712=m
+CONFIG_TOUCHSCREEN_USB_COMPOSITE=m
+CONFIG_INPUT_MISC=y
+CONFIG_INPUT_PCSPKR=m
+CONFIG_INPUT_ATLAS_BTNS=m
+CONFIG_INPUT_UINPUT=m
+CONFIG_SERIO=y
+CONFIG_SERIO_I8042=y
+CONFIG_SERIO_SERPORT=m
+CONFIG_SERIO_CT82C710=m
+CONFIG_SERIO_PARKBD=m
+CONFIG_SERIO_PCIPS2=m
+CONFIG_SERIO_LIBPS2=y
+CONFIG_SERIO_RAW=m
+CONFIG_GAMEPORT=m
+CONFIG_GAMEPORT_NS558=m
+CONFIG_GAMEPORT_L4=m
+CONFIG_GAMEPORT_EMU10K1=m
+CONFIG_GAMEPORT_FM801=m
+CONFIG_VT=y
+CONFIG_VT_CONSOLE=y
+CONFIG_HW_CONSOLE=y
+CONFIG_SERIAL_NONSTANDARD=y
+CONFIG_ROCKETPORT=m
+CONFIG_CYCLADES=m
+# CONFIG_CYZ_INTR is not set
+CONFIG_MOXA_SMARTIO=m
+CONFIG_ISI=m
+CONFIG_SYNCLINK=m
+CONFIG_SYNCLINKMP=m
+CONFIG_N_HDLC=m
+CONFIG_SPECIALIX=m
+# CONFIG_SPECIALIX_RTSCTS is not set
+CONFIG_SX=m
+CONFIG_STALDRV=y
+CONFIG_SERIAL_8250=y
+CONFIG_SERIAL_8250_CONSOLE=y
+CONFIG_SERIAL_8250_CS=m
+CONFIG_SERIAL_8250_NR_UARTS=16
+CONFIG_SERIAL_8250_EXTENDED=y
+CONFIG_SERIAL_8250_MANY_PORTS=y
+CONFIG_SERIAL_8250_SHARE_IRQ=y
+# CONFIG_SERIAL_8250_DETECT_IRQ is not set
+CONFIG_SERIAL_8250_RSA=y
+CONFIG_SERIAL_CORE=y
+CONFIG_SERIAL_CORE_CONSOLE=y
+CONFIG_SERIAL_JSM=m
+CONFIG_PRINTER=m
+# CONFIG_LP_CONSOLE is not set
+CONFIG_PPDEV=m
+CONFIG_TIPAR=m
+CONFIG_IPMI_HANDLER=m
+# CONFIG_IPMI_PANIC_EVENT is not set
+CONFIG_IPMI_DEVICE_INTERFACE=m
+CONFIG_IPMI_SI=m
+CONFIG_IPMI_WATCHDOG=m
+CONFIG_IPMI_POWEROFF=m
+CONFIG_WATCHDOG=y
+# CONFIG_WATCHDOG_NOWAYOUT is not set
+CONFIG_SOFT_WATCHDOG=m
+CONFIG_ACQUIRE_WDT=m
+CONFIG_ADVANTECH_WDT=m
+CONFIG_ALIM1535_WDT=m
+CONFIG_ALIM7101_WDT=m
+CONFIG_SC520_WDT=m
+CONFIG_EUROTECH_WDT=m
+CONFIG_IB700_WDT=m
+CONFIG_WAFER_WDT=m
+CONFIG_SC1200_WDT=m
+CONFIG_60XX_WDT=m
+CONFIG_CPU5_WDT=m
+CONFIG_W83627HF_WDT=m
+CONFIG_W83877F_WDT=m
+CONFIG_MACHZ_WDT=m
+CONFIG_PCIPCWATCHDOG=m
+CONFIG_WDTPCI=m
+CONFIG_WDT_501_PCI=y
+CONFIG_USBPCWATCHDOG=m
+CONFIG_NVRAM=m
+CONFIG_RTC=y
+CONFIG_GEN_RTC=m
+CONFIG_GEN_RTC_X=y
+CONFIG_DTLK=m
+CONFIG_R3964=m
+CONFIG_APPLICOM=m
+CONFIG_AGP=y
+CONFIG_AGP_AMD64=y
+CONFIG_AGP_INTEL=m
+CONFIG_DRM=m
+CONFIG_DRM_TDFX=m
+CONFIG_DRM_R128=m
+CONFIG_DRM_RADEON=m
+CONFIG_DRM_I810=m
+CONFIG_DRM_I830=m
+CONFIG_DRM_I915=m
+CONFIG_DRM_MGA=m
+CONFIG_DRM_SIS=m
+CONFIG_SYNCLINK_CS=m
+CONFIG_MWAVE=m
+CONFIG_RAW_DRIVER=m
+CONFIG_HPET=y
+# CONFIG_HPET_RTC_IRQ is not set
+CONFIG_HPET_MMAP=y
+CONFIG_MAX_RAW_DEVS=256
+CONFIG_HANGCHECK_TIMER=m
+CONFIG_I2C=m
+CONFIG_I2C_CHARDEV=m
+CONFIG_I2C_ALGOBIT=m
+CONFIG_I2C_ALGOPCF=m
+CONFIG_I2C_ALGOPCA=m
+CONFIG_I2C_ALI1535=m
+CONFIG_I2C_ALI1563=m
+CONFIG_I2C_ALI15X3=m
+CONFIG_I2C_AMD756=m
+CONFIG_I2C_AMD756_S4882=m
+CONFIG_I2C_AMD8111=m
+CONFIG_I2C_I801=m
+CONFIG_I2C_I810=m
+CONFIG_I2C_PIIX4=m
+CONFIG_I2C_NFORCE2=m
+CONFIG_I2C_PARPORT=m
+CONFIG_I2C_PARPORT_LIGHT=m
+CONFIG_I2C_PROSAVAGE=m
+CONFIG_I2C_SAVAGE4=m
+CONFIG_SCx200_ACB=m
+CONFIG_I2C_SIS5595=m
+CONFIG_I2C_SIS630=m
+CONFIG_I2C_SIS96X=m
+CONFIG_I2C_STUB=m
+CONFIG_I2C_VIA=m
+CONFIG_I2C_VIAPRO=m
+CONFIG_I2C_VOODOO3=m
+CONFIG_I2C_PCA_ISA=m
+CONFIG_SENSORS_ADM1021=m
+CONFIG_SENSORS_ADM1025=m
+CONFIG_SENSORS_ADM1026=m
+CONFIG_SENSORS_ADM1031=m
+CONFIG_SENSORS_ASB100=m
+CONFIG_SENSORS_DS1621=m
+CONFIG_SENSORS_F71805F=m
+CONFIG_SENSORS_FSCHER=m
+CONFIG_SENSORS_FSCPOS=m
+CONFIG_SENSORS_GL518SM=m
+CONFIG_SENSORS_GL520SM=m
+CONFIG_SENSORS_IT87=m
+CONFIG_SENSORS_LM63=m
+CONFIG_SENSORS_LM75=m
+CONFIG_SENSORS_LM77=m
+CONFIG_SENSORS_LM78=m
+CONFIG_SENSORS_LM80=m
+CONFIG_SENSORS_LM83=m
+CONFIG_SENSORS_LM85=m
+CONFIG_SENSORS_LM87=m
+CONFIG_SENSORS_LM90=m
+CONFIG_SENSORS_LM92=m
+CONFIG_SENSORS_MAX1619=m
+CONFIG_SENSORS_PC87360=m
+CONFIG_SENSORS_SMSC47B397=m
+CONFIG_SENSORS_SIS5595=m
+CONFIG_SENSORS_SMSC47M1=m
+CONFIG_SENSORS_VIA686A=m
+CONFIG_SENSORS_W83781D=m
+CONFIG_SENSORS_W83L785TS=m
+CONFIG_SENSORS_W83627HF=m
+CONFIG_SENSORS_DS1337=m
+CONFIG_SENSORS_EEPROM=m
+CONFIG_SENSORS_PCF8574=m
+CONFIG_SENSORS_PCF8591=m
+# CONFIG_I2C_DEBUG_CORE is not set
+# CONFIG_I2C_DEBUG_ALGO is not set
+# CONFIG_I2C_DEBUG_BUS is not set
+# CONFIG_I2C_DEBUG_CHIP is not set
+CONFIG_IBM_ASM=m
+CONFIG_PHANTOM=m
+CONFIG_VIDEO_DEV=m
+CONFIG_VIDEO_BT848=m
+CONFIG_VIDEO_BWQCAM=m
+CONFIG_VIDEO_CQCAM=m
+CONFIG_VIDEO_W9966=m
+CONFIG_VIDEO_CPIA=m
+CONFIG_VIDEO_CPIA_PP=m
+CONFIG_VIDEO_CPIA_USB=m
+CONFIG_VIDEO_SAA5246A=m
+CONFIG_VIDEO_SAA5249=m
+CONFIG_TUNER_3036=m
+CONFIG_VIDEO_STRADIS=m
+CONFIG_VIDEO_ZORAN=m
+CONFIG_VIDEO_ZORAN_BUZ=m
+CONFIG_VIDEO_ZORAN_DC10=m
+CONFIG_VIDEO_ZORAN_DC30=m
+CONFIG_VIDEO_ZORAN_LML33=m
+CONFIG_VIDEO_ZORAN_LML33R10=m
+CONFIG_VIDEO_MXB=m
+CONFIG_VIDEO_DPC=m
+CONFIG_VIDEO_HEXIUM_ORION=m
+CONFIG_VIDEO_HEXIUM_GEMINI=m
+CONFIG_VIDEO_CX88=m
+CONFIG_VIDEO_CX88_DVB=m
+CONFIG_VIDEO_OVCAMCHIP=m
+CONFIG_RADIO_GEMTEK_PCI=m
+CONFIG_RADIO_MAXIRADIO=m
+CONFIG_RADIO_MAESTRO=m
+CONFIG_DVB_CORE=m
+CONFIG_VIDEO_SAA7146=m
+CONFIG_VIDEO_SAA7146_VV=m
+CONFIG_VIDEO_TUNER=m
+CONFIG_VIDEO_BUF=m
+CONFIG_VIDEO_BUF_DVB=m
+CONFIG_VIDEO_BTCX=m
+CONFIG_VIDEO_IR=m
+CONFIG_VIDEO_TVEEPROM=m
+CONFIG_BACKLIGHT_PROGEAR=m
+CONFIG_VIDEO_OUTPUT_CONTROL=m
+CONFIG_FB=y
+# CONFIG_FB_MACMODES is not set
+CONFIG_FB_MODE_HELPERS=y
+CONFIG_FB_TILEBLITTING=y
+CONFIG_FB_CIRRUS=m
+CONFIG_FB_PM2=m
+CONFIG_FB_PM2_FIFO_DISCONNECT=y
+CONFIG_FB_CYBER2000=m
+# CONFIG_FB_ASILIANT is not set
+# CONFIG_FB_IMSTT is not set
+CONFIG_FB_VGA16=m
+CONFIG_FB_HECUBA=m
+CONFIG_FB_HGA=m
+# CONFIG_FB_HGA_ACCEL is not set
+CONFIG_FB_NVIDIA=m
+# CONFIG_FB_NVIDIA_I2C is not set
+# CONFIG_FB_RIVA is not set
+# CONFIG_FB_RIVA_I2C is not set
+# CONFIG_FB_RIVA_DEBUG is not set
+CONFIG_FB_LE80578=m
+CONFIG_FB_CARILLO_RANCH=m
+CONFIG_FB_INTEL=m
+CONFIG_FB_MATROX=m
+CONFIG_FB_MATROX_MILLENIUM=y
+CONFIG_FB_MATROX_MYSTIQUE=y
+CONFIG_FB_MATROX_I2C=m
+CONFIG_FB_MATROX_MULTIHEAD=y
+CONFIG_FB_RADEON=m
+CONFIG_FB_RADEON_I2C=y
+# CONFIG_FB_RADEON_DEBUG is not set
+CONFIG_FB_ATY128=m
+CONFIG_FB_ATY=m
+CONFIG_FB_ATY_CT=y
+# CONFIG_FB_ATY_GENERIC_LCD is not set
+CONFIG_FB_ATY_GX=y
+CONFIG_FB_SAVAGE=m
+# CONFIG_FB_SAVAGE_I2C is not set
+# CONFIG_FB_SAVAGE_ACCEL is not set
+CONFIG_FB_SIS=m
+CONFIG_FB_SIS_300=y
+CONFIG_FB_SIS_315=y
+CONFIG_FB_NEOMAGIC=m
+CONFIG_FB_KYRO=m
+CONFIG_FB_3DFX=m
+# CONFIG_FB_3DFX_ACCEL is not set
+CONFIG_FB_VOODOO1=m
+CONFIG_FB_TRIDENT=m
+# CONFIG_FB_TRIDENT_ACCEL is not set
+# CONFIG_FB_GEODE is not set
+CONFIG_FB_S1D13XXX=m
+CONFIG_FB_VIRTUAL=m
+CONFIG_VGA_CONSOLE=y
+CONFIG_DUMMY_CONSOLE=y
+CONFIG_FRAMEBUFFER_CONSOLE=y
+# CONFIG_FONTS is not set
+CONFIG_FONT_8x8=y
+CONFIG_FONT_8x16=y
+# CONFIG_LOGO is not set
+CONFIG_SOUND=m
+CONFIG_SND=m
+CONFIG_SND_TIMER=m
+CONFIG_SND_PCM=m
+CONFIG_SND_HWDEP=m
+CONFIG_SND_SEQUENCER=m
+CONFIG_SND_SEQ_DUMMY=m
+CONFIG_SND_OSSEMUL=y
+CONFIG_SND_MIXER_OSS=m
+CONFIG_SND_PCM_OSS=m
+CONFIG_SND_SEQUENCER_OSS=y
+CONFIG_SND_RTCTIMER=m
+# CONFIG_SND_VERBOSE_PRINTK is not set
+# CONFIG_SND_DEBUG is not set
+CONFIG_SND_MPU401_UART=m
+CONFIG_SND_OPL3_LIB=m
+CONFIG_SND_VX_LIB=m
+CONFIG_SND_DUMMY=m
+CONFIG_SND_VIRMIDI=m
+CONFIG_SND_MTPAV=m
+CONFIG_SND_SERIAL_U16550=m
+CONFIG_SND_MPU401=m
+CONFIG_SND_AC97_CODEC=m
+CONFIG_SND_ALI5451=m
+CONFIG_SND_ATIIXP=m
+CONFIG_SND_ATIIXP_MODEM=m
+CONFIG_SND_AU8810=m
+CONFIG_SND_AU8820=m
+CONFIG_SND_AU8830=m
+CONFIG_SND_AZT3328=m
+CONFIG_SND_BT87X=m
+# CONFIG_SND_BT87X_OVERCLOCK is not set
+CONFIG_SND_CS46XX=m
+CONFIG_SND_CS46XX_NEW_DSP=y
+CONFIG_SND_CS4281=m
+CONFIG_SND_EMU10K1=m
+CONFIG_SND_EMU10K1X=m
+CONFIG_SND_CA0106=m
+CONFIG_SND_KORG1212=m
+CONFIG_SND_MIXART=m
+CONFIG_SND_NM256=m
+CONFIG_SND_RME32=m
+CONFIG_SND_RME96=m
+CONFIG_SND_RME9652=m
+CONFIG_SND_HDSP=m
+CONFIG_SND_TRIDENT=m
+CONFIG_SND_YMFPCI=m
+CONFIG_SND_ALS4000=m
+CONFIG_SND_CMIPCI=m
+CONFIG_SND_ENS1370=m
+CONFIG_SND_ENS1371=m
+CONFIG_SND_ES1938=m
+CONFIG_SND_ES1968=m
+CONFIG_SND_MAESTRO3=m
+CONFIG_SND_FM801=m
+CONFIG_SND_FM801_TEA575X_BOOL=y
+CONFIG_SND_FM801_TEA575X=m
+CONFIG_SND_ICE1712=m
+CONFIG_SND_ICE1724=m
+CONFIG_SND_INTEL8X0=m
+CONFIG_SND_INTEL8X0M=m
+CONFIG_SND_SONICVIBES=m
+CONFIG_SND_VIA82XX=m
+CONFIG_SND_VIA82XX_MODEM=m
+CONFIG_SND_VX222=m
+CONFIG_SND_HDA_INTEL=m
+CONFIG_SND_USB_AUDIO=m
+CONFIG_SND_USB_USX2Y=m
+CONFIG_SOUND_PRIME=m
+CONFIG_SOUND_TRIDENT=m
+# CONFIG_SOUND_MSNDCLAS is not set
+# CONFIG_SOUND_MSNDPIN is not set
+CONFIG_SOUND_OSS=m
+# CONFIG_SOUND_TRACEINIT is not set
+# CONFIG_SOUND_DMAP is not set
+CONFIG_SOUND_SSCAPE=m
+CONFIG_SOUND_VMIDI=m
+CONFIG_SOUND_TRIX=m
+CONFIG_SOUND_MSS=m
+CONFIG_SOUND_MPU401=m
+CONFIG_SOUND_PAS=m
+CONFIG_SOUND_PSS=m
+CONFIG_PSS_MIXER=y
+CONFIG_SOUND_SB=m
+CONFIG_SOUND_YM3812=m
+CONFIG_SOUND_UART6850=m
+CONFIG_SOUND_AEDSP16=m
+CONFIG_SC6600=y
+CONFIG_SC6600_JOY=y
+CONFIG_SC6600_CDROM=4
+CONFIG_SC6600_CDROMBASE=0x0
+# CONFIG_AEDSP16_MSS is not set
+# CONFIG_AEDSP16_SBPRO is not set
+CONFIG_SOUND_KAHLUA=m
+CONFIG_USB_ARCH_HAS_HCD=y
+CONFIG_USB_ARCH_HAS_OHCI=y
+CONFIG_USB=y
+# CONFIG_USB_DEBUG is not set
+CONFIG_USB_DEVICEFS=y
+# CONFIG_USB_DYNAMIC_MINORS is not set
+# CONFIG_USB_OTG is not set
+CONFIG_USB_EHCI_HCD=m
+CONFIG_USB_EHCI_SPLIT_ISO=y
+CONFIG_USB_EHCI_ROOT_HUB_TT=y
+CONFIG_USB_OHCI_HCD=m
+CONFIG_USB_OHCI_LITTLE_ENDIAN=y
+CONFIG_USB_UHCI_HCD=m
+CONFIG_USB_SL811_HCD=m
+CONFIG_USB_SL811_CS=m
+CONFIG_USB_ACM=m
+CONFIG_USB_PRINTER=m
+CONFIG_USB_STORAGE=m
+# CONFIG_USB_STORAGE_DEBUG is not set
+CONFIG_USB_STORAGE_DATAFAB=y
+CONFIG_USB_STORAGE_FREECOM=y
+CONFIG_USB_STORAGE_ISD200=y
+CONFIG_USB_STORAGE_DPCM=y
+CONFIG_USB_STORAGE_USBAT=y
+CONFIG_USB_STORAGE_SDDR09=y
+CONFIG_USB_STORAGE_SDDR55=y
+CONFIG_USB_STORAGE_JUMPSHOT=y
+CONFIG_HID_SUPPORT=y
+CONFIG_USB_HID=m
+CONFIG_USB_HIDINPUT_POWERBOOK=y
+# CONFIG_HID_FF is not set
+CONFIG_USB_HIDDEV=y
+CONFIG_USB_KBD=m
+CONFIG_USB_MOUSE=m
+CONFIG_USB_SUPPORT=y
+CONFIG_USB_MDC800=m
+CONFIG_USB_MICROTEK=m
+CONFIG_USB_VICAM=m
+CONFIG_USB_DSBR=m
+CONFIG_USB_IBMCAM=m
+CONFIG_USB_KONICAWC=m
+CONFIG_USB_OV511=m
+CONFIG_USB_SE401=m
+CONFIG_USB_SN9C102=m
+CONFIG_USB_STV680=m
+CONFIG_USB_W9968CF=m
+CONFIG_USB_PWC=m
+CONFIG_USB_CATC=m
+CONFIG_USB_KAWETH=m
+CONFIG_USB_PEGASUS=m
+CONFIG_USB_RTL8150=m
+CONFIG_USB_USBNET=m
+CONFIG_USB_ALI_M5632=y
+CONFIG_USB_AN2720=y
+CONFIG_USB_BELKIN=y
+CONFIG_USB_ARMLINUX=y
+CONFIG_USB_EPSON2888=y
+CONFIG_USB_ZD1201=m
+CONFIG_USB_USS720=m
+CONFIG_USB_AUERSWALD=m
+CONFIG_USB_RIO500=m
+CONFIG_USB_LEGOTOWER=m
+CONFIG_USB_LCD=m
+CONFIG_USB_LED=m
+CONFIG_USB_CYTHERM=m
+CONFIG_USB_PHIDGETKIT=m
+CONFIG_USB_PHIDGETSERVO=m
+CONFIG_USB_IDMOUSE=m
+CONFIG_USB_SISUSBVGA=m
+CONFIG_USB_TEST=m
+CONFIG_USB_ATM=m
+CONFIG_USB_SPEEDTOUCH=m
+CONFIG_USB_GADGET=m
+# CONFIG_USB_GADGET_DEBUG_FILES is not set
+CONFIG_USB_GADGET_NET2280=y
+CONFIG_USB_NET2280=m
+# CONFIG_USB_GADGET_PXA2XX is not set
+# CONFIG_USB_GADGET_GOKU is not set
+# CONFIG_USB_GADGET_LH7A40X is not set
+# CONFIG_USB_GADGET_OMAP is not set
+# CONFIG_USB_GADGET_DUMMY_HCD is not set
+CONFIG_USB_GADGET_DUALSPEED=y
+CONFIG_USB_ZERO=m
+CONFIG_USB_ETH=m
+CONFIG_USB_ETH_RNDIS=y
+CONFIG_USB_GADGETFS=m
+CONFIG_USB_FILE_STORAGE=m
+# CONFIG_USB_FILE_STORAGE_TEST is not set
+CONFIG_USB_G_SERIAL=m
+CONFIG_MMC=m
+# CONFIG_MMC_DEBUG is not set
+CONFIG_MMC_BLOCK=m
+CONFIG_MMC_WBSD=m
+CONFIG_EDD=m
+CONFIG_DELL_RBU=m
+CONFIG_JBD=m
+CONFIG_XFS_RT=y
+CONFIG_ADFS_FS=m
+# CONFIG_ADFS_FS_RW is not set
+CONFIG_AFFS_FS=m
+CONFIG_HFS_FS=m
+CONFIG_HFSPLUS_FS=m
+CONFIG_BEFS_FS=m
+# CONFIG_BEFS_DEBUG is not set
+CONFIG_BFS_FS=m
+CONFIG_EFS_FS=m
+CONFIG_JFFS2_FS=m
+CONFIG_JFFS2_FS_DEBUG=0
+# CONFIG_JFFS2_COMPRESSION_OPTIONS is not set
+CONFIG_JFFS2_ZLIB=y
+CONFIG_JFFS2_RTIME=y
+# CONFIG_JFFS2_RUBIN is not set
+CONFIG_VXFS_FS=m
+CONFIG_HPFS_FS=m
+CONFIG_QNX4FS_FS=m
+CONFIG_SYSV_FS=m
+CONFIG_UFS_FS=m
+# CONFIG_UFS_FS_WRITE is not set
+CONFIG_SUNRPC_GSS=m
+CONFIG_RPCSEC_GSS_KRB5=m
+CONFIG_RPCSEC_GSS_SPKM3=m
+CONFIG_SMB_FS=m
+# CONFIG_SMB_NLS_DEFAULT is not set
+CONFIG_CIFS=m
+# CONFIG_CIFS_STATS is not set
+# CONFIG_CIFS_XATTR is not set
+# CONFIG_CIFS_EXPERIMENTAL is not set
+CONFIG_NCP_FS=m
+CONFIG_NCPFS_PACKET_SIGNING=y
+CONFIG_NCPFS_IOCTL_LOCKING=y
+CONFIG_NCPFS_STRONG=y
+CONFIG_NCPFS_NFS_NS=y
+CONFIG_NCPFS_OS2_NS=y
+# CONFIG_NCPFS_SMALLDOS is not set
+CONFIG_NCPFS_NLS=y
+CONFIG_NCPFS_EXTRAS=y
+CONFIG_CODA_FS=m
+# CONFIG_CODA_FS_OLD_API is not set
+CONFIG_AFS_FS=m
+# CONFIG_AFS_DEBUG is not set
+CONFIG_ACORN_PARTITION=y
+# CONFIG_ACORN_PARTITION_CUMANA is not set
+# CONFIG_ACORN_PARTITION_EESOX is not set
+CONFIG_ACORN_PARTITION_ICS=y
+# CONFIG_ACORN_PARTITION_ADFS is not set
+# CONFIG_ACORN_PARTITION_POWERTEC is not set
+CONFIG_ACORN_PARTITION_RISCIX=y
+CONFIG_OSF_PARTITION=y
+CONFIG_AMIGA_PARTITION=y
+CONFIG_ATARI_PARTITION=y
+CONFIG_MAC_PARTITION=y
+CONFIG_BSD_DISKLABEL=y
+CONFIG_MINIX_SUBPARTITION=y
+CONFIG_SOLARIS_X86_PARTITION=y
+CONFIG_UNIXWARE_DISKLABEL=y
+CONFIG_LDM_PARTITION=y
+# CONFIG_LDM_DEBUG is not set
+CONFIG_SGI_PARTITION=y
+CONFIG_ULTRIX_PARTITION=y
+CONFIG_SUN_PARTITION=y
+CONFIG_EFI_PARTITION=y
+CONFIG_PROFILING=y
+CONFIG_OPROFILE=m
+CONFIG_DEBUG_KERNEL=y
+CONFIG_MAGIC_SYSRQ=y
+CONFIG_LOG_BUF_SHIFT=16
+# CONFIG_DEBUG_SHIRQ is not set
+# CONFIG_SCHEDSTATS is not set
+CONFIG_TIMER_STATS=y
+# CONFIG_DEBUG_SLAB is not set
+# CONFIG_DEBUG_SPINLOCK is not set
+# CONFIG_DEBUG_SPINLOCK_SLEEP is not set
+# CONFIG_DEBUG_KOBJECT is not set
+# CONFIG_DEBUG_INFO is not set
+# CONFIG_FAULT_INJECTION is not set
+# CONFIG_IOMMU_DEBUG is not set
+# CONFIG_KPROBES is not set
+CONFIG_CRC_CCITT=m
+CONFIG_CRC32=y
+CONFIG_REED_SOLOMON=m
+CONFIG_REED_SOLOMON_DEC16=y
+CONFIG_HAVE_ARCH_EARLY_PFN_TO_NID=y
+CONFIG_KEXEC=y
+CONFIG_CRYPTO_AES_X86_64=m
+CONFIG_JFFS2_FS_WRITEBUFFER=y
+CONFIG_FB_VESA=y
+CONFIG_HPET_EMULATE_RTC=y
+CONFIG_FB_CFB_IMAGEBLIT=y
+CONFIG_ATP=m
+CONFIG_DE620=m
+# CONFIG_FRAME_POINTER is not set
+CONFIG_DE600=m
+CONFIG_DCDBAS=m
+CONFIG_SENSORS_HDAPS=m
+CONFIG_IBMASR=m
+CONFIG_SBC8360_WDT=m
+CONFIG_W83977F_WDT=m
+CONFIG_I6300ESB_WDT=m
+CONFIG_USB_SUSPEND=y
+CONFIG_SPLIT_PTLOCK_CPUS=4
+CONFIG_PM_LEGACY=y
+CONFIG_CC_OPTIMIZE_FOR_SIZE=y
+# CONFIG_IPW2100 is not set
+CONFIG_SERIAL_8250_RUNTIME_UARTS=4
+CONFIG_X86_PC=y
+# CONFIG_X86_VSMP is not set
+CONFIG_ARCH_SPARSEMEM_ENABLE=y
+CONFIG_COMPUTONE=m
+CONFIG_MOXA_INTELLIO=m
+CONFIG_PCI_MSI=y
+# CONFIG_EDAC_DEBUG is not set
+CONFIG_EDAC_I82875P=m
+CONFIG_EDAC_AMD76X=m
+CONFIG_EDAC_E7XXX=m
+CONFIG_EDAC=y
+CONFIG_EDAC_MM_EDAC=m
+CONFIG_EDAC_I82860=m
+CONFIG_EDAC_E752X=m
+CONFIG_EDAC_R82600=m
+CONFIG_AGP_VIA=m
+CONFIG_PHYSICAL_START=0x200000
+CONFIG_HOTPLUG_CPU=y
+CONFIG_X86_INTERNODE_CACHE_BYTES=128
+CONFIG_ACPI_HOTPLUG_MEMORY=m
+CONFIG_AGP_SIS=m
+CONFIG_RIO=m
+CONFIG_RIO_OLDPCI=y
+CONFIG_ARCH_ENABLE_MEMORY_HOTPLUG=y
+CONFIG_X86_HT=y
+CONFIG_SCHED_SMT=y
+CONFIG_SCHED_MC=y
+CONFIG_CALGARY_IOMMU=y
+CONFIG_K8_NB=y
+CONFIG_HW_RANDOM_GEODE=m
+CONFIG_INTEL_IOATDMA=m
+CONFIG_HW_RANDOM_AMD=m
+CONFIG_RESOURCES_64BIT=y
+CONFIG_IOMMU=y
+CONFIG_HW_RANDOM_INTEL=m
+CONFIG_ACPI_SBS=m
+CONFIG_AUDIT_ARCH=y
+CONFIG_SCSI_ARCMSR=m
+CONFIG_PCIEAER=y
+CONFIG_HT_IRQ=y
+CONFIG_SENSORS_K8TEMP=m
+CONFIG_CRYPTO_TWOFISH_X86_64=m
+CONFIG_ARCH_POPULATES_NODE_MAP=y
+CONFIG_BLK_DEV_IDEPNP=y
+CONFIG_CALGARY_IOMMU_ENABLED_BY_DEFAULT=y
+CONFIG_KS0108=m
+CONFIG_KS0108_PORT=0x378
+CONFIG_KS0108_DELAY=2
+CONFIG_VIRTUALIZATION=y
+CONFIG_KVM=m
+CONFIG_KVM_INTEL=m
+# CONFIG_HZ_300 is not set
+# CONFIG_MCORE2 is not set
+CONFIG_KVM_AMD=m
+# CONFIG_ARCH_HAS_ILOG2_U64 is not set
+# CONFIG_DEBUG_RODATA is not set
+# CONFIG_LOCK_STAT is not set
+CONFIG_GENERIC_PENDING_IRQ=y
+CONFIG_FB_ATY128_BACKLIGHT=y
+CONFIG_FB_ATY_BACKLIGHT=y
+CONFIG_FB_BACKLIGHT=y
+CONFIG_FB_DEFERRED_IO=y
+CONFIG_FB_NVIDIA_BACKLIGHT=y
+CONFIG_FB_RADEON_BACKLIGHT=y
+CONFIG_FB_SVGALIB=m
+CONFIG_FB_SYS_COPYAREA=m
+CONFIG_FB_SYS_FILLRECT=m
+CONFIG_FB_SYS_FOPS=m
+CONFIG_FB_SYS_IMAGEBLIT=m
+CONFIG_VIDEO_IR_I2C=m
+CONFIG_MICROCODE_OLD_INTERFACE=y
+CONFIG_HOTPLUG=y
+CONFIG_EDAC_I5000=m
+CONFIG_MAC_EMUMOUSEBTN=y
+CONFIG_HAS_IOPORT=y
+CONFIG_MOUSE_PS2_LIFEBOOK=y
+CONFIG_PM_SLEEP=y
+CONFIG_HIBERNATION_SMP_POSSIBLE=y
+CONFIG_HAS_DMA=y
+CONFIG_BASE_SMALL=0
+CONFIG_JOYSTICK_XPAD_LEDS=y
+CONFIG_COMPAT_FOR_U64_ALIGNMENT=y
+CONFIG_GENERIC_TIME=y
+CONFIG_GENERIC_TIME_VSYSCALL=y
+CONFIG_FIX_EARLYCON_MEM=y
+CONFIG_QUICKLIST=y
+# CONFIG_USB_OHCI_BIG_ENDIAN_DESC is not set
+CONFIG_ZONE_DMA=y
+CONFIG_HAS_IOMEM=y
+# CONFIG_DEFXX_MMIO is not set
+CONFIG_MACINTOSH_DRIVERS=y
+CONFIG_PM_SLEEP_SMP=y
+CONFIG_ZONE_DMA_FLAG=1
+CONFIG_PATA_ARTOP=m
+CONFIG_BOUNCE=y
+CONFIG_NR_QUICK=2
+CONFIG_ARCH_MAY_HAVE_PC_FDC=y
+CONFIG_ACPI_BAY=m
+CONFIG_MOUSE_PS2_LOGIPS2PP=y
+CONFIG_GENERIC_CMOS_UPDATE=y
+CONFIG_MOUSE_PS2_TRACKPOINT=y
+CONFIG_ARCH_SUPPORTS_MSI=y
+# CONFIG_IDEPCI_PCIBUS_ORDER is not set
+CONFIG_ASYNC_CORE=m
+CONFIG_MMU=y
+CONFIG_JOYSTICK_XPAD_FF=y
+CONFIG_MOUSE_PS2_SYNAPTICS=y
+CONFIG_PHYSICAL_ALIGN=0x200000
+CONFIG_VIRT_TO_BUS=y
+CONFIG_BASE_FULL=y
+CONFIG_GENERIC_HWEIGHT=y
+CONFIG_SUSPEND_SMP_POSSIBLE=y
+CONFIG_BLK_DEV_IDEACPI=y
+# CONFIG_USB_OHCI_BIG_ENDIAN_MMIO is not set
+CONFIG_NETDEVICES_MULTIQUEUE=y

Added: dists/sid/linux-2.6/debian/config/amd64/config.amd64
==============================================================================
--- (empty file)
+++ dists/sid/linux-2.6/debian/config/amd64/config.amd64	Mon Nov 26 20:06:56 2007
@@ -0,0 +1,33 @@
+CONFIG_LOCK_KERNEL=y
+CONFIG_STOP_MACHINE=y
+CONFIG_SMP=y
+# CONFIG_NUMA_EMU is not set
+CONFIG_NUMA=y
+CONFIG_NR_CPUS=32
+# CONFIG_CPU_FREQ_STAT_DETAILS is not set
+CONFIG_R8169_VLAN=y
+CONFIG_FB_MATROX_G=y
+CONFIG_FB_MATROX_MAVEN=m
+CONFIG_FS_MBCACHE=m
+CONFIG_NEED_MULTIPLE_NODES=y
+CONFIG_HAVE_MEMORY_PRESENT=y
+CONFIG_DIGIEPCA=m
+CONFIG_ARCH_DISCONTIGMEM_DEFAULT=y
+# CONFIG_FLATMEM_MANUAL is not set
+CONFIG_ARCH_DISCONTIGMEM_ENABLE=y
+# CONFIG_SPARSEMEM_MANUAL is not set
+CONFIG_DISCONTIGMEM=y
+CONFIG_DISCONTIGMEM_MANUAL=y
+CONFIG_ACPI_NUMA=y
+CONFIG_MIGRATION=y
+CONFIG_OUT_OF_LINE_PFN_TO_PAGE=y
+CONFIG_ACPI_HOTPLUG_CPU=y
+CONFIG_NODES_SHIFT=6
+CONFIG_X86_L1_CACHE_BYTES=128
+CONFIG_X86_MCE_AMD=y
+CONFIG_X86_64_ACPI_NUMA=y
+CONFIG_K8_NUMA=y
+CONFIG_X86_L1_CACHE_SHIFT=7
+# CONFIG_MPSC is not set
+# CONFIG_MK8 is not set
+CONFIG_GENERIC_CPU=y

Added: dists/sid/linux-2.6/debian/config/amd64/defines
==============================================================================
--- (empty file)
+++ dists/sid/linux-2.6/debian/config/amd64/defines	Mon Nov 26 20:06:56 2007
@@ -0,0 +1,22 @@
+[base]
+featuresets:
+ vserver
+ xen
+ xen-vserver
+flavours:
+ amd64
+kernel-arch: x86_64
+kernel-header-dirs: x86_64 i386
+
+[xen_base]
+enabled: false
+
+[image]
+conflicts: grub (<= 0.95+cvs20040624-17)
+depends: e2fsprogs (>= 1.35-7)
+suggests: grub (>= 0.97-3) | lilo (>= 19.1)
+
+[amd64_base]
+class: AMD64
+longclass: all 64bit single- and multiprocessor AMD and Intel
+

Added: dists/sid/linux-2.6/debian/config/amd64/vserver/defines
==============================================================================
--- (empty file)
+++ dists/sid/linux-2.6/debian/config/amd64/vserver/defines	Mon Nov 26 20:06:56 2007
@@ -0,0 +1,7 @@
+[base]
+flavours:
+ amd64
+
+[image]
+recommends: util-vserver
+

Added: dists/sid/linux-2.6/debian/config/amd64/xen-vserver/defines
==============================================================================
--- (empty file)
+++ dists/sid/linux-2.6/debian/config/amd64/xen-vserver/defines	Mon Nov 26 20:06:56 2007
@@ -0,0 +1,16 @@
+[base]
+flavours:
+ amd64
+
+[image]
+configs: amd64/xen/config
+initramfs-generators: initramfs-tools 
+suggests: grub (>= 0.97-16)
+type: plain-xen
+
+[xen]
+flavour: amd64
+
+[amd64_image]
+configs: amd64/config.amd64
+

Added: dists/sid/linux-2.6/debian/config/amd64/xen/config
==============================================================================
--- (empty file)
+++ dists/sid/linux-2.6/debian/config/amd64/xen/config	Mon Nov 26 20:06:56 2007
@@ -0,0 +1 @@
+CONFIG_X86_64_XEN=y

Added: dists/sid/linux-2.6/debian/config/amd64/xen/defines
==============================================================================
--- (empty file)
+++ dists/sid/linux-2.6/debian/config/amd64/xen/defines	Mon Nov 26 20:06:56 2007
@@ -0,0 +1,15 @@
+[base]
+flavours:
+ amd64
+
+[image]
+initramfs-generators: initramfs-tools 
+suggests: grub (>= 0.97-16)
+type: plain-xen
+
+[xen]
+flavour: amd64
+
+[amd64_image]
+configs: amd64/config.amd64
+

Added: dists/sid/linux-2.6/debian/config/arm/config
==============================================================================
--- (empty file)
+++ dists/sid/linux-2.6/debian/config/arm/config	Mon Nov 26 20:06:56 2007
@@ -0,0 +1,33 @@
+CONFIG_ARM=y
+# CONFIG_GENERIC_TIME is not set
+# CONFIG_CIFS_EXPERIMENTAL is not set
+CONFIG_SLIP_SMART=y
+CONFIG_SUNRPC_GSS=m
+# CONFIG_SMB_NLS_DEFAULT is not set
+# CONFIG_CODA_FS_OLD_API is not set
+CONFIG_CIFS_STATS=y
+CONFIG_CIFS_XATTR=y
+# CONFIG_SLIP_MODE_SLIP6 is not set
+CONFIG_SLIP_COMPRESSED=y
+CONFIG_ECONET_AUNUDP=y
+# CONFIG_CIFS_POSIX is not set
+CONFIG_ECONET_NATIVE=y
+CONFIG_EQUALIZER=m
+CONFIG_CC_OPTIMIZE_FOR_SIZE=y
+# CONFIG_IPW2100 is not set
+CONFIG_JBD=y
+# CONFIG_ARCH_REALVIEW is not set
+CONFIG_TMPFS=y
+# CONFIG_AEABI is not set
+# CONFIG_BLK_DEV_3W_XXXX_RAID is not set
+# CONFIG_SCSI_3W_9XXX is not set
+# CONFIG_SCSI_AIC7XXX_OLD is not set
+# CONFIG_SCSI_AACRAID is not set
+# CONFIG_SCSI_AIC7XXX is not set
+# CONFIG_SCSI_AIC79XX is not set
+# CONFIG_MEGARAID_SAS is not set
+# CONFIG_INPUT_FF_MEMLESS is not set
+# CONFIG_SCSI_QLA_FC is not set
+# CONFIG_SCSI_QLA_ISCSI is not set
+# CONFIG_SCSI_AIC94XX is not set
+# CONFIG_SCSI_HPTIOP is not set

Added: dists/sid/linux-2.6/debian/config/arm/config.footbridge
==============================================================================
--- (empty file)
+++ dists/sid/linux-2.6/debian/config/arm/config.footbridge	Mon Nov 26 20:06:56 2007
@@ -0,0 +1,1838 @@
+CONFIG_RWSEM_GENERIC_SPINLOCK=y
+CONFIG_GENERIC_HWEIGHT=y
+CONFIG_GENERIC_CALIBRATE_DELAY=y
+CONFIG_ARCH_MAY_HAVE_PC_FDC=y
+CONFIG_VECTORS_BASE=0xffff0000
+
+#
+# Code maturity level options
+#
+CONFIG_EXPERIMENTAL=y
+CONFIG_BROKEN_ON_SMP=y
+
+#
+# General setup
+#
+CONFIG_LOCALVERSION=""
+# CONFIG_LOCALVERSION_AUTO is not set
+CONFIG_SWAP=y
+CONFIG_SYSVIPC=y
+# CONFIG_POSIX_MQUEUE is not set
+CONFIG_BSD_PROCESS_ACCT=y
+# CONFIG_BSD_PROCESS_ACCT_V3 is not set
+CONFIG_AUDIT=y
+# CONFIG_IKCONFIG is not set
+CONFIG_INITRAMFS_SOURCE=""
+CONFIG_UID16=y
+CONFIG_EMBEDDED=y
+# CONFIG_KALLSYMS_ALL is not set
+CONFIG_HOTPLUG=y
+CONFIG_BASE_FULL=y
+CONFIG_CC_ALIGN_FUNCTIONS=0
+CONFIG_CC_ALIGN_LABELS=0
+CONFIG_CC_ALIGN_LOOPS=0
+CONFIG_CC_ALIGN_JUMPS=0
+CONFIG_SLAB=y
+CONFIG_BASE_SMALL=0
+# CONFIG_SLOB is not set
+CONFIG_OBSOLETE_INTERMODULE=y
+
+#
+# Loadable module support
+#
+CONFIG_MODULES=y
+CONFIG_OBSOLETE_MODPARM=y
+CONFIG_KMOD=y
+
+#
+# System Type
+#
+# CONFIG_ARCH_AAEC2000 is not set
+# CONFIG_ARCH_INTEGRATOR is not set
+# CONFIG_ARCH_REALVIEW is not set
+# CONFIG_ARCH_VERSATILE is not set
+# CONFIG_ARCH_AT91 is not set
+# CONFIG_ARCH_CLPS7500 is not set
+# CONFIG_ARCH_CLPS711X is not set
+# CONFIG_ARCH_CO285 is not set
+# CONFIG_ARCH_EBSA110 is not set
+# CONFIG_ARCH_EP93XX is not set
+CONFIG_ARCH_FOOTBRIDGE=y
+# CONFIG_ARCH_NETX is not set
+# CONFIG_ARCH_H720X is not set
+# CONFIG_ARCH_IMX is not set
+# CONFIG_ARCH_IOP32X is not set
+# CONFIG_ARCH_IOP33X is not set
+# CONFIG_ARCH_IXP4XX is not set
+# CONFIG_ARCH_IXP2000 is not set
+# CONFIG_ARCH_IXP23XX is not set
+# CONFIG_ARCH_L7200 is not set
+# CONFIG_ARCH_PNX4008 is not set
+# CONFIG_ARCH_PXA is not set
+# CONFIG_ARCH_RPC is not set
+# CONFIG_ARCH_SA1100 is not set
+# CONFIG_ARCH_S3C2410 is not set
+# CONFIG_ARCH_SHARK is not set
+# CONFIG_ARCH_LH7A40X is not set
+# CONFIG_ARCH_OMAP is not set
+
+#
+# Footbridge Implementations
+#
+CONFIG_ARCH_CATS=y
+CONFIG_ARCH_PERSONAL_SERVER=y
+# CONFIG_ARCH_EBSA285_ADDIN is not set
+CONFIG_ARCH_EBSA285_HOST=y
+CONFIG_ARCH_NETWINDER=y
+CONFIG_FOOTBRIDGE=y
+CONFIG_FOOTBRIDGE_HOST=y
+CONFIG_ARCH_EBSA285=y
+
+#
+# Processor Type
+#
+CONFIG_CPU_32=y
+CONFIG_CPU_SA110=y
+CONFIG_CPU_32v4=y
+CONFIG_CPU_ABRT_EV4=y
+CONFIG_CPU_CACHE_V4WB=y
+CONFIG_CPU_CACHE_VIVT=y
+CONFIG_CPU_COPY_V4WB=y
+CONFIG_CPU_TLB_V4WB=y
+
+#
+# Processor Features
+#
+
+#
+# Bus support
+#
+CONFIG_ISA=y
+CONFIG_ISA_DMA=y
+CONFIG_ISA_DMA_API=y
+CONFIG_PCI=y
+# CONFIG_PCI_DEBUG is not set
+
+#
+# PCCARD (PCMCIA/CardBus) support
+#
+# CONFIG_PCCARD is not set
+
+#
+# Kernel Features
+#
+# CONFIG_PREEMPT is not set
+# CONFIG_NO_IDLE_HZ is not set
+# CONFIG_ARCH_DISCONTIGMEM_ENABLE is not set
+CONFIG_SELECT_MEMORY_MODEL=y
+CONFIG_FLATMEM_MANUAL=y
+# CONFIG_DISCONTIGMEM_MANUAL is not set
+# CONFIG_SPARSEMEM_MANUAL is not set
+CONFIG_FLATMEM=y
+CONFIG_FLAT_NODE_MEM_MAP=y
+# CONFIG_SPARSEMEM_STATIC is not set
+CONFIG_LEDS=y
+CONFIG_LEDS_TIMER=y
+# CONFIG_LEDS_CPU is not set
+CONFIG_ALIGNMENT_TRAP=y
+
+#
+# Boot options
+#
+CONFIG_ZBOOT_ROM_TEXT=0x0
+CONFIG_ZBOOT_ROM_BSS=0x0
+CONFIG_CMDLINE=""
+# CONFIG_XIP_KERNEL is not set
+
+#
+# Floating point emulation
+#
+
+#
+# At least one emulation must be selected
+#
+CONFIG_FPE_NWFPE=y
+CONFIG_FPE_NWFPE_XP=y
+# CONFIG_FPE_FASTFPE is not set
+
+#
+# Userspace binary formats
+#
+CONFIG_BINFMT_ELF=y
+CONFIG_BINFMT_AOUT=y
+CONFIG_BINFMT_MISC=m
+# CONFIG_ARTHUR is not set
+
+#
+# Power management options
+#
+# CONFIG_PM is not set
+# CONFIG_APM is not set
+
+#
+# Networking
+#
+
+#
+# Networking options
+#
+# CONFIG_NET_KEY is not set
+# CONFIG_IP_ADVANCED_ROUTER is not set
+CONFIG_IP_PNP=y
+# CONFIG_IP_PNP_DHCP is not set
+CONFIG_IP_PNP_BOOTP=y
+# CONFIG_IP_PNP_RARP is not set
+# CONFIG_NET_IPIP is not set
+# CONFIG_NET_IPGRE is not set
+# CONFIG_IP_MROUTE is not set
+
+#
+# TCP congestion control
+#
+CONFIG_TCP_CONG_BIC=m
+
+#
+# DCCP Configuration (EXPERIMENTAL)
+#
+CONFIG_IP_DCCP=m
+
+#
+# DCCP CCIDs Configuration (EXPERIMENTAL)
+#
+CONFIG_IP_DCCP_CCID3=m
+CONFIG_IP_DCCP_TFRC_LIB=m
+
+#
+# SCTP Configuration (EXPERIMENTAL)
+#
+# CONFIG_IP_SCTP is not set
+CONFIG_ATM=y
+# CONFIG_ATM_CLIP is not set
+# CONFIG_ATM_LANE is not set
+# CONFIG_ATM_BR2684 is not set
+# CONFIG_BRIDGE is not set
+# CONFIG_VLAN_8021Q is not set
+# CONFIG_DECNET is not set
+# CONFIG_LLC2 is not set
+# CONFIG_IPX is not set
+# CONFIG_ATALK is not set
+# CONFIG_X25 is not set
+# CONFIG_LAPB is not set
+# CONFIG_NET_DIVERT is not set
+# CONFIG_ECONET is not set
+# CONFIG_WAN_ROUTER is not set
+# CONFIG_NET_SCHED is not set
+
+#
+# Network testing
+#
+# CONFIG_HAMRADIO is not set
+CONFIG_IRDA=m
+
+#
+# IrDA protocols
+#
+CONFIG_IRLAN=m
+CONFIG_IRNET=m
+CONFIG_IRCOMM=m
+CONFIG_IRDA_ULTRA=y
+
+#
+# IrDA options
+#
+CONFIG_IRDA_CACHE_LAST_LSAP=y
+CONFIG_IRDA_FAST_RR=y
+CONFIG_IRDA_DEBUG=y
+
+#
+# Infrared-port device drivers
+#
+
+#
+# SIR device drivers
+#
+# CONFIG_IRTTY_SIR is not set
+
+#
+# Dongle support
+#
+
+#
+# Old SIR device drivers
+#
+# CONFIG_IRPORT_SIR is not set
+
+#
+# Old Serial dongle support
+#
+
+#
+# FIR device drivers
+#
+# CONFIG_USB_IRDA is not set
+# CONFIG_SIGMATEL_FIR is not set
+# CONFIG_NSC_FIR is not set
+CONFIG_WINBOND_FIR=m
+# CONFIG_TOSHIBA_FIR is not set
+# CONFIG_SMC_IRCC_FIR is not set
+# CONFIG_ALI_FIR is not set
+# CONFIG_VLSI_FIR is not set
+# CONFIG_VIA_FIR is not set
+# CONFIG_BT is not set
+CONFIG_IEEE80211=m
+# CONFIG_IEEE80211_DEBUG is not set
+CONFIG_IEEE80211_CRYPT_WEP=m
+CONFIG_IEEE80211_CRYPT_CCMP=m
+CONFIG_IEEE80211_CRYPT_TKIP=m
+
+#
+# Device Drivers
+#
+
+#
+# Generic Driver Options
+#
+CONFIG_STANDALONE=y
+CONFIG_PREVENT_FIRMWARE_BUILD=y
+CONFIG_FW_LOADER=m
+# CONFIG_DEBUG_DRIVER is not set
+
+#
+# Memory Technology Devices (MTD)
+#
+CONFIG_MTD=y
+CONFIG_MTD_CHAR=y
+CONFIG_MTD_BLOCK=y
+CONFIG_MTD_CFI=y
+CONFIG_MTD_JEDECPROBE=y
+CONFIG_MTD_GEN_PROBE=y
+# CONFIG_MTD_CFI_ADV_OPTIONS is not set
+CONFIG_MTD_MAP_BANK_WIDTH_1=y
+CONFIG_MTD_MAP_BANK_WIDTH_2=y
+CONFIG_MTD_MAP_BANK_WIDTH_4=y
+# CONFIG_MTD_MAP_BANK_WIDTH_8 is not set
+# CONFIG_MTD_MAP_BANK_WIDTH_16 is not set
+# CONFIG_MTD_MAP_BANK_WIDTH_32 is not set
+CONFIG_MTD_CFI_I1=y
+CONFIG_MTD_CFI_I2=y
+# CONFIG_MTD_CFI_I4 is not set
+# CONFIG_MTD_CFI_I8 is not set
+CONFIG_MTD_CFI_INTELEXT=y
+CONFIG_MTD_CFI_AMDSTD=y
+CONFIG_MTD_CFI_AMDSTD_RETRY=0
+CONFIG_MTD_CFI_STAA=y
+CONFIG_MTD_CFI_UTIL=y
+# CONFIG_MTD_RAM is not set
+# CONFIG_MTD_ROM is not set
+# CONFIG_MTD_ABSENT is not set
+# CONFIG_MTD_XIP is not set
+# Mapping drivers for chip access
+#
+CONFIG_MTD_COMPLEX_MAPPINGS=y
+# CONFIG_MTD_PHYSMAP is not set
+# CONFIG_MTD_ARM_INTEGRATOR is not set
+CONFIG_MTD_DC21285=y
+# CONFIG_MTD_IMPA7 is not set
+# CONFIG_MTD_PCI is not set
+# CONFIG_MTD_PLATRAM is not set
+
+#
+# Parallel port support
+#
+# CONFIG_PARPORT_ARC is not set
+
+#
+# Plug and Play support
+#
+CONFIG_PNP=y
+# CONFIG_PNP_DEBUG is not set
+
+#
+# Protocols
+#
+CONFIG_ISAPNP=y
+
+#
+# Block devices
+#
+# CONFIG_BLK_DEV_FD is not set
+# CONFIG_BLK_DEV_XD is not set
+CONFIG_PARIDE=m
+
+#
+# Parallel IDE high-level drivers
+#
+CONFIG_PARIDE_PD=m
+CONFIG_PARIDE_PCD=m
+CONFIG_PARIDE_PF=m
+CONFIG_PARIDE_PT=m
+CONFIG_PARIDE_PG=m
+
+#
+# Parallel IDE protocol modules
+#
+CONFIG_PARIDE_ATEN=m
+CONFIG_PARIDE_BPCK=m
+# CONFIG_PARIDE_BPCK6 is not set
+CONFIG_PARIDE_COMM=m
+CONFIG_PARIDE_DSTR=m
+CONFIG_PARIDE_FIT2=m
+CONFIG_PARIDE_FIT3=m
+CONFIG_PARIDE_EPAT=m
+# CONFIG_PARIDE_EPATC8 is not set
+CONFIG_PARIDE_EPIA=m
+CONFIG_PARIDE_FRIQ=m
+CONFIG_PARIDE_FRPW=m
+CONFIG_PARIDE_KBIC=m
+CONFIG_PARIDE_KTTI=m
+CONFIG_PARIDE_ON20=m
+CONFIG_PARIDE_ON26=m
+# CONFIG_BLK_CPQ_DA is not set
+# CONFIG_BLK_CPQ_CISS_DA is not set
+# CONFIG_BLK_DEV_DAC960 is not set
+# CONFIG_BLK_DEV_UMEM is not set
+# CONFIG_BLK_DEV_COW_COMMON is not set
+CONFIG_BLK_DEV_LOOP=m
+CONFIG_BLK_DEV_CRYPTOLOOP=m
+CONFIG_BLK_DEV_NBD=m
+# CONFIG_BLK_DEV_SX8 is not set
+# CONFIG_BLK_DEV_UB is not set
+CONFIG_BLK_DEV_RAM=y
+CONFIG_BLK_DEV_RAM_COUNT=16
+CONFIG_BLK_DEV_RAM_SIZE=8192
+CONFIG_BLK_DEV_INITRD=y
+# CONFIG_CDROM_PKTCDVD is not set
+
+#
+# IO Schedulers
+#
+CONFIG_IOSCHED_NOOP=y
+CONFIG_IOSCHED_AS=y
+CONFIG_IOSCHED_DEADLINE=y
+CONFIG_IOSCHED_CFQ=y
+# CONFIG_ATA_OVER_ETH is not set
+
+#
+# ATA/ATAPI/MFM/RLL support
+#
+CONFIG_IDE=y
+CONFIG_BLK_DEV_IDE=y
+
+#
+# Please see Documentation/ide.txt for help/info on IDE drives
+#
+# CONFIG_BLK_DEV_IDE_SATA is not set
+CONFIG_BLK_DEV_IDEDISK=y
+CONFIG_IDEDISK_MULTI_MODE=y
+CONFIG_BLK_DEV_IDECD=m
+# CONFIG_BLK_DEV_IDETAPE is not set
+# CONFIG_BLK_DEV_IDEFLOPPY is not set
+# CONFIG_BLK_DEV_IDESCSI is not set
+
+#
+# IDE chipset support/bugfixes
+#
+CONFIG_IDE_GENERIC=y
+# CONFIG_BLK_DEV_IDEPNP is not set
+# CONFIG_IDE_ARM is not set
+# CONFIG_IDE_CHIPSETS is not set
+# CONFIG_BLK_DEV_HD is not set
+
+#
+# SCSI device support
+#
+CONFIG_RAID_ATTRS=m
+CONFIG_SCSI=m
+CONFIG_SCSI_PROC_FS=y
+
+#
+# SCSI support type (disk, tape, CD-ROM)
+#
+CONFIG_BLK_DEV_SD=m
+CONFIG_CHR_DEV_ST=m
+CONFIG_CHR_DEV_OSST=m
+CONFIG_BLK_DEV_SR=m
+CONFIG_BLK_DEV_SR_VENDOR=y
+CONFIG_CHR_DEV_SG=m
+CONFIG_CHR_DEV_SCH=m
+
+#
+# Some SCSI devices (e.g. CD jukebox) support multiple LUNs
+#
+CONFIG_SCSI_MULTI_LUN=y
+CONFIG_SCSI_CONSTANTS=y
+CONFIG_SCSI_LOGGING=y
+
+#
+# SCSI Transport Attributes
+#
+CONFIG_SCSI_SPI_ATTRS=m
+CONFIG_SCSI_FC_ATTRS=m
+CONFIG_SCSI_ISCSI_ATTRS=m
+CONFIG_SCSI_SAS_ATTRS=m
+
+#
+# SCSI low-level drivers
+#
+CONFIG_BLK_DEV_3W_XXXX_RAID=m
+CONFIG_SCSI_3W_9XXX=m
+CONFIG_SCSI_7000FASST=m
+# CONFIG_SCSI_ACARD is not set
+CONFIG_SCSI_AHA152X=m
+CONFIG_SCSI_AHA1542=m
+CONFIG_SCSI_AACRAID=m
+CONFIG_SCSI_AIC7XXX=m
+CONFIG_AIC7XXX_CMDS_PER_DEVICE=32
+CONFIG_AIC7XXX_RESET_DELAY_MS=15000
+CONFIG_AIC7XXX_DEBUG_ENABLE=y
+CONFIG_AIC7XXX_DEBUG_MASK=0
+CONFIG_AIC7XXX_REG_PRETTY_PRINT=y
+CONFIG_SCSI_AIC7XXX_OLD=m
+CONFIG_SCSI_AIC79XX=m
+CONFIG_AIC79XX_CMDS_PER_DEVICE=32
+CONFIG_AIC79XX_RESET_DELAY_MS=15000
+CONFIG_AIC79XX_DEBUG_ENABLE=y
+CONFIG_AIC79XX_DEBUG_MASK=0
+CONFIG_AIC79XX_REG_PRETTY_PRINT=y
+# CONFIG_SCSI_DPT_I2O is not set
+# CONFIG_SCSI_IN2000 is not set
+# CONFIG_MEGARAID_NEWGEN is not set
+# CONFIG_MEGARAID_LEGACY is not set
+CONFIG_MEGARAID_SAS=m
+# CONFIG_SCSI_BUSLOGIC is not set
+# CONFIG_SCSI_DMX3191D is not set
+# CONFIG_SCSI_DTC3280 is not set
+# CONFIG_SCSI_EATA is not set
+# CONFIG_SCSI_FUTURE_DOMAIN is not set
+# CONFIG_SCSI_GDTH is not set
+# CONFIG_SCSI_GENERIC_NCR5380 is not set
+# CONFIG_SCSI_GENERIC_NCR5380_MMIO is not set
+# CONFIG_SCSI_IPS is not set
+# CONFIG_SCSI_INITIO is not set
+# CONFIG_SCSI_INIA100 is not set
+# CONFIG_SCSI_PPA is not set
+# CONFIG_SCSI_IMM is not set
+# CONFIG_SCSI_NCR53C406A is not set
+# CONFIG_SCSI_SYM53C8XX_2 is not set
+# CONFIG_SCSI_IPR is not set
+# CONFIG_SCSI_PAS16 is not set
+# CONFIG_SCSI_PSI240I is not set
+# CONFIG_SCSI_QLOGIC_FAS is not set
+# CONFIG_SCSI_QLOGIC_FC is not set
+# CONFIG_SCSI_QLOGIC_1280 is not set
+# CONFIG_SCSI_LPFC is not set
+# CONFIG_SCSI_SYM53C416 is not set
+# CONFIG_SCSI_DC395x is not set
+# CONFIG_SCSI_DC390T is not set
+# CONFIG_SCSI_T128 is not set
+# CONFIG_SCSI_U14_34F is not set
+# CONFIG_SCSI_NSP32 is not set
+# CONFIG_SCSI_DEBUG is not set
+
+#
+# Serial ATA (prod) and Parallel ATA (experimental) drivers
+#
+# CONFIG_ATA is not set
+
+#
+# Multi-device support (RAID and LVM)
+#
+CONFIG_MD=y
+# CONFIG_DM_MULTIPATH_EMC is not set
+
+#
+# Fusion MPT device support
+#
+CONFIG_FUSION=y
+CONFIG_FUSION_SPI=m
+CONFIG_FUSION_FC=m
+CONFIG_FUSION_SAS=m
+CONFIG_FUSION_MAX_SGE=40
+CONFIG_FUSION_CTL=m
+
+#
+# IEEE 1394 (FireWire) support
+#
+# CONFIG_FIREWIRE is not set
+
+#
+# I2O device support
+#
+# CONFIG_I2O is not set
+
+#
+# Network device support
+#
+CONFIG_NETDEVICES=y
+# CONFIG_DUMMY is not set
+# CONFIG_BONDING is not set
+# CONFIG_TUN is not set
+# CONFIG_NET_SB1000 is not set
+
+#
+# ARCnet devices
+#
+# CONFIG_ARCNET is not set
+
+#
+# PHY device support
+#
+CONFIG_PHYLIB=m
+
+#
+# MII PHY device drivers
+#
+CONFIG_MARVELL_PHY=m
+CONFIG_DAVICOM_PHY=m
+CONFIG_QSEMI_PHY=m
+CONFIG_LXT_PHY=m
+CONFIG_CICADA_PHY=m
+
+#
+# Ethernet (10 or 100Mbit)
+#
+CONFIG_NET_ETHERNET=y
+CONFIG_MII=y
+# CONFIG_HAPPYMEAL is not set
+# CONFIG_SUNGEM is not set
+# CONFIG_EL1 is not set
+# CONFIG_EL2 is not set
+# CONFIG_ELPLUS is not set
+# CONFIG_EL16 is not set
+# CONFIG_EL3 is not set
+# CONFIG_3C515 is not set
+CONFIG_VORTEX=y
+# CONFIG_TYPHOON is not set
+# CONFIG_NET_VENDOR_SMC is not set
+# CONFIG_SMC91X is not set
+# CONFIG_DM9000 is not set
+# CONFIG_NET_VENDOR_RACAL is not set
+
+#
+# Tulip family network device support
+
+CONFIG_NET_TULIP=y
+CONFIG_DE2104X=m
+CONFIG_TULIP=m
+# CONFIG_TULIP_MWI is not set
+# CONFIG_TULIP_MMIO is not set
+CONFIG_DE4X5=m
+CONFIG_WINBOND_840=m
+CONFIG_DM9102=m
+CONFIG_ULI526X=m
+# CONFIG_AT1700 is not set
+# CONFIG_DEPCA is not set
+# CONFIG_HP100 is not set
+# CONFIG_NET_ISA is not set
+CONFIG_NET_PCI=y
+# CONFIG_PCNET32 is not set
+# CONFIG_AMD8111_ETH is not set
+# CONFIG_ADAPTEC_STARFIRE is not set
+# CONFIG_AC3200 is not set
+# CONFIG_APRICOT is not set
+# CONFIG_B44 is not set
+# CONFIG_FORCEDETH is not set
+# CONFIG_CS89x0 is not set
+# CONFIG_EEPRO100 is not set
+# CONFIG_E100 is not set
+# CONFIG_FEALNX is not set
+CONFIG_NATSEMI=m
+CONFIG_NE2K_PCI=m
+# CONFIG_8139CP is not set
+# CONFIG_8139TOO is not set
+# CONFIG_SIS900 is not set
+# CONFIG_EPIC100 is not set
+# CONFIG_SUNDANCE is not set
+# CONFIG_TLAN is not set
+# CONFIG_VIA_RHINE is not set
+# CONFIG_NET_POCKET is not set
+
+#
+# Ethernet (1000 Mbit)
+#
+# CONFIG_DL2K is not set
+# CONFIG_E1000 is not set
+# CONFIG_NS83820 is not set
+# CONFIG_HAMACHI is not set
+# CONFIG_YELLOWFIN is not set
+# CONFIG_R8169 is not set
+CONFIG_SIS190=m
+CONFIG_SKGE=m
+# CONFIG_VIA_VELOCITY is not set
+# CONFIG_TIGON3 is not set
+# CONFIG_BNX2 is not set
+
+#
+# Ethernet (10000 Mbit)
+#
+CONFIG_CHELSIO_T1=m
+# CONFIG_IXGB is not set
+# CONFIG_S2IO is not set
+
+#
+# Token Ring devices
+#
+# CONFIG_TR is not set
+
+#
+# Wireless LAN (non-hamradio)
+#
+# CONFIG_NET_RADIO is not set
+
+#
+# Wan interfaces
+#
+# CONFIG_WAN is not set
+
+#
+# ATM drivers
+#
+# CONFIG_ATM_DRIVERS is not set
+# CONFIG_ATM_TCP is not set
+# CONFIG_ATM_LANAI is not set
+# CONFIG_ATM_ENI is not set
+# CONFIG_ATM_FIRESTREAM is not set
+# CONFIG_ATM_ZATM is not set
+# CONFIG_ATM_NICSTAR is not set
+# CONFIG_ATM_IDT77252 is not set
+# CONFIG_ATM_AMBASSADOR is not set
+# CONFIG_ATM_HORIZON is not set
+# CONFIG_ATM_IA is not set
+# CONFIG_ATM_FORE200E_MAYBE is not set
+# CONFIG_ATM_HE is not set
+# CONFIG_FDDI is not set
+# CONFIG_HIPPI is not set
+# CONFIG_PLIP is not set
+CONFIG_PPP=m
+# CONFIG_PPP_MULTILINK is not set
+# CONFIG_PPP_FILTER is not set
+CONFIG_PPP_ASYNC=m
+# CONFIG_PPP_SYNC_TTY is not set
+CONFIG_PPP_DEFLATE=m
+CONFIG_PPP_BSDCOMP=m
+CONFIG_PPPOE=m
+# CONFIG_PPPOATM is not set
+CONFIG_SLIP=m
+# CONFIG_NET_FC is not set
+# CONFIG_SHAPER is not set
+CONFIG_NETCONSOLE=m
+CONFIG_NETPOLL=y
+# CONFIG_NETPOLL_TRAP is not set
+CONFIG_NET_POLL_CONTROLLER=y
+
+#
+# ISDN subsystem
+#
+# CONFIG_ISDN is not set
+
+#
+# Input device support
+#
+CONFIG_INPUT=y
+
+#
+# Userland interfaces
+#
+CONFIG_INPUT_MOUSEDEV=y
+CONFIG_INPUT_MOUSEDEV_PSAUX=y
+CONFIG_INPUT_MOUSEDEV_SCREEN_X=1024
+CONFIG_INPUT_MOUSEDEV_SCREEN_Y=768
+# CONFIG_INPUT_JOYDEV is not set
+# CONFIG_INPUT_TSDEV is not set
+CONFIG_INPUT_EVDEV=m
+
+#
+# Input Device Drivers
+#
+CONFIG_INPUT_KEYBOARD=y
+CONFIG_KEYBOARD_ATKBD=y
+# CONFIG_KEYBOARD_SUNKBD is not set
+# CONFIG_KEYBOARD_LKKBD is not set
+# CONFIG_KEYBOARD_XTKBD is not set
+# CONFIG_KEYBOARD_NEWTON is not set
+CONFIG_INPUT_MOUSE=y
+CONFIG_MOUSE_PS2=y
+# CONFIG_MOUSE_SERIAL is not set
+# CONFIG_MOUSE_INPORT is not set
+# CONFIG_MOUSE_LOGIBM is not set
+# CONFIG_MOUSE_PC110PAD is not set
+# CONFIG_MOUSE_VSXXXAA is not set
+# CONFIG_INPUT_JOYSTICK is not set
+# CONFIG_INPUT_TOUCHSCREEN is not set
+# CONFIG_INPUT_MISC is not set
+
+#
+# Hardware I/O ports
+#
+CONFIG_SERIO=y
+CONFIG_SERIO_I8042=y
+CONFIG_SERIO_SERPORT=y
+# CONFIG_SERIO_PARKBD is not set
+# CONFIG_SERIO_PCIPS2 is not set
+CONFIG_SERIO_LIBPS2=y
+# CONFIG_SERIO_RAW is not set
+# CONFIG_GAMEPORT is not set
+
+#
+# Character devices
+#
+CONFIG_VT=y
+CONFIG_VT_CONSOLE=y
+CONFIG_HW_CONSOLE=y
+CONFIG_SERIAL_NONSTANDARD=y
+# CONFIG_COMPUTONE is not set
+# CONFIG_ROCKETPORT is not set
+# CONFIG_CYCLADES is not set
+# CONFIG_DIGIEPCA is not set
+# CONFIG_ESPSERIAL is not set
+# CONFIG_MOXA_INTELLIO is not set
+# CONFIG_MOXA_SMARTIO is not set
+# CONFIG_ISI is not set
+# CONFIG_SYNCLINK is not set
+# CONFIG_SYNCLINKMP is not set
+# CONFIG_N_HDLC is not set
+# CONFIG_RISCOM8 is not set
+# CONFIG_SPECIALIX is not set
+# CONFIG_SX is not set
+# CONFIG_RIO is not set
+# CONFIG_STALDRV is not set
+
+#
+# Serial drivers
+#
+CONFIG_SERIAL_8250=y
+CONFIG_SERIAL_8250_CONSOLE=y
+CONFIG_SERIAL_8250_NR_UARTS=16
+CONFIG_SERIAL_8250_RUNTIME_UARTS=4
+# CONFIG_SERIAL_8250_EXTENDED is not set
+
+#
+# Non-8250 serial port support
+#
+CONFIG_SERIAL_21285=y
+CONFIG_SERIAL_21285_CONSOLE=y
+CONFIG_SERIAL_CORE=y
+CONFIG_SERIAL_CORE_CONSOLE=y
+# CONFIG_SERIAL_JSM is not set
+CONFIG_PRINTER=m
+# CONFIG_LP_CONSOLE is not set
+# CONFIG_PPDEV is not set
+# CONFIG_TIPAR is not set
+
+#
+# IPMI
+#
+# CONFIG_IPMI_HANDLER is not set
+
+#
+# Watchdog Cards
+#
+CONFIG_WATCHDOG=y
+# CONFIG_WATCHDOG_NOWAYOUT is not set
+
+#
+# Watchdog Device Drivers
+#
+CONFIG_SOFT_WATCHDOG=y
+CONFIG_21285_WATCHDOG=m
+CONFIG_977_WATCHDOG=m
+
+#
+# ISA-based Watchdog Cards
+#
+# CONFIG_PCWATCHDOG is not set
+# CONFIG_MIXCOMWD is not set
+# CONFIG_WDT is not set
+
+#
+# PCI-based Watchdog Cards
+#
+# CONFIG_PCIPCWATCHDOG is not set
+# CONFIG_WDTPCI is not set
+
+#
+# USB-based Watchdog Cards
+#
+# CONFIG_USBPCWATCHDOG is not set
+CONFIG_DS1620=y
+CONFIG_NWBUTTON=y
+CONFIG_NWBUTTON_REBOOT=y
+CONFIG_NWFLASH=m
+CONFIG_NVRAM=m
+CONFIG_RTC=y
+# CONFIG_DTLK is not set
+# CONFIG_R3964 is not set
+# CONFIG_APPLICOM is not set
+
+#
+# Ftape, the floppy tape device driver
+#
+# CONFIG_DRM is not set
+# CONFIG_RAW_DRIVER is not set
+
+#
+# TPM devices
+#
+# CONFIG_TCG_TPM is not set
+
+#
+# I2C support
+#
+CONFIG_I2C=m
+# CONFIG_I2C_CHARDEV is not set
+
+#
+# I2C Algorithms
+#
+# CONFIG_I2C_ALGOPCF is not set
+# CONFIG_I2C_ALGOPCA is not set
+
+#
+# I2C Hardware Bus support
+#
+# CONFIG_I2C_ALI1535 is not set
+# CONFIG_I2C_ALI1563 is not set
+# CONFIG_I2C_ALI15X3 is not set
+# CONFIG_I2C_AMD756 is not set
+# CONFIG_I2C_AMD8111 is not set
+# CONFIG_I2C_ELEKTOR is not set
+# CONFIG_I2C_I801 is not set
+# CONFIG_I2C_I810 is not set
+# CONFIG_I2C_PIIX4 is not set
+# CONFIG_I2C_NFORCE2 is not set
+# CONFIG_I2C_PARPORT is not set
+# CONFIG_I2C_PARPORT_LIGHT is not set
+# CONFIG_I2C_PROSAVAGE is not set
+# CONFIG_I2C_SAVAGE4 is not set
+# CONFIG_SCx200_ACB is not set
+# CONFIG_I2C_SIS5595 is not set
+# CONFIG_I2C_SIS630 is not set
+# CONFIG_I2C_SIS96X is not set
+# CONFIG_I2C_STUB is not set
+# CONFIG_I2C_VIA is not set
+# CONFIG_I2C_VIAPRO is not set
+# CONFIG_I2C_VOODOO3 is not set
+# CONFIG_I2C_PCA_ISA is not set
+
+#
+# Miscellaneous I2C Chip support
+#
+# CONFIG_SENSORS_DS1337 is not set
+CONFIG_SENSORS_DS1374=m
+# CONFIG_SENSORS_EEPROM is not set
+# CONFIG_SENSORS_PCF8574 is not set
+CONFIG_SENSORS_PCA9539=m
+# CONFIG_SENSORS_PCF8591 is not set
+CONFIG_SENSORS_MAX6875=m
+# CONFIG_I2C_DEBUG_CORE is not set
+# CONFIG_I2C_DEBUG_ALGO is not set
+# CONFIG_I2C_DEBUG_BUS is not set
+# CONFIG_I2C_DEBUG_CHIP is not set
+
+#
+# Dallas's 1-wire bus
+#
+# CONFIG_W1 is not set
+
+#
+# Hardware Monitoring support
+#
+CONFIG_HWMON=y
+CONFIG_HWMON_VID=m
+# CONFIG_SENSORS_ADM1021 is not set
+# CONFIG_SENSORS_ADM1025 is not set
+# CONFIG_SENSORS_ADM1026 is not set
+# CONFIG_SENSORS_ADM1031 is not set
+CONFIG_SENSORS_ADM9240=m
+# CONFIG_SENSORS_ASB100 is not set
+CONFIG_SENSORS_ATXP1=m
+# CONFIG_SENSORS_DS1621 is not set
+# CONFIG_SENSORS_F71805F is not set
+# CONFIG_SENSORS_FSCHER is not set
+# CONFIG_SENSORS_FSCPOS is not set
+# CONFIG_SENSORS_GL518SM is not set
+# CONFIG_SENSORS_GL520SM is not set
+# CONFIG_SENSORS_IT87 is not set
+# CONFIG_SENSORS_LM63 is not set
+# CONFIG_SENSORS_LM75 is not set
+# CONFIG_SENSORS_LM77 is not set
+# CONFIG_SENSORS_LM78 is not set
+# CONFIG_SENSORS_LM80 is not set
+# CONFIG_SENSORS_LM83 is not set
+# CONFIG_SENSORS_LM85 is not set
+# CONFIG_SENSORS_LM87 is not set
+# CONFIG_SENSORS_LM90 is not set
+# CONFIG_SENSORS_LM92 is not set
+# CONFIG_SENSORS_MAX1619 is not set
+# CONFIG_SENSORS_PC87360 is not set
+# CONFIG_SENSORS_SIS5595 is not set
+# CONFIG_SENSORS_SMSC47M1 is not set
+# CONFIG_SENSORS_SMSC47B397 is not set
+# CONFIG_SENSORS_VIA686A is not set
+# CONFIG_SENSORS_W83781D is not set
+CONFIG_SENSORS_W83792D=m
+# CONFIG_SENSORS_W83L785TS is not set
+# CONFIG_SENSORS_W83627HF is not set
+CONFIG_SENSORS_W83627EHF=m
+# CONFIG_HWMON_DEBUG_CHIP is not set
+
+#
+# Misc devices
+#
+
+#
+# Multimedia Capabilities Port drivers
+#
+
+#
+# Multimedia devices
+#
+CONFIG_VIDEO_DEV=m
+
+#
+# Video For Linux
+#
+
+#
+# Video Adapters
+#
+# CONFIG_VIDEO_BT848 is not set
+# CONFIG_VIDEO_PMS is not set
+# CONFIG_VIDEO_BWQCAM is not set
+# CONFIG_VIDEO_CQCAM is not set
+# CONFIG_VIDEO_W9966 is not set
+# CONFIG_VIDEO_CPIA is not set
+# CONFIG_VIDEO_SAA5246A is not set
+# CONFIG_VIDEO_SAA5249 is not set
+# CONFIG_TUNER_3036 is not set
+# CONFIG_VIDEO_STRADIS is not set
+# CONFIG_VIDEO_MXB is not set
+# CONFIG_VIDEO_DPC is not set
+# CONFIG_VIDEO_HEXIUM_ORION is not set
+# CONFIG_VIDEO_HEXIUM_GEMINI is not set
+# CONFIG_VIDEO_CX88 is not set
+# CONFIG_VIDEO_OVCAMCHIP is not set
+
+#
+# Radio Adapters
+#
+# CONFIG_RADIO_CADET is not set
+# CONFIG_RADIO_RTRACK is not set
+# CONFIG_RADIO_RTRACK2 is not set
+# CONFIG_RADIO_AZTECH is not set
+# CONFIG_RADIO_GEMTEK is not set
+# CONFIG_RADIO_GEMTEK_PCI is not set
+# CONFIG_RADIO_MAXIRADIO is not set
+# CONFIG_RADIO_MAESTRO is not set
+# CONFIG_RADIO_SF16FMI is not set
+# CONFIG_RADIO_SF16FMR2 is not set
+# CONFIG_RADIO_TERRATEC is not set
+# CONFIG_RADIO_TRUST is not set
+# CONFIG_RADIO_TYPHOON is not set
+# CONFIG_RADIO_ZOLTRIX is not set
+
+#
+# Digital Video Broadcasting Devices
+#
+# CONFIG_DVB is not set
+
+#
+# Graphics support
+#
+CONFIG_FB=y
+CONFIG_FB_CFB_FILLRECT=y
+CONFIG_FB_CFB_COPYAREA=y
+CONFIG_FB_CFB_IMAGEBLIT=y
+# CONFIG_FB_MACMODES is not set
+CONFIG_FB_MODE_HELPERS=y
+CONFIG_FB_TILEBLITTING=y
+CONFIG_FB_CIRRUS=m
+CONFIG_FB_PM2=m
+CONFIG_FB_CYBER2000=y
+# CONFIG_FB_ASILIANT is not set
+# CONFIG_FB_IMSTT is not set
+CONFIG_VIDEO_SELECT=y
+CONFIG_FB_NVIDIA=m
+CONFIG_FB_RIVA=m
+CONFIG_FB_RADEON=m
+CONFIG_FB_ATY128=m
+CONFIG_FB_ATY=m
+# CONFIG_FB_SAVAGE is not set
+CONFIG_FB_SIS=m
+CONFIG_FB_NEOMAGIC=m
+# CONFIG_FB_KYRO is not set
+# CONFIG_FB_3DFX is not set
+CONFIG_FB_CYBLA=m
+# CONFIG_FB_TRIDENT is not set
+# CONFIG_FB_S1D13XXX is not set
+# CONFIG_FB_VIRTUAL is not set
+
+#
+# Console display driver support
+#
+CONFIG_VGA_CONSOLE=y
+# CONFIG_MDA_CONSOLE is not set
+
+#
+# Logo configuration
+#
+# CONFIG_LOGO is not set
+
+#
+# Sound
+#
+CONFIG_SOUND=m
+
+#
+# Advanced Linux Sound Architecture
+#
+CONFIG_SND=m
+CONFIG_SND_TIMER=m
+CONFIG_SND_PCM=m
+CONFIG_SND_HWDEP=m
+CONFIG_SND_RAWMIDI=m
+CONFIG_SND_SEQUENCER=m
+# CONFIG_SND_SEQ_DUMMY is not set
+CONFIG_SND_OSSEMUL=y
+CONFIG_SND_MIXER_OSS=m
+CONFIG_SND_PCM_OSS=m
+# CONFIG_SND_SEQUENCER_OSS is not set
+CONFIG_SND_RTCTIMER=m
+CONFIG_SND_SEQ_RTCTIMER_DEFAULT=y
+# CONFIG_SND_DYNAMIC_MINORS is not set
+CONFIG_SND_SUPPORT_OLD_API=y
+# CONFIG_SND_VERBOSE_PRINTK is not set
+# CONFIG_SND_DEBUG is not set
+
+#
+# Generic devices
+#
+CONFIG_SND_MPU401_UART=m
+CONFIG_SND_OPL3_LIB=m
+# CONFIG_SND_DUMMY is not set
+# CONFIG_SND_VIRMIDI is not set
+# CONFIG_SND_MTPAV is not set
+# CONFIG_SND_SERIAL_U16550 is not set
+# CONFIG_SND_MPU401 is not set
+
+#
+# ISA devices
+#
+# CONFIG_SND_ADLIB is not set
+CONFIG_SND_CS4231_LIB=m
+# CONFIG_SND_AD1816A is not set
+# CONFIG_SND_AD1848 is not set
+# CONFIG_SND_ALS100 is not set
+# CONFIG_SND_AZT2320 is not set
+# CONFIG_SND_CMI8330 is not set
+# CONFIG_SND_CS4231 is not set
+# CONFIG_SND_CS4232 is not set
+# CONFIG_SND_CS4236 is not set
+# CONFIG_SND_DT019X is not set
+# CONFIG_SND_ES968 is not set
+# CONFIG_SND_ES1688 is not set
+# CONFIG_SND_ES18XX is not set
+# CONFIG_SND_GUSCLASSIC is not set
+# CONFIG_SND_GUSEXTREME is not set
+# CONFIG_SND_GUSMAX is not set
+# CONFIG_SND_INTERWAVE is not set
+# CONFIG_SND_INTERWAVE_STB is not set
+CONFIG_SND_OPL3SA2=m
+# CONFIG_SND_OPTI92X_AD1848 is not set
+# CONFIG_SND_OPTI92X_CS4231 is not set
+# CONFIG_SND_OPTI93X is not set
+# CONFIG_SND_MIRO is not set
+# CONFIG_SND_SB8 is not set
+# CONFIG_SND_SB16 is not set
+# CONFIG_SND_SBAWE is not set
+# CONFIG_SND_SGALAXY is not set
+# CONFIG_SND_SSCAPE is not set
+# CONFIG_SND_WAVEFRONT is not set
+
+#
+# PCI devices
+#
+# CONFIG_SND_AD1889 is not set
+# CONFIG_SND_ALS4000 is not set
+# CONFIG_SND_ALI5451 is not set
+# CONFIG_SND_ATIIXP is not set
+# CONFIG_SND_ATIIXP_MODEM is not set
+# CONFIG_SND_AU8810 is not set
+# CONFIG_SND_AU8820 is not set
+# CONFIG_SND_AU8830 is not set
+# CONFIG_SND_AZT3328 is not set
+# CONFIG_SND_BT87X is not set
+# CONFIG_SND_CA0106 is not set
+# CONFIG_SND_CMIPCI is not set
+# CONFIG_SND_CS4281 is not set
+# CONFIG_SND_CS46XX is not set
+# CONFIG_SND_EMU10K1 is not set
+# CONFIG_SND_EMU10K1X is not set
+# CONFIG_SND_ENS1370 is not set
+# CONFIG_SND_ENS1371 is not set
+# CONFIG_SND_ES1938 is not set
+# CONFIG_SND_ES1968 is not set
+# CONFIG_SND_FM801 is not set
+# CONFIG_SND_HDA_INTEL is not set
+# CONFIG_SND_HDSP is not set
+# CONFIG_SND_HDSPM is not set
+# CONFIG_SND_ICE1712 is not set
+# CONFIG_SND_ICE1724 is not set
+# CONFIG_SND_INTEL8X0 is not set
+# CONFIG_SND_INTEL8X0M is not set
+# CONFIG_SND_KORG1212 is not set
+# CONFIG_SND_MAESTRO3 is not set
+# CONFIG_SND_MIXART is not set
+# CONFIG_SND_NM256 is not set
+# CONFIG_SND_PCXHR is not set
+# CONFIG_SND_RME32 is not set
+# CONFIG_SND_RME96 is not set
+# CONFIG_SND_RME9652 is not set
+# CONFIG_SND_SONICVIBES is not set
+# CONFIG_SND_TRIDENT is not set
+# CONFIG_SND_VIA82XX is not set
+# CONFIG_SND_VIA82XX_MODEM is not set
+# CONFIG_SND_VX222 is not set
+# CONFIG_SND_YMFPCI is not set
+
+#
+# ALSA ARM devices
+#
+
+#
+# USB devices
+#
+# CONFIG_SND_USB_AUDIO is not set
+
+#
+# Open Sound System
+#
+CONFIG_SOUND_PRIME=m
+CONFIG_OBSOLETE_OSS_DRIVER=y
+# CONFIG_SOUND_CMPCI is not set
+# CONFIG_SOUND_EMU10K1 is not set
+# CONFIG_SOUND_FUSION is not set
+# CONFIG_SOUND_CS4281 is not set
+# CONFIG_SOUND_ES1370 is not set
+# CONFIG_SOUND_ESSSOLO1 is not set
+# CONFIG_SOUND_MAESTRO is not set
+# CONFIG_SOUND_MAESTRO3 is not set
+# CONFIG_SOUND_SONICVIBES is not set
+# CONFIG_SOUND_TRIDENT is not set
+# CONFIG_SOUND_MSNDCLAS is not set
+# CONFIG_SOUND_MSNDPIN is not set
+CONFIG_SOUND_OSS=m
+# CONFIG_SOUND_TRACEINIT is not set
+# CONFIG_SOUND_DMAP is not set
+# CONFIG_SOUND_AD1816 is not set
+# CONFIG_SOUND_AD1889 is not set
+# CONFIG_SOUND_SGALAXY is not set
+# CONFIG_SOUND_ADLIB is not set
+# CONFIG_SOUND_ACI_MIXER is not set
+# CONFIG_SOUND_SSCAPE is not set
+# CONFIG_SOUND_GUS is not set
+# CONFIG_SOUND_VMIDI is not set
+# CONFIG_SOUND_TRIX is not set
+# CONFIG_SOUND_MSS is not set
+# CONFIG_SOUND_MPU401 is not set
+# CONFIG_SOUND_NM256 is not set
+# CONFIG_SOUND_MAD16 is not set
+# CONFIG_SOUND_PAS is not set
+# CONFIG_SOUND_PSS is not set
+# CONFIG_SOUND_SB is not set
+# CONFIG_SOUND_AWE32_SYNTH is not set
+# CONFIG_SOUND_WAVEFRONT is not set
+# CONFIG_SOUND_MAUI is not set
+CONFIG_SOUND_YM3812=m
+# CONFIG_SOUND_OPL3SA1 is not set
+# CONFIG_SOUND_OPL3SA2 is not set
+# CONFIG_SOUND_YMFPCI is not set
+# CONFIG_SOUND_UART6850 is not set
+# CONFIG_SOUND_AEDSP16 is not set
+CONFIG_SOUND_WAVEARTIST=m
+# CONFIG_SOUND_ALI5455 is not set
+# CONFIG_SOUND_FORTE is not set
+# CONFIG_SOUND_RME96XX is not set
+# CONFIG_SOUND_AD1980 is not set
+
+#
+# USB support
+#
+CONFIG_USB_ARCH_HAS_HCD=y
+CONFIG_USB_ARCH_HAS_OHCI=y
+CONFIG_USB=m
+CONFIG_USB_DEBUG=y
+
+#
+# Miscellaneous USB options
+#
+CONFIG_USB_DEVICEFS=y
+# CONFIG_USB_DYNAMIC_MINORS is not set
+# CONFIG_USB_OTG is not set
+
+#
+# USB Host Controller Drivers
+#
+CONFIG_USB_EHCI_HCD=m
+# CONFIG_USB_EHCI_SPLIT_ISO is not set
+# CONFIG_USB_EHCI_ROOT_HUB_TT is not set
+CONFIG_USB_ISP116X_HCD=m
+CONFIG_USB_OHCI_HCD=m
+CONFIG_USB_OHCI_LITTLE_ENDIAN=y
+CONFIG_USB_UHCI_HCD=m
+# CONFIG_USB_SL811_HCD is not set
+
+#
+# USB Device Class drivers
+#
+# CONFIG_USB_ACM is not set
+CONFIG_USB_PRINTER=m
+
+#
+# NOTE: USB_STORAGE enables SCSI, and 'SCSI disk support' may also be needed; see USB_STORAGE Help for more information
+#
+CONFIG_USB_STORAGE=m
+# CONFIG_USB_STORAGE_DEBUG is not set
+CONFIG_USB_STORAGE_DATAFAB=y
+CONFIG_USB_STORAGE_FREECOM=y
+CONFIG_USB_STORAGE_ISD200=y
+CONFIG_USB_STORAGE_DPCM=y
+CONFIG_USB_STORAGE_USBAT=y
+CONFIG_USB_STORAGE_SDDR09=y
+CONFIG_USB_STORAGE_SDDR55=y
+CONFIG_USB_STORAGE_JUMPSHOT=y
+
+#
+# USB Input Devices
+#
+CONFIG_USB_HID=m
+# CONFIG_HID_FF is not set
+# CONFIG_USB_HIDDEV is not set
+
+#
+# USB HID Boot Protocol drivers
+#
+CONFIG_USB_KBD=m
+CONFIG_USB_MOUSE=m
+
+#
+# USB Imaging devices
+#
+# CONFIG_USB_MDC800 is not set
+# CONFIG_USB_MICROTEK is not set
+
+#
+# USB Multimedia devices
+#
+# CONFIG_USB_VICAM is not set
+# CONFIG_USB_DSBR is not set
+# CONFIG_USB_IBMCAM is not set
+# CONFIG_USB_KONICAWC is not set
+# CONFIG_USB_OV511 is not set
+# CONFIG_USB_SE401 is not set
+# CONFIG_USB_SN9C102 is not set
+# CONFIG_USB_STV680 is not set
+# CONFIG_USB_W9968CF is not set
+# CONFIG_USB_PWC is not set
+
+#
+# USB Network Adapters
+#
+CONFIG_USB_CATC=m
+CONFIG_USB_KAWETH=m
+CONFIG_USB_PEGASUS=m
+CONFIG_USB_RTL8150=m
+CONFIG_USB_USBNET=m
+CONFIG_USB_NET_AX8817X=m
+CONFIG_USB_NET_CDCETHER=m
+# CONFIG_USB_NET_GL620A is not set
+CONFIG_USB_NET_NET1080=m
+# CONFIG_USB_NET_PLUSB is not set
+# CONFIG_USB_NET_RNDIS_HOST is not set
+# CONFIG_USB_NET_CDC_SUBSET is not set
+CONFIG_USB_NET_ZAURUS=m
+CONFIG_USB_MON=y
+
+#
+# USB port drivers
+#
+# CONFIG_USB_USS720 is not set
+
+#
+# USB Serial Converter support
+#
+# CONFIG_USB_SERIAL is not set
+
+#
+# USB Miscellaneous drivers
+#
+# CONFIG_USB_AUERSWALD is not set
+# CONFIG_USB_RIO500 is not set
+# CONFIG_USB_LEGOTOWER is not set
+# CONFIG_USB_LCD is not set
+# CONFIG_USB_LED is not set
+# CONFIG_USB_CYTHERM is not set
+# CONFIG_USB_PHIDGETKIT is not set
+# CONFIG_USB_PHIDGETSERVO is not set
+# CONFIG_USB_IDMOUSE is not set
+CONFIG_USB_LD=m
+# CONFIG_USB_TEST is not set
+
+#
+# USB DSL modem support
+#
+# CONFIG_USB_ATM is not set
+
+#
+# USB Gadget Support
+#
+# CONFIG_USB_GADGET is not set
+
+#
+# MMC/SD Card support
+#
+# CONFIG_MMC is not set
+
+#
+# File systems
+#
+CONFIG_EXT2_FS=y
+CONFIG_EXT3_FS=y
+CONFIG_REISERFS_FS=m
+# CONFIG_REISERFS_CHECK is not set
+# CONFIG_REISERFS_PROC_INFO is not set
+CONFIG_REISERFS_FS_XATTR=y
+CONFIG_REISERFS_FS_POSIX_ACL=y
+CONFIG_REISERFS_FS_SECURITY=y
+CONFIG_FS_POSIX_ACL=y
+CONFIG_MINIX_FS=m
+CONFIG_ROMFS_FS=m
+CONFIG_INOTIFY=y
+CONFIG_QUOTA=y
+CONFIG_QFMT_V1=m
+CONFIG_QFMT_V2=m
+CONFIG_QUOTACTL=y
+CONFIG_DNOTIFY=y
+CONFIG_AUTOFS_FS=m
+CONFIG_AUTOFS4_FS=m
+CONFIG_FUSE_FS=m
+
+#
+# CD-ROM/DVD Filesystems
+#
+CONFIG_ISO9660_FS=m
+CONFIG_JOLIET=y
+CONFIG_ZISOFS=y
+CONFIG_UDF_FS=m
+CONFIG_UDF_NLS=y
+
+#
+# DOS/FAT/NT Filesystems
+#
+CONFIG_FAT_FS=m
+CONFIG_MSDOS_FS=m
+CONFIG_VFAT_FS=m
+CONFIG_FAT_DEFAULT_CODEPAGE=437
+CONFIG_FAT_DEFAULT_IOCHARSET="iso8859-1"
+CONFIG_NTFS_FS=m
+# CONFIG_NTFS_DEBUG is not set
+CONFIG_NTFS_RW=y
+
+#
+# Pseudo filesystems
+#
+CONFIG_PROC_FS=y
+CONFIG_SYSFS=y
+CONFIG_RAMFS=y
+CONFIG_RELAYFS_FS=m
+
+#
+# Miscellaneous filesystems
+#
+CONFIG_ADFS_FS=m
+# CONFIG_ADFS_FS_RW is not set
+# CONFIG_AFFS_FS is not set
+# CONFIG_ASFS_FS is not set
+# CONFIG_HFS_FS is not set
+# CONFIG_HFSPLUS_FS is not set
+# CONFIG_BEFS_FS is not set
+# CONFIG_BFS_FS is not set
+# CONFIG_EFS_FS is not set
+CONFIG_CRAMFS=y
+# CONFIG_VXFS_FS is not set
+# CONFIG_HPFS_FS is not set
+# CONFIG_QNX4FS_FS is not set
+# CONFIG_SYSV_FS is not set
+# CONFIG_UFS_FS is not set
+
+#
+# Network File Systems
+#
+CONFIG_NFS_FS=y
+CONFIG_ROOT_NFS=y
+CONFIG_LOCKD=y
+CONFIG_LOCKD_V4=y
+CONFIG_EXPORTFS=m
+CONFIG_NFS_ACL_SUPPORT=y
+CONFIG_SUNRPC=y
+CONFIG_SUNRPC_GSS=y
+CONFIG_RPCSEC_GSS_KRB5=y
+# CONFIG_RPCSEC_GSS_SPKM3 is not set
+# CONFIG_SMB_FS is not set
+CONFIG_CIFS=m
+CONFIG_CIFS_STATS=y
+CONFIG_CIFS_STATS2=y
+CONFIG_CIFS_WEAK_PW_HASH=y
+CONFIG_CIFS_XATTR=y
+CONFIG_CIFS_POSIX=y
+# CONFIG_CIFS_DEBUG2 is not set
+# CONFIG_CIFS_EXPERIMENTAL is not set
+# CONFIG_CIFS is not set
+# CONFIG_NCP_FS is not set
+# CONFIG_CODA_FS is not set
+# CONFIG_AFS_FS is not set
+CONFIG_9P_FS=m
+
+#
+# Partition Types
+#
+CONFIG_PARTITION_ADVANCED=y
+CONFIG_ACORN_PARTITION=y
+# CONFIG_ACORN_PARTITION_CUMANA is not set
+# CONFIG_ACORN_PARTITION_EESOX is not set
+# CONFIG_ACORN_PARTITION_ICS is not set
+CONFIG_ACORN_PARTITION_ADFS=y
+# CONFIG_ACORN_PARTITION_POWERTEC is not set
+# CONFIG_ACORN_PARTITION_RISCIX is not set
+# CONFIG_OSF_PARTITION is not set
+# CONFIG_AMIGA_PARTITION is not set
+# CONFIG_ATARI_PARTITION is not set
+# CONFIG_MAC_PARTITION is not set
+CONFIG_MSDOS_PARTITION=y
+# CONFIG_BSD_DISKLABEL is not set
+# CONFIG_MINIX_SUBPARTITION is not set
+# CONFIG_SOLARIS_X86_PARTITION is not set
+# CONFIG_UNIXWARE_DISKLABEL is not set
+# CONFIG_LDM_PARTITION is not set
+# CONFIG_SGI_PARTITION is not set
+# CONFIG_ULTRIX_PARTITION is not set
+# CONFIG_SUN_PARTITION is not set
+# CONFIG_EFI_PARTITION is not set
+
+#
+# Native Language Support
+#
+CONFIG_NLS=y
+CONFIG_NLS_DEFAULT="iso8859-1"
+CONFIG_NLS_CODEPAGE_437=m
+CONFIG_NLS_CODEPAGE_737=m
+CONFIG_NLS_CODEPAGE_775=m
+CONFIG_NLS_CODEPAGE_850=m
+CONFIG_NLS_CODEPAGE_852=m
+CONFIG_NLS_CODEPAGE_855=m
+CONFIG_NLS_CODEPAGE_857=m
+CONFIG_NLS_CODEPAGE_860=m
+CONFIG_NLS_CODEPAGE_861=m
+CONFIG_NLS_CODEPAGE_862=m
+CONFIG_NLS_CODEPAGE_863=m
+CONFIG_NLS_CODEPAGE_864=m
+CONFIG_NLS_CODEPAGE_865=m
+CONFIG_NLS_CODEPAGE_866=m
+CONFIG_NLS_CODEPAGE_869=m
+CONFIG_NLS_CODEPAGE_936=m
+CONFIG_NLS_CODEPAGE_950=m
+CONFIG_NLS_CODEPAGE_932=m
+CONFIG_NLS_CODEPAGE_949=m
+CONFIG_NLS_CODEPAGE_874=m
+CONFIG_NLS_ISO8859_8=m
+CONFIG_NLS_CODEPAGE_1250=m
+CONFIG_NLS_CODEPAGE_1251=m
+CONFIG_NLS_ASCII=m
+CONFIG_NLS_ISO8859_1=m
+CONFIG_NLS_ISO8859_2=m
+CONFIG_NLS_ISO8859_3=m
+CONFIG_NLS_ISO8859_4=m
+CONFIG_NLS_ISO8859_5=m
+CONFIG_NLS_ISO8859_6=m
+CONFIG_NLS_ISO8859_7=m
+CONFIG_NLS_ISO8859_9=m
+CONFIG_NLS_ISO8859_13=m
+CONFIG_NLS_ISO8859_14=m
+CONFIG_NLS_ISO8859_15=m
+CONFIG_NLS_KOI8_R=m
+CONFIG_NLS_KOI8_U=m
+CONFIG_NLS_UTF8=m
+
+#
+# Profiling support
+#
+# CONFIG_PROFILING is not set
+
+#
+# Kernel hacking
+#
+# CONFIG_PRINTK_TIME is not set
+CONFIG_MAGIC_SYSRQ=y
+CONFIG_DEBUG_KERNEL=y
+CONFIG_LOG_BUF_SHIFT=14
+CONFIG_DETECT_SOFTLOCKUP=y
+# CONFIG_SCHEDSTATS is not set
+# CONFIG_DEBUG_SLAB is not set
+# CONFIG_DEBUG_SPINLOCK is not set
+# CONFIG_DEBUG_SPINLOCK_SLEEP is not set
+# CONFIG_DEBUG_KOBJECT is not set
+# CONFIG_DEBUG_INFO is not set
+# CONFIG_DEBUG_FS is not set
+CONFIG_FRAME_POINTER=y
+# CONFIG_FORCED_INLINING is not set
+# CONFIG_RCU_TORTURE_TEST is not set
+CONFIG_DEBUG_USER=y
+# CONFIG_DEBUG_WAITQ is not set
+# CONFIG_DEBUG_ERRORS is not set
+# CONFIG_DEBUG_LL is not set
+
+#
+# Security options
+#
+CONFIG_KEYS=y
+# CONFIG_KEYS_DEBUG_PROC_KEYS is not set
+CONFIG_SECURITY=y
+CONFIG_SECURITY_NETWORK=y
+CONFIG_SECURITY_NETWORK_XFRM=y
+CONFIG_SECURITY_CAPABILITIES=y
+CONFIG_SECURITY_SELINUX=y
+CONFIG_SECURITY_SELINUX_BOOTPARAM=y
+CONFIG_SECURITY_SELINUX_BOOTPARAM_VALUE=0
+CONFIG_SECURITY_SELINUX_DISABLE=y
+CONFIG_SECURITY_SELINUX_DEVELOP=y
+CONFIG_SECURITY_SELINUX_AVC_STATS=y
+CONFIG_SECURITY_SELINUX_CHECKREQPROT_VALUE=1
+
+#
+# Cryptographic options
+#
+CONFIG_CRYPTO_DES=y
+
+#
+# Hardware crypto devices
+#
+
+#
+# Library routines
+#
+CONFIG_CRC_CCITT=m
+CONFIG_CRC16=m
+CONFIG_CRC32=y
+CONFIG_LIBCRC32C=m
+CONFIG_ZLIB_INFLATE=y
+CONFIG_ZLIB_DEFLATE=m
+CONFIG_ATM_MPOA=m
+# CONFIG_BLK_DEV_OFFBOARD is not set
+CONFIG_BLK_DEV_SL82C105=y
+# CONFIG_SUNDANCE_MMIO is not set
+# CONFIG_SYNCLINK_CS is not set
+CONFIG_PCMCIA_WL3501=m
+CONFIG_BT_HIDP=m
+CONFIG_I82365=m
+CONFIG_BLK_DEV_SIIMAGE=m
+CONFIG_BT_HCIVHCI=m
+CONFIG_PCCARD_NONSTATIC=m
+# CONFIG_BLK_DEV_4DRIVES is not set
+# CONFIG_SCSI_ADVANSYS is not set
+CONFIG_USB_SPEEDTOUCH=m
+# CONFIG_ATM_CLIP_NO_ICMP is not set
+CONFIG_PCMCIA_3C574=m
+CONFIG_PRISM54=m
+# CONFIG_BLK_DEV_SLC90E66 is not set
+CONFIG_BLK_DEV_AEC62XX=m
+# CONFIG_FB_PM3 is not set
+CONFIG_AIRO_CS=m
+CONFIG_BLK_DEV_CY82C693=m
+CONFIG_PD6729=m
+CONFIG_BT_HCIBFUSB=m
+# CONFIG_SCSI_EATA_PIO is not set
+# CONFIG_8139TOO_TUNE_TWISTER is not set
+CONFIG_PCMCIA_3C589=m
+CONFIG_PCMCIA_WAVELAN=m
+# CONFIG_VIDEO_ZR36120 is not set
+# CONFIG_INFTL is not set
+CONFIG_WAVELAN=m
+# CONFIG_PCMCIA_SYM53C500 is not set
+CONFIG_TCIC=m
+CONFIG_BLK_DEV_TRIFLEX=m
+CONFIG_BT_BNEP_PROTO_FILTER=y
+# CONFIG_USB_ZD1201 is not set
+# CONFIG_BLK_DEV_DTC2278 is not set
+# CONFIG_BLK_DEV_IDEDMA_FORCED is not set
+# CONFIG_SCSI_CPQFCTS is not set
+# CONFIG_NCPFS_NFS_NS is not set
+CONFIG_PCMCIA_AXNET=m
+# CONFIG_CDROM_PKTCDVD_WCACHE is not set
+CONFIG_NET_PCMCIA=y
+CONFIG_BLK_DEV_ALI15X3=m
+# CONFIG_PCMCIA_AHA152X is not set
+CONFIG_TMD_HERMES=m
+CONFIG_PCMCIA_ATMEL=m
+CONFIG_PCMCIA_HERMES=m
+CONFIG_BLK_DEV_SVWKS=m
+CONFIG_LOGO_LINUX_VGA16=y
+# CONFIG_IDEPCI_SHARE_IRQ is not set
+CONFIG_LOGO_LINUX_CLUT224=y
+CONFIG_BT_HCIUART=m
+CONFIG_BLK_DEV_NS87415=m
+CONFIG_PCMCIA_RAYCS=m
+CONFIG_BLK_DEV_VIA82CXXX=m
+CONFIG_BT_RFCOMM_TTY=y
+CONFIG_PCI_HERMES=m
+CONFIG_CARDBUS=y
+# CONFIG_BLK_DEV_HT6560B is not set
+# CONFIG_NFTL is not set
+# CONFIG_NCPFS_NLS is not set
+CONFIG_LLC=m
+CONFIG_BLK_DEV_CMD64X=m
+# CONFIG_WDC_ALI15X3 is not set
+CONFIG_PLX_HERMES=m
+CONFIG_STRIP=m
+CONFIG_BT_HCIBLUECARD=m
+CONFIG_BT_BNEP_MC_FILTER=y
+# CONFIG_VIA_RHINE_MMIO is not set
+CONFIG_BT_L2CAP=m
+# CONFIG_UFS_FS_WRITE is not set
+CONFIG_BT_BNEP=m
+CONFIG_PCMCIA_XIRTULIP=m
+CONFIG_PCMCIA_XIRC2PS=m
+CONFIG_PCMCIA_NETWAVE=m
+# CONFIG_SCSI_QLOGIC_ISP is not set
+# CONFIG_PCMCIA_DEBUG is not set
+CONFIG_BT_HCIBPA10X=m
+CONFIG_BLK_DEV_CS5520=m
+CONFIG_USB_SISUSBVGA=m
+CONFIG_PCMCIA_FMVJ18X=m
+# CONFIG_SMP is not set
+# CONFIG_8139_OLD_RX_RESET is not set
+# CONFIG_IDEDMA_IVB is not set
+CONFIG_LOGO_LINUX_MONO=y
+# CONFIG_BLK_DEV_ALI14XX is not set
+# CONFIG_PCMCIA_QLOGIC is not set
+CONFIG_BLK_DEV_CS5530=m
+# CONFIG_FTL is not set
+CONFIG_I82092=m
+# CONFIG_8139TOO_8129 is not set
+CONFIG_YENTA=m
+CONFIG_CDROM_PKTCDVD_BUFFERS=8
+# CONFIG_NCPFS_EXTRAS is not set
+CONFIG_PCMCIA_XIRCOM=m
+# CONFIG_NCPFS_PACKET_SIGNING is not set
+# CONFIG_BLK_DEV_AMD74XX is not set
+# CONFIG_PDC202XX_BURST is not set
+# CONFIG_8139TOO_PIO is not set
+# CONFIG_HPT34X_AUTODMA is not set
+CONFIG_AIRO=m
+CONFIG_BLK_DEV_TRM290=m
+# CONFIG_VIDEO_ZORAN is not set
+# CONFIG_USB_SL811_CS is not set
+CONFIG_HERMES=m
+CONFIG_BLK_DEV_IDEDMA_PCI=y
+# CONFIG_PCMCIA_FDOMAIN is not set
+CONFIG_BLK_DEV_OPTI621=m
+CONFIG_BT_HCIBCM203X=m
+CONFIG_PCMCIA_NMCLAN=m
+CONFIG_BLK_DEV_PIIX=m
+CONFIG_BLK_DEV_GENERIC=m
+CONFIG_BT_HCIDTL1=m
+CONFIG_BT_HCIUSB=m
+# CONFIG_NCPFS_OS2_NS is not set
+# CONFIG_BLK_DEV_IDECS is not set
+CONFIG_ATMEL=m
+# CONFIG_NCPFS_SMALLDOS is not set
+# CONFIG_NCPFS_STRONG is not set
+CONFIG_BT_HCIUART_H4=y
+# CONFIG_BLK_DEV_UMC8672 is not set
+CONFIG_BT_HCIBTUART=m
+CONFIG_PCMCIA=m
+CONFIG_BROKEN=y
+CONFIG_ARLAN=m
+# CONFIG_BLK_DEV_QD65XX is not set
+# CONFIG_ATM_BR2684_IPFILTER is not set
+CONFIG_BLK_DEV_HPT366=m
+CONFIG_FS_MBCACHE=y
+CONFIG_BLK_DEV_PDC202XX_NEW=m
+CONFIG_PCI_ATMEL=m
+CONFIG_BT_HCIBT3C=m
+# CONFIG_IPX_INTERN is not set
+# CONFIG_NCPFS_IOCTL_LOCKING is not set
+CONFIG_PCMCIA_SMC91C92=m
+CONFIG_PCMCIA_PCNET=m
+CONFIG_BT_RFCOMM=m
+CONFIG_BLK_DEV_HPT34X=m
+CONFIG_BT_SCO=m
+CONFIG_BT_HCIUSB_SCO=y
+CONFIG_BT_HCIUART_BCSP=y
+# CONFIG_DECNET_ROUTER is not set
+CONFIG_BLK_DEV_SC1200=m
+# CONFIG_R8169_VLAN is not set
+# CONFIG_PCMCIA_NINJA_SCSI is not set
+CONFIG_BLK_DEV_PDC202XX_OLD=m
+# CONFIG_LANCE is not set
+CONFIG_VIDEO_TVEEPROM=m
+CONFIG_VIDEO_IR=m
+CONFIG_VIDEO_TUNER=m
+# CONFIG_MEGARAID_MM is not set
+CONFIG_VIDEO_BUF=m
+CONFIG_SPLIT_PTLOCK_CPUS=4096
+CONFIG_BLK_DEV_IDEPCI=y
+CONFIG_BLK_DEV_IDEDMA=y
+# CONFIG_EQUALIZER is not set
+# CONFIG_NET_VENDOR_3COM is not set
+# CONFIG_CASSINI is not set
+# CONFIG_FB_PM2_FIFO_DISCONNECT is not set
+# CONFIG_FB_NVIDIA_I2C is not set
+# CONFIG_FB_RIVA_I2C is not set
+# CONFIG_FB_RIVA_DEBUG is not set
+CONFIG_FB_MATROX=m
+CONFIG_FB_MATROX_MILLENIUM=y
+CONFIG_FB_MATROX_MYSTIQUE=y
+CONFIG_FB_MATROX_G=y
+# CONFIG_FB_MATROX_I2C is not set
+# CONFIG_FB_MATROX_MULTIHEAD is not set
+CONFIG_FB_RADEON_I2C=y
+# CONFIG_FB_RADEON_DEBUG is not set
+CONFIG_FB_ATY_CT=y
+# CONFIG_FB_SAVAGE_I2C is not set
+# CONFIG_FB_SAVAGE_ACCEL is not set
+CONFIG_FB_SIS_300=y
+CONFIG_FB_SIS_315=y
+CONFIG_DUMMY_CONSOLE=y
+CONFIG_FRAMEBUFFER_CONSOLE=y
+CONFIG_FRAMEBUFFER_CONSOLE_ROTATION=y
+# CONFIG_FONTS is not set
+CONFIG_FONT_8x8=y
+CONFIG_FONT_8x16=y
+# CONFIG_FB_3DFX_ACCEL is not set
+CONFIG_FB_ATY_GX=y
+# CONFIG_FB_ATY_GENERIC_LCD is not set
+CONFIG_FB_VOODOO1=m
+# CONFIG_MTD_BLOCK2MTD is not set
+# CONFIG_MTD_MTDRAM is not set
+# CONFIG_MTD_CONCAT is not set
+# CONFIG_MTD_SLRAM is not set
+# CONFIG_MTD_DOC2000 is not set
+# CONFIG_MTD_DOC2001 is not set
+# CONFIG_MTD_DOC2001PLUS is not set
+# CONFIG_MTD_NAND is not set
+# CONFIG_MTD_BLKMTD is not set
+# CONFIG_MTD_PARTITIONS is not set
+# CONFIG_MTD_ONENAND_GENERIC is not set
+# CONFIG_MTD_DEBUG is not set
+# CONFIG_MTD_PHRAM is not set
+# CONFIG_MTD_PMC551 is not set
+CONFIG_I2C_ALGOBIT=m
+# CONFIG_JFFS2_RUBIN is not set
+CONFIG_JFFS2_FS_DEBUG=0
+# CONFIG_JFFS2_COMPRESSION_OPTIONS is not set
+CONFIG_JFFS2_FS_WRITEBUFFER=y
+CONFIG_JFFS2_RTIME=y
+CONFIG_JFFS2_ZLIB=y
+CONFIG_JFFS2_FS=m
+# CONFIG_VIDEO_SAA7134_ALSA is not set
+# CONFIG_VIDEO_SAA7134_OSS is not set

Added: dists/sid/linux-2.6/debian/config/arm/config.iop32x
==============================================================================
--- (empty file)
+++ dists/sid/linux-2.6/debian/config/arm/config.iop32x	Mon Nov 26 20:06:56 2007
@@ -0,0 +1,1204 @@
+CONFIG_RWSEM_GENERIC_SPINLOCK=y
+CONFIG_GENERIC_HWEIGHT=y
+CONFIG_GENERIC_CALIBRATE_DELAY=y
+CONFIG_VECTORS_BASE=0xffff0000
+
+#
+# Code maturity level options
+#
+CONFIG_EXPERIMENTAL=y
+CONFIG_BROKEN_ON_SMP=y
+
+#
+# General setup
+#
+CONFIG_LOCALVERSION=""
+# CONFIG_LOCALVERSION_AUTO is not set
+CONFIG_SWAP=y
+CONFIG_SYSVIPC=y
+# CONFIG_POSIX_MQUEUE is not set
+# CONFIG_BSD_PROCESS_ACCT is not set
+CONFIG_AUDIT=y
+# CONFIG_IKCONFIG is not set
+CONFIG_INITRAMFS_SOURCE=""
+CONFIG_UID16=y
+CONFIG_CC_OPTIMIZE_FOR_SIZE=y
+CONFIG_HOTPLUG=y
+CONFIG_BASE_FULL=y
+CONFIG_BASE_SMALL=0
+CONFIG_OBSOLETE_INTERMODULE=y
+
+#
+# Loadable module support
+#
+CONFIG_MODULES=y
+CONFIG_MODULE_UNLOAD=y
+# CONFIG_MODULE_FORCE_UNLOAD is not set
+CONFIG_MODVERSIONS=y
+# CONFIG_MODULE_SRCVERSION_ALL is not set
+CONFIG_KMOD=y
+
+#
+# Block layer
+#
+# CONFIG_BLK_DEV_IO_TRACE is not set
+
+#
+# System Type
+#
+# CONFIG_ARCH_AAEC2000 is not set
+# CONFIG_ARCH_INTEGRATOR is not set
+# CONFIG_ARCH_REALVIEW is not set
+# CONFIG_ARCH_VERSATILE is not set
+# CONFIG_ARCH_AT91 is not set
+# CONFIG_ARCH_CLPS7500 is not set
+# CONFIG_ARCH_CLPS711X is not set
+# CONFIG_ARCH_CO285 is not set
+# CONFIG_ARCH_EBSA110 is not set
+# CONFIG_ARCH_EP93XX is not set
+# CONFIG_ARCH_FOOTBRIDGE is not set
+# CONFIG_ARCH_NETX is not set
+# CONFIG_ARCH_H720X is not set
+# CONFIG_ARCH_IMX is not set
+CONFIG_ARCH_IOP32X=y
+# CONFIG_ARCH_IOP33X is not set
+# CONFIG_ARCH_IXP4XX is not set
+# CONFIG_ARCH_IXP2000 is not set
+# CONFIG_ARCH_IXP23XX is not set
+# CONFIG_ARCH_L7200 is not set
+# CONFIG_ARCH_PNX4008 is not set
+# CONFIG_ARCH_PXA is not set
+# CONFIG_ARCH_RPC is not set
+# CONFIG_ARCH_SA1100 is not set
+# CONFIG_ARCH_S3C2410 is not set
+# CONFIG_ARCH_SHARK is not set
+# CONFIG_ARCH_LH7A40X is not set
+# CONFIG_ARCH_OMAP is not set
+
+#
+# IOP32x Implementation Options
+#
+
+#
+# IOP32x Platform Types
+#
+CONFIG_MACH_GLANTANK=y
+CONFIG_ARCH_IQ80321=y
+CONFIG_ARCH_IQ31244=y
+CONFIG_MACH_N2100=y
+CONFIG_PLAT_IOP=y
+
+#
+# Processor Type
+#
+CONFIG_CPU_32=y
+CONFIG_CPU_XSCALE=y
+CONFIG_CPU_32v5=y
+CONFIG_CPU_ABRT_EV5T=y
+CONFIG_CPU_CACHE_VIVT=y
+CONFIG_CPU_TLB_V4WBI=y
+
+#
+# Processor Features
+#
+# CONFIG_ARM_THUMB is not set
+CONFIG_XSCALE_PMU=y
+
+#
+# Bus support
+#
+CONFIG_PCI=y
+
+#
+# PCCARD (PCMCIA/CardBus) support
+#
+# CONFIG_PCCARD is not set
+
+#
+# Kernel Features
+#
+# CONFIG_PREEMPT is not set
+# CONFIG_NO_IDLE_HZ is not set
+# CONFIG_ARCH_DISCONTIGMEM_ENABLE is not set
+CONFIG_SELECT_MEMORY_MODEL=y
+CONFIG_FLATMEM_MANUAL=y
+# CONFIG_DISCONTIGMEM_MANUAL is not set
+# CONFIG_SPARSEMEM_MANUAL is not set
+CONFIG_FLATMEM=y
+CONFIG_FLAT_NODE_MEM_MAP=y
+# CONFIG_SPARSEMEM_STATIC is not set
+CONFIG_SPLIT_PTLOCK_CPUS=4096
+CONFIG_ALIGNMENT_TRAP=y
+
+#
+# Boot options
+#
+CONFIG_ZBOOT_ROM_TEXT=0x0
+CONFIG_ZBOOT_ROM_BSS=0x0
+CONFIG_CMDLINE=""
+# CONFIG_XIP_KERNEL is not set
+
+#
+# Floating point emulation
+#
+
+#
+# At least one emulation must be selected
+#
+CONFIG_FPE_NWFPE=y
+# CONFIG_FPE_NWFPE_XP is not set
+# CONFIG_FPE_FASTFPE is not set
+
+#
+# Userspace binary formats
+#
+CONFIG_BINFMT_ELF=y
+CONFIG_BINFMT_AOUT=m
+CONFIG_BINFMT_MISC=m
+# CONFIG_ARTHUR is not set
+
+#
+# Power management options
+#
+# CONFIG_PM is not set
+# CONFIG_APM is not set
+
+#
+# Networking
+#
+CONFIG_NET=y
+
+#
+# Networking options
+#
+CONFIG_PACKET=y
+CONFIG_PACKET_MMAP=y
+CONFIG_UNIX=y
+CONFIG_XFRM=y
+CONFIG_XFRM_USER=m
+CONFIG_NET_KEY=m
+CONFIG_INET=y
+CONFIG_IP_MULTICAST=y
+# CONFIG_IP_ADVANCED_ROUTER is not set
+CONFIG_IP_FIB_HASH=y
+# CONFIG_IP_PNP is not set
+CONFIG_NET_IPIP=m
+CONFIG_NET_IPGRE=m
+CONFIG_NET_IPGRE_BROADCAST=y
+CONFIG_IP_MROUTE=y
+CONFIG_IP_PIMSM_V1=y
+CONFIG_IP_PIMSM_V2=y
+# CONFIG_ARPD is not set
+CONFIG_SYN_COOKIES=y
+CONFIG_INET_AH=m
+CONFIG_INET_ESP=m
+CONFIG_INET_IPCOMP=m
+CONFIG_INET_XFRM_TUNNEL=m
+CONFIG_INET_TUNNEL=m
+CONFIG_INET_DIAG=m
+CONFIG_INET_TCP_DIAG=m
+CONFIG_TCP_CONG_ADVANCED=y
+
+#
+# TCP congestion control
+#
+CONFIG_TCP_CONG_BIC=y
+CONFIG_TCP_CONG_CUBIC=m
+CONFIG_TCP_CONG_WESTWOOD=m
+CONFIG_TCP_CONG_HTCP=m
+# CONFIG_TCP_CONG_HSTCP is not set
+# CONFIG_TCP_CONG_HYBLA is not set
+# CONFIG_TCP_CONG_VEGAS is not set
+# CONFIG_TCP_CONG_SCALABLE is not set
+
+#
+# DECnet: Netfilter Configuration
+#
+# CONFIG_DECNET_NF_GRABULATOR is not set
+
+#
+# Bridge: Netfilter Configuration
+#
+# CONFIG_BRIDGE_NF_EBTABLES is not set
+
+#
+# DCCP Configuration (EXPERIMENTAL)
+#
+# CONFIG_IP_DCCP is not set
+
+#
+# SCTP Configuration (EXPERIMENTAL)
+#
+# CONFIG_IP_SCTP is not set
+
+#
+# TIPC Configuration (EXPERIMENTAL)
+#
+# CONFIG_TIPC is not set
+CONFIG_ATM=m
+CONFIG_ATM_CLIP=m
+# CONFIG_ATM_CLIP_NO_ICMP is not set
+CONFIG_ATM_LANE=m
+CONFIG_ATM_MPOA=m
+CONFIG_ATM_BR2684=m
+# CONFIG_ATM_BR2684_IPFILTER is not set
+CONFIG_BRIDGE=m
+CONFIG_VLAN_8021Q=m
+CONFIG_DECNET=m
+# CONFIG_DECNET_ROUTER is not set
+CONFIG_LLC=y
+CONFIG_LLC2=y
+CONFIG_IPX=m
+CONFIG_IPX_INTERN=y
+CONFIG_ATALK=m
+CONFIG_IPDDP=m
+CONFIG_IPDDP_ENCAP=y
+CONFIG_IPDDP_DECAP=y
+# CONFIG_X25 is not set
+# CONFIG_LAPB is not set
+# CONFIG_NET_DIVERT is not set
+# CONFIG_ECONET is not set
+# CONFIG_WAN_ROUTER is not set
+
+#
+# Network testing
+#
+# CONFIG_HAMRADIO is not set
+# CONFIG_IRDA is not set
+CONFIG_BT=m
+CONFIG_BT_L2CAP=m
+CONFIG_BT_SCO=m
+CONFIG_BT_RFCOMM=m
+CONFIG_BT_RFCOMM_TTY=y
+CONFIG_BT_BNEP=m
+CONFIG_BT_BNEP_MC_FILTER=y
+CONFIG_BT_BNEP_PROTO_FILTER=y
+CONFIG_BT_HIDP=m
+
+#
+# Bluetooth device drivers
+#
+CONFIG_BT_HCIUSB=m
+CONFIG_BT_HCIUSB_SCO=y
+# CONFIG_BT_HCIUART is not set
+CONFIG_BT_HCIBCM203X=m
+CONFIG_BT_HCIBPA10X=m
+CONFIG_BT_HCIBFUSB=m
+CONFIG_BT_HCIVHCI=m
+CONFIG_IEEE80211=m
+# CONFIG_IEEE80211_DEBUG is not set
+CONFIG_IEEE80211_CRYPT_WEP=m
+CONFIG_IEEE80211_CRYPT_CCMP=m
+# CONFIG_IEEE80211_CRYPT_TKIP is not set
+CONFIG_IEEE80211_SOFTMAC=m
+# CONFIG_IEEE80211_SOFTMAC_DEBUG is not set
+CONFIG_WIRELESS_EXT=y
+
+#
+# Device Drivers
+#
+
+#
+# Generic Driver Options
+#
+CONFIG_STANDALONE=y
+CONFIG_PREVENT_FIRMWARE_BUILD=y
+CONFIG_FW_LOADER=m
+
+#
+# Connector - unified userspace <-> kernelspace linker
+#
+CONFIG_CONNECTOR=m
+
+#
+# Memory Technology Devices (MTD)
+#
+CONFIG_MTD=y
+# CONFIG_MTD_DEBUG is not set
+CONFIG_MTD_CONCAT=y
+CONFIG_MTD_PARTITIONS=y
+CONFIG_MTD_REDBOOT_PARTS=y
+CONFIG_MTD_REDBOOT_DIRECTORY_BLOCK=-1
+# CONFIG_MTD_REDBOOT_PARTS_UNALLOCATED is not set
+# CONFIG_MTD_REDBOOT_PARTS_READONLY is not set
+# CONFIG_MTD_CMDLINE_PARTS is not set
+# CONFIG_MTD_AFS_PARTS is not set
+
+#
+# User Modules And Translation Layers
+#
+CONFIG_MTD_CHAR=y
+CONFIG_MTD_BLOCK=y
+# CONFIG_FTL is not set
+# CONFIG_NFTL is not set
+# CONFIG_INFTL is not set
+# CONFIG_RFD_FTL is not set
+
+#
+# RAM/ROM/Flash chip drivers
+#
+CONFIG_MTD_CFI=y
+# CONFIG_MTD_JEDECPROBE is not set
+CONFIG_MTD_GEN_PROBE=y
+CONFIG_MTD_CFI_ADV_OPTIONS=y
+CONFIG_MTD_CFI_NOSWAP=y
+# CONFIG_MTD_CFI_BE_BYTE_SWAP is not set
+# CONFIG_MTD_CFI_LE_BYTE_SWAP is not set
+CONFIG_MTD_CFI_GEOMETRY=y
+CONFIG_MTD_MAP_BANK_WIDTH_1=y
+CONFIG_MTD_MAP_BANK_WIDTH_2=y
+CONFIG_MTD_MAP_BANK_WIDTH_4=y
+# CONFIG_MTD_MAP_BANK_WIDTH_8 is not set
+# CONFIG_MTD_MAP_BANK_WIDTH_16 is not set
+# CONFIG_MTD_MAP_BANK_WIDTH_32 is not set
+CONFIG_MTD_CFI_I1=y
+CONFIG_MTD_CFI_I2=y
+# CONFIG_MTD_CFI_I4 is not set
+# CONFIG_MTD_CFI_I8 is not set
+# CONFIG_MTD_OTP is not set
+CONFIG_MTD_CFI_INTELEXT=y
+# CONFIG_MTD_CFI_AMDSTD is not set
+# CONFIG_MTD_CFI_STAA is not set
+CONFIG_MTD_CFI_UTIL=y
+CONFIG_MTD_RAM=m
+# CONFIG_MTD_ROM is not set
+# CONFIG_MTD_ABSENT is not set
+
+#
+# Mapping drivers for chip access
+#
+CONFIG_MTD_COMPLEX_MAPPINGS=y
+CONFIG_MTD_PHYSMAP=y
+CONFIG_MTD_PHYSMAP_START=0x0
+CONFIG_MTD_PHYSMAP_LEN=0x0
+CONFIG_MTD_PHYSMAP_BANKWIDTH=1
+# CONFIG_MTD_ARM_INTEGRATOR is not set
+# CONFIG_MTD_PCI is not set
+CONFIG_MTD_PLATRAM=m
+
+#
+# Self-contained MTD device drivers
+#
+# CONFIG_MTD_PMC551 is not set
+# CONFIG_MTD_DATAFLASH is not set
+# CONFIG_MTD_M25P80 is not set
+# CONFIG_MTD_SLRAM is not set
+# CONFIG_MTD_PHRAM is not set
+# CONFIG_MTD_MTDRAM is not set
+# CONFIG_MTD_BLOCK2MTD is not set
+
+#
+# Disk-On-Chip Device Drivers
+#
+# CONFIG_MTD_DOC2000 is not set
+# CONFIG_MTD_DOC2001 is not set
+# CONFIG_MTD_DOC2001PLUS is not set
+
+#
+# NAND Flash Device Drivers
+#
+CONFIG_MTD_NAND=m
+# CONFIG_MTD_NAND_VERIFY_WRITE is not set
+CONFIG_MTD_NAND_IDS=m
+# CONFIG_MTD_NAND_DISKONCHIP is not set
+# CONFIG_MTD_NAND_NANDSIM is not set
+
+#
+# OneNAND Flash Device Drivers
+#
+# CONFIG_MTD_ONENAND is not set
+
+#
+# Parallel port support
+#
+
+#
+# Plug and Play support
+#
+
+#
+# Block devices
+#
+# CONFIG_BLK_CPQ_DA is not set
+# CONFIG_BLK_CPQ_CISS_DA is not set
+# CONFIG_BLK_DEV_DAC960 is not set
+# CONFIG_BLK_DEV_UMEM is not set
+# CONFIG_BLK_DEV_COW_COMMON is not set
+CONFIG_BLK_DEV_LOOP=m
+CONFIG_BLK_DEV_CRYPTOLOOP=m
+CONFIG_BLK_DEV_NBD=m
+# CONFIG_BLK_DEV_SX8 is not set
+# CONFIG_BLK_DEV_UB is not set
+CONFIG_BLK_DEV_RAM=y
+CONFIG_BLK_DEV_RAM_COUNT=16
+CONFIG_BLK_DEV_RAM_SIZE=8192
+CONFIG_BLK_DEV_INITRD=y
+# CONFIG_CDROM_PKTCDVD is not set
+# CONFIG_ATA_OVER_ETH is not set
+
+#
+# ATA/ATAPI/MFM/RLL support
+#
+CONFIG_IDE=m
+CONFIG_BLK_DEV_IDE=m
+
+#
+# Please see Documentation/ide.txt for help/info on IDE drives
+#
+# CONFIG_BLK_DEV_IDE_SATA is not set
+CONFIG_BLK_DEV_IDEDISK=m
+# CONFIG_IDEDISK_MULTI_MODE is not set
+CONFIG_BLK_DEV_IDECD=m
+CONFIG_BLK_DEV_IDETAPE=m
+CONFIG_BLK_DEV_IDEFLOPPY=m
+CONFIG_BLK_DEV_IDESCSI=m
+
+#
+# IDE chipset support/bugfixes
+#
+CONFIG_IDE_GENERIC=m
+CONFIG_BLK_DEV_IDEPCI=y
+CONFIG_IDEPCI_SHARE_IRQ=y
+CONFIG_BLK_DEV_OFFBOARD=y
+CONFIG_BLK_DEV_GENERIC=m
+CONFIG_BLK_DEV_OPTI621=m
+CONFIG_BLK_DEV_SL82C105=m
+CONFIG_BLK_DEV_IDEDMA_PCI=y
+# CONFIG_BLK_DEV_IDEDMA_FORCED is not set
+CONFIG_IDEDMA_ONLYDISK=y
+CONFIG_BLK_DEV_AEC62XX=m
+CONFIG_BLK_DEV_ALI15X3=m
+# CONFIG_WDC_ALI15X3 is not set
+# CONFIG_BLK_DEV_AMD74XX is not set
+CONFIG_BLK_DEV_CMD64X=m
+CONFIG_BLK_DEV_TRIFLEX=m
+CONFIG_BLK_DEV_CY82C693=m
+CONFIG_BLK_DEV_CS5520=m
+CONFIG_BLK_DEV_CS5530=m
+CONFIG_BLK_DEV_HPT34X=m
+CONFIG_HPT34X_AUTODMA=y
+CONFIG_BLK_DEV_HPT366=m
+CONFIG_BLK_DEV_SC1200=m
+CONFIG_BLK_DEV_PIIX=m
+CONFIG_BLK_DEV_IT821X=m
+CONFIG_BLK_DEV_NS87415=m
+CONFIG_BLK_DEV_PDC202XX_OLD=m
+CONFIG_PDC202XX_BURST=y
+CONFIG_BLK_DEV_PDC202XX_NEW=m
+CONFIG_BLK_DEV_SVWKS=m
+CONFIG_BLK_DEV_SIIMAGE=m
+CONFIG_BLK_DEV_SLC90E66=m
+CONFIG_BLK_DEV_TRM290=m
+CONFIG_BLK_DEV_VIA82CXXX=m
+# CONFIG_IDE_ARM is not set
+CONFIG_BLK_DEV_IDEDMA=y
+# CONFIG_IDEDMA_IVB is not set
+# CONFIG_BLK_DEV_HD is not set
+
+#
+# SCSI device support
+#
+CONFIG_RAID_ATTRS=m
+CONFIG_SCSI=m
+CONFIG_SCSI_PROC_FS=y
+
+#
+# SCSI support type (disk, tape, CD-ROM)
+#
+CONFIG_BLK_DEV_SD=m
+CONFIG_CHR_DEV_ST=m
+CONFIG_CHR_DEV_OSST=m
+CONFIG_BLK_DEV_SR=m
+CONFIG_BLK_DEV_SR_VENDOR=y
+CONFIG_CHR_DEV_SG=m
+CONFIG_CHR_DEV_SCH=m
+
+#
+# Some SCSI devices (e.g. CD jukebox) support multiple LUNs
+#
+CONFIG_SCSI_MULTI_LUN=y
+# CONFIG_SCSI_CONSTANTS is not set
+# CONFIG_SCSI_LOGGING is not set
+
+#
+# SCSI Transport Attributes
+#
+CONFIG_SCSI_SPI_ATTRS=m
+CONFIG_SCSI_FC_ATTRS=m
+CONFIG_SCSI_ISCSI_ATTRS=m
+CONFIG_SCSI_SAS_ATTRS=m
+
+# SCSI low-level drivers
+# CONFIG_SCSI_ACARD is not set
+
+#
+# Serial ATA (prod) and Parallel ATA (experimental) drivers
+#
+CONFIG_ATA=m
+CONFIG_SATA_AHCI=m
+CONFIG_SATA_SVW=m
+CONFIG_ATA_PIIX=m
+CONFIG_SATA_MV=m
+CONFIG_SATA_NV=m
+CONFIG_PDC_ADMA=m
+CONFIG_SATA_QSTOR=m
+CONFIG_SATA_PROMISE=m
+CONFIG_SATA_SX4=m
+CONFIG_SATA_SIL=m
+CONFIG_SATA_SIL24=m
+CONFIG_SATA_SIS=m
+CONFIG_SATA_ULI=m
+CONFIG_SATA_VIA=m
+CONFIG_SATA_VITESSE=m
+
+#
+# Multi-device support (RAID and LVM)
+#
+CONFIG_MD=y
+CONFIG_BLK_DEV_MD=m
+CONFIG_MD_LINEAR=m
+CONFIG_MD_RAID0=m
+CONFIG_MD_RAID1=m
+CONFIG_MD_RAID10=m
+CONFIG_MD_RAID5=m
+CONFIG_MD_RAID5_RESHAPE=y
+CONFIG_MD_RAID6=m
+CONFIG_MD_MULTIPATH=m
+CONFIG_MD_FAULTY=m
+CONFIG_BLK_DEV_DM=m
+CONFIG_DM_CRYPT=m
+CONFIG_DM_SNAPSHOT=m
+CONFIG_DM_MIRROR=m
+CONFIG_DM_ZERO=m
+CONFIG_DM_MULTIPATH=m
+
+#
+# Fusion MPT device support
+#
+CONFIG_FUSION=y
+CONFIG_FUSION_SPI=m
+CONFIG_FUSION_FC=m
+CONFIG_FUSION_SAS=m
+CONFIG_FUSION_MAX_SGE=40
+CONFIG_FUSION_CTL=m
+
+#
+# IEEE 1394 (FireWire) support
+#
+# CONFIG_FIREWIRE is not set
+
+#
+# I2O device support
+#
+# CONFIG_I2O is not set
+
+#
+# Network device support
+#
+CONFIG_NETDEVICES=y
+CONFIG_DUMMY=m
+CONFIG_BONDING=m
+CONFIG_EQUALIZER=m
+CONFIG_TUN=m
+
+#
+# ARCnet devices
+#
+# CONFIG_ARCNET is not set
+
+#
+# PHY device support
+#
+CONFIG_PHYLIB=m
+
+#
+# MII PHY device drivers
+#
+CONFIG_MARVELL_PHY=m
+CONFIG_DAVICOM_PHY=m
+CONFIG_QSEMI_PHY=m
+CONFIG_LXT_PHY=m
+CONFIG_CICADA_PHY=m
+
+#
+# Ethernet (10 or 100Mbit)
+#
+CONFIG_NET_ETHERNET=y
+CONFIG_MII=y
+# CONFIG_HAPPYMEAL is not set
+# CONFIG_SUNGEM is not set
+# CONFIG_CASSINI is not set
+# CONFIG_NET_VENDOR_3COM is not set
+# CONFIG_SMC91X is not set
+# CONFIG_DM9000 is not set
+
+#
+# Tulip family network device support
+#
+# CONFIG_NET_TULIP is not set
+# CONFIG_HP100 is not set
+# CONFIG_NET_PCI is not set
+
+#
+# Ethernet (1000 Mbit)
+#
+CONFIG_R8169=m
+CONFIG_R8169_NAPI=y
+CONFIG_R8169_VLAN=y
+
+#
+# Token Ring devices
+#
+# CONFIG_TR is not set
+
+#
+# Wireless LAN (non-hamradio)
+#
+CONFIG_WLAN_PRE80211=y
+CONFIG_STRIP=m
+CONFIG_WLAN_80211=y
+
+#
+# Wireless 802.11b ISA/PCI cards support
+#
+CONFIG_IPW2100=m
+# CONFIG_IPW2100_MONITOR is not set
+# CONFIG_IPW2100_DEBUG is not set
+CONFIG_IPW2200=m
+CONFIG_IPW2200_MONITOR=y
+# CONFIG_IPW_QOS is not set
+# CONFIG_IPW2200_DEBUG is not set
+CONFIG_HERMES=m
+CONFIG_PLX_HERMES=m
+CONFIG_TMD_HERMES=m
+CONFIG_NORTEL_HERMES=m
+CONFIG_PCI_HERMES=m
+CONFIG_ATMEL=m
+CONFIG_PCI_ATMEL=m
+
+#
+# ISDN subsystem
+#
+# CONFIG_ISDN is not set
+
+#
+# Input device support
+#
+CONFIG_INPUT=y
+
+#
+# Userland interfaces
+#
+CONFIG_INPUT_MOUSEDEV=y
+CONFIG_INPUT_MOUSEDEV_PSAUX=y
+CONFIG_INPUT_MOUSEDEV_SCREEN_X=1024
+CONFIG_INPUT_MOUSEDEV_SCREEN_Y=768
+# CONFIG_INPUT_JOYDEV is not set
+# CONFIG_INPUT_TSDEV is not set
+CONFIG_INPUT_EVDEV=m
+
+#
+# Input Device Drivers
+#
+CONFIG_INPUT_KEYBOARD=y
+CONFIG_KEYBOARD_ATKBD=y
+# CONFIG_KEYBOARD_SUNKBD is not set
+# CONFIG_KEYBOARD_LKKBD is not set
+# CONFIG_KEYBOARD_XTKBD is not set
+# CONFIG_KEYBOARD_NEWTON is not set
+CONFIG_INPUT_MOUSE=y
+CONFIG_MOUSE_PS2=y
+# CONFIG_MOUSE_SERIAL is not set
+CONFIG_MOUSE_APPLETOUCH=m
+# CONFIG_MOUSE_VSXXXAA is not set
+# CONFIG_INPUT_JOYSTICK is not set
+CONFIG_INPUT_TABLET=y
+CONFIG_TABLET_USB_ACECAD=m
+CONFIG_TABLET_USB_AIPTEK=m
+CONFIG_TABLET_USB_GTCO=m
+CONFIG_TABLET_USB_KBTAB=m
+CONFIG_TABLET_USB_WACOM=m
+# CONFIG_INPUT_TOUCHSCREEN is not set
+CONFIG_INPUT_UINPUT=m
+
+#
+# Hardware I/O ports
+#
+CONFIG_SERIO=y
+CONFIG_SERIO_SERPORT=y
+# CONFIG_SERIO_PCIPS2 is not set
+CONFIG_SERIO_LIBPS2=y
+# CONFIG_SERIO_RAW is not set
+# CONFIG_GAMEPORT is not set
+
+#
+# Character devices
+#
+CONFIG_VT=y
+CONFIG_VT_CONSOLE=y
+CONFIG_HW_CONSOLE=y
+# CONFIG_SERIAL_NONSTANDARD is not set
+
+#
+# Serial drivers
+#
+CONFIG_SERIAL_8250=y
+CONFIG_SERIAL_8250_CONSOLE=y
+CONFIG_SERIAL_8250_NR_UARTS=2
+CONFIG_SERIAL_8250_RUNTIME_UARTS=2
+# CONFIG_SERIAL_8250_EXTENDED is not set
+
+#
+# Non-8250 serial port support
+#
+CONFIG_SERIAL_CORE=y
+CONFIG_SERIAL_CORE_CONSOLE=y
+# CONFIG_SERIAL_JSM is not set
+
+#
+# IPMI
+#
+# CONFIG_IPMI_HANDLER is not set
+
+#
+# Watchdog Cards
+#
+CONFIG_WATCHDOG=y
+# CONFIG_WATCHDOG_NOWAYOUT is not set
+
+#
+# Watchdog Device Drivers
+#
+# CONFIG_SOFT_WATCHDOG is not set
+
+#
+# PCI-based Watchdog Cards
+#
+# CONFIG_PCIPCWATCHDOG is not set
+# CONFIG_WDTPCI is not set
+
+#
+# USB-based Watchdog Cards
+#
+# CONFIG_USBPCWATCHDOG is not set
+# CONFIG_NVRAM is not set
+# CONFIG_DTLK is not set
+# CONFIG_R3964 is not set
+# CONFIG_APPLICOM is not set
+
+#
+# Ftape, the floppy tape device driver
+#
+# CONFIG_DRM is not set
+# CONFIG_RAW_DRIVER is not set
+
+#
+# TPM devices
+#
+# CONFIG_TCG_TPM is not set
+# CONFIG_TELCLOCK is not set
+
+#
+# I2C support
+#
+CONFIG_I2C=y
+CONFIG_I2C_CHARDEV=y
+
+#
+# I2C Algorithms
+#
+CONFIG_I2C_ALGOBIT=y
+# CONFIG_I2C_ALGOPCF is not set
+# CONFIG_I2C_ALGOPCA is not set
+
+#
+# I2C Hardware Bus support
+#
+# CONFIG_I2C_ALI1535 is not set
+# CONFIG_I2C_ALI1563 is not set
+# CONFIG_I2C_ALI15X3 is not set
+# CONFIG_I2C_AMD756 is not set
+# CONFIG_I2C_AMD8111 is not set
+# CONFIG_I2C_I801 is not set
+# CONFIG_I2C_I810 is not set
+# CONFIG_I2C_PIIX4 is not set
+CONFIG_I2C_IOP3XX=y
+# CONFIG_I2C_NFORCE2 is not set
+# CONFIG_I2C_PARPORT_LIGHT is not set
+# CONFIG_I2C_PROSAVAGE is not set
+# CONFIG_I2C_SAVAGE4 is not set
+# CONFIG_I2C_SIS5595 is not set
+# CONFIG_I2C_SIS630 is not set
+# CONFIG_I2C_SIS96X is not set
+# CONFIG_I2C_STUB is not set
+# CONFIG_I2C_VIA is not set
+# CONFIG_I2C_VIAPRO is not set
+# CONFIG_I2C_VOODOO3 is not set
+# CONFIG_I2C_PCA_ISA is not set
+
+#
+# Miscellaneous I2C Chip support
+#
+# CONFIG_SENSORS_DS1337 is not set
+# CONFIG_SENSORS_DS1374 is not set
+# CONFIG_SENSORS_EEPROM is not set
+# CONFIG_SENSORS_PCF8574 is not set
+# CONFIG_SENSORS_PCA9539 is not set
+# CONFIG_SENSORS_PCF8591 is not set
+# CONFIG_SENSORS_MAX6875 is not set
+# CONFIG_I2C_DEBUG_CORE is not set
+# CONFIG_I2C_DEBUG_ALGO is not set
+# CONFIG_I2C_DEBUG_BUS is not set
+# CONFIG_I2C_DEBUG_CHIP is not set
+
+#
+# SPI support
+#
+CONFIG_SPI=y
+CONFIG_SPI_MASTER=y
+
+#
+# SPI Master Controller Drivers
+#
+# CONFIG_SPI_BITBANG is not set
+
+#
+# SPI Protocol Masters
+#
+
+#
+# Dallas's 1-wire bus
+#
+# CONFIG_W1 is not set
+
+#
+# Hardware Monitoring support
+#
+CONFIG_HWMON=y
+# CONFIG_HWMON_VID is not set
+# CONFIG_SENSORS_ADM1021 is not set
+# CONFIG_SENSORS_ADM1025 is not set
+# CONFIG_SENSORS_ADM1026 is not set
+# CONFIG_SENSORS_ADM1031 is not set
+# CONFIG_SENSORS_ADM9240 is not set
+# CONFIG_SENSORS_ASB100 is not set
+# CONFIG_SENSORS_ATXP1 is not set
+# CONFIG_SENSORS_DS1621 is not set
+# CONFIG_SENSORS_F71805F is not set
+CONFIG_SENSORS_F75375S=y
+# CONFIG_SENSORS_FSCHER is not set
+# CONFIG_SENSORS_FSCPOS is not set
+# CONFIG_SENSORS_GL518SM is not set
+# CONFIG_SENSORS_GL520SM is not set
+# CONFIG_SENSORS_IT87 is not set
+# CONFIG_SENSORS_LM63 is not set
+# CONFIG_SENSORS_LM75 is not set
+# CONFIG_SENSORS_LM77 is not set
+# CONFIG_SENSORS_LM78 is not set
+# CONFIG_SENSORS_LM80 is not set
+# CONFIG_SENSORS_LM83 is not set
+# CONFIG_SENSORS_LM85 is not set
+# CONFIG_SENSORS_LM87 is not set
+# CONFIG_SENSORS_LM90 is not set
+# CONFIG_SENSORS_LM92 is not set
+# CONFIG_SENSORS_MAX1619 is not set
+# CONFIG_SENSORS_PC87360 is not set
+# CONFIG_SENSORS_SIS5595 is not set
+# CONFIG_SENSORS_SMSC47M1 is not set
+# CONFIG_SENSORS_SMSC47B397 is not set
+# CONFIG_SENSORS_VIA686A is not set
+# CONFIG_SENSORS_VT8231 is not set
+# CONFIG_SENSORS_W83781D is not set
+# CONFIG_SENSORS_W83792D is not set
+# CONFIG_SENSORS_W83L785TS is not set
+# CONFIG_SENSORS_W83627HF is not set
+# CONFIG_SENSORS_W83627EHF is not set
+# CONFIG_HWMON_DEBUG_CHIP is not set
+
+#
+# Misc devices
+#
+
+#
+# LED devices
+#
+CONFIG_NEW_LEDS=y
+CONFIG_LEDS_CLASS=m
+
+#
+# LED drivers
+#
+
+#
+# LED Triggers
+#
+CONFIG_LEDS_TRIGGERS=y
+CONFIG_LEDS_TRIGGER_TIMER=m
+# CONFIG_LEDS_TRIGGER_IDE_DISK is not set
+
+#
+# Multimedia devices
+#
+CONFIG_VIDEO_DEV=m
+CONFIG_VIDEO_V4L1=y
+
+#
+# Video Capture Adapters
+#
+
+#
+# Radio Adapters
+#
+# CONFIG_RADIO_GEMTEK_PCI is not set
+# CONFIG_RADIO_MAXIRADIO is not set
+# CONFIG_RADIO_MAESTRO is not set
+
+#
+# Digital Video Broadcasting Devices
+#
+CONFIG_DVB_CORE=m
+
+#
+# Supported DVB Frontends
+#
+
+#
+# Graphics support
+#
+# CONFIG_FB is not set
+
+#
+# Console display driver support
+#
+# CONFIG_VGA_CONSOLE is not set
+CONFIG_DUMMY_CONSOLE=y
+
+#
+# Sound
+#
+CONFIG_SOUND=m
+
+#
+# Advanced Linux Sound Architecture
+#
+CONFIG_SND=m
+CONFIG_SND_TIMER=m
+CONFIG_SND_PCM=m
+CONFIG_SND_HWDEP=m
+CONFIG_SND_RAWMIDI=m
+CONFIG_SND_SEQUENCER=m
+CONFIG_SND_SEQ_DUMMY=m
+CONFIG_SND_OSSEMUL=y
+CONFIG_SND_MIXER_OSS=m
+CONFIG_SND_PCM_OSS=m
+CONFIG_SND_PCM_OSS_PLUGINS=y
+# CONFIG_SND_SEQUENCER_OSS is not set
+# CONFIG_SND_DYNAMIC_MINORS is not set
+CONFIG_SND_SUPPORT_OLD_API=y
+CONFIG_SND_VERBOSE_PROCFS=y
+# CONFIG_SND_VERBOSE_PRINTK is not set
+# CONFIG_SND_DEBUG is not set
+
+#
+# Generic devices
+#
+CONFIG_SND_MPU401_UART=m
+CONFIG_SND_OPL3_LIB=m
+CONFIG_SND_AC97_CODEC=m
+CONFIG_SND_AC97_BUS=m
+CONFIG_SND_DUMMY=m
+# CONFIG_SND_VIRMIDI is not set
+CONFIG_SND_MTPAV=m
+CONFIG_SND_SERIAL_U16550=m
+CONFIG_SND_MPU401=m
+
+#
+# PCI devices
+#
+# CONFIG_SND_AD1889 is not set
+CONFIG_SND_ALS300=m
+# CONFIG_SND_ALI5451 is not set
+# CONFIG_SND_ATIIXP is not set
+# CONFIG_SND_ATIIXP_MODEM is not set
+# CONFIG_SND_AU8810 is not set
+# CONFIG_SND_AU8820 is not set
+# CONFIG_SND_AU8830 is not set
+# CONFIG_SND_AZT3328 is not set
+# CONFIG_SND_BT87X is not set
+# CONFIG_SND_CA0106 is not set
+# CONFIG_SND_CMIPCI is not set
+# CONFIG_SND_CS4281 is not set
+# CONFIG_SND_CS46XX is not set
+# CONFIG_SND_EMU10K1 is not set
+# CONFIG_SND_EMU10K1X is not set
+# CONFIG_SND_ENS1370 is not set
+# CONFIG_SND_ENS1371 is not set
+# CONFIG_SND_ES1938 is not set
+# CONFIG_SND_ES1968 is not set
+# CONFIG_SND_FM801 is not set
+# CONFIG_SND_HDA_INTEL is not set
+# CONFIG_SND_HDSP is not set
+# CONFIG_SND_HDSPM is not set
+# CONFIG_SND_ICE1712 is not set
+# CONFIG_SND_ICE1724 is not set
+# CONFIG_SND_INTEL8X0 is not set
+# CONFIG_SND_INTEL8X0M is not set
+# CONFIG_SND_KORG1212 is not set
+# CONFIG_SND_MAESTRO3 is not set
+# CONFIG_SND_MIXART is not set
+# CONFIG_SND_NM256 is not set
+CONFIG_SND_PCXHR=m
+CONFIG_SND_RIPTIDE=m
+# CONFIG_SND_RME32 is not set
+# CONFIG_SND_RME96 is not set
+# CONFIG_SND_RME9652 is not set
+# CONFIG_SND_SONICVIBES is not set
+# CONFIG_SND_TRIDENT is not set
+# CONFIG_SND_VIA82XX is not set
+# CONFIG_SND_VIA82XX_MODEM is not set
+# CONFIG_SND_VX222 is not set
+# CONFIG_SND_YMFPCI is not set
+
+#
+# ALSA ARM devices
+#
+
+#
+# USB devices
+#
+CONFIG_SND_USB_AUDIO=m
+
+#
+# Open Sound System
+#
+# CONFIG_SOUND_PRIME is not set
+
+#
+# USB support
+#
+CONFIG_USB_ARCH_HAS_HCD=y
+CONFIG_USB_ARCH_HAS_OHCI=y
+CONFIG_USB_ARCH_HAS_EHCI=y
+CONFIG_USB=m
+# CONFIG_USB_DEBUG is not set
+
+#
+# Miscellaneous USB options
+#
+CONFIG_USB_DEVICEFS=y
+# CONFIG_USB_DYNAMIC_MINORS is not set
+# CONFIG_USB_OTG is not set
+
+#
+# USB Host Controller Drivers
+#
+CONFIG_USB_EHCI_HCD=m
+CONFIG_USB_EHCI_SPLIT_ISO=y
+CONFIG_USB_EHCI_ROOT_HUB_TT=y
+CONFIG_USB_ISP116X_HCD=m
+CONFIG_USB_OHCI_HCD=m
+CONFIG_USB_OHCI_LITTLE_ENDIAN=y
+CONFIG_USB_UHCI_HCD=m
+CONFIG_USB_SL811_HCD=m
+
+# USB Device Class drivers
+#
+CONFIG_USB_ACM=m
+CONFIG_USB_PRINTER=m
+
+CONFIG_USB_STORAGE=m
+
+#
+# MMC/SD Card support
+#
+# CONFIG_MMC is not set
+
+#
+# Real Time Clock
+#
+CONFIG_RTC_LIB=y
+CONFIG_RTC_CLASS=y
+CONFIG_RTC_HCTOSYS=y
+CONFIG_RTC_HCTOSYS_DEVICE="rtc0"
+
+#
+# RTC interfaces
+#
+CONFIG_RTC_INTF_SYSFS=y
+CONFIG_RTC_INTF_PROC=y
+CONFIG_RTC_INTF_DEV=y
+
+#
+# RTC drivers
+#
+# CONFIG_RTC_DRV_X1205 is not set
+# CONFIG_RTC_DRV_DS1672 is not set
+# CONFIG_RTC_DRV_PCF8563 is not set
+CONFIG_RTC_DRV_RS5C372=y
+# CONFIG_RTC_DRV_M48T86 is not set
+# CONFIG_RTC_DRV_TEST is not set
+
+#
+# DMA Engine support
+#
+CONFIG_DMA_ENGINE=y
+
+#
+# DMA Clients
+#
+CONFIG_NET_DMA=y
+
+#
+# DMA Devices
+#
+CONFIG_INTEL_IOATDMA=y
+CONFIG_INTEL_IOP_ADMA=y
+
+#
+# Miscellaneous filesystems
+#
+CONFIG_JFFS2_FS=y
+CONFIG_JFFS2_FS_DEBUG=0
+CONFIG_JFFS2_FS_WRITEBUFFER=y
+# CONFIG_JFFS2_SUMMARY is not set
+# CONFIG_JFFS2_COMPRESSION_OPTIONS is not set
+CONFIG_JFFS2_ZLIB=y
+CONFIG_JFFS2_RTIME=y
+# CONFIG_JFFS2_RUBIN is not set
+
+CONFIG_CRAMFS=y
+
+#
+# Profiling support
+#
+# CONFIG_PROFILING is not set
+
+#
+# Kernel hacking
+#
+# CONFIG_PRINTK_TIME is not set
+# CONFIG_MAGIC_SYSRQ is not set
+# CONFIG_DEBUG_KERNEL is not set
+CONFIG_LOG_BUF_SHIFT=14
+# CONFIG_DEBUG_FS is not set
+CONFIG_FRAME_POINTER=y
+# CONFIG_UNWIND_INFO is not set
+# CONFIG_DEBUG_USER is not set
+
+#
+# Hardware crypto devices
+#
+
+#
+# Library routines
+#
+CONFIG_CRC_CCITT=m
+CONFIG_CRC16=m
+CONFIG_CRC32=y
+CONFIG_LIBCRC32C=m
+CONFIG_ZLIB_INFLATE=y
+CONFIG_ZLIB_DEFLATE=y
+CONFIG_TEXTSEARCH=y
+CONFIG_TEXTSEARCH_KMP=m
+CONFIG_TEXTSEARCH_BM=m
+CONFIG_TEXTSEARCH_FSM=m

Added: dists/sid/linux-2.6/debian/config/arm/config.ixp4xx
==============================================================================
--- (empty file)
+++ dists/sid/linux-2.6/debian/config/arm/config.ixp4xx	Mon Nov 26 20:06:56 2007
@@ -0,0 +1,1302 @@
+CONFIG_GENERIC_TIME=y
+CONFIG_RWSEM_GENERIC_SPINLOCK=y
+CONFIG_GENERIC_HWEIGHT=y
+CONFIG_GENERIC_CALIBRATE_DELAY=y
+CONFIG_VECTORS_BASE=0xffff0000
+
+#
+# Code maturity level options
+#
+CONFIG_EXPERIMENTAL=y
+CONFIG_BROKEN_ON_SMP=y
+
+#
+# General setup
+#
+CONFIG_LOCALVERSION=""
+# CONFIG_LOCALVERSION_AUTO is not set
+CONFIG_SWAP=y
+CONFIG_SYSVIPC=y
+CONFIG_AUDIT=y
+# CONFIG_IKCONFIG is not set
+CONFIG_INITRAMFS_SOURCE=""
+CONFIG_UID16=y
+CONFIG_CC_OPTIMIZE_FOR_SIZE=y
+CONFIG_HOTPLUG=y
+CONFIG_BASE_FULL=y
+CONFIG_CC_ALIGN_FUNCTIONS=0
+CONFIG_CC_ALIGN_LABELS=0
+CONFIG_CC_ALIGN_LOOPS=0
+CONFIG_CC_ALIGN_JUMPS=0
+CONFIG_BASE_SMALL=0
+CONFIG_OBSOLETE_INTERMODULE=y
+
+#
+# Loadable module support
+#
+CONFIG_MODULES=y
+CONFIG_OBSOLETE_MODPARM=y
+CONFIG_KMOD=y
+
+#
+# Block layer
+#
+
+#
+# System Type
+#
+# CONFIG_ARCH_AAEC2000 is not set
+# CONFIG_ARCH_INTEGRATOR is not set
+# CONFIG_ARCH_REALVIEW is not set
+# CONFIG_ARCH_VERSATILE is not set
+# CONFIG_ARCH_AT91 is not set
+# CONFIG_ARCH_CLPS7500 is not set
+# CONFIG_ARCH_CLPS711X is not set
+# CONFIG_ARCH_CO285 is not set
+# CONFIG_ARCH_EBSA110 is not set
+# CONFIG_ARCH_EP93XX is not set
+# CONFIG_ARCH_FOOTBRIDGE is not set
+# CONFIG_ARCH_NETX is not set
+# CONFIG_ARCH_H720X is not set
+# CONFIG_ARCH_IMX is not set
+# CONFIG_ARCH_IOP32X is not set
+# CONFIG_ARCH_IOP33X is not set
+CONFIG_ARCH_IXP4XX=y
+# CONFIG_ARCH_IXP2000 is not set
+# CONFIG_ARCH_IXP23XX is not set
+# CONFIG_ARCH_L7200 is not set
+# CONFIG_ARCH_PNX4008 is not set
+# CONFIG_ARCH_PXA is not set
+# CONFIG_ARCH_RPC is not set
+# CONFIG_ARCH_SA1100 is not set
+# CONFIG_ARCH_S3C2410 is not set
+# CONFIG_ARCH_SHARK is not set
+# CONFIG_ARCH_LH7A40X is not set
+# CONFIG_ARCH_OMAP is not set
+
+CONFIG_ARCH_SUPPORTS_BIG_ENDIAN=y
+
+#
+# Intel IXP4xx Implementation Options
+#
+
+#
+# IXP4xx Platforms
+#
+CONFIG_MACH_NSLU2=y
+CONFIG_ARCH_AVILA=y
+CONFIG_ARCH_ADI_COYOTE=y
+CONFIG_ARCH_IXDP425=y
+CONFIG_MACH_IXDPG425=y
+CONFIG_MACH_IXDP465=y
+CONFIG_ARCH_PRPMC1100=y
+CONFIG_MACH_NAS100D=y
+# CONFIG_MACH_GTWX5715 is not set
+
+#
+# IXP4xx Options
+#
+CONFIG_DMABOUNCE=y
+# CONFIG_IXP4XX_INDIRECT_PCI is not set
+
+#
+# Processor Type
+#
+CONFIG_CPU_32=y
+CONFIG_CPU_XSCALE=y
+CONFIG_CPU_32v5=y
+CONFIG_CPU_ABRT_EV5T=y
+CONFIG_CPU_CACHE_VIVT=y
+CONFIG_CPU_TLB_V4WBI=y
+
+#
+# Processor Features
+#
+# CONFIG_ARM_THUMB is not set
+# CONFIG_CPU_BIG_ENDIAN is not set
+CONFIG_XSCALE_PMU=y
+
+#
+# Bus support
+#
+CONFIG_PCI=y
+
+#
+# PCCARD (PCMCIA/CardBus) support
+#
+# CONFIG_PCCARD is not set
+
+#
+# Kernel Features
+#
+# CONFIG_PREEMPT is not set
+# CONFIG_NO_IDLE_HZ is not set
+# CONFIG_ARCH_DISCONTIGMEM_ENABLE is not set
+CONFIG_SELECT_MEMORY_MODEL=y
+CONFIG_FLATMEM_MANUAL=y
+# CONFIG_DISCONTIGMEM_MANUAL is not set
+# CONFIG_SPARSEMEM_MANUAL is not set
+CONFIG_FLATMEM=y
+CONFIG_FLAT_NODE_MEM_MAP=y
+# CONFIG_SPARSEMEM_STATIC is not set
+CONFIG_SPLIT_PTLOCK_CPUS=4096
+CONFIG_ALIGNMENT_TRAP=y
+
+#
+# Boot options
+#
+CONFIG_ZBOOT_ROM_TEXT=0x0
+CONFIG_ZBOOT_ROM_BSS=0x0
+CONFIG_CMDLINE="console=ttyS0,115200"
+# CONFIG_XIP_KERNEL is not set
+
+#
+# Floating point emulation
+#
+
+#
+# At least one emulation must be selected
+#
+CONFIG_FPE_NWFPE=y
+# CONFIG_FPE_NWFPE_XP is not set
+# CONFIG_FPE_FASTFPE is not set
+
+#
+# Userspace binary formats
+#
+CONFIG_BINFMT_ELF=y
+CONFIG_BINFMT_AOUT=m
+CONFIG_BINFMT_MISC=m
+# CONFIG_ARTHUR is not set
+
+#
+# Power management options
+#
+# CONFIG_PM is not set
+# CONFIG_APM is not set
+
+#
+# Networking
+#
+CONFIG_NET=y
+
+#
+# Networking options
+#
+CONFIG_PACKET=y
+CONFIG_PACKET_MMAP=y
+CONFIG_UNIX=y
+CONFIG_XFRM=y
+CONFIG_XFRM_USER=m
+CONFIG_NET_KEY=m
+CONFIG_INET=y
+CONFIG_IP_MULTICAST=y
+# CONFIG_IP_ADVANCED_ROUTER is not set
+CONFIG_IP_FIB_HASH=y
+# CONFIG_IP_PNP is not set
+CONFIG_NET_IPIP=m
+CONFIG_NET_IPGRE=m
+CONFIG_NET_IPGRE_BROADCAST=y
+CONFIG_IP_MROUTE=y
+CONFIG_IP_PIMSM_V1=y
+CONFIG_IP_PIMSM_V2=y
+# CONFIG_ARPD is not set
+CONFIG_SYN_COOKIES=y
+CONFIG_INET_AH=m
+CONFIG_INET_ESP=m
+CONFIG_INET_IPCOMP=m
+CONFIG_INET_TUNNEL=m
+CONFIG_INET_DIAG=m
+CONFIG_INET_TCP_DIAG=m
+CONFIG_TCP_CONG_ADVANCED=y
+
+#
+# TCP congestion control
+#
+CONFIG_TCP_CONG_BIC=y
+CONFIG_TCP_CONG_CUBIC=m
+CONFIG_TCP_CONG_WESTWOOD=m
+CONFIG_TCP_CONG_HTCP=m
+CONFIG_TCP_CONG_HSTCP=m
+CONFIG_TCP_CONG_HYBLA=m
+CONFIG_TCP_CONG_VEGAS=m
+CONFIG_TCP_CONG_SCALABLE=m
+
+#
+# IP: Virtual Server Configuration
+#
+CONFIG_IP_VS=m
+# CONFIG_IP_VS_DEBUG is not set
+CONFIG_IP_VS_TAB_BITS=12
+
+#
+# IPVS transport protocol load balancing support
+#
+CONFIG_IP_VS_PROTO_TCP=y
+CONFIG_IP_VS_PROTO_UDP=y
+CONFIG_IP_VS_PROTO_ESP=y
+CONFIG_IP_VS_PROTO_AH=y
+
+#
+# IPVS scheduler
+#
+CONFIG_IP_VS_RR=m
+CONFIG_IP_VS_WRR=m
+CONFIG_IP_VS_LC=m
+CONFIG_IP_VS_WLC=m
+CONFIG_IP_VS_LBLC=m
+CONFIG_IP_VS_LBLCR=m
+CONFIG_IP_VS_DH=m
+CONFIG_IP_VS_SH=m
+CONFIG_IP_VS_SED=m
+CONFIG_IP_VS_NQ=m
+
+#
+# IPVS application helper
+#
+CONFIG_IP_VS_FTP=m
+CONFIG_IPV6=m
+CONFIG_IPV6_PRIVACY=y
+CONFIG_INET6_AH=m
+CONFIG_INET6_ESP=m
+CONFIG_INET6_IPCOMP=m
+CONFIG_INET6_TUNNEL=m
+CONFIG_IPV6_TUNNEL=m
+CONFIG_NETFILTER=y
+# CONFIG_NETFILTER_DEBUG is not set
+CONFIG_BRIDGE_NETFILTER=y
+
+#
+# Core Netfilter Configuration
+#
+CONFIG_NETFILTER_NETLINK=m
+CONFIG_NETFILTER_NETLINK_QUEUE=m
+CONFIG_NETFILTER_NETLINK_LOG=m
+CONFIG_NETFILTER_XTABLES=m
+CONFIG_NETFILTER_XT_TARGET_CLASSIFY=m
+CONFIG_NETFILTER_XT_TARGET_CONNMARK=m
+CONFIG_NETFILTER_XT_TARGET_MARK=m
+CONFIG_NETFILTER_XT_TARGET_NFQUEUE=m
+CONFIG_NETFILTER_XT_TARGET_NOTRACK=m
+CONFIG_NETFILTER_XT_MATCH_COMMENT=m
+CONFIG_NETFILTER_XT_MATCH_CONNBYTES=m
+CONFIG_NETFILTER_XT_MATCH_CONNMARK=m
+CONFIG_NETFILTER_XT_MATCH_CONNTRACK=m
+CONFIG_NETFILTER_XT_MATCH_DCCP=m
+CONFIG_NETFILTER_XT_MATCH_HELPER=m
+CONFIG_NETFILTER_XT_MATCH_LENGTH=m
+CONFIG_NETFILTER_XT_MATCH_LIMIT=m
+CONFIG_NETFILTER_XT_MATCH_MAC=m
+CONFIG_NETFILTER_XT_MATCH_MARK=m
+CONFIG_NETFILTER_XT_MATCH_PHYSDEV=m
+CONFIG_NETFILTER_XT_MATCH_PKTTYPE=m
+CONFIG_NETFILTER_XT_MATCH_REALM=m
+CONFIG_NETFILTER_XT_MATCH_SCTP=m
+CONFIG_NETFILTER_XT_MATCH_STATE=m
+CONFIG_NETFILTER_XT_MATCH_STRING=m
+CONFIG_NETFILTER_XT_MATCH_TCPMSS=m
+
+#
+# IP: Netfilter Configuration
+#
+CONFIG_IP_NF_QUEUE=m
+CONFIG_IP_NF_IPTABLES=m
+CONFIG_IP_NF_MATCH_IPRANGE=m
+CONFIG_IP_NF_MATCH_MULTIPORT=m
+CONFIG_IP_NF_MATCH_TOS=m
+CONFIG_IP_NF_MATCH_RECENT=m
+CONFIG_IP_NF_MATCH_ECN=m
+CONFIG_IP_NF_MATCH_DSCP=m
+CONFIG_IP_NF_MATCH_AH_ESP=m
+CONFIG_IP_NF_MATCH_TTL=m
+CONFIG_IP_NF_MATCH_OWNER=m
+CONFIG_IP_NF_MATCH_ADDRTYPE=m
+CONFIG_IP_NF_MATCH_HASHLIMIT=m
+CONFIG_IP_NF_MATCH_POLICY=m
+CONFIG_IP_NF_FILTER=m
+CONFIG_IP_NF_TARGET_REJECT=m
+CONFIG_IP_NF_TARGET_LOG=m
+CONFIG_IP_NF_TARGET_ULOG=m
+CONFIG_IP_NF_TARGET_TCPMSS=m
+CONFIG_IP_NF_TARGET_MASQUERADE=m
+CONFIG_IP_NF_TARGET_REDIRECT=m
+CONFIG_IP_NF_TARGET_NETMAP=m
+CONFIG_IP_NF_TARGET_SAME=m
+CONFIG_IP_NF_MANGLE=m
+CONFIG_IP_NF_TARGET_TOS=m
+CONFIG_IP_NF_TARGET_ECN=m
+CONFIG_IP_NF_TARGET_DSCP=m
+CONFIG_IP_NF_TARGET_TTL=m
+CONFIG_IP_NF_TARGET_CLUSTERIP=m
+CONFIG_IP_NF_RAW=m
+CONFIG_IP_NF_ARPTABLES=m
+CONFIG_IP_NF_ARPFILTER=m
+CONFIG_IP_NF_ARP_MANGLE=m
+
+#
+# IPv6: Netfilter Configuration (EXPERIMENTAL)
+#
+CONFIG_IP6_NF_QUEUE=m
+CONFIG_IP6_NF_IPTABLES=m
+CONFIG_IP6_NF_MATCH_RT=m
+CONFIG_IP6_NF_MATCH_OPTS=m
+CONFIG_IP6_NF_MATCH_FRAG=m
+CONFIG_IP6_NF_MATCH_HL=m
+CONFIG_IP6_NF_MATCH_MULTIPORT=m
+CONFIG_IP6_NF_MATCH_OWNER=m
+CONFIG_IP6_NF_MATCH_IPV6HEADER=m
+CONFIG_IP6_NF_MATCH_AHESP=m
+CONFIG_IP6_NF_MATCH_EUI64=m
+CONFIG_IP6_NF_MATCH_POLICY=m
+CONFIG_IP6_NF_FILTER=m
+CONFIG_IP6_NF_TARGET_LOG=m
+CONFIG_IP6_NF_TARGET_REJECT=m
+CONFIG_IP6_NF_MANGLE=m
+CONFIG_IP6_NF_TARGET_HL=m
+CONFIG_IP6_NF_RAW=m
+
+#
+# DECnet: Netfilter Configuration
+#
+# CONFIG_DECNET_NF_GRABULATOR is not set
+
+#
+# Bridge: Netfilter Configuration
+#
+# CONFIG_BRIDGE_NF_EBTABLES is not set
+
+#
+# DCCP Configuration (EXPERIMENTAL)
+#
+CONFIG_IP_DCCP=m
+CONFIG_INET_DCCP_DIAG=m
+
+#
+# DCCP CCIDs Configuration (EXPERIMENTAL)
+#
+CONFIG_IP_DCCP_CCID3=m
+CONFIG_IP_DCCP_TFRC_LIB=m
+
+#
+# SCTP Configuration (EXPERIMENTAL)
+#
+# CONFIG_IP_SCTP is not set
+
+#
+# TIPC Configuration (EXPERIMENTAL)
+#
+CONFIG_TIPC=m
+CONFIG_TIPC_ADVANCED=y
+CONFIG_TIPC_ZONES=3
+CONFIG_TIPC_CLUSTERS=1
+CONFIG_TIPC_NODES=255
+CONFIG_TIPC_SLAVE_NODES=0
+CONFIG_TIPC_PORTS=8191
+CONFIG_TIPC_LOG=0
+# CONFIG_TIPC_DEBUG is not set
+CONFIG_ATM=m
+CONFIG_ATM_CLIP=m
+# CONFIG_ATM_CLIP_NO_ICMP is not set
+CONFIG_ATM_LANE=m
+CONFIG_ATM_MPOA=m
+CONFIG_ATM_BR2684=m
+# CONFIG_ATM_BR2684_IPFILTER is not set
+CONFIG_BRIDGE=m
+CONFIG_VLAN_8021Q=m
+CONFIG_DECNET=m
+CONFIG_DECNET_ROUTER=y
+CONFIG_LLC=y
+CONFIG_LLC2=y
+CONFIG_IPX=m
+CONFIG_IPX_INTERN=y
+CONFIG_ATALK=m
+CONFIG_IPDDP=m
+CONFIG_IPDDP_ENCAP=y
+CONFIG_IPDDP_DECAP=y
+CONFIG_X25=m
+CONFIG_LAPB=m
+# CONFIG_NET_DIVERT is not set
+# CONFIG_ECONET is not set
+CONFIG_WAN_ROUTER=m
+
+#
+# Network testing
+#
+# CONFIG_HAMRADIO is not set
+# CONFIG_IRDA is not set
+CONFIG_BT=m
+CONFIG_BT_L2CAP=m
+CONFIG_BT_SCO=m
+CONFIG_BT_RFCOMM=m
+CONFIG_BT_RFCOMM_TTY=y
+CONFIG_BT_BNEP=m
+CONFIG_BT_BNEP_MC_FILTER=y
+CONFIG_BT_BNEP_PROTO_FILTER=y
+CONFIG_BT_HIDP=m
+
+#
+# Bluetooth device drivers
+#
+CONFIG_BT_HCIUSB=m
+CONFIG_BT_HCIUSB_SCO=y
+# CONFIG_BT_HCIUART is not set
+CONFIG_BT_HCIBCM203X=m
+CONFIG_BT_HCIBPA10X=m
+CONFIG_BT_HCIBFUSB=m
+CONFIG_BT_HCIVHCI=m
+CONFIG_IEEE80211=m
+# CONFIG_IEEE80211_DEBUG is not set
+CONFIG_IEEE80211_CRYPT_WEP=m
+CONFIG_IEEE80211_CRYPT_CCMP=m
+# CONFIG_IEEE80211_CRYPT_TKIP is not set
+
+#
+# Device Drivers
+#
+
+#
+# Generic Driver Options
+#
+CONFIG_STANDALONE=y
+CONFIG_PREVENT_FIRMWARE_BUILD=y
+CONFIG_FW_LOADER=m
+
+#
+# Connector - unified userspace <-> kernelspace linker
+#
+CONFIG_CONNECTOR=m
+
+#
+# Memory Technology Devices (MTD)
+#
+CONFIG_MTD=y
+# CONFIG_MTD_DEBUG is not set
+CONFIG_MTD_CONCAT=y
+CONFIG_MTD_PARTITIONS=y
+CONFIG_MTD_REDBOOT_PARTS=y
+CONFIG_MTD_REDBOOT_DIRECTORY_BLOCK=-1
+# CONFIG_MTD_REDBOOT_PARTS_UNALLOCATED is not set
+# CONFIG_MTD_REDBOOT_PARTS_READONLY is not set
+# CONFIG_MTD_CMDLINE_PARTS is not set
+# CONFIG_MTD_AFS_PARTS is not set
+
+#
+# User Modules And Translation Layers
+#
+CONFIG_MTD_CHAR=y
+CONFIG_MTD_BLOCK=y
+# CONFIG_FTL is not set
+# CONFIG_NFTL is not set
+# CONFIG_INFTL is not set
+CONFIG_RFD_FTL=m
+
+#
+# RAM/ROM/Flash chip drivers
+#
+CONFIG_MTD_CFI=y
+# CONFIG_MTD_JEDECPROBE is not set
+CONFIG_MTD_GEN_PROBE=y
+CONFIG_MTD_CFI_ADV_OPTIONS=y
+# CONFIG_MTD_CFI_NOSWAP is not set
+CONFIG_MTD_CFI_BE_BYTE_SWAP=y
+# CONFIG_MTD_CFI_LE_BYTE_SWAP is not set
+CONFIG_MTD_CFI_GEOMETRY=y
+# CONFIG_MTD_MAP_BANK_WIDTH_1 is not set
+CONFIG_MTD_MAP_BANK_WIDTH_2=y
+# CONFIG_MTD_MAP_BANK_WIDTH_4 is not set
+# CONFIG_MTD_MAP_BANK_WIDTH_8 is not set
+# CONFIG_MTD_MAP_BANK_WIDTH_16 is not set
+# CONFIG_MTD_MAP_BANK_WIDTH_32 is not set
+CONFIG_MTD_CFI_I1=y
+CONFIG_MTD_CFI_I2=y
+# CONFIG_MTD_CFI_I4 is not set
+# CONFIG_MTD_CFI_I8 is not set
+# CONFIG_MTD_OTP is not set
+CONFIG_MTD_CFI_INTELEXT=y
+# CONFIG_MTD_CFI_AMDSTD is not set
+# CONFIG_MTD_CFI_STAA is not set
+CONFIG_MTD_CFI_UTIL=y
+CONFIG_MTD_RAM=m
+# CONFIG_MTD_ROM is not set
+# CONFIG_MTD_ABSENT is not set
+
+#
+# Mapping drivers for chip access
+#
+CONFIG_MTD_COMPLEX_MAPPINGS=y
+# CONFIG_MTD_PHYSMAP is not set
+# CONFIG_MTD_ARM_INTEGRATOR is not set
+CONFIG_MTD_IXP4XX=y
+# CONFIG_MTD_PCI is not set
+CONFIG_MTD_PLATRAM=m
+
+#
+# Self-contained MTD device drivers
+#
+# CONFIG_MTD_PMC551 is not set
+CONFIG_MTD_DATAFLASH=m
+CONFIG_MTD_M25P80=m
+# CONFIG_MTD_SLRAM is not set
+# CONFIG_MTD_PHRAM is not set
+# CONFIG_MTD_MTDRAM is not set
+# CONFIG_MTD_BLKMTD is not set
+# CONFIG_MTD_BLOCK2MTD is not set
+
+#
+# Disk-On-Chip Device Drivers
+#
+# CONFIG_MTD_DOC2000 is not set
+# CONFIG_MTD_DOC2001 is not set
+# CONFIG_MTD_DOC2001PLUS is not set
+
+#
+# NAND Flash Device Drivers
+#
+CONFIG_MTD_NAND=m
+# CONFIG_MTD_NAND_VERIFY_WRITE is not set
+CONFIG_MTD_NAND_IDS=m
+# CONFIG_MTD_NAND_DISKONCHIP is not set
+# CONFIG_MTD_NAND_NANDSIM is not set
+
+#
+# OneNAND Flash Device Drivers
+#
+# CONFIG_MTD_ONENAND is not set
+
+#
+# Parallel port support
+#
+
+#
+# Plug and Play support
+#
+
+#
+# Block devices
+#
+# CONFIG_BLK_CPQ_DA is not set
+# CONFIG_BLK_CPQ_CISS_DA is not set
+# CONFIG_BLK_DEV_DAC960 is not set
+# CONFIG_BLK_DEV_UMEM is not set
+# CONFIG_BLK_DEV_COW_COMMON is not set
+CONFIG_BLK_DEV_LOOP=m
+CONFIG_BLK_DEV_CRYPTOLOOP=m
+CONFIG_BLK_DEV_NBD=m
+# CONFIG_BLK_DEV_SX8 is not set
+# CONFIG_BLK_DEV_UB is not set
+CONFIG_BLK_DEV_RAM=y
+CONFIG_BLK_DEV_RAM_COUNT=16
+CONFIG_BLK_DEV_RAM_SIZE=8192
+CONFIG_BLK_DEV_INITRD=y
+# CONFIG_CDROM_PKTCDVD is not set
+# CONFIG_ATA_OVER_ETH is not set
+
+#
+# ATA/ATAPI/MFM/RLL support
+#
+# CONFIG_IDE is not set
+
+#
+# SCSI device support
+#
+CONFIG_RAID_ATTRS=m
+CONFIG_SCSI=m
+CONFIG_SCSI_PROC_FS=y
+
+#
+# SCSI support type (disk, tape, CD-ROM)
+#
+CONFIG_BLK_DEV_SD=m
+CONFIG_CHR_DEV_ST=m
+CONFIG_CHR_DEV_OSST=m
+CONFIG_BLK_DEV_SR=m
+CONFIG_BLK_DEV_SR_VENDOR=y
+CONFIG_CHR_DEV_SG=m
+CONFIG_CHR_DEV_SCH=m
+
+#
+# Some SCSI devices (e.g. CD jukebox) support multiple LUNs
+#
+CONFIG_SCSI_MULTI_LUN=y
+# CONFIG_SCSI_CONSTANTS is not set
+# CONFIG_SCSI_LOGGING is not set
+
+#
+# SCSI Transport Attributes
+#
+CONFIG_SCSI_SPI_ATTRS=m
+CONFIG_SCSI_FC_ATTRS=m
+CONFIG_SCSI_ISCSI_ATTRS=m
+CONFIG_SCSI_SAS_ATTRS=m
+
+#
+# SATA/PATA driver configuration
+#
+CONFIG_PATA_ARTOP=m
+
+#
+# IEEE 1394 (FireWire) support
+#
+# CONFIG_FIREWIRE is not set
+
+#
+# I2O device support
+#
+# CONFIG_I2O is not set
+
+#
+# Network device support
+#
+CONFIG_NETDEVICES=y
+# CONFIG_DUMMY is not set
+CONFIG_BONDING=m
+CONFIG_EQUALIZER=m
+CONFIG_TUN=m
+
+#
+# ARCnet devices
+#
+# CONFIG_ARCNET is not set
+
+#
+# PHY device support
+#
+CONFIG_PHYLIB=m
+
+#
+# MII PHY device drivers
+#
+CONFIG_MARVELL_PHY=m
+CONFIG_DAVICOM_PHY=m
+CONFIG_QSEMI_PHY=m
+CONFIG_LXT_PHY=m
+CONFIG_CICADA_PHY=m
+
+#
+# Ethernet (10 or 100Mbit)
+#
+CONFIG_NET_ETHERNET=y
+CONFIG_MII=y
+CONFIG_IXP4XX_QMGR=m
+CONFIG_IXP4XX_NPE=m
+CONFIG_IXP4XX_FW_LOAD=y
+CONFIG_IXP4XX_MAC=m
+CONFIG_IXP4XX_CRYPTO=m
+# CONFIG_HAPPYMEAL is not set
+# CONFIG_SUNGEM is not set
+# CONFIG_CASSINI is not set
+# CONFIG_NET_VENDOR_3COM is not set
+# CONFIG_SMC91X is not set
+# CONFIG_DM9000 is not set
+
+#
+# Tulip family network device support
+#
+# CONFIG_NET_TULIP is not set
+# CONFIG_HP100 is not set
+# CONFIG_NET_PCI is not set
+
+#
+# Ethernet (1000 Mbit)
+#
+# CONFIG_DL2K is not set
+# CONFIG_E1000 is not set
+# CONFIG_NS83820 is not set
+# CONFIG_HAMACHI is not set
+# CONFIG_YELLOWFIN is not set
+# CONFIG_R8169 is not set
+# CONFIG_SIS190 is not set
+# CONFIG_SKGE is not set
+# CONFIG_SKY2 is not set
+# CONFIG_TIGON3 is not set
+# CONFIG_BNX2 is not set
+
+#
+# Ethernet (10000 Mbit)
+#
+# CONFIG_CHELSIO_T1 is not set
+# CONFIG_IXGB is not set
+# CONFIG_S2IO is not set
+
+#
+# Token Ring devices
+#
+# CONFIG_TR is not set
+
+#
+# Wireless LAN (non-hamradio)
+#
+CONFIG_WLAN_PRE80211=y
+CONFIG_STRIP=m
+CONFIG_WLAN_80211=y
+
+#
+# Wireless 802.11b ISA/PCI cards support
+#
+CONFIG_IPW2100=m
+# CONFIG_IPW2100_MONITOR is not set
+# CONFIG_IPW2100_DEBUG is not set
+CONFIG_IPW2200=m
+# CONFIG_IPW2200_DEBUG is not set
+CONFIG_HERMES=m
+CONFIG_PLX_HERMES=m
+CONFIG_TMD_HERMES=m
+CONFIG_NORTEL_HERMES=m
+CONFIG_PCI_HERMES=m
+CONFIG_ATMEL=m
+# CONFIG_PCI_ATMEL is not set
+
+#
+# Prism GT/Duette 802.11(a/b/g) PCI/Cardbus support
+#
+# CONFIG_PRISM54 is not set
+CONFIG_HOSTAP=m
+# CONFIG_HOSTAP_FIRMWARE is not set
+CONFIG_HOSTAP_PLX=m
+# CONFIG_HOSTAP_PCI is not set
+# CONFIG_BCM43XX is not set
+
+#
+# Wan interfaces
+#
+# CONFIG_WAN is not set
+# CONFIG_FDDI is not set
+# CONFIG_HIPPI is not set
+CONFIG_PPP=m
+CONFIG_PPP_MULTILINK=y
+CONFIG_PPP_FILTER=y
+CONFIG_PPP_ASYNC=m
+CONFIG_PPP_SYNC_TTY=m
+CONFIG_PPP_DEFLATE=m
+CONFIG_PPP_BSDCOMP=m
+CONFIG_PPP_MPPE=m
+CONFIG_PPPOE=m
+CONFIG_PPPOATM=m
+CONFIG_SLIP=m
+CONFIG_SLIP_COMPRESSED=y
+CONFIG_SLIP_SMART=y
+CONFIG_SLIP_MODE_SLIP6=y
+# CONFIG_NET_FC is not set
+# CONFIG_SHAPER is not set
+CONFIG_NETCONSOLE=m
+CONFIG_NETPOLL=y
+# CONFIG_NETPOLL_TRAP is not set
+CONFIG_NET_POLL_CONTROLLER=y
+
+#
+# ISDN subsystem
+#
+# CONFIG_ISDN is not set
+
+#
+# Input device support
+#
+CONFIG_INPUT=y
+
+#
+# Userland interfaces
+#
+CONFIG_INPUT_MOUSEDEV=y
+CONFIG_INPUT_MOUSEDEV_PSAUX=y
+CONFIG_INPUT_MOUSEDEV_SCREEN_X=1024
+CONFIG_INPUT_MOUSEDEV_SCREEN_Y=768
+# CONFIG_INPUT_JOYDEV is not set
+# CONFIG_INPUT_TSDEV is not set
+CONFIG_INPUT_EVDEV=m
+
+#
+# Input Device Drivers
+#
+CONFIG_INPUT_KEYBOARD=y
+CONFIG_KEYBOARD_ATKBD=y
+# CONFIG_KEYBOARD_SUNKBD is not set
+# CONFIG_KEYBOARD_LKKBD is not set
+# CONFIG_KEYBOARD_XTKBD is not set
+# CONFIG_KEYBOARD_NEWTON is not set
+CONFIG_INPUT_MOUSE=y
+CONFIG_MOUSE_PS2=y
+# CONFIG_MOUSE_SERIAL is not set
+CONFIG_MOUSE_APPLETOUCH=m
+# CONFIG_MOUSE_VSXXXAA is not set
+# CONFIG_INPUT_JOYSTICK is not set
+CONFIG_INPUT_TABLET=y
+CONFIG_TABLET_USB_ACECAD=m
+CONFIG_TABLET_USB_AIPTEK=m
+CONFIG_TABLET_USB_GTCO=m
+CONFIG_TABLET_USB_KBTAB=m
+CONFIG_TABLET_USB_WACOM=m
+# CONFIG_INPUT_TOUCHSCREEN is not set
+CONFIG_INPUT_MISC=y
+CONFIG_INPUT_IXP4XX_BEEPER=m
+CONFIG_INPUT_UINPUT=m
+
+#
+# Hardware I/O ports
+#
+CONFIG_SERIO=y
+CONFIG_SERIO_SERPORT=y
+# CONFIG_SERIO_PCIPS2 is not set
+CONFIG_SERIO_LIBPS2=y
+# CONFIG_SERIO_RAW is not set
+# CONFIG_GAMEPORT is not set
+
+#
+# Character devices
+#
+CONFIG_VT=y
+CONFIG_VT_CONSOLE=y
+CONFIG_HW_CONSOLE=y
+# CONFIG_SERIAL_NONSTANDARD is not set
+
+#
+# Serial drivers
+#
+CONFIG_SERIAL_8250=y
+CONFIG_SERIAL_8250_CONSOLE=y
+CONFIG_SERIAL_8250_NR_UARTS=2
+CONFIG_SERIAL_8250_RUNTIME_UARTS=2
+# CONFIG_SERIAL_8250_EXTENDED is not set
+
+#
+# Non-8250 serial port support
+#
+CONFIG_SERIAL_CORE=y
+CONFIG_SERIAL_CORE_CONSOLE=y
+# CONFIG_SERIAL_JSM is not set
+
+#
+# IPMI
+#
+# CONFIG_IPMI_HANDLER is not set
+
+#
+# Watchdog Cards
+#
+CONFIG_WATCHDOG=y
+# CONFIG_WATCHDOG_NOWAYOUT is not set
+
+#
+# Watchdog Device Drivers
+#
+# CONFIG_SOFT_WATCHDOG is not set
+CONFIG_IXP4XX_WATCHDOG=y
+
+#
+# PCI-based Watchdog Cards
+#
+# CONFIG_PCIPCWATCHDOG is not set
+# CONFIG_WDTPCI is not set
+
+#
+# USB-based Watchdog Cards
+#
+# CONFIG_USBPCWATCHDOG is not set
+# CONFIG_NVRAM is not set
+# CONFIG_DTLK is not set
+# CONFIG_R3964 is not set
+# CONFIG_APPLICOM is not set
+
+#
+# Ftape, the floppy tape device driver
+#
+# CONFIG_DRM is not set
+# CONFIG_RAW_DRIVER is not set
+
+#
+# TPM devices
+#
+# CONFIG_TCG_TPM is not set
+CONFIG_TELCLOCK=m
+
+#
+# I2C support
+#
+CONFIG_I2C=y
+CONFIG_I2C_CHARDEV=y
+
+#
+# I2C Algorithms
+#
+CONFIG_I2C_ALGOBIT=y
+# CONFIG_I2C_ALGOPCF is not set
+# CONFIG_I2C_ALGOPCA is not set
+
+#
+# I2C Hardware Bus support
+#
+# CONFIG_I2C_ALI1535 is not set
+# CONFIG_I2C_ALI1563 is not set
+# CONFIG_I2C_ALI15X3 is not set
+# CONFIG_I2C_AMD756 is not set
+# CONFIG_I2C_AMD8111 is not set
+CONFIG_I2C_GPIO=y
+# CONFIG_I2C_I801 is not set
+# CONFIG_I2C_I810 is not set
+# CONFIG_I2C_PIIX4 is not set
+# CONFIG_I2C_IOP3XX is not set
+# CONFIG_I2C_IXP4XX is not set
+# CONFIG_I2C_NFORCE2 is not set
+# CONFIG_I2C_PARPORT_LIGHT is not set
+# CONFIG_I2C_PROSAVAGE is not set
+# CONFIG_I2C_SAVAGE4 is not set
+# CONFIG_SCx200_ACB is not set
+# CONFIG_I2C_SIS5595 is not set
+# CONFIG_I2C_SIS630 is not set
+# CONFIG_I2C_SIS96X is not set
+# CONFIG_I2C_STUB is not set
+# CONFIG_I2C_VIA is not set
+# CONFIG_I2C_VIAPRO is not set
+# CONFIG_I2C_VOODOO3 is not set
+# CONFIG_I2C_PCA_ISA is not set
+
+#
+# Miscellaneous I2C Chip support
+#
+CONFIG_SENSORS_DS1337=m
+CONFIG_SENSORS_DS1374=m
+CONFIG_SENSORS_EEPROM=y
+CONFIG_SENSORS_PCF8574=m
+CONFIG_SENSORS_PCA9539=m
+CONFIG_SENSORS_PCF8591=m
+CONFIG_SENSORS_MAX6875=m
+# CONFIG_I2C_DEBUG_CORE is not set
+# CONFIG_I2C_DEBUG_ALGO is not set
+# CONFIG_I2C_DEBUG_BUS is not set
+# CONFIG_I2C_DEBUG_CHIP is not set
+
+#
+# SPI support
+#
+CONFIG_SPI=y
+CONFIG_SPI_MASTER=y
+
+#
+# SPI Master Controller Drivers
+#
+CONFIG_SPI_BITBANG=m
+
+#
+# SPI Protocol Masters
+#
+
+#
+# Hardware Monitoring support
+#
+CONFIG_HWMON=y
+CONFIG_HWMON_VID=m
+CONFIG_SENSORS_ADM1021=m
+CONFIG_SENSORS_ADM1025=m
+CONFIG_SENSORS_ADM1026=m
+CONFIG_SENSORS_ADM1031=m
+CONFIG_SENSORS_ADM9240=m
+# CONFIG_SENSORS_ASB100 is not set
+CONFIG_SENSORS_ATXP1=m
+CONFIG_SENSORS_DS1621=m
+# CONFIG_SENSORS_F71805F is not set
+# CONFIG_SENSORS_FSCHER is not set
+# CONFIG_SENSORS_FSCPOS is not set
+# CONFIG_SENSORS_GL518SM is not set
+# CONFIG_SENSORS_GL520SM is not set
+# CONFIG_SENSORS_IT87 is not set
+CONFIG_SENSORS_LM63=m
+CONFIG_SENSORS_LM75=m
+CONFIG_SENSORS_LM77=m
+CONFIG_SENSORS_LM78=m
+CONFIG_SENSORS_LM80=m
+CONFIG_SENSORS_LM83=m
+CONFIG_SENSORS_LM85=m
+CONFIG_SENSORS_LM87=m
+CONFIG_SENSORS_LM90=m
+CONFIG_SENSORS_LM92=m
+CONFIG_SENSORS_MAX1619=m
+# CONFIG_SENSORS_PC87360 is not set
+# CONFIG_SENSORS_SIS5595 is not set
+# CONFIG_SENSORS_SMSC47M1 is not set
+# CONFIG_SENSORS_SMSC47B397 is not set
+# CONFIG_SENSORS_VIA686A is not set
+CONFIG_SENSORS_VT8231=m
+# CONFIG_SENSORS_W83781D is not set
+CONFIG_SENSORS_W83792D=m
+# CONFIG_SENSORS_W83L785TS is not set
+# CONFIG_SENSORS_W83627HF is not set
+CONFIG_SENSORS_W83627EHF=m
+# CONFIG_HWMON_DEBUG_CHIP is not set
+
+#
+# Misc devices
+#
+
+#
+# LED devices
+#
+CONFIG_NEW_LEDS=y
+CONFIG_LEDS_CLASS=y
+
+#
+# LED drivers
+#
+CONFIG_LEDS_IXP4XX=y
+
+#
+# LED Triggers
+#
+CONFIG_LEDS_TRIGGERS=y
+CONFIG_LEDS_TRIGGER_TIMER=y
+
+#
+# Radio Adapters
+#
+# CONFIG_RADIO_GEMTEK_PCI is not set
+# CONFIG_RADIO_MAXIRADIO is not set
+# CONFIG_RADIO_MAESTRO is not set
+# CONFIG_USB_DSBR is not set
+
+#
+# Digital Video Broadcasting Devices
+#
+CONFIG_DVB_CORE=m
+
+#
+# Supported DVB Frontends
+#
+
+#
+# Customise DVB Frontends
+#
+
+CONFIG_VIDEO_SAA7146=m
+CONFIG_VIDEO_SAA7146_VV=m
+CONFIG_VIDEO_TUNER=m
+CONFIG_VIDEO_BUF=m
+CONFIG_VIDEO_BTCX=m
+CONFIG_VIDEO_IR=m
+CONFIG_VIDEO_TVEEPROM=m
+
+#
+# Graphics support
+#
+# CONFIG_FB is not set
+
+#
+# Console display driver support
+#
+# CONFIG_VGA_CONSOLE is not set
+# CONFIG_VGACON_SOFT_SCROLLBACK is not set
+CONFIG_DUMMY_CONSOLE=y
+
+#
+# Sound
+#
+CONFIG_SOUND=m
+
+#
+# Advanced Linux Sound Architecture
+#
+CONFIG_SND=m
+CONFIG_SND_TIMER=m
+CONFIG_SND_PCM=m
+CONFIG_SND_HWDEP=m
+CONFIG_SND_RAWMIDI=m
+CONFIG_SND_SEQUENCER=m
+CONFIG_SND_SEQ_DUMMY=m
+CONFIG_SND_OSSEMUL=y
+CONFIG_SND_MIXER_OSS=m
+CONFIG_SND_PCM_OSS=m
+# CONFIG_SND_SEQUENCER_OSS is not set
+# CONFIG_SND_DYNAMIC_MINORS is not set
+CONFIG_SND_SUPPORT_OLD_API=y
+# CONFIG_SND_VERBOSE_PRINTK is not set
+# CONFIG_SND_DEBUG is not set
+
+#
+# Generic devices
+#
+CONFIG_SND_MPU401_UART=m
+CONFIG_SND_DUMMY=m
+# CONFIG_SND_VIRMIDI is not set
+CONFIG_SND_MTPAV=m
+CONFIG_SND_SERIAL_U16550=m
+CONFIG_SND_MPU401=m
+
+#
+# PCI devices
+#
+# CONFIG_SND_AD1889 is not set
+# CONFIG_SND_ALI5451 is not set
+# CONFIG_SND_ATIIXP is not set
+# CONFIG_SND_ATIIXP_MODEM is not set
+# CONFIG_SND_AU8810 is not set
+# CONFIG_SND_AU8820 is not set
+# CONFIG_SND_AU8830 is not set
+# CONFIG_SND_AZT3328 is not set
+# CONFIG_SND_BT87X is not set
+# CONFIG_SND_CA0106 is not set
+# CONFIG_SND_CMIPCI is not set
+# CONFIG_SND_CS4281 is not set
+# CONFIG_SND_CS46XX is not set
+# CONFIG_SND_EMU10K1 is not set
+# CONFIG_SND_EMU10K1X is not set
+# CONFIG_SND_ENS1370 is not set
+# CONFIG_SND_ENS1371 is not set
+# CONFIG_SND_ES1938 is not set
+# CONFIG_SND_ES1968 is not set
+# CONFIG_SND_FM801 is not set
+# CONFIG_SND_HDA_INTEL is not set
+# CONFIG_SND_HDSP is not set
+# CONFIG_SND_HDSPM is not set
+# CONFIG_SND_ICE1712 is not set
+# CONFIG_SND_ICE1724 is not set
+# CONFIG_SND_INTEL8X0 is not set
+# CONFIG_SND_INTEL8X0M is not set
+# CONFIG_SND_KORG1212 is not set
+# CONFIG_SND_MAESTRO3 is not set
+# CONFIG_SND_MIXART is not set
+# CONFIG_SND_NM256 is not set
+CONFIG_SND_PCXHR=m
+# CONFIG_SND_RME32 is not set
+# CONFIG_SND_RME96 is not set
+# CONFIG_SND_RME9652 is not set
+# CONFIG_SND_SONICVIBES is not set
+# CONFIG_SND_TRIDENT is not set
+# CONFIG_SND_VIA82XX is not set
+# CONFIG_SND_VIA82XX_MODEM is not set
+# CONFIG_SND_VX222 is not set
+# CONFIG_SND_YMFPCI is not set
+
+#
+# ALSA ARM devices
+#
+
+#
+# USB devices
+#
+CONFIG_SND_USB_AUDIO=m
+
+#
+# Open Sound System
+#
+# CONFIG_SOUND_PRIME is not set
+
+#
+# USB support
+#
+CONFIG_USB_ARCH_HAS_HCD=y
+CONFIG_USB_ARCH_HAS_OHCI=y
+CONFIG_USB=m
+# CONFIG_USB_DEBUG is not set
+
+#
+# Miscellaneous USB options
+#
+CONFIG_USB_DEVICEFS=y
+# CONFIG_USB_DYNAMIC_MINORS is not set
+# CONFIG_USB_OTG is not set
+
+#
+# USB Host Controller Drivers
+#
+CONFIG_USB_EHCI_HCD=m
+CONFIG_USB_EHCI_SPLIT_ISO=y
+CONFIG_USB_EHCI_ROOT_HUB_TT=y
+CONFIG_USB_EHCI_TT_NEWSCHED=y
+CONFIG_USB_ISP116X_HCD=m
+CONFIG_USB_OHCI_HCD=m
+CONFIG_USB_OHCI_LITTLE_ENDIAN=y
+CONFIG_USB_UHCI_HCD=m
+CONFIG_USB_SL811_HCD=m
+
+# USB Device Class drivers
+#
+CONFIG_USB_PRINTER=m
+
+#
+# NOTE: USB_STORAGE enables SCSI, and 'SCSI disk support'
+#
+
+CONFIG_USB_STORAGE=m
+# CONFIG_USB_STORAGE_DEBUG is not set
+CONFIG_USB_STORAGE_DATAFAB=y
+CONFIG_USB_STORAGE_FREECOM=y
+CONFIG_USB_STORAGE_DPCM=y
+CONFIG_USB_STORAGE_USBAT=y
+CONFIG_USB_STORAGE_SDDR09=y
+CONFIG_USB_STORAGE_SDDR55=y
+CONFIG_USB_STORAGE_JUMPSHOT=y
+CONFIG_USB_STORAGE_ALAUDA=y
+
+#
+# MMC/SD Card support
+#
+# CONFIG_MMC is not set
+
+#
+# Real Time Clock
+#
+CONFIG_RTC_LIB=y
+CONFIG_RTC_CLASS=y
+CONFIG_RTC_HCTOSYS=y
+CONFIG_RTC_HCTOSYS_DEVICE="rtc0"
+
+#
+# RTC interfaces
+#
+CONFIG_RTC_INTF_SYSFS=y
+CONFIG_RTC_INTF_PROC=y
+CONFIG_RTC_INTF_DEV=y
+
+#
+# RTC drivers
+#
+CONFIG_RTC_DRV_X1205=y
+# CONFIG_RTC_DRV_DS1672 is not set
+CONFIG_RTC_DRV_PCF8563=y
+# CONFIG_RTC_DRV_RS5C372 is not set
+# CONFIG_RTC_DRV_M48T86 is not set
+# CONFIG_RTC_DRV_TEST is not set
+
+#
+# Miscellaneous filesystems
+#
+CONFIG_JFFS2_FS=y
+CONFIG_JFFS2_FS_DEBUG=0
+CONFIG_JFFS2_FS_WRITEBUFFER=y
+# CONFIG_JFFS2_SUMMARY is not set
+# CONFIG_JFFS2_COMPRESSION_OPTIONS is not set
+CONFIG_JFFS2_ZLIB=y
+CONFIG_JFFS2_RTIME=y
+# CONFIG_JFFS2_RUBIN is not set
+
+CONFIG_CRAMFS=y
+
+#
+# Profiling support
+#
+# CONFIG_PROFILING is not set
+
+#
+# Kernel hacking
+#
+# CONFIG_PRINTK_TIME is not set
+# CONFIG_MAGIC_SYSRQ is not set
+# CONFIG_DEBUG_KERNEL is not set
+CONFIG_LOG_BUF_SHIFT=14
+CONFIG_FRAME_POINTER=y
+# CONFIG_DEBUG_USER is not set
+
+#
+# Hardware crypto devices
+#
+
+#
+# Library routines
+#
+CONFIG_CRC_CCITT=m
+CONFIG_CRC16=m
+CONFIG_CRC32=y
+CONFIG_LIBCRC32C=m
+CONFIG_ZLIB_INFLATE=y
+CONFIG_ZLIB_DEFLATE=y
+CONFIG_TEXTSEARCH=y
+CONFIG_TEXTSEARCH_KMP=m
+CONFIG_TEXTSEARCH_BM=m
+CONFIG_TEXTSEARCH_FSM=m

Added: dists/sid/linux-2.6/debian/config/arm/config.versatile
==============================================================================
--- (empty file)
+++ dists/sid/linux-2.6/debian/config/arm/config.versatile	Mon Nov 26 20:06:56 2007
@@ -0,0 +1,1304 @@
+#
+# Automatically generated make config: don't edit
+# Linux kernel version: 2.6.18
+# Mon Sep 25 14:26:30 2006
+#
+CONFIG_ARM=y
+CONFIG_MMU=y
+CONFIG_GENERIC_HARDIRQS=y
+CONFIG_HARDIRQS_SW_RESEND=y
+CONFIG_GENERIC_IRQ_PROBE=y
+CONFIG_RWSEM_GENERIC_SPINLOCK=y
+CONFIG_GENERIC_HWEIGHT=y
+CONFIG_GENERIC_CALIBRATE_DELAY=y
+CONFIG_VECTORS_BASE=0xffff0000
+CONFIG_DEFCONFIG_LIST="/lib/modules/$UNAME_RELEASE/.config"
+
+#
+# Code maturity level options
+#
+CONFIG_EXPERIMENTAL=y
+CONFIG_BROKEN_ON_SMP=y
+
+#
+# General setup
+#
+CONFIG_LOCALVERSION=""
+# CONFIG_LOCALVERSION_AUTO is not set
+CONFIG_SWAP=y
+CONFIG_SYSVIPC=y
+CONFIG_POSIX_MQUEUE=y
+CONFIG_BSD_PROCESS_ACCT=y
+CONFIG_BSD_PROCESS_ACCT_V3=y
+# CONFIG_TASKSTATS is not set
+# CONFIG_AUDIT is not set
+# CONFIG_IKCONFIG is not set
+CONFIG_INITRAMFS_SOURCE=""
+CONFIG_CC_OPTIMIZE_FOR_SIZE=y
+CONFIG_EMBEDDED=y
+CONFIG_UID16=y
+CONFIG_HOTPLUG=y
+CONFIG_BASE_FULL=y
+CONFIG_SLAB=y
+CONFIG_BASE_SMALL=0
+# CONFIG_SLOB is not set
+
+#
+# Loadable module support
+#
+CONFIG_MODULES=y
+CONFIG_MODULE_UNLOAD=y
+CONFIG_MODULE_FORCE_UNLOAD=y
+CONFIG_MODVERSIONS=y
+# CONFIG_MODULE_SRCVERSION_ALL is not set
+CONFIG_KMOD=y
+
+#
+# Block layer
+#
+# CONFIG_BLK_DEV_IO_TRACE is not set
+
+#
+# System Type
+#
+# CONFIG_ARCH_AAEC2000 is not set
+# CONFIG_ARCH_INTEGRATOR is not set
+# CONFIG_ARCH_REALVIEW is not set
+CONFIG_ARCH_VERSATILE=y
+# CONFIG_ARCH_AT91 is not set
+# CONFIG_ARCH_CLPS7500 is not set
+# CONFIG_ARCH_CLPS711X is not set
+# CONFIG_ARCH_CO285 is not set
+# CONFIG_ARCH_EBSA110 is not set
+# CONFIG_ARCH_EP93XX is not set
+# CONFIG_ARCH_FOOTBRIDGE is not set
+# CONFIG_ARCH_NETX is not set
+# CONFIG_ARCH_H720X is not set
+# CONFIG_ARCH_IMX is not set
+# CONFIG_ARCH_IOP32X is not set
+# CONFIG_ARCH_IOP33X is not set
+# CONFIG_ARCH_IXP4XX is not set
+# CONFIG_ARCH_IXP2000 is not set
+# CONFIG_ARCH_IXP23XX is not set
+# CONFIG_ARCH_L7200 is not set
+# CONFIG_ARCH_PNX4008 is not set
+# CONFIG_ARCH_PXA is not set
+# CONFIG_ARCH_RPC is not set
+# CONFIG_ARCH_SA1100 is not set
+# CONFIG_ARCH_S3C2410 is not set
+# CONFIG_ARCH_SHARK is not set
+# CONFIG_ARCH_LH7A40X is not set
+# CONFIG_ARCH_OMAP is not set
+
+#
+# Versatile platform type
+#
+CONFIG_ARCH_VERSATILE_PB=y
+CONFIG_MACH_VERSATILE_AB=y
+
+#
+# Processor Type
+#
+CONFIG_CPU_32=y
+CONFIG_CPU_ARM926T=y
+CONFIG_CPU_32v5=y
+CONFIG_CPU_ABRT_EV5TJ=y
+CONFIG_CPU_CACHE_VIVT=y
+CONFIG_CPU_COPY_V4WB=y
+CONFIG_CPU_TLB_V4WBI=y
+
+#
+# Processor Features
+#
+# CONFIG_ARM_THUMB is not set
+# CONFIG_CPU_ICACHE_DISABLE is not set
+# CONFIG_CPU_DCACHE_DISABLE is not set
+# CONFIG_CPU_DCACHE_WRITETHROUGH is not set
+# CONFIG_CPU_CACHE_ROUND_ROBIN is not set
+CONFIG_ARM_VIC=y
+CONFIG_ICST307=y
+
+#
+# Bus support
+#
+CONFIG_ARM_AMBA=y
+CONFIG_PCI=y
+
+#
+# PCCARD (PCMCIA/CardBus) support
+#
+# CONFIG_PCCARD is not set
+
+#
+# Kernel Features
+#
+# CONFIG_PREEMPT is not set
+# CONFIG_NO_IDLE_HZ is not set
+# CONFIG_ARCH_DISCONTIGMEM_ENABLE is not set
+CONFIG_SELECT_MEMORY_MODEL=y
+CONFIG_FLATMEM_MANUAL=y
+# CONFIG_DISCONTIGMEM_MANUAL is not set
+# CONFIG_SPARSEMEM_MANUAL is not set
+CONFIG_FLATMEM=y
+CONFIG_FLAT_NODE_MEM_MAP=y
+# CONFIG_SPARSEMEM_STATIC is not set
+CONFIG_SPLIT_PTLOCK_CPUS=4096
+# CONFIG_RESOURCES_64BIT is not set
+# CONFIG_LEDS is not set
+CONFIG_ALIGNMENT_TRAP=y
+
+#
+# Boot options
+#
+CONFIG_ZBOOT_ROM_TEXT=0x0
+CONFIG_ZBOOT_ROM_BSS=0x0
+CONFIG_CMDLINE=""
+# CONFIG_XIP_KERNEL is not set
+
+#
+# Floating point emulation
+#
+
+#
+# At least one emulation must be selected
+#
+CONFIG_FPE_NWFPE=y
+# CONFIG_FPE_NWFPE_XP is not set
+# CONFIG_FPE_FASTFPE is not set
+# CONFIG_VFP is not set
+
+#
+# Userspace binary formats
+#
+CONFIG_BINFMT_ELF=y
+CONFIG_BINFMT_AOUT=m
+CONFIG_BINFMT_MISC=m
+# CONFIG_ARTHUR is not set
+
+#
+# Power management options
+#
+# CONFIG_PM is not set
+# CONFIG_APM is not set
+
+#
+# Networking
+#
+CONFIG_NET=y
+
+#
+# Networking options
+#
+CONFIG_PACKET=y
+CONFIG_PACKET_MMAP=y
+CONFIG_UNIX=y
+CONFIG_XFRM=y
+CONFIG_XFRM_USER=m
+CONFIG_NET_KEY=m
+CONFIG_INET=y
+CONFIG_IP_MULTICAST=y
+CONFIG_IP_ADVANCED_ROUTER=y
+CONFIG_ASK_IP_FIB_HASH=y
+# CONFIG_IP_FIB_TRIE is not set
+CONFIG_IP_FIB_HASH=y
+CONFIG_IP_MULTIPLE_TABLES=y
+CONFIG_IP_ROUTE_MULTIPATH=y
+CONFIG_IP_ROUTE_VERBOSE=y
+# CONFIG_IP_PNP is not set
+CONFIG_NET_IPIP=m
+CONFIG_NET_IPGRE=m
+CONFIG_NET_IPGRE_BROADCAST=y
+CONFIG_IP_MROUTE=y
+CONFIG_IP_PIMSM_V1=y
+CONFIG_IP_PIMSM_V2=y
+# CONFIG_ARPD is not set
+CONFIG_SYN_COOKIES=y
+CONFIG_INET_AH=m
+CONFIG_INET_ESP=m
+CONFIG_INET_IPCOMP=m
+CONFIG_INET_XFRM_TUNNEL=m
+CONFIG_INET_TUNNEL=m
+CONFIG_INET_XFRM_MODE_TRANSPORT=m
+CONFIG_INET_XFRM_MODE_TUNNEL=m
+CONFIG_INET_DIAG=m
+CONFIG_INET_TCP_DIAG=m
+CONFIG_TCP_CONG_ADVANCED=y
+
+#
+# TCP congestion control
+#
+CONFIG_TCP_CONG_BIC=y
+CONFIG_TCP_CONG_CUBIC=m
+CONFIG_TCP_CONG_WESTWOOD=m
+CONFIG_TCP_CONG_HTCP=m
+CONFIG_TCP_CONG_HSTCP=m
+CONFIG_TCP_CONG_HYBLA=m
+CONFIG_TCP_CONG_VEGAS=m
+CONFIG_TCP_CONG_SCALABLE=m
+CONFIG_TCP_CONG_LP=m
+CONFIG_TCP_CONG_VENO=m
+
+#
+# IP: Virtual Server Configuration
+#
+CONFIG_IP_VS=m
+# CONFIG_IP_VS_DEBUG is not set
+CONFIG_IP_VS_TAB_BITS=12
+
+#
+# IPVS transport protocol load balancing support
+#
+CONFIG_IP_VS_PROTO_TCP=y
+CONFIG_IP_VS_PROTO_UDP=y
+CONFIG_IP_VS_PROTO_ESP=y
+CONFIG_IP_VS_PROTO_AH=y
+
+#
+# IPVS scheduler
+#
+CONFIG_IP_VS_RR=m
+CONFIG_IP_VS_WRR=m
+CONFIG_IP_VS_LC=m
+CONFIG_IP_VS_WLC=m
+CONFIG_IP_VS_LBLC=m
+CONFIG_IP_VS_LBLCR=m
+CONFIG_IP_VS_DH=m
+CONFIG_IP_VS_SH=m
+CONFIG_IP_VS_SED=m
+CONFIG_IP_VS_NQ=m
+
+#
+# IPVS application helper
+#
+CONFIG_IP_VS_FTP=m
+CONFIG_IPV6=m
+CONFIG_IPV6_PRIVACY=y
+# CONFIG_IPV6_ROUTER_PREF is not set
+CONFIG_INET6_AH=m
+CONFIG_INET6_ESP=m
+CONFIG_INET6_IPCOMP=m
+CONFIG_INET6_XFRM_TUNNEL=m
+CONFIG_INET6_TUNNEL=m
+CONFIG_INET6_XFRM_MODE_TRANSPORT=m
+CONFIG_INET6_XFRM_MODE_TUNNEL=m
+CONFIG_IPV6_TUNNEL=m
+CONFIG_NETWORK_SECMARK=y
+CONFIG_NETFILTER=y
+# CONFIG_NETFILTER_DEBUG is not set
+CONFIG_BRIDGE_NETFILTER=y
+
+#
+# Core Netfilter Configuration
+#
+CONFIG_NETFILTER_NETLINK=m
+CONFIG_NETFILTER_NETLINK_QUEUE=m
+CONFIG_NETFILTER_NETLINK_LOG=m
+CONFIG_NETFILTER_XTABLES=m
+CONFIG_NETFILTER_XT_TARGET_CLASSIFY=m
+CONFIG_NETFILTER_XT_TARGET_CONNMARK=m
+CONFIG_NETFILTER_XT_TARGET_MARK=m
+CONFIG_NETFILTER_XT_TARGET_NFQUEUE=m
+CONFIG_NETFILTER_XT_TARGET_NOTRACK=m
+CONFIG_NETFILTER_XT_TARGET_SECMARK=m
+CONFIG_NETFILTER_XT_MATCH_COMMENT=m
+CONFIG_NETFILTER_XT_MATCH_CONNBYTES=m
+CONFIG_NETFILTER_XT_MATCH_CONNMARK=m
+CONFIG_NETFILTER_XT_MATCH_CONNTRACK=m
+CONFIG_NETFILTER_XT_MATCH_DCCP=m
+CONFIG_NETFILTER_XT_MATCH_ESP=m
+CONFIG_NETFILTER_XT_MATCH_HELPER=m
+CONFIG_NETFILTER_XT_MATCH_LENGTH=m
+CONFIG_NETFILTER_XT_MATCH_LIMIT=m
+CONFIG_NETFILTER_XT_MATCH_MAC=m
+CONFIG_NETFILTER_XT_MATCH_MARK=m
+CONFIG_NETFILTER_XT_MATCH_POLICY=m
+CONFIG_NETFILTER_XT_MATCH_MULTIPORT=m
+CONFIG_NETFILTER_XT_MATCH_PHYSDEV=m
+CONFIG_NETFILTER_XT_MATCH_PKTTYPE=m
+CONFIG_NETFILTER_XT_MATCH_QUOTA=m
+CONFIG_NETFILTER_XT_MATCH_REALM=m
+CONFIG_NETFILTER_XT_MATCH_SCTP=m
+CONFIG_NETFILTER_XT_MATCH_STATE=m
+CONFIG_NETFILTER_XT_MATCH_STATISTIC=m
+CONFIG_NETFILTER_XT_MATCH_STRING=m
+CONFIG_NETFILTER_XT_MATCH_TCPMSS=m
+
+#
+# IP: Netfilter Configuration
+#
+CONFIG_IP_NF_QUEUE=m
+CONFIG_IP_NF_IPTABLES=m
+CONFIG_IP_NF_MATCH_IPRANGE=m
+CONFIG_IP_NF_MATCH_TOS=m
+CONFIG_IP_NF_MATCH_RECENT=m
+CONFIG_IP_NF_MATCH_ECN=m
+CONFIG_IP_NF_MATCH_DSCP=m
+CONFIG_IP_NF_MATCH_AH=m
+CONFIG_IP_NF_MATCH_TTL=m
+CONFIG_IP_NF_MATCH_OWNER=m
+CONFIG_IP_NF_MATCH_ADDRTYPE=m
+CONFIG_IP_NF_MATCH_HASHLIMIT=m
+CONFIG_IP_NF_FILTER=m
+CONFIG_IP_NF_TARGET_REJECT=m
+CONFIG_IP_NF_TARGET_LOG=m
+CONFIG_IP_NF_TARGET_ULOG=m
+CONFIG_IP_NF_TARGET_TCPMSS=m
+CONFIG_IP_NF_TARGET_MASQUERADE=m
+CONFIG_IP_NF_TARGET_REDIRECT=m
+CONFIG_IP_NF_TARGET_NETMAP=m
+CONFIG_IP_NF_TARGET_SAME=m
+CONFIG_IP_NF_MANGLE=m
+CONFIG_IP_NF_TARGET_TOS=m
+CONFIG_IP_NF_TARGET_ECN=m
+CONFIG_IP_NF_TARGET_DSCP=m
+CONFIG_IP_NF_TARGET_TTL=m
+CONFIG_IP_NF_TARGET_CLUSTERIP=m
+CONFIG_IP_NF_RAW=m
+CONFIG_IP_NF_ARPTABLES=m
+CONFIG_IP_NF_ARPFILTER=m
+CONFIG_IP_NF_ARP_MANGLE=m
+
+#
+# IPv6: Netfilter Configuration (EXPERIMENTAL)
+#
+CONFIG_IP6_NF_QUEUE=m
+CONFIG_IP6_NF_IPTABLES=m
+CONFIG_IP6_NF_MATCH_RT=m
+CONFIG_IP6_NF_MATCH_OPTS=m
+CONFIG_IP6_NF_MATCH_FRAG=m
+CONFIG_IP6_NF_MATCH_HL=m
+CONFIG_IP6_NF_MATCH_OWNER=m
+CONFIG_IP6_NF_MATCH_IPV6HEADER=m
+CONFIG_IP6_NF_MATCH_AH=m
+CONFIG_IP6_NF_MATCH_EUI64=m
+CONFIG_IP6_NF_FILTER=m
+CONFIG_IP6_NF_TARGET_LOG=m
+CONFIG_IP6_NF_TARGET_REJECT=m
+CONFIG_IP6_NF_MANGLE=m
+CONFIG_IP6_NF_TARGET_HL=m
+CONFIG_IP6_NF_RAW=m
+
+#
+# DECnet: Netfilter Configuration
+#
+CONFIG_DECNET_NF_GRABULATOR=m
+
+#
+# Bridge: Netfilter Configuration
+#
+CONFIG_BRIDGE_NF_EBTABLES=m
+CONFIG_BRIDGE_EBT_BROUTE=m
+CONFIG_BRIDGE_EBT_T_FILTER=m
+CONFIG_BRIDGE_EBT_T_NAT=m
+CONFIG_BRIDGE_EBT_802_3=m
+CONFIG_BRIDGE_EBT_AMONG=m
+CONFIG_BRIDGE_EBT_ARP=m
+CONFIG_BRIDGE_EBT_IP=m
+CONFIG_BRIDGE_EBT_LIMIT=m
+CONFIG_BRIDGE_EBT_MARK=m
+CONFIG_BRIDGE_EBT_PKTTYPE=m
+CONFIG_BRIDGE_EBT_STP=m
+CONFIG_BRIDGE_EBT_VLAN=m
+CONFIG_BRIDGE_EBT_ARPREPLY=m
+CONFIG_BRIDGE_EBT_DNAT=m
+CONFIG_BRIDGE_EBT_MARK_T=m
+CONFIG_BRIDGE_EBT_REDIRECT=m
+CONFIG_BRIDGE_EBT_SNAT=m
+CONFIG_BRIDGE_EBT_LOG=m
+CONFIG_BRIDGE_EBT_ULOG=m
+
+#
+# DCCP Configuration (EXPERIMENTAL)
+#
+CONFIG_IP_DCCP=m
+CONFIG_INET_DCCP_DIAG=m
+CONFIG_IP_DCCP_ACKVEC=y
+
+#
+# DCCP CCIDs Configuration (EXPERIMENTAL)
+#
+CONFIG_IP_DCCP_CCID2=m
+CONFIG_IP_DCCP_CCID3=m
+CONFIG_IP_DCCP_TFRC_LIB=m
+
+#
+# SCTP Configuration (EXPERIMENTAL)
+#
+CONFIG_IP_SCTP=m
+# CONFIG_SCTP_DBG_MSG is not set
+# CONFIG_SCTP_DBG_OBJCNT is not set
+# CONFIG_SCTP_HMAC_NONE is not set
+# CONFIG_SCTP_HMAC_SHA1 is not set
+CONFIG_SCTP_HMAC_MD5=y
+
+#
+# TIPC Configuration (EXPERIMENTAL)
+#
+CONFIG_TIPC=m
+CONFIG_TIPC_ADVANCED=y
+CONFIG_TIPC_ZONES=3
+CONFIG_TIPC_CLUSTERS=1
+CONFIG_TIPC_NODES=255
+CONFIG_TIPC_SLAVE_NODES=0
+CONFIG_TIPC_PORTS=8191
+CONFIG_TIPC_LOG=0
+# CONFIG_TIPC_DEBUG is not set
+# CONFIG_ATM is not set
+CONFIG_BRIDGE=m
+CONFIG_VLAN_8021Q=m
+CONFIG_DECNET=m
+# CONFIG_DECNET_ROUTER is not set
+CONFIG_LLC=m
+CONFIG_LLC2=m
+CONFIG_IPX=m
+# CONFIG_IPX_INTERN is not set
+CONFIG_ATALK=m
+CONFIG_DEV_APPLETALK=m
+CONFIG_IPDDP=m
+CONFIG_IPDDP_ENCAP=y
+CONFIG_IPDDP_DECAP=y
+CONFIG_X25=m
+CONFIG_LAPB=m
+CONFIG_ECONET=m
+CONFIG_ECONET_AUNUDP=y
+CONFIG_ECONET_NATIVE=y
+CONFIG_WAN_ROUTER=m
+
+#
+# Network testing
+#
+# CONFIG_HAMRADIO is not set
+# CONFIG_IRDA is not set
+# CONFIG_BT is not set
+# CONFIG_IEEE80211 is not set
+
+#
+# Device Drivers
+#
+
+#
+# Generic Driver Options
+#
+CONFIG_STANDALONE=y
+CONFIG_PREVENT_FIRMWARE_BUILD=y
+CONFIG_FW_LOADER=m
+# CONFIG_SYS_HYPERVISOR is not set
+
+#
+# Connector - unified userspace <-> kernelspace linker
+#
+CONFIG_CONNECTOR=m
+
+#
+# Memory Technology Devices (MTD)
+#
+# CONFIG_MTD is not set
+
+#
+# Parallel port support
+#
+# CONFIG_PARPORT is not set
+
+#
+# Plug and Play support
+#
+
+#
+# Block devices
+#
+# CONFIG_BLK_CPQ_DA is not set
+# CONFIG_BLK_CPQ_CISS_DA is not set
+# CONFIG_BLK_DEV_DAC960 is not set
+# CONFIG_BLK_DEV_UMEM is not set
+# CONFIG_BLK_DEV_COW_COMMON is not set
+CONFIG_BLK_DEV_LOOP=m
+CONFIG_BLK_DEV_CRYPTOLOOP=m
+CONFIG_BLK_DEV_NBD=m
+# CONFIG_BLK_DEV_SX8 is not set
+CONFIG_BLK_DEV_RAM=y
+CONFIG_BLK_DEV_RAM_COUNT=16
+CONFIG_BLK_DEV_RAM_SIZE=8192
+CONFIG_BLK_DEV_RAM_BLOCKSIZE=1024
+CONFIG_BLK_DEV_INITRD=y
+# CONFIG_CDROM_PKTCDVD is not set
+CONFIG_ATA_OVER_ETH=m
+
+#
+# SCSI device support
+#
+CONFIG_RAID_ATTRS=m
+CONFIG_SCSI=y
+CONFIG_SCSI_PROC_FS=y
+
+#
+# SCSI support type (disk, tape, CD-ROM)
+#
+CONFIG_BLK_DEV_SD=y
+CONFIG_CHR_DEV_ST=m
+CONFIG_CHR_DEV_OSST=m
+CONFIG_BLK_DEV_SR=m
+CONFIG_BLK_DEV_SR_VENDOR=y
+CONFIG_CHR_DEV_SG=m
+CONFIG_CHR_DEV_SCH=m
+
+#
+# Some SCSI devices (e.g. CD jukebox) support multiple LUNs
+#
+CONFIG_SCSI_MULTI_LUN=y
+CONFIG_SCSI_CONSTANTS=y
+CONFIG_SCSI_LOGGING=y
+
+#
+# SCSI Transport Attributes
+#
+CONFIG_SCSI_SPI_ATTRS=y
+# CONFIG_SCSI_FC_ATTRS is not set
+# CONFIG_SCSI_ISCSI_ATTRS is not set
+# CONFIG_SCSI_SAS_ATTRS is not set
+
+#
+# SCSI low-level drivers
+#
+# CONFIG_ISCSI_TCP is not set
+# CONFIG_BLK_DEV_3W_XXXX_RAID is not set
+# CONFIG_SCSI_3W_9XXX is not set
+# CONFIG_SCSI_ACARD is not set
+# CONFIG_SCSI_AACRAID is not set
+# CONFIG_SCSI_AIC7XXX is not set
+# CONFIG_SCSI_AIC7XXX_OLD is not set
+# CONFIG_SCSI_AIC79XX is not set
+# CONFIG_SCSI_DPT_I2O is not set
+# CONFIG_MEGARAID_NEWGEN is not set
+# CONFIG_MEGARAID_LEGACY is not set
+# CONFIG_MEGARAID_SAS is not set
+CONFIG_SCSI_HPTIOP=m
+# CONFIG_SCSI_DMX3191D is not set
+# CONFIG_SCSI_FUTURE_DOMAIN is not set
+# CONFIG_SCSI_IPS is not set
+# CONFIG_SCSI_INITIO is not set
+# CONFIG_SCSI_INIA100 is not set
+CONFIG_SCSI_SYM53C8XX_2=y
+CONFIG_SCSI_SYM53C8XX_DMA_ADDRESSING_MODE=1
+CONFIG_SCSI_SYM53C8XX_DEFAULT_TAGS=16
+CONFIG_SCSI_SYM53C8XX_MAX_TAGS=64
+CONFIG_SCSI_SYM53C8XX_MMIO=y
+# CONFIG_SCSI_IPR is not set
+# CONFIG_SCSI_QLOGIC_1280 is not set
+# CONFIG_SCSI_QLA_FC is not set
+# CONFIG_SCSI_LPFC is not set
+# CONFIG_SCSI_DC395x is not set
+# CONFIG_SCSI_DC390T is not set
+# CONFIG_SCSI_NSP32 is not set
+# CONFIG_SCSI_DEBUG is not set
+
+#
+# Serial ATA (prod) and Parallel ATA (experimental) drivers
+#
+# CONFIG_ATA is not set
+
+#
+# Multi-device support (RAID and LVM)
+#
+CONFIG_MD=y
+CONFIG_BLK_DEV_MD=m
+CONFIG_MD_LINEAR=m
+CONFIG_MD_RAID0=m
+CONFIG_MD_RAID1=m
+CONFIG_MD_RAID10=m
+CONFIG_MD_RAID456=m
+CONFIG_MD_RAID5_RESHAPE=y
+CONFIG_MD_MULTIPATH=m
+CONFIG_MD_FAULTY=m
+CONFIG_BLK_DEV_DM=m
+CONFIG_DM_CRYPT=m
+CONFIG_DM_SNAPSHOT=m
+CONFIG_DM_MIRROR=m
+CONFIG_DM_ZERO=m
+CONFIG_DM_MULTIPATH=m
+# CONFIG_DM_MULTIPATH_EMC is not set
+
+#
+# Fusion MPT device support
+#
+# CONFIG_FUSION is not set
+# CONFIG_FUSION_SPI is not set
+# CONFIG_FUSION_FC is not set
+# CONFIG_FUSION_SAS is not set
+
+#
+# IEEE 1394 (FireWire) support
+#
+# CONFIG_FIREWIRE is not set
+
+#
+# I2O device support
+#
+# CONFIG_I2O is not set
+
+#
+# Network device support
+#
+CONFIG_NETDEVICES=y
+CONFIG_DUMMY=m
+CONFIG_BONDING=m
+CONFIG_EQUALIZER=m
+CONFIG_TUN=m
+
+#
+# ARCnet devices
+#
+# CONFIG_ARCNET is not set
+
+#
+# PHY device support
+#
+# CONFIG_PHYLIB is not set
+
+#
+# Ethernet (10 or 100Mbit)
+#
+CONFIG_NET_ETHERNET=y
+CONFIG_MII=y
+# CONFIG_HAPPYMEAL is not set
+# CONFIG_SUNGEM is not set
+# CONFIG_CASSINI is not set
+# CONFIG_NET_VENDOR_3COM is not set
+CONFIG_SMC91X=y
+# CONFIG_DM9000 is not set
+
+#
+# Tulip family network device support
+#
+# CONFIG_NET_TULIP is not set
+# CONFIG_HP100 is not set
+# CONFIG_NET_PCI is not set
+
+#
+# Ethernet (1000 Mbit)
+#
+CONFIG_ACENIC=m
+# CONFIG_ACENIC_OMIT_TIGON_I is not set
+# CONFIG_DL2K is not set
+# CONFIG_E1000 is not set
+# CONFIG_NS83820 is not set
+# CONFIG_HAMACHI is not set
+# CONFIG_YELLOWFIN is not set
+# CONFIG_R8169 is not set
+# CONFIG_SIS190 is not set
+# CONFIG_SKGE is not set
+# CONFIG_SKY2 is not set
+# CONFIG_TIGON3 is not set
+# CONFIG_BNX2 is not set
+
+#
+# Ethernet (10000 Mbit)
+#
+# CONFIG_CHELSIO_T1 is not set
+# CONFIG_IXGB is not set
+# CONFIG_S2IO is not set
+CONFIG_MYRI10GE=m
+
+#
+# Token Ring devices
+#
+# CONFIG_TR is not set
+
+#
+# Wireless LAN (non-hamradio)
+#
+# CONFIG_NET_RADIO is not set
+
+#
+# Wan interfaces
+#
+# CONFIG_WAN is not set
+# CONFIG_FDDI is not set
+# CONFIG_HIPPI is not set
+CONFIG_PPP=m
+CONFIG_PPP_MULTILINK=y
+CONFIG_PPP_FILTER=y
+CONFIG_PPP_ASYNC=m
+CONFIG_PPP_SYNC_TTY=m
+CONFIG_PPP_DEFLATE=m
+CONFIG_PPP_BSDCOMP=m
+CONFIG_PPP_MPPE=m
+CONFIG_PPPOE=m
+CONFIG_SLIP=m
+CONFIG_SLIP_COMPRESSED=y
+CONFIG_SLIP_SMART=y
+CONFIG_SLIP_MODE_SLIP6=y
+# CONFIG_NET_FC is not set
+# CONFIG_SHAPER is not set
+CONFIG_NETCONSOLE=m
+CONFIG_NETPOLL=y
+# CONFIG_NETPOLL_TRAP is not set
+CONFIG_NET_POLL_CONTROLLER=y
+
+#
+# ISDN subsystem
+#
+# CONFIG_ISDN is not set
+
+#
+# Input device support
+#
+CONFIG_INPUT=y
+
+#
+# Userland interfaces
+#
+CONFIG_INPUT_MOUSEDEV=y
+# CONFIG_INPUT_MOUSEDEV_PSAUX is not set
+CONFIG_INPUT_MOUSEDEV_SCREEN_X=1024
+CONFIG_INPUT_MOUSEDEV_SCREEN_Y=768
+# CONFIG_INPUT_JOYDEV is not set
+# CONFIG_INPUT_TSDEV is not set
+# CONFIG_INPUT_EVDEV is not set
+# CONFIG_INPUT_EVBUG is not set
+
+#
+# Input Device Drivers
+#
+CONFIG_INPUT_KEYBOARD=y
+CONFIG_KEYBOARD_ATKBD=y
+# CONFIG_KEYBOARD_SUNKBD is not set
+# CONFIG_KEYBOARD_LKKBD is not set
+# CONFIG_KEYBOARD_XTKBD is not set
+# CONFIG_KEYBOARD_NEWTON is not set
+CONFIG_INPUT_MOUSE=y
+CONFIG_MOUSE_PS2=m
+CONFIG_MOUSE_SERIAL=m
+# CONFIG_MOUSE_VSXXXAA is not set
+# CONFIG_INPUT_JOYSTICK is not set
+# CONFIG_INPUT_TOUCHSCREEN is not set
+CONFIG_INPUT_MISC=y
+CONFIG_INPUT_UINPUT=m
+
+#
+# Hardware I/O ports
+#
+CONFIG_SERIO=y
+CONFIG_SERIO_SERPORT=y
+CONFIG_SERIO_AMBAKMI=y
+# CONFIG_SERIO_PCIPS2 is not set
+CONFIG_SERIO_LIBPS2=y
+# CONFIG_SERIO_RAW is not set
+# CONFIG_GAMEPORT is not set
+
+#
+# Character devices
+#
+CONFIG_VT=y
+CONFIG_VT_CONSOLE=y
+CONFIG_HW_CONSOLE=y
+# CONFIG_VT_HW_CONSOLE_BINDING is not set
+# CONFIG_SERIAL_NONSTANDARD is not set
+
+#
+# Serial drivers
+#
+# CONFIG_SERIAL_8250 is not set
+
+#
+# Non-8250 serial port support
+#
+CONFIG_SERIAL_AMBA_PL011=y
+CONFIG_SERIAL_AMBA_PL011_CONSOLE=y
+CONFIG_SERIAL_CORE=y
+CONFIG_SERIAL_CORE_CONSOLE=y
+# CONFIG_SERIAL_JSM is not set
+
+#
+# IPMI
+#
+# CONFIG_IPMI_HANDLER is not set
+
+#
+# Watchdog Cards
+#
+CONFIG_WATCHDOG=y
+# CONFIG_WATCHDOG_NOWAYOUT is not set
+
+#
+# Watchdog Device Drivers
+#
+CONFIG_SOFT_WATCHDOG=m
+
+#
+# PCI-based Watchdog Cards
+#
+# CONFIG_PCIPCWATCHDOG is not set
+# CONFIG_WDTPCI is not set
+CONFIG_HW_RANDOM=y
+# CONFIG_NVRAM is not set
+# CONFIG_DTLK is not set
+# CONFIG_R3964 is not set
+# CONFIG_APPLICOM is not set
+
+#
+# Ftape, the floppy tape device driver
+#
+# CONFIG_DRM is not set
+# CONFIG_RAW_DRIVER is not set
+
+#
+# TPM devices
+#
+# CONFIG_TCG_TPM is not set
+# CONFIG_TELCLOCK is not set
+
+#
+# I2C support
+#
+# CONFIG_I2C is not set
+
+#
+# SPI support
+#
+# CONFIG_SPI is not set
+# CONFIG_SPI_MASTER is not set
+
+#
+# Dallas's 1-wire bus
+#
+# CONFIG_W1 is not set
+
+#
+# Hardware Monitoring support
+#
+# CONFIG_HWMON is not set
+# CONFIG_HWMON_VID is not set
+
+#
+# Misc devices
+#
+
+#
+# LED devices
+#
+# CONFIG_NEW_LEDS is not set
+
+#
+# LED drivers
+#
+
+#
+# LED Triggers
+#
+
+#
+# Multimedia devices
+#
+# CONFIG_VIDEO_DEV is not set
+
+#
+# Digital Video Broadcasting Devices
+#
+# CONFIG_DVB is not set
+
+#
+# Graphics support
+#
+CONFIG_FIRMWARE_EDID=y
+CONFIG_FB=y
+CONFIG_FB_CFB_FILLRECT=y
+CONFIG_FB_CFB_COPYAREA=y
+CONFIG_FB_CFB_IMAGEBLIT=y
+# CONFIG_FB_MACMODES is not set
+# CONFIG_FB_BACKLIGHT is not set
+CONFIG_FB_MODE_HELPERS=y
+# CONFIG_FB_TILEBLITTING is not set
+# CONFIG_FB_CIRRUS is not set
+# CONFIG_FB_PM2 is not set
+CONFIG_FB_ARMCLCD=y
+# CONFIG_FB_CYBER2000 is not set
+# CONFIG_FB_ASILIANT is not set
+# CONFIG_FB_IMSTT is not set
+# CONFIG_FB_S1D13XXX is not set
+# CONFIG_FB_NVIDIA is not set
+# CONFIG_FB_RIVA is not set
+# CONFIG_FB_MATROX is not set
+# CONFIG_FB_RADEON is not set
+# CONFIG_FB_ATY128 is not set
+# CONFIG_FB_ATY is not set
+# CONFIG_FB_SAVAGE is not set
+# CONFIG_FB_SIS is not set
+# CONFIG_FB_NEOMAGIC is not set
+# CONFIG_FB_KYRO is not set
+# CONFIG_FB_3DFX is not set
+# CONFIG_FB_VOODOO1 is not set
+# CONFIG_FB_TRIDENT is not set
+CONFIG_FB_VIRTUAL=m
+
+#
+# Console display driver support
+#
+CONFIG_DUMMY_CONSOLE=y
+CONFIG_FRAMEBUFFER_CONSOLE=y
+CONFIG_FRAMEBUFFER_CONSOLE_ROTATION=y
+CONFIG_FONTS=y
+CONFIG_FONT_8x8=y
+CONFIG_FONT_8x16=y
+# CONFIG_FONT_6x11 is not set
+# CONFIG_FONT_7x14 is not set
+# CONFIG_FONT_PEARL_8x8 is not set
+# CONFIG_FONT_ACORN_8x8 is not set
+# CONFIG_FONT_MINI_4x6 is not set
+# CONFIG_FONT_SUN8x16 is not set
+# CONFIG_FONT_SUN12x22 is not set
+# CONFIG_FONT_10x18 is not set
+
+#
+# Logo configuration
+#
+CONFIG_LOGO=y
+# CONFIG_LOGO_LINUX_MONO is not set
+# CONFIG_LOGO_LINUX_VGA16 is not set
+CONFIG_LOGO_LINUX_CLUT224=y
+# CONFIG_BACKLIGHT_LCD_SUPPORT is not set
+
+#
+# Sound
+#
+# CONFIG_SOUND is not set
+
+#
+# USB support
+#
+CONFIG_USB_ARCH_HAS_HCD=y
+CONFIG_USB_ARCH_HAS_OHCI=y
+CONFIG_USB_ARCH_HAS_EHCI=y
+# CONFIG_USB is not set
+
+#
+# NOTE: USB_STORAGE enables SCSI, and 'SCSI disk support'
+#
+
+#
+# USB Gadget Support
+#
+# CONFIG_USB_GADGET is not set
+
+#
+# MMC/SD Card support
+#
+# CONFIG_MMC is not set
+
+#
+# Real Time Clock
+#
+CONFIG_RTC_LIB=y
+CONFIG_RTC_CLASS=m
+
+#
+# RTC interfaces
+#
+CONFIG_RTC_INTF_SYSFS=y
+CONFIG_RTC_INTF_PROC=y
+CONFIG_RTC_INTF_DEV=y
+# CONFIG_RTC_INTF_DEV_UIE_EMUL is not set
+
+#
+# RTC drivers
+#
+CONFIG_RTC_DRV_DS1553=m
+CONFIG_RTC_DRV_DS1742=m
+# CONFIG_RTC_DRV_M48T86 is not set
+# CONFIG_RTC_DRV_PL031 is not set
+# CONFIG_RTC_DRV_TEST is not set
+CONFIG_RTC_DRV_V3020=m
+
+#
+# File systems
+#
+CONFIG_EXT2_FS=y
+CONFIG_EXT2_FS_XATTR=y
+CONFIG_EXT2_FS_POSIX_ACL=y
+CONFIG_EXT2_FS_SECURITY=y
+# CONFIG_EXT2_FS_XIP is not set
+CONFIG_EXT3_FS=y
+CONFIG_EXT3_FS_XATTR=y
+CONFIG_EXT3_FS_POSIX_ACL=y
+CONFIG_EXT3_FS_SECURITY=y
+CONFIG_JBD=y
+# CONFIG_JBD_DEBUG is not set
+CONFIG_FS_MBCACHE=y
+CONFIG_REISERFS_FS=m
+# CONFIG_REISERFS_CHECK is not set
+# CONFIG_REISERFS_PROC_INFO is not set
+CONFIG_REISERFS_FS_XATTR=y
+CONFIG_REISERFS_FS_POSIX_ACL=y
+CONFIG_REISERFS_FS_SECURITY=y
+CONFIG_JFS_FS=m
+CONFIG_JFS_POSIX_ACL=y
+CONFIG_JFS_SECURITY=y
+# CONFIG_JFS_DEBUG is not set
+# CONFIG_JFS_STATISTICS is not set
+CONFIG_FS_POSIX_ACL=y
+CONFIG_XFS_FS=m
+CONFIG_XFS_QUOTA=y
+CONFIG_XFS_SECURITY=y
+CONFIG_XFS_POSIX_ACL=y
+# CONFIG_XFS_RT is not set
+CONFIG_OCFS2_FS=m
+CONFIG_OCFS2_DEBUG_MASKLOG=y
+CONFIG_MINIX_FS=m
+CONFIG_ROMFS_FS=m
+CONFIG_INOTIFY=y
+CONFIG_INOTIFY_USER=y
+CONFIG_QUOTA=y
+CONFIG_QFMT_V1=m
+CONFIG_QFMT_V2=m
+CONFIG_QUOTACTL=y
+CONFIG_DNOTIFY=y
+CONFIG_AUTOFS_FS=m
+CONFIG_AUTOFS4_FS=m
+CONFIG_FUSE_FS=m
+
+#
+# CD-ROM/DVD Filesystems
+#
+CONFIG_ISO9660_FS=m
+CONFIG_JOLIET=y
+CONFIG_ZISOFS=y
+CONFIG_UDF_FS=m
+CONFIG_UDF_NLS=y
+
+#
+# DOS/FAT/NT Filesystems
+#
+CONFIG_FAT_FS=m
+CONFIG_MSDOS_FS=m
+CONFIG_VFAT_FS=m
+CONFIG_FAT_DEFAULT_CODEPAGE=437
+CONFIG_FAT_DEFAULT_IOCHARSET="iso8859-1"
+CONFIG_NTFS_FS=m
+# CONFIG_NTFS_DEBUG is not set
+CONFIG_NTFS_RW=y
+
+#
+# Pseudo filesystems
+#
+CONFIG_PROC_FS=y
+CONFIG_SYSFS=y
+CONFIG_TMPFS=y
+CONFIG_RAMFS=y
+CONFIG_CONFIGFS_FS=m
+
+#
+# Miscellaneous filesystems
+#
+CONFIG_ADFS_FS=m
+# CONFIG_ADFS_FS_RW is not set
+CONFIG_AFFS_FS=m
+CONFIG_HFS_FS=m
+CONFIG_HFSPLUS_FS=m
+CONFIG_BEFS_FS=m
+# CONFIG_BEFS_DEBUG is not set
+CONFIG_BFS_FS=m
+CONFIG_EFS_FS=m
+CONFIG_CRAMFS=y
+CONFIG_VXFS_FS=m
+CONFIG_HPFS_FS=m
+CONFIG_QNX4FS_FS=m
+CONFIG_SYSV_FS=m
+CONFIG_UFS_FS=m
+# CONFIG_UFS_FS_WRITE is not set
+# CONFIG_UFS_DEBUG is not set
+
+#
+# Network File Systems
+#
+CONFIG_NFS_FS=m
+CONFIG_NFS_V3=y
+CONFIG_NFS_V3_ACL=y
+CONFIG_NFS_V4=y
+CONFIG_NFS_DIRECTIO=y
+CONFIG_NFSD=m
+CONFIG_NFSD_V2_ACL=y
+CONFIG_NFSD_V3=y
+CONFIG_NFSD_V3_ACL=y
+CONFIG_NFSD_V4=y
+CONFIG_NFSD_TCP=y
+CONFIG_LOCKD=m
+CONFIG_LOCKD_V4=y
+CONFIG_EXPORTFS=m
+CONFIG_NFS_ACL_SUPPORT=m
+CONFIG_NFS_COMMON=y
+CONFIG_SUNRPC=m
+CONFIG_SUNRPC_GSS=m
+CONFIG_RPCSEC_GSS_KRB5=m
+CONFIG_RPCSEC_GSS_SPKM3=m
+CONFIG_SMB_FS=m
+# CONFIG_SMB_NLS_DEFAULT is not set
+CONFIG_CIFS=m
+# CONFIG_CIFS_STATS is not set
+# CONFIG_CIFS_WEAK_PW_HASH is not set
+# CONFIG_CIFS_XATTR is not set
+# CONFIG_CIFS_DEBUG2 is not set
+# CONFIG_CIFS_EXPERIMENTAL is not set
+CONFIG_NCP_FS=m
+CONFIG_NCPFS_PACKET_SIGNING=y
+CONFIG_NCPFS_IOCTL_LOCKING=y
+CONFIG_NCPFS_STRONG=y
+CONFIG_NCPFS_NFS_NS=y
+CONFIG_NCPFS_OS2_NS=y
+# CONFIG_NCPFS_SMALLDOS is not set
+CONFIG_NCPFS_NLS=y
+CONFIG_NCPFS_EXTRAS=y
+CONFIG_CODA_FS=m
+# CONFIG_CODA_FS_OLD_API is not set
+CONFIG_AFS_FS=m
+# CONFIG_AFS_DEBUG is not set
+CONFIG_9P_FS=m
+
+#
+# Partition Types
+#
+CONFIG_PARTITION_ADVANCED=y
+CONFIG_ACORN_PARTITION=y
+# CONFIG_ACORN_PARTITION_CUMANA is not set
+# CONFIG_ACORN_PARTITION_EESOX is not set
+CONFIG_ACORN_PARTITION_ICS=y
+# CONFIG_ACORN_PARTITION_ADFS is not set
+# CONFIG_ACORN_PARTITION_POWERTEC is not set
+CONFIG_ACORN_PARTITION_RISCIX=y
+CONFIG_OSF_PARTITION=y
+CONFIG_AMIGA_PARTITION=y
+CONFIG_ATARI_PARTITION=y
+CONFIG_MAC_PARTITION=y
+CONFIG_MSDOS_PARTITION=y
+CONFIG_BSD_DISKLABEL=y
+CONFIG_MINIX_SUBPARTITION=y
+CONFIG_SOLARIS_X86_PARTITION=y
+CONFIG_UNIXWARE_DISKLABEL=y
+CONFIG_LDM_PARTITION=y
+# CONFIG_LDM_DEBUG is not set
+CONFIG_SGI_PARTITION=y
+CONFIG_ULTRIX_PARTITION=y
+CONFIG_SUN_PARTITION=y
+CONFIG_KARMA_PARTITION=y
+CONFIG_EFI_PARTITION=y
+
+#
+# Native Language Support
+#
+CONFIG_NLS=y
+CONFIG_NLS_DEFAULT="iso8859-1"
+CONFIG_NLS_CODEPAGE_437=m
+CONFIG_NLS_CODEPAGE_737=m
+CONFIG_NLS_CODEPAGE_775=m
+CONFIG_NLS_CODEPAGE_850=m
+CONFIG_NLS_CODEPAGE_852=m
+CONFIG_NLS_CODEPAGE_855=m
+CONFIG_NLS_CODEPAGE_857=m
+CONFIG_NLS_CODEPAGE_860=m
+CONFIG_NLS_CODEPAGE_861=m
+CONFIG_NLS_CODEPAGE_862=m
+CONFIG_NLS_CODEPAGE_863=m
+CONFIG_NLS_CODEPAGE_864=m
+CONFIG_NLS_CODEPAGE_865=m
+CONFIG_NLS_CODEPAGE_866=m
+CONFIG_NLS_CODEPAGE_869=m
+CONFIG_NLS_CODEPAGE_936=m
+CONFIG_NLS_CODEPAGE_950=m
+CONFIG_NLS_CODEPAGE_932=m
+CONFIG_NLS_CODEPAGE_949=m
+CONFIG_NLS_CODEPAGE_874=m
+CONFIG_NLS_ISO8859_8=m
+CONFIG_NLS_CODEPAGE_1250=m
+CONFIG_NLS_CODEPAGE_1251=m
+CONFIG_NLS_ASCII=m
+CONFIG_NLS_ISO8859_1=m
+CONFIG_NLS_ISO8859_2=m
+CONFIG_NLS_ISO8859_3=m
+CONFIG_NLS_ISO8859_4=m
+CONFIG_NLS_ISO8859_5=m
+CONFIG_NLS_ISO8859_6=m
+CONFIG_NLS_ISO8859_7=m
+CONFIG_NLS_ISO8859_9=m
+CONFIG_NLS_ISO8859_13=m
+CONFIG_NLS_ISO8859_14=m
+CONFIG_NLS_ISO8859_15=m
+CONFIG_NLS_KOI8_R=m
+CONFIG_NLS_KOI8_U=m
+CONFIG_NLS_UTF8=m
+
+#
+# Profiling support
+#
+CONFIG_PROFILING=y
+CONFIG_OPROFILE=m
+
+#
+# Kernel hacking
+#
+# CONFIG_PRINTK_TIME is not set
+CONFIG_MAGIC_SYSRQ=y
+CONFIG_UNUSED_SYMBOLS=y
+# CONFIG_DEBUG_KERNEL is not set
+CONFIG_LOG_BUF_SHIFT=14
+# CONFIG_DEBUG_BUGVERBOSE is not set
+# CONFIG_DEBUG_FS is not set
+CONFIG_FRAME_POINTER=y
+# CONFIG_UNWIND_INFO is not set
+# CONFIG_DEBUG_USER is not set
+
+#
+# Security options
+#
+CONFIG_KEYS=y
+# CONFIG_KEYS_DEBUG_PROC_KEYS is not set
+CONFIG_SECURITY=y
+CONFIG_SECURITY_NETWORK=y
+CONFIG_SECURITY_NETWORK_XFRM=y
+CONFIG_SECURITY_CAPABILITIES=y
+# CONFIG_SECURITY_SECLVL is not set
+
+#
+# Cryptographic options
+#
+CONFIG_CRYPTO=y
+CONFIG_CRYPTO_HMAC=y
+CONFIG_CRYPTO_NULL=m
+CONFIG_CRYPTO_MD4=m
+CONFIG_CRYPTO_MD5=y
+CONFIG_CRYPTO_SHA1=m
+CONFIG_CRYPTO_SHA256=m
+CONFIG_CRYPTO_SHA512=m
+CONFIG_CRYPTO_WP512=m
+CONFIG_CRYPTO_TGR192=m
+CONFIG_CRYPTO_DES=m
+CONFIG_CRYPTO_BLOWFISH=m
+CONFIG_CRYPTO_TWOFISH=m
+CONFIG_CRYPTO_SERPENT=m
+CONFIG_CRYPTO_AES=m
+CONFIG_CRYPTO_CAST5=m
+CONFIG_CRYPTO_CAST6=m
+CONFIG_CRYPTO_TEA=m
+CONFIG_CRYPTO_ARC4=m
+CONFIG_CRYPTO_KHAZAD=m
+CONFIG_CRYPTO_ANUBIS=m
+CONFIG_CRYPTO_DEFLATE=m
+CONFIG_CRYPTO_MICHAEL_MIC=m
+CONFIG_CRYPTO_CRC32C=m
+CONFIG_CRYPTO_TEST=m
+
+#
+# Hardware crypto devices
+#
+
+#
+# Library routines
+#
+CONFIG_CRC_CCITT=m
+CONFIG_CRC16=m
+CONFIG_CRC32=y
+CONFIG_LIBCRC32C=m
+CONFIG_ZLIB_INFLATE=y
+CONFIG_ZLIB_DEFLATE=m
+CONFIG_TEXTSEARCH=y
+CONFIG_TEXTSEARCH_KMP=m
+CONFIG_TEXTSEARCH_BM=m
+CONFIG_TEXTSEARCH_FSM=m
+CONFIG_PLIST=y

Added: dists/sid/linux-2.6/debian/config/arm/defines
==============================================================================
--- (empty file)
+++ dists/sid/linux-2.6/debian/config/arm/defines	Mon Nov 26 20:06:56 2007
@@ -0,0 +1,31 @@
+[base]
+flavours:
+ footbridge
+ iop32x
+ ixp4xx
+kernel-arch: arm
+kernel-header-dirs: arm
+
+[image]
+suggests: fdutils
+type: kernel-package
+
+[footbridge_image]
+suggests: nwutil
+
+[footbridge_base]
+class: Footbridge based
+longclass: Footbridge (CATS, Netwinder)
+
+[iop32x_base]
+class: IOP32x
+longclass: IOP32x based (Thecus N2100, etc)
+
+[ixp4xx_base]
+class: IXP4xx
+longclass: IXP4xx based (Linksys NSLU2, etc)
+
+[versatile_base]
+class: Versatile
+longclass: Versatile (PB, AB, Qemu)
+

Added: dists/sid/linux-2.6/debian/config/armel/config
==============================================================================
--- (empty file)
+++ dists/sid/linux-2.6/debian/config/armel/config	Mon Nov 26 20:06:56 2007
@@ -0,0 +1,22 @@
+CONFIG_ARM=y
+# CONFIG_GENERIC_TIME is not set
+# CONFIG_CIFS_EXPERIMENTAL is not set
+CONFIG_SLIP_SMART=y
+CONFIG_SUNRPC_GSS=m
+# CONFIG_SMB_NLS_DEFAULT is not set
+# CONFIG_CODA_FS_OLD_API is not set
+CONFIG_CIFS_STATS=y
+CONFIG_CIFS_XATTR=y
+# CONFIG_SLIP_MODE_SLIP6 is not set
+CONFIG_SLIP_COMPRESSED=y
+CONFIG_ECONET_AUNUDP=y
+# CONFIG_CIFS_POSIX is not set
+CONFIG_ECONET_NATIVE=y
+CONFIG_EQUALIZER=m
+CONFIG_CC_OPTIMIZE_FOR_SIZE=y
+# CONFIG_IPW2100 is not set
+CONFIG_JBD=y
+# CONFIG_ARCH_REALVIEW is not set
+CONFIG_TMPFS=y
+CONFIG_AEABI=y
+CONFIG_OABI_COMPAT=y

Added: dists/sid/linux-2.6/debian/config/armel/defines
==============================================================================
--- (empty file)
+++ dists/sid/linux-2.6/debian/config/armel/defines	Mon Nov 26 20:06:56 2007
@@ -0,0 +1,32 @@
+[base]
+flavours:
+ iop32x
+ ixp4xx
+ versatile
+kernel-arch: arm
+kernel-header-dirs: arm
+
+[image]
+suggests: fdutils
+type: kernel-package
+
+[iop32x_base]
+class: IOP32x
+longclass: IOP32x based (Thecus N2100, etc)
+
+[iop32x_image]
+configs: arm/config.iop32x
+
+[ixp4xx_base]
+class: IXP4xx
+longclass: IXP4xx based (Linksys NSLU2, etc)
+
+[ixp4xx_image]
+configs: arm/config.ixp4xx
+
+[versatile_base]
+class: Versatile
+longclass: Versatile (PB, AB, Qemu)
+
+[versatile_image]
+configs: arm/config.versatile

Added: dists/sid/linux-2.6/debian/config/config
==============================================================================
--- (empty file)
+++ dists/sid/linux-2.6/debian/config/config	Mon Nov 26 20:06:56 2007
@@ -0,0 +1,1942 @@
+#
+# Debian toplevel config
+#
+
+#
+# General setup
+#
+CONFIG_EXPERIMENTAL=y
+CONFIG_LOCALVERSION=""
+# CONFIG_LOCALVERSION_AUTO is not set
+CONFIG_SWAP=y
+CONFIG_SYSVIPC=y
+CONFIG_POSIX_MQUEUE=y
+CONFIG_BSD_PROCESS_ACCT=y
+CONFIG_BSD_PROCESS_ACCT_V3=y
+# CONFIG_TASKSTATS is not set
+# CONFIG_USER_NS is not set
+CONFIG_AUDIT=y
+# CONFIG_AUDITSYSCALL is not set
+# CONFIG_IKCONFIG is not set
+# TODO: too large for small systems?
+CONFIG_LOG_BUF_SHIFT=17
+CONFIG_CPUSETS=y
+CONFIG_SYSFS_DEPRECATED=y
+CONFIG_BLK_DEV_INITRD=y
+CONFIG_INITRAMFS_SOURCE=""
+CONFIG_CC_OPTIMIZE_FOR_SIZE=y
+# CONFIG_EMBEDDED is not set
+CONFIG_SLAB=y
+# CONFIG_SLUB is not set
+# CONFIG_SLOB is not set
+# CONFIG_BLK_DEV_BSG is not set
+
+#
+# Loadable module support
+#
+CONFIG_MODULES=y
+CONFIG_MODULE_UNLOAD=y
+CONFIG_MODULE_FORCE_UNLOAD=y
+CONFIG_MODVERSIONS=y
+# CONFIG_MODULE_SRCVERSION_ALL is not set
+CONFIG_KMOD=y
+
+#
+# Block layer
+#
+CONFIG_LBD=y
+CONFIG_BLK_DEV_IO_TRACE=y
+CONFIG_LSF=y
+
+#
+# IO Schedulers
+#
+CONFIG_IOSCHED_NOOP=y
+CONFIG_IOSCHED_AS=y
+CONFIG_IOSCHED_DEADLINE=y
+CONFIG_IOSCHED_CFQ=y
+# CONFIG_DEFAULT_AS is not set
+# CONFIG_DEFAULT_DEADLINE is not set
+CONFIG_DEFAULT_CFQ=y
+# CONFIG_DEFAULT_NOOP is not set
+CONFIG_DEFAULT_IOSCHED="cfq"
+
+#
+# Processor type and features
+#
+# TODO: wrong location? arch specific
+CONFIG_GENERIC_CALIBRATE_DELAY=y
+CONFIG_PREEMPT_NONE=y
+# CONFIG_PREEMPT_VOLUNTARY is not set
+# CONFIG_PREEMPT is not set
+# CONFIG_PREEMPT_BKL is not set
+
+#
+# Firmware Drivers
+#
+CONFIG_SELECT_MEMORY_MODEL=y
+CONFIG_FLATMEM=y
+# CONFIG_SPARSEMEM_STATIC is not set
+# CONFIG_SECCOMP is not set
+# CONFIG_HZ_100 is not set
+CONFIG_HZ_250=y
+# CONFIG_HZ_1000 is not set
+CONFIG_HZ=250
+# CONFIG_CRASH_DUMP is not set
+
+#
+# Executable file formats
+#
+CONFIG_BINFMT_ELF=y
+CONFIG_BINFMT_MISC=m
+
+#
+# Networking
+#
+CONFIG_NET=y
+
+#
+# Networking options
+#
+CONFIG_PACKET=y
+CONFIG_PACKET_MMAP=y
+CONFIG_UNIX=y
+CONFIG_XFRM=y
+CONFIG_XFRM_USER=m
+# CONFIG_XFRM_SUB_POLICY is not set
+# CONFIG_XFRM_MIGRATE is not set
+CONFIG_NET_KEY=m
+# CONFIG_NET_KEY_MIGRATE is not set
+CONFIG_INET=y
+CONFIG_IP_MULTICAST=y
+CONFIG_IP_ADVANCED_ROUTER=y
+CONFIG_ASK_IP_FIB_HASH=y
+# CONFIG_IP_FIB_TRIE is not set
+CONFIG_IP_FIB_HASH=y
+CONFIG_IP_MULTIPLE_TABLES=y
+CONFIG_IP_ROUTE_MULTIPATH=y
+CONFIG_IP_ROUTE_VERBOSE=y
+# CONFIG_IP_PNP is not set
+CONFIG_NET_IPIP=m
+CONFIG_IP_MROUTE=y
+CONFIG_IP_PIMSM_V1=y
+CONFIG_IP_PIMSM_V2=y
+# CONFIG_ARPD is not set
+CONFIG_SYN_COOKIES=y
+CONFIG_INET_AH=m
+CONFIG_INET_ESP=m
+CONFIG_INET_IPCOMP=m
+CONFIG_INET_XFRM_TUNNEL=m
+CONFIG_INET_TUNNEL=m
+CONFIG_INET_XFRM_MODE_TRANSPORT=m
+CONFIG_INET_XFRM_MODE_TUNNEL=m
+CONFIG_INET_XFRM_MODE_BEET=m
+CONFIG_INET_DIAG=m
+CONFIG_INET_TCP_DIAG=m
+CONFIG_TCP_CONG_ADVANCED=y
+CONFIG_TCP_CONG_BIC=y
+CONFIG_TCP_CONG_CUBIC=m
+CONFIG_TCP_CONG_WESTWOOD=m
+CONFIG_TCP_CONG_HTCP=m
+CONFIG_TCP_CONG_HSTCP=m
+CONFIG_TCP_CONG_HYBLA=m
+CONFIG_TCP_CONG_VEGAS=m
+CONFIG_TCP_CONG_SCALABLE=m
+CONFIG_TCP_CONG_YEAH=m
+CONFIG_TCP_CONG_ILLINOIS=m
+CONFIG_DEFAULT_BIC=y
+# CONFIG_DEFAULT_CUBIC is not set
+# CONFIG_DEFAULT_HTCP is not set
+# CONFIG_DEFAULT_VEGAS is not set
+# CONFIG_DEFAULT_WESTWOOD is not set
+# CONFIG_DEFAULT_RENO is not set
+CONFIG_DEFAULT_TCP_CONG="bic"
+# CONFIG_TCP_MD5SIG is not set
+CONFIG_NET_IPGRE=m
+CONFIG_NET_IPGRE_BROADCAST=y
+CONFIG_IP_VS=m
+# CONFIG_IP_VS_DEBUG is not set
+CONFIG_IP_VS_TAB_BITS=12
+
+#
+# IPVS transport protocol load balancing support
+#
+CONFIG_IP_VS_PROTO_TCP=y
+CONFIG_IP_VS_PROTO_UDP=y
+CONFIG_IP_VS_PROTO_ESP=y
+CONFIG_IP_VS_PROTO_AH=y
+
+#
+# IPVS scheduler
+#
+CONFIG_IP_VS_RR=m
+CONFIG_IP_VS_WRR=m
+CONFIG_IP_VS_LC=m
+CONFIG_IP_VS_WLC=m
+CONFIG_IP_VS_LBLC=m
+CONFIG_IP_VS_LBLCR=m
+CONFIG_IP_VS_DH=m
+CONFIG_IP_VS_SH=m
+CONFIG_IP_VS_SED=m
+CONFIG_IP_VS_NQ=m
+
+#
+# IPVS application helper
+#
+CONFIG_IP_VS_FTP=m
+CONFIG_IPV6=m
+CONFIG_IPV6_PRIVACY=y
+# CONFIG_IPV6_ROUTER_PREF is not set
+# CONFIG_IPV6_OPTIMISTIC_DAD is not set
+CONFIG_INET6_AH=m
+CONFIG_INET6_ESP=m
+CONFIG_INET6_IPCOMP=m
+# CONFIG_IPV6_MIP6 is not set
+CONFIG_INET6_XFRM_TUNNEL=m
+CONFIG_INET6_TUNNEL=m
+CONFIG_INET6_XFRM_MODE_TRANSPORT=m
+CONFIG_INET6_XFRM_MODE_TUNNEL=m
+CONFIG_INET6_XFRM_MODE_BEET=m
+CONFIG_INET6_XFRM_MODE_ROUTEOPTIMIZATION=m
+CONFIG_IPV6_SIT=m
+CONFIG_IPV6_TUNNEL=m
+CONFIG_IPV6_MULTIPLE_TABLES=y
+CONFIG_IPV6_SUBTREES=y
+# CONFIG_NETLABEL is not set
+CONFIG_NETWORK_SECMARK=y
+CONFIG_NETFILTER=y
+# CONFIG_NETFILTER_DEBUG is not set
+CONFIG_BRIDGE_NETFILTER=y
+
+#
+# Core Netfilter Configuration
+#
+CONFIG_NETFILTER_NETLINK=m
+CONFIG_NETFILTER_NETLINK_QUEUE=m
+CONFIG_NETFILTER_NETLINK_LOG=m
+CONFIG_NF_CONNTRACK_ENABLED=m
+CONFIG_NF_CONNTRACK=m
+CONFIG_NF_CT_ACCT=y
+CONFIG_NF_CONNTRACK_MARK=y
+CONFIG_NF_CONNTRACK_SECMARK=y
+CONFIG_NF_CONNTRACK_EVENTS=y
+CONFIG_NF_CT_PROTO_GRE=m
+CONFIG_NF_CT_PROTO_SCTP=m
+CONFIG_NF_CT_PROTO_UDPLITE=m
+CONFIG_NF_CONNTRACK_AMANDA=m
+CONFIG_NF_CONNTRACK_FTP=m
+CONFIG_NF_CONNTRACK_H323=m
+CONFIG_NF_CONNTRACK_IRC=m
+CONFIG_NF_CONNTRACK_NETBIOS_NS=m
+CONFIG_NF_CONNTRACK_PPTP=m
+CONFIG_NF_CONNTRACK_SANE=m
+CONFIG_NF_CONNTRACK_SIP=m
+CONFIG_NF_CONNTRACK_TFTP=m
+CONFIG_NF_CT_NETLINK=m
+CONFIG_NETFILTER_XTABLES=m
+CONFIG_NETFILTER_XT_TARGET_CLASSIFY=m
+CONFIG_NETFILTER_XT_TARGET_CONNMARK=m
+CONFIG_NETFILTER_XT_TARGET_DSCP=m
+CONFIG_NETFILTER_XT_TARGET_MARK=m
+CONFIG_NETFILTER_XT_TARGET_NFQUEUE=m
+CONFIG_NETFILTER_XT_TARGET_NFLOG=m
+CONFIG_NETFILTER_XT_TARGET_NOTRACK=m
+CONFIG_NETFILTER_XT_TARGET_TRACE=m
+CONFIG_NETFILTER_XT_TARGET_SECMARK=m
+CONFIG_NETFILTER_XT_TARGET_CONNSECMARK=m
+CONFIG_NETFILTER_XT_TARGET_TCPMSS=m
+CONFIG_NETFILTER_XT_MATCH_COMMENT=m
+CONFIG_NETFILTER_XT_MATCH_CONNBYTES=m
+CONFIG_NETFILTER_XT_MATCH_CONNLIMIT=m
+CONFIG_NETFILTER_XT_MATCH_CONNMARK=m
+CONFIG_NETFILTER_XT_MATCH_CONNTRACK=m
+CONFIG_NETFILTER_XT_MATCH_DCCP=m
+CONFIG_NETFILTER_XT_MATCH_DSCP=m
+CONFIG_NETFILTER_XT_MATCH_ESP=m
+CONFIG_NETFILTER_XT_MATCH_HELPER=m
+CONFIG_NETFILTER_XT_MATCH_LENGTH=m
+CONFIG_NETFILTER_XT_MATCH_LIMIT=m
+CONFIG_NETFILTER_XT_MATCH_MAC=m
+CONFIG_NETFILTER_XT_MATCH_MARK=m
+CONFIG_NETFILTER_XT_MATCH_POLICY=m
+CONFIG_NETFILTER_XT_MATCH_MULTIPORT=m
+CONFIG_NETFILTER_XT_MATCH_PHYSDEV=m
+CONFIG_NETFILTER_XT_MATCH_PKTTYPE=m
+CONFIG_NETFILTER_XT_MATCH_QUOTA=m
+CONFIG_NETFILTER_XT_MATCH_REALM=m
+CONFIG_NETFILTER_XT_MATCH_SCTP=m
+CONFIG_NETFILTER_XT_MATCH_STATE=m
+CONFIG_NETFILTER_XT_MATCH_STATISTIC=m
+CONFIG_NETFILTER_XT_MATCH_STRING=m
+CONFIG_NETFILTER_XT_MATCH_TCPMSS=m
+CONFIG_NETFILTER_XT_MATCH_U32=m
+CONFIG_NETFILTER_XT_MATCH_HASHLIMIT=m
+
+#
+# IP: Netfilter Configuration
+#
+CONFIG_NF_CONNTRACK_IPV4=m
+CONFIG_NF_CONNTRACK_PROC_COMPAT=y
+CONFIG_IP_NF_QUEUE=m
+CONFIG_IP_NF_IPTABLES=m
+CONFIG_IP_NF_MATCH_IPRANGE=m
+CONFIG_IP_NF_MATCH_TOS=m
+CONFIG_IP_NF_MATCH_RECENT=m
+CONFIG_IP_NF_MATCH_ECN=m
+CONFIG_IP_NF_MATCH_AH=m
+CONFIG_IP_NF_MATCH_TTL=m
+CONFIG_IP_NF_MATCH_OWNER=m
+CONFIG_IP_NF_MATCH_ADDRTYPE=m
+CONFIG_IP_NF_FILTER=m
+CONFIG_IP_NF_TARGET_REJECT=m
+CONFIG_IP_NF_TARGET_LOG=m
+CONFIG_IP_NF_TARGET_ULOG=m
+CONFIG_NF_NAT=m
+CONFIG_NF_NAT_NEEDED=y
+CONFIG_IP_NF_TARGET_MASQUERADE=m
+CONFIG_IP_NF_TARGET_REDIRECT=m
+CONFIG_IP_NF_TARGET_NETMAP=m
+CONFIG_IP_NF_TARGET_SAME=m
+CONFIG_NF_NAT_SNMP_BASIC=m
+CONFIG_NF_NAT_PROTO_GRE=m
+CONFIG_NF_NAT_FTP=m
+CONFIG_NF_NAT_IRC=m
+CONFIG_NF_NAT_TFTP=m
+CONFIG_NF_NAT_AMANDA=m
+CONFIG_NF_NAT_PPTP=m
+CONFIG_NF_NAT_H323=m
+CONFIG_NF_NAT_SIP=m
+CONFIG_IP_NF_MANGLE=m
+CONFIG_IP_NF_TARGET_TOS=m
+CONFIG_IP_NF_TARGET_ECN=m
+CONFIG_IP_NF_TARGET_TTL=m
+CONFIG_IP_NF_TARGET_CLUSTERIP=m
+CONFIG_IP_NF_RAW=m
+CONFIG_IP_NF_ARPTABLES=m
+CONFIG_IP_NF_ARPFILTER=m
+CONFIG_IP_NF_ARP_MANGLE=m
+
+#
+# IPv6: Netfilter Configuration (EXPERIMENTAL)
+#
+CONFIG_NF_CONNTRACK_IPV6=m
+CONFIG_IP6_NF_QUEUE=m
+CONFIG_IP6_NF_IPTABLES=m
+CONFIG_IP6_NF_MATCH_RT=m
+CONFIG_IP6_NF_MATCH_OPTS=m
+CONFIG_IP6_NF_MATCH_FRAG=m
+CONFIG_IP6_NF_MATCH_HL=m
+CONFIG_IP6_NF_MATCH_OWNER=m
+CONFIG_IP6_NF_MATCH_IPV6HEADER=m
+CONFIG_IP6_NF_MATCH_AH=m
+CONFIG_IP6_NF_MATCH_MH=m
+CONFIG_IP6_NF_MATCH_EUI64=m
+CONFIG_IP6_NF_FILTER=m
+CONFIG_IP6_NF_TARGET_LOG=m
+CONFIG_IP6_NF_TARGET_REJECT=m
+CONFIG_IP6_NF_MANGLE=m
+CONFIG_IP6_NF_TARGET_HL=m
+CONFIG_IP6_NF_RAW=m
+
+#
+# DECnet: Netfilter Configuration
+#
+CONFIG_DECNET_NF_GRABULATOR=m
+
+#
+# Bridge: Netfilter Configuration
+#
+CONFIG_BRIDGE_NF_EBTABLES=m
+CONFIG_BRIDGE_EBT_BROUTE=m
+CONFIG_BRIDGE_EBT_T_FILTER=m
+CONFIG_BRIDGE_EBT_T_NAT=m
+CONFIG_BRIDGE_EBT_802_3=m
+CONFIG_BRIDGE_EBT_AMONG=m
+CONFIG_BRIDGE_EBT_ARP=m
+CONFIG_BRIDGE_EBT_IP=m
+CONFIG_BRIDGE_EBT_LIMIT=m
+CONFIG_BRIDGE_EBT_MARK=m
+CONFIG_BRIDGE_EBT_PKTTYPE=m
+CONFIG_BRIDGE_EBT_STP=m
+CONFIG_BRIDGE_EBT_VLAN=m
+CONFIG_BRIDGE_EBT_ARPREPLY=m
+CONFIG_BRIDGE_EBT_DNAT=m
+CONFIG_BRIDGE_EBT_MARK_T=m
+CONFIG_BRIDGE_EBT_REDIRECT=m
+CONFIG_BRIDGE_EBT_SNAT=m
+CONFIG_BRIDGE_EBT_LOG=m
+CONFIG_BRIDGE_EBT_ULOG=m
+CONFIG_IP_DCCP=m
+CONFIG_INET_DCCP_DIAG=m
+CONFIG_IP_DCCP_ACKVEC=y
+
+#
+# DCCP CCIDs Configuration (EXPERIMENTAL)
+#
+CONFIG_IP_DCCP_CCID2=m
+# CONFIG_IP_DCCP_CCID2_DEBUG is not set
+CONFIG_IP_DCCP_CCID3=m
+CONFIG_IP_DCCP_TFRC_LIB=m
+# CONFIG_IP_DCCP_CCID3_DEBUG is not set
+CONFIG_IP_DCCP_CCID3_RTO=100
+
+#
+# DCCP Kernel Hacking
+#
+# CONFIG_IP_DCCP_DEBUG is not set
+CONFIG_IP_SCTP=m
+# CONFIG_SCTP_DBG_MSG is not set
+# CONFIG_SCTP_DBG_OBJCNT is not set
+# CONFIG_SCTP_HMAC_NONE is not set
+# CONFIG_SCTP_HMAC_SHA1 is not set
+CONFIG_SCTP_HMAC_MD5=y
+CONFIG_TIPC=m
+CONFIG_TIPC_ADVANCED=y
+CONFIG_TIPC_ZONES=3
+CONFIG_TIPC_CLUSTERS=1
+CONFIG_TIPC_NODES=255
+CONFIG_TIPC_SLAVE_NODES=0
+CONFIG_TIPC_PORTS=8191
+CONFIG_TIPC_LOG=0
+# CONFIG_TIPC_DEBUG is not set
+CONFIG_VLAN_8021Q=m
+
+#
+# QoS and/or fair queueing
+#
+CONFIG_NET_SCHED=y
+CONFIG_NET_SCH_FIFO=y
+
+#
+# Queueing/Scheduling
+#
+CONFIG_NET_SCH_CBQ=m
+CONFIG_NET_SCH_HTB=m
+CONFIG_NET_SCH_HFSC=m
+CONFIG_NET_SCH_ATM=m
+CONFIG_NET_SCH_PRIO=m
+CONFIG_NET_SCH_RR=m
+CONFIG_NET_SCH_RED=m
+CONFIG_NET_SCH_SFQ=m
+CONFIG_NET_SCH_TEQL=m
+CONFIG_NET_SCH_TBF=m
+CONFIG_NET_SCH_GRED=m
+CONFIG_NET_SCH_DSMARK=m
+CONFIG_NET_SCH_NETEM=m
+CONFIG_NET_SCH_INGRESS=m
+
+#
+# Classification
+#
+CONFIG_NET_CLS=y
+CONFIG_NET_CLS_BASIC=m
+CONFIG_NET_CLS_TCINDEX=m
+CONFIG_NET_CLS_ROUTE4=m
+CONFIG_NET_CLS_ROUTE=y
+CONFIG_NET_CLS_FW=m
+CONFIG_NET_CLS_U32=m
+CONFIG_CLS_U32_PERF=y
+CONFIG_CLS_U32_MARK=y
+CONFIG_NET_CLS_RSVP=m
+CONFIG_NET_CLS_RSVP6=m
+CONFIG_NET_EMATCH=y
+CONFIG_NET_EMATCH_STACK=32
+CONFIG_NET_EMATCH_CMP=m
+CONFIG_NET_EMATCH_NBYTE=m
+CONFIG_NET_EMATCH_U32=m
+CONFIG_NET_EMATCH_META=m
+CONFIG_NET_EMATCH_TEXT=m
+CONFIG_NET_CLS_ACT=y
+CONFIG_NET_ACT_POLICE=m
+CONFIG_NET_ACT_GACT=m
+CONFIG_GACT_PROB=y
+CONFIG_NET_ACT_MIRRED=m
+CONFIG_NET_ACT_IPT=m
+CONFIG_NET_ACT_PEDIT=m
+CONFIG_NET_ACT_SIMP=m
+CONFIG_NET_CLS_POLICE=n
+CONFIG_NET_CLS_IND=y
+
+#
+# Network testing
+#
+CONFIG_NET_PKTGEN=m
+
+#
+# AX.25 network device drivers
+#
+CONFIG_MKISS=m
+CONFIG_6PACK=m
+
+#
+# Wireless
+#
+CONFIG_CFG80211=m
+CONFIG_MAC80211=m
+CONFIG_MAC80211_LEDS=y
+# CONFIG_MAC80211_DEBUGFS is not set
+# CONFIG_MAC80211_DEBUG is not set
+CONFIG_IEEE80211=m
+CONFIG_IEEE80211_CRYPT_WEP=m
+CONFIG_IEEE80211_CRYPT_CCMP=m
+CONFIG_IEEE80211_CRYPT_TKIP=m
+CONFIG_IEEE80211_SOFTMAC=m
+# CONFIG_IEEE80211_DEBUG is not set
+CONFIG_RFKILL=m
+CONFIG_RFKILL_INPUT=m
+CONFIG_NET_9P=m
+CONFIG_NET_9P_DEBUG=n
+
+#
+# Device Drivers
+#
+
+#
+# Generic Driver Options
+#
+CONFIG_PREVENT_FIRMWARE_BUILD=y
+CONFIG_FW_LOADER=m
+# CONFIG_DEBUG_DEVRES is not set
+
+#
+# Connector - unified userspace <-> kernelspace linker
+#
+CONFIG_CONNECTOR=m
+CONFIG_MTD_PLATRAM=m
+CONFIG_MTD_ONENAND_VERIFY_WRITE=y
+CONFIG_MTD_ONENAND=m
+CONFIG_MTD_M25P80=m
+CONFIG_MTD_DATAFLASH=m
+# CONFIG_MTD_ONENAND_OTP is not set
+# CONFIG_MTD_NAND_ECC_SMC is not set
+# CONFIG_MTD_NAND_MUSEUM_IDS is not set
+CONFIG_MTD_NAND_CS553X=m
+CONFIG_MTD_BLKDEVS=m
+# CONFIG_MTD_ESB2ROM is not set
+# CONFIG_MTD_CK804XROM is not set
+CONFIG_MTD_NAND_CAFE=m
+CONFIG_MTD_UBI=m
+CONFIG_MTD_UBI_WL_THRESHOLD=4096
+CONFIG_MTD_UBI_BEB_RESERVE=1
+CONFIG_MTD_UBI_GLUEBI=n
+# CONFIG_MTD_UBI_DEBUG is not set
+
+#
+# Parallel port support
+#
+CONFIG_PARPORT=m
+CONFIG_PARPORT_PC=m
+CONFIG_PARPORT_SERIAL=m
+CONFIG_PARPORT_PC_FIFO=y
+# CONFIG_PARPORT_PC_SUPERIO is not set
+CONFIG_PARPORT_PC_PCMCIA=m
+# CONFIG_PARPORT_GSC is not set
+CONFIG_PARPORT_AX88796=m
+CONFIG_PARPORT_1284=y
+CONFIG_PARPORT_NOT_PC=y
+
+#
+# Protocols
+#
+CONFIG_BLK_DEV=y
+
+#
+# Parallel IDE protocol modules
+#
+# CONFIG_BLK_DEV_COW_COMMON is not set
+CONFIG_BLK_DEV_RAM=y
+CONFIG_BLK_DEV_RAM_COUNT=16
+CONFIG_MISC_DEVICES=y
+
+#
+# SCSI device support
+#
+CONFIG_RAID_ATTRS=m
+CONFIG_SCSI=m
+CONFIG_SCSI_TGT=m
+CONFIG_SCSI_NETLINK=y
+CONFIG_SCSI_PROC_FS=y
+
+#
+# SCSI support type (disk, tape, CD-ROM)
+#
+CONFIG_BLK_DEV_SD=m
+CONFIG_CHR_DEV_ST=m
+CONFIG_CHR_DEV_OSST=m
+CONFIG_BLK_DEV_SR=m
+CONFIG_BLK_DEV_SR_VENDOR=y
+CONFIG_CHR_DEV_SG=m
+CONFIG_CHR_DEV_SCH=m
+
+#
+# Some SCSI devices (e.g. CD jukebox) support multiple LUNs
+#
+CONFIG_SCSI_MULTI_LUN=y
+CONFIG_SCSI_CONSTANTS=y
+CONFIG_SCSI_LOGGING=y
+CONFIG_SCSI_SCAN_ASYNC=y
+
+#
+# SCSI Transports
+#
+CONFIG_SCSI_SPI_ATTRS=m
+CONFIG_SCSI_FC_ATTRS=m
+CONFIG_SCSI_ISCSI_ATTRS=m
+CONFIG_SCSI_SAS_ATTRS=m
+CONFIG_SCSI_SAS_LIBSAS=m
+CONFIG_SCSI_SAS_ATA=y
+# CONFIG_SCSI_SAS_LIBSAS_DEBUG is not set
+CONFIG_SCSI_LOWLEVEL=y
+CONFIG_ISCSI_TCP=m
+CONFIG_BLK_DEV_3W_XXXX_RAID=m
+CONFIG_SCSI_3W_9XXX=m
+CONFIG_SCSI_7000FASST=m
+CONFIG_SCSI_ACARD=m
+CONFIG_SCSI_AHA152X=m
+CONFIG_SCSI_AHA1542=m
+CONFIG_SCSI_AHA1740=m
+CONFIG_SCSI_AACRAID=m
+CONFIG_SCSI_AIC7XXX=m
+CONFIG_AIC7XXX_CMDS_PER_DEVICE=32
+CONFIG_AIC7XXX_RESET_DELAY_MS=15000
+CONFIG_AIC7XXX_DEBUG_ENABLE=y
+CONFIG_AIC7XXX_DEBUG_MASK=0
+CONFIG_AIC7XXX_REG_PRETTY_PRINT=y
+CONFIG_SCSI_AIC7XXX_OLD=m
+CONFIG_SCSI_AIC79XX=m
+CONFIG_AIC79XX_CMDS_PER_DEVICE=32
+CONFIG_AIC79XX_RESET_DELAY_MS=15000
+CONFIG_AIC79XX_DEBUG_ENABLE=y
+CONFIG_AIC79XX_DEBUG_MASK=0
+CONFIG_AIC79XX_REG_PRETTY_PRINT=y
+CONFIG_SCSI_AIC94XX=m
+# CONFIG_AIC94XX_DEBUG is not set
+CONFIG_MEGARAID_SAS=m
+CONFIG_SCSI_STEX=m
+CONFIG_SCSI_SYM53C8XX_MMIO=y
+# CONFIG_SCSI_IPR is not set
+CONFIG_SCSI_HPTIOP=m
+CONFIG_SCSI_QLA_FC=m
+CONFIG_SCSI_QLA_ISCSI=m
+CONFIG_SCSI_SRP=m
+
+#
+# Multi-device support (RAID and LVM)
+#
+CONFIG_MD=y
+CONFIG_BLK_DEV_MD=m
+CONFIG_MD_LINEAR=m
+CONFIG_MD_RAID0=m
+CONFIG_MD_RAID1=m
+CONFIG_MD_RAID10=m
+CONFIG_MD_RAID456=m
+CONFIG_MD_RAID5_RESHAPE=y
+CONFIG_MD_MULTIPATH=m
+CONFIG_MD_FAULTY=m
+CONFIG_BLK_DEV_DM=m
+# CONFIG_DM_DEBUG is not set
+CONFIG_DM_CRYPT=m
+CONFIG_DM_SNAPSHOT=m
+CONFIG_DM_MIRROR=m
+CONFIG_DM_ZERO=m
+CONFIG_DM_MULTIPATH=m
+CONFIG_DM_MULTIPATH_EMC=m
+CONFIG_DM_MULTIPATH_RDAC=m
+CONFIG_DM_DELAY=m
+
+#
+# Fusion MPT device support
+#
+CONFIG_FUSION=y
+CONFIG_FUSION_SPI=m
+CONFIG_FUSION_FC=m
+CONFIG_FUSION_SAS=m
+CONFIG_FUSION_MAX_SGE=40
+CONFIG_FUSION_CTL=m
+CONFIG_FUSION_LAN=m
+
+#
+# IEEE 1394 (FireWire) support
+#
+CONFIG_FIREWIRE=m
+CONFIG_FIREWIRE_OHCI=m
+CONFIG_FIREWIRE_SBP2=m
+# CONFIG_IEEE1394 is not set
+
+#
+# USB Serial Converter support
+#
+CONFIG_USB_SERIAL=m
+CONFIG_USB_SERIAL_GENERIC=y
+CONFIG_USB_SERIAL_AIRCABLE=m
+CONFIG_USB_SERIAL_AIRPRIME=m
+CONFIG_USB_SERIAL_ARK3116=m
+CONFIG_USB_SERIAL_BELKIN=m
+# !Firmware!
+# CONFIG_USB_SERIAL_WHITEHEAT is not set
+CONFIG_USB_SERIAL_DIGI_ACCELEPORT=m
+CONFIG_USB_SERIAL_CP2101=m
+CONFIG_USB_SERIAL_CYPRESS_M8=m
+CONFIG_USB_SERIAL_EMPEG=m
+CONFIG_USB_SERIAL_FTDI_SIO=m
+CONFIG_USB_SERIAL_FUNSOFT=m
+CONFIG_USB_SERIAL_VISOR=m
+CONFIG_USB_SERIAL_IPAQ=m
+CONFIG_USB_SERIAL_IR=m
+# !Firmware!
+# CONFIG_USB_SERIAL_EDGEPORT is not set
+# !Firmware!
+# CONFIG_USB_SERIAL_EDGEPORT_TI is not set
+CONFIG_USB_SERIAL_GARMIN=m
+CONFIG_USB_SERIAL_IPW=m
+CONFIG_USB_SERIAL_KEYSPAN_PDA=m
+# !Firmware!
+# CONFIG_USB_SERIAL_KEYSPAN is not set
+CONFIG_USB_SERIAL_KLSI=m
+CONFIG_USB_SERIAL_KOBIL_SCT=m
+CONFIG_USB_SERIAL_MCT_U232=m
+CONFIG_USB_SERIAL_MOS7720=m
+CONFIG_USB_SERIAL_MOS7840=m
+CONFIG_USB_SERIAL_NAVMAN=m
+CONFIG_USB_SERIAL_PL2303=m
+CONFIG_USB_SERIAL_HP4X=m
+CONFIG_USB_SERIAL_SAFE=m
+# CONFIG_USB_SERIAL_SAFE_PADDED is not set
+CONFIG_USB_SERIAL_SIERRAWIRELESS=m
+# !Firmware!
+# CONFIG_USB_SERIAL_TI is not set
+CONFIG_USB_SERIAL_CYBERJACK=m
+CONFIG_USB_SERIAL_XIRCOM=m
+CONFIG_USB_SERIAL_OPTION=m
+CONFIG_USB_SERIAL_OMNINET=m
+CONFIG_USB_SERIAL_DEBUG=m
+
+#
+# USB Miscellaneous drivers
+#
+CONFIG_USB_ADUTUX=m
+CONFIG_USB_BERRY_CHARGE=m
+CONFIG_USB_CYPRESS_CY7C63=m
+CONFIG_USB_PHIDGET=m
+CONFIG_USB_PHIDGETMOTORCONTROL=m
+CONFIG_USB_FTDI_ELAN=m
+CONFIG_USB_APPLEDISPLAY=m
+CONFIG_USB_SISUSBVGA_CON=y
+CONFIG_USB_LD=m
+CONFIG_USB_TRANCEVIBRATOR=m
+CONFIG_USB_IOWARRIOR=m
+
+CONFIG_NETDEVICES=y
+# CONFIG_NETDEVICES_MULTIQUEUE is not set
+CONFIG_BONDING=m
+# CONFIG_MACVLAN is not set
+CONFIG_EQUALIZER=m
+CONFIG_TUN=m
+CONFIG_NET_ETHERNET=y
+CONFIG_UNIX98_PTYS=y
+
+#
+# Partition Types
+#
+CONFIG_PARTITION_ADVANCED=y
+CONFIG_MSDOS_PARTITION=y
+CONFIG_KARMA_PARTITION=y
+# CONFIG_SYSV68_PARTITION is not set
+
+#
+# Kernel hacking
+#
+CONFIG_TRACE_IRQFLAGS_SUPPORT=y
+# CONFIG_PRINTK_TIME is not set
+CONFIG_ENABLE_MUST_CHECK=y
+CONFIG_MAGIC_SYSRQ=y
+CONFIG_UNUSED_SYMBOLS=y
+CONFIG_DEBUG_FS=y
+# CONFIG_HEADERS_CHECK is not set
+# CONFIG_DEBUG_KERNEL is not set
+# CONFIG_DEBUG_RT_MUTEXES is not set
+# CONFIG_RT_MUTEX_TESTER is not set
+# CONFIG_DEBUG_MUTEXES is not set
+# CONFIG_DEBUG_LOCK_ALLOC is not set
+# CONFIG_PROVE_LOCKING is not set
+# CONFIG_DEBUG_LOCKING_API_SELFTESTS is not set
+CONFIG_DEBUG_BUGVERBOSE=y
+# CONFIG_SCHEDSTATS is not set
+# CONFIG_DEBUG_VM is not set
+# CONFIG_DEBUG_LIST is not set
+# CONFIG_FORCED_INLINING is not set
+# CONFIG_RCU_TORTURE_TEST is not set
+CONFIG_EARLY_PRINTK=y
+# CONFIG_DEBUG_STACKOVERFLOW is not set
+# CONFIG_DEBUG_STACK_USAGE is not set
+
+#
+# Cryptographic options
+#
+CONFIG_CRYPTO=y
+CONFIG_CRYPTO_ALGAPI=y
+CONFIG_CRYPTO_BLKCIPHER=m
+CONFIG_CRYPTO_HASH=y
+CONFIG_CRYPTO_MANAGER=y
+CONFIG_CRYPTO_HMAC=y
+CONFIG_CRYPTO_XCBC=m
+CONFIG_CRYPTO_NULL=m
+CONFIG_CRYPTO_MD4=m
+CONFIG_CRYPTO_MD5=y
+CONFIG_CRYPTO_SHA1=m
+CONFIG_CRYPTO_SHA256=m
+CONFIG_CRYPTO_SHA512=m
+CONFIG_CRYPTO_WP512=m
+CONFIG_CRYPTO_TGR192=m
+CONFIG_CRYPTO_GF128MUL=m
+CONFIG_CRYPTO_ECB=m
+CONFIG_CRYPTO_CBC=m
+CONFIG_CRYPTO_PCBC=m
+CONFIG_CRYPTO_LRW=m
+# CONFIG_CRYPTO_CRYPTD is not set
+CONFIG_CRYPTO_DES=m
+CONFIG_CRYPTO_FCRYPT=m
+CONFIG_CRYPTO_BLOWFISH=m
+CONFIG_CRYPTO_TWOFISH=m
+CONFIG_CRYPTO_TWOFISH_COMMON=m
+CONFIG_CRYPTO_SERPENT=m
+CONFIG_CRYPTO_AES=m
+CONFIG_CRYPTO_CAST5=m
+CONFIG_CRYPTO_CAST6=m
+CONFIG_CRYPTO_TEA=m
+CONFIG_CRYPTO_ARC4=m
+CONFIG_CRYPTO_KHAZAD=m
+CONFIG_CRYPTO_ANUBIS=m
+CONFIG_CRYPTO_DEFLATE=m
+CONFIG_CRYPTO_MICHAEL_MIC=m
+CONFIG_CRYPTO_CRC32C=m
+CONFIG_CRYPTO_CAMELLIA=m
+CONFIG_CRYPTO_TEST=m
+CONFIG_CRYPTO_HW=y
+
+#
+# Hardware crypto devices
+#
+CONFIG_CRYPTO_DEV_PADLOCK=m
+CONFIG_CRYPTO_DEV_PADLOCK_SHA=m
+CONFIG_CRYPTO_DEV_PADLOCK_AES=m
+
+#
+## Library routines
+#
+CONFIG_BITREVERSE=y
+CONFIG_CRC_ITU_T=m
+CONFIG_CRC7=m
+CONFIG_LIBCRC32C=m
+CONFIG_AUDIT_GENERIC=y
+CONFIG_ZLIB_INFLATE=y
+CONFIG_ZLIB_DEFLATE=m
+CONFIG_TEXTSEARCH=y
+CONFIG_TEXTSEARCH_KMP=m
+CONFIG_TEXTSEARCH_BM=m
+CONFIG_TEXTSEARCH_FSM=m
+CONFIG_PLIST=y
+
+CONFIG_TCG_TPM=m
+CONFIG_TCG_TIS=m
+CONFIG_TCG_NSC=m
+CONFIG_TCG_ATMEL=m
+CONFIG_SERIAL_8250_ACCENT=m
+CONFIG_NFSD_V2_ACL=y
+CONFIG_I2O_EXT_ADAPTEC=y
+CONFIG_USB_CXACRU=m
+CONFIG_BLK_DEV_IT821X=m
+# CONFIG_BLK_DEV_JMICRON is not set
+CONFIG_DRM_VIA=m
+CONFIG_SND_HDSPM=m
+CONFIG_SND_USB_CAIAQ=m
+CONFIG_SND_USB_CAIAQ_INPUT=y
+CONFIG_SND_PORTMAN2X4=m
+CONFIG_SND_CS5530=m
+# CONFIG_HWMON_DEBUG_CHIP is not set
+CONFIG_USB_GADGET_SELECTED=y
+CONFIG_USB_ISP116X_HCD=m
+CONFIG_SERIAL_8250_HUB6=m
+CONFIG_SERIAL_8250_MCA=m
+CONFIG_I2O_BUS=m
+CONFIG_SERIAL_8250_BOCA=m
+
+#
+# I2C Hardware Bus support
+#
+CONFIG_I2C_OCORES=m
+CONFIG_I2C_SIMTEC=m
+CONFIG_I2C_TINY_USB=m
+CONFIG_I2C_TAOS_EVM=m
+
+#
+# Miscellaneous I2C Chip support
+#
+CONFIG_SENSORS_DS1374=m
+CONFIG_DS1682=m
+CONFIG_SENSORS_MAX6875=m
+CONFIG_SENSORS_PCA9539=m
+CONFIG_SENSORS_TSL2550=m
+
+#
+# SPI support
+#
+CONFIG_SPI=y
+# CONFIG_SPI_DEBUG is not set
+CONFIG_SPI_MASTER=y
+
+#
+# SPI Master Controller Drivers
+#
+CONFIG_SPI_BITBANG=m
+CONFIG_SPI_BUTTERFLY=m
+CONFIG_SPI_LM70_LLP=m
+
+#
+# SPI Protocol Masters
+#
+CONFIG_SPI_AT25=m
+# CONFIG_SPI_SPIDEV is not set
+CONFIG_SPI_TLE62X0=m
+
+#
+# Dallas's 1-wire bus
+#
+CONFIG_W1=m
+CONFIG_W1_CON=y
+
+#
+# 1-wire Bus Masters
+#
+CONFIG_W1_MASTER_MATROX=m
+CONFIG_W1_MASTER_DS2490=m
+CONFIG_W1_MASTER_DS2482=m
+
+#
+# 1-wire Slaves
+#
+CONFIG_W1_SLAVE_THERM=m
+CONFIG_W1_SLAVE_SMEM=m
+CONFIG_W1_SLAVE_DS2433=m
+# CONFIG_W1_SLAVE_DS2433_CRC is not set
+CONFIG_W1_SLAVE_DS2760=m
+CONFIG_HWMON=y
+CONFIG_HWMON_VID=m
+CONFIG_SENSORS_ABITUGURU=m
+CONFIG_SENSORS_ABITUGURU3=m
+CONFIG_SENSORS_AD7418=m
+CONFIG_SENSORS_ADM1029=m
+CONFIG_SENSORS_ADM9240=m
+CONFIG_SENSORS_ATXP1=m
+CONFIG_SENSORS_F75375S=m
+CONFIG_SENSORS_CORETEMP=m
+CONFIG_SENSORS_LM70=m
+CONFIG_SENSORS_LM93=m
+CONFIG_SENSORS_MAX6650=m
+CONFIG_SENSORS_PC87427=m
+CONFIG_SENSORS_DME1737=m
+CONFIG_SENSORS_SMSC47M192=m
+CONFIG_SENSORS_THMC50=m
+CONFIG_SENSORS_VT1211=m
+CONFIG_SENSORS_VT8231=m
+CONFIG_SENSORS_W83791D=m
+CONFIG_SENSORS_W83792D=m
+CONFIG_SENSORS_W83793=m
+CONFIG_SENSORS_W83627EHF=m
+CONFIG_SENSORS_APPLESMC=m
+
+#
+# Multifunction device drivers
+#
+CONFIG_MFD_SM501=m
+
+#
+# Multimedia devices
+#
+CONFIG_VIDEO_DEV=m
+CONFIG_VIDEO_V4L1=y
+CONFIG_VIDEO_V4L1_COMPAT=y
+CONFIG_VIDEO_V4L2=y
+CONFIG_VIDEO_CAPTURE_DRIVERS=y
+# CONFIG_VIDEO_ADV_DEBUG is not set
+CONFIG_VIDEO_HELPER_CHIPS_AUTO=y
+CONFIG_VIDEO_TVAUDIO=m
+CONFIG_VIDEO_TDA7432=m
+CONFIG_VIDEO_TDA9840=m
+CONFIG_VIDEO_TDA9875=m
+CONFIG_VIDEO_TEA6415C=m
+CONFIG_VIDEO_TEA6420=m
+CONFIG_VIDEO_MSP3400=m
+CONFIG_VIDEO_CS53L32A=m
+CONFIG_VIDEO_TLV320AIC23B=m
+CONFIG_VIDEO_WM8775=m
+CONFIG_VIDEO_WM8739=m
+CONFIG_VIDEO_BT819=m
+CONFIG_VIDEO_BT856=m
+CONFIG_VIDEO_KS0127=m
+CONFIG_VIDEO_OV7670=m
+CONFIG_VIDEO_SAA7110=m
+CONFIG_VIDEO_SAA7111=m
+CONFIG_VIDEO_SAA7114=m
+CONFIG_VIDEO_SAA711X=m
+CONFIG_VIDEO_TVP5150=m
+CONFIG_VIDEO_VPX3220=m
+CONFIG_VIDEO_CX25840=m
+CONFIG_VIDEO_CX2341X=m
+CONFIG_VIDEO_SAA7127=m
+CONFIG_VIDEO_SAA7185=m
+CONFIG_VIDEO_ADV7170=m
+CONFIG_VIDEO_ADV7175=m
+CONFIG_VIDEO_UPD64031A=m
+CONFIG_VIDEO_UPD64083=m
+CONFIG_VIDEO_VIVI=m
+CONFIG_VIDEO_BT848=m
+CONFIG_VIDEO_BT848_DVB=y
+CONFIG_VIDEO_SAA6588=m
+CONFIG_VIDEO_PMS=m
+CONFIG_VIDEO_BWQCAM=m
+CONFIG_VIDEO_CQCAM=m
+CONFIG_VIDEO_W9966=m
+CONFIG_VIDEO_CPIA=m
+CONFIG_VIDEO_CPIA_PP=m
+CONFIG_VIDEO_CPIA_USB=m
+CONFIG_VIDEO_CPIA2=m
+CONFIG_VIDEO_SAA5246A=m
+CONFIG_VIDEO_SAA5249=m
+CONFIG_TUNER_3036=m
+CONFIG_VIDEO_STRADIS=m
+CONFIG_TUNER_TEA5761=y
+CONFIG_VIDEO_ZORAN_ZR36060=m
+CONFIG_VIDEO_ZORAN=m
+CONFIG_VIDEO_ZORAN_BUZ=m
+CONFIG_VIDEO_ZORAN_DC10=m
+CONFIG_VIDEO_ZORAN_DC30=m
+CONFIG_VIDEO_ZORAN_LML33=m
+CONFIG_VIDEO_ZORAN_LML33R10=m
+CONFIG_VIDEO_ZORAN_AVS6EYES=m
+CONFIG_VIDEO_MEYE=m
+CONFIG_VIDEO_SAA7134=m
+CONFIG_VIDEO_SAA7134_ALSA=m
+CONFIG_VIDEO_SAA7134_OSS=m
+CONFIG_VIDEO_SAA7134_DVB=m
+CONFIG_VIDEO_MXB=m
+CONFIG_VIDEO_DPC=m
+CONFIG_VIDEO_HEXIUM_ORION=m
+CONFIG_VIDEO_HEXIUM_GEMINI=m
+CONFIG_VIDEO_CX88=m
+CONFIG_VIDEO_CX88_ALSA=m
+CONFIG_VIDEO_CX88_BLACKBIRD=m
+CONFIG_VIDEO_CX88_DVB=m
+CONFIG_VIDEO_CX88_VP3054=m
+CONFIG_VIDEO_IVTV=m
+CONFIG_VIDEO_CAFE_CCIC=m
+CONFIG_V4L_USB_DRIVERS=y
+CONFIG_VIDEO_PVRUSB2=m
+CONFIG_VIDEO_PVRUSB2_24XXX=y
+CONFIG_VIDEO_PVRUSB2_29XXX=y
+CONFIG_VIDEO_PVRUSB2_SYSFS=y
+# CONFIG_VIDEO_PVRUSB2_DEBUGIFC is not set
+CONFIG_VIDEO_EM28XX=m
+CONFIG_VIDEO_USBVISION=m
+CONFIG_VIDEO_USBVIDEO=m
+CONFIG_VIDEO_OVCAMCHIP=m
+CONFIG_USB_ZR364XX=m
+CONFIG_RADIO_ADAPTERS=y
+CONFIG_DVB_CORE_ATTACH=y
+CONFIG_DVB_CAPTURE_DRIVERS=y
+
+#
+# Supported SAA7146 based PCI Adapters
+#
+CONFIG_DVB_AV7110=m
+CONFIG_DVB_AV7110_OSD=y
+CONFIG_DVB_BUDGET=m
+CONFIG_DVB_BUDGET_CI=m
+CONFIG_DVB_BUDGET_AV=m
+CONFIG_DVB_BUDGET_PATCH=m
+
+#
+# Supported USB Adapters
+#
+CONFIG_DVB_USB=m
+# CONFIG_DVB_USB_DEBUG is not set
+CONFIG_DVB_USB_A800=m
+CONFIG_DVB_USB_DIBUSB_MB=m
+CONFIG_DVB_USB_DIBUSB_MB_FAULTY=y
+CONFIG_DVB_USB_DIBUSB_MC=m
+CONFIG_DVB_USB_DIB0700=m
+CONFIG_DVB_USB_UMT_010=m
+CONFIG_DVB_USB_CXUSB=m
+CONFIG_DVB_USB_M920X=m
+CONFIG_DVB_USB_GL861=m
+CONFIG_DVB_USB_AU6610=m
+CONFIG_DVB_USB_DIGITV=m
+CONFIG_DVB_USB_VP7045=m
+CONFIG_DVB_USB_VP702X=m
+CONFIG_DVB_USB_GP8PSK=m
+CONFIG_DVB_USB_NOVA_T_USB2=m
+CONFIG_DVB_USB_TTUSB2=m
+CONFIG_DVB_USB_DTT200U=m
+CONFIG_DVB_USB_OPERA1=m
+CONFIG_DVB_USB_AF9005=m
+CONFIG_DVB_USB_AF9005_REMOTE=m
+CONFIG_DVB_TTUSB_BUDGET=m
+CONFIG_DVB_TTUSB_DEC=m
+CONFIG_DVB_CINERGYT2=m
+# CONFIG_DVB_CINERGYT2_TUNING is not set
+
+#
+# Supported FlexCopII (B2C2) Adapters
+#
+CONFIG_DVB_B2C2_FLEXCOP=m
+CONFIG_DVB_B2C2_FLEXCOP_PCI=m
+CONFIG_DVB_B2C2_FLEXCOP_USB=m
+# CONFIG_DVB_B2C2_FLEXCOP_DEBUG is not set
+
+#
+# Supported BT878 Adapters
+#
+CONFIG_DVB_BT8XX=m
+
+#
+# Supported Pluto2 Adapters
+#
+CONFIG_DVB_PLUTO2=m
+
+#
+# Customise DVB Frontends
+#
+# CONFIG_DVB_FE_CUSTOMISE is not set
+
+#
+# DVB-S (satellite) frontends
+#
+CONFIG_DVB_STV0299=m
+CONFIG_DVB_CX24110=m
+CONFIG_DVB_CX24123=m
+CONFIG_DVB_TDA8083=m
+CONFIG_DVB_MT312=m
+CONFIG_DVB_VES1X93=m
+CONFIG_DVB_S5H1420=m
+CONFIG_DVB_TDA10086=m
+
+#
+# DVB-T (terrestrial) frontends
+#
+CONFIG_DVB_SP8870=m
+CONFIG_DVB_SP887X=m
+CONFIG_DVB_CX22700=m
+CONFIG_DVB_CX22702=m
+CONFIG_DVB_L64781=m
+CONFIG_DVB_TDA1004X=m
+CONFIG_DVB_NXT6000=m
+CONFIG_DVB_MT352=m
+CONFIG_DVB_ZL10353=m
+CONFIG_DVB_DIB3000MB=m
+CONFIG_DVB_DIB3000MC=m
+CONFIG_DVB_DIB7000M=m
+CONFIG_DVB_DIB7000P=m
+
+#
+# DVB-C (cable) frontends
+#
+CONFIG_DVB_VES1820=m
+CONFIG_DVB_TDA10021=m
+CONFIG_DVB_TDA10023=m
+CONFIG_DVB_STV0297=m
+
+#
+# ATSC (North American/Korean Terrestrial/Cable DTV) frontends
+#
+CONFIG_DVB_NXT200X=m
+CONFIG_DVB_OR51211=m
+CONFIG_DVB_OR51132=m
+CONFIG_DVB_BCM3510=m
+CONFIG_DVB_LGDT330X=m
+
+#
+# Tuners/PLL support
+#
+CONFIG_DVB_PLL=m
+CONFIG_DVB_TDA826X=m
+CONFIG_DVB_TDA827X=m
+CONFIG_DVB_TUNER_QT1010=m
+CONFIG_DVB_TUNER_MT2060=m
+
+#
+# Miscellaneous devices
+#
+CONFIG_DVB_LNBP21=m
+CONFIG_DVB_ISL6421=m
+CONFIG_DVB_TUA6100=m
+
+#
+# Graphics support
+#
+CONFIG_BACKLIGHT_LCD_SUPPORT=y
+# CONFIG_LCD_CLASS_DEVICE is not set
+
+#
+# Display device support
+#
+CONFIG_DISPLAY_SUPPORT=m
+
+#
+# Display hardware drivers
+#
+CONFIG_FIRMWARE_EDID=y
+CONFIG_FB_DDC=m
+CONFIG_FB_CFB_FILLRECT=y
+CONFIG_FB_CFB_COPYAREA=y
+
+#
+# Frame buffer hardware drivers
+#
+CONFIG_FB_ARC=m
+# CONFIG_FB_NVIDIA_DEBUG is not set
+# CONFIG_FB_INTEL_DEBUG is not set
+CONFIG_FB_INTEL_I2C=y
+CONFIG_FB_S3=m
+CONFIG_FB_VT8623=m
+CONFIG_FB_CYBLA=m
+CONFIG_FB_ARK=m
+CONFIG_FB_PM3=m
+CONFIG_FB_SM501=m
+
+#
+# InfiniBand support
+#
+CONFIG_INFINIBAND=m
+CONFIG_INFINIBAND_USER_MAD=m
+CONFIG_INFINIBAND_USER_ACCESS=m
+CONFIG_INFINIBAND_ADDR_TRANS=y
+CONFIG_INFINIBAND_MTHCA=m
+CONFIG_INFINIBAND_MTHCA_DEBUG=y
+CONFIG_INFINIBAND_AMSO1100=m
+# CONFIG_INFINIBAND_AMSO1100_DEBUG is not set
+CONFIG_INFINIBAND_IPATH=m
+CONFIG_INFINIBAND_CXGB3=m
+# CONFIG_INFINIBAND_CXGB3_DEBUG is not set
+CONFIG_MLX4_INFINIBAND=m
+CONFIG_INFINIBAND_IPOIB=m
+# CONFIG_INFINIBAND_IPOIB_CM is not set
+CONFIG_INFINIBAND_IPOIB_DEBUG=y
+# CONFIG_INFINIBAND_IPOIB_DEBUG_DATA is not set
+CONFIG_INFINIBAND_SRP=m
+CONFIG_INFINIBAND_ISER=m
+
+#
+# Real Time Clock
+#
+CONFIG_RTC_CLASS=m
+
+#
+## RTC interfaces
+#
+CONFIG_RTC_INTF_SYSFS=y
+CONFIG_RTC_INTF_PROC=y
+CONFIG_RTC_INTF_DEV=y
+# CONFIG_RTC_INTF_DEV_UIE_EMUL is not set
+# CONFIG_RTC_DRV_TEST is not set
+
+#
+# I2C RTC drivers
+#
+CONFIG_RTC_DRV_DS1307=m
+CONFIG_RTC_DRV_DS1672=m
+CONFIG_RTC_DRV_MAX6900=m
+CONFIG_RTC_DRV_RS5C372=m
+CONFIG_RTC_DRV_ISL1208=m
+CONFIG_RTC_DRV_X1205=m
+CONFIG_RTC_DRV_PCF8563=m
+CONFIG_RTC_DRV_PCF8583=m
+CONFIG_RTC_DRV_M41T80=m
+# CONFIG_RTC_DRV_M41T80_WDT is not set
+
+#
+# SPI RTC drivers
+#
+CONFIG_RTC_DRV_RS5C348=m
+CONFIG_RTC_DRV_MAX6902=m
+
+#
+# Platform RTC drivers
+#
+CONFIG_RTC_DRV_CMOS=m
+CONFIG_RTC_DRV_DS1553=m
+CONFIG_RTC_DRV_DS1742=m
+CONFIG_RTC_DRV_M48T86=m
+CONFIG_RTC_DRV_V3020=m
+
+CONFIG_USB_XUSBATM=m
+CONFIG_PCMCIA_LOAD_CIS=y
+CONFIG_SERIAL_8250_FOURPORT=m
+CONFIG_NFS_ACL_SUPPORT=m
+CONFIG_PCMCIA_IOCTL=y
+CONFIG_TCG_INFINEON=m
+# CONFIG_REISERFS_CHECK is not set
+CONFIG_USB_MON=y
+
+CONFIG_KEYS=y
+# CONFIG_KEYS_DEBUG_PROC_KEYS is not set
+CONFIG_SECURITY=y
+CONFIG_SECURITY_CAPABILITIES=y
+# CONFIG_SECURITY_ROOTPLUG is not set
+CONFIG_SECURITY_SELINUX=y
+CONFIG_SECURITY_SELINUX_BOOTPARAM=y
+CONFIG_SECURITY_SELINUX_BOOTPARAM_VALUE=0
+CONFIG_SECURITY_SELINUX_DISABLE=y
+CONFIG_SECURITY_SELINUX_DEVELOP=y
+CONFIG_SECURITY_SELINUX_AVC_STATS=y
+CONFIG_SECURITY_SELINUX_CHECKREQPROT_VALUE=1
+
+# CONFIG_BLK_DEV_IDESCSI is not set
+CONFIG_LXT_PHY=m
+CONFIG_FUSE_FS=m
+CONFIG_VIDEO_SELECT=y
+CONFIG_CRC16=m
+CONFIG_SIS190=m
+CONFIG_SND_AD1889=m
+CONFIG_DAVICOM_PHY=m
+CONFIG_9P_FS=m
+CONFIG_CASSINI=m
+CONFIG_USB_STORAGE_ONETOUCH=y
+CONFIG_DRM_SAVAGE=m
+CONFIG_PHYLIB=m
+CONFIG_MARVELL_PHY=m
+CONFIG_FLAT_NODE_MEM_MAP=y
+# CONFIG_LOCALVERSION_AUTO is not set
+CONFIG_DETECT_SOFTLOCKUP=y
+CONFIG_CICADA_PHY=m
+CONFIG_QSEMI_PHY=m
+CONFIG_SND_SEQ_RTCTIMER_DEFAULT=y
+CONFIG_I2O_CONFIG_OLD_IOCTL=y
+CONFIG_SND_RAWMIDI=m
+CONFIG_PCMCIA_PROBE=y
+# CONFIG_EXT2_FS_XIP is not set
+CONFIG_I2O_EXT_ADAPTEC_DMA64=y
+# CONFIG_NET_POCKET is not set
+CONFIG_MII=m
+CONFIG_SECURITY_NETWORK=y
+CONFIG_XFS_QUOTA=y
+# CONFIG_JFFS2_SUMMARY is not set
+CONFIG_PPP_MPPE=m
+CONFIG_PPPOL2TP=m
+CONFIG_FRAMEBUFFER_CONSOLE_ROTATION=y
+CONFIG_RFD_FTL=m
+CONFIG_TELCLOCK=m
+CONFIG_CARDMAN_4000=m
+CONFIG_CARDMAN_4040=m
+CONFIG_ATM_DUMMY=m
+CONFIG_SYNCLINK_GT=m
+CONFIG_DEV_APPLETALK=m
+CONFIG_USB_UEAGLEATM=m
+CONFIG_TOUCHSCREEN_ADS7846=m
+CONFIG_YENTA_TOSHIBA=y
+CONFIG_INPUT_ATI_REMOTE=m
+CONFIG_INPUT_ATI_REMOTE2=m
+CONFIG_INPUT_KEYSPAN_REMOTE=m
+CONFIG_INPUT_POWERMATE=m
+CONFIG_INPUT_YEALINK=m
+# CONFIG_INPUT_POLLDEV is not set
+# CONFIG_MOUSE_PS2_TOUCHKIT is not set
+CONFIG_SECURITY_NETWORK_XFRM=y
+CONFIG_YENTA_RICOH=y
+CONFIG_YENTA_ENE_TUNE=y
+CONFIG_SBC_EPX_C3_WATCHDOG=m
+# CONFIG_SND_DYNAMIC_MINORS is not set
+# CONFIG_USB_HIDINPUT_POWERBOOK is not set
+CONFIG_YENTA_O2=y
+CONFIG_SND_PCXHR=m
+CONFIG_IFB=m
+# CONFIG_USB_LIBUSUAL is not set
+CONFIG_CONFIGFS_FS=m
+CONFIG_USB_STORAGE_ALAUDA=y
+CONFIG_YENTA_TI=y
+# CONFIG_SLOB is not set
+CONFIG_SND_SUPPORT_OLD_API=y
+CONFIG_OCFS2_FS=m
+CONFIG_I2O_LCT_NOTIFY_ON_CHANGES=y
+CONFIG_SLAB=y
+CONFIG_USB_ET61X251=m
+CONFIG_AMD8111E_NAPI=y
+CONFIG_R8169_NAPI=y
+CONFIG_ADAPTEC_STARFIRE_NAPI=y
+# CONFIG_GIGASET_UNDOCREQ is not set
+CONFIG_MMC_SDHCI=m
+# CONFIG_MMC_UNSAFE_RESUME is not set
+CONFIG_SND_PCM_OSS_PLUGINS=y
+CONFIG_RTC_LIB=m
+CONFIG_GIGASET_BASE=m
+CONFIG_NEW_LEDS=y
+CONFIG_SND_RIPTIDE=m
+# CONFIG_VGACON_SOFT_SCROLLBACK is not set
+CONFIG_USB_ZC0301=m
+CONFIG_LEDS_TRIGGER_IDE_DISK=y
+CONFIG_LEDS_TRIGGER_TIMER=m
+CONFIG_USB_ARCH_HAS_EHCI=y
+CONFIG_LEDS_CLASS=m
+# CONFIG_USB_GADGET_AT91 is not set
+CONFIG_GIGASET_M105=m
+CONFIG_GIGASET_M101=m
+CONFIG_ISDN_DRV_GIGASET=m
+CONFIG_TOIM3232_DONGLE=m
+CONFIG_SND_VERBOSE_PROCFS=y
+# CONFIG_GIGASET_DEBUG is not set
+CONFIG_WIRELESS_EXT=y
+CONFIG_LEDS_TRIGGERS=y
+CONFIG_SND_ALS300=m
+# CONFIG_IEEE80211_SOFTMAC_DEBUG is not set
+CONFIG_SND_PDAUDIOCF=m
+CONFIG_SND_VXPOCKET=m
+CONFIG_DEFCONFIG_LIST="/lib/modules/$UNAME_RELEASE/.config"
+CONFIG_DMA_ENGINE=y
+# CONFIG_UFS_DEBUG is not set
+# CONFIG_USB_PWC_DEBUG is not set
+CONFIG_SND_INDIGOIO=m
+# CONFIG_FIXED_MII_10_FDX is not set
+# CONFIG_FIXED_MII_100_FDX is not set
+CONFIG_BLK_DEV_RAM_BLOCKSIZE=1024
+# CONFIG_FB_BACKLIGHT is not set
+CONFIG_PC8736x_GPIO=m
+CONFIG_NSC_GPIO=m
+# CONFIG_SECURITY_SELINUX_ENABLE_SECMARK_DEFAULT is not set
+CONFIG_SND_INDIGO=m
+CONFIG_TCP_CONG_VENO=m
+CONFIG_NET_DMA=y
+CONFIG_UIO=m
+CONFIG_UIO_CIF=m
+CONFIG_TCP_CONG_LP=m
+CONFIG_W1_CON=y
+CONFIG_INOTIFY_USER=y
+CONFIG_ACPI_DOCK=m
+CONFIG_SMSC_PHY=m
+CONFIG_USB_QUICKCAM_MESSENGER=m
+CONFIG_OCFS2_DEBUG_MASKLOG=y
+CONFIG_LEDS_TRIGGER_HEARTBEAT=m
+CONFIG_SND_GINA20=m
+CONFIG_VITESSE_PHY=m
+CONFIG_SND_GINA24=m
+# CONFIG_VT_HW_CONSOLE_BINDING is not set
+CONFIG_SND_DARLA20=m
+CONFIG_SND_DARLA24=m
+
+#
+# Tulip family network device support
+#
+CONFIG_TULIP_NAPI=y
+CONFIG_TULIP_NAPI_HW_MITIGATION=y
+CONFIG_ULI526X=m
+CONFIG_VIA_RHINE_NAPI=y
+CONFIG_SC92031=m
+CONFIG_NETDEV_1000=y
+CONFIG_ACENIC=m
+# CONFIG_ACENIC_OMIT_TIGON_I is not set
+CONFIG_E1000_NAPI=y
+# CONFIG_E1000_DISABLE_PACKET_SPLIT is not set
+CONFIG_E1000E=m
+CONFIG_SKGE=m
+CONFIG_SKY2=m
+# CONFIG_SKY2_DEBUG is not set
+CONFIG_QLA3XXX=m
+CONFIG_ATL1=m
+CONFIG_NETDEV_10000=y
+CONFIG_CHELSIO_T1_NAPI=y
+CONFIG_CHELSIO_T1=m
+CONFIG_CHELSIO_T1_1G=y
+CONFIG_CHELSIO_T3=m
+CONFIG_IXGB_NAPI=y
+CONFIG_S2IO_NAPI=y
+CONFIG_MYRI10GE=m
+
+#
+# Token Ring devices
+#
+CONFIG_TR=y
+CONFIG_IBMTR=m
+CONFIG_IBMOL=m
+CONFIG_IBMLS=m
+CONFIG_TMS380TR=m
+CONFIG_TMSPCI=m
+CONFIG_SKISA=m
+CONFIG_PROTEON=m
+CONFIG_ABYSS=m
+# CONFIG_SMCTR is not set
+
+#
+# Wireless LAN
+#
+CONFIG_IPW2200=m
+CONFIG_IPW2200_MONITOR=y
+CONFIG_IPW2200_RADIOTAP=y
+CONFIG_IPW2200_PROMISCUOUS=y
+CONFIG_IPW2200_QOS=y
+# CONFIG_IPW2200_DEBUG is not set
+CONFIG_LIBERTAS=m
+CONFIG_LIBERTAS_USB=m
+# CONFIG_LIBERTAS_DEBUG is not set
+CONFIG_AIRO=m
+CONFIG_NORTEL_HERMES=m
+CONFIG_PCMCIA_SPECTRUM=m
+CONFIG_RTL8187=m
+CONFIG_IWLWIFI=y
+# CONFIG_IWLWIFI_DEBUG is not set
+CONFIG_IWLWIFI_SENSITIVITY=y
+CONFIG_IWLWIFI_SPECTRUM_MEASUREMENT=y
+CONFIG_IWLWIFI_QOS=y
+CONFIG_IWL4965=m
+CONFIG_IWL3945=m
+CONFIG_HOSTAP=m
+CONFIG_HOSTAP_FIRMWARE=y
+# CONFIG_HOSTAP_FIRMWARE_NVRAM is not set
+CONFIG_HOSTAP_PCI=m
+CONFIG_HOSTAP_CS=m
+CONFIG_HOSTAP_PLX=m
+CONFIG_BCM43XX=m
+CONFIG_BCM43XX_DEBUG=y
+CONFIG_BCM43XX_DMA=y
+CONFIG_BCM43XX_PIO=y
+CONFIG_BCM43XX_DMA_AND_PIO_MODE=y
+# CONFIG_BCM43XX_DMA_MODE is not set
+# CONFIG_BCM43XX_PIO_MODE is not set
+CONFIG_ZD1211RW=m
+# CONFIG_ZD1211RW_DEBUG is not set
+
+#
+# USB Network Adapters
+#
+CONFIG_USB_USBNET_MII=m
+CONFIG_USB_NET_AX8817X=m
+CONFIG_USB_NET_CDCETHER=m
+CONFIG_USB_NET_DM9601=m
+CONFIG_USB_NET_MCS7830=m
+CONFIG_USB_NET_GL620A=m
+CONFIG_USB_NET_NET1080=m
+CONFIG_USB_NET_PLUSB=m
+CONFIG_USB_NET_RNDIS_HOST=m
+CONFIG_USB_NET_CDC_SUBSET=m
+CONFIG_USB_KC2190=y
+CONFIG_USB_NET_ZAURUS=m
+CONFIG_HDLC=m
+CONFIG_HDLC_RAW=m
+CONFIG_HDLC_RAW_ETH=m
+CONFIG_HDLC_CISCO=m
+CONFIG_HDLC_FR=m
+CONFIG_HDLC_PPP=m
+CONFIG_HDLC_X25=m
+
+#
+# File systems
+#
+CONFIG_EXT2_FS=m
+CONFIG_EXT2_FS_XATTR=y
+CONFIG_EXT2_FS_POSIX_ACL=y
+CONFIG_EXT2_FS_SECURITY=y
+# CONFIG_EXT2_FS_XIP is not set
+CONFIG_EXT3_FS=m
+CONFIG_EXT3_FS_XATTR=y
+CONFIG_EXT3_FS_POSIX_ACL=y
+CONFIG_EXT3_FS_SECURITY=y
+CONFIG_EXT4DEV_FS=m
+CONFIG_EXT4DEV_FS_XATTR=y
+CONFIG_EXT4DEV_FS_POSIX_ACL=y
+CONFIG_EXT4DEV_FS_SECURITY=y
+# CONFIG_JBD_DEBUG is not set
+# CONFIG_JBD2_DEBUG is not set
+CONFIG_REISERFS_FS=m
+# CONFIG_REISERFS_CHECK is not set
+# CONFIG_REISERFS_PROC_INFO is not set
+CONFIG_REISERFS_FS_XATTR=y
+CONFIG_REISERFS_FS_POSIX_ACL=y
+CONFIG_REISERFS_FS_SECURITY=y
+CONFIG_JFS_FS=m
+CONFIG_JFS_POSIX_ACL=y
+CONFIG_JFS_SECURITY=y
+# CONFIG_JFS_DEBUG is not set
+# CONFIG_JFS_STATISTICS is not set
+CONFIG_XFS_FS=m
+CONFIG_XFS_QUOTA=y
+CONFIG_XFS_SECURITY=y
+CONFIG_XFS_POSIX_ACL=y
+CONFIG_XFS_RT=y
+CONFIG_GFS2_FS=m
+CONFIG_GFS2_FS_LOCKING_NOLOCK=m
+CONFIG_GFS2_FS_LOCKING_DLM=m
+CONFIG_OCFS2_FS=m
+CONFIG_OCFS2_DEBUG_MASKLOG=y
+CONFIG_MINIX_FS=m
+CONFIG_ROMFS_FS=m
+CONFIG_INOTIFY=y
+CONFIG_INOTIFY_USER=y
+CONFIG_QUOTA=y
+CONFIG_QFMT_V1=m
+CONFIG_QFMT_V2=m
+CONFIG_DNOTIFY=y
+CONFIG_AUTOFS_FS=m
+CONFIG_AUTOFS4_FS=m
+CONFIG_FUSE_FS=m
+
+#
+# CD-ROM/DVD Filesystems
+#
+CONFIG_ISO9660_FS=m
+CONFIG_JOLIET=y
+CONFIG_ZISOFS=y
+CONFIG_UDF_FS=m
+
+#
+# DOS/FAT/NT Filesystems
+#
+CONFIG_FAT_FS=m
+CONFIG_MSDOS_FS=m
+CONFIG_VFAT_FS=m
+CONFIG_FAT_DEFAULT_CODEPAGE=437
+CONFIG_FAT_DEFAULT_IOCHARSET="iso8859-1"
+CONFIG_NTFS_FS=m
+# CONFIG_NTFS_DEBUG is not set
+CONFIG_NTFS_RW=y
+
+#
+# Pseudo filesystems
+#
+CONFIG_PROC_KCORE=y
+CONFIG_TMPFS=y
+CONFIG_TMPFS_POSIX_ACL=y
+CONFIG_HUGETLBFS=y
+CONFIG_RAMFS=y
+CONFIG_CONFIGFS_FS=m
+
+#
+# Miscellaneous filesystems
+#
+CONFIG_ADFS_FS=m
+# CONFIG_ADFS_FS_RW is not set
+CONFIG_AFFS_FS=m
+CONFIG_ECRYPT_FS=m
+CONFIG_HFS_FS=m
+CONFIG_HFSPLUS_FS=m
+CONFIG_BEFS_FS=m
+# CONFIG_BEFS_DEBUG is not set
+CONFIG_BFS_FS=m
+CONFIG_EFS_FS=m
+CONFIG_JFFS2_FS=m
+CONFIG_JFFS2_FS_DEBUG=0
+CONFIG_JFFS2_FS_WRITEBUFFER=y
+# CONFIG_JFFS2_FS_WBUF_VERIFY is not set
+# CONFIG_JFFS2_SUMMARY is not set
+CONFIG_JFFS2_FS_XATTR=y
+CONFIG_JFFS2_FS_POSIX_ACL=y
+CONFIG_JFFS2_FS_SECURITY=y
+# CONFIG_JFFS2_COMPRESSION_OPTIONS is not set
+CONFIG_CRAMFS=m
+CONFIG_VXFS_FS=m
+CONFIG_HPFS_FS=m
+CONFIG_QNX4FS_FS=m
+CONFIG_SYSV_FS=m
+CONFIG_UFS_FS=m
+# CONFIG_UFS_FS_WRITE is not set
+# CONFIG_UFS_DEBUG is not set
+
+#
+# Network File Systems
+#
+CONFIG_NFS_FS=m
+CONFIG_NFS_V3=y
+CONFIG_NFS_V3_ACL=y
+CONFIG_NFS_V4=y
+# CONFIG_NFS_DIRECTIO is not set
+CONFIG_NFSD=m
+CONFIG_NFSD_V3=y
+CONFIG_NFSD_V3_ACL=y
+CONFIG_NFSD_V4=y
+CONFIG_NFSD_TCP=y
+CONFIG_SUNRPC_BIND34=y
+CONFIG_RPCSEC_GSS_KRB5=m
+CONFIG_RPCSEC_GSS_SPKM3=m
+CONFIG_SMB_FS=m
+CONFIG_SMB_NLS_DEFAULT=y
+CONFIG_SMB_NLS_REMOTE="iso8859-1"
+CONFIG_CIFS=m
+# CONFIG_CIFS_STATS is not set
+# CONFIG_CIFS_WEAK_PW_HASH is not set
+CONFIG_CIFS_XATTR=y
+CONFIG_CIFS_POSIX=y
+# CONFIG_CIFS_DEBUG2 is not set
+# CONFIG_CIFS_EXPERIMENTAL is not set
+CONFIG_NCP_FS=m
+# CONFIG_NCPFS_PACKET_SIGNING is not set
+# CONFIG_NCPFS_IOCTL_LOCKING is not set
+# CONFIG_NCPFS_STRONG is not set
+CONFIG_NCPFS_NFS_NS=y
+CONFIG_NCPFS_OS2_NS=y
+# CONFIG_NCPFS_SMALLDOS is not set
+CONFIG_NCPFS_NLS=y
+CONFIG_NCPFS_EXTRAS=y
+CONFIG_CODA_FS=m
+# CONFIG_CODA_FS_OLD_API is not set
+CONFIG_AFS_FS=m
+# CONFIG_AFS_DEBUG is not set
+CONFIG_9P_FS=m
+
+#
+# Native Language Support
+#
+CONFIG_NLS=y
+CONFIG_NLS_DEFAULT="iso8859-1"
+CONFIG_NLS_CODEPAGE_437=m
+CONFIG_NLS_CODEPAGE_737=m
+CONFIG_NLS_CODEPAGE_775=m
+CONFIG_NLS_CODEPAGE_850=m
+CONFIG_NLS_CODEPAGE_852=m
+CONFIG_NLS_CODEPAGE_855=m
+CONFIG_NLS_CODEPAGE_857=m
+CONFIG_NLS_CODEPAGE_860=m
+CONFIG_NLS_CODEPAGE_861=m
+CONFIG_NLS_CODEPAGE_862=m
+CONFIG_NLS_CODEPAGE_863=m
+CONFIG_NLS_CODEPAGE_864=m
+CONFIG_NLS_CODEPAGE_865=m
+CONFIG_NLS_CODEPAGE_866=m
+CONFIG_NLS_CODEPAGE_869=m
+CONFIG_NLS_CODEPAGE_936=m
+CONFIG_NLS_CODEPAGE_950=m
+CONFIG_NLS_CODEPAGE_932=m
+CONFIG_NLS_CODEPAGE_949=m
+CONFIG_NLS_CODEPAGE_874=m
+CONFIG_NLS_ISO8859_8=m
+CONFIG_NLS_CODEPAGE_1250=m
+CONFIG_NLS_CODEPAGE_1251=m
+CONFIG_NLS_ASCII=m
+CONFIG_NLS_ISO8859_1=m
+CONFIG_NLS_ISO8859_2=m
+CONFIG_NLS_ISO8859_3=m
+CONFIG_NLS_ISO8859_4=m
+CONFIG_NLS_ISO8859_5=m
+CONFIG_NLS_ISO8859_6=m
+CONFIG_NLS_ISO8859_7=m
+CONFIG_NLS_ISO8859_9=m
+CONFIG_NLS_ISO8859_13=m
+CONFIG_NLS_ISO8859_14=m
+CONFIG_NLS_ISO8859_15=m
+CONFIG_NLS_KOI8_R=m
+CONFIG_NLS_KOI8_U=m
+CONFIG_NLS_UTF8=m
+
+#
+# Distributed Lock Manager
+#
+CONFIG_DLM=m
+CONFIG_DLM_DEBUG=y
+
+
+CONFIG_HW_RANDOM=y
+CONFIG_SND_MIA=m
+CONFIG_MCS_FIR=m
+CONFIG_STACKTRACE_SUPPORT=y
+# CONFIG_USB_EHCI_TT_NEWSCHED is not set
+CONFIG_SND_INDIGODJ=m
+CONFIG_SND_ECHO3G=m
+CONFIG_SND_LAYLA20=m
+# CONFIG_SYS_HYPERVISOR is not set
+CONFIG_SND_LAYLA24=m
+CONFIG_FIXED_PHY=m
+CONFIG_SND_MONA=m
+# CONFIG_FB_BACKLIGHT is not set
+CONFIG_LEDS_NET48XX=m
+CONFIG_SERIAL_8250_PCI=y
+CONFIG_SERIAL_8250_PNP=y
+# CONFIG_INPUT_EVBUG is not set
+# CONFIG_LEGACY_PTYS is not set
+# CONFIG_IDE_TASK_IOCTL is not set
+CONFIG_IDE_PROC_FS=y
+
+#
+# PCMCIA SCSI adapter support
+#
+CONFIG_ATA=m
+CONFIG_SATA_AHCI=m
+CONFIG_SATA_SVW=m
+CONFIG_ATA_PIIX=m
+CONFIG_SATA_MV=m
+CONFIG_SATA_NV=m
+CONFIG_PDC_ADMA=m
+CONFIG_SATA_QSTOR=m
+CONFIG_SATA_PROMISE=m
+CONFIG_SATA_SX4=m
+CONFIG_SATA_SIL=m
+CONFIG_SATA_SIL24=m
+CONFIG_SATA_SIS=m
+CONFIG_SATA_ULI=m
+CONFIG_SATA_VIA=m
+CONFIG_SATA_VITESSE=m
+CONFIG_SATA_INIC162X=m
+CONFIG_PCNET32_NAPI=y
+CONFIG_EEPROM_93CX6=m
+CONFIG_SGI_IOC4=m
+CONFIG_TOUCHSCREEN_TOUCHRIGHT=m
+CONFIG_SYSCTL_SYSCALL=y
+CONFIG_KEYBOARD_STOWAWAY=m
+CONFIG_USB_U132_HCD=m
+CONFIG_SND_MTS64=m
+CONFIG_SMSC37B787_WDT=m
+CONFIG_MMC_TIFM_SD=m
+CONFIG_INPUT_FF_MEMLESS=m
+CONFIG_BLK_DEV_JMICRON=m
+CONFIG_SND_AC97_POWER_SAVE=y
+CONFIG_JBD2=m
+CONFIG_SSFDC=m
+CONFIG_TOUCHSCREEN_PENMOUNT=m
+CONFIG_ASUS_LAPTOP=m
+CONFIG_MSI_LAPTOP=m
+CONFIG_SONY_LAPTOP=m
+CONFIG_FIB_RULES=y
+CONFIG_TIFM_7XX1=m
+CONFIG_PROC_SYSCTL=y
+CONFIG_USB_STORAGE_KARMA=y
+CONFIG_ATA_GENERIC=m
+# CONFIG_SECURITY_SELINUX_POLICYDB_VERSION_MAX is not set
+CONFIG_W83697HF_WDT=m
+CONFIG_SLHC=m
+CONFIG_TIFM_CORE=m
+CONFIG_ITCO_WDT=m
+CONFIG_TOUCHSCREEN_TOUCHWIN=m
+CONFIG_USB_MIDI_GADGET=m
+CONFIG_HOTPLUG_PCI_CPCI=y
+CONFIG_NETXEN_NIC=m
+CONFIG_PC87413_WDT=m
+CONFIG_BROADCOM_PHY=m
+# CONFIG_ARCH_HAS_ILOG2_U32 is not set
+CONFIG_HID=m
+# CONFIG_HID_DEBUG is not set
+CONFIG_MOXA_SMARTIO_NEW=m
+# CONFIG_ATA_NONSTANDARD is not set
+CONFIG_AC97_BUS=m
+CONFIG_TOUCHSCREEN_UCB1400=m
+# CONFIG_ITCO_VENDOR_SUPPORT is not set
+CONFIG_WAN_ROUTER_DRIVERS=m
+# CONFIG_FORCEDETH_NAPI is not set
+# CONFIG_PATA_ALI is not set
+# CONFIG_PATA_AMD is not set
+# CONFIG_PATA_ATIIXP is not set
+# CONFIG_PATA_CMD640_PCI is not set
+# CONFIG_PATA_CMD64X is not set
+# CONFIG_PATA_CS5520 is not set
+# CONFIG_PATA_CS5530 is not set
+# CONFIG_PATA_CYPRESS is not set
+# CONFIG_PATA_EFAR is not set
+# CONFIG_PATA_HPT366 is not set
+# CONFIG_PATA_HPT37X is not set
+# CONFIG_PATA_HPT3X2N is not set
+# CONFIG_PATA_HPT3X3 is not set
+# CONFIG_PATA_ISAPNP is not set
+# CONFIG_PATA_IT8213 is not set
+# CONFIG_PATA_IT821X is not set
+# CONFIG_PATA_JMICRON is not set
+# CONFIG_PATA_LEGACY is not set
+# CONFIG_PATA_MARVELL is not set
+# CONFIG_PATA_MPIIX is not set
+# CONFIG_PATA_NETCELL is not set
+# CONFIG_PATA_NS87410 is not set
+# CONFIG_PATA_OLDPIIX is not set
+# CONFIG_PATA_OPTI is not set
+# CONFIG_PATA_OPTIDMA is not set
+# CONFIG_PATA_PCMCIA is not set
+# CONFIG_PATA_PDC2027X is not set
+# CONFIG_PATA_QDI is not set
+# CONFIG_PATA_RADISYS is not set
+# CONFIG_PATA_RZ1000 is not set
+# CONFIG_PATA_SC1200 is not set
+# CONFIG_PATA_SERVERWORKS is not set
+# CONFIG_PATA_SIL680 is not set
+# CONFIG_PATA_TRIFLEX is not set
+# CONFIG_PATA_VIA is not set
+# CONFIG_PATA_WINBOND is not set
+# CONFIG_PATA_WINBOND_VLB is not set
+CONFIG_INFINIBAND_USER_MEM=y
+CONFIG_BATTERY_DS2760=m
+CONFIG_ATA_ACPI=y
+CONFIG_TOUCHSCREEN_USB_3M=y
+# CONFIG_SND_SOC is not set
+CONFIG_ELF_CORE=y
+CONFIG_SND_SB_COMMON=m
+# CONFIG_POWER_SUPPLY_DEBUG is not set
+CONFIG_ICPLUS_PHY=m
+CONFIG_EPOLL=y
+CONFIG_TOUCHSCREEN_USB_ETURBO=y
+# CONFIG_USB_GADGET_DEBUG is not set
+# CONFIG_KALLSYMS_EXTRA_PASS is not set
+CONFIG_SCSI_DMA=y
+# CONFIG_3C359 is not set
+CONFIG_TOUCHSCREEN_USB_GUNZE=y
+CONFIG_BLK_DEV_IT8213=m
+# CONFIG_USB_EMI62 is not set
+CONFIG_KALLSYMS=y
+CONFIG_USB_DEVICE_CLASS=y
+CONFIG_TOUCHSCREEN_USB_ITM=y
+CONFIG_LOCKDEP_SUPPORT=y
+CONFIG_SYSCTL=y
+# CONFIG_FUSION_LOGGING is not set
+CONFIG_TOUCHSCREEN_USB_EGALAX=y
+CONFIG_SHMEM=y
+CONFIG_INIT_ENV_ARG_LIMIT=32
+CONFIG_SYSVIPC_SYSCTL=y
+# CONFIG_PATA_PDC_OLD is not set
+# CONFIG_USB_GADGET_S3C2410 is not set
+CONFIG_BLK_DEV_TC86C001=m
+CONFIG_BUG=y
+CONFIG_MLX4_CORE=m
+CONFIG_RTC_DRV_STK17TA8=m
+CONFIG_MMC_BLOCK_BOUNCE=y
+CONFIG_POWER_SUPPLY=m
+CONFIG_RT_MUTEXES=y
+# CONFIG_USB_GADGET_M66592 is not set
+CONFIG_VM_EVENT_COUNTERS=y
+CONFIG_VGASTATE=m
+# CONFIG_RELOCATABLE is not set
+CONFIG_I2C_BOARDINFO=y
+# CONFIG_USB_PERSIST is not set
+CONFIG_USB_EZUSB=y
+CONFIG_GENERIC_ALLOCATOR=y
+CONFIG_TIMERFD=y
+CONFIG_BLOCK=y
+CONFIG_XOR_BLOCKS=m
+# CONFIG_USB_GADGET_AMD5536UDC is not set
+CONFIG_ASYNC_XOR=m
+CONFIG_DAB=y
+CONFIG_DEVPORT=y
+CONFIG_FUTEX=y
+CONFIG_SCSI_WAIT_SCAN=m
+CONFIG_GENERIC_BUG=y
+CONFIG_TOUCHSCREEN_USB_DMC_TSC10=y
+CONFIG_BLK_DEV_DELKIN=m
+CONFIG_SCSI_LOWLEVEL_PCMCIA=y
+# CONFIG_FRAMEBUFFER_CONSOLE_DETECT_PRIMARY is not set
+# CONFIG_USB_GADGET_FSL_USB2 is not set
+# CONFIG_SND_MAESTRO3_FIRMWARE_IN_KERNEL is not set
+CONFIG_TOUCHSCREEN_FUJITSU=m
+CONFIG_RTC_DRV_M48T59=m
+CONFIG_MOUSE_PS2_ALPS=y
+CONFIG_EDAC_I82975X=m
+CONFIG_SND_SB16_DSP=m
+CONFIG_ANON_INODES=y
+# CONFIG_SND_KORG1212_FIRMWARE_IN_KERNEL is not set
+# CONFIG_USB_DABUSB is not set
+CONFIG_PDA_POWER=m
+CONFIG_PRINTK=y
+CONFIG_CHECK_SIGNATURE=y
+CONFIG_SIGNALFD=y
+CONFIG_EVENTFD=y
+# CONFIG_SND_YMFPCI_FIRMWARE_IN_KERNEL is not set
+CONFIG_USB_SERIAL_OTI6858=m
+# CONFIG_AUXDISPLAY is not set
+# CONFIG_USB_EMI26 is not set
+CONFIG_TOUCHSCREEN_USB_IRTOUCH=y
+# CONFIG_TINY_SHMEM is not set
+CONFIG_MLX4_DEBUG=y
+CONFIG_TOUCHSCREEN_USB_PANJIT=y
+# CONFIG_SCHED_DEBUG is not set
+CONFIG_ASYNC_MEMCPY=m
+CONFIG_USB_R8A66597_HCD=m
+CONFIG_RELAY=y
+CONFIG_PATA_SIS=m
+CONFIG_BACKLIGHT_CLASS_DEVICE=y

Added: dists/sid/linux-2.6/debian/config/defines
==============================================================================
--- (empty file)
+++ dists/sid/linux-2.6/debian/config/defines	Mon Nov 26 20:06:56 2007
@@ -0,0 +1,53 @@
+[abi]
+abiname: 1
+
+[base]
+arches:
+ alpha
+ amd64
+ arm
+ armel
+ hppa
+ i386
+ ia64
+ m68k
+ mips
+ mipsel
+ powerpc
+ s390
+ sparc
+compiler: gcc-4.1
+featuresets:
+ none
+ vserver
+ xen
+ xen-vserver
+
+[featureset-vserver_base]
+enabled: false
+
+[featureset-xen-vserver_base]
+enabled: false
+
+[image]
+initramfs-generators: initramfs-tools yaird initramfs-fallback
+type: plain
+
+[xen]
+dom0-support: false
+versions:
+ 3.1-1
+
+[commands-image-initramfs-generators]
+initramfs-tools: mkinitramfs-kpkg
+yaird: mkinitrd.yaird
+
+[relations]
+gcc-3.3: gcc-3.3
+gcc-4.0: gcc-4.0
+gcc-4.1: gcc-4.1
+initramfs-fallback: linux-initramfs-tool
+initramfs-tools: initramfs-tools (>= 0.55)
+util-vserver: util-vserver (>= 0.30.210)
+yaird: yaird (>= 0.0.12-8)
+

Added: dists/sid/linux-2.6/debian/config/featureset-vserver/config
==============================================================================
--- (empty file)
+++ dists/sid/linux-2.6/debian/config/featureset-vserver/config	Mon Nov 26 20:06:56 2007
@@ -0,0 +1,21 @@
+# CONFIG_VSERVER_LEGACY is not set
+# CONFIG_VSERVER_LEGACY_VERSION is not set
+# CONFIG_VSERVER_LEGACYNET is not set
+# CONFIG_VSERVER_REMAP_SADDR is not set
+CONFIG_VSERVER_COWBL=y
+# CONFIG_VSERVER_VTIME is not set
+CONFIG_VSERVER_PROC_SECURE=y
+CONFIG_VSERVER_HARDCPU=y
+# CONFIG_VSERVER_IDLETIME is not set
+CONFIG_VSERVER_IDLELIMIT=y
+# CONFIG_TAGGING_NONE is not set
+# CONFIG_TAGGING_UID16 is not set
+# CONFIG_TAGGING_GID16 is not set
+CONFIG_TAGGING_ID24=y
+# CONFIG_TAGGING_INTERN is not set
+# CONFIG_TAGGING_RUNTIME is not set
+# CONFIG_TAG_NFSD is not set
+# CONFIG_PROPAGATE is not set
+CONFIG_VSERVER_PRIVACY=y
+# CONFIG_VSERVER_DEBUG is not set
+CONFIG_BLK_DEV_VROOT=y

Added: dists/sid/linux-2.6/debian/config/featureset-xen-vserver/defines
==============================================================================
--- (empty file)
+++ dists/sid/linux-2.6/debian/config/featureset-xen-vserver/defines	Mon Nov 26 20:06:56 2007
@@ -0,0 +1,4 @@
+[image]
+configs:
+ featureset-vserver/config
+ featureset-xen/config

Added: dists/sid/linux-2.6/debian/config/featureset-xen/config
==============================================================================
--- (empty file)
+++ dists/sid/linux-2.6/debian/config/featureset-xen/config	Mon Nov 26 20:06:56 2007
@@ -0,0 +1,19 @@
+CONFIG_XEN=y
+CONFIG_XEN_BLKDEV_FRONTEND=y
+CONFIG_HVC_XEN=y
+CONFIG_XEN_NETDEV_FRONTEND=y
+
+# CONFIG_VMI is not set
+# CONFIG_PM is not set
+# CONFIG_CPU_FREQ is not set
+# CONFIG_PCI is not set
+# CONFIG_ISA is not set
+# CONFIG_EISA is not set
+# CONFIG_SCx200 is not set
+# CONFIG_PCCARD is not set
+# CONFIG_PARPORT is not set
+# CONFIG_BLK_DEV_FD is not set
+# CONFIG_PARIDE is not set
+# CONFIG_CDROM_PKTCDVD is not set
+# CONFIG_IDE is not set
+

Added: dists/sid/linux-2.6/debian/config/hppa/config
==============================================================================
--- (empty file)
+++ dists/sid/linux-2.6/debian/config/hppa/config	Mon Nov 26 20:06:56 2007
@@ -0,0 +1,708 @@
+CONFIG_PARISC=y
+CONFIG_MMU=y
+CONFIG_STACK_GROWSUP=y
+CONFIG_RWSEM_GENERIC_SPINLOCK=y
+CONFIG_GENERIC_CALIBRATE_DELAY=y
+CONFIG_GENERIC_HARDIRQS=y
+CONFIG_GENERIC_IRQ_PROBE=y
+CONFIG_ISA_DMA_API=y
+CONFIG_EXPERIMENTAL=y
+CONFIG_LOCALVERSION=""
+CONFIG_SWAP=y
+CONFIG_SYSVIPC=y
+CONFIG_POSIX_MQUEUE=y
+CONFIG_HOTPLUG=y
+CONFIG_IKCONFIG=y
+# CONFIG_IKCONFIG_PROC is not set
+# CONFIG_KALLSYMS_ALL is not set
+CONFIG_BASE_FULL=y
+CONFIG_CC_ALIGN_FUNCTIONS=0
+CONFIG_CC_ALIGN_LABELS=0
+CONFIG_CC_ALIGN_LOOPS=0
+CONFIG_CC_ALIGN_JUMPS=0
+CONFIG_BASE_SMALL=0
+CONFIG_MODULES=y
+CONFIG_OBSOLETE_MODPARM=y
+CONFIG_KMOD=y
+# CONFIG_PA7100LC is not set
+# CONFIG_PA7200 is not set
+# CONFIG_PA7300LC is not set
+CONFIG_PARISC_PAGE_SIZE_4KB=y
+# CONFIG_PARISC_PAGE_SIZE_16KB is not set
+# CONFIG_PARISC_PAGE_SIZE_64KB is not set
+CONFIG_GSC=y
+CONFIG_HPPB=y
+CONFIG_IOMMU_CCIO=y
+CONFIG_GSC_LASI=y
+CONFIG_GSC_WAX=y
+CONFIG_EISA=y
+CONFIG_EISA_NAMES=y
+CONFIG_ISA=y
+CONFIG_PCI=y
+# CONFIG_PCI_DEBUG is not set
+CONFIG_GSC_DINO=y
+CONFIG_PCI_LBA=y
+CONFIG_IOSAPIC=y
+CONFIG_IOMMU_SBA=y
+CONFIG_PCCARD=m
+# CONFIG_PCMCIA_DEBUG is not set
+CONFIG_PCMCIA=m
+CONFIG_CARDBUS=y
+CONFIG_YENTA=m
+CONFIG_PD6729=m
+CONFIG_I82092=m
+CONFIG_I82365=m
+# CONFIG_TCIC is not set
+CONFIG_PCCARD_NONSTATIC=m
+# CONFIG_HOTPLUG_PCI is not set
+CONFIG_SUPERIO=y
+CONFIG_CHASSIS_LCD_LED=y
+CONFIG_PDC_CHASSIS=y
+CONFIG_PDC_CHASSIS_WARN=y
+CONFIG_PDC_STABLE=y
+CONFIG_BINFMT_ELF=y
+CONFIG_BINFMT_MISC=m
+CONFIG_STANDALONE=y
+CONFIG_PREVENT_FIRMWARE_BUILD=y
+# CONFIG_DEBUG_DRIVER is not set
+# CONFIG_MTD is not set
+# CONFIG_PNP is not set
+# CONFIG_BLK_DEV_FD is not set
+# CONFIG_BLK_DEV_XD is not set
+# CONFIG_PARIDE is not set
+# CONFIG_BLK_CPQ_DA is not set
+# CONFIG_BLK_CPQ_CISS_DA is not set
+# CONFIG_BLK_DEV_DAC960 is not set
+# CONFIG_BLK_DEV_UMEM is not set
+# CONFIG_BLK_DEV_COW_COMMON is not set
+CONFIG_BLK_DEV_LOOP=m
+CONFIG_BLK_DEV_CRYPTOLOOP=m
+# CONFIG_BLK_DEV_NBD is not set
+# CONFIG_BLK_DEV_SX8 is not set
+# CONFIG_BLK_DEV_UB is not set
+CONFIG_BLK_DEV_RAM=y
+CONFIG_BLK_DEV_RAM_COUNT=16
+CONFIG_BLK_DEV_RAM_SIZE=8192
+CONFIG_BLK_DEV_INITRD=y
+CONFIG_INITRAMFS_SOURCE=""
+CONFIG_CDROM_PKTCDVD=m
+CONFIG_CDROM_PKTCDVD_BUFFERS=8
+# CONFIG_CDROM_PKTCDVD_WCACHE is not set
+CONFIG_ATA_OVER_ETH=m
+CONFIG_IDE=m
+CONFIG_BLK_DEV_IDE=m
+# CONFIG_BLK_DEV_IDE_SATA is not set
+CONFIG_BLK_DEV_IDEDISK=m
+# CONFIG_IDEDISK_MULTI_MODE is not set
+CONFIG_BLK_DEV_IDECS=m
+CONFIG_BLK_DEV_IDECD=m
+# CONFIG_BLK_DEV_IDETAPE is not set
+# CONFIG_BLK_DEV_IDEFLOPPY is not set
+CONFIG_IDE_GENERIC=m
+CONFIG_BLK_DEV_IDEPCI=y
+CONFIG_IDEPCI_SHARE_IRQ=y
+# CONFIG_BLK_DEV_OFFBOARD is not set
+# CONFIG_BLK_DEV_GENERIC is not set
+# CONFIG_BLK_DEV_OPTI621 is not set
+CONFIG_BLK_DEV_IDEDMA_PCI=y
+# CONFIG_BLK_DEV_IDEDMA_FORCED is not set
+# CONFIG_IDEDMA_ONLYDISK is not set
+# CONFIG_BLK_DEV_AEC62XX is not set
+# CONFIG_BLK_DEV_ALI15X3 is not set
+# CONFIG_BLK_DEV_AMD74XX is not set
+CONFIG_BLK_DEV_CMD64X=m
+# CONFIG_BLK_DEV_TRIFLEX is not set
+# CONFIG_BLK_DEV_CY82C693 is not set
+# CONFIG_BLK_DEV_CS5520 is not set
+# CONFIG_BLK_DEV_CS5530 is not set
+# CONFIG_BLK_DEV_HPT34X is not set
+# CONFIG_BLK_DEV_HPT366 is not set
+# CONFIG_BLK_DEV_SC1200 is not set
+# CONFIG_BLK_DEV_PIIX is not set
+CONFIG_BLK_DEV_NS87415=m
+# CONFIG_BLK_DEV_PDC202XX_OLD is not set
+# CONFIG_BLK_DEV_PDC202XX_NEW is not set
+# CONFIG_BLK_DEV_SVWKS is not set
+# CONFIG_BLK_DEV_SIIMAGE is not set
+# CONFIG_BLK_DEV_SLC90E66 is not set
+# CONFIG_BLK_DEV_TRM290 is not set
+# CONFIG_BLK_DEV_VIA82CXXX is not set
+# CONFIG_IDE_ARM is not set
+# CONFIG_IDE_CHIPSETS is not set
+CONFIG_BLK_DEV_IDEDMA=y
+# CONFIG_IDEDMA_IVB is not set
+# CONFIG_BLK_DEV_HD is not set
+# CONFIG_SCSI_IN2000 is not set
+# CONFIG_MEGARAID_NEWGEN is not set
+CONFIG_MEGARAID_LEGACY=m
+# CONFIG_SCSI_BUSLOGIC is not set
+# CONFIG_SCSI_DMX3191D is not set
+# CONFIG_SCSI_DTC3280 is not set
+# CONFIG_SCSI_EATA is not set
+# CONFIG_SCSI_FUTURE_DOMAIN is not set
+# CONFIG_SCSI_GDTH is not set
+# CONFIG_SCSI_GENERIC_NCR5380 is not set
+# CONFIG_SCSI_GENERIC_NCR5380_MMIO is not set
+# CONFIG_SCSI_IPS is not set
+CONFIG_SCSI_INITIO=m
+# CONFIG_SCSI_INIA100 is not set
+# CONFIG_SCSI_PPA is not set
+# CONFIG_SCSI_IMM is not set
+# CONFIG_SCSI_NCR53C406A is not set
+CONFIG_SCSI_LASI700=m
+CONFIG_53C700_LE_ON_BE=y
+CONFIG_SCSI_SYM53C8XX_2=m
+CONFIG_SCSI_SYM53C8XX_DMA_ADDRESSING_MODE=1
+CONFIG_SCSI_SYM53C8XX_DEFAULT_TAGS=16
+CONFIG_SCSI_SYM53C8XX_MAX_TAGS=64
+# CONFIG_SCSI_IPR is not set
+CONFIG_SCSI_ZALON=m
+CONFIG_SCSI_NCR53C8XX_DEFAULT_TAGS=8
+CONFIG_SCSI_NCR53C8XX_MAX_TAGS=32
+CONFIG_SCSI_NCR53C8XX_SYNC=20
+# CONFIG_SCSI_PAS16 is not set
+# CONFIG_SCSI_PSI240I is not set
+# CONFIG_SCSI_QLOGIC_FAS is not set
+# CONFIG_SCSI_QLOGIC_FC is not set
+# CONFIG_SCSI_QLOGIC_1280 is not set
+CONFIG_SCSI_LPFC=m
+# CONFIG_SCSI_SIM710 is not set
+# CONFIG_SCSI_SYM53C416 is not set
+# CONFIG_SCSI_DC395x is not set
+# CONFIG_SCSI_DC390T is not set
+# CONFIG_SCSI_T128 is not set
+# CONFIG_SCSI_U14_34F is not set
+# CONFIG_SCSI_DEBUG is not set
+CONFIG_PCMCIA_FDOMAIN=m
+CONFIG_PCMCIA_QLOGIC=m
+CONFIG_PCMCIA_SYM53C500=m
+CONFIG_MD=y
+# CONFIG_FIREWIRE is not set
+CONFIG_I2O=m
+CONFIG_I2O_CONFIG=m
+CONFIG_I2O_BLOCK=m
+CONFIG_I2O_SCSI=m
+CONFIG_I2O_PROC=m
+CONFIG_NET_KEY=m
+# CONFIG_IP_ADVANCED_ROUTER is not set
+CONFIG_IP_PNP=y
+# CONFIG_IP_PNP_DHCP is not set
+CONFIG_IP_PNP_BOOTP=y
+# CONFIG_IP_PNP_RARP is not set
+CONFIG_IP_TCPDIAG=m
+CONFIG_IP_TCPDIAG_IPV6=y
+CONFIG_BRIDGE_NETFILTER=y
+CONFIG_BRIDGE_NF_EBTABLES=m
+CONFIG_BRIDGE_EBT_BROUTE=m
+CONFIG_BRIDGE_EBT_T_FILTER=m
+CONFIG_BRIDGE_EBT_T_NAT=m
+CONFIG_BRIDGE_EBT_802_3=m
+CONFIG_BRIDGE_EBT_AMONG=m
+CONFIG_BRIDGE_EBT_ARP=m
+CONFIG_BRIDGE_EBT_IP=m
+CONFIG_BRIDGE_EBT_LIMIT=m
+CONFIG_BRIDGE_EBT_MARK=m
+CONFIG_BRIDGE_EBT_PKTTYPE=m
+CONFIG_BRIDGE_EBT_STP=m
+CONFIG_BRIDGE_EBT_VLAN=m
+CONFIG_BRIDGE_EBT_ARPREPLY=m
+CONFIG_BRIDGE_EBT_DNAT=m
+CONFIG_BRIDGE_EBT_MARK_T=m
+CONFIG_BRIDGE_EBT_REDIRECT=m
+CONFIG_BRIDGE_EBT_SNAT=m
+CONFIG_BRIDGE_EBT_LOG=m
+CONFIG_BRIDGE_EBT_ULOG=m
+# CONFIG_IP_SCTP is not set
+# CONFIG_ATM is not set
+CONFIG_BRIDGE=m
+CONFIG_VLAN_8021Q=m
+# CONFIG_DECNET is not set
+# CONFIG_LLC2 is not set
+# CONFIG_IPX is not set
+# CONFIG_ATALK is not set
+# CONFIG_X25 is not set
+# CONFIG_LAPB is not set
+# CONFIG_ECONET is not set
+# CONFIG_WAN_ROUTER is not set
+CONFIG_NETPOLL=y
+# CONFIG_NETPOLL_TRAP is not set
+CONFIG_NET_POLL_CONTROLLER=y
+# CONFIG_HAMRADIO is not set
+# CONFIG_IRDA is not set
+# CONFIG_BT is not set
+CONFIG_NETDEVICES=y
+CONFIG_DUMMY=m
+# CONFIG_BONDING is not set
+# CONFIG_EQUALIZER is not set
+CONFIG_TUN=m
+# CONFIG_ARCNET is not set
+CONFIG_NET_ETHERNET=y
+CONFIG_LASI_82596=m
+CONFIG_HAPPYMEAL=m
+CONFIG_SUNGEM=m
+CONFIG_NET_VENDOR_3COM=y
+CONFIG_EL1=m
+CONFIG_EL2=m
+CONFIG_ELPLUS=m
+CONFIG_EL16=m
+CONFIG_EL3=m
+# CONFIG_3C515 is not set
+CONFIG_VORTEX=m
+CONFIG_TYPHOON=m
+# CONFIG_LANCE is not set
+CONFIG_NET_VENDOR_SMC=y
+CONFIG_WD80x3=m
+CONFIG_ULTRA=m
+CONFIG_ULTRA32=m
+CONFIG_SMC9194=m
+CONFIG_NET_VENDOR_RACAL=y
+# CONFIG_NI52 is not set
+# CONFIG_NI65 is not set
+CONFIG_NET_TULIP=y
+# CONFIG_DE2104X is not set
+CONFIG_TULIP=m
+# CONFIG_TULIP_MWI is not set
+CONFIG_TULIP_MMIO=y
+# CONFIG_DE4X5 is not set
+# CONFIG_WINBOND_840 is not set
+# CONFIG_DM9102 is not set
+CONFIG_PCMCIA_XIRCOM=m
+CONFIG_AT1700=m
+CONFIG_DEPCA=m
+CONFIG_HP100=m
+CONFIG_NET_ISA=y
+CONFIG_E2100=m
+CONFIG_EWRK3=m
+CONFIG_EEXPRESS=m
+CONFIG_EEXPRESS_PRO=m
+CONFIG_HPLAN_PLUS=m
+CONFIG_HPLAN=m
+CONFIG_LP486E=m
+CONFIG_ETH16I=m
+CONFIG_NE2000=m
+CONFIG_ZNET=m
+CONFIG_SEEQ8005=m
+CONFIG_NET_PCI=y
+CONFIG_PCNET32=m
+CONFIG_AMD8111_ETH=m
+CONFIG_ADAPTEC_STARFIRE=m
+CONFIG_AC3200=m
+CONFIG_APRICOT=m
+CONFIG_B44=m
+CONFIG_FORCEDETH=m
+CONFIG_CS89x0=m
+CONFIG_EEPRO100=m
+CONFIG_E100=m
+CONFIG_LNE390=m
+CONFIG_FEALNX=m
+CONFIG_NATSEMI=m
+CONFIG_NE2K_PCI=m
+CONFIG_NE3210=m
+CONFIG_ES3210=m
+CONFIG_8139CP=m
+CONFIG_8139TOO=m
+# CONFIG_8139TOO_PIO is not set
+# CONFIG_8139TOO_TUNE_TWISTER is not set
+# CONFIG_8139TOO_8129 is not set
+# CONFIG_8139_OLD_RX_RESET is not set
+CONFIG_SIS900=m
+CONFIG_EPIC100=m
+CONFIG_SUNDANCE=m
+# CONFIG_SUNDANCE_MMIO is not set
+CONFIG_VIA_RHINE=m
+# CONFIG_VIA_RHINE_MMIO is not set
+CONFIG_DL2K=m
+CONFIG_E1000=m
+CONFIG_NS83820=m
+CONFIG_HAMACHI=m
+CONFIG_YELLOWFIN=m
+CONFIG_R8169=m
+CONFIG_R8169_VLAN=y
+CONFIG_VIA_VELOCITY=m
+CONFIG_TIGON3=m
+CONFIG_BNX2=m
+CONFIG_IXGB=m
+CONFIG_S2IO=m
+# CONFIG_TR is not set
+CONFIG_WLAN_PRE80211=y
+# CONFIG_STRIP is not set
+# CONFIG_WAVELAN is not set
+CONFIG_PCMCIA_WAVELAN=m
+CONFIG_PCMCIA_NETWAVE=m
+CONFIG_WLAN_80211=y
+CONFIG_PCMCIA_RAYCS=m
+CONFIG_HERMES=m
+# CONFIG_PLX_HERMES is not set
+# CONFIG_TMD_HERMES is not set
+# CONFIG_PCI_HERMES is not set
+# CONFIG_ATMEL is not set
+CONFIG_PCMCIA_HERMES=m
+CONFIG_AIRO_CS=m
+CONFIG_PCMCIA_WL3501=m
+CONFIG_PRISM54=m
+CONFIG_NET_PCMCIA=y
+CONFIG_PCMCIA_3C589=m
+CONFIG_PCMCIA_3C574=m
+CONFIG_PCMCIA_FMVJ18X=m
+CONFIG_PCMCIA_PCNET=m
+CONFIG_PCMCIA_NMCLAN=m
+CONFIG_PCMCIA_SMC91C92=m
+CONFIG_PCMCIA_XIRC2PS=m
+CONFIG_PCMCIA_AXNET=m
+# CONFIG_WAN is not set
+# CONFIG_FDDI is not set
+# CONFIG_HIPPI is not set
+CONFIG_PLIP=m
+CONFIG_PPP=m
+CONFIG_PPP_MULTILINK=y
+CONFIG_PPP_FILTER=y
+CONFIG_PPP_ASYNC=m
+CONFIG_PPP_SYNC_TTY=m
+CONFIG_PPP_DEFLATE=m
+CONFIG_PPP_BSDCOMP=m
+CONFIG_PPPOE=m
+CONFIG_SLIP=m
+CONFIG_SLIP_COMPRESSED=y
+CONFIG_SLIP_SMART=y
+# CONFIG_SLIP_MODE_SLIP6 is not set
+# CONFIG_NET_FC is not set
+CONFIG_SHAPER=m
+CONFIG_NETCONSOLE=m
+# CONFIG_ISDN is not set
+# CONFIG_PHONE is not set
+CONFIG_INPUT=y
+CONFIG_INPUT_MOUSEDEV=y
+CONFIG_INPUT_MOUSEDEV_PSAUX=y
+CONFIG_INPUT_MOUSEDEV_SCREEN_X=1024
+CONFIG_INPUT_MOUSEDEV_SCREEN_Y=768
+# CONFIG_INPUT_JOYDEV is not set
+# CONFIG_INPUT_TSDEV is not set
+CONFIG_INPUT_EVDEV=m
+CONFIG_INPUT_KEYBOARD=y
+CONFIG_KEYBOARD_ATKBD=y
+CONFIG_KEYBOARD_ATKBD_HP_KEYCODES=y
+# CONFIG_KEYBOARD_ATKBD_RDI_KEYCODES is not set
+# CONFIG_KEYBOARD_SUNKBD is not set
+# CONFIG_KEYBOARD_LKKBD is not set
+# CONFIG_KEYBOARD_XTKBD is not set
+# CONFIG_KEYBOARD_NEWTON is not set
+CONFIG_KEYBOARD_HIL_OLD=m
+CONFIG_KEYBOARD_HIL=m
+CONFIG_INPUT_MOUSE=y
+CONFIG_MOUSE_PS2=m
+# CONFIG_MOUSE_SERIAL is not set
+# CONFIG_MOUSE_INPORT is not set
+# CONFIG_MOUSE_LOGIBM is not set
+# CONFIG_MOUSE_PC110PAD is not set
+# CONFIG_MOUSE_VSXXXAA is not set
+CONFIG_MOUSE_HIL=m
+# CONFIG_INPUT_JOYSTICK is not set
+# CONFIG_INPUT_TOUCHSCREEN is not set
+CONFIG_INPUT_MISC=y
+# CONFIG_INPUT_UINPUT is not set
+CONFIG_HP_SDC_RTC=m
+CONFIG_SERIO=y
+# CONFIG_SERIO_SERPORT is not set
+# CONFIG_SERIO_PARKBD is not set
+CONFIG_SERIO_GSCPS2=y
+CONFIG_HP_SDC=m
+CONFIG_HIL_MLC=m
+# CONFIG_SERIO_PCIPS2 is not set
+CONFIG_SERIO_LIBPS2=y
+CONFIG_SERIO_RAW=m
+# CONFIG_GAMEPORT is not set
+CONFIG_VT=y
+CONFIG_VT_CONSOLE=y
+CONFIG_HW_CONSOLE=y
+# CONFIG_SERIAL_NONSTANDARD is not set
+CONFIG_SERIAL_8250=y
+CONFIG_SERIAL_8250_CONSOLE=y
+CONFIG_SERIAL_8250_CS=m
+CONFIG_SERIAL_8250_NR_UARTS=16
+CONFIG_SERIAL_8250_RUNTIME_UARTS=4
+CONFIG_SERIAL_8250_EXTENDED=y
+CONFIG_SERIAL_8250_MANY_PORTS=y
+CONFIG_SERIAL_8250_SHARE_IRQ=y
+# CONFIG_SERIAL_8250_DETECT_IRQ is not set
+# CONFIG_SERIAL_8250_MULTIPORT is not set
+# CONFIG_SERIAL_8250_RSA is not set
+CONFIG_SERIAL_MUX=y
+CONFIG_SERIAL_MUX_CONSOLE=y
+CONFIG_SERIAL_CORE=y
+CONFIG_SERIAL_CORE_CONSOLE=y
+CONFIG_SERIAL_JSM=m
+CONFIG_PRINTER=m
+# CONFIG_LP_CONSOLE is not set
+# CONFIG_PPDEV is not set
+# CONFIG_TIPAR is not set
+# CONFIG_IPMI_HANDLER is not set
+# CONFIG_WATCHDOG is not set
+CONFIG_GEN_RTC=y
+# CONFIG_GEN_RTC_X is not set
+# CONFIG_DTLK is not set
+# CONFIG_R3964 is not set
+# CONFIG_APPLICOM is not set
+# CONFIG_DRM is not set
+CONFIG_SYNCLINK_CS=m
+# CONFIG_RAW_DRIVER is not set
+CONFIG_TCG_NSC=m
+CONFIG_TCG_ATMEL=m
+# CONFIG_I2C is not set
+# CONFIG_W1 is not set
+# CONFIG_VIDEO_DEV is not set
+# CONFIG_DVB is not set
+CONFIG_FB=y
+CONFIG_FB_CFB_IMAGEBLIT=y
+# CONFIG_FB_MACMODES is not set
+CONFIG_FB_MODE_HELPERS=y
+# CONFIG_FB_TILEBLITTING is not set
+# CONFIG_FB_CIRRUS is not set
+# CONFIG_FB_PM2 is not set
+# CONFIG_FB_CYBER2000 is not set
+# CONFIG_FB_ASILIANT is not set
+# CONFIG_FB_IMSTT is not set
+CONFIG_FB_STI=y
+# CONFIG_FB_NVIDIA is not set
+# CONFIG_FB_RIVA is not set
+# CONFIG_FB_MATROX is not set
+# CONFIG_FB_RADEON is not set
+# CONFIG_FB_ATY128 is not set
+# CONFIG_FB_ATY is not set
+# CONFIG_FB_S3 is not set
+# CONFIG_FB_SAVAGE is not set
+# CONFIG_FB_SIS is not set
+# CONFIG_FB_NEOMAGIC is not set
+# CONFIG_FB_KYRO is not set
+# CONFIG_FB_3DFX is not set
+# CONFIG_FB_VOODOO1 is not set
+# CONFIG_FB_VT8623 is not set
+# CONFIG_FB_TRIDENT is not set
+# CONFIG_FB_ARK is not set
+# CONFIG_FB_PM3 is not set
+# CONFIG_FB_S1D13XXX is not set
+# CONFIG_FB_VIRTUAL is not set
+CONFIG_DUMMY_CONSOLE=y
+CONFIG_DUMMY_CONSOLE_COLUMNS=160
+CONFIG_DUMMY_CONSOLE_ROWS=64
+CONFIG_FRAMEBUFFER_CONSOLE=y
+CONFIG_STI_CONSOLE=y
+# CONFIG_FONTS is not set
+CONFIG_FONT_8x8=y
+CONFIG_FONT_8x16=y
+CONFIG_LOGO=y
+CONFIG_LOGO_LINUX_MONO=y
+CONFIG_LOGO_LINUX_VGA16=y
+CONFIG_LOGO_LINUX_CLUT224=y
+CONFIG_LOGO_PARISC_CLUT224=y
+CONFIG_SOUND=m
+CONFIG_SND=m
+CONFIG_SND_TIMER=m
+CONFIG_SND_PCM=m
+CONFIG_SND_SEQUENCER=m
+# CONFIG_SND_SEQ_DUMMY is not set
+CONFIG_SND_OSSEMUL=y
+CONFIG_SND_MIXER_OSS=m
+CONFIG_SND_PCM_OSS=m
+CONFIG_SND_SEQUENCER_OSS=y
+# CONFIG_SND_VERBOSE_PRINTK is not set
+# CONFIG_SND_DEBUG is not set
+CONFIG_SND_DUMMY=m
+# CONFIG_SND_VIRMIDI is not set
+# CONFIG_SND_MTPAV is not set
+# CONFIG_SND_SERIAL_U16550 is not set
+# CONFIG_SND_MPU401 is not set
+# CONFIG_SND_AD1848 is not set
+# CONFIG_SND_CS4231 is not set
+# CONFIG_SND_CS4232 is not set
+# CONFIG_SND_CS4236 is not set
+# CONFIG_SND_ES1688 is not set
+# CONFIG_SND_ES18XX is not set
+# CONFIG_SND_GUSCLASSIC is not set
+# CONFIG_SND_GUSEXTREME is not set
+# CONFIG_SND_GUSMAX is not set
+# CONFIG_SND_INTERWAVE is not set
+# CONFIG_SND_INTERWAVE_STB is not set
+# CONFIG_SND_OPTI92X_AD1848 is not set
+# CONFIG_SND_OPTI92X_CS4231 is not set
+# CONFIG_SND_OPTI93X is not set
+# CONFIG_SND_SB8 is not set
+# CONFIG_SND_SB16 is not set
+# CONFIG_SND_SBAWE is not set
+# CONFIG_SND_WAVEFRONT is not set
+# CONFIG_SND_CMI8330 is not set
+# CONFIG_SND_OPL3SA2 is not set
+# CONFIG_SND_SGALAXY is not set
+# CONFIG_SND_SSCAPE is not set
+CONFIG_SND_AC97_CODEC=m
+# CONFIG_SND_ALI5451 is not set
+# CONFIG_SND_AD1889_OPL3 is not set
+# CONFIG_SND_ATIIXP is not set
+# CONFIG_SND_ATIIXP_MODEM is not set
+# CONFIG_SND_AU8810 is not set
+# CONFIG_SND_AU8820 is not set
+# CONFIG_SND_AU8830 is not set
+# CONFIG_SND_AZT3328 is not set
+# CONFIG_SND_BT87X is not set
+# CONFIG_SND_CS46XX is not set
+# CONFIG_SND_CS4281 is not set
+# CONFIG_SND_EMU10K1 is not set
+# CONFIG_SND_EMU10K1X is not set
+# CONFIG_SND_CA0106 is not set
+# CONFIG_SND_KORG1212 is not set
+# CONFIG_SND_MIXART is not set
+# CONFIG_SND_NM256 is not set
+# CONFIG_SND_RME32 is not set
+# CONFIG_SND_RME96 is not set
+# CONFIG_SND_RME9652 is not set
+# CONFIG_SND_HDSP is not set
+# CONFIG_SND_TRIDENT is not set
+# CONFIG_SND_YMFPCI is not set
+# CONFIG_SND_ALS4000 is not set
+# CONFIG_SND_CMIPCI is not set
+# CONFIG_SND_ENS1370 is not set
+# CONFIG_SND_ENS1371 is not set
+# CONFIG_SND_ES1938 is not set
+# CONFIG_SND_ES1968 is not set
+# CONFIG_SND_MAESTRO3 is not set
+# CONFIG_SND_FM801 is not set
+# CONFIG_SND_ICE1712 is not set
+# CONFIG_SND_ICE1724 is not set
+# CONFIG_SND_INTEL8X0 is not set
+# CONFIG_SND_INTEL8X0M is not set
+# CONFIG_SND_SONICVIBES is not set
+# CONFIG_SND_VIA82XX is not set
+# CONFIG_SND_VIA82XX_MODEM is not set
+# CONFIG_SND_VX222 is not set
+# CONFIG_SND_HDA_INTEL is not set
+# CONFIG_SND_USB_AUDIO is not set
+# CONFIG_SND_VXP440 is not set
+CONFIG_SND_HARMONY=m
+# CONFIG_SOUND_PRIME is not set
+CONFIG_USB_ARCH_HAS_HCD=y
+CONFIG_USB_ARCH_HAS_OHCI=y
+CONFIG_USB=m
+CONFIG_USB_DEBUG=y
+# CONFIG_USB_DEVICEFS is not set
+# CONFIG_USB_DYNAMIC_MINORS is not set
+# CONFIG_USB_OTG is not set
+CONFIG_USB_EHCI_HCD=m
+# CONFIG_USB_EHCI_SPLIT_ISO is not set
+# CONFIG_USB_EHCI_ROOT_HUB_TT is not set
+CONFIG_USB_OHCI_HCD=m
+CONFIG_USB_OHCI_LITTLE_ENDIAN=y
+# CONFIG_USB_UHCI_HCD is not set
+# CONFIG_USB_SL811_HCD is not set
+# CONFIG_USB_ACM is not set
+# CONFIG_USB_PRINTER is not set
+CONFIG_USB_STORAGE=m
+# CONFIG_USB_STORAGE_DEBUG is not set
+# CONFIG_USB_STORAGE_DATAFAB is not set
+# CONFIG_USB_STORAGE_FREECOM is not set
+# CONFIG_USB_STORAGE_ISD200 is not set
+# CONFIG_USB_STORAGE_DPCM is not set
+# CONFIG_USB_STORAGE_USBAT is not set
+# CONFIG_USB_STORAGE_SDDR09 is not set
+# CONFIG_USB_STORAGE_SDDR55 is not set
+# CONFIG_USB_STORAGE_JUMPSHOT is not set
+CONFIG_USB_HID=m
+# CONFIG_HID_FF is not set
+CONFIG_USB_HIDDEV=y
+CONFIG_USB_KBD=m
+CONFIG_USB_MOUSE=m
+# CONFIG_USB_MDC800 is not set
+# CONFIG_USB_MICROTEK is not set
+# CONFIG_USB_CATC is not set
+# CONFIG_USB_KAWETH is not set
+# CONFIG_USB_PEGASUS is not set
+# CONFIG_USB_RTL8150 is not set
+# CONFIG_USB_USBNET is not set
+# CONFIG_USB_ZD1201 is not set
+# CONFIG_USB_USS720 is not set
+# CONFIG_USB_AUERSWALD is not set
+# CONFIG_USB_RIO500 is not set
+# CONFIG_USB_LEGOTOWER is not set
+# CONFIG_USB_LCD is not set
+# CONFIG_USB_LED is not set
+# CONFIG_USB_CYTHERM is not set
+# CONFIG_USB_PHIDGETKIT is not set
+# CONFIG_USB_PHIDGETSERVO is not set
+# CONFIG_USB_IDMOUSE is not set
+# CONFIG_USB_SISUSBVGA is not set
+# CONFIG_USB_GADGET is not set
+# CONFIG_MMC is not set
+CONFIG_EXT2_FS=y
+CONFIG_JBD=m
+# CONFIG_JBD_DEBUG is not set
+CONFIG_FS_MBCACHE=y
+CONFIG_SYSFS=y
+CONFIG_TMPFS=y
+CONFIG_RAMFS=y
+# CONFIG_XFS_FS is not set
+# CONFIG_ADFS_FS is not set
+# CONFIG_AFFS_FS is not set
+# CONFIG_ASFS_FS is not set
+# CONFIG_HFS_FS is not set
+# CONFIG_HFSPLUS_FS is not set
+# CONFIG_BEFS_FS is not set
+# CONFIG_BFS_FS is not set
+# CONFIG_EFS_FS is not set
+CONFIG_CRAMFS=y
+CONFIG_VXFS_FS=m
+# CONFIG_HPFS_FS is not set
+# CONFIG_QNX4FS_FS is not set
+# CONFIG_SYSV_FS is not set
+# CONFIG_UFS_FS is not set
+CONFIG_NFS_FS=y
+CONFIG_ROOT_NFS=y
+CONFIG_LOCKD=y
+CONFIG_LOCKD_V4=y
+CONFIG_EXPORTFS=m
+CONFIG_SUNRPC=y
+CONFIG_SUNRPC_GSS=y
+CONFIG_RPCSEC_GSS_KRB5=y
+CONFIG_RPCSEC_GSS_SPKM3=m
+CONFIG_SMB_FS=m
+CONFIG_SMB_NLS_DEFAULT=y
+CONFIG_SMB_NLS_REMOTE="cp437"
+CONFIG_CIFS=m
+# CONFIG_CIFS_STATS is not set
+# CONFIG_CIFS_XATTR is not set
+# CONFIG_CIFS_EXPERIMENTAL is not set
+# CONFIG_NCP_FS is not set
+# CONFIG_CODA_FS is not set
+# CONFIG_AFS_FS is not set
+# CONFIG_PARTITION_ADVANCED is not set
+CONFIG_MSDOS_PARTITION=y
+CONFIG_PROFILING=y
+CONFIG_OPROFILE=m
+# CONFIG_PRINTK_TIME is not set
+CONFIG_DEBUG_KERNEL=y
+CONFIG_MAGIC_SYSRQ=y
+CONFIG_LOG_BUF_SHIFT=15
+# CONFIG_SCHEDSTATS is not set
+# CONFIG_DEBUG_SLAB is not set
+# CONFIG_DEBUG_SPINLOCK is not set
+# CONFIG_DEBUG_SPINLOCK_SLEEP is not set
+# CONFIG_DEBUG_KOBJECT is not set
+# CONFIG_DEBUG_INFO is not set
+# CONFIG_DEBUG_IOREMAP is not set
+CONFIG_CRC_CCITT=m
+CONFIG_CRC32=y
+CONFIG_LIBCRC32C=m
+CONFIG_ZLIB_INFLATE=y
+CONFIG_ZLIB_DEFLATE=m
+# CONFIG_ARCH_DISCONTIGMEM_ENABLE is not set
+CONFIG_SND_HWDEP=m
+CONFIG_NFS_ACL_SUPPORT=y
+# CONFIG_HWMON_VID is not set
+# CONFIG_SENSORS_F71805F is not set
+CONFIG_CC_OPTIMIZE_FOR_SIZE=y
+CONFIG_FLATMEM_MANUAL=y
+# CONFIG_SPARSEMEM_MANUAL is not set
+CONFIG_MEGARAID_MM=m
+CONFIG_MEGARAID_MAILBOX=m
+# CONFIG_DISCONTIGMEM_MANUAL is not set
+CONFIG_SPLIT_PTLOCK_CPUS=4096
+# CONFIG_IPW2100 is not set
+# CONFIG_DETECT_SOFTLOCKUP is not set
+# CONFIG_DEBUG_RODATA is not set

Added: dists/sid/linux-2.6/debian/config/hppa/config.parisc
==============================================================================
--- (empty file)
+++ dists/sid/linux-2.6/debian/config/hppa/config.parisc	Mon Nov 26 20:06:56 2007
@@ -0,0 +1,14 @@
+CONFIG_BROKEN_ON_SMP=y
+CONFIG_PA7000=y
+# CONFIG_PA8X00 is not set
+CONFIG_PA11=y
+# CONFIG_SMP is not set
+# CONFIG_HPUX is not set
+# CONFIG_SCSI_DPT_I2O is not set
+# CONFIG_SCSI_NSP32 is not set
+CONFIG_PCMCIA_AHA152X=m
+CONFIG_PCMCIA_NINJA_SCSI=m
+# CONFIG_NI5010 is not set
+# CONFIG_PCMCIA_XIRTULIP is not set
+CONFIG_TLAN=m
+# CONFIG_ARLAN is not set

Added: dists/sid/linux-2.6/debian/config/hppa/config.parisc-smp
==============================================================================
--- (empty file)
+++ dists/sid/linux-2.6/debian/config/hppa/config.parisc-smp	Mon Nov 26 20:06:56 2007
@@ -0,0 +1,16 @@
+CONFIG_LOCK_KERNEL=y
+CONFIG_STOP_MACHINE=y
+CONFIG_PA7000=y
+# CONFIG_PA8X00 is not set
+CONFIG_PA11=y
+CONFIG_SMP=y
+CONFIG_HOTPLUG_CPU=y
+# CONFIG_HPUX is not set
+CONFIG_NR_CPUS=8
+# CONFIG_SCSI_DPT_I2O is not set
+# CONFIG_SCSI_NSP32 is not set
+CONFIG_PCMCIA_AHA152X=m
+CONFIG_PCMCIA_NINJA_SCSI=m
+CONFIG_TLAN=m
+# CONFIG_ARLAN is not set
+# CONFIG_DEBUG_RWLOCK is not set

Added: dists/sid/linux-2.6/debian/config/hppa/config.parisc64
==============================================================================
--- (empty file)
+++ dists/sid/linux-2.6/debian/config/hppa/config.parisc64	Mon Nov 26 20:06:56 2007
@@ -0,0 +1,13 @@
+CONFIG_BROKEN_ON_SMP=y
+# CONFIG_PA7000 is not set
+CONFIG_PA8X00=y
+CONFIG_PA20=y
+CONFIG_PREFETCH=y
+CONFIG_64BIT=y
+# CONFIG_SMP is not set
+CONFIG_DISCONTIGMEM=y
+CONFIG_COMPAT=y
+# CONFIG_NI5010 is not set
+# CONFIG_PCMCIA_XIRTULIP is not set
+CONFIG_NEED_MULTIPLE_NODES=y
+# CONFIG_FLATMEM_MANUAL is not set

Added: dists/sid/linux-2.6/debian/config/hppa/config.parisc64-smp
==============================================================================
--- (empty file)
+++ dists/sid/linux-2.6/debian/config/hppa/config.parisc64-smp	Mon Nov 26 20:06:56 2007
@@ -0,0 +1,15 @@
+CONFIG_LOCK_KERNEL=y
+CONFIG_STOP_MACHINE=y
+# CONFIG_PA7000 is not set
+CONFIG_PA8X00=y
+CONFIG_PA20=y
+CONFIG_PREFETCH=y
+CONFIG_64BIT=y
+CONFIG_SMP=y
+CONFIG_HOTPLUG_CPU=y
+CONFIG_DISCONTIGMEM=y
+CONFIG_COMPAT=y
+CONFIG_NR_CPUS=8
+# CONFIG_DEBUG_RWLOCK is not set
+CONFIG_NEED_MULTIPLE_NODES=y
+# CONFIG_FLATMEM_MANUAL is not set

Added: dists/sid/linux-2.6/debian/config/hppa/defines
==============================================================================
--- (empty file)
+++ dists/sid/linux-2.6/debian/config/hppa/defines	Mon Nov 26 20:06:56 2007
@@ -0,0 +1,32 @@
+[base]
+flavours:
+ parisc
+ parisc-smp
+ parisc64
+ parisc64-smp
+kernel-arch: parisc
+kernel-header-dirs: parisc
+
+[image]
+suggests: palo
+type: kernel-package
+
+[parisc_base]
+class: 32-bit PA-RISC
+
+[parisc-smp_base]
+class: multiprocessor 32-bit PA-RISC
+
+[parisc64_base]
+cflags: -fno-cse-follow-jumps
+class: 64-bit PA-RISC
+override-host-type: hppa64-linux-gnu
+
+[parisc64-smp_base]
+cflags: -fno-cse-follow-jumps
+class: multiprocessor 64-bit PA-RISC
+override-host-type: hppa64-linux-gnu
+
+[relations]
+gcc-4.1: gcc-4.1, binutils-hppa64, gcc-4.1-hppa64
+

Added: dists/sid/linux-2.6/debian/config/i386/config
==============================================================================
--- (empty file)
+++ dists/sid/linux-2.6/debian/config/i386/config	Mon Nov 26 20:06:56 2007
@@ -0,0 +1,1580 @@
+CONFIG_NO_HZ=y
+CONFIG_HIGH_RES_TIMERS=y
+CONFIG_SEMAPHORE_SLEEPERS=y
+CONFIG_X86=y
+CONFIG_UID16=y
+CONFIG_GENERIC_ISA_DMA=y
+CONFIG_GENERIC_IOMAP=y
+CONFIG_DMI=y
+CONFIG_DMIID=y
+# CONFIG_IKCONFIG is not set
+# CONFIG_KALLSYMS_ALL is not set
+CONFIG_X86_PC=y
+# CONFIG_X86_ELAN is not set
+# CONFIG_X86_VOYAGER is not set
+# CONFIG_X86_NUMAQ is not set
+# CONFIG_X86_SUMMIT is not set
+# CONFIG_X86_BIGSMP is not set
+# CONFIG_X86_VISWS is not set
+# CONFIG_X86_GENERICARCH is not set
+# CONFIG_X86_ES7000 is not set
+# CONFIG_M586 is not set
+# CONFIG_M586TSC is not set
+# CONFIG_M586MMX is not set
+# CONFIG_MPENTIUMII is not set
+# CONFIG_MPENTIUMIII is not set
+# CONFIG_MPENTIUMM is not set
+# CONFIG_MPENTIUM4 is not set
+# CONFIG_MK6 is not set
+# CONFIG_MK8 is not set
+# CONFIG_MCRUSOE is not set
+# CONFIG_MEFFICEON is not set
+# CONFIG_MWINCHIPC6 is not set
+# CONFIG_MWINCHIP2 is not set
+# CONFIG_MWINCHIP3D is not set
+# CONFIG_MGEODEGX1 is not set
+# CONFIG_MCYRIXIII is not set
+# CONFIG_MVIAC3_2 is not set
+CONFIG_HPET_TIMER=y
+CONFIG_X86_LOCAL_APIC=y
+CONFIG_X86_IO_APIC=y
+CONFIG_TOSHIBA=m
+CONFIG_I8K=m
+# CONFIG_X86_REBOOTFIXUPS is not set
+CONFIG_MICROCODE=m
+CONFIG_MICROCODE_OLD_INTERFACE=y
+CONFIG_X86_MSR=m
+CONFIG_X86_CPUID=m
+CONFIG_EDD=m
+CONFIG_DELL_RBU=m
+# CONFIG_HIGHMEM64G is not set
+CONFIG_MTRR=y
+CONFIG_PM=y
+# CONFIG_PM_DEBUG is not set
+CONFIG_SUSPEND=y
+CONFIG_HIBERNATION=y
+CONFIG_PM_STD_PARTITION=""
+CONFIG_ACPI=y
+CONFIG_ACPI_SLEEP=y
+CONFIG_ACPI_PROCFS=y
+CONFIG_ACPI_PROC_EVENT=y
+CONFIG_ACPI_AC=m
+CONFIG_ACPI_BATTERY=m
+CONFIG_ACPI_BUTTON=m
+CONFIG_ACPI_VIDEO=m
+CONFIG_ACPI_FAN=m
+CONFIG_ACPI_BAY=m
+CONFIG_ACPI_PROCESSOR=m
+CONFIG_ACPI_THERMAL=m
+CONFIG_ACPI_ASUS=m
+# CONFIG_SONYPI_COMPAT is not set
+CONFIG_THINKPAD_ACPI=m
+CONFIG_THINKPAD_ACPI_BAY=y
+# CONFIG_THINKPAD_ACPI_DEBUG is not set
+CONFIG_ACPI_TOSHIBA=m
+CONFIG_ACPI_BLACKLIST_YEAR=0
+# CONFIG_ACPI_DEBUG is not set
+CONFIG_ACPI_EC=y
+CONFIG_ACPI_POWER=y
+CONFIG_ACPI_SYSTEM=y
+CONFIG_X86_PM_TIMER=y
+CONFIG_ACPI_CONTAINER=m
+CONFIG_APM=m
+# CONFIG_APM_IGNORE_USER_SUSPEND is not set
+# CONFIG_APM_DO_ENABLE is not set
+# CONFIG_APM_CPU_IDLE is not set
+# CONFIG_APM_DISPLAY_BLANK is not set
+# CONFIG_APM_ALLOW_INTS is not set
+# CONFIG_APM_REAL_MODE_POWER_OFF is not set
+CONFIG_CPU_FREQ=y
+CONFIG_CPU_FREQ_TABLE=m
+# CONFIG_CPU_FREQ_DEBUG is not set
+CONFIG_CPU_FREQ_STAT=m
+CONFIG_CPU_FREQ_DEFAULT_GOV_PERFORMANCE=y
+# CONFIG_CPU_FREQ_DEFAULT_GOV_USERSPACE is not set
+CONFIG_CPU_FREQ_GOV_PERFORMANCE=y
+CONFIG_CPU_FREQ_GOV_POWERSAVE=m
+CONFIG_CPU_FREQ_GOV_USERSPACE=m
+CONFIG_CPU_FREQ_GOV_ONDEMAND=m
+CONFIG_CPU_FREQ_GOV_CONSERVATIVE=m
+CONFIG_X86_ACPI_CPUFREQ=m
+CONFIG_X86_POWERNOW_K6=m
+CONFIG_X86_POWERNOW_K7=m
+CONFIG_X86_POWERNOW_K7_ACPI=y
+CONFIG_X86_POWERNOW_K8=m
+CONFIG_X86_POWERNOW_K8_ACPI=y
+CONFIG_X86_GX_SUSPMOD=m
+CONFIG_X86_SPEEDSTEP_CENTRINO=m
+CONFIG_X86_SPEEDSTEP_CENTRINO_TABLE=y
+CONFIG_X86_SPEEDSTEP_ICH=m
+CONFIG_X86_SPEEDSTEP_SMI=m
+CONFIG_X86_P4_CLOCKMOD=m
+CONFIG_X86_CPUFREQ_NFORCE2=m
+CONFIG_X86_LONGRUN=m
+CONFIG_X86_LONGHAUL=m
+CONFIG_X86_E_POWERSAVER=m
+# CONFIG_X86_ACPI_CPUFREQ_PROC_INTF is not set
+CONFIG_X86_SPEEDSTEP_LIB=m
+CONFIG_X86_SPEEDSTEP_RELAXED_CAP_CHECK=y
+CONFIG_PCI=y
+# CONFIG_PCI_GOBIOS is not set
+# CONFIG_PCI_GOMMCONFIG is not set
+# CONFIG_PCI_GODIRECT is not set
+CONFIG_PCI_GOANY=y
+CONFIG_PCI_BIOS=y
+CONFIG_PCI_DIRECT=y
+CONFIG_PCI_MMCONFIG=y
+CONFIG_PCIEPORTBUS=y
+CONFIG_HOTPLUG_PCI_PCIE=m
+# CONFIG_HOTPLUG_PCI_PCIE_POLL_EVENT_MODE is not set
+CONFIG_PCI_MSI=y
+# CONFIG_PCI_DEBUG is not set
+CONFIG_ISA_DMA_API=y
+CONFIG_ISA=y
+CONFIG_SCx200=m
+CONFIG_PCCARD=m
+# CONFIG_PCMCIA_DEBUG is not set
+CONFIG_PCMCIA=m
+CONFIG_CARDBUS=y
+CONFIG_YENTA=m
+CONFIG_PD6729=m
+CONFIG_I82092=m
+CONFIG_I82365=m
+CONFIG_TCIC=m
+CONFIG_PCCARD_NONSTATIC=m
+CONFIG_HOTPLUG_PCI=m
+CONFIG_HOTPLUG_PCI_FAKE=m
+CONFIG_HOTPLUG_PCI_COMPAQ=m
+CONFIG_HOTPLUG_PCI_IBM=m
+CONFIG_HOTPLUG_PCI_ACPI=m
+CONFIG_HOTPLUG_PCI_ACPI_IBM=m
+CONFIG_HOTPLUG_PCI_CPCI_ZT5550=m
+CONFIG_HOTPLUG_PCI_CPCI_GENERIC=m
+CONFIG_HOTPLUG_PCI_SHPC=m
+CONFIG_BINFMT_AOUT=m
+CONFIG_STANDALONE=y
+# CONFIG_DEBUG_DRIVER is not set
+CONFIG_MTD=m
+# CONFIG_MTD_DEBUG is not set
+CONFIG_MTD_CONCAT=m
+CONFIG_MTD_PARTITIONS=y
+CONFIG_MTD_REDBOOT_PARTS=m
+CONFIG_MTD_REDBOOT_DIRECTORY_BLOCK=-1
+# CONFIG_MTD_REDBOOT_PARTS_UNALLOCATED is not set
+# CONFIG_MTD_REDBOOT_PARTS_READONLY is not set
+# CONFIG_MTD_CMDLINE_PARTS is not set
+CONFIG_MTD_CHAR=m
+CONFIG_MTD_BLOCK=m
+CONFIG_MTD_BLOCK_RO=m
+CONFIG_FTL=m
+CONFIG_NFTL=m
+CONFIG_NFTL_RW=y
+CONFIG_INFTL=m
+CONFIG_MTD_CFI=m
+CONFIG_MTD_JEDECPROBE=m
+CONFIG_MTD_GEN_PROBE=m
+# CONFIG_MTD_CFI_ADV_OPTIONS is not set
+CONFIG_MTD_MAP_BANK_WIDTH_1=y
+CONFIG_MTD_MAP_BANK_WIDTH_2=y
+CONFIG_MTD_MAP_BANK_WIDTH_4=y
+# CONFIG_MTD_MAP_BANK_WIDTH_8 is not set
+# CONFIG_MTD_MAP_BANK_WIDTH_16 is not set
+# CONFIG_MTD_MAP_BANK_WIDTH_32 is not set
+CONFIG_MTD_CFI_I1=y
+CONFIG_MTD_CFI_I2=y
+# CONFIG_MTD_CFI_I4 is not set
+# CONFIG_MTD_CFI_I8 is not set
+CONFIG_MTD_CFI_INTELEXT=m
+CONFIG_MTD_CFI_AMDSTD=m
+CONFIG_MTD_CFI_STAA=m
+CONFIG_MTD_CFI_UTIL=m
+CONFIG_MTD_RAM=m
+CONFIG_MTD_ROM=m
+CONFIG_MTD_ABSENT=m
+CONFIG_MTD_COMPLEX_MAPPINGS=y
+CONFIG_MTD_PHYSMAP=m
+CONFIG_MTD_PHYSMAP_START=0x8000000
+CONFIG_MTD_PHYSMAP_LEN=0x4000000
+CONFIG_MTD_PHYSMAP_BANKWIDTH=2
+CONFIG_MTD_PNC2000=m
+CONFIG_MTD_SC520CDP=m
+CONFIG_MTD_NETSC520=m
+CONFIG_MTD_TS5500=m
+CONFIG_MTD_SBC_GXX=m
+CONFIG_MTD_SCx200_DOCFLASH=m
+# CONFIG_MTD_AMD76XROM is not set
+# CONFIG_MTD_ICHXROM is not set
+# CONFIG_MTD_SCB2_FLASH is not set
+CONFIG_MTD_NETtel=m
+CONFIG_MTD_DILNETPC=m
+CONFIG_MTD_DILNETPC_BOOTSIZE=0x80000
+# CONFIG_MTD_L440GX is not set
+CONFIG_MTD_PCI=m
+CONFIG_MTD_PCMCIA=m
+# CONFIG_MTD_PCMCIA_ANONYMOUS is not set
+CONFIG_MTD_PMC551=m
+# CONFIG_MTD_PMC551_BUGFIX is not set
+# CONFIG_MTD_PMC551_DEBUG is not set
+CONFIG_MTD_SLRAM=m
+CONFIG_MTD_PHRAM=m
+CONFIG_MTD_MTDRAM=m
+CONFIG_MTDRAM_TOTAL_SIZE=4096
+CONFIG_MTDRAM_ERASE_SIZE=128
+CONFIG_MTD_BLOCK2MTD=m
+CONFIG_MTD_DOC2000=m
+CONFIG_MTD_DOC2001=m
+CONFIG_MTD_DOC2001PLUS=m
+CONFIG_MTD_DOCPROBE=m
+CONFIG_MTD_DOCECC=m
+# CONFIG_MTD_DOCPROBE_ADVANCED is not set
+CONFIG_MTD_DOCPROBE_ADDRESS=0
+CONFIG_MTD_NAND=m
+# CONFIG_MTD_NAND_VERIFY_WRITE is not set
+CONFIG_MTD_NAND_IDS=m
+CONFIG_MTD_NAND_DISKONCHIP=m
+# CONFIG_MTD_NAND_DISKONCHIP_PROBE_ADVANCED is not set
+CONFIG_MTD_NAND_DISKONCHIP_PROBE_ADDRESS=0
+# CONFIG_MTD_NAND_DISKONCHIP_BBTWRITE is not set
+# CONFIG_MTD_NAND_NANDSIM is not set
+CONFIG_MTD_NAND_PLATFORM=m
+
+CONFIG_PNP=y
+# CONFIG_PNP_DEBUG is not set
+CONFIG_ISAPNP=y
+CONFIG_PNPBIOS=y
+CONFIG_PNPBIOS_PROC_FS=y
+CONFIG_PNPACPI=y
+CONFIG_BLK_DEV_FD=m
+CONFIG_BLK_DEV_XD=m
+CONFIG_PARIDE=m
+CONFIG_PARIDE_PD=m
+CONFIG_PARIDE_PCD=m
+CONFIG_PARIDE_PF=m
+CONFIG_PARIDE_PT=m
+CONFIG_PARIDE_PG=m
+CONFIG_PARIDE_ATEN=m
+CONFIG_PARIDE_BPCK=m
+CONFIG_PARIDE_BPCK6=m
+CONFIG_PARIDE_COMM=m
+CONFIG_PARIDE_DSTR=m
+CONFIG_PARIDE_FIT2=m
+CONFIG_PARIDE_FIT3=m
+CONFIG_PARIDE_EPAT=m
+# CONFIG_PARIDE_EPATC8 is not set
+CONFIG_PARIDE_EPIA=m
+CONFIG_PARIDE_FRIQ=m
+CONFIG_PARIDE_FRPW=m
+CONFIG_PARIDE_KBIC=m
+CONFIG_PARIDE_KTTI=m
+CONFIG_PARIDE_ON20=m
+CONFIG_PARIDE_ON26=m
+CONFIG_BLK_CPQ_DA=m
+CONFIG_BLK_CPQ_CISS_DA=m
+CONFIG_CISS_SCSI_TAPE=y
+CONFIG_BLK_DEV_DAC960=m
+CONFIG_BLK_DEV_UMEM=m
+CONFIG_BLK_DEV_LOOP=m
+CONFIG_BLK_DEV_CRYPTOLOOP=m
+CONFIG_BLK_DEV_NBD=m
+CONFIG_BLK_DEV_SX8=m
+# CONFIG_BLK_DEV_UB is not set
+CONFIG_BLK_DEV_RAM_SIZE=8192
+CONFIG_BLK_DEV_INITRD=y
+CONFIG_LBD=y
+CONFIG_CDROM_PKTCDVD=m
+CONFIG_CDROM_PKTCDVD_BUFFERS=8
+# CONFIG_CDROM_PKTCDVD_WCACHE is not set
+CONFIG_ATA_OVER_ETH=m
+CONFIG_IDE=m
+CONFIG_BLK_DEV_IDE=m
+# CONFIG_BLK_DEV_IDE_SATA is not set
+# CONFIG_BLK_DEV_HD_IDE is not set
+CONFIG_BLK_DEV_IDEDISK=m
+# CONFIG_IDEDISK_MULTI_MODE is not set
+CONFIG_BLK_DEV_IDECS=m
+CONFIG_BLK_DEV_IDECD=m
+CONFIG_BLK_DEV_IDETAPE=m
+CONFIG_BLK_DEV_IDEFLOPPY=m
+CONFIG_IDE_GENERIC=m
+CONFIG_BLK_DEV_CMD640=y
+# CONFIG_BLK_DEV_CMD640_ENHANCED is not set
+CONFIG_BLK_DEV_IDEPCI=y
+CONFIG_IDEPCI_SHARE_IRQ=y
+# CONFIG_BLK_DEV_OFFBOARD is not set
+CONFIG_BLK_DEV_GENERIC=m
+CONFIG_BLK_DEV_JMICRON=m
+CONFIG_BLK_DEV_OPTI621=m
+CONFIG_BLK_DEV_RZ1000=m
+CONFIG_BLK_DEV_IDEDMA_PCI=y
+# CONFIG_BLK_DEV_IDEDMA_FORCED is not set
+# CONFIG_IDEDMA_ONLYDISK is not set
+CONFIG_BLK_DEV_AEC62XX=m
+CONFIG_BLK_DEV_ALI15X3=m
+# CONFIG_WDC_ALI15X3 is not set
+CONFIG_BLK_DEV_AMD74XX=m
+CONFIG_BLK_DEV_ATIIXP=m
+CONFIG_BLK_DEV_CMD64X=m
+CONFIG_BLK_DEV_TRIFLEX=m
+CONFIG_BLK_DEV_CY82C693=m
+CONFIG_BLK_DEV_CS5520=m
+CONFIG_BLK_DEV_CS5530=m
+CONFIG_BLK_DEV_HPT34X=m
+# CONFIG_HPT34X_AUTODMA is not set
+CONFIG_BLK_DEV_HPT366=m
+CONFIG_BLK_DEV_SC1200=m
+CONFIG_BLK_DEV_PIIX=m
+CONFIG_BLK_DEV_NS87415=m
+CONFIG_BLK_DEV_PDC202XX_OLD=m
+CONFIG_PDC202XX_BURST=y
+CONFIG_BLK_DEV_PDC202XX_NEW=m
+CONFIG_BLK_DEV_SVWKS=m
+CONFIG_BLK_DEV_SIIMAGE=m
+CONFIG_BLK_DEV_SIS5513=m
+CONFIG_BLK_DEV_SLC90E66=m
+CONFIG_BLK_DEV_TRM290=m
+CONFIG_BLK_DEV_VIA82CXXX=m
+# CONFIG_IDE_ARM is not set
+# CONFIG_IDE_CHIPSETS is not set
+CONFIG_BLK_DEV_IDEDMA=y
+# CONFIG_IDEDMA_IVB is not set
+# CONFIG_BLK_DEV_HD is not set
+CONFIG_AIC7XXX_CMDS_PER_DEVICE=8
+CONFIG_SCSI_DPT_I2O=m
+CONFIG_SCSI_ADVANSYS=m
+CONFIG_SCSI_IN2000=m
+CONFIG_MEGARAID_NEWGEN=y
+CONFIG_MEGARAID_MM=m
+CONFIG_MEGARAID_MAILBOX=m
+CONFIG_MEGARAID_LEGACY=m
+CONFIG_SCSI_BUSLOGIC=m
+# CONFIG_SCSI_OMIT_FLASHPOINT is not set
+CONFIG_SCSI_DMX3191D=m
+CONFIG_SCSI_DTC3280=m
+CONFIG_SCSI_EATA=m
+CONFIG_SCSI_EATA_TAGGED_QUEUE=y
+CONFIG_SCSI_EATA_LINKED_COMMANDS=y
+CONFIG_SCSI_EATA_MAX_TAGS=16
+CONFIG_SCSI_EATA_PIO=m
+CONFIG_SCSI_FUTURE_DOMAIN=m
+CONFIG_SCSI_GDTH=m
+CONFIG_SCSI_GENERIC_NCR5380=m
+CONFIG_SCSI_GENERIC_NCR5380_MMIO=m
+CONFIG_SCSI_GENERIC_NCR53C400=y
+CONFIG_SCSI_IPS=m
+CONFIG_SCSI_INITIO=m
+# CONFIG_SCSI_INIA100 is not set
+CONFIG_SCSI_PPA=m
+CONFIG_SCSI_IMM=m
+# CONFIG_SCSI_IZIP_EPP16 is not set
+# CONFIG_SCSI_IZIP_SLOW_CTR is not set
+CONFIG_SCSI_NCR53C406A=m
+CONFIG_SCSI_SYM53C8XX_2=m
+CONFIG_SCSI_SYM53C8XX_DMA_ADDRESSING_MODE=1
+CONFIG_SCSI_SYM53C8XX_DEFAULT_TAGS=16
+CONFIG_SCSI_SYM53C8XX_MAX_TAGS=64
+CONFIG_SCSI_IPR=m
+# CONFIG_SCSI_IPR_TRACE is not set
+# CONFIG_SCSI_IPR_DUMP is not set
+CONFIG_SCSI_PAS16=m
+CONFIG_SCSI_PSI240I=m
+CONFIG_SCSI_QLOGIC_FAS=m
+CONFIG_SCSI_QLOGIC_FC=m
+CONFIG_SCSI_QLOGIC_FC_FIRMWARE=y
+CONFIG_SCSI_QLOGIC_1280=m
+CONFIG_SCSI_LPFC=m
+# CONFIG_SCSI_SEAGATE is not set
+CONFIG_SCSI_SYM53C416=m
+CONFIG_SCSI_DC395x=m
+CONFIG_SCSI_DC390T=m
+CONFIG_SCSI_T128=m
+CONFIG_SCSI_U14_34F=m
+CONFIG_SCSI_U14_34F_TAGGED_QUEUE=y
+CONFIG_SCSI_U14_34F_LINKED_COMMANDS=y
+CONFIG_SCSI_U14_34F_MAX_TAGS=8
+CONFIG_SCSI_ULTRASTOR=m
+CONFIG_SCSI_NSP32=m
+CONFIG_SCSI_DEBUG=m
+CONFIG_PCMCIA_AHA152X=m
+CONFIG_PCMCIA_FDOMAIN=m
+CONFIG_PCMCIA_NINJA_SCSI=m
+CONFIG_PCMCIA_QLOGIC=m
+CONFIG_PCMCIA_SYM53C500=m
+CONFIG_I2O=m
+CONFIG_I2O_CONFIG=m
+CONFIG_I2O_BLOCK=m
+CONFIG_I2O_SCSI=m
+CONFIG_I2O_PROC=m
+# CONFIG_MACINTOSH_DRIVERS is not set
+# CONFIG_IP_PNP is not set
+CONFIG_IP_SCTP=m
+# CONFIG_SCTP_DBG_MSG is not set
+# CONFIG_SCTP_DBG_OBJCNT is not set
+# CONFIG_SCTP_HMAC_NONE is not set
+CONFIG_ATM=y
+CONFIG_ATM_CLIP=y
+# CONFIG_ATM_CLIP_NO_ICMP is not set
+CONFIG_ATM_LANE=m
+CONFIG_ATM_MPOA=m
+CONFIG_ATM_BR2684=m
+# CONFIG_ATM_BR2684_IPFILTER is not set
+CONFIG_BRIDGE=m
+CONFIG_DECNET=m
+# CONFIG_DECNET_ROUTER is not set
+CONFIG_LLC=y
+CONFIG_LLC2=m
+CONFIG_IPX=m
+# CONFIG_IPX_INTERN is not set
+CONFIG_ATALK=m
+CONFIG_LTPC=m
+CONFIG_IPDDP=m
+CONFIG_IPDDP_ENCAP=y
+CONFIG_IPDDP_DECAP=y
+CONFIG_X25=m
+CONFIG_LAPB=m
+CONFIG_ECONET=m
+CONFIG_ECONET_AUNUDP=y
+CONFIG_ECONET_NATIVE=y
+CONFIG_WAN_ROUTER=m
+CONFIG_NETPOLL=y
+# CONFIG_NETPOLL_TRAP is not set
+CONFIG_NET_POLL_CONTROLLER=y
+CONFIG_HAMRADIO=y
+CONFIG_AX25=m
+# CONFIG_AX25_DAMA_SLAVE is not set
+CONFIG_NETROM=m
+CONFIG_ROSE=m
+CONFIG_BPQETHER=m
+CONFIG_SCC=m
+# CONFIG_SCC_DELAY is not set
+# CONFIG_SCC_TRXECHO is not set
+CONFIG_BAYCOM_SER_FDX=m
+CONFIG_BAYCOM_SER_HDX=m
+CONFIG_BAYCOM_PAR=m
+CONFIG_BAYCOM_EPP=m
+CONFIG_YAM=m
+CONFIG_IRDA=m
+CONFIG_IRLAN=m
+CONFIG_IRNET=m
+CONFIG_IRCOMM=m
+# CONFIG_IRDA_ULTRA is not set
+CONFIG_IRDA_CACHE_LAST_LSAP=y
+CONFIG_IRDA_FAST_RR=y
+CONFIG_IRDA_DEBUG=y
+CONFIG_IRTTY_SIR=m
+CONFIG_DONGLE=y
+CONFIG_ESI_DONGLE=m
+CONFIG_ACTISYS_DONGLE=m
+CONFIG_TEKRAM_DONGLE=m
+CONFIG_LITELINK_DONGLE=m
+CONFIG_MA600_DONGLE=m
+CONFIG_GIRBIL_DONGLE=m
+CONFIG_MCP2120_DONGLE=m
+CONFIG_OLD_BELKIN_DONGLE=m
+CONFIG_ACT200L_DONGLE=m
+CONFIG_KINGSUN_DONGLE=m
+
+CONFIG_USB_IRDA=m
+CONFIG_SIGMATEL_FIR=m
+CONFIG_NSC_FIR=m
+CONFIG_WINBOND_FIR=m
+CONFIG_TOSHIBA_FIR=m
+CONFIG_SMC_IRCC_FIR=m
+CONFIG_ALI_FIR=m
+CONFIG_VLSI_FIR=m
+CONFIG_VIA_FIR=m
+CONFIG_BT=m
+CONFIG_BT_L2CAP=m
+CONFIG_BT_SCO=m
+CONFIG_BT_RFCOMM=m
+CONFIG_BT_RFCOMM_TTY=y
+CONFIG_BT_BNEP=m
+CONFIG_BT_BNEP_MC_FILTER=y
+CONFIG_BT_BNEP_PROTO_FILTER=y
+CONFIG_BT_CMTP=m
+CONFIG_BT_HIDP=m
+CONFIG_BT_HCIUSB=m
+CONFIG_BT_HCIUSB_SCO=y
+CONFIG_BT_HCIUART=m
+CONFIG_BT_HCIUART_H4=y
+CONFIG_BT_HCIUART_BCSP=y
+CONFIG_BT_HCIBCM203X=m
+CONFIG_BT_HCIBPA10X=m
+CONFIG_BT_HCIBFUSB=m
+CONFIG_BT_HCIDTL1=m
+CONFIG_BT_HCIBT3C=m
+CONFIG_BT_HCIBLUECARD=m
+CONFIG_BT_HCIBTUART=m
+CONFIG_BT_HCIVHCI=m
+CONFIG_AF_RXRPC=m
+# CONFIG_AF_RXRPC_DEBUG is not set
+CONFIG_RXKAD=m
+
+CONFIG_NETDEVICES_MULTIQUEUE=y
+CONFIG_DUMMY=m
+CONFIG_NET_SB1000=m
+CONFIG_ARCNET=m
+CONFIG_ARCNET_1201=m
+CONFIG_ARCNET_1051=m
+CONFIG_ARCNET_RAW=m
+CONFIG_ARCNET_CAP=m
+CONFIG_ARCNET_COM90xx=m
+CONFIG_ARCNET_COM90xxIO=m
+CONFIG_ARCNET_RIM_I=m
+CONFIG_ARCNET_COM20020=m
+CONFIG_ARCNET_COM20020_ISA=m
+CONFIG_ARCNET_COM20020_PCI=m
+CONFIG_HAPPYMEAL=m
+CONFIG_SUNGEM=m
+CONFIG_NET_VENDOR_3COM=y
+CONFIG_EL1=m
+CONFIG_EL2=m
+CONFIG_ELPLUS=m
+CONFIG_EL16=m
+CONFIG_EL3=m
+CONFIG_3C515=m
+CONFIG_VORTEX=m
+CONFIG_TYPHOON=m
+CONFIG_LANCE=m
+CONFIG_NET_VENDOR_SMC=y
+CONFIG_WD80x3=m
+CONFIG_ULTRA=m
+CONFIG_SMC9194=m
+CONFIG_NET_VENDOR_RACAL=y
+CONFIG_NI52=m
+CONFIG_NI65=m
+CONFIG_NET_TULIP=y
+CONFIG_DE2104X=m
+CONFIG_TULIP=m
+# CONFIG_TULIP_MWI is not set
+# CONFIG_TULIP_MMIO is not set
+CONFIG_DE4X5=m
+CONFIG_WINBOND_840=m
+CONFIG_DM9102=m
+CONFIG_PCMCIA_XIRCOM=m
+CONFIG_AT1700=m
+CONFIG_DEPCA=m
+CONFIG_HP100=m
+CONFIG_NET_ISA=y
+CONFIG_E2100=m
+CONFIG_EWRK3=m
+CONFIG_EEXPRESS=m
+CONFIG_EEXPRESS_PRO=m
+CONFIG_HPLAN_PLUS=m
+CONFIG_HPLAN=m
+CONFIG_LP486E=m
+CONFIG_ETH16I=m
+CONFIG_NE2000=m
+CONFIG_ZNET=m
+CONFIG_SEEQ8005=m
+CONFIG_NET_PCI=y
+CONFIG_PCNET32=m
+CONFIG_AMD8111_ETH=m
+CONFIG_ADAPTEC_STARFIRE=m
+CONFIG_AC3200=m
+CONFIG_APRICOT=m
+CONFIG_B44=m
+CONFIG_FORCEDETH=m
+CONFIG_CS89x0=m
+CONFIG_EEPRO100=m
+CONFIG_E100=m
+CONFIG_FEALNX=m
+CONFIG_NATSEMI=m
+CONFIG_NE2K_PCI=m
+CONFIG_8139CP=m
+CONFIG_8139TOO=m
+CONFIG_8139TOO_PIO=y
+CONFIG_8139TOO_TUNE_TWISTER=y
+CONFIG_8139TOO_8129=y
+# CONFIG_8139_OLD_RX_RESET is not set
+CONFIG_SIS900=m
+CONFIG_EPIC100=m
+CONFIG_SUNDANCE=m
+# CONFIG_SUNDANCE_MMIO is not set
+CONFIG_TLAN=m
+CONFIG_VIA_RHINE=m
+# CONFIG_VIA_RHINE_MMIO is not set
+CONFIG_ATP=m
+CONFIG_DE600=m
+CONFIG_DE620=m
+CONFIG_DL2K=m
+CONFIG_E1000=m
+CONFIG_NS83820=m
+CONFIG_HAMACHI=m
+CONFIG_YELLOWFIN=m
+CONFIG_R8169=m
+CONFIG_R8169_VLAN=y
+CONFIG_VIA_VELOCITY=m
+CONFIG_TIGON3=m
+CONFIG_BNX2=m
+CONFIG_IXGB=m
+CONFIG_S2IO=m
+CONFIG_WLAN_PRE80211=y
+CONFIG_STRIP=m
+CONFIG_ARLAN=m
+CONFIG_WAVELAN=m
+CONFIG_PCMCIA_WAVELAN=m
+CONFIG_PCMCIA_NETWAVE=m
+CONFIG_WLAN_80211=y
+CONFIG_PCMCIA_RAYCS=m
+CONFIG_HERMES=m
+CONFIG_PLX_HERMES=m
+CONFIG_TMD_HERMES=m
+CONFIG_PCI_HERMES=m
+CONFIG_ATMEL=m
+CONFIG_PCI_ATMEL=m
+CONFIG_PCMCIA_HERMES=m
+CONFIG_AIRO_CS=m
+CONFIG_PCMCIA_ATMEL=m
+CONFIG_PCMCIA_WL3501=m
+CONFIG_PRISM54=m
+CONFIG_NET_PCMCIA=y
+CONFIG_PCMCIA_3C589=m
+CONFIG_PCMCIA_3C574=m
+CONFIG_PCMCIA_FMVJ18X=m
+CONFIG_PCMCIA_PCNET=m
+CONFIG_PCMCIA_NMCLAN=m
+CONFIG_PCMCIA_SMC91C92=m
+CONFIG_PCMCIA_XIRC2PS=m
+CONFIG_PCMCIA_AXNET=m
+CONFIG_ARCNET_COM20020_CS=m
+CONFIG_PCMCIA_IBMTR=m
+CONFIG_WAN=y
+CONFIG_HOSTESS_SV11=m
+CONFIG_COSA=m
+CONFIG_DSCC4=m
+CONFIG_DSCC4_PCISYNC=y
+CONFIG_DSCC4_PCI_RST=y
+CONFIG_LANMEDIA=m
+CONFIG_SEALEVEL_4021=m
+CONFIG_PCI200SYN=m
+CONFIG_WANXL=m
+CONFIG_PC300=m
+CONFIG_PC300_MLPPP=y
+CONFIG_N2=m
+CONFIG_C101=m
+CONFIG_FARSYNC=m
+CONFIG_DLCI=m
+CONFIG_DLCI_MAX=8
+CONFIG_SDLA=m
+CONFIG_CYCLADES_SYNC=m
+CONFIG_CYCLOMX_X25=y
+CONFIG_LAPBETHER=m
+CONFIG_X25_ASY=m
+CONFIG_SBNI=m
+# CONFIG_SBNI_MULTILINE is not set
+CONFIG_ATM_DRIVERS=y
+CONFIG_ATM_TCP=m
+CONFIG_ATM_LANAI=m
+CONFIG_ATM_ENI=m
+# CONFIG_ATM_ENI_DEBUG is not set
+# CONFIG_ATM_ENI_TUNE_BURST is not set
+CONFIG_ATM_FIRESTREAM=m
+CONFIG_ATM_ZATM=m
+# CONFIG_ATM_ZATM_DEBUG is not set
+CONFIG_ATM_NICSTAR=m
+# CONFIG_ATM_NICSTAR_USE_SUNI is not set
+# CONFIG_ATM_NICSTAR_USE_IDT77105 is not set
+CONFIG_ATM_IDT77252=m
+# CONFIG_ATM_IDT77252_DEBUG is not set
+# CONFIG_ATM_IDT77252_RCV_ALL is not set
+CONFIG_ATM_IDT77252_USE_SUNI=y
+CONFIG_ATM_AMBASSADOR=m
+# CONFIG_ATM_AMBASSADOR_DEBUG is not set
+CONFIG_ATM_HORIZON=m
+# CONFIG_ATM_HORIZON_DEBUG is not set
+CONFIG_ATM_IA=m
+# CONFIG_ATM_IA_DEBUG is not set
+CONFIG_ATM_FORE200E_MAYBE=m
+CONFIG_ATM_FORE200E_PCA=y
+CONFIG_ATM_FORE200E_PCA_DEFAULT_FW=y
+# CONFIG_ATM_FORE200E_USE_TASKLET is not set
+CONFIG_ATM_FORE200E_TX_RETRY=16
+CONFIG_ATM_FORE200E_DEBUG=0
+CONFIG_ATM_FORE200E=m
+CONFIG_ATM_HE=m
+CONFIG_ATM_HE_USE_SUNI=y
+CONFIG_FDDI=y
+CONFIG_DEFXX=m
+CONFIG_SKFP=m
+CONFIG_HIPPI=y
+CONFIG_ROADRUNNER=m
+# CONFIG_ROADRUNNER_LARGE_RINGS is not set
+CONFIG_PLIP=m
+CONFIG_PPP=m
+CONFIG_PPP_MULTILINK=y
+CONFIG_PPP_FILTER=y
+CONFIG_PPP_ASYNC=m
+CONFIG_PPP_SYNC_TTY=m
+CONFIG_PPP_DEFLATE=m
+CONFIG_PPP_BSDCOMP=m
+CONFIG_PPPOE=m
+CONFIG_PPPOATM=m
+CONFIG_SLIP=m
+CONFIG_SLIP_COMPRESSED=y
+CONFIG_SLIP_SMART=y
+CONFIG_SLIP_MODE_SLIP6=y
+CONFIG_NET_FC=y
+CONFIG_SHAPER=m
+CONFIG_NETCONSOLE=m
+CONFIG_ISDN=m
+CONFIG_ISDN_I4L=m
+CONFIG_ISDN_PPP=y
+CONFIG_ISDN_PPP_VJ=y
+CONFIG_ISDN_MPP=y
+CONFIG_IPPP_FILTER=y
+CONFIG_ISDN_PPP_BSDCOMP=m
+CONFIG_ISDN_AUDIO=y
+CONFIG_ISDN_TTY_FAX=y
+CONFIG_ISDN_X25=y
+# CONFIG_ISDN_DIVERSION is not set
+CONFIG_ISDN_DRV_HISAX=m
+CONFIG_HISAX_EURO=y
+CONFIG_DE_AOC=y
+# CONFIG_HISAX_NO_SENDCOMPLETE is not set
+# CONFIG_HISAX_NO_LLC is not set
+# CONFIG_HISAX_NO_KEYPAD is not set
+CONFIG_HISAX_1TR6=y
+CONFIG_HISAX_NI1=y
+CONFIG_HISAX_MAX_CARDS=8
+CONFIG_HISAX_16_0=y
+CONFIG_HISAX_16_3=y
+CONFIG_HISAX_TELESPCI=y
+CONFIG_HISAX_S0BOX=y
+CONFIG_HISAX_AVM_A1=y
+CONFIG_HISAX_FRITZPCI=y
+CONFIG_HISAX_AVM_A1_PCMCIA=y
+CONFIG_HISAX_ELSA=y
+CONFIG_HISAX_IX1MICROR2=y
+CONFIG_HISAX_DIEHLDIVA=y
+CONFIG_HISAX_ASUSCOM=y
+CONFIG_HISAX_TELEINT=y
+CONFIG_HISAX_HFCS=y
+CONFIG_HISAX_SEDLBAUER=y
+CONFIG_HISAX_SPORTSTER=y
+CONFIG_HISAX_MIC=y
+CONFIG_HISAX_NETJET=y
+CONFIG_HISAX_NETJET_U=y
+CONFIG_HISAX_NICCY=y
+CONFIG_HISAX_ISURF=y
+CONFIG_HISAX_HSTSAPHIR=y
+CONFIG_HISAX_BKM_A4T=y
+CONFIG_HISAX_SCT_QUADRO=y
+CONFIG_HISAX_GAZEL=y
+CONFIG_HISAX_HFC_PCI=y
+CONFIG_HISAX_W6692=y
+CONFIG_HISAX_HFC_SX=y
+CONFIG_HISAX_ENTERNOW_PCI=y
+# CONFIG_HISAX_DEBUG is not set
+CONFIG_HISAX_SEDLBAUER_CS=m
+CONFIG_HISAX_ELSA_CS=m
+CONFIG_HISAX_AVM_A1_CS=m
+CONFIG_HISAX_TELES_CS=m
+CONFIG_HISAX_ST5481=m
+CONFIG_HISAX_HFCUSB=m
+CONFIG_HISAX_HFC4S8S=m
+CONFIG_HISAX_FRITZ_PCIPNP=m
+CONFIG_HISAX_HDLC=y
+CONFIG_ISDN_DRV_ICN=m
+CONFIG_ISDN_DRV_PCBIT=m
+CONFIG_ISDN_DRV_SC=m
+CONFIG_ISDN_DRV_ACT2000=m
+CONFIG_ISDN_CAPI=m
+CONFIG_ISDN_DRV_AVMB1_VERBOSE_REASON=y
+CONFIG_CAPI_TRACE=y
+CONFIG_ISDN_CAPI_MIDDLEWARE=y
+CONFIG_ISDN_CAPI_CAPI20=m
+CONFIG_ISDN_CAPI_CAPIFS_BOOL=y
+CONFIG_ISDN_CAPI_CAPIFS=m
+CONFIG_ISDN_CAPI_CAPIDRV=m
+CONFIG_CAPI_AVM=y
+CONFIG_ISDN_DRV_AVMB1_B1ISA=m
+CONFIG_ISDN_DRV_AVMB1_B1PCI=m
+CONFIG_ISDN_DRV_AVMB1_T1ISA=m
+CONFIG_ISDN_DRV_AVMB1_B1PCMCIA=m
+CONFIG_ISDN_DRV_AVMB1_T1PCI=m
+CONFIG_ISDN_DRV_AVMB1_C4=m
+CONFIG_CAPI_EICON=y
+CONFIG_ISDN_DIVAS=m
+CONFIG_ISDN_DIVAS_BRIPCI=y
+CONFIG_ISDN_DIVAS_PRIPCI=y
+CONFIG_ISDN_DIVAS_DIVACAPI=m
+CONFIG_ISDN_DIVAS_USERIDI=m
+CONFIG_ISDN_DIVAS_MAINT=m
+CONFIG_PHONE=m
+CONFIG_PHONE_IXJ=m
+CONFIG_PHONE_IXJ_PCMCIA=m
+CONFIG_INPUT=y
+CONFIG_INPUT_MOUSEDEV_PSAUX=y
+CONFIG_INPUT_MOUSEDEV_SCREEN_X=1024
+CONFIG_INPUT_MOUSEDEV_SCREEN_Y=768
+CONFIG_INPUT_JOYDEV=m
+CONFIG_INPUT_TSDEV=m
+CONFIG_INPUT_TSDEV_SCREEN_X=240
+CONFIG_INPUT_TSDEV_SCREEN_Y=320
+CONFIG_INPUT_EVDEV=m
+CONFIG_INPUT_KEYBOARD=y
+CONFIG_KEYBOARD_ATKBD=y
+CONFIG_KEYBOARD_SUNKBD=m
+CONFIG_KEYBOARD_LKKBD=m
+CONFIG_KEYBOARD_XTKBD=m
+CONFIG_KEYBOARD_NEWTON=m
+CONFIG_INPUT_MOUSE=y
+CONFIG_MOUSE_PS2=m
+CONFIG_MOUSE_SERIAL=m
+CONFIG_MOUSE_APPLETOUCH=m
+CONFIG_MOUSE_INPORT=m
+# CONFIG_MOUSE_ATIXL is not set
+CONFIG_MOUSE_LOGIBM=m
+CONFIG_MOUSE_PC110PAD=m
+CONFIG_MOUSE_VSXXXAA=m
+CONFIG_INPUT_JOYSTICK=y
+CONFIG_JOYSTICK_ANALOG=m
+CONFIG_JOYSTICK_A3D=m
+CONFIG_JOYSTICK_ADI=m
+CONFIG_JOYSTICK_COBRA=m
+CONFIG_JOYSTICK_GF2K=m
+CONFIG_JOYSTICK_GRIP=m
+CONFIG_JOYSTICK_GRIP_MP=m
+CONFIG_JOYSTICK_GUILLEMOT=m
+CONFIG_JOYSTICK_INTERACT=m
+CONFIG_JOYSTICK_SIDEWINDER=m
+CONFIG_JOYSTICK_TMDC=m
+CONFIG_JOYSTICK_IFORCE=m
+CONFIG_JOYSTICK_IFORCE_USB=y
+CONFIG_JOYSTICK_IFORCE_232=y
+CONFIG_JOYSTICK_WARRIOR=m
+CONFIG_JOYSTICK_MAGELLAN=m
+CONFIG_JOYSTICK_SPACEORB=m
+CONFIG_JOYSTICK_SPACEBALL=m
+CONFIG_JOYSTICK_STINGER=m
+CONFIG_JOYSTICK_TWIDJOY=m
+CONFIG_JOYSTICK_DB9=m
+CONFIG_JOYSTICK_GAMECON=m
+CONFIG_JOYSTICK_TURBOGRAFX=m
+CONFIG_JOYSTICK_JOYDUMP=m
+CONFIG_JOYSTICK_XPAD=m
+CONFIG_INPUT_TABLET=y
+CONFIG_TABLET_USB_ACECAD=m
+CONFIG_TABLET_USB_AIPTEK=m
+CONFIG_TABLET_USB_GTCO=m
+CONFIG_TABLET_USB_KBTAB=m
+CONFIG_TABLET_USB_WACOM=m
+CONFIG_INPUT_TOUCHSCREEN=y
+CONFIG_TOUCHSCREEN_GUNZE=m
+CONFIG_TOUCHSCREEN_ELO=m
+CONFIG_TOUCHSCREEN_MTOUCH=m
+CONFIG_TOUCHSCREEN_MK712=m
+CONFIG_TOUCHSCREEN_USB_COMPOSITE=m
+CONFIG_INPUT_MISC=y
+CONFIG_INPUT_PCSPKR=m
+CONFIG_INPUT_ATLAS_BTNS=m
+CONFIG_INPUT_UINPUT=m
+CONFIG_SERIO=y
+CONFIG_SERIO_I8042=y
+CONFIG_SERIO_SERPORT=m
+CONFIG_SERIO_CT82C710=m
+CONFIG_SERIO_PARKBD=m
+CONFIG_SERIO_PCIPS2=m
+CONFIG_SERIO_LIBPS2=y
+CONFIG_SERIO_RAW=m
+CONFIG_GAMEPORT=m
+CONFIG_GAMEPORT_NS558=m
+CONFIG_GAMEPORT_L4=m
+CONFIG_GAMEPORT_EMU10K1=m
+CONFIG_GAMEPORT_FM801=m
+CONFIG_VT=y
+CONFIG_VT_CONSOLE=y
+CONFIG_HW_CONSOLE=y
+CONFIG_SERIAL_NONSTANDARD=y
+CONFIG_ROCKETPORT=m
+CONFIG_CYCLADES=m
+# CONFIG_CYZ_INTR is not set
+# CONFIG_ESPSERIAL is not set
+CONFIG_MOXA_SMARTIO=m
+# CONFIG_ISI is not set
+CONFIG_SYNCLINK=m
+CONFIG_SYNCLINKMP=m
+CONFIG_N_HDLC=m
+# CONFIG_RISCOM8 is not set
+# CONFIG_SPECIALIX is not set
+CONFIG_STALDRV=y
+CONFIG_SERIAL_8250=y
+CONFIG_SERIAL_8250_CONSOLE=y
+CONFIG_SERIAL_8250_CS=m
+CONFIG_SERIAL_8250_NR_UARTS=16
+CONFIG_SERIAL_8250_EXTENDED=y
+CONFIG_SERIAL_8250_MANY_PORTS=y
+CONFIG_SERIAL_8250_SHARE_IRQ=y
+# CONFIG_SERIAL_8250_DETECT_IRQ is not set
+CONFIG_SERIAL_8250_RSA=y
+CONFIG_SERIAL_CORE=y
+CONFIG_SERIAL_CORE_CONSOLE=y
+CONFIG_SERIAL_JSM=m
+CONFIG_PRINTER=m
+# CONFIG_LP_CONSOLE is not set
+CONFIG_PPDEV=m
+CONFIG_TIPAR=m
+CONFIG_IPMI_HANDLER=m
+# CONFIG_IPMI_PANIC_EVENT is not set
+CONFIG_IPMI_DEVICE_INTERFACE=m
+CONFIG_IPMI_SI=m
+CONFIG_IPMI_WATCHDOG=m
+CONFIG_IPMI_POWEROFF=m
+CONFIG_WATCHDOG=y
+# CONFIG_WATCHDOG_NOWAYOUT is not set
+CONFIG_SOFT_WATCHDOG=m
+CONFIG_ACQUIRE_WDT=m
+CONFIG_ADVANTECH_WDT=m
+CONFIG_ALIM1535_WDT=m
+CONFIG_ALIM7101_WDT=m
+CONFIG_SC520_WDT=m
+CONFIG_EUROTECH_WDT=m
+CONFIG_IB700_WDT=m
+CONFIG_WAFER_WDT=m
+CONFIG_SC1200_WDT=m
+CONFIG_SCx200_WDT=m
+CONFIG_60XX_WDT=m
+CONFIG_CPU5_WDT=m
+CONFIG_W83627HF_WDT=m
+CONFIG_W83877F_WDT=m
+CONFIG_MACHZ_WDT=m
+CONFIG_PCWATCHDOG=m
+CONFIG_MIXCOMWD=m
+CONFIG_WDT=m
+CONFIG_WDT_501=y
+CONFIG_PCIPCWATCHDOG=m
+CONFIG_WDTPCI=m
+CONFIG_WDT_501_PCI=y
+CONFIG_USBPCWATCHDOG=m
+CONFIG_NVRAM=m
+CONFIG_RTC=m
+CONFIG_GEN_RTC=m
+CONFIG_GEN_RTC_X=y
+CONFIG_DTLK=m
+CONFIG_R3964=m
+CONFIG_APPLICOM=m
+CONFIG_SONYPI=m
+CONFIG_AGP=m
+CONFIG_AGP_ALI=m
+CONFIG_AGP_ATI=m
+CONFIG_AGP_AMD=m
+CONFIG_AGP_AMD64=m
+CONFIG_AGP_INTEL=m
+CONFIG_AGP_NVIDIA=m
+CONFIG_AGP_SIS=m
+CONFIG_AGP_SWORKS=m
+CONFIG_AGP_VIA=m
+CONFIG_AGP_EFFICEON=m
+CONFIG_DRM=m
+CONFIG_DRM_TDFX=m
+CONFIG_DRM_R128=m
+CONFIG_DRM_RADEON=m
+CONFIG_DRM_I810=m
+CONFIG_DRM_I830=m
+CONFIG_DRM_I915=m
+CONFIG_DRM_MGA=m
+CONFIG_DRM_SIS=m
+CONFIG_SYNCLINK_CS=m
+CONFIG_MWAVE=m
+CONFIG_SCx200_GPIO=m
+CONFIG_RAW_DRIVER=m
+CONFIG_HPET=y
+# CONFIG_HPET_RTC_IRQ is not set
+CONFIG_HPET_MMAP=y
+CONFIG_MAX_RAW_DEVS=256
+CONFIG_HANGCHECK_TIMER=m
+CONFIG_I2C=m
+CONFIG_I2C_CHARDEV=m
+CONFIG_I2C_ALGOBIT=m
+CONFIG_I2C_ALGOPCF=m
+CONFIG_I2C_ALGOPCA=m
+CONFIG_I2C_ALI1535=m
+CONFIG_I2C_ALI1563=m
+CONFIG_I2C_ALI15X3=m
+CONFIG_I2C_AMD756=m
+CONFIG_I2C_AMD756_S4882=m
+CONFIG_I2C_AMD8111=m
+CONFIG_I2C_I801=m
+CONFIG_I2C_I810=m
+CONFIG_I2C_PIIX4=m
+CONFIG_I2C_NFORCE2=m
+CONFIG_I2C_PARPORT=m
+CONFIG_I2C_PARPORT_LIGHT=m
+CONFIG_I2C_PROSAVAGE=m
+CONFIG_I2C_SAVAGE4=m
+CONFIG_SCx200_I2C=m
+CONFIG_SCx200_I2C_SCL=12
+CONFIG_SCx200_I2C_SDA=13
+CONFIG_SCx200_ACB=m
+CONFIG_I2C_SIS5595=m
+CONFIG_I2C_SIS630=m
+CONFIG_I2C_SIS96X=m
+CONFIG_I2C_VIA=m
+CONFIG_I2C_VIAPRO=m
+CONFIG_I2C_VOODOO3=m
+CONFIG_I2C_PCA_ISA=m
+CONFIG_SENSORS_ADM1021=m
+CONFIG_SENSORS_ADM1025=m
+CONFIG_SENSORS_ADM1026=m
+CONFIG_SENSORS_ADM1029=m
+CONFIG_SENSORS_ADM1031=m
+CONFIG_SENSORS_ASB100=m
+CONFIG_SENSORS_DS1621=m
+CONFIG_SENSORS_F71805F=m
+CONFIG_SENSORS_FSCHER=m
+CONFIG_SENSORS_FSCPOS=m
+CONFIG_SENSORS_GL518SM=m
+CONFIG_SENSORS_GL520SM=m
+CONFIG_SENSORS_IT87=m
+CONFIG_SENSORS_LM63=m
+CONFIG_SENSORS_LM75=m
+CONFIG_SENSORS_LM77=m
+CONFIG_SENSORS_LM78=m
+CONFIG_SENSORS_LM80=m
+CONFIG_SENSORS_LM83=m
+CONFIG_SENSORS_LM85=m
+CONFIG_SENSORS_LM87=m
+CONFIG_SENSORS_LM90=m
+CONFIG_SENSORS_LM92=m
+CONFIG_SENSORS_MAX1619=m
+CONFIG_SENSORS_PC87360=m
+CONFIG_SENSORS_SMSC47B397=m
+CONFIG_SENSORS_SIS5595=m
+CONFIG_SENSORS_SMSC47M1=m
+CONFIG_SENSORS_VIA686A=m
+CONFIG_SENSORS_W83781D=m
+CONFIG_SENSORS_W83L785TS=m
+CONFIG_SENSORS_W83627HF=m
+CONFIG_SENSORS_DS1337=m
+CONFIG_SENSORS_EEPROM=m
+CONFIG_SENSORS_PCF8574=m
+CONFIG_SENSORS_PCF8591=m
+# CONFIG_I2C_DEBUG_CORE is not set
+# CONFIG_I2C_DEBUG_ALGO is not set
+# CONFIG_I2C_DEBUG_BUS is not set
+# CONFIG_I2C_DEBUG_CHIP is not set
+CONFIG_IBM_ASM=m
+CONFIG_PHANTOM=m
+CONFIG_RADIO_CADET=m
+CONFIG_RADIO_RTRACK=m
+CONFIG_RADIO_RTRACK2=m
+CONFIG_RADIO_AZTECH=m
+CONFIG_RADIO_GEMTEK=m
+CONFIG_RADIO_GEMTEK_PCI=m
+CONFIG_RADIO_MAXIRADIO=m
+CONFIG_RADIO_MAESTRO=m
+CONFIG_RADIO_SF16FMI=m
+CONFIG_RADIO_SF16FMR2=m
+CONFIG_RADIO_TERRATEC=m
+CONFIG_RADIO_TRUST=m
+CONFIG_RADIO_TYPHOON=m
+CONFIG_RADIO_TYPHOON_PROC_FS=y
+CONFIG_RADIO_ZOLTRIX=m
+CONFIG_DVB_CORE=m
+CONFIG_VIDEO_SAA7146=m
+CONFIG_VIDEO_SAA7146_VV=m
+CONFIG_VIDEO_TUNER=m
+CONFIG_VIDEO_BUF=m
+CONFIG_VIDEO_BUF_DVB=m
+CONFIG_VIDEO_BTCX=m
+CONFIG_VIDEO_IR=m
+CONFIG_VIDEO_TVEEPROM=m
+CONFIG_BACKLIGHT_PROGEAR=m
+CONFIG_VIDEO_OUTPUT_CONTROL=m
+CONFIG_FB=y
+CONFIG_FB_CFB_IMAGEBLIT=y
+CONFIG_FB_SVGALIB=y
+# CONFIG_FB_MACMODES is not set
+CONFIG_FB_MODE_HELPERS=y
+CONFIG_FB_TILEBLITTING=y
+CONFIG_FB_CIRRUS=m
+CONFIG_FB_PM2=m
+CONFIG_FB_PM2_FIFO_DISCONNECT=y
+CONFIG_FB_CYBER2000=m
+# CONFIG_FB_ASILIANT is not set
+# CONFIG_FB_IMSTT is not set
+CONFIG_FB_VGA16=m
+CONFIG_FB_VESA=y
+CONFIG_FB_HECUBA=m
+CONFIG_FB_HGA=m
+# CONFIG_FB_HGA_ACCEL is not set
+CONFIG_FB_NVIDIA=m
+CONFIG_FB_NVIDIA_I2C=y
+# CONFIG_FB_RIVA is not set
+# CONFIG_FB_RIVA_I2C is not set
+# CONFIG_FB_RIVA_DEBUG is not set
+CONFIG_FB_I810=m
+# CONFIG_FB_I810_GTF is not set
+CONFIG_FB_LE80578=m
+CONFIG_FB_CARILLO_RANCH=m
+CONFIG_FB_INTEL=m
+CONFIG_FB_MATROX=m
+CONFIG_FB_MATROX_MILLENIUM=y
+CONFIG_FB_MATROX_MYSTIQUE=y
+CONFIG_FB_MATROX_G=y
+CONFIG_FB_MATROX_I2C=m
+CONFIG_FB_MATROX_MAVEN=m
+CONFIG_FB_MATROX_MULTIHEAD=y
+CONFIG_FB_RADEON=m
+CONFIG_FB_RADEON_I2C=y
+# CONFIG_FB_RADEON_DEBUG is not set
+CONFIG_FB_ATY128=m
+CONFIG_FB_ATY=m
+CONFIG_FB_ATY_CT=y
+CONFIG_FB_ATY_GENERIC_LCD=y
+CONFIG_FB_ATY_GX=y
+CONFIG_FB_SAVAGE=m
+CONFIG_FB_SAVAGE_I2C=y
+# CONFIG_FB_SAVAGE_ACCEL is not set
+CONFIG_FB_SIS=m
+CONFIG_FB_SIS_300=y
+CONFIG_FB_SIS_315=y
+CONFIG_FB_NEOMAGIC=m
+CONFIG_FB_KYRO=m
+CONFIG_FB_3DFX=m
+# CONFIG_FB_3DFX_ACCEL is not set
+CONFIG_FB_VOODOO1=m
+CONFIG_FB_TRIDENT=m
+# CONFIG_FB_TRIDENT_ACCEL is not set
+CONFIG_FB_GEODE=y
+CONFIG_FB_GEODE_GX=m
+CONFIG_FB_GEODE_GX1=m
+CONFIG_FB_S1D13XXX=m
+CONFIG_FB_VIRTUAL=m
+CONFIG_VGA_CONSOLE=y
+CONFIG_MDA_CONSOLE=m
+CONFIG_DUMMY_CONSOLE=y
+CONFIG_FRAMEBUFFER_CONSOLE=y
+# CONFIG_FONTS is not set
+CONFIG_FONT_8x8=y
+CONFIG_FONT_8x16=y
+# CONFIG_LOGO is not set
+CONFIG_SOUND=m
+CONFIG_SND=m
+CONFIG_SND_TIMER=m
+CONFIG_SND_PCM=m
+CONFIG_SND_HWDEP=m
+CONFIG_SND_SEQUENCER=m
+CONFIG_SND_SEQ_DUMMY=m
+CONFIG_SND_OSSEMUL=y
+CONFIG_SND_MIXER_OSS=m
+CONFIG_SND_PCM_OSS=m
+CONFIG_SND_SEQUENCER_OSS=y
+CONFIG_SND_RTCTIMER=m
+# CONFIG_SND_VERBOSE_PRINTK is not set
+# CONFIG_SND_DEBUG is not set
+CONFIG_SND_MPU401_UART=m
+CONFIG_SND_OPL3_LIB=m
+CONFIG_SND_OPL4_LIB=m
+CONFIG_SND_VX_LIB=m
+CONFIG_SND_DUMMY=m
+CONFIG_SND_VIRMIDI=m
+CONFIG_SND_MTPAV=m
+CONFIG_SND_SERIAL_U16550=m
+CONFIG_SND_MPU401=m
+CONFIG_SND_ADLIB=m
+CONFIG_SND_AD1848_LIB=m
+CONFIG_SND_CS4231_LIB=m
+CONFIG_SND_AD1816A=m
+CONFIG_SND_AD1848=m
+CONFIG_SND_CS4231=m
+CONFIG_SND_CS4232=m
+CONFIG_SND_CS4236=m
+CONFIG_SND_ES968=m
+CONFIG_SND_ES1688=m
+CONFIG_SND_ES18XX=m
+CONFIG_SND_GUS_SYNTH=m
+CONFIG_SND_GUSCLASSIC=m
+CONFIG_SND_GUSEXTREME=m
+CONFIG_SND_GUSMAX=m
+CONFIG_SND_INTERWAVE=m
+CONFIG_SND_INTERWAVE_STB=m
+CONFIG_SND_OPTI92X_AD1848=m
+CONFIG_SND_OPTI92X_CS4231=m
+CONFIG_SND_OPTI93X=m
+CONFIG_SND_MIRO=m
+CONFIG_SND_SB8=m
+CONFIG_SND_SB16=m
+CONFIG_SND_SBAWE=m
+CONFIG_SND_SB16_CSP=y
+CONFIG_SND_WAVEFRONT=m
+CONFIG_SND_ALS100=m
+CONFIG_SND_AZT2320=m
+CONFIG_SND_CMI8330=m
+CONFIG_SND_DT019X=m
+CONFIG_SND_OPL3SA2=m
+CONFIG_SND_SGALAXY=m
+CONFIG_SND_SSCAPE=m
+CONFIG_SND_AC97_CODEC=m
+CONFIG_SND_ALI5451=m
+CONFIG_SND_ATIIXP=m
+CONFIG_SND_ATIIXP_MODEM=m
+CONFIG_SND_AU8810=m
+CONFIG_SND_AU8820=m
+CONFIG_SND_AU8830=m
+CONFIG_SND_AZT3328=m
+CONFIG_SND_BT87X=m
+# CONFIG_SND_BT87X_OVERCLOCK is not set
+CONFIG_SND_CS46XX=m
+CONFIG_SND_CS46XX_NEW_DSP=y
+CONFIG_SND_CS4281=m
+CONFIG_SND_EMU10K1=m
+CONFIG_SND_EMU10K1X=m
+CONFIG_SND_CA0106=m
+CONFIG_SND_KORG1212=m
+CONFIG_SND_MIXART=m
+CONFIG_SND_NM256=m
+CONFIG_SND_RME32=m
+CONFIG_SND_RME96=m
+CONFIG_SND_RME9652=m
+CONFIG_SND_HDSP=m
+CONFIG_SND_TRIDENT=m
+CONFIG_SND_YMFPCI=m
+CONFIG_SND_ALS4000=m
+CONFIG_SND_CMIPCI=m
+CONFIG_SND_ENS1370=m
+CONFIG_SND_ENS1371=m
+CONFIG_SND_ES1938=m
+CONFIG_SND_ES1968=m
+CONFIG_SND_MAESTRO3=m
+CONFIG_SND_FM801=m
+CONFIG_SND_FM801_TEA575X_BOOL=y
+CONFIG_SND_FM801_TEA575X=m
+CONFIG_SND_ICE1712=m
+CONFIG_SND_ICE1724=m
+CONFIG_SND_INTEL8X0=m
+CONFIG_SND_INTEL8X0M=m
+CONFIG_SND_SONICVIBES=m
+CONFIG_SND_VIA82XX=m
+CONFIG_SND_VIA82XX_MODEM=m
+CONFIG_SND_VX222=m
+CONFIG_SND_HDA_INTEL=m
+CONFIG_SND_USB_AUDIO=m
+CONFIG_SND_USB_USX2Y=m
+CONFIG_SOUND_PRIME=m
+CONFIG_SOUND_TRIDENT=m
+# CONFIG_SOUND_MSNDCLAS is not set
+# CONFIG_SOUND_MSNDPIN is not set
+CONFIG_SOUND_OSS=m
+# CONFIG_SOUND_TRACEINIT is not set
+# CONFIG_SOUND_DMAP is not set
+CONFIG_SOUND_SSCAPE=m
+CONFIG_SOUND_VMIDI=m
+CONFIG_SOUND_TRIX=m
+CONFIG_SOUND_MSS=m
+CONFIG_SOUND_MPU401=m
+CONFIG_SOUND_PAS=m
+CONFIG_SOUND_PSS=m
+CONFIG_PSS_MIXER=y
+CONFIG_SOUND_SB=m
+CONFIG_SOUND_YM3812=m
+CONFIG_SOUND_UART6850=m
+CONFIG_SOUND_AEDSP16=m
+CONFIG_SC6600=y
+CONFIG_SC6600_JOY=y
+CONFIG_SC6600_CDROM=4
+CONFIG_SC6600_CDROMBASE=0x0
+# CONFIG_AEDSP16_MSS is not set
+# CONFIG_AEDSP16_SBPRO is not set
+CONFIG_SOUND_KAHLUA=m
+CONFIG_USB_ARCH_HAS_HCD=y
+CONFIG_USB_ARCH_HAS_OHCI=y
+CONFIG_USB=m
+# CONFIG_USB_DEBUG is not set
+CONFIG_USB_DEVICEFS=y
+# CONFIG_USB_DYNAMIC_MINORS is not set
+CONFIG_USB_SUSPEND=y
+# CONFIG_USB_OTG is not set
+CONFIG_USB_EHCI_HCD=m
+CONFIG_USB_EHCI_SPLIT_ISO=y
+CONFIG_USB_EHCI_ROOT_HUB_TT=y
+CONFIG_USB_OHCI_HCD=m
+CONFIG_USB_OHCI_LITTLE_ENDIAN=y
+CONFIG_USB_UHCI_HCD=m
+CONFIG_USB_SL811_HCD=m
+CONFIG_USB_SL811_CS=m
+CONFIG_USB_ACM=m
+CONFIG_USB_PRINTER=m
+CONFIG_USB_STORAGE=m
+# CONFIG_USB_STORAGE_DEBUG is not set
+CONFIG_USB_STORAGE_DATAFAB=y
+CONFIG_USB_STORAGE_FREECOM=y
+CONFIG_USB_STORAGE_ISD200=y
+CONFIG_USB_STORAGE_DPCM=y
+CONFIG_USB_STORAGE_USBAT=y
+CONFIG_USB_STORAGE_SDDR09=y
+CONFIG_USB_STORAGE_SDDR55=y
+CONFIG_USB_STORAGE_JUMPSHOT=y
+CONFIG_HID_SUPPORT=y
+CONFIG_USB_HID=m
+CONFIG_USB_HIDINPUT_POWERBOOK=y
+# CONFIG_HID_FF is not set
+CONFIG_USB_HIDDEV=y
+CONFIG_USB_KBD=m
+CONFIG_USB_MOUSE=m
+CONFIG_USB_SUPPORT=y
+CONFIG_USB_MDC800=m
+CONFIG_USB_MICROTEK=m
+CONFIG_USB_VICAM=m
+CONFIG_USB_DSBR=m
+CONFIG_USB_IBMCAM=m
+CONFIG_USB_KONICAWC=m
+CONFIG_USB_OV511=m
+CONFIG_USB_SE401=m
+CONFIG_USB_SN9C102=m
+CONFIG_USB_STV680=m
+CONFIG_USB_PWC=m
+CONFIG_USB_CATC=m
+CONFIG_USB_KAWETH=m
+CONFIG_USB_PEGASUS=m
+CONFIG_USB_RTL8150=m
+CONFIG_USB_USBNET=m
+CONFIG_USB_ALI_M5632=y
+CONFIG_USB_AN2720=y
+CONFIG_USB_BELKIN=y
+CONFIG_USB_ARMLINUX=y
+CONFIG_USB_EPSON2888=y
+CONFIG_USB_ZD1201=m
+CONFIG_USB_USS720=m
+CONFIG_USB_AUERSWALD=m
+CONFIG_USB_RIO500=m
+CONFIG_USB_LEGOTOWER=m
+CONFIG_USB_LCD=m
+CONFIG_USB_LED=m
+CONFIG_USB_CYTHERM=m
+CONFIG_USB_PHIDGETKIT=m
+CONFIG_USB_PHIDGETSERVO=m
+CONFIG_USB_IDMOUSE=m
+CONFIG_USB_SISUSBVGA=m
+CONFIG_USB_TEST=m
+CONFIG_USB_ATM=m
+CONFIG_USB_SPEEDTOUCH=m
+CONFIG_USB_GADGET=m
+# CONFIG_USB_GADGET_DEBUG_FILES is not set
+CONFIG_USB_GADGET_NET2280=y
+CONFIG_USB_NET2280=m
+# CONFIG_USB_GADGET_PXA2XX is not set
+# CONFIG_USB_GADGET_GOKU is not set
+# CONFIG_USB_GADGET_LH7A40X is not set
+# CONFIG_USB_GADGET_OMAP is not set
+# CONFIG_USB_GADGET_DUMMY_HCD is not set
+CONFIG_USB_GADGET_DUALSPEED=y
+CONFIG_USB_ZERO=m
+CONFIG_USB_ETH=m
+CONFIG_USB_ETH_RNDIS=y
+CONFIG_USB_GADGETFS=m
+CONFIG_USB_FILE_STORAGE=m
+# CONFIG_USB_FILE_STORAGE_TEST is not set
+CONFIG_USB_G_SERIAL=m
+CONFIG_MMC=m
+# CONFIG_MMC_DEBUG is not set
+CONFIG_MMC_BLOCK=m
+CONFIG_MMC_WBSD=m
+CONFIG_JBD=m
+CONFIG_XFS_RT=y
+CONFIG_ADFS_FS=m
+# CONFIG_ADFS_FS_RW is not set
+CONFIG_AFFS_FS=m
+CONFIG_HFS_FS=m
+CONFIG_HFSPLUS_FS=m
+CONFIG_BEFS_FS=m
+# CONFIG_BEFS_DEBUG is not set
+CONFIG_BFS_FS=m
+CONFIG_EFS_FS=m
+CONFIG_JFFS2_FS=m
+CONFIG_JFFS2_FS_DEBUG=0
+CONFIG_JFFS2_FS_WRITEBUFFER=y
+# CONFIG_JFFS2_COMPRESSION_OPTIONS is not set
+CONFIG_JFFS2_ZLIB=y
+CONFIG_JFFS2_RTIME=y
+# CONFIG_JFFS2_RUBIN is not set
+CONFIG_VXFS_FS=m
+CONFIG_HPFS_FS=m
+CONFIG_QNX4FS_FS=m
+# CONFIG_QNX4FS_RW is not set
+CONFIG_SYSV_FS=m
+CONFIG_UFS_FS=m
+# CONFIG_UFS_FS_WRITE is not set
+CONFIG_SUNRPC_GSS=m
+CONFIG_RPCSEC_GSS_KRB5=m
+CONFIG_RPCSEC_GSS_SPKM3=m
+CONFIG_SMB_FS=m
+# CONFIG_SMB_NLS_DEFAULT is not set
+CONFIG_CIFS=m
+# CONFIG_CIFS_STATS is not set
+# CONFIG_CIFS_XATTR is not set
+# CONFIG_CIFS_EXPERIMENTAL is not set
+CONFIG_NCP_FS=m
+CONFIG_NCPFS_PACKET_SIGNING=y
+CONFIG_NCPFS_IOCTL_LOCKING=y
+CONFIG_NCPFS_STRONG=y
+CONFIG_NCPFS_NFS_NS=y
+CONFIG_NCPFS_OS2_NS=y
+# CONFIG_NCPFS_SMALLDOS is not set
+CONFIG_NCPFS_NLS=y
+CONFIG_NCPFS_EXTRAS=y
+CONFIG_CODA_FS=m
+# CONFIG_CODA_FS_OLD_API is not set
+CONFIG_AFS_FS=m
+# CONFIG_AFS_DEBUG is not set
+CONFIG_ACORN_PARTITION=y
+# CONFIG_ACORN_PARTITION_CUMANA is not set
+# CONFIG_ACORN_PARTITION_EESOX is not set
+CONFIG_ACORN_PARTITION_ICS=y
+# CONFIG_ACORN_PARTITION_ADFS is not set
+# CONFIG_ACORN_PARTITION_POWERTEC is not set
+CONFIG_ACORN_PARTITION_RISCIX=y
+CONFIG_OSF_PARTITION=y
+CONFIG_AMIGA_PARTITION=y
+CONFIG_ATARI_PARTITION=y
+CONFIG_MAC_PARTITION=y
+CONFIG_BSD_DISKLABEL=y
+CONFIG_MINIX_SUBPARTITION=y
+CONFIG_SOLARIS_X86_PARTITION=y
+CONFIG_UNIXWARE_DISKLABEL=y
+CONFIG_LDM_PARTITION=y
+# CONFIG_LDM_DEBUG is not set
+CONFIG_SGI_PARTITION=y
+CONFIG_ULTRIX_PARTITION=y
+CONFIG_SUN_PARTITION=y
+CONFIG_EFI_PARTITION=y
+CONFIG_INSTRUMENTATION=y
+CONFIG_PROFILING=y
+CONFIG_OPROFILE=m
+# CONFIG_KPROBES is not set
+CONFIG_DEBUG_KERNEL=y
+# CONFIG_DEBUG_SHIRQ is not set
+CONFIG_TIMER_STATS=y
+# CONFIG_DEBUG_SLAB is not set
+# CONFIG_DEBUG_SPINLOCK is not set
+# CONFIG_DEBUG_SPINLOCK_SLEEP is not set
+# CONFIG_DEBUG_KOBJECT is not set
+# CONFIG_DEBUG_INFO is not set
+# CONFIG_FRAME_POINTER is not set
+# CONFIG_FAULT_INJECTION is not set
+# CONFIG_4KSTACKS is not set
+CONFIG_X86_FIND_SMP_CONFIG=y
+CONFIG_X86_MPPARSE=y
+CONFIG_CRYPTO_AES_586=m
+CONFIG_CRC_CCITT=m
+CONFIG_CRC32=y
+CONFIG_REED_SOLOMON=m
+CONFIG_REED_SOLOMON_DEC16=y
+CONFIG_GENERIC_HARDIRQS=y
+CONFIG_GENERIC_IRQ_PROBE=y
+CONFIG_X86_BIOS_REBOOT=y
+CONFIG_KEXEC=y
+CONFIG_PHYSICAL_START=0x100000
+CONFIG_HOTPLUG_CPU=y
+CONFIG_HPET_EMULATE_RTC=y
+CONFIG_VIDEO_CX88_DVB=m
+CONFIG_VIDEO_CX88=m
+CONFIG_SENSORS_HDAPS=m
+CONFIG_DCDBAS=m
+CONFIG_IBMASR=m
+CONFIG_SBC8360_WDT=m
+CONFIG_W83977F_WDT=m
+CONFIG_I6300ESB_WDT=m
+CONFIG_X86_32=y
+CONFIG_BLK_DEV_CS5535=m
+CONFIG_PM_LEGACY=y
+CONFIG_INPUT_WISTRON_BTNS=m
+CONFIG_FLATMEM_MANUAL=y
+# CONFIG_SPARSEMEM_MANUAL is not set
+# CONFIG_DISCONTIGMEM_MANUAL is not set
+CONFIG_SPLIT_PTLOCK_CPUS=4
+CONFIG_CC_OPTIMIZE_FOR_SIZE=y
+CONFIG_IPW2100=m
+CONFIG_IPW2100_MONITOR=y
+# CONFIG_IPW2100_DEBUG is not set
+CONFIG_ARCH_FLATMEM_ENABLE=y
+CONFIG_SERIAL_8250_RUNTIME_UARTS=4
+CONFIG_KTIME_SCALAR=y
+CONFIG_DOUBLEFAULT=y
+CONFIG_ARCH_SPARSEMEM_ENABLE=y
+CONFIG_ARCH_SELECT_MEMORY_MODEL=y
+CONFIG_CS5535_GPIO=m
+# CONFIG_MGEODE_LX is not set
+CONFIG_SND_CS5535AUDIO=m
+CONFIG_VM86=y
+CONFIG_SPARSEMEM_STATIC=y
+# CONFIG_EDAC_DEBUG is not set
+CONFIG_EDAC_I82875P=m
+CONFIG_EDAC_AMD76X=m
+CONFIG_EDAC_E7XXX=m
+CONFIG_EDAC=y
+CONFIG_EDAC_MM_EDAC=m
+# CONFIG_VMSPLIT_3G is not set
+CONFIG_VMSPLIT_3G_OPT=y
+CONFIG_EDAC_I82860=m
+# CONFIG_VMSPLIT_2G is not set
+# CONFIG_VMSPLIT_1G is not set
+CONFIG_EDAC_E752X=m
+CONFIG_EDAC_R82600=m
+CONFIG_SCHED_SMT=y
+CONFIG_SCHED_MC=y
+CONFIG_EFI_VARS=m
+CONFIG_BOOT_IOREMAP=y
+CONFIG_EFI=y
+CONFIG_IRQBALANCE=n
+CONFIG_HW_RANDOM_INTEL=m
+CONFIG_K8_NB=y
+CONFIG_GENERIC_TIME=y
+CONFIG_HW_RANDOM_GEODE=m
+CONFIG_INTEL_IOATDMA=m
+CONFIG_SCx200HR_TIMER=m
+# CONFIG_FB_IMAC is not set
+CONFIG_ACPI_SBS=m
+CONFIG_HW_RANDOM_AMD=m
+CONFIG_COMPAT_VDSO=y
+CONFIG_HW_RANDOM_VIA=m
+# CONFIG_RESOURCES_64BIT is not set
+CONFIG_PAGE_OFFSET=0xC0000000
+CONFIG_INPUT_MOUSEDEV=y
+CONFIG_SX=m
+CONFIG_BLK_DEV_IDEPNP=y
+CONFIG_PCIEAER=y
+CONFIG_HT_IRQ=y
+CONFIG_SENSORS_K8TEMP=m
+CONFIG_ARCH_POPULATES_NODE_MAP=y
+CONFIG_SCSI_ARCMSR=m
+CONFIG_CRYPTO_TWOFISH_586=m
+CONFIG_ISDN_DRV_AVMB1_B1PCIV4=y
+CONFIG_SERIAL_8250_EXAR_ST16C554=m
+CONFIG_ISDN_DRV_AVMB1_AVM_CS=m
+# CONFIG_HZ_300 is not set
+# CONFIG_MCORE2 is not set
+CONFIG_CRYPTO_DEV_GEODE=m
+# CONFIG_FB_GEODE_GX_SET_FBSIZE is not set
+CONFIG_PHYSICAL_ALIGN=0x100000
+# CONFIG_ARCH_HAS_ILOG2_U64 is not set
+CONFIG_KS0108=m
+CONFIG_KS0108_PORT=0x378
+CONFIG_KS0108_DELAY=2
+CONFIG_CFAG12864B=m
+CONFIG_CFAG12864B_RATE=20
+# CONFIG_XEN is not set
+CONFIG_VMI=y
+CONFIG_PARAVIRT=y
+CONFIG_VIRTUALIZATION=y
+CONFIG_KVM=m
+CONFIG_KVM_INTEL=m
+CONFIG_KVM_AMD=m
+CONFIG_LGUEST=m
+CONFIG_LGUEST_GUEST=y
+CONFIG_LEDS_WRAP=m
+# CONFIG_DEBUG_RODATA is not set
+# CONFIG_DEBUG_PAGEALLOC is not set
+# CONFIG_LOCK_STAT is not set
+CONFIG_GENERIC_PENDING_IRQ=y
+CONFIG_FB_ATY128_BACKLIGHT=y
+CONFIG_FB_ATY_BACKLIGHT=y
+CONFIG_FB_BACKLIGHT=y
+CONFIG_FB_DEFERRED_IO=y
+CONFIG_FB_NVIDIA_BACKLIGHT=y
+CONFIG_FB_RADEON_BACKLIGHT=y
+CONFIG_FB_SVGALIB=m
+CONFIG_FB_SYS_COPYAREA=m
+CONFIG_FB_SYS_FILLRECT=m
+CONFIG_FB_SYS_FOPS=m
+CONFIG_FB_SYS_IMAGEBLIT=m

Added: dists/sid/linux-2.6/debian/config/i386/config.486
==============================================================================
--- (empty file)
+++ dists/sid/linux-2.6/debian/config/i386/config.486	Mon Nov 26 20:06:56 2007
@@ -0,0 +1,80 @@
+CONFIG_M486=y
+# CONFIG_M686 is not set
+# CONFIG_MK7 is not set
+CONFIG_X86_GENERIC=y
+CONFIG_X86_L1_CACHE_SHIFT=7
+CONFIG_RWSEM_GENERIC_SPINLOCK=y
+CONFIG_X86_PPRO_FENCE=y
+CONFIG_X86_F00F_BUG=y
+CONFIG_X86_INTEL_USERCOPY=y
+# CONFIG_SMP is not set
+CONFIG_X86_UP_APIC=y
+CONFIG_X86_UP_IOAPIC=y
+# CONFIG_X86_MCE is not set
+CONFIG_NOHIGHMEM=y
+# CONFIG_HIGHMEM4G is not set
+CONFIG_MATH_EMULATION=y
+# CONFIG_CPU_FREQ_STAT_DETAILS is not set
+CONFIG_EISA=y
+CONFIG_EISA_VLB_PRIMING=y
+CONFIG_EISA_PCI_EISA=y
+CONFIG_EISA_VIRTUAL_ROOT=y
+CONFIG_EISA_NAMES=y
+CONFIG_MCA=y
+CONFIG_MCA_LEGACY=y
+# CONFIG_MCA_PROC_FS is not set
+CONFIG_HOTPLUG_PCI_COMPAQ_NVRAM=y
+# CONFIG_MTD_XIP is not set
+CONFIG_BLK_DEV_PS2=m
+CONFIG_SCSI_FD_MCS=m
+CONFIG_SCSI_IBMMCA=m
+CONFIG_IBMMCA_SCSI_ORDER_STANDARD=y
+# CONFIG_IBMMCA_SCSI_DEV_RESET is not set
+CONFIG_SCSI_NCR_D700=m
+CONFIG_SCSI_NCR_Q720=m
+CONFIG_SCSI_NCR53C8XX_DEFAULT_TAGS=8
+CONFIG_SCSI_NCR53C8XX_MAX_TAGS=4
+CONFIG_SCSI_NCR53C8XX_SYNC=5
+CONFIG_SCSI_MCA_53C9X=m
+CONFIG_SCSI_SIM710=m
+CONFIG_DMASCC=m
+CONFIG_IRPORT_SIR=m
+# CONFIG_DONGLE_OLD is not set
+CONFIG_ELMC=m
+CONFIG_ELMC_II=m
+CONFIG_ULTRAMCA=m
+CONFIG_ULTRA32=m
+CONFIG_NI5010=m
+CONFIG_PCMCIA_XIRTULIP=m
+CONFIG_NE2_MCA=m
+CONFIG_IBMLANA=m
+CONFIG_LNE390=m
+CONFIG_NE3210=m
+CONFIG_ES3210=m
+CONFIG_MADGEMC=m
+CONFIG_ISDN_DRV_LOOP=m
+CONFIG_HYSDN=m
+CONFIG_HYSDN_CAPI=y
+CONFIG_COMPUTONE=m
+CONFIG_DIGIEPCA=m
+CONFIG_MOXA_INTELLIO=m
+CONFIG_RIO=m
+CONFIG_RIO_OLDPCI=y
+CONFIG_STALLION=m
+CONFIG_ISTALLION=m
+CONFIG_I2C_ELEKTOR=m
+CONFIG_I2C_STUB=m
+CONFIG_USB_W9968CF=m
+CONFIG_EXT2_FS=y
+CONFIG_FS_MBCACHE=y
+CONFIG_LOG_BUF_SHIFT=14
+# CONFIG_M386 is not set
+CONFIG_X86_POPAD_OK=y
+CONFIG_RWSEM_XCHGADD_ALGORITHM=y
+CONFIG_X86_BSWAP=y
+CONFIG_X86_XADD=y
+CONFIG_X86_CMPXCHG=y
+CONFIG_X86_ALIGNMENT_16=y
+CONFIG_X86_INVLPG=y
+CONFIG_X86_WP_WORKS_OK=y
+CONFIG_BROKEN_ON_SMP=y

Added: dists/sid/linux-2.6/debian/config/i386/config.686
==============================================================================
--- (empty file)
+++ dists/sid/linux-2.6/debian/config/i386/config.686	Mon Nov 26 20:06:56 2007
@@ -0,0 +1,57 @@
+CONFIG_LOCK_KERNEL=y
+CONFIG_STOP_MACHINE=y
+# CONFIG_M386 is not set
+CONFIG_M686=y
+# CONFIG_MK7 is not set
+# CONFIG_X86_GENERIC is not set
+CONFIG_X86_CMPXCHG=y
+CONFIG_X86_XADD=y
+CONFIG_X86_L1_CACHE_SHIFT=5
+CONFIG_RWSEM_XCHGADD_ALGORITHM=y
+CONFIG_X86_PPRO_FENCE=y
+CONFIG_X86_WP_WORKS_OK=y
+CONFIG_X86_INVLPG=y
+CONFIG_X86_BSWAP=y
+CONFIG_X86_POPAD_OK=y
+CONFIG_X86_GOOD_APIC=y
+CONFIG_X86_USE_PPRO_CHECKSUM=y
+CONFIG_SMP=y
+CONFIG_NR_CPUS=8
+CONFIG_X86_TSC=y
+CONFIG_X86_MCE=y
+CONFIG_X86_MCE_NONFATAL=m
+CONFIG_X86_MCE_P4THERMAL=y
+# CONFIG_NOHIGHMEM is not set
+CONFIG_HIGHMEM4G=y
+CONFIG_HIGHMEM=y
+# CONFIG_HIGHPTE is not set
+# CONFIG_MATH_EMULATION is not set
+# CONFIG_CPU_FREQ_STAT_DETAILS is not set
+# CONFIG_EISA is not set
+# CONFIG_MCA is not set
+# CONFIG_HOTPLUG_PCI_COMPAQ_NVRAM is not set
+# CONFIG_DMASCC is not set
+# CONFIG_IRPORT_SIR is not set
+# CONFIG_NI5010 is not set
+# CONFIG_PCMCIA_XIRTULIP is not set
+# CONFIG_ISDN_DRV_LOOP is not set
+# CONFIG_HYSDN is not set
+# CONFIG_COMPUTONE is not set
+# CONFIG_DIGIEPCA is not set
+# CONFIG_MOXA_INTELLIO is not set
+# CONFIG_RIO is not set
+# CONFIG_STALLION is not set
+# CONFIG_ISTALLION is not set
+# CONFIG_I2C_ELEKTOR is not set
+CONFIG_I2C_STUB=m
+# CONFIG_USB_W9968CF is not set
+CONFIG_FS_MBCACHE=m
+CONFIG_LOG_BUF_SHIFT=15
+# CONFIG_DEBUG_HIGHMEM is not set
+CONFIG_X86_SMP=y
+CONFIG_X86_HT=y
+CONFIG_X86_TRAMPOLINE=y
+CONFIG_X86_CMPXCHG64=y
+# CONFIG_M486 is not set
+CONFIG_ARCH_ENABLE_MEMORY_HOTPLUG=y
+CONFIG_ACPI_HOTPLUG_CPU=y

Added: dists/sid/linux-2.6/debian/config/i386/config.686-bigmem
==============================================================================
--- (empty file)
+++ dists/sid/linux-2.6/debian/config/i386/config.686-bigmem	Mon Nov 26 20:06:56 2007
@@ -0,0 +1,58 @@
+CONFIG_LOCK_KERNEL=y
+CONFIG_STOP_MACHINE=y
+# CONFIG_M386 is not set
+CONFIG_M686=y
+# CONFIG_MK7 is not set
+# CONFIG_X86_GENERIC is not set
+CONFIG_X86_CMPXCHG=y
+CONFIG_X86_XADD=y
+CONFIG_X86_L1_CACHE_SHIFT=5
+CONFIG_RWSEM_XCHGADD_ALGORITHM=y
+CONFIG_X86_PPRO_FENCE=y
+CONFIG_X86_WP_WORKS_OK=y
+CONFIG_X86_INVLPG=y
+CONFIG_X86_BSWAP=y
+CONFIG_X86_POPAD_OK=y
+CONFIG_X86_GOOD_APIC=y
+CONFIG_X86_USE_PPRO_CHECKSUM=y
+CONFIG_SMP=y
+CONFIG_NR_CPUS=32
+CONFIG_X86_TSC=y
+CONFIG_X86_MCE=y
+CONFIG_X86_MCE_NONFATAL=m
+CONFIG_X86_MCE_P4THERMAL=y
+# CONFIG_NOHIGHMEM is not set
+# CONFIG_HIGHMEM4G is not set
+CONFIG_HIGHMEM64G=y
+CONFIG_HIGHMEM=y
+CONFIG_X86_PAE=y
+# CONFIG_HIGHPTE is not set
+# CONFIG_MATH_EMULATION is not set
+# CONFIG_CPU_FREQ_STAT_DETAILS is not set
+# CONFIG_EISA is not set
+# CONFIG_MCA is not set
+# CONFIG_HOTPLUG_PCI_COMPAQ_NVRAM is not set
+# CONFIG_DMASCC is not set
+# CONFIG_IRPORT_SIR is not set
+# CONFIG_NI5010 is not set
+# CONFIG_PCMCIA_XIRTULIP is not set
+# CONFIG_ISDN_DRV_LOOP is not set
+# CONFIG_HYSDN is not set
+# CONFIG_COMPUTONE is not set
+# CONFIG_DIGIEPCA is not set
+# CONFIG_MOXA_INTELLIO is not set
+# CONFIG_SX is not set
+# CONFIG_RIO is not set
+# CONFIG_STALLION is not set
+# CONFIG_ISTALLION is not set
+# CONFIG_I2C_ELEKTOR is not set
+CONFIG_I2C_STUB=m
+# CONFIG_USB_W9968CF is not set
+CONFIG_FS_MBCACHE=m
+CONFIG_LOG_BUF_SHIFT=15
+# CONFIG_DEBUG_HIGHMEM is not set
+CONFIG_X86_SMP=y
+CONFIG_X86_HT=y
+CONFIG_X86_TRAMPOLINE=y
+CONFIG_X86_CMPXCHG64=y
+# CONFIG_M486 is not set

Added: dists/sid/linux-2.6/debian/config/i386/defines
==============================================================================
--- (empty file)
+++ dists/sid/linux-2.6/debian/config/i386/defines	Mon Nov 26 20:06:56 2007
@@ -0,0 +1,47 @@
+[base]
+featuresets:
+ vserver
+ xen
+ xen-vserver
+flavours:
+ 486
+ 686
+ 686-bigmem
+ amd64
+kernel-arch: i386
+kernel-header-dirs: i386 x86_64
+
+[image]
+conflicts: grub (<= 0.95+cvs20040624-17)
+suggests: grub (>= 0.97-3) | lilo (>= 19.1)
+
+[libc-dev]
+arch: x86_64
+
+[486_base]
+class: x86
+longclass: x86 and compatible
+
+[686_base]
+class: PPro/Celeron/PII/PIII/P4
+longclass: Pentium Pro/Celeron/Pentium II/Pentium III/Pentium 4
+
+[686_image]
+recommends: libc6-i686
+
+[686-bigmem_base]
+class: PPro/Celeron/PII/PIII/P4
+longclass: Pentium Pro/Celeron/Pentium II/Pentium III/Pentium 4 with 4-64G RAM
+
+[686-bigmem_image]
+recommends: libc6-i686
+
+[amd64_base]
+class: AMD64
+kernel-arch: x86_64
+longclass: all 64bit single- and multiprocessor AMD and Intel
+
+[amd64_image]
+configs: amd64/config amd64/config.amd64
+recommends: libc6-i686
+

Added: dists/sid/linux-2.6/debian/config/i386/vserver/defines
==============================================================================
--- (empty file)
+++ dists/sid/linux-2.6/debian/config/i386/vserver/defines	Mon Nov 26 20:06:56 2007
@@ -0,0 +1,11 @@
+[base]
+flavours:
+ 686
+kernel-header-dirs: i386
+
+[image]
+recommends: util-vserver, libc6-i686
+
+[686_image]
+configs: i386/config.686
+

Added: dists/sid/linux-2.6/debian/config/i386/xen-vserver/defines
==============================================================================
--- (empty file)
+++ dists/sid/linux-2.6/debian/config/i386/xen-vserver/defines	Mon Nov 26 20:06:56 2007
@@ -0,0 +1,22 @@
+[base]
+flavours:
+ 686
+kernel-header-dirs: i386
+
+[image]
+configs: i386/xen/config
+initramfs-generators: initramfs-tools
+recommends: libc6-xen
+suggests: grub (>= 0.97-16)
+type: plain-xen
+
+[xen]
+flavour: i386-pae
+
+[686_base]
+class: i686
+longclass: i686 and compatible
+
+[686_image]
+configs: i386/config.686-bigmem
+

Added: dists/sid/linux-2.6/debian/config/i386/xen/defines
==============================================================================
--- (empty file)
+++ dists/sid/linux-2.6/debian/config/i386/xen/defines	Mon Nov 26 20:06:56 2007
@@ -0,0 +1,22 @@
+[base]
+flavours:
+ 686
+kernel-header-dirs: i386
+
+[image]
+initramfs-generators: initramfs-tools
+recommends: libc6-xen
+suggests: grub (>= 0.97-16)
+type: plain-xen
+
+[xen]
+flavour: i386-pae
+
+[686_base]
+class: i686
+longclass: i686 and compatible
+
+[686_image]
+configs:
+  i386/config.686-bigmem
+

Added: dists/sid/linux-2.6/debian/config/ia64/config
==============================================================================
--- (empty file)
+++ dists/sid/linux-2.6/debian/config/ia64/config	Mon Nov 26 20:06:56 2007
@@ -0,0 +1,911 @@
+CONFIG_DMI=y
+CONFIG_DMIID=y
+CONFIG_VORTEX=m
+CONFIG_TYPHOON=m
+CONFIG_NET_TULIP=y
+CONFIG_DE2104X=m
+CONFIG_TULIP=m
+# CONFIG_TULIP_MWI is not set
+# CONFIG_TULIP_MMIO is not set
+# CONFIG_DE4X5 is not set
+CONFIG_WINBOND_840=m
+CONFIG_DM9102=m
+CONFIG_PCMCIA_XIRCOM=m
+# CONFIG_HP100 is not set
+CONFIG_NET_PCI=y
+CONFIG_PCNET32=m
+CONFIG_AMD8111_ETH=m
+CONFIG_ADAPTEC_STARFIRE=m
+CONFIG_B44=m
+CONFIG_FORCEDETH=m
+CONFIG_EEPRO100=m
+CONFIG_E100=m
+CONFIG_FEALNX=m
+CONFIG_NATSEMI=m
+CONFIG_NE2K_PCI=m
+CONFIG_8139CP=m
+CONFIG_8139TOO=m
+# CONFIG_8139TOO_PIO is not set
+# CONFIG_8139TOO_TUNE_TWISTER is not set
+# CONFIG_8139TOO_8129 is not set
+# CONFIG_8139_OLD_RX_RESET is not set
+CONFIG_SIS900=m
+CONFIG_EPIC100=m
+CONFIG_SUNDANCE=m
+# CONFIG_SUNDANCE_MMIO is not set
+CONFIG_VIA_RHINE=m
+# CONFIG_VIA_RHINE_MMIO is not set
+CONFIG_DL2K=m
+CONFIG_E1000=m
+CONFIG_NS83820=m
+CONFIG_HAMACHI=m
+CONFIG_YELLOWFIN=m
+CONFIG_R8169=m
+CONFIG_R8169_VLAN=y
+CONFIG_VIA_VELOCITY=m
+CONFIG_TIGON3=m
+CONFIG_BNX2=m
+CONFIG_IXGB=m
+CONFIG_S2IO=m
+CONFIG_WLAN_PRE80211=y
+CONFIG_STRIP=m
+CONFIG_PCMCIA_WAVELAN=m
+CONFIG_PCMCIA_NETWAVE=m
+CONFIG_WLAN_80211=y
+CONFIG_PCMCIA_RAYCS=m
+CONFIG_HERMES=m
+CONFIG_PLX_HERMES=m
+CONFIG_TMD_HERMES=m
+CONFIG_PCI_HERMES=m
+CONFIG_ATMEL=m
+CONFIG_PCI_ATMEL=m
+CONFIG_PCMCIA_HERMES=m
+CONFIG_AIRO_CS=m
+CONFIG_PCMCIA_ATMEL=m
+CONFIG_PCMCIA_WL3501=m
+CONFIG_PRISM54=m
+CONFIG_NET_PCMCIA=y
+# CONFIG_PCMCIA_3C589 is not set
+CONFIG_PCMCIA_3C574=m
+CONFIG_PCMCIA_FMVJ18X=m
+CONFIG_PCMCIA_PCNET=m
+CONFIG_PCMCIA_NMCLAN=m
+CONFIG_PCMCIA_SMC91C92=m
+CONFIG_PCMCIA_XIRC2PS=m
+CONFIG_PCMCIA_AXNET=m
+CONFIG_ARCNET_COM20020_CS=m
+CONFIG_WAN=y
+CONFIG_DSCC4=m
+# CONFIG_DSCC4_PCISYNC is not set
+# CONFIG_DSCC4_PCI_RST is not set
+CONFIG_LANMEDIA=m
+CONFIG_PCI200SYN=m
+CONFIG_WANXL=m
+CONFIG_PC300=m
+CONFIG_PC300_MLPPP=y
+CONFIG_FARSYNC=m
+CONFIG_DLCI=m
+CONFIG_DLCI_MAX=8
+# CONFIG_CYCLADES_SYNC is not set
+CONFIG_FDDI=y
+CONFIG_DEFXX=m
+CONFIG_SKFP=m
+# CONFIG_HIPPI is not set
+CONFIG_PLIP=m
+CONFIG_PPP=m
+CONFIG_PPP_MULTILINK=y
+CONFIG_PPP_FILTER=y
+CONFIG_PPP_ASYNC=m
+CONFIG_PPP_SYNC_TTY=m
+CONFIG_PPP_DEFLATE=m
+CONFIG_PPP_BSDCOMP=m
+CONFIG_PPPOE=m
+CONFIG_SLIP=m
+CONFIG_SLIP_COMPRESSED=y
+CONFIG_SLIP_SMART=y
+CONFIG_SLIP_MODE_SLIP6=y
+CONFIG_NET_FC=y
+CONFIG_SHAPER=m
+CONFIG_NETCONSOLE=m
+CONFIG_ISDN=m
+CONFIG_ISDN_CAPI=m
+CONFIG_ISDN_DRV_AVMB1_VERBOSE_REASON=y
+CONFIG_CAPI_TRACE=y
+# CONFIG_ISDN_CAPI_MIDDLEWARE is not set
+CONFIG_ISDN_CAPI_CAPI20=m
+CONFIG_CAPI_AVM=y
+CONFIG_ISDN_DRV_AVMB1_B1PCI=m
+CONFIG_ISDN_DRV_AVMB1_B1PCIV4=y
+CONFIG_ISDN_DRV_AVMB1_B1PCMCIA=m
+CONFIG_ISDN_DRV_AVMB1_AVM_CS=m
+CONFIG_ISDN_DRV_AVMB1_T1PCI=m
+CONFIG_ISDN_DRV_AVMB1_C4=m
+CONFIG_CAPI_EICON=y
+CONFIG_ISDN_DIVAS=m
+CONFIG_ISDN_DIVAS_BRIPCI=y
+CONFIG_ISDN_DIVAS_PRIPCI=y
+CONFIG_ISDN_DIVAS_DIVACAPI=m
+CONFIG_ISDN_DIVAS_USERIDI=m
+CONFIG_ISDN_DIVAS_MAINT=m
+CONFIG_PHONE=m
+CONFIG_PHONE_IXJ=m
+CONFIG_PHONE_IXJ_PCMCIA=m
+CONFIG_INPUT=y
+CONFIG_INPUT_MOUSEDEV=y
+CONFIG_INPUT_MOUSEDEV_PSAUX=y
+CONFIG_INPUT_MOUSEDEV_SCREEN_X=1024
+CONFIG_INPUT_MOUSEDEV_SCREEN_Y=768
+CONFIG_INPUT_JOYDEV=m
+CONFIG_INPUT_TSDEV=m
+CONFIG_INPUT_TSDEV_SCREEN_X=240
+CONFIG_INPUT_TSDEV_SCREEN_Y=320
+CONFIG_INPUT_EVDEV=m
+CONFIG_INPUT_KEYBOARD=y
+CONFIG_KEYBOARD_ATKBD=y
+CONFIG_KEYBOARD_SUNKBD=m
+CONFIG_KEYBOARD_LKKBD=m
+CONFIG_KEYBOARD_XTKBD=m
+CONFIG_KEYBOARD_NEWTON=m
+CONFIG_INPUT_MOUSE=y
+CONFIG_MOUSE_PS2=m
+CONFIG_MOUSE_SERIAL=m
+CONFIG_MOUSE_VSXXXAA=m
+CONFIG_INPUT_JOYSTICK=y
+CONFIG_JOYSTICK_ANALOG=m
+CONFIG_JOYSTICK_A3D=m
+CONFIG_JOYSTICK_ADI=m
+CONFIG_JOYSTICK_COBRA=m
+CONFIG_JOYSTICK_GF2K=m
+CONFIG_JOYSTICK_GRIP=m
+CONFIG_JOYSTICK_GRIP_MP=m
+CONFIG_JOYSTICK_GUILLEMOT=m
+CONFIG_JOYSTICK_INTERACT=m
+CONFIG_JOYSTICK_SIDEWINDER=m
+CONFIG_JOYSTICK_TMDC=m
+CONFIG_JOYSTICK_IFORCE=m
+# CONFIG_JOYSTICK_IFORCE_USB is not set
+# CONFIG_JOYSTICK_IFORCE_232 is not set
+CONFIG_JOYSTICK_WARRIOR=m
+CONFIG_JOYSTICK_MAGELLAN=m
+CONFIG_JOYSTICK_SPACEORB=m
+CONFIG_JOYSTICK_SPACEBALL=m
+CONFIG_JOYSTICK_STINGER=m
+CONFIG_JOYSTICK_TWIDJOY=m
+CONFIG_JOYSTICK_DB9=m
+CONFIG_JOYSTICK_GAMECON=m
+CONFIG_JOYSTICK_TURBOGRAFX=m
+CONFIG_JOYSTICK_JOYDUMP=m
+CONFIG_JOYSTICK_XPAD=m
+CONFIG_INPUT_TABLET=y
+CONFIG_TABLET_USB_ACECAD=m
+CONFIG_TABLET_USB_AIPTEK=m
+CONFIG_TABLET_USB_GTCO=m
+CONFIG_TABLET_USB_KBTAB=m
+CONFIG_TABLET_USB_WACOM=m
+# CONFIG_INPUT_TOUCHSCREEN is not set
+CONFIG_INPUT_MISC=y
+CONFIG_INPUT_UINPUT=m
+CONFIG_SERIO=y
+CONFIG_SERIO_I8042=y
+CONFIG_SERIO_SERPORT=m
+CONFIG_SERIO_PARKBD=m
+CONFIG_SERIO_PCIPS2=m
+CONFIG_SERIO_LIBPS2=y
+CONFIG_SERIO_RAW=m
+CONFIG_GAMEPORT=m
+CONFIG_GAMEPORT_NS558=m
+CONFIG_GAMEPORT_L4=m
+CONFIG_GAMEPORT_EMU10K1=m
+CONFIG_GAMEPORT_FM801=m
+CONFIG_VT=y
+CONFIG_VT_CONSOLE=y
+CONFIG_HW_CONSOLE=y
+CONFIG_SERIAL_NONSTANDARD=y
+CONFIG_COMPUTONE=m
+CONFIG_ROCKETPORT=m
+# CONFIG_CYCLADES is not set
+CONFIG_MOXA_INTELLIO=m
+# CONFIG_MOXA_SMARTIO is not set
+# CONFIG_ISI is not set
+CONFIG_SYNCLINKMP=m
+CONFIG_N_HDLC=m
+CONFIG_SPECIALIX=m
+# CONFIG_SPECIALIX_RTSCTS is not set
+CONFIG_SX=m
+CONFIG_STALDRV=y
+CONFIG_SGI_SNSC=y
+CONFIG_SGI_TIOCX=y
+CONFIG_SGI_MBCS=m
+CONFIG_SERIAL_8250=y
+CONFIG_SERIAL_8250_CONSOLE=y
+CONFIG_SERIAL_8250_CS=m
+CONFIG_SERIAL_8250_ACPI=y
+CONFIG_SERIAL_8250_NR_UARTS=16
+CONFIG_SERIAL_8250_RUNTIME_UARTS=4
+CONFIG_SERIAL_8250_EXTENDED=y
+CONFIG_SERIAL_8250_SHARE_IRQ=y
+# CONFIG_SERIAL_8250_DETECT_IRQ is not set
+CONFIG_SERIAL_8250_MULTIPORT=y
+CONFIG_SERIAL_8250_RSA=y
+CONFIG_SERIAL_CORE=y
+CONFIG_SERIAL_CORE_CONSOLE=y
+CONFIG_SERIAL_SGI_L1_CONSOLE=y
+CONFIG_SERIAL_JSM=m
+CONFIG_BLK_CPQ_CISS_DA=m
+CONFIG_CISS_SCSI_TAPE=y
+CONFIG_BLK_DEV_DAC960=m
+CONFIG_BLK_DEV_UMEM=m
+CONFIG_BLK_DEV_LOOP=m
+CONFIG_BLK_DEV_CRYPTOLOOP=m
+CONFIG_BLK_DEV_NBD=m
+CONFIG_BLK_DEV_SX8=m
+CONFIG_CDROM_PKTCDVD=m
+CONFIG_CDROM_PKTCDVD_BUFFERS=8
+# CONFIG_CDROM_PKTCDVD_WCACHE is not set
+CONFIG_ATA_OVER_ETH=m
+CONFIG_SERIAL_SGI_IOC4=m
+CONFIG_SERIAL_SGI_IOC3=m
+CONFIG_PRINTER=m
+# CONFIG_LP_CONSOLE is not set
+CONFIG_PPDEV=m
+CONFIG_TIPAR=m
+CONFIG_IPMI_HANDLER=m
+# CONFIG_IPMI_PANIC_EVENT is not set
+CONFIG_IPMI_DEVICE_INTERFACE=m
+CONFIG_IPMI_SI=m
+CONFIG_IPMI_WATCHDOG=m
+CONFIG_IPMI_POWEROFF=m
+# CONFIG_WATCHDOG is not set
+CONFIG_EFI_RTC=y
+CONFIG_DTLK=m
+CONFIG_R3964=m
+CONFIG_APPLICOM=m
+CONFIG_AGP=m
+CONFIG_AGP_I460=m
+CONFIG_AGP_HP_ZX1=m
+CONFIG_AGP_SGI_TIOCA=m
+CONFIG_DRM=m
+CONFIG_DRM_TDFX=m
+CONFIG_DRM_R128=m
+CONFIG_DRM_RADEON=m
+CONFIG_DRM_MGA=m
+CONFIG_DRM_SIS=m
+CONFIG_SYNCLINK_CS=m
+CONFIG_RAW_DRIVER=m
+CONFIG_HPET=y
+# CONFIG_HPET_RTC_IRQ is not set
+# CONFIG_HPET_MMAP is not set
+CONFIG_MAX_RAW_DEVS=256
+CONFIG_HANGCHECK_TIMER=m
+CONFIG_MMTIMER=m
+CONFIG_I2C=m
+CONFIG_I2C_CHARDEV=m
+CONFIG_I2C_ALGOBIT=m
+CONFIG_I2C_ALGOPCF=m
+CONFIG_I2C_ALGOPCA=m
+CONFIG_I2C_ALI1535=m
+CONFIG_I2C_ALI1563=m
+CONFIG_I2C_ALI15X3=m
+CONFIG_I2C_AMD756=m
+CONFIG_I2C_AMD756_S4882=m
+CONFIG_I2C_AMD8111=m
+CONFIG_I2C_I801=m
+CONFIG_I2C_I810=m
+CONFIG_I2C_PIIX4=m
+CONFIG_I2C_NFORCE2=m
+CONFIG_I2C_PARPORT=m
+CONFIG_I2C_PARPORT_LIGHT=m
+CONFIG_I2C_PROSAVAGE=m
+CONFIG_I2C_SAVAGE4=m
+CONFIG_SCx200_ACB=m
+CONFIG_I2C_SIS5595=m
+CONFIG_I2C_SIS630=m
+CONFIG_I2C_SIS96X=m
+CONFIG_I2C_STUB=m
+CONFIG_I2C_VIA=m
+CONFIG_I2C_VIAPRO=m
+CONFIG_I2C_VOODOO3=m
+CONFIG_I2C_PCA_ISA=m
+CONFIG_SENSORS_ADM1021=m
+CONFIG_SENSORS_ADM1025=m
+CONFIG_SENSORS_ADM1026=m
+CONFIG_SENSORS_ADM1031=m
+CONFIG_SENSORS_ASB100=m
+CONFIG_SENSORS_DS1621=m
+CONFIG_SENSORS_F71805F=m
+CONFIG_SENSORS_FSCHER=m
+CONFIG_SENSORS_FSCPOS=m
+CONFIG_SENSORS_GL518SM=m
+CONFIG_SENSORS_GL520SM=m
+CONFIG_SENSORS_IT87=m
+CONFIG_SENSORS_LM63=m
+CONFIG_SENSORS_LM75=m
+CONFIG_SENSORS_LM77=m
+CONFIG_SENSORS_LM78=m
+CONFIG_SENSORS_LM80=m
+CONFIG_SENSORS_LM83=m
+CONFIG_SENSORS_LM85=m
+CONFIG_SENSORS_LM87=m
+CONFIG_SENSORS_LM90=m
+CONFIG_SENSORS_LM92=m
+CONFIG_SENSORS_MAX1619=m
+CONFIG_SENSORS_PC87360=m
+CONFIG_SENSORS_SMSC47B397=m
+CONFIG_SENSORS_SIS5595=m
+CONFIG_SENSORS_SMSC47M1=m
+CONFIG_SENSORS_VIA686A=m
+CONFIG_SENSORS_W83781D=m
+CONFIG_SENSORS_W83L785TS=m
+CONFIG_SENSORS_W83627HF=m
+CONFIG_SENSORS_DS1337=m
+CONFIG_SENSORS_EEPROM=m
+CONFIG_SENSORS_PCF8574=m
+CONFIG_SENSORS_PCF8591=m
+# CONFIG_I2C_DEBUG_CORE is not set
+# CONFIG_I2C_DEBUG_ALGO is not set
+# CONFIG_I2C_DEBUG_BUS is not set
+# CONFIG_I2C_DEBUG_CHIP is not set
+CONFIG_VIDEO_DEV=m
+CONFIG_VIDEO_BT848=m
+CONFIG_VIDEO_BWQCAM=m
+CONFIG_VIDEO_CQCAM=m
+CONFIG_VIDEO_W9966=m
+CONFIG_VIDEO_CPIA=m
+CONFIG_VIDEO_CPIA_PP=m
+CONFIG_VIDEO_CPIA_USB=m
+CONFIG_VIDEO_SAA5246A=m
+CONFIG_VIDEO_SAA5249=m
+CONFIG_TUNER_3036=m
+CONFIG_VIDEO_STRADIS=m
+CONFIG_VIDEO_ZORAN=m
+CONFIG_VIDEO_ZORAN_BUZ=m
+CONFIG_VIDEO_ZORAN_DC10=m
+CONFIG_VIDEO_ZORAN_DC30=m
+CONFIG_VIDEO_ZORAN_LML33=m
+CONFIG_VIDEO_ZORAN_LML33R10=m
+CONFIG_VIDEO_MXB=m
+CONFIG_VIDEO_DPC=m
+CONFIG_VIDEO_HEXIUM_ORION=m
+CONFIG_VIDEO_HEXIUM_GEMINI=m
+CONFIG_VIDEO_CX88=m
+CONFIG_VIDEO_CX88_DVB=m
+CONFIG_VIDEO_OVCAMCHIP=m
+CONFIG_RADIO_GEMTEK_PCI=m
+CONFIG_RADIO_MAXIRADIO=m
+CONFIG_RADIO_MAESTRO=m
+CONFIG_DVB_CORE=m
+CONFIG_VIDEO_SAA7146=m
+CONFIG_VIDEO_SAA7146_VV=m
+CONFIG_VIDEO_TUNER=m
+CONFIG_VIDEO_BUF=m
+CONFIG_VIDEO_BUF_DVB=m
+CONFIG_VIDEO_BTCX=m
+CONFIG_VIDEO_IR=m
+CONFIG_VIDEO_TVEEPROM=m
+CONFIG_FB=y
+CONFIG_FB_CFB_IMAGEBLIT=y
+# CONFIG_FB_MACMODES is not set
+CONFIG_FB_MODE_HELPERS=y
+CONFIG_FB_TILEBLITTING=y
+CONFIG_FB_CIRRUS=m
+CONFIG_FB_PM2=m
+# CONFIG_FB_PM2_FIFO_DISCONNECT is not set
+CONFIG_FB_CYBER2000=m
+CONFIG_FB_ASILIANT=y
+# CONFIG_FB_IMSTT is not set
+CONFIG_FB_NVIDIA=m
+CONFIG_FB_NVIDIA_I2C=y
+# CONFIG_FB_RIVA is not set
+# CONFIG_FB_RIVA_I2C is not set
+# CONFIG_FB_RIVA_DEBUG is not set
+CONFIG_FB_MATROX=m
+CONFIG_FB_MATROX_MILLENIUM=y
+CONFIG_FB_MATROX_MYSTIQUE=y
+CONFIG_FB_MATROX_G=y
+CONFIG_FB_MATROX_I2C=m
+CONFIG_FB_MATROX_MAVEN=m
+CONFIG_FB_MATROX_MULTIHEAD=y
+CONFIG_FB_RADEON=m
+CONFIG_FB_RADEON_I2C=y
+# CONFIG_FB_RADEON_DEBUG is not set
+CONFIG_FB_ATY128=m
+CONFIG_FB_ATY=m
+CONFIG_FB_ATY_CT=y
+CONFIG_FB_ATY_GENERIC_LCD=y
+CONFIG_FB_ATY_GX=y
+CONFIG_FB_SAVAGE=m
+CONFIG_FB_SAVAGE_I2C=y
+# CONFIG_FB_SAVAGE_ACCEL is not set
+CONFIG_FB_SIS=m
+CONFIG_FB_SIS_300=y
+CONFIG_FB_SIS_315=y
+CONFIG_FB_NEOMAGIC=m
+CONFIG_FB_KYRO=m
+CONFIG_FB_3DFX=m
+# CONFIG_FB_3DFX_ACCEL is not set
+CONFIG_FB_VOODOO1=m
+CONFIG_FB_TRIDENT=m
+# CONFIG_FB_TRIDENT_ACCEL is not set
+CONFIG_FB_S1D13XXX=m
+# CONFIG_FB_VIRTUAL is not set
+CONFIG_VGA_CONSOLE=y
+CONFIG_DUMMY_CONSOLE=y
+CONFIG_FRAMEBUFFER_CONSOLE=m
+# CONFIG_FONTS is not set
+CONFIG_FONT_8x8=y
+CONFIG_FONT_8x16=y
+CONFIG_LOGO=y
+CONFIG_LOGO_LINUX_MONO=y
+CONFIG_LOGO_LINUX_VGA16=y
+CONFIG_LOGO_LINUX_CLUT224=y
+CONFIG_SOUND=y
+CONFIG_SND=m
+CONFIG_SND_TIMER=m
+CONFIG_SND_PCM=m
+CONFIG_SND_HWDEP=m
+CONFIG_SND_SEQUENCER=m
+CONFIG_SND_SEQ_DUMMY=m
+CONFIG_SND_OSSEMUL=y
+CONFIG_SND_MIXER_OSS=m
+CONFIG_SND_PCM_OSS=m
+CONFIG_SND_SEQUENCER_OSS=y
+# CONFIG_SND_VERBOSE_PRINTK is not set
+# CONFIG_SND_DEBUG is not set
+CONFIG_SND_MPU401_UART=m
+CONFIG_SND_OPL3_LIB=m
+CONFIG_SND_VX_LIB=m
+CONFIG_SND_DUMMY=m
+CONFIG_SND_VIRMIDI=m
+CONFIG_SND_MTPAV=m
+CONFIG_SND_SERIAL_U16550=m
+CONFIG_SND_MPU401=m
+CONFIG_SND_AC97_CODEC=m
+CONFIG_SND_ALI5451=m
+CONFIG_SND_ATIIXP=m
+CONFIG_SND_ATIIXP_MODEM=m
+CONFIG_SND_AU8810=m
+CONFIG_SND_AU8820=m
+CONFIG_SND_AU8830=m
+CONFIG_SND_AZT3328=m
+CONFIG_SND_BT87X=m
+# CONFIG_SND_BT87X_OVERCLOCK is not set
+CONFIG_SND_CS46XX=m
+CONFIG_SND_CS46XX_NEW_DSP=y
+CONFIG_SND_CS4281=m
+CONFIG_SND_EMU10K1=m
+CONFIG_SND_EMU10K1X=m
+CONFIG_SND_CA0106=m
+CONFIG_SND_KORG1212=m
+CONFIG_SND_MIXART=m
+CONFIG_SND_NM256=m
+CONFIG_SND_RME32=m
+CONFIG_SND_RME96=m
+CONFIG_SND_RME9652=m
+CONFIG_SND_HDSP=m
+CONFIG_SND_TRIDENT=m
+CONFIG_SND_YMFPCI=m
+CONFIG_SND_ALS4000=m
+CONFIG_SND_CMIPCI=m
+CONFIG_SND_ENS1370=m
+CONFIG_SND_ENS1371=m
+CONFIG_SND_ES1938=m
+CONFIG_SND_ES1968=m
+CONFIG_SND_MAESTRO3=m
+CONFIG_SND_FM801=m
+CONFIG_SND_FM801_TEA575X_BOOL=y
+CONFIG_SND_FM801_TEA575X=m
+CONFIG_SND_ICE1712=m
+CONFIG_SND_ICE1724=m
+CONFIG_SND_INTEL8X0=m
+CONFIG_SND_INTEL8X0M=m
+CONFIG_SND_SONICVIBES=m
+CONFIG_SND_VIA82XX=m
+CONFIG_SND_VIA82XX_MODEM=m
+CONFIG_SND_VX222=m
+CONFIG_SND_HDA_INTEL=m
+CONFIG_SND_USB_AUDIO=m
+CONFIG_SOUND_PRIME=m
+CONFIG_SOUND_CMPCI=m
+CONFIG_SOUND_CS4281=m
+CONFIG_SOUND_ES1370=m
+CONFIG_SOUND_ESSSOLO1=m
+CONFIG_SOUND_MAESTRO=m
+CONFIG_SOUND_MAESTRO3=m
+CONFIG_SOUND_SONICVIBES=m
+CONFIG_SOUND_TRIDENT=m
+CONFIG_SOUND_MSNDCLAS=m
+CONFIG_MSNDCLAS_INIT_FILE="m"
+CONFIG_MSNDCLAS_PERM_FILE="m"
+CONFIG_SOUND_MSNDPIN=m
+CONFIG_MSNDPIN_INIT_FILE="m"
+CONFIG_MSNDPIN_PERM_FILE="m"
+# CONFIG_SOUND_OSS is not set
+CONFIG_SOUND_ALI5455=m
+CONFIG_SOUND_FORTE=m
+CONFIG_SOUND_RME96XX=m
+CONFIG_SOUND_AD1980=m
+CONFIG_USB_ARCH_HAS_HCD=y
+CONFIG_USB_ARCH_HAS_OHCI=y
+CONFIG_USB=m
+# CONFIG_USB_DEBUG is not set
+CONFIG_USB_DEVICEFS=y
+# CONFIG_USB_DYNAMIC_MINORS is not set
+# CONFIG_USB_SUSPEND is not set
+# CONFIG_USB_OTG is not set
+CONFIG_USB_EHCI_HCD=m
+# CONFIG_USB_EHCI_SPLIT_ISO is not set
+CONFIG_USB_EHCI_ROOT_HUB_TT=y
+CONFIG_USB_OHCI_HCD=m
+CONFIG_USB_OHCI_LITTLE_ENDIAN=y
+CONFIG_USB_UHCI_HCD=m
+CONFIG_USB_SL811_HCD=m
+CONFIG_USB_SL811_CS=m
+CONFIG_USB_ACM=m
+CONFIG_USB_PRINTER=m
+CONFIG_USB_STORAGE=m
+# CONFIG_USB_STORAGE_DEBUG is not set
+CONFIG_USB_STORAGE_DATAFAB=y
+CONFIG_USB_STORAGE_FREECOM=y
+CONFIG_USB_STORAGE_ISD200=y
+CONFIG_USB_STORAGE_DPCM=y
+CONFIG_USB_STORAGE_USBAT=y
+CONFIG_USB_STORAGE_SDDR09=y
+CONFIG_USB_STORAGE_SDDR55=y
+CONFIG_USB_STORAGE_JUMPSHOT=y
+CONFIG_USB_HID=m
+CONFIG_HID_FF=y
+# CONFIG_HID_PID is not set
+# CONFIG_LOGITECH_FF is not set
+# CONFIG_THRUSTMASTER_FF is not set
+CONFIG_USB_HIDDEV=y
+CONFIG_USB_KBD=m
+CONFIG_USB_MOUSE=m
+CONFIG_USB_MDC800=m
+CONFIG_USB_MICROTEK=m
+CONFIG_USB_VICAM=m
+CONFIG_USB_DSBR=m
+CONFIG_USB_IBMCAM=m
+CONFIG_USB_KONICAWC=m
+CONFIG_USB_OV511=m
+CONFIG_USB_SE401=m
+CONFIG_USB_SN9C102=m
+CONFIG_USB_STV680=m
+CONFIG_USB_W9968CF=m
+CONFIG_USB_PWC=m
+CONFIG_USB_CATC=m
+CONFIG_USB_KAWETH=m
+CONFIG_USB_PEGASUS=m
+CONFIG_USB_RTL8150=m
+CONFIG_USB_USBNET=m
+CONFIG_USB_ALI_M5632=y
+CONFIG_USB_AN2720=y
+CONFIG_USB_BELKIN=y
+CONFIG_USB_ARMLINUX=y
+CONFIG_USB_EPSON2888=y
+CONFIG_USB_ZD1201=m
+CONFIG_USB_USS720=m
+CONFIG_USB_AUERSWALD=m
+CONFIG_USB_RIO500=m
+CONFIG_USB_LEGOTOWER=m
+CONFIG_USB_LCD=m
+CONFIG_USB_LED=m
+CONFIG_USB_CYTHERM=m
+CONFIG_USB_PHIDGETKIT=m
+CONFIG_USB_PHIDGETSERVO=m
+CONFIG_USB_IDMOUSE=m
+CONFIG_USB_SISUSBVGA=m
+CONFIG_USB_TEST=m
+# CONFIG_USB_GADGET is not set
+CONFIG_MMC=m
+# CONFIG_MMC_DEBUG is not set
+CONFIG_MMC_BLOCK=m
+CONFIG_SGI_IOC4=m
+CONFIG_SGI_IOC3=m
+CONFIG_JBD=m
+CONFIG_FS_MBCACHE=m
+CONFIG_ADFS_FS=m
+# CONFIG_ADFS_FS_RW is not set
+CONFIG_AFFS_FS=m
+CONFIG_HFS_FS=m
+CONFIG_HFSPLUS_FS=m
+CONFIG_BEFS_FS=m
+# CONFIG_BEFS_DEBUG is not set
+CONFIG_BFS_FS=m
+CONFIG_EFS_FS=m
+CONFIG_JFFS2_FS=m
+CONFIG_JFFS2_FS_DEBUG=0
+CONFIG_JFFS2_FS_WRITEBUFFER=y
+# CONFIG_JFFS2_FS_NAND is not set
+CONFIG_JFFS2_FS_NOR_ECC=y
+# CONFIG_JFFS2_COMPRESSION_OPTIONS is not set
+CONFIG_JFFS2_ZLIB=y
+CONFIG_JFFS2_RTIME=y
+# CONFIG_JFFS2_RUBIN is not set
+CONFIG_VXFS_FS=m
+CONFIG_HPFS_FS=m
+CONFIG_QNX4FS_FS=m
+CONFIG_SYSV_FS=m
+CONFIG_UFS_FS=m
+# CONFIG_UFS_FS_WRITE is not set
+CONFIG_SUNRPC_GSS=m
+CONFIG_RPCSEC_GSS_KRB5=m
+CONFIG_RPCSEC_GSS_SPKM3=m
+CONFIG_SMB_FS=m
+CONFIG_SMB_NLS_DEFAULT=y
+CONFIG_SMB_NLS_REMOTE="cp437"
+CONFIG_CIFS=m
+# CONFIG_CIFS_STATS is not set
+# CONFIG_CIFS_XATTR is not set
+# CONFIG_CIFS_EXPERIMENTAL is not set
+CONFIG_NCP_FS=m
+CONFIG_NCPFS_PACKET_SIGNING=y
+CONFIG_NCPFS_IOCTL_LOCKING=y
+CONFIG_NCPFS_STRONG=y
+CONFIG_NCPFS_NFS_NS=y
+CONFIG_NCPFS_OS2_NS=y
+CONFIG_NCPFS_SMALLDOS=y
+CONFIG_NCPFS_NLS=y
+CONFIG_NCPFS_EXTRAS=y
+CONFIG_CODA_FS=m
+CONFIG_CODA_FS_OLD_API=y
+CONFIG_AFS_FS=m
+# CONFIG_AFS_DEBUG is not set
+CONFIG_ACORN_PARTITION=y
+# CONFIG_ACORN_PARTITION_CUMANA is not set
+CONFIG_ACORN_PARTITION_EESOX=y
+CONFIG_ACORN_PARTITION_ICS=y
+CONFIG_ACORN_PARTITION_ADFS=y
+CONFIG_ACORN_PARTITION_POWERTEC=y
+CONFIG_ACORN_PARTITION_RISCIX=y
+CONFIG_OSF_PARTITION=y
+CONFIG_AMIGA_PARTITION=y
+CONFIG_ATARI_PARTITION=y
+CONFIG_MAC_PARTITION=y
+CONFIG_BSD_DISKLABEL=y
+CONFIG_MINIX_SUBPARTITION=y
+CONFIG_SOLARIS_X86_PARTITION=y
+CONFIG_UNIXWARE_DISKLABEL=y
+CONFIG_LDM_PARTITION=y
+CONFIG_LDM_DEBUG=y
+CONFIG_SGI_PARTITION=y
+CONFIG_ULTRIX_PARTITION=y
+CONFIG_SUN_PARTITION=y
+CONFIG_EFI_PARTITION=y
+CONFIG_CRC_CCITT=m
+CONFIG_CRC32=y
+CONFIG_REED_SOLOMON=m
+CONFIG_REED_SOLOMON_DEC16=y
+CONFIG_GENERIC_HARDIRQS=y
+CONFIG_GENERIC_IRQ_PROBE=y
+# CONFIG_HP_SIMETH is not set
+# CONFIG_HP_SIMSERIAL is not set
+# CONFIG_HP_SIMSCSI is not set
+CONFIG_PROFILING=y
+CONFIG_OPROFILE=m
+CONFIG_DEBUG_KERNEL=y
+CONFIG_MAGIC_SYSRQ=y
+CONFIG_LOG_BUF_SHIFT=16
+# CONFIG_SCHEDSTATS is not set
+# CONFIG_DEBUG_SLAB is not set
+# CONFIG_DEBUG_SPINLOCK is not set
+# CONFIG_DEBUG_SPINLOCK_SLEEP is not set
+# CONFIG_DEBUG_KOBJECT is not set
+# CONFIG_DEBUG_INFO is not set
+# CONFIG_KPROBES is not set
+CONFIG_IA64_GRANULE_16MB=y
+# CONFIG_IA64_GRANULE_64MB is not set
+CONFIG_IA64_PRINT_HAZARDS=y
+# CONFIG_DISABLE_VHPT is not set
+# CONFIG_IA64_DEBUG_CMPXCHG is not set
+# CONFIG_IA64_DEBUG_IRQ is not set
+CONFIG_SYSVIPC_COMPAT=y
+# CONFIG_PM_DEBUG is not set
+CONFIG_DIGIEPCA=m
+# CONFIG_CPU_FREQ is not set
+CONFIG_CC_OPTIMIZE_FOR_SIZE=y
+# CONFIG_IPW2100 is not set
+CONFIG_RIO=m
+CONFIG_ARCH_FLATMEM_ENABLE=y
+CONFIG_DMA_IS_DMA32=y
+CONFIG_NODES_SHIFT=8
+CONFIG_HAVE_ARCH_EARLY_PFN_TO_NID=y
+CONFIG_ARCH_DISCONTIGMEM_DEFAULT=y
+CONFIG_AGP_SIS=m
+CONFIG_SWIOTLB=y
+CONFIG_RIO_OLDPCI=y
+CONFIG_NEED_MULTIPLE_NODES=y
+CONFIG_IA64_UNCACHED_ALLOCATOR=y
+CONFIG_GENERIC_FIND_NEXT_BIT=y
+CONFIG_ARCH_SPARSEMEM_ENABLE=y
+CONFIG_DISCONTIGMEM=y
+CONFIG_ARCH_SELECT_MEMORY_MODEL=y
+CONFIG_SPLIT_PTLOCK_CPUS=4
+CONFIG_SGI_SN=y
+CONFIG_MIGRATION=y
+CONFIG_ACPI_EC=y
+CONFIG_AGP_VIA=m
+# CONFIG_BLK_DEV_IDEPNP is not set
+CONFIG_GENERIC_PENDING_IRQ=y
+CONFIG_IA64_SGI_SN_XP=m
+CONFIG_HOTPLUG_CPU=y
+CONFIG_SCHED_SMT=y
+CONFIG_PERMIT_BSP_REMOVE=y
+CONFIG_IA32_SUPPORT=y
+CONFIG_COMPAT=y
+CONFIG_IA64_MCA_RECOVERY=m
+CONFIG_PERFMON=y
+CONFIG_IA64_PALINFO=m
+CONFIG_KEXEC=y
+CONFIG_CRASH_DUMP=y
+CONFIG_EFI_VARS=m
+CONFIG_ACPI_HOTPLUG_CPU=y
+CONFIG_ACPI_CONTAINER=y
+CONFIG_CPU_FREQ=y
+CONFIG_CPU_FREQ_TABLE=m
+CONFIG_CPU_FREQ_STAT=m
+CONFIG_CPU_FREQ_DEFAULT_GOV_PERFORMANCE=y
+CONFIG_CPU_FREQ_GOV_PERFORMANCE=y
+CONFIG_CPU_FREQ_GOV_POWERSAVE=m
+CONFIG_CPU_FREQ_GOV_USERSPACE=m
+CONFIG_CPU_FREQ_GOV_ONDEMAND=m
+CONFIG_CPU_FREQ_GOV_CONSERVATIVE=m
+CONFIG_IA64_ACPI_CPUFREQ=m
+CONFIG_PCIEPORTBUS=y
+CONFIG_PCIEAER=y
+CONFIG_PCI_MSI=y
+CONFIG_HOTPLUG_PCI=m
+CONFIG_PCCARD=m
+CONFIG_PCMCIA=m
+CONFIG_PCMCIA_LOAD_CIS=y
+CONFIG_PCMCIA_IOCTL=y
+CONFIG_CARDBUS=y
+CONFIG_YENTA=m
+CONFIG_YENTA_O2=y
+CONFIG_YENTA_RICOH=y
+CONFIG_YENTA_TI=y
+CONFIG_YENTA_ENE_TUNE=y
+CONFIG_YENTA_TOSHIBA=y
+CONFIG_PD6729=m
+CONFIG_I82092=m
+CONFIG_PCCARD_NONSTATIC=m
+CONFIG_HAMRADIO=y
+CONFIG_IRDA=m
+CONFIG_IRLAN=m
+CONFIG_IRNET=m
+CONFIG_IRCOMM=m
+CONFIG_IRDA_ULTRA=y
+CONFIG_IRDA_CACHE_LAST_LSAP=y
+CONFIG_IRDA_FAST_RR=y
+CONFIG_IRTTY_SIR=m
+CONFIG_DONGLE=y
+CONFIG_ESI_DONGLE=m
+CONFIG_ACTISYS_DONGLE=m
+CONFIG_TEKRAM_DONGLE=m
+CONFIG_TOIM3232_DONGLE=m
+CONFIG_LITELINK_DONGLE=m
+CONFIG_MA600_DONGLE=m
+CONFIG_GIRBIL_DONGLE=m
+CONFIG_MCP2120_DONGLE=m
+CONFIG_OLD_BELKIN_DONGLE=m
+CONFIG_ACT200L_DONGLE=m
+CONFIG_KINGSUN_DONGLE=m
+CONFIG_USB_IRDA=m
+CONFIG_SIGMATEL_FIR=m
+CONFIG_VLSI_FIR=m
+CONFIG_BT=m
+CONFIG_IDE=m
+CONFIG_IDE_MAX_HWIFS=4
+CONFIG_BLK_DEV_IDE=m
+CONFIG_BLK_DEV_IDEDISK=m
+CONFIG_BLK_DEV_IDECS=m
+CONFIG_BLK_DEV_IDECD=m
+CONFIG_BLK_DEV_IDETAPE=m
+CONFIG_BLK_DEV_IDEFLOPPY=m
+CONFIG_IDE_PROC_FS=y
+CONFIG_IDE_GENERIC=m
+CONFIG_BLK_DEV_IDEPCI=y
+CONFIG_IDEPCI_SHARE_IRQ=y
+CONFIG_BLK_DEV_GENERIC=m
+CONFIG_BLK_DEV_OPTI621=m
+CONFIG_BLK_DEV_IDEDMA_PCI=y
+CONFIG_BLK_DEV_AEC62XX=m
+CONFIG_BLK_DEV_ALI15X3=m
+CONFIG_BLK_DEV_AMD74XX=m
+CONFIG_BLK_DEV_CMD64X=m
+CONFIG_BLK_DEV_TRIFLEX=m
+CONFIG_BLK_DEV_CY82C693=m
+CONFIG_BLK_DEV_CS5520=m
+CONFIG_BLK_DEV_CS5530=m
+CONFIG_BLK_DEV_HPT34X=m
+CONFIG_BLK_DEV_HPT366=m
+CONFIG_BLK_DEV_JMICRON=m
+CONFIG_BLK_DEV_SC1200=m
+CONFIG_BLK_DEV_PIIX=m
+CONFIG_BLK_DEV_IT8213=m
+CONFIG_BLK_DEV_IT821X=m
+CONFIG_BLK_DEV_NS87415=m
+CONFIG_BLK_DEV_PDC202XX_OLD=m
+CONFIG_BLK_DEV_PDC202XX_NEW=m
+CONFIG_BLK_DEV_SVWKS=m
+CONFIG_BLK_DEV_SGIIOC4=m
+CONFIG_BLK_DEV_SIIMAGE=m
+CONFIG_BLK_DEV_SLC90E66=m
+CONFIG_BLK_DEV_TRM290=m
+CONFIG_BLK_DEV_VIA82CXXX=m
+CONFIG_BLK_DEV_TC86C001=m
+CONFIG_BLK_DEV_IDEDMA=y
+CONFIG_SCSI_ARCMSR=m
+CONFIG_MEGARAID_NEWGEN=y
+CONFIG_MEGARAID_MM=m
+CONFIG_MEGARAID_MAILBOX=m
+CONFIG_MEGARAID_LEGACY=m
+CONFIG_SCSI_DMX3191D=m
+CONFIG_SCSI_IPS=m
+CONFIG_SCSI_INITIO=m
+CONFIG_SCSI_INIA100=m
+CONFIG_SCSI_PPA=m
+CONFIG_SCSI_IMM=m
+CONFIG_SCSI_SYM53C8XX_2=m
+CONFIG_SCSI_SYM53C8XX_DMA_ADDRESSING_MODE=1
+CONFIG_SCSI_SYM53C8XX_DEFAULT_TAGS=16
+CONFIG_SCSI_SYM53C8XX_MAX_TAGS=64
+CONFIG_SCSI_SYM53C8XX_MMIO=y
+CONFIG_SCSI_IPR=m
+CONFIG_SCSI_IPR_TRACE=y
+CONFIG_SCSI_IPR_DUMP=y
+CONFIG_SCSI_QLOGIC_1280=m
+CONFIG_SCSI_LPFC=m
+CONFIG_SCSI_DC395x=m
+CONFIG_SCSI_DC390T=m
+CONFIG_PCMCIA_FDOMAIN=m
+CONFIG_PCMCIA_QLOGIC=m
+CONFIG_PCMCIA_SYM53C500=m
+CONFIG_PATA_ALI=m
+CONFIG_DM_MULTIPATH_EMC=m
+CONFIG_IEEE1394=m
+CONFIG_IEEE1394_PCILYNX=m
+CONFIG_IEEE1394_OHCI1394=m
+CONFIG_IEEE1394_VIDEO1394=m
+CONFIG_IEEE1394_SBP2=m
+CONFIG_IEEE1394_ETH1394_ROM_ENTRY=y
+CONFIG_IEEE1394_ETH1394=m
+CONFIG_IEEE1394_DV1394=m
+CONFIG_IEEE1394_RAWIO=m
+CONFIG_I2O=m
+CONFIG_I2O_LCT_NOTIFY_ON_CHANGES=y
+CONFIG_I2O_EXT_ADAPTEC=y
+CONFIG_I2O_EXT_ADAPTEC_DMA64=y
+CONFIG_I2O_CONFIG=m
+CONFIG_I2O_CONFIG_OLD_IOCTL=y
+CONFIG_I2O_BUS=m
+CONFIG_I2O_BLOCK=m
+CONFIG_I2O_SCSI=m
+CONFIG_I2O_PROC=m
+CONFIG_NET_SB1000=m
+CONFIG_ARCNET=m
+CONFIG_ARCNET_1201=m
+CONFIG_ARCNET_1051=m
+CONFIG_ARCNET_RAW=m
+CONFIG_ARCNET_CAP=m
+CONFIG_ARCNET_COM90xx=m
+CONFIG_ARCNET_COM90xxIO=m
+CONFIG_ARCNET_RIM_I=m
+CONFIG_ARCNET_COM20020=m
+CONFIG_ARCNET_COM20020_PCI=m
+CONFIG_NET_VENDOR_3COM=y
+CONFIG_DE4X5=y
+CONFIG_3C359=m
+CONFIG_IPW2100=m
+CONFIG_IPW2100_MONITOR=y
+CONFIG_PCMCIA_SPECTRUM=m
+CONFIG_HOSTAP_CS=m
+CONFIG_PCMCIA_3C589=m
+CONFIG_USB_LIBUSUAL=y
+CONFIG_USB_SERIAL_WHITEHEAT=m
+CONFIG_USB_SERIAL_EDGEPORT=m
+CONFIG_USB_SERIAL_EDGEPORT_TI=m
+CONFIG_USB_EMI62=m
+CONFIG_USB_EMI26=m
+CONFIG_LEDS_TRIGGER_IDE_DISK=y
+CONFIG_INFINIBAND_IPATH=m
+CONFIG_PROC_VMCORE=y

Added: dists/sid/linux-2.6/debian/config/ia64/config.itanium
==============================================================================
--- (empty file)
+++ dists/sid/linux-2.6/debian/config/ia64/config.itanium	Mon Nov 26 20:06:56 2007
@@ -0,0 +1,10 @@
+CONFIG_LOCK_KERNEL=y
+CONFIG_STOP_MACHINE=y
+CONFIG_ITANIUM=y
+# CONFIG_MCKINLEY is not set
+CONFIG_IA64_BRL_EMU=y
+CONFIG_IA64_L1_CACHE_SHIFT=6
+CONFIG_SMP=y
+CONFIG_NR_CPUS=64
+# CONFIG_HOTPLUG_CPU is not set
+# CONFIG_SCHED_SMT is not set

Added: dists/sid/linux-2.6/debian/config/ia64/config.mckinley
==============================================================================
--- (empty file)
+++ dists/sid/linux-2.6/debian/config/ia64/config.mckinley	Mon Nov 26 20:06:56 2007
@@ -0,0 +1,9 @@
+CONFIG_LOCK_KERNEL=y
+CONFIG_STOP_MACHINE=y
+# CONFIG_ITANIUM is not set
+CONFIG_MCKINLEY=y
+CONFIG_IA64_L1_CACHE_SHIFT=7
+CONFIG_SMP=y
+CONFIG_NR_CPUS=64
+# CONFIG_HOTPLUG_CPU is not set
+# CONFIG_SCHED_SMT is not set

Added: dists/sid/linux-2.6/debian/config/ia64/defines
==============================================================================
--- (empty file)
+++ dists/sid/linux-2.6/debian/config/ia64/defines	Mon Nov 26 20:06:56 2007
@@ -0,0 +1,20 @@
+[base]
+featuresets:
+ vserver
+flavours:
+ itanium
+ mckinley
+kernel-arch: ia64
+kernel-header-dirs: ia64
+subarches:
+ vserver
+
+[image]
+suggests: elilo, fdutils
+type: kernel-package
+
+[itanium_base]
+class: Itanium
+
+[mckinley_base]
+class: Itanium II

Added: dists/sid/linux-2.6/debian/config/ia64/vserver/defines
==============================================================================
--- (empty file)
+++ dists/sid/linux-2.6/debian/config/ia64/vserver/defines	Mon Nov 26 20:06:56 2007
@@ -0,0 +1,15 @@
+[base]
+flavours:
+ itanium
+ mckinley
+kernel-header-dirs: ia64
+
+[image]
+recommends: util-vserver
+
+[itanium_image]
+configs: ia64/config.itanium
+
+[mckinley_image]
+configs: ia64/config.mckinley
+

Added: dists/sid/linux-2.6/debian/config/m68k/README.build
==============================================================================
--- (empty file)
+++ dists/sid/linux-2.6/debian/config/m68k/README.build	Mon Nov 26 20:06:56 2007
@@ -0,0 +1,26 @@
+HOWTO cross-build m68k linux-image
+
+Building linux-image packages takes a while, especially on the "slower
+arches", ie m68k. Cross-compiling is an alternative, and it works very well
+for m68k.
+
+You need to set up a cross-compiler. The toolchain-source package has some
+limitations, I prefer using cross-tools, see this page for instructions:
+
+ http://people.debian.org/~cts/debian-m68k/cross-compile/
+
+Now you only have to tell the debian build system, that you do want to build
+packages for m68k. It used to be sufficient to pass an option to debuild,
+since recently you also have to set an environment variable, like this:
+
+ DEB_HOST_ARCH=m68k debuild -B -am68k
+
+If you also want to build source packages, omit the -B. 
+
+If you want to build images for just one of the currently nine subarches,
+you can uncomment some lines in the flavours section in:
+ debian/arch/m68k/defines
+
+The first run of debuild will give you an error message that updating the
+configs suceeded, the second run will build the images.
+

Added: dists/sid/linux-2.6/debian/config/m68k/config
==============================================================================
--- (empty file)
+++ dists/sid/linux-2.6/debian/config/m68k/config	Mon Nov 26 20:06:56 2007
@@ -0,0 +1,203 @@
+# we don't trust the compiler, unfortunately, this does not fix the *vme* problems
+# CONFIG_CC_OPTIMIZE_FOR_SIZE is not set
+# build in SCSI for m68k
+CONFIG_SCSI=y
+CONFIG_BLK_DEV_SD=y
+# disable ISCSI to avoid
+# include/scsi/iscsi_if.h:241: error: syntax error before "volatile"
+# CONFIG_SCSI_ISCSI_ATTRS is not set
+# CONFIG_ISCSI_TCP is not set
+#
+CONFIG_M68K=y
+CONFIG_MMU=y
+CONFIG_UID16=y
+CONFIG_RWSEM_GENERIC_SPINLOCK=y
+CONFIG_GENERIC_CALIBRATE_DELAY=y
+CONFIG_EXPERIMENTAL=y
+CONFIG_BROKEN_ON_SMP=y
+CONFIG_LOCALVERSION=""
+CONFIG_SWAP=y
+CONFIG_SYSVIPC=y
+CONFIG_POSIX_MQUEUE=y
+# CONFIG_HOTPLUG is not set
+# CONFIG_IKCONFIG is not set
+# CONFIG_KALLSYMS_ALL is not set
+CONFIG_BASE_FULL=y
+CONFIG_CC_ALIGN_FUNCTIONS=0
+CONFIG_CC_ALIGN_LABELS=0
+CONFIG_CC_ALIGN_LOOPS=0
+CONFIG_CC_ALIGN_JUMPS=0
+CONFIG_BASE_SMALL=0
+CONFIG_MODULES=y
+CONFIG_OBSOLETE_MODPARM=y
+CONFIG_KMOD=y
+# CONFIG_ADVANCED is not set
+CONFIG_BINFMT_ELF=y
+CONFIG_BINFMT_AOUT=m
+CONFIG_BINFMT_MISC=m
+CONFIG_PROC_HARDWARE=y
+CONFIG_STANDALONE=y
+CONFIG_PREVENT_FIRMWARE_BUILD=y
+# CONFIG_DEBUG_DRIVER is not set
+# CONFIG_MTD is not set
+# CONFIG_BLK_DEV_COW_COMMON is not set
+CONFIG_BLK_DEV_LOOP=y
+CONFIG_BLK_DEV_CRYPTOLOOP=m
+CONFIG_BLK_DEV_NBD=m
+CONFIG_BLK_DEV_RAM=y
+CONFIG_BLK_DEV_RAM_COUNT=16
+CONFIG_BLK_DEV_RAM_SIZE=4096
+CONFIG_BLK_DEV_INITRD=y
+CONFIG_INITRAMFS_SOURCE=""
+# CONFIG_CDROM_PKTCDVD is not set
+CONFIG_IOSCHED_NOOP=y
+CONFIG_IOSCHED_AS=y
+CONFIG_IOSCHED_DEADLINE=y
+CONFIG_IOSCHED_CFQ=y
+# CONFIG_ATA_OVER_ETH is not set
+# CONFIG_SCSI_DEBUG is not set
+CONFIG_MD=y
+CONFIG_NET_KEY=y
+# CONFIG_IP_ADVANCED_ROUTER is not set
+CONFIG_IP_TCPDIAG=y
+# CONFIG_IP_TCPDIAG_IPV6 is not set
+CONFIG_IP_SCTP=m
+# CONFIG_SCTP_DBG_MSG is not set
+# CONFIG_SCTP_DBG_OBJCNT is not set
+# CONFIG_SCTP_HMAC_NONE is not set
+# CONFIG_ATM is not set
+# CONFIG_BRIDGE is not set
+# CONFIG_VLAN_8021Q is not set
+# CONFIG_DECNET is not set
+CONFIG_LLC=m
+# CONFIG_LLC2 is not set
+CONFIG_ATALK=m
+# CONFIG_X25 is not set
+# CONFIG_LAPB is not set
+# CONFIG_ECONET is not set
+# CONFIG_WAN_ROUTER is not set
+# CONFIG_NET_SCHED is not set
+CONFIG_NETPOLL=y
+# CONFIG_NETPOLL_TRAP is not set
+CONFIG_NET_POLL_CONTROLLER=y
+# CONFIG_HAMRADIO is not set
+# CONFIG_IRDA is not set
+# CONFIG_BT is not set
+CONFIG_NETDEVICES=y
+CONFIG_DUMMY=m
+# CONFIG_BONDING is not set
+CONFIG_EQUALIZER=m
+# CONFIG_TUN is not set
+# CONFIG_NET_RADIO is not set
+# CONFIG_WAN is not set
+CONFIG_PPP=m
+# CONFIG_PPP_MULTILINK is not set
+CONFIG_PPP_DEFLATE=m
+CONFIG_PPP_BSDCOMP=m
+CONFIG_PPPOE=m
+CONFIG_SLIP=m
+CONFIG_SLIP_COMPRESSED=y
+CONFIG_SLIP_SMART=y
+CONFIG_SLIP_MODE_SLIP6=y
+CONFIG_SHAPER=m
+CONFIG_NETCONSOLE=m
+# CONFIG_ISDN is not set
+# CONFIG_PHONE is not set
+CONFIG_INPUT=y
+CONFIG_INPUT_MOUSEDEV=y
+CONFIG_INPUT_MOUSEDEV_PSAUX=y
+CONFIG_INPUT_MOUSEDEV_SCREEN_X=1024
+CONFIG_INPUT_MOUSEDEV_SCREEN_Y=768
+# CONFIG_INPUT_JOYDEV is not set
+# CONFIG_INPUT_TSDEV is not set
+CONFIG_INPUT_EVDEV=m
+CONFIG_INPUT_KEYBOARD=y
+# CONFIG_KEYBOARD_LKKBD is not set
+# CONFIG_KEYBOARD_XTKBD is not set
+# CONFIG_KEYBOARD_NEWTON is not set
+CONFIG_INPUT_MOUSE=y
+# CONFIG_MOUSE_VSXXXAA is not set
+# CONFIG_INPUT_TOUCHSCREEN is not set
+# CONFIG_SERIO_RAW is not set
+# CONFIG_GAMEPORT is not set
+CONFIG_VT=y
+CONFIG_VT_CONSOLE=y
+CONFIG_HW_CONSOLE=y
+# CONFIG_SERIAL_NONSTANDARD is not set
+# CONFIG_IPMI_HANDLER is not set
+# CONFIG_WATCHDOG is not set
+CONFIG_GEN_RTC_X=y
+# CONFIG_DTLK is not set
+# CONFIG_R3964 is not set
+# CONFIG_DRM is not set
+# CONFIG_RAW_DRIVER is not set
+# CONFIG_I2C is not set
+# CONFIG_W1 is not set
+# CONFIG_VIDEO_DEV is not set
+# CONFIG_DVB is not set
+CONFIG_DUMMY_CONSOLE=y
+# CONFIG_USB_ARCH_HAS_HCD is not set
+# CONFIG_USB_ARCH_HAS_OHCI is not set
+# CONFIG_USB_GADGET is not set
+# CONFIG_MMC is not set
+# CONFIG_INFINIBAND is not set
+CONFIG_EXT2_FS=y
+CONFIG_EXT3_FS=y
+CONFIG_JBD=y
+# CONFIG_JBD_DEBUG is not set
+CONFIG_SYSFS=y
+CONFIG_TMPFS=y
+CONFIG_RAMFS=y
+# CONFIG_ADFS_FS is not set
+# CONFIG_BEFS_FS is not set
+# CONFIG_BFS_FS is not set
+# CONFIG_EFS_FS is not set
+CONFIG_CRAMFS=m
+# CONFIG_VXFS_FS is not set
+CONFIG_HPFS_FS=m
+# CONFIG_QNX4FS_FS is not set
+CONFIG_SYSV_FS=m
+CONFIG_UFS_FS=m
+# CONFIG_NFS_DIRECTIO is not set
+CONFIG_LOCKD_V4=y
+CONFIG_EXPORTFS=m
+# CONFIG_RPCSEC_GSS_SPKM3 is not set
+CONFIG_SMB_FS=m
+CONFIG_SMB_NLS_DEFAULT=y
+CONFIG_SMB_NLS_REMOTE="cp437"
+# CONFIG_CIFS is not set
+CONFIG_NCP_FS=m
+# CONFIG_NCPFS_PACKET_SIGNING is not set
+# CONFIG_NCPFS_IOCTL_LOCKING is not set
+# CONFIG_NCPFS_STRONG is not set
+# CONFIG_NCPFS_SMALLDOS is not set
+CONFIG_NCPFS_NLS=y
+# CONFIG_NCPFS_EXTRAS is not set
+CONFIG_CODA_FS=m
+# CONFIG_CODA_FS_OLD_API is not set
+# CONFIG_AFS_FS is not set
+CONFIG_MSDOS_PARTITION=y
+# CONFIG_PRINTK_TIME is not set
+CONFIG_DEBUG_KERNEL=y
+CONFIG_MAGIC_SYSRQ=y
+CONFIG_LOG_BUF_SHIFT=16
+# CONFIG_SCHEDSTATS is not set
+# CONFIG_DEBUG_SLAB is not set
+# CONFIG_DEBUG_SPINLOCK is not set
+# CONFIG_DEBUG_SPINLOCK_SLEEP is not set
+# CONFIG_DEBUG_KOBJECT is not set
+# CONFIG_DEBUG_INFO is not set
+# CONFIG_DEBUG_FS is not set
+# CONFIG_FRAME_POINTER is not set
+CONFIG_CRC_CCITT=m
+CONFIG_LIBCRC32C=m
+CONFIG_ZLIB_INFLATE=y
+CONFIG_ZLIB_DEFLATE=m
+# CONFIG_IEEE80211_CRYPT_CCMP is not set
+# CONFIG_IEEE80211_CRYPT_TKIP is not set
+# CONFIG_IEEE80211_CRYPT_WEP is not set
+# CONFIG_IEEE80211 is not set
+# CONFIG_IPW2100 is not set
+# new for 2.6.16:
+# CONFIG_SENSORS_F71805F is not set
+CONFIG_SERIAL_8250_RUNTIME_UARTS=4

Added: dists/sid/linux-2.6/debian/config/m68k/config.amiga
==============================================================================
--- (empty file)
+++ dists/sid/linux-2.6/debian/config/m68k/config.amiga	Mon Nov 26 20:06:56 2007
@@ -0,0 +1,196 @@
+CONFIG_BROKEN=y
+# CONFIG_SUN3 is not set
+CONFIG_AMIGA=y
+# CONFIG_ATARI is not set
+# CONFIG_MAC is not set
+# CONFIG_APOLLO is not set
+# CONFIG_VME is not set
+# CONFIG_HP300 is not set
+# CONFIG_SUN3X is not set
+# CONFIG_Q40 is not set
+CONFIG_M68020=y
+CONFIG_M68030=y
+CONFIG_M68040=y
+CONFIG_M68060=y
+CONFIG_MMU_MOTOROLA=y
+CONFIG_M68KFPU_EMU=y
+CONFIG_M68KFPU_EMU_EXTRAPREC=y
+# CONFIG_M68KFPU_EMU_ONLY is not set
+CONFIG_ZORRO=y
+CONFIG_AMIGA_PCMCIA=y
+# CONFIG_HEARTBEAT is not set
+CONFIG_ISA=y
+CONFIG_GENERIC_ISA_DMA=y
+CONFIG_ZORRO_NAMES=y
+CONFIG_PARPORT_AMIGA=m
+CONFIG_PARPORT_MFC3=m
+# CONFIG_PNP is not set
+CONFIG_AMIGA_FLOPPY=y
+CONFIG_AMIGA_Z2RAM=y
+# CONFIG_PARIDE is not set
+CONFIG_IDE=y
+CONFIG_BLK_DEV_IDE=y
+# CONFIG_BLK_DEV_IDE_SATA is not set
+CONFIG_BLK_DEV_IDEDISK=y
+# CONFIG_IDEDISK_MULTI_MODE is not set
+CONFIG_BLK_DEV_IDECD=y
+# disable IDETAPE, causes ICE
+# CONFIG_BLK_DEV_IDETAPE is not set
+CONFIG_BLK_DEV_IDEFLOPPY=m
+CONFIG_IDE_GENERIC=y
+# CONFIG_IDE_ARM is not set
+CONFIG_BLK_DEV_GAYLE=y
+CONFIG_BLK_DEV_IDEDOUBLER=y
+CONFIG_BLK_DEV_BUDDHA=y
+# CONFIG_IDE_CHIPSETS is not set
+# CONFIG_BLK_DEV_IDEDMA is not set
+# CONFIG_BLK_DEV_HD is not set
+# CONFIG_SCSI_ADVANSYS is not set
+# CONFIG_SCSI_IN2000 is not set
+# CONFIG_SCSI_DTC3280 is not set
+# CONFIG_SCSI_EATA_PIO is not set
+# CONFIG_SCSI_FUTURE_DOMAIN is not set
+# CONFIG_SCSI_GENERIC_NCR5380 is not set
+# CONFIG_SCSI_GENERIC_NCR5380_MMIO is not set
+# CONFIG_SCSI_PPA is not set
+# CONFIG_SCSI_IMM is not set
+# CONFIG_SCSI_NCR53C406A is not set
+# CONFIG_SCSI_PAS16 is not set
+# CONFIG_SCSI_PSI240I is not set
+# CONFIG_SCSI_QLOGIC_FAS is not set
+# CONFIG_SCSI_SYM53C416 is not set
+# CONFIG_SCSI_T128 is not set
+CONFIG_A3000_SCSI=y
+CONFIG_A2091_SCSI=y
+CONFIG_GVP11_SCSI=y
+CONFIG_CYBERSTORM_SCSI=y
+CONFIG_CYBERSTORMII_SCSI=y
+CONFIG_BLZ2060_SCSI=y
+CONFIG_BLZ1230_SCSI=y
+CONFIG_FASTLANE_SCSI=y
+CONFIG_SCSI_AMIGA7XX=y
+# CONFIG_OKTAGON_SCSI is not set
+# CONFIG_SCSI_NCR53C7xx_FAST is not set
+# CONFIG_FIREWIRE is not set
+# CONFIG_IP_PNP is not set
+CONFIG_IPX=m
+# CONFIG_IPX_INTERN is not set
+# CONFIG_ARCNET is not set
+CONFIG_NET_ETHERNET=y
+CONFIG_ARIADNE=m
+CONFIG_A2065=m
+CONFIG_HYDRA=m
+CONFIG_ZORRO8390=m
+CONFIG_APNE=m
+# CONFIG_NET_VENDOR_3COM is not set
+# CONFIG_NET_VENDOR_SMC is not set
+# CONFIG_NET_VENDOR_RACAL is not set
+# CONFIG_AT1700 is not set
+# CONFIG_DEPCA is not set
+# CONFIG_HP100 is not set
+# CONFIG_NET_ISA is not set
+# CONFIG_NET_PCI is not set
+# CONFIG_TR is not set
+CONFIG_PLIP=m
+CONFIG_PPP_FILTER=y
+CONFIG_PPP_ASYNC=m
+CONFIG_PPP_SYNC_TTY=m
+# CONFIG_KEYBOARD_ATKBD is not set
+# CONFIG_KEYBOARD_SUNKBD is not set
+CONFIG_KEYBOARD_AMIGA=y
+# CONFIG_MOUSE_PS2 is not set
+# CONFIG_MOUSE_SERIAL is not set
+# CONFIG_MOUSE_INPORT is not set
+# CONFIG_MOUSE_LOGIBM is not set
+# CONFIG_MOUSE_PC110PAD is not set
+CONFIG_MOUSE_AMIGA=y
+CONFIG_INPUT_JOYSTICK=y
+# CONFIG_JOYSTICK_ANALOG is not set
+# CONFIG_JOYSTICK_A3D is not set
+# CONFIG_JOYSTICK_ADI is not set
+# CONFIG_JOYSTICK_COBRA is not set
+# CONFIG_JOYSTICK_GF2K is not set
+# CONFIG_JOYSTICK_GRIP is not set
+# CONFIG_JOYSTICK_GRIP_MP is not set
+# CONFIG_JOYSTICK_GUILLEMOT is not set
+# CONFIG_JOYSTICK_INTERACT is not set
+# CONFIG_JOYSTICK_SIDEWINDER is not set
+# CONFIG_JOYSTICK_TMDC is not set
+# CONFIG_JOYSTICK_IFORCE is not set
+# CONFIG_JOYSTICK_WARRIOR is not set
+# CONFIG_JOYSTICK_MAGELLAN is not set
+# CONFIG_JOYSTICK_SPACEORB is not set
+# CONFIG_JOYSTICK_SPACEBALL is not set
+# CONFIG_JOYSTICK_STINGER is not set
+# CONFIG_JOYSTICK_TWIDJOY is not set
+# CONFIG_JOYSTICK_DB9 is not set
+# CONFIG_JOYSTICK_GAMECON is not set
+# CONFIG_JOYSTICK_TURBOGRAFX is not set
+CONFIG_JOYSTICK_AMIGA=m
+# CONFIG_JOYSTICK_JOYDUMP is not set
+# CONFIG_INPUT_MISC is not set
+CONFIG_SERIO=m
+CONFIG_SERIO_SERPORT=m
+# CONFIG_SERIO_PARKBD is not set
+CONFIG_A2232=m
+# CONFIG_SERIAL_8250 is not set
+CONFIG_PRINTER=m
+# CONFIG_LP_CONSOLE is not set
+# CONFIG_PPDEV is not set
+# CONFIG_TIPAR is not set
+CONFIG_GEN_RTC=m
+CONFIG_FB=y
+CONFIG_FB_CFB_IMAGEBLIT=y
+# CONFIG_FB_MACMODES is not set
+# CONFIG_FB_MODE_HELPERS is not set
+# CONFIG_FB_TILEBLITTING is not set
+CONFIG_FB_CIRRUS=y
+# CONFIG_FB_PM2 is not set
+CONFIG_FB_AMIGA=y
+CONFIG_FB_AMIGA_OCS=y
+CONFIG_FB_AMIGA_ECS=y
+CONFIG_FB_AMIGA_AGA=y
+# CONFIG_FB_CYBER is not set
+# CONFIG_FB_VIRGE is not set
+# CONFIG_FB_RETINAZ3 is not set
+CONFIG_FB_FM2=y
+# CONFIG_FB_S1D13XXX is not set
+# CONFIG_FB_VIRTUAL is not set
+CONFIG_FRAMEBUFFER_CONSOLE=y
+# CONFIG_FONTS is not set
+CONFIG_FONT_8x8=y
+CONFIG_FONT_8x16=y
+CONFIG_FONT_PEARL_8x8=y
+CONFIG_LOGO=y
+CONFIG_LOGO_LINUX_MONO=y
+CONFIG_LOGO_LINUX_VGA16=y
+CONFIG_LOGO_LINUX_CLUT224=y
+CONFIG_SOUND=m
+CONFIG_DMASOUND_PAULA=m
+CONFIG_DMASOUND=m
+CONFIG_AMIGA_BUILTIN_SERIAL=y
+# CONFIG_WHIPPET_SERIAL is not set
+CONFIG_MULTIFACE_III_TTY=m
+# CONFIG_SERIAL_CONSOLE is not set
+CONFIG_AFFS_FS=y
+CONFIG_HFS_FS=m
+CONFIG_HFSPLUS_FS=m
+# CONFIG_UFS_FS_WRITE is not set
+CONFIG_LOCKD=m
+CONFIG_SUNRPC=m
+CONFIG_SUNRPC_GSS=m
+CONFIG_RPCSEC_GSS_KRB5=m
+CONFIG_NCPFS_NFS_NS=y
+CONFIG_NCPFS_OS2_NS=y
+# CONFIG_PARTITION_ADVANCED is not set
+CONFIG_AMIGA_PARTITION=y
+CONFIG_CRC32=y
+# 2.6.16
+# temporary workaround for old/buggy(?) 53c7xx.c driver
+CONFIG_SCSI_SPI_ATTRS=y
+# 2.6.18
+# don't try to build lib/audit.c
+# CONFIG_AUDIT is not set
+# 2.6.21
+# disable, as recommended by Geert
+# CONFIG_SCSI_AIC7XXX_OLD is not set

Added: dists/sid/linux-2.6/debian/config/m68k/config.atari
==============================================================================
--- (empty file)
+++ dists/sid/linux-2.6/debian/config/m68k/config.atari	Mon Nov 26 20:06:56 2007
@@ -0,0 +1,118 @@
+# CONFIG_SUN3 is not set
+# CONFIG_AMIGA is not set
+CONFIG_ATARI=y
+# CONFIG_MAC is not set
+# CONFIG_APOLLO is not set
+# CONFIG_VME is not set
+# CONFIG_HP300 is not set
+# CONFIG_SUN3X is not set
+# CONFIG_Q40 is not set
+CONFIG_M68020=y
+CONFIG_M68030=y
+CONFIG_M68040=y
+CONFIG_M68060=y
+CONFIG_MMU_MOTOROLA=y
+CONFIG_M68KFPU_EMU=y
+CONFIG_M68KFPU_EMU_EXTRAPREC=y
+# CONFIG_M68KFPU_EMU_ONLY is not set
+CONFIG_STRAM_PROC=y
+CONFIG_HEARTBEAT=y
+CONFIG_PARPORT_ATARI=m
+CONFIG_ATARI_FLOPPY=y
+# CONFIG_PARIDE is not set
+CONFIG_IDE=y
+CONFIG_BLK_DEV_IDE=y
+# CONFIG_BLK_DEV_IDE_SATA is not set
+CONFIG_BLK_DEV_IDEDISK=y
+# CONFIG_IDEDISK_MULTI_MODE is not set
+CONFIG_BLK_DEV_IDECD=y
+# disable IDETAPE, causes ICE
+# CONFIG_BLK_DEV_IDETAPE is not set
+CONFIG_BLK_DEV_IDEFLOPPY=m
+CONFIG_IDE_GENERIC=y
+# CONFIG_IDE_ARM is not set
+CONFIG_BLK_DEV_FALCON_IDE=y
+# CONFIG_BLK_DEV_IDEDMA is not set
+# CONFIG_BLK_DEV_HD is not set
+# CONFIG_SCSI_PPA is not set
+# CONFIG_SCSI_IMM is not set
+# CONFIG_IP_PNP is not set
+CONFIG_IPX=m
+# CONFIG_IPX_INTERN is not set
+# CONFIG_NET_ETHERNET is not set
+# CONFIG_PLIP is not set
+CONFIG_PPP_FILTER=y
+CONFIG_PPP_ASYNC=m
+CONFIG_PPP_SYNC_TTY=m
+CONFIG_KEYBOARD_ATKBD=y
+CONFIG_KEYBOARD_ATARI=y
+# CONFIG_KEYBOARD_SUNKBD is not set
+CONFIG_MOUSE_PS2=y
+CONFIG_MOUSE_ATARI=y
+# CONFIG_MOUSE_SERIAL is not set
+# CONFIG_INPUT_JOYSTICK is not set
+CONFIG_INPUT_MISC=y
+CONFIG_INPUT_M68K_BEEP=m
+CONFIG_INPUT_UINPUT=m
+CONFIG_SERIO=y
+CONFIG_SERIO_SERPORT=y
+# CONFIG_SERIO_PARKBD is not set
+CONFIG_SERIO_LIBPS2=y
+# CONFIG_SERIAL_8250 is not set
+CONFIG_PRINTER=m
+# CONFIG_LP_CONSOLE is not set
+# CONFIG_PPDEV is not set
+# CONFIG_TIPAR is not set
+CONFIG_NVRAM=y
+CONFIG_GEN_RTC=y
+CONFIG_FB=y
+# CONFIG_FB_CFB_IMAGEBLIT is not set
+# CONFIG_FB_MACMODES is not set
+# CONFIG_FB_MODE_HELPERS is not set
+# CONFIG_FB_TILEBLITTING is not set
+CONFIG_FB_ATARI=y
+CONFIG_FB_ATY=y
+# CONFIG_FB_S1D13XXX is not set
+# CONFIG_FB_VIRTUAL is not set
+CONFIG_FRAMEBUFFER_CONSOLE=y
+# CONFIG_FONTS is not set
+CONFIG_FONT_8x8=y
+CONFIG_FONT_8x16=y
+# CONFIG_LOGO is not set
+CONFIG_SOUND=m
+CONFIG_DMASOUND_ATARI=m
+CONFIG_DMASOUND=m
+CONFIG_ATARI_MFPSER=m
+CONFIG_ATARI_SCC=y
+CONFIG_ATARI_SCC_DMA=y
+CONFIG_ATARI_MIDI=m
+CONFIG_ATARI_DSP56K=m
+# CONFIG_SERIAL_CONSOLE is not set
+CONFIG_AFFS_FS=m
+CONFIG_HFS_FS=m
+CONFIG_HFSPLUS_FS=m
+# CONFIG_UFS_FS_WRITE is not set
+# CONFIG_NFS_V4 is not set
+# CONFIG_NFSD_V4 is not set
+CONFIG_LOCKD=m
+CONFIG_SUNRPC=m
+# CONFIG_RPCSEC_GSS_KRB5 is not set
+CONFIG_NCPFS_NFS_NS=y
+CONFIG_NCPFS_OS2_NS=y
+# CONFIG_PARTITION_ADVANCED is not set
+CONFIG_ATARI_PARTITION=y
+CONFIG_CRC32=y
+# enable new ethernet drivers
+CONFIG_ARANYM=y
+CONFIG_NATFEAT=y
+# enable ethernet
+CONFIG_NET_ETHERNET=y
+CONFIG_ATARILANCE=y
+CONFIG_ATARI_NFETH=y
+CONFIG_ATARI_ETHERNEC=y
+# 2.6.21
+# uses undefined isa_*
+# CONFIG_PARPORT is not set
+# CONFIG_PARPORT_PC
+CONFIG_ATARI_ROM_ISA=y
+CONFIG_ATARI_SCSI=y

Added: dists/sid/linux-2.6/debian/config/m68k/config.bvme6000
==============================================================================
--- (empty file)
+++ dists/sid/linux-2.6/debian/config/m68k/config.bvme6000	Mon Nov 26 20:06:56 2007
@@ -0,0 +1,65 @@
+CONFIG_BROKEN=y
+# CONFIG_SUN3 is not set
+# CONFIG_AMIGA is not set
+# CONFIG_ATARI is not set
+# CONFIG_MAC is not set
+# CONFIG_APOLLO is not set
+CONFIG_VME=y
+# CONFIG_MVME147 is not set
+# CONFIG_MVME16x is not set
+CONFIG_BVME6000=y
+# CONFIG_HP300 is not set
+# CONFIG_SUN3X is not set
+# CONFIG_Q40 is not set
+# CONFIG_M68020 is not set
+# CONFIG_M68030 is not set
+CONFIG_M68040=y
+CONFIG_M68060=y
+CONFIG_MMU_MOTOROLA=y
+# CONFIG_M68KFPU_EMU is not set
+# CONFIG_IDE is not set
+CONFIG_BVME6000_SCSI=y
+# CONFIG_SCSI_NCR53C7xx_FAST is not set
+# CONFIG_FIREWIRE is not set
+CONFIG_IP_PNP=y
+CONFIG_IP_PNP_DHCP=y
+CONFIG_IP_PNP_BOOTP=y
+CONFIG_IP_PNP_RARP=y
+# CONFIG_IPX is not set
+CONFIG_NET_ETHERNET=y
+CONFIG_BVME6000_NET=y
+# CONFIG_PPP_FILTER is not set
+CONFIG_PPP_ASYNC=m
+CONFIG_PPP_SYNC_TTY=m
+# CONFIG_KEYBOARD_ATKBD is not set
+# CONFIG_KEYBOARD_SUNKBD is not set
+CONFIG_MOUSE_PS2=m
+CONFIG_MOUSE_SERIAL=m
+# CONFIG_INPUT_JOYSTICK is not set
+# CONFIG_INPUT_MISC is not set
+CONFIG_SERIO=m
+CONFIG_SERIO_SERPORT=m
+CONFIG_SERIO_LIBPS2=m
+CONFIG_SERIAL_8250=m
+CONFIG_SERIAL_8250_NR_UARTS=4
+# CONFIG_SERIAL_8250_EXTENDED is not set
+CONFIG_SERIAL_CORE=m
+CONFIG_GEN_RTC=m
+# CONFIG_FB is not set
+# CONFIG_SOUND is not set
+CONFIG_BVME6000_SCC=y
+CONFIG_SERIAL_CONSOLE=y
+CONFIG_AFFS_FS=m
+CONFIG_HFS_FS=m
+CONFIG_HFSPLUS_FS=m
+# CONFIG_UFS_FS_WRITE is not set
+CONFIG_NFS_FS=y
+CONFIG_ROOT_NFS=y
+CONFIG_LOCKD=y
+CONFIG_SUNRPC=y
+CONFIG_SUNRPC_GSS=y
+CONFIG_RPCSEC_GSS_KRB5=y
+CONFIG_NCPFS_NFS_NS=y
+CONFIG_NCPFS_OS2_NS=y
+# CONFIG_PARTITION_ADVANCED is not set
+CONFIG_CRC32=m

Added: dists/sid/linux-2.6/debian/config/m68k/config.hp
==============================================================================
--- (empty file)
+++ dists/sid/linux-2.6/debian/config/m68k/config.hp	Mon Nov 26 20:06:56 2007
@@ -0,0 +1,62 @@
+# CONFIG_SUN3 is not set
+# CONFIG_AMIGA is not set
+# CONFIG_ATARI is not set
+# CONFIG_MAC is not set
+# CONFIG_APOLLO is not set
+# CONFIG_VME is not set
+CONFIG_HP300=y
+# CONFIG_DIO is not set
+# CONFIG_SUN3X is not set
+# CONFIG_Q40 is not set
+CONFIG_M68020=y
+CONFIG_M68030=y
+CONFIG_M68040=y
+CONFIG_M68060=y
+CONFIG_MMU_MOTOROLA=y
+CONFIG_M68KFPU_EMU=y
+CONFIG_M68KFPU_EMU_EXTRAPREC=y
+# CONFIG_M68KFPU_EMU_ONLY is not set
+CONFIG_HEARTBEAT=y
+# CONFIG_IDE is not set
+CONFIG_IP_PNP=y
+CONFIG_IP_PNP_DHCP=y
+CONFIG_IP_PNP_BOOTP=y
+CONFIG_IP_PNP_RARP=y
+CONFIG_IPX=m
+# CONFIG_IPX_INTERN is not set
+CONFIG_NET_ETHERNET=y
+CONFIG_PPP_FILTER=y
+CONFIG_PPP_ASYNC=m
+CONFIG_PPP_SYNC_TTY=m
+# CONFIG_KEYBOARD_ATKBD is not set
+# CONFIG_KEYBOARD_SUNKBD is not set
+# CONFIG_KEYBOARD_HIL_OLD is not set
+# CONFIG_KEYBOARD_HIL is not set
+CONFIG_MOUSE_PS2=m
+CONFIG_MOUSE_SERIAL=m
+# CONFIG_MOUSE_HIL is not set
+# CONFIG_INPUT_JOYSTICK is not set
+# CONFIG_INPUT_MISC is not set
+CONFIG_SERIO=m
+CONFIG_SERIO_SERPORT=m
+# CONFIG_HP_SDC is not set
+# CONFIG_HIL_MLC is not set
+CONFIG_SERIO_LIBPS2=m
+# CONFIG_SERIAL_8250 is not set
+CONFIG_GEN_RTC=y
+# CONFIG_FB is not set
+# CONFIG_SOUND is not set
+CONFIG_AFFS_FS=m
+CONFIG_HFS_FS=m
+CONFIG_HFSPLUS_FS=m
+# CONFIG_UFS_FS_WRITE is not set
+CONFIG_NFS_FS=y
+CONFIG_ROOT_NFS=y
+CONFIG_LOCKD=y
+CONFIG_SUNRPC=y
+CONFIG_SUNRPC_GSS=y
+CONFIG_RPCSEC_GSS_KRB5=y
+CONFIG_NCPFS_NFS_NS=y
+CONFIG_NCPFS_OS2_NS=y
+# CONFIG_PARTITION_ADVANCED is not set
+CONFIG_CRC32=y

Added: dists/sid/linux-2.6/debian/config/m68k/config.mac
==============================================================================
--- (empty file)
+++ dists/sid/linux-2.6/debian/config/m68k/config.mac	Mon Nov 26 20:06:56 2007
@@ -0,0 +1,131 @@
+# CONFIG_WINDFARM is not set
+# CONFIG_SUN3 is not set
+# CONFIG_AMIGA is not set
+# CONFIG_ATARI is not set
+CONFIG_MAC=y
+CONFIG_NUBUS=y
+CONFIG_M68K_L2_CACHE=y
+# CONFIG_APOLLO is not set
+# CONFIG_VME is not set
+# CONFIG_HP300 is not set
+# CONFIG_SUN3X is not set
+# CONFIG_Q40 is not set
+CONFIG_M68020=y
+CONFIG_M68030=y
+CONFIG_M68040=y
+# CONFIG_M68060 is not set
+CONFIG_MMU_MOTOROLA=y
+CONFIG_M68KFPU_EMU=y
+CONFIG_M68KFPU_EMU_EXTRAPREC=y
+# CONFIG_M68KFPU_EMU_ONLY is not set
+# CONFIG_HEARTBEAT is not set
+CONFIG_IDE=y
+CONFIG_BLK_DEV_IDE=y
+# CONFIG_BLK_DEV_IDE_SATA is not set
+CONFIG_BLK_DEV_IDEDISK=y
+# CONFIG_IDEDISK_MULTI_MODE is not set
+CONFIG_BLK_DEV_IDECD=y
+# disable IDETAPE, causes ICE
+# CONFIG_BLK_DEV_IDETAPE is not set
+CONFIG_BLK_DEV_IDEFLOPPY=m
+CONFIG_IDE_GENERIC=y
+# CONFIG_IDE_ARM is not set
+CONFIG_BLK_DEV_MAC_IDE=y
+# CONFIG_BLK_DEV_IDEDMA is not set
+# CONFIG_BLK_DEV_HD is not set
+CONFIG_MAC_SCSI=y
+CONFIG_SCSI_MAC_ESP=y
+CONFIG_ADB=y
+# switched off the next four CONFIG_ADB_* as requested by Finn Thain
+CONFIG_ADB_MACII=y
+CONFIG_ADB_MACIISI=n
+CONFIG_ADB_IOP=y # switched on for the benefit of IIfx, Q900, Q950
+CONFIG_ADB_PMU68K=n
+CONFIG_ADB_CUDA=y
+CONFIG_INPUT_ADBHID=y
+CONFIG_MAC_EMUMOUSEBTN=y
+# CONFIG_IP_PNP is not set
+CONFIG_IPX=m
+# CONFIG_IPX_INTERN is not set
+CONFIG_IPDDP=m
+CONFIG_IPDDP_ENCAP=y
+CONFIG_IPDDP_DECAP=y
+CONFIG_NET_ETHERNET=y
+CONFIG_MAC8390=y
+CONFIG_MAC89x0=y
+CONFIG_MACSONIC=y # switched back on as requested by Finn Thain
+CONFIG_MACMACE=y
+# CONFIG_NET_VENDOR_SMC is not set
+CONFIG_PPP_FILTER=y
+# CONFIG_PPP_ASYNC is not set
+# CONFIG_PPP_SYNC_TTY is not set
+# CONFIG_KEYBOARD_ATKBD is not set
+# CONFIG_KEYBOARD_SUNKBD is not set
+CONFIG_MOUSE_PS2=m
+CONFIG_MOUSE_SERIAL=m
+# CONFIG_INPUT_JOYSTICK is not set
+CONFIG_INPUT_MISC=y
+CONFIG_INPUT_UINPUT=m
+CONFIG_SERIO=m
+CONFIG_SERIO_SERPORT=m
+CONFIG_SERIO_LIBPS2=m
+# CONFIG_SERIAL_8250 is not set
+CONFIG_GEN_RTC=m
+CONFIG_FB=y
+CONFIG_FB_CFB_IMAGEBLIT=y
+CONFIG_FB_MACMODES=y
+# CONFIG_FB_MODE_HELPERS is not set
+# CONFIG_FB_TILEBLITTING is not set
+CONFIG_FB_VALKYRIE=y
+CONFIG_FB_MAC=y
+# CONFIG_FB_S1D13XXX is not set
+# CONFIG_FB_VIRTUAL is not set
+CONFIG_FRAMEBUFFER_CONSOLE=y
+# CONFIG_FONTS is not set
+CONFIG_FONT_8x8=y
+CONFIG_FONT_8x16=y
+CONFIG_FONT_6x11=y
+CONFIG_LOGO=y
+CONFIG_LOGO_LINUX_MONO=y
+CONFIG_LOGO_LINUX_VGA16=y
+CONFIG_LOGO_LINUX_CLUT224=y
+CONFIG_LOGO_MAC_CLUT224=y
+# CONFIG_SOUND is not set
+CONFIG_MAC_SCC=y
+CONFIG_MAC_HID=y
+CONFIG_MAC_ADBKEYCODES=y
+CONFIG_SERIAL_CONSOLE=y
+CONFIG_AFFS_FS=m
+CONFIG_HFS_FS=y
+CONFIG_HFSPLUS_FS=y
+# CONFIG_UFS_FS_WRITE is not set
+CONFIG_LOCKD=m
+CONFIG_SUNRPC=m
+CONFIG_SUNRPC_GSS=m
+CONFIG_RPCSEC_GSS_KRB5=m
+CONFIG_NCPFS_NFS_NS=y
+CONFIG_NCPFS_OS2_NS=y
+CONFIG_PARTITION_ADVANCED=y
+# CONFIG_ACORN_PARTITION is not set
+# CONFIG_OSF_PARTITION is not set
+CONFIG_AMIGA_PARTITION=y
+CONFIG_ATARI_PARTITION=y
+CONFIG_MAC_PARTITION=y
+CONFIG_BSD_DISKLABEL=y
+CONFIG_MINIX_SUBPARTITION=y
+CONFIG_SOLARIS_X86_PARTITION=y
+CONFIG_UNIXWARE_DISKLABEL=y
+CONFIG_LDM_PARTITION=y
+CONFIG_LDM_DEBUG=y
+# CONFIG_SGI_PARTITION is not set
+# CONFIG_ULTRIX_PARTITION is not set
+CONFIG_SUN_PARTITION=y
+# CONFIG_EFI_PARTITION is not set
+CONFIG_CRC32=y
+# 2.6.18
+# don't try to build lib/audit.c
+# CONFIG_AUDIT is not set
+# 2.6.21
+# uses undefined isa_*
+# CONFIG_PARPORT is not set
+# CONFIG_PARPORT_PC is not set

Added: dists/sid/linux-2.6/debian/config/m68k/config.mvme147
==============================================================================
--- (empty file)
+++ dists/sid/linux-2.6/debian/config/m68k/config.mvme147	Mon Nov 26 20:06:56 2007
@@ -0,0 +1,74 @@
+# CONFIG_SUN3 is not set
+# CONFIG_AMIGA is not set
+# CONFIG_ATARI is not set
+# CONFIG_MAC is not set
+# CONFIG_APOLLO is not set
+CONFIG_VME=y
+CONFIG_MVME147=y
+# CONFIG_MVME16x is not set
+# CONFIG_BVME6000 is not set
+# CONFIG_HP300 is not set
+# CONFIG_SUN3X is not set
+# CONFIG_Q40 is not set
+# CONFIG_M68020 is not set
+CONFIG_M68030=y
+# CONFIG_M68040 is not set
+# CONFIG_M68060 is not set
+CONFIG_MMU_MOTOROLA=y
+# CONFIG_M68KFPU_EMU is not set
+# CONFIG_IDE is not set
+CONFIG_MVME147_SCSI=y
+CONFIG_IP_PNP=y
+CONFIG_IP_PNP_DHCP=y
+CONFIG_IP_PNP_BOOTP=y
+CONFIG_IP_PNP_RARP=y
+CONFIG_IPX=m
+# CONFIG_IPX_INTERN is not set
+CONFIG_NET_ETHERNET=y
+CONFIG_MVME147_NET=y
+CONFIG_PPP_FILTER=y
+CONFIG_PPP_ASYNC=m
+CONFIG_PPP_SYNC_TTY=m
+# CONFIG_KEYBOARD_ATKBD is not set
+# CONFIG_KEYBOARD_SUNKBD is not set
+CONFIG_MOUSE_PS2=m
+CONFIG_MOUSE_SERIAL=m
+# CONFIG_INPUT_JOYSTICK is not set
+# CONFIG_INPUT_MISC is not set
+CONFIG_SERIO=m
+CONFIG_SERIO_SERPORT=m
+CONFIG_SERIO_LIBPS2=m
+# CONFIG_SERIAL_8250 is not set
+CONFIG_GEN_RTC=m
+CONFIG_FB=y
+# CONFIG_FB_CFB_IMAGEBLIT is not set
+# CONFIG_FB_MACMODES is not set
+# CONFIG_FB_MODE_HELPERS is not set
+# CONFIG_FB_TILEBLITTING is not set
+# CONFIG_FB_S1D13XXX is not set
+# CONFIG_FB_VIRTUAL is not set
+CONFIG_FRAMEBUFFER_CONSOLE=y
+# CONFIG_FONTS is not set
+CONFIG_FONT_8x8=y
+CONFIG_FONT_8x16=y
+CONFIG_LOGO=y
+CONFIG_LOGO_LINUX_MONO=y
+CONFIG_LOGO_LINUX_VGA16=y
+CONFIG_LOGO_LINUX_CLUT224=y
+# CONFIG_SOUND is not set
+CONFIG_MVME147_SCC=y
+CONFIG_SERIAL_CONSOLE=y
+CONFIG_AFFS_FS=m
+CONFIG_HFS_FS=m
+CONFIG_HFSPLUS_FS=m
+# CONFIG_UFS_FS_WRITE is not set
+CONFIG_NFS_FS=y
+CONFIG_ROOT_NFS=y
+CONFIG_LOCKD=y
+CONFIG_SUNRPC=y
+CONFIG_SUNRPC_GSS=y
+CONFIG_RPCSEC_GSS_KRB5=y
+# CONFIG_NCPFS_NFS_NS is not set
+# CONFIG_NCPFS_OS2_NS is not set
+# CONFIG_PARTITION_ADVANCED is not set
+CONFIG_CRC32=y

Added: dists/sid/linux-2.6/debian/config/m68k/config.mvme16x
==============================================================================
--- (empty file)
+++ dists/sid/linux-2.6/debian/config/m68k/config.mvme16x	Mon Nov 26 20:06:56 2007
@@ -0,0 +1,78 @@
+CONFIG_BROKEN=y
+# CONFIG_SUN3 is not set
+# CONFIG_AMIGA is not set
+# CONFIG_ATARI is not set
+# CONFIG_MAC is not set
+# CONFIG_APOLLO is not set
+CONFIG_VME=y
+# CONFIG_MVME147 is not set
+CONFIG_MVME16x=y
+# CONFIG_BVME6000 is not set
+# CONFIG_HP300 is not set
+# CONFIG_SUN3X is not set
+# CONFIG_Q40 is not set
+# CONFIG_M68020 is not set
+# CONFIG_M68030 is not set
+CONFIG_M68040=y
+CONFIG_M68060=y
+CONFIG_MMU_MOTOROLA=y
+# CONFIG_M68KFPU_EMU is not set
+# CONFIG_IDE is not set
+CONFIG_MVME16x_SCSI=y
+# CONFIG_SCSI_NCR53C7xx_FAST is not set
+# CONFIG_FIREWIRE is not set
+CONFIG_IP_PNP=y
+CONFIG_IP_PNP_DHCP=y
+CONFIG_IP_PNP_BOOTP=y
+CONFIG_IP_PNP_RARP=y
+CONFIG_IPX=m
+# CONFIG_IPX_INTERN is not set
+CONFIG_NET_ETHERNET=y
+CONFIG_MVME16x_NET=y
+CONFIG_PPP_FILTER=y
+CONFIG_PPP_ASYNC=m
+CONFIG_PPP_SYNC_TTY=m
+# CONFIG_KEYBOARD_ATKBD is not set
+# CONFIG_KEYBOARD_SUNKBD is not set
+CONFIG_MOUSE_PS2=m
+CONFIG_MOUSE_SERIAL=m
+# CONFIG_INPUT_JOYSTICK is not set
+# CONFIG_INPUT_MISC is not set
+CONFIG_SERIO=m
+CONFIG_SERIO_SERPORT=m
+CONFIG_SERIO_LIBPS2=m
+# CONFIG_SERIAL_8250 is not set
+CONFIG_GEN_RTC=m
+CONFIG_FB=y
+# CONFIG_FB_CFB_IMAGEBLIT is not set
+# CONFIG_FB_MACMODES is not set
+# CONFIG_FB_MODE_HELPERS is not set
+# CONFIG_FB_TILEBLITTING is not set
+# CONFIG_FB_S1D13XXX is not set
+# CONFIG_FB_VIRTUAL is not set
+CONFIG_FRAMEBUFFER_CONSOLE=y
+# CONFIG_FONTS is not set
+CONFIG_FONT_8x8=y
+CONFIG_FONT_8x16=y
+CONFIG_LOGO=y
+CONFIG_LOGO_LINUX_MONO=y
+CONFIG_LOGO_LINUX_VGA16=y
+CONFIG_LOGO_LINUX_CLUT224=y
+# CONFIG_SOUND is not set
+CONFIG_SERIAL167=y
+CONFIG_MVME162_SCC=y
+CONFIG_SERIAL_CONSOLE=y
+CONFIG_AFFS_FS=m
+CONFIG_HFS_FS=m
+CONFIG_HFSPLUS_FS=m
+# CONFIG_UFS_FS_WRITE is not set
+CONFIG_NFS_FS=y
+CONFIG_ROOT_NFS=y
+CONFIG_LOCKD=y
+CONFIG_SUNRPC=y
+CONFIG_SUNRPC_GSS=y
+CONFIG_RPCSEC_GSS_KRB5=y
+# CONFIG_NCPFS_NFS_NS is not set
+# CONFIG_NCPFS_OS2_NS is not set
+# CONFIG_PARTITION_ADVANCED is not set
+CONFIG_CRC32=y

Added: dists/sid/linux-2.6/debian/config/m68k/config.q40
==============================================================================
--- (empty file)
+++ dists/sid/linux-2.6/debian/config/m68k/config.q40	Mon Nov 26 20:06:56 2007
@@ -0,0 +1,117 @@
+# CONFIG_SUN3 is not set
+# CONFIG_AMIGA is not set
+# CONFIG_ATARI is not set
+# CONFIG_MAC is not set
+# CONFIG_APOLLO is not set
+# CONFIG_VME is not set
+# CONFIG_HP300 is not set
+# CONFIG_SUN3X is not set
+CONFIG_Q40=y
+# CONFIG_M68020 is not set
+# CONFIG_M68030 is not set
+CONFIG_M68040=y
+CONFIG_M68060=y
+CONFIG_MMU_MOTOROLA=y
+CONFIG_M68KFPU_EMU=y
+CONFIG_M68KFPU_EMU_EXTRAPREC=y
+# CONFIG_M68KFPU_EMU_ONLY is not set
+# CONFIG_HEARTBEAT is not set
+CONFIG_ISA=y
+CONFIG_GENERIC_ISA_DMA=y
+# CONFIG_PNP is not set
+# CONFIG_BLK_DEV_FD is not set
+CONFIG_IDE=y
+CONFIG_BLK_DEV_IDE=y
+# CONFIG_BLK_DEV_IDE_SATA is not set
+CONFIG_BLK_DEV_IDEDISK=y
+# CONFIG_IDEDISK_MULTI_MODE is not set
+CONFIG_BLK_DEV_IDECD=y
+# disable IDETAPE, causes ICE
+# CONFIG_BLK_DEV_IDETAPE is not set
+CONFIG_BLK_DEV_IDEFLOPPY=m
+CONFIG_IDE_GENERIC=y
+# CONFIG_IDE_ARM is not set
+CONFIG_BLK_DEV_Q40IDE=y
+# CONFIG_IDE_CHIPSETS is not set
+# CONFIG_BLK_DEV_IDEDMA is not set
+# CONFIG_BLK_DEV_HD is not set
+# CONFIG_SCSI_IN2000 is not set
+# CONFIG_SCSI_DTC3280 is not set
+# CONFIG_SCSI_FUTURE_DOMAIN is not set
+# CONFIG_SCSI_GENERIC_NCR5380 is not set
+# CONFIG_SCSI_GENERIC_NCR5380_MMIO is not set
+# CONFIG_SCSI_NCR53C406A is not set
+# CONFIG_SCSI_PAS16 is not set
+# CONFIG_SCSI_PSI240I is not set
+# CONFIG_SCSI_QLOGIC_FAS is not set
+# CONFIG_SCSI_SYM53C416 is not set
+# CONFIG_SCSI_T128 is not set
+CONFIG_IP_PNP=y
+CONFIG_IP_PNP_DHCP=y
+CONFIG_IP_PNP_BOOTP=y
+CONFIG_IP_PNP_RARP=y
+CONFIG_IPX=m
+# CONFIG_IPX_INTERN is not set
+# CONFIG_ARCNET is not set
+CONFIG_NET_ETHERNET=y
+# CONFIG_NET_VENDOR_3COM is not set
+# CONFIG_NET_VENDOR_SMC is not set
+# CONFIG_NET_VENDOR_RACAL is not set
+# CONFIG_AT1700 is not set
+# CONFIG_DEPCA is not set
+# CONFIG_HP100 is not set
+# CONFIG_NET_ISA is not set
+CONFIG_NE2000=m
+# CONFIG_NET_PCI is not set
+# CONFIG_TR is not set
+CONFIG_PPP_FILTER=y
+CONFIG_PPP_ASYNC=m
+CONFIG_PPP_SYNC_TTY=m
+# CONFIG_KEYBOARD_ATKBD is not set
+# CONFIG_KEYBOARD_SUNKBD is not set
+CONFIG_MOUSE_PS2=m
+CONFIG_MOUSE_SERIAL=m
+# CONFIG_MOUSE_INPORT is not set
+# CONFIG_MOUSE_LOGIBM is not set
+# CONFIG_MOUSE_PC110PAD is not set
+# CONFIG_INPUT_JOYSTICK is not set
+# CONFIG_INPUT_MISC is not set
+CONFIG_SERIO=m
+CONFIG_SERIO_SERPORT=m
+CONFIG_SERIO_Q40KBD=m
+CONFIG_SERIO_LIBPS2=m
+# CONFIG_SERIAL_8250 is not set
+CONFIG_GEN_RTC=m
+CONFIG_FB=y
+CONFIG_FB_CFB_IMAGEBLIT=y
+# CONFIG_FB_MACMODES is not set
+# CONFIG_FB_MODE_HELPERS is not set
+# CONFIG_FB_TILEBLITTING is not set
+CONFIG_FB_Q40=y
+# CONFIG_FB_S1D13XXX is not set
+# CONFIG_FB_VIRTUAL is not set
+CONFIG_FRAMEBUFFER_CONSOLE=y
+# CONFIG_FONTS is not set
+CONFIG_FONT_8x8=y
+CONFIG_FONT_8x16=y
+CONFIG_LOGO=y
+CONFIG_LOGO_LINUX_MONO=y
+CONFIG_LOGO_LINUX_VGA16=y
+CONFIG_LOGO_LINUX_CLUT224=y
+CONFIG_SOUND=y
+CONFIG_DMASOUND_Q40=y
+CONFIG_DMASOUND=y
+CONFIG_AFFS_FS=m
+CONFIG_HFS_FS=m
+CONFIG_HFSPLUS_FS=m
+CONFIG_UFS_FS_WRITE=y
+CONFIG_NFS_FS=y
+CONFIG_ROOT_NFS=y
+CONFIG_LOCKD=y
+CONFIG_SUNRPC=y
+CONFIG_SUNRPC_GSS=y
+CONFIG_RPCSEC_GSS_KRB5=y
+# CONFIG_NCPFS_NFS_NS is not set
+# CONFIG_NCPFS_OS2_NS is not set
+# CONFIG_PARTITION_ADVANCED is not set
+CONFIG_CRC32=y

Added: dists/sid/linux-2.6/debian/config/m68k/config.sun3
==============================================================================
--- (empty file)
+++ dists/sid/linux-2.6/debian/config/m68k/config.sun3	Mon Nov 26 20:06:56 2007
@@ -0,0 +1,64 @@
+CONFIG_SUN3=y
+CONFIG_M68020=y
+CONFIG_MMU_SUN3=y
+CONFIG_M68KFPU_EMU=y
+CONFIG_M68KFPU_EMU_EXTRAPREC=y
+# CONFIG_M68KFPU_EMU_ONLY is not set
+# CONFIG_IDE is not set
+CONFIG_IP_PNP=y
+CONFIG_IP_PNP_DHCP=y
+CONFIG_IP_PNP_BOOTP=y
+CONFIG_IP_PNP_RARP=y
+CONFIG_IPX=m
+# CONFIG_IPX_INTERN is not set
+CONFIG_NET_ETHERNET=y
+CONFIG_SUN3LANCE=y
+CONFIG_SUN3_82586=y
+CONFIG_PPP_FILTER=y
+CONFIG_PPP_ASYNC=m
+CONFIG_PPP_SYNC_TTY=m
+# CONFIG_KEYBOARD_ATKBD is not set
+CONFIG_KEYBOARD_SUNKBD=y
+CONFIG_MOUSE_PS2=m
+CONFIG_MOUSE_SERIAL=m
+# CONFIG_INPUT_JOYSTICK is not set
+# CONFIG_INPUT_MISC is not set
+CONFIG_SERIO=y
+CONFIG_SERIO_SERPORT=m
+CONFIG_SERIO_LIBPS2=m
+# CONFIG_SERIAL_8250 is not set
+CONFIG_GEN_RTC=y
+CONFIG_FB=y
+# CONFIG_FB_CFB_IMAGEBLIT is not set
+# CONFIG_FB_MACMODES is not set
+# CONFIG_FB_MODE_HELPERS is not set
+# CONFIG_FB_TILEBLITTING is not set
+# CONFIG_FB_S1D13XXX is not set
+# CONFIG_FB_VIRTUAL is not set
+CONFIG_FRAMEBUFFER_CONSOLE=y
+# CONFIG_FONTS is not set
+CONFIG_FONT_8x8=y
+CONFIG_FONT_8x16=y
+CONFIG_LOGO=y
+CONFIG_LOGO_LINUX_MONO=y
+CONFIG_LOGO_LINUX_VGA16=y
+CONFIG_LOGO_LINUX_CLUT224=y
+# CONFIG_SOUND is not set
+CONFIG_AFFS_FS=m
+CONFIG_HFS_FS=m
+CONFIG_HFSPLUS_FS=m
+CONFIG_UFS_FS_WRITE=y
+CONFIG_NFS_FS=y
+CONFIG_ROOT_NFS=y
+CONFIG_LOCKD=y
+CONFIG_SUNRPC=y
+CONFIG_SUNRPC_GSS=y
+CONFIG_RPCSEC_GSS_KRB5=y
+# CONFIG_NCPFS_NFS_NS is not set
+# CONFIG_NCPFS_OS2_NS is not set
+# CONFIG_PARTITION_ADVANCED is not set
+CONFIG_SUN_PARTITION=y
+CONFIG_CRC32=y
+# 2.6.16-14
+# enable SCSI
+CONFIG_SUN3_SCSI=y

Added: dists/sid/linux-2.6/debian/config/m68k/defines
==============================================================================
--- (empty file)
+++ dists/sid/linux-2.6/debian/config/m68k/defines	Mon Nov 26 20:06:56 2007
@@ -0,0 +1,46 @@
+[base]
+compiler: gcc-3.3
+flavours:
+ amiga
+ atari
+# bvme6000
+# hp
+ mac
+# mvme147
+# mvme16x
+# q40
+# sun3
+kernel-arch: m68k
+kernel-header-dirs: m68k
+
+[image]
+initramfs: false
+suggests: vmelilo, fdutils
+
+[amiga_base]
+class: Amiga
+
+[atari_base]
+class: Atari
+
+[bvme6000_base]
+class: BVM BVME4000 and BVME6000
+
+[hp_base]
+class: HP
+
+[mac_base]
+class: Macintosh
+
+[mvme147_base]
+class: Motorola MVME147
+
+[mvme16x_base]
+class: Motorola MVME162/6/7, MVME172/7
+
+[q40_base]
+class: Q40 and Q60
+
+[sun3_base]
+class: sun3
+

Added: dists/sid/linux-2.6/debian/config/mips/config
==============================================================================
--- (empty file)
+++ dists/sid/linux-2.6/debian/config/mips/config	Mon Nov 26 20:06:56 2007
@@ -0,0 +1,3 @@
+CONFIG_MIPS=y
+CONFIG_SCHED_NO_NO_OMIT_FRAME_POINTER=y
+CONFIG_GENERIC_FIND_NEXT_BIT=y

Added: dists/sid/linux-2.6/debian/config/mips/config.4kc-malta
==============================================================================
--- (empty file)
+++ dists/sid/linux-2.6/debian/config/mips/config.4kc-malta	Mon Nov 26 20:06:56 2007
@@ -0,0 +1,2760 @@
+#
+# Machine selection
+#
+# CONFIG_MIPS_MTX1 is not set
+# CONFIG_MIPS_BOSPORUS is not set
+# CONFIG_MIPS_PB1000 is not set
+# CONFIG_MIPS_PB1100 is not set
+# CONFIG_MIPS_PB1500 is not set
+# CONFIG_MIPS_PB1550 is not set
+# CONFIG_MIPS_PB1200 is not set
+# CONFIG_MIPS_DB1000 is not set
+# CONFIG_MIPS_DB1100 is not set
+# CONFIG_MIPS_DB1500 is not set
+# CONFIG_MIPS_DB1550 is not set
+# CONFIG_MIPS_DB1200 is not set
+# CONFIG_MIPS_MIRAGE is not set
+# CONFIG_BASLER_EXCITE is not set
+# CONFIG_MIPS_COBALT is not set
+# CONFIG_MACH_DECSTATION is not set
+# CONFIG_MIPS_EV64120 is not set
+# CONFIG_MACH_JAZZ is not set
+# CONFIG_LASAT is not set
+# CONFIG_MIPS_ATLAS is not set
+CONFIG_MIPS_MALTA=y
+# CONFIG_MIPS_SEAD is not set
+# CONFIG_WR_PPMC is not set
+# CONFIG_MIPS_SIM is not set
+# CONFIG_MOMENCO_JAGUAR_ATX is not set
+# CONFIG_MOMENCO_OCELOT is not set
+# CONFIG_MOMENCO_OCELOT_3 is not set
+# CONFIG_MOMENCO_OCELOT_C is not set
+# CONFIG_MOMENCO_OCELOT_G is not set
+# CONFIG_MIPS_XXS1500 is not set
+# CONFIG_PNX8550_V2PCI is not set
+# CONFIG_PNX8550_JBS is not set
+# CONFIG_PNX8550_STB810 is not set
+# CONFIG_DDB5477 is not set
+# CONFIG_MACH_VR41XX is not set
+# CONFIG_PMC_YOSEMITE is not set
+# CONFIG_QEMU is not set
+# CONFIG_MARKEINS is not set
+# CONFIG_SGI_IP22 is not set
+# CONFIG_SGI_IP27 is not set
+# CONFIG_SGI_IP32 is not set
+# CONFIG_SIBYTE_BIGSUR is not set
+# CONFIG_SIBYTE_SWARM is not set
+# CONFIG_SIBYTE_SENTOSA is not set
+# CONFIG_SIBYTE_RHONE is not set
+# CONFIG_SIBYTE_CARMEL is not set
+# CONFIG_SIBYTE_PTSWARM is not set
+# CONFIG_SIBYTE_LITTLESUR is not set
+# CONFIG_SIBYTE_CRHINE is not set
+# CONFIG_SIBYTE_CRHONE is not set
+# CONFIG_SNI_RM is not set
+# CONFIG_TOSHIBA_JMR3927 is not set
+# CONFIG_TOSHIBA_RBTX4927 is not set
+# CONFIG_TOSHIBA_RBTX4938 is not set
+# CONFIG_KEXEC is not set
+CONFIG_RWSEM_GENERIC_SPINLOCK=y
+# CONFIG_ARCH_HAS_ILOG2_U32 is not set
+# CONFIG_ARCH_HAS_ILOG2_U64 is not set
+CONFIG_GENERIC_FIND_NEXT_BIT=y
+CONFIG_GENERIC_HWEIGHT=y
+CONFIG_GENERIC_CALIBRATE_DELAY=y
+CONFIG_GENERIC_TIME=y
+CONFIG_SCHED_NO_NO_OMIT_FRAME_POINTER=y
+# CONFIG_GENERIC_HARDIRQS_NO__DO_IRQ is not set
+CONFIG_ARCH_MAY_HAVE_PC_FDC=y
+CONFIG_DMA_NONCOHERENT=y
+CONFIG_DMA_NEED_PCI_MAP_STATE=y
+CONFIG_GENERIC_ISA_DMA=y
+CONFIG_I8259=y
+CONFIG_MIPS_BONITO64=y
+CONFIG_MIPS_MSC=y
+CONFIG_CPU_BIG_ENDIAN=y
+# CONFIG_CPU_LITTLE_ENDIAN is not set
+CONFIG_SYS_SUPPORTS_BIG_ENDIAN=y
+CONFIG_SYS_SUPPORTS_LITTLE_ENDIAN=y
+CONFIG_IRQ_CPU=y
+CONFIG_MIPS_BOARDS_GEN=y
+CONFIG_MIPS_GT64120=y
+CONFIG_SWAP_IO_SPACE=y
+CONFIG_BOOT_ELF32=y
+CONFIG_MIPS_L1_CACHE_SHIFT=5
+CONFIG_HAVE_STD_PC_SERIAL_PORT=y
+
+#
+# CPU selection
+#
+CONFIG_CPU_MIPS32_R1=y
+# CONFIG_CPU_MIPS32_R2 is not set
+# CONFIG_CPU_MIPS64_R1 is not set
+# CONFIG_CPU_MIPS64_R2 is not set
+# CONFIG_CPU_R3000 is not set
+# CONFIG_CPU_TX39XX is not set
+# CONFIG_CPU_VR41XX is not set
+# CONFIG_CPU_R4300 is not set
+# CONFIG_CPU_R4X00 is not set
+# CONFIG_CPU_TX49XX is not set
+# CONFIG_CPU_R5000 is not set
+# CONFIG_CPU_R5432 is not set
+# CONFIG_CPU_R6000 is not set
+# CONFIG_CPU_NEVADA is not set
+# CONFIG_CPU_R8000 is not set
+# CONFIG_CPU_R10000 is not set
+# CONFIG_CPU_RM7000 is not set
+# CONFIG_CPU_RM9000 is not set
+# CONFIG_CPU_SB1 is not set
+CONFIG_SYS_HAS_CPU_MIPS32_R1=y
+CONFIG_SYS_HAS_CPU_MIPS32_R2=y
+CONFIG_SYS_HAS_CPU_MIPS64_R1=y
+CONFIG_SYS_HAS_CPU_NEVADA=y
+CONFIG_SYS_HAS_CPU_RM7000=y
+CONFIG_CPU_MIPS32=y
+CONFIG_CPU_MIPSR1=y
+CONFIG_SYS_SUPPORTS_32BIT_KERNEL=y
+CONFIG_SYS_SUPPORTS_64BIT_KERNEL=y
+CONFIG_CPU_SUPPORTS_32BIT_KERNEL=y
+
+#
+# Kernel type
+#
+CONFIG_32BIT=y
+# CONFIG_64BIT is not set
+CONFIG_PAGE_SIZE_4KB=y
+# CONFIG_PAGE_SIZE_8KB is not set
+# CONFIG_PAGE_SIZE_16KB is not set
+# CONFIG_PAGE_SIZE_64KB is not set
+CONFIG_BOARD_SCACHE=y
+CONFIG_MIPS_CPU_SCACHE=y
+CONFIG_CPU_HAS_PREFETCH=y
+CONFIG_MIPS_MT_DISABLED=y
+# CONFIG_MIPS_MT_SMP is not set
+# CONFIG_MIPS_MT_SMTC is not set
+# CONFIG_MIPS_VPE_LOADER is not set
+CONFIG_SYS_SUPPORTS_MULTITHREADING=y
+# CONFIG_64BIT_PHYS_ADDR is not set
+CONFIG_CPU_HAS_LLSC=y
+CONFIG_CPU_HAS_SYNC=y
+CONFIG_GENERIC_HARDIRQS=y
+CONFIG_GENERIC_IRQ_PROBE=y
+CONFIG_CPU_SUPPORTS_HIGHMEM=y
+CONFIG_ARCH_FLATMEM_ENABLE=y
+CONFIG_SELECT_MEMORY_MODEL=y
+CONFIG_FLATMEM_MANUAL=y
+# CONFIG_DISCONTIGMEM_MANUAL is not set
+# CONFIG_SPARSEMEM_MANUAL is not set
+CONFIG_FLATMEM=y
+CONFIG_FLAT_NODE_MEM_MAP=y
+# CONFIG_SPARSEMEM_STATIC is not set
+CONFIG_SPLIT_PTLOCK_CPUS=4
+# CONFIG_RESOURCES_64BIT is not set
+# CONFIG_HZ_48 is not set
+# CONFIG_HZ_100 is not set
+# CONFIG_HZ_128 is not set
+CONFIG_HZ_250=y
+# CONFIG_HZ_256 is not set
+# CONFIG_HZ_1000 is not set
+# CONFIG_HZ_1024 is not set
+CONFIG_SYS_SUPPORTS_ARBIT_HZ=y
+CONFIG_HZ=250
+CONFIG_PREEMPT_NONE=y
+# CONFIG_PREEMPT_VOLUNTARY is not set
+# CONFIG_PREEMPT is not set
+CONFIG_STACKTRACE_SUPPORT=y
+CONFIG_DEFCONFIG_LIST="/lib/modules/$UNAME_RELEASE/.config"
+
+#
+# Code maturity level options
+#
+CONFIG_EXPERIMENTAL=y
+CONFIG_BROKEN_ON_SMP=y
+
+#
+# General setup
+#
+CONFIG_LOCALVERSION=""
+# CONFIG_LOCALVERSION_AUTO is not set
+CONFIG_SWAP=y
+CONFIG_SYSVIPC=y
+CONFIG_POSIX_MQUEUE=y
+CONFIG_BSD_PROCESS_ACCT=y
+CONFIG_BSD_PROCESS_ACCT_V3=y
+# CONFIG_TASKSTATS is not set
+CONFIG_AUDIT=y
+CONFIG_IKCONFIG=y
+CONFIG_IKCONFIG_PROC=y
+CONFIG_SYSFS_DEPRECATED=y
+CONFIG_INITRAMFS_SOURCE=""
+# CONFIG_CC_OPTIMIZE_FOR_SIZE is not set
+CONFIG_EMBEDDED=y
+CONFIG_SYSCTL_SYSCALL=y
+CONFIG_HOTPLUG=y
+CONFIG_BASE_FULL=y
+CONFIG_SLAB=y
+CONFIG_BASE_SMALL=0
+# CONFIG_SLOB is not set
+
+#
+# Loadable module support
+#
+CONFIG_MODULES=y
+CONFIG_MODULE_UNLOAD=y
+CONFIG_MODULE_FORCE_UNLOAD=y
+CONFIG_MODVERSIONS=y
+# CONFIG_MODULE_SRCVERSION_ALL is not set
+CONFIG_KMOD=y
+
+#
+# Block layer
+#
+# CONFIG_LBD is not set
+# CONFIG_BLK_DEV_IO_TRACE is not set
+# CONFIG_LSF is not set
+
+#
+# IO Schedulers
+#
+CONFIG_IOSCHED_NOOP=y
+CONFIG_IOSCHED_AS=y
+CONFIG_IOSCHED_DEADLINE=y
+CONFIG_IOSCHED_CFQ=y
+# CONFIG_DEFAULT_AS is not set
+# CONFIG_DEFAULT_DEADLINE is not set
+CONFIG_DEFAULT_CFQ=y
+# CONFIG_DEFAULT_NOOP is not set
+CONFIG_DEFAULT_IOSCHED="cfq"
+
+#
+# Bus options (PCI, PCMCIA, EISA, ISA, TC)
+#
+CONFIG_HW_HAS_PCI=y
+CONFIG_PCI=y
+CONFIG_MMU=y
+
+#
+# PCCARD (PCMCIA/CardBus) support
+#
+# CONFIG_PCCARD is not set
+
+#
+# PCI Hotplug Support
+#
+# CONFIG_HOTPLUG_PCI is not set
+
+#
+# Executable file formats
+#
+CONFIG_BINFMT_ELF=y
+CONFIG_BINFMT_MISC=m
+CONFIG_TRAD_SIGNALS=y
+
+#
+# Networking
+#
+CONFIG_NET=y
+
+#
+# Networking options
+#
+CONFIG_PACKET=y
+CONFIG_PACKET_MMAP=y
+CONFIG_UNIX=y
+CONFIG_XFRM=y
+CONFIG_XFRM_USER=m
+# CONFIG_XFRM_SUB_POLICY is not set
+CONFIG_NET_KEY=m
+CONFIG_INET=y
+CONFIG_IP_MULTICAST=y
+CONFIG_IP_ADVANCED_ROUTER=y
+CONFIG_ASK_IP_FIB_HASH=y
+# CONFIG_IP_FIB_TRIE is not set
+CONFIG_IP_FIB_HASH=y
+CONFIG_IP_MULTIPLE_TABLES=y
+CONFIG_IP_ROUTE_MULTIPATH=y
+CONFIG_IP_ROUTE_VERBOSE=y
+# CONFIG_IP_PNP is not set
+CONFIG_NET_IPIP=m
+CONFIG_NET_IPGRE=m
+CONFIG_NET_IPGRE_BROADCAST=y
+CONFIG_IP_MROUTE=y
+CONFIG_IP_PIMSM_V1=y
+CONFIG_IP_PIMSM_V2=y
+# CONFIG_ARPD is not set
+CONFIG_SYN_COOKIES=y
+CONFIG_INET_AH=m
+CONFIG_INET_ESP=m
+CONFIG_INET_IPCOMP=m
+CONFIG_INET_XFRM_TUNNEL=m
+CONFIG_INET_TUNNEL=m
+CONFIG_INET_XFRM_MODE_TRANSPORT=m
+CONFIG_INET_XFRM_MODE_TUNNEL=m
+CONFIG_INET_XFRM_MODE_BEET=m
+CONFIG_INET_DIAG=m
+CONFIG_INET_TCP_DIAG=m
+CONFIG_TCP_CONG_ADVANCED=y
+CONFIG_TCP_CONG_BIC=y
+CONFIG_TCP_CONG_CUBIC=m
+CONFIG_TCP_CONG_WESTWOOD=m
+CONFIG_TCP_CONG_HTCP=m
+CONFIG_TCP_CONG_HSTCP=m
+CONFIG_TCP_CONG_HYBLA=m
+CONFIG_TCP_CONG_VEGAS=m
+CONFIG_TCP_CONG_SCALABLE=m
+CONFIG_TCP_CONG_LP=m
+CONFIG_TCP_CONG_VENO=m
+CONFIG_DEFAULT_BIC=y
+# CONFIG_DEFAULT_CUBIC is not set
+# CONFIG_DEFAULT_HTCP is not set
+# CONFIG_DEFAULT_VEGAS is not set
+# CONFIG_DEFAULT_WESTWOOD is not set
+# CONFIG_DEFAULT_RENO is not set
+CONFIG_DEFAULT_TCP_CONG="bic"
+# CONFIG_TCP_MD5SIG is not set
+
+#
+# IP: Virtual Server Configuration
+#
+CONFIG_IP_VS=m
+# CONFIG_IP_VS_DEBUG is not set
+CONFIG_IP_VS_TAB_BITS=12
+
+#
+# IPVS transport protocol load balancing support
+#
+CONFIG_IP_VS_PROTO_TCP=y
+CONFIG_IP_VS_PROTO_UDP=y
+CONFIG_IP_VS_PROTO_ESP=y
+CONFIG_IP_VS_PROTO_AH=y
+
+#
+# IPVS scheduler
+#
+CONFIG_IP_VS_RR=m
+CONFIG_IP_VS_WRR=m
+CONFIG_IP_VS_LC=m
+CONFIG_IP_VS_WLC=m
+CONFIG_IP_VS_LBLC=m
+CONFIG_IP_VS_LBLCR=m
+CONFIG_IP_VS_DH=m
+CONFIG_IP_VS_SH=m
+CONFIG_IP_VS_SED=m
+CONFIG_IP_VS_NQ=m
+
+#
+# IPVS application helper
+#
+CONFIG_IP_VS_FTP=m
+CONFIG_IPV6=m
+CONFIG_IPV6_PRIVACY=y
+# CONFIG_IPV6_ROUTER_PREF is not set
+CONFIG_INET6_AH=m
+CONFIG_INET6_ESP=m
+CONFIG_INET6_IPCOMP=m
+# CONFIG_IPV6_MIP6 is not set
+CONFIG_INET6_XFRM_TUNNEL=m
+CONFIG_INET6_TUNNEL=m
+CONFIG_INET6_XFRM_MODE_TRANSPORT=m
+CONFIG_INET6_XFRM_MODE_TUNNEL=m
+CONFIG_INET6_XFRM_MODE_BEET=m
+CONFIG_INET6_XFRM_MODE_ROUTEOPTIMIZATION=m
+CONFIG_IPV6_SIT=m
+CONFIG_IPV6_TUNNEL=m
+# CONFIG_IPV6_MULTIPLE_TABLES is not set
+# CONFIG_NETLABEL is not set
+CONFIG_NETWORK_SECMARK=y
+CONFIG_NETFILTER=y
+# CONFIG_NETFILTER_DEBUG is not set
+CONFIG_BRIDGE_NETFILTER=y
+
+#
+# Core Netfilter Configuration
+#
+CONFIG_NETFILTER_NETLINK=m
+CONFIG_NETFILTER_NETLINK_QUEUE=m
+CONFIG_NETFILTER_NETLINK_LOG=m
+CONFIG_NF_CONNTRACK_ENABLED=m
+CONFIG_NF_CONNTRACK=m
+CONFIG_NF_CT_ACCT=y
+CONFIG_NF_CONNTRACK_MARK=y
+CONFIG_NF_CONNTRACK_SECMARK=y
+CONFIG_NF_CONNTRACK_EVENTS=y
+CONFIG_NF_CT_PROTO_GRE=m
+CONFIG_NF_CT_PROTO_SCTP=m
+CONFIG_NF_CONNTRACK_FTP=m
+CONFIG_NF_CONNTRACK_H323=m
+CONFIG_NF_CONNTRACK_IRC=m
+CONFIG_NF_CONNTRACK_NETBIOS_NS=m
+CONFIG_NF_CONNTRACK_PPTP=m
+CONFIG_NF_CONNTRACK_SIP=m
+CONFIG_NF_CT_NETLINK=m
+CONFIG_NETFILTER_XTABLES=m
+CONFIG_NETFILTER_XT_TARGET_CLASSIFY=m
+CONFIG_NETFILTER_XT_TARGET_CONNMARK=m
+CONFIG_NETFILTER_XT_TARGET_DSCP=m
+CONFIG_NETFILTER_XT_TARGET_MARK=m
+CONFIG_NETFILTER_XT_TARGET_NFQUEUE=m
+CONFIG_NETFILTER_XT_TARGET_NFLOG=m
+CONFIG_NETFILTER_XT_TARGET_NOTRACK=m
+CONFIG_NETFILTER_XT_TARGET_SECMARK=m
+CONFIG_NETFILTER_XT_TARGET_CONNSECMARK=m
+CONFIG_NETFILTER_XT_MATCH_COMMENT=m
+CONFIG_NETFILTER_XT_MATCH_CONNBYTES=m
+CONFIG_NETFILTER_XT_MATCH_CONNMARK=m
+CONFIG_NETFILTER_XT_MATCH_CONNTRACK=m
+CONFIG_NETFILTER_XT_MATCH_DCCP=m
+CONFIG_NETFILTER_XT_MATCH_DSCP=m
+CONFIG_NETFILTER_XT_MATCH_ESP=m
+CONFIG_NETFILTER_XT_MATCH_HELPER=m
+CONFIG_NETFILTER_XT_MATCH_LENGTH=m
+CONFIG_NETFILTER_XT_MATCH_LIMIT=m
+CONFIG_NETFILTER_XT_MATCH_MAC=m
+CONFIG_NETFILTER_XT_MATCH_MARK=m
+CONFIG_NETFILTER_XT_MATCH_POLICY=m
+CONFIG_NETFILTER_XT_MATCH_MULTIPORT=m
+CONFIG_NETFILTER_XT_MATCH_PHYSDEV=m
+CONFIG_NETFILTER_XT_MATCH_PKTTYPE=m
+CONFIG_NETFILTER_XT_MATCH_QUOTA=m
+CONFIG_NETFILTER_XT_MATCH_REALM=m
+CONFIG_NETFILTER_XT_MATCH_SCTP=m
+CONFIG_NETFILTER_XT_MATCH_STATE=m
+CONFIG_NETFILTER_XT_MATCH_STATISTIC=m
+CONFIG_NETFILTER_XT_MATCH_STRING=m
+CONFIG_NETFILTER_XT_MATCH_TCPMSS=m
+CONFIG_NETFILTER_XT_MATCH_HASHLIMIT=m
+
+#
+# IP: Netfilter Configuration
+#
+CONFIG_NF_CONNTRACK_IPV4=m
+CONFIG_NF_CONNTRACK_PROC_COMPAT=y
+CONFIG_IP_NF_QUEUE=m
+CONFIG_IP_NF_IPTABLES=m
+CONFIG_IP_NF_MATCH_IPRANGE=m
+CONFIG_IP_NF_MATCH_TOS=m
+CONFIG_IP_NF_MATCH_RECENT=m
+CONFIG_IP_NF_MATCH_ECN=m
+CONFIG_IP_NF_MATCH_AH=m
+CONFIG_IP_NF_MATCH_TTL=m
+CONFIG_IP_NF_MATCH_OWNER=m
+CONFIG_IP_NF_MATCH_ADDRTYPE=m
+CONFIG_IP_NF_FILTER=m
+CONFIG_IP_NF_TARGET_REJECT=m
+CONFIG_IP_NF_TARGET_LOG=m
+CONFIG_IP_NF_TARGET_ULOG=m
+CONFIG_IP_NF_TARGET_TCPMSS=m
+CONFIG_NF_NAT=m
+CONFIG_NF_NAT_NEEDED=y
+CONFIG_IP_NF_TARGET_MASQUERADE=m
+CONFIG_IP_NF_TARGET_REDIRECT=m
+CONFIG_IP_NF_TARGET_NETMAP=m
+CONFIG_IP_NF_TARGET_SAME=m
+CONFIG_NF_NAT_SNMP_BASIC=m
+CONFIG_NF_NAT_PROTO_GRE=m
+CONFIG_NF_NAT_FTP=m
+CONFIG_NF_NAT_IRC=m
+CONFIG_NF_NAT_TFTP=m
+CONFIG_NF_NAT_AMANDA=m
+CONFIG_NF_NAT_PPTP=m
+CONFIG_NF_NAT_H323=m
+CONFIG_NF_NAT_SIP=m
+CONFIG_IP_NF_MANGLE=m
+CONFIG_IP_NF_TARGET_TOS=m
+CONFIG_IP_NF_TARGET_ECN=m
+CONFIG_IP_NF_TARGET_TTL=m
+CONFIG_IP_NF_TARGET_CLUSTERIP=m
+CONFIG_IP_NF_RAW=m
+CONFIG_IP_NF_ARPTABLES=m
+CONFIG_IP_NF_ARPFILTER=m
+CONFIG_IP_NF_ARP_MANGLE=m
+
+#
+# IPv6: Netfilter Configuration (EXPERIMENTAL)
+#
+CONFIG_NF_CONNTRACK_IPV6=m
+CONFIG_IP6_NF_QUEUE=m
+CONFIG_IP6_NF_IPTABLES=m
+CONFIG_IP6_NF_MATCH_RT=m
+CONFIG_IP6_NF_MATCH_OPTS=m
+CONFIG_IP6_NF_MATCH_FRAG=m
+CONFIG_IP6_NF_MATCH_HL=m
+CONFIG_IP6_NF_MATCH_OWNER=m
+CONFIG_IP6_NF_MATCH_IPV6HEADER=m
+CONFIG_IP6_NF_MATCH_AH=m
+CONFIG_IP6_NF_MATCH_EUI64=m
+CONFIG_IP6_NF_FILTER=m
+CONFIG_IP6_NF_TARGET_LOG=m
+CONFIG_IP6_NF_TARGET_REJECT=m
+CONFIG_IP6_NF_MANGLE=m
+CONFIG_IP6_NF_TARGET_HL=m
+CONFIG_IP6_NF_RAW=m
+
+#
+# DECnet: Netfilter Configuration
+#
+CONFIG_DECNET_NF_GRABULATOR=m
+
+#
+# Bridge: Netfilter Configuration
+#
+CONFIG_BRIDGE_NF_EBTABLES=m
+CONFIG_BRIDGE_EBT_BROUTE=m
+CONFIG_BRIDGE_EBT_T_FILTER=m
+CONFIG_BRIDGE_EBT_T_NAT=m
+CONFIG_BRIDGE_EBT_802_3=m
+CONFIG_BRIDGE_EBT_AMONG=m
+CONFIG_BRIDGE_EBT_ARP=m
+CONFIG_BRIDGE_EBT_IP=m
+CONFIG_BRIDGE_EBT_LIMIT=m
+CONFIG_BRIDGE_EBT_MARK=m
+CONFIG_BRIDGE_EBT_PKTTYPE=m
+CONFIG_BRIDGE_EBT_STP=m
+CONFIG_BRIDGE_EBT_VLAN=m
+CONFIG_BRIDGE_EBT_ARPREPLY=m
+CONFIG_BRIDGE_EBT_DNAT=m
+CONFIG_BRIDGE_EBT_MARK_T=m
+CONFIG_BRIDGE_EBT_REDIRECT=m
+CONFIG_BRIDGE_EBT_SNAT=m
+CONFIG_BRIDGE_EBT_LOG=m
+CONFIG_BRIDGE_EBT_ULOG=m
+
+#
+# DCCP Configuration (EXPERIMENTAL)
+#
+CONFIG_IP_DCCP=m
+CONFIG_INET_DCCP_DIAG=m
+CONFIG_IP_DCCP_ACKVEC=y
+
+#
+# DCCP CCIDs Configuration (EXPERIMENTAL)
+#
+CONFIG_IP_DCCP_CCID2=m
+# CONFIG_IP_DCCP_CCID2_DEBUG is not set
+CONFIG_IP_DCCP_CCID3=m
+CONFIG_IP_DCCP_TFRC_LIB=m
+# CONFIG_IP_DCCP_CCID3_DEBUG is not set
+CONFIG_IP_DCCP_CCID3_RTO=100
+
+#
+# SCTP Configuration (EXPERIMENTAL)
+#
+CONFIG_IP_SCTP=m
+# CONFIG_SCTP_DBG_MSG is not set
+# CONFIG_SCTP_DBG_OBJCNT is not set
+# CONFIG_SCTP_HMAC_NONE is not set
+# CONFIG_SCTP_HMAC_SHA1 is not set
+CONFIG_SCTP_HMAC_MD5=y
+
+#
+# TIPC Configuration (EXPERIMENTAL)
+#
+CONFIG_TIPC=m
+CONFIG_TIPC_ADVANCED=y
+CONFIG_TIPC_ZONES=3
+CONFIG_TIPC_CLUSTERS=1
+CONFIG_TIPC_NODES=255
+CONFIG_TIPC_SLAVE_NODES=0
+CONFIG_TIPC_PORTS=8191
+CONFIG_TIPC_LOG=0
+# CONFIG_TIPC_DEBUG is not set
+CONFIG_ATM=m
+CONFIG_ATM_CLIP=m
+# CONFIG_ATM_CLIP_NO_ICMP is not set
+CONFIG_ATM_LANE=m
+CONFIG_ATM_MPOA=m
+CONFIG_ATM_BR2684=m
+# CONFIG_ATM_BR2684_IPFILTER is not set
+CONFIG_BRIDGE=m
+CONFIG_VLAN_8021Q=m
+CONFIG_DECNET=m
+# CONFIG_DECNET_ROUTER is not set
+CONFIG_LLC=y
+CONFIG_LLC2=m
+CONFIG_IPX=m
+# CONFIG_IPX_INTERN is not set
+CONFIG_ATALK=m
+CONFIG_DEV_APPLETALK=m
+CONFIG_IPDDP=m
+CONFIG_IPDDP_ENCAP=y
+CONFIG_IPDDP_DECAP=y
+CONFIG_X25=m
+CONFIG_LAPB=m
+CONFIG_ECONET=m
+CONFIG_ECONET_AUNUDP=y
+CONFIG_ECONET_NATIVE=y
+CONFIG_WAN_ROUTER=m
+
+#
+# Network testing
+#
+CONFIG_NET_PKTGEN=m
+CONFIG_HAMRADIO=y
+
+#
+# Packet Radio protocols
+#
+CONFIG_AX25=m
+# CONFIG_AX25_DAMA_SLAVE is not set
+CONFIG_NETROM=m
+CONFIG_ROSE=m
+
+#
+# AX.25 network device drivers
+#
+CONFIG_MKISS=m
+CONFIG_6PACK=m
+CONFIG_BPQETHER=m
+CONFIG_BAYCOM_SER_FDX=m
+CONFIG_BAYCOM_SER_HDX=m
+CONFIG_BAYCOM_PAR=m
+CONFIG_BAYCOM_EPP=m
+CONFIG_YAM=m
+CONFIG_IRDA=m
+
+#
+# IrDA protocols
+#
+CONFIG_IRLAN=m
+CONFIG_IRNET=m
+CONFIG_IRCOMM=m
+# CONFIG_IRDA_ULTRA is not set
+
+#
+# IrDA options
+#
+CONFIG_IRDA_CACHE_LAST_LSAP=y
+CONFIG_IRDA_FAST_RR=y
+CONFIG_IRDA_DEBUG=y
+
+#
+# Infrared-port device drivers
+#
+
+#
+# SIR device drivers
+#
+CONFIG_IRTTY_SIR=m
+
+#
+# Dongle support
+#
+CONFIG_DONGLE=y
+CONFIG_ESI_DONGLE=m
+CONFIG_ACTISYS_DONGLE=m
+CONFIG_TEKRAM_DONGLE=m
+CONFIG_TOIM3232_DONGLE=m
+CONFIG_LITELINK_DONGLE=m
+CONFIG_MA600_DONGLE=m
+CONFIG_GIRBIL_DONGLE=m
+CONFIG_MCP2120_DONGLE=m
+CONFIG_OLD_BELKIN_DONGLE=m
+CONFIG_ACT200L_DONGLE=m
+
+#
+# Old SIR device drivers
+#
+CONFIG_IRPORT_SIR=m
+
+#
+# Old Serial dongle support
+#
+# CONFIG_DONGLE_OLD is not set
+
+#
+# FIR device drivers
+#
+CONFIG_USB_IRDA=m
+CONFIG_SIGMATEL_FIR=m
+CONFIG_TOSHIBA_FIR=m
+CONFIG_VLSI_FIR=m
+CONFIG_MCS_FIR=m
+CONFIG_BT=m
+CONFIG_BT_L2CAP=m
+CONFIG_BT_SCO=m
+CONFIG_BT_RFCOMM=m
+CONFIG_BT_RFCOMM_TTY=y
+CONFIG_BT_BNEP=m
+CONFIG_BT_BNEP_MC_FILTER=y
+CONFIG_BT_BNEP_PROTO_FILTER=y
+CONFIG_BT_CMTP=m
+CONFIG_BT_HIDP=m
+
+#
+# Bluetooth device drivers
+#
+CONFIG_BT_HCIUSB=m
+CONFIG_BT_HCIUSB_SCO=y
+CONFIG_BT_HCIUART=m
+CONFIG_BT_HCIUART_H4=y
+CONFIG_BT_HCIUART_BCSP=y
+CONFIG_BT_HCIBCM203X=m
+CONFIG_BT_HCIBPA10X=m
+CONFIG_BT_HCIBFUSB=m
+CONFIG_BT_HCIVHCI=m
+CONFIG_IEEE80211=m
+# CONFIG_IEEE80211_DEBUG is not set
+CONFIG_IEEE80211_CRYPT_WEP=m
+CONFIG_IEEE80211_CRYPT_CCMP=m
+CONFIG_IEEE80211_CRYPT_TKIP=m
+CONFIG_IEEE80211_SOFTMAC=m
+# CONFIG_IEEE80211_SOFTMAC_DEBUG is not set
+CONFIG_WIRELESS_EXT=y
+CONFIG_FIB_RULES=y
+
+#
+# Device Drivers
+#
+
+#
+# Generic Driver Options
+#
+CONFIG_STANDALONE=y
+CONFIG_PREVENT_FIRMWARE_BUILD=y
+CONFIG_FW_LOADER=m
+# CONFIG_SYS_HYPERVISOR is not set
+
+#
+# Connector - unified userspace <-> kernelspace linker
+#
+CONFIG_CONNECTOR=m
+
+#
+# Memory Technology Devices (MTD)
+#
+CONFIG_MTD=m
+# CONFIG_MTD_DEBUG is not set
+CONFIG_MTD_CONCAT=m
+CONFIG_MTD_PARTITIONS=y
+CONFIG_MTD_REDBOOT_PARTS=m
+CONFIG_MTD_REDBOOT_DIRECTORY_BLOCK=-1
+# CONFIG_MTD_REDBOOT_PARTS_UNALLOCATED is not set
+# CONFIG_MTD_REDBOOT_PARTS_READONLY is not set
+
+#
+# User Modules And Translation Layers
+#
+CONFIG_MTD_CHAR=m
+CONFIG_MTD_BLKDEVS=m
+CONFIG_MTD_BLOCK=m
+CONFIG_MTD_BLOCK_RO=m
+CONFIG_FTL=m
+CONFIG_NFTL=m
+CONFIG_NFTL_RW=y
+CONFIG_INFTL=m
+CONFIG_RFD_FTL=m
+CONFIG_SSFDC=m
+
+#
+# RAM/ROM/Flash chip drivers
+#
+CONFIG_MTD_CFI=m
+CONFIG_MTD_JEDECPROBE=m
+CONFIG_MTD_GEN_PROBE=m
+# CONFIG_MTD_CFI_ADV_OPTIONS is not set
+CONFIG_MTD_MAP_BANK_WIDTH_1=y
+CONFIG_MTD_MAP_BANK_WIDTH_2=y
+CONFIG_MTD_MAP_BANK_WIDTH_4=y
+# CONFIG_MTD_MAP_BANK_WIDTH_8 is not set
+# CONFIG_MTD_MAP_BANK_WIDTH_16 is not set
+# CONFIG_MTD_MAP_BANK_WIDTH_32 is not set
+CONFIG_MTD_CFI_I1=y
+CONFIG_MTD_CFI_I2=y
+# CONFIG_MTD_CFI_I4 is not set
+# CONFIG_MTD_CFI_I8 is not set
+CONFIG_MTD_CFI_INTELEXT=m
+CONFIG_MTD_CFI_AMDSTD=m
+CONFIG_MTD_CFI_STAA=m
+CONFIG_MTD_CFI_UTIL=m
+CONFIG_MTD_RAM=m
+CONFIG_MTD_ROM=m
+CONFIG_MTD_ABSENT=m
+
+#
+# Mapping drivers for chip access
+#
+CONFIG_MTD_COMPLEX_MAPPINGS=y
+CONFIG_MTD_PHYSMAP=m
+CONFIG_MTD_PHYSMAP_START=0x8000000
+CONFIG_MTD_PHYSMAP_LEN=0x0
+CONFIG_MTD_PHYSMAP_BANKWIDTH=2
+CONFIG_MTD_PCI=m
+CONFIG_MTD_PLATRAM=m
+
+#
+# Self-contained MTD device drivers
+#
+CONFIG_MTD_PMC551=m
+# CONFIG_MTD_PMC551_BUGFIX is not set
+# CONFIG_MTD_PMC551_DEBUG is not set
+CONFIG_MTD_DATAFLASH=m
+CONFIG_MTD_M25P80=m
+CONFIG_MTD_SLRAM=m
+CONFIG_MTD_PHRAM=m
+CONFIG_MTD_MTDRAM=m
+CONFIG_MTDRAM_TOTAL_SIZE=4096
+CONFIG_MTDRAM_ERASE_SIZE=128
+CONFIG_MTD_BLOCK2MTD=m
+
+#
+# Disk-On-Chip Device Drivers
+#
+CONFIG_MTD_DOC2000=m
+CONFIG_MTD_DOC2001=m
+CONFIG_MTD_DOC2001PLUS=m
+CONFIG_MTD_DOCPROBE=m
+CONFIG_MTD_DOCECC=m
+# CONFIG_MTD_DOCPROBE_ADVANCED is not set
+CONFIG_MTD_DOCPROBE_ADDRESS=0
+
+#
+# NAND Flash Device Drivers
+#
+CONFIG_MTD_NAND=m
+# CONFIG_MTD_NAND_VERIFY_WRITE is not set
+# CONFIG_MTD_NAND_ECC_SMC is not set
+CONFIG_MTD_NAND_IDS=m
+CONFIG_MTD_NAND_DISKONCHIP=m
+# CONFIG_MTD_NAND_DISKONCHIP_PROBE_ADVANCED is not set
+CONFIG_MTD_NAND_DISKONCHIP_PROBE_ADDRESS=0
+# CONFIG_MTD_NAND_DISKONCHIP_BBTWRITE is not set
+CONFIG_MTD_NAND_CAFE=m
+# CONFIG_MTD_NAND_NANDSIM is not set
+
+#
+# OneNAND Flash Device Drivers
+#
+CONFIG_MTD_ONENAND=m
+CONFIG_MTD_ONENAND_VERIFY_WRITE=y
+# CONFIG_MTD_ONENAND_OTP is not set
+
+#
+# Parallel port support
+#
+CONFIG_PARPORT=m
+CONFIG_PARPORT_PC=m
+CONFIG_PARPORT_SERIAL=m
+CONFIG_PARPORT_PC_FIFO=y
+# CONFIG_PARPORT_PC_SUPERIO is not set
+# CONFIG_PARPORT_GSC is not set
+# CONFIG_PARPORT_AX88796 is not set
+CONFIG_PARPORT_1284=y
+CONFIG_PARPORT_NOT_PC=y
+
+#
+# Plug and Play support
+#
+
+#
+# Block devices
+#
+CONFIG_BLK_DEV_FD=m
+CONFIG_PARIDE=m
+
+#
+# Parallel IDE high-level drivers
+#
+CONFIG_PARIDE_PD=m
+CONFIG_PARIDE_PCD=m
+CONFIG_PARIDE_PF=m
+CONFIG_PARIDE_PT=m
+CONFIG_PARIDE_PG=m
+
+#
+# Parallel IDE protocol modules
+#
+CONFIG_PARIDE_ATEN=m
+CONFIG_PARIDE_BPCK=m
+# CONFIG_PARIDE_BPCK6 is not set
+CONFIG_PARIDE_COMM=m
+CONFIG_PARIDE_DSTR=m
+CONFIG_PARIDE_FIT2=m
+CONFIG_PARIDE_FIT3=m
+CONFIG_PARIDE_EPAT=m
+# CONFIG_PARIDE_EPATC8 is not set
+CONFIG_PARIDE_EPIA=m
+CONFIG_PARIDE_FRIQ=m
+CONFIG_PARIDE_FRPW=m
+CONFIG_PARIDE_KBIC=m
+CONFIG_PARIDE_KTTI=m
+CONFIG_PARIDE_ON20=m
+CONFIG_PARIDE_ON26=m
+CONFIG_BLK_CPQ_CISS_DA=m
+CONFIG_CISS_SCSI_TAPE=y
+CONFIG_BLK_DEV_DAC960=m
+CONFIG_BLK_DEV_UMEM=m
+# CONFIG_BLK_DEV_COW_COMMON is not set
+CONFIG_BLK_DEV_LOOP=m
+CONFIG_BLK_DEV_CRYPTOLOOP=m
+CONFIG_BLK_DEV_NBD=m
+CONFIG_BLK_DEV_SX8=m
+# CONFIG_BLK_DEV_UB is not set
+CONFIG_BLK_DEV_RAM=y
+CONFIG_BLK_DEV_RAM_COUNT=16
+CONFIG_BLK_DEV_RAM_SIZE=65536
+CONFIG_BLK_DEV_RAM_BLOCKSIZE=1024
+CONFIG_BLK_DEV_INITRD=y
+CONFIG_CDROM_PKTCDVD=m
+CONFIG_CDROM_PKTCDVD_BUFFERS=8
+# CONFIG_CDROM_PKTCDVD_WCACHE is not set
+CONFIG_ATA_OVER_ETH=m
+
+#
+# Misc devices
+#
+# CONFIG_SGI_IOC4 is not set
+CONFIG_TIFM_CORE=m
+CONFIG_TIFM_7XX1=m
+
+#
+# ATA/ATAPI/MFM/RLL support
+#
+CONFIG_IDE=y
+CONFIG_IDE_MAX_HWIFS=4
+CONFIG_BLK_DEV_IDE=y
+
+#
+# Please see Documentation/ide.txt for help/info on IDE drives
+#
+# CONFIG_BLK_DEV_IDE_SATA is not set
+CONFIG_BLK_DEV_IDEDISK=y
+# CONFIG_IDEDISK_MULTI_MODE is not set
+CONFIG_BLK_DEV_IDECD=m
+CONFIG_BLK_DEV_IDETAPE=m
+CONFIG_BLK_DEV_IDEFLOPPY=m
+CONFIG_BLK_DEV_IDESCSI=m
+# CONFIG_IDE_TASK_IOCTL is not set
+
+#
+# IDE chipset support/bugfixes
+#
+CONFIG_IDE_GENERIC=y
+CONFIG_BLK_DEV_IDEPCI=y
+CONFIG_IDEPCI_SHARE_IRQ=y
+# CONFIG_BLK_DEV_OFFBOARD is not set
+CONFIG_BLK_DEV_GENERIC=y
+# CONFIG_BLK_DEV_OPTI621 is not set
+CONFIG_BLK_DEV_IDEDMA_PCI=y
+# CONFIG_BLK_DEV_IDEDMA_FORCED is not set
+# CONFIG_IDEDMA_ONLYDISK is not set
+# CONFIG_BLK_DEV_AEC62XX is not set
+# CONFIG_BLK_DEV_ALI15X3 is not set
+# CONFIG_BLK_DEV_AMD74XX is not set
+CONFIG_BLK_DEV_CMD64X=y
+# CONFIG_BLK_DEV_TRIFLEX is not set
+# CONFIG_BLK_DEV_CY82C693 is not set
+# CONFIG_BLK_DEV_CS5520 is not set
+# CONFIG_BLK_DEV_CS5530 is not set
+CONFIG_BLK_DEV_HPT34X=y
+# CONFIG_HPT34X_AUTODMA is not set
+CONFIG_BLK_DEV_HPT366=y
+# CONFIG_BLK_DEV_JMICRON is not set
+# CONFIG_BLK_DEV_SC1200 is not set
+CONFIG_BLK_DEV_PIIX=y
+# CONFIG_BLK_DEV_IT821X is not set
+# CONFIG_BLK_DEV_NS87415 is not set
+CONFIG_BLK_DEV_PDC202XX_OLD=y
+# CONFIG_PDC202XX_BURST is not set
+CONFIG_BLK_DEV_PDC202XX_NEW=y
+# CONFIG_BLK_DEV_SVWKS is not set
+CONFIG_BLK_DEV_SIIMAGE=y
+# CONFIG_BLK_DEV_SLC90E66 is not set
+# CONFIG_BLK_DEV_TRM290 is not set
+# CONFIG_BLK_DEV_VIA82CXXX is not set
+# CONFIG_IDE_ARM is not set
+CONFIG_BLK_DEV_IDEDMA=y
+# CONFIG_IDEDMA_IVB is not set
+# CONFIG_BLK_DEV_HD is not set
+
+#
+# SCSI device support
+#
+CONFIG_RAID_ATTRS=m
+CONFIG_SCSI=y
+CONFIG_SCSI_TGT=m
+CONFIG_SCSI_NETLINK=y
+CONFIG_SCSI_PROC_FS=y
+
+#
+# SCSI support type (disk, tape, CD-ROM)
+#
+CONFIG_BLK_DEV_SD=m
+CONFIG_CHR_DEV_ST=m
+CONFIG_CHR_DEV_OSST=m
+CONFIG_BLK_DEV_SR=m
+CONFIG_BLK_DEV_SR_VENDOR=y
+CONFIG_CHR_DEV_SG=m
+CONFIG_CHR_DEV_SCH=m
+
+#
+# Some SCSI devices (e.g. CD jukebox) support multiple LUNs
+#
+CONFIG_SCSI_MULTI_LUN=y
+CONFIG_SCSI_CONSTANTS=y
+CONFIG_SCSI_LOGGING=y
+CONFIG_SCSI_SCAN_ASYNC=y
+
+#
+# SCSI Transports
+#
+CONFIG_SCSI_SPI_ATTRS=m
+CONFIG_SCSI_FC_ATTRS=m
+CONFIG_SCSI_ISCSI_ATTRS=m
+CONFIG_SCSI_SAS_ATTRS=m
+CONFIG_SCSI_SAS_LIBSAS=m
+# CONFIG_SCSI_SAS_LIBSAS_DEBUG is not set
+
+#
+# SCSI low-level drivers
+#
+CONFIG_ISCSI_TCP=m
+CONFIG_BLK_DEV_3W_XXXX_RAID=m
+CONFIG_SCSI_3W_9XXX=m
+CONFIG_SCSI_ACARD=m
+CONFIG_SCSI_AACRAID=m
+CONFIG_SCSI_AIC7XXX=m
+CONFIG_AIC7XXX_CMDS_PER_DEVICE=8
+CONFIG_AIC7XXX_RESET_DELAY_MS=15000
+CONFIG_AIC7XXX_DEBUG_ENABLE=y
+CONFIG_AIC7XXX_DEBUG_MASK=0
+CONFIG_AIC7XXX_REG_PRETTY_PRINT=y
+CONFIG_SCSI_AIC7XXX_OLD=m
+CONFIG_SCSI_AIC79XX=m
+CONFIG_AIC79XX_CMDS_PER_DEVICE=32
+CONFIG_AIC79XX_RESET_DELAY_MS=15000
+CONFIG_AIC79XX_DEBUG_ENABLE=y
+CONFIG_AIC79XX_DEBUG_MASK=0
+CONFIG_AIC79XX_REG_PRETTY_PRINT=y
+CONFIG_SCSI_AIC94XX=m
+# CONFIG_AIC94XX_DEBUG is not set
+CONFIG_SCSI_DPT_I2O=m
+CONFIG_SCSI_ARCMSR=m
+CONFIG_MEGARAID_NEWGEN=y
+CONFIG_MEGARAID_MM=m
+CONFIG_MEGARAID_MAILBOX=m
+CONFIG_MEGARAID_LEGACY=m
+CONFIG_MEGARAID_SAS=m
+CONFIG_SCSI_HPTIOP=m
+CONFIG_SCSI_DMX3191D=m
+CONFIG_SCSI_FUTURE_DOMAIN=m
+CONFIG_SCSI_IPS=m
+CONFIG_SCSI_INITIO=m
+CONFIG_SCSI_INIA100=m
+CONFIG_SCSI_PPA=m
+CONFIG_SCSI_IMM=m
+# CONFIG_SCSI_IZIP_EPP16 is not set
+# CONFIG_SCSI_IZIP_SLOW_CTR is not set
+CONFIG_SCSI_STEX=m
+CONFIG_SCSI_SYM53C8XX_2=m
+CONFIG_SCSI_SYM53C8XX_DMA_ADDRESSING_MODE=1
+CONFIG_SCSI_SYM53C8XX_DEFAULT_TAGS=16
+CONFIG_SCSI_SYM53C8XX_MAX_TAGS=64
+CONFIG_SCSI_SYM53C8XX_MMIO=y
+# CONFIG_SCSI_IPR is not set
+CONFIG_SCSI_QLOGIC_1280=m
+CONFIG_SCSI_QLA_FC=m
+CONFIG_SCSI_QLA_ISCSI=m
+CONFIG_SCSI_LPFC=m
+CONFIG_SCSI_DC395x=m
+CONFIG_SCSI_DC390T=m
+CONFIG_SCSI_NSP32=m
+CONFIG_SCSI_DEBUG=m
+CONFIG_SCSI_SRP=m
+
+#
+# Serial ATA (prod) and Parallel ATA (experimental) drivers
+#
+CONFIG_ATA=y
+# CONFIG_ATA_NONSTANDARD is not set
+CONFIG_SATA_AHCI=y
+# CONFIG_SATA_SVW is not set
+# CONFIG_ATA_PIIX is not set
+CONFIG_SATA_MV=y
+# CONFIG_SATA_NV is not set
+# CONFIG_PDC_ADMA is not set
+# CONFIG_SATA_QSTOR is not set
+CONFIG_SATA_PROMISE=y
+CONFIG_SATA_SX4=y
+CONFIG_SATA_SIL=y
+CONFIG_SATA_SIL24=y
+# CONFIG_SATA_SIS is not set
+# CONFIG_SATA_ULI is not set
+# CONFIG_SATA_VIA is not set
+# CONFIG_SATA_VITESSE is not set
+# CONFIG_ATA_GENERIC is not set
+
+#
+# Multi-device support (RAID and LVM)
+#
+CONFIG_MD=y
+CONFIG_BLK_DEV_MD=m
+CONFIG_MD_LINEAR=m
+CONFIG_MD_RAID0=m
+CONFIG_MD_RAID1=m
+CONFIG_MD_RAID10=m
+CONFIG_MD_RAID456=m
+CONFIG_MD_RAID5_RESHAPE=y
+CONFIG_MD_MULTIPATH=m
+CONFIG_MD_FAULTY=m
+CONFIG_BLK_DEV_DM=m
+# CONFIG_DM_DEBUG is not set
+CONFIG_DM_CRYPT=m
+CONFIG_DM_SNAPSHOT=m
+CONFIG_DM_MIRROR=m
+CONFIG_DM_ZERO=m
+CONFIG_DM_MULTIPATH=m
+
+#
+# I2O device support
+#
+CONFIG_I2O=m
+CONFIG_I2O_LCT_NOTIFY_ON_CHANGES=y
+CONFIG_I2O_EXT_ADAPTEC=y
+CONFIG_I2O_CONFIG=m
+CONFIG_I2O_CONFIG_OLD_IOCTL=y
+CONFIG_I2O_BUS=m
+CONFIG_I2O_BLOCK=m
+CONFIG_I2O_SCSI=m
+CONFIG_I2O_PROC=m
+
+#
+# Network device support
+#
+CONFIG_NETDEVICES=y
+CONFIG_IFB=m
+CONFIG_DUMMY=m
+CONFIG_BONDING=m
+CONFIG_EQUALIZER=m
+CONFIG_TUN=m
+
+#
+# ARCnet devices
+#
+CONFIG_ARCNET=m
+CONFIG_ARCNET_1201=m
+CONFIG_ARCNET_1051=m
+CONFIG_ARCNET_RAW=m
+CONFIG_ARCNET_CAP=m
+CONFIG_ARCNET_COM90xx=m
+CONFIG_ARCNET_COM90xxIO=m
+CONFIG_ARCNET_RIM_I=m
+CONFIG_ARCNET_COM20020=m
+CONFIG_ARCNET_COM20020_PCI=m
+
+#
+# PHY device support
+#
+CONFIG_PHYLIB=m
+
+#
+# MII PHY device drivers
+#
+CONFIG_MARVELL_PHY=m
+CONFIG_DAVICOM_PHY=m
+# CONFIG_QSEMI_PHY is not set
+CONFIG_LXT_PHY=m
+# CONFIG_CICADA_PHY is not set
+# CONFIG_VITESSE_PHY is not set
+CONFIG_SMSC_PHY=m
+CONFIG_BROADCOM_PHY=m
+CONFIG_FIXED_PHY=m
+# CONFIG_FIXED_MII_10_FDX is not set
+# CONFIG_FIXED_MII_100_FDX is not set
+
+#
+# Ethernet (10 or 100Mbit)
+#
+CONFIG_NET_ETHERNET=y
+CONFIG_MII=y
+# CONFIG_HAPPYMEAL is not set
+# CONFIG_SUNGEM is not set
+# CONFIG_CASSINI is not set
+CONFIG_NET_VENDOR_3COM=y
+CONFIG_VORTEX=m
+CONFIG_TYPHOON=m
+# CONFIG_DM9000 is not set
+
+#
+# Tulip family network device support
+#
+CONFIG_NET_TULIP=y
+CONFIG_DE2104X=m
+CONFIG_TULIP=m
+# CONFIG_TULIP_MWI is not set
+# CONFIG_TULIP_MMIO is not set
+# CONFIG_TULIP_NAPI is not set
+CONFIG_DE4X5=m
+# CONFIG_WINBOND_840 is not set
+CONFIG_DM9102=m
+# CONFIG_ULI526X is not set
+# CONFIG_HP100 is not set
+CONFIG_NET_PCI=y
+CONFIG_PCNET32=y
+CONFIG_PCNET32_NAPI=y
+CONFIG_AMD8111_ETH=m
+CONFIG_AMD8111E_NAPI=y
+CONFIG_ADAPTEC_STARFIRE=m
+CONFIG_ADAPTEC_STARFIRE_NAPI=y
+CONFIG_B44=m
+# CONFIG_FORCEDETH is not set
+CONFIG_EEPRO100=m
+CONFIG_E100=m
+CONFIG_FEALNX=m
+CONFIG_NATSEMI=m
+CONFIG_NE2K_PCI=m
+CONFIG_8139CP=m
+CONFIG_8139TOO=m
+# CONFIG_8139TOO_PIO is not set
+CONFIG_8139TOO_TUNE_TWISTER=y
+CONFIG_8139TOO_8129=y
+# CONFIG_8139_OLD_RX_RESET is not set
+CONFIG_SIS900=m
+CONFIG_EPIC100=m
+CONFIG_SUNDANCE=m
+# CONFIG_SUNDANCE_MMIO is not set
+CONFIG_TLAN=m
+CONFIG_VIA_RHINE=m
+# CONFIG_VIA_RHINE_MMIO is not set
+CONFIG_VIA_RHINE_NAPI=y
+CONFIG_NET_POCKET=y
+CONFIG_DE600=m
+CONFIG_DE620=m
+
+#
+# Ethernet (1000 Mbit)
+#
+CONFIG_ACENIC=m
+# CONFIG_ACENIC_OMIT_TIGON_I is not set
+CONFIG_DL2K=m
+CONFIG_E1000=m
+CONFIG_E1000_NAPI=y
+# CONFIG_E1000_DISABLE_PACKET_SPLIT is not set
+CONFIG_NS83820=m
+CONFIG_HAMACHI=m
+CONFIG_YELLOWFIN=m
+CONFIG_R8169=m
+CONFIG_R8169_NAPI=y
+CONFIG_R8169_VLAN=y
+CONFIG_SIS190=m
+CONFIG_SKGE=m
+CONFIG_SKY2=m
+CONFIG_VIA_VELOCITY=m
+CONFIG_TIGON3=m
+CONFIG_BNX2=m
+CONFIG_QLA3XXX=m
+
+#
+# Ethernet (10000 Mbit)
+#
+CONFIG_CHELSIO_T1=m
+CONFIG_CHELSIO_T1_1G=y
+CONFIG_CHELSIO_T1_NAPI=y
+CONFIG_IXGB=m
+CONFIG_IXGB_NAPI=y
+CONFIG_S2IO=m
+CONFIG_S2IO_NAPI=y
+CONFIG_MYRI10GE=m
+CONFIG_NETXEN_NIC=m
+
+#
+# Wireless LAN (non-hamradio)
+#
+CONFIG_WLAN_PRE80211=y
+CONFIG_STRIP=m
+CONFIG_WLAN_80211=y
+
+#
+# Wireless 802.11b ISA/PCI cards support
+#
+CONFIG_IPW2100=m
+CONFIG_IPW2100_MONITOR=y
+# CONFIG_IPW2100_DEBUG is not set
+CONFIG_IPW2200=m
+# CONFIG_IPW2200_MONITOR is not set
+CONFIG_IPW2200_QOS=y
+# CONFIG_IPW2200_DEBUG is not set
+CONFIG_HERMES=m
+CONFIG_PLX_HERMES=m
+CONFIG_TMD_HERMES=m
+CONFIG_NORTEL_HERMES=m
+CONFIG_PCI_HERMES=m
+CONFIG_ATMEL=m
+CONFIG_PCI_ATMEL=m
+
+#
+# Prism GT/Duette 802.11(a/b/g) PCI/Cardbus support
+#
+CONFIG_PRISM54=m
+CONFIG_USB_ZD1201=m
+CONFIG_HOSTAP=m
+CONFIG_HOSTAP_FIRMWARE=y
+# CONFIG_HOSTAP_FIRMWARE_NVRAM is not set
+CONFIG_HOSTAP_PLX=m
+CONFIG_HOSTAP_PCI=m
+CONFIG_BCM43XX=m
+CONFIG_BCM43XX_DEBUG=y
+CONFIG_BCM43XX_DMA=y
+CONFIG_BCM43XX_PIO=y
+CONFIG_BCM43XX_DMA_AND_PIO_MODE=y
+# CONFIG_BCM43XX_DMA_MODE is not set
+# CONFIG_BCM43XX_PIO_MODE is not set
+CONFIG_ZD1211RW=m
+# CONFIG_ZD1211RW_DEBUG is not set
+
+#
+# Wan interfaces
+#
+CONFIG_WAN=y
+CONFIG_LANMEDIA=m
+CONFIG_PCI200SYN=m
+CONFIG_WANXL=m
+CONFIG_PC300=m
+# CONFIG_PC300_MLPPP is not set
+
+#
+# Cyclades-PC300 MLPPP support is disabled.
+#
+
+#
+# Refer to the file README.mlppp, provided by PC300 package.
+#
+CONFIG_FARSYNC=m
+CONFIG_DSCC4=m
+# CONFIG_DSCC4_PCISYNC is not set
+# CONFIG_DSCC4_PCI_RST is not set
+CONFIG_DLCI=m
+CONFIG_DLCI_MAX=8
+CONFIG_WAN_ROUTER_DRIVERS=m
+CONFIG_CYCLADES_SYNC=m
+CONFIG_CYCLOMX_X25=y
+CONFIG_LAPBETHER=m
+CONFIG_X25_ASY=m
+
+#
+# ATM drivers
+#
+CONFIG_ATM_DRIVERS=y
+CONFIG_ATM_DUMMY=m
+CONFIG_ATM_TCP=m
+CONFIG_ATM_LANAI=m
+CONFIG_ATM_ENI=m
+# CONFIG_ATM_ENI_DEBUG is not set
+# CONFIG_ATM_ENI_TUNE_BURST is not set
+CONFIG_ATM_FIRESTREAM=m
+CONFIG_ATM_ZATM=m
+# CONFIG_ATM_ZATM_DEBUG is not set
+CONFIG_ATM_NICSTAR=m
+# CONFIG_ATM_NICSTAR_USE_SUNI is not set
+# CONFIG_ATM_NICSTAR_USE_IDT77105 is not set
+CONFIG_ATM_IDT77252=m
+# CONFIG_ATM_IDT77252_DEBUG is not set
+# CONFIG_ATM_IDT77252_RCV_ALL is not set
+CONFIG_ATM_IDT77252_USE_SUNI=y
+CONFIG_ATM_AMBASSADOR=m
+# CONFIG_ATM_AMBASSADOR_DEBUG is not set
+CONFIG_ATM_HORIZON=m
+# CONFIG_ATM_HORIZON_DEBUG is not set
+CONFIG_ATM_IA=m
+# CONFIG_ATM_IA_DEBUG is not set
+CONFIG_ATM_FORE200E_MAYBE=m
+CONFIG_ATM_FORE200E_PCA=y
+CONFIG_ATM_FORE200E_PCA_DEFAULT_FW=y
+# CONFIG_ATM_FORE200E_USE_TASKLET is not set
+CONFIG_ATM_FORE200E_TX_RETRY=16
+CONFIG_ATM_FORE200E_DEBUG=0
+CONFIG_ATM_FORE200E=m
+CONFIG_ATM_HE=m
+CONFIG_ATM_HE_USE_SUNI=y
+CONFIG_FDDI=y
+CONFIG_DEFXX=m
+CONFIG_SKFP=m
+CONFIG_HIPPI=y
+CONFIG_ROADRUNNER=m
+# CONFIG_ROADRUNNER_LARGE_RINGS is not set
+CONFIG_PLIP=m
+CONFIG_PPP=m
+CONFIG_PPP_MULTILINK=y
+CONFIG_PPP_FILTER=y
+CONFIG_PPP_ASYNC=m
+CONFIG_PPP_SYNC_TTY=m
+CONFIG_PPP_DEFLATE=m
+CONFIG_PPP_BSDCOMP=m
+CONFIG_PPP_MPPE=m
+CONFIG_PPPOE=m
+CONFIG_PPPOATM=m
+CONFIG_SLIP=m
+CONFIG_SLIP_COMPRESSED=y
+CONFIG_SLHC=m
+CONFIG_SLIP_SMART=y
+# CONFIG_SLIP_MODE_SLIP6 is not set
+CONFIG_NET_FC=y
+CONFIG_SHAPER=m
+CONFIG_NETCONSOLE=m
+CONFIG_NETPOLL=y
+# CONFIG_NETPOLL_TRAP is not set
+CONFIG_NET_POLL_CONTROLLER=y
+
+#
+# ISDN subsystem
+#
+CONFIG_ISDN=m
+
+#
+# Old ISDN4Linux
+#
+CONFIG_ISDN_I4L=m
+CONFIG_ISDN_PPP=y
+CONFIG_ISDN_PPP_VJ=y
+CONFIG_ISDN_MPP=y
+CONFIG_IPPP_FILTER=y
+CONFIG_ISDN_PPP_BSDCOMP=m
+CONFIG_ISDN_AUDIO=y
+CONFIG_ISDN_TTY_FAX=y
+CONFIG_ISDN_X25=y
+
+#
+# ISDN feature submodules
+#
+CONFIG_ISDN_DRV_LOOP=m
+CONFIG_ISDN_DIVERSION=m
+
+#
+# ISDN4Linux hardware drivers
+#
+
+#
+# Passive cards
+#
+CONFIG_ISDN_DRV_HISAX=m
+
+#
+# D-channel protocol features
+#
+CONFIG_HISAX_EURO=y
+CONFIG_DE_AOC=y
+# CONFIG_HISAX_NO_SENDCOMPLETE is not set
+# CONFIG_HISAX_NO_LLC is not set
+# CONFIG_HISAX_NO_KEYPAD is not set
+CONFIG_HISAX_1TR6=y
+CONFIG_HISAX_NI1=y
+CONFIG_HISAX_MAX_CARDS=8
+
+#
+# HiSax supported cards
+#
+CONFIG_HISAX_16_3=y
+CONFIG_HISAX_S0BOX=y
+CONFIG_HISAX_FRITZPCI=y
+CONFIG_HISAX_AVM_A1_PCMCIA=y
+CONFIG_HISAX_ELSA=y
+CONFIG_HISAX_DIEHLDIVA=y
+CONFIG_HISAX_SEDLBAUER=y
+CONFIG_HISAX_NICCY=y
+CONFIG_HISAX_BKM_A4T=y
+CONFIG_HISAX_SCT_QUADRO=y
+CONFIG_HISAX_GAZEL=y
+CONFIG_HISAX_W6692=y
+CONFIG_HISAX_HFC_SX=y
+# CONFIG_HISAX_DEBUG is not set
+
+#
+# HiSax PCMCIA card service modules
+#
+
+#
+# HiSax sub driver modules
+#
+CONFIG_HISAX_ST5481=m
+CONFIG_HISAX_HFCUSB=m
+CONFIG_HISAX_HFC4S8S=m
+CONFIG_HISAX_FRITZ_PCIPNP=m
+CONFIG_HISAX_HDLC=y
+
+#
+# Active cards
+#
+CONFIG_HYSDN=m
+# CONFIG_HYSDN_CAPI is not set
+
+#
+# Siemens Gigaset
+#
+CONFIG_ISDN_DRV_GIGASET=m
+CONFIG_GIGASET_BASE=m
+CONFIG_GIGASET_M105=m
+# CONFIG_GIGASET_DEBUG is not set
+# CONFIG_GIGASET_UNDOCREQ is not set
+
+#
+# CAPI subsystem
+#
+CONFIG_ISDN_CAPI=m
+CONFIG_ISDN_DRV_AVMB1_VERBOSE_REASON=y
+CONFIG_ISDN_CAPI_MIDDLEWARE=y
+CONFIG_ISDN_CAPI_CAPI20=m
+CONFIG_ISDN_CAPI_CAPIFS_BOOL=y
+CONFIG_ISDN_CAPI_CAPIFS=m
+CONFIG_ISDN_CAPI_CAPIDRV=m
+
+#
+# CAPI hardware drivers
+#
+
+#
+# Active AVM cards
+#
+CONFIG_CAPI_AVM=y
+CONFIG_ISDN_DRV_AVMB1_B1PCI=m
+CONFIG_ISDN_DRV_AVMB1_B1PCIV4=y
+CONFIG_ISDN_DRV_AVMB1_B1PCMCIA=m
+CONFIG_ISDN_DRV_AVMB1_T1PCI=m
+CONFIG_ISDN_DRV_AVMB1_C4=m
+
+#
+# Active Eicon DIVA Server cards
+#
+CONFIG_CAPI_EICON=y
+CONFIG_ISDN_DIVAS=m
+CONFIG_ISDN_DIVAS_BRIPCI=y
+CONFIG_ISDN_DIVAS_PRIPCI=y
+CONFIG_ISDN_DIVAS_DIVACAPI=m
+CONFIG_ISDN_DIVAS_USERIDI=m
+CONFIG_ISDN_DIVAS_MAINT=m
+
+#
+# Telephony Support
+#
+CONFIG_PHONE=m
+CONFIG_PHONE_IXJ=m
+
+#
+# Input device support
+#
+CONFIG_INPUT=y
+CONFIG_INPUT_FF_MEMLESS=m
+
+#
+# Userland interfaces
+#
+CONFIG_INPUT_MOUSEDEV=y
+CONFIG_INPUT_MOUSEDEV_PSAUX=y
+CONFIG_INPUT_MOUSEDEV_SCREEN_X=1024
+CONFIG_INPUT_MOUSEDEV_SCREEN_Y=768
+CONFIG_INPUT_JOYDEV=m
+CONFIG_INPUT_TSDEV=m
+CONFIG_INPUT_TSDEV_SCREEN_X=240
+CONFIG_INPUT_TSDEV_SCREEN_Y=320
+CONFIG_INPUT_EVDEV=m
+# CONFIG_INPUT_EVBUG is not set
+
+#
+# Input Device Drivers
+#
+CONFIG_INPUT_KEYBOARD=y
+CONFIG_KEYBOARD_ATKBD=y
+CONFIG_KEYBOARD_SUNKBD=m
+CONFIG_KEYBOARD_LKKBD=m
+CONFIG_KEYBOARD_XTKBD=m
+CONFIG_KEYBOARD_NEWTON=m
+CONFIG_KEYBOARD_STOWAWAY=m
+CONFIG_INPUT_MOUSE=y
+CONFIG_MOUSE_PS2=m
+CONFIG_MOUSE_SERIAL=m
+CONFIG_MOUSE_APPLETOUCH=m
+CONFIG_MOUSE_VSXXXAA=m
+CONFIG_INPUT_JOYSTICK=y
+CONFIG_JOYSTICK_ANALOG=m
+CONFIG_JOYSTICK_A3D=m
+CONFIG_JOYSTICK_ADI=m
+CONFIG_JOYSTICK_COBRA=m
+CONFIG_JOYSTICK_GF2K=m
+CONFIG_JOYSTICK_GRIP=m
+CONFIG_JOYSTICK_GRIP_MP=m
+CONFIG_JOYSTICK_GUILLEMOT=m
+CONFIG_JOYSTICK_INTERACT=m
+CONFIG_JOYSTICK_SIDEWINDER=m
+CONFIG_JOYSTICK_TMDC=m
+CONFIG_JOYSTICK_IFORCE=m
+CONFIG_JOYSTICK_IFORCE_USB=y
+CONFIG_JOYSTICK_IFORCE_232=y
+CONFIG_JOYSTICK_WARRIOR=m
+CONFIG_JOYSTICK_MAGELLAN=m
+CONFIG_JOYSTICK_SPACEORB=m
+CONFIG_JOYSTICK_SPACEBALL=m
+CONFIG_JOYSTICK_STINGER=m
+CONFIG_JOYSTICK_TWIDJOY=m
+CONFIG_JOYSTICK_DB9=m
+CONFIG_JOYSTICK_GAMECON=m
+CONFIG_JOYSTICK_TURBOGRAFX=m
+CONFIG_JOYSTICK_JOYDUMP=m
+CONFIG_JOYSTICK_XPAD=m
+CONFIG_INPUT_TABLET=y
+CONFIG_TABLET_USB_ACECAD=m
+CONFIG_TABLET_USB_AIPTEK=m
+CONFIG_TABLET_USB_GTCO=m
+CONFIG_TABLET_USB_KBTAB=m
+CONFIG_TABLET_USB_WACOM=m
+CONFIG_INPUT_TOUCHSCREEN=y
+CONFIG_TOUCHSCREEN_ADS7846=m
+CONFIG_TOUCHSCREEN_GUNZE=m
+CONFIG_TOUCHSCREEN_ELO=m
+CONFIG_TOUCHSCREEN_MTOUCH=m
+CONFIG_TOUCHSCREEN_MK712=m
+CONFIG_TOUCHSCREEN_PENMOUNT=m
+CONFIG_TOUCHSCREEN_TOUCHRIGHT=m
+CONFIG_TOUCHSCREEN_TOUCHWIN=m
+CONFIG_TOUCHSCREEN_UCB1400=m
+CONFIG_TOUCHSCREEN_USB_COMPOSITE=m
+# CONFIG_INPUT_MISC is not set
+
+#
+# Hardware I/O ports
+#
+CONFIG_SERIO=y
+CONFIG_SERIO_I8042=y
+CONFIG_SERIO_SERPORT=m
+CONFIG_SERIO_PARKBD=m
+CONFIG_SERIO_PCIPS2=y
+CONFIG_SERIO_LIBPS2=y
+CONFIG_SERIO_RAW=m
+CONFIG_GAMEPORT=m
+# CONFIG_GAMEPORT_NS558 is not set
+# CONFIG_GAMEPORT_L4 is not set
+CONFIG_GAMEPORT_EMU10K1=m
+CONFIG_GAMEPORT_FM801=m
+
+#
+# Character devices
+#
+CONFIG_VT=y
+CONFIG_VT_CONSOLE=y
+CONFIG_HW_CONSOLE=y
+# CONFIG_VT_HW_CONSOLE_BINDING is not set
+# CONFIG_SERIAL_NONSTANDARD is not set
+
+#
+# Serial drivers
+#
+CONFIG_SERIAL_8250=y
+CONFIG_SERIAL_8250_CONSOLE=y
+CONFIG_SERIAL_8250_PCI=y
+CONFIG_SERIAL_8250_NR_UARTS=4
+CONFIG_SERIAL_8250_RUNTIME_UARTS=4
+CONFIG_SERIAL_8250_EXTENDED=y
+# CONFIG_SERIAL_8250_MANY_PORTS is not set
+CONFIG_SERIAL_8250_SHARE_IRQ=y
+# CONFIG_SERIAL_8250_DETECT_IRQ is not set
+CONFIG_SERIAL_8250_RSA=y
+
+#
+# Non-8250 serial port support
+#
+CONFIG_SERIAL_CORE=y
+CONFIG_SERIAL_CORE_CONSOLE=y
+CONFIG_SERIAL_JSM=m
+CONFIG_UNIX98_PTYS=y
+# CONFIG_LEGACY_PTYS is not set
+CONFIG_PRINTER=m
+# CONFIG_LP_CONSOLE is not set
+CONFIG_PPDEV=m
+CONFIG_TIPAR=m
+
+#
+# IPMI
+#
+CONFIG_IPMI_HANDLER=m
+# CONFIG_IPMI_PANIC_EVENT is not set
+# CONFIG_IPMI_DEVICE_INTERFACE is not set
+CONFIG_IPMI_SI=m
+CONFIG_IPMI_WATCHDOG=m
+CONFIG_IPMI_POWEROFF=m
+
+#
+# Watchdog Cards
+#
+CONFIG_WATCHDOG=y
+# CONFIG_WATCHDOG_NOWAYOUT is not set
+
+#
+# Watchdog Device Drivers
+#
+CONFIG_SOFT_WATCHDOG=m
+
+#
+# PCI-based Watchdog Cards
+#
+CONFIG_PCIPCWATCHDOG=m
+CONFIG_WDTPCI=m
+CONFIG_WDT_501_PCI=y
+
+#
+# USB-based Watchdog Cards
+#
+CONFIG_USBPCWATCHDOG=m
+CONFIG_HW_RANDOM=m
+CONFIG_RTC=y
+CONFIG_DTLK=m
+CONFIG_R3964=m
+CONFIG_APPLICOM=m
+CONFIG_DRM=m
+CONFIG_DRM_TDFX=m
+CONFIG_DRM_R128=m
+CONFIG_DRM_RADEON=m
+CONFIG_DRM_MGA=m
+CONFIG_DRM_VIA=m
+CONFIG_DRM_SAVAGE=m
+# CONFIG_RAW_DRIVER is not set
+
+#
+# TPM devices
+#
+# CONFIG_TCG_TPM is not set
+
+#
+# I2C support
+#
+CONFIG_I2C=m
+CONFIG_I2C_CHARDEV=m
+
+#
+# I2C Algorithms
+#
+CONFIG_I2C_ALGOBIT=m
+# CONFIG_I2C_ALGOPCF is not set
+# CONFIG_I2C_ALGOPCA is not set
+
+#
+# I2C Hardware Bus support
+#
+# CONFIG_I2C_ALI1535 is not set
+# CONFIG_I2C_ALI1563 is not set
+# CONFIG_I2C_ALI15X3 is not set
+# CONFIG_I2C_AMD756 is not set
+# CONFIG_I2C_AMD8111 is not set
+# CONFIG_I2C_I801 is not set
+# CONFIG_I2C_I810 is not set
+CONFIG_I2C_PIIX4=m
+# CONFIG_I2C_NFORCE2 is not set
+# CONFIG_I2C_OCORES is not set
+CONFIG_I2C_PARPORT=m
+CONFIG_I2C_PARPORT_LIGHT=m
+# CONFIG_I2C_PROSAVAGE is not set
+# CONFIG_I2C_SAVAGE4 is not set
+# CONFIG_I2C_SIS5595 is not set
+# CONFIG_I2C_SIS630 is not set
+# CONFIG_I2C_SIS96X is not set
+# CONFIG_I2C_STUB is not set
+# CONFIG_I2C_VIA is not set
+# CONFIG_I2C_VIAPRO is not set
+CONFIG_I2C_VOODOO3=m
+# CONFIG_I2C_PCA_ISA is not set
+
+#
+# Miscellaneous I2C Chip support
+#
+CONFIG_SENSORS_DS1337=m
+CONFIG_SENSORS_DS1374=m
+CONFIG_SENSORS_EEPROM=m
+CONFIG_SENSORS_PCF8574=m
+CONFIG_SENSORS_PCA9539=m
+CONFIG_SENSORS_PCF8591=m
+CONFIG_SENSORS_MAX6875=m
+# CONFIG_I2C_DEBUG_CORE is not set
+# CONFIG_I2C_DEBUG_ALGO is not set
+# CONFIG_I2C_DEBUG_BUS is not set
+# CONFIG_I2C_DEBUG_CHIP is not set
+
+#
+# SPI support
+#
+CONFIG_SPI=y
+CONFIG_SPI_MASTER=y
+
+#
+# SPI Master Controller Drivers
+#
+CONFIG_SPI_BITBANG=m
+CONFIG_SPI_BUTTERFLY=m
+
+#
+# SPI Protocol Masters
+#
+
+#
+# Hardware Monitoring support
+#
+CONFIG_HWMON=y
+CONFIG_HWMON_VID=m
+# CONFIG_SENSORS_ABITUGURU is not set
+CONFIG_SENSORS_ADM1021=m
+CONFIG_SENSORS_ADM1025=m
+CONFIG_SENSORS_ADM1026=m
+CONFIG_SENSORS_ADM1031=m
+CONFIG_SENSORS_ADM9240=m
+# CONFIG_SENSORS_ASB100 is not set
+# CONFIG_SENSORS_ATXP1 is not set
+CONFIG_SENSORS_DS1621=m
+# CONFIG_SENSORS_F71805F is not set
+# CONFIG_SENSORS_FSCHER is not set
+# CONFIG_SENSORS_FSCPOS is not set
+# CONFIG_SENSORS_GL518SM is not set
+# CONFIG_SENSORS_GL520SM is not set
+# CONFIG_SENSORS_IT87 is not set
+CONFIG_SENSORS_LM63=m
+CONFIG_SENSORS_LM70=m
+CONFIG_SENSORS_LM75=m
+CONFIG_SENSORS_LM77=m
+CONFIG_SENSORS_LM78=m
+CONFIG_SENSORS_LM80=m
+CONFIG_SENSORS_LM83=m
+CONFIG_SENSORS_LM85=m
+CONFIG_SENSORS_LM87=m
+CONFIG_SENSORS_LM90=m
+CONFIG_SENSORS_LM92=m
+CONFIG_SENSORS_MAX1619=m
+# CONFIG_SENSORS_PC87360 is not set
+# CONFIG_SENSORS_PC87427 is not set
+# CONFIG_SENSORS_SIS5595 is not set
+# CONFIG_SENSORS_SMSC47M1 is not set
+# CONFIG_SENSORS_SMSC47M192 is not set
+# CONFIG_SENSORS_SMSC47B397 is not set
+# CONFIG_SENSORS_VIA686A is not set
+# CONFIG_SENSORS_VT1211 is not set
+# CONFIG_SENSORS_VT8231 is not set
+# CONFIG_SENSORS_W83781D is not set
+# CONFIG_SENSORS_W83791D is not set
+# CONFIG_SENSORS_W83792D is not set
+# CONFIG_SENSORS_W83793 is not set
+# CONFIG_SENSORS_W83L785TS is not set
+# CONFIG_SENSORS_W83627HF is not set
+# CONFIG_SENSORS_W83627EHF is not set
+# CONFIG_HWMON_DEBUG_CHIP is not set
+
+#
+# Multimedia devices
+#
+CONFIG_VIDEO_DEV=m
+CONFIG_VIDEO_V4L1=y
+CONFIG_VIDEO_V4L1_COMPAT=y
+CONFIG_VIDEO_V4L2=y
+
+#
+# Video Capture Adapters
+#
+
+#
+# Video Capture Adapters
+#
+# CONFIG_VIDEO_ADV_DEBUG is not set
+CONFIG_VIDEO_HELPER_CHIPS_AUTO=y
+CONFIG_VIDEO_TVAUDIO=m
+CONFIG_VIDEO_TDA7432=m
+CONFIG_VIDEO_TDA9840=m
+CONFIG_VIDEO_TDA9875=m
+CONFIG_VIDEO_TEA6415C=m
+CONFIG_VIDEO_TEA6420=m
+CONFIG_VIDEO_MSP3400=m
+CONFIG_VIDEO_WM8775=m
+CONFIG_VIDEO_BT819=m
+CONFIG_VIDEO_BT856=m
+CONFIG_VIDEO_KS0127=m
+CONFIG_VIDEO_OV7670=m
+CONFIG_VIDEO_SAA7110=m
+CONFIG_VIDEO_SAA7111=m
+CONFIG_VIDEO_SAA7114=m
+CONFIG_VIDEO_SAA711X=m
+CONFIG_VIDEO_TVP5150=m
+CONFIG_VIDEO_VPX3220=m
+CONFIG_VIDEO_CX25840=m
+CONFIG_VIDEO_CX2341X=m
+CONFIG_VIDEO_SAA7185=m
+CONFIG_VIDEO_ADV7170=m
+CONFIG_VIDEO_ADV7175=m
+CONFIG_VIDEO_VIVI=m
+CONFIG_VIDEO_BT848=m
+CONFIG_VIDEO_BT848_DVB=y
+CONFIG_VIDEO_SAA6588=m
+CONFIG_VIDEO_BWQCAM=m
+CONFIG_VIDEO_CQCAM=m
+CONFIG_VIDEO_W9966=m
+CONFIG_VIDEO_CPIA=m
+CONFIG_VIDEO_CPIA_PP=m
+CONFIG_VIDEO_CPIA_USB=m
+CONFIG_VIDEO_CPIA2=m
+CONFIG_VIDEO_SAA5246A=m
+CONFIG_VIDEO_SAA5249=m
+CONFIG_TUNER_3036=m
+CONFIG_VIDEO_STRADIS=m
+CONFIG_VIDEO_ZORAN_ZR36060=m
+CONFIG_VIDEO_ZORAN=m
+CONFIG_VIDEO_ZORAN_BUZ=m
+CONFIG_VIDEO_ZORAN_DC10=m
+CONFIG_VIDEO_ZORAN_DC30=m
+CONFIG_VIDEO_ZORAN_LML33=m
+CONFIG_VIDEO_ZORAN_LML33R10=m
+CONFIG_VIDEO_ZORAN_AVS6EYES=m
+CONFIG_VIDEO_SAA7134=m
+CONFIG_VIDEO_SAA7134_ALSA=m
+CONFIG_VIDEO_SAA7134_OSS=m
+CONFIG_VIDEO_SAA7134_DVB=m
+CONFIG_VIDEO_MXB=m
+CONFIG_VIDEO_DPC=m
+CONFIG_VIDEO_HEXIUM_ORION=m
+CONFIG_VIDEO_HEXIUM_GEMINI=m
+CONFIG_VIDEO_CX88=m
+CONFIG_VIDEO_CX88_ALSA=m
+CONFIG_VIDEO_CX88_BLACKBIRD=m
+CONFIG_VIDEO_CX88_DVB=m
+CONFIG_VIDEO_CX88_VP3054=m
+CONFIG_VIDEO_CAFE_CCIC=m
+
+#
+# V4L USB devices
+#
+CONFIG_VIDEO_PVRUSB2=m
+CONFIG_VIDEO_PVRUSB2_29XXX=y
+CONFIG_VIDEO_PVRUSB2_24XXX=y
+CONFIG_VIDEO_PVRUSB2_SYSFS=y
+# CONFIG_VIDEO_PVRUSB2_DEBUGIFC is not set
+CONFIG_VIDEO_EM28XX=m
+CONFIG_VIDEO_USBVISION=m
+CONFIG_VIDEO_USBVIDEO=m
+CONFIG_USB_VICAM=m
+CONFIG_USB_IBMCAM=m
+CONFIG_USB_KONICAWC=m
+CONFIG_USB_QUICKCAM_MESSENGER=m
+CONFIG_USB_ET61X251=m
+CONFIG_VIDEO_OVCAMCHIP=m
+CONFIG_USB_W9968CF=m
+CONFIG_USB_OV511=m
+CONFIG_USB_SE401=m
+CONFIG_USB_SN9C102=m
+CONFIG_USB_STV680=m
+CONFIG_USB_ZC0301=m
+CONFIG_USB_PWC=m
+# CONFIG_USB_PWC_DEBUG is not set
+
+#
+# Radio Adapters
+#
+CONFIG_RADIO_GEMTEK_PCI=m
+CONFIG_RADIO_MAXIRADIO=m
+CONFIG_RADIO_MAESTRO=m
+CONFIG_USB_DSBR=m
+
+#
+# Digital Video Broadcasting Devices
+#
+CONFIG_DVB_CORE=m
+CONFIG_DVB_CORE_ATTACH=y
+
+#
+# Supported DVB Frontends
+#
+
+#
+# Customise DVB Frontends
+#
+# CONFIG_DVB_FE_CUSTOMISE is not set
+
+#
+# Tuners/PLL support
+#
+CONFIG_DVB_PLL=m
+CONFIG_DVB_TDA826X=m
+CONFIG_DVB_TUNER_MT2060=m
+
+#
+# Miscellaneous devices
+#
+CONFIG_DVB_LNBP21=m
+CONFIG_DVB_ISL6421=m
+CONFIG_DVB_TUA6100=m
+CONFIG_VIDEO_SAA7146=m
+CONFIG_VIDEO_SAA7146_VV=m
+CONFIG_VIDEO_TUNER=m
+CONFIG_VIDEO_BUF=m
+CONFIG_VIDEO_BUF_DVB=m
+CONFIG_VIDEO_BTCX=m
+CONFIG_VIDEO_IR=m
+CONFIG_VIDEO_TVEEPROM=m
+
+#
+# Graphics support
+#
+CONFIG_FIRMWARE_EDID=y
+CONFIG_FB=y
+CONFIG_FB_DDC=m
+CONFIG_FB_CFB_FILLRECT=m
+CONFIG_FB_CFB_COPYAREA=m
+CONFIG_FB_CFB_IMAGEBLIT=m
+# CONFIG_FB_MACMODES is not set
+# CONFIG_FB_BACKLIGHT is not set
+CONFIG_FB_MODE_HELPERS=y
+CONFIG_FB_TILEBLITTING=y
+CONFIG_FB_CIRRUS=m
+CONFIG_FB_PM2=m
+CONFIG_FB_PM2_FIFO_DISCONNECT=y
+CONFIG_FB_CYBER2000=m
+# CONFIG_FB_ASILIANT is not set
+# CONFIG_FB_IMSTT is not set
+CONFIG_FB_S1D13XXX=m
+CONFIG_FB_NVIDIA=m
+# CONFIG_FB_NVIDIA_I2C is not set
+# CONFIG_FB_RIVA is not set
+CONFIG_FB_MATROX=m
+CONFIG_FB_MATROX_MILLENIUM=y
+CONFIG_FB_MATROX_MYSTIQUE=y
+CONFIG_FB_MATROX_G=y
+CONFIG_FB_MATROX_I2C=m
+CONFIG_FB_MATROX_MAVEN=m
+CONFIG_FB_MATROX_MULTIHEAD=y
+CONFIG_FB_RADEON=m
+CONFIG_FB_RADEON_I2C=y
+# CONFIG_FB_RADEON_DEBUG is not set
+CONFIG_FB_ATY128=m
+CONFIG_FB_ATY=m
+CONFIG_FB_ATY_CT=y
+# CONFIG_FB_ATY_GENERIC_LCD is not set
+CONFIG_FB_ATY_GX=y
+CONFIG_FB_SAVAGE=m
+# CONFIG_FB_SAVAGE_I2C is not set
+# CONFIG_FB_SAVAGE_ACCEL is not set
+CONFIG_FB_SIS=m
+CONFIG_FB_SIS_300=y
+CONFIG_FB_SIS_315=y
+CONFIG_FB_NEOMAGIC=m
+CONFIG_FB_KYRO=m
+CONFIG_FB_3DFX=m
+# CONFIG_FB_3DFX_ACCEL is not set
+CONFIG_FB_VOODOO1=m
+CONFIG_FB_TRIDENT=m
+# CONFIG_FB_TRIDENT_ACCEL is not set
+CONFIG_FB_VIRTUAL=m
+
+#
+# Console display driver support
+#
+CONFIG_VGA_CONSOLE=y
+# CONFIG_VGACON_SOFT_SCROLLBACK is not set
+CONFIG_DUMMY_CONSOLE=y
+CONFIG_FRAMEBUFFER_CONSOLE=y
+CONFIG_FRAMEBUFFER_CONSOLE_ROTATION=y
+# CONFIG_FONTS is not set
+CONFIG_FONT_8x8=y
+CONFIG_FONT_8x16=y
+
+#
+# Logo configuration
+#
+# CONFIG_LOGO is not set
+CONFIG_BACKLIGHT_LCD_SUPPORT=y
+# CONFIG_LCD_CLASS_DEVICE is not set
+
+#
+# Sound
+#
+CONFIG_SOUND=y
+
+#
+# Advanced Linux Sound Architecture
+#
+CONFIG_SND=m
+CONFIG_SND_TIMER=m
+CONFIG_SND_PCM=m
+CONFIG_SND_HWDEP=m
+CONFIG_SND_RAWMIDI=m
+CONFIG_SND_SEQUENCER=m
+CONFIG_SND_SEQ_DUMMY=m
+CONFIG_SND_OSSEMUL=y
+CONFIG_SND_MIXER_OSS=m
+CONFIG_SND_PCM_OSS=m
+CONFIG_SND_PCM_OSS_PLUGINS=y
+CONFIG_SND_SEQUENCER_OSS=y
+CONFIG_SND_RTCTIMER=m
+CONFIG_SND_SEQ_RTCTIMER_DEFAULT=y
+# CONFIG_SND_DYNAMIC_MINORS is not set
+CONFIG_SND_SUPPORT_OLD_API=y
+CONFIG_SND_VERBOSE_PROCFS=y
+# CONFIG_SND_VERBOSE_PRINTK is not set
+# CONFIG_SND_DEBUG is not set
+
+#
+# Generic devices
+#
+CONFIG_SND_MPU401_UART=m
+CONFIG_SND_OPL3_LIB=m
+CONFIG_SND_VX_LIB=m
+CONFIG_SND_AC97_CODEC=m
+CONFIG_SND_DUMMY=m
+CONFIG_SND_VIRMIDI=m
+CONFIG_SND_MTPAV=m
+CONFIG_SND_MTS64=m
+CONFIG_SND_SERIAL_U16550=m
+CONFIG_SND_MPU401=m
+
+#
+# PCI devices
+#
+CONFIG_SND_AD1889=m
+CONFIG_SND_ALS300=m
+CONFIG_SND_ALI5451=m
+CONFIG_SND_ATIIXP=m
+CONFIG_SND_ATIIXP_MODEM=m
+CONFIG_SND_AU8810=m
+CONFIG_SND_AU8820=m
+CONFIG_SND_AU8830=m
+CONFIG_SND_AZT3328=m
+CONFIG_SND_BT87X=m
+# CONFIG_SND_BT87X_OVERCLOCK is not set
+CONFIG_SND_CA0106=m
+CONFIG_SND_CMIPCI=m
+CONFIG_SND_CS4281=m
+CONFIG_SND_CS46XX=m
+CONFIG_SND_CS46XX_NEW_DSP=y
+CONFIG_SND_DARLA20=m
+CONFIG_SND_GINA20=m
+CONFIG_SND_LAYLA20=m
+CONFIG_SND_DARLA24=m
+CONFIG_SND_GINA24=m
+CONFIG_SND_LAYLA24=m
+CONFIG_SND_MONA=m
+CONFIG_SND_MIA=m
+CONFIG_SND_ECHO3G=m
+CONFIG_SND_INDIGO=m
+CONFIG_SND_INDIGOIO=m
+CONFIG_SND_INDIGODJ=m
+CONFIG_SND_EMU10K1=m
+CONFIG_SND_EMU10K1X=m
+CONFIG_SND_ENS1370=m
+CONFIG_SND_ENS1371=m
+CONFIG_SND_ES1938=m
+CONFIG_SND_ES1968=m
+CONFIG_SND_FM801=m
+CONFIG_SND_FM801_TEA575X_BOOL=y
+CONFIG_SND_FM801_TEA575X=m
+CONFIG_SND_HDA_INTEL=m
+CONFIG_SND_HDSP=m
+CONFIG_SND_HDSPM=m
+CONFIG_SND_ICE1712=m
+CONFIG_SND_ICE1724=m
+CONFIG_SND_INTEL8X0=m
+CONFIG_SND_INTEL8X0M=m
+CONFIG_SND_KORG1212=m
+CONFIG_SND_MAESTRO3=m
+CONFIG_SND_MIXART=m
+CONFIG_SND_NM256=m
+CONFIG_SND_PCXHR=m
+CONFIG_SND_RIPTIDE=m
+CONFIG_SND_RME32=m
+CONFIG_SND_RME96=m
+CONFIG_SND_RME9652=m
+CONFIG_SND_SONICVIBES=m
+CONFIG_SND_TRIDENT=m
+CONFIG_SND_VIA82XX=m
+CONFIG_SND_VIA82XX_MODEM=m
+CONFIG_SND_VX222=m
+CONFIG_SND_YMFPCI=m
+CONFIG_SND_AC97_POWER_SAVE=y
+
+#
+# ALSA MIPS devices
+#
+
+#
+# USB devices
+#
+CONFIG_SND_USB_AUDIO=m
+
+#
+# Open Sound System
+#
+CONFIG_SOUND_PRIME=m
+CONFIG_SOUND_TRIDENT=m
+CONFIG_SOUND_MSNDCLAS=m
+CONFIG_MSNDCLAS_INIT_FILE="/etc/sound/msndinit.bin"
+CONFIG_MSNDCLAS_PERM_FILE="/etc/sound/msndperm.bin"
+CONFIG_SOUND_MSNDPIN=m
+CONFIG_MSNDPIN_INIT_FILE="/etc/sound/pndspini.bin"
+CONFIG_MSNDPIN_PERM_FILE="/etc/sound/pndsperm.bin"
+CONFIG_AC97_BUS=m
+
+#
+# HID Devices
+#
+CONFIG_HID=y
+
+#
+# USB support
+#
+CONFIG_USB_ARCH_HAS_HCD=y
+CONFIG_USB_ARCH_HAS_OHCI=y
+CONFIG_USB_ARCH_HAS_EHCI=y
+CONFIG_USB=y
+# CONFIG_USB_DEBUG is not set
+
+#
+# Miscellaneous USB options
+#
+CONFIG_USB_DEVICEFS=y
+# CONFIG_USB_DYNAMIC_MINORS is not set
+# CONFIG_USB_OTG is not set
+
+#
+# USB Host Controller Drivers
+#
+CONFIG_USB_EHCI_HCD=m
+CONFIG_USB_EHCI_SPLIT_ISO=y
+CONFIG_USB_EHCI_ROOT_HUB_TT=y
+# CONFIG_USB_EHCI_TT_NEWSCHED is not set
+CONFIG_USB_ISP116X_HCD=m
+CONFIG_USB_OHCI_HCD=m
+CONFIG_USB_OHCI_LITTLE_ENDIAN=y
+CONFIG_USB_UHCI_HCD=y
+CONFIG_USB_U132_HCD=m
+CONFIG_USB_SL811_HCD=m
+
+#
+# USB Device Class drivers
+#
+CONFIG_USB_ACM=m
+CONFIG_USB_PRINTER=m
+
+#
+# NOTE: USB_STORAGE enables SCSI, and 'SCSI disk support'
+#
+
+#
+# may also be needed; see USB_STORAGE Help for more information
+#
+CONFIG_USB_STORAGE=m
+# CONFIG_USB_STORAGE_DEBUG is not set
+CONFIG_USB_STORAGE_DATAFAB=y
+CONFIG_USB_STORAGE_FREECOM=y
+CONFIG_USB_STORAGE_ISD200=y
+CONFIG_USB_STORAGE_DPCM=y
+CONFIG_USB_STORAGE_USBAT=y
+CONFIG_USB_STORAGE_SDDR09=y
+CONFIG_USB_STORAGE_SDDR55=y
+CONFIG_USB_STORAGE_JUMPSHOT=y
+CONFIG_USB_STORAGE_ALAUDA=y
+CONFIG_USB_STORAGE_ONETOUCH=y
+CONFIG_USB_STORAGE_KARMA=y
+# CONFIG_USB_LIBUSUAL is not set
+
+#
+# USB Input Devices
+#
+CONFIG_USB_HID=m
+# CONFIG_USB_HIDINPUT_POWERBOOK is not set
+# CONFIG_HID_FF is not set
+CONFIG_USB_HIDDEV=y
+
+#
+# USB HID Boot Protocol drivers
+#
+CONFIG_USB_KBD=m
+CONFIG_USB_MOUSE=m
+
+#
+# USB Imaging devices
+#
+CONFIG_USB_MDC800=m
+CONFIG_USB_MICROTEK=m
+
+#
+# USB Network Adapters
+#
+CONFIG_USB_CATC=m
+CONFIG_USB_KAWETH=m
+CONFIG_USB_PEGASUS=m
+CONFIG_USB_RTL8150=m
+CONFIG_USB_USBNET_MII=m
+CONFIG_USB_USBNET=m
+CONFIG_USB_NET_AX8817X=m
+CONFIG_USB_NET_CDCETHER=m
+CONFIG_USB_NET_GL620A=m
+CONFIG_USB_NET_NET1080=m
+CONFIG_USB_NET_PLUSB=m
+CONFIG_USB_NET_MCS7830=m
+CONFIG_USB_NET_RNDIS_HOST=m
+CONFIG_USB_NET_CDC_SUBSET=m
+CONFIG_USB_ALI_M5632=y
+CONFIG_USB_AN2720=y
+CONFIG_USB_BELKIN=y
+CONFIG_USB_ARMLINUX=y
+CONFIG_USB_EPSON2888=y
+CONFIG_USB_NET_ZAURUS=m
+CONFIG_USB_MON=y
+
+#
+# USB port drivers
+#
+CONFIG_USB_USS720=m
+
+#
+# USB Miscellaneous drivers
+#
+CONFIG_USB_ADUTUX=m
+CONFIG_USB_AUERSWALD=m
+CONFIG_USB_RIO500=m
+CONFIG_USB_LEGOTOWER=m
+CONFIG_USB_LCD=m
+CONFIG_USB_LED=m
+CONFIG_USB_CYPRESS_CY7C63=m
+CONFIG_USB_CYTHERM=m
+CONFIG_USB_PHIDGET=m
+CONFIG_USB_PHIDGETKIT=m
+CONFIG_USB_PHIDGETMOTORCONTROL=m
+CONFIG_USB_PHIDGETSERVO=m
+CONFIG_USB_IDMOUSE=m
+CONFIG_USB_FTDI_ELAN=m
+CONFIG_USB_APPLEDISPLAY=m
+CONFIG_USB_SISUSBVGA=m
+CONFIG_USB_SISUSBVGA_CON=y
+CONFIG_USB_LD=m
+CONFIG_USB_TRANCEVIBRATOR=m
+CONFIG_USB_TEST=m
+
+#
+# USB DSL modem support
+#
+CONFIG_USB_ATM=m
+CONFIG_USB_SPEEDTOUCH=m
+CONFIG_USB_CXACRU=m
+CONFIG_USB_UEAGLEATM=m
+CONFIG_USB_XUSBATM=m
+
+#
+# USB Gadget Support
+#
+CONFIG_USB_GADGET=m
+# CONFIG_USB_GADGET_DEBUG_FILES is not set
+CONFIG_USB_GADGET_SELECTED=y
+CONFIG_USB_GADGET_NET2280=y
+CONFIG_USB_NET2280=m
+# CONFIG_USB_GADGET_PXA2XX is not set
+# CONFIG_USB_GADGET_GOKU is not set
+# CONFIG_USB_GADGET_LH7A40X is not set
+# CONFIG_USB_GADGET_OMAP is not set
+# CONFIG_USB_GADGET_AT91 is not set
+# CONFIG_USB_GADGET_DUMMY_HCD is not set
+CONFIG_USB_GADGET_DUALSPEED=y
+CONFIG_USB_ZERO=m
+CONFIG_USB_ETH=m
+CONFIG_USB_ETH_RNDIS=y
+CONFIG_USB_GADGETFS=m
+CONFIG_USB_FILE_STORAGE=m
+# CONFIG_USB_FILE_STORAGE_TEST is not set
+CONFIG_USB_G_SERIAL=m
+CONFIG_USB_MIDI_GADGET=m
+
+#
+# MMC/SD Card support
+#
+CONFIG_MMC=m
+# CONFIG_MMC_DEBUG is not set
+CONFIG_MMC_BLOCK=m
+CONFIG_MMC_SDHCI=m
+CONFIG_MMC_TIFM_SD=m
+
+#
+# LED devices
+#
+# CONFIG_NEW_LEDS is not set
+
+#
+# LED drivers
+#
+
+#
+# LED Triggers
+#
+
+#
+# InfiniBand support
+#
+
+#
+# EDAC - error detection and reporting (RAS) (EXPERIMENTAL)
+#
+
+#
+# Real Time Clock
+#
+CONFIG_RTC_LIB=m
+CONFIG_RTC_CLASS=m
+
+#
+# RTC interfaces
+#
+CONFIG_RTC_INTF_SYSFS=y
+CONFIG_RTC_INTF_PROC=y
+CONFIG_RTC_INTF_DEV=y
+# CONFIG_RTC_INTF_DEV_UIE_EMUL is not set
+
+#
+# RTC drivers
+#
+CONFIG_RTC_DRV_X1205=m
+CONFIG_RTC_DRV_DS1307=m
+# CONFIG_RTC_DRV_DS1553 is not set
+CONFIG_RTC_DRV_ISL1208=m
+CONFIG_RTC_DRV_DS1672=m
+# CONFIG_RTC_DRV_DS1742 is not set
+CONFIG_RTC_DRV_PCF8563=m
+CONFIG_RTC_DRV_PCF8583=m
+CONFIG_RTC_DRV_RS5C348=m
+CONFIG_RTC_DRV_RS5C372=m
+CONFIG_RTC_DRV_M48T86=m
+# CONFIG_RTC_DRV_TEST is not set
+CONFIG_RTC_DRV_MAX6902=m
+# CONFIG_RTC_DRV_V3020 is not set
+
+#
+# DMA Engine support
+#
+CONFIG_DMA_ENGINE=y
+
+#
+# DMA Clients
+#
+CONFIG_NET_DMA=y
+
+#
+# DMA Devices
+#
+# CONFIG_INTEL_IOATDMA is not set
+
+#
+# Virtualization
+#
+
+#
+# File systems
+#
+CONFIG_EXT2_FS=y
+CONFIG_EXT2_FS_XATTR=y
+CONFIG_EXT2_FS_POSIX_ACL=y
+CONFIG_EXT2_FS_SECURITY=y
+# CONFIG_EXT2_FS_XIP is not set
+CONFIG_EXT3_FS=y
+CONFIG_EXT3_FS_XATTR=y
+CONFIG_EXT3_FS_POSIX_ACL=y
+CONFIG_EXT3_FS_SECURITY=y
+CONFIG_EXT4DEV_FS=m
+CONFIG_EXT4DEV_FS_XATTR=y
+CONFIG_EXT4DEV_FS_POSIX_ACL=y
+CONFIG_EXT4DEV_FS_SECURITY=y
+CONFIG_JBD=y
+# CONFIG_JBD_DEBUG is not set
+CONFIG_JBD2=m
+# CONFIG_JBD2_DEBUG is not set
+CONFIG_FS_MBCACHE=y
+CONFIG_REISERFS_FS=m
+# CONFIG_REISERFS_CHECK is not set
+# CONFIG_REISERFS_PROC_INFO is not set
+CONFIG_REISERFS_FS_XATTR=y
+CONFIG_REISERFS_FS_POSIX_ACL=y
+CONFIG_REISERFS_FS_SECURITY=y
+CONFIG_JFS_FS=m
+# CONFIG_JFS_POSIX_ACL is not set
+CONFIG_JFS_SECURITY=y
+# CONFIG_JFS_DEBUG is not set
+# CONFIG_JFS_STATISTICS is not set
+CONFIG_FS_POSIX_ACL=y
+CONFIG_XFS_FS=m
+CONFIG_XFS_QUOTA=y
+CONFIG_XFS_SECURITY=y
+CONFIG_XFS_POSIX_ACL=y
+CONFIG_XFS_RT=y
+CONFIG_GFS2_FS=m
+CONFIG_GFS2_FS_LOCKING_NOLOCK=m
+CONFIG_GFS2_FS_LOCKING_DLM=m
+CONFIG_OCFS2_FS=m
+CONFIG_OCFS2_DEBUG_MASKLOG=y
+CONFIG_MINIX_FS=m
+CONFIG_ROMFS_FS=m
+CONFIG_INOTIFY=y
+CONFIG_INOTIFY_USER=y
+CONFIG_QUOTA=y
+CONFIG_QFMT_V1=m
+CONFIG_QFMT_V2=m
+CONFIG_QUOTACTL=y
+CONFIG_DNOTIFY=y
+CONFIG_AUTOFS_FS=m
+CONFIG_AUTOFS4_FS=m
+CONFIG_FUSE_FS=m
+CONFIG_GENERIC_ACL=y
+
+#
+# CD-ROM/DVD Filesystems
+#
+CONFIG_ISO9660_FS=m
+CONFIG_JOLIET=y
+CONFIG_ZISOFS=y
+CONFIG_UDF_FS=m
+CONFIG_UDF_NLS=y
+
+#
+# DOS/FAT/NT Filesystems
+#
+CONFIG_FAT_FS=m
+CONFIG_MSDOS_FS=m
+CONFIG_VFAT_FS=m
+CONFIG_FAT_DEFAULT_CODEPAGE=437
+CONFIG_FAT_DEFAULT_IOCHARSET="iso8859-1"
+CONFIG_NTFS_FS=m
+# CONFIG_NTFS_DEBUG is not set
+CONFIG_NTFS_RW=y
+
+#
+# Pseudo filesystems
+#
+CONFIG_PROC_FS=y
+CONFIG_PROC_KCORE=y
+CONFIG_PROC_SYSCTL=y
+CONFIG_SYSFS=y
+CONFIG_TMPFS=y
+CONFIG_TMPFS_POSIX_ACL=y
+CONFIG_RAMFS=y
+CONFIG_CONFIGFS_FS=m
+
+#
+# Miscellaneous filesystems
+#
+CONFIG_ADFS_FS=m
+# CONFIG_ADFS_FS_RW is not set
+CONFIG_AFFS_FS=m
+CONFIG_ECRYPT_FS=m
+CONFIG_HFS_FS=m
+CONFIG_HFSPLUS_FS=m
+CONFIG_BEFS_FS=m
+# CONFIG_BEFS_DEBUG is not set
+CONFIG_BFS_FS=m
+CONFIG_EFS_FS=m
+CONFIG_JFFS2_FS=m
+CONFIG_JFFS2_FS_DEBUG=0
+CONFIG_JFFS2_FS_WRITEBUFFER=y
+# CONFIG_JFFS2_SUMMARY is not set
+CONFIG_JFFS2_FS_XATTR=y
+CONFIG_JFFS2_FS_POSIX_ACL=y
+CONFIG_JFFS2_FS_SECURITY=y
+# CONFIG_JFFS2_COMPRESSION_OPTIONS is not set
+CONFIG_JFFS2_ZLIB=y
+CONFIG_JFFS2_RTIME=y
+# CONFIG_JFFS2_RUBIN is not set
+CONFIG_CRAMFS=y
+CONFIG_VXFS_FS=m
+CONFIG_HPFS_FS=m
+CONFIG_QNX4FS_FS=m
+CONFIG_SYSV_FS=m
+CONFIG_UFS_FS=m
+# CONFIG_UFS_FS_WRITE is not set
+# CONFIG_UFS_DEBUG is not set
+
+#
+# Network File Systems
+#
+CONFIG_NFS_FS=y
+CONFIG_NFS_V3=y
+CONFIG_NFS_V3_ACL=y
+CONFIG_NFS_V4=y
+CONFIG_NFS_DIRECTIO=y
+CONFIG_NFSD=m
+CONFIG_NFSD_V2_ACL=y
+CONFIG_NFSD_V3=y
+CONFIG_NFSD_V3_ACL=y
+CONFIG_NFSD_V4=y
+CONFIG_NFSD_TCP=y
+CONFIG_LOCKD=y
+CONFIG_LOCKD_V4=y
+CONFIG_EXPORTFS=m
+CONFIG_NFS_ACL_SUPPORT=y
+CONFIG_NFS_COMMON=y
+CONFIG_SUNRPC=y
+CONFIG_SUNRPC_GSS=y
+CONFIG_RPCSEC_GSS_KRB5=y
+# CONFIG_RPCSEC_GSS_SPKM3 is not set
+CONFIG_SMB_FS=m
+# CONFIG_SMB_NLS_DEFAULT is not set
+CONFIG_CIFS=m
+# CONFIG_CIFS_STATS is not set
+# CONFIG_CIFS_WEAK_PW_HASH is not set
+CONFIG_CIFS_XATTR=y
+CONFIG_CIFS_POSIX=y
+# CONFIG_CIFS_DEBUG2 is not set
+# CONFIG_CIFS_EXPERIMENTAL is not set
+CONFIG_NCP_FS=m
+CONFIG_NCPFS_PACKET_SIGNING=y
+CONFIG_NCPFS_IOCTL_LOCKING=y
+CONFIG_NCPFS_STRONG=y
+CONFIG_NCPFS_NFS_NS=y
+CONFIG_NCPFS_OS2_NS=y
+# CONFIG_NCPFS_SMALLDOS is not set
+CONFIG_NCPFS_NLS=y
+CONFIG_NCPFS_EXTRAS=y
+CONFIG_CODA_FS=m
+# CONFIG_CODA_FS_OLD_API is not set
+CONFIG_AFS_FS=m
+# CONFIG_AFS_DEBUG is not set
+CONFIG_9P_FS=m
+
+#
+# Partition Types
+#
+# CONFIG_PARTITION_ADVANCED is not set
+CONFIG_MSDOS_PARTITION=y
+
+#
+# Native Language Support
+#
+CONFIG_NLS=y
+CONFIG_NLS_DEFAULT="iso8859-1"
+CONFIG_NLS_CODEPAGE_437=m
+CONFIG_NLS_CODEPAGE_737=m
+CONFIG_NLS_CODEPAGE_775=m
+CONFIG_NLS_CODEPAGE_850=m
+CONFIG_NLS_CODEPAGE_852=m
+CONFIG_NLS_CODEPAGE_855=m
+CONFIG_NLS_CODEPAGE_857=m
+CONFIG_NLS_CODEPAGE_860=m
+CONFIG_NLS_CODEPAGE_861=m
+CONFIG_NLS_CODEPAGE_862=m
+CONFIG_NLS_CODEPAGE_863=m
+CONFIG_NLS_CODEPAGE_864=m
+CONFIG_NLS_CODEPAGE_865=m
+CONFIG_NLS_CODEPAGE_866=m
+CONFIG_NLS_CODEPAGE_869=m
+CONFIG_NLS_CODEPAGE_936=m
+CONFIG_NLS_CODEPAGE_950=m
+CONFIG_NLS_CODEPAGE_932=m
+CONFIG_NLS_CODEPAGE_949=m
+CONFIG_NLS_CODEPAGE_874=m
+CONFIG_NLS_ISO8859_8=m
+CONFIG_NLS_CODEPAGE_1250=m
+CONFIG_NLS_CODEPAGE_1251=m
+CONFIG_NLS_ASCII=m
+CONFIG_NLS_ISO8859_1=m
+CONFIG_NLS_ISO8859_2=m
+CONFIG_NLS_ISO8859_3=m
+CONFIG_NLS_ISO8859_4=m
+CONFIG_NLS_ISO8859_5=m
+CONFIG_NLS_ISO8859_6=m
+CONFIG_NLS_ISO8859_7=m
+CONFIG_NLS_ISO8859_9=m
+CONFIG_NLS_ISO8859_13=m
+CONFIG_NLS_ISO8859_14=m
+CONFIG_NLS_ISO8859_15=m
+CONFIG_NLS_KOI8_R=m
+CONFIG_NLS_KOI8_U=m
+CONFIG_NLS_UTF8=m
+
+#
+# Distributed Lock Manager
+#
+CONFIG_DLM=m
+# CONFIG_DLM_DEBUG is not set
+
+#
+# Profiling support
+#
+CONFIG_PROFILING=y
+CONFIG_OPROFILE=m
+
+#
+# Kernel hacking
+#
+CONFIG_TRACE_IRQFLAGS_SUPPORT=y
+# CONFIG_PRINTK_TIME is not set
+CONFIG_ENABLE_MUST_CHECK=y
+CONFIG_MAGIC_SYSRQ=y
+CONFIG_UNUSED_SYMBOLS=y
+# CONFIG_DEBUG_FS is not set
+# CONFIG_HEADERS_CHECK is not set
+# CONFIG_DEBUG_KERNEL is not set
+CONFIG_LOG_BUF_SHIFT=14
+# CONFIG_CROSSCOMPILE is not set
+CONFIG_CMDLINE=""
+
+#
+# Security options
+#
+CONFIG_KEYS=y
+# CONFIG_KEYS_DEBUG_PROC_KEYS is not set
+CONFIG_SECURITY=y
+CONFIG_SECURITY_NETWORK=y
+CONFIG_SECURITY_NETWORK_XFRM=y
+CONFIG_SECURITY_CAPABILITIES=y
+# CONFIG_SECURITY_ROOTPLUG is not set
+CONFIG_SECURITY_SELINUX=y
+CONFIG_SECURITY_SELINUX_BOOTPARAM=y
+CONFIG_SECURITY_SELINUX_BOOTPARAM_VALUE=0
+CONFIG_SECURITY_SELINUX_DISABLE=y
+CONFIG_SECURITY_SELINUX_DEVELOP=y
+CONFIG_SECURITY_SELINUX_AVC_STATS=y
+CONFIG_SECURITY_SELINUX_CHECKREQPROT_VALUE=1
+# CONFIG_SECURITY_SELINUX_ENABLE_SECMARK_DEFAULT is not set
+# CONFIG_SECURITY_SELINUX_POLICYDB_VERSION_MAX is not set
+
+#
+# Cryptographic options
+#
+CONFIG_CRYPTO=y
+CONFIG_CRYPTO_ALGAPI=y
+CONFIG_CRYPTO_BLKCIPHER=y
+CONFIG_CRYPTO_HASH=y
+CONFIG_CRYPTO_MANAGER=y
+CONFIG_CRYPTO_HMAC=y
+CONFIG_CRYPTO_XCBC=m
+CONFIG_CRYPTO_NULL=m
+CONFIG_CRYPTO_MD4=m
+CONFIG_CRYPTO_MD5=y
+CONFIG_CRYPTO_SHA1=m
+CONFIG_CRYPTO_SHA256=m
+CONFIG_CRYPTO_SHA512=m
+CONFIG_CRYPTO_WP512=m
+CONFIG_CRYPTO_TGR192=m
+CONFIG_CRYPTO_GF128MUL=m
+CONFIG_CRYPTO_ECB=m
+CONFIG_CRYPTO_CBC=y
+CONFIG_CRYPTO_LRW=m
+CONFIG_CRYPTO_DES=y
+CONFIG_CRYPTO_BLOWFISH=m
+CONFIG_CRYPTO_TWOFISH=m
+CONFIG_CRYPTO_TWOFISH_COMMON=m
+CONFIG_CRYPTO_SERPENT=m
+CONFIG_CRYPTO_AES=m
+CONFIG_CRYPTO_CAST5=m
+CONFIG_CRYPTO_CAST6=m
+CONFIG_CRYPTO_TEA=m
+CONFIG_CRYPTO_ARC4=m
+CONFIG_CRYPTO_KHAZAD=m
+CONFIG_CRYPTO_ANUBIS=m
+CONFIG_CRYPTO_DEFLATE=m
+CONFIG_CRYPTO_MICHAEL_MIC=m
+CONFIG_CRYPTO_CRC32C=m
+CONFIG_CRYPTO_TEST=m
+
+#
+# Hardware crypto devices
+#
+
+#
+# Library routines
+#
+CONFIG_BITREVERSE=y
+CONFIG_CRC_CCITT=m
+CONFIG_CRC16=m
+CONFIG_CRC32=y
+CONFIG_LIBCRC32C=m
+CONFIG_AUDIT_GENERIC=y
+CONFIG_ZLIB_INFLATE=y
+CONFIG_ZLIB_DEFLATE=m
+CONFIG_REED_SOLOMON=m
+CONFIG_REED_SOLOMON_DEC16=y
+CONFIG_TEXTSEARCH=y
+CONFIG_TEXTSEARCH_KMP=m
+CONFIG_TEXTSEARCH_BM=m
+CONFIG_TEXTSEARCH_FSM=m
+CONFIG_PLIST=y

Added: dists/sid/linux-2.6/debian/config/mips/config.5kc-malta
==============================================================================
--- (empty file)
+++ dists/sid/linux-2.6/debian/config/mips/config.5kc-malta	Mon Nov 26 20:06:56 2007
@@ -0,0 +1,3080 @@
+#
+# Machine selection
+#
+CONFIG_ZONE_DMA=y
+# CONFIG_MACH_ALCHEMY is not set
+# CONFIG_BASLER_EXCITE is not set
+# CONFIG_MIPS_COBALT is not set
+# CONFIG_MACH_DECSTATION is not set
+# CONFIG_MIPS_EV64120 is not set
+# CONFIG_MACH_JAZZ is not set
+# CONFIG_LASAT is not set
+# CONFIG_MIPS_ATLAS is not set
+CONFIG_MIPS_MALTA=y
+# CONFIG_MIPS_SEAD is not set
+# CONFIG_WR_PPMC is not set
+# CONFIG_MIPS_SIM is not set
+# CONFIG_MOMENCO_OCELOT is not set
+# CONFIG_MOMENCO_OCELOT_3 is not set
+# CONFIG_MOMENCO_OCELOT_C is not set
+# CONFIG_PNX8550_JBS is not set
+# CONFIG_PNX8550_STB810 is not set
+# CONFIG_DDB5477 is not set
+# CONFIG_MACH_VR41XX is not set
+# CONFIG_PMC_YOSEMITE is not set
+# CONFIG_QEMU is not set
+# CONFIG_MARKEINS is not set
+# CONFIG_SGI_IP22 is not set
+# CONFIG_SGI_IP27 is not set
+# CONFIG_SGI_IP32 is not set
+# CONFIG_SIBYTE_BIGSUR is not set
+# CONFIG_SIBYTE_SWARM is not set
+# CONFIG_SIBYTE_SENTOSA is not set
+# CONFIG_SIBYTE_RHONE is not set
+# CONFIG_SIBYTE_CARMEL is not set
+# CONFIG_SIBYTE_PTSWARM is not set
+# CONFIG_SIBYTE_LITTLESUR is not set
+# CONFIG_SIBYTE_CRHINE is not set
+# CONFIG_SIBYTE_CRHONE is not set
+# CONFIG_SNI_RM is not set
+# CONFIG_TOSHIBA_JMR3927 is not set
+# CONFIG_TOSHIBA_RBTX4927 is not set
+# CONFIG_TOSHIBA_RBTX4938 is not set
+CONFIG_RWSEM_GENERIC_SPINLOCK=y
+# CONFIG_ARCH_HAS_ILOG2_U32 is not set
+# CONFIG_ARCH_HAS_ILOG2_U64 is not set
+CONFIG_GENERIC_FIND_NEXT_BIT=y
+CONFIG_GENERIC_HWEIGHT=y
+CONFIG_GENERIC_CALIBRATE_DELAY=y
+CONFIG_GENERIC_TIME=y
+CONFIG_SCHED_NO_NO_OMIT_FRAME_POINTER=y
+# CONFIG_GENERIC_HARDIRQS_NO__DO_IRQ is not set
+CONFIG_ARCH_MAY_HAVE_PC_FDC=y
+CONFIG_DMA_NONCOHERENT=y
+CONFIG_DMA_NEED_PCI_MAP_STATE=y
+CONFIG_EARLY_PRINTK=y
+CONFIG_SYS_HAS_EARLY_PRINTK=y
+CONFIG_GENERIC_ISA_DMA=y
+CONFIG_I8259=y
+CONFIG_MIPS_BONITO64=y
+CONFIG_MIPS_MSC=y
+CONFIG_CPU_BIG_ENDIAN=y
+# CONFIG_CPU_LITTLE_ENDIAN is not set
+CONFIG_SYS_SUPPORTS_BIG_ENDIAN=y
+CONFIG_SYS_SUPPORTS_LITTLE_ENDIAN=y
+CONFIG_IRQ_CPU=y
+CONFIG_MIPS_BOARDS_GEN=y
+CONFIG_PCI_GT64XXX_PCI0=y
+CONFIG_SWAP_IO_SPACE=y
+CONFIG_BOOT_ELF32=y
+CONFIG_MIPS_L1_CACHE_SHIFT=5
+CONFIG_HAVE_STD_PC_SERIAL_PORT=y
+
+#
+# CPU selection
+#
+# CONFIG_CPU_MIPS32_R1 is not set
+# CONFIG_CPU_MIPS32_R2 is not set
+CONFIG_CPU_MIPS64_R1=y
+# CONFIG_CPU_MIPS64_R2 is not set
+# CONFIG_CPU_R3000 is not set
+# CONFIG_CPU_TX39XX is not set
+# CONFIG_CPU_VR41XX is not set
+# CONFIG_CPU_R4300 is not set
+# CONFIG_CPU_R4X00 is not set
+# CONFIG_CPU_TX49XX is not set
+# CONFIG_CPU_R5000 is not set
+# CONFIG_CPU_R5432 is not set
+# CONFIG_CPU_R6000 is not set
+# CONFIG_CPU_NEVADA is not set
+# CONFIG_CPU_R8000 is not set
+# CONFIG_CPU_R10000 is not set
+# CONFIG_CPU_RM7000 is not set
+# CONFIG_CPU_RM9000 is not set
+# CONFIG_CPU_SB1 is not set
+CONFIG_SYS_HAS_CPU_MIPS32_R1=y
+CONFIG_SYS_HAS_CPU_MIPS32_R2=y
+CONFIG_SYS_HAS_CPU_MIPS64_R1=y
+CONFIG_SYS_HAS_CPU_NEVADA=y
+CONFIG_SYS_HAS_CPU_RM7000=y
+CONFIG_CPU_MIPS64=y
+CONFIG_CPU_MIPSR1=y
+CONFIG_SYS_SUPPORTS_32BIT_KERNEL=y
+CONFIG_SYS_SUPPORTS_64BIT_KERNEL=y
+CONFIG_CPU_SUPPORTS_32BIT_KERNEL=y
+CONFIG_CPU_SUPPORTS_64BIT_KERNEL=y
+
+#
+# Kernel type
+#
+# CONFIG_32BIT is not set
+CONFIG_64BIT=y
+CONFIG_PAGE_SIZE_4KB=y
+# CONFIG_PAGE_SIZE_8KB is not set
+# CONFIG_PAGE_SIZE_16KB is not set
+# CONFIG_PAGE_SIZE_64KB is not set
+CONFIG_BOARD_SCACHE=y
+CONFIG_MIPS_CPU_SCACHE=y
+CONFIG_CPU_HAS_PREFETCH=y
+CONFIG_MIPS_MT_DISABLED=y
+# CONFIG_MIPS_MT_SMP is not set
+# CONFIG_MIPS_MT_SMTC is not set
+# CONFIG_MIPS_VPE_LOADER is not set
+CONFIG_SYS_SUPPORTS_MULTITHREADING=y
+CONFIG_CPU_HAS_LLSC=y
+# CONFIG_CPU_HAS_SMARTMIPS is not set
+CONFIG_CPU_HAS_SYNC=y
+CONFIG_GENERIC_HARDIRQS=y
+CONFIG_GENERIC_IRQ_PROBE=y
+CONFIG_CPU_SUPPORTS_HIGHMEM=y
+CONFIG_SYS_SUPPORTS_SMARTMIPS=y
+CONFIG_ARCH_FLATMEM_ENABLE=y
+CONFIG_SELECT_MEMORY_MODEL=y
+CONFIG_FLATMEM_MANUAL=y
+# CONFIG_DISCONTIGMEM_MANUAL is not set
+# CONFIG_SPARSEMEM_MANUAL is not set
+CONFIG_FLATMEM=y
+CONFIG_FLAT_NODE_MEM_MAP=y
+# CONFIG_SPARSEMEM_STATIC is not set
+CONFIG_SPLIT_PTLOCK_CPUS=4
+CONFIG_RESOURCES_64BIT=y
+CONFIG_ZONE_DMA_FLAG=1
+# CONFIG_HZ_48 is not set
+# CONFIG_HZ_100 is not set
+# CONFIG_HZ_128 is not set
+CONFIG_HZ_250=y
+# CONFIG_HZ_256 is not set
+# CONFIG_HZ_1000 is not set
+# CONFIG_HZ_1024 is not set
+CONFIG_SYS_SUPPORTS_ARBIT_HZ=y
+CONFIG_HZ=250
+CONFIG_PREEMPT_NONE=y
+# CONFIG_PREEMPT_VOLUNTARY is not set
+# CONFIG_PREEMPT is not set
+# CONFIG_KEXEC is not set
+CONFIG_STACKTRACE_SUPPORT=y
+CONFIG_DEFCONFIG_LIST="/lib/modules/$UNAME_RELEASE/.config"
+
+#
+# Code maturity level options
+#
+CONFIG_EXPERIMENTAL=y
+CONFIG_BROKEN_ON_SMP=y
+
+#
+# General setup
+#
+CONFIG_LOCALVERSION=""
+# CONFIG_LOCALVERSION_AUTO is not set
+CONFIG_SWAP=y
+CONFIG_SYSVIPC=y
+# CONFIG_IPC_NS is not set
+CONFIG_POSIX_MQUEUE=y
+CONFIG_BSD_PROCESS_ACCT=y
+CONFIG_BSD_PROCESS_ACCT_V3=y
+# CONFIG_TASKSTATS is not set
+# CONFIG_UTS_NS is not set
+CONFIG_AUDIT=y
+CONFIG_IKCONFIG=y
+CONFIG_IKCONFIG_PROC=y
+CONFIG_LOG_BUF_SHIFT=14
+CONFIG_SYSFS_DEPRECATED=y
+CONFIG_BLK_DEV_INITRD=y
+CONFIG_INITRAMFS_SOURCE=""
+# CONFIG_CC_OPTIMIZE_FOR_SIZE is not set
+CONFIG_EMBEDDED=y
+CONFIG_SYSCTL_SYSCALL=y
+CONFIG_HOTPLUG=y
+CONFIG_BASE_FULL=y
+CONFIG_SLAB=y
+# CONFIG_SLUB is not set
+# CONFIG_SLOB is not set
+CONFIG_BASE_SMALL=0
+
+#
+# Loadable module support
+#
+CONFIG_MODULES=y
+CONFIG_MODULE_UNLOAD=y
+CONFIG_MODULE_FORCE_UNLOAD=y
+CONFIG_MODVERSIONS=y
+# CONFIG_MODULE_SRCVERSION_ALL is not set
+CONFIG_KMOD=y
+
+#
+# Block layer
+#
+# CONFIG_BLK_DEV_IO_TRACE is not set
+
+#
+# IO Schedulers
+#
+CONFIG_IOSCHED_NOOP=y
+CONFIG_IOSCHED_AS=y
+CONFIG_IOSCHED_DEADLINE=y
+CONFIG_IOSCHED_CFQ=y
+# CONFIG_DEFAULT_AS is not set
+# CONFIG_DEFAULT_DEADLINE is not set
+CONFIG_DEFAULT_CFQ=y
+# CONFIG_DEFAULT_NOOP is not set
+CONFIG_DEFAULT_IOSCHED="cfq"
+
+#
+# Bus options (PCI, PCMCIA, EISA, ISA, TC)
+#
+CONFIG_HW_HAS_PCI=y
+CONFIG_PCI=y
+# CONFIG_ARCH_SUPPORTS_MSI is not set
+CONFIG_MMU=y
+
+#
+# PCCARD (PCMCIA/CardBus) support
+#
+# CONFIG_PCCARD is not set
+# CONFIG_HOTPLUG_PCI is not set
+
+#
+# Executable file formats
+#
+CONFIG_BINFMT_ELF=y
+CONFIG_BINFMT_MISC=m
+# CONFIG_BUILD_ELF64 is not set
+CONFIG_MIPS32_COMPAT=y
+CONFIG_COMPAT=y
+CONFIG_SYSVIPC_COMPAT=y
+CONFIG_MIPS32_O32=y
+CONFIG_MIPS32_N32=y
+CONFIG_BINFMT_ELF32=y
+
+#
+# Power management options
+#
+# CONFIG_PM is not set
+
+#
+# Networking
+#
+CONFIG_NET=y
+
+#
+# Networking options
+#
+CONFIG_PACKET=y
+CONFIG_PACKET_MMAP=y
+CONFIG_UNIX=y
+CONFIG_XFRM=y
+CONFIG_XFRM_USER=m
+# CONFIG_XFRM_SUB_POLICY is not set
+# CONFIG_XFRM_MIGRATE is not set
+CONFIG_NET_KEY=m
+# CONFIG_NET_KEY_MIGRATE is not set
+CONFIG_INET=y
+CONFIG_IP_MULTICAST=y
+CONFIG_IP_ADVANCED_ROUTER=y
+CONFIG_ASK_IP_FIB_HASH=y
+# CONFIG_IP_FIB_TRIE is not set
+CONFIG_IP_FIB_HASH=y
+CONFIG_IP_MULTIPLE_TABLES=y
+CONFIG_IP_ROUTE_MULTIPATH=y
+CONFIG_IP_ROUTE_MULTIPATH_CACHED=y
+CONFIG_IP_ROUTE_MULTIPATH_RR=m
+CONFIG_IP_ROUTE_MULTIPATH_RANDOM=m
+CONFIG_IP_ROUTE_MULTIPATH_WRANDOM=m
+CONFIG_IP_ROUTE_MULTIPATH_DRR=m
+CONFIG_IP_ROUTE_VERBOSE=y
+# CONFIG_IP_PNP is not set
+CONFIG_NET_IPIP=m
+CONFIG_NET_IPGRE=m
+CONFIG_NET_IPGRE_BROADCAST=y
+CONFIG_IP_MROUTE=y
+CONFIG_IP_PIMSM_V1=y
+CONFIG_IP_PIMSM_V2=y
+# CONFIG_ARPD is not set
+CONFIG_SYN_COOKIES=y
+CONFIG_INET_AH=m
+CONFIG_INET_ESP=m
+CONFIG_INET_IPCOMP=m
+CONFIG_INET_XFRM_TUNNEL=m
+CONFIG_INET_TUNNEL=m
+CONFIG_INET_XFRM_MODE_TRANSPORT=m
+CONFIG_INET_XFRM_MODE_TUNNEL=m
+CONFIG_INET_XFRM_MODE_BEET=m
+CONFIG_INET_DIAG=m
+CONFIG_INET_TCP_DIAG=m
+CONFIG_TCP_CONG_ADVANCED=y
+CONFIG_TCP_CONG_BIC=y
+CONFIG_TCP_CONG_CUBIC=m
+CONFIG_TCP_CONG_WESTWOOD=m
+CONFIG_TCP_CONG_HTCP=m
+CONFIG_TCP_CONG_HSTCP=m
+CONFIG_TCP_CONG_HYBLA=m
+CONFIG_TCP_CONG_VEGAS=m
+CONFIG_TCP_CONG_SCALABLE=m
+CONFIG_TCP_CONG_LP=m
+CONFIG_TCP_CONG_VENO=m
+CONFIG_TCP_CONG_YEAH=m
+CONFIG_TCP_CONG_ILLINOIS=m
+CONFIG_DEFAULT_BIC=y
+# CONFIG_DEFAULT_CUBIC is not set
+# CONFIG_DEFAULT_HTCP is not set
+# CONFIG_DEFAULT_VEGAS is not set
+# CONFIG_DEFAULT_WESTWOOD is not set
+# CONFIG_DEFAULT_RENO is not set
+CONFIG_DEFAULT_TCP_CONG="bic"
+# CONFIG_TCP_MD5SIG is not set
+CONFIG_IP_VS=m
+# CONFIG_IP_VS_DEBUG is not set
+CONFIG_IP_VS_TAB_BITS=12
+
+#
+# IPVS transport protocol load balancing support
+#
+CONFIG_IP_VS_PROTO_TCP=y
+CONFIG_IP_VS_PROTO_UDP=y
+CONFIG_IP_VS_PROTO_ESP=y
+CONFIG_IP_VS_PROTO_AH=y
+
+#
+# IPVS scheduler
+#
+CONFIG_IP_VS_RR=m
+CONFIG_IP_VS_WRR=m
+CONFIG_IP_VS_LC=m
+CONFIG_IP_VS_WLC=m
+CONFIG_IP_VS_LBLC=m
+CONFIG_IP_VS_LBLCR=m
+CONFIG_IP_VS_DH=m
+CONFIG_IP_VS_SH=m
+CONFIG_IP_VS_SED=m
+CONFIG_IP_VS_NQ=m
+
+#
+# IPVS application helper
+#
+CONFIG_IP_VS_FTP=m
+CONFIG_IPV6=m
+CONFIG_IPV6_PRIVACY=y
+# CONFIG_IPV6_ROUTER_PREF is not set
+# CONFIG_IPV6_OPTIMISTIC_DAD is not set
+CONFIG_INET6_AH=m
+CONFIG_INET6_ESP=m
+CONFIG_INET6_IPCOMP=m
+# CONFIG_IPV6_MIP6 is not set
+CONFIG_INET6_XFRM_TUNNEL=m
+CONFIG_INET6_TUNNEL=m
+CONFIG_INET6_XFRM_MODE_TRANSPORT=m
+CONFIG_INET6_XFRM_MODE_TUNNEL=m
+CONFIG_INET6_XFRM_MODE_BEET=m
+CONFIG_INET6_XFRM_MODE_ROUTEOPTIMIZATION=m
+CONFIG_IPV6_SIT=m
+CONFIG_IPV6_TUNNEL=m
+# CONFIG_IPV6_MULTIPLE_TABLES is not set
+# CONFIG_NETLABEL is not set
+CONFIG_NETWORK_SECMARK=y
+CONFIG_NETFILTER=y
+# CONFIG_NETFILTER_DEBUG is not set
+CONFIG_BRIDGE_NETFILTER=y
+
+#
+# Core Netfilter Configuration
+#
+CONFIG_NETFILTER_NETLINK=m
+CONFIG_NETFILTER_NETLINK_QUEUE=m
+CONFIG_NETFILTER_NETLINK_LOG=m
+CONFIG_NF_CONNTRACK_ENABLED=m
+CONFIG_NF_CONNTRACK=m
+CONFIG_NF_CT_ACCT=y
+CONFIG_NF_CONNTRACK_MARK=y
+CONFIG_NF_CONNTRACK_SECMARK=y
+CONFIG_NF_CONNTRACK_EVENTS=y
+CONFIG_NF_CT_PROTO_GRE=m
+CONFIG_NF_CT_PROTO_SCTP=m
+CONFIG_NF_CONNTRACK_AMANDA=m
+CONFIG_NF_CONNTRACK_FTP=m
+CONFIG_NF_CONNTRACK_H323=m
+CONFIG_NF_CONNTRACK_IRC=m
+CONFIG_NF_CONNTRACK_NETBIOS_NS=m
+CONFIG_NF_CONNTRACK_PPTP=m
+CONFIG_NF_CONNTRACK_SANE=m
+CONFIG_NF_CONNTRACK_SIP=m
+CONFIG_NF_CONNTRACK_TFTP=m
+CONFIG_NF_CT_NETLINK=m
+CONFIG_NETFILTER_XTABLES=m
+CONFIG_NETFILTER_XT_TARGET_CLASSIFY=m
+CONFIG_NETFILTER_XT_TARGET_CONNMARK=m
+CONFIG_NETFILTER_XT_TARGET_DSCP=m
+CONFIG_NETFILTER_XT_TARGET_MARK=m
+CONFIG_NETFILTER_XT_TARGET_NFQUEUE=m
+CONFIG_NETFILTER_XT_TARGET_NFLOG=m
+CONFIG_NETFILTER_XT_TARGET_NOTRACK=m
+CONFIG_NETFILTER_XT_TARGET_SECMARK=m
+CONFIG_NETFILTER_XT_TARGET_CONNSECMARK=m
+CONFIG_NETFILTER_XT_TARGET_TCPMSS=m
+CONFIG_NETFILTER_XT_MATCH_COMMENT=m
+CONFIG_NETFILTER_XT_MATCH_CONNBYTES=m
+CONFIG_NETFILTER_XT_MATCH_CONNMARK=m
+CONFIG_NETFILTER_XT_MATCH_CONNTRACK=m
+CONFIG_NETFILTER_XT_MATCH_DCCP=m
+CONFIG_NETFILTER_XT_MATCH_DSCP=m
+CONFIG_NETFILTER_XT_MATCH_ESP=m
+CONFIG_NETFILTER_XT_MATCH_HELPER=m
+CONFIG_NETFILTER_XT_MATCH_LENGTH=m
+CONFIG_NETFILTER_XT_MATCH_LIMIT=m
+CONFIG_NETFILTER_XT_MATCH_MAC=m
+CONFIG_NETFILTER_XT_MATCH_MARK=m
+CONFIG_NETFILTER_XT_MATCH_POLICY=m
+CONFIG_NETFILTER_XT_MATCH_MULTIPORT=m
+CONFIG_NETFILTER_XT_MATCH_PHYSDEV=m
+CONFIG_NETFILTER_XT_MATCH_PKTTYPE=m
+CONFIG_NETFILTER_XT_MATCH_QUOTA=m
+CONFIG_NETFILTER_XT_MATCH_REALM=m
+CONFIG_NETFILTER_XT_MATCH_SCTP=m
+CONFIG_NETFILTER_XT_MATCH_STATE=m
+CONFIG_NETFILTER_XT_MATCH_STATISTIC=m
+CONFIG_NETFILTER_XT_MATCH_STRING=m
+CONFIG_NETFILTER_XT_MATCH_TCPMSS=m
+CONFIG_NETFILTER_XT_MATCH_HASHLIMIT=m
+
+#
+# IP: Netfilter Configuration
+#
+CONFIG_NF_CONNTRACK_IPV4=m
+CONFIG_NF_CONNTRACK_PROC_COMPAT=y
+CONFIG_IP_NF_QUEUE=m
+CONFIG_IP_NF_IPTABLES=m
+CONFIG_IP_NF_MATCH_IPRANGE=m
+CONFIG_IP_NF_MATCH_TOS=m
+CONFIG_IP_NF_MATCH_RECENT=m
+CONFIG_IP_NF_MATCH_ECN=m
+CONFIG_IP_NF_MATCH_AH=m
+CONFIG_IP_NF_MATCH_TTL=m
+CONFIG_IP_NF_MATCH_OWNER=m
+CONFIG_IP_NF_MATCH_ADDRTYPE=m
+CONFIG_IP_NF_FILTER=m
+CONFIG_IP_NF_TARGET_REJECT=m
+CONFIG_IP_NF_TARGET_LOG=m
+CONFIG_IP_NF_TARGET_ULOG=m
+CONFIG_NF_NAT=m
+CONFIG_NF_NAT_NEEDED=y
+CONFIG_IP_NF_TARGET_MASQUERADE=m
+CONFIG_IP_NF_TARGET_REDIRECT=m
+CONFIG_IP_NF_TARGET_NETMAP=m
+CONFIG_IP_NF_TARGET_SAME=m
+CONFIG_NF_NAT_SNMP_BASIC=m
+CONFIG_NF_NAT_PROTO_GRE=m
+CONFIG_NF_NAT_FTP=m
+CONFIG_NF_NAT_IRC=m
+CONFIG_NF_NAT_TFTP=m
+CONFIG_NF_NAT_AMANDA=m
+CONFIG_NF_NAT_PPTP=m
+CONFIG_NF_NAT_H323=m
+CONFIG_NF_NAT_SIP=m
+CONFIG_IP_NF_MANGLE=m
+CONFIG_IP_NF_TARGET_TOS=m
+CONFIG_IP_NF_TARGET_ECN=m
+CONFIG_IP_NF_TARGET_TTL=m
+CONFIG_IP_NF_TARGET_CLUSTERIP=m
+CONFIG_IP_NF_RAW=m
+CONFIG_IP_NF_ARPTABLES=m
+CONFIG_IP_NF_ARPFILTER=m
+CONFIG_IP_NF_ARP_MANGLE=m
+
+#
+# IPv6: Netfilter Configuration (EXPERIMENTAL)
+#
+CONFIG_NF_CONNTRACK_IPV6=m
+CONFIG_IP6_NF_QUEUE=m
+CONFIG_IP6_NF_IPTABLES=m
+CONFIG_IP6_NF_MATCH_RT=m
+CONFIG_IP6_NF_MATCH_OPTS=m
+CONFIG_IP6_NF_MATCH_FRAG=m
+CONFIG_IP6_NF_MATCH_HL=m
+CONFIG_IP6_NF_MATCH_OWNER=m
+CONFIG_IP6_NF_MATCH_IPV6HEADER=m
+CONFIG_IP6_NF_MATCH_AH=m
+CONFIG_IP6_NF_MATCH_MH=m
+CONFIG_IP6_NF_MATCH_EUI64=m
+CONFIG_IP6_NF_FILTER=m
+CONFIG_IP6_NF_TARGET_LOG=m
+CONFIG_IP6_NF_TARGET_REJECT=m
+CONFIG_IP6_NF_MANGLE=m
+CONFIG_IP6_NF_TARGET_HL=m
+CONFIG_IP6_NF_RAW=m
+
+#
+# DECnet: Netfilter Configuration
+#
+CONFIG_DECNET_NF_GRABULATOR=m
+
+#
+# Bridge: Netfilter Configuration
+#
+CONFIG_BRIDGE_NF_EBTABLES=m
+CONFIG_BRIDGE_EBT_BROUTE=m
+CONFIG_BRIDGE_EBT_T_FILTER=m
+CONFIG_BRIDGE_EBT_T_NAT=m
+CONFIG_BRIDGE_EBT_802_3=m
+CONFIG_BRIDGE_EBT_AMONG=m
+CONFIG_BRIDGE_EBT_ARP=m
+CONFIG_BRIDGE_EBT_IP=m
+CONFIG_BRIDGE_EBT_LIMIT=m
+CONFIG_BRIDGE_EBT_MARK=m
+CONFIG_BRIDGE_EBT_PKTTYPE=m
+CONFIG_BRIDGE_EBT_STP=m
+CONFIG_BRIDGE_EBT_VLAN=m
+CONFIG_BRIDGE_EBT_ARPREPLY=m
+CONFIG_BRIDGE_EBT_DNAT=m
+CONFIG_BRIDGE_EBT_MARK_T=m
+CONFIG_BRIDGE_EBT_REDIRECT=m
+CONFIG_BRIDGE_EBT_SNAT=m
+CONFIG_BRIDGE_EBT_LOG=m
+CONFIG_BRIDGE_EBT_ULOG=m
+CONFIG_IP_DCCP=m
+CONFIG_INET_DCCP_DIAG=m
+CONFIG_IP_DCCP_ACKVEC=y
+
+#
+# DCCP CCIDs Configuration (EXPERIMENTAL)
+#
+CONFIG_IP_DCCP_CCID2=m
+# CONFIG_IP_DCCP_CCID2_DEBUG is not set
+CONFIG_IP_DCCP_CCID3=m
+CONFIG_IP_DCCP_TFRC_LIB=m
+# CONFIG_IP_DCCP_CCID3_DEBUG is not set
+CONFIG_IP_DCCP_CCID3_RTO=100
+CONFIG_IP_SCTP=m
+# CONFIG_SCTP_DBG_MSG is not set
+# CONFIG_SCTP_DBG_OBJCNT is not set
+# CONFIG_SCTP_HMAC_NONE is not set
+# CONFIG_SCTP_HMAC_SHA1 is not set
+CONFIG_SCTP_HMAC_MD5=y
+CONFIG_TIPC=m
+CONFIG_TIPC_ADVANCED=y
+CONFIG_TIPC_ZONES=3
+CONFIG_TIPC_CLUSTERS=1
+CONFIG_TIPC_NODES=255
+CONFIG_TIPC_SLAVE_NODES=0
+CONFIG_TIPC_PORTS=8191
+CONFIG_TIPC_LOG=0
+# CONFIG_TIPC_DEBUG is not set
+CONFIG_ATM=m
+CONFIG_ATM_CLIP=m
+# CONFIG_ATM_CLIP_NO_ICMP is not set
+CONFIG_ATM_LANE=m
+CONFIG_ATM_MPOA=m
+CONFIG_ATM_BR2684=m
+# CONFIG_ATM_BR2684_IPFILTER is not set
+CONFIG_BRIDGE=m
+CONFIG_VLAN_8021Q=m
+CONFIG_DECNET=m
+# CONFIG_DECNET_ROUTER is not set
+CONFIG_LLC=y
+CONFIG_LLC2=m
+CONFIG_IPX=m
+# CONFIG_IPX_INTERN is not set
+CONFIG_ATALK=m
+CONFIG_DEV_APPLETALK=m
+CONFIG_IPDDP=m
+CONFIG_IPDDP_ENCAP=y
+CONFIG_IPDDP_DECAP=y
+CONFIG_X25=m
+CONFIG_LAPB=m
+CONFIG_ECONET=m
+CONFIG_ECONET_AUNUDP=y
+CONFIG_ECONET_NATIVE=y
+CONFIG_WAN_ROUTER=m
+
+#
+# QoS and/or fair queueing
+#
+CONFIG_NET_SCHED=y
+CONFIG_NET_SCH_FIFO=y
+
+#
+# Queueing/Scheduling
+#
+CONFIG_NET_SCH_CBQ=m
+CONFIG_NET_SCH_HTB=m
+CONFIG_NET_SCH_HFSC=m
+CONFIG_NET_SCH_ATM=m
+CONFIG_NET_SCH_PRIO=m
+CONFIG_NET_SCH_RED=m
+CONFIG_NET_SCH_SFQ=m
+CONFIG_NET_SCH_TEQL=m
+CONFIG_NET_SCH_TBF=m
+CONFIG_NET_SCH_GRED=m
+CONFIG_NET_SCH_DSMARK=m
+CONFIG_NET_SCH_NETEM=m
+CONFIG_NET_SCH_INGRESS=m
+
+#
+# Classification
+#
+CONFIG_NET_CLS=y
+CONFIG_NET_CLS_BASIC=m
+CONFIG_NET_CLS_TCINDEX=m
+CONFIG_NET_CLS_ROUTE4=m
+CONFIG_NET_CLS_ROUTE=y
+CONFIG_NET_CLS_FW=m
+CONFIG_NET_CLS_U32=m
+CONFIG_CLS_U32_PERF=y
+CONFIG_CLS_U32_MARK=y
+CONFIG_NET_CLS_RSVP=m
+CONFIG_NET_CLS_RSVP6=m
+CONFIG_NET_EMATCH=y
+CONFIG_NET_EMATCH_STACK=32
+CONFIG_NET_EMATCH_CMP=m
+CONFIG_NET_EMATCH_NBYTE=m
+CONFIG_NET_EMATCH_U32=m
+# CONFIG_NET_EMATCH_META is not set
+CONFIG_NET_EMATCH_TEXT=m
+CONFIG_NET_CLS_ACT=y
+CONFIG_NET_ACT_POLICE=m
+CONFIG_NET_ACT_GACT=m
+CONFIG_GACT_PROB=y
+CONFIG_NET_ACT_MIRRED=m
+CONFIG_NET_ACT_IPT=m
+CONFIG_NET_ACT_PEDIT=m
+CONFIG_NET_ACT_SIMP=m
+CONFIG_NET_CLS_IND=y
+CONFIG_NET_ESTIMATOR=y
+
+#
+# Network testing
+#
+CONFIG_NET_PKTGEN=m
+CONFIG_HAMRADIO=y
+
+#
+# Packet Radio protocols
+#
+CONFIG_AX25=m
+# CONFIG_AX25_DAMA_SLAVE is not set
+CONFIG_NETROM=m
+CONFIG_ROSE=m
+
+#
+# AX.25 network device drivers
+#
+CONFIG_MKISS=m
+CONFIG_6PACK=m
+CONFIG_BPQETHER=m
+CONFIG_BAYCOM_SER_FDX=m
+CONFIG_BAYCOM_SER_HDX=m
+CONFIG_BAYCOM_PAR=m
+CONFIG_YAM=m
+CONFIG_IRDA=m
+
+#
+# IrDA protocols
+#
+CONFIG_IRLAN=m
+CONFIG_IRNET=m
+CONFIG_IRCOMM=m
+# CONFIG_IRDA_ULTRA is not set
+
+#
+# IrDA options
+#
+CONFIG_IRDA_CACHE_LAST_LSAP=y
+CONFIG_IRDA_FAST_RR=y
+CONFIG_IRDA_DEBUG=y
+
+#
+# Infrared-port device drivers
+#
+
+#
+# SIR device drivers
+#
+CONFIG_IRTTY_SIR=m
+
+#
+# Dongle support
+#
+CONFIG_DONGLE=y
+CONFIG_ESI_DONGLE=m
+CONFIG_ACTISYS_DONGLE=m
+CONFIG_TEKRAM_DONGLE=m
+CONFIG_TOIM3232_DONGLE=m
+CONFIG_LITELINK_DONGLE=m
+CONFIG_MA600_DONGLE=m
+CONFIG_GIRBIL_DONGLE=m
+CONFIG_MCP2120_DONGLE=m
+CONFIG_OLD_BELKIN_DONGLE=m
+CONFIG_ACT200L_DONGLE=m
+# CONFIG_KINGSUN_DONGLE is not set
+
+#
+# Old SIR device drivers
+#
+CONFIG_IRPORT_SIR=m
+
+#
+# Old Serial dongle support
+#
+# CONFIG_DONGLE_OLD is not set
+
+#
+# FIR device drivers
+#
+CONFIG_USB_IRDA=m
+CONFIG_SIGMATEL_FIR=m
+CONFIG_VLSI_FIR=m
+CONFIG_MCS_FIR=m
+CONFIG_BT=m
+CONFIG_BT_L2CAP=m
+CONFIG_BT_SCO=m
+CONFIG_BT_RFCOMM=m
+CONFIG_BT_RFCOMM_TTY=y
+CONFIG_BT_BNEP=m
+CONFIG_BT_BNEP_MC_FILTER=y
+CONFIG_BT_BNEP_PROTO_FILTER=y
+CONFIG_BT_CMTP=m
+CONFIG_BT_HIDP=m
+
+#
+# Bluetooth device drivers
+#
+CONFIG_BT_HCIUSB=m
+CONFIG_BT_HCIUSB_SCO=y
+CONFIG_BT_HCIUART=m
+CONFIG_BT_HCIUART_H4=y
+CONFIG_BT_HCIUART_BCSP=y
+CONFIG_BT_HCIBCM203X=m
+CONFIG_BT_HCIBPA10X=m
+CONFIG_BT_HCIBFUSB=m
+CONFIG_BT_HCIVHCI=m
+CONFIG_AF_RXRPC=m
+# CONFIG_AF_RXRPC_DEBUG is not set
+# CONFIG_RXKAD is not set
+CONFIG_FIB_RULES=y
+
+#
+# Wireless
+#
+CONFIG_CFG80211=m
+CONFIG_WIRELESS_EXT=y
+CONFIG_MAC80211=m
+# CONFIG_MAC80211_DEBUG is not set
+CONFIG_IEEE80211=m
+# CONFIG_IEEE80211_DEBUG is not set
+CONFIG_IEEE80211_CRYPT_WEP=m
+CONFIG_IEEE80211_CRYPT_CCMP=m
+CONFIG_IEEE80211_CRYPT_TKIP=m
+CONFIG_IEEE80211_SOFTMAC=m
+# CONFIG_IEEE80211_SOFTMAC_DEBUG is not set
+CONFIG_RFKILL=m
+CONFIG_RFKILL_INPUT=m
+
+#
+# Device Drivers
+#
+
+#
+# Generic Driver Options
+#
+CONFIG_STANDALONE=y
+CONFIG_PREVENT_FIRMWARE_BUILD=y
+CONFIG_FW_LOADER=m
+# CONFIG_SYS_HYPERVISOR is not set
+
+#
+# Connector - unified userspace <-> kernelspace linker
+#
+CONFIG_CONNECTOR=m
+CONFIG_MTD=m
+# CONFIG_MTD_DEBUG is not set
+CONFIG_MTD_CONCAT=m
+CONFIG_MTD_PARTITIONS=y
+CONFIG_MTD_REDBOOT_PARTS=m
+CONFIG_MTD_REDBOOT_DIRECTORY_BLOCK=-1
+# CONFIG_MTD_REDBOOT_PARTS_UNALLOCATED is not set
+# CONFIG_MTD_REDBOOT_PARTS_READONLY is not set
+
+#
+# User Modules And Translation Layers
+#
+CONFIG_MTD_CHAR=m
+CONFIG_MTD_BLKDEVS=m
+CONFIG_MTD_BLOCK=m
+CONFIG_MTD_BLOCK_RO=m
+CONFIG_FTL=m
+CONFIG_NFTL=m
+CONFIG_NFTL_RW=y
+CONFIG_INFTL=m
+CONFIG_RFD_FTL=m
+CONFIG_SSFDC=m
+
+#
+# RAM/ROM/Flash chip drivers
+#
+CONFIG_MTD_CFI=m
+CONFIG_MTD_JEDECPROBE=m
+CONFIG_MTD_GEN_PROBE=m
+# CONFIG_MTD_CFI_ADV_OPTIONS is not set
+CONFIG_MTD_MAP_BANK_WIDTH_1=y
+CONFIG_MTD_MAP_BANK_WIDTH_2=y
+CONFIG_MTD_MAP_BANK_WIDTH_4=y
+# CONFIG_MTD_MAP_BANK_WIDTH_8 is not set
+# CONFIG_MTD_MAP_BANK_WIDTH_16 is not set
+# CONFIG_MTD_MAP_BANK_WIDTH_32 is not set
+CONFIG_MTD_CFI_I1=y
+CONFIG_MTD_CFI_I2=y
+# CONFIG_MTD_CFI_I4 is not set
+# CONFIG_MTD_CFI_I8 is not set
+CONFIG_MTD_CFI_INTELEXT=m
+CONFIG_MTD_CFI_AMDSTD=m
+CONFIG_MTD_CFI_STAA=m
+CONFIG_MTD_CFI_UTIL=m
+CONFIG_MTD_RAM=m
+CONFIG_MTD_ROM=m
+CONFIG_MTD_ABSENT=m
+
+#
+# Mapping drivers for chip access
+#
+CONFIG_MTD_COMPLEX_MAPPINGS=y
+CONFIG_MTD_PHYSMAP=m
+CONFIG_MTD_PHYSMAP_START=0x8000000
+CONFIG_MTD_PHYSMAP_LEN=0x0
+CONFIG_MTD_PHYSMAP_BANKWIDTH=2
+CONFIG_MTD_PCI=m
+CONFIG_MTD_PLATRAM=m
+
+#
+# Self-contained MTD device drivers
+#
+CONFIG_MTD_PMC551=m
+# CONFIG_MTD_PMC551_BUGFIX is not set
+# CONFIG_MTD_PMC551_DEBUG is not set
+CONFIG_MTD_DATAFLASH=m
+CONFIG_MTD_M25P80=m
+CONFIG_MTD_SLRAM=m
+CONFIG_MTD_PHRAM=m
+CONFIG_MTD_MTDRAM=m
+CONFIG_MTDRAM_TOTAL_SIZE=4096
+CONFIG_MTDRAM_ERASE_SIZE=128
+CONFIG_MTD_BLOCK2MTD=m
+
+#
+# Disk-On-Chip Device Drivers
+#
+CONFIG_MTD_DOC2000=m
+CONFIG_MTD_DOC2001=m
+CONFIG_MTD_DOC2001PLUS=m
+CONFIG_MTD_DOCPROBE=m
+CONFIG_MTD_DOCECC=m
+# CONFIG_MTD_DOCPROBE_ADVANCED is not set
+CONFIG_MTD_DOCPROBE_ADDRESS=0
+CONFIG_MTD_NAND=m
+# CONFIG_MTD_NAND_VERIFY_WRITE is not set
+# CONFIG_MTD_NAND_ECC_SMC is not set
+# CONFIG_MTD_NAND_MUSEUM_IDS is not set
+CONFIG_MTD_NAND_IDS=m
+CONFIG_MTD_NAND_DISKONCHIP=m
+# CONFIG_MTD_NAND_DISKONCHIP_PROBE_ADVANCED is not set
+CONFIG_MTD_NAND_DISKONCHIP_PROBE_ADDRESS=0
+# CONFIG_MTD_NAND_DISKONCHIP_BBTWRITE is not set
+CONFIG_MTD_NAND_CAFE=m
+# CONFIG_MTD_NAND_NANDSIM is not set
+# CONFIG_MTD_NAND_PLATFORM is not set
+CONFIG_MTD_ONENAND=m
+CONFIG_MTD_ONENAND_VERIFY_WRITE=y
+# CONFIG_MTD_ONENAND_OTP is not set
+
+#
+# UBI - Unsorted block images
+#
+CONFIG_MTD_UBI=m
+CONFIG_MTD_UBI_WL_THRESHOLD=4096
+CONFIG_MTD_UBI_BEB_RESERVE=1
+# CONFIG_MTD_UBI_GLUEBI is not set
+
+#
+# UBI debugging options
+#
+# CONFIG_MTD_UBI_DEBUG is not set
+
+#
+# Parallel port support
+#
+CONFIG_PARPORT=m
+CONFIG_PARPORT_PC=m
+CONFIG_PARPORT_SERIAL=m
+CONFIG_PARPORT_PC_FIFO=y
+# CONFIG_PARPORT_PC_SUPERIO is not set
+# CONFIG_PARPORT_GSC is not set
+# CONFIG_PARPORT_AX88796 is not set
+CONFIG_PARPORT_1284=y
+CONFIG_PARPORT_NOT_PC=y
+
+#
+# Plug and Play support
+#
+# CONFIG_PNPACPI is not set
+
+#
+# Block devices
+#
+CONFIG_BLK_DEV_FD=m
+CONFIG_PARIDE=m
+
+#
+# Parallel IDE high-level drivers
+#
+CONFIG_PARIDE_PD=m
+CONFIG_PARIDE_PCD=m
+CONFIG_PARIDE_PF=m
+CONFIG_PARIDE_PT=m
+CONFIG_PARIDE_PG=m
+
+#
+# Parallel IDE protocol modules
+#
+CONFIG_PARIDE_ATEN=m
+CONFIG_PARIDE_BPCK=m
+CONFIG_PARIDE_COMM=m
+CONFIG_PARIDE_DSTR=m
+CONFIG_PARIDE_FIT2=m
+CONFIG_PARIDE_FIT3=m
+CONFIG_PARIDE_EPAT=m
+# CONFIG_PARIDE_EPATC8 is not set
+CONFIG_PARIDE_EPIA=m
+CONFIG_PARIDE_FRIQ=m
+CONFIG_PARIDE_FRPW=m
+CONFIG_PARIDE_KBIC=m
+CONFIG_PARIDE_KTTI=m
+CONFIG_PARIDE_ON20=m
+CONFIG_PARIDE_ON26=m
+# CONFIG_BLK_CPQ_DA is not set
+CONFIG_BLK_CPQ_CISS_DA=m
+CONFIG_CISS_SCSI_TAPE=y
+CONFIG_BLK_DEV_DAC960=m
+CONFIG_BLK_DEV_UMEM=m
+# CONFIG_BLK_DEV_COW_COMMON is not set
+CONFIG_BLK_DEV_LOOP=m
+CONFIG_BLK_DEV_CRYPTOLOOP=m
+CONFIG_BLK_DEV_NBD=m
+CONFIG_BLK_DEV_SX8=m
+# CONFIG_BLK_DEV_UB is not set
+CONFIG_BLK_DEV_RAM=y
+CONFIG_BLK_DEV_RAM_COUNT=16
+CONFIG_BLK_DEV_RAM_SIZE=65536
+CONFIG_BLK_DEV_RAM_BLOCKSIZE=1024
+CONFIG_CDROM_PKTCDVD=m
+CONFIG_CDROM_PKTCDVD_BUFFERS=8
+# CONFIG_CDROM_PKTCDVD_WCACHE is not set
+CONFIG_ATA_OVER_ETH=m
+
+#
+# Misc devices
+#
+# CONFIG_PHANTOM is not set
+# CONFIG_SGI_IOC4 is not set
+CONFIG_TIFM_CORE=m
+CONFIG_TIFM_7XX1=m
+CONFIG_IDE=y
+CONFIG_IDE_MAX_HWIFS=4
+CONFIG_BLK_DEV_IDE=y
+
+#
+# Please see Documentation/ide.txt for help/info on IDE drives
+#
+# CONFIG_BLK_DEV_IDE_SATA is not set
+CONFIG_BLK_DEV_IDEDISK=y
+# CONFIG_IDEDISK_MULTI_MODE is not set
+CONFIG_BLK_DEV_IDECD=m
+CONFIG_BLK_DEV_IDETAPE=m
+CONFIG_BLK_DEV_IDEFLOPPY=m
+CONFIG_BLK_DEV_IDESCSI=m
+# CONFIG_IDE_TASK_IOCTL is not set
+CONFIG_IDE_PROC_FS=y
+
+#
+# IDE chipset support/bugfixes
+#
+CONFIG_IDE_GENERIC=y
+CONFIG_BLK_DEV_IDEPCI=y
+CONFIG_IDEPCI_SHARE_IRQ=y
+CONFIG_IDEPCI_PCIBUS_ORDER=y
+# CONFIG_BLK_DEV_OFFBOARD is not set
+CONFIG_BLK_DEV_GENERIC=y
+# CONFIG_BLK_DEV_OPTI621 is not set
+CONFIG_BLK_DEV_IDEDMA_PCI=y
+# CONFIG_BLK_DEV_IDEDMA_FORCED is not set
+# CONFIG_IDEDMA_ONLYDISK is not set
+# CONFIG_BLK_DEV_AEC62XX is not set
+# CONFIG_BLK_DEV_ALI15X3 is not set
+# CONFIG_BLK_DEV_AMD74XX is not set
+CONFIG_BLK_DEV_CMD64X=y
+# CONFIG_BLK_DEV_TRIFLEX is not set
+# CONFIG_BLK_DEV_CY82C693 is not set
+# CONFIG_BLK_DEV_CS5520 is not set
+# CONFIG_BLK_DEV_CS5530 is not set
+CONFIG_BLK_DEV_HPT34X=y
+# CONFIG_HPT34X_AUTODMA is not set
+CONFIG_BLK_DEV_HPT366=y
+# CONFIG_BLK_DEV_JMICRON is not set
+# CONFIG_BLK_DEV_SC1200 is not set
+CONFIG_BLK_DEV_PIIX=y
+# CONFIG_BLK_DEV_IT821X is not set
+# CONFIG_BLK_DEV_NS87415 is not set
+CONFIG_BLK_DEV_PDC202XX_OLD=y
+# CONFIG_PDC202XX_BURST is not set
+CONFIG_BLK_DEV_PDC202XX_NEW=y
+# CONFIG_BLK_DEV_SVWKS is not set
+CONFIG_BLK_DEV_SIIMAGE=y
+# CONFIG_BLK_DEV_SLC90E66 is not set
+# CONFIG_BLK_DEV_TRM290 is not set
+# CONFIG_BLK_DEV_VIA82CXXX is not set
+# CONFIG_IDE_ARM is not set
+CONFIG_BLK_DEV_IDEDMA=y
+# CONFIG_IDEDMA_IVB is not set
+# CONFIG_BLK_DEV_HD is not set
+
+#
+# SCSI device support
+#
+CONFIG_RAID_ATTRS=m
+CONFIG_SCSI=y
+CONFIG_SCSI_TGT=m
+CONFIG_SCSI_NETLINK=y
+CONFIG_SCSI_PROC_FS=y
+
+#
+# SCSI support type (disk, tape, CD-ROM)
+#
+CONFIG_BLK_DEV_SD=m
+CONFIG_CHR_DEV_ST=m
+CONFIG_CHR_DEV_OSST=m
+CONFIG_BLK_DEV_SR=m
+CONFIG_BLK_DEV_SR_VENDOR=y
+CONFIG_CHR_DEV_SG=m
+CONFIG_CHR_DEV_SCH=m
+
+#
+# Some SCSI devices (e.g. CD jukebox) support multiple LUNs
+#
+CONFIG_SCSI_MULTI_LUN=y
+CONFIG_SCSI_CONSTANTS=y
+CONFIG_SCSI_LOGGING=y
+CONFIG_SCSI_SCAN_ASYNC=y
+
+#
+# SCSI Transports
+#
+CONFIG_SCSI_SPI_ATTRS=m
+CONFIG_SCSI_FC_ATTRS=m
+CONFIG_SCSI_ISCSI_ATTRS=m
+CONFIG_SCSI_SAS_ATTRS=m
+CONFIG_SCSI_SAS_LIBSAS=m
+# CONFIG_SCSI_SAS_LIBSAS_DEBUG is not set
+
+#
+# SCSI low-level drivers
+#
+CONFIG_ISCSI_TCP=m
+CONFIG_BLK_DEV_3W_XXXX_RAID=m
+CONFIG_SCSI_3W_9XXX=m
+CONFIG_SCSI_ACARD=m
+CONFIG_SCSI_AACRAID=m
+CONFIG_SCSI_AIC7XXX=m
+CONFIG_AIC7XXX_CMDS_PER_DEVICE=8
+CONFIG_AIC7XXX_RESET_DELAY_MS=15000
+CONFIG_AIC7XXX_DEBUG_ENABLE=y
+CONFIG_AIC7XXX_DEBUG_MASK=0
+CONFIG_AIC7XXX_REG_PRETTY_PRINT=y
+CONFIG_SCSI_AIC7XXX_OLD=m
+CONFIG_SCSI_AIC79XX=m
+CONFIG_AIC79XX_CMDS_PER_DEVICE=32
+CONFIG_AIC79XX_RESET_DELAY_MS=15000
+CONFIG_AIC79XX_DEBUG_ENABLE=y
+CONFIG_AIC79XX_DEBUG_MASK=0
+CONFIG_AIC79XX_REG_PRETTY_PRINT=y
+CONFIG_SCSI_AIC94XX=m
+# CONFIG_AIC94XX_DEBUG is not set
+CONFIG_SCSI_ARCMSR=m
+CONFIG_MEGARAID_NEWGEN=y
+CONFIG_MEGARAID_MM=m
+CONFIG_MEGARAID_MAILBOX=m
+CONFIG_MEGARAID_LEGACY=m
+CONFIG_MEGARAID_SAS=m
+CONFIG_SCSI_HPTIOP=m
+CONFIG_SCSI_DMX3191D=m
+CONFIG_SCSI_FUTURE_DOMAIN=m
+CONFIG_SCSI_IPS=m
+CONFIG_SCSI_INITIO=m
+CONFIG_SCSI_INIA100=m
+CONFIG_SCSI_PPA=m
+CONFIG_SCSI_IMM=m
+# CONFIG_SCSI_IZIP_EPP16 is not set
+# CONFIG_SCSI_IZIP_SLOW_CTR is not set
+CONFIG_SCSI_STEX=m
+CONFIG_SCSI_SYM53C8XX_2=m
+CONFIG_SCSI_SYM53C8XX_DMA_ADDRESSING_MODE=1
+CONFIG_SCSI_SYM53C8XX_DEFAULT_TAGS=16
+CONFIG_SCSI_SYM53C8XX_MAX_TAGS=64
+CONFIG_SCSI_SYM53C8XX_MMIO=y
+# CONFIG_SCSI_IPR is not set
+CONFIG_SCSI_QLOGIC_1280=m
+CONFIG_SCSI_QLA_FC=m
+CONFIG_SCSI_QLA_ISCSI=m
+CONFIG_SCSI_LPFC=m
+CONFIG_SCSI_DC395x=m
+CONFIG_SCSI_DC390T=m
+CONFIG_SCSI_DEBUG=m
+CONFIG_SCSI_SRP=m
+CONFIG_ATA=y
+# CONFIG_ATA_NONSTANDARD is not set
+CONFIG_SATA_AHCI=y
+# CONFIG_SATA_SVW is not set
+# CONFIG_ATA_PIIX is not set
+CONFIG_SATA_MV=y
+# CONFIG_SATA_NV is not set
+# CONFIG_PDC_ADMA is not set
+# CONFIG_SATA_QSTOR is not set
+CONFIG_SATA_PROMISE=y
+CONFIG_SATA_SX4=y
+CONFIG_SATA_SIL=y
+CONFIG_SATA_SIL24=y
+# CONFIG_SATA_SIS is not set
+# CONFIG_SATA_ULI is not set
+# CONFIG_SATA_VIA is not set
+# CONFIG_SATA_VITESSE is not set
+CONFIG_SATA_INIC162X=m
+# CONFIG_ATA_GENERIC is not set
+
+#
+# Multi-device support (RAID and LVM)
+#
+CONFIG_MD=y
+CONFIG_BLK_DEV_MD=m
+CONFIG_MD_LINEAR=m
+CONFIG_MD_RAID0=m
+CONFIG_MD_RAID1=m
+CONFIG_MD_RAID10=m
+CONFIG_MD_RAID456=m
+CONFIG_MD_RAID5_RESHAPE=y
+CONFIG_MD_MULTIPATH=m
+CONFIG_MD_FAULTY=m
+CONFIG_BLK_DEV_DM=m
+# CONFIG_DM_DEBUG is not set
+CONFIG_DM_CRYPT=m
+CONFIG_DM_SNAPSHOT=m
+CONFIG_DM_MIRROR=m
+CONFIG_DM_ZERO=m
+CONFIG_DM_MULTIPATH=m
+CONFIG_DM_MULTIPATH_EMC=m
+CONFIG_DM_DELAY=m
+
+#
+# Fusion MPT device support
+#
+CONFIG_FUSION=y
+CONFIG_FUSION_SPI=m
+CONFIG_FUSION_FC=m
+CONFIG_FUSION_SAS=m
+CONFIG_FUSION_MAX_SGE=40
+CONFIG_FUSION_CTL=m
+CONFIG_FUSION_LAN=m
+
+#
+# IEEE 1394 (FireWire) support
+#
+CONFIG_FIREWIRE=m
+CONFIG_FIREWIRE_OHCI=m
+CONFIG_FIREWIRE_SBP2=m
+# CONFIG_IEEE1394 is not set
+
+#
+# I2O device support
+#
+CONFIG_I2O=m
+CONFIG_I2O_LCT_NOTIFY_ON_CHANGES=y
+CONFIG_I2O_EXT_ADAPTEC=y
+CONFIG_I2O_EXT_ADAPTEC_DMA64=y
+CONFIG_I2O_CONFIG=m
+CONFIG_I2O_CONFIG_OLD_IOCTL=y
+CONFIG_I2O_BUS=m
+CONFIG_I2O_BLOCK=m
+CONFIG_I2O_SCSI=m
+CONFIG_I2O_PROC=m
+
+#
+# Network device support
+#
+CONFIG_NETDEVICES=y
+CONFIG_IFB=m
+CONFIG_DUMMY=m
+CONFIG_BONDING=m
+CONFIG_EQUALIZER=m
+CONFIG_TUN=m
+CONFIG_ARCNET=m
+CONFIG_ARCNET_1201=m
+CONFIG_ARCNET_1051=m
+CONFIG_ARCNET_RAW=m
+CONFIG_ARCNET_CAP=m
+CONFIG_ARCNET_COM90xx=m
+CONFIG_ARCNET_COM90xxIO=m
+CONFIG_ARCNET_RIM_I=m
+CONFIG_ARCNET_COM20020=m
+CONFIG_ARCNET_COM20020_PCI=m
+CONFIG_PHYLIB=m
+
+#
+# MII PHY device drivers
+#
+CONFIG_MARVELL_PHY=m
+CONFIG_DAVICOM_PHY=m
+# CONFIG_QSEMI_PHY is not set
+CONFIG_LXT_PHY=m
+# CONFIG_CICADA_PHY is not set
+# CONFIG_VITESSE_PHY is not set
+CONFIG_SMSC_PHY=m
+CONFIG_BROADCOM_PHY=m
+CONFIG_FIXED_PHY=m
+# CONFIG_FIXED_MII_10_FDX is not set
+# CONFIG_FIXED_MII_100_FDX is not set
+
+#
+# Ethernet (10 or 100Mbit)
+#
+CONFIG_NET_ETHERNET=y
+CONFIG_MII=y
+# CONFIG_HAPPYMEAL is not set
+# CONFIG_SUNGEM is not set
+# CONFIG_CASSINI is not set
+CONFIG_NET_VENDOR_3COM=y
+CONFIG_VORTEX=m
+CONFIG_TYPHOON=m
+# CONFIG_DM9000 is not set
+
+#
+# Tulip family network device support
+#
+CONFIG_NET_TULIP=y
+CONFIG_DE2104X=m
+CONFIG_TULIP=m
+# CONFIG_TULIP_MWI is not set
+# CONFIG_TULIP_MMIO is not set
+# CONFIG_TULIP_NAPI is not set
+CONFIG_DE4X5=m
+# CONFIG_WINBOND_840 is not set
+CONFIG_DM9102=m
+# CONFIG_ULI526X is not set
+# CONFIG_HP100 is not set
+CONFIG_NET_PCI=y
+CONFIG_PCNET32=y
+CONFIG_PCNET32_NAPI=y
+CONFIG_AMD8111_ETH=m
+CONFIG_AMD8111E_NAPI=y
+CONFIG_ADAPTEC_STARFIRE=m
+CONFIG_ADAPTEC_STARFIRE_NAPI=y
+CONFIG_B44=m
+# CONFIG_FORCEDETH is not set
+# CONFIG_TC35815 is not set
+CONFIG_EEPRO100=m
+CONFIG_E100=m
+CONFIG_FEALNX=m
+CONFIG_NATSEMI=m
+CONFIG_NE2K_PCI=m
+CONFIG_8139CP=m
+CONFIG_8139TOO=m
+# CONFIG_8139TOO_PIO is not set
+CONFIG_8139TOO_TUNE_TWISTER=y
+CONFIG_8139TOO_8129=y
+# CONFIG_8139_OLD_RX_RESET is not set
+CONFIG_SIS900=m
+CONFIG_EPIC100=m
+CONFIG_SUNDANCE=m
+# CONFIG_SUNDANCE_MMIO is not set
+CONFIG_VIA_RHINE=m
+# CONFIG_VIA_RHINE_MMIO is not set
+CONFIG_VIA_RHINE_NAPI=y
+CONFIG_SC92031=m
+CONFIG_NET_POCKET=y
+CONFIG_DE600=m
+CONFIG_DE620=m
+CONFIG_NETDEV_1000=y
+CONFIG_ACENIC=m
+# CONFIG_ACENIC_OMIT_TIGON_I is not set
+CONFIG_DL2K=m
+CONFIG_E1000=m
+CONFIG_E1000_NAPI=y
+# CONFIG_E1000_DISABLE_PACKET_SPLIT is not set
+CONFIG_NS83820=m
+CONFIG_HAMACHI=m
+CONFIG_YELLOWFIN=m
+CONFIG_R8169=m
+CONFIG_R8169_NAPI=y
+CONFIG_R8169_VLAN=y
+CONFIG_SIS190=m
+CONFIG_SKGE=m
+CONFIG_SKY2=m
+# CONFIG_SK98LIN is not set
+CONFIG_VIA_VELOCITY=m
+CONFIG_TIGON3=m
+CONFIG_BNX2=m
+CONFIG_QLA3XXX=m
+CONFIG_ATL1=m
+CONFIG_NETDEV_10000=y
+CONFIG_CHELSIO_T1=m
+CONFIG_CHELSIO_T1_1G=y
+CONFIG_CHELSIO_T1_NAPI=y
+CONFIG_CHELSIO_T3=m
+CONFIG_IXGB=m
+CONFIG_IXGB_NAPI=y
+CONFIG_S2IO=m
+CONFIG_S2IO_NAPI=y
+CONFIG_MYRI10GE=m
+CONFIG_NETXEN_NIC=m
+CONFIG_TR=y
+CONFIG_IBMOL=m
+CONFIG_TMS380TR=m
+CONFIG_TMSPCI=m
+CONFIG_ABYSS=m
+
+#
+# Wireless LAN
+#
+CONFIG_WLAN_PRE80211=y
+CONFIG_STRIP=m
+CONFIG_WLAN_80211=y
+CONFIG_IPW2100=m
+CONFIG_IPW2100_MONITOR=y
+# CONFIG_IPW2100_DEBUG is not set
+CONFIG_IPW2200=m
+# CONFIG_IPW2200_MONITOR is not set
+CONFIG_IPW2200_QOS=y
+# CONFIG_IPW2200_DEBUG is not set
+CONFIG_LIBERTAS=m
+CONFIG_LIBERTAS_USB=m
+# CONFIG_LIBERTAS_DEBUG is not set
+CONFIG_HERMES=m
+CONFIG_PLX_HERMES=m
+CONFIG_TMD_HERMES=m
+CONFIG_NORTEL_HERMES=m
+CONFIG_PCI_HERMES=m
+CONFIG_ATMEL=m
+CONFIG_PCI_ATMEL=m
+CONFIG_PRISM54=m
+CONFIG_USB_ZD1201=m
+CONFIG_HOSTAP=m
+CONFIG_HOSTAP_FIRMWARE=y
+# CONFIG_HOSTAP_FIRMWARE_NVRAM is not set
+CONFIG_HOSTAP_PLX=m
+CONFIG_HOSTAP_PCI=m
+CONFIG_BCM43XX=m
+CONFIG_BCM43XX_DEBUG=y
+CONFIG_BCM43XX_DMA=y
+CONFIG_BCM43XX_PIO=y
+CONFIG_BCM43XX_DMA_AND_PIO_MODE=y
+# CONFIG_BCM43XX_DMA_MODE is not set
+# CONFIG_BCM43XX_PIO_MODE is not set
+CONFIG_ZD1211RW=m
+# CONFIG_ZD1211RW_DEBUG is not set
+
+#
+# USB Network Adapters
+#
+CONFIG_USB_CATC=m
+CONFIG_USB_KAWETH=m
+CONFIG_USB_PEGASUS=m
+CONFIG_USB_RTL8150=m
+CONFIG_USB_USBNET_MII=m
+CONFIG_USB_USBNET=m
+CONFIG_USB_NET_AX8817X=m
+CONFIG_USB_NET_CDCETHER=m
+CONFIG_USB_NET_DM9601=m
+CONFIG_USB_NET_GL620A=m
+CONFIG_USB_NET_NET1080=m
+CONFIG_USB_NET_PLUSB=m
+CONFIG_USB_NET_MCS7830=m
+CONFIG_USB_NET_RNDIS_HOST=m
+CONFIG_USB_NET_CDC_SUBSET=m
+CONFIG_USB_ALI_M5632=y
+CONFIG_USB_AN2720=y
+CONFIG_USB_BELKIN=y
+CONFIG_USB_ARMLINUX=y
+CONFIG_USB_EPSON2888=y
+CONFIG_USB_KC2190=y
+CONFIG_USB_NET_ZAURUS=m
+CONFIG_WAN=y
+CONFIG_LANMEDIA=m
+CONFIG_HDLC=m
+CONFIG_HDLC_RAW=m
+CONFIG_HDLC_RAW_ETH=m
+CONFIG_HDLC_CISCO=m
+CONFIG_HDLC_FR=m
+CONFIG_HDLC_PPP=m
+CONFIG_HDLC_X25=m
+CONFIG_PCI200SYN=m
+CONFIG_WANXL=m
+CONFIG_PC300=m
+# CONFIG_PC300_MLPPP is not set
+
+#
+# Cyclades-PC300 MLPPP support is disabled.
+#
+
+#
+# Refer to the file README.mlppp, provided by PC300 package.
+#
+# CONFIG_PC300TOO is not set
+CONFIG_FARSYNC=m
+CONFIG_DSCC4=m
+# CONFIG_DSCC4_PCISYNC is not set
+# CONFIG_DSCC4_PCI_RST is not set
+CONFIG_DLCI=m
+CONFIG_DLCI_MAX=8
+CONFIG_WAN_ROUTER_DRIVERS=m
+CONFIG_CYCLADES_SYNC=m
+CONFIG_CYCLOMX_X25=y
+CONFIG_LAPBETHER=m
+CONFIG_X25_ASY=m
+CONFIG_ATM_DRIVERS=y
+CONFIG_ATM_DUMMY=m
+CONFIG_ATM_TCP=m
+CONFIG_ATM_LANAI=m
+CONFIG_ATM_ENI=m
+# CONFIG_ATM_ENI_DEBUG is not set
+# CONFIG_ATM_ENI_TUNE_BURST is not set
+CONFIG_ATM_FIRESTREAM=m
+CONFIG_ATM_ZATM=m
+# CONFIG_ATM_ZATM_DEBUG is not set
+CONFIG_ATM_IDT77252=m
+# CONFIG_ATM_IDT77252_DEBUG is not set
+# CONFIG_ATM_IDT77252_RCV_ALL is not set
+CONFIG_ATM_IDT77252_USE_SUNI=y
+CONFIG_ATM_AMBASSADOR=m
+# CONFIG_ATM_AMBASSADOR_DEBUG is not set
+CONFIG_ATM_HORIZON=m
+# CONFIG_ATM_HORIZON_DEBUG is not set
+CONFIG_ATM_FORE200E_MAYBE=m
+CONFIG_ATM_FORE200E_PCA=y
+CONFIG_ATM_FORE200E_PCA_DEFAULT_FW=y
+# CONFIG_ATM_FORE200E_USE_TASKLET is not set
+CONFIG_ATM_FORE200E_TX_RETRY=16
+CONFIG_ATM_FORE200E_DEBUG=0
+CONFIG_ATM_FORE200E=m
+CONFIG_ATM_HE=m
+CONFIG_ATM_HE_USE_SUNI=y
+CONFIG_FDDI=y
+CONFIG_DEFXX=m
+# CONFIG_DEFXX_MMIO is not set
+CONFIG_SKFP=m
+CONFIG_HIPPI=y
+CONFIG_ROADRUNNER=m
+# CONFIG_ROADRUNNER_LARGE_RINGS is not set
+CONFIG_PLIP=m
+CONFIG_PPP=m
+CONFIG_PPP_MULTILINK=y
+CONFIG_PPP_FILTER=y
+CONFIG_PPP_ASYNC=m
+CONFIG_PPP_SYNC_TTY=m
+CONFIG_PPP_DEFLATE=m
+CONFIG_PPP_BSDCOMP=m
+CONFIG_PPP_MPPE=m
+CONFIG_PPPOE=m
+CONFIG_PPPOATM=m
+CONFIG_SLIP=m
+CONFIG_SLIP_COMPRESSED=y
+CONFIG_SLHC=m
+CONFIG_SLIP_SMART=y
+# CONFIG_SLIP_MODE_SLIP6 is not set
+CONFIG_NET_FC=y
+CONFIG_SHAPER=m
+CONFIG_NETCONSOLE=m
+CONFIG_NETPOLL=y
+# CONFIG_NETPOLL_TRAP is not set
+CONFIG_NET_POLL_CONTROLLER=y
+
+#
+# ISDN subsystem
+#
+CONFIG_ISDN=m
+
+#
+# Old ISDN4Linux
+#
+CONFIG_ISDN_I4L=m
+CONFIG_ISDN_PPP=y
+CONFIG_ISDN_PPP_VJ=y
+CONFIG_ISDN_MPP=y
+CONFIG_IPPP_FILTER=y
+CONFIG_ISDN_PPP_BSDCOMP=m
+CONFIG_ISDN_AUDIO=y
+CONFIG_ISDN_TTY_FAX=y
+CONFIG_ISDN_X25=y
+
+#
+# ISDN feature submodules
+#
+CONFIG_ISDN_DRV_LOOP=m
+CONFIG_ISDN_DIVERSION=m
+
+#
+# ISDN4Linux hardware drivers
+#
+
+#
+# Passive cards
+#
+CONFIG_ISDN_DRV_HISAX=m
+
+#
+# D-channel protocol features
+#
+CONFIG_HISAX_EURO=y
+CONFIG_DE_AOC=y
+# CONFIG_HISAX_NO_SENDCOMPLETE is not set
+# CONFIG_HISAX_NO_LLC is not set
+# CONFIG_HISAX_NO_KEYPAD is not set
+CONFIG_HISAX_1TR6=y
+CONFIG_HISAX_NI1=y
+CONFIG_HISAX_MAX_CARDS=8
+
+#
+# HiSax supported cards
+#
+CONFIG_HISAX_16_3=y
+CONFIG_HISAX_S0BOX=y
+CONFIG_HISAX_FRITZPCI=y
+CONFIG_HISAX_AVM_A1_PCMCIA=y
+CONFIG_HISAX_ELSA=y
+CONFIG_HISAX_DIEHLDIVA=y
+CONFIG_HISAX_SEDLBAUER=y
+CONFIG_HISAX_NICCY=y
+CONFIG_HISAX_BKM_A4T=y
+CONFIG_HISAX_SCT_QUADRO=y
+CONFIG_HISAX_GAZEL=y
+CONFIG_HISAX_W6692=y
+CONFIG_HISAX_HFC_SX=y
+# CONFIG_HISAX_DEBUG is not set
+
+#
+# HiSax PCMCIA card service modules
+#
+
+#
+# HiSax sub driver modules
+#
+CONFIG_HISAX_ST5481=m
+CONFIG_HISAX_HFCUSB=m
+CONFIG_HISAX_HFC4S8S=m
+CONFIG_HISAX_FRITZ_PCIPNP=m
+CONFIG_HISAX_HDLC=y
+
+#
+# Active cards
+#
+CONFIG_HYSDN=m
+# CONFIG_HYSDN_CAPI is not set
+
+#
+# Siemens Gigaset
+#
+CONFIG_ISDN_DRV_GIGASET=m
+CONFIG_GIGASET_BASE=m
+CONFIG_GIGASET_M105=m
+CONFIG_GIGASET_M101=m
+# CONFIG_GIGASET_DEBUG is not set
+# CONFIG_GIGASET_UNDOCREQ is not set
+
+#
+# CAPI subsystem
+#
+CONFIG_ISDN_CAPI=m
+CONFIG_ISDN_DRV_AVMB1_VERBOSE_REASON=y
+CONFIG_CAPI_TRACE=y
+CONFIG_ISDN_CAPI_MIDDLEWARE=y
+CONFIG_ISDN_CAPI_CAPI20=m
+CONFIG_ISDN_CAPI_CAPIFS_BOOL=y
+CONFIG_ISDN_CAPI_CAPIFS=m
+CONFIG_ISDN_CAPI_CAPIDRV=m
+
+#
+# CAPI hardware drivers
+#
+
+#
+# Active AVM cards
+#
+CONFIG_CAPI_AVM=y
+CONFIG_ISDN_DRV_AVMB1_B1PCI=m
+CONFIG_ISDN_DRV_AVMB1_B1PCIV4=y
+CONFIG_ISDN_DRV_AVMB1_B1PCMCIA=m
+CONFIG_ISDN_DRV_AVMB1_T1PCI=m
+CONFIG_ISDN_DRV_AVMB1_C4=m
+
+#
+# Active Eicon DIVA Server cards
+#
+CONFIG_CAPI_EICON=y
+CONFIG_ISDN_DIVAS=m
+CONFIG_ISDN_DIVAS_BRIPCI=y
+CONFIG_ISDN_DIVAS_PRIPCI=y
+CONFIG_ISDN_DIVAS_DIVACAPI=m
+CONFIG_ISDN_DIVAS_USERIDI=m
+CONFIG_ISDN_DIVAS_MAINT=m
+
+#
+# Telephony Support
+#
+CONFIG_PHONE=m
+CONFIG_PHONE_IXJ=m
+
+#
+# Input device support
+#
+CONFIG_INPUT=y
+CONFIG_INPUT_FF_MEMLESS=m
+# CONFIG_INPUT_POLLDEV is not set
+
+#
+# Userland interfaces
+#
+CONFIG_INPUT_MOUSEDEV=y
+CONFIG_INPUT_MOUSEDEV_PSAUX=y
+CONFIG_INPUT_MOUSEDEV_SCREEN_X=1024
+CONFIG_INPUT_MOUSEDEV_SCREEN_Y=768
+CONFIG_INPUT_JOYDEV=m
+CONFIG_INPUT_TSDEV=m
+CONFIG_INPUT_TSDEV_SCREEN_X=240
+CONFIG_INPUT_TSDEV_SCREEN_Y=320
+CONFIG_INPUT_EVDEV=m
+# CONFIG_INPUT_EVBUG is not set
+
+#
+# Input Device Drivers
+#
+CONFIG_INPUT_KEYBOARD=y
+CONFIG_KEYBOARD_ATKBD=y
+CONFIG_KEYBOARD_SUNKBD=m
+CONFIG_KEYBOARD_LKKBD=m
+CONFIG_KEYBOARD_XTKBD=m
+CONFIG_KEYBOARD_NEWTON=m
+CONFIG_KEYBOARD_STOWAWAY=m
+CONFIG_INPUT_MOUSE=y
+CONFIG_MOUSE_PS2=m
+CONFIG_MOUSE_PS2_LOGIPS2PP=y
+CONFIG_MOUSE_PS2_SYNAPTICS=y
+CONFIG_MOUSE_PS2_LIFEBOOK=y
+CONFIG_MOUSE_PS2_TRACKPOINT=y
+# CONFIG_MOUSE_PS2_TOUCHKIT is not set
+CONFIG_MOUSE_SERIAL=m
+CONFIG_MOUSE_APPLETOUCH=m
+CONFIG_MOUSE_VSXXXAA=m
+CONFIG_INPUT_JOYSTICK=y
+CONFIG_JOYSTICK_ANALOG=m
+CONFIG_JOYSTICK_A3D=m
+CONFIG_JOYSTICK_ADI=m
+CONFIG_JOYSTICK_COBRA=m
+CONFIG_JOYSTICK_GF2K=m
+CONFIG_JOYSTICK_GRIP=m
+CONFIG_JOYSTICK_GRIP_MP=m
+CONFIG_JOYSTICK_GUILLEMOT=m
+CONFIG_JOYSTICK_INTERACT=m
+CONFIG_JOYSTICK_SIDEWINDER=m
+CONFIG_JOYSTICK_TMDC=m
+CONFIG_JOYSTICK_IFORCE=m
+CONFIG_JOYSTICK_IFORCE_USB=y
+CONFIG_JOYSTICK_IFORCE_232=y
+CONFIG_JOYSTICK_WARRIOR=m
+CONFIG_JOYSTICK_MAGELLAN=m
+CONFIG_JOYSTICK_SPACEORB=m
+CONFIG_JOYSTICK_SPACEBALL=m
+CONFIG_JOYSTICK_STINGER=m
+CONFIG_JOYSTICK_TWIDJOY=m
+CONFIG_JOYSTICK_DB9=m
+CONFIG_JOYSTICK_GAMECON=m
+CONFIG_JOYSTICK_TURBOGRAFX=m
+CONFIG_JOYSTICK_JOYDUMP=m
+CONFIG_JOYSTICK_XPAD=m
+CONFIG_INPUT_TABLET=y
+CONFIG_TABLET_USB_ACECAD=m
+CONFIG_TABLET_USB_AIPTEK=m
+CONFIG_TABLET_USB_GTCO=m
+CONFIG_TABLET_USB_KBTAB=m
+CONFIG_TABLET_USB_WACOM=m
+CONFIG_INPUT_TOUCHSCREEN=y
+CONFIG_TOUCHSCREEN_ADS7846=m
+CONFIG_TOUCHSCREEN_GUNZE=m
+CONFIG_TOUCHSCREEN_ELO=m
+CONFIG_TOUCHSCREEN_MTOUCH=m
+CONFIG_TOUCHSCREEN_MK712=m
+CONFIG_TOUCHSCREEN_PENMOUNT=m
+CONFIG_TOUCHSCREEN_TOUCHRIGHT=m
+CONFIG_TOUCHSCREEN_TOUCHWIN=m
+CONFIG_TOUCHSCREEN_UCB1400=m
+CONFIG_TOUCHSCREEN_USB_COMPOSITE=m
+# CONFIG_INPUT_MISC is not set
+
+#
+# Hardware I/O ports
+#
+CONFIG_SERIO=y
+CONFIG_SERIO_I8042=y
+CONFIG_SERIO_SERPORT=m
+CONFIG_SERIO_PARKBD=m
+CONFIG_SERIO_PCIPS2=y
+CONFIG_SERIO_LIBPS2=y
+CONFIG_SERIO_RAW=m
+CONFIG_GAMEPORT=m
+# CONFIG_GAMEPORT_NS558 is not set
+# CONFIG_GAMEPORT_L4 is not set
+CONFIG_GAMEPORT_EMU10K1=m
+CONFIG_GAMEPORT_FM801=m
+
+#
+# Character devices
+#
+CONFIG_VT=y
+CONFIG_VT_CONSOLE=y
+CONFIG_HW_CONSOLE=y
+# CONFIG_VT_HW_CONSOLE_BINDING is not set
+# CONFIG_SERIAL_NONSTANDARD is not set
+
+#
+# Serial drivers
+#
+CONFIG_SERIAL_8250=y
+CONFIG_SERIAL_8250_CONSOLE=y
+CONFIG_SERIAL_8250_PCI=y
+CONFIG_SERIAL_8250_NR_UARTS=4
+CONFIG_SERIAL_8250_RUNTIME_UARTS=4
+CONFIG_SERIAL_8250_EXTENDED=y
+# CONFIG_SERIAL_8250_MANY_PORTS is not set
+CONFIG_SERIAL_8250_SHARE_IRQ=y
+# CONFIG_SERIAL_8250_DETECT_IRQ is not set
+CONFIG_SERIAL_8250_RSA=y
+
+#
+# Non-8250 serial port support
+#
+CONFIG_SERIAL_CORE=y
+CONFIG_SERIAL_CORE_CONSOLE=y
+CONFIG_SERIAL_JSM=m
+CONFIG_UNIX98_PTYS=y
+# CONFIG_LEGACY_PTYS is not set
+CONFIG_PRINTER=m
+# CONFIG_LP_CONSOLE is not set
+CONFIG_PPDEV=m
+CONFIG_TIPAR=m
+
+#
+# IPMI
+#
+CONFIG_IPMI_HANDLER=m
+# CONFIG_IPMI_PANIC_EVENT is not set
+# CONFIG_IPMI_DEVICE_INTERFACE is not set
+CONFIG_IPMI_SI=m
+CONFIG_IPMI_WATCHDOG=m
+CONFIG_IPMI_POWEROFF=m
+CONFIG_WATCHDOG=y
+# CONFIG_WATCHDOG_NOWAYOUT is not set
+
+#
+# Watchdog Device Drivers
+#
+CONFIG_SOFT_WATCHDOG=m
+
+#
+# PCI-based Watchdog Cards
+#
+CONFIG_PCIPCWATCHDOG=m
+CONFIG_WDTPCI=m
+CONFIG_WDT_501_PCI=y
+
+#
+# USB-based Watchdog Cards
+#
+CONFIG_USBPCWATCHDOG=m
+CONFIG_HW_RANDOM=m
+CONFIG_RTC=y
+CONFIG_R3964=m
+CONFIG_APPLICOM=m
+CONFIG_DRM=m
+CONFIG_DRM_TDFX=m
+CONFIG_DRM_R128=m
+CONFIG_DRM_RADEON=m
+CONFIG_DRM_MGA=m
+CONFIG_DRM_VIA=m
+CONFIG_DRM_SAVAGE=m
+# CONFIG_RAW_DRIVER is not set
+
+#
+# TPM devices
+#
+# CONFIG_TCG_TPM is not set
+CONFIG_I2C=m
+CONFIG_I2C_CHARDEV=m
+
+#
+# I2C Algorithms
+#
+CONFIG_I2C_ALGOBIT=m
+# CONFIG_I2C_ALGOPCF is not set
+# CONFIG_I2C_ALGOPCA is not set
+
+#
+# I2C Hardware Bus support
+#
+# CONFIG_I2C_ALI1535 is not set
+# CONFIG_I2C_ALI1563 is not set
+# CONFIG_I2C_ALI15X3 is not set
+# CONFIG_I2C_AMD756 is not set
+# CONFIG_I2C_AMD8111 is not set
+# CONFIG_I2C_I801 is not set
+# CONFIG_I2C_I810 is not set
+CONFIG_I2C_PIIX4=m
+# CONFIG_I2C_NFORCE2 is not set
+# CONFIG_I2C_OCORES is not set
+CONFIG_I2C_PARPORT=m
+CONFIG_I2C_PARPORT_LIGHT=m
+# CONFIG_I2C_PROSAVAGE is not set
+# CONFIG_I2C_SAVAGE4 is not set
+CONFIG_I2C_SIMTEC=m
+# CONFIG_I2C_SIS5595 is not set
+# CONFIG_I2C_SIS630 is not set
+# CONFIG_I2C_SIS96X is not set
+# CONFIG_I2C_STUB is not set
+CONFIG_I2C_TINY_USB=m
+# CONFIG_I2C_VIA is not set
+# CONFIG_I2C_VIAPRO is not set
+CONFIG_I2C_VOODOO3=m
+
+#
+# Miscellaneous I2C Chip support
+#
+CONFIG_SENSORS_DS1337=m
+CONFIG_SENSORS_DS1374=m
+CONFIG_SENSORS_EEPROM=m
+CONFIG_SENSORS_PCF8574=m
+CONFIG_SENSORS_PCA9539=m
+CONFIG_SENSORS_PCF8591=m
+CONFIG_SENSORS_MAX6875=m
+# CONFIG_I2C_DEBUG_CORE is not set
+# CONFIG_I2C_DEBUG_ALGO is not set
+# CONFIG_I2C_DEBUG_BUS is not set
+# CONFIG_I2C_DEBUG_CHIP is not set
+
+#
+# SPI support
+#
+CONFIG_SPI=y
+CONFIG_SPI_MASTER=y
+
+#
+# SPI Master Controller Drivers
+#
+CONFIG_SPI_BITBANG=m
+CONFIG_SPI_BUTTERFLY=m
+
+#
+# SPI Protocol Masters
+#
+CONFIG_SPI_AT25=m
+# CONFIG_SPI_SPIDEV is not set
+
+#
+# Dallas's 1-wire bus
+#
+CONFIG_W1=m
+CONFIG_W1_CON=y
+
+#
+# 1-wire Bus Masters
+#
+CONFIG_W1_MASTER_MATROX=m
+CONFIG_W1_MASTER_DS2490=m
+CONFIG_W1_MASTER_DS2482=m
+
+#
+# 1-wire Slaves
+#
+CONFIG_W1_SLAVE_THERM=m
+CONFIG_W1_SLAVE_SMEM=m
+CONFIG_W1_SLAVE_DS2433=m
+# CONFIG_W1_SLAVE_DS2433_CRC is not set
+CONFIG_HWMON=y
+CONFIG_HWMON_VID=m
+# CONFIG_SENSORS_ABITUGURU is not set
+CONFIG_SENSORS_AD7418=m
+CONFIG_SENSORS_ADM1021=m
+CONFIG_SENSORS_ADM1025=m
+CONFIG_SENSORS_ADM1026=m
+CONFIG_SENSORS_ADM1029=m
+CONFIG_SENSORS_ADM1031=m
+CONFIG_SENSORS_ADM9240=m
+# CONFIG_SENSORS_ASB100 is not set
+# CONFIG_SENSORS_ATXP1 is not set
+CONFIG_SENSORS_DS1621=m
+# CONFIG_SENSORS_F71805F is not set
+# CONFIG_SENSORS_FSCHER is not set
+# CONFIG_SENSORS_FSCPOS is not set
+# CONFIG_SENSORS_GL518SM is not set
+# CONFIG_SENSORS_GL520SM is not set
+# CONFIG_SENSORS_IT87 is not set
+CONFIG_SENSORS_LM63=m
+CONFIG_SENSORS_LM70=m
+CONFIG_SENSORS_LM75=m
+CONFIG_SENSORS_LM77=m
+CONFIG_SENSORS_LM78=m
+CONFIG_SENSORS_LM80=m
+CONFIG_SENSORS_LM83=m
+CONFIG_SENSORS_LM85=m
+CONFIG_SENSORS_LM87=m
+CONFIG_SENSORS_LM90=m
+CONFIG_SENSORS_LM92=m
+CONFIG_SENSORS_MAX1619=m
+CONFIG_SENSORS_MAX6650=m
+# CONFIG_SENSORS_PC87360 is not set
+# CONFIG_SENSORS_PC87427 is not set
+# CONFIG_SENSORS_SIS5595 is not set
+# CONFIG_SENSORS_SMSC47M1 is not set
+# CONFIG_SENSORS_SMSC47M192 is not set
+# CONFIG_SENSORS_SMSC47B397 is not set
+# CONFIG_SENSORS_VIA686A is not set
+# CONFIG_SENSORS_VT1211 is not set
+# CONFIG_SENSORS_VT8231 is not set
+# CONFIG_SENSORS_W83781D is not set
+# CONFIG_SENSORS_W83791D is not set
+# CONFIG_SENSORS_W83792D is not set
+# CONFIG_SENSORS_W83793 is not set
+# CONFIG_SENSORS_W83L785TS is not set
+# CONFIG_SENSORS_W83627HF is not set
+# CONFIG_SENSORS_W83627EHF is not set
+# CONFIG_HWMON_DEBUG_CHIP is not set
+
+#
+# Multifunction device drivers
+#
+CONFIG_MFD_SM501=m
+
+#
+# Multimedia devices
+#
+CONFIG_VIDEO_DEV=m
+CONFIG_VIDEO_V4L1=y
+CONFIG_VIDEO_V4L1_COMPAT=y
+CONFIG_VIDEO_V4L2=y
+CONFIG_VIDEO_CAPTURE_DRIVERS=y
+# CONFIG_VIDEO_ADV_DEBUG is not set
+CONFIG_VIDEO_HELPER_CHIPS_AUTO=y
+CONFIG_VIDEO_TVAUDIO=m
+CONFIG_VIDEO_TDA7432=m
+CONFIG_VIDEO_TDA9840=m
+CONFIG_VIDEO_TDA9875=m
+CONFIG_VIDEO_TEA6415C=m
+CONFIG_VIDEO_TEA6420=m
+CONFIG_VIDEO_MSP3400=m
+CONFIG_VIDEO_CS53L32A=m
+CONFIG_VIDEO_WM8775=m
+CONFIG_VIDEO_WM8739=m
+CONFIG_VIDEO_BT819=m
+CONFIG_VIDEO_BT856=m
+CONFIG_VIDEO_KS0127=m
+CONFIG_VIDEO_OV7670=m
+CONFIG_VIDEO_SAA7110=m
+CONFIG_VIDEO_SAA7111=m
+CONFIG_VIDEO_SAA7114=m
+CONFIG_VIDEO_SAA711X=m
+CONFIG_VIDEO_TVP5150=m
+CONFIG_VIDEO_VPX3220=m
+CONFIG_VIDEO_CX25840=m
+CONFIG_VIDEO_CX2341X=m
+CONFIG_VIDEO_SAA7127=m
+CONFIG_VIDEO_SAA7185=m
+CONFIG_VIDEO_ADV7170=m
+CONFIG_VIDEO_ADV7175=m
+CONFIG_VIDEO_UPD64031A=m
+CONFIG_VIDEO_UPD64083=m
+CONFIG_VIDEO_VIVI=m
+CONFIG_VIDEO_BT848=m
+CONFIG_VIDEO_BT848_DVB=y
+CONFIG_VIDEO_SAA6588=m
+CONFIG_VIDEO_BWQCAM=m
+CONFIG_VIDEO_CQCAM=m
+CONFIG_VIDEO_W9966=m
+CONFIG_VIDEO_CPIA=m
+CONFIG_VIDEO_CPIA_PP=m
+CONFIG_VIDEO_CPIA_USB=m
+CONFIG_VIDEO_CPIA2=m
+CONFIG_VIDEO_SAA5246A=m
+CONFIG_VIDEO_SAA5249=m
+CONFIG_TUNER_3036=m
+CONFIG_VIDEO_STRADIS=m
+CONFIG_VIDEO_ZORAN_ZR36060=m
+CONFIG_VIDEO_ZORAN=m
+CONFIG_VIDEO_ZORAN_BUZ=m
+CONFIG_VIDEO_ZORAN_DC10=m
+CONFIG_VIDEO_ZORAN_DC30=m
+CONFIG_VIDEO_ZORAN_LML33=m
+CONFIG_VIDEO_ZORAN_LML33R10=m
+CONFIG_VIDEO_ZORAN_AVS6EYES=m
+CONFIG_VIDEO_SAA7134=m
+CONFIG_VIDEO_SAA7134_ALSA=m
+CONFIG_VIDEO_SAA7134_OSS=m
+CONFIG_VIDEO_SAA7134_DVB=m
+CONFIG_VIDEO_MXB=m
+CONFIG_VIDEO_DPC=m
+CONFIG_VIDEO_HEXIUM_ORION=m
+CONFIG_VIDEO_HEXIUM_GEMINI=m
+CONFIG_VIDEO_CX88=m
+CONFIG_VIDEO_CX88_ALSA=m
+CONFIG_VIDEO_CX88_BLACKBIRD=m
+CONFIG_VIDEO_CX88_DVB=m
+CONFIG_VIDEO_CX88_VP3054=m
+CONFIG_VIDEO_IVTV=m
+CONFIG_VIDEO_CAFE_CCIC=m
+CONFIG_V4L_USB_DRIVERS=y
+CONFIG_VIDEO_PVRUSB2=m
+CONFIG_VIDEO_PVRUSB2_29XXX=y
+CONFIG_VIDEO_PVRUSB2_24XXX=y
+CONFIG_VIDEO_PVRUSB2_SYSFS=y
+# CONFIG_VIDEO_PVRUSB2_DEBUGIFC is not set
+CONFIG_VIDEO_EM28XX=m
+CONFIG_VIDEO_USBVISION=m
+CONFIG_VIDEO_USBVIDEO=m
+CONFIG_USB_VICAM=m
+CONFIG_USB_IBMCAM=m
+CONFIG_USB_KONICAWC=m
+CONFIG_USB_QUICKCAM_MESSENGER=m
+CONFIG_USB_ET61X251=m
+CONFIG_VIDEO_OVCAMCHIP=m
+CONFIG_USB_W9968CF=m
+CONFIG_USB_OV511=m
+CONFIG_USB_SE401=m
+CONFIG_USB_SN9C102=m
+CONFIG_USB_STV680=m
+CONFIG_USB_ZC0301=m
+CONFIG_USB_PWC=m
+# CONFIG_USB_PWC_DEBUG is not set
+CONFIG_USB_ZR364XX=m
+CONFIG_RADIO_ADAPTERS=y
+CONFIG_RADIO_GEMTEK_PCI=m
+CONFIG_RADIO_MAXIRADIO=m
+CONFIG_RADIO_MAESTRO=m
+CONFIG_USB_DSBR=m
+CONFIG_DVB_CORE=m
+CONFIG_DVB_CORE_ATTACH=y
+CONFIG_DVB_CAPTURE_DRIVERS=y
+
+#
+# Supported SAA7146 based PCI Adapters
+#
+CONFIG_DVB_AV7110=m
+CONFIG_DVB_AV7110_OSD=y
+CONFIG_DVB_BUDGET=m
+CONFIG_DVB_BUDGET_CI=m
+CONFIG_DVB_BUDGET_AV=m
+CONFIG_DVB_BUDGET_PATCH=m
+
+#
+# Supported USB Adapters
+#
+CONFIG_DVB_USB=m
+# CONFIG_DVB_USB_DEBUG is not set
+CONFIG_DVB_USB_A800=m
+CONFIG_DVB_USB_DIBUSB_MB=m
+CONFIG_DVB_USB_DIBUSB_MB_FAULTY=y
+CONFIG_DVB_USB_DIBUSB_MC=m
+CONFIG_DVB_USB_DIB0700=m
+CONFIG_DVB_USB_UMT_010=m
+CONFIG_DVB_USB_CXUSB=m
+CONFIG_DVB_USB_M920X=m
+CONFIG_DVB_USB_GL861=m
+CONFIG_DVB_USB_AU6610=m
+CONFIG_DVB_USB_DIGITV=m
+CONFIG_DVB_USB_VP7045=m
+CONFIG_DVB_USB_VP702X=m
+CONFIG_DVB_USB_GP8PSK=m
+CONFIG_DVB_USB_NOVA_T_USB2=m
+CONFIG_DVB_USB_TTUSB2=m
+CONFIG_DVB_USB_DTT200U=m
+CONFIG_DVB_USB_OPERA1=m
+CONFIG_DVB_TTUSB_BUDGET=m
+CONFIG_DVB_TTUSB_DEC=m
+CONFIG_DVB_CINERGYT2=m
+# CONFIG_DVB_CINERGYT2_TUNING is not set
+
+#
+# Supported FlexCopII (B2C2) Adapters
+#
+CONFIG_DVB_B2C2_FLEXCOP=m
+CONFIG_DVB_B2C2_FLEXCOP_PCI=m
+CONFIG_DVB_B2C2_FLEXCOP_USB=m
+# CONFIG_DVB_B2C2_FLEXCOP_DEBUG is not set
+
+#
+# Supported BT878 Adapters
+#
+CONFIG_DVB_BT8XX=m
+
+#
+# Supported Pluto2 Adapters
+#
+CONFIG_DVB_PLUTO2=m
+
+#
+# Supported DVB Frontends
+#
+
+#
+# Customise DVB Frontends
+#
+# CONFIG_DVB_FE_CUSTOMISE is not set
+
+#
+# DVB-S (satellite) frontends
+#
+CONFIG_DVB_STV0299=m
+CONFIG_DVB_CX24110=m
+CONFIG_DVB_CX24123=m
+CONFIG_DVB_TDA8083=m
+CONFIG_DVB_MT312=m
+CONFIG_DVB_VES1X93=m
+CONFIG_DVB_S5H1420=m
+CONFIG_DVB_TDA10086=m
+
+#
+# DVB-T (terrestrial) frontends
+#
+CONFIG_DVB_SP8870=m
+CONFIG_DVB_SP887X=m
+CONFIG_DVB_CX22700=m
+CONFIG_DVB_CX22702=m
+CONFIG_DVB_L64781=m
+CONFIG_DVB_TDA1004X=m
+CONFIG_DVB_NXT6000=m
+CONFIG_DVB_MT352=m
+CONFIG_DVB_ZL10353=m
+CONFIG_DVB_DIB3000MB=m
+CONFIG_DVB_DIB3000MC=m
+CONFIG_DVB_DIB7000M=m
+CONFIG_DVB_DIB7000P=m
+
+#
+# DVB-C (cable) frontends
+#
+CONFIG_DVB_VES1820=m
+CONFIG_DVB_TDA10021=m
+CONFIG_DVB_TDA10023=m
+CONFIG_DVB_STV0297=m
+
+#
+# ATSC (North American/Korean Terrestrial/Cable DTV) frontends
+#
+CONFIG_DVB_NXT200X=m
+CONFIG_DVB_OR51211=m
+CONFIG_DVB_OR51132=m
+CONFIG_DVB_BCM3510=m
+CONFIG_DVB_LGDT330X=m
+
+#
+# Tuners/PLL support
+#
+CONFIG_DVB_PLL=m
+CONFIG_DVB_TDA826X=m
+CONFIG_DVB_TDA827X=m
+CONFIG_DVB_TUNER_QT1010=m
+CONFIG_DVB_TUNER_MT2060=m
+
+#
+# Miscellaneous devices
+#
+CONFIG_DVB_LNBP21=m
+CONFIG_DVB_ISL6421=m
+CONFIG_DVB_TUA6100=m
+CONFIG_VIDEO_SAA7146=m
+CONFIG_VIDEO_SAA7146_VV=m
+CONFIG_VIDEO_TUNER=m
+CONFIG_VIDEO_BUF=m
+CONFIG_VIDEO_BUF_DVB=m
+CONFIG_VIDEO_BTCX=m
+CONFIG_VIDEO_IR=m
+CONFIG_VIDEO_TVEEPROM=m
+
+#
+# Graphics support
+#
+CONFIG_BACKLIGHT_LCD_SUPPORT=y
+# CONFIG_LCD_CLASS_DEVICE is not set
+
+#
+# Display device support
+#
+CONFIG_DISPLAY_SUPPORT=m
+
+#
+# Display hardware drivers
+#
+CONFIG_FB=y
+CONFIG_FIRMWARE_EDID=y
+CONFIG_FB_DDC=m
+CONFIG_FB_CFB_FILLRECT=m
+CONFIG_FB_CFB_COPYAREA=m
+CONFIG_FB_CFB_IMAGEBLIT=m
+CONFIG_FB_SYS_FILLRECT=m
+CONFIG_FB_SYS_COPYAREA=m
+CONFIG_FB_SYS_IMAGEBLIT=m
+CONFIG_FB_SYS_FOPS=m
+CONFIG_FB_DEFERRED_IO=y
+CONFIG_FB_SVGALIB=m
+# CONFIG_FB_MACMODES is not set
+CONFIG_FB_BACKLIGHT=y
+CONFIG_FB_MODE_HELPERS=y
+CONFIG_FB_TILEBLITTING=y
+
+#
+# Frame buffer hardware drivers
+#
+CONFIG_FB_CIRRUS=m
+CONFIG_FB_PM2=m
+CONFIG_FB_PM2_FIFO_DISCONNECT=y
+CONFIG_FB_CYBER2000=m
+# CONFIG_FB_ASILIANT is not set
+# CONFIG_FB_IMSTT is not set
+CONFIG_FB_S1D13XXX=m
+CONFIG_FB_NVIDIA=m
+# CONFIG_FB_NVIDIA_I2C is not set
+# CONFIG_FB_NVIDIA_DEBUG is not set
+CONFIG_FB_NVIDIA_BACKLIGHT=y
+# CONFIG_FB_RIVA is not set
+CONFIG_FB_MATROX=m
+CONFIG_FB_MATROX_MILLENIUM=y
+CONFIG_FB_MATROX_MYSTIQUE=y
+CONFIG_FB_MATROX_G=y
+CONFIG_FB_MATROX_I2C=m
+CONFIG_FB_MATROX_MAVEN=m
+CONFIG_FB_MATROX_MULTIHEAD=y
+CONFIG_FB_RADEON=m
+CONFIG_FB_RADEON_I2C=y
+CONFIG_FB_RADEON_BACKLIGHT=y
+# CONFIG_FB_RADEON_DEBUG is not set
+CONFIG_FB_ATY128=m
+CONFIG_FB_ATY128_BACKLIGHT=y
+CONFIG_FB_ATY=m
+CONFIG_FB_ATY_CT=y
+# CONFIG_FB_ATY_GENERIC_LCD is not set
+CONFIG_FB_ATY_GX=y
+CONFIG_FB_ATY_BACKLIGHT=y
+CONFIG_FB_S3=m
+CONFIG_FB_SAVAGE=m
+# CONFIG_FB_SAVAGE_I2C is not set
+# CONFIG_FB_SAVAGE_ACCEL is not set
+CONFIG_FB_SIS=m
+CONFIG_FB_SIS_300=y
+CONFIG_FB_SIS_315=y
+CONFIG_FB_NEOMAGIC=m
+CONFIG_FB_KYRO=m
+CONFIG_FB_3DFX=m
+# CONFIG_FB_3DFX_ACCEL is not set
+CONFIG_FB_VOODOO1=m
+CONFIG_FB_VT8623=m
+CONFIG_FB_TRIDENT=m
+# CONFIG_FB_TRIDENT_ACCEL is not set
+CONFIG_FB_ARK=m
+CONFIG_FB_PM3=m
+CONFIG_FB_SM501=m
+CONFIG_FB_VIRTUAL=m
+
+#
+# Console display driver support
+#
+# CONFIG_VGA_CONSOLE is not set
+CONFIG_DUMMY_CONSOLE=y
+CONFIG_FRAMEBUFFER_CONSOLE=y
+CONFIG_FRAMEBUFFER_CONSOLE_ROTATION=y
+# CONFIG_FONTS is not set
+CONFIG_FONT_8x8=y
+CONFIG_FONT_8x16=y
+# CONFIG_LOGO is not set
+
+#
+# Sound
+#
+CONFIG_SOUND=y
+
+#
+# Advanced Linux Sound Architecture
+#
+CONFIG_SND=m
+CONFIG_SND_TIMER=m
+CONFIG_SND_PCM=m
+CONFIG_SND_HWDEP=m
+CONFIG_SND_RAWMIDI=m
+CONFIG_SND_SEQUENCER=m
+CONFIG_SND_SEQ_DUMMY=m
+CONFIG_SND_OSSEMUL=y
+CONFIG_SND_MIXER_OSS=m
+CONFIG_SND_PCM_OSS=m
+CONFIG_SND_PCM_OSS_PLUGINS=y
+CONFIG_SND_SEQUENCER_OSS=y
+CONFIG_SND_RTCTIMER=m
+CONFIG_SND_SEQ_RTCTIMER_DEFAULT=y
+# CONFIG_SND_DYNAMIC_MINORS is not set
+CONFIG_SND_SUPPORT_OLD_API=y
+CONFIG_SND_VERBOSE_PROCFS=y
+# CONFIG_SND_VERBOSE_PRINTK is not set
+# CONFIG_SND_DEBUG is not set
+
+#
+# Generic devices
+#
+CONFIG_SND_MPU401_UART=m
+CONFIG_SND_OPL3_LIB=m
+CONFIG_SND_VX_LIB=m
+CONFIG_SND_AC97_CODEC=m
+CONFIG_SND_DUMMY=m
+CONFIG_SND_VIRMIDI=m
+CONFIG_SND_MTPAV=m
+CONFIG_SND_MTS64=m
+CONFIG_SND_SERIAL_U16550=m
+CONFIG_SND_MPU401=m
+CONFIG_SND_PORTMAN2X4=m
+
+#
+# PCI devices
+#
+CONFIG_SND_AD1889=m
+CONFIG_SND_ALS300=m
+CONFIG_SND_ALI5451=m
+CONFIG_SND_ATIIXP=m
+CONFIG_SND_ATIIXP_MODEM=m
+CONFIG_SND_AU8810=m
+CONFIG_SND_AU8820=m
+CONFIG_SND_AU8830=m
+CONFIG_SND_AZT3328=m
+CONFIG_SND_BT87X=m
+# CONFIG_SND_BT87X_OVERCLOCK is not set
+CONFIG_SND_CA0106=m
+CONFIG_SND_CMIPCI=m
+CONFIG_SND_CS4281=m
+CONFIG_SND_CS46XX=m
+CONFIG_SND_CS46XX_NEW_DSP=y
+CONFIG_SND_DARLA20=m
+CONFIG_SND_GINA20=m
+CONFIG_SND_LAYLA20=m
+CONFIG_SND_DARLA24=m
+CONFIG_SND_GINA24=m
+CONFIG_SND_LAYLA24=m
+CONFIG_SND_MONA=m
+CONFIG_SND_MIA=m
+CONFIG_SND_ECHO3G=m
+CONFIG_SND_INDIGO=m
+CONFIG_SND_INDIGOIO=m
+CONFIG_SND_INDIGODJ=m
+CONFIG_SND_EMU10K1=m
+CONFIG_SND_EMU10K1X=m
+CONFIG_SND_ENS1370=m
+CONFIG_SND_ENS1371=m
+CONFIG_SND_ES1938=m
+CONFIG_SND_ES1968=m
+CONFIG_SND_FM801=m
+CONFIG_SND_FM801_TEA575X_BOOL=y
+CONFIG_SND_FM801_TEA575X=m
+CONFIG_SND_HDA_INTEL=m
+CONFIG_SND_HDSP=m
+CONFIG_SND_HDSPM=m
+CONFIG_SND_ICE1712=m
+CONFIG_SND_ICE1724=m
+CONFIG_SND_INTEL8X0=m
+CONFIG_SND_INTEL8X0M=m
+CONFIG_SND_KORG1212=m
+CONFIG_SND_MAESTRO3=m
+CONFIG_SND_MIXART=m
+CONFIG_SND_NM256=m
+CONFIG_SND_PCXHR=m
+CONFIG_SND_RIPTIDE=m
+CONFIG_SND_RME32=m
+CONFIG_SND_RME96=m
+CONFIG_SND_RME9652=m
+CONFIG_SND_SONICVIBES=m
+CONFIG_SND_TRIDENT=m
+CONFIG_SND_VIA82XX=m
+CONFIG_SND_VIA82XX_MODEM=m
+CONFIG_SND_VX222=m
+CONFIG_SND_YMFPCI=m
+CONFIG_SND_AC97_POWER_SAVE=y
+
+#
+# ALSA MIPS devices
+#
+
+#
+# USB devices
+#
+CONFIG_SND_USB_AUDIO=m
+CONFIG_SND_USB_CAIAQ=m
+CONFIG_SND_USB_CAIAQ_INPUT=y
+
+#
+# System on Chip audio support
+#
+
+#
+# Open Sound System
+#
+CONFIG_SOUND_PRIME=m
+# CONFIG_OSS_OBSOLETE is not set
+CONFIG_SOUND_TRIDENT=m
+CONFIG_SOUND_MSNDCLAS=m
+CONFIG_MSNDCLAS_INIT_FILE="/etc/sound/msndinit.bin"
+CONFIG_MSNDCLAS_PERM_FILE="/etc/sound/msndperm.bin"
+CONFIG_SOUND_MSNDPIN=m
+CONFIG_MSNDPIN_INIT_FILE="/etc/sound/pndspini.bin"
+CONFIG_MSNDPIN_PERM_FILE="/etc/sound/pndsperm.bin"
+CONFIG_AC97_BUS=m
+
+#
+# HID Devices
+#
+CONFIG_HID=y
+# CONFIG_HID_DEBUG is not set
+
+#
+# USB Input Devices
+#
+CONFIG_USB_HID=m
+# CONFIG_USB_HIDINPUT_POWERBOOK is not set
+# CONFIG_HID_FF is not set
+CONFIG_USB_HIDDEV=y
+
+#
+# USB HID Boot Protocol drivers
+#
+CONFIG_USB_KBD=m
+CONFIG_USB_MOUSE=m
+
+#
+# USB support
+#
+CONFIG_USB_ARCH_HAS_HCD=y
+CONFIG_USB_ARCH_HAS_OHCI=y
+CONFIG_USB_ARCH_HAS_EHCI=y
+CONFIG_USB=y
+# CONFIG_USB_DEBUG is not set
+
+#
+# Miscellaneous USB options
+#
+CONFIG_USB_DEVICEFS=y
+# CONFIG_USB_DYNAMIC_MINORS is not set
+# CONFIG_USB_OTG is not set
+
+#
+# USB Host Controller Drivers
+#
+CONFIG_USB_EHCI_HCD=m
+CONFIG_USB_EHCI_SPLIT_ISO=y
+CONFIG_USB_EHCI_ROOT_HUB_TT=y
+# CONFIG_USB_EHCI_TT_NEWSCHED is not set
+# CONFIG_USB_EHCI_BIG_ENDIAN_MMIO is not set
+CONFIG_USB_ISP116X_HCD=m
+CONFIG_USB_OHCI_HCD=m
+# CONFIG_USB_OHCI_BIG_ENDIAN_DESC is not set
+# CONFIG_USB_OHCI_BIG_ENDIAN_MMIO is not set
+CONFIG_USB_OHCI_LITTLE_ENDIAN=y
+CONFIG_USB_UHCI_HCD=y
+CONFIG_USB_U132_HCD=m
+CONFIG_USB_SL811_HCD=m
+
+#
+# USB Device Class drivers
+#
+CONFIG_USB_ACM=m
+CONFIG_USB_PRINTER=m
+
+#
+# NOTE: USB_STORAGE enables SCSI, and 'SCSI disk support'
+#
+
+#
+# may also be needed; see USB_STORAGE Help for more information
+#
+CONFIG_USB_STORAGE=m
+# CONFIG_USB_STORAGE_DEBUG is not set
+CONFIG_USB_STORAGE_DATAFAB=y
+CONFIG_USB_STORAGE_FREECOM=y
+CONFIG_USB_STORAGE_ISD200=y
+CONFIG_USB_STORAGE_DPCM=y
+CONFIG_USB_STORAGE_USBAT=y
+CONFIG_USB_STORAGE_SDDR09=y
+CONFIG_USB_STORAGE_SDDR55=y
+CONFIG_USB_STORAGE_JUMPSHOT=y
+CONFIG_USB_STORAGE_ALAUDA=y
+CONFIG_USB_STORAGE_ONETOUCH=y
+CONFIG_USB_STORAGE_KARMA=y
+# CONFIG_USB_LIBUSUAL is not set
+
+#
+# USB Imaging devices
+#
+CONFIG_USB_MDC800=m
+CONFIG_USB_MICROTEK=m
+CONFIG_USB_MON=y
+
+#
+# USB port drivers
+#
+CONFIG_USB_USS720=m
+
+#
+# USB Serial Converter support
+#
+CONFIG_USB_SERIAL=m
+CONFIG_USB_SERIAL_GENERIC=y
+CONFIG_USB_SERIAL_AIRCABLE=m
+CONFIG_USB_SERIAL_AIRPRIME=m
+CONFIG_USB_SERIAL_ARK3116=m
+CONFIG_USB_SERIAL_BELKIN=m
+# CONFIG_USB_SERIAL_WHITEHEAT is not set
+CONFIG_USB_SERIAL_DIGI_ACCELEPORT=m
+CONFIG_USB_SERIAL_CP2101=m
+CONFIG_USB_SERIAL_CYPRESS_M8=m
+CONFIG_USB_SERIAL_EMPEG=m
+CONFIG_USB_SERIAL_FTDI_SIO=m
+CONFIG_USB_SERIAL_FUNSOFT=m
+CONFIG_USB_SERIAL_VISOR=m
+CONFIG_USB_SERIAL_IPAQ=m
+CONFIG_USB_SERIAL_IR=m
+# CONFIG_USB_SERIAL_EDGEPORT is not set
+# CONFIG_USB_SERIAL_EDGEPORT_TI is not set
+CONFIG_USB_SERIAL_GARMIN=m
+CONFIG_USB_SERIAL_IPW=m
+CONFIG_USB_SERIAL_KEYSPAN_PDA=m
+# CONFIG_USB_SERIAL_KEYSPAN is not set
+CONFIG_USB_SERIAL_KLSI=m
+CONFIG_USB_SERIAL_KOBIL_SCT=m
+CONFIG_USB_SERIAL_MCT_U232=m
+CONFIG_USB_SERIAL_MOS7720=m
+CONFIG_USB_SERIAL_MOS7840=m
+CONFIG_USB_SERIAL_NAVMAN=m
+CONFIG_USB_SERIAL_PL2303=m
+CONFIG_USB_SERIAL_HP4X=m
+CONFIG_USB_SERIAL_SAFE=m
+# CONFIG_USB_SERIAL_SAFE_PADDED is not set
+CONFIG_USB_SERIAL_SIERRAWIRELESS=m
+# CONFIG_USB_SERIAL_TI is not set
+CONFIG_USB_SERIAL_CYBERJACK=m
+CONFIG_USB_SERIAL_XIRCOM=m
+CONFIG_USB_SERIAL_OPTION=m
+CONFIG_USB_SERIAL_OMNINET=m
+CONFIG_USB_SERIAL_DEBUG=m
+
+#
+# USB Miscellaneous drivers
+#
+CONFIG_USB_ADUTUX=m
+CONFIG_USB_AUERSWALD=m
+CONFIG_USB_RIO500=m
+CONFIG_USB_LEGOTOWER=m
+CONFIG_USB_LCD=m
+CONFIG_USB_BERRY_CHARGE=m
+CONFIG_USB_LED=m
+CONFIG_USB_CYPRESS_CY7C63=m
+CONFIG_USB_CYTHERM=m
+CONFIG_USB_PHIDGET=m
+CONFIG_USB_PHIDGETKIT=m
+CONFIG_USB_PHIDGETMOTORCONTROL=m
+CONFIG_USB_PHIDGETSERVO=m
+CONFIG_USB_IDMOUSE=m
+CONFIG_USB_FTDI_ELAN=m
+CONFIG_USB_APPLEDISPLAY=m
+CONFIG_USB_SISUSBVGA=m
+CONFIG_USB_SISUSBVGA_CON=y
+CONFIG_USB_LD=m
+CONFIG_USB_TRANCEVIBRATOR=m
+CONFIG_USB_IOWARRIOR=m
+CONFIG_USB_TEST=m
+
+#
+# USB DSL modem support
+#
+CONFIG_USB_ATM=m
+CONFIG_USB_SPEEDTOUCH=m
+CONFIG_USB_CXACRU=m
+CONFIG_USB_UEAGLEATM=m
+CONFIG_USB_XUSBATM=m
+
+#
+# USB Gadget Support
+#
+CONFIG_USB_GADGET=m
+# CONFIG_USB_GADGET_DEBUG_FILES is not set
+CONFIG_USB_GADGET_SELECTED=y
+CONFIG_USB_GADGET_NET2280=y
+CONFIG_USB_NET2280=m
+# CONFIG_USB_GADGET_PXA2XX is not set
+# CONFIG_USB_GADGET_GOKU is not set
+# CONFIG_USB_GADGET_LH7A40X is not set
+# CONFIG_USB_GADGET_OMAP is not set
+# CONFIG_USB_GADGET_AT91 is not set
+# CONFIG_USB_GADGET_DUMMY_HCD is not set
+CONFIG_USB_GADGET_DUALSPEED=y
+CONFIG_USB_ZERO=m
+CONFIG_USB_ETH=m
+CONFIG_USB_ETH_RNDIS=y
+CONFIG_USB_GADGETFS=m
+CONFIG_USB_FILE_STORAGE=m
+# CONFIG_USB_FILE_STORAGE_TEST is not set
+CONFIG_USB_G_SERIAL=m
+CONFIG_USB_MIDI_GADGET=m
+CONFIG_MMC=m
+# CONFIG_MMC_DEBUG is not set
+# CONFIG_MMC_UNSAFE_RESUME is not set
+
+#
+# MMC/SD Card Drivers
+#
+CONFIG_MMC_BLOCK=m
+
+#
+# MMC/SD Host Controller Drivers
+#
+CONFIG_MMC_SDHCI=m
+CONFIG_MMC_TIFM_SD=m
+
+#
+# LED devices
+#
+# CONFIG_NEW_LEDS is not set
+
+#
+# LED drivers
+#
+
+#
+# LED Triggers
+#
+
+#
+# InfiniBand support
+#
+CONFIG_INFINIBAND=m
+CONFIG_INFINIBAND_USER_MAD=m
+CONFIG_INFINIBAND_USER_ACCESS=m
+CONFIG_INFINIBAND_ADDR_TRANS=y
+CONFIG_INFINIBAND_MTHCA=m
+CONFIG_INFINIBAND_MTHCA_DEBUG=y
+CONFIG_INFINIBAND_AMSO1100=m
+# CONFIG_INFINIBAND_AMSO1100_DEBUG is not set
+CONFIG_INFINIBAND_CXGB3=m
+# CONFIG_INFINIBAND_CXGB3_DEBUG is not set
+CONFIG_MLX4_INFINIBAND=m
+CONFIG_INFINIBAND_IPOIB=m
+# CONFIG_INFINIBAND_IPOIB_CM is not set
+CONFIG_INFINIBAND_IPOIB_DEBUG=y
+# CONFIG_INFINIBAND_IPOIB_DEBUG_DATA is not set
+CONFIG_INFINIBAND_SRP=m
+CONFIG_INFINIBAND_ISER=m
+
+#
+# EDAC - error detection and reporting (RAS) (EXPERIMENTAL)
+#
+
+#
+# Real Time Clock
+#
+CONFIG_RTC_LIB=m
+CONFIG_RTC_CLASS=m
+
+#
+# RTC interfaces
+#
+CONFIG_RTC_INTF_SYSFS=y
+CONFIG_RTC_INTF_PROC=y
+CONFIG_RTC_INTF_DEV=y
+# CONFIG_RTC_INTF_DEV_UIE_EMUL is not set
+# CONFIG_RTC_DRV_TEST is not set
+
+#
+# I2C RTC drivers
+#
+CONFIG_RTC_DRV_DS1307=m
+CONFIG_RTC_DRV_DS1672=m
+CONFIG_RTC_DRV_MAX6900=m
+CONFIG_RTC_DRV_RS5C372=m
+CONFIG_RTC_DRV_ISL1208=m
+CONFIG_RTC_DRV_X1205=m
+CONFIG_RTC_DRV_PCF8563=m
+CONFIG_RTC_DRV_PCF8583=m
+
+#
+# SPI RTC drivers
+#
+CONFIG_RTC_DRV_RS5C348=m
+CONFIG_RTC_DRV_MAX6902=m
+
+#
+# Platform RTC drivers
+#
+CONFIG_RTC_DRV_CMOS=m
+# CONFIG_RTC_DRV_DS1553 is not set
+# CONFIG_RTC_DRV_DS1742 is not set
+CONFIG_RTC_DRV_M48T86=m
+# CONFIG_RTC_DRV_V3020 is not set
+
+#
+# on-CPU RTC drivers
+#
+
+#
+# DMA Engine support
+#
+CONFIG_DMA_ENGINE=y
+
+#
+# DMA Clients
+#
+CONFIG_NET_DMA=y
+
+#
+# DMA Devices
+#
+# CONFIG_INTEL_IOATDMA is not set
+
+#
+# Auxiliary Display support
+#
+# CONFIG_KS0108 is not set
+
+#
+# File systems
+#
+CONFIG_EXT2_FS=y
+CONFIG_EXT2_FS_XATTR=y
+CONFIG_EXT2_FS_POSIX_ACL=y
+CONFIG_EXT2_FS_SECURITY=y
+# CONFIG_EXT2_FS_XIP is not set
+CONFIG_EXT3_FS=y
+CONFIG_EXT3_FS_XATTR=y
+CONFIG_EXT3_FS_POSIX_ACL=y
+CONFIG_EXT3_FS_SECURITY=y
+CONFIG_EXT4DEV_FS=m
+CONFIG_EXT4DEV_FS_XATTR=y
+CONFIG_EXT4DEV_FS_POSIX_ACL=y
+CONFIG_EXT4DEV_FS_SECURITY=y
+CONFIG_JBD=y
+# CONFIG_JBD_DEBUG is not set
+CONFIG_JBD2=m
+# CONFIG_JBD2_DEBUG is not set
+CONFIG_FS_MBCACHE=y
+CONFIG_REISERFS_FS=m
+# CONFIG_REISERFS_CHECK is not set
+# CONFIG_REISERFS_PROC_INFO is not set
+CONFIG_REISERFS_FS_XATTR=y
+CONFIG_REISERFS_FS_POSIX_ACL=y
+CONFIG_REISERFS_FS_SECURITY=y
+CONFIG_JFS_FS=m
+# CONFIG_JFS_POSIX_ACL is not set
+CONFIG_JFS_SECURITY=y
+# CONFIG_JFS_DEBUG is not set
+# CONFIG_JFS_STATISTICS is not set
+CONFIG_FS_POSIX_ACL=y
+CONFIG_XFS_FS=m
+CONFIG_XFS_QUOTA=y
+CONFIG_XFS_SECURITY=y
+CONFIG_XFS_POSIX_ACL=y
+CONFIG_XFS_RT=y
+CONFIG_GFS2_FS=m
+CONFIG_GFS2_FS_LOCKING_NOLOCK=m
+CONFIG_GFS2_FS_LOCKING_DLM=m
+CONFIG_OCFS2_FS=m
+CONFIG_OCFS2_DEBUG_MASKLOG=y
+CONFIG_MINIX_FS=m
+CONFIG_ROMFS_FS=m
+CONFIG_INOTIFY=y
+CONFIG_INOTIFY_USER=y
+CONFIG_QUOTA=y
+CONFIG_QFMT_V1=m
+CONFIG_QFMT_V2=m
+CONFIG_QUOTACTL=y
+CONFIG_DNOTIFY=y
+CONFIG_AUTOFS_FS=m
+CONFIG_AUTOFS4_FS=m
+CONFIG_FUSE_FS=m
+CONFIG_GENERIC_ACL=y
+
+#
+# CD-ROM/DVD Filesystems
+#
+CONFIG_ISO9660_FS=m
+CONFIG_JOLIET=y
+CONFIG_ZISOFS=y
+CONFIG_UDF_FS=m
+CONFIG_UDF_NLS=y
+
+#
+# DOS/FAT/NT Filesystems
+#
+CONFIG_FAT_FS=m
+CONFIG_MSDOS_FS=m
+CONFIG_VFAT_FS=m
+CONFIG_FAT_DEFAULT_CODEPAGE=437
+CONFIG_FAT_DEFAULT_IOCHARSET="iso8859-1"
+CONFIG_NTFS_FS=m
+# CONFIG_NTFS_DEBUG is not set
+CONFIG_NTFS_RW=y
+
+#
+# Pseudo filesystems
+#
+CONFIG_PROC_FS=y
+CONFIG_PROC_KCORE=y
+CONFIG_PROC_SYSCTL=y
+CONFIG_SYSFS=y
+CONFIG_TMPFS=y
+CONFIG_TMPFS_POSIX_ACL=y
+CONFIG_RAMFS=y
+CONFIG_CONFIGFS_FS=m
+
+#
+# Miscellaneous filesystems
+#
+CONFIG_ADFS_FS=m
+# CONFIG_ADFS_FS_RW is not set
+CONFIG_AFFS_FS=m
+CONFIG_ECRYPT_FS=m
+CONFIG_HFS_FS=m
+CONFIG_HFSPLUS_FS=m
+CONFIG_BEFS_FS=m
+# CONFIG_BEFS_DEBUG is not set
+CONFIG_BFS_FS=m
+CONFIG_EFS_FS=m
+CONFIG_JFFS2_FS=m
+CONFIG_JFFS2_FS_DEBUG=0
+CONFIG_JFFS2_FS_WRITEBUFFER=y
+# CONFIG_JFFS2_SUMMARY is not set
+CONFIG_JFFS2_FS_XATTR=y
+CONFIG_JFFS2_FS_POSIX_ACL=y
+CONFIG_JFFS2_FS_SECURITY=y
+# CONFIG_JFFS2_COMPRESSION_OPTIONS is not set
+CONFIG_JFFS2_ZLIB=y
+CONFIG_JFFS2_RTIME=y
+# CONFIG_JFFS2_RUBIN is not set
+CONFIG_CRAMFS=y
+CONFIG_VXFS_FS=m
+CONFIG_HPFS_FS=m
+CONFIG_QNX4FS_FS=m
+CONFIG_SYSV_FS=m
+CONFIG_UFS_FS=m
+# CONFIG_UFS_FS_WRITE is not set
+# CONFIG_UFS_DEBUG is not set
+
+#
+# Network File Systems
+#
+CONFIG_NFS_FS=y
+CONFIG_NFS_V3=y
+CONFIG_NFS_V3_ACL=y
+CONFIG_NFS_V4=y
+CONFIG_NFS_DIRECTIO=y
+CONFIG_NFSD=m
+CONFIG_NFSD_V2_ACL=y
+CONFIG_NFSD_V3=y
+CONFIG_NFSD_V3_ACL=y
+CONFIG_NFSD_V4=y
+CONFIG_NFSD_TCP=y
+CONFIG_LOCKD=y
+CONFIG_LOCKD_V4=y
+CONFIG_EXPORTFS=m
+CONFIG_NFS_ACL_SUPPORT=y
+CONFIG_NFS_COMMON=y
+CONFIG_SUNRPC=y
+CONFIG_SUNRPC_GSS=y
+CONFIG_SUNRPC_BIND34=y
+CONFIG_RPCSEC_GSS_KRB5=y
+# CONFIG_RPCSEC_GSS_SPKM3 is not set
+CONFIG_SMB_FS=m
+# CONFIG_SMB_NLS_DEFAULT is not set
+CONFIG_CIFS=m
+# CONFIG_CIFS_STATS is not set
+# CONFIG_CIFS_WEAK_PW_HASH is not set
+CONFIG_CIFS_XATTR=y
+CONFIG_CIFS_POSIX=y
+# CONFIG_CIFS_DEBUG2 is not set
+# CONFIG_CIFS_EXPERIMENTAL is not set
+CONFIG_NCP_FS=m
+CONFIG_NCPFS_PACKET_SIGNING=y
+CONFIG_NCPFS_IOCTL_LOCKING=y
+CONFIG_NCPFS_STRONG=y
+CONFIG_NCPFS_NFS_NS=y
+CONFIG_NCPFS_OS2_NS=y
+# CONFIG_NCPFS_SMALLDOS is not set
+CONFIG_NCPFS_NLS=y
+CONFIG_NCPFS_EXTRAS=y
+CONFIG_CODA_FS=m
+# CONFIG_CODA_FS_OLD_API is not set
+CONFIG_AFS_FS=m
+# CONFIG_AFS_DEBUG is not set
+CONFIG_9P_FS=m
+
+#
+# Partition Types
+#
+# CONFIG_PARTITION_ADVANCED is not set
+CONFIG_MSDOS_PARTITION=y
+
+#
+# Native Language Support
+#
+CONFIG_NLS=y
+CONFIG_NLS_DEFAULT="iso8859-1"
+CONFIG_NLS_CODEPAGE_437=m
+CONFIG_NLS_CODEPAGE_737=m
+CONFIG_NLS_CODEPAGE_775=m
+CONFIG_NLS_CODEPAGE_850=m
+CONFIG_NLS_CODEPAGE_852=m
+CONFIG_NLS_CODEPAGE_855=m
+CONFIG_NLS_CODEPAGE_857=m
+CONFIG_NLS_CODEPAGE_860=m
+CONFIG_NLS_CODEPAGE_861=m
+CONFIG_NLS_CODEPAGE_862=m
+CONFIG_NLS_CODEPAGE_863=m
+CONFIG_NLS_CODEPAGE_864=m
+CONFIG_NLS_CODEPAGE_865=m
+CONFIG_NLS_CODEPAGE_866=m
+CONFIG_NLS_CODEPAGE_869=m
+CONFIG_NLS_CODEPAGE_936=m
+CONFIG_NLS_CODEPAGE_950=m
+CONFIG_NLS_CODEPAGE_932=m
+CONFIG_NLS_CODEPAGE_949=m
+CONFIG_NLS_CODEPAGE_874=m
+CONFIG_NLS_ISO8859_8=m
+CONFIG_NLS_CODEPAGE_1250=m
+CONFIG_NLS_CODEPAGE_1251=m
+CONFIG_NLS_ASCII=m
+CONFIG_NLS_ISO8859_1=m
+CONFIG_NLS_ISO8859_2=m
+CONFIG_NLS_ISO8859_3=m
+CONFIG_NLS_ISO8859_4=m
+CONFIG_NLS_ISO8859_5=m
+CONFIG_NLS_ISO8859_6=m
+CONFIG_NLS_ISO8859_7=m
+CONFIG_NLS_ISO8859_9=m
+CONFIG_NLS_ISO8859_13=m
+CONFIG_NLS_ISO8859_14=m
+CONFIG_NLS_ISO8859_15=m
+CONFIG_NLS_KOI8_R=m
+CONFIG_NLS_KOI8_U=m
+CONFIG_NLS_UTF8=m
+
+#
+# Distributed Lock Manager
+#
+CONFIG_DLM=m
+# CONFIG_DLM_DEBUG is not set
+
+#
+# Profiling support
+#
+CONFIG_PROFILING=y
+CONFIG_OPROFILE=m
+
+#
+# Kernel hacking
+#
+CONFIG_TRACE_IRQFLAGS_SUPPORT=y
+# CONFIG_PRINTK_TIME is not set
+CONFIG_ENABLE_MUST_CHECK=y
+CONFIG_MAGIC_SYSRQ=y
+CONFIG_UNUSED_SYMBOLS=y
+# CONFIG_DEBUG_FS is not set
+# CONFIG_HEADERS_CHECK is not set
+# CONFIG_DEBUG_KERNEL is not set
+# CONFIG_CROSSCOMPILE is not set
+CONFIG_CMDLINE=""
+
+#
+# Security options
+#
+CONFIG_KEYS=y
+# CONFIG_KEYS_DEBUG_PROC_KEYS is not set
+CONFIG_SECURITY=y
+CONFIG_SECURITY_NETWORK=y
+CONFIG_SECURITY_NETWORK_XFRM=y
+CONFIG_SECURITY_CAPABILITIES=y
+# CONFIG_SECURITY_ROOTPLUG is not set
+CONFIG_SECURITY_SELINUX=y
+CONFIG_SECURITY_SELINUX_BOOTPARAM=y
+CONFIG_SECURITY_SELINUX_BOOTPARAM_VALUE=0
+CONFIG_SECURITY_SELINUX_DISABLE=y
+CONFIG_SECURITY_SELINUX_DEVELOP=y
+CONFIG_SECURITY_SELINUX_AVC_STATS=y
+CONFIG_SECURITY_SELINUX_CHECKREQPROT_VALUE=1
+# CONFIG_SECURITY_SELINUX_ENABLE_SECMARK_DEFAULT is not set
+# CONFIG_SECURITY_SELINUX_POLICYDB_VERSION_MAX is not set
+
+#
+# Cryptographic options
+#
+CONFIG_CRYPTO=y
+CONFIG_CRYPTO_ALGAPI=y
+CONFIG_CRYPTO_BLKCIPHER=y
+CONFIG_CRYPTO_HASH=y
+CONFIG_CRYPTO_MANAGER=y
+CONFIG_CRYPTO_HMAC=y
+CONFIG_CRYPTO_XCBC=m
+CONFIG_CRYPTO_NULL=m
+CONFIG_CRYPTO_MD4=m
+CONFIG_CRYPTO_MD5=y
+CONFIG_CRYPTO_SHA1=m
+CONFIG_CRYPTO_SHA256=m
+CONFIG_CRYPTO_SHA512=m
+CONFIG_CRYPTO_WP512=m
+CONFIG_CRYPTO_TGR192=m
+CONFIG_CRYPTO_GF128MUL=m
+CONFIG_CRYPTO_ECB=m
+CONFIG_CRYPTO_CBC=y
+CONFIG_CRYPTO_PCBC=m
+CONFIG_CRYPTO_LRW=m
+# CONFIG_CRYPTO_CRYPTD is not set
+CONFIG_CRYPTO_DES=y
+CONFIG_CRYPTO_FCRYPT=m
+CONFIG_CRYPTO_BLOWFISH=m
+CONFIG_CRYPTO_TWOFISH=m
+CONFIG_CRYPTO_TWOFISH_COMMON=m
+CONFIG_CRYPTO_SERPENT=m
+CONFIG_CRYPTO_AES=m
+CONFIG_CRYPTO_CAST5=m
+CONFIG_CRYPTO_CAST6=m
+CONFIG_CRYPTO_TEA=m
+CONFIG_CRYPTO_ARC4=m
+CONFIG_CRYPTO_KHAZAD=m
+CONFIG_CRYPTO_ANUBIS=m
+CONFIG_CRYPTO_DEFLATE=m
+CONFIG_CRYPTO_MICHAEL_MIC=m
+CONFIG_CRYPTO_CRC32C=m
+CONFIG_CRYPTO_CAMELLIA=m
+CONFIG_CRYPTO_TEST=m
+
+#
+# Hardware crypto devices
+#
+
+#
+# Library routines
+#
+CONFIG_BITREVERSE=y
+CONFIG_CRC_CCITT=m
+CONFIG_CRC16=m
+CONFIG_CRC_ITU_T=m
+CONFIG_CRC32=y
+CONFIG_LIBCRC32C=m
+CONFIG_AUDIT_GENERIC=y
+CONFIG_ZLIB_INFLATE=y
+CONFIG_ZLIB_DEFLATE=m
+CONFIG_REED_SOLOMON=m
+CONFIG_REED_SOLOMON_DEC16=y
+CONFIG_TEXTSEARCH=y
+CONFIG_TEXTSEARCH_KMP=m
+CONFIG_TEXTSEARCH_BM=m
+CONFIG_TEXTSEARCH_FSM=m
+CONFIG_PLIST=y
+CONFIG_HAS_IOMEM=y
+CONFIG_HAS_IOPORT=y
+CONFIG_HAS_DMA=y

Added: dists/sid/linux-2.6/debian/config/mips/config.qemu
==============================================================================
--- (empty file)
+++ dists/sid/linux-2.6/debian/config/mips/config.qemu	Mon Nov 26 20:06:56 2007
@@ -0,0 +1,1226 @@
+#
+# Machine selection
+#
+# CONFIG_MIPS_MTX1 is not set
+# CONFIG_MIPS_BOSPORUS is not set
+# CONFIG_MIPS_PB1000 is not set
+# CONFIG_MIPS_PB1100 is not set
+# CONFIG_MIPS_PB1500 is not set
+# CONFIG_MIPS_PB1550 is not set
+# CONFIG_MIPS_PB1200 is not set
+# CONFIG_MIPS_DB1000 is not set
+# CONFIG_MIPS_DB1100 is not set
+# CONFIG_MIPS_DB1500 is not set
+# CONFIG_MIPS_DB1550 is not set
+# CONFIG_MIPS_DB1200 is not set
+# CONFIG_MIPS_MIRAGE is not set
+# CONFIG_BASLER_EXCITE is not set
+# CONFIG_MIPS_COBALT is not set
+# CONFIG_MACH_DECSTATION is not set
+# CONFIG_MIPS_EV64120 is not set
+# CONFIG_MIPS_EV96100 is not set
+# CONFIG_MIPS_IVR is not set
+# CONFIG_MIPS_ITE8172 is not set
+# CONFIG_MACH_JAZZ is not set
+# CONFIG_LASAT is not set
+# CONFIG_MIPS_ATLAS is not set
+# CONFIG_MIPS_MALTA is not set
+# CONFIG_MIPS_SEAD is not set
+# CONFIG_WR_PPMC is not set
+# CONFIG_MIPS_SIM is not set
+# CONFIG_MOMENCO_JAGUAR_ATX is not set
+# CONFIG_MOMENCO_OCELOT is not set
+# CONFIG_MOMENCO_OCELOT_3 is not set
+# CONFIG_MOMENCO_OCELOT_C is not set
+# CONFIG_MOMENCO_OCELOT_G is not set
+# CONFIG_MIPS_XXS1500 is not set
+# CONFIG_PNX8550_V2PCI is not set
+# CONFIG_PNX8550_JBS is not set
+# CONFIG_DDB5477 is not set
+# CONFIG_MACH_VR41XX is not set
+# CONFIG_PMC_YOSEMITE is not set
+CONFIG_QEMU=y
+# CONFIG_MARKEINS is not set
+# CONFIG_SGI_IP22 is not set
+# CONFIG_SGI_IP27 is not set
+# CONFIG_SGI_IP32 is not set
+# CONFIG_SIBYTE_BIGSUR is not set
+# CONFIG_SIBYTE_SWARM is not set
+# CONFIG_SIBYTE_SENTOSA is not set
+# CONFIG_SIBYTE_RHONE is not set
+# CONFIG_SIBYTE_CARMEL is not set
+# CONFIG_SIBYTE_PTSWARM is not set
+# CONFIG_SIBYTE_LITTLESUR is not set
+# CONFIG_SIBYTE_CRHINE is not set
+# CONFIG_SIBYTE_CRHONE is not set
+# CONFIG_SNI_RM200_PCI is not set
+# CONFIG_TOSHIBA_JMR3927 is not set
+# CONFIG_TOSHIBA_RBTX4927 is not set
+# CONFIG_TOSHIBA_RBTX4938 is not set
+CONFIG_RWSEM_GENERIC_SPINLOCK=y
+CONFIG_GENERIC_FIND_NEXT_BIT=y
+CONFIG_GENERIC_HWEIGHT=y
+CONFIG_GENERIC_CALIBRATE_DELAY=y
+CONFIG_SCHED_NO_NO_OMIT_FRAME_POINTER=y
+CONFIG_DMA_COHERENT=y
+CONFIG_GENERIC_ISA_DMA=y
+CONFIG_I8259=y
+CONFIG_CPU_BIG_ENDIAN=y
+# CONFIG_CPU_LITTLE_ENDIAN is not set
+CONFIG_SYS_SUPPORTS_BIG_ENDIAN=y
+CONFIG_SYS_SUPPORTS_LITTLE_ENDIAN=y
+CONFIG_SWAP_IO_SPACE=y
+CONFIG_MIPS_L1_CACHE_SHIFT=5
+CONFIG_HAVE_STD_PC_SERIAL_PORT=y
+
+#
+# CPU selection
+#
+CONFIG_CPU_MIPS32_R1=y
+# CONFIG_CPU_MIPS32_R2 is not set
+# CONFIG_CPU_MIPS64_R1 is not set
+# CONFIG_CPU_MIPS64_R2 is not set
+# CONFIG_CPU_R3000 is not set
+# CONFIG_CPU_TX39XX is not set
+# CONFIG_CPU_VR41XX is not set
+# CONFIG_CPU_R4300 is not set
+# CONFIG_CPU_R4X00 is not set
+# CONFIG_CPU_TX49XX is not set
+# CONFIG_CPU_R5000 is not set
+# CONFIG_CPU_R5432 is not set
+# CONFIG_CPU_R6000 is not set
+# CONFIG_CPU_NEVADA is not set
+# CONFIG_CPU_R8000 is not set
+# CONFIG_CPU_R10000 is not set
+# CONFIG_CPU_RM7000 is not set
+# CONFIG_CPU_RM9000 is not set
+# CONFIG_CPU_SB1 is not set
+CONFIG_SYS_HAS_CPU_MIPS32_R1=y
+CONFIG_CPU_MIPS32=y
+CONFIG_CPU_MIPSR1=y
+CONFIG_SYS_SUPPORTS_32BIT_KERNEL=y
+CONFIG_CPU_SUPPORTS_32BIT_KERNEL=y
+
+#
+# Kernel type
+#
+CONFIG_32BIT=y
+# CONFIG_64BIT is not set
+CONFIG_PAGE_SIZE_4KB=y
+# CONFIG_PAGE_SIZE_8KB is not set
+# CONFIG_PAGE_SIZE_16KB is not set
+# CONFIG_PAGE_SIZE_64KB is not set
+CONFIG_CPU_HAS_PREFETCH=y
+CONFIG_MIPS_MT_DISABLED=y
+# CONFIG_MIPS_MT_SMTC is not set
+# CONFIG_MIPS_MT_SMP is not set
+# CONFIG_MIPS_VPE_LOADER is not set
+# CONFIG_64BIT_PHYS_ADDR is not set
+CONFIG_CPU_HAS_LLSC=y
+CONFIG_CPU_HAS_SYNC=y
+CONFIG_GENERIC_HARDIRQS=y
+CONFIG_GENERIC_IRQ_PROBE=y
+CONFIG_CPU_SUPPORTS_HIGHMEM=y
+CONFIG_ARCH_FLATMEM_ENABLE=y
+CONFIG_ARCH_SPARSEMEM_ENABLE=y
+CONFIG_SELECT_MEMORY_MODEL=y
+CONFIG_FLATMEM_MANUAL=y
+# CONFIG_DISCONTIGMEM_MANUAL is not set
+# CONFIG_SPARSEMEM_MANUAL is not set
+CONFIG_FLATMEM=y
+CONFIG_FLAT_NODE_MEM_MAP=y
+CONFIG_SPARSEMEM_STATIC=y
+CONFIG_SPLIT_PTLOCK_CPUS=4
+# CONFIG_RESOURCES_64BIT is not set
+# CONFIG_HZ_48 is not set
+# CONFIG_HZ_100 is not set
+# CONFIG_HZ_128 is not set
+CONFIG_HZ_250=y
+# CONFIG_HZ_256 is not set
+# CONFIG_HZ_1000 is not set
+# CONFIG_HZ_1024 is not set
+CONFIG_SYS_SUPPORTS_ARBIT_HZ=y
+CONFIG_HZ=250
+CONFIG_PREEMPT_NONE=y
+# CONFIG_PREEMPT_VOLUNTARY is not set
+# CONFIG_PREEMPT is not set
+CONFIG_DEFCONFIG_LIST="/lib/modules/$UNAME_RELEASE/.config"
+
+#
+# Code maturity level options
+#
+CONFIG_EXPERIMENTAL=y
+CONFIG_BROKEN_ON_SMP=y
+
+#
+# General setup
+#
+CONFIG_LOCALVERSION=""
+CONFIG_LOCALVERSION_AUTO=y
+CONFIG_SWAP=y
+CONFIG_SYSVIPC=y
+CONFIG_POSIX_MQUEUE=y
+# CONFIG_BSD_PROCESS_ACCT is not set
+# CONFIG_TASKSTATS is not set
+CONFIG_AUDIT=y
+CONFIG_IKCONFIG=y
+CONFIG_IKCONFIG_PROC=y
+CONFIG_INITRAMFS_SOURCE=""
+# CONFIG_CC_OPTIMIZE_FOR_SIZE is not set
+CONFIG_EMBEDDED=y
+CONFIG_HOTPLUG=y
+CONFIG_BASE_FULL=y
+CONFIG_SLAB=y
+CONFIG_BASE_SMALL=0
+# CONFIG_SLOB is not set
+
+#
+# Loadable module support
+#
+CONFIG_MODULES=y
+CONFIG_MODULE_UNLOAD=y
+CONFIG_MODULE_FORCE_UNLOAD=y
+CONFIG_MODVERSIONS=y
+# CONFIG_MODULE_SRCVERSION_ALL is not set
+CONFIG_KMOD=y
+
+#
+# Block layer
+#
+# CONFIG_LBD is not set
+# CONFIG_BLK_DEV_IO_TRACE is not set
+# CONFIG_LSF is not set
+
+#
+# IO Schedulers
+#
+CONFIG_IOSCHED_NOOP=y
+CONFIG_IOSCHED_AS=y
+CONFIG_IOSCHED_DEADLINE=y
+CONFIG_IOSCHED_CFQ=y
+# CONFIG_DEFAULT_AS is not set
+# CONFIG_DEFAULT_DEADLINE is not set
+CONFIG_DEFAULT_CFQ=y
+# CONFIG_DEFAULT_NOOP is not set
+CONFIG_DEFAULT_IOSCHED="cfq"
+
+#
+# Bus options (PCI, PCMCIA, EISA, ISA, TC)
+#
+CONFIG_ISA=y
+CONFIG_MMU=y
+CONFIG_I8253=y
+
+#
+# PCCARD (PCMCIA/CardBus) support
+#
+# CONFIG_PCCARD is not set
+
+#
+# PCI Hotplug Support
+#
+
+#
+# Executable file formats
+#
+CONFIG_BINFMT_ELF=y
+CONFIG_BINFMT_MISC=m
+CONFIG_TRAD_SIGNALS=y
+
+#
+# Networking
+#
+CONFIG_NET=y
+
+#
+# Networking options
+#
+CONFIG_PACKET=y
+CONFIG_PACKET_MMAP=y
+CONFIG_UNIX=y
+CONFIG_XFRM=y
+# CONFIG_XFRM_USER is not set
+CONFIG_NET_KEY=m
+CONFIG_INET=y
+CONFIG_IP_MULTICAST=y
+CONFIG_IP_ADVANCED_ROUTER=y
+CONFIG_ASK_IP_FIB_HASH=y
+# CONFIG_IP_FIB_TRIE is not set
+CONFIG_IP_FIB_HASH=y
+CONFIG_IP_MULTIPLE_TABLES=y
+CONFIG_IP_ROUTE_MULTIPATH=y
+CONFIG_IP_ROUTE_VERBOSE=y
+# CONFIG_IP_PNP is not set
+CONFIG_NET_IPIP=m
+CONFIG_NET_IPGRE=m
+CONFIG_NET_IPGRE_BROADCAST=y
+CONFIG_IP_MROUTE=y
+CONFIG_IP_PIMSM_V1=y
+CONFIG_IP_PIMSM_V2=y
+# CONFIG_ARPD is not set
+CONFIG_SYN_COOKIES=y
+CONFIG_INET_AH=m
+CONFIG_INET_ESP=m
+CONFIG_INET_IPCOMP=m
+CONFIG_INET_XFRM_TUNNEL=m
+CONFIG_INET_TUNNEL=m
+CONFIG_INET_XFRM_MODE_TRANSPORT=y
+CONFIG_INET_XFRM_MODE_TUNNEL=y
+CONFIG_INET_DIAG=m
+CONFIG_INET_TCP_DIAG=m
+CONFIG_TCP_CONG_ADVANCED=y
+
+#
+# TCP congestion control
+#
+CONFIG_TCP_CONG_BIC=y
+CONFIG_TCP_CONG_CUBIC=m
+CONFIG_TCP_CONG_WESTWOOD=m
+CONFIG_TCP_CONG_HTCP=m
+CONFIG_TCP_CONG_HSTCP=m
+CONFIG_TCP_CONG_HYBLA=m
+CONFIG_TCP_CONG_VEGAS=m
+CONFIG_TCP_CONG_SCALABLE=m
+# CONFIG_TCP_CONG_LP is not set
+# CONFIG_TCP_CONG_VENO is not set
+
+#
+# IP: Virtual Server Configuration
+#
+CONFIG_IP_VS=m
+# CONFIG_IP_VS_DEBUG is not set
+CONFIG_IP_VS_TAB_BITS=12
+
+#
+# IPVS transport protocol load balancing support
+#
+CONFIG_IP_VS_PROTO_TCP=y
+CONFIG_IP_VS_PROTO_UDP=y
+CONFIG_IP_VS_PROTO_ESP=y
+CONFIG_IP_VS_PROTO_AH=y
+
+#
+# IPVS scheduler
+#
+CONFIG_IP_VS_RR=m
+CONFIG_IP_VS_WRR=m
+CONFIG_IP_VS_LC=m
+CONFIG_IP_VS_WLC=m
+CONFIG_IP_VS_LBLC=m
+CONFIG_IP_VS_LBLCR=m
+CONFIG_IP_VS_DH=m
+CONFIG_IP_VS_SH=m
+CONFIG_IP_VS_SED=m
+CONFIG_IP_VS_NQ=m
+
+#
+# IPVS application helper
+#
+CONFIG_IP_VS_FTP=m
+CONFIG_IPV6=m
+CONFIG_IPV6_PRIVACY=y
+# CONFIG_IPV6_ROUTER_PREF is not set
+CONFIG_INET6_AH=m
+CONFIG_INET6_ESP=m
+CONFIG_INET6_IPCOMP=m
+CONFIG_INET6_XFRM_TUNNEL=m
+CONFIG_INET6_TUNNEL=m
+CONFIG_INET6_XFRM_MODE_TRANSPORT=m
+CONFIG_INET6_XFRM_MODE_TUNNEL=m
+CONFIG_IPV6_TUNNEL=m
+CONFIG_NETWORK_SECMARK=y
+CONFIG_NETFILTER=y
+# CONFIG_NETFILTER_DEBUG is not set
+CONFIG_BRIDGE_NETFILTER=y
+
+#
+# Core Netfilter Configuration
+#
+CONFIG_NETFILTER_NETLINK=m
+CONFIG_NETFILTER_NETLINK_QUEUE=m
+CONFIG_NETFILTER_NETLINK_LOG=m
+CONFIG_NETFILTER_XTABLES=m
+CONFIG_NETFILTER_XT_TARGET_CLASSIFY=m
+CONFIG_NETFILTER_XT_TARGET_CONNMARK=m
+CONFIG_NETFILTER_XT_TARGET_MARK=m
+CONFIG_NETFILTER_XT_TARGET_NFQUEUE=m
+CONFIG_NETFILTER_XT_TARGET_NOTRACK=m
+# CONFIG_NETFILTER_XT_TARGET_SECMARK is not set
+CONFIG_NETFILTER_XT_MATCH_COMMENT=m
+CONFIG_NETFILTER_XT_MATCH_CONNBYTES=m
+CONFIG_NETFILTER_XT_MATCH_CONNMARK=m
+CONFIG_NETFILTER_XT_MATCH_CONNTRACK=m
+CONFIG_NETFILTER_XT_MATCH_DCCP=m
+CONFIG_NETFILTER_XT_MATCH_ESP=m
+CONFIG_NETFILTER_XT_MATCH_HELPER=m
+CONFIG_NETFILTER_XT_MATCH_LENGTH=m
+CONFIG_NETFILTER_XT_MATCH_LIMIT=m
+CONFIG_NETFILTER_XT_MATCH_MAC=m
+CONFIG_NETFILTER_XT_MATCH_MARK=m
+CONFIG_NETFILTER_XT_MATCH_POLICY=m
+CONFIG_NETFILTER_XT_MATCH_MULTIPORT=m
+CONFIG_NETFILTER_XT_MATCH_PHYSDEV=m
+CONFIG_NETFILTER_XT_MATCH_PKTTYPE=m
+# CONFIG_NETFILTER_XT_MATCH_QUOTA is not set
+CONFIG_NETFILTER_XT_MATCH_REALM=m
+CONFIG_NETFILTER_XT_MATCH_SCTP=m
+CONFIG_NETFILTER_XT_MATCH_STATE=m
+# CONFIG_NETFILTER_XT_MATCH_STATISTIC is not set
+CONFIG_NETFILTER_XT_MATCH_STRING=m
+CONFIG_NETFILTER_XT_MATCH_TCPMSS=m
+
+#
+# IP: Netfilter Configuration
+#
+CONFIG_IP_NF_QUEUE=m
+CONFIG_IP_NF_IPTABLES=m
+CONFIG_IP_NF_MATCH_IPRANGE=m
+CONFIG_IP_NF_MATCH_TOS=m
+CONFIG_IP_NF_MATCH_RECENT=m
+CONFIG_IP_NF_MATCH_ECN=m
+CONFIG_IP_NF_MATCH_DSCP=m
+CONFIG_IP_NF_MATCH_AH=m
+CONFIG_IP_NF_MATCH_TTL=m
+CONFIG_IP_NF_MATCH_OWNER=m
+CONFIG_IP_NF_MATCH_ADDRTYPE=m
+CONFIG_IP_NF_MATCH_HASHLIMIT=m
+CONFIG_IP_NF_FILTER=m
+CONFIG_IP_NF_TARGET_REJECT=m
+CONFIG_IP_NF_TARGET_LOG=m
+CONFIG_IP_NF_TARGET_ULOG=m
+CONFIG_IP_NF_TARGET_TCPMSS=m
+CONFIG_IP_NF_TARGET_MASQUERADE=m
+CONFIG_IP_NF_TARGET_REDIRECT=m
+CONFIG_IP_NF_TARGET_NETMAP=m
+CONFIG_IP_NF_TARGET_SAME=m
+CONFIG_IP_NF_MANGLE=m
+CONFIG_IP_NF_TARGET_TOS=m
+CONFIG_IP_NF_TARGET_ECN=m
+CONFIG_IP_NF_TARGET_DSCP=m
+CONFIG_IP_NF_TARGET_TTL=m
+CONFIG_IP_NF_TARGET_CLUSTERIP=m
+CONFIG_IP_NF_RAW=m
+CONFIG_IP_NF_ARPTABLES=m
+CONFIG_IP_NF_ARPFILTER=m
+CONFIG_IP_NF_ARP_MANGLE=m
+
+#
+# IPv6: Netfilter Configuration (EXPERIMENTAL)
+#
+CONFIG_IP6_NF_QUEUE=m
+CONFIG_IP6_NF_IPTABLES=m
+CONFIG_IP6_NF_MATCH_RT=m
+CONFIG_IP6_NF_MATCH_OPTS=m
+CONFIG_IP6_NF_MATCH_FRAG=m
+CONFIG_IP6_NF_MATCH_HL=m
+CONFIG_IP6_NF_MATCH_OWNER=m
+CONFIG_IP6_NF_MATCH_IPV6HEADER=m
+CONFIG_IP6_NF_MATCH_AH=m
+CONFIG_IP6_NF_MATCH_EUI64=m
+CONFIG_IP6_NF_FILTER=m
+CONFIG_IP6_NF_TARGET_LOG=m
+CONFIG_IP6_NF_TARGET_REJECT=m
+CONFIG_IP6_NF_MANGLE=m
+CONFIG_IP6_NF_TARGET_HL=m
+CONFIG_IP6_NF_RAW=m
+
+#
+# Bridge: Netfilter Configuration
+#
+CONFIG_BRIDGE_NF_EBTABLES=m
+CONFIG_BRIDGE_EBT_BROUTE=m
+CONFIG_BRIDGE_EBT_T_FILTER=m
+CONFIG_BRIDGE_EBT_T_NAT=m
+CONFIG_BRIDGE_EBT_802_3=m
+CONFIG_BRIDGE_EBT_AMONG=m
+CONFIG_BRIDGE_EBT_ARP=m
+CONFIG_BRIDGE_EBT_IP=m
+CONFIG_BRIDGE_EBT_LIMIT=m
+CONFIG_BRIDGE_EBT_MARK=m
+CONFIG_BRIDGE_EBT_PKTTYPE=m
+CONFIG_BRIDGE_EBT_STP=m
+CONFIG_BRIDGE_EBT_VLAN=m
+CONFIG_BRIDGE_EBT_ARPREPLY=m
+CONFIG_BRIDGE_EBT_DNAT=m
+CONFIG_BRIDGE_EBT_MARK_T=m
+CONFIG_BRIDGE_EBT_REDIRECT=m
+CONFIG_BRIDGE_EBT_SNAT=m
+CONFIG_BRIDGE_EBT_LOG=m
+CONFIG_BRIDGE_EBT_ULOG=m
+
+#
+# DCCP Configuration (EXPERIMENTAL)
+#
+CONFIG_IP_DCCP=m
+CONFIG_INET_DCCP_DIAG=m
+CONFIG_IP_DCCP_ACKVEC=y
+
+#
+# DCCP CCIDs Configuration (EXPERIMENTAL)
+#
+CONFIG_IP_DCCP_CCID2=m
+CONFIG_IP_DCCP_CCID3=m
+CONFIG_IP_DCCP_TFRC_LIB=m
+
+#
+# SCTP Configuration (EXPERIMENTAL)
+#
+CONFIG_IP_SCTP=m
+# CONFIG_SCTP_DBG_MSG is not set
+# CONFIG_SCTP_DBG_OBJCNT is not set
+# CONFIG_SCTP_HMAC_NONE is not set
+# CONFIG_SCTP_HMAC_SHA1 is not set
+CONFIG_SCTP_HMAC_MD5=y
+
+#
+# TIPC Configuration (EXPERIMENTAL)
+#
+CONFIG_TIPC=m
+CONFIG_TIPC_ADVANCED=y
+CONFIG_TIPC_ZONES=3
+CONFIG_TIPC_CLUSTERS=1
+CONFIG_TIPC_NODES=255
+CONFIG_TIPC_SLAVE_NODES=0
+CONFIG_TIPC_PORTS=8191
+CONFIG_TIPC_LOG=0
+# CONFIG_TIPC_DEBUG is not set
+# CONFIG_ATM is not set
+CONFIG_BRIDGE=m
+CONFIG_VLAN_8021Q=m
+# CONFIG_DECNET is not set
+CONFIG_LLC=m
+# CONFIG_LLC2 is not set
+# CONFIG_IPX is not set
+# CONFIG_ATALK is not set
+# CONFIG_X25 is not set
+# CONFIG_LAPB is not set
+# CONFIG_ECONET is not set
+# CONFIG_WAN_ROUTER is not set
+
+#
+# Network testing
+#
+# CONFIG_HAMRADIO is not set
+# CONFIG_IRDA is not set
+# CONFIG_BT is not set
+# CONFIG_IEEE80211 is not set
+
+#
+# Device Drivers
+#
+
+#
+# Generic Driver Options
+#
+# CONFIG_STANDALONE is not set
+# CONFIG_PREVENT_FIRMWARE_BUILD is not set
+CONFIG_FW_LOADER=m
+# CONFIG_SYS_HYPERVISOR is not set
+
+#
+# Connector - unified userspace <-> kernelspace linker
+#
+# CONFIG_CONNECTOR is not set
+
+#
+# Memory Technology Devices (MTD)
+#
+# CONFIG_MTD is not set
+
+#
+# Parallel port support
+#
+# CONFIG_PARPORT is not set
+
+#
+# Plug and Play support
+#
+CONFIG_PNP=y
+# CONFIG_PNP_DEBUG is not set
+
+#
+# Protocols
+#
+CONFIG_ISAPNP=y
+
+#
+# Block devices
+#
+# CONFIG_BLK_DEV_COW_COMMON is not set
+CONFIG_BLK_DEV_LOOP=m
+CONFIG_BLK_DEV_CRYPTOLOOP=m
+# CONFIG_BLK_DEV_NBD is not set
+CONFIG_BLK_DEV_RAM=y
+CONFIG_BLK_DEV_RAM_COUNT=16
+CONFIG_BLK_DEV_RAM_SIZE=8192
+CONFIG_BLK_DEV_RAM_BLOCKSIZE=1024
+CONFIG_BLK_DEV_INITRD=y
+CONFIG_CDROM_PKTCDVD=m
+CONFIG_CDROM_PKTCDVD_BUFFERS=8
+# CONFIG_CDROM_PKTCDVD_WCACHE is not set
+CONFIG_ATA_OVER_ETH=m
+
+#
+# ATA/ATAPI/MFM/RLL support
+#
+CONFIG_IDE=y
+CONFIG_BLK_DEV_IDE=y
+
+#
+# Please see Documentation/ide.txt for help/info on IDE drives
+#
+# CONFIG_BLK_DEV_IDE_SATA is not set
+CONFIG_BLK_DEV_IDEDISK=y
+CONFIG_IDEDISK_MULTI_MODE=y
+CONFIG_BLK_DEV_IDECD=m
+# CONFIG_BLK_DEV_IDETAPE is not set
+# CONFIG_BLK_DEV_IDEFLOPPY is not set
+# CONFIG_IDE_TASK_IOCTL is not set
+
+#
+# IDE chipset support/bugfixes
+#
+CONFIG_IDE_GENERIC=y
+# CONFIG_BLK_DEV_IDEPNP is not set
+# CONFIG_IDE_ARM is not set
+# CONFIG_IDE_CHIPSETS is not set
+# CONFIG_BLK_DEV_IDEDMA is not set
+# CONFIG_BLK_DEV_HD is not set
+
+#
+# SCSI device support
+#
+# CONFIG_RAID_ATTRS is not set
+# CONFIG_SCSI is not set
+
+#
+# Multi-device support (RAID and LVM)
+#
+CONFIG_MD=y
+CONFIG_BLK_DEV_MD=m
+CONFIG_MD_LINEAR=m
+CONFIG_MD_RAID0=m
+CONFIG_MD_RAID1=m
+CONFIG_MD_RAID10=m
+CONFIG_MD_RAID456=m
+CONFIG_MD_RAID5_RESHAPE=y
+CONFIG_MD_MULTIPATH=m
+CONFIG_MD_FAULTY=m
+CONFIG_BLK_DEV_DM=m
+CONFIG_DM_CRYPT=m
+CONFIG_DM_SNAPSHOT=m
+CONFIG_DM_MIRROR=m
+CONFIG_DM_ZERO=m
+CONFIG_DM_MULTIPATH=m
+# CONFIG_DM_MULTIPATH_EMC is not set
+
+#
+# Fusion MPT device support
+#
+# CONFIG_FUSION is not set
+
+#
+# IEEE 1394 (FireWire) support
+#
+
+#
+# I2O device support
+#
+
+#
+# Network device support
+#
+CONFIG_NETDEVICES=y
+# CONFIG_IFB is not set
+# CONFIG_DUMMY is not set
+CONFIG_BONDING=m
+# CONFIG_EQUALIZER is not set
+CONFIG_TUN=m
+# CONFIG_NET_SB1000 is not set
+
+#
+# ARCnet devices
+#
+# CONFIG_ARCNET is not set
+
+#
+# PHY device support
+#
+# CONFIG_PHYLIB is not set
+
+#
+# Ethernet (10 or 100Mbit)
+#
+CONFIG_NET_ETHERNET=y
+CONFIG_MII=y
+# CONFIG_NET_VENDOR_3COM is not set
+# CONFIG_NET_VENDOR_SMC is not set
+# CONFIG_DM9000 is not set
+# CONFIG_NET_VENDOR_RACAL is not set
+# CONFIG_AT1700 is not set
+# CONFIG_DEPCA is not set
+# CONFIG_HP100 is not set
+CONFIG_NET_ISA=y
+# CONFIG_E2100 is not set
+# CONFIG_EWRK3 is not set
+# CONFIG_EEXPRESS is not set
+# CONFIG_EEXPRESS_PRO is not set
+# CONFIG_HPLAN_PLUS is not set
+# CONFIG_HPLAN is not set
+# CONFIG_LP486E is not set
+# CONFIG_ETH16I is not set
+CONFIG_NE2000=y
+# CONFIG_SEEQ8005 is not set
+# CONFIG_NET_PCI is not set
+
+#
+# Ethernet (1000 Mbit)
+#
+
+#
+# Ethernet (10000 Mbit)
+#
+
+#
+# Token Ring devices
+#
+# CONFIG_TR is not set
+
+#
+# Wireless LAN (non-hamradio)
+#
+# CONFIG_NET_RADIO is not set
+
+#
+# Wan interfaces
+#
+# CONFIG_WAN is not set
+CONFIG_PPP=m
+CONFIG_PPP_MULTILINK=y
+CONFIG_PPP_FILTER=y
+CONFIG_PPP_ASYNC=m
+CONFIG_PPP_SYNC_TTY=m
+CONFIG_PPP_DEFLATE=m
+CONFIG_PPP_BSDCOMP=m
+CONFIG_PPP_MPPE=m
+CONFIG_PPPOE=m
+CONFIG_SLIP=m
+CONFIG_SLIP_COMPRESSED=y
+CONFIG_SLIP_SMART=y
+CONFIG_SLIP_MODE_SLIP6=y
+# CONFIG_SHAPER is not set
+CONFIG_NETCONSOLE=m
+CONFIG_NETPOLL=y
+# CONFIG_NETPOLL_TRAP is not set
+CONFIG_NET_POLL_CONTROLLER=y
+
+#
+# ISDN subsystem
+#
+# CONFIG_ISDN is not set
+
+#
+# Telephony Support
+#
+# CONFIG_PHONE is not set
+
+#
+# Input device support
+#
+CONFIG_INPUT=y
+
+#
+# Userland interfaces
+#
+CONFIG_INPUT_MOUSEDEV=m
+CONFIG_INPUT_MOUSEDEV_PSAUX=y
+CONFIG_INPUT_MOUSEDEV_SCREEN_X=1024
+CONFIG_INPUT_MOUSEDEV_SCREEN_Y=768
+# CONFIG_INPUT_JOYDEV is not set
+# CONFIG_INPUT_TSDEV is not set
+CONFIG_INPUT_EVDEV=m
+# CONFIG_INPUT_EVBUG is not set
+
+#
+# Input Device Drivers
+#
+CONFIG_INPUT_KEYBOARD=y
+CONFIG_KEYBOARD_ATKBD=m
+# CONFIG_KEYBOARD_SUNKBD is not set
+# CONFIG_KEYBOARD_LKKBD is not set
+# CONFIG_KEYBOARD_XTKBD is not set
+# CONFIG_KEYBOARD_NEWTON is not set
+CONFIG_INPUT_MOUSE=y
+CONFIG_MOUSE_PS2=m
+# CONFIG_MOUSE_SERIAL is not set
+# CONFIG_MOUSE_INPORT is not set
+# CONFIG_MOUSE_LOGIBM is not set
+# CONFIG_MOUSE_PC110PAD is not set
+# CONFIG_MOUSE_VSXXXAA is not set
+# CONFIG_INPUT_JOYSTICK is not set
+# CONFIG_INPUT_TOUCHSCREEN is not set
+CONFIG_INPUT_MISC=y
+# CONFIG_INPUT_PCSPKR is not set
+CONFIG_INPUT_UINPUT=m
+
+#
+# Hardware I/O ports
+#
+CONFIG_SERIO=m
+CONFIG_SERIO_I8042=m
+CONFIG_SERIO_SERPORT=m
+CONFIG_SERIO_LIBPS2=m
+# CONFIG_SERIO_RAW is not set
+# CONFIG_GAMEPORT is not set
+
+#
+# Character devices
+#
+CONFIG_VT=y
+CONFIG_VT_CONSOLE=y
+CONFIG_HW_CONSOLE=y
+# CONFIG_VT_HW_CONSOLE_BINDING is not set
+# CONFIG_SERIAL_NONSTANDARD is not set
+
+#
+# Serial drivers
+#
+CONFIG_SERIAL_8250=y
+CONFIG_SERIAL_8250_CONSOLE=y
+CONFIG_SERIAL_8250_PNP=y
+CONFIG_SERIAL_8250_NR_UARTS=4
+CONFIG_SERIAL_8250_RUNTIME_UARTS=4
+# CONFIG_SERIAL_8250_EXTENDED is not set
+
+#
+# Non-8250 serial port support
+#
+CONFIG_SERIAL_CORE=y
+CONFIG_SERIAL_CORE_CONSOLE=y
+
+#
+# IPMI
+#
+# CONFIG_IPMI_HANDLER is not set
+
+#
+# Watchdog Cards
+#
+# CONFIG_WATCHDOG is not set
+# CONFIG_HW_RANDOM is not set
+CONFIG_RTC=y
+# CONFIG_DTLK is not set
+# CONFIG_R3964 is not set
+
+#
+# Ftape, the floppy tape device driver
+#
+# CONFIG_RAW_DRIVER is not set
+
+#
+# TPM devices
+#
+# CONFIG_TCG_TPM is not set
+# CONFIG_TELCLOCK is not set
+
+#
+# I2C support
+#
+# CONFIG_I2C is not set
+
+#
+# SPI support
+#
+# CONFIG_SPI is not set
+# CONFIG_SPI_MASTER is not set
+
+#
+# Dallas's 1-wire bus
+#
+
+#
+# Hardware Monitoring support
+#
+# CONFIG_HWMON is not set
+# CONFIG_HWMON_VID is not set
+
+#
+# Misc devices
+#
+
+#
+# Multimedia devices
+#
+# CONFIG_VIDEO_DEV is not set
+
+#
+# Digital Video Broadcasting Devices
+#
+# CONFIG_DVB is not set
+
+#
+# Graphics support
+#
+# CONFIG_FIRMWARE_EDID is not set
+# CONFIG_FB is not set
+
+#
+# Console display driver support
+#
+CONFIG_VGA_CONSOLE=y
+# CONFIG_VGACON_SOFT_SCROLLBACK is not set
+# CONFIG_MDA_CONSOLE is not set
+CONFIG_DUMMY_CONSOLE=y
+# CONFIG_BACKLIGHT_LCD_SUPPORT is not set
+
+#
+# Sound
+#
+# CONFIG_SOUND is not set
+
+#
+# USB support
+#
+# CONFIG_USB_ARCH_HAS_HCD is not set
+# CONFIG_USB_ARCH_HAS_OHCI is not set
+# CONFIG_USB_ARCH_HAS_EHCI is not set
+
+#
+# NOTE: USB_STORAGE enables SCSI, and 'SCSI disk support'
+#
+
+#
+# USB Gadget Support
+#
+# CONFIG_USB_GADGET is not set
+
+#
+# MMC/SD Card support
+#
+# CONFIG_MMC is not set
+
+#
+# LED devices
+#
+# CONFIG_NEW_LEDS is not set
+
+#
+# LED drivers
+#
+
+#
+# LED Triggers
+#
+
+#
+# InfiniBand support
+#
+
+#
+# EDAC - error detection and reporting (RAS) (EXPERIMENTAL)
+#
+
+#
+# Real Time Clock
+#
+CONFIG_RTC_LIB=m
+CONFIG_RTC_CLASS=m
+
+#
+# RTC interfaces
+#
+CONFIG_RTC_INTF_SYSFS=y
+CONFIG_RTC_INTF_PROC=y
+CONFIG_RTC_INTF_DEV=y
+# CONFIG_RTC_INTF_DEV_UIE_EMUL is not set
+
+#
+# RTC drivers
+#
+# CONFIG_RTC_DRV_DS1553 is not set
+# CONFIG_RTC_DRV_DS1742 is not set
+# CONFIG_RTC_DRV_M48T86 is not set
+# CONFIG_RTC_DRV_TEST is not set
+# CONFIG_RTC_DRV_V3020 is not set
+
+#
+# DMA Engine support
+#
+# CONFIG_DMA_ENGINE is not set
+
+#
+# DMA Clients
+#
+
+#
+# DMA Devices
+#
+
+#
+# File systems
+#
+CONFIG_EXT2_FS=y
+CONFIG_EXT2_FS_XATTR=y
+CONFIG_EXT2_FS_POSIX_ACL=y
+CONFIG_EXT2_FS_SECURITY=y
+# CONFIG_EXT2_FS_XIP is not set
+CONFIG_EXT3_FS=y
+CONFIG_EXT3_FS_XATTR=y
+CONFIG_EXT3_FS_POSIX_ACL=y
+CONFIG_EXT3_FS_SECURITY=y
+CONFIG_JBD=y
+# CONFIG_JBD_DEBUG is not set
+CONFIG_FS_MBCACHE=y
+CONFIG_REISERFS_FS=m
+# CONFIG_REISERFS_CHECK is not set
+# CONFIG_REISERFS_PROC_INFO is not set
+CONFIG_REISERFS_FS_XATTR=y
+CONFIG_REISERFS_FS_POSIX_ACL=y
+CONFIG_REISERFS_FS_SECURITY=y
+CONFIG_JFS_FS=m
+CONFIG_JFS_POSIX_ACL=y
+CONFIG_JFS_SECURITY=y
+# CONFIG_JFS_DEBUG is not set
+# CONFIG_JFS_STATISTICS is not set
+CONFIG_FS_POSIX_ACL=y
+CONFIG_XFS_FS=m
+CONFIG_XFS_QUOTA=y
+CONFIG_XFS_SECURITY=y
+CONFIG_XFS_POSIX_ACL=y
+CONFIG_XFS_RT=y
+CONFIG_OCFS2_FS=m
+CONFIG_OCFS2_DEBUG_MASKLOG=y
+CONFIG_MINIX_FS=m
+CONFIG_ROMFS_FS=m
+CONFIG_INOTIFY=y
+CONFIG_INOTIFY_USER=y
+CONFIG_QUOTA=y
+CONFIG_QFMT_V1=m
+CONFIG_QFMT_V2=m
+CONFIG_QUOTACTL=y
+CONFIG_DNOTIFY=y
+CONFIG_AUTOFS_FS=m
+CONFIG_AUTOFS4_FS=m
+CONFIG_FUSE_FS=m
+
+#
+# CD-ROM/DVD Filesystems
+#
+CONFIG_ISO9660_FS=m
+CONFIG_JOLIET=y
+CONFIG_ZISOFS=y
+CONFIG_UDF_FS=m
+CONFIG_UDF_NLS=y
+
+#
+# DOS/FAT/NT Filesystems
+#
+CONFIG_FAT_FS=m
+CONFIG_MSDOS_FS=m
+CONFIG_VFAT_FS=m
+CONFIG_FAT_DEFAULT_CODEPAGE=437
+CONFIG_FAT_DEFAULT_IOCHARSET="iso8859-1"
+CONFIG_NTFS_FS=m
+# CONFIG_NTFS_DEBUG is not set
+CONFIG_NTFS_RW=y
+
+#
+# Pseudo filesystems
+#
+CONFIG_PROC_FS=y
+CONFIG_PROC_KCORE=y
+CONFIG_SYSFS=y
+CONFIG_TMPFS=y
+CONFIG_RAMFS=y
+CONFIG_CONFIGFS_FS=m
+
+#
+# Miscellaneous filesystems
+#
+# CONFIG_ADFS_FS is not set
+# CONFIG_AFFS_FS is not set
+# CONFIG_HFS_FS is not set
+# CONFIG_HFSPLUS_FS is not set
+# CONFIG_BEFS_FS is not set
+# CONFIG_BFS_FS is not set
+# CONFIG_EFS_FS is not set
+CONFIG_CRAMFS=y
+# CONFIG_VXFS_FS is not set
+# CONFIG_HPFS_FS is not set
+# CONFIG_QNX4FS_FS is not set
+# CONFIG_SYSV_FS is not set
+CONFIG_UFS_FS=m
+# CONFIG_UFS_FS_WRITE is not set
+# CONFIG_UFS_DEBUG is not set
+
+#
+# Network File Systems
+#
+CONFIG_NFS_FS=m
+CONFIG_NFS_V3=y
+CONFIG_NFS_V3_ACL=y
+CONFIG_NFS_V4=y
+CONFIG_NFS_DIRECTIO=y
+CONFIG_NFSD=m
+CONFIG_NFSD_V2_ACL=y
+CONFIG_NFSD_V3=y
+CONFIG_NFSD_V3_ACL=y
+CONFIG_NFSD_V4=y
+CONFIG_NFSD_TCP=y
+CONFIG_LOCKD=m
+CONFIG_LOCKD_V4=y
+CONFIG_EXPORTFS=m
+CONFIG_NFS_ACL_SUPPORT=m
+CONFIG_NFS_COMMON=y
+CONFIG_SUNRPC=m
+CONFIG_SUNRPC_GSS=m
+CONFIG_RPCSEC_GSS_KRB5=m
+CONFIG_RPCSEC_GSS_SPKM3=m
+CONFIG_SMB_FS=m
+# CONFIG_SMB_NLS_DEFAULT is not set
+CONFIG_CIFS=m
+CONFIG_CIFS_STATS=y
+# CONFIG_CIFS_STATS2 is not set
+# CONFIG_CIFS_WEAK_PW_HASH is not set
+# CONFIG_CIFS_XATTR is not set
+# CONFIG_CIFS_DEBUG2 is not set
+# CONFIG_CIFS_EXPERIMENTAL is not set
+# CONFIG_NCP_FS is not set
+# CONFIG_CODA_FS is not set
+# CONFIG_AFS_FS is not set
+# CONFIG_9P_FS is not set
+
+#
+# Partition Types
+#
+# CONFIG_PARTITION_ADVANCED is not set
+CONFIG_MSDOS_PARTITION=y
+
+#
+# Native Language Support
+#
+CONFIG_NLS=y
+CONFIG_NLS_DEFAULT="iso8859-1"
+CONFIG_NLS_CODEPAGE_437=m
+CONFIG_NLS_CODEPAGE_737=m
+CONFIG_NLS_CODEPAGE_775=m
+CONFIG_NLS_CODEPAGE_850=m
+CONFIG_NLS_CODEPAGE_852=m
+CONFIG_NLS_CODEPAGE_855=m
+CONFIG_NLS_CODEPAGE_857=m
+CONFIG_NLS_CODEPAGE_860=m
+CONFIG_NLS_CODEPAGE_861=m
+CONFIG_NLS_CODEPAGE_862=m
+CONFIG_NLS_CODEPAGE_863=m
+CONFIG_NLS_CODEPAGE_864=m
+CONFIG_NLS_CODEPAGE_865=m
+CONFIG_NLS_CODEPAGE_866=m
+CONFIG_NLS_CODEPAGE_869=m
+CONFIG_NLS_CODEPAGE_936=m
+CONFIG_NLS_CODEPAGE_950=m
+CONFIG_NLS_CODEPAGE_932=m
+CONFIG_NLS_CODEPAGE_949=m
+CONFIG_NLS_CODEPAGE_874=m
+CONFIG_NLS_ISO8859_8=m
+CONFIG_NLS_CODEPAGE_1250=m
+CONFIG_NLS_CODEPAGE_1251=m
+CONFIG_NLS_ASCII=m
+CONFIG_NLS_ISO8859_1=m
+CONFIG_NLS_ISO8859_2=m
+CONFIG_NLS_ISO8859_3=m
+CONFIG_NLS_ISO8859_4=m
+CONFIG_NLS_ISO8859_5=m
+CONFIG_NLS_ISO8859_6=m
+CONFIG_NLS_ISO8859_7=m
+CONFIG_NLS_ISO8859_9=m
+CONFIG_NLS_ISO8859_13=m
+CONFIG_NLS_ISO8859_14=m
+CONFIG_NLS_ISO8859_15=m
+CONFIG_NLS_KOI8_R=m
+CONFIG_NLS_KOI8_U=m
+CONFIG_NLS_UTF8=m
+
+#
+# Profiling support
+#
+# CONFIG_PROFILING is not set
+
+#
+# Kernel hacking
+#
+CONFIG_TRACE_IRQFLAGS_SUPPORT=y
+# CONFIG_PRINTK_TIME is not set
+CONFIG_MAGIC_SYSRQ=y
+# CONFIG_UNUSED_SYMBOLS is not set
+# CONFIG_DEBUG_KERNEL is not set
+CONFIG_LOG_BUF_SHIFT=14
+# CONFIG_DEBUG_FS is not set
+# CONFIG_CROSSCOMPILE is not set
+CONFIG_CMDLINE=""
+
+#
+# Security options
+#
+CONFIG_KEYS=y
+# CONFIG_KEYS_DEBUG_PROC_KEYS is not set
+CONFIG_SECURITY=y
+CONFIG_SECURITY_NETWORK=y
+CONFIG_SECURITY_NETWORK_XFRM=y
+CONFIG_SECURITY_CAPABILITIES=y
+# CONFIG_SECURITY_SECLVL is not set
+CONFIG_SECURITY_SELINUX=y
+CONFIG_SECURITY_SELINUX_BOOTPARAM=y
+CONFIG_SECURITY_SELINUX_BOOTPARAM_VALUE=0
+CONFIG_SECURITY_SELINUX_DISABLE=y
+CONFIG_SECURITY_SELINUX_DEVELOP=y
+CONFIG_SECURITY_SELINUX_AVC_STATS=y
+CONFIG_SECURITY_SELINUX_CHECKREQPROT_VALUE=1
+# CONFIG_SECURITY_SELINUX_ENABLE_SECMARK_DEFAULT is not set
+
+#
+# Cryptographic options
+#
+CONFIG_CRYPTO=y
+CONFIG_CRYPTO_HMAC=y
+CONFIG_CRYPTO_NULL=m
+CONFIG_CRYPTO_MD4=m
+CONFIG_CRYPTO_MD5=y
+CONFIG_CRYPTO_SHA1=m
+CONFIG_CRYPTO_SHA256=m
+CONFIG_CRYPTO_SHA512=m
+CONFIG_CRYPTO_WP512=m
+CONFIG_CRYPTO_TGR192=m
+CONFIG_CRYPTO_DES=m
+CONFIG_CRYPTO_BLOWFISH=m
+CONFIG_CRYPTO_TWOFISH=m
+CONFIG_CRYPTO_SERPENT=m
+CONFIG_CRYPTO_AES=m
+CONFIG_CRYPTO_CAST5=m
+CONFIG_CRYPTO_CAST6=m
+CONFIG_CRYPTO_TEA=m
+CONFIG_CRYPTO_ARC4=m
+CONFIG_CRYPTO_KHAZAD=m
+CONFIG_CRYPTO_ANUBIS=m
+CONFIG_CRYPTO_DEFLATE=m
+CONFIG_CRYPTO_MICHAEL_MIC=m
+CONFIG_CRYPTO_CRC32C=m
+CONFIG_CRYPTO_TEST=m
+
+#
+# Hardware crypto devices
+#
+
+#
+# Library routines
+#
+CONFIG_CRC_CCITT=m
+CONFIG_CRC16=m
+CONFIG_CRC32=m
+CONFIG_LIBCRC32C=m
+CONFIG_ZLIB_INFLATE=y
+CONFIG_ZLIB_DEFLATE=m
+CONFIG_TEXTSEARCH=y
+CONFIG_TEXTSEARCH_KMP=m
+CONFIG_TEXTSEARCH_BM=m
+CONFIG_TEXTSEARCH_FSM=m
+CONFIG_PLIST=y

Added: dists/sid/linux-2.6/debian/config/mips/config.r4k-ip22
==============================================================================
--- (empty file)
+++ dists/sid/linux-2.6/debian/config/mips/config.r4k-ip22	Mon Nov 26 20:06:56 2007
@@ -0,0 +1,879 @@
+#
+# Machine selection
+#
+# CONFIG_MIPS_MTX1 is not set
+# CONFIG_MIPS_BOSPORUS is not set
+# CONFIG_MIPS_PB1000 is not set
+# CONFIG_MIPS_PB1100 is not set
+# CONFIG_MIPS_PB1500 is not set
+# CONFIG_MIPS_PB1550 is not set
+# CONFIG_MIPS_PB1200 is not set
+# CONFIG_MIPS_DB1000 is not set
+# CONFIG_MIPS_DB1100 is not set
+# CONFIG_MIPS_DB1500 is not set
+# CONFIG_MIPS_DB1550 is not set
+# CONFIG_MIPS_DB1200 is not set
+# CONFIG_MIPS_MIRAGE is not set
+# CONFIG_MIPS_COBALT is not set
+# CONFIG_MACH_DECSTATION is not set
+# CONFIG_MIPS_EV64120 is not set
+# CONFIG_MIPS_EV96100 is not set
+# CONFIG_MIPS_IVR is not set
+# CONFIG_MIPS_ITE8172 is not set
+# CONFIG_MACH_JAZZ is not set
+# CONFIG_LASAT is not set
+# CONFIG_MIPS_ATLAS is not set
+# CONFIG_MIPS_MALTA is not set
+# CONFIG_MIPS_SEAD is not set
+# CONFIG_MIPS_SIM is not set
+# CONFIG_MOMENCO_JAGUAR_ATX is not set
+# CONFIG_MOMENCO_OCELOT is not set
+# CONFIG_MOMENCO_OCELOT_3 is not set
+# CONFIG_MOMENCO_OCELOT_C is not set
+# CONFIG_MOMENCO_OCELOT_G is not set
+# CONFIG_MIPS_XXS1500 is not set
+# CONFIG_PNX8550_V2PCI is not set
+# CONFIG_PNX8550_JBS is not set
+# CONFIG_DDB5074 is not set
+# CONFIG_DDB5476 is not set
+# CONFIG_DDB5477 is not set
+# CONFIG_MACH_VR41XX is not set
+# CONFIG_PMC_YOSEMITE is not set
+# CONFIG_QEMU is not set
+CONFIG_SGI_IP22=y
+# CONFIG_SGI_IP27 is not set
+# CONFIG_SGI_IP32 is not set
+# CONFIG_SIBYTE_BIGSUR is not set
+# CONFIG_SIBYTE_SWARM is not set
+# CONFIG_SIBYTE_SENTOSA is not set
+# CONFIG_SIBYTE_RHONE is not set
+# CONFIG_SIBYTE_CARMEL is not set
+# CONFIG_SIBYTE_PTSWARM is not set
+# CONFIG_SIBYTE_LITTLESUR is not set
+# CONFIG_SIBYTE_CRHINE is not set
+# CONFIG_SIBYTE_CRHONE is not set
+# CONFIG_SNI_RM200_PCI is not set
+# CONFIG_TOSHIBA_JMR3927 is not set
+# CONFIG_TOSHIBA_RBTX4927 is not set
+# CONFIG_TOSHIBA_RBTX4938 is not set
+CONFIG_RWSEM_GENERIC_SPINLOCK=y
+CONFIG_GENERIC_CALIBRATE_DELAY=y
+CONFIG_ARC=y
+CONFIG_DMA_NONCOHERENT=y
+CONFIG_DMA_NEED_PCI_MAP_STATE=y
+CONFIG_CPU_BIG_ENDIAN=y
+# CONFIG_CPU_LITTLE_ENDIAN is not set
+CONFIG_SYS_SUPPORTS_BIG_ENDIAN=y
+CONFIG_IRQ_CPU=y
+CONFIG_SWAP_IO_SPACE=y
+CONFIG_ARC32=y
+CONFIG_BOOT_ELF32=y
+CONFIG_MIPS_L1_CACHE_SHIFT=5
+CONFIG_ARC_CONSOLE=y
+CONFIG_ARC_PROMLIB=y
+
+#
+# CPU selection
+#
+# CONFIG_CPU_MIPS32_R1 is not set
+# CONFIG_CPU_MIPS32_R2 is not set
+# CONFIG_CPU_MIPS64_R1 is not set
+# CONFIG_CPU_MIPS64_R2 is not set
+# CONFIG_CPU_R3000 is not set
+# CONFIG_CPU_TX39XX is not set
+# CONFIG_CPU_VR41XX is not set
+# CONFIG_CPU_R4300 is not set
+CONFIG_CPU_R4X00=y
+# CONFIG_CPU_TX49XX is not set
+# CONFIG_CPU_R5000 is not set
+# CONFIG_CPU_R5432 is not set
+# CONFIG_CPU_R6000 is not set
+# CONFIG_CPU_NEVADA is not set
+# CONFIG_CPU_R8000 is not set
+# CONFIG_CPU_R10000 is not set
+# CONFIG_CPU_RM7000 is not set
+# CONFIG_CPU_RM9000 is not set
+# CONFIG_CPU_SB1 is not set
+CONFIG_SYS_HAS_CPU_R4X00=y
+CONFIG_SYS_HAS_CPU_R5000=y
+CONFIG_SYS_SUPPORTS_32BIT_KERNEL=y
+CONFIG_SYS_SUPPORTS_64BIT_KERNEL=y
+CONFIG_CPU_SUPPORTS_32BIT_KERNEL=y
+CONFIG_CPU_SUPPORTS_64BIT_KERNEL=y
+
+#
+# Kernel type
+#
+# CONFIG_32BIT is not set
+CONFIG_64BIT=y
+CONFIG_PAGE_SIZE_4KB=y
+# CONFIG_PAGE_SIZE_8KB is not set
+# CONFIG_PAGE_SIZE_16KB is not set
+# CONFIG_PAGE_SIZE_64KB is not set
+CONFIG_BOARD_SCACHE=y
+CONFIG_IP22_CPU_SCACHE=y
+# CONFIG_MIPS_MT is not set
+CONFIG_CPU_HAS_LLSC=y
+CONFIG_CPU_HAS_SYNC=y
+CONFIG_GENERIC_HARDIRQS=y
+CONFIG_GENERIC_IRQ_PROBE=y
+CONFIG_ARCH_FLATMEM_ENABLE=y
+CONFIG_SELECT_MEMORY_MODEL=y
+CONFIG_FLATMEM_MANUAL=y
+# CONFIG_DISCONTIGMEM_MANUAL is not set
+# CONFIG_SPARSEMEM_MANUAL is not set
+CONFIG_FLATMEM=y
+CONFIG_FLAT_NODE_MEM_MAP=y
+# CONFIG_SPARSEMEM_STATIC is not set
+CONFIG_SPLIT_PTLOCK_CPUS=4
+CONFIG_PREEMPT_NONE=y
+# CONFIG_PREEMPT_VOLUNTARY is not set
+# CONFIG_PREEMPT is not set
+
+#
+# Code maturity level options
+#
+CONFIG_EXPERIMENTAL=y
+CONFIG_BROKEN_ON_SMP=y
+
+#
+# General setup
+#
+CONFIG_LOCALVERSION=""
+CONFIG_LOCALVERSION_AUTO=y
+CONFIG_SWAP=y
+CONFIG_SYSVIPC=y
+CONFIG_POSIX_MQUEUE=y
+CONFIG_BSD_PROCESS_ACCT=y
+# CONFIG_BSD_PROCESS_ACCT_V3 is not set
+CONFIG_AUDIT=y
+# CONFIG_IKCONFIG is not set
+CONFIG_INITRAMFS_SOURCE=""
+# CONFIG_CC_OPTIMIZE_FOR_SIZE is not set
+CONFIG_HOTPLUG=y
+CONFIG_BASE_FULL=y
+CONFIG_CC_ALIGN_FUNCTIONS=0
+CONFIG_CC_ALIGN_LABELS=0
+CONFIG_CC_ALIGN_LOOPS=0
+CONFIG_CC_ALIGN_JUMPS=0
+CONFIG_SLAB=y
+CONFIG_BASE_SMALL=0
+# CONFIG_SLOB is not set
+
+#
+# Loadable module support
+#
+CONFIG_MODULES=y
+CONFIG_OBSOLETE_MODPARM=y
+CONFIG_KMOD=y
+
+#
+# Block layer
+#
+
+#
+# Bus options (PCI, PCMCIA, EISA, ISA, TC)
+#
+CONFIG_HW_HAS_EISA=y
+CONFIG_ISA=y
+CONFIG_EISA=y
+CONFIG_EISA_NAMES=y
+CONFIG_MMU=y
+
+#
+# PCCARD (PCMCIA/CardBus) support
+#
+# CONFIG_PCCARD is not set
+
+#
+# PCI Hotplug Support
+#
+
+#
+# Executable file formats
+#
+CONFIG_BINFMT_ELF=y
+CONFIG_BINFMT_MISC=m
+CONFIG_BUILD_ELF64=y
+CONFIG_MIPS32_COMPAT=y
+CONFIG_COMPAT=y
+CONFIG_MIPS32_O32=y
+CONFIG_MIPS32_N32=y
+CONFIG_BINFMT_ELF32=y
+
+#
+# Networking
+#
+CONFIG_NET=y
+
+#
+# DCCP Configuration (EXPERIMENTAL)
+#
+# CONFIG_IP_DCCP is not set
+
+#
+# SCTP Configuration (EXPERIMENTAL)
+#
+CONFIG_IP_SCTP=m
+# CONFIG_SCTP_DBG_MSG is not set
+# CONFIG_SCTP_DBG_OBJCNT is not set
+# CONFIG_SCTP_HMAC_NONE is not set
+# CONFIG_SCTP_HMAC_SHA1 is not set
+CONFIG_SCTP_HMAC_MD5=y
+
+#
+# TIPC Configuration (EXPERIMENTAL)
+#
+CONFIG_TIPC=m
+CONFIG_TIPC_ADVANCED=y
+CONFIG_TIPC_ZONES=3
+CONFIG_TIPC_CLUSTERS=1
+CONFIG_TIPC_NODES=255
+CONFIG_TIPC_SLAVE_NODES=0
+CONFIG_TIPC_PORTS=8191
+CONFIG_TIPC_LOG=0
+# CONFIG_TIPC_DEBUG is not set
+# CONFIG_ATM is not set
+# CONFIG_BRIDGE is not set
+# CONFIG_VLAN_8021Q is not set
+# CONFIG_DECNET is not set
+# CONFIG_LLC2 is not set
+# CONFIG_IPX is not set
+# CONFIG_ATALK is not set
+# CONFIG_X25 is not set
+# CONFIG_LAPB is not set
+# CONFIG_NET_DIVERT is not set
+# CONFIG_ECONET is not set
+# CONFIG_WAN_ROUTER is not set
+
+#
+# Network testing
+#
+# CONFIG_HAMRADIO is not set
+# CONFIG_IRDA is not set
+# CONFIG_BT is not set
+# CONFIG_IEEE80211 is not set
+
+#
+# Device Drivers
+#
+
+#
+# Generic Driver Options
+#
+CONFIG_STANDALONE=y
+CONFIG_PREVENT_FIRMWARE_BUILD=y
+CONFIG_FW_LOADER=m
+
+#
+# Connector - unified userspace <-> kernelspace linker
+#
+# CONFIG_CONNECTOR is not set
+
+#
+# Memory Technology Devices (MTD)
+#
+# CONFIG_MTD is not set
+
+#
+# Parallel port support
+#
+
+#
+# Plug and Play support
+#
+# CONFIG_PNP is not set
+
+#
+# Block devices
+#
+CONFIG_BLK_DEV_RAM=y
+CONFIG_BLK_DEV_RAM_COUNT=16
+CONFIG_BLK_DEV_RAM_SIZE=8192
+CONFIG_BLK_DEV_INITRD=y
+# CONFIG_CDROM_PKTCDVD is not set
+# CONFIG_ATA_OVER_ETH is not set
+
+#
+# ATA/ATAPI/MFM/RLL support
+#
+# CONFIG_IDE is not set
+
+#
+# SCSI device support
+#
+CONFIG_RAID_ATTRS=m
+CONFIG_SCSI=y
+CONFIG_SCSI_PROC_FS=y
+
+#
+# SCSI support type (disk, tape, CD-ROM)
+#
+CONFIG_BLK_DEV_SD=y
+CONFIG_CHR_DEV_ST=m
+# CONFIG_CHR_DEV_OSST is not set
+CONFIG_BLK_DEV_SR=y
+CONFIG_BLK_DEV_SR_VENDOR=y
+CONFIG_CHR_DEV_SG=m
+CONFIG_CHR_DEV_SCH=m
+
+#
+# Some SCSI devices (e.g. CD jukebox) support multiple LUNs
+#
+CONFIG_SCSI_MULTI_LUN=y
+CONFIG_SCSI_CONSTANTS=y
+# CONFIG_SCSI_LOGGING is not set
+
+#
+# SCSI low-level drivers
+#
+CONFIG_SGIWD93_SCSI=y
+# CONFIG_SCSI_AHA1740 is not set
+# CONFIG_SCSI_AIC7XXX is not set
+# CONFIG_SCSI_AIC7XXX_OLD is not set
+# CONFIG_SCSI_IN2000 is not set
+# CONFIG_SCSI_DTC3280 is not set
+# CONFIG_SCSI_FUTURE_DOMAIN is not set
+# CONFIG_SCSI_GENERIC_NCR5380 is not set
+# CONFIG_SCSI_GENERIC_NCR5380_MMIO is not set
+# CONFIG_SCSI_NCR53C406A is not set
+# CONFIG_SCSI_PAS16 is not set
+# CONFIG_SCSI_PSI240I is not set
+# CONFIG_SCSI_QLOGIC_FAS is not set
+# CONFIG_SCSI_SIM710 is not set
+# CONFIG_SCSI_SYM53C416 is not set
+# CONFIG_SCSI_T128 is not set
+# CONFIG_SCSI_DEBUG is not set
+
+#
+# Serial ATA (prod) and Parallel ATA (experimental) drivers
+#
+# CONFIG_ATA is not set
+
+#
+# Fusion MPT device support
+#
+# CONFIG_FUSION is not set
+
+#
+# IEEE 1394 (FireWire) support
+#
+
+#
+# I2O device support
+#
+
+#
+# Network device support
+#
+CONFIG_NETDEVICES=y
+CONFIG_DUMMY=m
+CONFIG_BONDING=m
+CONFIG_EQUALIZER=m
+CONFIG_TUN=m
+
+#
+# ARCnet devices
+#
+# CONFIG_ARCNET is not set
+
+#
+# PHY device support
+#
+# CONFIG_PHYLIB is not set
+
+#
+# Ethernet (10 or 100Mbit)
+#
+CONFIG_NET_ETHERNET=y
+CONFIG_MII=y
+# CONFIG_NET_VENDOR_3COM is not set
+# CONFIG_NET_VENDOR_SMC is not set
+# CONFIG_DM9000 is not set
+# CONFIG_NET_VENDOR_RACAL is not set
+
+#
+# Tulip family network device support
+#
+# CONFIG_NET_TULIP is not set
+# CONFIG_AT1700 is not set
+# CONFIG_DEPCA is not set
+# CONFIG_HP100 is not set
+# CONFIG_NET_ISA is not set
+# CONFIG_NET_PCI is not set
+# CONFIG_NET_POCKET is not set
+CONFIG_SGISEEQ=y
+
+#
+# Ethernet (1000 Mbit)
+#
+
+#
+# Ethernet (10000 Mbit)
+#
+
+#
+# Token Ring devices
+#
+# CONFIG_TR is not set
+
+#
+# Wireless LAN (non-hamradio)
+#
+# CONFIG_NET_RADIO is not set
+
+#
+# ISDN subsystem
+#
+# CONFIG_ISDN is not set
+
+#
+# Telephony Support
+#
+# CONFIG_PHONE is not set
+
+#
+# Input device support
+#
+CONFIG_INPUT=y
+
+#
+# Userland interfaces
+#
+CONFIG_INPUT_MOUSEDEV=y
+CONFIG_INPUT_MOUSEDEV_PSAUX=y
+CONFIG_INPUT_MOUSEDEV_SCREEN_X=1024
+CONFIG_INPUT_MOUSEDEV_SCREEN_Y=768
+# CONFIG_INPUT_JOYDEV is not set
+# CONFIG_INPUT_TSDEV is not set
+CONFIG_INPUT_EVDEV=m
+
+#
+# Input Device Drivers
+#
+CONFIG_INPUT_KEYBOARD=y
+CONFIG_KEYBOARD_ATKBD=y
+# CONFIG_KEYBOARD_SUNKBD is not set
+# CONFIG_KEYBOARD_LKKBD is not set
+# CONFIG_KEYBOARD_XTKBD is not set
+# CONFIG_KEYBOARD_NEWTON is not set
+CONFIG_INPUT_MOUSE=y
+CONFIG_MOUSE_PS2=y
+# CONFIG_MOUSE_SERIAL is not set
+# CONFIG_MOUSE_INPORT is not set
+# CONFIG_MOUSE_LOGIBM is not set
+# CONFIG_MOUSE_PC110PAD is not set
+# CONFIG_MOUSE_VSXXXAA is not set
+# CONFIG_INPUT_JOYSTICK is not set
+# CONFIG_INPUT_TOUCHSCREEN is not set
+# CONFIG_INPUT_MISC is not set
+
+#
+# Hardware I/O ports
+#
+CONFIG_SERIO=y
+CONFIG_SERIO_SERPORT=y
+# CONFIG_SERIO_PARKBD is not set
+CONFIG_SERIO_LIBPS2=y
+CONFIG_SERIO_RAW=y
+# CONFIG_GAMEPORT is not set
+
+#
+# Character devices
+#
+CONFIG_VT=y
+CONFIG_VT_CONSOLE=y
+CONFIG_HW_CONSOLE=y
+# CONFIG_SERIAL_NONSTANDARD is not set
+
+#
+# Serial drivers
+#
+# CONFIG_SERIAL_8250 is not set
+
+#
+# Non-8250 serial port support
+#
+CONFIG_SERIAL_IP22_ZILOG=y
+CONFIG_SERIAL_IP22_ZILOG_CONSOLE=y
+CONFIG_SERIAL_CORE=y
+CONFIG_SERIAL_CORE_CONSOLE=y
+CONFIG_PRINTER=m
+# CONFIG_LP_CONSOLE is not set
+# CONFIG_PPDEV is not set
+# CONFIG_TIPAR is not set
+
+#
+# IPMI
+#
+# CONFIG_IPMI_HANDLER is not set
+
+#
+# Watchdog Cards
+#
+CONFIG_WATCHDOG=y
+# CONFIG_WATCHDOG_NOWAYOUT is not set
+
+#
+# Watchdog Device Drivers
+#
+# CONFIG_SOFT_WATCHDOG is not set
+CONFIG_INDYDOG=m
+
+#
+# ISA-based Watchdog Cards
+#
+# CONFIG_PCWATCHDOG is not set
+# CONFIG_MIXCOMWD is not set
+# CONFIG_WDT is not set
+CONFIG_RTC=m
+CONFIG_SGI_DS1286=y
+CONFIG_GEN_RTC=y
+CONFIG_GEN_RTC_X=y
+# CONFIG_DTLK is not set
+# CONFIG_R3964 is not set
+
+#
+# Ftape, the floppy tape device driver
+#
+# CONFIG_RAW_DRIVER is not set
+
+#
+# TPM devices
+#
+# CONFIG_TCG_TPM is not set
+# CONFIG_TELCLOCK is not set
+
+#
+# I2C support
+#
+CONFIG_I2C=m
+CONFIG_I2C_CHARDEV=m
+
+#
+# I2C Algorithms
+#
+# CONFIG_I2C_ALGOBIT is not set
+# CONFIG_I2C_ALGOPCF is not set
+# CONFIG_I2C_ALGOPCA is not set
+CONFIG_I2C_ALGO_SGI=m
+
+#
+# I2C Hardware Bus support
+#
+# CONFIG_I2C_ELEKTOR is not set
+# CONFIG_I2C_PARPORT is not set
+# CONFIG_I2C_PARPORT_LIGHT is not set
+# CONFIG_I2C_STUB is not set
+# CONFIG_I2C_PCA_ISA is not set
+
+#
+# Miscellaneous I2C Chip support
+#
+# CONFIG_SENSORS_DS1337 is not set
+# CONFIG_SENSORS_DS1374 is not set
+# CONFIG_SENSORS_EEPROM is not set
+# CONFIG_SENSORS_PCF8574 is not set
+# CONFIG_SENSORS_PCA9539 is not set
+# CONFIG_SENSORS_PCF8591 is not set
+# CONFIG_SENSORS_MAX6875 is not set
+# CONFIG_I2C_DEBUG_CORE is not set
+# CONFIG_I2C_DEBUG_ALGO is not set
+# CONFIG_I2C_DEBUG_BUS is not set
+# CONFIG_I2C_DEBUG_CHIP is not set
+
+#
+# SPI support
+#
+CONFIG_SPI=y
+CONFIG_SPI_MASTER=y
+
+#
+# SPI Master Controller Drivers
+#
+CONFIG_SPI_BITBANG=m
+CONFIG_SPI_BUTTERFLY=m
+
+#
+# SPI Protocol Masters
+#
+
+#
+# Dallas's 1-wire bus
+#
+# CONFIG_W1 is not set
+
+#
+# Hardware Monitoring support
+#
+CONFIG_HWMON=y
+# CONFIG_HWMON_VID is not set
+# CONFIG_SENSORS_ADM1021 is not set
+# CONFIG_SENSORS_ADM1025 is not set
+# CONFIG_SENSORS_ADM1026 is not set
+# CONFIG_SENSORS_ADM1031 is not set
+# CONFIG_SENSORS_ADM9240 is not set
+# CONFIG_SENSORS_ASB100 is not set
+# CONFIG_SENSORS_ATXP1 is not set
+# CONFIG_SENSORS_DS1621 is not set
+# CONFIG_SENSORS_F71805F is not set
+# CONFIG_SENSORS_FSCHER is not set
+# CONFIG_SENSORS_FSCPOS is not set
+# CONFIG_SENSORS_GL518SM is not set
+# CONFIG_SENSORS_GL520SM is not set
+# CONFIG_SENSORS_IT87 is not set
+# CONFIG_SENSORS_LM63 is not set
+# CONFIG_SENSORS_LM75 is not set
+# CONFIG_SENSORS_LM77 is not set
+# CONFIG_SENSORS_LM78 is not set
+# CONFIG_SENSORS_LM80 is not set
+# CONFIG_SENSORS_LM83 is not set
+# CONFIG_SENSORS_LM85 is not set
+# CONFIG_SENSORS_LM87 is not set
+# CONFIG_SENSORS_LM90 is not set
+# CONFIG_SENSORS_LM92 is not set
+# CONFIG_SENSORS_MAX1619 is not set
+# CONFIG_SENSORS_PC87360 is not set
+# CONFIG_SENSORS_SMSC47M1 is not set
+# CONFIG_SENSORS_SMSC47B397 is not set
+# CONFIG_SENSORS_W83781D is not set
+# CONFIG_SENSORS_W83792D is not set
+# CONFIG_SENSORS_W83L785TS is not set
+# CONFIG_SENSORS_W83627HF is not set
+# CONFIG_SENSORS_W83627EHF is not set
+# CONFIG_HWMON_DEBUG_CHIP is not set
+
+#
+# Misc devices
+#
+
+#
+# Multimedia Capabilities Port drivers
+#
+
+#
+# Multimedia devices
+#
+CONFIG_VIDEO_DEV=m
+
+#
+# Video For Linux
+#
+
+#
+# Video Adapters
+#
+# CONFIG_VIDEO_ADV_DEBUG is not set
+# CONFIG_VIDEO_PMS is not set
+# CONFIG_VIDEO_BWQCAM is not set
+# CONFIG_VIDEO_CQCAM is not set
+# CONFIG_VIDEO_W9966 is not set
+# CONFIG_VIDEO_CPIA is not set
+# CONFIG_VIDEO_SAA5246A is not set
+# CONFIG_VIDEO_SAA5249 is not set
+# CONFIG_TUNER_3036 is not set
+CONFIG_VIDEO_VINO=m
+# CONFIG_VIDEO_OVCAMCHIP is not set
+# CONFIG_VIDEO_AUDIO_DECODER is not set
+# CONFIG_VIDEO_DECODER is not set
+
+#
+# Radio Adapters
+#
+# CONFIG_RADIO_CADET is not set
+# CONFIG_RADIO_RTRACK is not set
+# CONFIG_RADIO_RTRACK2 is not set
+# CONFIG_RADIO_AZTECH is not set
+# CONFIG_RADIO_GEMTEK is not set
+# CONFIG_RADIO_MAESTRO is not set
+# CONFIG_RADIO_SF16FMI is not set
+# CONFIG_RADIO_SF16FMR2 is not set
+# CONFIG_RADIO_TERRATEC is not set
+# CONFIG_RADIO_TRUST is not set
+# CONFIG_RADIO_TYPHOON is not set
+# CONFIG_RADIO_ZOLTRIX is not set
+
+#
+# Digital Video Broadcasting Devices
+#
+# CONFIG_DVB is not set
+
+#
+# Graphics support
+#
+CONFIG_FB=y
+# CONFIG_FB_CFB_FILLRECT is not set
+# CONFIG_FB_CFB_COPYAREA is not set
+# CONFIG_FB_CFB_IMAGEBLIT is not set
+# CONFIG_FB_MACMODES is not set
+# CONFIG_FB_MODE_HELPERS is not set
+# CONFIG_FB_TILEBLITTING is not set
+# CONFIG_FB_S1D13XXX is not set
+# CONFIG_FB_VIRTUAL is not set
+
+#
+# Console display driver support
+#
+# CONFIG_VGA_CONSOLE is not set
+# CONFIG_MDA_CONSOLE is not set
+CONFIG_SGI_NEWPORT_CONSOLE=y
+CONFIG_DUMMY_CONSOLE=y
+CONFIG_FRAMEBUFFER_CONSOLE=y
+# CONFIG_FRAMEBUFFER_CONSOLE_ROTATION is not set
+# CONFIG_FONTS is not set
+CONFIG_FONT_8x8=y
+CONFIG_FONT_8x16=y
+
+#
+# Logo configuration
+#
+CONFIG_LOGO=y
+# CONFIG_LOGO_LINUX_MONO is not set
+# CONFIG_LOGO_LINUX_VGA16 is not set
+# CONFIG_LOGO_LINUX_CLUT224 is not set
+CONFIG_LOGO_SGI_CLUT224=y
+
+#
+# Sound
+#
+CONFIG_SOUND=m
+
+#
+# Advanced Linux Sound Architecture
+#
+CONFIG_SND=m
+CONFIG_SND_TIMER=m
+CONFIG_SND_PCM=m
+# CONFIG_SND_SEQUENCER is not set
+CONFIG_SND_OSSEMUL=y
+CONFIG_SND_MIXER_OSS=m
+CONFIG_SND_PCM_OSS=m
+CONFIG_SND_RTCTIMER=m
+# CONFIG_SND_DYNAMIC_MINORS is not set
+CONFIG_SND_SUPPORT_OLD_API=y
+# CONFIG_SND_VERBOSE_PRINTK is not set
+# CONFIG_SND_DEBUG is not set
+
+#
+# Generic devices
+#
+# CONFIG_SND_DUMMY is not set
+# CONFIG_SND_MTPAV is not set
+# CONFIG_SND_SERIAL_U16550 is not set
+# CONFIG_SND_MPU401 is not set
+
+#
+# ALSA MIPS devices
+#
+
+#
+# Open Sound System
+#
+CONFIG_SOUND_PRIME=m
+# CONFIG_OBSOLETE_OSS_DRIVER is not set
+CONFIG_SOUND_HAL2=m
+# CONFIG_SOUND_MSNDCLAS is not set
+# CONFIG_SOUND_MSNDPIN is not set
+
+#
+# USB support
+#
+# CONFIG_USB_ARCH_HAS_HCD is not set
+# CONFIG_USB_ARCH_HAS_OHCI is not set
+
+#
+# NOTE: USB_STORAGE enables SCSI, and 'SCSI disk support'
+#
+
+#
+# USB Gadget Support
+#
+# CONFIG_USB_GADGET is not set
+
+#
+# MMC/SD Card support
+#
+# CONFIG_MMC is not set
+
+#
+# InfiniBand support
+#
+
+#
+# SN Devices
+#
+
+#
+# EDAC - error detection and reporting (RAS)
+#
+
+#
+# File systems
+#
+CONFIG_EXT2_FS=y
+CONFIG_EXT2_FS_XATTR=y
+CONFIG_EXT2_FS_POSIX_ACL=y
+CONFIG_EXT2_FS_SECURITY=y
+# CONFIG_EXT2_FS_XIP is not set
+CONFIG_EXT3_FS=y
+CONFIG_EXT3_FS_XATTR=y
+CONFIG_EXT3_FS_POSIX_ACL=y
+CONFIG_EXT3_FS_SECURITY=y
+CONFIG_JBD=y
+# CONFIG_JBD_DEBUG is not set
+CONFIG_FS_MBCACHE=y
+
+CONFIG_CRAMFS=y
+
+#
+# CD-ROM/DVD Filesystems
+#
+CONFIG_ISO9660_FS=y
+CONFIG_JOLIET=y
+CONFIG_ZISOFS=y
+CONFIG_UDF_FS=y
+CONFIG_UDF_NLS=y
+
+#
+# Partition Types
+#
+CONFIG_PARTITION_ADVANCED=y
+CONFIG_MSDOS_PARTITION=y
+CONFIG_SGI_PARTITION=y
+CONFIG_KARMA_PARTITION=y
+
+# Profiling support
+#
+CONFIG_PROFILING=y
+# CONFIG_OPROFILE is not set
+
+#
+# Kernel hacking
+#
+# CONFIG_PRINTK_TIME is not set
+CONFIG_MAGIC_SYSRQ=y
+# CONFIG_DEBUG_KERNEL is not set
+CONFIG_LOG_BUF_SHIFT=14
+# CONFIG_CROSSCOMPILE is not set
+CONFIG_CMDLINE=""
+
+#
+# Hardware crypto devices
+#
+
+#
+# Library routines
+#
+CONFIG_CRC_CCITT=m
+# CONFIG_CRC16 is not set
+CONFIG_CRC32=y
+CONFIG_LIBCRC32C=m
+CONFIG_ZLIB_INFLATE=y
+CONFIG_ZLIB_DEFLATE=m
+CONFIG_TEXTSEARCH=y
+CONFIG_TEXTSEARCH_KMP=m
+CONFIG_TEXTSEARCH_BM=m
+CONFIG_TEXTSEARCH_FSM=m
+CONFIG_VIDEO_BUF=m
+CONFIG_SERIO_I8042=y
+# CONFIG_USB_ARCH_HAS_EHCI is not set

Added: dists/sid/linux-2.6/debian/config/mips/config.r5k-ip32
==============================================================================
--- (empty file)
+++ dists/sid/linux-2.6/debian/config/mips/config.r5k-ip32	Mon Nov 26 20:06:56 2007
@@ -0,0 +1,1204 @@
+#
+# Machine selection
+#
+# CONFIG_MIPS_MTX1 is not set
+# CONFIG_MIPS_BOSPORUS is not set
+# CONFIG_MIPS_PB1000 is not set
+# CONFIG_MIPS_PB1100 is not set
+# CONFIG_MIPS_PB1500 is not set
+# CONFIG_MIPS_PB1550 is not set
+# CONFIG_MIPS_PB1200 is not set
+# CONFIG_MIPS_DB1000 is not set
+# CONFIG_MIPS_DB1100 is not set
+# CONFIG_MIPS_DB1500 is not set
+# CONFIG_MIPS_DB1550 is not set
+# CONFIG_MIPS_DB1200 is not set
+# CONFIG_MIPS_MIRAGE is not set
+# CONFIG_MIPS_COBALT is not set
+# CONFIG_MACH_DECSTATION is not set
+# CONFIG_MIPS_EV64120 is not set
+# CONFIG_MIPS_EV96100 is not set
+# CONFIG_MIPS_IVR is not set
+# CONFIG_MIPS_ITE8172 is not set
+# CONFIG_MACH_JAZZ is not set
+# CONFIG_LASAT is not set
+# CONFIG_MIPS_ATLAS is not set
+# CONFIG_MIPS_MALTA is not set
+# CONFIG_MIPS_SEAD is not set
+# CONFIG_MIPS_SIM is not set
+# CONFIG_MOMENCO_JAGUAR_ATX is not set
+# CONFIG_MOMENCO_OCELOT is not set
+# CONFIG_MOMENCO_OCELOT_3 is not set
+# CONFIG_MOMENCO_OCELOT_C is not set
+# CONFIG_MOMENCO_OCELOT_G is not set
+# CONFIG_MIPS_XXS1500 is not set
+# CONFIG_PNX8550_V2PCI is not set
+# CONFIG_PNX8550_JBS is not set
+# CONFIG_DDB5074 is not set
+# CONFIG_DDB5476 is not set
+# CONFIG_DDB5477 is not set
+# CONFIG_MACH_VR41XX is not set
+# CONFIG_PMC_YOSEMITE is not set
+# CONFIG_QEMU is not set
+# CONFIG_SGI_IP22 is not set
+# CONFIG_SGI_IP27 is not set
+CONFIG_SGI_IP32=y
+# CONFIG_SIBYTE_BIGSUR is not set
+# CONFIG_SIBYTE_SWARM is not set
+# CONFIG_SIBYTE_SENTOSA is not set
+# CONFIG_SIBYTE_RHONE is not set
+# CONFIG_SIBYTE_CARMEL is not set
+# CONFIG_SIBYTE_PTSWARM is not set
+# CONFIG_SIBYTE_LITTLESUR is not set
+# CONFIG_SIBYTE_CRHINE is not set
+# CONFIG_SIBYTE_CRHONE is not set
+# CONFIG_SNI_RM200_PCI is not set
+# CONFIG_TOSHIBA_JMR3927 is not set
+# CONFIG_TOSHIBA_RBTX4927 is not set
+# CONFIG_TOSHIBA_RBTX4938 is not set
+CONFIG_RWSEM_GENERIC_SPINLOCK=y
+CONFIG_GENERIC_CALIBRATE_DELAY=y
+CONFIG_ARC=y
+CONFIG_DMA_IP32=y
+CONFIG_DMA_NONCOHERENT=y
+CONFIG_DMA_NEED_PCI_MAP_STATE=y
+CONFIG_OWN_DMA=y
+CONFIG_CPU_BIG_ENDIAN=y
+# CONFIG_CPU_LITTLE_ENDIAN is not set
+CONFIG_SYS_SUPPORTS_BIG_ENDIAN=y
+CONFIG_ARC32=y
+CONFIG_BOOT_ELF32=y
+CONFIG_MIPS_L1_CACHE_SHIFT=5
+CONFIG_ARC_MEMORY=y
+CONFIG_ARC_PROMLIB=y
+
+#
+# CPU selection
+#
+# CONFIG_CPU_MIPS32_R1 is not set
+# CONFIG_CPU_MIPS32_R2 is not set
+# CONFIG_CPU_MIPS64_R1 is not set
+# CONFIG_CPU_MIPS64_R2 is not set
+# CONFIG_CPU_R3000 is not set
+# CONFIG_CPU_TX39XX is not set
+# CONFIG_CPU_VR41XX is not set
+# CONFIG_CPU_R4300 is not set
+# CONFIG_CPU_R4X00 is not set
+# CONFIG_CPU_TX49XX is not set
+CONFIG_CPU_R5000=y
+# CONFIG_CPU_R5432 is not set
+# CONFIG_CPU_R6000 is not set
+# CONFIG_CPU_NEVADA is not set
+# CONFIG_CPU_R8000 is not set
+# CONFIG_CPU_R10000 is not set
+# CONFIG_CPU_RM7000 is not set
+# CONFIG_CPU_RM9000 is not set
+# CONFIG_CPU_SB1 is not set
+CONFIG_SYS_HAS_CPU_R5000=y
+CONFIG_SYS_HAS_CPU_NEVADA=y
+CONFIG_SYS_HAS_CPU_RM7000=y
+CONFIG_SYS_SUPPORTS_64BIT_KERNEL=y
+CONFIG_CPU_SUPPORTS_32BIT_KERNEL=y
+CONFIG_CPU_SUPPORTS_64BIT_KERNEL=y
+
+#
+# Kernel type
+#
+# CONFIG_32BIT is not set
+CONFIG_64BIT=y
+CONFIG_PAGE_SIZE_4KB=y
+# CONFIG_PAGE_SIZE_8KB is not set
+# CONFIG_PAGE_SIZE_16KB is not set
+# CONFIG_PAGE_SIZE_64KB is not set
+CONFIG_BOARD_SCACHE=y
+CONFIG_R5000_CPU_SCACHE=y
+CONFIG_RM7000_CPU_SCACHE=y
+# CONFIG_MIPS_MT is not set
+CONFIG_CPU_HAS_LLSC=y
+CONFIG_CPU_HAS_SYNC=y
+CONFIG_GENERIC_HARDIRQS=y
+CONFIG_GENERIC_IRQ_PROBE=y
+CONFIG_ARCH_FLATMEM_ENABLE=y
+CONFIG_SELECT_MEMORY_MODEL=y
+CONFIG_FLATMEM_MANUAL=y
+# CONFIG_DISCONTIGMEM_MANUAL is not set
+# CONFIG_SPARSEMEM_MANUAL is not set
+CONFIG_FLATMEM=y
+CONFIG_FLAT_NODE_MEM_MAP=y
+# CONFIG_SPARSEMEM_STATIC is not set
+CONFIG_SPLIT_PTLOCK_CPUS=4
+CONFIG_PREEMPT_NONE=y
+# CONFIG_PREEMPT_VOLUNTARY is not set
+# CONFIG_PREEMPT is not set
+
+#
+# Code maturity level options
+#
+CONFIG_EXPERIMENTAL=y
+CONFIG_BROKEN_ON_SMP=y
+
+#
+# General setup
+#
+CONFIG_LOCALVERSION=""
+CONFIG_LOCALVERSION_AUTO=y
+CONFIG_SWAP=y
+CONFIG_SYSVIPC=y
+CONFIG_POSIX_MQUEUE=y
+CONFIG_BSD_PROCESS_ACCT=y
+# CONFIG_BSD_PROCESS_ACCT_V3 is not set
+CONFIG_AUDIT=y
+# CONFIG_IKCONFIG is not set
+CONFIG_INITRAMFS_SOURCE=""
+# CONFIG_CC_OPTIMIZE_FOR_SIZE is not set
+CONFIG_HOTPLUG=y
+CONFIG_BASE_FULL=y
+CONFIG_CC_ALIGN_FUNCTIONS=0
+CONFIG_CC_ALIGN_LABELS=0
+CONFIG_CC_ALIGN_LOOPS=0
+CONFIG_CC_ALIGN_JUMPS=0
+CONFIG_SLAB=y
+CONFIG_BASE_SMALL=0
+# CONFIG_SLOB is not set
+
+#
+# Loadable module support
+#
+CONFIG_MODULES=y
+CONFIG_OBSOLETE_MODPARM=y
+CONFIG_KMOD=y
+
+#
+# Block layer
+#
+
+#
+# Bus options (PCI, PCMCIA, EISA, ISA, TC)
+#
+CONFIG_HW_HAS_PCI=y
+CONFIG_PCI=y
+CONFIG_MMU=y
+
+#
+# PCCARD (PCMCIA/CardBus) support
+#
+# CONFIG_PCCARD is not set
+
+#
+# PCI Hotplug Support
+#
+# CONFIG_HOTPLUG_PCI is not set
+
+#
+# Executable file formats
+#
+CONFIG_BINFMT_ELF=y
+CONFIG_BINFMT_MISC=m
+CONFIG_BUILD_ELF64=y
+CONFIG_MIPS32_COMPAT=y
+CONFIG_COMPAT=y
+CONFIG_MIPS32_O32=y
+CONFIG_MIPS32_N32=y
+CONFIG_BINFMT_ELF32=y
+
+#
+# Networking
+#
+CONFIG_NET=y
+
+#
+# Networking options
+#
+CONFIG_PACKET=y
+CONFIG_PACKET_MMAP=y
+CONFIG_UNIX=y
+CONFIG_XFRM=y
+CONFIG_XFRM_USER=y
+CONFIG_NET_KEY=y
+CONFIG_INET=y
+CONFIG_IP_MULTICAST=y
+# CONFIG_IP_ADVANCED_ROUTER is not set
+CONFIG_IP_FIB_HASH=y
+CONFIG_IP_PNP=y
+CONFIG_IP_PNP_DHCP=y
+CONFIG_IP_PNP_BOOTP=y
+# CONFIG_IP_PNP_RARP is not set
+CONFIG_NET_IPIP=m
+CONFIG_NET_IPGRE=m
+# CONFIG_NET_IPGRE_BROADCAST is not set
+# CONFIG_IP_MROUTE is not set
+# CONFIG_ARPD is not set
+# CONFIG_SYN_COOKIES is not set
+CONFIG_INET_AH=m
+CONFIG_INET_ESP=m
+CONFIG_INET_IPCOMP=m
+CONFIG_INET_TUNNEL=m
+CONFIG_INET_DIAG=y
+CONFIG_INET_TCP_DIAG=y
+CONFIG_TCP_CONG_ADVANCED=y
+
+#
+# TCP congestion control
+#
+CONFIG_TCP_CONG_BIC=y
+CONFIG_TCP_CONG_CUBIC=m
+CONFIG_TCP_CONG_WESTWOOD=m
+CONFIG_TCP_CONG_HTCP=m
+CONFIG_TCP_CONG_HSTCP=m
+CONFIG_TCP_CONG_HYBLA=m
+CONFIG_TCP_CONG_VEGAS=m
+CONFIG_TCP_CONG_SCALABLE=m
+
+#
+# IP: Virtual Server Configuration
+#
+# CONFIG_IP_VS is not set
+CONFIG_IPV6=m
+CONFIG_IPV6_PRIVACY=y
+CONFIG_INET6_AH=m
+CONFIG_INET6_ESP=m
+CONFIG_INET6_IPCOMP=m
+CONFIG_INET6_TUNNEL=m
+CONFIG_IPV6_TUNNEL=m
+CONFIG_NETFILTER=y
+# CONFIG_NETFILTER_DEBUG is not set
+
+# Connector - unified userspace <-> kernelspace linker
+#
+# CONFIG_CONNECTOR is not set
+
+#
+# Memory Technology Devices (MTD)
+#
+# CONFIG_MTD is not set
+
+#
+# Parallel port support
+#
+CONFIG_PARPORT_IP32=m
+
+#
+# Plug and Play support
+#
+
+#
+# Block devices
+#
+CONFIG_BLK_DEV_RAM=y
+CONFIG_BLK_DEV_RAM_COUNT=16
+CONFIG_BLK_DEV_RAM_SIZE=8192
+CONFIG_BLK_DEV_INITRD=y
+# CONFIG_CDROM_PKTCDVD is not set
+# CONFIG_ATA_OVER_ETH is not set
+
+#
+# ATA/ATAPI/MFM/RLL support
+#
+# CONFIG_IDE is not set
+
+#
+# SCSI device support
+#
+CONFIG_RAID_ATTRS=m
+CONFIG_SCSI=y
+CONFIG_SCSI_PROC_FS=y
+
+#
+# SCSI support type (disk, tape, CD-ROM)
+#
+CONFIG_BLK_DEV_SD=y
+CONFIG_CHR_DEV_ST=m
+# CONFIG_CHR_DEV_OSST is not set
+CONFIG_BLK_DEV_SR=y
+CONFIG_BLK_DEV_SR_VENDOR=y
+CONFIG_CHR_DEV_SG=m
+CONFIG_CHR_DEV_SCH=m
+
+#
+# Some SCSI devices (e.g. CD jukebox) support multiple LUNs
+#
+CONFIG_SCSI_MULTI_LUN=y
+CONFIG_SCSI_CONSTANTS=y
+# CONFIG_SCSI_LOGGING is not set
+
+#
+# SCSI low-level drivers
+#
+# CONFIG_BLK_DEV_3W_XXXX_RAID is not set
+# CONFIG_SCSI_3W_9XXX is not set
+# CONFIG_SCSI_ACARD is not set
+# CONFIG_SCSI_AACRAID is not set
+CONFIG_SCSI_AIC7XXX=y
+CONFIG_AIC7XXX_CMDS_PER_DEVICE=32
+CONFIG_AIC7XXX_RESET_DELAY_MS=15000
+CONFIG_AIC7XXX_DEBUG_ENABLE=y
+CONFIG_AIC7XXX_DEBUG_MASK=0
+CONFIG_AIC7XXX_REG_PRETTY_PRINT=y
+# CONFIG_SCSI_AIC7XXX_OLD is not set
+# CONFIG_SCSI_AIC79XX is not set
+# CONFIG_MEGARAID_NEWGEN is not set
+# CONFIG_MEGARAID_LEGACY is not set
+# CONFIG_MEGARAID_SAS is not set
+# CONFIG_SCSI_DMX3191D is not set
+# CONFIG_SCSI_FUTURE_DOMAIN is not set
+# CONFIG_SCSI_IPS is not set
+# CONFIG_SCSI_INITIO is not set
+# CONFIG_SCSI_INIA100 is not set
+# CONFIG_SCSI_SYM53C8XX_2 is not set
+# CONFIG_SCSI_IPR is not set
+# CONFIG_SCSI_QLOGIC_FC is not set
+# CONFIG_SCSI_QLOGIC_1280 is not set
+# CONFIG_SCSI_QLA_FC is not set
+# CONFIG_SCSI_LPFC is not set
+# CONFIG_SCSI_DC395x is not set
+# CONFIG_SCSI_DC390T is not set
+# CONFIG_SCSI_DEBUG is not set
+
+#
+# Serial ATA (prod) and Parallel ATA (experimental) drivers
+#
+# CONFIG_ATA is not set
+
+#
+# Fusion MPT device support
+#
+# CONFIG_FUSION is not set
+# CONFIG_FUSION_SPI is not set
+# CONFIG_FUSION_FC is not set
+# CONFIG_FUSION_SAS is not set
+
+#
+# IEEE 1394 (FireWire) support
+#
+# CONFIG_FIREWIRE is not set
+
+#
+# I2O device support
+#
+# CONFIG_I2O is not set
+
+#
+# Network device support
+#
+CONFIG_NETDEVICES=y
+CONFIG_DUMMY=m
+CONFIG_BONDING=m
+CONFIG_EQUALIZER=m
+CONFIG_TUN=m
+
+#
+# ARCnet devices
+#
+# CONFIG_ARCNET is not set
+
+#
+# PHY device support
+#
+# CONFIG_PHYLIB is not set
+
+#
+# Ethernet (10 or 100Mbit)
+#
+CONFIG_NET_ETHERNET=y
+CONFIG_MII=y
+CONFIG_SGI_O2MACE_ETH=y
+# CONFIG_HAPPYMEAL is not set
+# CONFIG_SUNGEM is not set
+# CONFIG_CASSINI is not set
+# CONFIG_NET_VENDOR_3COM is not set
+# CONFIG_DM9000 is not set
+CONFIG_NET_TULIP=y
+CONFIG_DE2104X=m
+CONFIG_TULIP=m
+CONFIG_DE4X5=m
+CONFIG_WINBOND_840=m
+CONFIG_DM9102=m
+CONFIG_ULI526X=m
+CONFIG_NET_PCI=y
+CONFIG_E100=m
+
+#
+# Ethernet (1000 Mbit)
+#
+# CONFIG_DL2K is not set
+# CONFIG_E1000 is not set
+# CONFIG_NS83820 is not set
+# CONFIG_HAMACHI is not set
+# CONFIG_YELLOWFIN is not set
+# CONFIG_R8169 is not set
+# CONFIG_SIS190 is not set
+# CONFIG_SKGE is not set
+# CONFIG_SKY2 is not set
+# CONFIG_TIGON3 is not set
+# CONFIG_BNX2 is not set
+
+#
+# Ethernet (10000 Mbit)
+#
+# CONFIG_CHELSIO_T1 is not set
+# CONFIG_IXGB is not set
+# CONFIG_S2IO is not set
+
+#
+# Token Ring devices
+#
+# CONFIG_TR is not set
+
+#
+# Wireless LAN (non-hamradio)
+#
+# CONFIG_NET_RADIO is not set
+
+#
+# ISDN subsystem
+#
+# CONFIG_ISDN is not set
+
+#
+# Telephony Support
+#
+# CONFIG_PHONE is not set
+
+#
+# Input device support
+#
+CONFIG_INPUT=y
+
+#
+# Userland interfaces
+#
+CONFIG_INPUT_MOUSEDEV=y
+CONFIG_INPUT_MOUSEDEV_PSAUX=y
+CONFIG_INPUT_MOUSEDEV_SCREEN_X=1024
+CONFIG_INPUT_MOUSEDEV_SCREEN_Y=768
+# CONFIG_INPUT_JOYDEV is not set
+# CONFIG_INPUT_TSDEV is not set
+CONFIG_INPUT_EVDEV=m
+
+#
+# Input Device Drivers
+#
+CONFIG_INPUT_KEYBOARD=y
+CONFIG_KEYBOARD_ATKBD=y
+# CONFIG_KEYBOARD_SUNKBD is not set
+# CONFIG_KEYBOARD_LKKBD is not set
+# CONFIG_KEYBOARD_XTKBD is not set
+# CONFIG_KEYBOARD_NEWTON is not set
+CONFIG_INPUT_MOUSE=y
+CONFIG_MOUSE_PS2=y
+# CONFIG_MOUSE_SERIAL is not set
+# CONFIG_MOUSE_VSXXXAA is not set
+# CONFIG_INPUT_JOYSTICK is not set
+# CONFIG_INPUT_TOUCHSCREEN is not set
+# CONFIG_INPUT_MISC is not set
+
+#
+# Hardware I/O ports
+#
+CONFIG_SERIO=y
+# CONFIG_SERIO_I8042 is not set
+CONFIG_SERIO_SERPORT=y
+# CONFIG_SERIO_PARKBD is not set
+# CONFIG_SERIO_PCIPS2 is not set
+CONFIG_SERIO_MACEPS2=y
+CONFIG_SERIO_LIBPS2=y
+CONFIG_SERIO_RAW=y
+# CONFIG_GAMEPORT is not set
+
+#
+# Character devices
+#
+CONFIG_VT=y
+CONFIG_VT_CONSOLE=y
+CONFIG_HW_CONSOLE=y
+# CONFIG_SERIAL_NONSTANDARD is not set
+
+#
+# Serial drivers
+#
+CONFIG_SERIAL_8250=y
+CONFIG_SERIAL_8250_CONSOLE=y
+CONFIG_SERIAL_8250_NR_UARTS=4
+CONFIG_SERIAL_8250_RUNTIME_UARTS=4
+# CONFIG_SERIAL_8250_EXTENDED is not set
+
+#
+# Non-8250 serial port support
+#
+CONFIG_SERIAL_CORE=y
+CONFIG_SERIAL_CORE_CONSOLE=y
+# CONFIG_SERIAL_JSM is not set
+CONFIG_PRINTER=m
+# CONFIG_LP_CONSOLE is not set
+# CONFIG_PPDEV is not set
+# CONFIG_TIPAR is not set
+
+#
+# IPMI
+#
+# CONFIG_IPMI_HANDLER is not set
+
+#
+# Watchdog Cards
+#
+CONFIG_WATCHDOG=y
+# CONFIG_WATCHDOG_NOWAYOUT is not set
+
+#
+# Watchdog Device Drivers
+#
+# CONFIG_SOFT_WATCHDOG is not set
+
+#
+# PCI-based Watchdog Cards
+#
+# CONFIG_PCIPCWATCHDOG is not set
+# CONFIG_WDTPCI is not set
+CONFIG_RTC=m
+CONFIG_GEN_RTC=y
+CONFIG_GEN_RTC_X=y
+# CONFIG_DTLK is not set
+# CONFIG_R3964 is not set
+# CONFIG_APPLICOM is not set
+
+#
+# Ftape, the floppy tape device driver
+#
+# CONFIG_DRM is not set
+# CONFIG_RAW_DRIVER is not set
+
+#
+# TPM devices
+#
+# CONFIG_TCG_TPM is not set
+# CONFIG_TELCLOCK is not set
+
+#
+# I2C support
+#
+CONFIG_I2C=m
+CONFIG_I2C_CHARDEV=m
+
+#
+# I2C Algorithms
+#
+# CONFIG_I2C_ALGOBIT is not set
+# CONFIG_I2C_ALGOPCF is not set
+# CONFIG_I2C_ALGOPCA is not set
+CONFIG_I2C_ALGO_SGI=m
+
+#
+# I2C Hardware Bus support
+#
+# CONFIG_I2C_ALI1535 is not set
+# CONFIG_I2C_ALI1563 is not set
+# CONFIG_I2C_ALI15X3 is not set
+# CONFIG_I2C_AMD756 is not set
+# CONFIG_I2C_AMD8111 is not set
+# CONFIG_I2C_I801 is not set
+# CONFIG_I2C_I810 is not set
+# CONFIG_I2C_PIIX4 is not set
+# CONFIG_I2C_NFORCE2 is not set
+# CONFIG_I2C_PARPORT is not set
+# CONFIG_I2C_PARPORT_LIGHT is not set
+# CONFIG_I2C_PROSAVAGE is not set
+# CONFIG_I2C_SAVAGE4 is not set
+# CONFIG_SCx200_ACB is not set
+# CONFIG_I2C_SIS5595 is not set
+# CONFIG_I2C_SIS630 is not set
+# CONFIG_I2C_SIS96X is not set
+# CONFIG_I2C_STUB is not set
+# CONFIG_I2C_VIA is not set
+# CONFIG_I2C_VIAPRO is not set
+# CONFIG_I2C_VOODOO3 is not set
+# CONFIG_I2C_PCA_ISA is not set
+
+#
+# Miscellaneous I2C Chip support
+#
+# CONFIG_SENSORS_DS1337 is not set
+# CONFIG_SENSORS_DS1374 is not set
+# CONFIG_SENSORS_EEPROM is not set
+# CONFIG_SENSORS_PCF8574 is not set
+# CONFIG_SENSORS_PCA9539 is not set
+# CONFIG_SENSORS_PCF8591 is not set
+# CONFIG_SENSORS_MAX6875 is not set
+# CONFIG_I2C_DEBUG_CORE is not set
+# CONFIG_I2C_DEBUG_ALGO is not set
+# CONFIG_I2C_DEBUG_BUS is not set
+# CONFIG_I2C_DEBUG_CHIP is not set
+
+#
+# SPI support
+#
+CONFIG_SPI=y
+CONFIG_SPI_MASTER=y
+
+#
+# SPI Master Controller Drivers
+#
+CONFIG_SPI_BITBANG=m
+CONFIG_SPI_BUTTERFLY=m
+
+#
+# SPI Protocol Masters
+#
+
+#
+# Dallas's 1-wire bus
+#
+# CONFIG_W1 is not set
+
+#
+# Hardware Monitoring support
+#
+CONFIG_HWMON=y
+# CONFIG_HWMON_VID is not set
+# CONFIG_SENSORS_ADM1021 is not set
+# CONFIG_SENSORS_ADM1025 is not set
+# CONFIG_SENSORS_ADM1026 is not set
+# CONFIG_SENSORS_ADM1031 is not set
+# CONFIG_SENSORS_ADM9240 is not set
+# CONFIG_SENSORS_ASB100 is not set
+# CONFIG_SENSORS_ATXP1 is not set
+# CONFIG_SENSORS_DS1621 is not set
+# CONFIG_SENSORS_F71805F is not set
+# CONFIG_SENSORS_FSCHER is not set
+# CONFIG_SENSORS_FSCPOS is not set
+# CONFIG_SENSORS_GL518SM is not set
+# CONFIG_SENSORS_GL520SM is not set
+# CONFIG_SENSORS_IT87 is not set
+# CONFIG_SENSORS_LM63 is not set
+# CONFIG_SENSORS_LM75 is not set
+# CONFIG_SENSORS_LM77 is not set
+# CONFIG_SENSORS_LM78 is not set
+# CONFIG_SENSORS_LM80 is not set
+# CONFIG_SENSORS_LM83 is not set
+# CONFIG_SENSORS_LM85 is not set
+# CONFIG_SENSORS_LM87 is not set
+# CONFIG_SENSORS_LM90 is not set
+# CONFIG_SENSORS_LM92 is not set
+# CONFIG_SENSORS_MAX1619 is not set
+# CONFIG_SENSORS_PC87360 is not set
+# CONFIG_SENSORS_SIS5595 is not set
+# CONFIG_SENSORS_SMSC47M1 is not set
+# CONFIG_SENSORS_SMSC47B397 is not set
+# CONFIG_SENSORS_VIA686A is not set
+# CONFIG_SENSORS_VT8231 is not set
+# CONFIG_SENSORS_W83781D is not set
+# CONFIG_SENSORS_W83792D is not set
+# CONFIG_SENSORS_W83L785TS is not set
+# CONFIG_SENSORS_W83627HF is not set
+# CONFIG_SENSORS_W83627EHF is not set
+# CONFIG_HWMON_DEBUG_CHIP is not set
+
+#
+# Misc devices
+#
+
+#
+# Multimedia Capabilities Port drivers
+#
+
+#
+# Multimedia devices
+#
+CONFIG_VIDEO_DEV=m
+
+#
+# Video For Linux
+#
+
+#
+# Video Adapters
+#
+# CONFIG_VIDEO_ADV_DEBUG is not set
+# CONFIG_VIDEO_BT848 is not set
+# CONFIG_VIDEO_BWQCAM is not set
+# CONFIG_VIDEO_CQCAM is not set
+# CONFIG_VIDEO_W9966 is not set
+# CONFIG_VIDEO_CPIA is not set
+# CONFIG_VIDEO_SAA5246A is not set
+# CONFIG_VIDEO_SAA5249 is not set
+# CONFIG_TUNER_3036 is not set
+# CONFIG_VIDEO_STRADIS is not set
+# CONFIG_VIDEO_SAA7134 is not set
+# CONFIG_VIDEO_MXB is not set
+# CONFIG_VIDEO_DPC is not set
+# CONFIG_VIDEO_HEXIUM_ORION is not set
+# CONFIG_VIDEO_HEXIUM_GEMINI is not set
+# CONFIG_VIDEO_CX88 is not set
+# CONFIG_VIDEO_OVCAMCHIP is not set
+# CONFIG_VIDEO_AUDIO_DECODER is not set
+# CONFIG_VIDEO_DECODER is not set
+
+#
+# Radio Adapters
+#
+# CONFIG_RADIO_GEMTEK_PCI is not set
+# CONFIG_RADIO_MAXIRADIO is not set
+# CONFIG_RADIO_MAESTRO is not set
+
+#
+# Digital Video Broadcasting Devices
+#
+# CONFIG_DVB is not set
+
+#
+# Graphics support
+#
+CONFIG_FB=y
+CONFIG_FB_CFB_FILLRECT=y
+CONFIG_FB_CFB_COPYAREA=y
+CONFIG_FB_CFB_IMAGEBLIT=y
+# CONFIG_FB_MACMODES is not set
+# CONFIG_FB_MODE_HELPERS is not set
+# CONFIG_FB_TILEBLITTING is not set
+# CONFIG_FB_CIRRUS is not set
+# CONFIG_FB_PM2 is not set
+# CONFIG_FB_CYBER2000 is not set
+# CONFIG_FB_ASILIANT is not set
+# CONFIG_FB_IMSTT is not set
+CONFIG_FB_GBE=y
+CONFIG_FB_GBE_MEM=4
+# CONFIG_FB_S1D13XXX is not set
+# CONFIG_FB_NVIDIA is not set
+# CONFIG_FB_RIVA is not set
+# CONFIG_FB_MATROX is not set
+# CONFIG_FB_RADEON is not set
+# CONFIG_FB_ATY128 is not set
+# CONFIG_FB_ATY is not set
+# CONFIG_FB_SAVAGE is not set
+# CONFIG_FB_SIS is not set
+# CONFIG_FB_NEOMAGIC is not set
+# CONFIG_FB_KYRO is not set
+# CONFIG_FB_3DFX is not set
+# CONFIG_FB_VOODOO1 is not set
+# CONFIG_FB_TRIDENT is not set
+# CONFIG_FB_VIRTUAL is not set
+
+#
+# Console display driver support
+#
+# CONFIG_VGA_CONSOLE is not set
+CONFIG_DUMMY_CONSOLE=y
+CONFIG_FRAMEBUFFER_CONSOLE=y
+# CONFIG_FRAMEBUFFER_CONSOLE_ROTATION is not set
+# CONFIG_FONTS is not set
+CONFIG_FONT_8x8=y
+CONFIG_FONT_8x16=y
+
+#
+# Logo configuration
+#
+CONFIG_LOGO=y
+# CONFIG_LOGO_LINUX_MONO is not set
+# CONFIG_LOGO_LINUX_VGA16 is not set
+# CONFIG_LOGO_LINUX_CLUT224 is not set
+CONFIG_LOGO_SGI_CLUT224=y
+
+#
+# Sound
+#
+CONFIG_SOUND=m
+
+#
+# Advanced Linux Sound Architecture
+#
+CONFIG_SND=m
+CONFIG_SND_TIMER=m
+CONFIG_SND_PCM=m
+# CONFIG_SND_SEQUENCER is not set
+CONFIG_SND_OSSEMUL=y
+CONFIG_SND_MIXER_OSS=m
+CONFIG_SND_PCM_OSS=m
+CONFIG_SND_RTCTIMER=m
+# CONFIG_SND_DYNAMIC_MINORS is not set
+CONFIG_SND_SUPPORT_OLD_API=y
+# CONFIG_SND_VERBOSE_PRINTK is not set
+# CONFIG_SND_DEBUG is not set
+
+#
+# Generic devices
+#
+# CONFIG_SND_DUMMY is not set
+# CONFIG_SND_MTPAV is not set
+# CONFIG_SND_SERIAL_U16550 is not set
+# CONFIG_SND_MPU401 is not set
+
+#
+# PCI devices
+#
+# CONFIG_SND_AD1889 is not set
+# CONFIG_SND_ALI5451 is not set
+# CONFIG_SND_ATIIXP is not set
+# CONFIG_SND_ATIIXP_MODEM is not set
+# CONFIG_SND_AU8810 is not set
+# CONFIG_SND_AU8820 is not set
+# CONFIG_SND_AU8830 is not set
+# CONFIG_SND_AZT3328 is not set
+# CONFIG_SND_BT87X is not set
+# CONFIG_SND_CA0106 is not set
+# CONFIG_SND_CMIPCI is not set
+# CONFIG_SND_CS4281 is not set
+# CONFIG_SND_CS46XX is not set
+# CONFIG_SND_EMU10K1 is not set
+# CONFIG_SND_EMU10K1X is not set
+# CONFIG_SND_ENS1370 is not set
+# CONFIG_SND_ENS1371 is not set
+# CONFIG_SND_ES1938 is not set
+# CONFIG_SND_ES1968 is not set
+# CONFIG_SND_FM801 is not set
+# CONFIG_SND_HDA_INTEL is not set
+# CONFIG_SND_HDSP is not set
+# CONFIG_SND_HDSPM is not set
+# CONFIG_SND_ICE1712 is not set
+# CONFIG_SND_ICE1724 is not set
+# CONFIG_SND_INTEL8X0 is not set
+# CONFIG_SND_INTEL8X0M is not set
+# CONFIG_SND_MAESTRO3 is not set
+# CONFIG_SND_MIXART is not set
+# CONFIG_SND_NM256 is not set
+# CONFIG_SND_PCXHR is not set
+# CONFIG_SND_RME32 is not set
+# CONFIG_SND_RME96 is not set
+# CONFIG_SND_RME9652 is not set
+# CONFIG_SND_SONICVIBES is not set
+# CONFIG_SND_TRIDENT is not set
+# CONFIG_SND_VIA82XX is not set
+# CONFIG_SND_VIA82XX_MODEM is not set
+# CONFIG_SND_VX222 is not set
+# CONFIG_SND_YMFPCI is not set
+
+#
+# ALSA MIPS devices
+#
+
+#
+# Open Sound System
+#
+CONFIG_SOUND_PRIME=m
+# CONFIG_OBSOLETE_OSS_DRIVER is not set
+# CONFIG_SOUND_FUSION is not set
+# CONFIG_SOUND_TRIDENT is not set
+# CONFIG_SOUND_MSNDCLAS is not set
+# CONFIG_SOUND_MSNDPIN is not set
+
+#
+# USB support
+#
+CONFIG_USB_ARCH_HAS_HCD=y
+CONFIG_USB_ARCH_HAS_OHCI=y
+# CONFIG_USB is not set
+
+#
+# NOTE: USB_STORAGE enables SCSI, and 'SCSI disk support'
+#
+
+#
+# USB Gadget Support
+#
+# CONFIG_USB_GADGET is not set
+
+#
+# MMC/SD Card support
+#
+# CONFIG_MMC is not set
+
+#
+# InfiniBand support
+#
+# CONFIG_INFINIBAND is not set
+
+#
+# SN Devices
+#
+
+#
+# EDAC - error detection and reporting (RAS)
+#
+
+#
+# File systems
+#
+CONFIG_EXT2_FS=y
+CONFIG_EXT2_FS_XATTR=y
+CONFIG_EXT2_FS_POSIX_ACL=y
+CONFIG_EXT2_FS_SECURITY=y
+# CONFIG_EXT2_FS_XIP is not set
+CONFIG_EXT3_FS=y
+CONFIG_EXT3_FS_XATTR=y
+CONFIG_EXT3_FS_POSIX_ACL=y
+CONFIG_EXT3_FS_SECURITY=y
+CONFIG_JBD=y
+# CONFIG_JBD_DEBUG is not set
+CONFIG_FS_MBCACHE=y
+CONFIG_REISERFS_FS=m
+# CONFIG_REISERFS_CHECK is not set
+# CONFIG_REISERFS_PROC_INFO is not set
+CONFIG_REISERFS_FS_XATTR=y
+CONFIG_REISERFS_FS_POSIX_ACL=y
+# CONFIG_REISERFS_FS_SECURITY is not set
+CONFIG_JFS_FS=m
+CONFIG_JFS_POSIX_ACL=y
+# CONFIG_JFS_SECURITY is not set
+# CONFIG_JFS_DEBUG is not set
+# CONFIG_JFS_STATISTICS is not set
+CONFIG_FS_POSIX_ACL=y
+CONFIG_XFS_FS=m
+CONFIG_XFS_EXPORT=y
+# CONFIG_XFS_QUOTA is not set
+# CONFIG_XFS_SECURITY is not set
+CONFIG_XFS_POSIX_ACL=y
+CONFIG_XFS_RT=y
+CONFIG_OCFS2_FS=m
+# CONFIG_MINIX_FS is not set
+# CONFIG_ROMFS_FS is not set
+CONFIG_INOTIFY=y
+CONFIG_QUOTA=y
+CONFIG_QFMT_V1=m
+CONFIG_QFMT_V2=m
+CONFIG_QUOTACTL=y
+CONFIG_DNOTIFY=y
+CONFIG_AUTOFS_FS=m
+CONFIG_AUTOFS4_FS=m
+CONFIG_FUSE_FS=m
+
+#
+# CD-ROM/DVD Filesystems
+#
+CONFIG_ISO9660_FS=y
+CONFIG_JOLIET=y
+CONFIG_ZISOFS=y
+CONFIG_UDF_FS=y
+CONFIG_UDF_NLS=y
+
+#
+# DOS/FAT/NT Filesystems
+#
+CONFIG_FAT_FS=m
+CONFIG_MSDOS_FS=m
+CONFIG_VFAT_FS=m
+CONFIG_FAT_DEFAULT_CODEPAGE=437
+CONFIG_FAT_DEFAULT_IOCHARSET="iso8859-1"
+# CONFIG_NTFS_FS is not set
+
+#
+# Pseudo filesystems
+#
+CONFIG_PROC_FS=y
+CONFIG_PROC_KCORE=y
+CONFIG_SYSFS=y
+CONFIG_TMPFS=y
+CONFIG_RAMFS=y
+# CONFIG_RELAYFS_FS is not set
+CONFIG_CONFIGFS_FS=m
+
+#
+# Miscellaneous filesystems
+#
+# CONFIG_ADFS_FS is not set
+# CONFIG_AFFS_FS is not set
+# CONFIG_ASFS_FS is not set
+# CONFIG_HFS_FS is not set
+# CONFIG_HFSPLUS_FS is not set
+# CONFIG_BEFS_FS is not set
+# CONFIG_BFS_FS is not set
+CONFIG_EFS_FS=m
+CONFIG_CRAMFS=y
+# CONFIG_VXFS_FS is not set
+# CONFIG_HPFS_FS is not set
+# CONFIG_QNX4FS_FS is not set
+# CONFIG_SYSV_FS is not set
+# CONFIG_UFS_FS is not set
+
+#
+# Network File Systems
+#
+CONFIG_NFS_FS=y
+# CONFIG_NFS_V3_ACL is not set
+# CONFIG_NFS_V4 is not set
+# CONFIG_NFS_DIRECTIO is not set
+CONFIG_NFSD=y
+# CONFIG_NFSD_V3_ACL is not set
+# CONFIG_NFSD_V4 is not set
+CONFIG_ROOT_NFS=y
+CONFIG_LOCKD=y
+CONFIG_LOCKD_V4=y
+CONFIG_EXPORTFS=y
+CONFIG_SUNRPC=y
+# CONFIG_RPCSEC_GSS_KRB5 is not set
+# CONFIG_RPCSEC_GSS_SPKM3 is not set
+CONFIG_SMB_FS=m
+CONFIG_SMB_NLS_DEFAULT=y
+CONFIG_SMB_NLS_REMOTE="cp437"
+CONFIG_CIFS=m
+# CONFIG_CIFS_STATS is not set
+CONFIG_CIFS_XATTR=y
+CONFIG_CIFS_POSIX=y
+# CONFIG_CIFS_EXPERIMENTAL is not set
+# CONFIG_NCP_FS is not set
+# CONFIG_CODA_FS is not set
+# CONFIG_AFS_FS is not set
+# CONFIG_9P_FS is not set
+
+#
+# Partition Types
+#
+CONFIG_PARTITION_ADVANCED=y
+# CONFIG_ACORN_PARTITION is not set
+# CONFIG_OSF_PARTITION is not set
+# CONFIG_AMIGA_PARTITION is not set
+# CONFIG_ATARI_PARTITION is not set
+# CONFIG_MAC_PARTITION is not set
+CONFIG_MSDOS_PARTITION=y
+# CONFIG_BSD_DISKLABEL is not set
+# CONFIG_MINIX_SUBPARTITION is not set
+# CONFIG_SOLARIS_X86_PARTITION is not set
+# CONFIG_UNIXWARE_DISKLABEL is not set
+# CONFIG_LDM_PARTITION is not set
+CONFIG_SGI_PARTITION=y
+# CONFIG_ULTRIX_PARTITION is not set
+# CONFIG_SUN_PARTITION is not set
+CONFIG_KARMA_PARTITION=y
+# CONFIG_EFI_PARTITION is not set
+
+#
+# Native Language Support
+#
+CONFIG_NLS=y
+CONFIG_NLS_DEFAULT="iso8859-1"
+CONFIG_NLS_CODEPAGE_437=m
+CONFIG_NLS_CODEPAGE_737=m
+CONFIG_NLS_CODEPAGE_775=m
+CONFIG_NLS_CODEPAGE_850=m
+CONFIG_NLS_CODEPAGE_852=m
+CONFIG_NLS_CODEPAGE_855=m
+CONFIG_NLS_CODEPAGE_857=m
+CONFIG_NLS_CODEPAGE_860=m
+CONFIG_NLS_CODEPAGE_861=m
+CONFIG_NLS_CODEPAGE_862=m
+CONFIG_NLS_CODEPAGE_863=m
+CONFIG_NLS_CODEPAGE_864=m
+CONFIG_NLS_CODEPAGE_865=m
+CONFIG_NLS_CODEPAGE_866=m
+CONFIG_NLS_CODEPAGE_869=m
+CONFIG_NLS_CODEPAGE_936=m
+CONFIG_NLS_CODEPAGE_950=m
+CONFIG_NLS_CODEPAGE_932=m
+CONFIG_NLS_CODEPAGE_949=m
+CONFIG_NLS_CODEPAGE_874=m
+CONFIG_NLS_ISO8859_8=m
+CONFIG_NLS_CODEPAGE_1250=m
+CONFIG_NLS_CODEPAGE_1251=m
+CONFIG_NLS_ASCII=m
+CONFIG_NLS_ISO8859_1=m
+CONFIG_NLS_ISO8859_2=m
+CONFIG_NLS_ISO8859_3=m
+CONFIG_NLS_ISO8859_4=m
+CONFIG_NLS_ISO8859_5=m
+CONFIG_NLS_ISO8859_6=m
+CONFIG_NLS_ISO8859_7=m
+CONFIG_NLS_ISO8859_9=m
+CONFIG_NLS_ISO8859_13=m
+CONFIG_NLS_ISO8859_14=m
+CONFIG_NLS_ISO8859_15=m
+CONFIG_NLS_KOI8_R=m
+CONFIG_NLS_KOI8_U=m
+CONFIG_NLS_UTF8=m
+
+#
+# Profiling support
+#
+CONFIG_PROFILING=y
+# CONFIG_OPROFILE is not set
+
+#
+# Kernel hacking
+#
+# CONFIG_PRINTK_TIME is not set
+CONFIG_MAGIC_SYSRQ=y
+# CONFIG_DEBUG_KERNEL is not set
+CONFIG_LOG_BUF_SHIFT=14
+# CONFIG_CROSSCOMPILE is not set
+CONFIG_CMDLINE=""
+
+#
+# Security options
+#
+CONFIG_KEYS=y
+# CONFIG_KEYS_DEBUG_PROC_KEYS is not set
+CONFIG_SECURITY=y
+CONFIG_SECURITY_NETWORK=y
+CONFIG_SECURITY_NETWORK_XFRM=y
+CONFIG_SECURITY_CAPABILITIES=y
+CONFIG_SECURITY_SELINUX=y
+CONFIG_SECURITY_SELINUX_BOOTPARAM=y
+CONFIG_SECURITY_SELINUX_BOOTPARAM_VALUE=0
+CONFIG_SECURITY_SELINUX_DISABLE=y
+CONFIG_SECURITY_SELINUX_DEVELOP=y
+CONFIG_SECURITY_SELINUX_AVC_STATS=y
+CONFIG_SECURITY_SELINUX_CHECKREQPROT_VALUE=1
+
+#
+# Cryptographic options
+#
+CONFIG_CRYPTO=y
+CONFIG_CRYPTO_HMAC=y
+CONFIG_CRYPTO_NULL=m
+CONFIG_CRYPTO_MD4=m
+CONFIG_CRYPTO_MD5=y
+CONFIG_CRYPTO_SHA1=m
+CONFIG_CRYPTO_SHA256=m
+CONFIG_CRYPTO_SHA512=m
+CONFIG_CRYPTO_WP512=m
+CONFIG_CRYPTO_TGR192=m
+CONFIG_CRYPTO_DES=m
+CONFIG_CRYPTO_BLOWFISH=m
+CONFIG_CRYPTO_TWOFISH=m
+CONFIG_CRYPTO_SERPENT=m
+CONFIG_CRYPTO_AES=m
+CONFIG_CRYPTO_CAST5=m
+CONFIG_CRYPTO_CAST6=m
+CONFIG_CRYPTO_TEA=m
+CONFIG_CRYPTO_ARC4=m
+CONFIG_CRYPTO_KHAZAD=m
+CONFIG_CRYPTO_ANUBIS=m
+CONFIG_CRYPTO_DEFLATE=m
+CONFIG_CRYPTO_MICHAEL_MIC=m
+CONFIG_CRYPTO_CRC32C=m
+CONFIG_CRYPTO_TEST=m
+
+#
+# Hardware crypto devices
+#
+
+#
+# Library routines
+#
+CONFIG_CRC_CCITT=m
+# CONFIG_CRC16 is not set
+CONFIG_CRC32=y
+CONFIG_LIBCRC32C=m
+CONFIG_ZLIB_INFLATE=y
+CONFIG_ZLIB_DEFLATE=m
+CONFIG_TEXTSEARCH=y
+CONFIG_TEXTSEARCH_KMP=m
+CONFIG_TEXTSEARCH_BM=m
+CONFIG_TEXTSEARCH_FSM=m
+CONFIG_SND_OPL3_LIB=m
+CONFIG_SND_CS46XX_NEW_DSP=y
+CONFIG_MSNDPIN_INIT_FILE="/etc/sound/pndspini.bin"
+CONFIG_MSNDPIN_PERM_FILE="/etc/sound/pndsperm.bin"
+CONFIG_SOUND_EMU10K1=m
+CONFIG_SND_MPU401_UART=m
+CONFIG_SND_FM801_TEA575X_BOOL=y
+CONFIG_SND_FM801_TEA575X=m
+CONFIG_VIDEO_BUF=m
+CONFIG_SND_AC97_CODEC=m
+CONFIG_SND_BT87X_OVERCLOCK=y
+CONFIG_MSNDCLAS_INIT_FILE="/etc/sound/msndinit.bin"
+CONFIG_SND_HWDEP=m
+CONFIG_MSNDCLAS_PERM_FILE="/etc/sound/msndperm.bin"
+CONFIG_SND_VX_LIB=m
+CONFIG_SND_KORG1212=m

Added: dists/sid/linux-2.6/debian/config/mips/config.sb1-bcm91250a
==============================================================================
--- (empty file)
+++ dists/sid/linux-2.6/debian/config/mips/config.sb1-bcm91250a	Mon Nov 26 20:06:56 2007
@@ -0,0 +1,1713 @@
+#
+# Machine selection
+#
+# CONFIG_MIPS_MTX1 is not set
+# CONFIG_MIPS_BOSPORUS is not set
+# CONFIG_MIPS_PB1000 is not set
+# CONFIG_MIPS_PB1100 is not set
+# CONFIG_MIPS_PB1500 is not set
+# CONFIG_MIPS_PB1550 is not set
+# CONFIG_MIPS_PB1200 is not set
+# CONFIG_MIPS_DB1000 is not set
+# CONFIG_MIPS_DB1100 is not set
+# CONFIG_MIPS_DB1500 is not set
+# CONFIG_MIPS_DB1550 is not set
+# CONFIG_MIPS_DB1200 is not set
+# CONFIG_MIPS_MIRAGE is not set
+# CONFIG_MIPS_COBALT is not set
+# CONFIG_MACH_DECSTATION is not set
+# CONFIG_MIPS_EV64120 is not set
+# CONFIG_MIPS_EV96100 is not set
+# CONFIG_MIPS_IVR is not set
+# CONFIG_MIPS_ITE8172 is not set
+# CONFIG_MACH_JAZZ is not set
+# CONFIG_LASAT is not set
+# CONFIG_MIPS_ATLAS is not set
+# CONFIG_MIPS_MALTA is not set
+# CONFIG_MIPS_SEAD is not set
+# CONFIG_MIPS_SIM is not set
+# CONFIG_MOMENCO_JAGUAR_ATX is not set
+# CONFIG_MOMENCO_OCELOT is not set
+# CONFIG_MOMENCO_OCELOT_3 is not set
+# CONFIG_MOMENCO_OCELOT_C is not set
+# CONFIG_MOMENCO_OCELOT_G is not set
+# CONFIG_MIPS_XXS1500 is not set
+# CONFIG_PNX8550_V2PCI is not set
+# CONFIG_PNX8550_JBS is not set
+# CONFIG_DDB5074 is not set
+# CONFIG_DDB5476 is not set
+# CONFIG_DDB5477 is not set
+# CONFIG_MACH_VR41XX is not set
+# CONFIG_PMC_YOSEMITE is not set
+# CONFIG_QEMU is not set
+# CONFIG_SGI_IP22 is not set
+# CONFIG_SGI_IP27 is not set
+# CONFIG_SGI_IP32 is not set
+# CONFIG_SIBYTE_BIGSUR is not set
+CONFIG_SIBYTE_SWARM=y
+# CONFIG_SIBYTE_SENTOSA is not set
+# CONFIG_SIBYTE_RHONE is not set
+# CONFIG_SIBYTE_CARMEL is not set
+# CONFIG_SIBYTE_PTSWARM is not set
+# CONFIG_SIBYTE_LITTLESUR is not set
+# CONFIG_SIBYTE_CRHINE is not set
+# CONFIG_SIBYTE_CRHONE is not set
+# CONFIG_SNI_RM200_PCI is not set
+# CONFIG_TOSHIBA_JMR3927 is not set
+# CONFIG_TOSHIBA_RBTX4927 is not set
+# CONFIG_TOSHIBA_RBTX4938 is not set
+CONFIG_SIBYTE_SB1250=y
+CONFIG_SIBYTE_SB1xxx_SOC=y
+# CONFIG_CPU_SB1_PASS_1 is not set
+# CONFIG_CPU_SB1_PASS_2_1250 is not set
+CONFIG_CPU_SB1_PASS_2_2=y
+# CONFIG_CPU_SB1_PASS_4 is not set
+# CONFIG_CPU_SB1_PASS_2_112x is not set
+# CONFIG_CPU_SB1_PASS_3 is not set
+CONFIG_SIBYTE_HAS_LDT=y
+# CONFIG_SIMULATION is not set
+# CONFIG_SB1_CEX_ALWAYS_FATAL is not set
+# CONFIG_SB1_CERR_STALL is not set
+CONFIG_SIBYTE_CFE=y
+# CONFIG_SIBYTE_CFE_CONSOLE is not set
+# CONFIG_SIBYTE_BUS_WATCHER is not set
+# CONFIG_SIBYTE_SB1250_PROF is not set
+# CONFIG_SIBYTE_TBPROF is not set
+CONFIG_RWSEM_GENERIC_SPINLOCK=y
+CONFIG_GENERIC_CALIBRATE_DELAY=y
+CONFIG_DMA_COHERENT=y
+CONFIG_CPU_BIG_ENDIAN=y
+# CONFIG_CPU_LITTLE_ENDIAN is not set
+CONFIG_SYS_SUPPORTS_BIG_ENDIAN=y
+CONFIG_SYS_SUPPORTS_LITTLE_ENDIAN=y
+CONFIG_SWAP_IO_SPACE=y
+CONFIG_BOOT_ELF32=y
+CONFIG_MIPS_L1_CACHE_SHIFT=5
+
+#
+# CPU selection
+#
+# CONFIG_CPU_MIPS32_R1 is not set
+# CONFIG_CPU_MIPS32_R2 is not set
+# CONFIG_CPU_MIPS64_R1 is not set
+# CONFIG_CPU_MIPS64_R2 is not set
+# CONFIG_CPU_R3000 is not set
+# CONFIG_CPU_TX39XX is not set
+# CONFIG_CPU_VR41XX is not set
+# CONFIG_CPU_R4300 is not set
+# CONFIG_CPU_R4X00 is not set
+# CONFIG_CPU_TX49XX is not set
+# CONFIG_CPU_R5000 is not set
+# CONFIG_CPU_R5432 is not set
+# CONFIG_CPU_R6000 is not set
+# CONFIG_CPU_NEVADA is not set
+# CONFIG_CPU_R8000 is not set
+# CONFIG_CPU_R10000 is not set
+# CONFIG_CPU_RM7000 is not set
+# CONFIG_CPU_RM9000 is not set
+CONFIG_CPU_SB1=y
+CONFIG_SYS_HAS_CPU_SB1=y
+CONFIG_SYS_SUPPORTS_32BIT_KERNEL=y
+CONFIG_SYS_SUPPORTS_64BIT_KERNEL=y
+CONFIG_CPU_SUPPORTS_32BIT_KERNEL=y
+CONFIG_CPU_SUPPORTS_64BIT_KERNEL=y
+
+#
+# Kernel type
+#
+# CONFIG_32BIT is not set
+CONFIG_64BIT=y
+CONFIG_PAGE_SIZE_4KB=y
+# CONFIG_PAGE_SIZE_8KB is not set
+# CONFIG_PAGE_SIZE_16KB is not set
+# CONFIG_PAGE_SIZE_64KB is not set
+# CONFIG_SIBYTE_DMA_PAGEOPS is not set
+CONFIG_CPU_HAS_PREFETCH=y
+# CONFIG_MIPS_MT is not set
+CONFIG_SB1_PASS_2_WORKAROUNDS=y
+CONFIG_CPU_HAS_LLSC=y
+CONFIG_CPU_HAS_SYNC=y
+CONFIG_GENERIC_HARDIRQS=y
+CONFIG_GENERIC_IRQ_PROBE=y
+CONFIG_CPU_SUPPORTS_HIGHMEM=y
+CONFIG_SYS_SUPPORTS_HIGHMEM=y
+CONFIG_ARCH_FLATMEM_ENABLE=y
+CONFIG_SELECT_MEMORY_MODEL=y
+CONFIG_FLATMEM_MANUAL=y
+# CONFIG_DISCONTIGMEM_MANUAL is not set
+# CONFIG_SPARSEMEM_MANUAL is not set
+CONFIG_FLATMEM=y
+CONFIG_FLAT_NODE_MEM_MAP=y
+# CONFIG_SPARSEMEM_STATIC is not set
+CONFIG_SPLIT_PTLOCK_CPUS=4
+CONFIG_SMP=y
+CONFIG_NR_CPUS=2
+CONFIG_PREEMPT_NONE=y
+# CONFIG_PREEMPT_VOLUNTARY is not set
+# CONFIG_PREEMPT is not set
+CONFIG_PREEMPT_BKL=y
+
+#
+# Code maturity level options
+#
+CONFIG_EXPERIMENTAL=y
+CONFIG_BROKEN_ON_SMP=y
+CONFIG_LOCK_KERNEL=y
+
+#
+# General setup
+#
+CONFIG_LOCALVERSION=""
+CONFIG_LOCALVERSION_AUTO=y
+CONFIG_SWAP=y
+CONFIG_SYSVIPC=y
+CONFIG_POSIX_MQUEUE=y
+CONFIG_BSD_PROCESS_ACCT=y
+# CONFIG_BSD_PROCESS_ACCT_V3 is not set
+CONFIG_AUDIT=y
+# CONFIG_IKCONFIG is not set
+CONFIG_INITRAMFS_SOURCE=""
+# CONFIG_CC_OPTIMIZE_FOR_SIZE is not set
+CONFIG_EMBEDDED=y
+CONFIG_HOTPLUG=y
+CONFIG_BASE_FULL=y
+CONFIG_CC_ALIGN_FUNCTIONS=0
+CONFIG_CC_ALIGN_LABELS=0
+CONFIG_CC_ALIGN_LOOPS=0
+CONFIG_CC_ALIGN_JUMPS=0
+CONFIG_SLAB=y
+CONFIG_BASE_SMALL=0
+# CONFIG_SLOB is not set
+
+#
+# Loadable module support
+#
+CONFIG_MODULES=y
+CONFIG_OBSOLETE_MODPARM=y
+CONFIG_KMOD=y
+CONFIG_STOP_MACHINE=y
+
+#
+# Block layer
+#
+
+#
+# Bus options (PCI, PCMCIA, EISA, ISA, TC)
+#
+CONFIG_HW_HAS_PCI=y
+CONFIG_PCI=y
+CONFIG_MMU=y
+
+#
+# PCCARD (PCMCIA/CardBus) support
+#
+# CONFIG_PCCARD is not set
+
+#
+# PCI Hotplug Support
+#
+# CONFIG_HOTPLUG_PCI is not set
+
+#
+# Executable file formats
+#
+CONFIG_BINFMT_ELF=y
+CONFIG_BINFMT_MISC=m
+CONFIG_BUILD_ELF64=y
+CONFIG_MIPS32_COMPAT=y
+CONFIG_COMPAT=y
+CONFIG_MIPS32_O32=y
+CONFIG_MIPS32_N32=y
+CONFIG_BINFMT_ELF32=y
+
+#
+# Networking
+#
+CONFIG_NET=y
+
+#
+# Networking options
+#
+CONFIG_PACKET=y
+CONFIG_PACKET_MMAP=y
+CONFIG_UNIX=y
+CONFIG_XFRM=y
+CONFIG_XFRM_USER=y
+CONFIG_NET_KEY=y
+CONFIG_INET=y
+CONFIG_IP_MULTICAST=y
+# CONFIG_IP_ADVANCED_ROUTER is not set
+CONFIG_IP_FIB_HASH=y
+CONFIG_IP_PNP=y
+CONFIG_IP_PNP_DHCP=y
+CONFIG_IP_PNP_BOOTP=y
+# CONFIG_IP_PNP_RARP is not set
+CONFIG_NET_IPIP=m
+CONFIG_NET_IPGRE=m
+# CONFIG_NET_IPGRE_BROADCAST is not set
+# CONFIG_IP_MROUTE is not set
+# CONFIG_ARPD is not set
+# CONFIG_SYN_COOKIES is not set
+CONFIG_INET_AH=m
+CONFIG_INET_ESP=m
+CONFIG_INET_IPCOMP=m
+CONFIG_INET_TUNNEL=m
+CONFIG_INET_DIAG=y
+CONFIG_INET_TCP_DIAG=y
+CONFIG_TCP_CONG_ADVANCED=y
+
+#
+# TCP congestion control
+#
+CONFIG_TCP_CONG_BIC=y
+CONFIG_TCP_CONG_CUBIC=m
+CONFIG_TCP_CONG_WESTWOOD=m
+CONFIG_TCP_CONG_HTCP=m
+CONFIG_TCP_CONG_HSTCP=m
+CONFIG_TCP_CONG_HYBLA=m
+CONFIG_TCP_CONG_VEGAS=m
+CONFIG_TCP_CONG_SCALABLE=m
+
+#
+# IP: Virtual Server Configuration
+#
+# CONFIG_IP_VS is not set
+CONFIG_IPV6=m
+CONFIG_IPV6_PRIVACY=y
+CONFIG_INET6_AH=m
+CONFIG_INET6_ESP=m
+CONFIG_INET6_IPCOMP=m
+CONFIG_INET6_TUNNEL=m
+CONFIG_IPV6_TUNNEL=m
+CONFIG_NETFILTER=y
+# CONFIG_NETFILTER_DEBUG is not set
+
+#
+# Core Netfilter Configuration
+#
+CONFIG_NETFILTER_NETLINK=m
+CONFIG_NETFILTER_NETLINK_QUEUE=m
+CONFIG_NETFILTER_NETLINK_LOG=m
+CONFIG_NETFILTER_XTABLES=m
+CONFIG_NETFILTER_XT_TARGET_CLASSIFY=m
+CONFIG_NETFILTER_XT_TARGET_CONNMARK=m
+CONFIG_NETFILTER_XT_TARGET_MARK=m
+CONFIG_NETFILTER_XT_TARGET_NFQUEUE=m
+CONFIG_NETFILTER_XT_TARGET_NOTRACK=m
+CONFIG_NETFILTER_XT_MATCH_COMMENT=m
+CONFIG_NETFILTER_XT_MATCH_CONNBYTES=m
+CONFIG_NETFILTER_XT_MATCH_CONNMARK=m
+CONFIG_NETFILTER_XT_MATCH_CONNTRACK=m
+CONFIG_NETFILTER_XT_MATCH_DCCP=m
+CONFIG_NETFILTER_XT_MATCH_HELPER=m
+CONFIG_NETFILTER_XT_MATCH_LENGTH=m
+CONFIG_NETFILTER_XT_MATCH_LIMIT=m
+CONFIG_NETFILTER_XT_MATCH_MAC=m
+CONFIG_NETFILTER_XT_MATCH_MARK=m
+CONFIG_NETFILTER_XT_MATCH_PKTTYPE=m
+CONFIG_NETFILTER_XT_MATCH_REALM=m
+CONFIG_NETFILTER_XT_MATCH_SCTP=m
+CONFIG_NETFILTER_XT_MATCH_STATE=m
+CONFIG_NETFILTER_XT_MATCH_STRING=m
+CONFIG_NETFILTER_XT_MATCH_TCPMSS=m
+
+#
+# IP: Netfilter Configuration
+#
+CONFIG_IP_NF_QUEUE=m
+CONFIG_IP_NF_IPTABLES=m
+CONFIG_IP_NF_MATCH_IPRANGE=m
+CONFIG_IP_NF_MATCH_MULTIPORT=m
+CONFIG_IP_NF_MATCH_TOS=m
+CONFIG_IP_NF_MATCH_RECENT=m
+CONFIG_IP_NF_MATCH_ECN=m
+CONFIG_IP_NF_MATCH_DSCP=m
+CONFIG_IP_NF_MATCH_AH_ESP=m
+CONFIG_IP_NF_MATCH_TTL=m
+CONFIG_IP_NF_MATCH_OWNER=m
+CONFIG_IP_NF_MATCH_ADDRTYPE=m
+CONFIG_IP_NF_MATCH_HASHLIMIT=m
+CONFIG_IP_NF_MATCH_POLICY=m
+CONFIG_IP_NF_FILTER=m
+CONFIG_IP_NF_TARGET_REJECT=m
+CONFIG_IP_NF_TARGET_LOG=m
+CONFIG_IP_NF_TARGET_ULOG=m
+CONFIG_IP_NF_TARGET_TCPMSS=m
+CONFIG_IP_NF_TARGET_MASQUERADE=m
+CONFIG_IP_NF_TARGET_REDIRECT=m
+CONFIG_IP_NF_TARGET_NETMAP=m
+CONFIG_IP_NF_TARGET_SAME=m
+CONFIG_IP_NF_MANGLE=m
+CONFIG_IP_NF_TARGET_TOS=m
+CONFIG_IP_NF_TARGET_ECN=m
+CONFIG_IP_NF_TARGET_DSCP=m
+CONFIG_IP_NF_TARGET_TTL=m
+CONFIG_IP_NF_TARGET_CLUSTERIP=m
+CONFIG_IP_NF_RAW=m
+CONFIG_IP_NF_ARPTABLES=m
+CONFIG_IP_NF_ARPFILTER=m
+CONFIG_IP_NF_ARP_MANGLE=m
+
+#
+# IPv6: Netfilter Configuration (EXPERIMENTAL)
+#
+CONFIG_IP6_NF_QUEUE=m
+CONFIG_IP6_NF_IPTABLES=m
+CONFIG_IP6_NF_MATCH_RT=m
+CONFIG_IP6_NF_MATCH_OPTS=m
+CONFIG_IP6_NF_MATCH_FRAG=m
+CONFIG_IP6_NF_MATCH_HL=m
+CONFIG_IP6_NF_MATCH_MULTIPORT=m
+CONFIG_IP6_NF_MATCH_OWNER=m
+CONFIG_IP6_NF_MATCH_IPV6HEADER=m
+CONFIG_IP6_NF_MATCH_AHESP=m
+CONFIG_IP6_NF_MATCH_EUI64=m
+CONFIG_IP6_NF_MATCH_POLICY=m
+CONFIG_IP6_NF_FILTER=m
+CONFIG_IP6_NF_TARGET_LOG=m
+# CONFIG_IP6_NF_TARGET_REJECT is not set
+CONFIG_IP6_NF_MANGLE=m
+# CONFIG_IP6_NF_TARGET_HL is not set
+CONFIG_IP6_NF_RAW=m
+
+#
+# DCCP Configuration (EXPERIMENTAL)
+#
+# CONFIG_IP_DCCP is not set
+
+#
+# SCTP Configuration (EXPERIMENTAL)
+#
+CONFIG_IP_SCTP=m
+# CONFIG_SCTP_DBG_MSG is not set
+# CONFIG_SCTP_DBG_OBJCNT is not set
+# CONFIG_SCTP_HMAC_NONE is not set
+# CONFIG_SCTP_HMAC_SHA1 is not set
+CONFIG_SCTP_HMAC_MD5=y
+
+#
+# TIPC Configuration (EXPERIMENTAL)
+#
+CONFIG_TIPC=m
+CONFIG_TIPC_ADVANCED=y
+CONFIG_TIPC_ZONES=3
+CONFIG_TIPC_CLUSTERS=1
+CONFIG_TIPC_NODES=255
+CONFIG_TIPC_SLAVE_NODES=0
+CONFIG_TIPC_PORTS=8191
+CONFIG_TIPC_LOG=0
+# CONFIG_TIPC_DEBUG is not set
+# CONFIG_ATM is not set
+# CONFIG_BRIDGE is not set
+# CONFIG_VLAN_8021Q is not set
+# CONFIG_DECNET is not set
+# CONFIG_LLC2 is not set
+# CONFIG_IPX is not set
+# CONFIG_ATALK is not set
+# CONFIG_X25 is not set
+# CONFIG_LAPB is not set
+# CONFIG_NET_DIVERT is not set
+# CONFIG_ECONET is not set
+# CONFIG_WAN_ROUTER is not set
+
+#
+# Network testing
+#
+# CONFIG_HAMRADIO is not set
+# CONFIG_IRDA is not set
+# CONFIG_BT is not set
+# CONFIG_IEEE80211 is not set
+
+#
+# Device Drivers
+#
+
+#
+# Generic Driver Options
+#
+CONFIG_STANDALONE=y
+CONFIG_PREVENT_FIRMWARE_BUILD=y
+CONFIG_FW_LOADER=m
+
+#
+# Connector - unified userspace <-> kernelspace linker
+#
+# CONFIG_CONNECTOR is not set
+
+#
+# Memory Technology Devices (MTD)
+#
+# CONFIG_MTD is not set
+
+#
+# Parallel port support
+#
+
+#
+# Plug and Play support
+#
+
+#
+# Block devices
+#
+# CONFIG_BLK_CPQ_DA is not set
+# CONFIG_BLK_CPQ_CISS_DA is not set
+# CONFIG_BLK_DEV_DAC960 is not set
+# CONFIG_BLK_DEV_UMEM is not set
+# CONFIG_BLK_DEV_COW_COMMON is not set
+CONFIG_BLK_DEV_LOOP=m
+CONFIG_BLK_DEV_CRYPTOLOOP=m
+CONFIG_BLK_DEV_NBD=m
+# CONFIG_BLK_DEV_SX8 is not set
+# CONFIG_BLK_DEV_UB is not set
+CONFIG_BLK_DEV_RAM=y
+CONFIG_BLK_DEV_RAM_COUNT=16
+CONFIG_BLK_DEV_RAM_SIZE=8192
+CONFIG_BLK_DEV_INITRD=y
+# CONFIG_CDROM_PKTCDVD is not set
+# CONFIG_ATA_OVER_ETH is not set
+
+#
+# ATA/ATAPI/MFM/RLL support
+#
+CONFIG_IDE=y
+CONFIG_BLK_DEV_IDE=y
+
+#
+# Please see Documentation/ide.txt for help/info on IDE drives
+#
+# CONFIG_BLK_DEV_IDE_SATA is not set
+CONFIG_BLK_DEV_IDEDISK=y
+# CONFIG_IDEDISK_MULTI_MODE is not set
+CONFIG_BLK_DEV_IDECD=m
+CONFIG_BLK_DEV_IDETAPE=m
+CONFIG_BLK_DEV_IDEFLOPPY=m
+# CONFIG_BLK_DEV_IDESCSI is not set
+
+#
+# IDE chipset support/bugfixes
+#
+CONFIG_IDE_GENERIC=y
+CONFIG_BLK_DEV_IDEPCI=y
+CONFIG_IDEPCI_SHARE_IRQ=y
+# CONFIG_BLK_DEV_OFFBOARD is not set
+# CONFIG_BLK_DEV_GENERIC is not set
+# CONFIG_BLK_DEV_OPTI621 is not set
+CONFIG_BLK_DEV_IDEDMA_PCI=y
+# CONFIG_BLK_DEV_IDEDMA_FORCED is not set
+# CONFIG_IDEDMA_ONLYDISK is not set
+CONFIG_BLK_DEV_AEC62XX=m
+CONFIG_BLK_DEV_ALI15X3=m
+# CONFIG_WDC_ALI15X3 is not set
+CONFIG_BLK_DEV_AMD74XX=m
+CONFIG_BLK_DEV_CMD64X=m
+CONFIG_BLK_DEV_TRIFLEX=m
+CONFIG_BLK_DEV_CY82C693=m
+# CONFIG_BLK_DEV_CS5520 is not set
+CONFIG_BLK_DEV_CS5530=m
+CONFIG_BLK_DEV_HPT34X=m
+# CONFIG_HPT34X_AUTODMA is not set
+CONFIG_BLK_DEV_HPT366=m
+CONFIG_BLK_DEV_SC1200=m
+CONFIG_BLK_DEV_PIIX=m
+CONFIG_BLK_DEV_IT821X=m
+CONFIG_BLK_DEV_NS87415=m
+CONFIG_BLK_DEV_PDC202XX_OLD=m
+# CONFIG_PDC202XX_BURST is not set
+CONFIG_BLK_DEV_PDC202XX_NEW=m
+CONFIG_BLK_DEV_SVWKS=m
+CONFIG_BLK_DEV_SIIMAGE=m
+CONFIG_BLK_DEV_SLC90E66=m
+CONFIG_BLK_DEV_TRM290=m
+CONFIG_BLK_DEV_VIA82CXXX=m
+CONFIG_BLK_DEV_IDE_SWARM=y
+# CONFIG_IDE_ARM is not set
+CONFIG_BLK_DEV_IDEDMA=y
+# CONFIG_IDEDMA_IVB is not set
+# CONFIG_BLK_DEV_HD is not set
+
+#
+# SCSI device support
+#
+CONFIG_RAID_ATTRS=m
+CONFIG_SCSI=m
+CONFIG_SCSI_PROC_FS=y
+
+#
+# SCSI support type (disk, tape, CD-ROM)
+#
+CONFIG_BLK_DEV_SD=m
+CONFIG_CHR_DEV_ST=m
+CONFIG_CHR_DEV_OSST=m
+CONFIG_BLK_DEV_SR=m
+CONFIG_BLK_DEV_SR_VENDOR=y
+CONFIG_CHR_DEV_SG=m
+CONFIG_CHR_DEV_SCH=m
+
+#
+# Some SCSI devices (e.g. CD jukebox) support multiple LUNs
+#
+# CONFIG_SCSI_MULTI_LUN is not set
+# CONFIG_SCSI_CONSTANTS is not set
+# CONFIG_SCSI_LOGGING is not set
+
+#
+# SCSI Transport Attributes
+#
+CONFIG_SCSI_SPI_ATTRS=m
+CONFIG_SCSI_FC_ATTRS=m
+CONFIG_SCSI_ISCSI_ATTRS=m
+# CONFIG_SCSI_SAS_ATTRS is not set
+
+#
+# SCSI low-level drivers
+#
+CONFIG_ISCSI_TCP=m
+CONFIG_BLK_DEV_3W_XXXX_RAID=m
+CONFIG_SCSI_3W_9XXX=m
+CONFIG_SCSI_ACARD=m
+CONFIG_SCSI_AACRAID=m
+CONFIG_SCSI_AIC7XXX=m
+CONFIG_AIC7XXX_CMDS_PER_DEVICE=32
+CONFIG_AIC7XXX_RESET_DELAY_MS=15000
+CONFIG_AIC7XXX_DEBUG_ENABLE=y
+CONFIG_AIC7XXX_DEBUG_MASK=0
+CONFIG_AIC7XXX_REG_PRETTY_PRINT=y
+CONFIG_SCSI_AIC7XXX_OLD=m
+CONFIG_SCSI_AIC79XX=m
+CONFIG_AIC79XX_CMDS_PER_DEVICE=32
+CONFIG_AIC79XX_RESET_DELAY_MS=15000
+CONFIG_AIC79XX_DEBUG_ENABLE=y
+CONFIG_AIC79XX_DEBUG_MASK=0
+CONFIG_AIC79XX_REG_PRETTY_PRINT=y
+# CONFIG_MEGARAID_NEWGEN is not set
+CONFIG_MEGARAID_LEGACY=m
+CONFIG_MEGARAID_SAS=m
+CONFIG_SCSI_DMX3191D=m
+CONFIG_SCSI_FUTURE_DOMAIN=m
+CONFIG_SCSI_IPS=m
+CONFIG_SCSI_INITIO=m
+CONFIG_SCSI_INIA100=m
+CONFIG_SCSI_SYM53C8XX_2=m
+CONFIG_SCSI_SYM53C8XX_DMA_ADDRESSING_MODE=1
+CONFIG_SCSI_SYM53C8XX_DEFAULT_TAGS=16
+CONFIG_SCSI_SYM53C8XX_MAX_TAGS=64
+# CONFIG_SCSI_IPR is not set
+CONFIG_SCSI_QLOGIC_FC=m
+# CONFIG_SCSI_QLOGIC_FC_FIRMWARE is not set
+CONFIG_SCSI_QLOGIC_1280=m
+CONFIG_SCSI_QLA_FC=m
+# CONFIG_SCSI_QLA2XXX_EMBEDDED_FIRMWARE is not set
+CONFIG_SCSI_LPFC=m
+CONFIG_SCSI_DC395x=m
+CONFIG_SCSI_DC390T=m
+CONFIG_SCSI_DEBUG=m
+
+#
+# Serial ATA (prod) and Parallel ATA (experimental) drivers
+#
+CONFIG_ATA=m
+CONFIG_SATA_AHCI=m
+CONFIG_SATA_SVW=m
+CONFIG_ATA_PIIX=m
+CONFIG_SATA_MV=m
+CONFIG_SATA_NV=m
+CONFIG_PDC_ADMA=m
+CONFIG_SATA_QSTOR=m
+CONFIG_SATA_PROMISE=m
+CONFIG_SATA_SX4=m
+CONFIG_SATA_SIL=m
+CONFIG_SATA_SIL24=m
+CONFIG_SATA_SIS=m
+CONFIG_SATA_ULI=m
+CONFIG_SATA_VIA=m
+CONFIG_SATA_VITESSE=m
+
+#
+# Multi-device support (RAID and LVM)
+#
+CONFIG_MD=y
+CONFIG_BLK_DEV_MD=m
+CONFIG_MD_LINEAR=m
+CONFIG_MD_RAID0=m
+CONFIG_MD_RAID1=m
+CONFIG_MD_RAID10=m
+CONFIG_MD_RAID5=m
+CONFIG_MD_RAID6=m
+CONFIG_MD_MULTIPATH=m
+CONFIG_MD_FAULTY=m
+CONFIG_BLK_DEV_DM=m
+CONFIG_DM_CRYPT=m
+CONFIG_DM_SNAPSHOT=m
+CONFIG_DM_MIRROR=m
+CONFIG_DM_ZERO=m
+CONFIG_DM_MULTIPATH=m
+# CONFIG_DM_MULTIPATH_EMC is not set
+
+#
+# Fusion MPT device support
+#
+# CONFIG_FUSION is not set
+# CONFIG_FUSION_SPI is not set
+# CONFIG_FUSION_FC is not set
+# CONFIG_FUSION_SAS is not set
+
+#
+# IEEE 1394 (FireWire) support
+#
+# CONFIG_FIREWIRE is not set
+
+#
+# I2O device support
+#
+# CONFIG_I2O is not set
+
+#
+# Network device support
+#
+CONFIG_NETDEVICES=y
+CONFIG_DUMMY=m
+CONFIG_BONDING=m
+CONFIG_EQUALIZER=m
+CONFIG_TUN=m
+
+#
+# ARCnet devices
+#
+# CONFIG_ARCNET is not set
+
+#
+# PHY device support
+#
+# CONFIG_PHYLIB is not set
+
+#
+# Ethernet (10 or 100Mbit)
+#
+CONFIG_NET_ETHERNET=y
+CONFIG_MII=y
+CONFIG_NET_SB1250_MAC=y
+CONFIG_SBMAC_NAPI=y
+# CONFIG_HAPPYMEAL is not set
+# CONFIG_SUNGEM is not set
+# CONFIG_CASSINI is not set
+# CONFIG_NET_VENDOR_3COM is not set
+# CONFIG_DM9000 is not set
+
+#
+# Tulip family network device support
+#
+# CONFIG_NET_TULIP is not set
+# CONFIG_HP100 is not set
+CONFIG_NET_PCI=y
+CONFIG_PCNET32=m
+CONFIG_AMD8111_ETH=m
+# CONFIG_AMD8111E_NAPI is not set
+CONFIG_ADAPTEC_STARFIRE=m
+# CONFIG_ADAPTEC_STARFIRE_NAPI is not set
+CONFIG_B44=m
+CONFIG_FORCEDETH=m
+CONFIG_EEPRO100=m
+CONFIG_E100=m
+CONFIG_FEALNX=m
+CONFIG_NATSEMI=m
+CONFIG_NE2K_PCI=m
+CONFIG_8139CP=m
+CONFIG_8139TOO=m
+CONFIG_8139TOO_PIO=y
+# CONFIG_8139TOO_TUNE_TWISTER is not set
+CONFIG_8139TOO_8129=y
+# CONFIG_8139_OLD_RX_RESET is not set
+CONFIG_SIS900=m
+CONFIG_EPIC100=m
+CONFIG_SUNDANCE=m
+# CONFIG_SUNDANCE_MMIO is not set
+CONFIG_VIA_RHINE=m
+# CONFIG_VIA_RHINE_MMIO is not set
+# CONFIG_LAN_SAA9730 is not set
+# CONFIG_NET_POCKET is not set
+
+#
+# Ethernet (1000 Mbit)
+#
+CONFIG_DL2K=m
+CONFIG_E1000=m
+# CONFIG_E1000_NAPI is not set
+# CONFIG_E1000_DISABLE_PACKET_SPLIT is not set
+CONFIG_NS83820=m
+CONFIG_HAMACHI=m
+CONFIG_YELLOWFIN=m
+CONFIG_R8169=m
+# CONFIG_R8169_NAPI is not set
+CONFIG_SIS190=m
+CONFIG_SKGE=m
+CONFIG_SKY2=m
+CONFIG_VIA_VELOCITY=m
+CONFIG_TIGON3=m
+CONFIG_BNX2=m
+
+#
+# Ethernet (10000 Mbit)
+#
+# CONFIG_CHELSIO_T1 is not set
+# CONFIG_IXGB is not set
+# CONFIG_S2IO is not set
+
+#
+# Token Ring devices
+#
+# CONFIG_TR is not set
+
+#
+# Wireless LAN (non-hamradio)
+#
+# CONFIG_NET_RADIO is not set
+
+#
+# Wan interfaces
+#
+# CONFIG_WAN is not set
+# CONFIG_FDDI is not set
+# CONFIG_HIPPI is not set
+# CONFIG_PLIP is not set
+CONFIG_PPP=m
+# CONFIG_PPP_MULTILINK is not set
+CONFIG_PPP_FILTER=y
+CONFIG_PPP_ASYNC=m
+CONFIG_PPP_SYNC_TTY=m
+CONFIG_PPP_DEFLATE=m
+CONFIG_PPP_BSDCOMP=m
+CONFIG_PPP_MPPE=m
+CONFIG_PPPOE=m
+CONFIG_SLIP=m
+CONFIG_SLIP_COMPRESSED=y
+CONFIG_SLIP_SMART=y
+CONFIG_SLIP_MODE_SLIP6=y
+# CONFIG_NET_FC is not set
+# CONFIG_SHAPER is not set
+# CONFIG_NETCONSOLE is not set
+# CONFIG_NETPOLL is not set
+# CONFIG_NET_POLL_CONTROLLER is not set
+
+#
+# ISDN subsystem
+#
+# CONFIG_ISDN is not set
+
+#
+# Telephony Support
+#
+# CONFIG_PHONE is not set
+
+#
+# Input device support
+#
+CONFIG_INPUT=y
+
+#
+# Userland interfaces
+#
+CONFIG_INPUT_MOUSEDEV=y
+CONFIG_INPUT_MOUSEDEV_PSAUX=y
+CONFIG_INPUT_MOUSEDEV_SCREEN_X=1024
+CONFIG_INPUT_MOUSEDEV_SCREEN_Y=768
+# CONFIG_INPUT_JOYDEV is not set
+# CONFIG_INPUT_TSDEV is not set
+CONFIG_INPUT_EVDEV=m
+
+#
+# Input Device Drivers
+#
+CONFIG_INPUT_KEYBOARD=y
+CONFIG_KEYBOARD_ATKBD=y
+# CONFIG_KEYBOARD_SUNKBD is not set
+# CONFIG_KEYBOARD_LKKBD is not set
+# CONFIG_KEYBOARD_XTKBD is not set
+# CONFIG_KEYBOARD_NEWTON is not set
+CONFIG_INPUT_MOUSE=y
+CONFIG_MOUSE_PS2=y
+# CONFIG_MOUSE_SERIAL is not set
+# CONFIG_MOUSE_VSXXXAA is not set
+# CONFIG_INPUT_JOYSTICK is not set
+# CONFIG_INPUT_TOUCHSCREEN is not set
+# CONFIG_INPUT_MISC is not set
+
+#
+# Hardware I/O ports
+#
+CONFIG_SERIO=y
+# CONFIG_SERIO_I8042 is not set
+# CONFIG_SERIO_SERPORT is not set
+# CONFIG_SERIO_PARKBD is not set
+# CONFIG_SERIO_PCIPS2 is not set
+CONFIG_SERIO_LIBPS2=y
+# CONFIG_SERIO_RAW is not set
+# CONFIG_GAMEPORT is not set
+
+#
+# Character devices
+#
+CONFIG_VT=y
+CONFIG_VT_CONSOLE=y
+CONFIG_HW_CONSOLE=y
+# CONFIG_SERIAL_NONSTANDARD is not set
+CONFIG_SIBYTE_SB1250_DUART=y
+CONFIG_SIBYTE_SB1250_DUART_CONSOLE=y
+
+#
+# Serial drivers
+#
+# CONFIG_SERIAL_8250 is not set
+
+#
+# Non-8250 serial port support
+#
+# CONFIG_SERIAL_JSM is not set
+CONFIG_PRINTER=m
+# CONFIG_LP_CONSOLE is not set
+# CONFIG_PPDEV is not set
+# CONFIG_TIPAR is not set
+
+#
+# IPMI
+#
+# CONFIG_IPMI_HANDLER is not set
+
+#
+# Watchdog Cards
+#
+CONFIG_WATCHDOG=y
+# CONFIG_WATCHDOG_NOWAYOUT is not set
+
+#
+# Watchdog Device Drivers
+#
+# CONFIG_SOFT_WATCHDOG is not set
+
+#
+# PCI-based Watchdog Cards
+#
+# CONFIG_PCIPCWATCHDOG is not set
+# CONFIG_WDTPCI is not set
+
+#
+# USB-based Watchdog Cards
+#
+# CONFIG_USBPCWATCHDOG is not set
+CONFIG_RTC=m
+CONFIG_GEN_RTC=y
+CONFIG_GEN_RTC_X=y
+# CONFIG_DTLK is not set
+# CONFIG_R3964 is not set
+# CONFIG_APPLICOM is not set
+
+#
+# Ftape, the floppy tape device driver
+#
+# CONFIG_DRM is not set
+# CONFIG_RAW_DRIVER is not set
+
+#
+# TPM devices
+#
+# CONFIG_TCG_TPM is not set
+# CONFIG_TELCLOCK is not set
+
+#
+# I2C support
+#
+CONFIG_I2C=m
+CONFIG_I2C_CHARDEV=m
+
+#
+# I2C Algorithms
+#
+CONFIG_I2C_ALGOBIT=m
+# CONFIG_I2C_ALGOPCF is not set
+# CONFIG_I2C_ALGOPCA is not set
+CONFIG_I2C_ALGO_SIBYTE=m
+
+#
+# I2C Hardware Bus support
+#
+# CONFIG_I2C_ALI1535 is not set
+# CONFIG_I2C_ALI1563 is not set
+# CONFIG_I2C_ALI15X3 is not set
+# CONFIG_I2C_AMD756 is not set
+# CONFIG_I2C_AMD8111 is not set
+# CONFIG_I2C_I801 is not set
+# CONFIG_I2C_I810 is not set
+# CONFIG_I2C_PIIX4 is not set
+# CONFIG_I2C_NFORCE2 is not set
+# CONFIG_I2C_PARPORT is not set
+# CONFIG_I2C_PARPORT_LIGHT is not set
+# CONFIG_I2C_PROSAVAGE is not set
+# CONFIG_I2C_SAVAGE4 is not set
+CONFIG_I2C_SIBYTE=m
+# CONFIG_SCx200_ACB is not set
+# CONFIG_I2C_SIS5595 is not set
+# CONFIG_I2C_SIS630 is not set
+# CONFIG_I2C_SIS96X is not set
+CONFIG_I2C_STUB=m
+# CONFIG_I2C_VIA is not set
+# CONFIG_I2C_VIAPRO is not set
+# CONFIG_I2C_VOODOO3 is not set
+# CONFIG_I2C_PCA_ISA is not set
+
+#
+# Miscellaneous I2C Chip support
+#
+# CONFIG_SENSORS_DS1337 is not set
+# CONFIG_SENSORS_DS1374 is not set
+# CONFIG_SENSORS_EEPROM is not set
+# CONFIG_SENSORS_PCF8574 is not set
+# CONFIG_SENSORS_PCA9539 is not set
+# CONFIG_SENSORS_PCF8591 is not set
+# CONFIG_SENSORS_MAX6875 is not set
+# CONFIG_I2C_DEBUG_CORE is not set
+# CONFIG_I2C_DEBUG_ALGO is not set
+# CONFIG_I2C_DEBUG_BUS is not set
+# CONFIG_I2C_DEBUG_CHIP is not set
+
+#
+# SPI support
+#
+CONFIG_SPI=y
+CONFIG_SPI_MASTER=y
+
+#
+# SPI Master Controller Drivers
+#
+CONFIG_SPI_BITBANG=m
+CONFIG_SPI_BUTTERFLY=m
+
+#
+# SPI Protocol Masters
+#
+
+#
+# Dallas's 1-wire bus
+#
+# CONFIG_W1 is not set
+
+#
+# Hardware Monitoring support
+#
+CONFIG_HWMON=y
+CONFIG_HWMON_VID=m
+# CONFIG_SENSORS_ADM1021 is not set
+# CONFIG_SENSORS_ADM1025 is not set
+# CONFIG_SENSORS_ADM1026 is not set
+# CONFIG_SENSORS_ADM1031 is not set
+# CONFIG_SENSORS_ADM9240 is not set
+# CONFIG_SENSORS_ASB100 is not set
+# CONFIG_SENSORS_ATXP1 is not set
+# CONFIG_SENSORS_DS1621 is not set
+# CONFIG_SENSORS_F71805F is not set
+# CONFIG_SENSORS_FSCHER is not set
+# CONFIG_SENSORS_FSCPOS is not set
+# CONFIG_SENSORS_GL518SM is not set
+# CONFIG_SENSORS_GL520SM is not set
+# CONFIG_SENSORS_IT87 is not set
+# CONFIG_SENSORS_LM63 is not set
+# CONFIG_SENSORS_LM75 is not set
+# CONFIG_SENSORS_LM77 is not set
+# CONFIG_SENSORS_LM78 is not set
+# CONFIG_SENSORS_LM80 is not set
+# CONFIG_SENSORS_LM83 is not set
+# CONFIG_SENSORS_LM85 is not set
+# CONFIG_SENSORS_LM87 is not set
+# CONFIG_SENSORS_LM90 is not set
+# CONFIG_SENSORS_LM92 is not set
+# CONFIG_SENSORS_MAX1619 is not set
+# CONFIG_SENSORS_PC87360 is not set
+# CONFIG_SENSORS_SIS5595 is not set
+# CONFIG_SENSORS_SMSC47M1 is not set
+# CONFIG_SENSORS_SMSC47B397 is not set
+# CONFIG_SENSORS_VIA686A is not set
+CONFIG_SENSORS_VT8231=m
+# CONFIG_SENSORS_W83781D is not set
+# CONFIG_SENSORS_W83792D is not set
+# CONFIG_SENSORS_W83L785TS is not set
+# CONFIG_SENSORS_W83627HF is not set
+# CONFIG_SENSORS_W83627EHF is not set
+# CONFIG_HWMON_DEBUG_CHIP is not set
+
+#
+# Misc devices
+#
+
+#
+# Multimedia Capabilities Port drivers
+#
+
+#
+# Multimedia devices
+#
+CONFIG_VIDEO_DEV=m
+
+#
+# Video For Linux
+#
+
+#
+# Video Adapters
+#
+# CONFIG_VIDEO_ADV_DEBUG is not set
+# CONFIG_VIDEO_BT848 is not set
+# CONFIG_VIDEO_BWQCAM is not set
+# CONFIG_VIDEO_CQCAM is not set
+# CONFIG_VIDEO_W9966 is not set
+# CONFIG_VIDEO_CPIA is not set
+# CONFIG_VIDEO_SAA5246A is not set
+# CONFIG_VIDEO_SAA5249 is not set
+# CONFIG_TUNER_3036 is not set
+# CONFIG_VIDEO_STRADIS is not set
+# CONFIG_VIDEO_ZORAN is not set
+# CONFIG_VIDEO_SAA7134 is not set
+# CONFIG_VIDEO_MXB is not set
+# CONFIG_VIDEO_DPC is not set
+# CONFIG_VIDEO_HEXIUM_ORION is not set
+# CONFIG_VIDEO_HEXIUM_GEMINI is not set
+# CONFIG_VIDEO_CX88 is not set
+# CONFIG_VIDEO_EM28XX is not set
+# CONFIG_VIDEO_OVCAMCHIP is not set
+# CONFIG_VIDEO_AUDIO_DECODER is not set
+# CONFIG_VIDEO_DECODER is not set
+
+#
+# Radio Adapters
+#
+# CONFIG_RADIO_GEMTEK_PCI is not set
+# CONFIG_RADIO_MAXIRADIO is not set
+# CONFIG_RADIO_MAESTRO is not set
+
+#
+# Digital Video Broadcasting Devices
+#
+# CONFIG_DVB is not set
+
+#
+# Graphics support
+#
+CONFIG_FB=y
+CONFIG_FB_CFB_FILLRECT=m
+CONFIG_FB_CFB_COPYAREA=m
+CONFIG_FB_CFB_IMAGEBLIT=m
+# CONFIG_FB_MACMODES is not set
+CONFIG_FB_MODE_HELPERS=y
+CONFIG_FB_TILEBLITTING=y
+# CONFIG_FB_CIRRUS is not set
+CONFIG_FB_PM2=m
+# CONFIG_FB_PM2_FIFO_DISCONNECT is not set
+CONFIG_FB_CYBER2000=m
+# CONFIG_FB_ASILIANT is not set
+# CONFIG_FB_IMSTT is not set
+# CONFIG_FB_S1D13XXX is not set
+CONFIG_FB_NVIDIA=m
+# CONFIG_FB_NVIDIA_I2C is not set
+CONFIG_FB_RIVA=m
+# CONFIG_FB_RIVA_I2C is not set
+# CONFIG_FB_RIVA_DEBUG is not set
+CONFIG_FB_MATROX=m
+CONFIG_FB_MATROX_MILLENIUM=y
+CONFIG_FB_MATROX_MYSTIQUE=y
+CONFIG_FB_MATROX_G=y
+# CONFIG_FB_MATROX_I2C is not set
+# CONFIG_FB_MATROX_MULTIHEAD is not set
+CONFIG_FB_RADEON=m
+CONFIG_FB_RADEON_I2C=y
+# CONFIG_FB_RADEON_DEBUG is not set
+CONFIG_FB_ATY128=m
+CONFIG_FB_ATY=m
+# CONFIG_FB_ATY_CT is not set
+# CONFIG_FB_ATY_GX is not set
+CONFIG_FB_SAVAGE=m
+# CONFIG_FB_SAVAGE_I2C is not set
+# CONFIG_FB_SAVAGE_ACCEL is not set
+CONFIG_FB_SIS=m
+CONFIG_FB_SIS_300=y
+CONFIG_FB_SIS_315=y
+CONFIG_FB_NEOMAGIC=m
+CONFIG_FB_KYRO=m
+CONFIG_FB_3DFX=m
+# CONFIG_FB_3DFX_ACCEL is not set
+CONFIG_FB_VOODOO1=m
+CONFIG_FB_TRIDENT=m
+# CONFIG_FB_TRIDENT_ACCEL is not set
+# CONFIG_FB_VIRTUAL is not set
+
+#
+# Console display driver support
+#
+# CONFIG_VGA_CONSOLE is not set
+CONFIG_DUMMY_CONSOLE=y
+CONFIG_FRAMEBUFFER_CONSOLE=y
+# CONFIG_FRAMEBUFFER_CONSOLE_ROTATION is not set
+# CONFIG_FONTS is not set
+CONFIG_FONT_8x8=y
+CONFIG_FONT_8x16=y
+
+#
+# Logo configuration
+#
+CONFIG_LOGO=y
+# CONFIG_LOGO_LINUX_MONO is not set
+# CONFIG_LOGO_LINUX_VGA16 is not set
+# CONFIG_LOGO_LINUX_CLUT224 is not set
+
+#
+# Sound
+#
+CONFIG_SOUND=y
+
+#
+# Advanced Linux Sound Architecture
+#
+CONFIG_SND=m
+CONFIG_SND_TIMER=m
+CONFIG_SND_PCM=m
+CONFIG_SND_HWDEP=m
+CONFIG_SND_RAWMIDI=m
+# CONFIG_SND_SEQUENCER is not set
+CONFIG_SND_OSSEMUL=y
+CONFIG_SND_MIXER_OSS=m
+CONFIG_SND_PCM_OSS=m
+CONFIG_SND_RTCTIMER=m
+# CONFIG_SND_DYNAMIC_MINORS is not set
+CONFIG_SND_SUPPORT_OLD_API=y
+# CONFIG_SND_VERBOSE_PRINTK is not set
+# CONFIG_SND_DEBUG is not set
+
+#
+# Generic devices
+#
+CONFIG_SND_MPU401_UART=m
+CONFIG_SND_OPL3_LIB=m
+CONFIG_SND_VX_LIB=m
+CONFIG_SND_AC97_CODEC=m
+CONFIG_SND_AC97_BUS=m
+# CONFIG_SND_DUMMY is not set
+# CONFIG_SND_MTPAV is not set
+# CONFIG_SND_SERIAL_U16550 is not set
+# CONFIG_SND_MPU401 is not set
+
+#
+# PCI devices
+#
+CONFIG_SND_AD1889=m
+CONFIG_SND_ALI5451=m
+CONFIG_SND_ATIIXP=m
+CONFIG_SND_ATIIXP_MODEM=m
+CONFIG_SND_AU8810=m
+CONFIG_SND_AU8820=m
+CONFIG_SND_AU8830=m
+CONFIG_SND_AZT3328=m
+CONFIG_SND_BT87X=m
+CONFIG_SND_BT87X_OVERCLOCK=y
+CONFIG_SND_CA0106=m
+CONFIG_SND_CMIPCI=m
+CONFIG_SND_CS4281=m
+CONFIG_SND_CS46XX=m
+CONFIG_SND_CS46XX_NEW_DSP=y
+CONFIG_SND_EMU10K1=m
+CONFIG_SND_EMU10K1X=m
+CONFIG_SND_ENS1370=m
+CONFIG_SND_ENS1371=m
+CONFIG_SND_ES1938=m
+CONFIG_SND_ES1968=m
+CONFIG_SND_FM801=m
+CONFIG_SND_FM801_TEA575X_BOOL=y
+CONFIG_SND_FM801_TEA575X=m
+CONFIG_SND_HDA_INTEL=m
+CONFIG_SND_HDSP=m
+CONFIG_SND_HDSPM=m
+CONFIG_SND_ICE1712=m
+CONFIG_SND_ICE1724=m
+CONFIG_SND_INTEL8X0=m
+CONFIG_SND_INTEL8X0M=m
+CONFIG_SND_KORG1212=m
+CONFIG_SND_MAESTRO3=m
+CONFIG_SND_MIXART=m
+CONFIG_SND_NM256=m
+CONFIG_SND_PCXHR=m
+CONFIG_SND_RME32=m
+CONFIG_SND_RME96=m
+CONFIG_SND_RME9652=m
+CONFIG_SND_SONICVIBES=m
+CONFIG_SND_TRIDENT=m
+CONFIG_SND_VIA82XX=m
+CONFIG_SND_VIA82XX_MODEM=m
+CONFIG_SND_VX222=m
+CONFIG_SND_YMFPCI=m
+
+#
+# ALSA MIPS devices
+#
+
+#
+# USB devices
+#
+# CONFIG_SND_USB_AUDIO is not set
+
+#
+# Open Sound System
+#
+CONFIG_SOUND_PRIME=y
+# CONFIG_OBSOLETE_OSS_DRIVER is not set
+# CONFIG_SOUND_FUSION is not set
+# CONFIG_SOUND_BCM_CS4297A is not set
+# CONFIG_SOUND_TRIDENT is not set
+# CONFIG_SOUND_MSNDCLAS is not set
+# CONFIG_SOUND_MSNDPIN is not set
+
+#
+# USB support
+#
+CONFIG_USB_ARCH_HAS_HCD=y
+CONFIG_USB_ARCH_HAS_OHCI=y
+CONFIG_USB=m
+# CONFIG_USB_DEBUG is not set
+
+#
+# Miscellaneous USB options
+#
+CONFIG_USB_DEVICEFS=y
+# CONFIG_USB_DYNAMIC_MINORS is not set
+# CONFIG_USB_OTG is not set
+
+#
+# USB Host Controller Drivers
+#
+CONFIG_USB_EHCI_HCD=m
+# CONFIG_USB_EHCI_SPLIT_ISO is not set
+# CONFIG_USB_EHCI_ROOT_HUB_TT is not set
+CONFIG_USB_ISP116X_HCD=m
+CONFIG_USB_OHCI_HCD=m
+CONFIG_USB_OHCI_LITTLE_ENDIAN=y
+CONFIG_USB_UHCI_HCD=m
+CONFIG_USB_SL811_HCD=m
+
+#
+# USB Device Class drivers
+#
+# CONFIG_OBSOLETE_OSS_USB_DRIVER is not set
+# CONFIG_USB_PRINTER is not set
+
+#
+# NOTE: USB_STORAGE enables SCSI, and 'SCSI disk support'
+#
+
+#
+# may also be needed; see USB_STORAGE Help for more information
+#
+CONFIG_USB_STORAGE=m
+# CONFIG_USB_STORAGE_DEBUG is not set
+# CONFIG_USB_STORAGE_DATAFAB is not set
+# CONFIG_USB_STORAGE_FREECOM is not set
+# CONFIG_USB_STORAGE_ISD200 is not set
+# CONFIG_USB_STORAGE_DPCM is not set
+# CONFIG_USB_STORAGE_USBAT is not set
+# CONFIG_USB_STORAGE_SDDR09 is not set
+# CONFIG_USB_STORAGE_SDDR55 is not set
+# CONFIG_USB_STORAGE_JUMPSHOT is not set
+CONFIG_USB_STORAGE_ALAUDA=y
+# CONFIG_USB_LIBUSUAL is not set
+
+#
+# USB Input Devices
+#
+CONFIG_USB_HID=m
+# CONFIG_USB_HIDINPUT_POWERBOOK is not set
+# CONFIG_HID_FF is not set
+CONFIG_USB_HIDDEV=y
+
+#
+# USB HID Boot Protocol drivers
+#
+# CONFIG_USB_KBD is not set
+# CONFIG_USB_MOUSE is not set
+
+#
+# USB Imaging devices
+#
+# CONFIG_USB_MDC800 is not set
+# CONFIG_USB_MICROTEK is not set
+
+#
+# USB Multimedia devices
+#
+# CONFIG_USB_VICAM is not set
+# CONFIG_USB_DSBR is not set
+CONFIG_USB_ET61X251=m
+# CONFIG_USB_IBMCAM is not set
+# CONFIG_USB_KONICAWC is not set
+# CONFIG_USB_OV511 is not set
+# CONFIG_USB_SE401 is not set
+# CONFIG_USB_SN9C102 is not set
+# CONFIG_USB_STV680 is not set
+# CONFIG_USB_PWC is not set
+
+#
+# USB Network Adapters
+#
+# CONFIG_USB_CATC is not set
+# CONFIG_USB_KAWETH is not set
+# CONFIG_USB_PEGASUS is not set
+# CONFIG_USB_RTL8150 is not set
+# CONFIG_USB_USBNET is not set
+CONFIG_USB_MON=y
+
+#
+# USB port drivers
+#
+# CONFIG_USB_USS720 is not set
+
+#
+# USB Miscellaneous drivers
+#
+# CONFIG_USB_AUERSWALD is not set
+# CONFIG_USB_RIO500 is not set
+# CONFIG_USB_LEGOTOWER is not set
+# CONFIG_USB_LCD is not set
+# CONFIG_USB_LED is not set
+# CONFIG_USB_CYTHERM is not set
+# CONFIG_USB_PHIDGETKIT is not set
+# CONFIG_USB_PHIDGETSERVO is not set
+# CONFIG_USB_IDMOUSE is not set
+CONFIG_USB_SISUSBVGA=m
+# CONFIG_USB_SISUSBVGA_CON is not set
+# CONFIG_USB_LD is not set
+# CONFIG_USB_TEST is not set
+
+#
+# USB DSL modem support
+#
+
+#
+# USB Gadget Support
+#
+# CONFIG_USB_GADGET is not set
+
+#
+# MMC/SD Card support
+#
+# CONFIG_MMC is not set
+
+#
+# InfiniBand support
+#
+# CONFIG_INFINIBAND is not set
+
+#
+# SN Devices
+#
+
+#
+# EDAC - error detection and reporting (RAS)
+#
+
+#
+# File systems
+#
+CONFIG_EXT2_FS=y
+CONFIG_EXT2_FS_XATTR=y
+CONFIG_EXT2_FS_POSIX_ACL=y
+CONFIG_EXT2_FS_SECURITY=y
+# CONFIG_EXT2_FS_XIP is not set
+CONFIG_EXT3_FS=y
+CONFIG_EXT3_FS_XATTR=y
+CONFIG_EXT3_FS_POSIX_ACL=y
+CONFIG_EXT3_FS_SECURITY=y
+CONFIG_JBD=y
+# CONFIG_JBD_DEBUG is not set
+CONFIG_FS_MBCACHE=y
+CONFIG_REISERFS_FS=m
+# CONFIG_REISERFS_CHECK is not set
+# CONFIG_REISERFS_PROC_INFO is not set
+CONFIG_REISERFS_FS_XATTR=y
+CONFIG_REISERFS_FS_POSIX_ACL=y
+# CONFIG_REISERFS_FS_SECURITY is not set
+CONFIG_JFS_FS=m
+CONFIG_JFS_POSIX_ACL=y
+# CONFIG_JFS_SECURITY is not set
+# CONFIG_JFS_DEBUG is not set
+# CONFIG_JFS_STATISTICS is not set
+CONFIG_FS_POSIX_ACL=y
+CONFIG_XFS_FS=m
+CONFIG_XFS_EXPORT=y
+# CONFIG_XFS_QUOTA is not set
+# CONFIG_XFS_SECURITY is not set
+CONFIG_XFS_POSIX_ACL=y
+CONFIG_XFS_RT=y
+CONFIG_OCFS2_FS=m
+# CONFIG_MINIX_FS is not set
+# CONFIG_ROMFS_FS is not set
+CONFIG_INOTIFY=y
+CONFIG_QUOTA=y
+CONFIG_QFMT_V1=m
+CONFIG_QFMT_V2=m
+CONFIG_QUOTACTL=y
+CONFIG_DNOTIFY=y
+CONFIG_AUTOFS_FS=m
+CONFIG_AUTOFS4_FS=m
+CONFIG_FUSE_FS=m
+
+#
+# CD-ROM/DVD Filesystems
+#
+CONFIG_ISO9660_FS=y
+CONFIG_JOLIET=y
+CONFIG_ZISOFS=y
+CONFIG_UDF_FS=y
+CONFIG_UDF_NLS=y
+
+#
+# DOS/FAT/NT Filesystems
+#
+CONFIG_FAT_FS=m
+CONFIG_MSDOS_FS=m
+CONFIG_VFAT_FS=m
+CONFIG_FAT_DEFAULT_CODEPAGE=437
+CONFIG_FAT_DEFAULT_IOCHARSET="iso8859-1"
+CONFIG_NTFS_FS=m
+# CONFIG_NTFS_DEBUG is not set
+CONFIG_NTFS_RW=y
+
+#
+# Pseudo filesystems
+#
+CONFIG_PROC_FS=y
+CONFIG_PROC_KCORE=y
+CONFIG_SYSFS=y
+CONFIG_TMPFS=y
+CONFIG_RAMFS=y
+# CONFIG_RELAYFS_FS is not set
+CONFIG_CONFIGFS_FS=m
+
+#
+# Miscellaneous filesystems
+#
+# CONFIG_ADFS_FS is not set
+# CONFIG_AFFS_FS is not set
+# CONFIG_ASFS_FS is not set
+# CONFIG_HFS_FS is not set
+# CONFIG_HFSPLUS_FS is not set
+# CONFIG_BEFS_FS is not set
+# CONFIG_BFS_FS is not set
+CONFIG_EFS_FS=m
+CONFIG_CRAMFS=y
+# CONFIG_VXFS_FS is not set
+# CONFIG_HPFS_FS is not set
+# CONFIG_QNX4FS_FS is not set
+# CONFIG_SYSV_FS is not set
+# CONFIG_UFS_FS is not set
+
+#
+# Network File Systems
+#
+CONFIG_NFS_FS=y
+# CONFIG_NFS_V3_ACL is not set
+# CONFIG_NFS_V4 is not set
+# CONFIG_NFS_DIRECTIO is not set
+CONFIG_NFSD=y
+# CONFIG_NFSD_V3_ACL is not set
+# CONFIG_NFSD_V4 is not set
+CONFIG_ROOT_NFS=y
+CONFIG_LOCKD=y
+CONFIG_LOCKD_V4=y
+CONFIG_EXPORTFS=y
+CONFIG_SUNRPC=y
+# CONFIG_RPCSEC_GSS_KRB5 is not set
+# CONFIG_RPCSEC_GSS_SPKM3 is not set
+CONFIG_SMB_FS=m
+CONFIG_SMB_NLS_DEFAULT=y
+CONFIG_SMB_NLS_REMOTE="cp437"
+CONFIG_CIFS=m
+# CONFIG_CIFS_STATS is not set
+CONFIG_CIFS_XATTR=y
+CONFIG_CIFS_POSIX=y
+# CONFIG_CIFS_EXPERIMENTAL is not set
+# CONFIG_NCP_FS is not set
+# CONFIG_CODA_FS is not set
+# CONFIG_AFS_FS is not set
+# CONFIG_9P_FS is not set
+
+#
+# Partition Types
+#
+CONFIG_PARTITION_ADVANCED=y
+# CONFIG_ACORN_PARTITION is not set
+# CONFIG_OSF_PARTITION is not set
+# CONFIG_AMIGA_PARTITION is not set
+# CONFIG_ATARI_PARTITION is not set
+# CONFIG_MAC_PARTITION is not set
+CONFIG_MSDOS_PARTITION=y
+# CONFIG_BSD_DISKLABEL is not set
+# CONFIG_MINIX_SUBPARTITION is not set
+# CONFIG_SOLARIS_X86_PARTITION is not set
+# CONFIG_UNIXWARE_DISKLABEL is not set
+# CONFIG_LDM_PARTITION is not set
+CONFIG_SGI_PARTITION=y
+# CONFIG_ULTRIX_PARTITION is not set
+# CONFIG_SUN_PARTITION is not set
+CONFIG_KARMA_PARTITION=y
+# CONFIG_EFI_PARTITION is not set
+
+#
+# Native Language Support
+#
+CONFIG_NLS=y
+CONFIG_NLS_DEFAULT="iso8859-1"
+CONFIG_NLS_CODEPAGE_437=m
+CONFIG_NLS_CODEPAGE_737=m
+CONFIG_NLS_CODEPAGE_775=m
+CONFIG_NLS_CODEPAGE_850=m
+CONFIG_NLS_CODEPAGE_852=m
+CONFIG_NLS_CODEPAGE_855=m
+CONFIG_NLS_CODEPAGE_857=m
+CONFIG_NLS_CODEPAGE_860=m
+CONFIG_NLS_CODEPAGE_861=m
+CONFIG_NLS_CODEPAGE_862=m
+CONFIG_NLS_CODEPAGE_863=m
+CONFIG_NLS_CODEPAGE_864=m
+CONFIG_NLS_CODEPAGE_865=m
+CONFIG_NLS_CODEPAGE_866=m
+CONFIG_NLS_CODEPAGE_869=m
+CONFIG_NLS_CODEPAGE_936=m
+CONFIG_NLS_CODEPAGE_950=m
+CONFIG_NLS_CODEPAGE_932=m
+CONFIG_NLS_CODEPAGE_949=m
+CONFIG_NLS_CODEPAGE_874=m
+CONFIG_NLS_ISO8859_8=m
+CONFIG_NLS_CODEPAGE_1250=m
+CONFIG_NLS_CODEPAGE_1251=m
+CONFIG_NLS_ASCII=m
+CONFIG_NLS_ISO8859_1=m
+CONFIG_NLS_ISO8859_2=m
+CONFIG_NLS_ISO8859_3=m
+CONFIG_NLS_ISO8859_4=m
+CONFIG_NLS_ISO8859_5=m
+CONFIG_NLS_ISO8859_6=m
+CONFIG_NLS_ISO8859_7=m
+CONFIG_NLS_ISO8859_9=m
+CONFIG_NLS_ISO8859_13=m
+CONFIG_NLS_ISO8859_14=m
+CONFIG_NLS_ISO8859_15=m
+CONFIG_NLS_KOI8_R=m
+CONFIG_NLS_KOI8_U=m
+CONFIG_NLS_UTF8=m
+
+#
+# Profiling support
+#
+CONFIG_PROFILING=y
+# CONFIG_OPROFILE is not set
+
+#
+# Kernel hacking
+#
+# CONFIG_PRINTK_TIME is not set
+CONFIG_MAGIC_SYSRQ=y
+# CONFIG_DEBUG_KERNEL is not set
+CONFIG_LOG_BUF_SHIFT=15
+# CONFIG_CROSSCOMPILE is not set
+CONFIG_CMDLINE=""
+# CONFIG_SB1XXX_CORELIS is not set
+
+#
+# Security options
+#
+CONFIG_KEYS=y
+# CONFIG_KEYS_DEBUG_PROC_KEYS is not set
+CONFIG_SECURITY=y
+CONFIG_SECURITY_NETWORK=y
+CONFIG_SECURITY_NETWORK_XFRM=y
+CONFIG_SECURITY_CAPABILITIES=y
+CONFIG_SECURITY_SELINUX=y
+CONFIG_SECURITY_SELINUX_BOOTPARAM=y
+CONFIG_SECURITY_SELINUX_BOOTPARAM_VALUE=0
+CONFIG_SECURITY_SELINUX_DISABLE=y
+CONFIG_SECURITY_SELINUX_DEVELOP=y
+CONFIG_SECURITY_SELINUX_AVC_STATS=y
+CONFIG_SECURITY_SELINUX_CHECKREQPROT_VALUE=1
+
+#
+# Cryptographic options
+#
+CONFIG_CRYPTO=y
+CONFIG_CRYPTO_HMAC=y
+CONFIG_CRYPTO_NULL=m
+CONFIG_CRYPTO_MD4=m
+CONFIG_CRYPTO_MD5=y
+CONFIG_CRYPTO_SHA1=m
+CONFIG_CRYPTO_SHA256=m
+CONFIG_CRYPTO_SHA512=m
+CONFIG_CRYPTO_WP512=m
+CONFIG_CRYPTO_TGR192=m
+CONFIG_CRYPTO_DES=m
+CONFIG_CRYPTO_BLOWFISH=m
+CONFIG_CRYPTO_TWOFISH=m
+CONFIG_CRYPTO_SERPENT=m
+CONFIG_CRYPTO_AES=m
+CONFIG_CRYPTO_CAST5=m
+CONFIG_CRYPTO_CAST6=m
+CONFIG_CRYPTO_TEA=m
+CONFIG_CRYPTO_ARC4=m
+CONFIG_CRYPTO_KHAZAD=m
+CONFIG_CRYPTO_ANUBIS=m
+CONFIG_CRYPTO_DEFLATE=m
+CONFIG_CRYPTO_MICHAEL_MIC=m
+CONFIG_CRYPTO_CRC32C=m
+CONFIG_CRYPTO_TEST=m
+
+#
+# Hardware crypto devices
+#
+
+#
+# Library routines
+#
+CONFIG_CRC_CCITT=m
+# CONFIG_CRC16 is not set
+CONFIG_CRC32=y
+CONFIG_LIBCRC32C=m
+CONFIG_ZLIB_INFLATE=y
+CONFIG_ZLIB_DEFLATE=m
+CONFIG_TEXTSEARCH=y
+CONFIG_TEXTSEARCH_KMP=m
+CONFIG_TEXTSEARCH_BM=m
+CONFIG_TEXTSEARCH_FSM=m
+CONFIG_MSNDPIN_INIT_FILE="/etc/sound/pndspini.bin"
+CONFIG_USB_NET2280=m
+CONFIG_USB_ALI_M5632=y
+CONFIG_MSNDPIN_PERM_FILE="/etc/sound/pndsperm.bin"
+CONFIG_USB_FILE_STORAGE=m
+CONFIG_SND_SEQUENCER_OSS=y
+CONFIG_SOUND_EMU10K1=m
+CONFIG_USB_EPSON2888=y
+CONFIG_SND_VIRMIDI=m
+CONFIG_USB_AN2720=y
+# CONFIG_USB_GADGET_PXA2XX is not set
+CONFIG_USB_GADGET_DUALSPEED=y
+# CONFIG_USB_GADGET_OMAP is not set
+CONFIG_USB_GADGET_NET2280=y
+CONFIG_USB_ETH_RNDIS=y
+# CONFIG_USB_GADGET_DEBUG_FILES is not set
+CONFIG_VIDEO_BUF=m
+CONFIG_USB_FILE_STORAGE_TEST=y
+CONFIG_MSNDCLAS_INIT_FILE="/etc/sound/msndinit.bin"
+CONFIG_MSNDCLAS_PERM_FILE="/etc/sound/msndperm.bin"
+# CONFIG_USB_GADGET_DUMMY_HCD is not set
+CONFIG_USB_GADGETFS=m
+CONFIG_USB_ETH=m
+CONFIG_USB_ARMLINUX=y
+# CONFIG_USB_W9968CF is not set
+# CONFIG_USB_GADGET_GOKU is not set
+# CONFIG_USB_GADGET_LH7A40X is not set
+CONFIG_USB_G_SERIAL=m
+CONFIG_USB_BELKIN=y
+CONFIG_USB_ZERO=m
+CONFIG_SND_SEQ_DUMMY=m
+CONFIG_USB_STORAGE_ONETOUCH=y
+CONFIG_USB_ACM=m

Added: dists/sid/linux-2.6/debian/config/mips/config.sb1a-bcm91480b
==============================================================================
--- (empty file)
+++ dists/sid/linux-2.6/debian/config/mips/config.sb1a-bcm91480b	Mon Nov 26 20:06:56 2007
@@ -0,0 +1,1687 @@
+#
+# Machine selection
+#
+# CONFIG_MIPS_MTX1 is not set
+# CONFIG_MIPS_BOSPORUS is not set
+# CONFIG_MIPS_PB1000 is not set
+# CONFIG_MIPS_PB1100 is not set
+# CONFIG_MIPS_PB1500 is not set
+# CONFIG_MIPS_PB1550 is not set
+# CONFIG_MIPS_PB1200 is not set
+# CONFIG_MIPS_DB1000 is not set
+# CONFIG_MIPS_DB1100 is not set
+# CONFIG_MIPS_DB1500 is not set
+# CONFIG_MIPS_DB1550 is not set
+# CONFIG_MIPS_DB1200 is not set
+# CONFIG_MIPS_MIRAGE is not set
+# CONFIG_MIPS_COBALT is not set
+# CONFIG_MACH_DECSTATION is not set
+# CONFIG_MIPS_EV64120 is not set
+# CONFIG_MIPS_EV96100 is not set
+# CONFIG_MIPS_IVR is not set
+# CONFIG_MIPS_ITE8172 is not set
+# CONFIG_MACH_JAZZ is not set
+# CONFIG_LASAT is not set
+# CONFIG_MIPS_ATLAS is not set
+# CONFIG_MIPS_MALTA is not set
+# CONFIG_MIPS_SEAD is not set
+# CONFIG_MIPS_SIM is not set
+# CONFIG_MOMENCO_JAGUAR_ATX is not set
+# CONFIG_MOMENCO_OCELOT is not set
+# CONFIG_MOMENCO_OCELOT_3 is not set
+# CONFIG_MOMENCO_OCELOT_C is not set
+# CONFIG_MOMENCO_OCELOT_G is not set
+# CONFIG_MIPS_XXS1500 is not set
+# CONFIG_PNX8550_V2PCI is not set
+# CONFIG_PNX8550_JBS is not set
+# CONFIG_DDB5074 is not set
+# CONFIG_DDB5476 is not set
+# CONFIG_DDB5477 is not set
+# CONFIG_MACH_VR41XX is not set
+# CONFIG_PMC_YOSEMITE is not set
+# CONFIG_QEMU is not set
+# CONFIG_SGI_IP22 is not set
+# CONFIG_SGI_IP27 is not set
+# CONFIG_SGI_IP32 is not set
+CONFIG_SIBYTE_BIGSUR=y
+# CONFIG_SIBYTE_SWARM is not set
+# CONFIG_SIBYTE_SENTOSA is not set
+# CONFIG_SIBYTE_RHONE is not set
+# CONFIG_SIBYTE_CARMEL is not set
+# CONFIG_SIBYTE_PTSWARM is not set
+# CONFIG_SIBYTE_LITTLESUR is not set
+# CONFIG_SIBYTE_CRHINE is not set
+# CONFIG_SIBYTE_CRHONE is not set
+# CONFIG_SNI_RM200_PCI is not set
+# CONFIG_TOSHIBA_JMR3927 is not set
+# CONFIG_TOSHIBA_RBTX4927 is not set
+# CONFIG_TOSHIBA_RBTX4938 is not set
+CONFIG_SIBYTE_BCM1x80=y
+CONFIG_SIBYTE_SB1xxx_SOC=y
+# CONFIG_CPU_SB1_PASS_1 is not set
+# CONFIG_CPU_SB1_PASS_2_1250 is not set
+# CONFIG_CPU_SB1_PASS_2_2 is not set
+# CONFIG_CPU_SB1_PASS_4 is not set
+# CONFIG_CPU_SB1_PASS_2_112x is not set
+# CONFIG_CPU_SB1_PASS_3 is not set
+# CONFIG_SIMULATION is not set
+# CONFIG_SB1_CEX_ALWAYS_FATAL is not set
+# CONFIG_SB1_CERR_STALL is not set
+CONFIG_SIBYTE_CFE=y
+# CONFIG_SIBYTE_CFE_CONSOLE is not set
+# CONFIG_SIBYTE_BUS_WATCHER is not set
+# CONFIG_SIBYTE_SB1250_PROF is not set
+# CONFIG_SIBYTE_TBPROF is not set
+CONFIG_RWSEM_GENERIC_SPINLOCK=y
+CONFIG_GENERIC_CALIBRATE_DELAY=y
+CONFIG_DMA_COHERENT=y
+CONFIG_CPU_BIG_ENDIAN=y
+# CONFIG_CPU_LITTLE_ENDIAN is not set
+CONFIG_SYS_SUPPORTS_BIG_ENDIAN=y
+CONFIG_SYS_SUPPORTS_LITTLE_ENDIAN=y
+CONFIG_SWAP_IO_SPACE=y
+CONFIG_BOOT_ELF32=y
+CONFIG_MIPS_L1_CACHE_SHIFT=5
+
+#
+# CPU selection
+#
+# CONFIG_CPU_MIPS32_R1 is not set
+# CONFIG_CPU_MIPS32_R2 is not set
+# CONFIG_CPU_MIPS64_R1 is not set
+# CONFIG_CPU_MIPS64_R2 is not set
+# CONFIG_CPU_R3000 is not set
+# CONFIG_CPU_TX39XX is not set
+# CONFIG_CPU_VR41XX is not set
+# CONFIG_CPU_R4300 is not set
+# CONFIG_CPU_R4X00 is not set
+# CONFIG_CPU_TX49XX is not set
+# CONFIG_CPU_R5000 is not set
+# CONFIG_CPU_R5432 is not set
+# CONFIG_CPU_R6000 is not set
+# CONFIG_CPU_NEVADA is not set
+# CONFIG_CPU_R8000 is not set
+# CONFIG_CPU_R10000 is not set
+# CONFIG_CPU_RM7000 is not set
+# CONFIG_CPU_RM9000 is not set
+CONFIG_CPU_SB1=y
+CONFIG_SYS_HAS_CPU_SB1=y
+CONFIG_SYS_SUPPORTS_32BIT_KERNEL=y
+CONFIG_SYS_SUPPORTS_64BIT_KERNEL=y
+CONFIG_CPU_SUPPORTS_32BIT_KERNEL=y
+CONFIG_CPU_SUPPORTS_64BIT_KERNEL=y
+
+#
+# Kernel type
+#
+# CONFIG_32BIT is not set
+CONFIG_64BIT=y
+CONFIG_PAGE_SIZE_4KB=y
+# CONFIG_PAGE_SIZE_8KB is not set
+# CONFIG_PAGE_SIZE_16KB is not set
+# CONFIG_PAGE_SIZE_64KB is not set
+# CONFIG_SIBYTE_DMA_PAGEOPS is not set
+# CONFIG_MIPS_MT is not set
+CONFIG_CPU_HAS_LLSC=y
+CONFIG_CPU_HAS_SYNC=y
+CONFIG_GENERIC_HARDIRQS=y
+CONFIG_GENERIC_IRQ_PROBE=y
+CONFIG_CPU_SUPPORTS_HIGHMEM=y
+CONFIG_ARCH_FLATMEM_ENABLE=y
+CONFIG_SELECT_MEMORY_MODEL=y
+CONFIG_FLATMEM_MANUAL=y
+# CONFIG_DISCONTIGMEM_MANUAL is not set
+# CONFIG_SPARSEMEM_MANUAL is not set
+CONFIG_FLATMEM=y
+CONFIG_FLAT_NODE_MEM_MAP=y
+# CONFIG_SPARSEMEM_STATIC is not set
+CONFIG_SPLIT_PTLOCK_CPUS=4
+CONFIG_SMP=y
+CONFIG_NR_CPUS=4
+CONFIG_PREEMPT_NONE=y
+# CONFIG_PREEMPT_VOLUNTARY is not set
+# CONFIG_PREEMPT is not set
+CONFIG_PREEMPT_BKL=y
+
+#
+# Code maturity level options
+#
+CONFIG_EXPERIMENTAL=y
+CONFIG_LOCK_KERNEL=y
+
+#
+# General setup
+#
+CONFIG_LOCALVERSION=""
+CONFIG_LOCALVERSION_AUTO=y
+CONFIG_SWAP=y
+CONFIG_SYSVIPC=y
+CONFIG_POSIX_MQUEUE=y
+CONFIG_BSD_PROCESS_ACCT=y
+# CONFIG_BSD_PROCESS_ACCT_V3 is not set
+CONFIG_AUDIT=y
+# CONFIG_IKCONFIG is not set
+CONFIG_INITRAMFS_SOURCE=""
+# CONFIG_CC_OPTIMIZE_FOR_SIZE is not set
+CONFIG_EMBEDDED=y
+CONFIG_HOTPLUG=y
+CONFIG_BASE_FULL=y
+CONFIG_CC_ALIGN_FUNCTIONS=0
+CONFIG_CC_ALIGN_LABELS=0
+CONFIG_CC_ALIGN_LOOPS=0
+CONFIG_CC_ALIGN_JUMPS=0
+CONFIG_SLAB=y
+CONFIG_BASE_SMALL=0
+# CONFIG_SLOB is not set
+
+#
+# Loadable module support
+#
+CONFIG_MODULES=y
+CONFIG_OBSOLETE_MODPARM=y
+CONFIG_KMOD=y
+CONFIG_STOP_MACHINE=y
+
+#
+# Block layer
+#
+
+#
+# Bus options (PCI, PCMCIA, EISA, ISA, TC)
+#
+CONFIG_HW_HAS_PCI=y
+CONFIG_PCI=y
+CONFIG_PCI_DOMAINS=y
+CONFIG_MMU=y
+
+#
+# PCCARD (PCMCIA/CardBus) support
+#
+# CONFIG_PCCARD is not set
+
+#
+# PCI Hotplug Support
+#
+# CONFIG_HOTPLUG_PCI is not set
+
+#
+# Executable file formats
+#
+CONFIG_BINFMT_ELF=y
+CONFIG_BINFMT_MISC=m
+CONFIG_BUILD_ELF64=y
+CONFIG_MIPS32_COMPAT=y
+CONFIG_COMPAT=y
+CONFIG_MIPS32_O32=y
+CONFIG_MIPS32_N32=y
+CONFIG_BINFMT_ELF32=y
+
+#
+# Networking
+#
+CONFIG_NET=y
+
+#
+# Networking options
+#
+CONFIG_PACKET=y
+CONFIG_PACKET_MMAP=y
+CONFIG_UNIX=y
+CONFIG_XFRM=y
+CONFIG_XFRM_USER=y
+CONFIG_NET_KEY=y
+CONFIG_INET=y
+CONFIG_IP_MULTICAST=y
+# CONFIG_IP_ADVANCED_ROUTER is not set
+CONFIG_IP_FIB_HASH=y
+CONFIG_IP_PNP=y
+CONFIG_IP_PNP_DHCP=y
+CONFIG_IP_PNP_BOOTP=y
+# CONFIG_IP_PNP_RARP is not set
+CONFIG_NET_IPIP=m
+CONFIG_NET_IPGRE=m
+# CONFIG_NET_IPGRE_BROADCAST is not set
+# CONFIG_IP_MROUTE is not set
+# CONFIG_ARPD is not set
+# CONFIG_SYN_COOKIES is not set
+CONFIG_INET_AH=m
+CONFIG_INET_ESP=m
+CONFIG_INET_IPCOMP=m
+CONFIG_INET_TUNNEL=m
+CONFIG_INET_DIAG=y
+CONFIG_INET_TCP_DIAG=y
+CONFIG_TCP_CONG_ADVANCED=y
+
+#
+# TCP congestion control
+#
+CONFIG_TCP_CONG_BIC=y
+CONFIG_TCP_CONG_CUBIC=m
+CONFIG_TCP_CONG_WESTWOOD=m
+CONFIG_TCP_CONG_HTCP=m
+CONFIG_TCP_CONG_HSTCP=m
+CONFIG_TCP_CONG_HYBLA=m
+CONFIG_TCP_CONG_VEGAS=m
+CONFIG_TCP_CONG_SCALABLE=m
+
+#
+# IP: Virtual Server Configuration
+#
+# CONFIG_IP_VS is not set
+CONFIG_IPV6=m
+CONFIG_IPV6_PRIVACY=y
+CONFIG_INET6_AH=m
+CONFIG_INET6_ESP=m
+CONFIG_INET6_IPCOMP=m
+CONFIG_INET6_TUNNEL=m
+CONFIG_IPV6_TUNNEL=m
+CONFIG_NETFILTER=y
+# CONFIG_NETFILTER_DEBUG is not set
+
+#
+# Core Netfilter Configuration
+#
+CONFIG_NETFILTER_NETLINK=m
+CONFIG_NETFILTER_NETLINK_QUEUE=m
+CONFIG_NETFILTER_NETLINK_LOG=m
+CONFIG_NETFILTER_XTABLES=m
+CONFIG_NETFILTER_XT_TARGET_CLASSIFY=m
+CONFIG_NETFILTER_XT_TARGET_CONNMARK=m
+CONFIG_NETFILTER_XT_TARGET_MARK=m
+CONFIG_NETFILTER_XT_TARGET_NFQUEUE=m
+CONFIG_NETFILTER_XT_TARGET_NOTRACK=m
+CONFIG_NETFILTER_XT_MATCH_COMMENT=m
+CONFIG_NETFILTER_XT_MATCH_CONNBYTES=m
+CONFIG_NETFILTER_XT_MATCH_CONNMARK=m
+CONFIG_NETFILTER_XT_MATCH_CONNTRACK=m
+CONFIG_NETFILTER_XT_MATCH_DCCP=m
+CONFIG_NETFILTER_XT_MATCH_HELPER=m
+CONFIG_NETFILTER_XT_MATCH_LENGTH=m
+CONFIG_NETFILTER_XT_MATCH_LIMIT=m
+CONFIG_NETFILTER_XT_MATCH_MAC=m
+CONFIG_NETFILTER_XT_MATCH_MARK=m
+CONFIG_NETFILTER_XT_MATCH_PKTTYPE=m
+CONFIG_NETFILTER_XT_MATCH_REALM=m
+CONFIG_NETFILTER_XT_MATCH_SCTP=m
+CONFIG_NETFILTER_XT_MATCH_STATE=m
+CONFIG_NETFILTER_XT_MATCH_STRING=m
+CONFIG_NETFILTER_XT_MATCH_TCPMSS=m
+
+#
+# IP: Netfilter Configuration
+#
+CONFIG_IP_NF_QUEUE=m
+CONFIG_IP_NF_IPTABLES=m
+CONFIG_IP_NF_MATCH_IPRANGE=m
+CONFIG_IP_NF_MATCH_MULTIPORT=m
+CONFIG_IP_NF_MATCH_TOS=m
+CONFIG_IP_NF_MATCH_RECENT=m
+CONFIG_IP_NF_MATCH_ECN=m
+CONFIG_IP_NF_MATCH_DSCP=m
+CONFIG_IP_NF_MATCH_AH_ESP=m
+CONFIG_IP_NF_MATCH_TTL=m
+CONFIG_IP_NF_MATCH_OWNER=m
+CONFIG_IP_NF_MATCH_ADDRTYPE=m
+CONFIG_IP_NF_MATCH_HASHLIMIT=m
+CONFIG_IP_NF_MATCH_POLICY=m
+CONFIG_IP_NF_FILTER=m
+CONFIG_IP_NF_TARGET_REJECT=m
+CONFIG_IP_NF_TARGET_LOG=m
+CONFIG_IP_NF_TARGET_ULOG=m
+CONFIG_IP_NF_TARGET_TCPMSS=m
+CONFIG_IP_NF_TARGET_MASQUERADE=m
+CONFIG_IP_NF_TARGET_REDIRECT=m
+CONFIG_IP_NF_TARGET_NETMAP=m
+CONFIG_IP_NF_TARGET_SAME=m
+CONFIG_IP_NF_MANGLE=m
+CONFIG_IP_NF_TARGET_TOS=m
+CONFIG_IP_NF_TARGET_ECN=m
+CONFIG_IP_NF_TARGET_DSCP=m
+CONFIG_IP_NF_TARGET_TTL=m
+CONFIG_IP_NF_TARGET_CLUSTERIP=m
+CONFIG_IP_NF_RAW=m
+CONFIG_IP_NF_ARPTABLES=m
+CONFIG_IP_NF_ARPFILTER=m
+CONFIG_IP_NF_ARP_MANGLE=m
+
+#
+# IPv6: Netfilter Configuration (EXPERIMENTAL)
+#
+CONFIG_IP6_NF_QUEUE=m
+CONFIG_IP6_NF_IPTABLES=m
+CONFIG_IP6_NF_MATCH_RT=m
+CONFIG_IP6_NF_MATCH_OPTS=m
+CONFIG_IP6_NF_MATCH_FRAG=m
+CONFIG_IP6_NF_MATCH_HL=m
+CONFIG_IP6_NF_MATCH_MULTIPORT=m
+CONFIG_IP6_NF_MATCH_OWNER=m
+CONFIG_IP6_NF_MATCH_IPV6HEADER=m
+CONFIG_IP6_NF_MATCH_AHESP=m
+CONFIG_IP6_NF_MATCH_EUI64=m
+CONFIG_IP6_NF_MATCH_POLICY=m
+CONFIG_IP6_NF_FILTER=m
+CONFIG_IP6_NF_TARGET_LOG=m
+# CONFIG_IP6_NF_TARGET_REJECT is not set
+CONFIG_IP6_NF_MANGLE=m
+# CONFIG_IP6_NF_TARGET_HL is not set
+CONFIG_IP6_NF_RAW=m
+
+#
+# DCCP Configuration (EXPERIMENTAL)
+#
+# CONFIG_IP_DCCP is not set
+
+#
+# SCTP Configuration (EXPERIMENTAL)
+#
+CONFIG_IP_SCTP=m
+# CONFIG_SCTP_DBG_MSG is not set
+# CONFIG_SCTP_DBG_OBJCNT is not set
+# CONFIG_SCTP_HMAC_NONE is not set
+# CONFIG_SCTP_HMAC_SHA1 is not set
+CONFIG_SCTP_HMAC_MD5=y
+
+#
+# TIPC Configuration (EXPERIMENTAL)
+#
+CONFIG_TIPC=m
+CONFIG_TIPC_ADVANCED=y
+CONFIG_TIPC_ZONES=3
+CONFIG_TIPC_CLUSTERS=1
+CONFIG_TIPC_NODES=255
+CONFIG_TIPC_SLAVE_NODES=0
+CONFIG_TIPC_PORTS=8191
+CONFIG_TIPC_LOG=0
+# CONFIG_TIPC_DEBUG is not set
+# CONFIG_ATM is not set
+# CONFIG_BRIDGE is not set
+# CONFIG_VLAN_8021Q is not set
+# CONFIG_DECNET is not set
+# CONFIG_LLC2 is not set
+# CONFIG_IPX is not set
+# CONFIG_ATALK is not set
+# CONFIG_X25 is not set
+# CONFIG_LAPB is not set
+# CONFIG_NET_DIVERT is not set
+# CONFIG_ECONET is not set
+# CONFIG_WAN_ROUTER is not set
+
+#
+# Network testing
+#
+# CONFIG_HAMRADIO is not set
+# CONFIG_IRDA is not set
+# CONFIG_BT is not set
+# CONFIG_IEEE80211 is not set
+
+#
+# Device Drivers
+#
+
+#
+# Generic Driver Options
+#
+CONFIG_STANDALONE=y
+CONFIG_PREVENT_FIRMWARE_BUILD=y
+CONFIG_FW_LOADER=m
+
+#
+# Connector - unified userspace <-> kernelspace linker
+#
+# CONFIG_CONNECTOR is not set
+
+#
+# Memory Technology Devices (MTD)
+#
+# CONFIG_MTD is not set
+
+#
+# Parallel port support
+#
+
+#
+# Plug and Play support
+#
+
+#
+# Block devices
+#
+# CONFIG_BLK_CPQ_DA is not set
+# CONFIG_BLK_CPQ_CISS_DA is not set
+# CONFIG_BLK_DEV_DAC960 is not set
+# CONFIG_BLK_DEV_UMEM is not set
+# CONFIG_BLK_DEV_COW_COMMON is not set
+CONFIG_BLK_DEV_LOOP=m
+CONFIG_BLK_DEV_CRYPTOLOOP=m
+CONFIG_BLK_DEV_NBD=m
+# CONFIG_BLK_DEV_SX8 is not set
+# CONFIG_BLK_DEV_UB is not set
+CONFIG_BLK_DEV_RAM=y
+CONFIG_BLK_DEV_RAM_COUNT=16
+CONFIG_BLK_DEV_RAM_SIZE=8192
+CONFIG_BLK_DEV_INITRD=y
+# CONFIG_CDROM_PKTCDVD is not set
+# CONFIG_ATA_OVER_ETH is not set
+
+#
+# ATA/ATAPI/MFM/RLL support
+#
+CONFIG_IDE=y
+CONFIG_BLK_DEV_IDE=y
+
+#
+# Please see Documentation/ide.txt for help/info on IDE drives
+#
+# CONFIG_BLK_DEV_IDE_SATA is not set
+CONFIG_BLK_DEV_IDEDISK=y
+# CONFIG_IDEDISK_MULTI_MODE is not set
+CONFIG_BLK_DEV_IDECD=m
+CONFIG_BLK_DEV_IDETAPE=m
+CONFIG_BLK_DEV_IDEFLOPPY=m
+# CONFIG_BLK_DEV_IDESCSI is not set
+
+#
+# IDE chipset support/bugfixes
+#
+CONFIG_IDE_GENERIC=y
+CONFIG_BLK_DEV_IDEPCI=y
+CONFIG_IDEPCI_SHARE_IRQ=y
+# CONFIG_BLK_DEV_OFFBOARD is not set
+# CONFIG_BLK_DEV_GENERIC is not set
+# CONFIG_BLK_DEV_OPTI621 is not set
+CONFIG_BLK_DEV_IDEDMA_PCI=y
+# CONFIG_BLK_DEV_IDEDMA_FORCED is not set
+# CONFIG_IDEDMA_ONLYDISK is not set
+CONFIG_BLK_DEV_AEC62XX=m
+CONFIG_BLK_DEV_ALI15X3=m
+# CONFIG_WDC_ALI15X3 is not set
+CONFIG_BLK_DEV_AMD74XX=m
+CONFIG_BLK_DEV_CMD64X=m
+CONFIG_BLK_DEV_TRIFLEX=m
+CONFIG_BLK_DEV_CY82C693=m
+# CONFIG_BLK_DEV_CS5520 is not set
+CONFIG_BLK_DEV_CS5530=m
+CONFIG_BLK_DEV_HPT34X=m
+# CONFIG_HPT34X_AUTODMA is not set
+CONFIG_BLK_DEV_HPT366=m
+CONFIG_BLK_DEV_SC1200=m
+CONFIG_BLK_DEV_PIIX=m
+CONFIG_BLK_DEV_IT821X=m
+CONFIG_BLK_DEV_NS87415=m
+CONFIG_BLK_DEV_PDC202XX_OLD=m
+# CONFIG_PDC202XX_BURST is not set
+CONFIG_BLK_DEV_PDC202XX_NEW=m
+CONFIG_BLK_DEV_SVWKS=m
+CONFIG_BLK_DEV_SIIMAGE=m
+CONFIG_BLK_DEV_SLC90E66=m
+CONFIG_BLK_DEV_TRM290=m
+CONFIG_BLK_DEV_VIA82CXXX=m
+# CONFIG_BLK_DEV_IDE_SWARM is not set
+# CONFIG_IDE_ARM is not set
+CONFIG_BLK_DEV_IDEDMA=y
+# CONFIG_IDEDMA_IVB is not set
+# CONFIG_BLK_DEV_HD is not set
+
+#
+# SCSI device support
+#
+CONFIG_RAID_ATTRS=m
+CONFIG_SCSI=m
+CONFIG_SCSI_PROC_FS=y
+
+#
+# SCSI support type (disk, tape, CD-ROM)
+#
+CONFIG_BLK_DEV_SD=m
+CONFIG_CHR_DEV_ST=m
+CONFIG_CHR_DEV_OSST=m
+CONFIG_BLK_DEV_SR=m
+CONFIG_BLK_DEV_SR_VENDOR=y
+CONFIG_CHR_DEV_SG=m
+CONFIG_CHR_DEV_SCH=m
+
+#
+# Some SCSI devices (e.g. CD jukebox) support multiple LUNs
+#
+# CONFIG_SCSI_MULTI_LUN is not set
+# CONFIG_SCSI_CONSTANTS is not set
+# CONFIG_SCSI_LOGGING is not set
+
+#
+# SCSI Transport Attributes
+#
+CONFIG_SCSI_SPI_ATTRS=m
+CONFIG_SCSI_FC_ATTRS=m
+CONFIG_SCSI_ISCSI_ATTRS=m
+# CONFIG_SCSI_SAS_ATTRS is not set
+
+#
+# SCSI low-level drivers
+#
+CONFIG_ISCSI_TCP=m
+CONFIG_BLK_DEV_3W_XXXX_RAID=m
+CONFIG_SCSI_3W_9XXX=m
+CONFIG_SCSI_ACARD=m
+CONFIG_SCSI_AACRAID=m
+CONFIG_SCSI_AIC7XXX=m
+CONFIG_AIC7XXX_CMDS_PER_DEVICE=32
+CONFIG_AIC7XXX_RESET_DELAY_MS=15000
+CONFIG_AIC7XXX_DEBUG_ENABLE=y
+CONFIG_AIC7XXX_DEBUG_MASK=0
+CONFIG_AIC7XXX_REG_PRETTY_PRINT=y
+CONFIG_SCSI_AIC7XXX_OLD=m
+CONFIG_SCSI_AIC79XX=m
+CONFIG_AIC79XX_CMDS_PER_DEVICE=32
+CONFIG_AIC79XX_RESET_DELAY_MS=15000
+CONFIG_AIC79XX_DEBUG_ENABLE=y
+CONFIG_AIC79XX_DEBUG_MASK=0
+CONFIG_AIC79XX_REG_PRETTY_PRINT=y
+# CONFIG_MEGARAID_NEWGEN is not set
+CONFIG_MEGARAID_LEGACY=m
+CONFIG_MEGARAID_SAS=m
+CONFIG_SCSI_DMX3191D=m
+CONFIG_SCSI_FUTURE_DOMAIN=m
+CONFIG_SCSI_IPS=m
+CONFIG_SCSI_INITIO=m
+CONFIG_SCSI_INIA100=m
+CONFIG_SCSI_SYM53C8XX_2=m
+CONFIG_SCSI_SYM53C8XX_DMA_ADDRESSING_MODE=1
+CONFIG_SCSI_SYM53C8XX_DEFAULT_TAGS=16
+CONFIG_SCSI_SYM53C8XX_MAX_TAGS=64
+# CONFIG_SCSI_IPR is not set
+CONFIG_SCSI_QLOGIC_FC=m
+# CONFIG_SCSI_QLOGIC_FC_FIRMWARE is not set
+CONFIG_SCSI_QLOGIC_1280=m
+CONFIG_SCSI_QLA_FC=m
+# CONFIG_SCSI_QLA2XXX_EMBEDDED_FIRMWARE is not set
+CONFIG_SCSI_LPFC=m
+CONFIG_SCSI_DC395x=m
+CONFIG_SCSI_DC390T=m
+CONFIG_SCSI_DEBUG=m
+
+#
+# Serial ATA (prod) and Parallel ATA (experimental) drivers
+#
+CONFIG_ATA=m
+CONFIG_SATA_AHCI=m
+CONFIG_SATA_SVW=m
+CONFIG_ATA_PIIX=m
+CONFIG_SATA_MV=m
+CONFIG_SATA_NV=m
+CONFIG_PDC_ADMA=m
+CONFIG_SATA_QSTOR=m
+CONFIG_SATA_PROMISE=m
+CONFIG_SATA_SX4=m
+CONFIG_SATA_SIL=m
+CONFIG_SATA_SIL24=m
+CONFIG_SATA_SIS=m
+CONFIG_SATA_ULI=m
+CONFIG_SATA_VIA=m
+CONFIG_SATA_VITESSE=m
+
+#
+# Multi-device support (RAID and LVM)
+#
+CONFIG_MD=y
+CONFIG_BLK_DEV_MD=m
+CONFIG_MD_LINEAR=m
+CONFIG_MD_RAID0=m
+CONFIG_MD_RAID1=m
+CONFIG_MD_RAID10=m
+CONFIG_MD_RAID5=m
+CONFIG_MD_RAID6=m
+CONFIG_MD_MULTIPATH=m
+CONFIG_MD_FAULTY=m
+CONFIG_BLK_DEV_DM=m
+CONFIG_DM_CRYPT=m
+CONFIG_DM_SNAPSHOT=m
+CONFIG_DM_MIRROR=m
+CONFIG_DM_ZERO=m
+CONFIG_DM_MULTIPATH=m
+# CONFIG_DM_MULTIPATH_EMC is not set
+
+#
+# Fusion MPT device support
+#
+# CONFIG_FUSION is not set
+# CONFIG_FUSION_SPI is not set
+# CONFIG_FUSION_FC is not set
+# CONFIG_FUSION_SAS is not set
+
+#
+# IEEE 1394 (FireWire) support
+#
+# CONFIG_FIREWIRE is not set
+
+#
+# I2O device support
+#
+# CONFIG_I2O is not set
+
+#
+# Network device support
+#
+CONFIG_NETDEVICES=y
+CONFIG_DUMMY=m
+CONFIG_BONDING=m
+CONFIG_EQUALIZER=m
+CONFIG_TUN=m
+
+#
+# ARCnet devices
+#
+# CONFIG_ARCNET is not set
+
+#
+# PHY device support
+#
+# CONFIG_PHYLIB is not set
+
+#
+# Ethernet (10 or 100Mbit)
+#
+CONFIG_NET_ETHERNET=y
+CONFIG_MII=y
+CONFIG_NET_SB1250_MAC=y
+CONFIG_SBMAC_NAPI=y
+# CONFIG_HAPPYMEAL is not set
+# CONFIG_SUNGEM is not set
+# CONFIG_CASSINI is not set
+# CONFIG_NET_VENDOR_3COM is not set
+# CONFIG_DM9000 is not set
+
+#
+# Tulip family network device support
+#
+# CONFIG_NET_TULIP is not set
+# CONFIG_HP100 is not set
+CONFIG_NET_PCI=y
+CONFIG_PCNET32=m
+CONFIG_AMD8111_ETH=m
+# CONFIG_AMD8111E_NAPI is not set
+CONFIG_ADAPTEC_STARFIRE=m
+# CONFIG_ADAPTEC_STARFIRE_NAPI is not set
+CONFIG_B44=m
+CONFIG_FORCEDETH=m
+CONFIG_EEPRO100=m
+CONFIG_E100=m
+CONFIG_FEALNX=m
+CONFIG_NATSEMI=m
+CONFIG_NE2K_PCI=m
+CONFIG_8139CP=m
+CONFIG_8139TOO=m
+CONFIG_8139TOO_PIO=y
+# CONFIG_8139TOO_TUNE_TWISTER is not set
+CONFIG_8139TOO_8129=y
+# CONFIG_8139_OLD_RX_RESET is not set
+CONFIG_SIS900=m
+CONFIG_EPIC100=m
+CONFIG_SUNDANCE=m
+# CONFIG_SUNDANCE_MMIO is not set
+CONFIG_VIA_RHINE=m
+# CONFIG_VIA_RHINE_MMIO is not set
+# CONFIG_LAN_SAA9730 is not set
+# CONFIG_NET_POCKET is not set
+
+#
+# Ethernet (1000 Mbit)
+#
+CONFIG_DL2K=m
+CONFIG_E1000=m
+# CONFIG_E1000_NAPI is not set
+# CONFIG_E1000_DISABLE_PACKET_SPLIT is not set
+CONFIG_NS83820=m
+CONFIG_HAMACHI=m
+CONFIG_YELLOWFIN=m
+CONFIG_R8169=m
+# CONFIG_R8169_NAPI is not set
+CONFIG_SIS190=m
+CONFIG_SKGE=m
+CONFIG_SKY2=m
+CONFIG_VIA_VELOCITY=m
+CONFIG_TIGON3=m
+CONFIG_BNX2=m
+
+#
+# Ethernet (10000 Mbit)
+#
+# CONFIG_CHELSIO_T1 is not set
+# CONFIG_IXGB is not set
+# CONFIG_S2IO is not set
+
+#
+# Token Ring devices
+#
+# CONFIG_TR is not set
+
+#
+# Wireless LAN (non-hamradio)
+#
+# CONFIG_NET_RADIO is not set
+
+#
+# Wan interfaces
+#
+# CONFIG_WAN is not set
+# CONFIG_FDDI is not set
+# CONFIG_HIPPI is not set
+# CONFIG_PLIP is not set
+CONFIG_PPP=m
+# CONFIG_PPP_MULTILINK is not set
+CONFIG_PPP_FILTER=y
+CONFIG_PPP_ASYNC=m
+CONFIG_PPP_SYNC_TTY=m
+CONFIG_PPP_DEFLATE=m
+CONFIG_PPP_BSDCOMP=m
+CONFIG_PPP_MPPE=m
+CONFIG_PPPOE=m
+CONFIG_SLIP=m
+CONFIG_SLIP_COMPRESSED=y
+CONFIG_SLIP_SMART=y
+CONFIG_SLIP_MODE_SLIP6=y
+# CONFIG_NET_FC is not set
+# CONFIG_SHAPER is not set
+# CONFIG_NETCONSOLE is not set
+# CONFIG_NETPOLL is not set
+# CONFIG_NET_POLL_CONTROLLER is not set
+
+#
+# ISDN subsystem
+#
+# CONFIG_ISDN is not set
+
+#
+# Telephony Support
+#
+# CONFIG_PHONE is not set
+
+#
+# Input device support
+#
+CONFIG_INPUT=y
+
+#
+# Userland interfaces
+#
+CONFIG_INPUT_MOUSEDEV=y
+CONFIG_INPUT_MOUSEDEV_PSAUX=y
+CONFIG_INPUT_MOUSEDEV_SCREEN_X=1024
+CONFIG_INPUT_MOUSEDEV_SCREEN_Y=768
+# CONFIG_INPUT_JOYDEV is not set
+# CONFIG_INPUT_TSDEV is not set
+CONFIG_INPUT_EVDEV=m
+
+#
+# Input Device Drivers
+#
+CONFIG_INPUT_KEYBOARD=y
+CONFIG_KEYBOARD_ATKBD=y
+# CONFIG_KEYBOARD_SUNKBD is not set
+# CONFIG_KEYBOARD_LKKBD is not set
+# CONFIG_KEYBOARD_XTKBD is not set
+# CONFIG_KEYBOARD_NEWTON is not set
+CONFIG_INPUT_MOUSE=y
+CONFIG_MOUSE_PS2=y
+# CONFIG_MOUSE_SERIAL is not set
+# CONFIG_MOUSE_VSXXXAA is not set
+# CONFIG_INPUT_JOYSTICK is not set
+# CONFIG_INPUT_TOUCHSCREEN is not set
+# CONFIG_INPUT_MISC is not set
+
+#
+# Hardware I/O ports
+#
+CONFIG_SERIO=y
+# CONFIG_SERIO_I8042 is not set
+# CONFIG_SERIO_SERPORT is not set
+# CONFIG_SERIO_PARKBD is not set
+# CONFIG_SERIO_PCIPS2 is not set
+CONFIG_SERIO_LIBPS2=y
+# CONFIG_SERIO_RAW is not set
+# CONFIG_GAMEPORT is not set
+
+#
+# Character devices
+#
+CONFIG_VT=y
+CONFIG_VT_CONSOLE=y
+CONFIG_HW_CONSOLE=y
+# CONFIG_SERIAL_NONSTANDARD is not set
+CONFIG_SIBYTE_SB1250_DUART=y
+CONFIG_SIBYTE_SB1250_DUART_CONSOLE=y
+
+#
+# Serial drivers
+#
+# CONFIG_SERIAL_8250 is not set
+
+#
+# Non-8250 serial port support
+#
+# CONFIG_SERIAL_JSM is not set
+CONFIG_PRINTER=m
+# CONFIG_LP_CONSOLE is not set
+# CONFIG_PPDEV is not set
+# CONFIG_TIPAR is not set
+
+#
+# IPMI
+#
+# CONFIG_IPMI_HANDLER is not set
+
+#
+# Watchdog Cards
+#
+CONFIG_WATCHDOG=y
+# CONFIG_WATCHDOG_NOWAYOUT is not set
+
+#
+# Watchdog Device Drivers
+#
+# CONFIG_SOFT_WATCHDOG is not set
+
+#
+# PCI-based Watchdog Cards
+#
+# CONFIG_PCIPCWATCHDOG is not set
+# CONFIG_WDTPCI is not set
+
+#
+# USB-based Watchdog Cards
+#
+# CONFIG_USBPCWATCHDOG is not set
+CONFIG_RTC=m
+CONFIG_GEN_RTC=y
+CONFIG_GEN_RTC_X=y
+# CONFIG_DTLK is not set
+# CONFIG_R3964 is not set
+# CONFIG_APPLICOM is not set
+
+#
+# Ftape, the floppy tape device driver
+#
+# CONFIG_DRM is not set
+# CONFIG_RAW_DRIVER is not set
+
+#
+# TPM devices
+#
+# CONFIG_TCG_TPM is not set
+# CONFIG_TELCLOCK is not set
+
+#
+# I2C support
+#
+CONFIG_I2C=m
+CONFIG_I2C_CHARDEV=m
+
+#
+# I2C Algorithms
+#
+CONFIG_I2C_ALGOBIT=m
+# CONFIG_I2C_ALGOPCF is not set
+# CONFIG_I2C_ALGOPCA is not set
+CONFIG_I2C_ALGO_SIBYTE=m
+
+#
+# I2C Hardware Bus support
+#
+# CONFIG_I2C_ALI1535 is not set
+# CONFIG_I2C_ALI1563 is not set
+# CONFIG_I2C_ALI15X3 is not set
+# CONFIG_I2C_AMD756 is not set
+# CONFIG_I2C_AMD8111 is not set
+# CONFIG_I2C_I801 is not set
+# CONFIG_I2C_I810 is not set
+# CONFIG_I2C_PIIX4 is not set
+# CONFIG_I2C_NFORCE2 is not set
+# CONFIG_I2C_PARPORT is not set
+# CONFIG_I2C_PARPORT_LIGHT is not set
+# CONFIG_I2C_PROSAVAGE is not set
+# CONFIG_I2C_SAVAGE4 is not set
+CONFIG_I2C_SIBYTE=m
+# CONFIG_SCx200_ACB is not set
+# CONFIG_I2C_SIS5595 is not set
+# CONFIG_I2C_SIS630 is not set
+# CONFIG_I2C_SIS96X is not set
+CONFIG_I2C_STUB=m
+# CONFIG_I2C_VIA is not set
+# CONFIG_I2C_VIAPRO is not set
+# CONFIG_I2C_VOODOO3 is not set
+# CONFIG_I2C_PCA_ISA is not set
+
+#
+# Miscellaneous I2C Chip support
+#
+# CONFIG_SENSORS_DS1337 is not set
+# CONFIG_SENSORS_DS1374 is not set
+# CONFIG_SENSORS_EEPROM is not set
+# CONFIG_SENSORS_PCF8574 is not set
+# CONFIG_SENSORS_PCA9539 is not set
+# CONFIG_SENSORS_PCF8591 is not set
+# CONFIG_SENSORS_MAX6875 is not set
+# CONFIG_I2C_DEBUG_CORE is not set
+# CONFIG_I2C_DEBUG_ALGO is not set
+# CONFIG_I2C_DEBUG_BUS is not set
+# CONFIG_I2C_DEBUG_CHIP is not set
+
+#
+# SPI support
+#
+CONFIG_SPI=y
+CONFIG_SPI_MASTER=y
+
+#
+# SPI Master Controller Drivers
+#
+CONFIG_SPI_BITBANG=m
+CONFIG_SPI_BUTTERFLY=m
+
+#
+# SPI Protocol Masters
+#
+
+#
+# Dallas's 1-wire bus
+#
+# CONFIG_W1 is not set
+
+#
+# Hardware Monitoring support
+#
+CONFIG_HWMON=y
+CONFIG_HWMON_VID=m
+# CONFIG_SENSORS_ADM1021 is not set
+# CONFIG_SENSORS_ADM1025 is not set
+# CONFIG_SENSORS_ADM1026 is not set
+# CONFIG_SENSORS_ADM1031 is not set
+# CONFIG_SENSORS_ADM9240 is not set
+# CONFIG_SENSORS_ASB100 is not set
+# CONFIG_SENSORS_ATXP1 is not set
+# CONFIG_SENSORS_DS1621 is not set
+# CONFIG_SENSORS_F71805F is not set
+# CONFIG_SENSORS_FSCHER is not set
+# CONFIG_SENSORS_FSCPOS is not set
+# CONFIG_SENSORS_GL518SM is not set
+# CONFIG_SENSORS_GL520SM is not set
+# CONFIG_SENSORS_IT87 is not set
+# CONFIG_SENSORS_LM63 is not set
+# CONFIG_SENSORS_LM75 is not set
+# CONFIG_SENSORS_LM77 is not set
+# CONFIG_SENSORS_LM78 is not set
+# CONFIG_SENSORS_LM80 is not set
+# CONFIG_SENSORS_LM83 is not set
+# CONFIG_SENSORS_LM85 is not set
+# CONFIG_SENSORS_LM87 is not set
+# CONFIG_SENSORS_LM90 is not set
+# CONFIG_SENSORS_LM92 is not set
+# CONFIG_SENSORS_MAX1619 is not set
+# CONFIG_SENSORS_PC87360 is not set
+# CONFIG_SENSORS_SIS5595 is not set
+# CONFIG_SENSORS_SMSC47M1 is not set
+# CONFIG_SENSORS_SMSC47B397 is not set
+# CONFIG_SENSORS_VIA686A is not set
+CONFIG_SENSORS_VT8231=m
+# CONFIG_SENSORS_W83781D is not set
+# CONFIG_SENSORS_W83792D is not set
+# CONFIG_SENSORS_W83L785TS is not set
+# CONFIG_SENSORS_W83627HF is not set
+# CONFIG_SENSORS_W83627EHF is not set
+# CONFIG_HWMON_DEBUG_CHIP is not set
+
+#
+# Misc devices
+#
+
+#
+# Multimedia Capabilities Port drivers
+#
+
+#
+# Multimedia devices
+#
+CONFIG_VIDEO_DEV=m
+
+#
+# Video For Linux
+#
+
+#
+# Video Adapters
+#
+# CONFIG_VIDEO_ADV_DEBUG is not set
+# CONFIG_VIDEO_BT848 is not set
+# CONFIG_VIDEO_BWQCAM is not set
+# CONFIG_VIDEO_CQCAM is not set
+# CONFIG_VIDEO_W9966 is not set
+# CONFIG_VIDEO_CPIA is not set
+# CONFIG_VIDEO_SAA5246A is not set
+# CONFIG_VIDEO_SAA5249 is not set
+# CONFIG_TUNER_3036 is not set
+# CONFIG_VIDEO_STRADIS is not set
+# CONFIG_VIDEO_ZORAN is not set
+# CONFIG_VIDEO_SAA7134 is not set
+# CONFIG_VIDEO_MXB is not set
+# CONFIG_VIDEO_DPC is not set
+# CONFIG_VIDEO_HEXIUM_ORION is not set
+# CONFIG_VIDEO_HEXIUM_GEMINI is not set
+# CONFIG_VIDEO_CX88 is not set
+# CONFIG_VIDEO_EM28XX is not set
+# CONFIG_VIDEO_OVCAMCHIP is not set
+# CONFIG_VIDEO_AUDIO_DECODER is not set
+# CONFIG_VIDEO_DECODER is not set
+
+#
+# Radio Adapters
+#
+# CONFIG_RADIO_GEMTEK_PCI is not set
+# CONFIG_RADIO_MAXIRADIO is not set
+# CONFIG_RADIO_MAESTRO is not set
+
+#
+# Digital Video Broadcasting Devices
+#
+# CONFIG_DVB is not set
+
+#
+# Graphics support
+#
+CONFIG_FB=y
+CONFIG_FB_CFB_FILLRECT=m
+CONFIG_FB_CFB_COPYAREA=m
+CONFIG_FB_CFB_IMAGEBLIT=m
+# CONFIG_FB_MACMODES is not set
+CONFIG_FB_MODE_HELPERS=y
+CONFIG_FB_TILEBLITTING=y
+# CONFIG_FB_CIRRUS is not set
+CONFIG_FB_PM2=m
+# CONFIG_FB_PM2_FIFO_DISCONNECT is not set
+CONFIG_FB_CYBER2000=m
+# CONFIG_FB_ASILIANT is not set
+# CONFIG_FB_IMSTT is not set
+# CONFIG_FB_S1D13XXX is not set
+CONFIG_FB_NVIDIA=m
+# CONFIG_FB_NVIDIA_I2C is not set
+CONFIG_FB_RIVA=m
+# CONFIG_FB_RIVA_I2C is not set
+# CONFIG_FB_RIVA_DEBUG is not set
+CONFIG_FB_MATROX=m
+CONFIG_FB_MATROX_MILLENIUM=y
+CONFIG_FB_MATROX_MYSTIQUE=y
+CONFIG_FB_MATROX_G=y
+# CONFIG_FB_MATROX_I2C is not set
+# CONFIG_FB_MATROX_MULTIHEAD is not set
+CONFIG_FB_RADEON=m
+CONFIG_FB_RADEON_I2C=y
+# CONFIG_FB_RADEON_DEBUG is not set
+CONFIG_FB_ATY128=m
+CONFIG_FB_ATY=m
+# CONFIG_FB_ATY_CT is not set
+# CONFIG_FB_ATY_GX is not set
+CONFIG_FB_SAVAGE=m
+# CONFIG_FB_SAVAGE_I2C is not set
+# CONFIG_FB_SAVAGE_ACCEL is not set
+CONFIG_FB_SIS=m
+CONFIG_FB_SIS_300=y
+CONFIG_FB_SIS_315=y
+CONFIG_FB_NEOMAGIC=m
+CONFIG_FB_KYRO=m
+CONFIG_FB_3DFX=m
+# CONFIG_FB_3DFX_ACCEL is not set
+CONFIG_FB_VOODOO1=m
+CONFIG_FB_TRIDENT=m
+# CONFIG_FB_TRIDENT_ACCEL is not set
+# CONFIG_FB_VIRTUAL is not set
+
+#
+# Console display driver support
+#
+# CONFIG_VGA_CONSOLE is not set
+CONFIG_DUMMY_CONSOLE=y
+CONFIG_FRAMEBUFFER_CONSOLE=y
+# CONFIG_FRAMEBUFFER_CONSOLE_ROTATION is not set
+# CONFIG_FONTS is not set
+CONFIG_FONT_8x8=y
+CONFIG_FONT_8x16=y
+
+#
+# Logo configuration
+#
+CONFIG_LOGO=y
+# CONFIG_LOGO_LINUX_MONO is not set
+# CONFIG_LOGO_LINUX_VGA16 is not set
+# CONFIG_LOGO_LINUX_CLUT224 is not set
+
+#
+# Sound
+#
+CONFIG_SOUND=y
+
+#
+# Advanced Linux Sound Architecture
+#
+CONFIG_SND=m
+CONFIG_SND_TIMER=m
+CONFIG_SND_PCM=m
+CONFIG_SND_HWDEP=m
+CONFIG_SND_RAWMIDI=m
+# CONFIG_SND_SEQUENCER is not set
+CONFIG_SND_OSSEMUL=y
+CONFIG_SND_MIXER_OSS=m
+CONFIG_SND_PCM_OSS=m
+CONFIG_SND_RTCTIMER=m
+# CONFIG_SND_DYNAMIC_MINORS is not set
+CONFIG_SND_SUPPORT_OLD_API=y
+# CONFIG_SND_VERBOSE_PRINTK is not set
+# CONFIG_SND_DEBUG is not set
+
+#
+# Generic devices
+#
+CONFIG_SND_MPU401_UART=m
+CONFIG_SND_OPL3_LIB=m
+CONFIG_SND_VX_LIB=m
+CONFIG_SND_AC97_CODEC=m
+CONFIG_SND_AC97_BUS=m
+# CONFIG_SND_DUMMY is not set
+# CONFIG_SND_MTPAV is not set
+# CONFIG_SND_MPU401 is not set
+
+#
+# PCI devices
+#
+CONFIG_SND_AD1889=m
+CONFIG_SND_ALI5451=m
+CONFIG_SND_ATIIXP=m
+CONFIG_SND_ATIIXP_MODEM=m
+CONFIG_SND_AU8810=m
+CONFIG_SND_AU8820=m
+CONFIG_SND_AU8830=m
+CONFIG_SND_AZT3328=m
+CONFIG_SND_BT87X=m
+CONFIG_SND_BT87X_OVERCLOCK=y
+CONFIG_SND_CA0106=m
+CONFIG_SND_CMIPCI=m
+CONFIG_SND_CS4281=m
+CONFIG_SND_CS46XX=m
+CONFIG_SND_CS46XX_NEW_DSP=y
+CONFIG_SND_EMU10K1=m
+CONFIG_SND_EMU10K1X=m
+CONFIG_SND_ENS1370=m
+CONFIG_SND_ENS1371=m
+CONFIG_SND_ES1938=m
+CONFIG_SND_ES1968=m
+CONFIG_SND_FM801=m
+CONFIG_SND_FM801_TEA575X_BOOL=y
+CONFIG_SND_FM801_TEA575X=m
+CONFIG_SND_HDA_INTEL=m
+CONFIG_SND_HDSP=m
+CONFIG_SND_HDSPM=m
+CONFIG_SND_ICE1712=m
+CONFIG_SND_ICE1724=m
+CONFIG_SND_INTEL8X0=m
+CONFIG_SND_INTEL8X0M=m
+CONFIG_SND_KORG1212=m
+CONFIG_SND_MAESTRO3=m
+CONFIG_SND_MIXART=m
+CONFIG_SND_NM256=m
+CONFIG_SND_PCXHR=m
+CONFIG_SND_RME32=m
+CONFIG_SND_RME96=m
+CONFIG_SND_RME9652=m
+CONFIG_SND_SONICVIBES=m
+CONFIG_SND_TRIDENT=m
+CONFIG_SND_VIA82XX=m
+CONFIG_SND_VIA82XX_MODEM=m
+CONFIG_SND_VX222=m
+CONFIG_SND_YMFPCI=m
+
+#
+# ALSA MIPS devices
+#
+
+#
+# USB devices
+#
+# CONFIG_SND_USB_AUDIO is not set
+
+#
+# Open Sound System
+#
+CONFIG_SOUND_PRIME=y
+# CONFIG_OBSOLETE_OSS_DRIVER is not set
+# CONFIG_SOUND_FUSION is not set
+# CONFIG_SOUND_TRIDENT is not set
+# CONFIG_SOUND_MSNDCLAS is not set
+# CONFIG_SOUND_MSNDPIN is not set
+
+#
+# USB support
+#
+CONFIG_USB_ARCH_HAS_HCD=y
+CONFIG_USB_ARCH_HAS_OHCI=y
+CONFIG_USB=m
+# CONFIG_USB_DEBUG is not set
+
+#
+# Miscellaneous USB options
+#
+CONFIG_USB_DEVICEFS=y
+# CONFIG_USB_DYNAMIC_MINORS is not set
+# CONFIG_USB_OTG is not set
+
+#
+# USB Host Controller Drivers
+#
+CONFIG_USB_EHCI_HCD=m
+# CONFIG_USB_EHCI_SPLIT_ISO is not set
+# CONFIG_USB_EHCI_ROOT_HUB_TT is not set
+CONFIG_USB_ISP116X_HCD=m
+CONFIG_USB_OHCI_HCD=m
+CONFIG_USB_OHCI_LITTLE_ENDIAN=y
+CONFIG_USB_UHCI_HCD=m
+CONFIG_USB_SL811_HCD=m
+
+#
+# USB Device Class drivers
+#
+# CONFIG_OBSOLETE_OSS_USB_DRIVER is not set
+# CONFIG_USB_ACM is not set
+# CONFIG_USB_PRINTER is not set
+
+#
+# NOTE: USB_STORAGE enables SCSI, and 'SCSI disk support'
+#
+
+#
+# may also be needed; see USB_STORAGE Help for more information
+#
+CONFIG_USB_STORAGE=m
+# CONFIG_USB_STORAGE_DEBUG is not set
+# CONFIG_USB_STORAGE_DATAFAB is not set
+# CONFIG_USB_STORAGE_FREECOM is not set
+# CONFIG_USB_STORAGE_ISD200 is not set
+# CONFIG_USB_STORAGE_DPCM is not set
+# CONFIG_USB_STORAGE_USBAT is not set
+# CONFIG_USB_STORAGE_SDDR09 is not set
+# CONFIG_USB_STORAGE_SDDR55 is not set
+# CONFIG_USB_STORAGE_JUMPSHOT is not set
+CONFIG_USB_STORAGE_ALAUDA=y
+# CONFIG_USB_STORAGE_ONETOUCH is not set
+# CONFIG_USB_LIBUSUAL is not set
+
+#
+# USB Input Devices
+#
+CONFIG_USB_HID=m
+# CONFIG_USB_HIDINPUT_POWERBOOK is not set
+# CONFIG_HID_FF is not set
+CONFIG_USB_HIDDEV=y
+
+#
+# USB HID Boot Protocol drivers
+#
+# CONFIG_USB_KBD is not set
+# CONFIG_USB_MOUSE is not set
+
+#
+# USB Imaging devices
+#
+# CONFIG_USB_MDC800 is not set
+# CONFIG_USB_MICROTEK is not set
+
+#
+# USB Multimedia devices
+#
+# CONFIG_USB_VICAM is not set
+# CONFIG_USB_DSBR is not set
+CONFIG_USB_ET61X251=m
+# CONFIG_USB_IBMCAM is not set
+# CONFIG_USB_KONICAWC is not set
+# CONFIG_USB_OV511 is not set
+# CONFIG_USB_SE401 is not set
+# CONFIG_USB_SN9C102 is not set
+# CONFIG_USB_STV680 is not set
+# CONFIG_USB_PWC is not set
+
+#
+# USB Network Adapters
+#
+# CONFIG_USB_CATC is not set
+# CONFIG_USB_KAWETH is not set
+# CONFIG_USB_PEGASUS is not set
+# CONFIG_USB_RTL8150 is not set
+# CONFIG_USB_USBNET is not set
+CONFIG_USB_MON=y
+
+#
+# USB port drivers
+#
+# CONFIG_USB_USS720 is not set
+
+#
+# USB Miscellaneous drivers
+#
+# CONFIG_USB_AUERSWALD is not set
+# CONFIG_USB_RIO500 is not set
+# CONFIG_USB_LEGOTOWER is not set
+# CONFIG_USB_LCD is not set
+# CONFIG_USB_LED is not set
+# CONFIG_USB_CYTHERM is not set
+# CONFIG_USB_PHIDGETKIT is not set
+# CONFIG_USB_PHIDGETSERVO is not set
+# CONFIG_USB_IDMOUSE is not set
+CONFIG_USB_SISUSBVGA=m
+# CONFIG_USB_SISUSBVGA_CON is not set
+# CONFIG_USB_LD is not set
+# CONFIG_USB_TEST is not set
+
+#
+# USB DSL modem support
+#
+
+#
+# USB Gadget Support
+#
+# CONFIG_USB_GADGET is not set
+
+#
+# MMC/SD Card support
+#
+# CONFIG_MMC is not set
+
+#
+# InfiniBand support
+#
+# CONFIG_INFINIBAND is not set
+
+#
+# SN Devices
+#
+
+#
+# EDAC - error detection and reporting (RAS)
+#
+
+#
+# File systems
+#
+CONFIG_EXT2_FS=y
+CONFIG_EXT2_FS_XATTR=y
+CONFIG_EXT2_FS_POSIX_ACL=y
+CONFIG_EXT2_FS_SECURITY=y
+# CONFIG_EXT2_FS_XIP is not set
+CONFIG_EXT3_FS=y
+CONFIG_EXT3_FS_XATTR=y
+CONFIG_EXT3_FS_POSIX_ACL=y
+CONFIG_EXT3_FS_SECURITY=y
+CONFIG_JBD=y
+# CONFIG_JBD_DEBUG is not set
+CONFIG_FS_MBCACHE=y
+CONFIG_REISERFS_FS=m
+# CONFIG_REISERFS_CHECK is not set
+# CONFIG_REISERFS_PROC_INFO is not set
+CONFIG_REISERFS_FS_XATTR=y
+CONFIG_REISERFS_FS_POSIX_ACL=y
+# CONFIG_REISERFS_FS_SECURITY is not set
+CONFIG_JFS_FS=m
+CONFIG_JFS_POSIX_ACL=y
+# CONFIG_JFS_SECURITY is not set
+# CONFIG_JFS_DEBUG is not set
+# CONFIG_JFS_STATISTICS is not set
+CONFIG_FS_POSIX_ACL=y
+CONFIG_XFS_FS=m
+CONFIG_XFS_EXPORT=y
+# CONFIG_XFS_QUOTA is not set
+# CONFIG_XFS_SECURITY is not set
+CONFIG_XFS_POSIX_ACL=y
+CONFIG_XFS_RT=y
+CONFIG_OCFS2_FS=m
+# CONFIG_MINIX_FS is not set
+# CONFIG_ROMFS_FS is not set
+CONFIG_INOTIFY=y
+CONFIG_QUOTA=y
+CONFIG_QFMT_V1=m
+CONFIG_QFMT_V2=m
+CONFIG_QUOTACTL=y
+CONFIG_DNOTIFY=y
+CONFIG_AUTOFS_FS=m
+CONFIG_AUTOFS4_FS=m
+CONFIG_FUSE_FS=m
+
+#
+# CD-ROM/DVD Filesystems
+#
+CONFIG_ISO9660_FS=y
+CONFIG_JOLIET=y
+CONFIG_ZISOFS=y
+CONFIG_UDF_FS=y
+CONFIG_UDF_NLS=y
+
+#
+# DOS/FAT/NT Filesystems
+#
+CONFIG_FAT_FS=m
+CONFIG_MSDOS_FS=m
+CONFIG_VFAT_FS=m
+CONFIG_FAT_DEFAULT_CODEPAGE=437
+CONFIG_FAT_DEFAULT_IOCHARSET="iso8859-1"
+CONFIG_NTFS_FS=m
+# CONFIG_NTFS_DEBUG is not set
+CONFIG_NTFS_RW=y
+
+#
+# Pseudo filesystems
+#
+CONFIG_PROC_FS=y
+CONFIG_PROC_KCORE=y
+CONFIG_SYSFS=y
+CONFIG_TMPFS=y
+CONFIG_RAMFS=y
+# CONFIG_RELAYFS_FS is not set
+CONFIG_CONFIGFS_FS=m
+
+#
+# Miscellaneous filesystems
+#
+# CONFIG_ADFS_FS is not set
+# CONFIG_AFFS_FS is not set
+# CONFIG_ASFS_FS is not set
+# CONFIG_HFS_FS is not set
+# CONFIG_HFSPLUS_FS is not set
+# CONFIG_BEFS_FS is not set
+# CONFIG_BFS_FS is not set
+CONFIG_EFS_FS=m
+CONFIG_CRAMFS=y
+# CONFIG_VXFS_FS is not set
+# CONFIG_HPFS_FS is not set
+# CONFIG_QNX4FS_FS is not set
+# CONFIG_SYSV_FS is not set
+# CONFIG_UFS_FS is not set
+
+#
+# Network File Systems
+#
+CONFIG_NFS_FS=y
+# CONFIG_NFS_V3_ACL is not set
+# CONFIG_NFS_V4 is not set
+# CONFIG_NFS_DIRECTIO is not set
+CONFIG_NFSD=y
+# CONFIG_NFSD_V3_ACL is not set
+# CONFIG_NFSD_V4 is not set
+CONFIG_ROOT_NFS=y
+CONFIG_LOCKD=y
+CONFIG_LOCKD_V4=y
+CONFIG_EXPORTFS=y
+CONFIG_SUNRPC=y
+# CONFIG_RPCSEC_GSS_KRB5 is not set
+# CONFIG_RPCSEC_GSS_SPKM3 is not set
+CONFIG_SMB_FS=m
+CONFIG_SMB_NLS_DEFAULT=y
+CONFIG_SMB_NLS_REMOTE="cp437"
+CONFIG_CIFS=m
+# CONFIG_CIFS_STATS is not set
+CONFIG_CIFS_XATTR=y
+CONFIG_CIFS_POSIX=y
+# CONFIG_CIFS_EXPERIMENTAL is not set
+# CONFIG_NCP_FS is not set
+# CONFIG_CODA_FS is not set
+# CONFIG_AFS_FS is not set
+# CONFIG_9P_FS is not set
+
+#
+# Partition Types
+#
+CONFIG_PARTITION_ADVANCED=y
+# CONFIG_ACORN_PARTITION is not set
+# CONFIG_OSF_PARTITION is not set
+# CONFIG_AMIGA_PARTITION is not set
+# CONFIG_ATARI_PARTITION is not set
+# CONFIG_MAC_PARTITION is not set
+CONFIG_MSDOS_PARTITION=y
+# CONFIG_BSD_DISKLABEL is not set
+# CONFIG_MINIX_SUBPARTITION is not set
+# CONFIG_SOLARIS_X86_PARTITION is not set
+# CONFIG_UNIXWARE_DISKLABEL is not set
+# CONFIG_LDM_PARTITION is not set
+CONFIG_SGI_PARTITION=y
+# CONFIG_ULTRIX_PARTITION is not set
+# CONFIG_SUN_PARTITION is not set
+CONFIG_KARMA_PARTITION=y
+# CONFIG_EFI_PARTITION is not set
+
+#
+# Native Language Support
+#
+CONFIG_NLS=y
+CONFIG_NLS_DEFAULT="iso8859-1"
+CONFIG_NLS_CODEPAGE_437=m
+CONFIG_NLS_CODEPAGE_737=m
+CONFIG_NLS_CODEPAGE_775=m
+CONFIG_NLS_CODEPAGE_850=m
+CONFIG_NLS_CODEPAGE_852=m
+CONFIG_NLS_CODEPAGE_855=m
+CONFIG_NLS_CODEPAGE_857=m
+CONFIG_NLS_CODEPAGE_860=m
+CONFIG_NLS_CODEPAGE_861=m
+CONFIG_NLS_CODEPAGE_862=m
+CONFIG_NLS_CODEPAGE_863=m
+CONFIG_NLS_CODEPAGE_864=m
+CONFIG_NLS_CODEPAGE_865=m
+CONFIG_NLS_CODEPAGE_866=m
+CONFIG_NLS_CODEPAGE_869=m
+CONFIG_NLS_CODEPAGE_936=m
+CONFIG_NLS_CODEPAGE_950=m
+CONFIG_NLS_CODEPAGE_932=m
+CONFIG_NLS_CODEPAGE_949=m
+CONFIG_NLS_CODEPAGE_874=m
+CONFIG_NLS_ISO8859_8=m
+CONFIG_NLS_CODEPAGE_1250=m
+CONFIG_NLS_CODEPAGE_1251=m
+CONFIG_NLS_ASCII=m
+CONFIG_NLS_ISO8859_1=m
+CONFIG_NLS_ISO8859_2=m
+CONFIG_NLS_ISO8859_3=m
+CONFIG_NLS_ISO8859_4=m
+CONFIG_NLS_ISO8859_5=m
+CONFIG_NLS_ISO8859_6=m
+CONFIG_NLS_ISO8859_7=m
+CONFIG_NLS_ISO8859_9=m
+CONFIG_NLS_ISO8859_13=m
+CONFIG_NLS_ISO8859_14=m
+CONFIG_NLS_ISO8859_15=m
+CONFIG_NLS_KOI8_R=m
+CONFIG_NLS_KOI8_U=m
+CONFIG_NLS_UTF8=m
+
+#
+# Profiling support
+#
+CONFIG_PROFILING=y
+# CONFIG_OPROFILE is not set
+
+#
+# Kernel hacking
+#
+# CONFIG_PRINTK_TIME is not set
+CONFIG_MAGIC_SYSRQ=y
+# CONFIG_DEBUG_KERNEL is not set
+CONFIG_LOG_BUF_SHIFT=15
+# CONFIG_CROSSCOMPILE is not set
+CONFIG_CMDLINE=""
+# CONFIG_SB1XXX_CORELIS is not set
+
+#
+# Security options
+#
+CONFIG_KEYS=y
+# CONFIG_KEYS_DEBUG_PROC_KEYS is not set
+CONFIG_SECURITY=y
+CONFIG_SECURITY_NETWORK=y
+CONFIG_SECURITY_NETWORK_XFRM=y
+CONFIG_SECURITY_CAPABILITIES=y
+CONFIG_SECURITY_SELINUX=y
+CONFIG_SECURITY_SELINUX_BOOTPARAM=y
+CONFIG_SECURITY_SELINUX_BOOTPARAM_VALUE=0
+CONFIG_SECURITY_SELINUX_DISABLE=y
+CONFIG_SECURITY_SELINUX_DEVELOP=y
+CONFIG_SECURITY_SELINUX_AVC_STATS=y
+CONFIG_SECURITY_SELINUX_CHECKREQPROT_VALUE=1
+
+#
+# Cryptographic options
+#
+CONFIG_CRYPTO=y
+CONFIG_CRYPTO_HMAC=y
+CONFIG_CRYPTO_NULL=m
+CONFIG_CRYPTO_MD4=m
+CONFIG_CRYPTO_MD5=y
+CONFIG_CRYPTO_SHA1=m
+CONFIG_CRYPTO_SHA256=m
+CONFIG_CRYPTO_SHA512=m
+CONFIG_CRYPTO_WP512=m
+CONFIG_CRYPTO_TGR192=m
+CONFIG_CRYPTO_DES=m
+CONFIG_CRYPTO_BLOWFISH=m
+CONFIG_CRYPTO_TWOFISH=m
+CONFIG_CRYPTO_SERPENT=m
+CONFIG_CRYPTO_AES=m
+CONFIG_CRYPTO_CAST5=m
+CONFIG_CRYPTO_CAST6=m
+CONFIG_CRYPTO_TEA=m
+CONFIG_CRYPTO_ARC4=m
+CONFIG_CRYPTO_KHAZAD=m
+CONFIG_CRYPTO_ANUBIS=m
+CONFIG_CRYPTO_DEFLATE=m
+CONFIG_CRYPTO_MICHAEL_MIC=m
+CONFIG_CRYPTO_CRC32C=m
+CONFIG_CRYPTO_TEST=m
+
+#
+# Hardware crypto devices
+#
+
+#
+# Library routines
+#
+CONFIG_CRC_CCITT=m
+# CONFIG_CRC16 is not set
+CONFIG_CRC32=y
+CONFIG_LIBCRC32C=m
+CONFIG_ZLIB_INFLATE=y
+CONFIG_ZLIB_DEFLATE=m
+CONFIG_TEXTSEARCH=y
+CONFIG_TEXTSEARCH_KMP=m
+CONFIG_TEXTSEARCH_BM=m
+CONFIG_TEXTSEARCH_FSM=m
+CONFIG_SND_SEQUENCER_OSS=y
+# CONFIG_SOUND_EMU10K1 is not set
+CONFIG_SND_VIRMIDI=m
+CONFIG_VIDEO_BUF=m
+# CONFIG_USB_W9968CF is not set
+CONFIG_SND_SEQ_DUMMY=m
+CONFIG_SND_SERIAL_U16550=m
+CONFIG_MSNDPIN_INIT_FILE="/etc/sound/pndspini.bin"
+CONFIG_MSNDPIN_PERM_FILE="/etc/sound/pndsperm.bin"
+CONFIG_MSNDCLAS_INIT_FILE="/etc/sound/msndinit.bin"
+CONFIG_MSNDCLAS_PERM_FILE="/etc/sound/msndperm.bin"

Added: dists/sid/linux-2.6/debian/config/mips/defines
==============================================================================
--- (empty file)
+++ dists/sid/linux-2.6/debian/config/mips/defines	Mon Nov 26 20:06:56 2007
@@ -0,0 +1,43 @@
+[base]
+flavours:
+ r4k-ip22
+ r5k-ip32
+ sb1-bcm91250a
+ sb1a-bcm91480b
+ 4kc-malta
+ 5kc-malta
+ qemu
+kernel-arch: mips
+kernel-header-dirs: mips
+
+[image]
+initramfs: false
+type: kernel-package
+
+[r4k-ip22_base]
+class: SGI IP22
+longclass: SGI IP22 (Indy, Indigo2)
+
+[r5k-ip32_base]
+class: SGI IP32
+longclass: SGI IP32 (O2)
+
+[sb1-bcm91250a_base]
+class: BCM91250A
+longclass: Broadcom BCM91250A (aka SWARM)
+
+[sb1a-bcm91480b_base]
+class: BCM91480B
+longclass: Broadcom BCM91480B (aka BigSur)
+
+[4kc-malta_base]
+class: MIPS Malta
+longclass: MIPS Malta board
+
+[5kc-malta_base]
+class: MIPS Malta (64-bit)
+longclass: MIPS Malta board (64-bit)
+
+[qemu_base]
+class: QEMU
+longclass: QEMU virtual machine

Added: dists/sid/linux-2.6/debian/config/mipsel/config
==============================================================================
--- (empty file)
+++ dists/sid/linux-2.6/debian/config/mipsel/config	Mon Nov 26 20:06:56 2007
@@ -0,0 +1 @@
+CONFIG_MIPS=y

Added: dists/sid/linux-2.6/debian/config/mipsel/config.4kc-malta
==============================================================================
--- (empty file)
+++ dists/sid/linux-2.6/debian/config/mipsel/config.4kc-malta	Mon Nov 26 20:06:56 2007
@@ -0,0 +1,2760 @@
+#
+# Machine selection
+#
+# CONFIG_MIPS_MTX1 is not set
+# CONFIG_MIPS_BOSPORUS is not set
+# CONFIG_MIPS_PB1000 is not set
+# CONFIG_MIPS_PB1100 is not set
+# CONFIG_MIPS_PB1500 is not set
+# CONFIG_MIPS_PB1550 is not set
+# CONFIG_MIPS_PB1200 is not set
+# CONFIG_MIPS_DB1000 is not set
+# CONFIG_MIPS_DB1100 is not set
+# CONFIG_MIPS_DB1500 is not set
+# CONFIG_MIPS_DB1550 is not set
+# CONFIG_MIPS_DB1200 is not set
+# CONFIG_MIPS_MIRAGE is not set
+# CONFIG_BASLER_EXCITE is not set
+# CONFIG_MIPS_COBALT is not set
+# CONFIG_MACH_DECSTATION is not set
+# CONFIG_MIPS_EV64120 is not set
+# CONFIG_MACH_JAZZ is not set
+# CONFIG_LASAT is not set
+# CONFIG_MIPS_ATLAS is not set
+CONFIG_MIPS_MALTA=y
+# CONFIG_MIPS_SEAD is not set
+# CONFIG_WR_PPMC is not set
+# CONFIG_MIPS_SIM is not set
+# CONFIG_MOMENCO_JAGUAR_ATX is not set
+# CONFIG_MOMENCO_OCELOT is not set
+# CONFIG_MOMENCO_OCELOT_3 is not set
+# CONFIG_MOMENCO_OCELOT_C is not set
+# CONFIG_MOMENCO_OCELOT_G is not set
+# CONFIG_MIPS_XXS1500 is not set
+# CONFIG_PNX8550_V2PCI is not set
+# CONFIG_PNX8550_JBS is not set
+# CONFIG_PNX8550_STB810 is not set
+# CONFIG_DDB5477 is not set
+# CONFIG_MACH_VR41XX is not set
+# CONFIG_PMC_YOSEMITE is not set
+# CONFIG_QEMU is not set
+# CONFIG_MARKEINS is not set
+# CONFIG_SGI_IP22 is not set
+# CONFIG_SGI_IP27 is not set
+# CONFIG_SGI_IP32 is not set
+# CONFIG_SIBYTE_BIGSUR is not set
+# CONFIG_SIBYTE_SWARM is not set
+# CONFIG_SIBYTE_SENTOSA is not set
+# CONFIG_SIBYTE_RHONE is not set
+# CONFIG_SIBYTE_CARMEL is not set
+# CONFIG_SIBYTE_PTSWARM is not set
+# CONFIG_SIBYTE_LITTLESUR is not set
+# CONFIG_SIBYTE_CRHINE is not set
+# CONFIG_SIBYTE_CRHONE is not set
+# CONFIG_SNI_RM is not set
+# CONFIG_TOSHIBA_JMR3927 is not set
+# CONFIG_TOSHIBA_RBTX4927 is not set
+# CONFIG_TOSHIBA_RBTX4938 is not set
+# CONFIG_KEXEC is not set
+CONFIG_RWSEM_GENERIC_SPINLOCK=y
+# CONFIG_ARCH_HAS_ILOG2_U32 is not set
+# CONFIG_ARCH_HAS_ILOG2_U64 is not set
+CONFIG_GENERIC_FIND_NEXT_BIT=y
+CONFIG_GENERIC_HWEIGHT=y
+CONFIG_GENERIC_CALIBRATE_DELAY=y
+CONFIG_GENERIC_TIME=y
+CONFIG_SCHED_NO_NO_OMIT_FRAME_POINTER=y
+# CONFIG_GENERIC_HARDIRQS_NO__DO_IRQ is not set
+CONFIG_ARCH_MAY_HAVE_PC_FDC=y
+CONFIG_DMA_NONCOHERENT=y
+CONFIG_DMA_NEED_PCI_MAP_STATE=y
+CONFIG_GENERIC_ISA_DMA=y
+CONFIG_I8259=y
+CONFIG_MIPS_BONITO64=y
+CONFIG_MIPS_MSC=y
+# CONFIG_CPU_BIG_ENDIAN is not set
+CONFIG_CPU_LITTLE_ENDIAN=y
+CONFIG_SYS_SUPPORTS_BIG_ENDIAN=y
+CONFIG_SYS_SUPPORTS_LITTLE_ENDIAN=y
+CONFIG_IRQ_CPU=y
+CONFIG_MIPS_BOARDS_GEN=y
+CONFIG_MIPS_GT64120=y
+CONFIG_SWAP_IO_SPACE=y
+CONFIG_BOOT_ELF32=y
+CONFIG_MIPS_L1_CACHE_SHIFT=5
+CONFIG_HAVE_STD_PC_SERIAL_PORT=y
+
+#
+# CPU selection
+#
+CONFIG_CPU_MIPS32_R1=y
+# CONFIG_CPU_MIPS32_R2 is not set
+# CONFIG_CPU_MIPS64_R1 is not set
+# CONFIG_CPU_MIPS64_R2 is not set
+# CONFIG_CPU_R3000 is not set
+# CONFIG_CPU_TX39XX is not set
+# CONFIG_CPU_VR41XX is not set
+# CONFIG_CPU_R4300 is not set
+# CONFIG_CPU_R4X00 is not set
+# CONFIG_CPU_TX49XX is not set
+# CONFIG_CPU_R5000 is not set
+# CONFIG_CPU_R5432 is not set
+# CONFIG_CPU_R6000 is not set
+# CONFIG_CPU_NEVADA is not set
+# CONFIG_CPU_R8000 is not set
+# CONFIG_CPU_R10000 is not set
+# CONFIG_CPU_RM7000 is not set
+# CONFIG_CPU_RM9000 is not set
+# CONFIG_CPU_SB1 is not set
+CONFIG_SYS_HAS_CPU_MIPS32_R1=y
+CONFIG_SYS_HAS_CPU_MIPS32_R2=y
+CONFIG_SYS_HAS_CPU_MIPS64_R1=y
+CONFIG_SYS_HAS_CPU_NEVADA=y
+CONFIG_SYS_HAS_CPU_RM7000=y
+CONFIG_CPU_MIPS32=y
+CONFIG_CPU_MIPSR1=y
+CONFIG_SYS_SUPPORTS_32BIT_KERNEL=y
+CONFIG_SYS_SUPPORTS_64BIT_KERNEL=y
+CONFIG_CPU_SUPPORTS_32BIT_KERNEL=y
+
+#
+# Kernel type
+#
+CONFIG_32BIT=y
+# CONFIG_64BIT is not set
+CONFIG_PAGE_SIZE_4KB=y
+# CONFIG_PAGE_SIZE_8KB is not set
+# CONFIG_PAGE_SIZE_16KB is not set
+# CONFIG_PAGE_SIZE_64KB is not set
+CONFIG_BOARD_SCACHE=y
+CONFIG_MIPS_CPU_SCACHE=y
+CONFIG_CPU_HAS_PREFETCH=y
+CONFIG_MIPS_MT_DISABLED=y
+# CONFIG_MIPS_MT_SMP is not set
+# CONFIG_MIPS_MT_SMTC is not set
+# CONFIG_MIPS_VPE_LOADER is not set
+CONFIG_SYS_SUPPORTS_MULTITHREADING=y
+# CONFIG_64BIT_PHYS_ADDR is not set
+CONFIG_CPU_HAS_LLSC=y
+CONFIG_CPU_HAS_SYNC=y
+CONFIG_GENERIC_HARDIRQS=y
+CONFIG_GENERIC_IRQ_PROBE=y
+CONFIG_CPU_SUPPORTS_HIGHMEM=y
+CONFIG_ARCH_FLATMEM_ENABLE=y
+CONFIG_SELECT_MEMORY_MODEL=y
+CONFIG_FLATMEM_MANUAL=y
+# CONFIG_DISCONTIGMEM_MANUAL is not set
+# CONFIG_SPARSEMEM_MANUAL is not set
+CONFIG_FLATMEM=y
+CONFIG_FLAT_NODE_MEM_MAP=y
+# CONFIG_SPARSEMEM_STATIC is not set
+CONFIG_SPLIT_PTLOCK_CPUS=4
+# CONFIG_RESOURCES_64BIT is not set
+# CONFIG_HZ_48 is not set
+# CONFIG_HZ_100 is not set
+# CONFIG_HZ_128 is not set
+CONFIG_HZ_250=y
+# CONFIG_HZ_256 is not set
+# CONFIG_HZ_1000 is not set
+# CONFIG_HZ_1024 is not set
+CONFIG_SYS_SUPPORTS_ARBIT_HZ=y
+CONFIG_HZ=250
+CONFIG_PREEMPT_NONE=y
+# CONFIG_PREEMPT_VOLUNTARY is not set
+# CONFIG_PREEMPT is not set
+CONFIG_STACKTRACE_SUPPORT=y
+CONFIG_DEFCONFIG_LIST="/lib/modules/$UNAME_RELEASE/.config"
+
+#
+# Code maturity level options
+#
+CONFIG_EXPERIMENTAL=y
+CONFIG_BROKEN_ON_SMP=y
+
+#
+# General setup
+#
+CONFIG_LOCALVERSION=""
+# CONFIG_LOCALVERSION_AUTO is not set
+CONFIG_SWAP=y
+CONFIG_SYSVIPC=y
+CONFIG_POSIX_MQUEUE=y
+CONFIG_BSD_PROCESS_ACCT=y
+CONFIG_BSD_PROCESS_ACCT_V3=y
+# CONFIG_TASKSTATS is not set
+CONFIG_AUDIT=y
+CONFIG_IKCONFIG=y
+CONFIG_IKCONFIG_PROC=y
+CONFIG_SYSFS_DEPRECATED=y
+CONFIG_INITRAMFS_SOURCE=""
+# CONFIG_CC_OPTIMIZE_FOR_SIZE is not set
+CONFIG_EMBEDDED=y
+CONFIG_SYSCTL_SYSCALL=y
+CONFIG_HOTPLUG=y
+CONFIG_BASE_FULL=y
+CONFIG_SLAB=y
+CONFIG_BASE_SMALL=0
+# CONFIG_SLOB is not set
+
+#
+# Loadable module support
+#
+CONFIG_MODULES=y
+CONFIG_MODULE_UNLOAD=y
+CONFIG_MODULE_FORCE_UNLOAD=y
+CONFIG_MODVERSIONS=y
+# CONFIG_MODULE_SRCVERSION_ALL is not set
+CONFIG_KMOD=y
+
+#
+# Block layer
+#
+# CONFIG_LBD is not set
+# CONFIG_BLK_DEV_IO_TRACE is not set
+# CONFIG_LSF is not set
+
+#
+# IO Schedulers
+#
+CONFIG_IOSCHED_NOOP=y
+CONFIG_IOSCHED_AS=y
+CONFIG_IOSCHED_DEADLINE=y
+CONFIG_IOSCHED_CFQ=y
+# CONFIG_DEFAULT_AS is not set
+# CONFIG_DEFAULT_DEADLINE is not set
+CONFIG_DEFAULT_CFQ=y
+# CONFIG_DEFAULT_NOOP is not set
+CONFIG_DEFAULT_IOSCHED="cfq"
+
+#
+# Bus options (PCI, PCMCIA, EISA, ISA, TC)
+#
+CONFIG_HW_HAS_PCI=y
+CONFIG_PCI=y
+CONFIG_MMU=y
+
+#
+# PCCARD (PCMCIA/CardBus) support
+#
+# CONFIG_PCCARD is not set
+
+#
+# PCI Hotplug Support
+#
+# CONFIG_HOTPLUG_PCI is not set
+
+#
+# Executable file formats
+#
+CONFIG_BINFMT_ELF=y
+CONFIG_BINFMT_MISC=m
+CONFIG_TRAD_SIGNALS=y
+
+#
+# Networking
+#
+CONFIG_NET=y
+
+#
+# Networking options
+#
+CONFIG_PACKET=y
+CONFIG_PACKET_MMAP=y
+CONFIG_UNIX=y
+CONFIG_XFRM=y
+CONFIG_XFRM_USER=m
+# CONFIG_XFRM_SUB_POLICY is not set
+CONFIG_NET_KEY=m
+CONFIG_INET=y
+CONFIG_IP_MULTICAST=y
+CONFIG_IP_ADVANCED_ROUTER=y
+CONFIG_ASK_IP_FIB_HASH=y
+# CONFIG_IP_FIB_TRIE is not set
+CONFIG_IP_FIB_HASH=y
+CONFIG_IP_MULTIPLE_TABLES=y
+CONFIG_IP_ROUTE_MULTIPATH=y
+CONFIG_IP_ROUTE_VERBOSE=y
+# CONFIG_IP_PNP is not set
+CONFIG_NET_IPIP=m
+CONFIG_NET_IPGRE=m
+CONFIG_NET_IPGRE_BROADCAST=y
+CONFIG_IP_MROUTE=y
+CONFIG_IP_PIMSM_V1=y
+CONFIG_IP_PIMSM_V2=y
+# CONFIG_ARPD is not set
+CONFIG_SYN_COOKIES=y
+CONFIG_INET_AH=m
+CONFIG_INET_ESP=m
+CONFIG_INET_IPCOMP=m
+CONFIG_INET_XFRM_TUNNEL=m
+CONFIG_INET_TUNNEL=m
+CONFIG_INET_XFRM_MODE_TRANSPORT=m
+CONFIG_INET_XFRM_MODE_TUNNEL=m
+CONFIG_INET_XFRM_MODE_BEET=m
+CONFIG_INET_DIAG=m
+CONFIG_INET_TCP_DIAG=m
+CONFIG_TCP_CONG_ADVANCED=y
+CONFIG_TCP_CONG_BIC=y
+CONFIG_TCP_CONG_CUBIC=m
+CONFIG_TCP_CONG_WESTWOOD=m
+CONFIG_TCP_CONG_HTCP=m
+CONFIG_TCP_CONG_HSTCP=m
+CONFIG_TCP_CONG_HYBLA=m
+CONFIG_TCP_CONG_VEGAS=m
+CONFIG_TCP_CONG_SCALABLE=m
+CONFIG_TCP_CONG_LP=m
+CONFIG_TCP_CONG_VENO=m
+CONFIG_DEFAULT_BIC=y
+# CONFIG_DEFAULT_CUBIC is not set
+# CONFIG_DEFAULT_HTCP is not set
+# CONFIG_DEFAULT_VEGAS is not set
+# CONFIG_DEFAULT_WESTWOOD is not set
+# CONFIG_DEFAULT_RENO is not set
+CONFIG_DEFAULT_TCP_CONG="bic"
+# CONFIG_TCP_MD5SIG is not set
+
+#
+# IP: Virtual Server Configuration
+#
+CONFIG_IP_VS=m
+# CONFIG_IP_VS_DEBUG is not set
+CONFIG_IP_VS_TAB_BITS=12
+
+#
+# IPVS transport protocol load balancing support
+#
+CONFIG_IP_VS_PROTO_TCP=y
+CONFIG_IP_VS_PROTO_UDP=y
+CONFIG_IP_VS_PROTO_ESP=y
+CONFIG_IP_VS_PROTO_AH=y
+
+#
+# IPVS scheduler
+#
+CONFIG_IP_VS_RR=m
+CONFIG_IP_VS_WRR=m
+CONFIG_IP_VS_LC=m
+CONFIG_IP_VS_WLC=m
+CONFIG_IP_VS_LBLC=m
+CONFIG_IP_VS_LBLCR=m
+CONFIG_IP_VS_DH=m
+CONFIG_IP_VS_SH=m
+CONFIG_IP_VS_SED=m
+CONFIG_IP_VS_NQ=m
+
+#
+# IPVS application helper
+#
+CONFIG_IP_VS_FTP=m
+CONFIG_IPV6=m
+CONFIG_IPV6_PRIVACY=y
+# CONFIG_IPV6_ROUTER_PREF is not set
+CONFIG_INET6_AH=m
+CONFIG_INET6_ESP=m
+CONFIG_INET6_IPCOMP=m
+# CONFIG_IPV6_MIP6 is not set
+CONFIG_INET6_XFRM_TUNNEL=m
+CONFIG_INET6_TUNNEL=m
+CONFIG_INET6_XFRM_MODE_TRANSPORT=m
+CONFIG_INET6_XFRM_MODE_TUNNEL=m
+CONFIG_INET6_XFRM_MODE_BEET=m
+CONFIG_INET6_XFRM_MODE_ROUTEOPTIMIZATION=m
+CONFIG_IPV6_SIT=m
+CONFIG_IPV6_TUNNEL=m
+# CONFIG_IPV6_MULTIPLE_TABLES is not set
+# CONFIG_NETLABEL is not set
+CONFIG_NETWORK_SECMARK=y
+CONFIG_NETFILTER=y
+# CONFIG_NETFILTER_DEBUG is not set
+CONFIG_BRIDGE_NETFILTER=y
+
+#
+# Core Netfilter Configuration
+#
+CONFIG_NETFILTER_NETLINK=m
+CONFIG_NETFILTER_NETLINK_QUEUE=m
+CONFIG_NETFILTER_NETLINK_LOG=m
+CONFIG_NF_CONNTRACK_ENABLED=m
+CONFIG_NF_CONNTRACK=m
+CONFIG_NF_CT_ACCT=y
+CONFIG_NF_CONNTRACK_MARK=y
+CONFIG_NF_CONNTRACK_SECMARK=y
+CONFIG_NF_CONNTRACK_EVENTS=y
+CONFIG_NF_CT_PROTO_GRE=m
+CONFIG_NF_CT_PROTO_SCTP=m
+CONFIG_NF_CONNTRACK_FTP=m
+CONFIG_NF_CONNTRACK_H323=m
+CONFIG_NF_CONNTRACK_IRC=m
+CONFIG_NF_CONNTRACK_NETBIOS_NS=m
+CONFIG_NF_CONNTRACK_PPTP=m
+CONFIG_NF_CONNTRACK_SIP=m
+CONFIG_NF_CT_NETLINK=m
+CONFIG_NETFILTER_XTABLES=m
+CONFIG_NETFILTER_XT_TARGET_CLASSIFY=m
+CONFIG_NETFILTER_XT_TARGET_CONNMARK=m
+CONFIG_NETFILTER_XT_TARGET_DSCP=m
+CONFIG_NETFILTER_XT_TARGET_MARK=m
+CONFIG_NETFILTER_XT_TARGET_NFQUEUE=m
+CONFIG_NETFILTER_XT_TARGET_NFLOG=m
+CONFIG_NETFILTER_XT_TARGET_NOTRACK=m
+CONFIG_NETFILTER_XT_TARGET_SECMARK=m
+CONFIG_NETFILTER_XT_TARGET_CONNSECMARK=m
+CONFIG_NETFILTER_XT_MATCH_COMMENT=m
+CONFIG_NETFILTER_XT_MATCH_CONNBYTES=m
+CONFIG_NETFILTER_XT_MATCH_CONNMARK=m
+CONFIG_NETFILTER_XT_MATCH_CONNTRACK=m
+CONFIG_NETFILTER_XT_MATCH_DCCP=m
+CONFIG_NETFILTER_XT_MATCH_DSCP=m
+CONFIG_NETFILTER_XT_MATCH_ESP=m
+CONFIG_NETFILTER_XT_MATCH_HELPER=m
+CONFIG_NETFILTER_XT_MATCH_LENGTH=m
+CONFIG_NETFILTER_XT_MATCH_LIMIT=m
+CONFIG_NETFILTER_XT_MATCH_MAC=m
+CONFIG_NETFILTER_XT_MATCH_MARK=m
+CONFIG_NETFILTER_XT_MATCH_POLICY=m
+CONFIG_NETFILTER_XT_MATCH_MULTIPORT=m
+CONFIG_NETFILTER_XT_MATCH_PHYSDEV=m
+CONFIG_NETFILTER_XT_MATCH_PKTTYPE=m
+CONFIG_NETFILTER_XT_MATCH_QUOTA=m
+CONFIG_NETFILTER_XT_MATCH_REALM=m
+CONFIG_NETFILTER_XT_MATCH_SCTP=m
+CONFIG_NETFILTER_XT_MATCH_STATE=m
+CONFIG_NETFILTER_XT_MATCH_STATISTIC=m
+CONFIG_NETFILTER_XT_MATCH_STRING=m
+CONFIG_NETFILTER_XT_MATCH_TCPMSS=m
+CONFIG_NETFILTER_XT_MATCH_HASHLIMIT=m
+
+#
+# IP: Netfilter Configuration
+#
+CONFIG_NF_CONNTRACK_IPV4=m
+CONFIG_NF_CONNTRACK_PROC_COMPAT=y
+CONFIG_IP_NF_QUEUE=m
+CONFIG_IP_NF_IPTABLES=m
+CONFIG_IP_NF_MATCH_IPRANGE=m
+CONFIG_IP_NF_MATCH_TOS=m
+CONFIG_IP_NF_MATCH_RECENT=m
+CONFIG_IP_NF_MATCH_ECN=m
+CONFIG_IP_NF_MATCH_AH=m
+CONFIG_IP_NF_MATCH_TTL=m
+CONFIG_IP_NF_MATCH_OWNER=m
+CONFIG_IP_NF_MATCH_ADDRTYPE=m
+CONFIG_IP_NF_FILTER=m
+CONFIG_IP_NF_TARGET_REJECT=m
+CONFIG_IP_NF_TARGET_LOG=m
+CONFIG_IP_NF_TARGET_ULOG=m
+CONFIG_IP_NF_TARGET_TCPMSS=m
+CONFIG_NF_NAT=m
+CONFIG_NF_NAT_NEEDED=y
+CONFIG_IP_NF_TARGET_MASQUERADE=m
+CONFIG_IP_NF_TARGET_REDIRECT=m
+CONFIG_IP_NF_TARGET_NETMAP=m
+CONFIG_IP_NF_TARGET_SAME=m
+CONFIG_NF_NAT_SNMP_BASIC=m
+CONFIG_NF_NAT_PROTO_GRE=m
+CONFIG_NF_NAT_FTP=m
+CONFIG_NF_NAT_IRC=m
+CONFIG_NF_NAT_TFTP=m
+CONFIG_NF_NAT_AMANDA=m
+CONFIG_NF_NAT_PPTP=m
+CONFIG_NF_NAT_H323=m
+CONFIG_NF_NAT_SIP=m
+CONFIG_IP_NF_MANGLE=m
+CONFIG_IP_NF_TARGET_TOS=m
+CONFIG_IP_NF_TARGET_ECN=m
+CONFIG_IP_NF_TARGET_TTL=m
+CONFIG_IP_NF_TARGET_CLUSTERIP=m
+CONFIG_IP_NF_RAW=m
+CONFIG_IP_NF_ARPTABLES=m
+CONFIG_IP_NF_ARPFILTER=m
+CONFIG_IP_NF_ARP_MANGLE=m
+
+#
+# IPv6: Netfilter Configuration (EXPERIMENTAL)
+#
+CONFIG_NF_CONNTRACK_IPV6=m
+CONFIG_IP6_NF_QUEUE=m
+CONFIG_IP6_NF_IPTABLES=m
+CONFIG_IP6_NF_MATCH_RT=m
+CONFIG_IP6_NF_MATCH_OPTS=m
+CONFIG_IP6_NF_MATCH_FRAG=m
+CONFIG_IP6_NF_MATCH_HL=m
+CONFIG_IP6_NF_MATCH_OWNER=m
+CONFIG_IP6_NF_MATCH_IPV6HEADER=m
+CONFIG_IP6_NF_MATCH_AH=m
+CONFIG_IP6_NF_MATCH_EUI64=m
+CONFIG_IP6_NF_FILTER=m
+CONFIG_IP6_NF_TARGET_LOG=m
+CONFIG_IP6_NF_TARGET_REJECT=m
+CONFIG_IP6_NF_MANGLE=m
+CONFIG_IP6_NF_TARGET_HL=m
+CONFIG_IP6_NF_RAW=m
+
+#
+# DECnet: Netfilter Configuration
+#
+CONFIG_DECNET_NF_GRABULATOR=m
+
+#
+# Bridge: Netfilter Configuration
+#
+CONFIG_BRIDGE_NF_EBTABLES=m
+CONFIG_BRIDGE_EBT_BROUTE=m
+CONFIG_BRIDGE_EBT_T_FILTER=m
+CONFIG_BRIDGE_EBT_T_NAT=m
+CONFIG_BRIDGE_EBT_802_3=m
+CONFIG_BRIDGE_EBT_AMONG=m
+CONFIG_BRIDGE_EBT_ARP=m
+CONFIG_BRIDGE_EBT_IP=m
+CONFIG_BRIDGE_EBT_LIMIT=m
+CONFIG_BRIDGE_EBT_MARK=m
+CONFIG_BRIDGE_EBT_PKTTYPE=m
+CONFIG_BRIDGE_EBT_STP=m
+CONFIG_BRIDGE_EBT_VLAN=m
+CONFIG_BRIDGE_EBT_ARPREPLY=m
+CONFIG_BRIDGE_EBT_DNAT=m
+CONFIG_BRIDGE_EBT_MARK_T=m
+CONFIG_BRIDGE_EBT_REDIRECT=m
+CONFIG_BRIDGE_EBT_SNAT=m
+CONFIG_BRIDGE_EBT_LOG=m
+CONFIG_BRIDGE_EBT_ULOG=m
+
+#
+# DCCP Configuration (EXPERIMENTAL)
+#
+CONFIG_IP_DCCP=m
+CONFIG_INET_DCCP_DIAG=m
+CONFIG_IP_DCCP_ACKVEC=y
+
+#
+# DCCP CCIDs Configuration (EXPERIMENTAL)
+#
+CONFIG_IP_DCCP_CCID2=m
+# CONFIG_IP_DCCP_CCID2_DEBUG is not set
+CONFIG_IP_DCCP_CCID3=m
+CONFIG_IP_DCCP_TFRC_LIB=m
+# CONFIG_IP_DCCP_CCID3_DEBUG is not set
+CONFIG_IP_DCCP_CCID3_RTO=100
+
+#
+# SCTP Configuration (EXPERIMENTAL)
+#
+CONFIG_IP_SCTP=m
+# CONFIG_SCTP_DBG_MSG is not set
+# CONFIG_SCTP_DBG_OBJCNT is not set
+# CONFIG_SCTP_HMAC_NONE is not set
+# CONFIG_SCTP_HMAC_SHA1 is not set
+CONFIG_SCTP_HMAC_MD5=y
+
+#
+# TIPC Configuration (EXPERIMENTAL)
+#
+CONFIG_TIPC=m
+CONFIG_TIPC_ADVANCED=y
+CONFIG_TIPC_ZONES=3
+CONFIG_TIPC_CLUSTERS=1
+CONFIG_TIPC_NODES=255
+CONFIG_TIPC_SLAVE_NODES=0
+CONFIG_TIPC_PORTS=8191
+CONFIG_TIPC_LOG=0
+# CONFIG_TIPC_DEBUG is not set
+CONFIG_ATM=m
+CONFIG_ATM_CLIP=m
+# CONFIG_ATM_CLIP_NO_ICMP is not set
+CONFIG_ATM_LANE=m
+CONFIG_ATM_MPOA=m
+CONFIG_ATM_BR2684=m
+# CONFIG_ATM_BR2684_IPFILTER is not set
+CONFIG_BRIDGE=m
+CONFIG_VLAN_8021Q=m
+CONFIG_DECNET=m
+# CONFIG_DECNET_ROUTER is not set
+CONFIG_LLC=y
+CONFIG_LLC2=m
+CONFIG_IPX=m
+# CONFIG_IPX_INTERN is not set
+CONFIG_ATALK=m
+CONFIG_DEV_APPLETALK=m
+CONFIG_IPDDP=m
+CONFIG_IPDDP_ENCAP=y
+CONFIG_IPDDP_DECAP=y
+CONFIG_X25=m
+CONFIG_LAPB=m
+CONFIG_ECONET=m
+CONFIG_ECONET_AUNUDP=y
+CONFIG_ECONET_NATIVE=y
+CONFIG_WAN_ROUTER=m
+
+#
+# Network testing
+#
+CONFIG_NET_PKTGEN=m
+CONFIG_HAMRADIO=y
+
+#
+# Packet Radio protocols
+#
+CONFIG_AX25=m
+# CONFIG_AX25_DAMA_SLAVE is not set
+CONFIG_NETROM=m
+CONFIG_ROSE=m
+
+#
+# AX.25 network device drivers
+#
+CONFIG_MKISS=m
+CONFIG_6PACK=m
+CONFIG_BPQETHER=m
+CONFIG_BAYCOM_SER_FDX=m
+CONFIG_BAYCOM_SER_HDX=m
+CONFIG_BAYCOM_PAR=m
+CONFIG_BAYCOM_EPP=m
+CONFIG_YAM=m
+CONFIG_IRDA=m
+
+#
+# IrDA protocols
+#
+CONFIG_IRLAN=m
+CONFIG_IRNET=m
+CONFIG_IRCOMM=m
+# CONFIG_IRDA_ULTRA is not set
+
+#
+# IrDA options
+#
+CONFIG_IRDA_CACHE_LAST_LSAP=y
+CONFIG_IRDA_FAST_RR=y
+CONFIG_IRDA_DEBUG=y
+
+#
+# Infrared-port device drivers
+#
+
+#
+# SIR device drivers
+#
+CONFIG_IRTTY_SIR=m
+
+#
+# Dongle support
+#
+CONFIG_DONGLE=y
+CONFIG_ESI_DONGLE=m
+CONFIG_ACTISYS_DONGLE=m
+CONFIG_TEKRAM_DONGLE=m
+CONFIG_TOIM3232_DONGLE=m
+CONFIG_LITELINK_DONGLE=m
+CONFIG_MA600_DONGLE=m
+CONFIG_GIRBIL_DONGLE=m
+CONFIG_MCP2120_DONGLE=m
+CONFIG_OLD_BELKIN_DONGLE=m
+CONFIG_ACT200L_DONGLE=m
+
+#
+# Old SIR device drivers
+#
+CONFIG_IRPORT_SIR=m
+
+#
+# Old Serial dongle support
+#
+# CONFIG_DONGLE_OLD is not set
+
+#
+# FIR device drivers
+#
+CONFIG_USB_IRDA=m
+CONFIG_SIGMATEL_FIR=m
+CONFIG_TOSHIBA_FIR=m
+CONFIG_VLSI_FIR=m
+CONFIG_MCS_FIR=m
+CONFIG_BT=m
+CONFIG_BT_L2CAP=m
+CONFIG_BT_SCO=m
+CONFIG_BT_RFCOMM=m
+CONFIG_BT_RFCOMM_TTY=y
+CONFIG_BT_BNEP=m
+CONFIG_BT_BNEP_MC_FILTER=y
+CONFIG_BT_BNEP_PROTO_FILTER=y
+CONFIG_BT_CMTP=m
+CONFIG_BT_HIDP=m
+
+#
+# Bluetooth device drivers
+#
+CONFIG_BT_HCIUSB=m
+CONFIG_BT_HCIUSB_SCO=y
+CONFIG_BT_HCIUART=m
+CONFIG_BT_HCIUART_H4=y
+CONFIG_BT_HCIUART_BCSP=y
+CONFIG_BT_HCIBCM203X=m
+CONFIG_BT_HCIBPA10X=m
+CONFIG_BT_HCIBFUSB=m
+CONFIG_BT_HCIVHCI=m
+CONFIG_IEEE80211=m
+# CONFIG_IEEE80211_DEBUG is not set
+CONFIG_IEEE80211_CRYPT_WEP=m
+CONFIG_IEEE80211_CRYPT_CCMP=m
+CONFIG_IEEE80211_CRYPT_TKIP=m
+CONFIG_IEEE80211_SOFTMAC=m
+# CONFIG_IEEE80211_SOFTMAC_DEBUG is not set
+CONFIG_WIRELESS_EXT=y
+CONFIG_FIB_RULES=y
+
+#
+# Device Drivers
+#
+
+#
+# Generic Driver Options
+#
+CONFIG_STANDALONE=y
+CONFIG_PREVENT_FIRMWARE_BUILD=y
+CONFIG_FW_LOADER=m
+# CONFIG_SYS_HYPERVISOR is not set
+
+#
+# Connector - unified userspace <-> kernelspace linker
+#
+CONFIG_CONNECTOR=m
+
+#
+# Memory Technology Devices (MTD)
+#
+CONFIG_MTD=m
+# CONFIG_MTD_DEBUG is not set
+CONFIG_MTD_CONCAT=m
+CONFIG_MTD_PARTITIONS=y
+CONFIG_MTD_REDBOOT_PARTS=m
+CONFIG_MTD_REDBOOT_DIRECTORY_BLOCK=-1
+# CONFIG_MTD_REDBOOT_PARTS_UNALLOCATED is not set
+# CONFIG_MTD_REDBOOT_PARTS_READONLY is not set
+
+#
+# User Modules And Translation Layers
+#
+CONFIG_MTD_CHAR=m
+CONFIG_MTD_BLKDEVS=m
+CONFIG_MTD_BLOCK=m
+CONFIG_MTD_BLOCK_RO=m
+CONFIG_FTL=m
+CONFIG_NFTL=m
+CONFIG_NFTL_RW=y
+CONFIG_INFTL=m
+CONFIG_RFD_FTL=m
+CONFIG_SSFDC=m
+
+#
+# RAM/ROM/Flash chip drivers
+#
+CONFIG_MTD_CFI=m
+CONFIG_MTD_JEDECPROBE=m
+CONFIG_MTD_GEN_PROBE=m
+# CONFIG_MTD_CFI_ADV_OPTIONS is not set
+CONFIG_MTD_MAP_BANK_WIDTH_1=y
+CONFIG_MTD_MAP_BANK_WIDTH_2=y
+CONFIG_MTD_MAP_BANK_WIDTH_4=y
+# CONFIG_MTD_MAP_BANK_WIDTH_8 is not set
+# CONFIG_MTD_MAP_BANK_WIDTH_16 is not set
+# CONFIG_MTD_MAP_BANK_WIDTH_32 is not set
+CONFIG_MTD_CFI_I1=y
+CONFIG_MTD_CFI_I2=y
+# CONFIG_MTD_CFI_I4 is not set
+# CONFIG_MTD_CFI_I8 is not set
+CONFIG_MTD_CFI_INTELEXT=m
+CONFIG_MTD_CFI_AMDSTD=m
+CONFIG_MTD_CFI_STAA=m
+CONFIG_MTD_CFI_UTIL=m
+CONFIG_MTD_RAM=m
+CONFIG_MTD_ROM=m
+CONFIG_MTD_ABSENT=m
+
+#
+# Mapping drivers for chip access
+#
+CONFIG_MTD_COMPLEX_MAPPINGS=y
+CONFIG_MTD_PHYSMAP=m
+CONFIG_MTD_PHYSMAP_START=0x8000000
+CONFIG_MTD_PHYSMAP_LEN=0x0
+CONFIG_MTD_PHYSMAP_BANKWIDTH=2
+CONFIG_MTD_PCI=m
+CONFIG_MTD_PLATRAM=m
+
+#
+# Self-contained MTD device drivers
+#
+CONFIG_MTD_PMC551=m
+# CONFIG_MTD_PMC551_BUGFIX is not set
+# CONFIG_MTD_PMC551_DEBUG is not set
+CONFIG_MTD_DATAFLASH=m
+CONFIG_MTD_M25P80=m
+CONFIG_MTD_SLRAM=m
+CONFIG_MTD_PHRAM=m
+CONFIG_MTD_MTDRAM=m
+CONFIG_MTDRAM_TOTAL_SIZE=4096
+CONFIG_MTDRAM_ERASE_SIZE=128
+CONFIG_MTD_BLOCK2MTD=m
+
+#
+# Disk-On-Chip Device Drivers
+#
+CONFIG_MTD_DOC2000=m
+CONFIG_MTD_DOC2001=m
+CONFIG_MTD_DOC2001PLUS=m
+CONFIG_MTD_DOCPROBE=m
+CONFIG_MTD_DOCECC=m
+# CONFIG_MTD_DOCPROBE_ADVANCED is not set
+CONFIG_MTD_DOCPROBE_ADDRESS=0
+
+#
+# NAND Flash Device Drivers
+#
+CONFIG_MTD_NAND=m
+# CONFIG_MTD_NAND_VERIFY_WRITE is not set
+# CONFIG_MTD_NAND_ECC_SMC is not set
+CONFIG_MTD_NAND_IDS=m
+CONFIG_MTD_NAND_DISKONCHIP=m
+# CONFIG_MTD_NAND_DISKONCHIP_PROBE_ADVANCED is not set
+CONFIG_MTD_NAND_DISKONCHIP_PROBE_ADDRESS=0
+# CONFIG_MTD_NAND_DISKONCHIP_BBTWRITE is not set
+CONFIG_MTD_NAND_CAFE=m
+# CONFIG_MTD_NAND_NANDSIM is not set
+
+#
+# OneNAND Flash Device Drivers
+#
+CONFIG_MTD_ONENAND=m
+CONFIG_MTD_ONENAND_VERIFY_WRITE=y
+# CONFIG_MTD_ONENAND_OTP is not set
+
+#
+# Parallel port support
+#
+CONFIG_PARPORT=m
+CONFIG_PARPORT_PC=m
+CONFIG_PARPORT_SERIAL=m
+CONFIG_PARPORT_PC_FIFO=y
+# CONFIG_PARPORT_PC_SUPERIO is not set
+# CONFIG_PARPORT_GSC is not set
+# CONFIG_PARPORT_AX88796 is not set
+CONFIG_PARPORT_1284=y
+CONFIG_PARPORT_NOT_PC=y
+
+#
+# Plug and Play support
+#
+
+#
+# Block devices
+#
+CONFIG_BLK_DEV_FD=m
+CONFIG_PARIDE=m
+
+#
+# Parallel IDE high-level drivers
+#
+CONFIG_PARIDE_PD=m
+CONFIG_PARIDE_PCD=m
+CONFIG_PARIDE_PF=m
+CONFIG_PARIDE_PT=m
+CONFIG_PARIDE_PG=m
+
+#
+# Parallel IDE protocol modules
+#
+CONFIG_PARIDE_ATEN=m
+CONFIG_PARIDE_BPCK=m
+# CONFIG_PARIDE_BPCK6 is not set
+CONFIG_PARIDE_COMM=m
+CONFIG_PARIDE_DSTR=m
+CONFIG_PARIDE_FIT2=m
+CONFIG_PARIDE_FIT3=m
+CONFIG_PARIDE_EPAT=m
+# CONFIG_PARIDE_EPATC8 is not set
+CONFIG_PARIDE_EPIA=m
+CONFIG_PARIDE_FRIQ=m
+CONFIG_PARIDE_FRPW=m
+CONFIG_PARIDE_KBIC=m
+CONFIG_PARIDE_KTTI=m
+CONFIG_PARIDE_ON20=m
+CONFIG_PARIDE_ON26=m
+CONFIG_BLK_CPQ_CISS_DA=m
+CONFIG_CISS_SCSI_TAPE=y
+CONFIG_BLK_DEV_DAC960=m
+CONFIG_BLK_DEV_UMEM=m
+# CONFIG_BLK_DEV_COW_COMMON is not set
+CONFIG_BLK_DEV_LOOP=m
+CONFIG_BLK_DEV_CRYPTOLOOP=m
+CONFIG_BLK_DEV_NBD=m
+CONFIG_BLK_DEV_SX8=m
+# CONFIG_BLK_DEV_UB is not set
+CONFIG_BLK_DEV_RAM=y
+CONFIG_BLK_DEV_RAM_COUNT=16
+CONFIG_BLK_DEV_RAM_SIZE=65536
+CONFIG_BLK_DEV_RAM_BLOCKSIZE=1024
+CONFIG_BLK_DEV_INITRD=y
+CONFIG_CDROM_PKTCDVD=m
+CONFIG_CDROM_PKTCDVD_BUFFERS=8
+# CONFIG_CDROM_PKTCDVD_WCACHE is not set
+CONFIG_ATA_OVER_ETH=m
+
+#
+# Misc devices
+#
+# CONFIG_SGI_IOC4 is not set
+CONFIG_TIFM_CORE=m
+CONFIG_TIFM_7XX1=m
+
+#
+# ATA/ATAPI/MFM/RLL support
+#
+CONFIG_IDE=y
+CONFIG_IDE_MAX_HWIFS=4
+CONFIG_BLK_DEV_IDE=y
+
+#
+# Please see Documentation/ide.txt for help/info on IDE drives
+#
+# CONFIG_BLK_DEV_IDE_SATA is not set
+CONFIG_BLK_DEV_IDEDISK=y
+# CONFIG_IDEDISK_MULTI_MODE is not set
+CONFIG_BLK_DEV_IDECD=m
+CONFIG_BLK_DEV_IDETAPE=m
+CONFIG_BLK_DEV_IDEFLOPPY=m
+CONFIG_BLK_DEV_IDESCSI=m
+# CONFIG_IDE_TASK_IOCTL is not set
+
+#
+# IDE chipset support/bugfixes
+#
+CONFIG_IDE_GENERIC=y
+CONFIG_BLK_DEV_IDEPCI=y
+CONFIG_IDEPCI_SHARE_IRQ=y
+# CONFIG_BLK_DEV_OFFBOARD is not set
+CONFIG_BLK_DEV_GENERIC=y
+# CONFIG_BLK_DEV_OPTI621 is not set
+CONFIG_BLK_DEV_IDEDMA_PCI=y
+# CONFIG_BLK_DEV_IDEDMA_FORCED is not set
+# CONFIG_IDEDMA_ONLYDISK is not set
+# CONFIG_BLK_DEV_AEC62XX is not set
+# CONFIG_BLK_DEV_ALI15X3 is not set
+# CONFIG_BLK_DEV_AMD74XX is not set
+CONFIG_BLK_DEV_CMD64X=y
+# CONFIG_BLK_DEV_TRIFLEX is not set
+# CONFIG_BLK_DEV_CY82C693 is not set
+# CONFIG_BLK_DEV_CS5520 is not set
+# CONFIG_BLK_DEV_CS5530 is not set
+CONFIG_BLK_DEV_HPT34X=y
+# CONFIG_HPT34X_AUTODMA is not set
+CONFIG_BLK_DEV_HPT366=y
+# CONFIG_BLK_DEV_JMICRON is not set
+# CONFIG_BLK_DEV_SC1200 is not set
+CONFIG_BLK_DEV_PIIX=y
+# CONFIG_BLK_DEV_IT821X is not set
+# CONFIG_BLK_DEV_NS87415 is not set
+CONFIG_BLK_DEV_PDC202XX_OLD=y
+# CONFIG_PDC202XX_BURST is not set
+CONFIG_BLK_DEV_PDC202XX_NEW=y
+# CONFIG_BLK_DEV_SVWKS is not set
+CONFIG_BLK_DEV_SIIMAGE=y
+# CONFIG_BLK_DEV_SLC90E66 is not set
+# CONFIG_BLK_DEV_TRM290 is not set
+# CONFIG_BLK_DEV_VIA82CXXX is not set
+# CONFIG_IDE_ARM is not set
+CONFIG_BLK_DEV_IDEDMA=y
+# CONFIG_IDEDMA_IVB is not set
+# CONFIG_BLK_DEV_HD is not set
+
+#
+# SCSI device support
+#
+CONFIG_RAID_ATTRS=m
+CONFIG_SCSI=y
+CONFIG_SCSI_TGT=m
+CONFIG_SCSI_NETLINK=y
+CONFIG_SCSI_PROC_FS=y
+
+#
+# SCSI support type (disk, tape, CD-ROM)
+#
+CONFIG_BLK_DEV_SD=m
+CONFIG_CHR_DEV_ST=m
+CONFIG_CHR_DEV_OSST=m
+CONFIG_BLK_DEV_SR=m
+CONFIG_BLK_DEV_SR_VENDOR=y
+CONFIG_CHR_DEV_SG=m
+CONFIG_CHR_DEV_SCH=m
+
+#
+# Some SCSI devices (e.g. CD jukebox) support multiple LUNs
+#
+CONFIG_SCSI_MULTI_LUN=y
+CONFIG_SCSI_CONSTANTS=y
+CONFIG_SCSI_LOGGING=y
+CONFIG_SCSI_SCAN_ASYNC=y
+
+#
+# SCSI Transports
+#
+CONFIG_SCSI_SPI_ATTRS=m
+CONFIG_SCSI_FC_ATTRS=m
+CONFIG_SCSI_ISCSI_ATTRS=m
+CONFIG_SCSI_SAS_ATTRS=m
+CONFIG_SCSI_SAS_LIBSAS=m
+# CONFIG_SCSI_SAS_LIBSAS_DEBUG is not set
+
+#
+# SCSI low-level drivers
+#
+CONFIG_ISCSI_TCP=m
+CONFIG_BLK_DEV_3W_XXXX_RAID=m
+CONFIG_SCSI_3W_9XXX=m
+CONFIG_SCSI_ACARD=m
+CONFIG_SCSI_AACRAID=m
+CONFIG_SCSI_AIC7XXX=m
+CONFIG_AIC7XXX_CMDS_PER_DEVICE=8
+CONFIG_AIC7XXX_RESET_DELAY_MS=15000
+CONFIG_AIC7XXX_DEBUG_ENABLE=y
+CONFIG_AIC7XXX_DEBUG_MASK=0
+CONFIG_AIC7XXX_REG_PRETTY_PRINT=y
+CONFIG_SCSI_AIC7XXX_OLD=m
+CONFIG_SCSI_AIC79XX=m
+CONFIG_AIC79XX_CMDS_PER_DEVICE=32
+CONFIG_AIC79XX_RESET_DELAY_MS=15000
+CONFIG_AIC79XX_DEBUG_ENABLE=y
+CONFIG_AIC79XX_DEBUG_MASK=0
+CONFIG_AIC79XX_REG_PRETTY_PRINT=y
+CONFIG_SCSI_AIC94XX=m
+# CONFIG_AIC94XX_DEBUG is not set
+CONFIG_SCSI_DPT_I2O=m
+CONFIG_SCSI_ARCMSR=m
+CONFIG_MEGARAID_NEWGEN=y
+CONFIG_MEGARAID_MM=m
+CONFIG_MEGARAID_MAILBOX=m
+CONFIG_MEGARAID_LEGACY=m
+CONFIG_MEGARAID_SAS=m
+CONFIG_SCSI_HPTIOP=m
+CONFIG_SCSI_DMX3191D=m
+CONFIG_SCSI_FUTURE_DOMAIN=m
+CONFIG_SCSI_IPS=m
+CONFIG_SCSI_INITIO=m
+CONFIG_SCSI_INIA100=m
+CONFIG_SCSI_PPA=m
+CONFIG_SCSI_IMM=m
+# CONFIG_SCSI_IZIP_EPP16 is not set
+# CONFIG_SCSI_IZIP_SLOW_CTR is not set
+CONFIG_SCSI_STEX=m
+CONFIG_SCSI_SYM53C8XX_2=m
+CONFIG_SCSI_SYM53C8XX_DMA_ADDRESSING_MODE=1
+CONFIG_SCSI_SYM53C8XX_DEFAULT_TAGS=16
+CONFIG_SCSI_SYM53C8XX_MAX_TAGS=64
+CONFIG_SCSI_SYM53C8XX_MMIO=y
+# CONFIG_SCSI_IPR is not set
+CONFIG_SCSI_QLOGIC_1280=m
+CONFIG_SCSI_QLA_FC=m
+CONFIG_SCSI_QLA_ISCSI=m
+CONFIG_SCSI_LPFC=m
+CONFIG_SCSI_DC395x=m
+CONFIG_SCSI_DC390T=m
+CONFIG_SCSI_NSP32=m
+CONFIG_SCSI_DEBUG=m
+CONFIG_SCSI_SRP=m
+
+#
+# Serial ATA (prod) and Parallel ATA (experimental) drivers
+#
+CONFIG_ATA=y
+# CONFIG_ATA_NONSTANDARD is not set
+CONFIG_SATA_AHCI=y
+# CONFIG_SATA_SVW is not set
+# CONFIG_ATA_PIIX is not set
+CONFIG_SATA_MV=y
+# CONFIG_SATA_NV is not set
+# CONFIG_PDC_ADMA is not set
+# CONFIG_SATA_QSTOR is not set
+CONFIG_SATA_PROMISE=y
+CONFIG_SATA_SX4=y
+CONFIG_SATA_SIL=y
+CONFIG_SATA_SIL24=y
+# CONFIG_SATA_SIS is not set
+# CONFIG_SATA_ULI is not set
+# CONFIG_SATA_VIA is not set
+# CONFIG_SATA_VITESSE is not set
+# CONFIG_ATA_GENERIC is not set
+
+#
+# Multi-device support (RAID and LVM)
+#
+CONFIG_MD=y
+CONFIG_BLK_DEV_MD=m
+CONFIG_MD_LINEAR=m
+CONFIG_MD_RAID0=m
+CONFIG_MD_RAID1=m
+CONFIG_MD_RAID10=m
+CONFIG_MD_RAID456=m
+CONFIG_MD_RAID5_RESHAPE=y
+CONFIG_MD_MULTIPATH=m
+CONFIG_MD_FAULTY=m
+CONFIG_BLK_DEV_DM=m
+# CONFIG_DM_DEBUG is not set
+CONFIG_DM_CRYPT=m
+CONFIG_DM_SNAPSHOT=m
+CONFIG_DM_MIRROR=m
+CONFIG_DM_ZERO=m
+CONFIG_DM_MULTIPATH=m
+
+#
+# I2O device support
+#
+CONFIG_I2O=m
+CONFIG_I2O_LCT_NOTIFY_ON_CHANGES=y
+CONFIG_I2O_EXT_ADAPTEC=y
+CONFIG_I2O_CONFIG=m
+CONFIG_I2O_CONFIG_OLD_IOCTL=y
+CONFIG_I2O_BUS=m
+CONFIG_I2O_BLOCK=m
+CONFIG_I2O_SCSI=m
+CONFIG_I2O_PROC=m
+
+#
+# Network device support
+#
+CONFIG_NETDEVICES=y
+CONFIG_IFB=m
+CONFIG_DUMMY=m
+CONFIG_BONDING=m
+CONFIG_EQUALIZER=m
+CONFIG_TUN=m
+
+#
+# ARCnet devices
+#
+CONFIG_ARCNET=m
+CONFIG_ARCNET_1201=m
+CONFIG_ARCNET_1051=m
+CONFIG_ARCNET_RAW=m
+CONFIG_ARCNET_CAP=m
+CONFIG_ARCNET_COM90xx=m
+CONFIG_ARCNET_COM90xxIO=m
+CONFIG_ARCNET_RIM_I=m
+CONFIG_ARCNET_COM20020=m
+CONFIG_ARCNET_COM20020_PCI=m
+
+#
+# PHY device support
+#
+CONFIG_PHYLIB=m
+
+#
+# MII PHY device drivers
+#
+CONFIG_MARVELL_PHY=m
+CONFIG_DAVICOM_PHY=m
+# CONFIG_QSEMI_PHY is not set
+CONFIG_LXT_PHY=m
+# CONFIG_CICADA_PHY is not set
+# CONFIG_VITESSE_PHY is not set
+CONFIG_SMSC_PHY=m
+CONFIG_BROADCOM_PHY=m
+CONFIG_FIXED_PHY=m
+# CONFIG_FIXED_MII_10_FDX is not set
+# CONFIG_FIXED_MII_100_FDX is not set
+
+#
+# Ethernet (10 or 100Mbit)
+#
+CONFIG_NET_ETHERNET=y
+CONFIG_MII=y
+# CONFIG_HAPPYMEAL is not set
+# CONFIG_SUNGEM is not set
+# CONFIG_CASSINI is not set
+CONFIG_NET_VENDOR_3COM=y
+CONFIG_VORTEX=m
+CONFIG_TYPHOON=m
+# CONFIG_DM9000 is not set
+
+#
+# Tulip family network device support
+#
+CONFIG_NET_TULIP=y
+CONFIG_DE2104X=m
+CONFIG_TULIP=m
+# CONFIG_TULIP_MWI is not set
+# CONFIG_TULIP_MMIO is not set
+# CONFIG_TULIP_NAPI is not set
+CONFIG_DE4X5=m
+# CONFIG_WINBOND_840 is not set
+CONFIG_DM9102=m
+# CONFIG_ULI526X is not set
+# CONFIG_HP100 is not set
+CONFIG_NET_PCI=y
+CONFIG_PCNET32=y
+CONFIG_PCNET32_NAPI=y
+CONFIG_AMD8111_ETH=m
+CONFIG_AMD8111E_NAPI=y
+CONFIG_ADAPTEC_STARFIRE=m
+CONFIG_ADAPTEC_STARFIRE_NAPI=y
+CONFIG_B44=m
+# CONFIG_FORCEDETH is not set
+CONFIG_EEPRO100=m
+CONFIG_E100=m
+CONFIG_FEALNX=m
+CONFIG_NATSEMI=m
+CONFIG_NE2K_PCI=m
+CONFIG_8139CP=m
+CONFIG_8139TOO=m
+# CONFIG_8139TOO_PIO is not set
+CONFIG_8139TOO_TUNE_TWISTER=y
+CONFIG_8139TOO_8129=y
+# CONFIG_8139_OLD_RX_RESET is not set
+CONFIG_SIS900=m
+CONFIG_EPIC100=m
+CONFIG_SUNDANCE=m
+# CONFIG_SUNDANCE_MMIO is not set
+CONFIG_TLAN=m
+CONFIG_VIA_RHINE=m
+# CONFIG_VIA_RHINE_MMIO is not set
+CONFIG_VIA_RHINE_NAPI=y
+CONFIG_NET_POCKET=y
+CONFIG_DE600=m
+CONFIG_DE620=m
+
+#
+# Ethernet (1000 Mbit)
+#
+CONFIG_ACENIC=m
+# CONFIG_ACENIC_OMIT_TIGON_I is not set
+CONFIG_DL2K=m
+CONFIG_E1000=m
+CONFIG_E1000_NAPI=y
+# CONFIG_E1000_DISABLE_PACKET_SPLIT is not set
+CONFIG_NS83820=m
+CONFIG_HAMACHI=m
+CONFIG_YELLOWFIN=m
+CONFIG_R8169=m
+CONFIG_R8169_NAPI=y
+CONFIG_R8169_VLAN=y
+CONFIG_SIS190=m
+CONFIG_SKGE=m
+CONFIG_SKY2=m
+CONFIG_VIA_VELOCITY=m
+CONFIG_TIGON3=m
+CONFIG_BNX2=m
+CONFIG_QLA3XXX=m
+
+#
+# Ethernet (10000 Mbit)
+#
+CONFIG_CHELSIO_T1=m
+CONFIG_CHELSIO_T1_1G=y
+CONFIG_CHELSIO_T1_NAPI=y
+CONFIG_IXGB=m
+CONFIG_IXGB_NAPI=y
+CONFIG_S2IO=m
+CONFIG_S2IO_NAPI=y
+CONFIG_MYRI10GE=m
+CONFIG_NETXEN_NIC=m
+
+#
+# Wireless LAN (non-hamradio)
+#
+CONFIG_WLAN_PRE80211=y
+CONFIG_STRIP=m
+CONFIG_WLAN_80211=y
+
+#
+# Wireless 802.11b ISA/PCI cards support
+#
+CONFIG_IPW2100=m
+CONFIG_IPW2100_MONITOR=y
+# CONFIG_IPW2100_DEBUG is not set
+CONFIG_IPW2200=m
+# CONFIG_IPW2200_MONITOR is not set
+CONFIG_IPW2200_QOS=y
+# CONFIG_IPW2200_DEBUG is not set
+CONFIG_HERMES=m
+CONFIG_PLX_HERMES=m
+CONFIG_TMD_HERMES=m
+CONFIG_NORTEL_HERMES=m
+CONFIG_PCI_HERMES=m
+CONFIG_ATMEL=m
+CONFIG_PCI_ATMEL=m
+
+#
+# Prism GT/Duette 802.11(a/b/g) PCI/Cardbus support
+#
+CONFIG_PRISM54=m
+CONFIG_USB_ZD1201=m
+CONFIG_HOSTAP=m
+CONFIG_HOSTAP_FIRMWARE=y
+# CONFIG_HOSTAP_FIRMWARE_NVRAM is not set
+CONFIG_HOSTAP_PLX=m
+CONFIG_HOSTAP_PCI=m
+CONFIG_BCM43XX=m
+CONFIG_BCM43XX_DEBUG=y
+CONFIG_BCM43XX_DMA=y
+CONFIG_BCM43XX_PIO=y
+CONFIG_BCM43XX_DMA_AND_PIO_MODE=y
+# CONFIG_BCM43XX_DMA_MODE is not set
+# CONFIG_BCM43XX_PIO_MODE is not set
+CONFIG_ZD1211RW=m
+# CONFIG_ZD1211RW_DEBUG is not set
+
+#
+# Wan interfaces
+#
+CONFIG_WAN=y
+CONFIG_LANMEDIA=m
+CONFIG_PCI200SYN=m
+CONFIG_WANXL=m
+CONFIG_PC300=m
+# CONFIG_PC300_MLPPP is not set
+
+#
+# Cyclades-PC300 MLPPP support is disabled.
+#
+
+#
+# Refer to the file README.mlppp, provided by PC300 package.
+#
+CONFIG_FARSYNC=m
+CONFIG_DSCC4=m
+# CONFIG_DSCC4_PCISYNC is not set
+# CONFIG_DSCC4_PCI_RST is not set
+CONFIG_DLCI=m
+CONFIG_DLCI_MAX=8
+CONFIG_WAN_ROUTER_DRIVERS=m
+CONFIG_CYCLADES_SYNC=m
+CONFIG_CYCLOMX_X25=y
+CONFIG_LAPBETHER=m
+CONFIG_X25_ASY=m
+
+#
+# ATM drivers
+#
+CONFIG_ATM_DRIVERS=y
+CONFIG_ATM_DUMMY=m
+CONFIG_ATM_TCP=m
+CONFIG_ATM_LANAI=m
+CONFIG_ATM_ENI=m
+# CONFIG_ATM_ENI_DEBUG is not set
+# CONFIG_ATM_ENI_TUNE_BURST is not set
+CONFIG_ATM_FIRESTREAM=m
+CONFIG_ATM_ZATM=m
+# CONFIG_ATM_ZATM_DEBUG is not set
+CONFIG_ATM_NICSTAR=m
+# CONFIG_ATM_NICSTAR_USE_SUNI is not set
+# CONFIG_ATM_NICSTAR_USE_IDT77105 is not set
+CONFIG_ATM_IDT77252=m
+# CONFIG_ATM_IDT77252_DEBUG is not set
+# CONFIG_ATM_IDT77252_RCV_ALL is not set
+CONFIG_ATM_IDT77252_USE_SUNI=y
+CONFIG_ATM_AMBASSADOR=m
+# CONFIG_ATM_AMBASSADOR_DEBUG is not set
+CONFIG_ATM_HORIZON=m
+# CONFIG_ATM_HORIZON_DEBUG is not set
+CONFIG_ATM_IA=m
+# CONFIG_ATM_IA_DEBUG is not set
+CONFIG_ATM_FORE200E_MAYBE=m
+CONFIG_ATM_FORE200E_PCA=y
+CONFIG_ATM_FORE200E_PCA_DEFAULT_FW=y
+# CONFIG_ATM_FORE200E_USE_TASKLET is not set
+CONFIG_ATM_FORE200E_TX_RETRY=16
+CONFIG_ATM_FORE200E_DEBUG=0
+CONFIG_ATM_FORE200E=m
+CONFIG_ATM_HE=m
+CONFIG_ATM_HE_USE_SUNI=y
+CONFIG_FDDI=y
+CONFIG_DEFXX=m
+CONFIG_SKFP=m
+CONFIG_HIPPI=y
+CONFIG_ROADRUNNER=m
+# CONFIG_ROADRUNNER_LARGE_RINGS is not set
+CONFIG_PLIP=m
+CONFIG_PPP=m
+CONFIG_PPP_MULTILINK=y
+CONFIG_PPP_FILTER=y
+CONFIG_PPP_ASYNC=m
+CONFIG_PPP_SYNC_TTY=m
+CONFIG_PPP_DEFLATE=m
+CONFIG_PPP_BSDCOMP=m
+CONFIG_PPP_MPPE=m
+CONFIG_PPPOE=m
+CONFIG_PPPOATM=m
+CONFIG_SLIP=m
+CONFIG_SLIP_COMPRESSED=y
+CONFIG_SLHC=m
+CONFIG_SLIP_SMART=y
+# CONFIG_SLIP_MODE_SLIP6 is not set
+CONFIG_NET_FC=y
+CONFIG_SHAPER=m
+CONFIG_NETCONSOLE=m
+CONFIG_NETPOLL=y
+# CONFIG_NETPOLL_TRAP is not set
+CONFIG_NET_POLL_CONTROLLER=y
+
+#
+# ISDN subsystem
+#
+CONFIG_ISDN=m
+
+#
+# Old ISDN4Linux
+#
+CONFIG_ISDN_I4L=m
+CONFIG_ISDN_PPP=y
+CONFIG_ISDN_PPP_VJ=y
+CONFIG_ISDN_MPP=y
+CONFIG_IPPP_FILTER=y
+CONFIG_ISDN_PPP_BSDCOMP=m
+CONFIG_ISDN_AUDIO=y
+CONFIG_ISDN_TTY_FAX=y
+CONFIG_ISDN_X25=y
+
+#
+# ISDN feature submodules
+#
+CONFIG_ISDN_DRV_LOOP=m
+CONFIG_ISDN_DIVERSION=m
+
+#
+# ISDN4Linux hardware drivers
+#
+
+#
+# Passive cards
+#
+CONFIG_ISDN_DRV_HISAX=m
+
+#
+# D-channel protocol features
+#
+CONFIG_HISAX_EURO=y
+CONFIG_DE_AOC=y
+# CONFIG_HISAX_NO_SENDCOMPLETE is not set
+# CONFIG_HISAX_NO_LLC is not set
+# CONFIG_HISAX_NO_KEYPAD is not set
+CONFIG_HISAX_1TR6=y
+CONFIG_HISAX_NI1=y
+CONFIG_HISAX_MAX_CARDS=8
+
+#
+# HiSax supported cards
+#
+CONFIG_HISAX_16_3=y
+CONFIG_HISAX_S0BOX=y
+CONFIG_HISAX_FRITZPCI=y
+CONFIG_HISAX_AVM_A1_PCMCIA=y
+CONFIG_HISAX_ELSA=y
+CONFIG_HISAX_DIEHLDIVA=y
+CONFIG_HISAX_SEDLBAUER=y
+CONFIG_HISAX_NICCY=y
+CONFIG_HISAX_BKM_A4T=y
+CONFIG_HISAX_SCT_QUADRO=y
+CONFIG_HISAX_GAZEL=y
+CONFIG_HISAX_W6692=y
+CONFIG_HISAX_HFC_SX=y
+# CONFIG_HISAX_DEBUG is not set
+
+#
+# HiSax PCMCIA card service modules
+#
+
+#
+# HiSax sub driver modules
+#
+CONFIG_HISAX_ST5481=m
+CONFIG_HISAX_HFCUSB=m
+CONFIG_HISAX_HFC4S8S=m
+CONFIG_HISAX_FRITZ_PCIPNP=m
+CONFIG_HISAX_HDLC=y
+
+#
+# Active cards
+#
+CONFIG_HYSDN=m
+# CONFIG_HYSDN_CAPI is not set
+
+#
+# Siemens Gigaset
+#
+CONFIG_ISDN_DRV_GIGASET=m
+CONFIG_GIGASET_BASE=m
+CONFIG_GIGASET_M105=m
+# CONFIG_GIGASET_DEBUG is not set
+# CONFIG_GIGASET_UNDOCREQ is not set
+
+#
+# CAPI subsystem
+#
+CONFIG_ISDN_CAPI=m
+CONFIG_ISDN_DRV_AVMB1_VERBOSE_REASON=y
+CONFIG_ISDN_CAPI_MIDDLEWARE=y
+CONFIG_ISDN_CAPI_CAPI20=m
+CONFIG_ISDN_CAPI_CAPIFS_BOOL=y
+CONFIG_ISDN_CAPI_CAPIFS=m
+CONFIG_ISDN_CAPI_CAPIDRV=m
+
+#
+# CAPI hardware drivers
+#
+
+#
+# Active AVM cards
+#
+CONFIG_CAPI_AVM=y
+CONFIG_ISDN_DRV_AVMB1_B1PCI=m
+CONFIG_ISDN_DRV_AVMB1_B1PCIV4=y
+CONFIG_ISDN_DRV_AVMB1_B1PCMCIA=m
+CONFIG_ISDN_DRV_AVMB1_T1PCI=m
+CONFIG_ISDN_DRV_AVMB1_C4=m
+
+#
+# Active Eicon DIVA Server cards
+#
+CONFIG_CAPI_EICON=y
+CONFIG_ISDN_DIVAS=m
+CONFIG_ISDN_DIVAS_BRIPCI=y
+CONFIG_ISDN_DIVAS_PRIPCI=y
+CONFIG_ISDN_DIVAS_DIVACAPI=m
+CONFIG_ISDN_DIVAS_USERIDI=m
+CONFIG_ISDN_DIVAS_MAINT=m
+
+#
+# Telephony Support
+#
+CONFIG_PHONE=m
+CONFIG_PHONE_IXJ=m
+
+#
+# Input device support
+#
+CONFIG_INPUT=y
+CONFIG_INPUT_FF_MEMLESS=m
+
+#
+# Userland interfaces
+#
+CONFIG_INPUT_MOUSEDEV=y
+CONFIG_INPUT_MOUSEDEV_PSAUX=y
+CONFIG_INPUT_MOUSEDEV_SCREEN_X=1024
+CONFIG_INPUT_MOUSEDEV_SCREEN_Y=768
+CONFIG_INPUT_JOYDEV=m
+CONFIG_INPUT_TSDEV=m
+CONFIG_INPUT_TSDEV_SCREEN_X=240
+CONFIG_INPUT_TSDEV_SCREEN_Y=320
+CONFIG_INPUT_EVDEV=m
+# CONFIG_INPUT_EVBUG is not set
+
+#
+# Input Device Drivers
+#
+CONFIG_INPUT_KEYBOARD=y
+CONFIG_KEYBOARD_ATKBD=y
+CONFIG_KEYBOARD_SUNKBD=m
+CONFIG_KEYBOARD_LKKBD=m
+CONFIG_KEYBOARD_XTKBD=m
+CONFIG_KEYBOARD_NEWTON=m
+CONFIG_KEYBOARD_STOWAWAY=m
+CONFIG_INPUT_MOUSE=y
+CONFIG_MOUSE_PS2=m
+CONFIG_MOUSE_SERIAL=m
+CONFIG_MOUSE_APPLETOUCH=m
+CONFIG_MOUSE_VSXXXAA=m
+CONFIG_INPUT_JOYSTICK=y
+CONFIG_JOYSTICK_ANALOG=m
+CONFIG_JOYSTICK_A3D=m
+CONFIG_JOYSTICK_ADI=m
+CONFIG_JOYSTICK_COBRA=m
+CONFIG_JOYSTICK_GF2K=m
+CONFIG_JOYSTICK_GRIP=m
+CONFIG_JOYSTICK_GRIP_MP=m
+CONFIG_JOYSTICK_GUILLEMOT=m
+CONFIG_JOYSTICK_INTERACT=m
+CONFIG_JOYSTICK_SIDEWINDER=m
+CONFIG_JOYSTICK_TMDC=m
+CONFIG_JOYSTICK_IFORCE=m
+CONFIG_JOYSTICK_IFORCE_USB=y
+CONFIG_JOYSTICK_IFORCE_232=y
+CONFIG_JOYSTICK_WARRIOR=m
+CONFIG_JOYSTICK_MAGELLAN=m
+CONFIG_JOYSTICK_SPACEORB=m
+CONFIG_JOYSTICK_SPACEBALL=m
+CONFIG_JOYSTICK_STINGER=m
+CONFIG_JOYSTICK_TWIDJOY=m
+CONFIG_JOYSTICK_DB9=m
+CONFIG_JOYSTICK_GAMECON=m
+CONFIG_JOYSTICK_TURBOGRAFX=m
+CONFIG_JOYSTICK_JOYDUMP=m
+CONFIG_JOYSTICK_XPAD=m
+CONFIG_INPUT_TABLET=y
+CONFIG_TABLET_USB_ACECAD=m
+CONFIG_TABLET_USB_AIPTEK=m
+CONFIG_TABLET_USB_GTCO=m
+CONFIG_TABLET_USB_KBTAB=m
+CONFIG_TABLET_USB_WACOM=m
+CONFIG_INPUT_TOUCHSCREEN=y
+CONFIG_TOUCHSCREEN_ADS7846=m
+CONFIG_TOUCHSCREEN_GUNZE=m
+CONFIG_TOUCHSCREEN_ELO=m
+CONFIG_TOUCHSCREEN_MTOUCH=m
+CONFIG_TOUCHSCREEN_MK712=m
+CONFIG_TOUCHSCREEN_PENMOUNT=m
+CONFIG_TOUCHSCREEN_TOUCHRIGHT=m
+CONFIG_TOUCHSCREEN_TOUCHWIN=m
+CONFIG_TOUCHSCREEN_UCB1400=m
+CONFIG_TOUCHSCREEN_USB_COMPOSITE=m
+# CONFIG_INPUT_MISC is not set
+
+#
+# Hardware I/O ports
+#
+CONFIG_SERIO=y
+CONFIG_SERIO_I8042=y
+CONFIG_SERIO_SERPORT=m
+CONFIG_SERIO_PARKBD=m
+CONFIG_SERIO_PCIPS2=y
+CONFIG_SERIO_LIBPS2=y
+CONFIG_SERIO_RAW=m
+CONFIG_GAMEPORT=m
+# CONFIG_GAMEPORT_NS558 is not set
+# CONFIG_GAMEPORT_L4 is not set
+CONFIG_GAMEPORT_EMU10K1=m
+CONFIG_GAMEPORT_FM801=m
+
+#
+# Character devices
+#
+CONFIG_VT=y
+CONFIG_VT_CONSOLE=y
+CONFIG_HW_CONSOLE=y
+# CONFIG_VT_HW_CONSOLE_BINDING is not set
+# CONFIG_SERIAL_NONSTANDARD is not set
+
+#
+# Serial drivers
+#
+CONFIG_SERIAL_8250=y
+CONFIG_SERIAL_8250_CONSOLE=y
+CONFIG_SERIAL_8250_PCI=y
+CONFIG_SERIAL_8250_NR_UARTS=4
+CONFIG_SERIAL_8250_RUNTIME_UARTS=4
+CONFIG_SERIAL_8250_EXTENDED=y
+# CONFIG_SERIAL_8250_MANY_PORTS is not set
+CONFIG_SERIAL_8250_SHARE_IRQ=y
+# CONFIG_SERIAL_8250_DETECT_IRQ is not set
+CONFIG_SERIAL_8250_RSA=y
+
+#
+# Non-8250 serial port support
+#
+CONFIG_SERIAL_CORE=y
+CONFIG_SERIAL_CORE_CONSOLE=y
+CONFIG_SERIAL_JSM=m
+CONFIG_UNIX98_PTYS=y
+# CONFIG_LEGACY_PTYS is not set
+CONFIG_PRINTER=m
+# CONFIG_LP_CONSOLE is not set
+CONFIG_PPDEV=m
+CONFIG_TIPAR=m
+
+#
+# IPMI
+#
+CONFIG_IPMI_HANDLER=m
+# CONFIG_IPMI_PANIC_EVENT is not set
+# CONFIG_IPMI_DEVICE_INTERFACE is not set
+CONFIG_IPMI_SI=m
+CONFIG_IPMI_WATCHDOG=m
+CONFIG_IPMI_POWEROFF=m
+
+#
+# Watchdog Cards
+#
+CONFIG_WATCHDOG=y
+# CONFIG_WATCHDOG_NOWAYOUT is not set
+
+#
+# Watchdog Device Drivers
+#
+CONFIG_SOFT_WATCHDOG=m
+
+#
+# PCI-based Watchdog Cards
+#
+CONFIG_PCIPCWATCHDOG=m
+CONFIG_WDTPCI=m
+CONFIG_WDT_501_PCI=y
+
+#
+# USB-based Watchdog Cards
+#
+CONFIG_USBPCWATCHDOG=m
+CONFIG_HW_RANDOM=m
+CONFIG_RTC=y
+CONFIG_DTLK=m
+CONFIG_R3964=m
+CONFIG_APPLICOM=m
+CONFIG_DRM=m
+CONFIG_DRM_TDFX=m
+CONFIG_DRM_R128=m
+CONFIG_DRM_RADEON=m
+CONFIG_DRM_MGA=m
+CONFIG_DRM_VIA=m
+CONFIG_DRM_SAVAGE=m
+# CONFIG_RAW_DRIVER is not set
+
+#
+# TPM devices
+#
+# CONFIG_TCG_TPM is not set
+
+#
+# I2C support
+#
+CONFIG_I2C=m
+CONFIG_I2C_CHARDEV=m
+
+#
+# I2C Algorithms
+#
+CONFIG_I2C_ALGOBIT=m
+# CONFIG_I2C_ALGOPCF is not set
+# CONFIG_I2C_ALGOPCA is not set
+
+#
+# I2C Hardware Bus support
+#
+# CONFIG_I2C_ALI1535 is not set
+# CONFIG_I2C_ALI1563 is not set
+# CONFIG_I2C_ALI15X3 is not set
+# CONFIG_I2C_AMD756 is not set
+# CONFIG_I2C_AMD8111 is not set
+# CONFIG_I2C_I801 is not set
+# CONFIG_I2C_I810 is not set
+CONFIG_I2C_PIIX4=m
+# CONFIG_I2C_NFORCE2 is not set
+# CONFIG_I2C_OCORES is not set
+CONFIG_I2C_PARPORT=m
+CONFIG_I2C_PARPORT_LIGHT=m
+# CONFIG_I2C_PROSAVAGE is not set
+# CONFIG_I2C_SAVAGE4 is not set
+# CONFIG_I2C_SIS5595 is not set
+# CONFIG_I2C_SIS630 is not set
+# CONFIG_I2C_SIS96X is not set
+# CONFIG_I2C_STUB is not set
+# CONFIG_I2C_VIA is not set
+# CONFIG_I2C_VIAPRO is not set
+CONFIG_I2C_VOODOO3=m
+# CONFIG_I2C_PCA_ISA is not set
+
+#
+# Miscellaneous I2C Chip support
+#
+CONFIG_SENSORS_DS1337=m
+CONFIG_SENSORS_DS1374=m
+CONFIG_SENSORS_EEPROM=m
+CONFIG_SENSORS_PCF8574=m
+CONFIG_SENSORS_PCA9539=m
+CONFIG_SENSORS_PCF8591=m
+CONFIG_SENSORS_MAX6875=m
+# CONFIG_I2C_DEBUG_CORE is not set
+# CONFIG_I2C_DEBUG_ALGO is not set
+# CONFIG_I2C_DEBUG_BUS is not set
+# CONFIG_I2C_DEBUG_CHIP is not set
+
+#
+# SPI support
+#
+CONFIG_SPI=y
+CONFIG_SPI_MASTER=y
+
+#
+# SPI Master Controller Drivers
+#
+CONFIG_SPI_BITBANG=m
+CONFIG_SPI_BUTTERFLY=m
+
+#
+# SPI Protocol Masters
+#
+
+#
+# Hardware Monitoring support
+#
+CONFIG_HWMON=y
+CONFIG_HWMON_VID=m
+# CONFIG_SENSORS_ABITUGURU is not set
+CONFIG_SENSORS_ADM1021=m
+CONFIG_SENSORS_ADM1025=m
+CONFIG_SENSORS_ADM1026=m
+CONFIG_SENSORS_ADM1031=m
+CONFIG_SENSORS_ADM9240=m
+# CONFIG_SENSORS_ASB100 is not set
+# CONFIG_SENSORS_ATXP1 is not set
+CONFIG_SENSORS_DS1621=m
+# CONFIG_SENSORS_F71805F is not set
+# CONFIG_SENSORS_FSCHER is not set
+# CONFIG_SENSORS_FSCPOS is not set
+# CONFIG_SENSORS_GL518SM is not set
+# CONFIG_SENSORS_GL520SM is not set
+# CONFIG_SENSORS_IT87 is not set
+CONFIG_SENSORS_LM63=m
+CONFIG_SENSORS_LM70=m
+CONFIG_SENSORS_LM75=m
+CONFIG_SENSORS_LM77=m
+CONFIG_SENSORS_LM78=m
+CONFIG_SENSORS_LM80=m
+CONFIG_SENSORS_LM83=m
+CONFIG_SENSORS_LM85=m
+CONFIG_SENSORS_LM87=m
+CONFIG_SENSORS_LM90=m
+CONFIG_SENSORS_LM92=m
+CONFIG_SENSORS_MAX1619=m
+# CONFIG_SENSORS_PC87360 is not set
+# CONFIG_SENSORS_PC87427 is not set
+# CONFIG_SENSORS_SIS5595 is not set
+# CONFIG_SENSORS_SMSC47M1 is not set
+# CONFIG_SENSORS_SMSC47M192 is not set
+# CONFIG_SENSORS_SMSC47B397 is not set
+# CONFIG_SENSORS_VIA686A is not set
+# CONFIG_SENSORS_VT1211 is not set
+# CONFIG_SENSORS_VT8231 is not set
+# CONFIG_SENSORS_W83781D is not set
+# CONFIG_SENSORS_W83791D is not set
+# CONFIG_SENSORS_W83792D is not set
+# CONFIG_SENSORS_W83793 is not set
+# CONFIG_SENSORS_W83L785TS is not set
+# CONFIG_SENSORS_W83627HF is not set
+# CONFIG_SENSORS_W83627EHF is not set
+# CONFIG_HWMON_DEBUG_CHIP is not set
+
+#
+# Multimedia devices
+#
+CONFIG_VIDEO_DEV=m
+CONFIG_VIDEO_V4L1=y
+CONFIG_VIDEO_V4L1_COMPAT=y
+CONFIG_VIDEO_V4L2=y
+
+#
+# Video Capture Adapters
+#
+
+#
+# Video Capture Adapters
+#
+# CONFIG_VIDEO_ADV_DEBUG is not set
+CONFIG_VIDEO_HELPER_CHIPS_AUTO=y
+CONFIG_VIDEO_TVAUDIO=m
+CONFIG_VIDEO_TDA7432=m
+CONFIG_VIDEO_TDA9840=m
+CONFIG_VIDEO_TDA9875=m
+CONFIG_VIDEO_TEA6415C=m
+CONFIG_VIDEO_TEA6420=m
+CONFIG_VIDEO_MSP3400=m
+CONFIG_VIDEO_WM8775=m
+CONFIG_VIDEO_BT819=m
+CONFIG_VIDEO_BT856=m
+CONFIG_VIDEO_KS0127=m
+CONFIG_VIDEO_OV7670=m
+CONFIG_VIDEO_SAA7110=m
+CONFIG_VIDEO_SAA7111=m
+CONFIG_VIDEO_SAA7114=m
+CONFIG_VIDEO_SAA711X=m
+CONFIG_VIDEO_TVP5150=m
+CONFIG_VIDEO_VPX3220=m
+CONFIG_VIDEO_CX25840=m
+CONFIG_VIDEO_CX2341X=m
+CONFIG_VIDEO_SAA7185=m
+CONFIG_VIDEO_ADV7170=m
+CONFIG_VIDEO_ADV7175=m
+CONFIG_VIDEO_VIVI=m
+CONFIG_VIDEO_BT848=m
+CONFIG_VIDEO_BT848_DVB=y
+CONFIG_VIDEO_SAA6588=m
+CONFIG_VIDEO_BWQCAM=m
+CONFIG_VIDEO_CQCAM=m
+CONFIG_VIDEO_W9966=m
+CONFIG_VIDEO_CPIA=m
+CONFIG_VIDEO_CPIA_PP=m
+CONFIG_VIDEO_CPIA_USB=m
+CONFIG_VIDEO_CPIA2=m
+CONFIG_VIDEO_SAA5246A=m
+CONFIG_VIDEO_SAA5249=m
+CONFIG_TUNER_3036=m
+CONFIG_VIDEO_STRADIS=m
+CONFIG_VIDEO_ZORAN_ZR36060=m
+CONFIG_VIDEO_ZORAN=m
+CONFIG_VIDEO_ZORAN_BUZ=m
+CONFIG_VIDEO_ZORAN_DC10=m
+CONFIG_VIDEO_ZORAN_DC30=m
+CONFIG_VIDEO_ZORAN_LML33=m
+CONFIG_VIDEO_ZORAN_LML33R10=m
+CONFIG_VIDEO_ZORAN_AVS6EYES=m
+CONFIG_VIDEO_SAA7134=m
+CONFIG_VIDEO_SAA7134_ALSA=m
+CONFIG_VIDEO_SAA7134_OSS=m
+CONFIG_VIDEO_SAA7134_DVB=m
+CONFIG_VIDEO_MXB=m
+CONFIG_VIDEO_DPC=m
+CONFIG_VIDEO_HEXIUM_ORION=m
+CONFIG_VIDEO_HEXIUM_GEMINI=m
+CONFIG_VIDEO_CX88=m
+CONFIG_VIDEO_CX88_ALSA=m
+CONFIG_VIDEO_CX88_BLACKBIRD=m
+CONFIG_VIDEO_CX88_DVB=m
+CONFIG_VIDEO_CX88_VP3054=m
+CONFIG_VIDEO_CAFE_CCIC=m
+
+#
+# V4L USB devices
+#
+CONFIG_VIDEO_PVRUSB2=m
+CONFIG_VIDEO_PVRUSB2_29XXX=y
+CONFIG_VIDEO_PVRUSB2_24XXX=y
+CONFIG_VIDEO_PVRUSB2_SYSFS=y
+# CONFIG_VIDEO_PVRUSB2_DEBUGIFC is not set
+CONFIG_VIDEO_EM28XX=m
+CONFIG_VIDEO_USBVISION=m
+CONFIG_VIDEO_USBVIDEO=m
+CONFIG_USB_VICAM=m
+CONFIG_USB_IBMCAM=m
+CONFIG_USB_KONICAWC=m
+CONFIG_USB_QUICKCAM_MESSENGER=m
+CONFIG_USB_ET61X251=m
+CONFIG_VIDEO_OVCAMCHIP=m
+CONFIG_USB_W9968CF=m
+CONFIG_USB_OV511=m
+CONFIG_USB_SE401=m
+CONFIG_USB_SN9C102=m
+CONFIG_USB_STV680=m
+CONFIG_USB_ZC0301=m
+CONFIG_USB_PWC=m
+# CONFIG_USB_PWC_DEBUG is not set
+
+#
+# Radio Adapters
+#
+CONFIG_RADIO_GEMTEK_PCI=m
+CONFIG_RADIO_MAXIRADIO=m
+CONFIG_RADIO_MAESTRO=m
+CONFIG_USB_DSBR=m
+
+#
+# Digital Video Broadcasting Devices
+#
+CONFIG_DVB_CORE=m
+CONFIG_DVB_CORE_ATTACH=y
+
+#
+# Supported DVB Frontends
+#
+
+#
+# Customise DVB Frontends
+#
+# CONFIG_DVB_FE_CUSTOMISE is not set
+
+#
+# Tuners/PLL support
+#
+CONFIG_DVB_PLL=m
+CONFIG_DVB_TDA826X=m
+CONFIG_DVB_TUNER_MT2060=m
+
+#
+# Miscellaneous devices
+#
+CONFIG_DVB_LNBP21=m
+CONFIG_DVB_ISL6421=m
+CONFIG_DVB_TUA6100=m
+CONFIG_VIDEO_SAA7146=m
+CONFIG_VIDEO_SAA7146_VV=m
+CONFIG_VIDEO_TUNER=m
+CONFIG_VIDEO_BUF=m
+CONFIG_VIDEO_BUF_DVB=m
+CONFIG_VIDEO_BTCX=m
+CONFIG_VIDEO_IR=m
+CONFIG_VIDEO_TVEEPROM=m
+
+#
+# Graphics support
+#
+CONFIG_FIRMWARE_EDID=y
+CONFIG_FB=y
+CONFIG_FB_DDC=m
+CONFIG_FB_CFB_FILLRECT=m
+CONFIG_FB_CFB_COPYAREA=m
+CONFIG_FB_CFB_IMAGEBLIT=m
+# CONFIG_FB_MACMODES is not set
+# CONFIG_FB_BACKLIGHT is not set
+CONFIG_FB_MODE_HELPERS=y
+CONFIG_FB_TILEBLITTING=y
+CONFIG_FB_CIRRUS=m
+CONFIG_FB_PM2=m
+CONFIG_FB_PM2_FIFO_DISCONNECT=y
+CONFIG_FB_CYBER2000=m
+# CONFIG_FB_ASILIANT is not set
+# CONFIG_FB_IMSTT is not set
+CONFIG_FB_S1D13XXX=m
+CONFIG_FB_NVIDIA=m
+# CONFIG_FB_NVIDIA_I2C is not set
+# CONFIG_FB_RIVA is not set
+CONFIG_FB_MATROX=m
+CONFIG_FB_MATROX_MILLENIUM=y
+CONFIG_FB_MATROX_MYSTIQUE=y
+CONFIG_FB_MATROX_G=y
+CONFIG_FB_MATROX_I2C=m
+CONFIG_FB_MATROX_MAVEN=m
+CONFIG_FB_MATROX_MULTIHEAD=y
+CONFIG_FB_RADEON=m
+CONFIG_FB_RADEON_I2C=y
+# CONFIG_FB_RADEON_DEBUG is not set
+CONFIG_FB_ATY128=m
+CONFIG_FB_ATY=m
+CONFIG_FB_ATY_CT=y
+# CONFIG_FB_ATY_GENERIC_LCD is not set
+CONFIG_FB_ATY_GX=y
+CONFIG_FB_SAVAGE=m
+# CONFIG_FB_SAVAGE_I2C is not set
+# CONFIG_FB_SAVAGE_ACCEL is not set
+CONFIG_FB_SIS=m
+CONFIG_FB_SIS_300=y
+CONFIG_FB_SIS_315=y
+CONFIG_FB_NEOMAGIC=m
+CONFIG_FB_KYRO=m
+CONFIG_FB_3DFX=m
+# CONFIG_FB_3DFX_ACCEL is not set
+CONFIG_FB_VOODOO1=m
+CONFIG_FB_TRIDENT=m
+# CONFIG_FB_TRIDENT_ACCEL is not set
+CONFIG_FB_VIRTUAL=m
+
+#
+# Console display driver support
+#
+CONFIG_VGA_CONSOLE=y
+# CONFIG_VGACON_SOFT_SCROLLBACK is not set
+CONFIG_DUMMY_CONSOLE=y
+CONFIG_FRAMEBUFFER_CONSOLE=y
+CONFIG_FRAMEBUFFER_CONSOLE_ROTATION=y
+# CONFIG_FONTS is not set
+CONFIG_FONT_8x8=y
+CONFIG_FONT_8x16=y
+
+#
+# Logo configuration
+#
+# CONFIG_LOGO is not set
+CONFIG_BACKLIGHT_LCD_SUPPORT=y
+# CONFIG_LCD_CLASS_DEVICE is not set
+
+#
+# Sound
+#
+CONFIG_SOUND=y
+
+#
+# Advanced Linux Sound Architecture
+#
+CONFIG_SND=m
+CONFIG_SND_TIMER=m
+CONFIG_SND_PCM=m
+CONFIG_SND_HWDEP=m
+CONFIG_SND_RAWMIDI=m
+CONFIG_SND_SEQUENCER=m
+CONFIG_SND_SEQ_DUMMY=m
+CONFIG_SND_OSSEMUL=y
+CONFIG_SND_MIXER_OSS=m
+CONFIG_SND_PCM_OSS=m
+CONFIG_SND_PCM_OSS_PLUGINS=y
+CONFIG_SND_SEQUENCER_OSS=y
+CONFIG_SND_RTCTIMER=m
+CONFIG_SND_SEQ_RTCTIMER_DEFAULT=y
+# CONFIG_SND_DYNAMIC_MINORS is not set
+CONFIG_SND_SUPPORT_OLD_API=y
+CONFIG_SND_VERBOSE_PROCFS=y
+# CONFIG_SND_VERBOSE_PRINTK is not set
+# CONFIG_SND_DEBUG is not set
+
+#
+# Generic devices
+#
+CONFIG_SND_MPU401_UART=m
+CONFIG_SND_OPL3_LIB=m
+CONFIG_SND_VX_LIB=m
+CONFIG_SND_AC97_CODEC=m
+CONFIG_SND_DUMMY=m
+CONFIG_SND_VIRMIDI=m
+CONFIG_SND_MTPAV=m
+CONFIG_SND_MTS64=m
+CONFIG_SND_SERIAL_U16550=m
+CONFIG_SND_MPU401=m
+
+#
+# PCI devices
+#
+CONFIG_SND_AD1889=m
+CONFIG_SND_ALS300=m
+CONFIG_SND_ALI5451=m
+CONFIG_SND_ATIIXP=m
+CONFIG_SND_ATIIXP_MODEM=m
+CONFIG_SND_AU8810=m
+CONFIG_SND_AU8820=m
+CONFIG_SND_AU8830=m
+CONFIG_SND_AZT3328=m
+CONFIG_SND_BT87X=m
+# CONFIG_SND_BT87X_OVERCLOCK is not set
+CONFIG_SND_CA0106=m
+CONFIG_SND_CMIPCI=m
+CONFIG_SND_CS4281=m
+CONFIG_SND_CS46XX=m
+CONFIG_SND_CS46XX_NEW_DSP=y
+CONFIG_SND_DARLA20=m
+CONFIG_SND_GINA20=m
+CONFIG_SND_LAYLA20=m
+CONFIG_SND_DARLA24=m
+CONFIG_SND_GINA24=m
+CONFIG_SND_LAYLA24=m
+CONFIG_SND_MONA=m
+CONFIG_SND_MIA=m
+CONFIG_SND_ECHO3G=m
+CONFIG_SND_INDIGO=m
+CONFIG_SND_INDIGOIO=m
+CONFIG_SND_INDIGODJ=m
+CONFIG_SND_EMU10K1=m
+CONFIG_SND_EMU10K1X=m
+CONFIG_SND_ENS1370=m
+CONFIG_SND_ENS1371=m
+CONFIG_SND_ES1938=m
+CONFIG_SND_ES1968=m
+CONFIG_SND_FM801=m
+CONFIG_SND_FM801_TEA575X_BOOL=y
+CONFIG_SND_FM801_TEA575X=m
+CONFIG_SND_HDA_INTEL=m
+CONFIG_SND_HDSP=m
+CONFIG_SND_HDSPM=m
+CONFIG_SND_ICE1712=m
+CONFIG_SND_ICE1724=m
+CONFIG_SND_INTEL8X0=m
+CONFIG_SND_INTEL8X0M=m
+CONFIG_SND_KORG1212=m
+CONFIG_SND_MAESTRO3=m
+CONFIG_SND_MIXART=m
+CONFIG_SND_NM256=m
+CONFIG_SND_PCXHR=m
+CONFIG_SND_RIPTIDE=m
+CONFIG_SND_RME32=m
+CONFIG_SND_RME96=m
+CONFIG_SND_RME9652=m
+CONFIG_SND_SONICVIBES=m
+CONFIG_SND_TRIDENT=m
+CONFIG_SND_VIA82XX=m
+CONFIG_SND_VIA82XX_MODEM=m
+CONFIG_SND_VX222=m
+CONFIG_SND_YMFPCI=m
+CONFIG_SND_AC97_POWER_SAVE=y
+
+#
+# ALSA MIPS devices
+#
+
+#
+# USB devices
+#
+CONFIG_SND_USB_AUDIO=m
+
+#
+# Open Sound System
+#
+CONFIG_SOUND_PRIME=m
+CONFIG_SOUND_TRIDENT=m
+CONFIG_SOUND_MSNDCLAS=m
+CONFIG_MSNDCLAS_INIT_FILE="/etc/sound/msndinit.bin"
+CONFIG_MSNDCLAS_PERM_FILE="/etc/sound/msndperm.bin"
+CONFIG_SOUND_MSNDPIN=m
+CONFIG_MSNDPIN_INIT_FILE="/etc/sound/pndspini.bin"
+CONFIG_MSNDPIN_PERM_FILE="/etc/sound/pndsperm.bin"
+CONFIG_AC97_BUS=m
+
+#
+# HID Devices
+#
+CONFIG_HID=y
+
+#
+# USB support
+#
+CONFIG_USB_ARCH_HAS_HCD=y
+CONFIG_USB_ARCH_HAS_OHCI=y
+CONFIG_USB_ARCH_HAS_EHCI=y
+CONFIG_USB=y
+# CONFIG_USB_DEBUG is not set
+
+#
+# Miscellaneous USB options
+#
+CONFIG_USB_DEVICEFS=y
+# CONFIG_USB_DYNAMIC_MINORS is not set
+# CONFIG_USB_OTG is not set
+
+#
+# USB Host Controller Drivers
+#
+CONFIG_USB_EHCI_HCD=m
+CONFIG_USB_EHCI_SPLIT_ISO=y
+CONFIG_USB_EHCI_ROOT_HUB_TT=y
+# CONFIG_USB_EHCI_TT_NEWSCHED is not set
+CONFIG_USB_ISP116X_HCD=m
+CONFIG_USB_OHCI_HCD=m
+CONFIG_USB_OHCI_LITTLE_ENDIAN=y
+CONFIG_USB_UHCI_HCD=y
+CONFIG_USB_U132_HCD=m
+CONFIG_USB_SL811_HCD=m
+
+#
+# USB Device Class drivers
+#
+CONFIG_USB_ACM=m
+CONFIG_USB_PRINTER=m
+
+#
+# NOTE: USB_STORAGE enables SCSI, and 'SCSI disk support'
+#
+
+#
+# may also be needed; see USB_STORAGE Help for more information
+#
+CONFIG_USB_STORAGE=m
+# CONFIG_USB_STORAGE_DEBUG is not set
+CONFIG_USB_STORAGE_DATAFAB=y
+CONFIG_USB_STORAGE_FREECOM=y
+CONFIG_USB_STORAGE_ISD200=y
+CONFIG_USB_STORAGE_DPCM=y
+CONFIG_USB_STORAGE_USBAT=y
+CONFIG_USB_STORAGE_SDDR09=y
+CONFIG_USB_STORAGE_SDDR55=y
+CONFIG_USB_STORAGE_JUMPSHOT=y
+CONFIG_USB_STORAGE_ALAUDA=y
+CONFIG_USB_STORAGE_ONETOUCH=y
+CONFIG_USB_STORAGE_KARMA=y
+# CONFIG_USB_LIBUSUAL is not set
+
+#
+# USB Input Devices
+#
+CONFIG_USB_HID=m
+# CONFIG_USB_HIDINPUT_POWERBOOK is not set
+# CONFIG_HID_FF is not set
+CONFIG_USB_HIDDEV=y
+
+#
+# USB HID Boot Protocol drivers
+#
+CONFIG_USB_KBD=m
+CONFIG_USB_MOUSE=m
+
+#
+# USB Imaging devices
+#
+CONFIG_USB_MDC800=m
+CONFIG_USB_MICROTEK=m
+
+#
+# USB Network Adapters
+#
+CONFIG_USB_CATC=m
+CONFIG_USB_KAWETH=m
+CONFIG_USB_PEGASUS=m
+CONFIG_USB_RTL8150=m
+CONFIG_USB_USBNET_MII=m
+CONFIG_USB_USBNET=m
+CONFIG_USB_NET_AX8817X=m
+CONFIG_USB_NET_CDCETHER=m
+CONFIG_USB_NET_GL620A=m
+CONFIG_USB_NET_NET1080=m
+CONFIG_USB_NET_PLUSB=m
+CONFIG_USB_NET_MCS7830=m
+CONFIG_USB_NET_RNDIS_HOST=m
+CONFIG_USB_NET_CDC_SUBSET=m
+CONFIG_USB_ALI_M5632=y
+CONFIG_USB_AN2720=y
+CONFIG_USB_BELKIN=y
+CONFIG_USB_ARMLINUX=y
+CONFIG_USB_EPSON2888=y
+CONFIG_USB_NET_ZAURUS=m
+CONFIG_USB_MON=y
+
+#
+# USB port drivers
+#
+CONFIG_USB_USS720=m
+
+#
+# USB Miscellaneous drivers
+#
+CONFIG_USB_ADUTUX=m
+CONFIG_USB_AUERSWALD=m
+CONFIG_USB_RIO500=m
+CONFIG_USB_LEGOTOWER=m
+CONFIG_USB_LCD=m
+CONFIG_USB_LED=m
+CONFIG_USB_CYPRESS_CY7C63=m
+CONFIG_USB_CYTHERM=m
+CONFIG_USB_PHIDGET=m
+CONFIG_USB_PHIDGETKIT=m
+CONFIG_USB_PHIDGETMOTORCONTROL=m
+CONFIG_USB_PHIDGETSERVO=m
+CONFIG_USB_IDMOUSE=m
+CONFIG_USB_FTDI_ELAN=m
+CONFIG_USB_APPLEDISPLAY=m
+CONFIG_USB_SISUSBVGA=m
+CONFIG_USB_SISUSBVGA_CON=y
+CONFIG_USB_LD=m
+CONFIG_USB_TRANCEVIBRATOR=m
+CONFIG_USB_TEST=m
+
+#
+# USB DSL modem support
+#
+CONFIG_USB_ATM=m
+CONFIG_USB_SPEEDTOUCH=m
+CONFIG_USB_CXACRU=m
+CONFIG_USB_UEAGLEATM=m
+CONFIG_USB_XUSBATM=m
+
+#
+# USB Gadget Support
+#
+CONFIG_USB_GADGET=m
+# CONFIG_USB_GADGET_DEBUG_FILES is not set
+CONFIG_USB_GADGET_SELECTED=y
+CONFIG_USB_GADGET_NET2280=y
+CONFIG_USB_NET2280=m
+# CONFIG_USB_GADGET_PXA2XX is not set
+# CONFIG_USB_GADGET_GOKU is not set
+# CONFIG_USB_GADGET_LH7A40X is not set
+# CONFIG_USB_GADGET_OMAP is not set
+# CONFIG_USB_GADGET_AT91 is not set
+# CONFIG_USB_GADGET_DUMMY_HCD is not set
+CONFIG_USB_GADGET_DUALSPEED=y
+CONFIG_USB_ZERO=m
+CONFIG_USB_ETH=m
+CONFIG_USB_ETH_RNDIS=y
+CONFIG_USB_GADGETFS=m
+CONFIG_USB_FILE_STORAGE=m
+# CONFIG_USB_FILE_STORAGE_TEST is not set
+CONFIG_USB_G_SERIAL=m
+CONFIG_USB_MIDI_GADGET=m
+
+#
+# MMC/SD Card support
+#
+CONFIG_MMC=m
+# CONFIG_MMC_DEBUG is not set
+CONFIG_MMC_BLOCK=m
+CONFIG_MMC_SDHCI=m
+CONFIG_MMC_TIFM_SD=m
+
+#
+# LED devices
+#
+# CONFIG_NEW_LEDS is not set
+
+#
+# LED drivers
+#
+
+#
+# LED Triggers
+#
+
+#
+# InfiniBand support
+#
+
+#
+# EDAC - error detection and reporting (RAS) (EXPERIMENTAL)
+#
+
+#
+# Real Time Clock
+#
+CONFIG_RTC_LIB=m
+CONFIG_RTC_CLASS=m
+
+#
+# RTC interfaces
+#
+CONFIG_RTC_INTF_SYSFS=y
+CONFIG_RTC_INTF_PROC=y
+CONFIG_RTC_INTF_DEV=y
+# CONFIG_RTC_INTF_DEV_UIE_EMUL is not set
+
+#
+# RTC drivers
+#
+CONFIG_RTC_DRV_X1205=m
+CONFIG_RTC_DRV_DS1307=m
+# CONFIG_RTC_DRV_DS1553 is not set
+CONFIG_RTC_DRV_ISL1208=m
+CONFIG_RTC_DRV_DS1672=m
+# CONFIG_RTC_DRV_DS1742 is not set
+CONFIG_RTC_DRV_PCF8563=m
+CONFIG_RTC_DRV_PCF8583=m
+CONFIG_RTC_DRV_RS5C348=m
+CONFIG_RTC_DRV_RS5C372=m
+CONFIG_RTC_DRV_M48T86=m
+# CONFIG_RTC_DRV_TEST is not set
+CONFIG_RTC_DRV_MAX6902=m
+# CONFIG_RTC_DRV_V3020 is not set
+
+#
+# DMA Engine support
+#
+CONFIG_DMA_ENGINE=y
+
+#
+# DMA Clients
+#
+CONFIG_NET_DMA=y
+
+#
+# DMA Devices
+#
+# CONFIG_INTEL_IOATDMA is not set
+
+#
+# Virtualization
+#
+
+#
+# File systems
+#
+CONFIG_EXT2_FS=y
+CONFIG_EXT2_FS_XATTR=y
+CONFIG_EXT2_FS_POSIX_ACL=y
+CONFIG_EXT2_FS_SECURITY=y
+# CONFIG_EXT2_FS_XIP is not set
+CONFIG_EXT3_FS=y
+CONFIG_EXT3_FS_XATTR=y
+CONFIG_EXT3_FS_POSIX_ACL=y
+CONFIG_EXT3_FS_SECURITY=y
+CONFIG_EXT4DEV_FS=m
+CONFIG_EXT4DEV_FS_XATTR=y
+CONFIG_EXT4DEV_FS_POSIX_ACL=y
+CONFIG_EXT4DEV_FS_SECURITY=y
+CONFIG_JBD=y
+# CONFIG_JBD_DEBUG is not set
+CONFIG_JBD2=m
+# CONFIG_JBD2_DEBUG is not set
+CONFIG_FS_MBCACHE=y
+CONFIG_REISERFS_FS=m
+# CONFIG_REISERFS_CHECK is not set
+# CONFIG_REISERFS_PROC_INFO is not set
+CONFIG_REISERFS_FS_XATTR=y
+CONFIG_REISERFS_FS_POSIX_ACL=y
+CONFIG_REISERFS_FS_SECURITY=y
+CONFIG_JFS_FS=m
+# CONFIG_JFS_POSIX_ACL is not set
+CONFIG_JFS_SECURITY=y
+# CONFIG_JFS_DEBUG is not set
+# CONFIG_JFS_STATISTICS is not set
+CONFIG_FS_POSIX_ACL=y
+CONFIG_XFS_FS=m
+CONFIG_XFS_QUOTA=y
+CONFIG_XFS_SECURITY=y
+CONFIG_XFS_POSIX_ACL=y
+CONFIG_XFS_RT=y
+CONFIG_GFS2_FS=m
+CONFIG_GFS2_FS_LOCKING_NOLOCK=m
+CONFIG_GFS2_FS_LOCKING_DLM=m
+CONFIG_OCFS2_FS=m
+CONFIG_OCFS2_DEBUG_MASKLOG=y
+CONFIG_MINIX_FS=m
+CONFIG_ROMFS_FS=m
+CONFIG_INOTIFY=y
+CONFIG_INOTIFY_USER=y
+CONFIG_QUOTA=y
+CONFIG_QFMT_V1=m
+CONFIG_QFMT_V2=m
+CONFIG_QUOTACTL=y
+CONFIG_DNOTIFY=y
+CONFIG_AUTOFS_FS=m
+CONFIG_AUTOFS4_FS=m
+CONFIG_FUSE_FS=m
+CONFIG_GENERIC_ACL=y
+
+#
+# CD-ROM/DVD Filesystems
+#
+CONFIG_ISO9660_FS=m
+CONFIG_JOLIET=y
+CONFIG_ZISOFS=y
+CONFIG_UDF_FS=m
+CONFIG_UDF_NLS=y
+
+#
+# DOS/FAT/NT Filesystems
+#
+CONFIG_FAT_FS=m
+CONFIG_MSDOS_FS=m
+CONFIG_VFAT_FS=m
+CONFIG_FAT_DEFAULT_CODEPAGE=437
+CONFIG_FAT_DEFAULT_IOCHARSET="iso8859-1"
+CONFIG_NTFS_FS=m
+# CONFIG_NTFS_DEBUG is not set
+CONFIG_NTFS_RW=y
+
+#
+# Pseudo filesystems
+#
+CONFIG_PROC_FS=y
+CONFIG_PROC_KCORE=y
+CONFIG_PROC_SYSCTL=y
+CONFIG_SYSFS=y
+CONFIG_TMPFS=y
+CONFIG_TMPFS_POSIX_ACL=y
+CONFIG_RAMFS=y
+CONFIG_CONFIGFS_FS=m
+
+#
+# Miscellaneous filesystems
+#
+CONFIG_ADFS_FS=m
+# CONFIG_ADFS_FS_RW is not set
+CONFIG_AFFS_FS=m
+CONFIG_ECRYPT_FS=m
+CONFIG_HFS_FS=m
+CONFIG_HFSPLUS_FS=m
+CONFIG_BEFS_FS=m
+# CONFIG_BEFS_DEBUG is not set
+CONFIG_BFS_FS=m
+CONFIG_EFS_FS=m
+CONFIG_JFFS2_FS=m
+CONFIG_JFFS2_FS_DEBUG=0
+CONFIG_JFFS2_FS_WRITEBUFFER=y
+# CONFIG_JFFS2_SUMMARY is not set
+CONFIG_JFFS2_FS_XATTR=y
+CONFIG_JFFS2_FS_POSIX_ACL=y
+CONFIG_JFFS2_FS_SECURITY=y
+# CONFIG_JFFS2_COMPRESSION_OPTIONS is not set
+CONFIG_JFFS2_ZLIB=y
+CONFIG_JFFS2_RTIME=y
+# CONFIG_JFFS2_RUBIN is not set
+CONFIG_CRAMFS=y
+CONFIG_VXFS_FS=m
+CONFIG_HPFS_FS=m
+CONFIG_QNX4FS_FS=m
+CONFIG_SYSV_FS=m
+CONFIG_UFS_FS=m
+# CONFIG_UFS_FS_WRITE is not set
+# CONFIG_UFS_DEBUG is not set
+
+#
+# Network File Systems
+#
+CONFIG_NFS_FS=y
+CONFIG_NFS_V3=y
+CONFIG_NFS_V3_ACL=y
+CONFIG_NFS_V4=y
+CONFIG_NFS_DIRECTIO=y
+CONFIG_NFSD=m
+CONFIG_NFSD_V2_ACL=y
+CONFIG_NFSD_V3=y
+CONFIG_NFSD_V3_ACL=y
+CONFIG_NFSD_V4=y
+CONFIG_NFSD_TCP=y
+CONFIG_LOCKD=y
+CONFIG_LOCKD_V4=y
+CONFIG_EXPORTFS=m
+CONFIG_NFS_ACL_SUPPORT=y
+CONFIG_NFS_COMMON=y
+CONFIG_SUNRPC=y
+CONFIG_SUNRPC_GSS=y
+CONFIG_RPCSEC_GSS_KRB5=y
+# CONFIG_RPCSEC_GSS_SPKM3 is not set
+CONFIG_SMB_FS=m
+# CONFIG_SMB_NLS_DEFAULT is not set
+CONFIG_CIFS=m
+# CONFIG_CIFS_STATS is not set
+# CONFIG_CIFS_WEAK_PW_HASH is not set
+CONFIG_CIFS_XATTR=y
+CONFIG_CIFS_POSIX=y
+# CONFIG_CIFS_DEBUG2 is not set
+# CONFIG_CIFS_EXPERIMENTAL is not set
+CONFIG_NCP_FS=m
+CONFIG_NCPFS_PACKET_SIGNING=y
+CONFIG_NCPFS_IOCTL_LOCKING=y
+CONFIG_NCPFS_STRONG=y
+CONFIG_NCPFS_NFS_NS=y
+CONFIG_NCPFS_OS2_NS=y
+# CONFIG_NCPFS_SMALLDOS is not set
+CONFIG_NCPFS_NLS=y
+CONFIG_NCPFS_EXTRAS=y
+CONFIG_CODA_FS=m
+# CONFIG_CODA_FS_OLD_API is not set
+CONFIG_AFS_FS=m
+# CONFIG_AFS_DEBUG is not set
+CONFIG_9P_FS=m
+
+#
+# Partition Types
+#
+# CONFIG_PARTITION_ADVANCED is not set
+CONFIG_MSDOS_PARTITION=y
+
+#
+# Native Language Support
+#
+CONFIG_NLS=y
+CONFIG_NLS_DEFAULT="iso8859-1"
+CONFIG_NLS_CODEPAGE_437=m
+CONFIG_NLS_CODEPAGE_737=m
+CONFIG_NLS_CODEPAGE_775=m
+CONFIG_NLS_CODEPAGE_850=m
+CONFIG_NLS_CODEPAGE_852=m
+CONFIG_NLS_CODEPAGE_855=m
+CONFIG_NLS_CODEPAGE_857=m
+CONFIG_NLS_CODEPAGE_860=m
+CONFIG_NLS_CODEPAGE_861=m
+CONFIG_NLS_CODEPAGE_862=m
+CONFIG_NLS_CODEPAGE_863=m
+CONFIG_NLS_CODEPAGE_864=m
+CONFIG_NLS_CODEPAGE_865=m
+CONFIG_NLS_CODEPAGE_866=m
+CONFIG_NLS_CODEPAGE_869=m
+CONFIG_NLS_CODEPAGE_936=m
+CONFIG_NLS_CODEPAGE_950=m
+CONFIG_NLS_CODEPAGE_932=m
+CONFIG_NLS_CODEPAGE_949=m
+CONFIG_NLS_CODEPAGE_874=m
+CONFIG_NLS_ISO8859_8=m
+CONFIG_NLS_CODEPAGE_1250=m
+CONFIG_NLS_CODEPAGE_1251=m
+CONFIG_NLS_ASCII=m
+CONFIG_NLS_ISO8859_1=m
+CONFIG_NLS_ISO8859_2=m
+CONFIG_NLS_ISO8859_3=m
+CONFIG_NLS_ISO8859_4=m
+CONFIG_NLS_ISO8859_5=m
+CONFIG_NLS_ISO8859_6=m
+CONFIG_NLS_ISO8859_7=m
+CONFIG_NLS_ISO8859_9=m
+CONFIG_NLS_ISO8859_13=m
+CONFIG_NLS_ISO8859_14=m
+CONFIG_NLS_ISO8859_15=m
+CONFIG_NLS_KOI8_R=m
+CONFIG_NLS_KOI8_U=m
+CONFIG_NLS_UTF8=m
+
+#
+# Distributed Lock Manager
+#
+CONFIG_DLM=m
+# CONFIG_DLM_DEBUG is not set
+
+#
+# Profiling support
+#
+CONFIG_PROFILING=y
+CONFIG_OPROFILE=m
+
+#
+# Kernel hacking
+#
+CONFIG_TRACE_IRQFLAGS_SUPPORT=y
+# CONFIG_PRINTK_TIME is not set
+CONFIG_ENABLE_MUST_CHECK=y
+CONFIG_MAGIC_SYSRQ=y
+CONFIG_UNUSED_SYMBOLS=y
+# CONFIG_DEBUG_FS is not set
+# CONFIG_HEADERS_CHECK is not set
+# CONFIG_DEBUG_KERNEL is not set
+CONFIG_LOG_BUF_SHIFT=14
+# CONFIG_CROSSCOMPILE is not set
+CONFIG_CMDLINE=""
+
+#
+# Security options
+#
+CONFIG_KEYS=y
+# CONFIG_KEYS_DEBUG_PROC_KEYS is not set
+CONFIG_SECURITY=y
+CONFIG_SECURITY_NETWORK=y
+CONFIG_SECURITY_NETWORK_XFRM=y
+CONFIG_SECURITY_CAPABILITIES=y
+# CONFIG_SECURITY_ROOTPLUG is not set
+CONFIG_SECURITY_SELINUX=y
+CONFIG_SECURITY_SELINUX_BOOTPARAM=y
+CONFIG_SECURITY_SELINUX_BOOTPARAM_VALUE=0
+CONFIG_SECURITY_SELINUX_DISABLE=y
+CONFIG_SECURITY_SELINUX_DEVELOP=y
+CONFIG_SECURITY_SELINUX_AVC_STATS=y
+CONFIG_SECURITY_SELINUX_CHECKREQPROT_VALUE=1
+# CONFIG_SECURITY_SELINUX_ENABLE_SECMARK_DEFAULT is not set
+# CONFIG_SECURITY_SELINUX_POLICYDB_VERSION_MAX is not set
+
+#
+# Cryptographic options
+#
+CONFIG_CRYPTO=y
+CONFIG_CRYPTO_ALGAPI=y
+CONFIG_CRYPTO_BLKCIPHER=y
+CONFIG_CRYPTO_HASH=y
+CONFIG_CRYPTO_MANAGER=y
+CONFIG_CRYPTO_HMAC=y
+CONFIG_CRYPTO_XCBC=m
+CONFIG_CRYPTO_NULL=m
+CONFIG_CRYPTO_MD4=m
+CONFIG_CRYPTO_MD5=y
+CONFIG_CRYPTO_SHA1=m
+CONFIG_CRYPTO_SHA256=m
+CONFIG_CRYPTO_SHA512=m
+CONFIG_CRYPTO_WP512=m
+CONFIG_CRYPTO_TGR192=m
+CONFIG_CRYPTO_GF128MUL=m
+CONFIG_CRYPTO_ECB=m
+CONFIG_CRYPTO_CBC=y
+CONFIG_CRYPTO_LRW=m
+CONFIG_CRYPTO_DES=y
+CONFIG_CRYPTO_BLOWFISH=m
+CONFIG_CRYPTO_TWOFISH=m
+CONFIG_CRYPTO_TWOFISH_COMMON=m
+CONFIG_CRYPTO_SERPENT=m
+CONFIG_CRYPTO_AES=m
+CONFIG_CRYPTO_CAST5=m
+CONFIG_CRYPTO_CAST6=m
+CONFIG_CRYPTO_TEA=m
+CONFIG_CRYPTO_ARC4=m
+CONFIG_CRYPTO_KHAZAD=m
+CONFIG_CRYPTO_ANUBIS=m
+CONFIG_CRYPTO_DEFLATE=m
+CONFIG_CRYPTO_MICHAEL_MIC=m
+CONFIG_CRYPTO_CRC32C=m
+CONFIG_CRYPTO_TEST=m
+
+#
+# Hardware crypto devices
+#
+
+#
+# Library routines
+#
+CONFIG_BITREVERSE=y
+CONFIG_CRC_CCITT=m
+CONFIG_CRC16=m
+CONFIG_CRC32=y
+CONFIG_LIBCRC32C=m
+CONFIG_AUDIT_GENERIC=y
+CONFIG_ZLIB_INFLATE=y
+CONFIG_ZLIB_DEFLATE=m
+CONFIG_REED_SOLOMON=m
+CONFIG_REED_SOLOMON_DEC16=y
+CONFIG_TEXTSEARCH=y
+CONFIG_TEXTSEARCH_KMP=m
+CONFIG_TEXTSEARCH_BM=m
+CONFIG_TEXTSEARCH_FSM=m
+CONFIG_PLIST=y

Added: dists/sid/linux-2.6/debian/config/mipsel/config.5kc-malta
==============================================================================
--- (empty file)
+++ dists/sid/linux-2.6/debian/config/mipsel/config.5kc-malta	Mon Nov 26 20:06:56 2007
@@ -0,0 +1,3080 @@
+#
+# Machine selection
+#
+CONFIG_ZONE_DMA=y
+# CONFIG_MACH_ALCHEMY is not set
+# CONFIG_BASLER_EXCITE is not set
+# CONFIG_MIPS_COBALT is not set
+# CONFIG_MACH_DECSTATION is not set
+# CONFIG_MIPS_EV64120 is not set
+# CONFIG_MACH_JAZZ is not set
+# CONFIG_LASAT is not set
+# CONFIG_MIPS_ATLAS is not set
+CONFIG_MIPS_MALTA=y
+# CONFIG_MIPS_SEAD is not set
+# CONFIG_WR_PPMC is not set
+# CONFIG_MIPS_SIM is not set
+# CONFIG_MOMENCO_OCELOT is not set
+# CONFIG_MOMENCO_OCELOT_3 is not set
+# CONFIG_MOMENCO_OCELOT_C is not set
+# CONFIG_PNX8550_JBS is not set
+# CONFIG_PNX8550_STB810 is not set
+# CONFIG_DDB5477 is not set
+# CONFIG_MACH_VR41XX is not set
+# CONFIG_PMC_YOSEMITE is not set
+# CONFIG_QEMU is not set
+# CONFIG_MARKEINS is not set
+# CONFIG_SGI_IP22 is not set
+# CONFIG_SGI_IP27 is not set
+# CONFIG_SGI_IP32 is not set
+# CONFIG_SIBYTE_BIGSUR is not set
+# CONFIG_SIBYTE_SWARM is not set
+# CONFIG_SIBYTE_SENTOSA is not set
+# CONFIG_SIBYTE_RHONE is not set
+# CONFIG_SIBYTE_CARMEL is not set
+# CONFIG_SIBYTE_PTSWARM is not set
+# CONFIG_SIBYTE_LITTLESUR is not set
+# CONFIG_SIBYTE_CRHINE is not set
+# CONFIG_SIBYTE_CRHONE is not set
+# CONFIG_SNI_RM is not set
+# CONFIG_TOSHIBA_JMR3927 is not set
+# CONFIG_TOSHIBA_RBTX4927 is not set
+# CONFIG_TOSHIBA_RBTX4938 is not set
+CONFIG_RWSEM_GENERIC_SPINLOCK=y
+# CONFIG_ARCH_HAS_ILOG2_U32 is not set
+# CONFIG_ARCH_HAS_ILOG2_U64 is not set
+CONFIG_GENERIC_FIND_NEXT_BIT=y
+CONFIG_GENERIC_HWEIGHT=y
+CONFIG_GENERIC_CALIBRATE_DELAY=y
+CONFIG_GENERIC_TIME=y
+CONFIG_SCHED_NO_NO_OMIT_FRAME_POINTER=y
+# CONFIG_GENERIC_HARDIRQS_NO__DO_IRQ is not set
+CONFIG_ARCH_MAY_HAVE_PC_FDC=y
+CONFIG_DMA_NONCOHERENT=y
+CONFIG_DMA_NEED_PCI_MAP_STATE=y
+CONFIG_EARLY_PRINTK=y
+CONFIG_SYS_HAS_EARLY_PRINTK=y
+CONFIG_GENERIC_ISA_DMA=y
+CONFIG_I8259=y
+CONFIG_MIPS_BONITO64=y
+CONFIG_MIPS_MSC=y
+# CONFIG_CPU_BIG_ENDIAN is not set
+CONFIG_CPU_LITTLE_ENDIAN=y
+CONFIG_SYS_SUPPORTS_BIG_ENDIAN=y
+CONFIG_SYS_SUPPORTS_LITTLE_ENDIAN=y
+CONFIG_IRQ_CPU=y
+CONFIG_MIPS_BOARDS_GEN=y
+CONFIG_PCI_GT64XXX_PCI0=y
+CONFIG_SWAP_IO_SPACE=y
+CONFIG_BOOT_ELF32=y
+CONFIG_MIPS_L1_CACHE_SHIFT=5
+CONFIG_HAVE_STD_PC_SERIAL_PORT=y
+
+#
+# CPU selection
+#
+# CONFIG_CPU_MIPS32_R1 is not set
+# CONFIG_CPU_MIPS32_R2 is not set
+CONFIG_CPU_MIPS64_R1=y
+# CONFIG_CPU_MIPS64_R2 is not set
+# CONFIG_CPU_R3000 is not set
+# CONFIG_CPU_TX39XX is not set
+# CONFIG_CPU_VR41XX is not set
+# CONFIG_CPU_R4300 is not set
+# CONFIG_CPU_R4X00 is not set
+# CONFIG_CPU_TX49XX is not set
+# CONFIG_CPU_R5000 is not set
+# CONFIG_CPU_R5432 is not set
+# CONFIG_CPU_R6000 is not set
+# CONFIG_CPU_NEVADA is not set
+# CONFIG_CPU_R8000 is not set
+# CONFIG_CPU_R10000 is not set
+# CONFIG_CPU_RM7000 is not set
+# CONFIG_CPU_RM9000 is not set
+# CONFIG_CPU_SB1 is not set
+CONFIG_SYS_HAS_CPU_MIPS32_R1=y
+CONFIG_SYS_HAS_CPU_MIPS32_R2=y
+CONFIG_SYS_HAS_CPU_MIPS64_R1=y
+CONFIG_SYS_HAS_CPU_NEVADA=y
+CONFIG_SYS_HAS_CPU_RM7000=y
+CONFIG_CPU_MIPS64=y
+CONFIG_CPU_MIPSR1=y
+CONFIG_SYS_SUPPORTS_32BIT_KERNEL=y
+CONFIG_SYS_SUPPORTS_64BIT_KERNEL=y
+CONFIG_CPU_SUPPORTS_32BIT_KERNEL=y
+CONFIG_CPU_SUPPORTS_64BIT_KERNEL=y
+
+#
+# Kernel type
+#
+# CONFIG_32BIT is not set
+CONFIG_64BIT=y
+CONFIG_PAGE_SIZE_4KB=y
+# CONFIG_PAGE_SIZE_8KB is not set
+# CONFIG_PAGE_SIZE_16KB is not set
+# CONFIG_PAGE_SIZE_64KB is not set
+CONFIG_BOARD_SCACHE=y
+CONFIG_MIPS_CPU_SCACHE=y
+CONFIG_CPU_HAS_PREFETCH=y
+CONFIG_MIPS_MT_DISABLED=y
+# CONFIG_MIPS_MT_SMP is not set
+# CONFIG_MIPS_MT_SMTC is not set
+# CONFIG_MIPS_VPE_LOADER is not set
+CONFIG_SYS_SUPPORTS_MULTITHREADING=y
+CONFIG_CPU_HAS_LLSC=y
+# CONFIG_CPU_HAS_SMARTMIPS is not set
+CONFIG_CPU_HAS_SYNC=y
+CONFIG_GENERIC_HARDIRQS=y
+CONFIG_GENERIC_IRQ_PROBE=y
+CONFIG_CPU_SUPPORTS_HIGHMEM=y
+CONFIG_SYS_SUPPORTS_SMARTMIPS=y
+CONFIG_ARCH_FLATMEM_ENABLE=y
+CONFIG_SELECT_MEMORY_MODEL=y
+CONFIG_FLATMEM_MANUAL=y
+# CONFIG_DISCONTIGMEM_MANUAL is not set
+# CONFIG_SPARSEMEM_MANUAL is not set
+CONFIG_FLATMEM=y
+CONFIG_FLAT_NODE_MEM_MAP=y
+# CONFIG_SPARSEMEM_STATIC is not set
+CONFIG_SPLIT_PTLOCK_CPUS=4
+CONFIG_RESOURCES_64BIT=y
+CONFIG_ZONE_DMA_FLAG=1
+# CONFIG_HZ_48 is not set
+# CONFIG_HZ_100 is not set
+# CONFIG_HZ_128 is not set
+CONFIG_HZ_250=y
+# CONFIG_HZ_256 is not set
+# CONFIG_HZ_1000 is not set
+# CONFIG_HZ_1024 is not set
+CONFIG_SYS_SUPPORTS_ARBIT_HZ=y
+CONFIG_HZ=250
+CONFIG_PREEMPT_NONE=y
+# CONFIG_PREEMPT_VOLUNTARY is not set
+# CONFIG_PREEMPT is not set
+# CONFIG_KEXEC is not set
+CONFIG_STACKTRACE_SUPPORT=y
+CONFIG_DEFCONFIG_LIST="/lib/modules/$UNAME_RELEASE/.config"
+
+#
+# Code maturity level options
+#
+CONFIG_EXPERIMENTAL=y
+CONFIG_BROKEN_ON_SMP=y
+
+#
+# General setup
+#
+CONFIG_LOCALVERSION=""
+# CONFIG_LOCALVERSION_AUTO is not set
+CONFIG_SWAP=y
+CONFIG_SYSVIPC=y
+# CONFIG_IPC_NS is not set
+CONFIG_POSIX_MQUEUE=y
+CONFIG_BSD_PROCESS_ACCT=y
+CONFIG_BSD_PROCESS_ACCT_V3=y
+# CONFIG_TASKSTATS is not set
+# CONFIG_UTS_NS is not set
+CONFIG_AUDIT=y
+CONFIG_IKCONFIG=y
+CONFIG_IKCONFIG_PROC=y
+CONFIG_LOG_BUF_SHIFT=14
+CONFIG_SYSFS_DEPRECATED=y
+CONFIG_BLK_DEV_INITRD=y
+CONFIG_INITRAMFS_SOURCE=""
+# CONFIG_CC_OPTIMIZE_FOR_SIZE is not set
+CONFIG_EMBEDDED=y
+CONFIG_SYSCTL_SYSCALL=y
+CONFIG_HOTPLUG=y
+CONFIG_BASE_FULL=y
+CONFIG_SLAB=y
+# CONFIG_SLUB is not set
+# CONFIG_SLOB is not set
+CONFIG_BASE_SMALL=0
+
+#
+# Loadable module support
+#
+CONFIG_MODULES=y
+CONFIG_MODULE_UNLOAD=y
+CONFIG_MODULE_FORCE_UNLOAD=y
+CONFIG_MODVERSIONS=y
+# CONFIG_MODULE_SRCVERSION_ALL is not set
+CONFIG_KMOD=y
+
+#
+# Block layer
+#
+# CONFIG_BLK_DEV_IO_TRACE is not set
+
+#
+# IO Schedulers
+#
+CONFIG_IOSCHED_NOOP=y
+CONFIG_IOSCHED_AS=y
+CONFIG_IOSCHED_DEADLINE=y
+CONFIG_IOSCHED_CFQ=y
+# CONFIG_DEFAULT_AS is not set
+# CONFIG_DEFAULT_DEADLINE is not set
+CONFIG_DEFAULT_CFQ=y
+# CONFIG_DEFAULT_NOOP is not set
+CONFIG_DEFAULT_IOSCHED="cfq"
+
+#
+# Bus options (PCI, PCMCIA, EISA, ISA, TC)
+#
+CONFIG_HW_HAS_PCI=y
+CONFIG_PCI=y
+# CONFIG_ARCH_SUPPORTS_MSI is not set
+CONFIG_MMU=y
+
+#
+# PCCARD (PCMCIA/CardBus) support
+#
+# CONFIG_PCCARD is not set
+# CONFIG_HOTPLUG_PCI is not set
+
+#
+# Executable file formats
+#
+CONFIG_BINFMT_ELF=y
+CONFIG_BINFMT_MISC=m
+# CONFIG_BUILD_ELF64 is not set
+CONFIG_MIPS32_COMPAT=y
+CONFIG_COMPAT=y
+CONFIG_SYSVIPC_COMPAT=y
+CONFIG_MIPS32_O32=y
+CONFIG_MIPS32_N32=y
+CONFIG_BINFMT_ELF32=y
+
+#
+# Power management options
+#
+# CONFIG_PM is not set
+
+#
+# Networking
+#
+CONFIG_NET=y
+
+#
+# Networking options
+#
+CONFIG_PACKET=y
+CONFIG_PACKET_MMAP=y
+CONFIG_UNIX=y
+CONFIG_XFRM=y
+CONFIG_XFRM_USER=m
+# CONFIG_XFRM_SUB_POLICY is not set
+# CONFIG_XFRM_MIGRATE is not set
+CONFIG_NET_KEY=m
+# CONFIG_NET_KEY_MIGRATE is not set
+CONFIG_INET=y
+CONFIG_IP_MULTICAST=y
+CONFIG_IP_ADVANCED_ROUTER=y
+CONFIG_ASK_IP_FIB_HASH=y
+# CONFIG_IP_FIB_TRIE is not set
+CONFIG_IP_FIB_HASH=y
+CONFIG_IP_MULTIPLE_TABLES=y
+CONFIG_IP_ROUTE_MULTIPATH=y
+CONFIG_IP_ROUTE_MULTIPATH_CACHED=y
+CONFIG_IP_ROUTE_MULTIPATH_RR=m
+CONFIG_IP_ROUTE_MULTIPATH_RANDOM=m
+CONFIG_IP_ROUTE_MULTIPATH_WRANDOM=m
+CONFIG_IP_ROUTE_MULTIPATH_DRR=m
+CONFIG_IP_ROUTE_VERBOSE=y
+# CONFIG_IP_PNP is not set
+CONFIG_NET_IPIP=m
+CONFIG_NET_IPGRE=m
+CONFIG_NET_IPGRE_BROADCAST=y
+CONFIG_IP_MROUTE=y
+CONFIG_IP_PIMSM_V1=y
+CONFIG_IP_PIMSM_V2=y
+# CONFIG_ARPD is not set
+CONFIG_SYN_COOKIES=y
+CONFIG_INET_AH=m
+CONFIG_INET_ESP=m
+CONFIG_INET_IPCOMP=m
+CONFIG_INET_XFRM_TUNNEL=m
+CONFIG_INET_TUNNEL=m
+CONFIG_INET_XFRM_MODE_TRANSPORT=m
+CONFIG_INET_XFRM_MODE_TUNNEL=m
+CONFIG_INET_XFRM_MODE_BEET=m
+CONFIG_INET_DIAG=m
+CONFIG_INET_TCP_DIAG=m
+CONFIG_TCP_CONG_ADVANCED=y
+CONFIG_TCP_CONG_BIC=y
+CONFIG_TCP_CONG_CUBIC=m
+CONFIG_TCP_CONG_WESTWOOD=m
+CONFIG_TCP_CONG_HTCP=m
+CONFIG_TCP_CONG_HSTCP=m
+CONFIG_TCP_CONG_HYBLA=m
+CONFIG_TCP_CONG_VEGAS=m
+CONFIG_TCP_CONG_SCALABLE=m
+CONFIG_TCP_CONG_LP=m
+CONFIG_TCP_CONG_VENO=m
+CONFIG_TCP_CONG_YEAH=m
+CONFIG_TCP_CONG_ILLINOIS=m
+CONFIG_DEFAULT_BIC=y
+# CONFIG_DEFAULT_CUBIC is not set
+# CONFIG_DEFAULT_HTCP is not set
+# CONFIG_DEFAULT_VEGAS is not set
+# CONFIG_DEFAULT_WESTWOOD is not set
+# CONFIG_DEFAULT_RENO is not set
+CONFIG_DEFAULT_TCP_CONG="bic"
+# CONFIG_TCP_MD5SIG is not set
+CONFIG_IP_VS=m
+# CONFIG_IP_VS_DEBUG is not set
+CONFIG_IP_VS_TAB_BITS=12
+
+#
+# IPVS transport protocol load balancing support
+#
+CONFIG_IP_VS_PROTO_TCP=y
+CONFIG_IP_VS_PROTO_UDP=y
+CONFIG_IP_VS_PROTO_ESP=y
+CONFIG_IP_VS_PROTO_AH=y
+
+#
+# IPVS scheduler
+#
+CONFIG_IP_VS_RR=m
+CONFIG_IP_VS_WRR=m
+CONFIG_IP_VS_LC=m
+CONFIG_IP_VS_WLC=m
+CONFIG_IP_VS_LBLC=m
+CONFIG_IP_VS_LBLCR=m
+CONFIG_IP_VS_DH=m
+CONFIG_IP_VS_SH=m
+CONFIG_IP_VS_SED=m
+CONFIG_IP_VS_NQ=m
+
+#
+# IPVS application helper
+#
+CONFIG_IP_VS_FTP=m
+CONFIG_IPV6=m
+CONFIG_IPV6_PRIVACY=y
+# CONFIG_IPV6_ROUTER_PREF is not set
+# CONFIG_IPV6_OPTIMISTIC_DAD is not set
+CONFIG_INET6_AH=m
+CONFIG_INET6_ESP=m
+CONFIG_INET6_IPCOMP=m
+# CONFIG_IPV6_MIP6 is not set
+CONFIG_INET6_XFRM_TUNNEL=m
+CONFIG_INET6_TUNNEL=m
+CONFIG_INET6_XFRM_MODE_TRANSPORT=m
+CONFIG_INET6_XFRM_MODE_TUNNEL=m
+CONFIG_INET6_XFRM_MODE_BEET=m
+CONFIG_INET6_XFRM_MODE_ROUTEOPTIMIZATION=m
+CONFIG_IPV6_SIT=m
+CONFIG_IPV6_TUNNEL=m
+# CONFIG_IPV6_MULTIPLE_TABLES is not set
+# CONFIG_NETLABEL is not set
+CONFIG_NETWORK_SECMARK=y
+CONFIG_NETFILTER=y
+# CONFIG_NETFILTER_DEBUG is not set
+CONFIG_BRIDGE_NETFILTER=y
+
+#
+# Core Netfilter Configuration
+#
+CONFIG_NETFILTER_NETLINK=m
+CONFIG_NETFILTER_NETLINK_QUEUE=m
+CONFIG_NETFILTER_NETLINK_LOG=m
+CONFIG_NF_CONNTRACK_ENABLED=m
+CONFIG_NF_CONNTRACK=m
+CONFIG_NF_CT_ACCT=y
+CONFIG_NF_CONNTRACK_MARK=y
+CONFIG_NF_CONNTRACK_SECMARK=y
+CONFIG_NF_CONNTRACK_EVENTS=y
+CONFIG_NF_CT_PROTO_GRE=m
+CONFIG_NF_CT_PROTO_SCTP=m
+CONFIG_NF_CONNTRACK_AMANDA=m
+CONFIG_NF_CONNTRACK_FTP=m
+CONFIG_NF_CONNTRACK_H323=m
+CONFIG_NF_CONNTRACK_IRC=m
+CONFIG_NF_CONNTRACK_NETBIOS_NS=m
+CONFIG_NF_CONNTRACK_PPTP=m
+CONFIG_NF_CONNTRACK_SANE=m
+CONFIG_NF_CONNTRACK_SIP=m
+CONFIG_NF_CONNTRACK_TFTP=m
+CONFIG_NF_CT_NETLINK=m
+CONFIG_NETFILTER_XTABLES=m
+CONFIG_NETFILTER_XT_TARGET_CLASSIFY=m
+CONFIG_NETFILTER_XT_TARGET_CONNMARK=m
+CONFIG_NETFILTER_XT_TARGET_DSCP=m
+CONFIG_NETFILTER_XT_TARGET_MARK=m
+CONFIG_NETFILTER_XT_TARGET_NFQUEUE=m
+CONFIG_NETFILTER_XT_TARGET_NFLOG=m
+CONFIG_NETFILTER_XT_TARGET_NOTRACK=m
+CONFIG_NETFILTER_XT_TARGET_SECMARK=m
+CONFIG_NETFILTER_XT_TARGET_CONNSECMARK=m
+CONFIG_NETFILTER_XT_TARGET_TCPMSS=m
+CONFIG_NETFILTER_XT_MATCH_COMMENT=m
+CONFIG_NETFILTER_XT_MATCH_CONNBYTES=m
+CONFIG_NETFILTER_XT_MATCH_CONNMARK=m
+CONFIG_NETFILTER_XT_MATCH_CONNTRACK=m
+CONFIG_NETFILTER_XT_MATCH_DCCP=m
+CONFIG_NETFILTER_XT_MATCH_DSCP=m
+CONFIG_NETFILTER_XT_MATCH_ESP=m
+CONFIG_NETFILTER_XT_MATCH_HELPER=m
+CONFIG_NETFILTER_XT_MATCH_LENGTH=m
+CONFIG_NETFILTER_XT_MATCH_LIMIT=m
+CONFIG_NETFILTER_XT_MATCH_MAC=m
+CONFIG_NETFILTER_XT_MATCH_MARK=m
+CONFIG_NETFILTER_XT_MATCH_POLICY=m
+CONFIG_NETFILTER_XT_MATCH_MULTIPORT=m
+CONFIG_NETFILTER_XT_MATCH_PHYSDEV=m
+CONFIG_NETFILTER_XT_MATCH_PKTTYPE=m
+CONFIG_NETFILTER_XT_MATCH_QUOTA=m
+CONFIG_NETFILTER_XT_MATCH_REALM=m
+CONFIG_NETFILTER_XT_MATCH_SCTP=m
+CONFIG_NETFILTER_XT_MATCH_STATE=m
+CONFIG_NETFILTER_XT_MATCH_STATISTIC=m
+CONFIG_NETFILTER_XT_MATCH_STRING=m
+CONFIG_NETFILTER_XT_MATCH_TCPMSS=m
+CONFIG_NETFILTER_XT_MATCH_HASHLIMIT=m
+
+#
+# IP: Netfilter Configuration
+#
+CONFIG_NF_CONNTRACK_IPV4=m
+CONFIG_NF_CONNTRACK_PROC_COMPAT=y
+CONFIG_IP_NF_QUEUE=m
+CONFIG_IP_NF_IPTABLES=m
+CONFIG_IP_NF_MATCH_IPRANGE=m
+CONFIG_IP_NF_MATCH_TOS=m
+CONFIG_IP_NF_MATCH_RECENT=m
+CONFIG_IP_NF_MATCH_ECN=m
+CONFIG_IP_NF_MATCH_AH=m
+CONFIG_IP_NF_MATCH_TTL=m
+CONFIG_IP_NF_MATCH_OWNER=m
+CONFIG_IP_NF_MATCH_ADDRTYPE=m
+CONFIG_IP_NF_FILTER=m
+CONFIG_IP_NF_TARGET_REJECT=m
+CONFIG_IP_NF_TARGET_LOG=m
+CONFIG_IP_NF_TARGET_ULOG=m
+CONFIG_NF_NAT=m
+CONFIG_NF_NAT_NEEDED=y
+CONFIG_IP_NF_TARGET_MASQUERADE=m
+CONFIG_IP_NF_TARGET_REDIRECT=m
+CONFIG_IP_NF_TARGET_NETMAP=m
+CONFIG_IP_NF_TARGET_SAME=m
+CONFIG_NF_NAT_SNMP_BASIC=m
+CONFIG_NF_NAT_PROTO_GRE=m
+CONFIG_NF_NAT_FTP=m
+CONFIG_NF_NAT_IRC=m
+CONFIG_NF_NAT_TFTP=m
+CONFIG_NF_NAT_AMANDA=m
+CONFIG_NF_NAT_PPTP=m
+CONFIG_NF_NAT_H323=m
+CONFIG_NF_NAT_SIP=m
+CONFIG_IP_NF_MANGLE=m
+CONFIG_IP_NF_TARGET_TOS=m
+CONFIG_IP_NF_TARGET_ECN=m
+CONFIG_IP_NF_TARGET_TTL=m
+CONFIG_IP_NF_TARGET_CLUSTERIP=m
+CONFIG_IP_NF_RAW=m
+CONFIG_IP_NF_ARPTABLES=m
+CONFIG_IP_NF_ARPFILTER=m
+CONFIG_IP_NF_ARP_MANGLE=m
+
+#
+# IPv6: Netfilter Configuration (EXPERIMENTAL)
+#
+CONFIG_NF_CONNTRACK_IPV6=m
+CONFIG_IP6_NF_QUEUE=m
+CONFIG_IP6_NF_IPTABLES=m
+CONFIG_IP6_NF_MATCH_RT=m
+CONFIG_IP6_NF_MATCH_OPTS=m
+CONFIG_IP6_NF_MATCH_FRAG=m
+CONFIG_IP6_NF_MATCH_HL=m
+CONFIG_IP6_NF_MATCH_OWNER=m
+CONFIG_IP6_NF_MATCH_IPV6HEADER=m
+CONFIG_IP6_NF_MATCH_AH=m
+CONFIG_IP6_NF_MATCH_MH=m
+CONFIG_IP6_NF_MATCH_EUI64=m
+CONFIG_IP6_NF_FILTER=m
+CONFIG_IP6_NF_TARGET_LOG=m
+CONFIG_IP6_NF_TARGET_REJECT=m
+CONFIG_IP6_NF_MANGLE=m
+CONFIG_IP6_NF_TARGET_HL=m
+CONFIG_IP6_NF_RAW=m
+
+#
+# DECnet: Netfilter Configuration
+#
+CONFIG_DECNET_NF_GRABULATOR=m
+
+#
+# Bridge: Netfilter Configuration
+#
+CONFIG_BRIDGE_NF_EBTABLES=m
+CONFIG_BRIDGE_EBT_BROUTE=m
+CONFIG_BRIDGE_EBT_T_FILTER=m
+CONFIG_BRIDGE_EBT_T_NAT=m
+CONFIG_BRIDGE_EBT_802_3=m
+CONFIG_BRIDGE_EBT_AMONG=m
+CONFIG_BRIDGE_EBT_ARP=m
+CONFIG_BRIDGE_EBT_IP=m
+CONFIG_BRIDGE_EBT_LIMIT=m
+CONFIG_BRIDGE_EBT_MARK=m
+CONFIG_BRIDGE_EBT_PKTTYPE=m
+CONFIG_BRIDGE_EBT_STP=m
+CONFIG_BRIDGE_EBT_VLAN=m
+CONFIG_BRIDGE_EBT_ARPREPLY=m
+CONFIG_BRIDGE_EBT_DNAT=m
+CONFIG_BRIDGE_EBT_MARK_T=m
+CONFIG_BRIDGE_EBT_REDIRECT=m
+CONFIG_BRIDGE_EBT_SNAT=m
+CONFIG_BRIDGE_EBT_LOG=m
+CONFIG_BRIDGE_EBT_ULOG=m
+CONFIG_IP_DCCP=m
+CONFIG_INET_DCCP_DIAG=m
+CONFIG_IP_DCCP_ACKVEC=y
+
+#
+# DCCP CCIDs Configuration (EXPERIMENTAL)
+#
+CONFIG_IP_DCCP_CCID2=m
+# CONFIG_IP_DCCP_CCID2_DEBUG is not set
+CONFIG_IP_DCCP_CCID3=m
+CONFIG_IP_DCCP_TFRC_LIB=m
+# CONFIG_IP_DCCP_CCID3_DEBUG is not set
+CONFIG_IP_DCCP_CCID3_RTO=100
+CONFIG_IP_SCTP=m
+# CONFIG_SCTP_DBG_MSG is not set
+# CONFIG_SCTP_DBG_OBJCNT is not set
+# CONFIG_SCTP_HMAC_NONE is not set
+# CONFIG_SCTP_HMAC_SHA1 is not set
+CONFIG_SCTP_HMAC_MD5=y
+CONFIG_TIPC=m
+CONFIG_TIPC_ADVANCED=y
+CONFIG_TIPC_ZONES=3
+CONFIG_TIPC_CLUSTERS=1
+CONFIG_TIPC_NODES=255
+CONFIG_TIPC_SLAVE_NODES=0
+CONFIG_TIPC_PORTS=8191
+CONFIG_TIPC_LOG=0
+# CONFIG_TIPC_DEBUG is not set
+CONFIG_ATM=m
+CONFIG_ATM_CLIP=m
+# CONFIG_ATM_CLIP_NO_ICMP is not set
+CONFIG_ATM_LANE=m
+CONFIG_ATM_MPOA=m
+CONFIG_ATM_BR2684=m
+# CONFIG_ATM_BR2684_IPFILTER is not set
+CONFIG_BRIDGE=m
+CONFIG_VLAN_8021Q=m
+CONFIG_DECNET=m
+# CONFIG_DECNET_ROUTER is not set
+CONFIG_LLC=y
+CONFIG_LLC2=m
+CONFIG_IPX=m
+# CONFIG_IPX_INTERN is not set
+CONFIG_ATALK=m
+CONFIG_DEV_APPLETALK=m
+CONFIG_IPDDP=m
+CONFIG_IPDDP_ENCAP=y
+CONFIG_IPDDP_DECAP=y
+CONFIG_X25=m
+CONFIG_LAPB=m
+CONFIG_ECONET=m
+CONFIG_ECONET_AUNUDP=y
+CONFIG_ECONET_NATIVE=y
+CONFIG_WAN_ROUTER=m
+
+#
+# QoS and/or fair queueing
+#
+CONFIG_NET_SCHED=y
+CONFIG_NET_SCH_FIFO=y
+
+#
+# Queueing/Scheduling
+#
+CONFIG_NET_SCH_CBQ=m
+CONFIG_NET_SCH_HTB=m
+CONFIG_NET_SCH_HFSC=m
+CONFIG_NET_SCH_ATM=m
+CONFIG_NET_SCH_PRIO=m
+CONFIG_NET_SCH_RED=m
+CONFIG_NET_SCH_SFQ=m
+CONFIG_NET_SCH_TEQL=m
+CONFIG_NET_SCH_TBF=m
+CONFIG_NET_SCH_GRED=m
+CONFIG_NET_SCH_DSMARK=m
+CONFIG_NET_SCH_NETEM=m
+CONFIG_NET_SCH_INGRESS=m
+
+#
+# Classification
+#
+CONFIG_NET_CLS=y
+CONFIG_NET_CLS_BASIC=m
+CONFIG_NET_CLS_TCINDEX=m
+CONFIG_NET_CLS_ROUTE4=m
+CONFIG_NET_CLS_ROUTE=y
+CONFIG_NET_CLS_FW=m
+CONFIG_NET_CLS_U32=m
+CONFIG_CLS_U32_PERF=y
+CONFIG_CLS_U32_MARK=y
+CONFIG_NET_CLS_RSVP=m
+CONFIG_NET_CLS_RSVP6=m
+CONFIG_NET_EMATCH=y
+CONFIG_NET_EMATCH_STACK=32
+CONFIG_NET_EMATCH_CMP=m
+CONFIG_NET_EMATCH_NBYTE=m
+CONFIG_NET_EMATCH_U32=m
+# CONFIG_NET_EMATCH_META is not set
+CONFIG_NET_EMATCH_TEXT=m
+CONFIG_NET_CLS_ACT=y
+CONFIG_NET_ACT_POLICE=m
+CONFIG_NET_ACT_GACT=m
+CONFIG_GACT_PROB=y
+CONFIG_NET_ACT_MIRRED=m
+CONFIG_NET_ACT_IPT=m
+CONFIG_NET_ACT_PEDIT=m
+CONFIG_NET_ACT_SIMP=m
+CONFIG_NET_CLS_IND=y
+CONFIG_NET_ESTIMATOR=y
+
+#
+# Network testing
+#
+CONFIG_NET_PKTGEN=m
+CONFIG_HAMRADIO=y
+
+#
+# Packet Radio protocols
+#
+CONFIG_AX25=m
+# CONFIG_AX25_DAMA_SLAVE is not set
+CONFIG_NETROM=m
+CONFIG_ROSE=m
+
+#
+# AX.25 network device drivers
+#
+CONFIG_MKISS=m
+CONFIG_6PACK=m
+CONFIG_BPQETHER=m
+CONFIG_BAYCOM_SER_FDX=m
+CONFIG_BAYCOM_SER_HDX=m
+CONFIG_BAYCOM_PAR=m
+CONFIG_YAM=m
+CONFIG_IRDA=m
+
+#
+# IrDA protocols
+#
+CONFIG_IRLAN=m
+CONFIG_IRNET=m
+CONFIG_IRCOMM=m
+# CONFIG_IRDA_ULTRA is not set
+
+#
+# IrDA options
+#
+CONFIG_IRDA_CACHE_LAST_LSAP=y
+CONFIG_IRDA_FAST_RR=y
+CONFIG_IRDA_DEBUG=y
+
+#
+# Infrared-port device drivers
+#
+
+#
+# SIR device drivers
+#
+CONFIG_IRTTY_SIR=m
+
+#
+# Dongle support
+#
+CONFIG_DONGLE=y
+CONFIG_ESI_DONGLE=m
+CONFIG_ACTISYS_DONGLE=m
+CONFIG_TEKRAM_DONGLE=m
+CONFIG_TOIM3232_DONGLE=m
+CONFIG_LITELINK_DONGLE=m
+CONFIG_MA600_DONGLE=m
+CONFIG_GIRBIL_DONGLE=m
+CONFIG_MCP2120_DONGLE=m
+CONFIG_OLD_BELKIN_DONGLE=m
+CONFIG_ACT200L_DONGLE=m
+# CONFIG_KINGSUN_DONGLE is not set
+
+#
+# Old SIR device drivers
+#
+CONFIG_IRPORT_SIR=m
+
+#
+# Old Serial dongle support
+#
+# CONFIG_DONGLE_OLD is not set
+
+#
+# FIR device drivers
+#
+CONFIG_USB_IRDA=m
+CONFIG_SIGMATEL_FIR=m
+CONFIG_VLSI_FIR=m
+CONFIG_MCS_FIR=m
+CONFIG_BT=m
+CONFIG_BT_L2CAP=m
+CONFIG_BT_SCO=m
+CONFIG_BT_RFCOMM=m
+CONFIG_BT_RFCOMM_TTY=y
+CONFIG_BT_BNEP=m
+CONFIG_BT_BNEP_MC_FILTER=y
+CONFIG_BT_BNEP_PROTO_FILTER=y
+CONFIG_BT_CMTP=m
+CONFIG_BT_HIDP=m
+
+#
+# Bluetooth device drivers
+#
+CONFIG_BT_HCIUSB=m
+CONFIG_BT_HCIUSB_SCO=y
+CONFIG_BT_HCIUART=m
+CONFIG_BT_HCIUART_H4=y
+CONFIG_BT_HCIUART_BCSP=y
+CONFIG_BT_HCIBCM203X=m
+CONFIG_BT_HCIBPA10X=m
+CONFIG_BT_HCIBFUSB=m
+CONFIG_BT_HCIVHCI=m
+CONFIG_AF_RXRPC=m
+# CONFIG_AF_RXRPC_DEBUG is not set
+# CONFIG_RXKAD is not set
+CONFIG_FIB_RULES=y
+
+#
+# Wireless
+#
+CONFIG_CFG80211=m
+CONFIG_WIRELESS_EXT=y
+CONFIG_MAC80211=m
+# CONFIG_MAC80211_DEBUG is not set
+CONFIG_IEEE80211=m
+# CONFIG_IEEE80211_DEBUG is not set
+CONFIG_IEEE80211_CRYPT_WEP=m
+CONFIG_IEEE80211_CRYPT_CCMP=m
+CONFIG_IEEE80211_CRYPT_TKIP=m
+CONFIG_IEEE80211_SOFTMAC=m
+# CONFIG_IEEE80211_SOFTMAC_DEBUG is not set
+CONFIG_RFKILL=m
+CONFIG_RFKILL_INPUT=m
+
+#
+# Device Drivers
+#
+
+#
+# Generic Driver Options
+#
+CONFIG_STANDALONE=y
+CONFIG_PREVENT_FIRMWARE_BUILD=y
+CONFIG_FW_LOADER=m
+# CONFIG_SYS_HYPERVISOR is not set
+
+#
+# Connector - unified userspace <-> kernelspace linker
+#
+CONFIG_CONNECTOR=m
+CONFIG_MTD=m
+# CONFIG_MTD_DEBUG is not set
+CONFIG_MTD_CONCAT=m
+CONFIG_MTD_PARTITIONS=y
+CONFIG_MTD_REDBOOT_PARTS=m
+CONFIG_MTD_REDBOOT_DIRECTORY_BLOCK=-1
+# CONFIG_MTD_REDBOOT_PARTS_UNALLOCATED is not set
+# CONFIG_MTD_REDBOOT_PARTS_READONLY is not set
+
+#
+# User Modules And Translation Layers
+#
+CONFIG_MTD_CHAR=m
+CONFIG_MTD_BLKDEVS=m
+CONFIG_MTD_BLOCK=m
+CONFIG_MTD_BLOCK_RO=m
+CONFIG_FTL=m
+CONFIG_NFTL=m
+CONFIG_NFTL_RW=y
+CONFIG_INFTL=m
+CONFIG_RFD_FTL=m
+CONFIG_SSFDC=m
+
+#
+# RAM/ROM/Flash chip drivers
+#
+CONFIG_MTD_CFI=m
+CONFIG_MTD_JEDECPROBE=m
+CONFIG_MTD_GEN_PROBE=m
+# CONFIG_MTD_CFI_ADV_OPTIONS is not set
+CONFIG_MTD_MAP_BANK_WIDTH_1=y
+CONFIG_MTD_MAP_BANK_WIDTH_2=y
+CONFIG_MTD_MAP_BANK_WIDTH_4=y
+# CONFIG_MTD_MAP_BANK_WIDTH_8 is not set
+# CONFIG_MTD_MAP_BANK_WIDTH_16 is not set
+# CONFIG_MTD_MAP_BANK_WIDTH_32 is not set
+CONFIG_MTD_CFI_I1=y
+CONFIG_MTD_CFI_I2=y
+# CONFIG_MTD_CFI_I4 is not set
+# CONFIG_MTD_CFI_I8 is not set
+CONFIG_MTD_CFI_INTELEXT=m
+CONFIG_MTD_CFI_AMDSTD=m
+CONFIG_MTD_CFI_STAA=m
+CONFIG_MTD_CFI_UTIL=m
+CONFIG_MTD_RAM=m
+CONFIG_MTD_ROM=m
+CONFIG_MTD_ABSENT=m
+
+#
+# Mapping drivers for chip access
+#
+CONFIG_MTD_COMPLEX_MAPPINGS=y
+CONFIG_MTD_PHYSMAP=m
+CONFIG_MTD_PHYSMAP_START=0x8000000
+CONFIG_MTD_PHYSMAP_LEN=0x0
+CONFIG_MTD_PHYSMAP_BANKWIDTH=2
+CONFIG_MTD_PCI=m
+CONFIG_MTD_PLATRAM=m
+
+#
+# Self-contained MTD device drivers
+#
+CONFIG_MTD_PMC551=m
+# CONFIG_MTD_PMC551_BUGFIX is not set
+# CONFIG_MTD_PMC551_DEBUG is not set
+CONFIG_MTD_DATAFLASH=m
+CONFIG_MTD_M25P80=m
+CONFIG_MTD_SLRAM=m
+CONFIG_MTD_PHRAM=m
+CONFIG_MTD_MTDRAM=m
+CONFIG_MTDRAM_TOTAL_SIZE=4096
+CONFIG_MTDRAM_ERASE_SIZE=128
+CONFIG_MTD_BLOCK2MTD=m
+
+#
+# Disk-On-Chip Device Drivers
+#
+CONFIG_MTD_DOC2000=m
+CONFIG_MTD_DOC2001=m
+CONFIG_MTD_DOC2001PLUS=m
+CONFIG_MTD_DOCPROBE=m
+CONFIG_MTD_DOCECC=m
+# CONFIG_MTD_DOCPROBE_ADVANCED is not set
+CONFIG_MTD_DOCPROBE_ADDRESS=0
+CONFIG_MTD_NAND=m
+# CONFIG_MTD_NAND_VERIFY_WRITE is not set
+# CONFIG_MTD_NAND_ECC_SMC is not set
+# CONFIG_MTD_NAND_MUSEUM_IDS is not set
+CONFIG_MTD_NAND_IDS=m
+CONFIG_MTD_NAND_DISKONCHIP=m
+# CONFIG_MTD_NAND_DISKONCHIP_PROBE_ADVANCED is not set
+CONFIG_MTD_NAND_DISKONCHIP_PROBE_ADDRESS=0
+# CONFIG_MTD_NAND_DISKONCHIP_BBTWRITE is not set
+CONFIG_MTD_NAND_CAFE=m
+# CONFIG_MTD_NAND_NANDSIM is not set
+# CONFIG_MTD_NAND_PLATFORM is not set
+CONFIG_MTD_ONENAND=m
+CONFIG_MTD_ONENAND_VERIFY_WRITE=y
+# CONFIG_MTD_ONENAND_OTP is not set
+
+#
+# UBI - Unsorted block images
+#
+CONFIG_MTD_UBI=m
+CONFIG_MTD_UBI_WL_THRESHOLD=4096
+CONFIG_MTD_UBI_BEB_RESERVE=1
+# CONFIG_MTD_UBI_GLUEBI is not set
+
+#
+# UBI debugging options
+#
+# CONFIG_MTD_UBI_DEBUG is not set
+
+#
+# Parallel port support
+#
+CONFIG_PARPORT=m
+CONFIG_PARPORT_PC=m
+CONFIG_PARPORT_SERIAL=m
+CONFIG_PARPORT_PC_FIFO=y
+# CONFIG_PARPORT_PC_SUPERIO is not set
+# CONFIG_PARPORT_GSC is not set
+# CONFIG_PARPORT_AX88796 is not set
+CONFIG_PARPORT_1284=y
+CONFIG_PARPORT_NOT_PC=y
+
+#
+# Plug and Play support
+#
+# CONFIG_PNPACPI is not set
+
+#
+# Block devices
+#
+CONFIG_BLK_DEV_FD=m
+CONFIG_PARIDE=m
+
+#
+# Parallel IDE high-level drivers
+#
+CONFIG_PARIDE_PD=m
+CONFIG_PARIDE_PCD=m
+CONFIG_PARIDE_PF=m
+CONFIG_PARIDE_PT=m
+CONFIG_PARIDE_PG=m
+
+#
+# Parallel IDE protocol modules
+#
+CONFIG_PARIDE_ATEN=m
+CONFIG_PARIDE_BPCK=m
+CONFIG_PARIDE_COMM=m
+CONFIG_PARIDE_DSTR=m
+CONFIG_PARIDE_FIT2=m
+CONFIG_PARIDE_FIT3=m
+CONFIG_PARIDE_EPAT=m
+# CONFIG_PARIDE_EPATC8 is not set
+CONFIG_PARIDE_EPIA=m
+CONFIG_PARIDE_FRIQ=m
+CONFIG_PARIDE_FRPW=m
+CONFIG_PARIDE_KBIC=m
+CONFIG_PARIDE_KTTI=m
+CONFIG_PARIDE_ON20=m
+CONFIG_PARIDE_ON26=m
+# CONFIG_BLK_CPQ_DA is not set
+CONFIG_BLK_CPQ_CISS_DA=m
+CONFIG_CISS_SCSI_TAPE=y
+CONFIG_BLK_DEV_DAC960=m
+CONFIG_BLK_DEV_UMEM=m
+# CONFIG_BLK_DEV_COW_COMMON is not set
+CONFIG_BLK_DEV_LOOP=m
+CONFIG_BLK_DEV_CRYPTOLOOP=m
+CONFIG_BLK_DEV_NBD=m
+CONFIG_BLK_DEV_SX8=m
+# CONFIG_BLK_DEV_UB is not set
+CONFIG_BLK_DEV_RAM=y
+CONFIG_BLK_DEV_RAM_COUNT=16
+CONFIG_BLK_DEV_RAM_SIZE=65536
+CONFIG_BLK_DEV_RAM_BLOCKSIZE=1024
+CONFIG_CDROM_PKTCDVD=m
+CONFIG_CDROM_PKTCDVD_BUFFERS=8
+# CONFIG_CDROM_PKTCDVD_WCACHE is not set
+CONFIG_ATA_OVER_ETH=m
+
+#
+# Misc devices
+#
+# CONFIG_PHANTOM is not set
+# CONFIG_SGI_IOC4 is not set
+CONFIG_TIFM_CORE=m
+CONFIG_TIFM_7XX1=m
+CONFIG_IDE=y
+CONFIG_IDE_MAX_HWIFS=4
+CONFIG_BLK_DEV_IDE=y
+
+#
+# Please see Documentation/ide.txt for help/info on IDE drives
+#
+# CONFIG_BLK_DEV_IDE_SATA is not set
+CONFIG_BLK_DEV_IDEDISK=y
+# CONFIG_IDEDISK_MULTI_MODE is not set
+CONFIG_BLK_DEV_IDECD=m
+CONFIG_BLK_DEV_IDETAPE=m
+CONFIG_BLK_DEV_IDEFLOPPY=m
+CONFIG_BLK_DEV_IDESCSI=m
+# CONFIG_IDE_TASK_IOCTL is not set
+CONFIG_IDE_PROC_FS=y
+
+#
+# IDE chipset support/bugfixes
+#
+CONFIG_IDE_GENERIC=y
+CONFIG_BLK_DEV_IDEPCI=y
+CONFIG_IDEPCI_SHARE_IRQ=y
+CONFIG_IDEPCI_PCIBUS_ORDER=y
+# CONFIG_BLK_DEV_OFFBOARD is not set
+CONFIG_BLK_DEV_GENERIC=y
+# CONFIG_BLK_DEV_OPTI621 is not set
+CONFIG_BLK_DEV_IDEDMA_PCI=y
+# CONFIG_BLK_DEV_IDEDMA_FORCED is not set
+# CONFIG_IDEDMA_ONLYDISK is not set
+# CONFIG_BLK_DEV_AEC62XX is not set
+# CONFIG_BLK_DEV_ALI15X3 is not set
+# CONFIG_BLK_DEV_AMD74XX is not set
+CONFIG_BLK_DEV_CMD64X=y
+# CONFIG_BLK_DEV_TRIFLEX is not set
+# CONFIG_BLK_DEV_CY82C693 is not set
+# CONFIG_BLK_DEV_CS5520 is not set
+# CONFIG_BLK_DEV_CS5530 is not set
+CONFIG_BLK_DEV_HPT34X=y
+# CONFIG_HPT34X_AUTODMA is not set
+CONFIG_BLK_DEV_HPT366=y
+# CONFIG_BLK_DEV_JMICRON is not set
+# CONFIG_BLK_DEV_SC1200 is not set
+CONFIG_BLK_DEV_PIIX=y
+# CONFIG_BLK_DEV_IT821X is not set
+# CONFIG_BLK_DEV_NS87415 is not set
+CONFIG_BLK_DEV_PDC202XX_OLD=y
+# CONFIG_PDC202XX_BURST is not set
+CONFIG_BLK_DEV_PDC202XX_NEW=y
+# CONFIG_BLK_DEV_SVWKS is not set
+CONFIG_BLK_DEV_SIIMAGE=y
+# CONFIG_BLK_DEV_SLC90E66 is not set
+# CONFIG_BLK_DEV_TRM290 is not set
+# CONFIG_BLK_DEV_VIA82CXXX is not set
+# CONFIG_IDE_ARM is not set
+CONFIG_BLK_DEV_IDEDMA=y
+# CONFIG_IDEDMA_IVB is not set
+# CONFIG_BLK_DEV_HD is not set
+
+#
+# SCSI device support
+#
+CONFIG_RAID_ATTRS=m
+CONFIG_SCSI=y
+CONFIG_SCSI_TGT=m
+CONFIG_SCSI_NETLINK=y
+CONFIG_SCSI_PROC_FS=y
+
+#
+# SCSI support type (disk, tape, CD-ROM)
+#
+CONFIG_BLK_DEV_SD=m
+CONFIG_CHR_DEV_ST=m
+CONFIG_CHR_DEV_OSST=m
+CONFIG_BLK_DEV_SR=m
+CONFIG_BLK_DEV_SR_VENDOR=y
+CONFIG_CHR_DEV_SG=m
+CONFIG_CHR_DEV_SCH=m
+
+#
+# Some SCSI devices (e.g. CD jukebox) support multiple LUNs
+#
+CONFIG_SCSI_MULTI_LUN=y
+CONFIG_SCSI_CONSTANTS=y
+CONFIG_SCSI_LOGGING=y
+CONFIG_SCSI_SCAN_ASYNC=y
+
+#
+# SCSI Transports
+#
+CONFIG_SCSI_SPI_ATTRS=m
+CONFIG_SCSI_FC_ATTRS=m
+CONFIG_SCSI_ISCSI_ATTRS=m
+CONFIG_SCSI_SAS_ATTRS=m
+CONFIG_SCSI_SAS_LIBSAS=m
+# CONFIG_SCSI_SAS_LIBSAS_DEBUG is not set
+
+#
+# SCSI low-level drivers
+#
+CONFIG_ISCSI_TCP=m
+CONFIG_BLK_DEV_3W_XXXX_RAID=m
+CONFIG_SCSI_3W_9XXX=m
+CONFIG_SCSI_ACARD=m
+CONFIG_SCSI_AACRAID=m
+CONFIG_SCSI_AIC7XXX=m
+CONFIG_AIC7XXX_CMDS_PER_DEVICE=8
+CONFIG_AIC7XXX_RESET_DELAY_MS=15000
+CONFIG_AIC7XXX_DEBUG_ENABLE=y
+CONFIG_AIC7XXX_DEBUG_MASK=0
+CONFIG_AIC7XXX_REG_PRETTY_PRINT=y
+CONFIG_SCSI_AIC7XXX_OLD=m
+CONFIG_SCSI_AIC79XX=m
+CONFIG_AIC79XX_CMDS_PER_DEVICE=32
+CONFIG_AIC79XX_RESET_DELAY_MS=15000
+CONFIG_AIC79XX_DEBUG_ENABLE=y
+CONFIG_AIC79XX_DEBUG_MASK=0
+CONFIG_AIC79XX_REG_PRETTY_PRINT=y
+CONFIG_SCSI_AIC94XX=m
+# CONFIG_AIC94XX_DEBUG is not set
+CONFIG_SCSI_ARCMSR=m
+CONFIG_MEGARAID_NEWGEN=y
+CONFIG_MEGARAID_MM=m
+CONFIG_MEGARAID_MAILBOX=m
+CONFIG_MEGARAID_LEGACY=m
+CONFIG_MEGARAID_SAS=m
+CONFIG_SCSI_HPTIOP=m
+CONFIG_SCSI_DMX3191D=m
+CONFIG_SCSI_FUTURE_DOMAIN=m
+CONFIG_SCSI_IPS=m
+CONFIG_SCSI_INITIO=m
+CONFIG_SCSI_INIA100=m
+CONFIG_SCSI_PPA=m
+CONFIG_SCSI_IMM=m
+# CONFIG_SCSI_IZIP_EPP16 is not set
+# CONFIG_SCSI_IZIP_SLOW_CTR is not set
+CONFIG_SCSI_STEX=m
+CONFIG_SCSI_SYM53C8XX_2=m
+CONFIG_SCSI_SYM53C8XX_DMA_ADDRESSING_MODE=1
+CONFIG_SCSI_SYM53C8XX_DEFAULT_TAGS=16
+CONFIG_SCSI_SYM53C8XX_MAX_TAGS=64
+CONFIG_SCSI_SYM53C8XX_MMIO=y
+# CONFIG_SCSI_IPR is not set
+CONFIG_SCSI_QLOGIC_1280=m
+CONFIG_SCSI_QLA_FC=m
+CONFIG_SCSI_QLA_ISCSI=m
+CONFIG_SCSI_LPFC=m
+CONFIG_SCSI_DC395x=m
+CONFIG_SCSI_DC390T=m
+CONFIG_SCSI_DEBUG=m
+CONFIG_SCSI_SRP=m
+CONFIG_ATA=y
+# CONFIG_ATA_NONSTANDARD is not set
+CONFIG_SATA_AHCI=y
+# CONFIG_SATA_SVW is not set
+# CONFIG_ATA_PIIX is not set
+CONFIG_SATA_MV=y
+# CONFIG_SATA_NV is not set
+# CONFIG_PDC_ADMA is not set
+# CONFIG_SATA_QSTOR is not set
+CONFIG_SATA_PROMISE=y
+CONFIG_SATA_SX4=y
+CONFIG_SATA_SIL=y
+CONFIG_SATA_SIL24=y
+# CONFIG_SATA_SIS is not set
+# CONFIG_SATA_ULI is not set
+# CONFIG_SATA_VIA is not set
+# CONFIG_SATA_VITESSE is not set
+CONFIG_SATA_INIC162X=m
+# CONFIG_ATA_GENERIC is not set
+
+#
+# Multi-device support (RAID and LVM)
+#
+CONFIG_MD=y
+CONFIG_BLK_DEV_MD=m
+CONFIG_MD_LINEAR=m
+CONFIG_MD_RAID0=m
+CONFIG_MD_RAID1=m
+CONFIG_MD_RAID10=m
+CONFIG_MD_RAID456=m
+CONFIG_MD_RAID5_RESHAPE=y
+CONFIG_MD_MULTIPATH=m
+CONFIG_MD_FAULTY=m
+CONFIG_BLK_DEV_DM=m
+# CONFIG_DM_DEBUG is not set
+CONFIG_DM_CRYPT=m
+CONFIG_DM_SNAPSHOT=m
+CONFIG_DM_MIRROR=m
+CONFIG_DM_ZERO=m
+CONFIG_DM_MULTIPATH=m
+CONFIG_DM_MULTIPATH_EMC=m
+CONFIG_DM_DELAY=m
+
+#
+# Fusion MPT device support
+#
+CONFIG_FUSION=y
+CONFIG_FUSION_SPI=m
+CONFIG_FUSION_FC=m
+CONFIG_FUSION_SAS=m
+CONFIG_FUSION_MAX_SGE=40
+CONFIG_FUSION_CTL=m
+CONFIG_FUSION_LAN=m
+
+#
+# IEEE 1394 (FireWire) support
+#
+CONFIG_FIREWIRE=m
+CONFIG_FIREWIRE_OHCI=m
+CONFIG_FIREWIRE_SBP2=m
+# CONFIG_IEEE1394 is not set
+
+#
+# I2O device support
+#
+CONFIG_I2O=m
+CONFIG_I2O_LCT_NOTIFY_ON_CHANGES=y
+CONFIG_I2O_EXT_ADAPTEC=y
+CONFIG_I2O_EXT_ADAPTEC_DMA64=y
+CONFIG_I2O_CONFIG=m
+CONFIG_I2O_CONFIG_OLD_IOCTL=y
+CONFIG_I2O_BUS=m
+CONFIG_I2O_BLOCK=m
+CONFIG_I2O_SCSI=m
+CONFIG_I2O_PROC=m
+
+#
+# Network device support
+#
+CONFIG_NETDEVICES=y
+CONFIG_IFB=m
+CONFIG_DUMMY=m
+CONFIG_BONDING=m
+CONFIG_EQUALIZER=m
+CONFIG_TUN=m
+CONFIG_ARCNET=m
+CONFIG_ARCNET_1201=m
+CONFIG_ARCNET_1051=m
+CONFIG_ARCNET_RAW=m
+CONFIG_ARCNET_CAP=m
+CONFIG_ARCNET_COM90xx=m
+CONFIG_ARCNET_COM90xxIO=m
+CONFIG_ARCNET_RIM_I=m
+CONFIG_ARCNET_COM20020=m
+CONFIG_ARCNET_COM20020_PCI=m
+CONFIG_PHYLIB=m
+
+#
+# MII PHY device drivers
+#
+CONFIG_MARVELL_PHY=m
+CONFIG_DAVICOM_PHY=m
+# CONFIG_QSEMI_PHY is not set
+CONFIG_LXT_PHY=m
+# CONFIG_CICADA_PHY is not set
+# CONFIG_VITESSE_PHY is not set
+CONFIG_SMSC_PHY=m
+CONFIG_BROADCOM_PHY=m
+CONFIG_FIXED_PHY=m
+# CONFIG_FIXED_MII_10_FDX is not set
+# CONFIG_FIXED_MII_100_FDX is not set
+
+#
+# Ethernet (10 or 100Mbit)
+#
+CONFIG_NET_ETHERNET=y
+CONFIG_MII=y
+# CONFIG_HAPPYMEAL is not set
+# CONFIG_SUNGEM is not set
+# CONFIG_CASSINI is not set
+CONFIG_NET_VENDOR_3COM=y
+CONFIG_VORTEX=m
+CONFIG_TYPHOON=m
+# CONFIG_DM9000 is not set
+
+#
+# Tulip family network device support
+#
+CONFIG_NET_TULIP=y
+CONFIG_DE2104X=m
+CONFIG_TULIP=m
+# CONFIG_TULIP_MWI is not set
+# CONFIG_TULIP_MMIO is not set
+# CONFIG_TULIP_NAPI is not set
+CONFIG_DE4X5=m
+# CONFIG_WINBOND_840 is not set
+CONFIG_DM9102=m
+# CONFIG_ULI526X is not set
+# CONFIG_HP100 is not set
+CONFIG_NET_PCI=y
+CONFIG_PCNET32=y
+CONFIG_PCNET32_NAPI=y
+CONFIG_AMD8111_ETH=m
+CONFIG_AMD8111E_NAPI=y
+CONFIG_ADAPTEC_STARFIRE=m
+CONFIG_ADAPTEC_STARFIRE_NAPI=y
+CONFIG_B44=m
+# CONFIG_FORCEDETH is not set
+# CONFIG_TC35815 is not set
+CONFIG_EEPRO100=m
+CONFIG_E100=m
+CONFIG_FEALNX=m
+CONFIG_NATSEMI=m
+CONFIG_NE2K_PCI=m
+CONFIG_8139CP=m
+CONFIG_8139TOO=m
+# CONFIG_8139TOO_PIO is not set
+CONFIG_8139TOO_TUNE_TWISTER=y
+CONFIG_8139TOO_8129=y
+# CONFIG_8139_OLD_RX_RESET is not set
+CONFIG_SIS900=m
+CONFIG_EPIC100=m
+CONFIG_SUNDANCE=m
+# CONFIG_SUNDANCE_MMIO is not set
+CONFIG_VIA_RHINE=m
+# CONFIG_VIA_RHINE_MMIO is not set
+CONFIG_VIA_RHINE_NAPI=y
+CONFIG_SC92031=m
+CONFIG_NET_POCKET=y
+CONFIG_DE600=m
+CONFIG_DE620=m
+CONFIG_NETDEV_1000=y
+CONFIG_ACENIC=m
+# CONFIG_ACENIC_OMIT_TIGON_I is not set
+CONFIG_DL2K=m
+CONFIG_E1000=m
+CONFIG_E1000_NAPI=y
+# CONFIG_E1000_DISABLE_PACKET_SPLIT is not set
+CONFIG_NS83820=m
+CONFIG_HAMACHI=m
+CONFIG_YELLOWFIN=m
+CONFIG_R8169=m
+CONFIG_R8169_NAPI=y
+CONFIG_R8169_VLAN=y
+CONFIG_SIS190=m
+CONFIG_SKGE=m
+CONFIG_SKY2=m
+# CONFIG_SK98LIN is not set
+CONFIG_VIA_VELOCITY=m
+CONFIG_TIGON3=m
+CONFIG_BNX2=m
+CONFIG_QLA3XXX=m
+CONFIG_ATL1=m
+CONFIG_NETDEV_10000=y
+CONFIG_CHELSIO_T1=m
+CONFIG_CHELSIO_T1_1G=y
+CONFIG_CHELSIO_T1_NAPI=y
+CONFIG_CHELSIO_T3=m
+CONFIG_IXGB=m
+CONFIG_IXGB_NAPI=y
+CONFIG_S2IO=m
+CONFIG_S2IO_NAPI=y
+CONFIG_MYRI10GE=m
+CONFIG_NETXEN_NIC=m
+CONFIG_TR=y
+CONFIG_IBMOL=m
+CONFIG_TMS380TR=m
+CONFIG_TMSPCI=m
+CONFIG_ABYSS=m
+
+#
+# Wireless LAN
+#
+CONFIG_WLAN_PRE80211=y
+CONFIG_STRIP=m
+CONFIG_WLAN_80211=y
+CONFIG_IPW2100=m
+CONFIG_IPW2100_MONITOR=y
+# CONFIG_IPW2100_DEBUG is not set
+CONFIG_IPW2200=m
+# CONFIG_IPW2200_MONITOR is not set
+CONFIG_IPW2200_QOS=y
+# CONFIG_IPW2200_DEBUG is not set
+CONFIG_LIBERTAS=m
+CONFIG_LIBERTAS_USB=m
+# CONFIG_LIBERTAS_DEBUG is not set
+CONFIG_HERMES=m
+CONFIG_PLX_HERMES=m
+CONFIG_TMD_HERMES=m
+CONFIG_NORTEL_HERMES=m
+CONFIG_PCI_HERMES=m
+CONFIG_ATMEL=m
+CONFIG_PCI_ATMEL=m
+CONFIG_PRISM54=m
+CONFIG_USB_ZD1201=m
+CONFIG_HOSTAP=m
+CONFIG_HOSTAP_FIRMWARE=y
+# CONFIG_HOSTAP_FIRMWARE_NVRAM is not set
+CONFIG_HOSTAP_PLX=m
+CONFIG_HOSTAP_PCI=m
+CONFIG_BCM43XX=m
+CONFIG_BCM43XX_DEBUG=y
+CONFIG_BCM43XX_DMA=y
+CONFIG_BCM43XX_PIO=y
+CONFIG_BCM43XX_DMA_AND_PIO_MODE=y
+# CONFIG_BCM43XX_DMA_MODE is not set
+# CONFIG_BCM43XX_PIO_MODE is not set
+CONFIG_ZD1211RW=m
+# CONFIG_ZD1211RW_DEBUG is not set
+
+#
+# USB Network Adapters
+#
+CONFIG_USB_CATC=m
+CONFIG_USB_KAWETH=m
+CONFIG_USB_PEGASUS=m
+CONFIG_USB_RTL8150=m
+CONFIG_USB_USBNET_MII=m
+CONFIG_USB_USBNET=m
+CONFIG_USB_NET_AX8817X=m
+CONFIG_USB_NET_CDCETHER=m
+CONFIG_USB_NET_DM9601=m
+CONFIG_USB_NET_GL620A=m
+CONFIG_USB_NET_NET1080=m
+CONFIG_USB_NET_PLUSB=m
+CONFIG_USB_NET_MCS7830=m
+CONFIG_USB_NET_RNDIS_HOST=m
+CONFIG_USB_NET_CDC_SUBSET=m
+CONFIG_USB_ALI_M5632=y
+CONFIG_USB_AN2720=y
+CONFIG_USB_BELKIN=y
+CONFIG_USB_ARMLINUX=y
+CONFIG_USB_EPSON2888=y
+CONFIG_USB_KC2190=y
+CONFIG_USB_NET_ZAURUS=m
+CONFIG_WAN=y
+CONFIG_LANMEDIA=m
+CONFIG_HDLC=m
+CONFIG_HDLC_RAW=m
+CONFIG_HDLC_RAW_ETH=m
+CONFIG_HDLC_CISCO=m
+CONFIG_HDLC_FR=m
+CONFIG_HDLC_PPP=m
+CONFIG_HDLC_X25=m
+CONFIG_PCI200SYN=m
+CONFIG_WANXL=m
+CONFIG_PC300=m
+# CONFIG_PC300_MLPPP is not set
+
+#
+# Cyclades-PC300 MLPPP support is disabled.
+#
+
+#
+# Refer to the file README.mlppp, provided by PC300 package.
+#
+# CONFIG_PC300TOO is not set
+CONFIG_FARSYNC=m
+CONFIG_DSCC4=m
+# CONFIG_DSCC4_PCISYNC is not set
+# CONFIG_DSCC4_PCI_RST is not set
+CONFIG_DLCI=m
+CONFIG_DLCI_MAX=8
+CONFIG_WAN_ROUTER_DRIVERS=m
+CONFIG_CYCLADES_SYNC=m
+CONFIG_CYCLOMX_X25=y
+CONFIG_LAPBETHER=m
+CONFIG_X25_ASY=m
+CONFIG_ATM_DRIVERS=y
+CONFIG_ATM_DUMMY=m
+CONFIG_ATM_TCP=m
+CONFIG_ATM_LANAI=m
+CONFIG_ATM_ENI=m
+# CONFIG_ATM_ENI_DEBUG is not set
+# CONFIG_ATM_ENI_TUNE_BURST is not set
+CONFIG_ATM_FIRESTREAM=m
+CONFIG_ATM_ZATM=m
+# CONFIG_ATM_ZATM_DEBUG is not set
+CONFIG_ATM_IDT77252=m
+# CONFIG_ATM_IDT77252_DEBUG is not set
+# CONFIG_ATM_IDT77252_RCV_ALL is not set
+CONFIG_ATM_IDT77252_USE_SUNI=y
+CONFIG_ATM_AMBASSADOR=m
+# CONFIG_ATM_AMBASSADOR_DEBUG is not set
+CONFIG_ATM_HORIZON=m
+# CONFIG_ATM_HORIZON_DEBUG is not set
+CONFIG_ATM_FORE200E_MAYBE=m
+CONFIG_ATM_FORE200E_PCA=y
+CONFIG_ATM_FORE200E_PCA_DEFAULT_FW=y
+# CONFIG_ATM_FORE200E_USE_TASKLET is not set
+CONFIG_ATM_FORE200E_TX_RETRY=16
+CONFIG_ATM_FORE200E_DEBUG=0
+CONFIG_ATM_FORE200E=m
+CONFIG_ATM_HE=m
+CONFIG_ATM_HE_USE_SUNI=y
+CONFIG_FDDI=y
+CONFIG_DEFXX=m
+# CONFIG_DEFXX_MMIO is not set
+CONFIG_SKFP=m
+CONFIG_HIPPI=y
+CONFIG_ROADRUNNER=m
+# CONFIG_ROADRUNNER_LARGE_RINGS is not set
+CONFIG_PLIP=m
+CONFIG_PPP=m
+CONFIG_PPP_MULTILINK=y
+CONFIG_PPP_FILTER=y
+CONFIG_PPP_ASYNC=m
+CONFIG_PPP_SYNC_TTY=m
+CONFIG_PPP_DEFLATE=m
+CONFIG_PPP_BSDCOMP=m
+CONFIG_PPP_MPPE=m
+CONFIG_PPPOE=m
+CONFIG_PPPOATM=m
+CONFIG_SLIP=m
+CONFIG_SLIP_COMPRESSED=y
+CONFIG_SLHC=m
+CONFIG_SLIP_SMART=y
+# CONFIG_SLIP_MODE_SLIP6 is not set
+CONFIG_NET_FC=y
+CONFIG_SHAPER=m
+CONFIG_NETCONSOLE=m
+CONFIG_NETPOLL=y
+# CONFIG_NETPOLL_TRAP is not set
+CONFIG_NET_POLL_CONTROLLER=y
+
+#
+# ISDN subsystem
+#
+CONFIG_ISDN=m
+
+#
+# Old ISDN4Linux
+#
+CONFIG_ISDN_I4L=m
+CONFIG_ISDN_PPP=y
+CONFIG_ISDN_PPP_VJ=y
+CONFIG_ISDN_MPP=y
+CONFIG_IPPP_FILTER=y
+CONFIG_ISDN_PPP_BSDCOMP=m
+CONFIG_ISDN_AUDIO=y
+CONFIG_ISDN_TTY_FAX=y
+CONFIG_ISDN_X25=y
+
+#
+# ISDN feature submodules
+#
+CONFIG_ISDN_DRV_LOOP=m
+CONFIG_ISDN_DIVERSION=m
+
+#
+# ISDN4Linux hardware drivers
+#
+
+#
+# Passive cards
+#
+CONFIG_ISDN_DRV_HISAX=m
+
+#
+# D-channel protocol features
+#
+CONFIG_HISAX_EURO=y
+CONFIG_DE_AOC=y
+# CONFIG_HISAX_NO_SENDCOMPLETE is not set
+# CONFIG_HISAX_NO_LLC is not set
+# CONFIG_HISAX_NO_KEYPAD is not set
+CONFIG_HISAX_1TR6=y
+CONFIG_HISAX_NI1=y
+CONFIG_HISAX_MAX_CARDS=8
+
+#
+# HiSax supported cards
+#
+CONFIG_HISAX_16_3=y
+CONFIG_HISAX_S0BOX=y
+CONFIG_HISAX_FRITZPCI=y
+CONFIG_HISAX_AVM_A1_PCMCIA=y
+CONFIG_HISAX_ELSA=y
+CONFIG_HISAX_DIEHLDIVA=y
+CONFIG_HISAX_SEDLBAUER=y
+CONFIG_HISAX_NICCY=y
+CONFIG_HISAX_BKM_A4T=y
+CONFIG_HISAX_SCT_QUADRO=y
+CONFIG_HISAX_GAZEL=y
+CONFIG_HISAX_W6692=y
+CONFIG_HISAX_HFC_SX=y
+# CONFIG_HISAX_DEBUG is not set
+
+#
+# HiSax PCMCIA card service modules
+#
+
+#
+# HiSax sub driver modules
+#
+CONFIG_HISAX_ST5481=m
+CONFIG_HISAX_HFCUSB=m
+CONFIG_HISAX_HFC4S8S=m
+CONFIG_HISAX_FRITZ_PCIPNP=m
+CONFIG_HISAX_HDLC=y
+
+#
+# Active cards
+#
+CONFIG_HYSDN=m
+# CONFIG_HYSDN_CAPI is not set
+
+#
+# Siemens Gigaset
+#
+CONFIG_ISDN_DRV_GIGASET=m
+CONFIG_GIGASET_BASE=m
+CONFIG_GIGASET_M105=m
+CONFIG_GIGASET_M101=m
+# CONFIG_GIGASET_DEBUG is not set
+# CONFIG_GIGASET_UNDOCREQ is not set
+
+#
+# CAPI subsystem
+#
+CONFIG_ISDN_CAPI=m
+CONFIG_ISDN_DRV_AVMB1_VERBOSE_REASON=y
+CONFIG_CAPI_TRACE=y
+CONFIG_ISDN_CAPI_MIDDLEWARE=y
+CONFIG_ISDN_CAPI_CAPI20=m
+CONFIG_ISDN_CAPI_CAPIFS_BOOL=y
+CONFIG_ISDN_CAPI_CAPIFS=m
+CONFIG_ISDN_CAPI_CAPIDRV=m
+
+#
+# CAPI hardware drivers
+#
+
+#
+# Active AVM cards
+#
+CONFIG_CAPI_AVM=y
+CONFIG_ISDN_DRV_AVMB1_B1PCI=m
+CONFIG_ISDN_DRV_AVMB1_B1PCIV4=y
+CONFIG_ISDN_DRV_AVMB1_B1PCMCIA=m
+CONFIG_ISDN_DRV_AVMB1_T1PCI=m
+CONFIG_ISDN_DRV_AVMB1_C4=m
+
+#
+# Active Eicon DIVA Server cards
+#
+CONFIG_CAPI_EICON=y
+CONFIG_ISDN_DIVAS=m
+CONFIG_ISDN_DIVAS_BRIPCI=y
+CONFIG_ISDN_DIVAS_PRIPCI=y
+CONFIG_ISDN_DIVAS_DIVACAPI=m
+CONFIG_ISDN_DIVAS_USERIDI=m
+CONFIG_ISDN_DIVAS_MAINT=m
+
+#
+# Telephony Support
+#
+CONFIG_PHONE=m
+CONFIG_PHONE_IXJ=m
+
+#
+# Input device support
+#
+CONFIG_INPUT=y
+CONFIG_INPUT_FF_MEMLESS=m
+# CONFIG_INPUT_POLLDEV is not set
+
+#
+# Userland interfaces
+#
+CONFIG_INPUT_MOUSEDEV=y
+CONFIG_INPUT_MOUSEDEV_PSAUX=y
+CONFIG_INPUT_MOUSEDEV_SCREEN_X=1024
+CONFIG_INPUT_MOUSEDEV_SCREEN_Y=768
+CONFIG_INPUT_JOYDEV=m
+CONFIG_INPUT_TSDEV=m
+CONFIG_INPUT_TSDEV_SCREEN_X=240
+CONFIG_INPUT_TSDEV_SCREEN_Y=320
+CONFIG_INPUT_EVDEV=m
+# CONFIG_INPUT_EVBUG is not set
+
+#
+# Input Device Drivers
+#
+CONFIG_INPUT_KEYBOARD=y
+CONFIG_KEYBOARD_ATKBD=y
+CONFIG_KEYBOARD_SUNKBD=m
+CONFIG_KEYBOARD_LKKBD=m
+CONFIG_KEYBOARD_XTKBD=m
+CONFIG_KEYBOARD_NEWTON=m
+CONFIG_KEYBOARD_STOWAWAY=m
+CONFIG_INPUT_MOUSE=y
+CONFIG_MOUSE_PS2=m
+CONFIG_MOUSE_PS2_LOGIPS2PP=y
+CONFIG_MOUSE_PS2_SYNAPTICS=y
+CONFIG_MOUSE_PS2_LIFEBOOK=y
+CONFIG_MOUSE_PS2_TRACKPOINT=y
+# CONFIG_MOUSE_PS2_TOUCHKIT is not set
+CONFIG_MOUSE_SERIAL=m
+CONFIG_MOUSE_APPLETOUCH=m
+CONFIG_MOUSE_VSXXXAA=m
+CONFIG_INPUT_JOYSTICK=y
+CONFIG_JOYSTICK_ANALOG=m
+CONFIG_JOYSTICK_A3D=m
+CONFIG_JOYSTICK_ADI=m
+CONFIG_JOYSTICK_COBRA=m
+CONFIG_JOYSTICK_GF2K=m
+CONFIG_JOYSTICK_GRIP=m
+CONFIG_JOYSTICK_GRIP_MP=m
+CONFIG_JOYSTICK_GUILLEMOT=m
+CONFIG_JOYSTICK_INTERACT=m
+CONFIG_JOYSTICK_SIDEWINDER=m
+CONFIG_JOYSTICK_TMDC=m
+CONFIG_JOYSTICK_IFORCE=m
+CONFIG_JOYSTICK_IFORCE_USB=y
+CONFIG_JOYSTICK_IFORCE_232=y
+CONFIG_JOYSTICK_WARRIOR=m
+CONFIG_JOYSTICK_MAGELLAN=m
+CONFIG_JOYSTICK_SPACEORB=m
+CONFIG_JOYSTICK_SPACEBALL=m
+CONFIG_JOYSTICK_STINGER=m
+CONFIG_JOYSTICK_TWIDJOY=m
+CONFIG_JOYSTICK_DB9=m
+CONFIG_JOYSTICK_GAMECON=m
+CONFIG_JOYSTICK_TURBOGRAFX=m
+CONFIG_JOYSTICK_JOYDUMP=m
+CONFIG_JOYSTICK_XPAD=m
+CONFIG_INPUT_TABLET=y
+CONFIG_TABLET_USB_ACECAD=m
+CONFIG_TABLET_USB_AIPTEK=m
+CONFIG_TABLET_USB_GTCO=m
+CONFIG_TABLET_USB_KBTAB=m
+CONFIG_TABLET_USB_WACOM=m
+CONFIG_INPUT_TOUCHSCREEN=y
+CONFIG_TOUCHSCREEN_ADS7846=m
+CONFIG_TOUCHSCREEN_GUNZE=m
+CONFIG_TOUCHSCREEN_ELO=m
+CONFIG_TOUCHSCREEN_MTOUCH=m
+CONFIG_TOUCHSCREEN_MK712=m
+CONFIG_TOUCHSCREEN_PENMOUNT=m
+CONFIG_TOUCHSCREEN_TOUCHRIGHT=m
+CONFIG_TOUCHSCREEN_TOUCHWIN=m
+CONFIG_TOUCHSCREEN_UCB1400=m
+CONFIG_TOUCHSCREEN_USB_COMPOSITE=m
+# CONFIG_INPUT_MISC is not set
+
+#
+# Hardware I/O ports
+#
+CONFIG_SERIO=y
+CONFIG_SERIO_I8042=y
+CONFIG_SERIO_SERPORT=m
+CONFIG_SERIO_PARKBD=m
+CONFIG_SERIO_PCIPS2=y
+CONFIG_SERIO_LIBPS2=y
+CONFIG_SERIO_RAW=m
+CONFIG_GAMEPORT=m
+# CONFIG_GAMEPORT_NS558 is not set
+# CONFIG_GAMEPORT_L4 is not set
+CONFIG_GAMEPORT_EMU10K1=m
+CONFIG_GAMEPORT_FM801=m
+
+#
+# Character devices
+#
+CONFIG_VT=y
+CONFIG_VT_CONSOLE=y
+CONFIG_HW_CONSOLE=y
+# CONFIG_VT_HW_CONSOLE_BINDING is not set
+# CONFIG_SERIAL_NONSTANDARD is not set
+
+#
+# Serial drivers
+#
+CONFIG_SERIAL_8250=y
+CONFIG_SERIAL_8250_CONSOLE=y
+CONFIG_SERIAL_8250_PCI=y
+CONFIG_SERIAL_8250_NR_UARTS=4
+CONFIG_SERIAL_8250_RUNTIME_UARTS=4
+CONFIG_SERIAL_8250_EXTENDED=y
+# CONFIG_SERIAL_8250_MANY_PORTS is not set
+CONFIG_SERIAL_8250_SHARE_IRQ=y
+# CONFIG_SERIAL_8250_DETECT_IRQ is not set
+CONFIG_SERIAL_8250_RSA=y
+
+#
+# Non-8250 serial port support
+#
+CONFIG_SERIAL_CORE=y
+CONFIG_SERIAL_CORE_CONSOLE=y
+CONFIG_SERIAL_JSM=m
+CONFIG_UNIX98_PTYS=y
+# CONFIG_LEGACY_PTYS is not set
+CONFIG_PRINTER=m
+# CONFIG_LP_CONSOLE is not set
+CONFIG_PPDEV=m
+CONFIG_TIPAR=m
+
+#
+# IPMI
+#
+CONFIG_IPMI_HANDLER=m
+# CONFIG_IPMI_PANIC_EVENT is not set
+# CONFIG_IPMI_DEVICE_INTERFACE is not set
+CONFIG_IPMI_SI=m
+CONFIG_IPMI_WATCHDOG=m
+CONFIG_IPMI_POWEROFF=m
+CONFIG_WATCHDOG=y
+# CONFIG_WATCHDOG_NOWAYOUT is not set
+
+#
+# Watchdog Device Drivers
+#
+CONFIG_SOFT_WATCHDOG=m
+
+#
+# PCI-based Watchdog Cards
+#
+CONFIG_PCIPCWATCHDOG=m
+CONFIG_WDTPCI=m
+CONFIG_WDT_501_PCI=y
+
+#
+# USB-based Watchdog Cards
+#
+CONFIG_USBPCWATCHDOG=m
+CONFIG_HW_RANDOM=m
+CONFIG_RTC=y
+CONFIG_R3964=m
+CONFIG_APPLICOM=m
+CONFIG_DRM=m
+CONFIG_DRM_TDFX=m
+CONFIG_DRM_R128=m
+CONFIG_DRM_RADEON=m
+CONFIG_DRM_MGA=m
+CONFIG_DRM_VIA=m
+CONFIG_DRM_SAVAGE=m
+# CONFIG_RAW_DRIVER is not set
+
+#
+# TPM devices
+#
+# CONFIG_TCG_TPM is not set
+CONFIG_I2C=m
+CONFIG_I2C_CHARDEV=m
+
+#
+# I2C Algorithms
+#
+CONFIG_I2C_ALGOBIT=m
+# CONFIG_I2C_ALGOPCF is not set
+# CONFIG_I2C_ALGOPCA is not set
+
+#
+# I2C Hardware Bus support
+#
+# CONFIG_I2C_ALI1535 is not set
+# CONFIG_I2C_ALI1563 is not set
+# CONFIG_I2C_ALI15X3 is not set
+# CONFIG_I2C_AMD756 is not set
+# CONFIG_I2C_AMD8111 is not set
+# CONFIG_I2C_I801 is not set
+# CONFIG_I2C_I810 is not set
+CONFIG_I2C_PIIX4=m
+# CONFIG_I2C_NFORCE2 is not set
+# CONFIG_I2C_OCORES is not set
+CONFIG_I2C_PARPORT=m
+CONFIG_I2C_PARPORT_LIGHT=m
+# CONFIG_I2C_PROSAVAGE is not set
+# CONFIG_I2C_SAVAGE4 is not set
+CONFIG_I2C_SIMTEC=m
+# CONFIG_I2C_SIS5595 is not set
+# CONFIG_I2C_SIS630 is not set
+# CONFIG_I2C_SIS96X is not set
+# CONFIG_I2C_STUB is not set
+CONFIG_I2C_TINY_USB=m
+# CONFIG_I2C_VIA is not set
+# CONFIG_I2C_VIAPRO is not set
+CONFIG_I2C_VOODOO3=m
+
+#
+# Miscellaneous I2C Chip support
+#
+CONFIG_SENSORS_DS1337=m
+CONFIG_SENSORS_DS1374=m
+CONFIG_SENSORS_EEPROM=m
+CONFIG_SENSORS_PCF8574=m
+CONFIG_SENSORS_PCA9539=m
+CONFIG_SENSORS_PCF8591=m
+CONFIG_SENSORS_MAX6875=m
+# CONFIG_I2C_DEBUG_CORE is not set
+# CONFIG_I2C_DEBUG_ALGO is not set
+# CONFIG_I2C_DEBUG_BUS is not set
+# CONFIG_I2C_DEBUG_CHIP is not set
+
+#
+# SPI support
+#
+CONFIG_SPI=y
+CONFIG_SPI_MASTER=y
+
+#
+# SPI Master Controller Drivers
+#
+CONFIG_SPI_BITBANG=m
+CONFIG_SPI_BUTTERFLY=m
+
+#
+# SPI Protocol Masters
+#
+CONFIG_SPI_AT25=m
+# CONFIG_SPI_SPIDEV is not set
+
+#
+# Dallas's 1-wire bus
+#
+CONFIG_W1=m
+CONFIG_W1_CON=y
+
+#
+# 1-wire Bus Masters
+#
+CONFIG_W1_MASTER_MATROX=m
+CONFIG_W1_MASTER_DS2490=m
+CONFIG_W1_MASTER_DS2482=m
+
+#
+# 1-wire Slaves
+#
+CONFIG_W1_SLAVE_THERM=m
+CONFIG_W1_SLAVE_SMEM=m
+CONFIG_W1_SLAVE_DS2433=m
+# CONFIG_W1_SLAVE_DS2433_CRC is not set
+CONFIG_HWMON=y
+CONFIG_HWMON_VID=m
+# CONFIG_SENSORS_ABITUGURU is not set
+CONFIG_SENSORS_AD7418=m
+CONFIG_SENSORS_ADM1021=m
+CONFIG_SENSORS_ADM1025=m
+CONFIG_SENSORS_ADM1026=m
+CONFIG_SENSORS_ADM1029=m
+CONFIG_SENSORS_ADM1031=m
+CONFIG_SENSORS_ADM9240=m
+# CONFIG_SENSORS_ASB100 is not set
+# CONFIG_SENSORS_ATXP1 is not set
+CONFIG_SENSORS_DS1621=m
+# CONFIG_SENSORS_F71805F is not set
+# CONFIG_SENSORS_FSCHER is not set
+# CONFIG_SENSORS_FSCPOS is not set
+# CONFIG_SENSORS_GL518SM is not set
+# CONFIG_SENSORS_GL520SM is not set
+# CONFIG_SENSORS_IT87 is not set
+CONFIG_SENSORS_LM63=m
+CONFIG_SENSORS_LM70=m
+CONFIG_SENSORS_LM75=m
+CONFIG_SENSORS_LM77=m
+CONFIG_SENSORS_LM78=m
+CONFIG_SENSORS_LM80=m
+CONFIG_SENSORS_LM83=m
+CONFIG_SENSORS_LM85=m
+CONFIG_SENSORS_LM87=m
+CONFIG_SENSORS_LM90=m
+CONFIG_SENSORS_LM92=m
+CONFIG_SENSORS_MAX1619=m
+CONFIG_SENSORS_MAX6650=m
+# CONFIG_SENSORS_PC87360 is not set
+# CONFIG_SENSORS_PC87427 is not set
+# CONFIG_SENSORS_SIS5595 is not set
+# CONFIG_SENSORS_SMSC47M1 is not set
+# CONFIG_SENSORS_SMSC47M192 is not set
+# CONFIG_SENSORS_SMSC47B397 is not set
+# CONFIG_SENSORS_VIA686A is not set
+# CONFIG_SENSORS_VT1211 is not set
+# CONFIG_SENSORS_VT8231 is not set
+# CONFIG_SENSORS_W83781D is not set
+# CONFIG_SENSORS_W83791D is not set
+# CONFIG_SENSORS_W83792D is not set
+# CONFIG_SENSORS_W83793 is not set
+# CONFIG_SENSORS_W83L785TS is not set
+# CONFIG_SENSORS_W83627HF is not set
+# CONFIG_SENSORS_W83627EHF is not set
+# CONFIG_HWMON_DEBUG_CHIP is not set
+
+#
+# Multifunction device drivers
+#
+CONFIG_MFD_SM501=m
+
+#
+# Multimedia devices
+#
+CONFIG_VIDEO_DEV=m
+CONFIG_VIDEO_V4L1=y
+CONFIG_VIDEO_V4L1_COMPAT=y
+CONFIG_VIDEO_V4L2=y
+CONFIG_VIDEO_CAPTURE_DRIVERS=y
+# CONFIG_VIDEO_ADV_DEBUG is not set
+CONFIG_VIDEO_HELPER_CHIPS_AUTO=y
+CONFIG_VIDEO_TVAUDIO=m
+CONFIG_VIDEO_TDA7432=m
+CONFIG_VIDEO_TDA9840=m
+CONFIG_VIDEO_TDA9875=m
+CONFIG_VIDEO_TEA6415C=m
+CONFIG_VIDEO_TEA6420=m
+CONFIG_VIDEO_MSP3400=m
+CONFIG_VIDEO_CS53L32A=m
+CONFIG_VIDEO_WM8775=m
+CONFIG_VIDEO_WM8739=m
+CONFIG_VIDEO_BT819=m
+CONFIG_VIDEO_BT856=m
+CONFIG_VIDEO_KS0127=m
+CONFIG_VIDEO_OV7670=m
+CONFIG_VIDEO_SAA7110=m
+CONFIG_VIDEO_SAA7111=m
+CONFIG_VIDEO_SAA7114=m
+CONFIG_VIDEO_SAA711X=m
+CONFIG_VIDEO_TVP5150=m
+CONFIG_VIDEO_VPX3220=m
+CONFIG_VIDEO_CX25840=m
+CONFIG_VIDEO_CX2341X=m
+CONFIG_VIDEO_SAA7127=m
+CONFIG_VIDEO_SAA7185=m
+CONFIG_VIDEO_ADV7170=m
+CONFIG_VIDEO_ADV7175=m
+CONFIG_VIDEO_UPD64031A=m
+CONFIG_VIDEO_UPD64083=m
+CONFIG_VIDEO_VIVI=m
+CONFIG_VIDEO_BT848=m
+CONFIG_VIDEO_BT848_DVB=y
+CONFIG_VIDEO_SAA6588=m
+CONFIG_VIDEO_BWQCAM=m
+CONFIG_VIDEO_CQCAM=m
+CONFIG_VIDEO_W9966=m
+CONFIG_VIDEO_CPIA=m
+CONFIG_VIDEO_CPIA_PP=m
+CONFIG_VIDEO_CPIA_USB=m
+CONFIG_VIDEO_CPIA2=m
+CONFIG_VIDEO_SAA5246A=m
+CONFIG_VIDEO_SAA5249=m
+CONFIG_TUNER_3036=m
+CONFIG_VIDEO_STRADIS=m
+CONFIG_VIDEO_ZORAN_ZR36060=m
+CONFIG_VIDEO_ZORAN=m
+CONFIG_VIDEO_ZORAN_BUZ=m
+CONFIG_VIDEO_ZORAN_DC10=m
+CONFIG_VIDEO_ZORAN_DC30=m
+CONFIG_VIDEO_ZORAN_LML33=m
+CONFIG_VIDEO_ZORAN_LML33R10=m
+CONFIG_VIDEO_ZORAN_AVS6EYES=m
+CONFIG_VIDEO_SAA7134=m
+CONFIG_VIDEO_SAA7134_ALSA=m
+CONFIG_VIDEO_SAA7134_OSS=m
+CONFIG_VIDEO_SAA7134_DVB=m
+CONFIG_VIDEO_MXB=m
+CONFIG_VIDEO_DPC=m
+CONFIG_VIDEO_HEXIUM_ORION=m
+CONFIG_VIDEO_HEXIUM_GEMINI=m
+CONFIG_VIDEO_CX88=m
+CONFIG_VIDEO_CX88_ALSA=m
+CONFIG_VIDEO_CX88_BLACKBIRD=m
+CONFIG_VIDEO_CX88_DVB=m
+CONFIG_VIDEO_CX88_VP3054=m
+CONFIG_VIDEO_IVTV=m
+CONFIG_VIDEO_CAFE_CCIC=m
+CONFIG_V4L_USB_DRIVERS=y
+CONFIG_VIDEO_PVRUSB2=m
+CONFIG_VIDEO_PVRUSB2_29XXX=y
+CONFIG_VIDEO_PVRUSB2_24XXX=y
+CONFIG_VIDEO_PVRUSB2_SYSFS=y
+# CONFIG_VIDEO_PVRUSB2_DEBUGIFC is not set
+CONFIG_VIDEO_EM28XX=m
+CONFIG_VIDEO_USBVISION=m
+CONFIG_VIDEO_USBVIDEO=m
+CONFIG_USB_VICAM=m
+CONFIG_USB_IBMCAM=m
+CONFIG_USB_KONICAWC=m
+CONFIG_USB_QUICKCAM_MESSENGER=m
+CONFIG_USB_ET61X251=m
+CONFIG_VIDEO_OVCAMCHIP=m
+CONFIG_USB_W9968CF=m
+CONFIG_USB_OV511=m
+CONFIG_USB_SE401=m
+CONFIG_USB_SN9C102=m
+CONFIG_USB_STV680=m
+CONFIG_USB_ZC0301=m
+CONFIG_USB_PWC=m
+# CONFIG_USB_PWC_DEBUG is not set
+CONFIG_USB_ZR364XX=m
+CONFIG_RADIO_ADAPTERS=y
+CONFIG_RADIO_GEMTEK_PCI=m
+CONFIG_RADIO_MAXIRADIO=m
+CONFIG_RADIO_MAESTRO=m
+CONFIG_USB_DSBR=m
+CONFIG_DVB_CORE=m
+CONFIG_DVB_CORE_ATTACH=y
+CONFIG_DVB_CAPTURE_DRIVERS=y
+
+#
+# Supported SAA7146 based PCI Adapters
+#
+CONFIG_DVB_AV7110=m
+CONFIG_DVB_AV7110_OSD=y
+CONFIG_DVB_BUDGET=m
+CONFIG_DVB_BUDGET_CI=m
+CONFIG_DVB_BUDGET_AV=m
+CONFIG_DVB_BUDGET_PATCH=m
+
+#
+# Supported USB Adapters
+#
+CONFIG_DVB_USB=m
+# CONFIG_DVB_USB_DEBUG is not set
+CONFIG_DVB_USB_A800=m
+CONFIG_DVB_USB_DIBUSB_MB=m
+CONFIG_DVB_USB_DIBUSB_MB_FAULTY=y
+CONFIG_DVB_USB_DIBUSB_MC=m
+CONFIG_DVB_USB_DIB0700=m
+CONFIG_DVB_USB_UMT_010=m
+CONFIG_DVB_USB_CXUSB=m
+CONFIG_DVB_USB_M920X=m
+CONFIG_DVB_USB_GL861=m
+CONFIG_DVB_USB_AU6610=m
+CONFIG_DVB_USB_DIGITV=m
+CONFIG_DVB_USB_VP7045=m
+CONFIG_DVB_USB_VP702X=m
+CONFIG_DVB_USB_GP8PSK=m
+CONFIG_DVB_USB_NOVA_T_USB2=m
+CONFIG_DVB_USB_TTUSB2=m
+CONFIG_DVB_USB_DTT200U=m
+CONFIG_DVB_USB_OPERA1=m
+CONFIG_DVB_TTUSB_BUDGET=m
+CONFIG_DVB_TTUSB_DEC=m
+CONFIG_DVB_CINERGYT2=m
+# CONFIG_DVB_CINERGYT2_TUNING is not set
+
+#
+# Supported FlexCopII (B2C2) Adapters
+#
+CONFIG_DVB_B2C2_FLEXCOP=m
+CONFIG_DVB_B2C2_FLEXCOP_PCI=m
+CONFIG_DVB_B2C2_FLEXCOP_USB=m
+# CONFIG_DVB_B2C2_FLEXCOP_DEBUG is not set
+
+#
+# Supported BT878 Adapters
+#
+CONFIG_DVB_BT8XX=m
+
+#
+# Supported Pluto2 Adapters
+#
+CONFIG_DVB_PLUTO2=m
+
+#
+# Supported DVB Frontends
+#
+
+#
+# Customise DVB Frontends
+#
+# CONFIG_DVB_FE_CUSTOMISE is not set
+
+#
+# DVB-S (satellite) frontends
+#
+CONFIG_DVB_STV0299=m
+CONFIG_DVB_CX24110=m
+CONFIG_DVB_CX24123=m
+CONFIG_DVB_TDA8083=m
+CONFIG_DVB_MT312=m
+CONFIG_DVB_VES1X93=m
+CONFIG_DVB_S5H1420=m
+CONFIG_DVB_TDA10086=m
+
+#
+# DVB-T (terrestrial) frontends
+#
+CONFIG_DVB_SP8870=m
+CONFIG_DVB_SP887X=m
+CONFIG_DVB_CX22700=m
+CONFIG_DVB_CX22702=m
+CONFIG_DVB_L64781=m
+CONFIG_DVB_TDA1004X=m
+CONFIG_DVB_NXT6000=m
+CONFIG_DVB_MT352=m
+CONFIG_DVB_ZL10353=m
+CONFIG_DVB_DIB3000MB=m
+CONFIG_DVB_DIB3000MC=m
+CONFIG_DVB_DIB7000M=m
+CONFIG_DVB_DIB7000P=m
+
+#
+# DVB-C (cable) frontends
+#
+CONFIG_DVB_VES1820=m
+CONFIG_DVB_TDA10021=m
+CONFIG_DVB_TDA10023=m
+CONFIG_DVB_STV0297=m
+
+#
+# ATSC (North American/Korean Terrestrial/Cable DTV) frontends
+#
+CONFIG_DVB_NXT200X=m
+CONFIG_DVB_OR51211=m
+CONFIG_DVB_OR51132=m
+CONFIG_DVB_BCM3510=m
+CONFIG_DVB_LGDT330X=m
+
+#
+# Tuners/PLL support
+#
+CONFIG_DVB_PLL=m
+CONFIG_DVB_TDA826X=m
+CONFIG_DVB_TDA827X=m
+CONFIG_DVB_TUNER_QT1010=m
+CONFIG_DVB_TUNER_MT2060=m
+
+#
+# Miscellaneous devices
+#
+CONFIG_DVB_LNBP21=m
+CONFIG_DVB_ISL6421=m
+CONFIG_DVB_TUA6100=m
+CONFIG_VIDEO_SAA7146=m
+CONFIG_VIDEO_SAA7146_VV=m
+CONFIG_VIDEO_TUNER=m
+CONFIG_VIDEO_BUF=m
+CONFIG_VIDEO_BUF_DVB=m
+CONFIG_VIDEO_BTCX=m
+CONFIG_VIDEO_IR=m
+CONFIG_VIDEO_TVEEPROM=m
+
+#
+# Graphics support
+#
+CONFIG_BACKLIGHT_LCD_SUPPORT=y
+# CONFIG_LCD_CLASS_DEVICE is not set
+
+#
+# Display device support
+#
+CONFIG_DISPLAY_SUPPORT=m
+
+#
+# Display hardware drivers
+#
+CONFIG_FB=y
+CONFIG_FIRMWARE_EDID=y
+CONFIG_FB_DDC=m
+CONFIG_FB_CFB_FILLRECT=m
+CONFIG_FB_CFB_COPYAREA=m
+CONFIG_FB_CFB_IMAGEBLIT=m
+CONFIG_FB_SYS_FILLRECT=m
+CONFIG_FB_SYS_COPYAREA=m
+CONFIG_FB_SYS_IMAGEBLIT=m
+CONFIG_FB_SYS_FOPS=m
+CONFIG_FB_DEFERRED_IO=y
+CONFIG_FB_SVGALIB=m
+# CONFIG_FB_MACMODES is not set
+CONFIG_FB_BACKLIGHT=y
+CONFIG_FB_MODE_HELPERS=y
+CONFIG_FB_TILEBLITTING=y
+
+#
+# Frame buffer hardware drivers
+#
+CONFIG_FB_CIRRUS=m
+CONFIG_FB_PM2=m
+CONFIG_FB_PM2_FIFO_DISCONNECT=y
+CONFIG_FB_CYBER2000=m
+# CONFIG_FB_ASILIANT is not set
+# CONFIG_FB_IMSTT is not set
+CONFIG_FB_S1D13XXX=m
+CONFIG_FB_NVIDIA=m
+# CONFIG_FB_NVIDIA_I2C is not set
+# CONFIG_FB_NVIDIA_DEBUG is not set
+CONFIG_FB_NVIDIA_BACKLIGHT=y
+# CONFIG_FB_RIVA is not set
+CONFIG_FB_MATROX=m
+CONFIG_FB_MATROX_MILLENIUM=y
+CONFIG_FB_MATROX_MYSTIQUE=y
+CONFIG_FB_MATROX_G=y
+CONFIG_FB_MATROX_I2C=m
+CONFIG_FB_MATROX_MAVEN=m
+CONFIG_FB_MATROX_MULTIHEAD=y
+CONFIG_FB_RADEON=m
+CONFIG_FB_RADEON_I2C=y
+CONFIG_FB_RADEON_BACKLIGHT=y
+# CONFIG_FB_RADEON_DEBUG is not set
+CONFIG_FB_ATY128=m
+CONFIG_FB_ATY128_BACKLIGHT=y
+CONFIG_FB_ATY=m
+CONFIG_FB_ATY_CT=y
+# CONFIG_FB_ATY_GENERIC_LCD is not set
+CONFIG_FB_ATY_GX=y
+CONFIG_FB_ATY_BACKLIGHT=y
+CONFIG_FB_S3=m
+CONFIG_FB_SAVAGE=m
+# CONFIG_FB_SAVAGE_I2C is not set
+# CONFIG_FB_SAVAGE_ACCEL is not set
+CONFIG_FB_SIS=m
+CONFIG_FB_SIS_300=y
+CONFIG_FB_SIS_315=y
+CONFIG_FB_NEOMAGIC=m
+CONFIG_FB_KYRO=m
+CONFIG_FB_3DFX=m
+# CONFIG_FB_3DFX_ACCEL is not set
+CONFIG_FB_VOODOO1=m
+CONFIG_FB_VT8623=m
+CONFIG_FB_TRIDENT=m
+# CONFIG_FB_TRIDENT_ACCEL is not set
+CONFIG_FB_ARK=m
+CONFIG_FB_PM3=m
+CONFIG_FB_SM501=m
+CONFIG_FB_VIRTUAL=m
+
+#
+# Console display driver support
+#
+# CONFIG_VGA_CONSOLE is not set
+CONFIG_DUMMY_CONSOLE=y
+CONFIG_FRAMEBUFFER_CONSOLE=y
+CONFIG_FRAMEBUFFER_CONSOLE_ROTATION=y
+# CONFIG_FONTS is not set
+CONFIG_FONT_8x8=y
+CONFIG_FONT_8x16=y
+# CONFIG_LOGO is not set
+
+#
+# Sound
+#
+CONFIG_SOUND=y
+
+#
+# Advanced Linux Sound Architecture
+#
+CONFIG_SND=m
+CONFIG_SND_TIMER=m
+CONFIG_SND_PCM=m
+CONFIG_SND_HWDEP=m
+CONFIG_SND_RAWMIDI=m
+CONFIG_SND_SEQUENCER=m
+CONFIG_SND_SEQ_DUMMY=m
+CONFIG_SND_OSSEMUL=y
+CONFIG_SND_MIXER_OSS=m
+CONFIG_SND_PCM_OSS=m
+CONFIG_SND_PCM_OSS_PLUGINS=y
+CONFIG_SND_SEQUENCER_OSS=y
+CONFIG_SND_RTCTIMER=m
+CONFIG_SND_SEQ_RTCTIMER_DEFAULT=y
+# CONFIG_SND_DYNAMIC_MINORS is not set
+CONFIG_SND_SUPPORT_OLD_API=y
+CONFIG_SND_VERBOSE_PROCFS=y
+# CONFIG_SND_VERBOSE_PRINTK is not set
+# CONFIG_SND_DEBUG is not set
+
+#
+# Generic devices
+#
+CONFIG_SND_MPU401_UART=m
+CONFIG_SND_OPL3_LIB=m
+CONFIG_SND_VX_LIB=m
+CONFIG_SND_AC97_CODEC=m
+CONFIG_SND_DUMMY=m
+CONFIG_SND_VIRMIDI=m
+CONFIG_SND_MTPAV=m
+CONFIG_SND_MTS64=m
+CONFIG_SND_SERIAL_U16550=m
+CONFIG_SND_MPU401=m
+CONFIG_SND_PORTMAN2X4=m
+
+#
+# PCI devices
+#
+CONFIG_SND_AD1889=m
+CONFIG_SND_ALS300=m
+CONFIG_SND_ALI5451=m
+CONFIG_SND_ATIIXP=m
+CONFIG_SND_ATIIXP_MODEM=m
+CONFIG_SND_AU8810=m
+CONFIG_SND_AU8820=m
+CONFIG_SND_AU8830=m
+CONFIG_SND_AZT3328=m
+CONFIG_SND_BT87X=m
+# CONFIG_SND_BT87X_OVERCLOCK is not set
+CONFIG_SND_CA0106=m
+CONFIG_SND_CMIPCI=m
+CONFIG_SND_CS4281=m
+CONFIG_SND_CS46XX=m
+CONFIG_SND_CS46XX_NEW_DSP=y
+CONFIG_SND_DARLA20=m
+CONFIG_SND_GINA20=m
+CONFIG_SND_LAYLA20=m
+CONFIG_SND_DARLA24=m
+CONFIG_SND_GINA24=m
+CONFIG_SND_LAYLA24=m
+CONFIG_SND_MONA=m
+CONFIG_SND_MIA=m
+CONFIG_SND_ECHO3G=m
+CONFIG_SND_INDIGO=m
+CONFIG_SND_INDIGOIO=m
+CONFIG_SND_INDIGODJ=m
+CONFIG_SND_EMU10K1=m
+CONFIG_SND_EMU10K1X=m
+CONFIG_SND_ENS1370=m
+CONFIG_SND_ENS1371=m
+CONFIG_SND_ES1938=m
+CONFIG_SND_ES1968=m
+CONFIG_SND_FM801=m
+CONFIG_SND_FM801_TEA575X_BOOL=y
+CONFIG_SND_FM801_TEA575X=m
+CONFIG_SND_HDA_INTEL=m
+CONFIG_SND_HDSP=m
+CONFIG_SND_HDSPM=m
+CONFIG_SND_ICE1712=m
+CONFIG_SND_ICE1724=m
+CONFIG_SND_INTEL8X0=m
+CONFIG_SND_INTEL8X0M=m
+CONFIG_SND_KORG1212=m
+CONFIG_SND_MAESTRO3=m
+CONFIG_SND_MIXART=m
+CONFIG_SND_NM256=m
+CONFIG_SND_PCXHR=m
+CONFIG_SND_RIPTIDE=m
+CONFIG_SND_RME32=m
+CONFIG_SND_RME96=m
+CONFIG_SND_RME9652=m
+CONFIG_SND_SONICVIBES=m
+CONFIG_SND_TRIDENT=m
+CONFIG_SND_VIA82XX=m
+CONFIG_SND_VIA82XX_MODEM=m
+CONFIG_SND_VX222=m
+CONFIG_SND_YMFPCI=m
+CONFIG_SND_AC97_POWER_SAVE=y
+
+#
+# ALSA MIPS devices
+#
+
+#
+# USB devices
+#
+CONFIG_SND_USB_AUDIO=m
+CONFIG_SND_USB_CAIAQ=m
+CONFIG_SND_USB_CAIAQ_INPUT=y
+
+#
+# System on Chip audio support
+#
+
+#
+# Open Sound System
+#
+CONFIG_SOUND_PRIME=m
+# CONFIG_OSS_OBSOLETE is not set
+CONFIG_SOUND_TRIDENT=m
+CONFIG_SOUND_MSNDCLAS=m
+CONFIG_MSNDCLAS_INIT_FILE="/etc/sound/msndinit.bin"
+CONFIG_MSNDCLAS_PERM_FILE="/etc/sound/msndperm.bin"
+CONFIG_SOUND_MSNDPIN=m
+CONFIG_MSNDPIN_INIT_FILE="/etc/sound/pndspini.bin"
+CONFIG_MSNDPIN_PERM_FILE="/etc/sound/pndsperm.bin"
+CONFIG_AC97_BUS=m
+
+#
+# HID Devices
+#
+CONFIG_HID=y
+# CONFIG_HID_DEBUG is not set
+
+#
+# USB Input Devices
+#
+CONFIG_USB_HID=m
+# CONFIG_USB_HIDINPUT_POWERBOOK is not set
+# CONFIG_HID_FF is not set
+CONFIG_USB_HIDDEV=y
+
+#
+# USB HID Boot Protocol drivers
+#
+CONFIG_USB_KBD=m
+CONFIG_USB_MOUSE=m
+
+#
+# USB support
+#
+CONFIG_USB_ARCH_HAS_HCD=y
+CONFIG_USB_ARCH_HAS_OHCI=y
+CONFIG_USB_ARCH_HAS_EHCI=y
+CONFIG_USB=y
+# CONFIG_USB_DEBUG is not set
+
+#
+# Miscellaneous USB options
+#
+CONFIG_USB_DEVICEFS=y
+# CONFIG_USB_DYNAMIC_MINORS is not set
+# CONFIG_USB_OTG is not set
+
+#
+# USB Host Controller Drivers
+#
+CONFIG_USB_EHCI_HCD=m
+CONFIG_USB_EHCI_SPLIT_ISO=y
+CONFIG_USB_EHCI_ROOT_HUB_TT=y
+# CONFIG_USB_EHCI_TT_NEWSCHED is not set
+# CONFIG_USB_EHCI_BIG_ENDIAN_MMIO is not set
+CONFIG_USB_ISP116X_HCD=m
+CONFIG_USB_OHCI_HCD=m
+# CONFIG_USB_OHCI_BIG_ENDIAN_DESC is not set
+# CONFIG_USB_OHCI_BIG_ENDIAN_MMIO is not set
+CONFIG_USB_OHCI_LITTLE_ENDIAN=y
+CONFIG_USB_UHCI_HCD=y
+CONFIG_USB_U132_HCD=m
+CONFIG_USB_SL811_HCD=m
+
+#
+# USB Device Class drivers
+#
+CONFIG_USB_ACM=m
+CONFIG_USB_PRINTER=m
+
+#
+# NOTE: USB_STORAGE enables SCSI, and 'SCSI disk support'
+#
+
+#
+# may also be needed; see USB_STORAGE Help for more information
+#
+CONFIG_USB_STORAGE=m
+# CONFIG_USB_STORAGE_DEBUG is not set
+CONFIG_USB_STORAGE_DATAFAB=y
+CONFIG_USB_STORAGE_FREECOM=y
+CONFIG_USB_STORAGE_ISD200=y
+CONFIG_USB_STORAGE_DPCM=y
+CONFIG_USB_STORAGE_USBAT=y
+CONFIG_USB_STORAGE_SDDR09=y
+CONFIG_USB_STORAGE_SDDR55=y
+CONFIG_USB_STORAGE_JUMPSHOT=y
+CONFIG_USB_STORAGE_ALAUDA=y
+CONFIG_USB_STORAGE_ONETOUCH=y
+CONFIG_USB_STORAGE_KARMA=y
+# CONFIG_USB_LIBUSUAL is not set
+
+#
+# USB Imaging devices
+#
+CONFIG_USB_MDC800=m
+CONFIG_USB_MICROTEK=m
+CONFIG_USB_MON=y
+
+#
+# USB port drivers
+#
+CONFIG_USB_USS720=m
+
+#
+# USB Serial Converter support
+#
+CONFIG_USB_SERIAL=m
+CONFIG_USB_SERIAL_GENERIC=y
+CONFIG_USB_SERIAL_AIRCABLE=m
+CONFIG_USB_SERIAL_AIRPRIME=m
+CONFIG_USB_SERIAL_ARK3116=m
+CONFIG_USB_SERIAL_BELKIN=m
+# CONFIG_USB_SERIAL_WHITEHEAT is not set
+CONFIG_USB_SERIAL_DIGI_ACCELEPORT=m
+CONFIG_USB_SERIAL_CP2101=m
+CONFIG_USB_SERIAL_CYPRESS_M8=m
+CONFIG_USB_SERIAL_EMPEG=m
+CONFIG_USB_SERIAL_FTDI_SIO=m
+CONFIG_USB_SERIAL_FUNSOFT=m
+CONFIG_USB_SERIAL_VISOR=m
+CONFIG_USB_SERIAL_IPAQ=m
+CONFIG_USB_SERIAL_IR=m
+# CONFIG_USB_SERIAL_EDGEPORT is not set
+# CONFIG_USB_SERIAL_EDGEPORT_TI is not set
+CONFIG_USB_SERIAL_GARMIN=m
+CONFIG_USB_SERIAL_IPW=m
+CONFIG_USB_SERIAL_KEYSPAN_PDA=m
+# CONFIG_USB_SERIAL_KEYSPAN is not set
+CONFIG_USB_SERIAL_KLSI=m
+CONFIG_USB_SERIAL_KOBIL_SCT=m
+CONFIG_USB_SERIAL_MCT_U232=m
+CONFIG_USB_SERIAL_MOS7720=m
+CONFIG_USB_SERIAL_MOS7840=m
+CONFIG_USB_SERIAL_NAVMAN=m
+CONFIG_USB_SERIAL_PL2303=m
+CONFIG_USB_SERIAL_HP4X=m
+CONFIG_USB_SERIAL_SAFE=m
+# CONFIG_USB_SERIAL_SAFE_PADDED is not set
+CONFIG_USB_SERIAL_SIERRAWIRELESS=m
+# CONFIG_USB_SERIAL_TI is not set
+CONFIG_USB_SERIAL_CYBERJACK=m
+CONFIG_USB_SERIAL_XIRCOM=m
+CONFIG_USB_SERIAL_OPTION=m
+CONFIG_USB_SERIAL_OMNINET=m
+CONFIG_USB_SERIAL_DEBUG=m
+
+#
+# USB Miscellaneous drivers
+#
+CONFIG_USB_ADUTUX=m
+CONFIG_USB_AUERSWALD=m
+CONFIG_USB_RIO500=m
+CONFIG_USB_LEGOTOWER=m
+CONFIG_USB_LCD=m
+CONFIG_USB_BERRY_CHARGE=m
+CONFIG_USB_LED=m
+CONFIG_USB_CYPRESS_CY7C63=m
+CONFIG_USB_CYTHERM=m
+CONFIG_USB_PHIDGET=m
+CONFIG_USB_PHIDGETKIT=m
+CONFIG_USB_PHIDGETMOTORCONTROL=m
+CONFIG_USB_PHIDGETSERVO=m
+CONFIG_USB_IDMOUSE=m
+CONFIG_USB_FTDI_ELAN=m
+CONFIG_USB_APPLEDISPLAY=m
+CONFIG_USB_SISUSBVGA=m
+CONFIG_USB_SISUSBVGA_CON=y
+CONFIG_USB_LD=m
+CONFIG_USB_TRANCEVIBRATOR=m
+CONFIG_USB_IOWARRIOR=m
+CONFIG_USB_TEST=m
+
+#
+# USB DSL modem support
+#
+CONFIG_USB_ATM=m
+CONFIG_USB_SPEEDTOUCH=m
+CONFIG_USB_CXACRU=m
+CONFIG_USB_UEAGLEATM=m
+CONFIG_USB_XUSBATM=m
+
+#
+# USB Gadget Support
+#
+CONFIG_USB_GADGET=m
+# CONFIG_USB_GADGET_DEBUG_FILES is not set
+CONFIG_USB_GADGET_SELECTED=y
+CONFIG_USB_GADGET_NET2280=y
+CONFIG_USB_NET2280=m
+# CONFIG_USB_GADGET_PXA2XX is not set
+# CONFIG_USB_GADGET_GOKU is not set
+# CONFIG_USB_GADGET_LH7A40X is not set
+# CONFIG_USB_GADGET_OMAP is not set
+# CONFIG_USB_GADGET_AT91 is not set
+# CONFIG_USB_GADGET_DUMMY_HCD is not set
+CONFIG_USB_GADGET_DUALSPEED=y
+CONFIG_USB_ZERO=m
+CONFIG_USB_ETH=m
+CONFIG_USB_ETH_RNDIS=y
+CONFIG_USB_GADGETFS=m
+CONFIG_USB_FILE_STORAGE=m
+# CONFIG_USB_FILE_STORAGE_TEST is not set
+CONFIG_USB_G_SERIAL=m
+CONFIG_USB_MIDI_GADGET=m
+CONFIG_MMC=m
+# CONFIG_MMC_DEBUG is not set
+# CONFIG_MMC_UNSAFE_RESUME is not set
+
+#
+# MMC/SD Card Drivers
+#
+CONFIG_MMC_BLOCK=m
+
+#
+# MMC/SD Host Controller Drivers
+#
+CONFIG_MMC_SDHCI=m
+CONFIG_MMC_TIFM_SD=m
+
+#
+# LED devices
+#
+# CONFIG_NEW_LEDS is not set
+
+#
+# LED drivers
+#
+
+#
+# LED Triggers
+#
+
+#
+# InfiniBand support
+#
+CONFIG_INFINIBAND=m
+CONFIG_INFINIBAND_USER_MAD=m
+CONFIG_INFINIBAND_USER_ACCESS=m
+CONFIG_INFINIBAND_ADDR_TRANS=y
+CONFIG_INFINIBAND_MTHCA=m
+CONFIG_INFINIBAND_MTHCA_DEBUG=y
+CONFIG_INFINIBAND_AMSO1100=m
+# CONFIG_INFINIBAND_AMSO1100_DEBUG is not set
+CONFIG_INFINIBAND_CXGB3=m
+# CONFIG_INFINIBAND_CXGB3_DEBUG is not set
+CONFIG_MLX4_INFINIBAND=m
+CONFIG_INFINIBAND_IPOIB=m
+# CONFIG_INFINIBAND_IPOIB_CM is not set
+CONFIG_INFINIBAND_IPOIB_DEBUG=y
+# CONFIG_INFINIBAND_IPOIB_DEBUG_DATA is not set
+CONFIG_INFINIBAND_SRP=m
+CONFIG_INFINIBAND_ISER=m
+
+#
+# EDAC - error detection and reporting (RAS) (EXPERIMENTAL)
+#
+
+#
+# Real Time Clock
+#
+CONFIG_RTC_LIB=m
+CONFIG_RTC_CLASS=m
+
+#
+# RTC interfaces
+#
+CONFIG_RTC_INTF_SYSFS=y
+CONFIG_RTC_INTF_PROC=y
+CONFIG_RTC_INTF_DEV=y
+# CONFIG_RTC_INTF_DEV_UIE_EMUL is not set
+# CONFIG_RTC_DRV_TEST is not set
+
+#
+# I2C RTC drivers
+#
+CONFIG_RTC_DRV_DS1307=m
+CONFIG_RTC_DRV_DS1672=m
+CONFIG_RTC_DRV_MAX6900=m
+CONFIG_RTC_DRV_RS5C372=m
+CONFIG_RTC_DRV_ISL1208=m
+CONFIG_RTC_DRV_X1205=m
+CONFIG_RTC_DRV_PCF8563=m
+CONFIG_RTC_DRV_PCF8583=m
+
+#
+# SPI RTC drivers
+#
+CONFIG_RTC_DRV_RS5C348=m
+CONFIG_RTC_DRV_MAX6902=m
+
+#
+# Platform RTC drivers
+#
+CONFIG_RTC_DRV_CMOS=m
+# CONFIG_RTC_DRV_DS1553 is not set
+# CONFIG_RTC_DRV_DS1742 is not set
+CONFIG_RTC_DRV_M48T86=m
+# CONFIG_RTC_DRV_V3020 is not set
+
+#
+# on-CPU RTC drivers
+#
+
+#
+# DMA Engine support
+#
+CONFIG_DMA_ENGINE=y
+
+#
+# DMA Clients
+#
+CONFIG_NET_DMA=y
+
+#
+# DMA Devices
+#
+# CONFIG_INTEL_IOATDMA is not set
+
+#
+# Auxiliary Display support
+#
+# CONFIG_KS0108 is not set
+
+#
+# File systems
+#
+CONFIG_EXT2_FS=y
+CONFIG_EXT2_FS_XATTR=y
+CONFIG_EXT2_FS_POSIX_ACL=y
+CONFIG_EXT2_FS_SECURITY=y
+# CONFIG_EXT2_FS_XIP is not set
+CONFIG_EXT3_FS=y
+CONFIG_EXT3_FS_XATTR=y
+CONFIG_EXT3_FS_POSIX_ACL=y
+CONFIG_EXT3_FS_SECURITY=y
+CONFIG_EXT4DEV_FS=m
+CONFIG_EXT4DEV_FS_XATTR=y
+CONFIG_EXT4DEV_FS_POSIX_ACL=y
+CONFIG_EXT4DEV_FS_SECURITY=y
+CONFIG_JBD=y
+# CONFIG_JBD_DEBUG is not set
+CONFIG_JBD2=m
+# CONFIG_JBD2_DEBUG is not set
+CONFIG_FS_MBCACHE=y
+CONFIG_REISERFS_FS=m
+# CONFIG_REISERFS_CHECK is not set
+# CONFIG_REISERFS_PROC_INFO is not set
+CONFIG_REISERFS_FS_XATTR=y
+CONFIG_REISERFS_FS_POSIX_ACL=y
+CONFIG_REISERFS_FS_SECURITY=y
+CONFIG_JFS_FS=m
+# CONFIG_JFS_POSIX_ACL is not set
+CONFIG_JFS_SECURITY=y
+# CONFIG_JFS_DEBUG is not set
+# CONFIG_JFS_STATISTICS is not set
+CONFIG_FS_POSIX_ACL=y
+CONFIG_XFS_FS=m
+CONFIG_XFS_QUOTA=y
+CONFIG_XFS_SECURITY=y
+CONFIG_XFS_POSIX_ACL=y
+CONFIG_XFS_RT=y
+CONFIG_GFS2_FS=m
+CONFIG_GFS2_FS_LOCKING_NOLOCK=m
+CONFIG_GFS2_FS_LOCKING_DLM=m
+CONFIG_OCFS2_FS=m
+CONFIG_OCFS2_DEBUG_MASKLOG=y
+CONFIG_MINIX_FS=m
+CONFIG_ROMFS_FS=m
+CONFIG_INOTIFY=y
+CONFIG_INOTIFY_USER=y
+CONFIG_QUOTA=y
+CONFIG_QFMT_V1=m
+CONFIG_QFMT_V2=m
+CONFIG_QUOTACTL=y
+CONFIG_DNOTIFY=y
+CONFIG_AUTOFS_FS=m
+CONFIG_AUTOFS4_FS=m
+CONFIG_FUSE_FS=m
+CONFIG_GENERIC_ACL=y
+
+#
+# CD-ROM/DVD Filesystems
+#
+CONFIG_ISO9660_FS=m
+CONFIG_JOLIET=y
+CONFIG_ZISOFS=y
+CONFIG_UDF_FS=m
+CONFIG_UDF_NLS=y
+
+#
+# DOS/FAT/NT Filesystems
+#
+CONFIG_FAT_FS=m
+CONFIG_MSDOS_FS=m
+CONFIG_VFAT_FS=m
+CONFIG_FAT_DEFAULT_CODEPAGE=437
+CONFIG_FAT_DEFAULT_IOCHARSET="iso8859-1"
+CONFIG_NTFS_FS=m
+# CONFIG_NTFS_DEBUG is not set
+CONFIG_NTFS_RW=y
+
+#
+# Pseudo filesystems
+#
+CONFIG_PROC_FS=y
+CONFIG_PROC_KCORE=y
+CONFIG_PROC_SYSCTL=y
+CONFIG_SYSFS=y
+CONFIG_TMPFS=y
+CONFIG_TMPFS_POSIX_ACL=y
+CONFIG_RAMFS=y
+CONFIG_CONFIGFS_FS=m
+
+#
+# Miscellaneous filesystems
+#
+CONFIG_ADFS_FS=m
+# CONFIG_ADFS_FS_RW is not set
+CONFIG_AFFS_FS=m
+CONFIG_ECRYPT_FS=m
+CONFIG_HFS_FS=m
+CONFIG_HFSPLUS_FS=m
+CONFIG_BEFS_FS=m
+# CONFIG_BEFS_DEBUG is not set
+CONFIG_BFS_FS=m
+CONFIG_EFS_FS=m
+CONFIG_JFFS2_FS=m
+CONFIG_JFFS2_FS_DEBUG=0
+CONFIG_JFFS2_FS_WRITEBUFFER=y
+# CONFIG_JFFS2_SUMMARY is not set
+CONFIG_JFFS2_FS_XATTR=y
+CONFIG_JFFS2_FS_POSIX_ACL=y
+CONFIG_JFFS2_FS_SECURITY=y
+# CONFIG_JFFS2_COMPRESSION_OPTIONS is not set
+CONFIG_JFFS2_ZLIB=y
+CONFIG_JFFS2_RTIME=y
+# CONFIG_JFFS2_RUBIN is not set
+CONFIG_CRAMFS=y
+CONFIG_VXFS_FS=m
+CONFIG_HPFS_FS=m
+CONFIG_QNX4FS_FS=m
+CONFIG_SYSV_FS=m
+CONFIG_UFS_FS=m
+# CONFIG_UFS_FS_WRITE is not set
+# CONFIG_UFS_DEBUG is not set
+
+#
+# Network File Systems
+#
+CONFIG_NFS_FS=y
+CONFIG_NFS_V3=y
+CONFIG_NFS_V3_ACL=y
+CONFIG_NFS_V4=y
+CONFIG_NFS_DIRECTIO=y
+CONFIG_NFSD=m
+CONFIG_NFSD_V2_ACL=y
+CONFIG_NFSD_V3=y
+CONFIG_NFSD_V3_ACL=y
+CONFIG_NFSD_V4=y
+CONFIG_NFSD_TCP=y
+CONFIG_LOCKD=y
+CONFIG_LOCKD_V4=y
+CONFIG_EXPORTFS=m
+CONFIG_NFS_ACL_SUPPORT=y
+CONFIG_NFS_COMMON=y
+CONFIG_SUNRPC=y
+CONFIG_SUNRPC_GSS=y
+CONFIG_SUNRPC_BIND34=y
+CONFIG_RPCSEC_GSS_KRB5=y
+# CONFIG_RPCSEC_GSS_SPKM3 is not set
+CONFIG_SMB_FS=m
+# CONFIG_SMB_NLS_DEFAULT is not set
+CONFIG_CIFS=m
+# CONFIG_CIFS_STATS is not set
+# CONFIG_CIFS_WEAK_PW_HASH is not set
+CONFIG_CIFS_XATTR=y
+CONFIG_CIFS_POSIX=y
+# CONFIG_CIFS_DEBUG2 is not set
+# CONFIG_CIFS_EXPERIMENTAL is not set
+CONFIG_NCP_FS=m
+CONFIG_NCPFS_PACKET_SIGNING=y
+CONFIG_NCPFS_IOCTL_LOCKING=y
+CONFIG_NCPFS_STRONG=y
+CONFIG_NCPFS_NFS_NS=y
+CONFIG_NCPFS_OS2_NS=y
+# CONFIG_NCPFS_SMALLDOS is not set
+CONFIG_NCPFS_NLS=y
+CONFIG_NCPFS_EXTRAS=y
+CONFIG_CODA_FS=m
+# CONFIG_CODA_FS_OLD_API is not set
+CONFIG_AFS_FS=m
+# CONFIG_AFS_DEBUG is not set
+CONFIG_9P_FS=m
+
+#
+# Partition Types
+#
+# CONFIG_PARTITION_ADVANCED is not set
+CONFIG_MSDOS_PARTITION=y
+
+#
+# Native Language Support
+#
+CONFIG_NLS=y
+CONFIG_NLS_DEFAULT="iso8859-1"
+CONFIG_NLS_CODEPAGE_437=m
+CONFIG_NLS_CODEPAGE_737=m
+CONFIG_NLS_CODEPAGE_775=m
+CONFIG_NLS_CODEPAGE_850=m
+CONFIG_NLS_CODEPAGE_852=m
+CONFIG_NLS_CODEPAGE_855=m
+CONFIG_NLS_CODEPAGE_857=m
+CONFIG_NLS_CODEPAGE_860=m
+CONFIG_NLS_CODEPAGE_861=m
+CONFIG_NLS_CODEPAGE_862=m
+CONFIG_NLS_CODEPAGE_863=m
+CONFIG_NLS_CODEPAGE_864=m
+CONFIG_NLS_CODEPAGE_865=m
+CONFIG_NLS_CODEPAGE_866=m
+CONFIG_NLS_CODEPAGE_869=m
+CONFIG_NLS_CODEPAGE_936=m
+CONFIG_NLS_CODEPAGE_950=m
+CONFIG_NLS_CODEPAGE_932=m
+CONFIG_NLS_CODEPAGE_949=m
+CONFIG_NLS_CODEPAGE_874=m
+CONFIG_NLS_ISO8859_8=m
+CONFIG_NLS_CODEPAGE_1250=m
+CONFIG_NLS_CODEPAGE_1251=m
+CONFIG_NLS_ASCII=m
+CONFIG_NLS_ISO8859_1=m
+CONFIG_NLS_ISO8859_2=m
+CONFIG_NLS_ISO8859_3=m
+CONFIG_NLS_ISO8859_4=m
+CONFIG_NLS_ISO8859_5=m
+CONFIG_NLS_ISO8859_6=m
+CONFIG_NLS_ISO8859_7=m
+CONFIG_NLS_ISO8859_9=m
+CONFIG_NLS_ISO8859_13=m
+CONFIG_NLS_ISO8859_14=m
+CONFIG_NLS_ISO8859_15=m
+CONFIG_NLS_KOI8_R=m
+CONFIG_NLS_KOI8_U=m
+CONFIG_NLS_UTF8=m
+
+#
+# Distributed Lock Manager
+#
+CONFIG_DLM=m
+# CONFIG_DLM_DEBUG is not set
+
+#
+# Profiling support
+#
+CONFIG_PROFILING=y
+CONFIG_OPROFILE=m
+
+#
+# Kernel hacking
+#
+CONFIG_TRACE_IRQFLAGS_SUPPORT=y
+# CONFIG_PRINTK_TIME is not set
+CONFIG_ENABLE_MUST_CHECK=y
+CONFIG_MAGIC_SYSRQ=y
+CONFIG_UNUSED_SYMBOLS=y
+# CONFIG_DEBUG_FS is not set
+# CONFIG_HEADERS_CHECK is not set
+# CONFIG_DEBUG_KERNEL is not set
+# CONFIG_CROSSCOMPILE is not set
+CONFIG_CMDLINE=""
+
+#
+# Security options
+#
+CONFIG_KEYS=y
+# CONFIG_KEYS_DEBUG_PROC_KEYS is not set
+CONFIG_SECURITY=y
+CONFIG_SECURITY_NETWORK=y
+CONFIG_SECURITY_NETWORK_XFRM=y
+CONFIG_SECURITY_CAPABILITIES=y
+# CONFIG_SECURITY_ROOTPLUG is not set
+CONFIG_SECURITY_SELINUX=y
+CONFIG_SECURITY_SELINUX_BOOTPARAM=y
+CONFIG_SECURITY_SELINUX_BOOTPARAM_VALUE=0
+CONFIG_SECURITY_SELINUX_DISABLE=y
+CONFIG_SECURITY_SELINUX_DEVELOP=y
+CONFIG_SECURITY_SELINUX_AVC_STATS=y
+CONFIG_SECURITY_SELINUX_CHECKREQPROT_VALUE=1
+# CONFIG_SECURITY_SELINUX_ENABLE_SECMARK_DEFAULT is not set
+# CONFIG_SECURITY_SELINUX_POLICYDB_VERSION_MAX is not set
+
+#
+# Cryptographic options
+#
+CONFIG_CRYPTO=y
+CONFIG_CRYPTO_ALGAPI=y
+CONFIG_CRYPTO_BLKCIPHER=y
+CONFIG_CRYPTO_HASH=y
+CONFIG_CRYPTO_MANAGER=y
+CONFIG_CRYPTO_HMAC=y
+CONFIG_CRYPTO_XCBC=m
+CONFIG_CRYPTO_NULL=m
+CONFIG_CRYPTO_MD4=m
+CONFIG_CRYPTO_MD5=y
+CONFIG_CRYPTO_SHA1=m
+CONFIG_CRYPTO_SHA256=m
+CONFIG_CRYPTO_SHA512=m
+CONFIG_CRYPTO_WP512=m
+CONFIG_CRYPTO_TGR192=m
+CONFIG_CRYPTO_GF128MUL=m
+CONFIG_CRYPTO_ECB=m
+CONFIG_CRYPTO_CBC=y
+CONFIG_CRYPTO_PCBC=m
+CONFIG_CRYPTO_LRW=m
+# CONFIG_CRYPTO_CRYPTD is not set
+CONFIG_CRYPTO_DES=y
+CONFIG_CRYPTO_FCRYPT=m
+CONFIG_CRYPTO_BLOWFISH=m
+CONFIG_CRYPTO_TWOFISH=m
+CONFIG_CRYPTO_TWOFISH_COMMON=m
+CONFIG_CRYPTO_SERPENT=m
+CONFIG_CRYPTO_AES=m
+CONFIG_CRYPTO_CAST5=m
+CONFIG_CRYPTO_CAST6=m
+CONFIG_CRYPTO_TEA=m
+CONFIG_CRYPTO_ARC4=m
+CONFIG_CRYPTO_KHAZAD=m
+CONFIG_CRYPTO_ANUBIS=m
+CONFIG_CRYPTO_DEFLATE=m
+CONFIG_CRYPTO_MICHAEL_MIC=m
+CONFIG_CRYPTO_CRC32C=m
+CONFIG_CRYPTO_CAMELLIA=m
+CONFIG_CRYPTO_TEST=m
+
+#
+# Hardware crypto devices
+#
+
+#
+# Library routines
+#
+CONFIG_BITREVERSE=y
+CONFIG_CRC_CCITT=m
+CONFIG_CRC16=m
+CONFIG_CRC_ITU_T=m
+CONFIG_CRC32=y
+CONFIG_LIBCRC32C=m
+CONFIG_AUDIT_GENERIC=y
+CONFIG_ZLIB_INFLATE=y
+CONFIG_ZLIB_DEFLATE=m
+CONFIG_REED_SOLOMON=m
+CONFIG_REED_SOLOMON_DEC16=y
+CONFIG_TEXTSEARCH=y
+CONFIG_TEXTSEARCH_KMP=m
+CONFIG_TEXTSEARCH_BM=m
+CONFIG_TEXTSEARCH_FSM=m
+CONFIG_PLIST=y
+CONFIG_HAS_IOMEM=y
+CONFIG_HAS_IOPORT=y
+CONFIG_HAS_DMA=y

Added: dists/sid/linux-2.6/debian/config/mipsel/config.qemu
==============================================================================
--- (empty file)
+++ dists/sid/linux-2.6/debian/config/mipsel/config.qemu	Mon Nov 26 20:06:56 2007
@@ -0,0 +1,1231 @@
+#
+# Machine selection
+#
+# CONFIG_MIPS_MTX1 is not set
+# CONFIG_MIPS_BOSPORUS is not set
+# CONFIG_MIPS_PB1000 is not set
+# CONFIG_MIPS_PB1100 is not set
+# CONFIG_MIPS_PB1500 is not set
+# CONFIG_MIPS_PB1550 is not set
+# CONFIG_MIPS_PB1200 is not set
+# CONFIG_MIPS_DB1000 is not set
+# CONFIG_MIPS_DB1100 is not set
+# CONFIG_MIPS_DB1500 is not set
+# CONFIG_MIPS_DB1550 is not set
+# CONFIG_MIPS_DB1200 is not set
+# CONFIG_MIPS_MIRAGE is not set
+# CONFIG_BASLER_EXCITE is not set
+# CONFIG_MIPS_COBALT is not set
+# CONFIG_MACH_DECSTATION is not set
+# CONFIG_MIPS_EV64120 is not set
+# CONFIG_MIPS_EV96100 is not set
+# CONFIG_MIPS_IVR is not set
+# CONFIG_MIPS_ITE8172 is not set
+# CONFIG_MACH_JAZZ is not set
+# CONFIG_LASAT is not set
+# CONFIG_MIPS_ATLAS is not set
+# CONFIG_MIPS_MALTA is not set
+# CONFIG_MIPS_SEAD is not set
+# CONFIG_WR_PPMC is not set
+# CONFIG_MIPS_SIM is not set
+# CONFIG_MOMENCO_JAGUAR_ATX is not set
+# CONFIG_MOMENCO_OCELOT is not set
+# CONFIG_MOMENCO_OCELOT_3 is not set
+# CONFIG_MOMENCO_OCELOT_C is not set
+# CONFIG_MOMENCO_OCELOT_G is not set
+# CONFIG_MIPS_XXS1500 is not set
+# CONFIG_PNX8550_V2PCI is not set
+# CONFIG_PNX8550_JBS is not set
+# CONFIG_DDB5477 is not set
+# CONFIG_MACH_VR41XX is not set
+# CONFIG_PMC_YOSEMITE is not set
+CONFIG_QEMU=y
+# CONFIG_MARKEINS is not set
+# CONFIG_SGI_IP22 is not set
+# CONFIG_SGI_IP27 is not set
+# CONFIG_SGI_IP32 is not set
+# CONFIG_SIBYTE_BIGSUR is not set
+# CONFIG_SIBYTE_SWARM is not set
+# CONFIG_SIBYTE_SENTOSA is not set
+# CONFIG_SIBYTE_RHONE is not set
+# CONFIG_SIBYTE_CARMEL is not set
+# CONFIG_SIBYTE_PTSWARM is not set
+# CONFIG_SIBYTE_LITTLESUR is not set
+# CONFIG_SIBYTE_CRHINE is not set
+# CONFIG_SIBYTE_CRHONE is not set
+# CONFIG_SNI_RM200_PCI is not set
+# CONFIG_TOSHIBA_JMR3927 is not set
+# CONFIG_TOSHIBA_RBTX4927 is not set
+# CONFIG_TOSHIBA_RBTX4938 is not set
+CONFIG_RWSEM_GENERIC_SPINLOCK=y
+CONFIG_GENERIC_FIND_NEXT_BIT=y
+CONFIG_GENERIC_HWEIGHT=y
+CONFIG_GENERIC_CALIBRATE_DELAY=y
+CONFIG_SCHED_NO_NO_OMIT_FRAME_POINTER=y
+CONFIG_DMA_COHERENT=y
+CONFIG_GENERIC_ISA_DMA=y
+CONFIG_I8259=y
+# CONFIG_CPU_BIG_ENDIAN is not set
+CONFIG_CPU_LITTLE_ENDIAN=y
+CONFIG_SYS_SUPPORTS_BIG_ENDIAN=y
+CONFIG_SYS_SUPPORTS_LITTLE_ENDIAN=y
+CONFIG_SWAP_IO_SPACE=y
+CONFIG_MIPS_L1_CACHE_SHIFT=5
+CONFIG_HAVE_STD_PC_SERIAL_PORT=y
+
+#
+# CPU selection
+#
+CONFIG_CPU_MIPS32_R1=y
+# CONFIG_CPU_MIPS32_R2 is not set
+# CONFIG_CPU_MIPS64_R1 is not set
+# CONFIG_CPU_MIPS64_R2 is not set
+# CONFIG_CPU_R3000 is not set
+# CONFIG_CPU_TX39XX is not set
+# CONFIG_CPU_VR41XX is not set
+# CONFIG_CPU_R4300 is not set
+# CONFIG_CPU_R4X00 is not set
+# CONFIG_CPU_TX49XX is not set
+# CONFIG_CPU_R5000 is not set
+# CONFIG_CPU_R5432 is not set
+# CONFIG_CPU_R6000 is not set
+# CONFIG_CPU_NEVADA is not set
+# CONFIG_CPU_R8000 is not set
+# CONFIG_CPU_R10000 is not set
+# CONFIG_CPU_RM7000 is not set
+# CONFIG_CPU_RM9000 is not set
+# CONFIG_CPU_SB1 is not set
+CONFIG_SYS_HAS_CPU_MIPS32_R1=y
+CONFIG_CPU_MIPS32=y
+CONFIG_CPU_MIPSR1=y
+CONFIG_SYS_SUPPORTS_32BIT_KERNEL=y
+CONFIG_CPU_SUPPORTS_32BIT_KERNEL=y
+
+#
+# Kernel type
+#
+CONFIG_32BIT=y
+# CONFIG_64BIT is not set
+CONFIG_PAGE_SIZE_4KB=y
+# CONFIG_PAGE_SIZE_8KB is not set
+# CONFIG_PAGE_SIZE_16KB is not set
+# CONFIG_PAGE_SIZE_64KB is not set
+CONFIG_CPU_HAS_PREFETCH=y
+CONFIG_MIPS_MT_DISABLED=y
+# CONFIG_MIPS_MT_SMTC is not set
+# CONFIG_MIPS_MT_SMP is not set
+# CONFIG_MIPS_VPE_LOADER is not set
+# CONFIG_64BIT_PHYS_ADDR is not set
+CONFIG_CPU_HAS_LLSC=y
+CONFIG_CPU_HAS_SYNC=y
+CONFIG_GENERIC_HARDIRQS=y
+CONFIG_GENERIC_IRQ_PROBE=y
+CONFIG_CPU_SUPPORTS_HIGHMEM=y
+CONFIG_ARCH_FLATMEM_ENABLE=y
+CONFIG_ARCH_SPARSEMEM_ENABLE=y
+CONFIG_SELECT_MEMORY_MODEL=y
+CONFIG_FLATMEM_MANUAL=y
+# CONFIG_DISCONTIGMEM_MANUAL is not set
+# CONFIG_SPARSEMEM_MANUAL is not set
+CONFIG_FLATMEM=y
+CONFIG_FLAT_NODE_MEM_MAP=y
+CONFIG_SPARSEMEM_STATIC=y
+CONFIG_SPLIT_PTLOCK_CPUS=4
+# CONFIG_RESOURCES_64BIT is not set
+# CONFIG_HZ_48 is not set
+# CONFIG_HZ_100 is not set
+# CONFIG_HZ_128 is not set
+CONFIG_HZ_250=y
+# CONFIG_HZ_256 is not set
+# CONFIG_HZ_1000 is not set
+# CONFIG_HZ_1024 is not set
+CONFIG_SYS_SUPPORTS_ARBIT_HZ=y
+CONFIG_HZ=250
+CONFIG_PREEMPT_NONE=y
+# CONFIG_PREEMPT_VOLUNTARY is not set
+# CONFIG_PREEMPT is not set
+CONFIG_DEFCONFIG_LIST="/lib/modules/$UNAME_RELEASE/.config"
+
+#
+# Code maturity level options
+#
+CONFIG_EXPERIMENTAL=y
+CONFIG_BROKEN_ON_SMP=y
+
+#
+# General setup
+#
+CONFIG_LOCALVERSION=""
+CONFIG_LOCALVERSION_AUTO=y
+CONFIG_SWAP=y
+CONFIG_SYSVIPC=y
+CONFIG_POSIX_MQUEUE=y
+# CONFIG_BSD_PROCESS_ACCT is not set
+# CONFIG_TASKSTATS is not set
+CONFIG_AUDIT=y
+CONFIG_IKCONFIG=y
+CONFIG_IKCONFIG_PROC=y
+CONFIG_INITRAMFS_SOURCE=""
+# CONFIG_CC_OPTIMIZE_FOR_SIZE is not set
+CONFIG_EMBEDDED=y
+CONFIG_HOTPLUG=y
+CONFIG_BASE_FULL=y
+CONFIG_SLAB=y
+CONFIG_BASE_SMALL=0
+# CONFIG_SLOB is not set
+
+#
+# Loadable module support
+#
+CONFIG_MODULES=y
+CONFIG_MODULE_UNLOAD=y
+CONFIG_MODULE_FORCE_UNLOAD=y
+CONFIG_MODVERSIONS=y
+# CONFIG_MODULE_SRCVERSION_ALL is not set
+CONFIG_KMOD=y
+
+#
+# Block layer
+#
+# CONFIG_LBD is not set
+# CONFIG_BLK_DEV_IO_TRACE is not set
+# CONFIG_LSF is not set
+
+#
+# IO Schedulers
+#
+CONFIG_IOSCHED_NOOP=y
+CONFIG_IOSCHED_AS=y
+CONFIG_IOSCHED_DEADLINE=y
+CONFIG_IOSCHED_CFQ=y
+# CONFIG_DEFAULT_AS is not set
+# CONFIG_DEFAULT_DEADLINE is not set
+CONFIG_DEFAULT_CFQ=y
+# CONFIG_DEFAULT_NOOP is not set
+CONFIG_DEFAULT_IOSCHED="cfq"
+
+#
+# Bus options (PCI, PCMCIA, EISA, ISA, TC)
+#
+CONFIG_ISA=y
+CONFIG_MMU=y
+CONFIG_I8253=y
+
+#
+# PCCARD (PCMCIA/CardBus) support
+#
+# CONFIG_PCCARD is not set
+
+#
+# PCI Hotplug Support
+#
+
+#
+# Executable file formats
+#
+CONFIG_BINFMT_ELF=y
+CONFIG_BINFMT_MISC=m
+CONFIG_TRAD_SIGNALS=y
+
+#
+# Networking
+#
+CONFIG_NET=y
+
+#
+# Networking options
+#
+CONFIG_PACKET=y
+CONFIG_PACKET_MMAP=y
+CONFIG_UNIX=y
+CONFIG_XFRM=y
+# CONFIG_XFRM_USER is not set
+CONFIG_NET_KEY=m
+CONFIG_INET=y
+CONFIG_IP_MULTICAST=y
+CONFIG_IP_ADVANCED_ROUTER=y
+CONFIG_ASK_IP_FIB_HASH=y
+# CONFIG_IP_FIB_TRIE is not set
+CONFIG_IP_FIB_HASH=y
+CONFIG_IP_MULTIPLE_TABLES=y
+CONFIG_IP_ROUTE_MULTIPATH=y
+CONFIG_IP_ROUTE_VERBOSE=y
+# CONFIG_IP_PNP is not set
+CONFIG_NET_IPIP=m
+CONFIG_NET_IPGRE=m
+CONFIG_NET_IPGRE_BROADCAST=y
+CONFIG_IP_MROUTE=y
+CONFIG_IP_PIMSM_V1=y
+CONFIG_IP_PIMSM_V2=y
+# CONFIG_ARPD is not set
+CONFIG_SYN_COOKIES=y
+CONFIG_INET_AH=m
+CONFIG_INET_ESP=m
+CONFIG_INET_IPCOMP=m
+CONFIG_INET_XFRM_TUNNEL=m
+CONFIG_INET_TUNNEL=m
+CONFIG_INET_XFRM_MODE_TRANSPORT=y
+CONFIG_INET_XFRM_MODE_TUNNEL=y
+CONFIG_INET_DIAG=m
+CONFIG_INET_TCP_DIAG=m
+CONFIG_TCP_CONG_ADVANCED=y
+
+#
+# TCP congestion control
+#
+CONFIG_TCP_CONG_BIC=y
+CONFIG_TCP_CONG_CUBIC=m
+CONFIG_TCP_CONG_WESTWOOD=m
+CONFIG_TCP_CONG_HTCP=m
+CONFIG_TCP_CONG_HSTCP=m
+CONFIG_TCP_CONG_HYBLA=m
+CONFIG_TCP_CONG_VEGAS=m
+CONFIG_TCP_CONG_SCALABLE=m
+# CONFIG_TCP_CONG_LP is not set
+# CONFIG_TCP_CONG_VENO is not set
+
+#
+# IP: Virtual Server Configuration
+#
+CONFIG_IP_VS=m
+# CONFIG_IP_VS_DEBUG is not set
+CONFIG_IP_VS_TAB_BITS=12
+
+#
+# IPVS transport protocol load balancing support
+#
+CONFIG_IP_VS_PROTO_TCP=y
+CONFIG_IP_VS_PROTO_UDP=y
+CONFIG_IP_VS_PROTO_ESP=y
+CONFIG_IP_VS_PROTO_AH=y
+
+#
+# IPVS scheduler
+#
+CONFIG_IP_VS_RR=m
+CONFIG_IP_VS_WRR=m
+CONFIG_IP_VS_LC=m
+CONFIG_IP_VS_WLC=m
+CONFIG_IP_VS_LBLC=m
+CONFIG_IP_VS_LBLCR=m
+CONFIG_IP_VS_DH=m
+CONFIG_IP_VS_SH=m
+CONFIG_IP_VS_SED=m
+CONFIG_IP_VS_NQ=m
+
+#
+# IPVS application helper
+#
+CONFIG_IP_VS_FTP=m
+CONFIG_IPV6=m
+CONFIG_IPV6_PRIVACY=y
+# CONFIG_IPV6_ROUTER_PREF is not set
+CONFIG_INET6_AH=m
+CONFIG_INET6_ESP=m
+CONFIG_INET6_IPCOMP=m
+CONFIG_INET6_XFRM_TUNNEL=m
+CONFIG_INET6_TUNNEL=m
+CONFIG_INET6_XFRM_MODE_TRANSPORT=m
+CONFIG_INET6_XFRM_MODE_TUNNEL=m
+CONFIG_IPV6_TUNNEL=m
+CONFIG_NETWORK_SECMARK=y
+CONFIG_NETFILTER=y
+# CONFIG_NETFILTER_DEBUG is not set
+CONFIG_BRIDGE_NETFILTER=y
+
+#
+# Core Netfilter Configuration
+#
+CONFIG_NETFILTER_NETLINK=m
+CONFIG_NETFILTER_NETLINK_QUEUE=m
+CONFIG_NETFILTER_NETLINK_LOG=m
+CONFIG_NETFILTER_XTABLES=m
+CONFIG_NETFILTER_XT_TARGET_CLASSIFY=m
+CONFIG_NETFILTER_XT_TARGET_CONNMARK=m
+CONFIG_NETFILTER_XT_TARGET_MARK=m
+CONFIG_NETFILTER_XT_TARGET_NFQUEUE=m
+CONFIG_NETFILTER_XT_TARGET_NOTRACK=m
+# CONFIG_NETFILTER_XT_TARGET_SECMARK is not set
+CONFIG_NETFILTER_XT_MATCH_COMMENT=m
+CONFIG_NETFILTER_XT_MATCH_CONNBYTES=m
+CONFIG_NETFILTER_XT_MATCH_CONNMARK=m
+CONFIG_NETFILTER_XT_MATCH_CONNTRACK=m
+CONFIG_NETFILTER_XT_MATCH_DCCP=m
+CONFIG_NETFILTER_XT_MATCH_ESP=m
+CONFIG_NETFILTER_XT_MATCH_HELPER=m
+CONFIG_NETFILTER_XT_MATCH_LENGTH=m
+CONFIG_NETFILTER_XT_MATCH_LIMIT=m
+CONFIG_NETFILTER_XT_MATCH_MAC=m
+CONFIG_NETFILTER_XT_MATCH_MARK=m
+CONFIG_NETFILTER_XT_MATCH_POLICY=m
+CONFIG_NETFILTER_XT_MATCH_MULTIPORT=m
+CONFIG_NETFILTER_XT_MATCH_PHYSDEV=m
+CONFIG_NETFILTER_XT_MATCH_PKTTYPE=m
+# CONFIG_NETFILTER_XT_MATCH_QUOTA is not set
+CONFIG_NETFILTER_XT_MATCH_REALM=m
+CONFIG_NETFILTER_XT_MATCH_SCTP=m
+CONFIG_NETFILTER_XT_MATCH_STATE=m
+# CONFIG_NETFILTER_XT_MATCH_STATISTIC is not set
+CONFIG_NETFILTER_XT_MATCH_STRING=m
+CONFIG_NETFILTER_XT_MATCH_TCPMSS=m
+
+#
+# IP: Netfilter Configuration
+#
+CONFIG_IP_NF_QUEUE=m
+CONFIG_IP_NF_IPTABLES=m
+CONFIG_IP_NF_MATCH_IPRANGE=m
+CONFIG_IP_NF_MATCH_TOS=m
+CONFIG_IP_NF_MATCH_RECENT=m
+CONFIG_IP_NF_MATCH_ECN=m
+CONFIG_IP_NF_MATCH_DSCP=m
+CONFIG_IP_NF_MATCH_AH=m
+CONFIG_IP_NF_MATCH_TTL=m
+CONFIG_IP_NF_MATCH_OWNER=m
+CONFIG_IP_NF_MATCH_ADDRTYPE=m
+CONFIG_IP_NF_MATCH_HASHLIMIT=m
+CONFIG_IP_NF_FILTER=m
+CONFIG_IP_NF_TARGET_REJECT=m
+CONFIG_IP_NF_TARGET_LOG=m
+CONFIG_IP_NF_TARGET_ULOG=m
+CONFIG_IP_NF_TARGET_TCPMSS=m
+CONFIG_IP_NF_TARGET_MASQUERADE=m
+CONFIG_IP_NF_TARGET_REDIRECT=m
+CONFIG_IP_NF_TARGET_NETMAP=m
+CONFIG_IP_NF_TARGET_SAME=m
+CONFIG_IP_NF_MANGLE=m
+CONFIG_IP_NF_TARGET_TOS=m
+CONFIG_IP_NF_TARGET_ECN=m
+CONFIG_IP_NF_TARGET_DSCP=m
+CONFIG_IP_NF_TARGET_TTL=m
+CONFIG_IP_NF_TARGET_CLUSTERIP=m
+CONFIG_IP_NF_RAW=m
+CONFIG_IP_NF_ARPTABLES=m
+CONFIG_IP_NF_ARPFILTER=m
+CONFIG_IP_NF_ARP_MANGLE=m
+
+#
+# IPv6: Netfilter Configuration (EXPERIMENTAL)
+#
+CONFIG_IP6_NF_QUEUE=m
+CONFIG_IP6_NF_IPTABLES=m
+CONFIG_IP6_NF_MATCH_RT=m
+CONFIG_IP6_NF_MATCH_OPTS=m
+CONFIG_IP6_NF_MATCH_FRAG=m
+CONFIG_IP6_NF_MATCH_HL=m
+CONFIG_IP6_NF_MATCH_OWNER=m
+CONFIG_IP6_NF_MATCH_IPV6HEADER=m
+CONFIG_IP6_NF_MATCH_AH=m
+CONFIG_IP6_NF_MATCH_EUI64=m
+CONFIG_IP6_NF_FILTER=m
+CONFIG_IP6_NF_TARGET_LOG=m
+CONFIG_IP6_NF_TARGET_REJECT=m
+CONFIG_IP6_NF_MANGLE=m
+CONFIG_IP6_NF_TARGET_HL=m
+CONFIG_IP6_NF_RAW=m
+
+#
+# Bridge: Netfilter Configuration
+#
+CONFIG_BRIDGE_NF_EBTABLES=m
+CONFIG_BRIDGE_EBT_BROUTE=m
+CONFIG_BRIDGE_EBT_T_FILTER=m
+CONFIG_BRIDGE_EBT_T_NAT=m
+CONFIG_BRIDGE_EBT_802_3=m
+CONFIG_BRIDGE_EBT_AMONG=m
+CONFIG_BRIDGE_EBT_ARP=m
+CONFIG_BRIDGE_EBT_IP=m
+CONFIG_BRIDGE_EBT_LIMIT=m
+CONFIG_BRIDGE_EBT_MARK=m
+CONFIG_BRIDGE_EBT_PKTTYPE=m
+CONFIG_BRIDGE_EBT_STP=m
+CONFIG_BRIDGE_EBT_VLAN=m
+CONFIG_BRIDGE_EBT_ARPREPLY=m
+CONFIG_BRIDGE_EBT_DNAT=m
+CONFIG_BRIDGE_EBT_MARK_T=m
+CONFIG_BRIDGE_EBT_REDIRECT=m
+CONFIG_BRIDGE_EBT_SNAT=m
+CONFIG_BRIDGE_EBT_LOG=m
+CONFIG_BRIDGE_EBT_ULOG=m
+
+#
+# DCCP Configuration (EXPERIMENTAL)
+#
+CONFIG_IP_DCCP=m
+CONFIG_INET_DCCP_DIAG=m
+CONFIG_IP_DCCP_ACKVEC=y
+
+#
+# DCCP CCIDs Configuration (EXPERIMENTAL)
+#
+CONFIG_IP_DCCP_CCID2=m
+CONFIG_IP_DCCP_CCID3=m
+CONFIG_IP_DCCP_TFRC_LIB=m
+
+#
+# SCTP Configuration (EXPERIMENTAL)
+#
+CONFIG_IP_SCTP=m
+# CONFIG_SCTP_DBG_MSG is not set
+# CONFIG_SCTP_DBG_OBJCNT is not set
+# CONFIG_SCTP_HMAC_NONE is not set
+# CONFIG_SCTP_HMAC_SHA1 is not set
+CONFIG_SCTP_HMAC_MD5=y
+
+#
+# TIPC Configuration (EXPERIMENTAL)
+#
+CONFIG_TIPC=m
+CONFIG_TIPC_ADVANCED=y
+CONFIG_TIPC_ZONES=3
+CONFIG_TIPC_CLUSTERS=1
+CONFIG_TIPC_NODES=255
+CONFIG_TIPC_SLAVE_NODES=0
+CONFIG_TIPC_PORTS=8191
+CONFIG_TIPC_LOG=0
+# CONFIG_TIPC_DEBUG is not set
+# CONFIG_ATM is not set
+CONFIG_BRIDGE=m
+CONFIG_VLAN_8021Q=m
+# CONFIG_DECNET is not set
+CONFIG_LLC=m
+# CONFIG_LLC2 is not set
+# CONFIG_IPX is not set
+# CONFIG_ATALK is not set
+# CONFIG_X25 is not set
+# CONFIG_LAPB is not set
+# CONFIG_ECONET is not set
+# CONFIG_WAN_ROUTER is not set
+
+#
+# Network testing
+#
+# CONFIG_HAMRADIO is not set
+# CONFIG_IRDA is not set
+# CONFIG_BT is not set
+# CONFIG_IEEE80211 is not set
+
+#
+# Device Drivers
+#
+
+#
+# Generic Driver Options
+#
+# CONFIG_STANDALONE is not set
+# CONFIG_PREVENT_FIRMWARE_BUILD is not set
+CONFIG_FW_LOADER=m
+# CONFIG_SYS_HYPERVISOR is not set
+
+#
+# Connector - unified userspace <-> kernelspace linker
+#
+# CONFIG_CONNECTOR is not set
+
+#
+# Memory Technology Devices (MTD)
+#
+# CONFIG_MTD is not set
+
+#
+# Parallel port support
+#
+# CONFIG_PARPORT is not set
+
+#
+# Plug and Play support
+#
+CONFIG_PNP=y
+# CONFIG_PNP_DEBUG is not set
+
+#
+# Protocols
+#
+CONFIG_ISAPNP=y
+
+#
+# Block devices
+#
+# CONFIG_BLK_DEV_COW_COMMON is not set
+CONFIG_BLK_DEV_LOOP=m
+CONFIG_BLK_DEV_CRYPTOLOOP=m
+# CONFIG_BLK_DEV_NBD is not set
+CONFIG_BLK_DEV_RAM=y
+CONFIG_BLK_DEV_RAM_COUNT=16
+CONFIG_BLK_DEV_RAM_SIZE=8192
+CONFIG_BLK_DEV_RAM_BLOCKSIZE=1024
+CONFIG_BLK_DEV_INITRD=y
+CONFIG_CDROM_PKTCDVD=m
+CONFIG_CDROM_PKTCDVD_BUFFERS=8
+# CONFIG_CDROM_PKTCDVD_WCACHE is not set
+CONFIG_ATA_OVER_ETH=m
+
+#
+# ATA/ATAPI/MFM/RLL support
+#
+CONFIG_IDE=y
+CONFIG_BLK_DEV_IDE=y
+
+#
+# Please see Documentation/ide.txt for help/info on IDE drives
+#
+# CONFIG_BLK_DEV_IDE_SATA is not set
+CONFIG_BLK_DEV_IDEDISK=y
+CONFIG_IDEDISK_MULTI_MODE=y
+CONFIG_BLK_DEV_IDECD=m
+# CONFIG_BLK_DEV_IDETAPE is not set
+# CONFIG_BLK_DEV_IDEFLOPPY is not set
+# CONFIG_IDE_TASK_IOCTL is not set
+
+#
+# IDE chipset support/bugfixes
+#
+CONFIG_IDE_GENERIC=y
+# CONFIG_BLK_DEV_IDEPNP is not set
+# CONFIG_IDE_ARM is not set
+# CONFIG_IDE_CHIPSETS is not set
+# CONFIG_BLK_DEV_IDEDMA is not set
+# CONFIG_BLK_DEV_HD is not set
+
+#
+# SCSI device support
+#
+# CONFIG_RAID_ATTRS is not set
+# CONFIG_SCSI is not set
+
+#
+# Serial ATA (prod) and Parallel ATA (experimental) drivers
+#
+# CONFIG_ATA is not set
+
+#
+# Multi-device support (RAID and LVM)
+#
+CONFIG_MD=y
+CONFIG_BLK_DEV_MD=m
+CONFIG_MD_LINEAR=m
+CONFIG_MD_RAID0=m
+CONFIG_MD_RAID1=m
+CONFIG_MD_RAID10=m
+CONFIG_MD_RAID456=m
+CONFIG_MD_RAID5_RESHAPE=y
+CONFIG_MD_MULTIPATH=m
+CONFIG_MD_FAULTY=m
+CONFIG_BLK_DEV_DM=m
+CONFIG_DM_CRYPT=m
+CONFIG_DM_SNAPSHOT=m
+CONFIG_DM_MIRROR=m
+CONFIG_DM_ZERO=m
+CONFIG_DM_MULTIPATH=m
+# CONFIG_DM_MULTIPATH_EMC is not set
+
+#
+# Fusion MPT device support
+#
+# CONFIG_FUSION is not set
+
+#
+# IEEE 1394 (FireWire) support
+#
+
+#
+# I2O device support
+#
+
+#
+# Network device support
+#
+CONFIG_NETDEVICES=y
+# CONFIG_IFB is not set
+# CONFIG_DUMMY is not set
+CONFIG_BONDING=m
+# CONFIG_EQUALIZER is not set
+CONFIG_TUN=m
+# CONFIG_NET_SB1000 is not set
+
+#
+# ARCnet devices
+#
+# CONFIG_ARCNET is not set
+
+#
+# PHY device support
+#
+# CONFIG_PHYLIB is not set
+
+#
+# Ethernet (10 or 100Mbit)
+#
+CONFIG_NET_ETHERNET=y
+CONFIG_MII=y
+# CONFIG_NET_VENDOR_3COM is not set
+# CONFIG_NET_VENDOR_SMC is not set
+# CONFIG_DM9000 is not set
+# CONFIG_NET_VENDOR_RACAL is not set
+# CONFIG_AT1700 is not set
+# CONFIG_DEPCA is not set
+# CONFIG_HP100 is not set
+CONFIG_NET_ISA=y
+# CONFIG_E2100 is not set
+# CONFIG_EWRK3 is not set
+# CONFIG_EEXPRESS is not set
+# CONFIG_EEXPRESS_PRO is not set
+# CONFIG_HPLAN_PLUS is not set
+# CONFIG_HPLAN is not set
+# CONFIG_LP486E is not set
+# CONFIG_ETH16I is not set
+CONFIG_NE2000=y
+# CONFIG_SEEQ8005 is not set
+# CONFIG_NET_PCI is not set
+
+#
+# Ethernet (1000 Mbit)
+#
+
+#
+# Ethernet (10000 Mbit)
+#
+
+#
+# Token Ring devices
+#
+# CONFIG_TR is not set
+
+#
+# Wireless LAN (non-hamradio)
+#
+# CONFIG_NET_RADIO is not set
+
+#
+# Wan interfaces
+#
+# CONFIG_WAN is not set
+CONFIG_PPP=m
+CONFIG_PPP_MULTILINK=y
+CONFIG_PPP_FILTER=y
+CONFIG_PPP_ASYNC=m
+CONFIG_PPP_SYNC_TTY=m
+CONFIG_PPP_DEFLATE=m
+CONFIG_PPP_BSDCOMP=m
+CONFIG_PPP_MPPE=m
+CONFIG_PPPOE=m
+CONFIG_SLIP=m
+CONFIG_SLIP_COMPRESSED=y
+CONFIG_SLIP_SMART=y
+CONFIG_SLIP_MODE_SLIP6=y
+# CONFIG_SHAPER is not set
+CONFIG_NETCONSOLE=m
+CONFIG_NETPOLL=y
+# CONFIG_NETPOLL_TRAP is not set
+CONFIG_NET_POLL_CONTROLLER=y
+
+#
+# ISDN subsystem
+#
+# CONFIG_ISDN is not set
+
+#
+# Telephony Support
+#
+# CONFIG_PHONE is not set
+
+#
+# Input device support
+#
+CONFIG_INPUT=y
+
+#
+# Userland interfaces
+#
+CONFIG_INPUT_MOUSEDEV=m
+CONFIG_INPUT_MOUSEDEV_PSAUX=y
+CONFIG_INPUT_MOUSEDEV_SCREEN_X=1024
+CONFIG_INPUT_MOUSEDEV_SCREEN_Y=768
+# CONFIG_INPUT_JOYDEV is not set
+# CONFIG_INPUT_TSDEV is not set
+CONFIG_INPUT_EVDEV=m
+# CONFIG_INPUT_EVBUG is not set
+
+#
+# Input Device Drivers
+#
+CONFIG_INPUT_KEYBOARD=y
+CONFIG_KEYBOARD_ATKBD=m
+# CONFIG_KEYBOARD_SUNKBD is not set
+# CONFIG_KEYBOARD_LKKBD is not set
+# CONFIG_KEYBOARD_XTKBD is not set
+# CONFIG_KEYBOARD_NEWTON is not set
+CONFIG_INPUT_MOUSE=y
+CONFIG_MOUSE_PS2=m
+# CONFIG_MOUSE_SERIAL is not set
+# CONFIG_MOUSE_INPORT is not set
+# CONFIG_MOUSE_LOGIBM is not set
+# CONFIG_MOUSE_PC110PAD is not set
+# CONFIG_MOUSE_VSXXXAA is not set
+# CONFIG_INPUT_JOYSTICK is not set
+# CONFIG_INPUT_TOUCHSCREEN is not set
+CONFIG_INPUT_MISC=y
+# CONFIG_INPUT_PCSPKR is not set
+CONFIG_INPUT_UINPUT=m
+
+#
+# Hardware I/O ports
+#
+CONFIG_SERIO=m
+CONFIG_SERIO_I8042=m
+CONFIG_SERIO_SERPORT=m
+CONFIG_SERIO_LIBPS2=m
+# CONFIG_SERIO_RAW is not set
+# CONFIG_GAMEPORT is not set
+
+#
+# Character devices
+#
+CONFIG_VT=y
+CONFIG_VT_CONSOLE=y
+CONFIG_HW_CONSOLE=y
+# CONFIG_VT_HW_CONSOLE_BINDING is not set
+# CONFIG_SERIAL_NONSTANDARD is not set
+
+#
+# Serial drivers
+#
+CONFIG_SERIAL_8250=y
+CONFIG_SERIAL_8250_CONSOLE=y
+CONFIG_SERIAL_8250_PNP=y
+CONFIG_SERIAL_8250_NR_UARTS=4
+CONFIG_SERIAL_8250_RUNTIME_UARTS=4
+# CONFIG_SERIAL_8250_EXTENDED is not set
+
+#
+# Non-8250 serial port support
+#
+CONFIG_SERIAL_CORE=y
+CONFIG_SERIAL_CORE_CONSOLE=y
+
+#
+# IPMI
+#
+# CONFIG_IPMI_HANDLER is not set
+
+#
+# Watchdog Cards
+#
+# CONFIG_WATCHDOG is not set
+# CONFIG_HW_RANDOM is not set
+CONFIG_RTC=y
+# CONFIG_DTLK is not set
+# CONFIG_R3964 is not set
+
+#
+# Ftape, the floppy tape device driver
+#
+# CONFIG_RAW_DRIVER is not set
+
+#
+# TPM devices
+#
+# CONFIG_TCG_TPM is not set
+# CONFIG_TELCLOCK is not set
+
+#
+# I2C support
+#
+# CONFIG_I2C is not set
+
+#
+# SPI support
+#
+# CONFIG_SPI is not set
+# CONFIG_SPI_MASTER is not set
+
+#
+# Dallas's 1-wire bus
+#
+
+#
+# Hardware Monitoring support
+#
+# CONFIG_HWMON is not set
+# CONFIG_HWMON_VID is not set
+
+#
+# Misc devices
+#
+
+#
+# Multimedia devices
+#
+# CONFIG_VIDEO_DEV is not set
+
+#
+# Digital Video Broadcasting Devices
+#
+# CONFIG_DVB is not set
+
+#
+# Graphics support
+#
+# CONFIG_FIRMWARE_EDID is not set
+# CONFIG_FB is not set
+
+#
+# Console display driver support
+#
+CONFIG_VGA_CONSOLE=y
+# CONFIG_VGACON_SOFT_SCROLLBACK is not set
+# CONFIG_MDA_CONSOLE is not set
+CONFIG_DUMMY_CONSOLE=y
+# CONFIG_BACKLIGHT_LCD_SUPPORT is not set
+
+#
+# Sound
+#
+# CONFIG_SOUND is not set
+
+#
+# USB support
+#
+# CONFIG_USB_ARCH_HAS_HCD is not set
+# CONFIG_USB_ARCH_HAS_OHCI is not set
+# CONFIG_USB_ARCH_HAS_EHCI is not set
+
+#
+# NOTE: USB_STORAGE enables SCSI, and 'SCSI disk support'
+#
+
+#
+# USB Gadget Support
+#
+# CONFIG_USB_GADGET is not set
+
+#
+# MMC/SD Card support
+#
+# CONFIG_MMC is not set
+
+#
+# LED devices
+#
+# CONFIG_NEW_LEDS is not set
+
+#
+# LED drivers
+#
+
+#
+# LED Triggers
+#
+
+#
+# InfiniBand support
+#
+
+#
+# EDAC - error detection and reporting (RAS) (EXPERIMENTAL)
+#
+
+#
+# Real Time Clock
+#
+CONFIG_RTC_LIB=m
+CONFIG_RTC_CLASS=m
+
+#
+# RTC interfaces
+#
+CONFIG_RTC_INTF_SYSFS=y
+CONFIG_RTC_INTF_PROC=y
+CONFIG_RTC_INTF_DEV=y
+# CONFIG_RTC_INTF_DEV_UIE_EMUL is not set
+
+#
+# RTC drivers
+#
+# CONFIG_RTC_DRV_DS1553 is not set
+# CONFIG_RTC_DRV_DS1742 is not set
+# CONFIG_RTC_DRV_M48T86 is not set
+# CONFIG_RTC_DRV_TEST is not set
+# CONFIG_RTC_DRV_V3020 is not set
+
+#
+# DMA Engine support
+#
+# CONFIG_DMA_ENGINE is not set
+
+#
+# DMA Clients
+#
+
+#
+# DMA Devices
+#
+
+#
+# File systems
+#
+CONFIG_EXT2_FS=y
+CONFIG_EXT2_FS_XATTR=y
+CONFIG_EXT2_FS_POSIX_ACL=y
+CONFIG_EXT2_FS_SECURITY=y
+# CONFIG_EXT2_FS_XIP is not set
+CONFIG_EXT3_FS=y
+CONFIG_EXT3_FS_XATTR=y
+CONFIG_EXT3_FS_POSIX_ACL=y
+CONFIG_EXT3_FS_SECURITY=y
+CONFIG_JBD=y
+# CONFIG_JBD_DEBUG is not set
+CONFIG_FS_MBCACHE=y
+CONFIG_REISERFS_FS=m
+# CONFIG_REISERFS_CHECK is not set
+# CONFIG_REISERFS_PROC_INFO is not set
+CONFIG_REISERFS_FS_XATTR=y
+CONFIG_REISERFS_FS_POSIX_ACL=y
+CONFIG_REISERFS_FS_SECURITY=y
+CONFIG_JFS_FS=m
+CONFIG_JFS_POSIX_ACL=y
+CONFIG_JFS_SECURITY=y
+# CONFIG_JFS_DEBUG is not set
+# CONFIG_JFS_STATISTICS is not set
+CONFIG_FS_POSIX_ACL=y
+CONFIG_XFS_FS=m
+CONFIG_XFS_QUOTA=y
+CONFIG_XFS_SECURITY=y
+CONFIG_XFS_POSIX_ACL=y
+CONFIG_XFS_RT=y
+CONFIG_OCFS2_FS=m
+CONFIG_OCFS2_DEBUG_MASKLOG=y
+CONFIG_MINIX_FS=m
+CONFIG_ROMFS_FS=m
+CONFIG_INOTIFY=y
+CONFIG_INOTIFY_USER=y
+CONFIG_QUOTA=y
+CONFIG_QFMT_V1=m
+CONFIG_QFMT_V2=m
+CONFIG_QUOTACTL=y
+CONFIG_DNOTIFY=y
+CONFIG_AUTOFS_FS=m
+CONFIG_AUTOFS4_FS=m
+CONFIG_FUSE_FS=m
+
+#
+# CD-ROM/DVD Filesystems
+#
+CONFIG_ISO9660_FS=m
+CONFIG_JOLIET=y
+CONFIG_ZISOFS=y
+CONFIG_UDF_FS=m
+CONFIG_UDF_NLS=y
+
+#
+# DOS/FAT/NT Filesystems
+#
+CONFIG_FAT_FS=m
+CONFIG_MSDOS_FS=m
+CONFIG_VFAT_FS=m
+CONFIG_FAT_DEFAULT_CODEPAGE=437
+CONFIG_FAT_DEFAULT_IOCHARSET="iso8859-1"
+CONFIG_NTFS_FS=m
+# CONFIG_NTFS_DEBUG is not set
+CONFIG_NTFS_RW=y
+
+#
+# Pseudo filesystems
+#
+CONFIG_PROC_FS=y
+CONFIG_PROC_KCORE=y
+CONFIG_SYSFS=y
+CONFIG_TMPFS=y
+CONFIG_RAMFS=y
+CONFIG_CONFIGFS_FS=m
+
+#
+# Miscellaneous filesystems
+#
+# CONFIG_ADFS_FS is not set
+# CONFIG_AFFS_FS is not set
+# CONFIG_HFS_FS is not set
+# CONFIG_HFSPLUS_FS is not set
+# CONFIG_BEFS_FS is not set
+# CONFIG_BFS_FS is not set
+# CONFIG_EFS_FS is not set
+CONFIG_CRAMFS=y
+# CONFIG_VXFS_FS is not set
+# CONFIG_HPFS_FS is not set
+# CONFIG_QNX4FS_FS is not set
+# CONFIG_SYSV_FS is not set
+CONFIG_UFS_FS=m
+# CONFIG_UFS_FS_WRITE is not set
+# CONFIG_UFS_DEBUG is not set
+
+#
+# Network File Systems
+#
+CONFIG_NFS_FS=m
+CONFIG_NFS_V3=y
+CONFIG_NFS_V3_ACL=y
+CONFIG_NFS_V4=y
+CONFIG_NFS_DIRECTIO=y
+CONFIG_NFSD=m
+CONFIG_NFSD_V2_ACL=y
+CONFIG_NFSD_V3=y
+CONFIG_NFSD_V3_ACL=y
+CONFIG_NFSD_V4=y
+CONFIG_NFSD_TCP=y
+CONFIG_LOCKD=m
+CONFIG_LOCKD_V4=y
+CONFIG_EXPORTFS=m
+CONFIG_NFS_ACL_SUPPORT=m
+CONFIG_NFS_COMMON=y
+CONFIG_SUNRPC=m
+CONFIG_SUNRPC_GSS=m
+CONFIG_RPCSEC_GSS_KRB5=m
+CONFIG_RPCSEC_GSS_SPKM3=m
+CONFIG_SMB_FS=m
+# CONFIG_SMB_NLS_DEFAULT is not set
+CONFIG_CIFS=m
+CONFIG_CIFS_STATS=y
+# CONFIG_CIFS_STATS2 is not set
+# CONFIG_CIFS_WEAK_PW_HASH is not set
+# CONFIG_CIFS_XATTR is not set
+# CONFIG_CIFS_DEBUG2 is not set
+# CONFIG_CIFS_EXPERIMENTAL is not set
+# CONFIG_NCP_FS is not set
+# CONFIG_CODA_FS is not set
+# CONFIG_AFS_FS is not set
+# CONFIG_9P_FS is not set
+
+#
+# Partition Types
+#
+# CONFIG_PARTITION_ADVANCED is not set
+CONFIG_MSDOS_PARTITION=y
+
+#
+# Native Language Support
+#
+CONFIG_NLS=y
+CONFIG_NLS_DEFAULT="iso8859-1"
+CONFIG_NLS_CODEPAGE_437=m
+CONFIG_NLS_CODEPAGE_737=m
+CONFIG_NLS_CODEPAGE_775=m
+CONFIG_NLS_CODEPAGE_850=m
+CONFIG_NLS_CODEPAGE_852=m
+CONFIG_NLS_CODEPAGE_855=m
+CONFIG_NLS_CODEPAGE_857=m
+CONFIG_NLS_CODEPAGE_860=m
+CONFIG_NLS_CODEPAGE_861=m
+CONFIG_NLS_CODEPAGE_862=m
+CONFIG_NLS_CODEPAGE_863=m
+CONFIG_NLS_CODEPAGE_864=m
+CONFIG_NLS_CODEPAGE_865=m
+CONFIG_NLS_CODEPAGE_866=m
+CONFIG_NLS_CODEPAGE_869=m
+CONFIG_NLS_CODEPAGE_936=m
+CONFIG_NLS_CODEPAGE_950=m
+CONFIG_NLS_CODEPAGE_932=m
+CONFIG_NLS_CODEPAGE_949=m
+CONFIG_NLS_CODEPAGE_874=m
+CONFIG_NLS_ISO8859_8=m
+CONFIG_NLS_CODEPAGE_1250=m
+CONFIG_NLS_CODEPAGE_1251=m
+CONFIG_NLS_ASCII=m
+CONFIG_NLS_ISO8859_1=m
+CONFIG_NLS_ISO8859_2=m
+CONFIG_NLS_ISO8859_3=m
+CONFIG_NLS_ISO8859_4=m
+CONFIG_NLS_ISO8859_5=m
+CONFIG_NLS_ISO8859_6=m
+CONFIG_NLS_ISO8859_7=m
+CONFIG_NLS_ISO8859_9=m
+CONFIG_NLS_ISO8859_13=m
+CONFIG_NLS_ISO8859_14=m
+CONFIG_NLS_ISO8859_15=m
+CONFIG_NLS_KOI8_R=m
+CONFIG_NLS_KOI8_U=m
+CONFIG_NLS_UTF8=m
+
+#
+# Profiling support
+#
+# CONFIG_PROFILING is not set
+
+#
+# Kernel hacking
+#
+CONFIG_TRACE_IRQFLAGS_SUPPORT=y
+# CONFIG_PRINTK_TIME is not set
+CONFIG_MAGIC_SYSRQ=y
+# CONFIG_UNUSED_SYMBOLS is not set
+# CONFIG_DEBUG_KERNEL is not set
+CONFIG_LOG_BUF_SHIFT=14
+# CONFIG_DEBUG_FS is not set
+# CONFIG_CROSSCOMPILE is not set
+CONFIG_CMDLINE=""
+
+#
+# Security options
+#
+CONFIG_KEYS=y
+# CONFIG_KEYS_DEBUG_PROC_KEYS is not set
+CONFIG_SECURITY=y
+CONFIG_SECURITY_NETWORK=y
+CONFIG_SECURITY_NETWORK_XFRM=y
+CONFIG_SECURITY_CAPABILITIES=y
+# CONFIG_SECURITY_SECLVL is not set
+CONFIG_SECURITY_SELINUX=y
+CONFIG_SECURITY_SELINUX_BOOTPARAM=y
+CONFIG_SECURITY_SELINUX_BOOTPARAM_VALUE=0
+CONFIG_SECURITY_SELINUX_DISABLE=y
+CONFIG_SECURITY_SELINUX_DEVELOP=y
+CONFIG_SECURITY_SELINUX_AVC_STATS=y
+CONFIG_SECURITY_SELINUX_CHECKREQPROT_VALUE=1
+# CONFIG_SECURITY_SELINUX_ENABLE_SECMARK_DEFAULT is not set
+
+#
+# Cryptographic options
+#
+CONFIG_CRYPTO=y
+CONFIG_CRYPTO_HMAC=y
+CONFIG_CRYPTO_NULL=m
+CONFIG_CRYPTO_MD4=m
+CONFIG_CRYPTO_MD5=y
+CONFIG_CRYPTO_SHA1=m
+CONFIG_CRYPTO_SHA256=m
+CONFIG_CRYPTO_SHA512=m
+CONFIG_CRYPTO_WP512=m
+CONFIG_CRYPTO_TGR192=m
+CONFIG_CRYPTO_DES=m
+CONFIG_CRYPTO_BLOWFISH=m
+CONFIG_CRYPTO_TWOFISH=m
+CONFIG_CRYPTO_SERPENT=m
+CONFIG_CRYPTO_AES=m
+CONFIG_CRYPTO_CAST5=m
+CONFIG_CRYPTO_CAST6=m
+CONFIG_CRYPTO_TEA=m
+CONFIG_CRYPTO_ARC4=m
+CONFIG_CRYPTO_KHAZAD=m
+CONFIG_CRYPTO_ANUBIS=m
+CONFIG_CRYPTO_DEFLATE=m
+CONFIG_CRYPTO_MICHAEL_MIC=m
+CONFIG_CRYPTO_CRC32C=m
+CONFIG_CRYPTO_TEST=m
+
+#
+# Hardware crypto devices
+#
+
+#
+# Library routines
+#
+CONFIG_CRC_CCITT=m
+CONFIG_CRC16=m
+CONFIG_CRC32=m
+CONFIG_LIBCRC32C=m
+CONFIG_ZLIB_INFLATE=y
+CONFIG_ZLIB_DEFLATE=m
+CONFIG_TEXTSEARCH=y
+CONFIG_TEXTSEARCH_KMP=m
+CONFIG_TEXTSEARCH_BM=m
+CONFIG_TEXTSEARCH_FSM=m
+CONFIG_PLIST=y

Added: dists/sid/linux-2.6/debian/config/mipsel/config.r5k-cobalt
==============================================================================
--- (empty file)
+++ dists/sid/linux-2.6/debian/config/mipsel/config.r5k-cobalt	Mon Nov 26 20:06:56 2007
@@ -0,0 +1,1192 @@
+#
+# Machine selection
+#
+# CONFIG_MIPS_MTX1 is not set
+# CONFIG_MIPS_BOSPORUS is not set
+# CONFIG_MIPS_PB1000 is not set
+# CONFIG_MIPS_PB1100 is not set
+# CONFIG_MIPS_PB1500 is not set
+# CONFIG_MIPS_PB1550 is not set
+# CONFIG_MIPS_PB1200 is not set
+# CONFIG_MIPS_DB1000 is not set
+# CONFIG_MIPS_DB1100 is not set
+# CONFIG_MIPS_DB1500 is not set
+# CONFIG_MIPS_DB1550 is not set
+# CONFIG_MIPS_DB1200 is not set
+# CONFIG_MIPS_MIRAGE is not set
+CONFIG_MIPS_COBALT=y
+# CONFIG_MACH_DECSTATION is not set
+# CONFIG_MIPS_EV64120 is not set
+# CONFIG_MIPS_EV96100 is not set
+# CONFIG_MIPS_IVR is not set
+# CONFIG_MIPS_ITE8172 is not set
+# CONFIG_MACH_JAZZ is not set
+# CONFIG_LASAT is not set
+# CONFIG_MIPS_ATLAS is not set
+# CONFIG_MIPS_MALTA is not set
+# CONFIG_MIPS_SEAD is not set
+# CONFIG_MIPS_SIM is not set
+# CONFIG_MOMENCO_JAGUAR_ATX is not set
+# CONFIG_MOMENCO_OCELOT is not set
+# CONFIG_MOMENCO_OCELOT_3 is not set
+# CONFIG_MOMENCO_OCELOT_C is not set
+# CONFIG_MOMENCO_OCELOT_G is not set
+# CONFIG_MIPS_XXS1500 is not set
+# CONFIG_PNX8550_V2PCI is not set
+# CONFIG_PNX8550_JBS is not set
+# CONFIG_DDB5074 is not set
+# CONFIG_DDB5476 is not set
+# CONFIG_DDB5477 is not set
+# CONFIG_MACH_VR41XX is not set
+# CONFIG_PMC_YOSEMITE is not set
+# CONFIG_QEMU is not set
+# CONFIG_SGI_IP22 is not set
+# CONFIG_SGI_IP27 is not set
+# CONFIG_SGI_IP32 is not set
+# CONFIG_SIBYTE_BIGSUR is not set
+# CONFIG_SIBYTE_SWARM is not set
+# CONFIG_SIBYTE_SENTOSA is not set
+# CONFIG_SIBYTE_RHONE is not set
+# CONFIG_SIBYTE_CARMEL is not set
+# CONFIG_SIBYTE_PTSWARM is not set
+# CONFIG_SIBYTE_LITTLESUR is not set
+# CONFIG_SIBYTE_CRHINE is not set
+# CONFIG_SIBYTE_CRHONE is not set
+# CONFIG_SNI_RM200_PCI is not set
+# CONFIG_TOSHIBA_JMR3927 is not set
+# CONFIG_TOSHIBA_RBTX4927 is not set
+# CONFIG_TOSHIBA_RBTX4938 is not set
+CONFIG_RWSEM_GENERIC_SPINLOCK=y
+CONFIG_GENERIC_CALIBRATE_DELAY=y
+CONFIG_DMA_NONCOHERENT=y
+CONFIG_DMA_NEED_PCI_MAP_STATE=y
+CONFIG_I8259=y
+# CONFIG_CPU_BIG_ENDIAN is not set
+CONFIG_CPU_LITTLE_ENDIAN=y
+CONFIG_SYS_SUPPORTS_LITTLE_ENDIAN=y
+CONFIG_IRQ_CPU=y
+CONFIG_PCI_GT64XXX_PCI0=y
+CONFIG_MIPS_L1_CACHE_SHIFT=5
+
+#
+# CPU selection
+#
+# CONFIG_CPU_MIPS32_R1 is not set
+# CONFIG_CPU_MIPS32_R2 is not set
+# CONFIG_CPU_MIPS64_R1 is not set
+# CONFIG_CPU_MIPS64_R2 is not set
+# CONFIG_CPU_R3000 is not set
+# CONFIG_CPU_TX39XX is not set
+# CONFIG_CPU_VR41XX is not set
+# CONFIG_CPU_R4300 is not set
+# CONFIG_CPU_R4X00 is not set
+# CONFIG_CPU_TX49XX is not set
+# CONFIG_CPU_R5000 is not set
+# CONFIG_CPU_R5432 is not set
+# CONFIG_CPU_R6000 is not set
+CONFIG_CPU_NEVADA=y
+# CONFIG_CPU_R8000 is not set
+# CONFIG_CPU_R10000 is not set
+# CONFIG_CPU_RM7000 is not set
+# CONFIG_CPU_RM9000 is not set
+# CONFIG_CPU_SB1 is not set
+CONFIG_SYS_HAS_CPU_NEVADA=y
+CONFIG_SYS_SUPPORTS_32BIT_KERNEL=y
+CONFIG_SYS_SUPPORTS_64BIT_KERNEL=y
+CONFIG_CPU_SUPPORTS_32BIT_KERNEL=y
+CONFIG_CPU_SUPPORTS_64BIT_KERNEL=y
+
+#
+# Kernel type
+#
+CONFIG_32BIT=y
+# CONFIG_64BIT is not set
+CONFIG_PAGE_SIZE_4KB=y
+# CONFIG_PAGE_SIZE_8KB is not set
+# CONFIG_PAGE_SIZE_16KB is not set
+# CONFIG_PAGE_SIZE_64KB is not set
+# CONFIG_MIPS_MT is not set
+# CONFIG_CPU_ADVANCED is not set
+CONFIG_CPU_HAS_LLSC=y
+CONFIG_CPU_HAS_SYNC=y
+CONFIG_GENERIC_HARDIRQS=y
+CONFIG_GENERIC_IRQ_PROBE=y
+CONFIG_ARCH_FLATMEM_ENABLE=y
+CONFIG_SELECT_MEMORY_MODEL=y
+CONFIG_FLATMEM_MANUAL=y
+# CONFIG_DISCONTIGMEM_MANUAL is not set
+# CONFIG_SPARSEMEM_MANUAL is not set
+CONFIG_FLATMEM=y
+CONFIG_FLAT_NODE_MEM_MAP=y
+# CONFIG_SPARSEMEM_STATIC is not set
+CONFIG_SPLIT_PTLOCK_CPUS=4
+CONFIG_PREEMPT_NONE=y
+# CONFIG_PREEMPT_VOLUNTARY is not set
+# CONFIG_PREEMPT is not set
+
+#
+# Code maturity level options
+#
+CONFIG_EXPERIMENTAL=y
+CONFIG_BROKEN_ON_SMP=y
+
+#
+# General setup
+#
+CONFIG_LOCALVERSION=""
+CONFIG_LOCALVERSION_AUTO=y
+CONFIG_SWAP=y
+CONFIG_SYSVIPC=y
+CONFIG_POSIX_MQUEUE=y
+# CONFIG_BSD_PROCESS_ACCT is not set
+CONFIG_AUDIT=y
+CONFIG_IKCONFIG=y
+CONFIG_IKCONFIG_PROC=y
+CONFIG_INITRAMFS_SOURCE=""
+# CONFIG_CC_OPTIMIZE_FOR_SIZE is not set
+CONFIG_EMBEDDED=y
+CONFIG_HOTPLUG=y
+CONFIG_BASE_FULL=y
+CONFIG_CC_ALIGN_FUNCTIONS=0
+CONFIG_CC_ALIGN_LABELS=0
+CONFIG_CC_ALIGN_LOOPS=0
+CONFIG_CC_ALIGN_JUMPS=0
+CONFIG_SLAB=y
+CONFIG_BASE_SMALL=0
+# CONFIG_SLOB is not set
+
+#
+# Loadable module support
+#
+CONFIG_MODULES=y
+CONFIG_OBSOLETE_MODPARM=y
+CONFIG_KMOD=y
+
+#
+# Block layer
+#
+# CONFIG_LBD is not set
+
+#
+# Bus options (PCI, PCMCIA, EISA, ISA, TC)
+#
+CONFIG_HW_HAS_PCI=y
+CONFIG_PCI=y
+CONFIG_MMU=y
+
+#
+# PCCARD (PCMCIA/CardBus) support
+#
+# CONFIG_PCCARD is not set
+
+#
+# PCI Hotplug Support
+#
+# CONFIG_HOTPLUG_PCI is not set
+
+#
+# Executable file formats
+#
+CONFIG_BINFMT_ELF=y
+CONFIG_BINFMT_MISC=m
+CONFIG_TRAD_SIGNALS=y
+
+#
+# Networking
+#
+CONFIG_NET=y
+
+#
+# DCCP Configuration (EXPERIMENTAL)
+#
+# CONFIG_IP_DCCP is not set
+
+#
+# SCTP Configuration (EXPERIMENTAL)
+#
+# CONFIG_IP_SCTP is not set
+
+#
+# TIPC Configuration (EXPERIMENTAL)
+#
+CONFIG_TIPC=m
+CONFIG_TIPC_ADVANCED=y
+CONFIG_TIPC_ZONES=3
+CONFIG_TIPC_CLUSTERS=1
+CONFIG_TIPC_NODES=255
+CONFIG_TIPC_SLAVE_NODES=0
+CONFIG_TIPC_PORTS=8191
+CONFIG_TIPC_LOG=0
+# CONFIG_TIPC_DEBUG is not set
+# CONFIG_ATM is not set
+# CONFIG_BRIDGE is not set
+# CONFIG_VLAN_8021Q is not set
+# CONFIG_DECNET is not set
+# CONFIG_LLC2 is not set
+# CONFIG_IPX is not set
+# CONFIG_ATALK is not set
+# CONFIG_X25 is not set
+# CONFIG_LAPB is not set
+# CONFIG_NET_DIVERT is not set
+# CONFIG_ECONET is not set
+# CONFIG_WAN_ROUTER is not set
+
+#
+# QoS and/or fair queueing
+#
+# CONFIG_NET_SCHED is not set
+
+#
+# Network testing
+#
+# CONFIG_HAMRADIO is not set
+# CONFIG_IRDA is not set
+# CONFIG_BT is not set
+CONFIG_IEEE80211=m
+# CONFIG_IEEE80211_DEBUG is not set
+CONFIG_IEEE80211_CRYPT_WEP=m
+# CONFIG_IEEE80211_CRYPT_CCMP is not set
+# CONFIG_IEEE80211_CRYPT_TKIP is not set
+
+#
+# Device Drivers
+#
+
+#
+# Generic Driver Options
+#
+# CONFIG_STANDALONE is not set
+# CONFIG_PREVENT_FIRMWARE_BUILD is not set
+CONFIG_FW_LOADER=m
+
+#
+# Connector - unified userspace <-> kernelspace linker
+#
+# CONFIG_CONNECTOR is not set
+CONFIG_MTD=y
+# CONFIG_MTD_DEBUG is not set
+# CONFIG_MTD_CONCAT is not set
+CONFIG_MTD_PARTITIONS=y
+# CONFIG_MTD_REDBOOT_PARTS is not set
+# CONFIG_MTD_CMDLINE_PARTS is not set
+
+#
+# User Modules And Translation Layers
+#
+CONFIG_MTD_CHAR=y
+CONFIG_MTD_BLKDEVS=y
+# CONFIG_MTD_BLOCK is not set
+# CONFIG_MTD_BLOCK_RO is not set
+# CONFIG_FTL is not set
+# CONFIG_NFTL is not set
+# CONFIG_INFTL is not set
+# CONFIG_RFD_FTL is not set
+# CONFIG_SSFDC is not set
+
+#
+# RAM/ROM/Flash chip drivers
+#
+# CONFIG_MTD_CFI is not set
+CONFIG_MTD_JEDECPROBE=y
+CONFIG_MTD_GEN_PROBE=y
+# CONFIG_MTD_CFI_ADV_OPTIONS is not set
+CONFIG_MTD_MAP_BANK_WIDTH_1=y
+CONFIG_MTD_MAP_BANK_WIDTH_2=y
+CONFIG_MTD_MAP_BANK_WIDTH_4=y
+# CONFIG_MTD_MAP_BANK_WIDTH_8 is not set
+# CONFIG_MTD_MAP_BANK_WIDTH_16 is not set
+# CONFIG_MTD_MAP_BANK_WIDTH_32 is not set
+CONFIG_MTD_CFI_I1=y
+CONFIG_MTD_CFI_I2=y
+# CONFIG_MTD_CFI_I4 is not set
+# CONFIG_MTD_CFI_I8 is not set
+# CONFIG_MTD_CFI_INTELEXT is not set
+CONFIG_MTD_CFI_AMDSTD=y
+# CONFIG_MTD_CFI_STAA is not set
+CONFIG_MTD_CFI_UTIL=y
+# CONFIG_MTD_RAM is not set
+# CONFIG_MTD_ROM is not set
+# CONFIG_MTD_ABSENT is not set
+
+#
+# Mapping drivers for chip access
+#
+# CONFIG_MTD_COMPLEX_MAPPINGS is not set
+CONFIG_MTD_PHYSMAP=y
+CONFIG_MTD_PHYSMAP_START=0x0
+CONFIG_MTD_PHYSMAP_LEN=0x0
+CONFIG_MTD_PHYSMAP_BANKWIDTH=0
+# CONFIG_MTD_PLATRAM is not set
+
+#
+# Self-contained MTD device drivers
+#
+# CONFIG_MTD_PMC551 is not set
+# CONFIG_MTD_DATAFLASH is not set
+# CONFIG_MTD_M25P80 is not set
+# CONFIG_MTD_SLRAM is not set
+# CONFIG_MTD_PHRAM is not set
+# CONFIG_MTD_MTDRAM is not set
+# CONFIG_MTD_BLOCK2MTD is not set
+
+#
+# Disk-On-Chip Device Drivers
+#
+# CONFIG_MTD_DOC2000 is not set
+# CONFIG_MTD_DOC2001 is not set
+# CONFIG_MTD_DOC2001PLUS is not set
+# CONFIG_MTD_NAND is not set
+# CONFIG_MTD_ONENAND is not set
+
+#
+# UBI - Unsorted block images
+#
+# CONFIG_MTD_UBI is not set
+
+#
+# Parallel port support
+#
+
+#
+# Plug and Play support
+#
+
+#
+# Block devices
+#
+# CONFIG_PARIDE is not set
+# CONFIG_BLK_CPQ_DA is not set
+# CONFIG_BLK_CPQ_CISS_DA is not set
+# CONFIG_BLK_DEV_DAC960 is not set
+# CONFIG_BLK_DEV_UMEM is not set
+# CONFIG_BLK_DEV_COW_COMMON is not set
+CONFIG_BLK_DEV_LOOP=m
+CONFIG_BLK_DEV_CRYPTOLOOP=m
+# CONFIG_BLK_DEV_NBD is not set
+# CONFIG_BLK_DEV_SX8 is not set
+# CONFIG_BLK_DEV_UB is not set
+CONFIG_BLK_DEV_RAM=y
+CONFIG_BLK_DEV_RAM_COUNT=16
+CONFIG_BLK_DEV_RAM_SIZE=8192
+CONFIG_BLK_DEV_INITRD=y
+# CONFIG_CDROM_PKTCDVD is not set
+# CONFIG_ATA_OVER_ETH is not set
+
+#
+# ATA/ATAPI/MFM/RLL support
+#
+CONFIG_IDE=y
+CONFIG_BLK_DEV_IDE=y
+
+#
+# Please see Documentation/ide.txt for help/info on IDE drives
+#
+# CONFIG_BLK_DEV_IDE_SATA is not set
+CONFIG_BLK_DEV_IDEDISK=y
+# CONFIG_IDEDISK_MULTI_MODE is not set
+# CONFIG_BLK_DEV_IDECD is not set
+# CONFIG_BLK_DEV_IDETAPE is not set
+# CONFIG_BLK_DEV_IDEFLOPPY is not set
+# CONFIG_BLK_DEV_IDESCSI is not set
+
+#
+# IDE chipset support/bugfixes
+#
+CONFIG_IDE_GENERIC=y
+CONFIG_BLK_DEV_IDEPCI=y
+CONFIG_IDEPCI_SHARE_IRQ=y
+# CONFIG_BLK_DEV_OFFBOARD is not set
+# CONFIG_BLK_DEV_GENERIC is not set
+# CONFIG_BLK_DEV_OPTI621 is not set
+CONFIG_BLK_DEV_IDEDMA_PCI=y
+# CONFIG_BLK_DEV_IDEDMA_FORCED is not set
+# CONFIG_BLK_DEV_AEC62XX is not set
+# CONFIG_BLK_DEV_ALI15X3 is not set
+# CONFIG_BLK_DEV_AMD74XX is not set
+# CONFIG_BLK_DEV_CMD64X is not set
+# CONFIG_BLK_DEV_TRIFLEX is not set
+# CONFIG_BLK_DEV_CY82C693 is not set
+# CONFIG_BLK_DEV_CS5520 is not set
+# CONFIG_BLK_DEV_CS5530 is not set
+# CONFIG_BLK_DEV_HPT34X is not set
+# CONFIG_BLK_DEV_HPT366 is not set
+# CONFIG_BLK_DEV_SC1200 is not set
+# CONFIG_BLK_DEV_PIIX is not set
+# CONFIG_BLK_DEV_IT821X is not set
+# CONFIG_BLK_DEV_NS87415 is not set
+# CONFIG_BLK_DEV_PDC202XX_OLD is not set
+# CONFIG_BLK_DEV_PDC202XX_NEW is not set
+# CONFIG_BLK_DEV_SVWKS is not set
+# CONFIG_BLK_DEV_SIIMAGE is not set
+# CONFIG_BLK_DEV_SLC90E66 is not set
+# CONFIG_BLK_DEV_TRM290 is not set
+CONFIG_BLK_DEV_VIA82CXXX=y
+# CONFIG_IDE_ARM is not set
+CONFIG_BLK_DEV_IDEDMA=y
+# CONFIG_IDEDMA_IVB is not set
+# CONFIG_BLK_DEV_HD is not set
+
+#
+# Some SCSI devices (e.g. CD jukebox) support multiple LUNs
+#
+# CONFIG_SCSI_MULTI_LUN is not set
+# CONFIG_SCSI_CONSTANTS is not set
+# CONFIG_SCSI_LOGGING is not set
+
+#
+# Fusion MPT device support
+#
+# CONFIG_FUSION is not set
+# CONFIG_FUSION_SPI is not set
+# CONFIG_FUSION_FC is not set
+# CONFIG_FUSION_SAS is not set
+
+#
+# IEEE 1394 (FireWire) support
+#
+# CONFIG_FIREWIRE is not set
+
+#
+# I2O device support
+#
+# CONFIG_I2O is not set
+
+#
+# Network device support
+#
+CONFIG_NETDEVICES=y
+# CONFIG_DUMMY is not set
+CONFIG_BONDING=m
+# CONFIG_EQUALIZER is not set
+CONFIG_TUN=m
+
+#
+# ARCnet devices
+#
+# CONFIG_ARCNET is not set
+
+#
+# PHY device support
+#
+# CONFIG_PHYLIB is not set
+
+#
+# Ethernet (10 or 100Mbit)
+#
+CONFIG_NET_ETHERNET=y
+CONFIG_MII=y
+# CONFIG_HAPPYMEAL is not set
+# CONFIG_SUNGEM is not set
+# CONFIG_CASSINI is not set
+# CONFIG_NET_VENDOR_3COM is not set
+# CONFIG_DM9000 is not set
+
+#
+# Tulip family network device support
+#
+CONFIG_NET_TULIP=y
+CONFIG_DE2104X=y
+CONFIG_TULIP=y
+CONFIG_TULIP_MWI=y
+CONFIG_TULIP_MWI_DC21143=y
+CONFIG_TULIP_MMIO=y
+# CONFIG_TULIP_NAPI is not set
+# CONFIG_DE4X5 is not set
+# CONFIG_WINBOND_840 is not set
+# CONFIG_DM9102 is not set
+# CONFIG_ULI526X is not set
+# CONFIG_HP100 is not set
+CONFIG_NET_PCI=y
+CONFIG_PCNET32=m
+CONFIG_AMD8111_ETH=m
+# CONFIG_AMD8111E_NAPI is not set
+CONFIG_ADAPTEC_STARFIRE=m
+# CONFIG_ADAPTEC_STARFIRE_NAPI is not set
+CONFIG_B44=m
+# CONFIG_FORCEDETH is not set
+# CONFIG_EEPRO100 is not set
+CONFIG_E100=m
+CONFIG_FEALNX=m
+CONFIG_NATSEMI=m
+CONFIG_NE2K_PCI=m
+CONFIG_8139CP=m
+CONFIG_8139TOO=m
+CONFIG_8139TOO_PIO=y
+# CONFIG_8139TOO_TUNE_TWISTER is not set
+# CONFIG_8139TOO_8129 is not set
+# CONFIG_8139_OLD_RX_RESET is not set
+CONFIG_SIS900=m
+CONFIG_EPIC100=m
+CONFIG_SUNDANCE=m
+# CONFIG_SUNDANCE_MMIO is not set
+# CONFIG_TLAN is not set
+CONFIG_VIA_RHINE=m
+# CONFIG_VIA_RHINE_MMIO is not set
+# CONFIG_LAN_SAA9730 is not set
+# CONFIG_NET_POCKET is not set
+
+#
+# Ethernet (1000 Mbit)
+#
+# CONFIG_DL2K is not set
+# CONFIG_E1000 is not set
+# CONFIG_NS83820 is not set
+# CONFIG_HAMACHI is not set
+# CONFIG_YELLOWFIN is not set
+# CONFIG_R8169 is not set
+# CONFIG_SIS190 is not set
+# CONFIG_SKGE is not set
+# CONFIG_SKY2 is not set
+# CONFIG_VIA_VELOCITY is not set
+# CONFIG_TIGON3 is not set
+# CONFIG_BNX2 is not set
+
+#
+# Ethernet (10000 Mbit)
+#
+# CONFIG_CHELSIO_T1 is not set
+# CONFIG_IXGB is not set
+# CONFIG_S2IO is not set
+
+#
+# Token Ring devices
+#
+# CONFIG_TR is not set
+
+#
+# Wireless LAN (non-hamradio)
+#
+CONFIG_WLAN_PRE80211=y
+# CONFIG_STRIP is not set
+CONFIG_WLAN_80211=y
+
+#
+# Wireless 802.11b ISA/PCI cards support
+#
+CONFIG_IPW2100=m
+# CONFIG_IPW2100_MONITOR is not set
+# CONFIG_IPW2100_DEBUG is not set
+CONFIG_IPW2200=m
+# CONFIG_IPW2200_DEBUG is not set
+CONFIG_HERMES=m
+CONFIG_PLX_HERMES=m
+CONFIG_TMD_HERMES=m
+CONFIG_NORTEL_HERMES=m
+CONFIG_PCI_HERMES=m
+CONFIG_ATMEL=m
+CONFIG_PCI_ATMEL=m
+
+#
+# Prism GT/Duette 802.11(a/b/g) PCI/Cardbus support
+#
+# CONFIG_PRISM54 is not set
+CONFIG_HOSTAP=m
+CONFIG_HOSTAP_FIRMWARE=y
+# CONFIG_HOSTAP_FIRMWARE_NVRAM is not set
+CONFIG_HOSTAP_PLX=m
+CONFIG_HOSTAP_PCI=m
+
+#
+# Wan interfaces
+#
+# CONFIG_WAN is not set
+# CONFIG_FDDI is not set
+# CONFIG_HIPPI is not set
+CONFIG_PLIP=m
+CONFIG_PPP=m
+CONFIG_PPP_MULTILINK=y
+CONFIG_PPP_FILTER=y
+CONFIG_PPP_ASYNC=m
+CONFIG_PPP_SYNC_TTY=m
+CONFIG_PPP_DEFLATE=m
+CONFIG_PPP_BSDCOMP=m
+CONFIG_PPP_MPPE=m
+CONFIG_PPPOE=m
+CONFIG_SLIP=m
+CONFIG_SLIP_COMPRESSED=y
+CONFIG_SLIP_SMART=y
+CONFIG_SLIP_MODE_SLIP6=y
+# CONFIG_NET_FC is not set
+# CONFIG_SHAPER is not set
+CONFIG_NETCONSOLE=m
+CONFIG_NETPOLL=y
+# CONFIG_NETPOLL_TRAP is not set
+CONFIG_NET_POLL_CONTROLLER=y
+
+#
+# ISDN subsystem
+#
+CONFIG_ISDN=m
+
+#
+# Old ISDN4Linux
+#
+# CONFIG_ISDN_I4L is not set
+
+#
+# CAPI subsystem
+#
+CONFIG_ISDN_CAPI=m
+CONFIG_ISDN_DRV_AVMB1_VERBOSE_REASON=y
+CONFIG_ISDN_CAPI_MIDDLEWARE=y
+CONFIG_ISDN_CAPI_CAPI20=m
+CONFIG_ISDN_CAPI_CAPIFS_BOOL=y
+CONFIG_ISDN_CAPI_CAPIFS=m
+
+#
+# CAPI hardware drivers
+#
+
+#
+# Active AVM cards
+#
+CONFIG_CAPI_AVM=y
+CONFIG_ISDN_DRV_AVMB1_B1PCI=m
+CONFIG_ISDN_DRV_AVMB1_B1PCIV4=y
+CONFIG_ISDN_DRV_AVMB1_B1PCMCIA=m
+CONFIG_ISDN_DRV_AVMB1_T1PCI=m
+CONFIG_ISDN_DRV_AVMB1_C4=m
+
+#
+# Active Eicon DIVA Server cards
+#
+CONFIG_CAPI_EICON=y
+CONFIG_ISDN_DIVAS=m
+CONFIG_ISDN_DIVAS_BRIPCI=y
+CONFIG_ISDN_DIVAS_PRIPCI=y
+CONFIG_ISDN_DIVAS_DIVACAPI=m
+CONFIG_ISDN_DIVAS_USERIDI=m
+CONFIG_ISDN_DIVAS_MAINT=m
+
+#
+# Telephony Support
+#
+# CONFIG_PHONE is not set
+
+#
+# Input device support
+#
+CONFIG_INPUT=y
+
+#
+# Userland interfaces
+#
+CONFIG_INPUT_MOUSEDEV=m
+CONFIG_INPUT_MOUSEDEV_PSAUX=y
+CONFIG_INPUT_MOUSEDEV_SCREEN_X=1024
+CONFIG_INPUT_MOUSEDEV_SCREEN_Y=768
+# CONFIG_INPUT_JOYDEV is not set
+# CONFIG_INPUT_TSDEV is not set
+CONFIG_INPUT_EVDEV=m
+
+#
+# Input Device Drivers
+#
+CONFIG_INPUT_KEYBOARD=y
+CONFIG_KEYBOARD_ATKBD=m
+# CONFIG_KEYBOARD_SUNKBD is not set
+# CONFIG_KEYBOARD_LKKBD is not set
+# CONFIG_KEYBOARD_XTKBD is not set
+# CONFIG_KEYBOARD_NEWTON is not set
+CONFIG_INPUT_MOUSE=y
+CONFIG_MOUSE_PS2=m
+# CONFIG_MOUSE_SERIAL is not set
+# CONFIG_MOUSE_VSXXXAA is not set
+# CONFIG_INPUT_JOYSTICK is not set
+# CONFIG_INPUT_TOUCHSCREEN is not set
+CONFIG_INPUT_MISC=y
+# CONFIG_INPUT_PCSPKR is not set
+
+#
+# Hardware I/O ports
+#
+CONFIG_SERIO=m
+CONFIG_SERIO_I8042=m
+CONFIG_SERIO_SERPORT=m
+# CONFIG_SERIO_PARKBD is not set
+# CONFIG_SERIO_PCIPS2 is not set
+CONFIG_SERIO_LIBPS2=m
+# CONFIG_SERIO_RAW is not set
+# CONFIG_GAMEPORT is not set
+
+#
+# Character devices
+#
+# CONFIG_VT is not set
+# CONFIG_SERIAL_NONSTANDARD is not set
+
+#
+# Serial drivers
+#
+CONFIG_SERIAL_8250=y
+CONFIG_SERIAL_8250_CONSOLE=y
+CONFIG_SERIAL_8250_NR_UARTS=4
+CONFIG_SERIAL_8250_RUNTIME_UARTS=4
+# CONFIG_SERIAL_8250_EXTENDED is not set
+
+#
+# Non-8250 serial port support
+#
+CONFIG_SERIAL_CORE=y
+CONFIG_SERIAL_CORE_CONSOLE=y
+# CONFIG_SERIAL_JSM is not set
+# CONFIG_PRINTER is not set
+# CONFIG_PPDEV is not set
+# CONFIG_TIPAR is not set
+
+#
+# IPMI
+#
+# CONFIG_IPMI_HANDLER is not set
+
+#
+# Watchdog Cards
+#
+# CONFIG_WATCHDOG is not set
+# CONFIG_RTC is not set
+# CONFIG_GEN_RTC is not set
+CONFIG_COBALT_LCD=y
+# CONFIG_DTLK is not set
+# CONFIG_R3964 is not set
+# CONFIG_APPLICOM is not set
+
+#
+# Ftape, the floppy tape device driver
+#
+# CONFIG_DRM is not set
+# CONFIG_RAW_DRIVER is not set
+
+#
+# TPM devices
+#
+# CONFIG_TCG_TPM is not set
+# CONFIG_TELCLOCK is not set
+
+#
+# I2C support
+#
+# CONFIG_I2C is not set
+
+#
+# SPI support
+#
+CONFIG_SPI=y
+CONFIG_SPI_MASTER=y
+
+#
+# SPI Master Controller Drivers
+#
+CONFIG_SPI_BITBANG=m
+# CONFIG_SPI_BUTTERFLY is not set
+
+#
+# SPI Protocol Masters
+#
+
+#
+# Dallas's 1-wire bus
+#
+# CONFIG_W1 is not set
+
+#
+# Hardware Monitoring support
+#
+# CONFIG_HWMON is not set
+# CONFIG_HWMON_VID is not set
+
+#
+# Misc devices
+#
+
+#
+# Multimedia Capabilities Port drivers
+#
+
+#
+# Multimedia devices
+#
+CONFIG_VIDEO_DEV=m
+
+#
+# Video For Linux
+#
+
+#
+# Video Adapters
+#
+# CONFIG_VIDEO_ADV_DEBUG is not set
+# CONFIG_VIDEO_BWQCAM is not set
+# CONFIG_VIDEO_CQCAM is not set
+# CONFIG_VIDEO_W9966 is not set
+# CONFIG_VIDEO_CPIA is not set
+# CONFIG_VIDEO_STRADIS is not set
+# CONFIG_VIDEO_MXB is not set
+# CONFIG_VIDEO_DPC is not set
+# CONFIG_VIDEO_HEXIUM_ORION is not set
+# CONFIG_VIDEO_HEXIUM_GEMINI is not set
+
+#
+# Radio Adapters
+#
+# CONFIG_RADIO_GEMTEK_PCI is not set
+# CONFIG_RADIO_MAXIRADIO is not set
+# CONFIG_RADIO_MAESTRO is not set
+
+#
+# Digital Video Broadcasting Devices
+#
+# CONFIG_DVB is not set
+
+#
+# Graphics support
+#
+# CONFIG_FB is not set
+
+#
+# Sound
+#
+CONFIG_SOUND=m
+
+#
+# Advanced Linux Sound Architecture
+#
+CONFIG_SND=m
+CONFIG_SND_TIMER=m
+CONFIG_SND_PCM=m
+CONFIG_SND_HWDEP=m
+CONFIG_SND_RAWMIDI=m
+CONFIG_SND_SEQUENCER=m
+# CONFIG_SND_SEQ_DUMMY is not set
+CONFIG_SND_OSSEMUL=y
+CONFIG_SND_MIXER_OSS=m
+CONFIG_SND_PCM_OSS=m
+# CONFIG_SND_SEQUENCER_OSS is not set
+CONFIG_SND_RTCTIMER=m
+CONFIG_SND_SEQ_RTCTIMER_DEFAULT=y
+# CONFIG_SND_DYNAMIC_MINORS is not set
+CONFIG_SND_SUPPORT_OLD_API=y
+# CONFIG_SND_VERBOSE_PRINTK is not set
+# CONFIG_SND_DEBUG is not set
+
+#
+# Generic devices
+#
+CONFIG_SND_MPU401_UART=m
+CONFIG_SND_OPL3_LIB=m
+CONFIG_SND_VX_LIB=m
+CONFIG_SND_AC97_CODEC=m
+CONFIG_SND_AC97_BUS=m
+# CONFIG_SND_DUMMY is not set
+# CONFIG_SND_VIRMIDI is not set
+# CONFIG_SND_MTPAV is not set
+# CONFIG_SND_SERIAL_U16550 is not set
+# CONFIG_SND_MPU401 is not set
+
+#
+# PCI devices
+#
+CONFIG_SND_AD1889=m
+CONFIG_SND_ALI5451=m
+CONFIG_SND_ATIIXP=m
+CONFIG_SND_ATIIXP_MODEM=m
+CONFIG_SND_AU8810=m
+CONFIG_SND_AU8820=m
+CONFIG_SND_AU8830=m
+CONFIG_SND_AZT3328=m
+CONFIG_SND_BT87X=m
+# CONFIG_SND_BT87X_OVERCLOCK is not set
+CONFIG_SND_CA0106=m
+CONFIG_SND_CMIPCI=m
+CONFIG_SND_CS4281=m
+CONFIG_SND_CS46XX=m
+# CONFIG_SND_CS46XX_NEW_DSP is not set
+CONFIG_SND_EMU10K1=m
+CONFIG_SND_EMU10K1X=m
+CONFIG_SND_ENS1370=m
+CONFIG_SND_ENS1371=m
+CONFIG_SND_ES1938=m
+CONFIG_SND_ES1968=m
+CONFIG_SND_FM801=m
+CONFIG_SND_FM801_TEA575X_BOOL=y
+CONFIG_SND_FM801_TEA575X=m
+CONFIG_SND_HDA_INTEL=m
+CONFIG_SND_HDSP=m
+CONFIG_SND_HDSPM=m
+CONFIG_SND_ICE1712=m
+CONFIG_SND_ICE1724=m
+CONFIG_SND_INTEL8X0=m
+CONFIG_SND_INTEL8X0M=m
+CONFIG_SND_KORG1212=m
+CONFIG_SND_MAESTRO3=m
+CONFIG_SND_MIXART=m
+CONFIG_SND_NM256=m
+CONFIG_SND_PCXHR=m
+CONFIG_SND_RME32=m
+CONFIG_SND_RME96=m
+CONFIG_SND_RME9652=m
+CONFIG_SND_SONICVIBES=m
+CONFIG_SND_TRIDENT=m
+CONFIG_SND_VIA82XX=m
+CONFIG_SND_VIA82XX_MODEM=m
+CONFIG_SND_VX222=m
+CONFIG_SND_YMFPCI=m
+
+#
+# ALSA MIPS devices
+#
+
+#
+# USB devices
+#
+CONFIG_SND_USB_AUDIO=m
+# CONFIG_USB_W9968CF is not set
+
+#
+# Open Sound System
+#
+# CONFIG_SOUND_PRIME is not set
+CONFIG_SOUND_EMU10K1=m
+
+#
+# USB support
+#
+CONFIG_USB_ARCH_HAS_HCD=y
+CONFIG_USB_ARCH_HAS_OHCI=y
+CONFIG_USB=m
+# CONFIG_USB_DEBUG is not set
+
+#
+# Miscellaneous USB options
+#
+# CONFIG_USB_DEVICEFS is not set
+# CONFIG_USB_DYNAMIC_MINORS is not set
+# CONFIG_USB_OTG is not set
+
+#
+# USB Host Controller Drivers
+#
+CONFIG_USB_EHCI_HCD=m
+# CONFIG_USB_EHCI_SPLIT_ISO is not set
+# CONFIG_USB_EHCI_ROOT_HUB_TT is not set
+CONFIG_USB_ISP116X_HCD=m
+CONFIG_USB_OHCI_HCD=m
+CONFIG_USB_OHCI_LITTLE_ENDIAN=y
+CONFIG_USB_UHCI_HCD=m
+CONFIG_USB_SL811_HCD=m
+
+#
+# USB Device Class drivers
+#
+# CONFIG_OBSOLETE_OSS_USB_DRIVER is not set
+CONFIG_USB_ACM=m
+CONFIG_USB_PRINTER=m
+
+#
+# NOTE: USB_STORAGE enables SCSI, and 'SCSI disk support'
+#
+
+#
+# may also be needed; see USB_STORAGE Help for more information
+#
+CONFIG_USB_STORAGE=m
+# CONFIG_USB_STORAGE_DEBUG is not set
+# CONFIG_USB_STORAGE_DATAFAB is not set
+# CONFIG_USB_STORAGE_FREECOM is not set
+# CONFIG_USB_STORAGE_ISD200 is not set
+# CONFIG_USB_STORAGE_DPCM is not set
+# CONFIG_USB_STORAGE_USBAT is not set
+# CONFIG_USB_STORAGE_SDDR09 is not set
+# CONFIG_USB_STORAGE_SDDR55 is not set
+# CONFIG_USB_STORAGE_JUMPSHOT is not set
+CONFIG_USB_STORAGE_ALAUDA=y
+# CONFIG_USB_STORAGE_ONETOUCH is not set
+# CONFIG_USB_LIBUSUAL is not set
+
+#
+# USB Input Devices
+#
+# CONFIG_USB_HID is not set
+
+#
+# USB HID Boot Protocol drivers
+#
+# CONFIG_USB_KBD is not set
+# CONFIG_USB_MOUSE is not set
+
+#
+# USB Imaging devices
+#
+# CONFIG_USB_MDC800 is not set
+# CONFIG_USB_MICROTEK is not set
+
+#
+# USB Multimedia devices
+#
+# CONFIG_USB_VICAM is not set
+# CONFIG_USB_DSBR is not set
+CONFIG_USB_ET61X251=m
+# CONFIG_USB_IBMCAM is not set
+# CONFIG_USB_KONICAWC is not set
+# CONFIG_USB_OV511 is not set
+# CONFIG_USB_SE401 is not set
+# CONFIG_USB_SN9C102 is not set
+# CONFIG_USB_STV680 is not set
+# CONFIG_USB_PWC is not set
+
+#
+# USB Network Adapters
+#
+CONFIG_USB_CATC=m
+CONFIG_USB_KAWETH=m
+CONFIG_USB_PEGASUS=m
+CONFIG_USB_RTL8150=m
+CONFIG_USB_USBNET=m
+CONFIG_USB_NET_AX8817X=m
+CONFIG_USB_NET_CDCETHER=m
+CONFIG_USB_NET_GL620A=m
+CONFIG_USB_NET_NET1080=m
+CONFIG_USB_NET_PLUSB=m
+CONFIG_USB_NET_RNDIS_HOST=m
+CONFIG_USB_NET_CDC_SUBSET=m
+CONFIG_USB_ALI_M5632=y
+CONFIG_USB_AN2720=y
+CONFIG_USB_BELKIN=y
+CONFIG_USB_ARMLINUX=y
+# CONFIG_USB_EPSON2888 is not set
+CONFIG_USB_NET_ZAURUS=m
+CONFIG_USB_ZD1201=m
+CONFIG_USB_MON=y
+
+#
+# USB port drivers
+#
+# CONFIG_USB_USS720 is not set
+
+#
+# USB Miscellaneous drivers
+#
+# CONFIG_USB_AUERSWALD is not set
+# CONFIG_USB_RIO500 is not set
+# CONFIG_USB_LEGOTOWER is not set
+# CONFIG_USB_LCD is not set
+# CONFIG_USB_LED is not set
+# CONFIG_USB_CYTHERM is not set
+# CONFIG_USB_PHIDGETKIT is not set
+# CONFIG_USB_PHIDGETSERVO is not set
+# CONFIG_USB_IDMOUSE is not set
+CONFIG_USB_SISUSBVGA=m
+# CONFIG_USB_LD is not set
+
+#
+# USB DSL modem support
+#
+
+#
+# USB Gadget Support
+#
+# CONFIG_USB_GADGET is not set
+
+#
+# MMC/SD Card support
+#
+# CONFIG_MMC is not set
+
+CONFIG_NEW_LEDS=y
+CONFIG_LEDS_CLASS=y
+
+#
+# LED drivers
+#
+CONFIG_LEDS_COBALT=y
+
+#
+# InfiniBand support
+#
+# CONFIG_INFINIBAND is not set
+
+#
+# SN Devices
+#
+
+#
+# EDAC - error detection and reporting (RAS)
+#
+
+# Real Time Clock
+
+CONFIG_RTC_LIB=y
+CONFIG_RTC_CLASS=y
+CONFIG_RTC_HCTOSYS=y
+CONFIG_RTC_HCTOSYS_DEVICE="rtc0"
+# CONFIG_RTC_DEBUG is not set
+
+#
+# RTC interfaces
+#
+CONFIG_RTC_INTF_SYSFS=y
+CONFIG_RTC_INTF_PROC=y
+CONFIG_RTC_INTF_DEV=y
+# CONFIG_RTC_INTF_DEV_UIE_EMUL is not set
+
+#
+# RTC drivers
+#
+CONFIG_RTC_DRV_CMOS=y
+# CONFIG_RTC_DRV_DS1553 is not set
+# CONFIG_RTC_DRV_DS1742 is not set
+# CONFIG_RTC_DRV_M48T86 is not set
+# CONFIG_RTC_DRV_TEST is not set
+# CONFIG_RTC_DRV_V3020 is not set
+
+#
+# File systems
+#
+CONFIG_EXT2_FS=y
+CONFIG_EXT2_FS_XATTR=y
+CONFIG_EXT2_FS_POSIX_ACL=y
+CONFIG_EXT2_FS_SECURITY=y
+# CONFIG_EXT2_FS_XIP is not set
+CONFIG_EXT3_FS=y
+CONFIG_EXT3_FS_XATTR=y
+CONFIG_EXT3_FS_POSIX_ACL=y
+CONFIG_EXT3_FS_SECURITY=y
+CONFIG_JBD=y
+# CONFIG_JBD_DEBUG is not set
+CONFIG_FS_MBCACHE=y
+
+CONFIG_CRAMFS=y
+
+CONFIG_MSDOS_PARTITION=y
+
+#
+# Profiling support
+#
+# CONFIG_PROFILING is not set
+
+#
+# Kernel hacking
+#
+# CONFIG_PRINTK_TIME is not set
+CONFIG_MAGIC_SYSRQ=y
+# CONFIG_DEBUG_KERNEL is not set
+CONFIG_LOG_BUF_SHIFT=14
+# CONFIG_CROSSCOMPILE is not set
+CONFIG_CMDLINE=""
+
+#
+# Hardware crypto devices
+#
+
+#
+# Library routines
+#
+CONFIG_CRC_CCITT=m
+# CONFIG_CRC16 is not set
+CONFIG_CRC32=y
+CONFIG_LIBCRC32C=m
+CONFIG_ZLIB_INFLATE=y
+CONFIG_ZLIB_DEFLATE=m
+CONFIG_TEXTSEARCH=y
+CONFIG_TEXTSEARCH_KMP=m
+CONFIG_TEXTSEARCH_BM=m
+CONFIG_TEXTSEARCH_FSM=m

Added: dists/sid/linux-2.6/debian/config/mipsel/config.sb1-bcm91250a
==============================================================================
--- (empty file)
+++ dists/sid/linux-2.6/debian/config/mipsel/config.sb1-bcm91250a	Mon Nov 26 20:06:56 2007
@@ -0,0 +1,1713 @@
+#
+# Machine selection
+#
+# CONFIG_MIPS_MTX1 is not set
+# CONFIG_MIPS_BOSPORUS is not set
+# CONFIG_MIPS_PB1000 is not set
+# CONFIG_MIPS_PB1100 is not set
+# CONFIG_MIPS_PB1500 is not set
+# CONFIG_MIPS_PB1550 is not set
+# CONFIG_MIPS_PB1200 is not set
+# CONFIG_MIPS_DB1000 is not set
+# CONFIG_MIPS_DB1100 is not set
+# CONFIG_MIPS_DB1500 is not set
+# CONFIG_MIPS_DB1550 is not set
+# CONFIG_MIPS_DB1200 is not set
+# CONFIG_MIPS_MIRAGE is not set
+# CONFIG_MIPS_COBALT is not set
+# CONFIG_MACH_DECSTATION is not set
+# CONFIG_MIPS_EV64120 is not set
+# CONFIG_MIPS_EV96100 is not set
+# CONFIG_MIPS_IVR is not set
+# CONFIG_MIPS_ITE8172 is not set
+# CONFIG_MACH_JAZZ is not set
+# CONFIG_LASAT is not set
+# CONFIG_MIPS_ATLAS is not set
+# CONFIG_MIPS_MALTA is not set
+# CONFIG_MIPS_SEAD is not set
+# CONFIG_MIPS_SIM is not set
+# CONFIG_MOMENCO_JAGUAR_ATX is not set
+# CONFIG_MOMENCO_OCELOT is not set
+# CONFIG_MOMENCO_OCELOT_3 is not set
+# CONFIG_MOMENCO_OCELOT_C is not set
+# CONFIG_MOMENCO_OCELOT_G is not set
+# CONFIG_MIPS_XXS1500 is not set
+# CONFIG_PNX8550_V2PCI is not set
+# CONFIG_PNX8550_JBS is not set
+# CONFIG_DDB5074 is not set
+# CONFIG_DDB5476 is not set
+# CONFIG_DDB5477 is not set
+# CONFIG_MACH_VR41XX is not set
+# CONFIG_PMC_YOSEMITE is not set
+# CONFIG_QEMU is not set
+# CONFIG_SGI_IP22 is not set
+# CONFIG_SGI_IP27 is not set
+# CONFIG_SGI_IP32 is not set
+# CONFIG_SIBYTE_BIGSUR is not set
+CONFIG_SIBYTE_SWARM=y
+# CONFIG_SIBYTE_SENTOSA is not set
+# CONFIG_SIBYTE_RHONE is not set
+# CONFIG_SIBYTE_CARMEL is not set
+# CONFIG_SIBYTE_PTSWARM is not set
+# CONFIG_SIBYTE_LITTLESUR is not set
+# CONFIG_SIBYTE_CRHINE is not set
+# CONFIG_SIBYTE_CRHONE is not set
+# CONFIG_SNI_RM200_PCI is not set
+# CONFIG_TOSHIBA_JMR3927 is not set
+# CONFIG_TOSHIBA_RBTX4927 is not set
+# CONFIG_TOSHIBA_RBTX4938 is not set
+CONFIG_SIBYTE_SB1250=y
+CONFIG_SIBYTE_SB1xxx_SOC=y
+# CONFIG_CPU_SB1_PASS_1 is not set
+# CONFIG_CPU_SB1_PASS_2_1250 is not set
+CONFIG_CPU_SB1_PASS_2_2=y
+# CONFIG_CPU_SB1_PASS_4 is not set
+# CONFIG_CPU_SB1_PASS_2_112x is not set
+# CONFIG_CPU_SB1_PASS_3 is not set
+CONFIG_SIBYTE_HAS_LDT=y
+# CONFIG_SIMULATION is not set
+# CONFIG_SB1_CEX_ALWAYS_FATAL is not set
+# CONFIG_SB1_CERR_STALL is not set
+CONFIG_SIBYTE_CFE=y
+# CONFIG_SIBYTE_CFE_CONSOLE is not set
+# CONFIG_SIBYTE_BUS_WATCHER is not set
+# CONFIG_SIBYTE_SB1250_PROF is not set
+# CONFIG_SIBYTE_TBPROF is not set
+CONFIG_RWSEM_GENERIC_SPINLOCK=y
+CONFIG_GENERIC_CALIBRATE_DELAY=y
+CONFIG_DMA_COHERENT=y
+# CONFIG_CPU_BIG_ENDIAN is not set
+CONFIG_CPU_LITTLE_ENDIAN=y
+CONFIG_SYS_SUPPORTS_BIG_ENDIAN=y
+CONFIG_SYS_SUPPORTS_LITTLE_ENDIAN=y
+CONFIG_SWAP_IO_SPACE=y
+CONFIG_BOOT_ELF32=y
+CONFIG_MIPS_L1_CACHE_SHIFT=5
+
+#
+# CPU selection
+#
+# CONFIG_CPU_MIPS32_R1 is not set
+# CONFIG_CPU_MIPS32_R2 is not set
+# CONFIG_CPU_MIPS64_R1 is not set
+# CONFIG_CPU_MIPS64_R2 is not set
+# CONFIG_CPU_R3000 is not set
+# CONFIG_CPU_TX39XX is not set
+# CONFIG_CPU_VR41XX is not set
+# CONFIG_CPU_R4300 is not set
+# CONFIG_CPU_R4X00 is not set
+# CONFIG_CPU_TX49XX is not set
+# CONFIG_CPU_R5000 is not set
+# CONFIG_CPU_R5432 is not set
+# CONFIG_CPU_R6000 is not set
+# CONFIG_CPU_NEVADA is not set
+# CONFIG_CPU_R8000 is not set
+# CONFIG_CPU_R10000 is not set
+# CONFIG_CPU_RM7000 is not set
+# CONFIG_CPU_RM9000 is not set
+CONFIG_CPU_SB1=y
+CONFIG_SYS_HAS_CPU_SB1=y
+CONFIG_SYS_SUPPORTS_32BIT_KERNEL=y
+CONFIG_SYS_SUPPORTS_64BIT_KERNEL=y
+CONFIG_CPU_SUPPORTS_32BIT_KERNEL=y
+CONFIG_CPU_SUPPORTS_64BIT_KERNEL=y
+
+#
+# Kernel type
+#
+# CONFIG_32BIT is not set
+CONFIG_64BIT=y
+CONFIG_PAGE_SIZE_4KB=y
+# CONFIG_PAGE_SIZE_8KB is not set
+# CONFIG_PAGE_SIZE_16KB is not set
+# CONFIG_PAGE_SIZE_64KB is not set
+# CONFIG_SIBYTE_DMA_PAGEOPS is not set
+CONFIG_CPU_HAS_PREFETCH=y
+# CONFIG_MIPS_MT is not set
+CONFIG_SB1_PASS_2_WORKAROUNDS=y
+CONFIG_CPU_HAS_LLSC=y
+CONFIG_CPU_HAS_SYNC=y
+CONFIG_GENERIC_HARDIRQS=y
+CONFIG_GENERIC_IRQ_PROBE=y
+CONFIG_CPU_SUPPORTS_HIGHMEM=y
+CONFIG_SYS_SUPPORTS_HIGHMEM=y
+CONFIG_ARCH_FLATMEM_ENABLE=y
+CONFIG_SELECT_MEMORY_MODEL=y
+CONFIG_FLATMEM_MANUAL=y
+# CONFIG_DISCONTIGMEM_MANUAL is not set
+# CONFIG_SPARSEMEM_MANUAL is not set
+CONFIG_FLATMEM=y
+CONFIG_FLAT_NODE_MEM_MAP=y
+# CONFIG_SPARSEMEM_STATIC is not set
+CONFIG_SPLIT_PTLOCK_CPUS=4
+CONFIG_SMP=y
+CONFIG_NR_CPUS=2
+CONFIG_PREEMPT_NONE=y
+# CONFIG_PREEMPT_VOLUNTARY is not set
+# CONFIG_PREEMPT is not set
+CONFIG_PREEMPT_BKL=y
+
+#
+# Code maturity level options
+#
+CONFIG_EXPERIMENTAL=y
+CONFIG_BROKEN_ON_SMP=y
+CONFIG_LOCK_KERNEL=y
+
+#
+# General setup
+#
+CONFIG_LOCALVERSION=""
+CONFIG_LOCALVERSION_AUTO=y
+CONFIG_SWAP=y
+CONFIG_SYSVIPC=y
+CONFIG_POSIX_MQUEUE=y
+CONFIG_BSD_PROCESS_ACCT=y
+# CONFIG_BSD_PROCESS_ACCT_V3 is not set
+CONFIG_AUDIT=y
+# CONFIG_IKCONFIG is not set
+CONFIG_INITRAMFS_SOURCE=""
+# CONFIG_CC_OPTIMIZE_FOR_SIZE is not set
+CONFIG_EMBEDDED=y
+CONFIG_HOTPLUG=y
+CONFIG_BASE_FULL=y
+CONFIG_CC_ALIGN_FUNCTIONS=0
+CONFIG_CC_ALIGN_LABELS=0
+CONFIG_CC_ALIGN_LOOPS=0
+CONFIG_CC_ALIGN_JUMPS=0
+CONFIG_SLAB=y
+CONFIG_BASE_SMALL=0
+# CONFIG_SLOB is not set
+
+#
+# Loadable module support
+#
+CONFIG_MODULES=y
+CONFIG_OBSOLETE_MODPARM=y
+CONFIG_KMOD=y
+CONFIG_STOP_MACHINE=y
+
+#
+# Block layer
+#
+
+#
+# Bus options (PCI, PCMCIA, EISA, ISA, TC)
+#
+CONFIG_HW_HAS_PCI=y
+CONFIG_PCI=y
+CONFIG_MMU=y
+
+#
+# PCCARD (PCMCIA/CardBus) support
+#
+# CONFIG_PCCARD is not set
+
+#
+# PCI Hotplug Support
+#
+# CONFIG_HOTPLUG_PCI is not set
+
+#
+# Executable file formats
+#
+CONFIG_BINFMT_ELF=y
+CONFIG_BINFMT_MISC=m
+CONFIG_BUILD_ELF64=y
+CONFIG_MIPS32_COMPAT=y
+CONFIG_COMPAT=y
+CONFIG_MIPS32_O32=y
+CONFIG_MIPS32_N32=y
+CONFIG_BINFMT_ELF32=y
+
+#
+# Networking
+#
+CONFIG_NET=y
+
+#
+# Networking options
+#
+CONFIG_PACKET=y
+CONFIG_PACKET_MMAP=y
+CONFIG_UNIX=y
+CONFIG_XFRM=y
+CONFIG_XFRM_USER=y
+CONFIG_NET_KEY=y
+CONFIG_INET=y
+CONFIG_IP_MULTICAST=y
+# CONFIG_IP_ADVANCED_ROUTER is not set
+CONFIG_IP_FIB_HASH=y
+CONFIG_IP_PNP=y
+CONFIG_IP_PNP_DHCP=y
+CONFIG_IP_PNP_BOOTP=y
+# CONFIG_IP_PNP_RARP is not set
+CONFIG_NET_IPIP=m
+CONFIG_NET_IPGRE=m
+# CONFIG_NET_IPGRE_BROADCAST is not set
+# CONFIG_IP_MROUTE is not set
+# CONFIG_ARPD is not set
+# CONFIG_SYN_COOKIES is not set
+CONFIG_INET_AH=m
+CONFIG_INET_ESP=m
+CONFIG_INET_IPCOMP=m
+CONFIG_INET_TUNNEL=m
+CONFIG_INET_DIAG=y
+CONFIG_INET_TCP_DIAG=y
+CONFIG_TCP_CONG_ADVANCED=y
+
+#
+# TCP congestion control
+#
+CONFIG_TCP_CONG_BIC=y
+CONFIG_TCP_CONG_CUBIC=m
+CONFIG_TCP_CONG_WESTWOOD=m
+CONFIG_TCP_CONG_HTCP=m
+CONFIG_TCP_CONG_HSTCP=m
+CONFIG_TCP_CONG_HYBLA=m
+CONFIG_TCP_CONG_VEGAS=m
+CONFIG_TCP_CONG_SCALABLE=m
+
+#
+# IP: Virtual Server Configuration
+#
+# CONFIG_IP_VS is not set
+CONFIG_IPV6=m
+CONFIG_IPV6_PRIVACY=y
+CONFIG_INET6_AH=m
+CONFIG_INET6_ESP=m
+CONFIG_INET6_IPCOMP=m
+CONFIG_INET6_TUNNEL=m
+CONFIG_IPV6_TUNNEL=m
+CONFIG_NETFILTER=y
+# CONFIG_NETFILTER_DEBUG is not set
+
+#
+# Core Netfilter Configuration
+#
+CONFIG_NETFILTER_NETLINK=m
+CONFIG_NETFILTER_NETLINK_QUEUE=m
+CONFIG_NETFILTER_NETLINK_LOG=m
+CONFIG_NETFILTER_XTABLES=m
+CONFIG_NETFILTER_XT_TARGET_CLASSIFY=m
+CONFIG_NETFILTER_XT_TARGET_CONNMARK=m
+CONFIG_NETFILTER_XT_TARGET_MARK=m
+CONFIG_NETFILTER_XT_TARGET_NFQUEUE=m
+CONFIG_NETFILTER_XT_TARGET_NOTRACK=m
+CONFIG_NETFILTER_XT_MATCH_COMMENT=m
+CONFIG_NETFILTER_XT_MATCH_CONNBYTES=m
+CONFIG_NETFILTER_XT_MATCH_CONNMARK=m
+CONFIG_NETFILTER_XT_MATCH_CONNTRACK=m
+CONFIG_NETFILTER_XT_MATCH_DCCP=m
+CONFIG_NETFILTER_XT_MATCH_HELPER=m
+CONFIG_NETFILTER_XT_MATCH_LENGTH=m
+CONFIG_NETFILTER_XT_MATCH_LIMIT=m
+CONFIG_NETFILTER_XT_MATCH_MAC=m
+CONFIG_NETFILTER_XT_MATCH_MARK=m
+CONFIG_NETFILTER_XT_MATCH_PKTTYPE=m
+CONFIG_NETFILTER_XT_MATCH_REALM=m
+CONFIG_NETFILTER_XT_MATCH_SCTP=m
+CONFIG_NETFILTER_XT_MATCH_STATE=m
+CONFIG_NETFILTER_XT_MATCH_STRING=m
+CONFIG_NETFILTER_XT_MATCH_TCPMSS=m
+
+#
+# IP: Netfilter Configuration
+#
+CONFIG_IP_NF_QUEUE=m
+CONFIG_IP_NF_IPTABLES=m
+CONFIG_IP_NF_MATCH_IPRANGE=m
+CONFIG_IP_NF_MATCH_MULTIPORT=m
+CONFIG_IP_NF_MATCH_TOS=m
+CONFIG_IP_NF_MATCH_RECENT=m
+CONFIG_IP_NF_MATCH_ECN=m
+CONFIG_IP_NF_MATCH_DSCP=m
+CONFIG_IP_NF_MATCH_AH_ESP=m
+CONFIG_IP_NF_MATCH_TTL=m
+CONFIG_IP_NF_MATCH_OWNER=m
+CONFIG_IP_NF_MATCH_ADDRTYPE=m
+CONFIG_IP_NF_MATCH_HASHLIMIT=m
+CONFIG_IP_NF_MATCH_POLICY=m
+CONFIG_IP_NF_FILTER=m
+CONFIG_IP_NF_TARGET_REJECT=m
+CONFIG_IP_NF_TARGET_LOG=m
+CONFIG_IP_NF_TARGET_ULOG=m
+CONFIG_IP_NF_TARGET_TCPMSS=m
+CONFIG_IP_NF_TARGET_MASQUERADE=m
+CONFIG_IP_NF_TARGET_REDIRECT=m
+CONFIG_IP_NF_TARGET_NETMAP=m
+CONFIG_IP_NF_TARGET_SAME=m
+CONFIG_IP_NF_MANGLE=m
+CONFIG_IP_NF_TARGET_TOS=m
+CONFIG_IP_NF_TARGET_ECN=m
+CONFIG_IP_NF_TARGET_DSCP=m
+CONFIG_IP_NF_TARGET_TTL=m
+CONFIG_IP_NF_TARGET_CLUSTERIP=m
+CONFIG_IP_NF_RAW=m
+CONFIG_IP_NF_ARPTABLES=m
+CONFIG_IP_NF_ARPFILTER=m
+CONFIG_IP_NF_ARP_MANGLE=m
+
+#
+# IPv6: Netfilter Configuration (EXPERIMENTAL)
+#
+CONFIG_IP6_NF_QUEUE=m
+CONFIG_IP6_NF_IPTABLES=m
+CONFIG_IP6_NF_MATCH_RT=m
+CONFIG_IP6_NF_MATCH_OPTS=m
+CONFIG_IP6_NF_MATCH_FRAG=m
+CONFIG_IP6_NF_MATCH_HL=m
+CONFIG_IP6_NF_MATCH_MULTIPORT=m
+CONFIG_IP6_NF_MATCH_OWNER=m
+CONFIG_IP6_NF_MATCH_IPV6HEADER=m
+CONFIG_IP6_NF_MATCH_AHESP=m
+CONFIG_IP6_NF_MATCH_EUI64=m
+CONFIG_IP6_NF_MATCH_POLICY=m
+CONFIG_IP6_NF_FILTER=m
+CONFIG_IP6_NF_TARGET_LOG=m
+# CONFIG_IP6_NF_TARGET_REJECT is not set
+CONFIG_IP6_NF_MANGLE=m
+# CONFIG_IP6_NF_TARGET_HL is not set
+CONFIG_IP6_NF_RAW=m
+
+#
+# DCCP Configuration (EXPERIMENTAL)
+#
+# CONFIG_IP_DCCP is not set
+
+#
+# SCTP Configuration (EXPERIMENTAL)
+#
+CONFIG_IP_SCTP=m
+# CONFIG_SCTP_DBG_MSG is not set
+# CONFIG_SCTP_DBG_OBJCNT is not set
+# CONFIG_SCTP_HMAC_NONE is not set
+# CONFIG_SCTP_HMAC_SHA1 is not set
+CONFIG_SCTP_HMAC_MD5=y
+
+#
+# TIPC Configuration (EXPERIMENTAL)
+#
+CONFIG_TIPC=m
+CONFIG_TIPC_ADVANCED=y
+CONFIG_TIPC_ZONES=3
+CONFIG_TIPC_CLUSTERS=1
+CONFIG_TIPC_NODES=255
+CONFIG_TIPC_SLAVE_NODES=0
+CONFIG_TIPC_PORTS=8191
+CONFIG_TIPC_LOG=0
+# CONFIG_TIPC_DEBUG is not set
+# CONFIG_ATM is not set
+# CONFIG_BRIDGE is not set
+# CONFIG_VLAN_8021Q is not set
+# CONFIG_DECNET is not set
+# CONFIG_LLC2 is not set
+# CONFIG_IPX is not set
+# CONFIG_ATALK is not set
+# CONFIG_X25 is not set
+# CONFIG_LAPB is not set
+# CONFIG_NET_DIVERT is not set
+# CONFIG_ECONET is not set
+# CONFIG_WAN_ROUTER is not set
+
+#
+# Network testing
+#
+# CONFIG_HAMRADIO is not set
+# CONFIG_IRDA is not set
+# CONFIG_BT is not set
+# CONFIG_IEEE80211 is not set
+
+#
+# Device Drivers
+#
+
+#
+# Generic Driver Options
+#
+CONFIG_STANDALONE=y
+CONFIG_PREVENT_FIRMWARE_BUILD=y
+CONFIG_FW_LOADER=m
+
+#
+# Connector - unified userspace <-> kernelspace linker
+#
+# CONFIG_CONNECTOR is not set
+
+#
+# Memory Technology Devices (MTD)
+#
+# CONFIG_MTD is not set
+
+#
+# Parallel port support
+#
+
+#
+# Plug and Play support
+#
+
+#
+# Block devices
+#
+# CONFIG_BLK_CPQ_DA is not set
+# CONFIG_BLK_CPQ_CISS_DA is not set
+# CONFIG_BLK_DEV_DAC960 is not set
+# CONFIG_BLK_DEV_UMEM is not set
+# CONFIG_BLK_DEV_COW_COMMON is not set
+CONFIG_BLK_DEV_LOOP=m
+CONFIG_BLK_DEV_CRYPTOLOOP=m
+CONFIG_BLK_DEV_NBD=m
+# CONFIG_BLK_DEV_SX8 is not set
+# CONFIG_BLK_DEV_UB is not set
+CONFIG_BLK_DEV_RAM=y
+CONFIG_BLK_DEV_RAM_COUNT=16
+CONFIG_BLK_DEV_RAM_SIZE=8192
+CONFIG_BLK_DEV_INITRD=y
+# CONFIG_CDROM_PKTCDVD is not set
+# CONFIG_ATA_OVER_ETH is not set
+
+#
+# ATA/ATAPI/MFM/RLL support
+#
+CONFIG_IDE=y
+CONFIG_BLK_DEV_IDE=y
+
+#
+# Please see Documentation/ide.txt for help/info on IDE drives
+#
+# CONFIG_BLK_DEV_IDE_SATA is not set
+CONFIG_BLK_DEV_IDEDISK=y
+# CONFIG_IDEDISK_MULTI_MODE is not set
+CONFIG_BLK_DEV_IDECD=m
+CONFIG_BLK_DEV_IDETAPE=m
+CONFIG_BLK_DEV_IDEFLOPPY=m
+# CONFIG_BLK_DEV_IDESCSI is not set
+
+#
+# IDE chipset support/bugfixes
+#
+CONFIG_IDE_GENERIC=y
+CONFIG_BLK_DEV_IDEPCI=y
+CONFIG_IDEPCI_SHARE_IRQ=y
+# CONFIG_BLK_DEV_OFFBOARD is not set
+# CONFIG_BLK_DEV_GENERIC is not set
+# CONFIG_BLK_DEV_OPTI621 is not set
+CONFIG_BLK_DEV_IDEDMA_PCI=y
+# CONFIG_BLK_DEV_IDEDMA_FORCED is not set
+# CONFIG_IDEDMA_ONLYDISK is not set
+CONFIG_BLK_DEV_AEC62XX=m
+CONFIG_BLK_DEV_ALI15X3=m
+# CONFIG_WDC_ALI15X3 is not set
+CONFIG_BLK_DEV_AMD74XX=m
+CONFIG_BLK_DEV_CMD64X=m
+CONFIG_BLK_DEV_TRIFLEX=m
+CONFIG_BLK_DEV_CY82C693=m
+# CONFIG_BLK_DEV_CS5520 is not set
+CONFIG_BLK_DEV_CS5530=m
+CONFIG_BLK_DEV_HPT34X=m
+# CONFIG_HPT34X_AUTODMA is not set
+CONFIG_BLK_DEV_HPT366=m
+CONFIG_BLK_DEV_SC1200=m
+CONFIG_BLK_DEV_PIIX=m
+CONFIG_BLK_DEV_IT821X=m
+CONFIG_BLK_DEV_NS87415=m
+CONFIG_BLK_DEV_PDC202XX_OLD=m
+# CONFIG_PDC202XX_BURST is not set
+CONFIG_BLK_DEV_PDC202XX_NEW=m
+CONFIG_BLK_DEV_SVWKS=m
+CONFIG_BLK_DEV_SIIMAGE=m
+CONFIG_BLK_DEV_SLC90E66=m
+CONFIG_BLK_DEV_TRM290=m
+CONFIG_BLK_DEV_VIA82CXXX=m
+CONFIG_BLK_DEV_IDE_SWARM=y
+# CONFIG_IDE_ARM is not set
+CONFIG_BLK_DEV_IDEDMA=y
+# CONFIG_IDEDMA_IVB is not set
+# CONFIG_BLK_DEV_HD is not set
+
+#
+# SCSI device support
+#
+CONFIG_RAID_ATTRS=m
+CONFIG_SCSI=m
+CONFIG_SCSI_PROC_FS=y
+
+#
+# SCSI support type (disk, tape, CD-ROM)
+#
+CONFIG_BLK_DEV_SD=m
+CONFIG_CHR_DEV_ST=m
+CONFIG_CHR_DEV_OSST=m
+CONFIG_BLK_DEV_SR=m
+CONFIG_BLK_DEV_SR_VENDOR=y
+CONFIG_CHR_DEV_SG=m
+CONFIG_CHR_DEV_SCH=m
+
+#
+# Some SCSI devices (e.g. CD jukebox) support multiple LUNs
+#
+# CONFIG_SCSI_MULTI_LUN is not set
+# CONFIG_SCSI_CONSTANTS is not set
+# CONFIG_SCSI_LOGGING is not set
+
+#
+# SCSI Transport Attributes
+#
+CONFIG_SCSI_SPI_ATTRS=m
+CONFIG_SCSI_FC_ATTRS=m
+CONFIG_SCSI_ISCSI_ATTRS=m
+# CONFIG_SCSI_SAS_ATTRS is not set
+
+#
+# SCSI low-level drivers
+#
+CONFIG_ISCSI_TCP=m
+CONFIG_BLK_DEV_3W_XXXX_RAID=m
+CONFIG_SCSI_3W_9XXX=m
+CONFIG_SCSI_ACARD=m
+CONFIG_SCSI_AACRAID=m
+CONFIG_SCSI_AIC7XXX=m
+CONFIG_AIC7XXX_CMDS_PER_DEVICE=32
+CONFIG_AIC7XXX_RESET_DELAY_MS=15000
+CONFIG_AIC7XXX_DEBUG_ENABLE=y
+CONFIG_AIC7XXX_DEBUG_MASK=0
+CONFIG_AIC7XXX_REG_PRETTY_PRINT=y
+CONFIG_SCSI_AIC7XXX_OLD=m
+CONFIG_SCSI_AIC79XX=m
+CONFIG_AIC79XX_CMDS_PER_DEVICE=32
+CONFIG_AIC79XX_RESET_DELAY_MS=15000
+CONFIG_AIC79XX_DEBUG_ENABLE=y
+CONFIG_AIC79XX_DEBUG_MASK=0
+CONFIG_AIC79XX_REG_PRETTY_PRINT=y
+# CONFIG_MEGARAID_NEWGEN is not set
+CONFIG_MEGARAID_LEGACY=m
+CONFIG_MEGARAID_SAS=m
+CONFIG_SCSI_DMX3191D=m
+CONFIG_SCSI_FUTURE_DOMAIN=m
+CONFIG_SCSI_IPS=m
+CONFIG_SCSI_INITIO=m
+CONFIG_SCSI_INIA100=m
+CONFIG_SCSI_SYM53C8XX_2=m
+CONFIG_SCSI_SYM53C8XX_DMA_ADDRESSING_MODE=1
+CONFIG_SCSI_SYM53C8XX_DEFAULT_TAGS=16
+CONFIG_SCSI_SYM53C8XX_MAX_TAGS=64
+# CONFIG_SCSI_IPR is not set
+CONFIG_SCSI_QLOGIC_FC=m
+# CONFIG_SCSI_QLOGIC_FC_FIRMWARE is not set
+CONFIG_SCSI_QLOGIC_1280=m
+CONFIG_SCSI_QLA_FC=m
+# CONFIG_SCSI_QLA2XXX_EMBEDDED_FIRMWARE is not set
+CONFIG_SCSI_LPFC=m
+CONFIG_SCSI_DC395x=m
+CONFIG_SCSI_DC390T=m
+CONFIG_SCSI_DEBUG=m
+
+#
+# Serial ATA (prod) and Parallel ATA (experimental) drivers
+#
+CONFIG_ATA=m
+CONFIG_SATA_AHCI=m
+CONFIG_SATA_SVW=m
+CONFIG_ATA_PIIX=m
+CONFIG_SATA_MV=m
+CONFIG_SATA_NV=m
+CONFIG_PDC_ADMA=m
+CONFIG_SATA_QSTOR=m
+CONFIG_SATA_PROMISE=m
+CONFIG_SATA_SX4=m
+CONFIG_SATA_SIL=m
+CONFIG_SATA_SIL24=m
+CONFIG_SATA_SIS=m
+CONFIG_SATA_ULI=m
+CONFIG_SATA_VIA=m
+CONFIG_SATA_VITESSE=m
+
+#
+# Multi-device support (RAID and LVM)
+#
+CONFIG_MD=y
+CONFIG_BLK_DEV_MD=m
+CONFIG_MD_LINEAR=m
+CONFIG_MD_RAID0=m
+CONFIG_MD_RAID1=m
+CONFIG_MD_RAID10=m
+CONFIG_MD_RAID5=m
+CONFIG_MD_RAID6=m
+CONFIG_MD_MULTIPATH=m
+CONFIG_MD_FAULTY=m
+CONFIG_BLK_DEV_DM=m
+CONFIG_DM_CRYPT=m
+CONFIG_DM_SNAPSHOT=m
+CONFIG_DM_MIRROR=m
+CONFIG_DM_ZERO=m
+CONFIG_DM_MULTIPATH=m
+# CONFIG_DM_MULTIPATH_EMC is not set
+
+#
+# Fusion MPT device support
+#
+# CONFIG_FUSION is not set
+# CONFIG_FUSION_SPI is not set
+# CONFIG_FUSION_FC is not set
+# CONFIG_FUSION_SAS is not set
+
+#
+# IEEE 1394 (FireWire) support
+#
+# CONFIG_FIREWIRE is not set
+
+#
+# I2O device support
+#
+# CONFIG_I2O is not set
+
+#
+# Network device support
+#
+CONFIG_NETDEVICES=y
+CONFIG_DUMMY=m
+CONFIG_BONDING=m
+CONFIG_EQUALIZER=m
+CONFIG_TUN=m
+
+#
+# ARCnet devices
+#
+# CONFIG_ARCNET is not set
+
+#
+# PHY device support
+#
+# CONFIG_PHYLIB is not set
+
+#
+# Ethernet (10 or 100Mbit)
+#
+CONFIG_NET_ETHERNET=y
+CONFIG_MII=y
+CONFIG_NET_SB1250_MAC=y
+CONFIG_SBMAC_NAPI=y
+# CONFIG_HAPPYMEAL is not set
+# CONFIG_SUNGEM is not set
+# CONFIG_CASSINI is not set
+# CONFIG_NET_VENDOR_3COM is not set
+# CONFIG_DM9000 is not set
+
+#
+# Tulip family network device support
+#
+# CONFIG_NET_TULIP is not set
+# CONFIG_HP100 is not set
+CONFIG_NET_PCI=y
+CONFIG_PCNET32=m
+CONFIG_AMD8111_ETH=m
+# CONFIG_AMD8111E_NAPI is not set
+CONFIG_ADAPTEC_STARFIRE=m
+# CONFIG_ADAPTEC_STARFIRE_NAPI is not set
+CONFIG_B44=m
+CONFIG_FORCEDETH=m
+CONFIG_EEPRO100=m
+CONFIG_E100=m
+CONFIG_FEALNX=m
+CONFIG_NATSEMI=m
+CONFIG_NE2K_PCI=m
+CONFIG_8139CP=m
+CONFIG_8139TOO=m
+CONFIG_8139TOO_PIO=y
+# CONFIG_8139TOO_TUNE_TWISTER is not set
+CONFIG_8139TOO_8129=y
+# CONFIG_8139_OLD_RX_RESET is not set
+CONFIG_SIS900=m
+CONFIG_EPIC100=m
+CONFIG_SUNDANCE=m
+# CONFIG_SUNDANCE_MMIO is not set
+CONFIG_VIA_RHINE=m
+# CONFIG_VIA_RHINE_MMIO is not set
+# CONFIG_LAN_SAA9730 is not set
+# CONFIG_NET_POCKET is not set
+
+#
+# Ethernet (1000 Mbit)
+#
+CONFIG_DL2K=m
+CONFIG_E1000=m
+# CONFIG_E1000_NAPI is not set
+# CONFIG_E1000_DISABLE_PACKET_SPLIT is not set
+CONFIG_NS83820=m
+CONFIG_HAMACHI=m
+CONFIG_YELLOWFIN=m
+CONFIG_R8169=m
+# CONFIG_R8169_NAPI is not set
+CONFIG_SIS190=m
+CONFIG_SKGE=m
+CONFIG_SKY2=m
+CONFIG_VIA_VELOCITY=m
+CONFIG_TIGON3=m
+CONFIG_BNX2=m
+
+#
+# Ethernet (10000 Mbit)
+#
+# CONFIG_CHELSIO_T1 is not set
+# CONFIG_IXGB is not set
+# CONFIG_S2IO is not set
+
+#
+# Token Ring devices
+#
+# CONFIG_TR is not set
+
+#
+# Wireless LAN (non-hamradio)
+#
+# CONFIG_NET_RADIO is not set
+
+#
+# Wan interfaces
+#
+# CONFIG_WAN is not set
+# CONFIG_FDDI is not set
+# CONFIG_HIPPI is not set
+# CONFIG_PLIP is not set
+CONFIG_PPP=m
+# CONFIG_PPP_MULTILINK is not set
+CONFIG_PPP_FILTER=y
+CONFIG_PPP_ASYNC=m
+CONFIG_PPP_SYNC_TTY=m
+CONFIG_PPP_DEFLATE=m
+CONFIG_PPP_BSDCOMP=m
+CONFIG_PPP_MPPE=m
+CONFIG_PPPOE=m
+CONFIG_SLIP=m
+CONFIG_SLIP_COMPRESSED=y
+CONFIG_SLIP_SMART=y
+CONFIG_SLIP_MODE_SLIP6=y
+# CONFIG_NET_FC is not set
+# CONFIG_SHAPER is not set
+# CONFIG_NETCONSOLE is not set
+# CONFIG_NETPOLL is not set
+# CONFIG_NET_POLL_CONTROLLER is not set
+
+#
+# ISDN subsystem
+#
+# CONFIG_ISDN is not set
+
+#
+# Telephony Support
+#
+# CONFIG_PHONE is not set
+
+#
+# Input device support
+#
+CONFIG_INPUT=y
+
+#
+# Userland interfaces
+#
+CONFIG_INPUT_MOUSEDEV=y
+CONFIG_INPUT_MOUSEDEV_PSAUX=y
+CONFIG_INPUT_MOUSEDEV_SCREEN_X=1024
+CONFIG_INPUT_MOUSEDEV_SCREEN_Y=768
+# CONFIG_INPUT_JOYDEV is not set
+# CONFIG_INPUT_TSDEV is not set
+CONFIG_INPUT_EVDEV=m
+
+#
+# Input Device Drivers
+#
+CONFIG_INPUT_KEYBOARD=y
+CONFIG_KEYBOARD_ATKBD=y
+# CONFIG_KEYBOARD_SUNKBD is not set
+# CONFIG_KEYBOARD_LKKBD is not set
+# CONFIG_KEYBOARD_XTKBD is not set
+# CONFIG_KEYBOARD_NEWTON is not set
+CONFIG_INPUT_MOUSE=y
+CONFIG_MOUSE_PS2=y
+# CONFIG_MOUSE_SERIAL is not set
+# CONFIG_MOUSE_VSXXXAA is not set
+# CONFIG_INPUT_JOYSTICK is not set
+# CONFIG_INPUT_TOUCHSCREEN is not set
+# CONFIG_INPUT_MISC is not set
+
+#
+# Hardware I/O ports
+#
+CONFIG_SERIO=y
+# CONFIG_SERIO_I8042 is not set
+# CONFIG_SERIO_SERPORT is not set
+# CONFIG_SERIO_PARKBD is not set
+# CONFIG_SERIO_PCIPS2 is not set
+CONFIG_SERIO_LIBPS2=y
+# CONFIG_SERIO_RAW is not set
+# CONFIG_GAMEPORT is not set
+
+#
+# Character devices
+#
+CONFIG_VT=y
+CONFIG_VT_CONSOLE=y
+CONFIG_HW_CONSOLE=y
+# CONFIG_SERIAL_NONSTANDARD is not set
+CONFIG_SIBYTE_SB1250_DUART=y
+CONFIG_SIBYTE_SB1250_DUART_CONSOLE=y
+
+#
+# Serial drivers
+#
+# CONFIG_SERIAL_8250 is not set
+
+#
+# Non-8250 serial port support
+#
+# CONFIG_SERIAL_JSM is not set
+CONFIG_PRINTER=m
+# CONFIG_LP_CONSOLE is not set
+# CONFIG_PPDEV is not set
+# CONFIG_TIPAR is not set
+
+#
+# IPMI
+#
+# CONFIG_IPMI_HANDLER is not set
+
+#
+# Watchdog Cards
+#
+CONFIG_WATCHDOG=y
+# CONFIG_WATCHDOG_NOWAYOUT is not set
+
+#
+# Watchdog Device Drivers
+#
+# CONFIG_SOFT_WATCHDOG is not set
+
+#
+# PCI-based Watchdog Cards
+#
+# CONFIG_PCIPCWATCHDOG is not set
+# CONFIG_WDTPCI is not set
+
+#
+# USB-based Watchdog Cards
+#
+# CONFIG_USBPCWATCHDOG is not set
+CONFIG_RTC=m
+CONFIG_GEN_RTC=y
+CONFIG_GEN_RTC_X=y
+# CONFIG_DTLK is not set
+# CONFIG_R3964 is not set
+# CONFIG_APPLICOM is not set
+
+#
+# Ftape, the floppy tape device driver
+#
+# CONFIG_DRM is not set
+# CONFIG_RAW_DRIVER is not set
+
+#
+# TPM devices
+#
+# CONFIG_TCG_TPM is not set
+# CONFIG_TELCLOCK is not set
+
+#
+# I2C support
+#
+CONFIG_I2C=m
+CONFIG_I2C_CHARDEV=m
+
+#
+# I2C Algorithms
+#
+CONFIG_I2C_ALGOBIT=m
+# CONFIG_I2C_ALGOPCF is not set
+# CONFIG_I2C_ALGOPCA is not set
+CONFIG_I2C_ALGO_SIBYTE=m
+
+#
+# I2C Hardware Bus support
+#
+# CONFIG_I2C_ALI1535 is not set
+# CONFIG_I2C_ALI1563 is not set
+# CONFIG_I2C_ALI15X3 is not set
+# CONFIG_I2C_AMD756 is not set
+# CONFIG_I2C_AMD8111 is not set
+# CONFIG_I2C_I801 is not set
+# CONFIG_I2C_I810 is not set
+# CONFIG_I2C_PIIX4 is not set
+# CONFIG_I2C_NFORCE2 is not set
+# CONFIG_I2C_PARPORT is not set
+# CONFIG_I2C_PARPORT_LIGHT is not set
+# CONFIG_I2C_PROSAVAGE is not set
+# CONFIG_I2C_SAVAGE4 is not set
+CONFIG_I2C_SIBYTE=m
+# CONFIG_SCx200_ACB is not set
+# CONFIG_I2C_SIS5595 is not set
+# CONFIG_I2C_SIS630 is not set
+# CONFIG_I2C_SIS96X is not set
+CONFIG_I2C_STUB=m
+# CONFIG_I2C_VIA is not set
+# CONFIG_I2C_VIAPRO is not set
+# CONFIG_I2C_VOODOO3 is not set
+# CONFIG_I2C_PCA_ISA is not set
+
+#
+# Miscellaneous I2C Chip support
+#
+# CONFIG_SENSORS_DS1337 is not set
+# CONFIG_SENSORS_DS1374 is not set
+# CONFIG_SENSORS_EEPROM is not set
+# CONFIG_SENSORS_PCF8574 is not set
+# CONFIG_SENSORS_PCA9539 is not set
+# CONFIG_SENSORS_PCF8591 is not set
+# CONFIG_SENSORS_MAX6875 is not set
+# CONFIG_I2C_DEBUG_CORE is not set
+# CONFIG_I2C_DEBUG_ALGO is not set
+# CONFIG_I2C_DEBUG_BUS is not set
+# CONFIG_I2C_DEBUG_CHIP is not set
+
+#
+# SPI support
+#
+CONFIG_SPI=y
+CONFIG_SPI_MASTER=y
+
+#
+# SPI Master Controller Drivers
+#
+CONFIG_SPI_BITBANG=m
+CONFIG_SPI_BUTTERFLY=m
+
+#
+# SPI Protocol Masters
+#
+
+#
+# Dallas's 1-wire bus
+#
+# CONFIG_W1 is not set
+
+#
+# Hardware Monitoring support
+#
+CONFIG_HWMON=y
+CONFIG_HWMON_VID=m
+# CONFIG_SENSORS_ADM1021 is not set
+# CONFIG_SENSORS_ADM1025 is not set
+# CONFIG_SENSORS_ADM1026 is not set
+# CONFIG_SENSORS_ADM1031 is not set
+# CONFIG_SENSORS_ADM9240 is not set
+# CONFIG_SENSORS_ASB100 is not set
+# CONFIG_SENSORS_ATXP1 is not set
+# CONFIG_SENSORS_DS1621 is not set
+# CONFIG_SENSORS_F71805F is not set
+# CONFIG_SENSORS_FSCHER is not set
+# CONFIG_SENSORS_FSCPOS is not set
+# CONFIG_SENSORS_GL518SM is not set
+# CONFIG_SENSORS_GL520SM is not set
+# CONFIG_SENSORS_IT87 is not set
+# CONFIG_SENSORS_LM63 is not set
+# CONFIG_SENSORS_LM75 is not set
+# CONFIG_SENSORS_LM77 is not set
+# CONFIG_SENSORS_LM78 is not set
+# CONFIG_SENSORS_LM80 is not set
+# CONFIG_SENSORS_LM83 is not set
+# CONFIG_SENSORS_LM85 is not set
+# CONFIG_SENSORS_LM87 is not set
+# CONFIG_SENSORS_LM90 is not set
+# CONFIG_SENSORS_LM92 is not set
+# CONFIG_SENSORS_MAX1619 is not set
+# CONFIG_SENSORS_PC87360 is not set
+# CONFIG_SENSORS_SIS5595 is not set
+# CONFIG_SENSORS_SMSC47M1 is not set
+# CONFIG_SENSORS_SMSC47B397 is not set
+# CONFIG_SENSORS_VIA686A is not set
+CONFIG_SENSORS_VT8231=m
+# CONFIG_SENSORS_W83781D is not set
+# CONFIG_SENSORS_W83792D is not set
+# CONFIG_SENSORS_W83L785TS is not set
+# CONFIG_SENSORS_W83627HF is not set
+# CONFIG_SENSORS_W83627EHF is not set
+# CONFIG_HWMON_DEBUG_CHIP is not set
+
+#
+# Misc devices
+#
+
+#
+# Multimedia Capabilities Port drivers
+#
+
+#
+# Multimedia devices
+#
+CONFIG_VIDEO_DEV=m
+
+#
+# Video For Linux
+#
+
+#
+# Video Adapters
+#
+# CONFIG_VIDEO_ADV_DEBUG is not set
+# CONFIG_VIDEO_BT848 is not set
+# CONFIG_VIDEO_BWQCAM is not set
+# CONFIG_VIDEO_CQCAM is not set
+# CONFIG_VIDEO_W9966 is not set
+# CONFIG_VIDEO_CPIA is not set
+# CONFIG_VIDEO_SAA5246A is not set
+# CONFIG_VIDEO_SAA5249 is not set
+# CONFIG_TUNER_3036 is not set
+# CONFIG_VIDEO_STRADIS is not set
+# CONFIG_VIDEO_ZORAN is not set
+# CONFIG_VIDEO_SAA7134 is not set
+# CONFIG_VIDEO_MXB is not set
+# CONFIG_VIDEO_DPC is not set
+# CONFIG_VIDEO_HEXIUM_ORION is not set
+# CONFIG_VIDEO_HEXIUM_GEMINI is not set
+# CONFIG_VIDEO_CX88 is not set
+# CONFIG_VIDEO_EM28XX is not set
+# CONFIG_VIDEO_OVCAMCHIP is not set
+# CONFIG_VIDEO_AUDIO_DECODER is not set
+# CONFIG_VIDEO_DECODER is not set
+
+#
+# Radio Adapters
+#
+# CONFIG_RADIO_GEMTEK_PCI is not set
+# CONFIG_RADIO_MAXIRADIO is not set
+# CONFIG_RADIO_MAESTRO is not set
+
+#
+# Digital Video Broadcasting Devices
+#
+# CONFIG_DVB is not set
+
+#
+# Graphics support
+#
+CONFIG_FB=y
+CONFIG_FB_CFB_FILLRECT=m
+CONFIG_FB_CFB_COPYAREA=m
+CONFIG_FB_CFB_IMAGEBLIT=m
+# CONFIG_FB_MACMODES is not set
+CONFIG_FB_MODE_HELPERS=y
+CONFIG_FB_TILEBLITTING=y
+# CONFIG_FB_CIRRUS is not set
+CONFIG_FB_PM2=m
+# CONFIG_FB_PM2_FIFO_DISCONNECT is not set
+CONFIG_FB_CYBER2000=m
+# CONFIG_FB_ASILIANT is not set
+# CONFIG_FB_IMSTT is not set
+# CONFIG_FB_S1D13XXX is not set
+CONFIG_FB_NVIDIA=m
+# CONFIG_FB_NVIDIA_I2C is not set
+CONFIG_FB_RIVA=m
+# CONFIG_FB_RIVA_I2C is not set
+# CONFIG_FB_RIVA_DEBUG is not set
+CONFIG_FB_MATROX=m
+CONFIG_FB_MATROX_MILLENIUM=y
+CONFIG_FB_MATROX_MYSTIQUE=y
+CONFIG_FB_MATROX_G=y
+# CONFIG_FB_MATROX_I2C is not set
+# CONFIG_FB_MATROX_MULTIHEAD is not set
+CONFIG_FB_RADEON=m
+CONFIG_FB_RADEON_I2C=y
+# CONFIG_FB_RADEON_DEBUG is not set
+CONFIG_FB_ATY128=m
+CONFIG_FB_ATY=m
+# CONFIG_FB_ATY_CT is not set
+# CONFIG_FB_ATY_GX is not set
+CONFIG_FB_SAVAGE=m
+# CONFIG_FB_SAVAGE_I2C is not set
+# CONFIG_FB_SAVAGE_ACCEL is not set
+CONFIG_FB_SIS=m
+CONFIG_FB_SIS_300=y
+CONFIG_FB_SIS_315=y
+CONFIG_FB_NEOMAGIC=m
+CONFIG_FB_KYRO=m
+CONFIG_FB_3DFX=m
+# CONFIG_FB_3DFX_ACCEL is not set
+CONFIG_FB_VOODOO1=m
+CONFIG_FB_TRIDENT=m
+# CONFIG_FB_TRIDENT_ACCEL is not set
+# CONFIG_FB_VIRTUAL is not set
+
+#
+# Console display driver support
+#
+# CONFIG_VGA_CONSOLE is not set
+CONFIG_DUMMY_CONSOLE=y
+CONFIG_FRAMEBUFFER_CONSOLE=y
+# CONFIG_FRAMEBUFFER_CONSOLE_ROTATION is not set
+# CONFIG_FONTS is not set
+CONFIG_FONT_8x8=y
+CONFIG_FONT_8x16=y
+
+#
+# Logo configuration
+#
+CONFIG_LOGO=y
+# CONFIG_LOGO_LINUX_MONO is not set
+# CONFIG_LOGO_LINUX_VGA16 is not set
+# CONFIG_LOGO_LINUX_CLUT224 is not set
+
+#
+# Sound
+#
+CONFIG_SOUND=y
+
+#
+# Advanced Linux Sound Architecture
+#
+CONFIG_SND=m
+CONFIG_SND_TIMER=m
+CONFIG_SND_PCM=m
+CONFIG_SND_HWDEP=m
+CONFIG_SND_RAWMIDI=m
+# CONFIG_SND_SEQUENCER is not set
+CONFIG_SND_OSSEMUL=y
+CONFIG_SND_MIXER_OSS=m
+CONFIG_SND_PCM_OSS=m
+CONFIG_SND_RTCTIMER=m
+# CONFIG_SND_DYNAMIC_MINORS is not set
+CONFIG_SND_SUPPORT_OLD_API=y
+# CONFIG_SND_VERBOSE_PRINTK is not set
+# CONFIG_SND_DEBUG is not set
+
+#
+# Generic devices
+#
+CONFIG_SND_MPU401_UART=m
+CONFIG_SND_OPL3_LIB=m
+CONFIG_SND_VX_LIB=m
+CONFIG_SND_AC97_CODEC=m
+CONFIG_SND_AC97_BUS=m
+# CONFIG_SND_DUMMY is not set
+# CONFIG_SND_MTPAV is not set
+# CONFIG_SND_SERIAL_U16550 is not set
+# CONFIG_SND_MPU401 is not set
+
+#
+# PCI devices
+#
+CONFIG_SND_AD1889=m
+CONFIG_SND_ALI5451=m
+CONFIG_SND_ATIIXP=m
+CONFIG_SND_ATIIXP_MODEM=m
+CONFIG_SND_AU8810=m
+CONFIG_SND_AU8820=m
+CONFIG_SND_AU8830=m
+CONFIG_SND_AZT3328=m
+CONFIG_SND_BT87X=m
+CONFIG_SND_BT87X_OVERCLOCK=y
+CONFIG_SND_CA0106=m
+CONFIG_SND_CMIPCI=m
+CONFIG_SND_CS4281=m
+CONFIG_SND_CS46XX=m
+CONFIG_SND_CS46XX_NEW_DSP=y
+CONFIG_SND_EMU10K1=m
+CONFIG_SND_EMU10K1X=m
+CONFIG_SND_ENS1370=m
+CONFIG_SND_ENS1371=m
+CONFIG_SND_ES1938=m
+CONFIG_SND_ES1968=m
+CONFIG_SND_FM801=m
+CONFIG_SND_FM801_TEA575X_BOOL=y
+CONFIG_SND_FM801_TEA575X=m
+CONFIG_SND_HDA_INTEL=m
+CONFIG_SND_HDSP=m
+CONFIG_SND_HDSPM=m
+CONFIG_SND_ICE1712=m
+CONFIG_SND_ICE1724=m
+CONFIG_SND_INTEL8X0=m
+CONFIG_SND_INTEL8X0M=m
+CONFIG_SND_KORG1212=m
+CONFIG_SND_MAESTRO3=m
+CONFIG_SND_MIXART=m
+CONFIG_SND_NM256=m
+CONFIG_SND_PCXHR=m
+CONFIG_SND_RME32=m
+CONFIG_SND_RME96=m
+CONFIG_SND_RME9652=m
+CONFIG_SND_SONICVIBES=m
+CONFIG_SND_TRIDENT=m
+CONFIG_SND_VIA82XX=m
+CONFIG_SND_VIA82XX_MODEM=m
+CONFIG_SND_VX222=m
+CONFIG_SND_YMFPCI=m
+
+#
+# ALSA MIPS devices
+#
+
+#
+# USB devices
+#
+# CONFIG_SND_USB_AUDIO is not set
+
+#
+# Open Sound System
+#
+CONFIG_SOUND_PRIME=y
+# CONFIG_OBSOLETE_OSS_DRIVER is not set
+# CONFIG_SOUND_FUSION is not set
+# CONFIG_SOUND_BCM_CS4297A is not set
+# CONFIG_SOUND_TRIDENT is not set
+# CONFIG_SOUND_MSNDCLAS is not set
+# CONFIG_SOUND_MSNDPIN is not set
+
+#
+# USB support
+#
+CONFIG_USB_ARCH_HAS_HCD=y
+CONFIG_USB_ARCH_HAS_OHCI=y
+CONFIG_USB=m
+# CONFIG_USB_DEBUG is not set
+
+#
+# Miscellaneous USB options
+#
+CONFIG_USB_DEVICEFS=y
+# CONFIG_USB_DYNAMIC_MINORS is not set
+# CONFIG_USB_OTG is not set
+
+#
+# USB Host Controller Drivers
+#
+CONFIG_USB_EHCI_HCD=m
+# CONFIG_USB_EHCI_SPLIT_ISO is not set
+# CONFIG_USB_EHCI_ROOT_HUB_TT is not set
+CONFIG_USB_ISP116X_HCD=m
+CONFIG_USB_OHCI_HCD=m
+CONFIG_USB_OHCI_LITTLE_ENDIAN=y
+CONFIG_USB_UHCI_HCD=m
+CONFIG_USB_SL811_HCD=m
+
+#
+# USB Device Class drivers
+#
+# CONFIG_OBSOLETE_OSS_USB_DRIVER is not set
+# CONFIG_USB_PRINTER is not set
+
+#
+# NOTE: USB_STORAGE enables SCSI, and 'SCSI disk support'
+#
+
+#
+# may also be needed; see USB_STORAGE Help for more information
+#
+CONFIG_USB_STORAGE=m
+# CONFIG_USB_STORAGE_DEBUG is not set
+# CONFIG_USB_STORAGE_DATAFAB is not set
+# CONFIG_USB_STORAGE_FREECOM is not set
+# CONFIG_USB_STORAGE_ISD200 is not set
+# CONFIG_USB_STORAGE_DPCM is not set
+# CONFIG_USB_STORAGE_USBAT is not set
+# CONFIG_USB_STORAGE_SDDR09 is not set
+# CONFIG_USB_STORAGE_SDDR55 is not set
+# CONFIG_USB_STORAGE_JUMPSHOT is not set
+CONFIG_USB_STORAGE_ALAUDA=y
+# CONFIG_USB_LIBUSUAL is not set
+
+#
+# USB Input Devices
+#
+CONFIG_USB_HID=m
+# CONFIG_USB_HIDINPUT_POWERBOOK is not set
+# CONFIG_HID_FF is not set
+CONFIG_USB_HIDDEV=y
+
+#
+# USB HID Boot Protocol drivers
+#
+# CONFIG_USB_KBD is not set
+# CONFIG_USB_MOUSE is not set
+
+#
+# USB Imaging devices
+#
+# CONFIG_USB_MDC800 is not set
+# CONFIG_USB_MICROTEK is not set
+
+#
+# USB Multimedia devices
+#
+# CONFIG_USB_VICAM is not set
+# CONFIG_USB_DSBR is not set
+CONFIG_USB_ET61X251=m
+# CONFIG_USB_IBMCAM is not set
+# CONFIG_USB_KONICAWC is not set
+# CONFIG_USB_OV511 is not set
+# CONFIG_USB_SE401 is not set
+# CONFIG_USB_SN9C102 is not set
+# CONFIG_USB_STV680 is not set
+# CONFIG_USB_PWC is not set
+
+#
+# USB Network Adapters
+#
+# CONFIG_USB_CATC is not set
+# CONFIG_USB_KAWETH is not set
+# CONFIG_USB_PEGASUS is not set
+# CONFIG_USB_RTL8150 is not set
+# CONFIG_USB_USBNET is not set
+CONFIG_USB_MON=y
+
+#
+# USB port drivers
+#
+# CONFIG_USB_USS720 is not set
+
+#
+# USB Miscellaneous drivers
+#
+# CONFIG_USB_AUERSWALD is not set
+# CONFIG_USB_RIO500 is not set
+# CONFIG_USB_LEGOTOWER is not set
+# CONFIG_USB_LCD is not set
+# CONFIG_USB_LED is not set
+# CONFIG_USB_CYTHERM is not set
+# CONFIG_USB_PHIDGETKIT is not set
+# CONFIG_USB_PHIDGETSERVO is not set
+# CONFIG_USB_IDMOUSE is not set
+CONFIG_USB_SISUSBVGA=m
+# CONFIG_USB_SISUSBVGA_CON is not set
+# CONFIG_USB_LD is not set
+# CONFIG_USB_TEST is not set
+
+#
+# USB DSL modem support
+#
+
+#
+# USB Gadget Support
+#
+# CONFIG_USB_GADGET is not set
+
+#
+# MMC/SD Card support
+#
+# CONFIG_MMC is not set
+
+#
+# InfiniBand support
+#
+# CONFIG_INFINIBAND is not set
+
+#
+# SN Devices
+#
+
+#
+# EDAC - error detection and reporting (RAS)
+#
+
+#
+# File systems
+#
+CONFIG_EXT2_FS=y
+CONFIG_EXT2_FS_XATTR=y
+CONFIG_EXT2_FS_POSIX_ACL=y
+CONFIG_EXT2_FS_SECURITY=y
+# CONFIG_EXT2_FS_XIP is not set
+CONFIG_EXT3_FS=y
+CONFIG_EXT3_FS_XATTR=y
+CONFIG_EXT3_FS_POSIX_ACL=y
+CONFIG_EXT3_FS_SECURITY=y
+CONFIG_JBD=y
+# CONFIG_JBD_DEBUG is not set
+CONFIG_FS_MBCACHE=y
+CONFIG_REISERFS_FS=m
+# CONFIG_REISERFS_CHECK is not set
+# CONFIG_REISERFS_PROC_INFO is not set
+CONFIG_REISERFS_FS_XATTR=y
+CONFIG_REISERFS_FS_POSIX_ACL=y
+# CONFIG_REISERFS_FS_SECURITY is not set
+CONFIG_JFS_FS=m
+CONFIG_JFS_POSIX_ACL=y
+# CONFIG_JFS_SECURITY is not set
+# CONFIG_JFS_DEBUG is not set
+# CONFIG_JFS_STATISTICS is not set
+CONFIG_FS_POSIX_ACL=y
+CONFIG_XFS_FS=m
+CONFIG_XFS_EXPORT=y
+# CONFIG_XFS_QUOTA is not set
+# CONFIG_XFS_SECURITY is not set
+CONFIG_XFS_POSIX_ACL=y
+CONFIG_XFS_RT=y
+CONFIG_OCFS2_FS=m
+# CONFIG_MINIX_FS is not set
+# CONFIG_ROMFS_FS is not set
+CONFIG_INOTIFY=y
+CONFIG_QUOTA=y
+CONFIG_QFMT_V1=m
+CONFIG_QFMT_V2=m
+CONFIG_QUOTACTL=y
+CONFIG_DNOTIFY=y
+CONFIG_AUTOFS_FS=m
+CONFIG_AUTOFS4_FS=m
+CONFIG_FUSE_FS=m
+
+#
+# CD-ROM/DVD Filesystems
+#
+CONFIG_ISO9660_FS=y
+CONFIG_JOLIET=y
+CONFIG_ZISOFS=y
+CONFIG_UDF_FS=y
+CONFIG_UDF_NLS=y
+
+#
+# DOS/FAT/NT Filesystems
+#
+CONFIG_FAT_FS=m
+CONFIG_MSDOS_FS=m
+CONFIG_VFAT_FS=m
+CONFIG_FAT_DEFAULT_CODEPAGE=437
+CONFIG_FAT_DEFAULT_IOCHARSET="iso8859-1"
+CONFIG_NTFS_FS=m
+# CONFIG_NTFS_DEBUG is not set
+CONFIG_NTFS_RW=y
+
+#
+# Pseudo filesystems
+#
+CONFIG_PROC_FS=y
+CONFIG_PROC_KCORE=y
+CONFIG_SYSFS=y
+CONFIG_TMPFS=y
+CONFIG_RAMFS=y
+# CONFIG_RELAYFS_FS is not set
+CONFIG_CONFIGFS_FS=m
+
+#
+# Miscellaneous filesystems
+#
+# CONFIG_ADFS_FS is not set
+# CONFIG_AFFS_FS is not set
+# CONFIG_ASFS_FS is not set
+# CONFIG_HFS_FS is not set
+# CONFIG_HFSPLUS_FS is not set
+# CONFIG_BEFS_FS is not set
+# CONFIG_BFS_FS is not set
+CONFIG_EFS_FS=m
+CONFIG_CRAMFS=y
+# CONFIG_VXFS_FS is not set
+# CONFIG_HPFS_FS is not set
+# CONFIG_QNX4FS_FS is not set
+# CONFIG_SYSV_FS is not set
+# CONFIG_UFS_FS is not set
+
+#
+# Network File Systems
+#
+CONFIG_NFS_FS=y
+# CONFIG_NFS_V3_ACL is not set
+# CONFIG_NFS_V4 is not set
+# CONFIG_NFS_DIRECTIO is not set
+CONFIG_NFSD=y
+# CONFIG_NFSD_V3_ACL is not set
+# CONFIG_NFSD_V4 is not set
+CONFIG_ROOT_NFS=y
+CONFIG_LOCKD=y
+CONFIG_LOCKD_V4=y
+CONFIG_EXPORTFS=y
+CONFIG_SUNRPC=y
+# CONFIG_RPCSEC_GSS_KRB5 is not set
+# CONFIG_RPCSEC_GSS_SPKM3 is not set
+CONFIG_SMB_FS=m
+CONFIG_SMB_NLS_DEFAULT=y
+CONFIG_SMB_NLS_REMOTE="cp437"
+CONFIG_CIFS=m
+# CONFIG_CIFS_STATS is not set
+CONFIG_CIFS_XATTR=y
+CONFIG_CIFS_POSIX=y
+# CONFIG_CIFS_EXPERIMENTAL is not set
+# CONFIG_NCP_FS is not set
+# CONFIG_CODA_FS is not set
+# CONFIG_AFS_FS is not set
+# CONFIG_9P_FS is not set
+
+#
+# Partition Types
+#
+CONFIG_PARTITION_ADVANCED=y
+# CONFIG_ACORN_PARTITION is not set
+# CONFIG_OSF_PARTITION is not set
+# CONFIG_AMIGA_PARTITION is not set
+# CONFIG_ATARI_PARTITION is not set
+# CONFIG_MAC_PARTITION is not set
+CONFIG_MSDOS_PARTITION=y
+# CONFIG_BSD_DISKLABEL is not set
+# CONFIG_MINIX_SUBPARTITION is not set
+# CONFIG_SOLARIS_X86_PARTITION is not set
+# CONFIG_UNIXWARE_DISKLABEL is not set
+# CONFIG_LDM_PARTITION is not set
+CONFIG_SGI_PARTITION=y
+# CONFIG_ULTRIX_PARTITION is not set
+# CONFIG_SUN_PARTITION is not set
+CONFIG_KARMA_PARTITION=y
+# CONFIG_EFI_PARTITION is not set
+
+#
+# Native Language Support
+#
+CONFIG_NLS=y
+CONFIG_NLS_DEFAULT="iso8859-1"
+CONFIG_NLS_CODEPAGE_437=m
+CONFIG_NLS_CODEPAGE_737=m
+CONFIG_NLS_CODEPAGE_775=m
+CONFIG_NLS_CODEPAGE_850=m
+CONFIG_NLS_CODEPAGE_852=m
+CONFIG_NLS_CODEPAGE_855=m
+CONFIG_NLS_CODEPAGE_857=m
+CONFIG_NLS_CODEPAGE_860=m
+CONFIG_NLS_CODEPAGE_861=m
+CONFIG_NLS_CODEPAGE_862=m
+CONFIG_NLS_CODEPAGE_863=m
+CONFIG_NLS_CODEPAGE_864=m
+CONFIG_NLS_CODEPAGE_865=m
+CONFIG_NLS_CODEPAGE_866=m
+CONFIG_NLS_CODEPAGE_869=m
+CONFIG_NLS_CODEPAGE_936=m
+CONFIG_NLS_CODEPAGE_950=m
+CONFIG_NLS_CODEPAGE_932=m
+CONFIG_NLS_CODEPAGE_949=m
+CONFIG_NLS_CODEPAGE_874=m
+CONFIG_NLS_ISO8859_8=m
+CONFIG_NLS_CODEPAGE_1250=m
+CONFIG_NLS_CODEPAGE_1251=m
+CONFIG_NLS_ASCII=m
+CONFIG_NLS_ISO8859_1=m
+CONFIG_NLS_ISO8859_2=m
+CONFIG_NLS_ISO8859_3=m
+CONFIG_NLS_ISO8859_4=m
+CONFIG_NLS_ISO8859_5=m
+CONFIG_NLS_ISO8859_6=m
+CONFIG_NLS_ISO8859_7=m
+CONFIG_NLS_ISO8859_9=m
+CONFIG_NLS_ISO8859_13=m
+CONFIG_NLS_ISO8859_14=m
+CONFIG_NLS_ISO8859_15=m
+CONFIG_NLS_KOI8_R=m
+CONFIG_NLS_KOI8_U=m
+CONFIG_NLS_UTF8=m
+
+#
+# Profiling support
+#
+CONFIG_PROFILING=y
+# CONFIG_OPROFILE is not set
+
+#
+# Kernel hacking
+#
+# CONFIG_PRINTK_TIME is not set
+CONFIG_MAGIC_SYSRQ=y
+# CONFIG_DEBUG_KERNEL is not set
+CONFIG_LOG_BUF_SHIFT=15
+# CONFIG_CROSSCOMPILE is not set
+CONFIG_CMDLINE=""
+# CONFIG_SB1XXX_CORELIS is not set
+
+#
+# Security options
+#
+CONFIG_KEYS=y
+# CONFIG_KEYS_DEBUG_PROC_KEYS is not set
+CONFIG_SECURITY=y
+CONFIG_SECURITY_NETWORK=y
+CONFIG_SECURITY_NETWORK_XFRM=y
+CONFIG_SECURITY_CAPABILITIES=y
+CONFIG_SECURITY_SELINUX=y
+CONFIG_SECURITY_SELINUX_BOOTPARAM=y
+CONFIG_SECURITY_SELINUX_BOOTPARAM_VALUE=0
+CONFIG_SECURITY_SELINUX_DISABLE=y
+CONFIG_SECURITY_SELINUX_DEVELOP=y
+CONFIG_SECURITY_SELINUX_AVC_STATS=y
+CONFIG_SECURITY_SELINUX_CHECKREQPROT_VALUE=1
+
+#
+# Cryptographic options
+#
+CONFIG_CRYPTO=y
+CONFIG_CRYPTO_HMAC=y
+CONFIG_CRYPTO_NULL=m
+CONFIG_CRYPTO_MD4=m
+CONFIG_CRYPTO_MD5=y
+CONFIG_CRYPTO_SHA1=m
+CONFIG_CRYPTO_SHA256=m
+CONFIG_CRYPTO_SHA512=m
+CONFIG_CRYPTO_WP512=m
+CONFIG_CRYPTO_TGR192=m
+CONFIG_CRYPTO_DES=m
+CONFIG_CRYPTO_BLOWFISH=m
+CONFIG_CRYPTO_TWOFISH=m
+CONFIG_CRYPTO_SERPENT=m
+CONFIG_CRYPTO_AES=m
+CONFIG_CRYPTO_CAST5=m
+CONFIG_CRYPTO_CAST6=m
+CONFIG_CRYPTO_TEA=m
+CONFIG_CRYPTO_ARC4=m
+CONFIG_CRYPTO_KHAZAD=m
+CONFIG_CRYPTO_ANUBIS=m
+CONFIG_CRYPTO_DEFLATE=m
+CONFIG_CRYPTO_MICHAEL_MIC=m
+CONFIG_CRYPTO_CRC32C=m
+CONFIG_CRYPTO_TEST=m
+
+#
+# Hardware crypto devices
+#
+
+#
+# Library routines
+#
+CONFIG_CRC_CCITT=m
+# CONFIG_CRC16 is not set
+CONFIG_CRC32=y
+CONFIG_LIBCRC32C=m
+CONFIG_ZLIB_INFLATE=y
+CONFIG_ZLIB_DEFLATE=m
+CONFIG_TEXTSEARCH=y
+CONFIG_TEXTSEARCH_KMP=m
+CONFIG_TEXTSEARCH_BM=m
+CONFIG_TEXTSEARCH_FSM=m
+CONFIG_MSNDPIN_INIT_FILE="/etc/sound/pndspini.bin"
+CONFIG_USB_NET2280=m
+CONFIG_USB_ALI_M5632=y
+CONFIG_MSNDPIN_PERM_FILE="/etc/sound/pndsperm.bin"
+CONFIG_USB_FILE_STORAGE=m
+CONFIG_SND_SEQUENCER_OSS=y
+CONFIG_SOUND_EMU10K1=m
+CONFIG_USB_EPSON2888=y
+CONFIG_SND_VIRMIDI=m
+CONFIG_USB_AN2720=y
+# CONFIG_USB_GADGET_PXA2XX is not set
+CONFIG_USB_GADGET_DUALSPEED=y
+# CONFIG_USB_GADGET_OMAP is not set
+CONFIG_USB_GADGET_NET2280=y
+CONFIG_USB_ETH_RNDIS=y
+# CONFIG_USB_GADGET_DEBUG_FILES is not set
+CONFIG_VIDEO_BUF=m
+CONFIG_USB_FILE_STORAGE_TEST=y
+CONFIG_MSNDCLAS_INIT_FILE="/etc/sound/msndinit.bin"
+CONFIG_MSNDCLAS_PERM_FILE="/etc/sound/msndperm.bin"
+# CONFIG_USB_GADGET_DUMMY_HCD is not set
+CONFIG_USB_GADGETFS=m
+CONFIG_USB_ETH=m
+CONFIG_USB_ARMLINUX=y
+# CONFIG_USB_W9968CF is not set
+# CONFIG_USB_GADGET_GOKU is not set
+# CONFIG_USB_GADGET_LH7A40X is not set
+CONFIG_USB_G_SERIAL=m
+CONFIG_USB_BELKIN=y
+CONFIG_USB_ZERO=m
+CONFIG_SND_SEQ_DUMMY=m
+CONFIG_USB_STORAGE_ONETOUCH=y
+CONFIG_USB_ACM=m

Added: dists/sid/linux-2.6/debian/config/mipsel/config.sb1a-bcm91480b
==============================================================================
--- (empty file)
+++ dists/sid/linux-2.6/debian/config/mipsel/config.sb1a-bcm91480b	Mon Nov 26 20:06:56 2007
@@ -0,0 +1,1687 @@
+#
+# Machine selection
+#
+# CONFIG_MIPS_MTX1 is not set
+# CONFIG_MIPS_BOSPORUS is not set
+# CONFIG_MIPS_PB1000 is not set
+# CONFIG_MIPS_PB1100 is not set
+# CONFIG_MIPS_PB1500 is not set
+# CONFIG_MIPS_PB1550 is not set
+# CONFIG_MIPS_PB1200 is not set
+# CONFIG_MIPS_DB1000 is not set
+# CONFIG_MIPS_DB1100 is not set
+# CONFIG_MIPS_DB1500 is not set
+# CONFIG_MIPS_DB1550 is not set
+# CONFIG_MIPS_DB1200 is not set
+# CONFIG_MIPS_MIRAGE is not set
+# CONFIG_MIPS_COBALT is not set
+# CONFIG_MACH_DECSTATION is not set
+# CONFIG_MIPS_EV64120 is not set
+# CONFIG_MIPS_EV96100 is not set
+# CONFIG_MIPS_IVR is not set
+# CONFIG_MIPS_ITE8172 is not set
+# CONFIG_MACH_JAZZ is not set
+# CONFIG_LASAT is not set
+# CONFIG_MIPS_ATLAS is not set
+# CONFIG_MIPS_MALTA is not set
+# CONFIG_MIPS_SEAD is not set
+# CONFIG_MIPS_SIM is not set
+# CONFIG_MOMENCO_JAGUAR_ATX is not set
+# CONFIG_MOMENCO_OCELOT is not set
+# CONFIG_MOMENCO_OCELOT_3 is not set
+# CONFIG_MOMENCO_OCELOT_C is not set
+# CONFIG_MOMENCO_OCELOT_G is not set
+# CONFIG_MIPS_XXS1500 is not set
+# CONFIG_PNX8550_V2PCI is not set
+# CONFIG_PNX8550_JBS is not set
+# CONFIG_DDB5074 is not set
+# CONFIG_DDB5476 is not set
+# CONFIG_DDB5477 is not set
+# CONFIG_MACH_VR41XX is not set
+# CONFIG_PMC_YOSEMITE is not set
+# CONFIG_QEMU is not set
+# CONFIG_SGI_IP22 is not set
+# CONFIG_SGI_IP27 is not set
+# CONFIG_SGI_IP32 is not set
+CONFIG_SIBYTE_BIGSUR=y
+# CONFIG_SIBYTE_SWARM is not set
+# CONFIG_SIBYTE_SENTOSA is not set
+# CONFIG_SIBYTE_RHONE is not set
+# CONFIG_SIBYTE_CARMEL is not set
+# CONFIG_SIBYTE_PTSWARM is not set
+# CONFIG_SIBYTE_LITTLESUR is not set
+# CONFIG_SIBYTE_CRHINE is not set
+# CONFIG_SIBYTE_CRHONE is not set
+# CONFIG_SNI_RM200_PCI is not set
+# CONFIG_TOSHIBA_JMR3927 is not set
+# CONFIG_TOSHIBA_RBTX4927 is not set
+# CONFIG_TOSHIBA_RBTX4938 is not set
+CONFIG_SIBYTE_BCM1x80=y
+CONFIG_SIBYTE_SB1xxx_SOC=y
+# CONFIG_CPU_SB1_PASS_1 is not set
+# CONFIG_CPU_SB1_PASS_2_1250 is not set
+# CONFIG_CPU_SB1_PASS_2_2 is not set
+# CONFIG_CPU_SB1_PASS_4 is not set
+# CONFIG_CPU_SB1_PASS_2_112x is not set
+# CONFIG_CPU_SB1_PASS_3 is not set
+# CONFIG_SIMULATION is not set
+# CONFIG_SB1_CEX_ALWAYS_FATAL is not set
+# CONFIG_SB1_CERR_STALL is not set
+CONFIG_SIBYTE_CFE=y
+# CONFIG_SIBYTE_CFE_CONSOLE is not set
+# CONFIG_SIBYTE_BUS_WATCHER is not set
+# CONFIG_SIBYTE_SB1250_PROF is not set
+# CONFIG_SIBYTE_TBPROF is not set
+CONFIG_RWSEM_GENERIC_SPINLOCK=y
+CONFIG_GENERIC_CALIBRATE_DELAY=y
+CONFIG_DMA_COHERENT=y
+# CONFIG_CPU_BIG_ENDIAN is not set
+CONFIG_CPU_LITTLE_ENDIAN=y
+CONFIG_SYS_SUPPORTS_BIG_ENDIAN=y
+CONFIG_SYS_SUPPORTS_LITTLE_ENDIAN=y
+CONFIG_SWAP_IO_SPACE=y
+CONFIG_BOOT_ELF32=y
+CONFIG_MIPS_L1_CACHE_SHIFT=5
+
+#
+# CPU selection
+#
+# CONFIG_CPU_MIPS32_R1 is not set
+# CONFIG_CPU_MIPS32_R2 is not set
+# CONFIG_CPU_MIPS64_R1 is not set
+# CONFIG_CPU_MIPS64_R2 is not set
+# CONFIG_CPU_R3000 is not set
+# CONFIG_CPU_TX39XX is not set
+# CONFIG_CPU_VR41XX is not set
+# CONFIG_CPU_R4300 is not set
+# CONFIG_CPU_R4X00 is not set
+# CONFIG_CPU_TX49XX is not set
+# CONFIG_CPU_R5000 is not set
+# CONFIG_CPU_R5432 is not set
+# CONFIG_CPU_R6000 is not set
+# CONFIG_CPU_NEVADA is not set
+# CONFIG_CPU_R8000 is not set
+# CONFIG_CPU_R10000 is not set
+# CONFIG_CPU_RM7000 is not set
+# CONFIG_CPU_RM9000 is not set
+CONFIG_CPU_SB1=y
+CONFIG_SYS_HAS_CPU_SB1=y
+CONFIG_SYS_SUPPORTS_32BIT_KERNEL=y
+CONFIG_SYS_SUPPORTS_64BIT_KERNEL=y
+CONFIG_CPU_SUPPORTS_32BIT_KERNEL=y
+CONFIG_CPU_SUPPORTS_64BIT_KERNEL=y
+
+#
+# Kernel type
+#
+# CONFIG_32BIT is not set
+CONFIG_64BIT=y
+CONFIG_PAGE_SIZE_4KB=y
+# CONFIG_PAGE_SIZE_8KB is not set
+# CONFIG_PAGE_SIZE_16KB is not set
+# CONFIG_PAGE_SIZE_64KB is not set
+# CONFIG_SIBYTE_DMA_PAGEOPS is not set
+# CONFIG_MIPS_MT is not set
+CONFIG_CPU_HAS_LLSC=y
+CONFIG_CPU_HAS_SYNC=y
+CONFIG_GENERIC_HARDIRQS=y
+CONFIG_GENERIC_IRQ_PROBE=y
+CONFIG_CPU_SUPPORTS_HIGHMEM=y
+CONFIG_ARCH_FLATMEM_ENABLE=y
+CONFIG_SELECT_MEMORY_MODEL=y
+CONFIG_FLATMEM_MANUAL=y
+# CONFIG_DISCONTIGMEM_MANUAL is not set
+# CONFIG_SPARSEMEM_MANUAL is not set
+CONFIG_FLATMEM=y
+CONFIG_FLAT_NODE_MEM_MAP=y
+# CONFIG_SPARSEMEM_STATIC is not set
+CONFIG_SPLIT_PTLOCK_CPUS=4
+CONFIG_SMP=y
+CONFIG_NR_CPUS=4
+CONFIG_PREEMPT_NONE=y
+# CONFIG_PREEMPT_VOLUNTARY is not set
+# CONFIG_PREEMPT is not set
+CONFIG_PREEMPT_BKL=y
+
+#
+# Code maturity level options
+#
+CONFIG_EXPERIMENTAL=y
+CONFIG_LOCK_KERNEL=y
+
+#
+# General setup
+#
+CONFIG_LOCALVERSION=""
+CONFIG_LOCALVERSION_AUTO=y
+CONFIG_SWAP=y
+CONFIG_SYSVIPC=y
+CONFIG_POSIX_MQUEUE=y
+CONFIG_BSD_PROCESS_ACCT=y
+# CONFIG_BSD_PROCESS_ACCT_V3 is not set
+CONFIG_AUDIT=y
+# CONFIG_IKCONFIG is not set
+CONFIG_INITRAMFS_SOURCE=""
+# CONFIG_CC_OPTIMIZE_FOR_SIZE is not set
+CONFIG_EMBEDDED=y
+CONFIG_HOTPLUG=y
+CONFIG_BASE_FULL=y
+CONFIG_CC_ALIGN_FUNCTIONS=0
+CONFIG_CC_ALIGN_LABELS=0
+CONFIG_CC_ALIGN_LOOPS=0
+CONFIG_CC_ALIGN_JUMPS=0
+CONFIG_SLAB=y
+CONFIG_BASE_SMALL=0
+# CONFIG_SLOB is not set
+
+#
+# Loadable module support
+#
+CONFIG_MODULES=y
+CONFIG_OBSOLETE_MODPARM=y
+CONFIG_KMOD=y
+CONFIG_STOP_MACHINE=y
+
+#
+# Block layer
+#
+
+#
+# Bus options (PCI, PCMCIA, EISA, ISA, TC)
+#
+CONFIG_HW_HAS_PCI=y
+CONFIG_PCI=y
+CONFIG_PCI_DOMAINS=y
+CONFIG_MMU=y
+
+#
+# PCCARD (PCMCIA/CardBus) support
+#
+# CONFIG_PCCARD is not set
+
+#
+# PCI Hotplug Support
+#
+# CONFIG_HOTPLUG_PCI is not set
+
+#
+# Executable file formats
+#
+CONFIG_BINFMT_ELF=y
+CONFIG_BINFMT_MISC=m
+CONFIG_BUILD_ELF64=y
+CONFIG_MIPS32_COMPAT=y
+CONFIG_COMPAT=y
+CONFIG_MIPS32_O32=y
+CONFIG_MIPS32_N32=y
+CONFIG_BINFMT_ELF32=y
+
+#
+# Networking
+#
+CONFIG_NET=y
+
+#
+# Networking options
+#
+CONFIG_PACKET=y
+CONFIG_PACKET_MMAP=y
+CONFIG_UNIX=y
+CONFIG_XFRM=y
+CONFIG_XFRM_USER=y
+CONFIG_NET_KEY=y
+CONFIG_INET=y
+CONFIG_IP_MULTICAST=y
+# CONFIG_IP_ADVANCED_ROUTER is not set
+CONFIG_IP_FIB_HASH=y
+CONFIG_IP_PNP=y
+CONFIG_IP_PNP_DHCP=y
+CONFIG_IP_PNP_BOOTP=y
+# CONFIG_IP_PNP_RARP is not set
+CONFIG_NET_IPIP=m
+CONFIG_NET_IPGRE=m
+# CONFIG_NET_IPGRE_BROADCAST is not set
+# CONFIG_IP_MROUTE is not set
+# CONFIG_ARPD is not set
+# CONFIG_SYN_COOKIES is not set
+CONFIG_INET_AH=m
+CONFIG_INET_ESP=m
+CONFIG_INET_IPCOMP=m
+CONFIG_INET_TUNNEL=m
+CONFIG_INET_DIAG=y
+CONFIG_INET_TCP_DIAG=y
+CONFIG_TCP_CONG_ADVANCED=y
+
+#
+# TCP congestion control
+#
+CONFIG_TCP_CONG_BIC=y
+CONFIG_TCP_CONG_CUBIC=m
+CONFIG_TCP_CONG_WESTWOOD=m
+CONFIG_TCP_CONG_HTCP=m
+CONFIG_TCP_CONG_HSTCP=m
+CONFIG_TCP_CONG_HYBLA=m
+CONFIG_TCP_CONG_VEGAS=m
+CONFIG_TCP_CONG_SCALABLE=m
+
+#
+# IP: Virtual Server Configuration
+#
+# CONFIG_IP_VS is not set
+CONFIG_IPV6=m
+CONFIG_IPV6_PRIVACY=y
+CONFIG_INET6_AH=m
+CONFIG_INET6_ESP=m
+CONFIG_INET6_IPCOMP=m
+CONFIG_INET6_TUNNEL=m
+CONFIG_IPV6_TUNNEL=m
+CONFIG_NETFILTER=y
+# CONFIG_NETFILTER_DEBUG is not set
+
+#
+# Core Netfilter Configuration
+#
+CONFIG_NETFILTER_NETLINK=m
+CONFIG_NETFILTER_NETLINK_QUEUE=m
+CONFIG_NETFILTER_NETLINK_LOG=m
+CONFIG_NETFILTER_XTABLES=m
+CONFIG_NETFILTER_XT_TARGET_CLASSIFY=m
+CONFIG_NETFILTER_XT_TARGET_CONNMARK=m
+CONFIG_NETFILTER_XT_TARGET_MARK=m
+CONFIG_NETFILTER_XT_TARGET_NFQUEUE=m
+CONFIG_NETFILTER_XT_TARGET_NOTRACK=m
+CONFIG_NETFILTER_XT_MATCH_COMMENT=m
+CONFIG_NETFILTER_XT_MATCH_CONNBYTES=m
+CONFIG_NETFILTER_XT_MATCH_CONNMARK=m
+CONFIG_NETFILTER_XT_MATCH_CONNTRACK=m
+CONFIG_NETFILTER_XT_MATCH_DCCP=m
+CONFIG_NETFILTER_XT_MATCH_HELPER=m
+CONFIG_NETFILTER_XT_MATCH_LENGTH=m
+CONFIG_NETFILTER_XT_MATCH_LIMIT=m
+CONFIG_NETFILTER_XT_MATCH_MAC=m
+CONFIG_NETFILTER_XT_MATCH_MARK=m
+CONFIG_NETFILTER_XT_MATCH_PKTTYPE=m
+CONFIG_NETFILTER_XT_MATCH_REALM=m
+CONFIG_NETFILTER_XT_MATCH_SCTP=m
+CONFIG_NETFILTER_XT_MATCH_STATE=m
+CONFIG_NETFILTER_XT_MATCH_STRING=m
+CONFIG_NETFILTER_XT_MATCH_TCPMSS=m
+
+#
+# IP: Netfilter Configuration
+#
+CONFIG_IP_NF_QUEUE=m
+CONFIG_IP_NF_IPTABLES=m
+CONFIG_IP_NF_MATCH_IPRANGE=m
+CONFIG_IP_NF_MATCH_MULTIPORT=m
+CONFIG_IP_NF_MATCH_TOS=m
+CONFIG_IP_NF_MATCH_RECENT=m
+CONFIG_IP_NF_MATCH_ECN=m
+CONFIG_IP_NF_MATCH_DSCP=m
+CONFIG_IP_NF_MATCH_AH_ESP=m
+CONFIG_IP_NF_MATCH_TTL=m
+CONFIG_IP_NF_MATCH_OWNER=m
+CONFIG_IP_NF_MATCH_ADDRTYPE=m
+CONFIG_IP_NF_MATCH_HASHLIMIT=m
+CONFIG_IP_NF_MATCH_POLICY=m
+CONFIG_IP_NF_FILTER=m
+CONFIG_IP_NF_TARGET_REJECT=m
+CONFIG_IP_NF_TARGET_LOG=m
+CONFIG_IP_NF_TARGET_ULOG=m
+CONFIG_IP_NF_TARGET_TCPMSS=m
+CONFIG_IP_NF_TARGET_MASQUERADE=m
+CONFIG_IP_NF_TARGET_REDIRECT=m
+CONFIG_IP_NF_TARGET_NETMAP=m
+CONFIG_IP_NF_TARGET_SAME=m
+CONFIG_IP_NF_MANGLE=m
+CONFIG_IP_NF_TARGET_TOS=m
+CONFIG_IP_NF_TARGET_ECN=m
+CONFIG_IP_NF_TARGET_DSCP=m
+CONFIG_IP_NF_TARGET_TTL=m
+CONFIG_IP_NF_TARGET_CLUSTERIP=m
+CONFIG_IP_NF_RAW=m
+CONFIG_IP_NF_ARPTABLES=m
+CONFIG_IP_NF_ARPFILTER=m
+CONFIG_IP_NF_ARP_MANGLE=m
+
+#
+# IPv6: Netfilter Configuration (EXPERIMENTAL)
+#
+CONFIG_IP6_NF_QUEUE=m
+CONFIG_IP6_NF_IPTABLES=m
+CONFIG_IP6_NF_MATCH_RT=m
+CONFIG_IP6_NF_MATCH_OPTS=m
+CONFIG_IP6_NF_MATCH_FRAG=m
+CONFIG_IP6_NF_MATCH_HL=m
+CONFIG_IP6_NF_MATCH_MULTIPORT=m
+CONFIG_IP6_NF_MATCH_OWNER=m
+CONFIG_IP6_NF_MATCH_IPV6HEADER=m
+CONFIG_IP6_NF_MATCH_AHESP=m
+CONFIG_IP6_NF_MATCH_EUI64=m
+CONFIG_IP6_NF_MATCH_POLICY=m
+CONFIG_IP6_NF_FILTER=m
+CONFIG_IP6_NF_TARGET_LOG=m
+# CONFIG_IP6_NF_TARGET_REJECT is not set
+CONFIG_IP6_NF_MANGLE=m
+# CONFIG_IP6_NF_TARGET_HL is not set
+CONFIG_IP6_NF_RAW=m
+
+#
+# DCCP Configuration (EXPERIMENTAL)
+#
+# CONFIG_IP_DCCP is not set
+
+#
+# SCTP Configuration (EXPERIMENTAL)
+#
+CONFIG_IP_SCTP=m
+# CONFIG_SCTP_DBG_MSG is not set
+# CONFIG_SCTP_DBG_OBJCNT is not set
+# CONFIG_SCTP_HMAC_NONE is not set
+# CONFIG_SCTP_HMAC_SHA1 is not set
+CONFIG_SCTP_HMAC_MD5=y
+
+#
+# TIPC Configuration (EXPERIMENTAL)
+#
+CONFIG_TIPC=m
+CONFIG_TIPC_ADVANCED=y
+CONFIG_TIPC_ZONES=3
+CONFIG_TIPC_CLUSTERS=1
+CONFIG_TIPC_NODES=255
+CONFIG_TIPC_SLAVE_NODES=0
+CONFIG_TIPC_PORTS=8191
+CONFIG_TIPC_LOG=0
+# CONFIG_TIPC_DEBUG is not set
+# CONFIG_ATM is not set
+# CONFIG_BRIDGE is not set
+# CONFIG_VLAN_8021Q is not set
+# CONFIG_DECNET is not set
+# CONFIG_LLC2 is not set
+# CONFIG_IPX is not set
+# CONFIG_ATALK is not set
+# CONFIG_X25 is not set
+# CONFIG_LAPB is not set
+# CONFIG_NET_DIVERT is not set
+# CONFIG_ECONET is not set
+# CONFIG_WAN_ROUTER is not set
+
+#
+# Network testing
+#
+# CONFIG_HAMRADIO is not set
+# CONFIG_IRDA is not set
+# CONFIG_BT is not set
+# CONFIG_IEEE80211 is not set
+
+#
+# Device Drivers
+#
+
+#
+# Generic Driver Options
+#
+CONFIG_STANDALONE=y
+CONFIG_PREVENT_FIRMWARE_BUILD=y
+CONFIG_FW_LOADER=m
+
+#
+# Connector - unified userspace <-> kernelspace linker
+#
+# CONFIG_CONNECTOR is not set
+
+#
+# Memory Technology Devices (MTD)
+#
+# CONFIG_MTD is not set
+
+#
+# Parallel port support
+#
+
+#
+# Plug and Play support
+#
+
+#
+# Block devices
+#
+# CONFIG_BLK_CPQ_DA is not set
+# CONFIG_BLK_CPQ_CISS_DA is not set
+# CONFIG_BLK_DEV_DAC960 is not set
+# CONFIG_BLK_DEV_UMEM is not set
+# CONFIG_BLK_DEV_COW_COMMON is not set
+CONFIG_BLK_DEV_LOOP=m
+CONFIG_BLK_DEV_CRYPTOLOOP=m
+CONFIG_BLK_DEV_NBD=m
+# CONFIG_BLK_DEV_SX8 is not set
+# CONFIG_BLK_DEV_UB is not set
+CONFIG_BLK_DEV_RAM=y
+CONFIG_BLK_DEV_RAM_COUNT=16
+CONFIG_BLK_DEV_RAM_SIZE=8192
+CONFIG_BLK_DEV_INITRD=y
+# CONFIG_CDROM_PKTCDVD is not set
+# CONFIG_ATA_OVER_ETH is not set
+
+#
+# ATA/ATAPI/MFM/RLL support
+#
+CONFIG_IDE=y
+CONFIG_BLK_DEV_IDE=y
+
+#
+# Please see Documentation/ide.txt for help/info on IDE drives
+#
+# CONFIG_BLK_DEV_IDE_SATA is not set
+CONFIG_BLK_DEV_IDEDISK=y
+# CONFIG_IDEDISK_MULTI_MODE is not set
+CONFIG_BLK_DEV_IDECD=m
+CONFIG_BLK_DEV_IDETAPE=m
+CONFIG_BLK_DEV_IDEFLOPPY=m
+# CONFIG_BLK_DEV_IDESCSI is not set
+
+#
+# IDE chipset support/bugfixes
+#
+CONFIG_IDE_GENERIC=y
+CONFIG_BLK_DEV_IDEPCI=y
+CONFIG_IDEPCI_SHARE_IRQ=y
+# CONFIG_BLK_DEV_OFFBOARD is not set
+# CONFIG_BLK_DEV_GENERIC is not set
+# CONFIG_BLK_DEV_OPTI621 is not set
+CONFIG_BLK_DEV_IDEDMA_PCI=y
+# CONFIG_BLK_DEV_IDEDMA_FORCED is not set
+# CONFIG_IDEDMA_ONLYDISK is not set
+CONFIG_BLK_DEV_AEC62XX=m
+CONFIG_BLK_DEV_ALI15X3=m
+# CONFIG_WDC_ALI15X3 is not set
+CONFIG_BLK_DEV_AMD74XX=m
+CONFIG_BLK_DEV_CMD64X=m
+CONFIG_BLK_DEV_TRIFLEX=m
+CONFIG_BLK_DEV_CY82C693=m
+# CONFIG_BLK_DEV_CS5520 is not set
+CONFIG_BLK_DEV_CS5530=m
+CONFIG_BLK_DEV_HPT34X=m
+# CONFIG_HPT34X_AUTODMA is not set
+CONFIG_BLK_DEV_HPT366=m
+CONFIG_BLK_DEV_SC1200=m
+CONFIG_BLK_DEV_PIIX=m
+CONFIG_BLK_DEV_IT821X=m
+CONFIG_BLK_DEV_NS87415=m
+CONFIG_BLK_DEV_PDC202XX_OLD=m
+# CONFIG_PDC202XX_BURST is not set
+CONFIG_BLK_DEV_PDC202XX_NEW=m
+CONFIG_BLK_DEV_SVWKS=m
+CONFIG_BLK_DEV_SIIMAGE=m
+CONFIG_BLK_DEV_SLC90E66=m
+CONFIG_BLK_DEV_TRM290=m
+CONFIG_BLK_DEV_VIA82CXXX=m
+# CONFIG_BLK_DEV_IDE_SWARM is not set
+# CONFIG_IDE_ARM is not set
+CONFIG_BLK_DEV_IDEDMA=y
+# CONFIG_IDEDMA_IVB is not set
+# CONFIG_BLK_DEV_HD is not set
+
+#
+# SCSI device support
+#
+CONFIG_RAID_ATTRS=m
+CONFIG_SCSI=m
+CONFIG_SCSI_PROC_FS=y
+
+#
+# SCSI support type (disk, tape, CD-ROM)
+#
+CONFIG_BLK_DEV_SD=m
+CONFIG_CHR_DEV_ST=m
+CONFIG_CHR_DEV_OSST=m
+CONFIG_BLK_DEV_SR=m
+CONFIG_BLK_DEV_SR_VENDOR=y
+CONFIG_CHR_DEV_SG=m
+CONFIG_CHR_DEV_SCH=m
+
+#
+# Some SCSI devices (e.g. CD jukebox) support multiple LUNs
+#
+# CONFIG_SCSI_MULTI_LUN is not set
+# CONFIG_SCSI_CONSTANTS is not set
+# CONFIG_SCSI_LOGGING is not set
+
+#
+# SCSI Transport Attributes
+#
+CONFIG_SCSI_SPI_ATTRS=m
+CONFIG_SCSI_FC_ATTRS=m
+CONFIG_SCSI_ISCSI_ATTRS=m
+# CONFIG_SCSI_SAS_ATTRS is not set
+
+#
+# SCSI low-level drivers
+#
+CONFIG_ISCSI_TCP=m
+CONFIG_BLK_DEV_3W_XXXX_RAID=m
+CONFIG_SCSI_3W_9XXX=m
+CONFIG_SCSI_ACARD=m
+CONFIG_SCSI_AACRAID=m
+CONFIG_SCSI_AIC7XXX=m
+CONFIG_AIC7XXX_CMDS_PER_DEVICE=32
+CONFIG_AIC7XXX_RESET_DELAY_MS=15000
+CONFIG_AIC7XXX_DEBUG_ENABLE=y
+CONFIG_AIC7XXX_DEBUG_MASK=0
+CONFIG_AIC7XXX_REG_PRETTY_PRINT=y
+CONFIG_SCSI_AIC7XXX_OLD=m
+CONFIG_SCSI_AIC79XX=m
+CONFIG_AIC79XX_CMDS_PER_DEVICE=32
+CONFIG_AIC79XX_RESET_DELAY_MS=15000
+CONFIG_AIC79XX_DEBUG_ENABLE=y
+CONFIG_AIC79XX_DEBUG_MASK=0
+CONFIG_AIC79XX_REG_PRETTY_PRINT=y
+# CONFIG_MEGARAID_NEWGEN is not set
+CONFIG_MEGARAID_LEGACY=m
+CONFIG_MEGARAID_SAS=m
+CONFIG_SCSI_DMX3191D=m
+CONFIG_SCSI_FUTURE_DOMAIN=m
+CONFIG_SCSI_IPS=m
+CONFIG_SCSI_INITIO=m
+CONFIG_SCSI_INIA100=m
+CONFIG_SCSI_SYM53C8XX_2=m
+CONFIG_SCSI_SYM53C8XX_DMA_ADDRESSING_MODE=1
+CONFIG_SCSI_SYM53C8XX_DEFAULT_TAGS=16
+CONFIG_SCSI_SYM53C8XX_MAX_TAGS=64
+# CONFIG_SCSI_IPR is not set
+CONFIG_SCSI_QLOGIC_FC=m
+# CONFIG_SCSI_QLOGIC_FC_FIRMWARE is not set
+CONFIG_SCSI_QLOGIC_1280=m
+CONFIG_SCSI_QLA_FC=m
+# CONFIG_SCSI_QLA2XXX_EMBEDDED_FIRMWARE is not set
+CONFIG_SCSI_LPFC=m
+CONFIG_SCSI_DC395x=m
+CONFIG_SCSI_DC390T=m
+CONFIG_SCSI_DEBUG=m
+
+#
+# Serial ATA (prod) and Parallel ATA (experimental) drivers
+#
+CONFIG_ATA=m
+CONFIG_SATA_AHCI=m
+CONFIG_SATA_SVW=m
+CONFIG_ATA_PIIX=m
+CONFIG_SATA_MV=m
+CONFIG_SATA_NV=m
+CONFIG_PDC_ADMA=m
+CONFIG_SATA_QSTOR=m
+CONFIG_SATA_PROMISE=m
+CONFIG_SATA_SX4=m
+CONFIG_SATA_SIL=m
+CONFIG_SATA_SIL24=m
+CONFIG_SATA_SIS=m
+CONFIG_SATA_ULI=m
+CONFIG_SATA_VIA=m
+CONFIG_SATA_VITESSE=m
+
+#
+# Multi-device support (RAID and LVM)
+#
+CONFIG_MD=y
+CONFIG_BLK_DEV_MD=m
+CONFIG_MD_LINEAR=m
+CONFIG_MD_RAID0=m
+CONFIG_MD_RAID1=m
+CONFIG_MD_RAID10=m
+CONFIG_MD_RAID5=m
+CONFIG_MD_RAID6=m
+CONFIG_MD_MULTIPATH=m
+CONFIG_MD_FAULTY=m
+CONFIG_BLK_DEV_DM=m
+CONFIG_DM_CRYPT=m
+CONFIG_DM_SNAPSHOT=m
+CONFIG_DM_MIRROR=m
+CONFIG_DM_ZERO=m
+CONFIG_DM_MULTIPATH=m
+# CONFIG_DM_MULTIPATH_EMC is not set
+
+#
+# Fusion MPT device support
+#
+# CONFIG_FUSION is not set
+# CONFIG_FUSION_SPI is not set
+# CONFIG_FUSION_FC is not set
+# CONFIG_FUSION_SAS is not set
+
+#
+# IEEE 1394 (FireWire) support
+#
+# CONFIG_FIREWIRE is not set
+
+#
+# I2O device support
+#
+# CONFIG_I2O is not set
+
+#
+# Network device support
+#
+CONFIG_NETDEVICES=y
+CONFIG_DUMMY=m
+CONFIG_BONDING=m
+CONFIG_EQUALIZER=m
+CONFIG_TUN=m
+
+#
+# ARCnet devices
+#
+# CONFIG_ARCNET is not set
+
+#
+# PHY device support
+#
+# CONFIG_PHYLIB is not set
+
+#
+# Ethernet (10 or 100Mbit)
+#
+CONFIG_NET_ETHERNET=y
+CONFIG_MII=y
+CONFIG_NET_SB1250_MAC=y
+CONFIG_SBMAC_NAPI=y
+# CONFIG_HAPPYMEAL is not set
+# CONFIG_SUNGEM is not set
+# CONFIG_CASSINI is not set
+# CONFIG_NET_VENDOR_3COM is not set
+# CONFIG_DM9000 is not set
+
+#
+# Tulip family network device support
+#
+# CONFIG_NET_TULIP is not set
+# CONFIG_HP100 is not set
+CONFIG_NET_PCI=y
+CONFIG_PCNET32=m
+CONFIG_AMD8111_ETH=m
+# CONFIG_AMD8111E_NAPI is not set
+CONFIG_ADAPTEC_STARFIRE=m
+# CONFIG_ADAPTEC_STARFIRE_NAPI is not set
+CONFIG_B44=m
+CONFIG_FORCEDETH=m
+CONFIG_EEPRO100=m
+CONFIG_E100=m
+CONFIG_FEALNX=m
+CONFIG_NATSEMI=m
+CONFIG_NE2K_PCI=m
+CONFIG_8139CP=m
+CONFIG_8139TOO=m
+CONFIG_8139TOO_PIO=y
+# CONFIG_8139TOO_TUNE_TWISTER is not set
+CONFIG_8139TOO_8129=y
+# CONFIG_8139_OLD_RX_RESET is not set
+CONFIG_SIS900=m
+CONFIG_EPIC100=m
+CONFIG_SUNDANCE=m
+# CONFIG_SUNDANCE_MMIO is not set
+CONFIG_VIA_RHINE=m
+# CONFIG_VIA_RHINE_MMIO is not set
+# CONFIG_LAN_SAA9730 is not set
+# CONFIG_NET_POCKET is not set
+
+#
+# Ethernet (1000 Mbit)
+#
+CONFIG_DL2K=m
+CONFIG_E1000=m
+# CONFIG_E1000_NAPI is not set
+# CONFIG_E1000_DISABLE_PACKET_SPLIT is not set
+CONFIG_NS83820=m
+CONFIG_HAMACHI=m
+CONFIG_YELLOWFIN=m
+CONFIG_R8169=m
+# CONFIG_R8169_NAPI is not set
+CONFIG_SIS190=m
+CONFIG_SKGE=m
+CONFIG_SKY2=m
+CONFIG_VIA_VELOCITY=m
+CONFIG_TIGON3=m
+CONFIG_BNX2=m
+
+#
+# Ethernet (10000 Mbit)
+#
+# CONFIG_CHELSIO_T1 is not set
+# CONFIG_IXGB is not set
+# CONFIG_S2IO is not set
+
+#
+# Token Ring devices
+#
+# CONFIG_TR is not set
+
+#
+# Wireless LAN (non-hamradio)
+#
+# CONFIG_NET_RADIO is not set
+
+#
+# Wan interfaces
+#
+# CONFIG_WAN is not set
+# CONFIG_FDDI is not set
+# CONFIG_HIPPI is not set
+# CONFIG_PLIP is not set
+CONFIG_PPP=m
+# CONFIG_PPP_MULTILINK is not set
+CONFIG_PPP_FILTER=y
+CONFIG_PPP_ASYNC=m
+CONFIG_PPP_SYNC_TTY=m
+CONFIG_PPP_DEFLATE=m
+CONFIG_PPP_BSDCOMP=m
+CONFIG_PPP_MPPE=m
+CONFIG_PPPOE=m
+CONFIG_SLIP=m
+CONFIG_SLIP_COMPRESSED=y
+CONFIG_SLIP_SMART=y
+CONFIG_SLIP_MODE_SLIP6=y
+# CONFIG_NET_FC is not set
+# CONFIG_SHAPER is not set
+# CONFIG_NETCONSOLE is not set
+# CONFIG_NETPOLL is not set
+# CONFIG_NET_POLL_CONTROLLER is not set
+
+#
+# ISDN subsystem
+#
+# CONFIG_ISDN is not set
+
+#
+# Telephony Support
+#
+# CONFIG_PHONE is not set
+
+#
+# Input device support
+#
+CONFIG_INPUT=y
+
+#
+# Userland interfaces
+#
+CONFIG_INPUT_MOUSEDEV=y
+CONFIG_INPUT_MOUSEDEV_PSAUX=y
+CONFIG_INPUT_MOUSEDEV_SCREEN_X=1024
+CONFIG_INPUT_MOUSEDEV_SCREEN_Y=768
+# CONFIG_INPUT_JOYDEV is not set
+# CONFIG_INPUT_TSDEV is not set
+CONFIG_INPUT_EVDEV=m
+
+#
+# Input Device Drivers
+#
+CONFIG_INPUT_KEYBOARD=y
+CONFIG_KEYBOARD_ATKBD=y
+# CONFIG_KEYBOARD_SUNKBD is not set
+# CONFIG_KEYBOARD_LKKBD is not set
+# CONFIG_KEYBOARD_XTKBD is not set
+# CONFIG_KEYBOARD_NEWTON is not set
+CONFIG_INPUT_MOUSE=y
+CONFIG_MOUSE_PS2=y
+# CONFIG_MOUSE_SERIAL is not set
+# CONFIG_MOUSE_VSXXXAA is not set
+# CONFIG_INPUT_JOYSTICK is not set
+# CONFIG_INPUT_TOUCHSCREEN is not set
+# CONFIG_INPUT_MISC is not set
+
+#
+# Hardware I/O ports
+#
+CONFIG_SERIO=y
+# CONFIG_SERIO_I8042 is not set
+# CONFIG_SERIO_SERPORT is not set
+# CONFIG_SERIO_PARKBD is not set
+# CONFIG_SERIO_PCIPS2 is not set
+CONFIG_SERIO_LIBPS2=y
+# CONFIG_SERIO_RAW is not set
+# CONFIG_GAMEPORT is not set
+
+#
+# Character devices
+#
+CONFIG_VT=y
+CONFIG_VT_CONSOLE=y
+CONFIG_HW_CONSOLE=y
+# CONFIG_SERIAL_NONSTANDARD is not set
+CONFIG_SIBYTE_SB1250_DUART=y
+CONFIG_SIBYTE_SB1250_DUART_CONSOLE=y
+
+#
+# Serial drivers
+#
+# CONFIG_SERIAL_8250 is not set
+
+#
+# Non-8250 serial port support
+#
+# CONFIG_SERIAL_JSM is not set
+CONFIG_PRINTER=m
+# CONFIG_LP_CONSOLE is not set
+# CONFIG_PPDEV is not set
+# CONFIG_TIPAR is not set
+
+#
+# IPMI
+#
+# CONFIG_IPMI_HANDLER is not set
+
+#
+# Watchdog Cards
+#
+CONFIG_WATCHDOG=y
+# CONFIG_WATCHDOG_NOWAYOUT is not set
+
+#
+# Watchdog Device Drivers
+#
+# CONFIG_SOFT_WATCHDOG is not set
+
+#
+# PCI-based Watchdog Cards
+#
+# CONFIG_PCIPCWATCHDOG is not set
+# CONFIG_WDTPCI is not set
+
+#
+# USB-based Watchdog Cards
+#
+# CONFIG_USBPCWATCHDOG is not set
+CONFIG_RTC=m
+CONFIG_GEN_RTC=y
+CONFIG_GEN_RTC_X=y
+# CONFIG_DTLK is not set
+# CONFIG_R3964 is not set
+# CONFIG_APPLICOM is not set
+
+#
+# Ftape, the floppy tape device driver
+#
+# CONFIG_DRM is not set
+# CONFIG_RAW_DRIVER is not set
+
+#
+# TPM devices
+#
+# CONFIG_TCG_TPM is not set
+# CONFIG_TELCLOCK is not set
+
+#
+# I2C support
+#
+CONFIG_I2C=m
+CONFIG_I2C_CHARDEV=m
+
+#
+# I2C Algorithms
+#
+CONFIG_I2C_ALGOBIT=m
+# CONFIG_I2C_ALGOPCF is not set
+# CONFIG_I2C_ALGOPCA is not set
+CONFIG_I2C_ALGO_SIBYTE=m
+
+#
+# I2C Hardware Bus support
+#
+# CONFIG_I2C_ALI1535 is not set
+# CONFIG_I2C_ALI1563 is not set
+# CONFIG_I2C_ALI15X3 is not set
+# CONFIG_I2C_AMD756 is not set
+# CONFIG_I2C_AMD8111 is not set
+# CONFIG_I2C_I801 is not set
+# CONFIG_I2C_I810 is not set
+# CONFIG_I2C_PIIX4 is not set
+# CONFIG_I2C_NFORCE2 is not set
+# CONFIG_I2C_PARPORT is not set
+# CONFIG_I2C_PARPORT_LIGHT is not set
+# CONFIG_I2C_PROSAVAGE is not set
+# CONFIG_I2C_SAVAGE4 is not set
+CONFIG_I2C_SIBYTE=m
+# CONFIG_SCx200_ACB is not set
+# CONFIG_I2C_SIS5595 is not set
+# CONFIG_I2C_SIS630 is not set
+# CONFIG_I2C_SIS96X is not set
+CONFIG_I2C_STUB=m
+# CONFIG_I2C_VIA is not set
+# CONFIG_I2C_VIAPRO is not set
+# CONFIG_I2C_VOODOO3 is not set
+# CONFIG_I2C_PCA_ISA is not set
+
+#
+# Miscellaneous I2C Chip support
+#
+# CONFIG_SENSORS_DS1337 is not set
+# CONFIG_SENSORS_DS1374 is not set
+# CONFIG_SENSORS_EEPROM is not set
+# CONFIG_SENSORS_PCF8574 is not set
+# CONFIG_SENSORS_PCA9539 is not set
+# CONFIG_SENSORS_PCF8591 is not set
+# CONFIG_SENSORS_MAX6875 is not set
+# CONFIG_I2C_DEBUG_CORE is not set
+# CONFIG_I2C_DEBUG_ALGO is not set
+# CONFIG_I2C_DEBUG_BUS is not set
+# CONFIG_I2C_DEBUG_CHIP is not set
+
+#
+# SPI support
+#
+CONFIG_SPI=y
+CONFIG_SPI_MASTER=y
+
+#
+# SPI Master Controller Drivers
+#
+CONFIG_SPI_BITBANG=m
+CONFIG_SPI_BUTTERFLY=m
+
+#
+# SPI Protocol Masters
+#
+
+#
+# Dallas's 1-wire bus
+#
+# CONFIG_W1 is not set
+
+#
+# Hardware Monitoring support
+#
+CONFIG_HWMON=y
+CONFIG_HWMON_VID=m
+# CONFIG_SENSORS_ADM1021 is not set
+# CONFIG_SENSORS_ADM1025 is not set
+# CONFIG_SENSORS_ADM1026 is not set
+# CONFIG_SENSORS_ADM1031 is not set
+# CONFIG_SENSORS_ADM9240 is not set
+# CONFIG_SENSORS_ASB100 is not set
+# CONFIG_SENSORS_ATXP1 is not set
+# CONFIG_SENSORS_DS1621 is not set
+# CONFIG_SENSORS_F71805F is not set
+# CONFIG_SENSORS_FSCHER is not set
+# CONFIG_SENSORS_FSCPOS is not set
+# CONFIG_SENSORS_GL518SM is not set
+# CONFIG_SENSORS_GL520SM is not set
+# CONFIG_SENSORS_IT87 is not set
+# CONFIG_SENSORS_LM63 is not set
+# CONFIG_SENSORS_LM75 is not set
+# CONFIG_SENSORS_LM77 is not set
+# CONFIG_SENSORS_LM78 is not set
+# CONFIG_SENSORS_LM80 is not set
+# CONFIG_SENSORS_LM83 is not set
+# CONFIG_SENSORS_LM85 is not set
+# CONFIG_SENSORS_LM87 is not set
+# CONFIG_SENSORS_LM90 is not set
+# CONFIG_SENSORS_LM92 is not set
+# CONFIG_SENSORS_MAX1619 is not set
+# CONFIG_SENSORS_PC87360 is not set
+# CONFIG_SENSORS_SIS5595 is not set
+# CONFIG_SENSORS_SMSC47M1 is not set
+# CONFIG_SENSORS_SMSC47B397 is not set
+# CONFIG_SENSORS_VIA686A is not set
+CONFIG_SENSORS_VT8231=m
+# CONFIG_SENSORS_W83781D is not set
+# CONFIG_SENSORS_W83792D is not set
+# CONFIG_SENSORS_W83L785TS is not set
+# CONFIG_SENSORS_W83627HF is not set
+# CONFIG_SENSORS_W83627EHF is not set
+# CONFIG_HWMON_DEBUG_CHIP is not set
+
+#
+# Misc devices
+#
+
+#
+# Multimedia Capabilities Port drivers
+#
+
+#
+# Multimedia devices
+#
+CONFIG_VIDEO_DEV=m
+
+#
+# Video For Linux
+#
+
+#
+# Video Adapters
+#
+# CONFIG_VIDEO_ADV_DEBUG is not set
+# CONFIG_VIDEO_BT848 is not set
+# CONFIG_VIDEO_BWQCAM is not set
+# CONFIG_VIDEO_CQCAM is not set
+# CONFIG_VIDEO_W9966 is not set
+# CONFIG_VIDEO_CPIA is not set
+# CONFIG_VIDEO_SAA5246A is not set
+# CONFIG_VIDEO_SAA5249 is not set
+# CONFIG_TUNER_3036 is not set
+# CONFIG_VIDEO_STRADIS is not set
+# CONFIG_VIDEO_ZORAN is not set
+# CONFIG_VIDEO_SAA7134 is not set
+# CONFIG_VIDEO_MXB is not set
+# CONFIG_VIDEO_DPC is not set
+# CONFIG_VIDEO_HEXIUM_ORION is not set
+# CONFIG_VIDEO_HEXIUM_GEMINI is not set
+# CONFIG_VIDEO_CX88 is not set
+# CONFIG_VIDEO_EM28XX is not set
+# CONFIG_VIDEO_OVCAMCHIP is not set
+# CONFIG_VIDEO_AUDIO_DECODER is not set
+# CONFIG_VIDEO_DECODER is not set
+
+#
+# Radio Adapters
+#
+# CONFIG_RADIO_GEMTEK_PCI is not set
+# CONFIG_RADIO_MAXIRADIO is not set
+# CONFIG_RADIO_MAESTRO is not set
+
+#
+# Digital Video Broadcasting Devices
+#
+# CONFIG_DVB is not set
+
+#
+# Graphics support
+#
+CONFIG_FB=y
+CONFIG_FB_CFB_FILLRECT=m
+CONFIG_FB_CFB_COPYAREA=m
+CONFIG_FB_CFB_IMAGEBLIT=m
+# CONFIG_FB_MACMODES is not set
+CONFIG_FB_MODE_HELPERS=y
+CONFIG_FB_TILEBLITTING=y
+# CONFIG_FB_CIRRUS is not set
+CONFIG_FB_PM2=m
+# CONFIG_FB_PM2_FIFO_DISCONNECT is not set
+CONFIG_FB_CYBER2000=m
+# CONFIG_FB_ASILIANT is not set
+# CONFIG_FB_IMSTT is not set
+# CONFIG_FB_S1D13XXX is not set
+CONFIG_FB_NVIDIA=m
+# CONFIG_FB_NVIDIA_I2C is not set
+CONFIG_FB_RIVA=m
+# CONFIG_FB_RIVA_I2C is not set
+# CONFIG_FB_RIVA_DEBUG is not set
+CONFIG_FB_MATROX=m
+CONFIG_FB_MATROX_MILLENIUM=y
+CONFIG_FB_MATROX_MYSTIQUE=y
+CONFIG_FB_MATROX_G=y
+# CONFIG_FB_MATROX_I2C is not set
+# CONFIG_FB_MATROX_MULTIHEAD is not set
+CONFIG_FB_RADEON=m
+CONFIG_FB_RADEON_I2C=y
+# CONFIG_FB_RADEON_DEBUG is not set
+CONFIG_FB_ATY128=m
+CONFIG_FB_ATY=m
+# CONFIG_FB_ATY_CT is not set
+# CONFIG_FB_ATY_GX is not set
+CONFIG_FB_SAVAGE=m
+# CONFIG_FB_SAVAGE_I2C is not set
+# CONFIG_FB_SAVAGE_ACCEL is not set
+CONFIG_FB_SIS=m
+CONFIG_FB_SIS_300=y
+CONFIG_FB_SIS_315=y
+CONFIG_FB_NEOMAGIC=m
+CONFIG_FB_KYRO=m
+CONFIG_FB_3DFX=m
+# CONFIG_FB_3DFX_ACCEL is not set
+CONFIG_FB_VOODOO1=m
+CONFIG_FB_TRIDENT=m
+# CONFIG_FB_TRIDENT_ACCEL is not set
+# CONFIG_FB_VIRTUAL is not set
+
+#
+# Console display driver support
+#
+# CONFIG_VGA_CONSOLE is not set
+CONFIG_DUMMY_CONSOLE=y
+CONFIG_FRAMEBUFFER_CONSOLE=y
+# CONFIG_FRAMEBUFFER_CONSOLE_ROTATION is not set
+# CONFIG_FONTS is not set
+CONFIG_FONT_8x8=y
+CONFIG_FONT_8x16=y
+
+#
+# Logo configuration
+#
+CONFIG_LOGO=y
+# CONFIG_LOGO_LINUX_MONO is not set
+# CONFIG_LOGO_LINUX_VGA16 is not set
+# CONFIG_LOGO_LINUX_CLUT224 is not set
+
+#
+# Sound
+#
+CONFIG_SOUND=y
+
+#
+# Advanced Linux Sound Architecture
+#
+CONFIG_SND=m
+CONFIG_SND_TIMER=m
+CONFIG_SND_PCM=m
+CONFIG_SND_HWDEP=m
+CONFIG_SND_RAWMIDI=m
+# CONFIG_SND_SEQUENCER is not set
+CONFIG_SND_OSSEMUL=y
+CONFIG_SND_MIXER_OSS=m
+CONFIG_SND_PCM_OSS=m
+CONFIG_SND_RTCTIMER=m
+# CONFIG_SND_DYNAMIC_MINORS is not set
+CONFIG_SND_SUPPORT_OLD_API=y
+# CONFIG_SND_VERBOSE_PRINTK is not set
+# CONFIG_SND_DEBUG is not set
+
+#
+# Generic devices
+#
+CONFIG_SND_MPU401_UART=m
+CONFIG_SND_OPL3_LIB=m
+CONFIG_SND_VX_LIB=m
+CONFIG_SND_AC97_CODEC=m
+CONFIG_SND_AC97_BUS=m
+# CONFIG_SND_DUMMY is not set
+# CONFIG_SND_MTPAV is not set
+# CONFIG_SND_MPU401 is not set
+
+#
+# PCI devices
+#
+CONFIG_SND_AD1889=m
+CONFIG_SND_ALI5451=m
+CONFIG_SND_ATIIXP=m
+CONFIG_SND_ATIIXP_MODEM=m
+CONFIG_SND_AU8810=m
+CONFIG_SND_AU8820=m
+CONFIG_SND_AU8830=m
+CONFIG_SND_AZT3328=m
+CONFIG_SND_BT87X=m
+CONFIG_SND_BT87X_OVERCLOCK=y
+CONFIG_SND_CA0106=m
+CONFIG_SND_CMIPCI=m
+CONFIG_SND_CS4281=m
+CONFIG_SND_CS46XX=m
+CONFIG_SND_CS46XX_NEW_DSP=y
+CONFIG_SND_EMU10K1=m
+CONFIG_SND_EMU10K1X=m
+CONFIG_SND_ENS1370=m
+CONFIG_SND_ENS1371=m
+CONFIG_SND_ES1938=m
+CONFIG_SND_ES1968=m
+CONFIG_SND_FM801=m
+CONFIG_SND_FM801_TEA575X_BOOL=y
+CONFIG_SND_FM801_TEA575X=m
+CONFIG_SND_HDA_INTEL=m
+CONFIG_SND_HDSP=m
+CONFIG_SND_HDSPM=m
+CONFIG_SND_ICE1712=m
+CONFIG_SND_ICE1724=m
+CONFIG_SND_INTEL8X0=m
+CONFIG_SND_INTEL8X0M=m
+CONFIG_SND_KORG1212=m
+CONFIG_SND_MAESTRO3=m
+CONFIG_SND_MIXART=m
+CONFIG_SND_NM256=m
+CONFIG_SND_PCXHR=m
+CONFIG_SND_RME32=m
+CONFIG_SND_RME96=m
+CONFIG_SND_RME9652=m
+CONFIG_SND_SONICVIBES=m
+CONFIG_SND_TRIDENT=m
+CONFIG_SND_VIA82XX=m
+CONFIG_SND_VIA82XX_MODEM=m
+CONFIG_SND_VX222=m
+CONFIG_SND_YMFPCI=m
+
+#
+# ALSA MIPS devices
+#
+
+#
+# USB devices
+#
+# CONFIG_SND_USB_AUDIO is not set
+
+#
+# Open Sound System
+#
+CONFIG_SOUND_PRIME=y
+# CONFIG_OBSOLETE_OSS_DRIVER is not set
+# CONFIG_SOUND_FUSION is not set
+# CONFIG_SOUND_TRIDENT is not set
+# CONFIG_SOUND_MSNDCLAS is not set
+# CONFIG_SOUND_MSNDPIN is not set
+
+#
+# USB support
+#
+CONFIG_USB_ARCH_HAS_HCD=y
+CONFIG_USB_ARCH_HAS_OHCI=y
+CONFIG_USB=m
+# CONFIG_USB_DEBUG is not set
+
+#
+# Miscellaneous USB options
+#
+CONFIG_USB_DEVICEFS=y
+# CONFIG_USB_DYNAMIC_MINORS is not set
+# CONFIG_USB_OTG is not set
+
+#
+# USB Host Controller Drivers
+#
+CONFIG_USB_EHCI_HCD=m
+# CONFIG_USB_EHCI_SPLIT_ISO is not set
+# CONFIG_USB_EHCI_ROOT_HUB_TT is not set
+CONFIG_USB_ISP116X_HCD=m
+CONFIG_USB_OHCI_HCD=m
+CONFIG_USB_OHCI_LITTLE_ENDIAN=y
+CONFIG_USB_UHCI_HCD=m
+CONFIG_USB_SL811_HCD=m
+
+#
+# USB Device Class drivers
+#
+# CONFIG_OBSOLETE_OSS_USB_DRIVER is not set
+# CONFIG_USB_ACM is not set
+# CONFIG_USB_PRINTER is not set
+
+#
+# NOTE: USB_STORAGE enables SCSI, and 'SCSI disk support'
+#
+
+#
+# may also be needed; see USB_STORAGE Help for more information
+#
+CONFIG_USB_STORAGE=m
+# CONFIG_USB_STORAGE_DEBUG is not set
+# CONFIG_USB_STORAGE_DATAFAB is not set
+# CONFIG_USB_STORAGE_FREECOM is not set
+# CONFIG_USB_STORAGE_ISD200 is not set
+# CONFIG_USB_STORAGE_DPCM is not set
+# CONFIG_USB_STORAGE_USBAT is not set
+# CONFIG_USB_STORAGE_SDDR09 is not set
+# CONFIG_USB_STORAGE_SDDR55 is not set
+# CONFIG_USB_STORAGE_JUMPSHOT is not set
+CONFIG_USB_STORAGE_ALAUDA=y
+# CONFIG_USB_STORAGE_ONETOUCH is not set
+# CONFIG_USB_LIBUSUAL is not set
+
+#
+# USB Input Devices
+#
+CONFIG_USB_HID=m
+# CONFIG_USB_HIDINPUT_POWERBOOK is not set
+# CONFIG_HID_FF is not set
+CONFIG_USB_HIDDEV=y
+
+#
+# USB HID Boot Protocol drivers
+#
+# CONFIG_USB_KBD is not set
+# CONFIG_USB_MOUSE is not set
+
+#
+# USB Imaging devices
+#
+# CONFIG_USB_MDC800 is not set
+# CONFIG_USB_MICROTEK is not set
+
+#
+# USB Multimedia devices
+#
+# CONFIG_USB_VICAM is not set
+# CONFIG_USB_DSBR is not set
+CONFIG_USB_ET61X251=m
+# CONFIG_USB_IBMCAM is not set
+# CONFIG_USB_KONICAWC is not set
+# CONFIG_USB_OV511 is not set
+# CONFIG_USB_SE401 is not set
+# CONFIG_USB_SN9C102 is not set
+# CONFIG_USB_STV680 is not set
+# CONFIG_USB_PWC is not set
+
+#
+# USB Network Adapters
+#
+# CONFIG_USB_CATC is not set
+# CONFIG_USB_KAWETH is not set
+# CONFIG_USB_PEGASUS is not set
+# CONFIG_USB_RTL8150 is not set
+# CONFIG_USB_USBNET is not set
+CONFIG_USB_MON=y
+
+#
+# USB port drivers
+#
+# CONFIG_USB_USS720 is not set
+
+#
+# USB Miscellaneous drivers
+#
+# CONFIG_USB_AUERSWALD is not set
+# CONFIG_USB_RIO500 is not set
+# CONFIG_USB_LEGOTOWER is not set
+# CONFIG_USB_LCD is not set
+# CONFIG_USB_LED is not set
+# CONFIG_USB_CYTHERM is not set
+# CONFIG_USB_PHIDGETKIT is not set
+# CONFIG_USB_PHIDGETSERVO is not set
+# CONFIG_USB_IDMOUSE is not set
+CONFIG_USB_SISUSBVGA=m
+# CONFIG_USB_SISUSBVGA_CON is not set
+# CONFIG_USB_LD is not set
+# CONFIG_USB_TEST is not set
+
+#
+# USB DSL modem support
+#
+
+#
+# USB Gadget Support
+#
+# CONFIG_USB_GADGET is not set
+
+#
+# MMC/SD Card support
+#
+# CONFIG_MMC is not set
+
+#
+# InfiniBand support
+#
+# CONFIG_INFINIBAND is not set
+
+#
+# SN Devices
+#
+
+#
+# EDAC - error detection and reporting (RAS)
+#
+
+#
+# File systems
+#
+CONFIG_EXT2_FS=y
+CONFIG_EXT2_FS_XATTR=y
+CONFIG_EXT2_FS_POSIX_ACL=y
+CONFIG_EXT2_FS_SECURITY=y
+# CONFIG_EXT2_FS_XIP is not set
+CONFIG_EXT3_FS=y
+CONFIG_EXT3_FS_XATTR=y
+CONFIG_EXT3_FS_POSIX_ACL=y
+CONFIG_EXT3_FS_SECURITY=y
+CONFIG_JBD=y
+# CONFIG_JBD_DEBUG is not set
+CONFIG_FS_MBCACHE=y
+CONFIG_REISERFS_FS=m
+# CONFIG_REISERFS_CHECK is not set
+# CONFIG_REISERFS_PROC_INFO is not set
+CONFIG_REISERFS_FS_XATTR=y
+CONFIG_REISERFS_FS_POSIX_ACL=y
+# CONFIG_REISERFS_FS_SECURITY is not set
+CONFIG_JFS_FS=m
+CONFIG_JFS_POSIX_ACL=y
+# CONFIG_JFS_SECURITY is not set
+# CONFIG_JFS_DEBUG is not set
+# CONFIG_JFS_STATISTICS is not set
+CONFIG_FS_POSIX_ACL=y
+CONFIG_XFS_FS=m
+CONFIG_XFS_EXPORT=y
+# CONFIG_XFS_QUOTA is not set
+# CONFIG_XFS_SECURITY is not set
+CONFIG_XFS_POSIX_ACL=y
+CONFIG_XFS_RT=y
+CONFIG_OCFS2_FS=m
+# CONFIG_MINIX_FS is not set
+# CONFIG_ROMFS_FS is not set
+CONFIG_INOTIFY=y
+CONFIG_QUOTA=y
+CONFIG_QFMT_V1=m
+CONFIG_QFMT_V2=m
+CONFIG_QUOTACTL=y
+CONFIG_DNOTIFY=y
+CONFIG_AUTOFS_FS=m
+CONFIG_AUTOFS4_FS=m
+CONFIG_FUSE_FS=m
+
+#
+# CD-ROM/DVD Filesystems
+#
+CONFIG_ISO9660_FS=y
+CONFIG_JOLIET=y
+CONFIG_ZISOFS=y
+CONFIG_UDF_FS=y
+CONFIG_UDF_NLS=y
+
+#
+# DOS/FAT/NT Filesystems
+#
+CONFIG_FAT_FS=m
+CONFIG_MSDOS_FS=m
+CONFIG_VFAT_FS=m
+CONFIG_FAT_DEFAULT_CODEPAGE=437
+CONFIG_FAT_DEFAULT_IOCHARSET="iso8859-1"
+CONFIG_NTFS_FS=m
+# CONFIG_NTFS_DEBUG is not set
+CONFIG_NTFS_RW=y
+
+#
+# Pseudo filesystems
+#
+CONFIG_PROC_FS=y
+CONFIG_PROC_KCORE=y
+CONFIG_SYSFS=y
+CONFIG_TMPFS=y
+CONFIG_RAMFS=y
+# CONFIG_RELAYFS_FS is not set
+CONFIG_CONFIGFS_FS=m
+
+#
+# Miscellaneous filesystems
+#
+# CONFIG_ADFS_FS is not set
+# CONFIG_AFFS_FS is not set
+# CONFIG_ASFS_FS is not set
+# CONFIG_HFS_FS is not set
+# CONFIG_HFSPLUS_FS is not set
+# CONFIG_BEFS_FS is not set
+# CONFIG_BFS_FS is not set
+CONFIG_EFS_FS=m
+CONFIG_CRAMFS=y
+# CONFIG_VXFS_FS is not set
+# CONFIG_HPFS_FS is not set
+# CONFIG_QNX4FS_FS is not set
+# CONFIG_SYSV_FS is not set
+# CONFIG_UFS_FS is not set
+
+#
+# Network File Systems
+#
+CONFIG_NFS_FS=y
+# CONFIG_NFS_V3_ACL is not set
+# CONFIG_NFS_V4 is not set
+# CONFIG_NFS_DIRECTIO is not set
+CONFIG_NFSD=y
+# CONFIG_NFSD_V3_ACL is not set
+# CONFIG_NFSD_V4 is not set
+CONFIG_ROOT_NFS=y
+CONFIG_LOCKD=y
+CONFIG_LOCKD_V4=y
+CONFIG_EXPORTFS=y
+CONFIG_SUNRPC=y
+# CONFIG_RPCSEC_GSS_KRB5 is not set
+# CONFIG_RPCSEC_GSS_SPKM3 is not set
+CONFIG_SMB_FS=m
+CONFIG_SMB_NLS_DEFAULT=y
+CONFIG_SMB_NLS_REMOTE="cp437"
+CONFIG_CIFS=m
+# CONFIG_CIFS_STATS is not set
+CONFIG_CIFS_XATTR=y
+CONFIG_CIFS_POSIX=y
+# CONFIG_CIFS_EXPERIMENTAL is not set
+# CONFIG_NCP_FS is not set
+# CONFIG_CODA_FS is not set
+# CONFIG_AFS_FS is not set
+# CONFIG_9P_FS is not set
+
+#
+# Partition Types
+#
+CONFIG_PARTITION_ADVANCED=y
+# CONFIG_ACORN_PARTITION is not set
+# CONFIG_OSF_PARTITION is not set
+# CONFIG_AMIGA_PARTITION is not set
+# CONFIG_ATARI_PARTITION is not set
+# CONFIG_MAC_PARTITION is not set
+CONFIG_MSDOS_PARTITION=y
+# CONFIG_BSD_DISKLABEL is not set
+# CONFIG_MINIX_SUBPARTITION is not set
+# CONFIG_SOLARIS_X86_PARTITION is not set
+# CONFIG_UNIXWARE_DISKLABEL is not set
+# CONFIG_LDM_PARTITION is not set
+CONFIG_SGI_PARTITION=y
+# CONFIG_ULTRIX_PARTITION is not set
+# CONFIG_SUN_PARTITION is not set
+CONFIG_KARMA_PARTITION=y
+# CONFIG_EFI_PARTITION is not set
+
+#
+# Native Language Support
+#
+CONFIG_NLS=y
+CONFIG_NLS_DEFAULT="iso8859-1"
+CONFIG_NLS_CODEPAGE_437=m
+CONFIG_NLS_CODEPAGE_737=m
+CONFIG_NLS_CODEPAGE_775=m
+CONFIG_NLS_CODEPAGE_850=m
+CONFIG_NLS_CODEPAGE_852=m
+CONFIG_NLS_CODEPAGE_855=m
+CONFIG_NLS_CODEPAGE_857=m
+CONFIG_NLS_CODEPAGE_860=m
+CONFIG_NLS_CODEPAGE_861=m
+CONFIG_NLS_CODEPAGE_862=m
+CONFIG_NLS_CODEPAGE_863=m
+CONFIG_NLS_CODEPAGE_864=m
+CONFIG_NLS_CODEPAGE_865=m
+CONFIG_NLS_CODEPAGE_866=m
+CONFIG_NLS_CODEPAGE_869=m
+CONFIG_NLS_CODEPAGE_936=m
+CONFIG_NLS_CODEPAGE_950=m
+CONFIG_NLS_CODEPAGE_932=m
+CONFIG_NLS_CODEPAGE_949=m
+CONFIG_NLS_CODEPAGE_874=m
+CONFIG_NLS_ISO8859_8=m
+CONFIG_NLS_CODEPAGE_1250=m
+CONFIG_NLS_CODEPAGE_1251=m
+CONFIG_NLS_ASCII=m
+CONFIG_NLS_ISO8859_1=m
+CONFIG_NLS_ISO8859_2=m
+CONFIG_NLS_ISO8859_3=m
+CONFIG_NLS_ISO8859_4=m
+CONFIG_NLS_ISO8859_5=m
+CONFIG_NLS_ISO8859_6=m
+CONFIG_NLS_ISO8859_7=m
+CONFIG_NLS_ISO8859_9=m
+CONFIG_NLS_ISO8859_13=m
+CONFIG_NLS_ISO8859_14=m
+CONFIG_NLS_ISO8859_15=m
+CONFIG_NLS_KOI8_R=m
+CONFIG_NLS_KOI8_U=m
+CONFIG_NLS_UTF8=m
+
+#
+# Profiling support
+#
+CONFIG_PROFILING=y
+# CONFIG_OPROFILE is not set
+
+#
+# Kernel hacking
+#
+# CONFIG_PRINTK_TIME is not set
+CONFIG_MAGIC_SYSRQ=y
+# CONFIG_DEBUG_KERNEL is not set
+CONFIG_LOG_BUF_SHIFT=15
+# CONFIG_CROSSCOMPILE is not set
+CONFIG_CMDLINE=""
+# CONFIG_SB1XXX_CORELIS is not set
+
+#
+# Security options
+#
+CONFIG_KEYS=y
+# CONFIG_KEYS_DEBUG_PROC_KEYS is not set
+CONFIG_SECURITY=y
+CONFIG_SECURITY_NETWORK=y
+CONFIG_SECURITY_NETWORK_XFRM=y
+CONFIG_SECURITY_CAPABILITIES=y
+CONFIG_SECURITY_SELINUX=y
+CONFIG_SECURITY_SELINUX_BOOTPARAM=y
+CONFIG_SECURITY_SELINUX_BOOTPARAM_VALUE=0
+CONFIG_SECURITY_SELINUX_DISABLE=y
+CONFIG_SECURITY_SELINUX_DEVELOP=y
+CONFIG_SECURITY_SELINUX_AVC_STATS=y
+CONFIG_SECURITY_SELINUX_CHECKREQPROT_VALUE=1
+
+#
+# Cryptographic options
+#
+CONFIG_CRYPTO=y
+CONFIG_CRYPTO_HMAC=y
+CONFIG_CRYPTO_NULL=m
+CONFIG_CRYPTO_MD4=m
+CONFIG_CRYPTO_MD5=y
+CONFIG_CRYPTO_SHA1=m
+CONFIG_CRYPTO_SHA256=m
+CONFIG_CRYPTO_SHA512=m
+CONFIG_CRYPTO_WP512=m
+CONFIG_CRYPTO_TGR192=m
+CONFIG_CRYPTO_DES=m
+CONFIG_CRYPTO_BLOWFISH=m
+CONFIG_CRYPTO_TWOFISH=m
+CONFIG_CRYPTO_SERPENT=m
+CONFIG_CRYPTO_AES=m
+CONFIG_CRYPTO_CAST5=m
+CONFIG_CRYPTO_CAST6=m
+CONFIG_CRYPTO_TEA=m
+CONFIG_CRYPTO_ARC4=m
+CONFIG_CRYPTO_KHAZAD=m
+CONFIG_CRYPTO_ANUBIS=m
+CONFIG_CRYPTO_DEFLATE=m
+CONFIG_CRYPTO_MICHAEL_MIC=m
+CONFIG_CRYPTO_CRC32C=m
+CONFIG_CRYPTO_TEST=m
+
+#
+# Hardware crypto devices
+#
+
+#
+# Library routines
+#
+CONFIG_CRC_CCITT=m
+# CONFIG_CRC16 is not set
+CONFIG_CRC32=y
+CONFIG_LIBCRC32C=m
+CONFIG_ZLIB_INFLATE=y
+CONFIG_ZLIB_DEFLATE=m
+CONFIG_TEXTSEARCH=y
+CONFIG_TEXTSEARCH_KMP=m
+CONFIG_TEXTSEARCH_BM=m
+CONFIG_TEXTSEARCH_FSM=m
+CONFIG_SND_SEQUENCER_OSS=y
+# CONFIG_SOUND_EMU10K1 is not set
+CONFIG_SND_VIRMIDI=m
+CONFIG_VIDEO_BUF=m
+# CONFIG_USB_W9968CF is not set
+CONFIG_SND_SEQ_DUMMY=m
+CONFIG_SND_SERIAL_U16550=m
+CONFIG_MSNDPIN_INIT_FILE="/etc/sound/pndspini.bin"
+CONFIG_MSNDPIN_PERM_FILE="/etc/sound/pndsperm.bin"
+CONFIG_MSNDCLAS_INIT_FILE="/etc/sound/msndinit.bin"
+CONFIG_MSNDCLAS_PERM_FILE="/etc/sound/msndperm.bin"

Added: dists/sid/linux-2.6/debian/config/mipsel/defines
==============================================================================
--- (empty file)
+++ dists/sid/linux-2.6/debian/config/mipsel/defines	Mon Nov 26 20:06:56 2007
@@ -0,0 +1,38 @@
+[base]
+flavours:
+ r5k-cobalt
+ sb1-bcm91250a
+ sb1a-bcm91480b
+ 4kc-malta
+ 5kc-malta
+ qemu
+kernel-arch: mips
+kernel-header-dirs: mips
+
+[image]
+initramfs: false
+type: kernel-package
+
+[r5k-cobalt_base]
+class: Cobalt
+longclass: Cobalt (Qube, RaQ, Qube2, RaQ2)
+
+[sb1-bcm91250a_base]
+class: BCM91250A
+longclass: Broadcom BCM91250A (aka SWARM)
+
+[sb1a-bcm91480b_base]
+class: BCM91480B
+longclass: Broadcom BCM91480B (aka BigSur)
+
+[4kc-malta_base]
+class: MIPS Malta
+longclass: MIPS Malta board
+
+[5kc-malta_base]
+class: MIPS Malta (64-bit)
+longclass: MIPS Malta board (64-bit)
+
+[qemu_base]
+class: QEMU
+longclass: QEMU virtual machine

Added: dists/sid/linux-2.6/debian/config/powerpc/config
==============================================================================
--- (empty file)
+++ dists/sid/linux-2.6/debian/config/powerpc/config	Mon Nov 26 20:06:56 2007
@@ -0,0 +1,988 @@
+#
+# Macintosh device drivers
+#
+CONFIG_MACINTOSH_DRIVERS=y
+CONFIG_ADB=y
+CONFIG_ADB_CUDA=y
+CONFIG_ADB_PMU=y
+CONFIG_ADB_PMU_LED=y
+# CONFIG_ADB_PMU_LED_IDE is not set
+CONFIG_PMAC_SMU=y
+# CONFIG_PMAC_APM_EMU is not set
+CONFIG_PMAC_MEDIABAY=y
+CONFIG_ADB_MACIO=y
+CONFIG_INPUT_ADBHID=y
+CONFIG_MAC_EMUMOUSEBTN=y
+CONFIG_THERM_WINDTUNNEL=m
+CONFIG_THERM_ADT746X=m
+CONFIG_THERM_PM72=m
+CONFIG_WINDFARM=m
+CONFIG_WINDFARM_PM81=m
+CONFIG_WINDFARM_PM91=m
+CONFIG_WINDFARM_PM112=m
+CONFIG_ANSLCD=m
+CONFIG_PMAC_RACKMETER=m
+
+CONFIG_GENERIC_HARDIRQS=y
+CONFIG_RWSEM_XCHGADD_ALGORITHM=y
+CONFIG_PPC=y
+CONFIG_GENERIC_NVRAM=y
+CONFIG_SCHED_NO_NO_OMIT_FRAME_POINTER=y
+# CONFIG_IKCONFIG is not set
+# CONFIG_KALLSYMS_ALL is not set
+CONFIG_6xx=y
+# CONFIG_40x is not set
+# CONFIG_44x is not set
+# CONFIG_POWER3 is not set
+# CONFIG_POWER4 is not set
+# CONFIG_8xx is not set
+# CONFIG_E200 is not set
+# CONFIG_E500 is not set
+CONFIG_PPC_FPU=y
+CONFIG_ALTIVEC=y
+CONFIG_TAU=y
+# CONFIG_TAU_INT is not set
+# CONFIG_TAU_AVERAGE is not set
+CONFIG_CPU_FREQ=y
+CONFIG_CPU_FREQ_TABLE=y
+# CONFIG_CPU_FREQ_DEBUG is not set
+CONFIG_CPU_FREQ_STAT=m
+CONFIG_CPU_FREQ_STAT_DETAILS=y
+CONFIG_CPU_FREQ_DEFAULT_GOV_PERFORMANCE=y
+# CONFIG_CPU_FREQ_DEFAULT_GOV_USERSPACE is not set
+CONFIG_CPU_FREQ_GOV_PERFORMANCE=y
+CONFIG_CPU_FREQ_GOV_POWERSAVE=m
+CONFIG_CPU_FREQ_GOV_USERSPACE=m
+CONFIG_CPU_FREQ_GOV_ONDEMAND=m
+CONFIG_CPU_FREQ_GOV_CONSERVATIVE=m
+CONFIG_CPU_FREQ_PMAC=y
+CONFIG_PPC601_SYNC_FIX=y
+CONFIG_PM=y
+CONFIG_PPC_STD_MMU=y
+CONFIG_PPC_MULTIPLATFORM=y
+# CONFIG_LOPEC is not set
+# CONFIG_PPLUS is not set
+# CONFIG_SBC82xx is not set
+# CONFIG_PPC_LITE5200 is not set
+CONFIG_PPC_CHRP=y
+CONFIG_PPC_PMAC=y
+CONFIG_PPC_PREP=y
+CONFIG_PPC_OF=y
+CONFIG_PPCBUG_NVRAM=y
+CONFIG_HIGHMEM=y
+CONFIG_PROC_DEVICETREE=y
+CONFIG_PREP_RESIDUAL=y
+CONFIG_PROC_PREPRESIDUAL=y
+CONFIG_CMDLINE_BOOL=y
+CONFIG_CMDLINE="console=ttyS0,9600 console=tty0"
+# CONFIG_PM_DEBUG is not set
+CONFIG_ISA_DMA_API=y
+# CONFIG_ISA is not set
+CONFIG_GENERIC_ISA_DMA=y
+CONFIG_PCI=y
+CONFIG_PCI_DOMAINS=y
+# CONFIG_PCI_DEBUG is not set
+CONFIG_PCCARD=m
+# CONFIG_PCMCIA_DEBUG is not set
+CONFIG_PCMCIA=m
+CONFIG_CARDBUS=y
+CONFIG_YENTA=m
+CONFIG_PD6729=m
+CONFIG_I82092=m
+CONFIG_TCIC=m
+CONFIG_PCCARD_NONSTATIC=m
+# CONFIG_ADVANCED_OPTIONS is not set
+CONFIG_HIGHMEM_START=0xfe000000
+CONFIG_LOWMEM_SIZE=0x30000000
+CONFIG_KERNEL_START=0xc0000000
+CONFIG_TASK_SIZE=0x80000000
+CONFIG_BOOT_LOAD=0x00800000
+CONFIG_STANDALONE=y
+# CONFIG_MTD is not set
+CONFIG_BLK_DEV_FD=m
+CONFIG_BLK_CPQ_DA=m
+CONFIG_BLK_CPQ_CISS_DA=m
+CONFIG_CISS_SCSI_TAPE=y
+CONFIG_BLK_DEV_DAC960=m
+CONFIG_BLK_DEV_UMEM=m
+CONFIG_BLK_DEV_LOOP=m
+CONFIG_BLK_DEV_CRYPTOLOOP=m
+CONFIG_BLK_DEV_NBD=m
+CONFIG_BLK_DEV_SX8=m
+# CONFIG_BLK_DEV_UB is not set
+CONFIG_BLK_DEV_RAM_SIZE=8192
+CONFIG_BLK_DEV_INITRD=y
+CONFIG_LBD=y
+CONFIG_CDROM_PKTCDVD=m
+CONFIG_CDROM_PKTCDVD_BUFFERS=8
+# CONFIG_CDROM_PKTCDVD_WCACHE is not set
+CONFIG_ATA_OVER_ETH=m
+CONFIG_IDE=y
+CONFIG_BLK_DEV_IDE=y
+# CONFIG_BLK_DEV_IDE_SATA is not set
+CONFIG_BLK_DEV_IDEDISK=m
+# CONFIG_IDEDISK_MULTI_MODE is not set
+CONFIG_BLK_DEV_IDECS=m
+CONFIG_BLK_DEV_IDECD=m
+CONFIG_BLK_DEV_IDETAPE=m
+CONFIG_BLK_DEV_IDEFLOPPY=m
+# CONFIG_IDE_GENERIC is not set
+CONFIG_BLK_DEV_IDEPCI=y
+CONFIG_IDEPCI_SHARE_IRQ=y
+# CONFIG_BLK_DEV_OFFBOARD is not set
+CONFIG_BLK_DEV_GENERIC=m
+# CONFIG_BLK_DEV_OPTI621 is not set
+CONFIG_BLK_DEV_SL82C105=m
+CONFIG_BLK_DEV_IDEDMA_PCI=y
+# CONFIG_BLK_DEV_IDEDMA_FORCED is not set
+# CONFIG_IDEDMA_ONLYDISK is not set
+CONFIG_BLK_DEV_AEC62XX=m
+# CONFIG_BLK_DEV_ALI15X3 is not set
+# CONFIG_BLK_DEV_AMD74XX is not set
+CONFIG_BLK_DEV_CMD64X=m
+# CONFIG_BLK_DEV_TRIFLEX is not set
+# CONFIG_BLK_DEV_CY82C693 is not set
+# CONFIG_BLK_DEV_CS5520 is not set
+# CONFIG_BLK_DEV_CS5530 is not set
+CONFIG_BLK_DEV_HPT34X=m
+# CONFIG_HPT34X_AUTODMA is not set
+CONFIG_BLK_DEV_HPT366=m
+CONFIG_BLK_DEV_SC1200=m
+# CONFIG_BLK_DEV_PIIX is not set
+CONFIG_BLK_DEV_NS87415=m
+CONFIG_BLK_DEV_PDC202XX_OLD=m
+# CONFIG_PDC202XX_BURST is not set
+CONFIG_BLK_DEV_PDC202XX_NEW=m
+# CONFIG_BLK_DEV_SVWKS is not set
+CONFIG_BLK_DEV_SIIMAGE=m
+# CONFIG_BLK_DEV_SLC90E66 is not set
+CONFIG_BLK_DEV_TRM290=m
+CONFIG_BLK_DEV_VIA82CXXX=m
+CONFIG_BLK_DEV_IDE_PMAC=y
+CONFIG_BLK_DEV_IDE_PMAC_ATA100FIRST=y
+CONFIG_BLK_DEV_IDEDMA_PMAC=y
+# CONFIG_IDE_ARM is not set
+CONFIG_BLK_DEV_IDEDMA=y
+# CONFIG_IDEDMA_IVB is not set
+# CONFIG_BLK_DEV_HD is not set
+CONFIG_SCSI_DPT_I2O=m
+CONFIG_MEGARAID_NEWGEN=y
+CONFIG_MEGARAID_MM=m
+CONFIG_MEGARAID_MAILBOX=m
+# CONFIG_MEGARAID_LEGACY is not set
+CONFIG_SCSI_BUSLOGIC=m
+# CONFIG_SCSI_OMIT_FLASHPOINT is not set
+CONFIG_SCSI_DMX3191D=m
+CONFIG_SCSI_EATA=m
+# CONFIG_SCSI_EATA_TAGGED_QUEUE is not set
+# CONFIG_SCSI_EATA_LINKED_COMMANDS is not set
+CONFIG_SCSI_EATA_MAX_TAGS=16
+# CONFIG_SCSI_FUTURE_DOMAIN is not set
+# CONFIG_SCSI_GDTH is not set
+CONFIG_SCSI_IPS=m
+# CONFIG_SCSI_INITIO is not set
+CONFIG_SCSI_INIA100=m
+CONFIG_SCSI_SYM53C8XX_2=m
+CONFIG_SCSI_SYM53C8XX_DMA_ADDRESSING_MODE=1
+CONFIG_SCSI_SYM53C8XX_DEFAULT_TAGS=16
+CONFIG_SCSI_SYM53C8XX_MAX_TAGS=64
+CONFIG_SCSI_IPR=m
+# CONFIG_SCSI_IPR_TRACE is not set
+# CONFIG_SCSI_IPR_DUMP is not set
+CONFIG_SCSI_QLOGIC_FC=m
+# CONFIG_SCSI_QLOGIC_FC_FIRMWARE is not set
+# CONFIG_SCSI_QLOGIC_1280 is not set
+CONFIG_SCSI_LPFC=m
+CONFIG_SCSI_DC395x=m
+CONFIG_SCSI_DC390T=m
+CONFIG_SCSI_NSP32=m
+# CONFIG_SCSI_DEBUG is not set
+CONFIG_SCSI_MESH=m
+CONFIG_SCSI_MESH_SYNC_RATE=5
+CONFIG_SCSI_MESH_RESET_DELAY_MS=4000
+CONFIG_SCSI_MAC53C94=m
+CONFIG_PCMCIA_AHA152X=m
+# CONFIG_PCMCIA_FDOMAIN is not set
+CONFIG_PCMCIA_NINJA_SCSI=m
+CONFIG_PCMCIA_QLOGIC=m
+CONFIG_PCMCIA_SYM53C500=m
+CONFIG_I2O=m
+CONFIG_I2O_CONFIG=m
+CONFIG_I2O_BLOCK=m
+CONFIG_I2O_SCSI=m
+CONFIG_I2O_PROC=m
+CONFIG_ATM=m
+CONFIG_ATM_CLIP=m
+CONFIG_ATM_CLIP_NO_ICMP=y
+CONFIG_ATM_LANE=m
+CONFIG_ATM_MPOA=m
+CONFIG_ATM_BR2684=m
+# CONFIG_ATM_BR2684_IPFILTER is not set
+CONFIG_BRIDGE=m
+CONFIG_DECNET=m
+CONFIG_DECNET_ROUTER=y
+CONFIG_LLC=y
+CONFIG_LLC2=m
+CONFIG_IPX=m
+CONFIG_IPX_INTERN=y
+CONFIG_ATALK=m
+CONFIG_IPDDP=m
+CONFIG_IPDDP_ENCAP=y
+CONFIG_IPDDP_DECAP=y
+CONFIG_X25=m
+CONFIG_LAPB=m
+CONFIG_ECONET=m
+CONFIG_ECONET_AUNUDP=y
+CONFIG_ECONET_NATIVE=y
+CONFIG_WAN_ROUTER=m
+CONFIG_NETPOLL=y
+CONFIG_NETPOLL_TRAP=y
+CONFIG_NET_POLL_CONTROLLER=y
+CONFIG_HAMRADIO=y
+CONFIG_AX25=m
+CONFIG_AX25_DAMA_SLAVE=y
+CONFIG_NETROM=m
+CONFIG_ROSE=m
+CONFIG_BPQETHER=m
+CONFIG_BAYCOM_SER_FDX=m
+CONFIG_BAYCOM_SER_HDX=m
+CONFIG_YAM=m
+CONFIG_IRDA=m
+CONFIG_IRLAN=m
+CONFIG_IRNET=m
+CONFIG_IRCOMM=m
+CONFIG_IRDA_ULTRA=y
+CONFIG_IRDA_CACHE_LAST_LSAP=y
+CONFIG_IRDA_FAST_RR=y
+CONFIG_IRDA_DEBUG=y
+CONFIG_IRTTY_SIR=m
+# CONFIG_DONGLE is not set
+CONFIG_USB_IRDA=m
+# CONFIG_SIGMATEL_FIR is not set
+CONFIG_NSC_FIR=m
+CONFIG_WINBOND_FIR=m
+# CONFIG_TOSHIBA_FIR is not set
+CONFIG_SMC_IRCC_FIR=m
+CONFIG_ALI_FIR=m
+# CONFIG_VLSI_FIR is not set
+CONFIG_VIA_FIR=m
+CONFIG_BT=m
+CONFIG_BT_L2CAP=m
+CONFIG_BT_SCO=m
+CONFIG_BT_RFCOMM=m
+CONFIG_BT_RFCOMM_TTY=y
+CONFIG_BT_BNEP=m
+CONFIG_BT_BNEP_MC_FILTER=y
+CONFIG_BT_BNEP_PROTO_FILTER=y
+CONFIG_BT_CMTP=m
+CONFIG_BT_HIDP=m
+CONFIG_BT_HCIUSB=m
+CONFIG_BT_HCIUSB_SCO=y
+CONFIG_BT_HCIUART=m
+CONFIG_BT_HCIUART_H4=y
+CONFIG_BT_HCIUART_BCSP=y
+CONFIG_BT_HCIBCM203X=m
+CONFIG_BT_HCIBPA10X=m
+CONFIG_BT_HCIBFUSB=m
+CONFIG_BT_HCIDTL1=m
+CONFIG_BT_HCIBT3C=m
+CONFIG_BT_HCIBLUECARD=m
+CONFIG_BT_HCIBTUART=m
+CONFIG_BT_HCIVHCI=m
+CONFIG_DUMMY=m
+CONFIG_ARCNET=m
+CONFIG_ARCNET_1201=m
+CONFIG_ARCNET_1051=m
+CONFIG_ARCNET_RAW=m
+CONFIG_ARCNET_CAP=m
+# CONFIG_ARCNET_COM90xx is not set
+CONFIG_ARCNET_COM90xxIO=m
+# CONFIG_ARCNET_RIM_I is not set
+CONFIG_ARCNET_COM20020=m
+CONFIG_ARCNET_COM20020_PCI=m
+CONFIG_MACE=m
+# CONFIG_MACE_AAUI_PORT is not set
+CONFIG_BMAC=m
+CONFIG_HAPPYMEAL=m
+CONFIG_SUNGEM=m
+CONFIG_NET_VENDOR_3COM=y
+CONFIG_VORTEX=m
+CONFIG_TYPHOON=m
+CONFIG_NET_TULIP=y
+CONFIG_DE2104X=m
+CONFIG_TULIP=m
+# CONFIG_TULIP_MWI is not set
+# CONFIG_TULIP_MMIO is not set
+CONFIG_DE4X5=m
+CONFIG_WINBOND_840=m
+CONFIG_DM9102=m
+CONFIG_PCMCIA_XIRCOM=m
+# CONFIG_HP100 is not set
+CONFIG_NET_PCI=y
+CONFIG_PCNET32=m
+# CONFIG_AMD8111_ETH is not set
+CONFIG_ADAPTEC_STARFIRE=m
+CONFIG_B44=m
+# CONFIG_FORCEDETH is not set
+CONFIG_EEPRO100=m
+CONFIG_E100=m
+CONFIG_FEALNX=m
+CONFIG_NATSEMI=m
+CONFIG_NE2K_PCI=m
+CONFIG_8139CP=m
+CONFIG_8139TOO=m
+CONFIG_8139TOO_PIO=y
+# CONFIG_8139TOO_TUNE_TWISTER is not set
+CONFIG_8139TOO_8129=y
+# CONFIG_8139_OLD_RX_RESET is not set
+CONFIG_SIS900=m
+CONFIG_EPIC100=m
+CONFIG_SUNDANCE=m
+CONFIG_SUNDANCE_MMIO=y
+CONFIG_TLAN=m
+CONFIG_VIA_RHINE=m
+CONFIG_VIA_RHINE_MMIO=y
+CONFIG_DL2K=m
+CONFIG_E1000=m
+CONFIG_NS83820=m
+CONFIG_HAMACHI=m
+CONFIG_YELLOWFIN=m
+CONFIG_R8169=m
+CONFIG_R8169_VLAN=y
+CONFIG_VIA_VELOCITY=m
+CONFIG_TIGON3=m
+CONFIG_BNX2=m
+CONFIG_MV643XX_ETH=m
+CONFIG_IXGB=m
+CONFIG_S2IO=m
+CONFIG_WLAN_PRE80211=y
+CONFIG_STRIP=m
+CONFIG_PCMCIA_WAVELAN=m
+CONFIG_PCMCIA_NETWAVE=m
+CONFIG_WLAN_80211=y
+CONFIG_PCMCIA_RAYCS=m
+CONFIG_HERMES=m
+CONFIG_APPLE_AIRPORT=m
+CONFIG_PLX_HERMES=m
+CONFIG_TMD_HERMES=m
+CONFIG_PCI_HERMES=m
+CONFIG_ATMEL=m
+# CONFIG_PCI_ATMEL is not set
+CONFIG_PCMCIA_HERMES=m
+CONFIG_AIRO_CS=m
+CONFIG_PCMCIA_ATMEL=m
+CONFIG_PCMCIA_WL3501=m
+CONFIG_PRISM54=m
+CONFIG_NET_PCMCIA=y
+CONFIG_PCMCIA_3C589=m
+CONFIG_PCMCIA_3C574=m
+CONFIG_PCMCIA_FMVJ18X=m
+CONFIG_PCMCIA_PCNET=m
+CONFIG_PCMCIA_NMCLAN=m
+CONFIG_PCMCIA_SMC91C92=m
+CONFIG_PCMCIA_XIRC2PS=m
+CONFIG_PCMCIA_AXNET=m
+CONFIG_ARCNET_COM20020_CS=m
+CONFIG_PCMCIA_IBMTR=m
+CONFIG_WAN=y
+CONFIG_DSCC4=m
+# CONFIG_DSCC4_PCISYNC is not set
+# CONFIG_DSCC4_PCI_RST is not set
+CONFIG_LANMEDIA=m
+CONFIG_PCI200SYN=m
+CONFIG_WANXL=m
+CONFIG_PC300=m
+CONFIG_PC300_MLPPP=y
+CONFIG_FARSYNC=m
+CONFIG_DLCI=m
+CONFIG_DLCI_MAX=8
+CONFIG_CYCLADES_SYNC=m
+CONFIG_CYCLOMX_X25=y
+CONFIG_LAPBETHER=m
+CONFIG_X25_ASY=m
+CONFIG_ATM_DRIVERS=y
+CONFIG_ATM_TCP=m
+CONFIG_ATM_LANAI=m
+CONFIG_ATM_ENI=m
+# CONFIG_ATM_ENI_DEBUG is not set
+# CONFIG_ATM_ENI_TUNE_BURST is not set
+CONFIG_ATM_FIRESTREAM=m
+CONFIG_ATM_ZATM=m
+CONFIG_ATM_ZATM_DEBUG=y
+CONFIG_ATM_NICSTAR=m
+CONFIG_ATM_NICSTAR_USE_SUNI=y
+CONFIG_ATM_NICSTAR_USE_IDT77105=y
+CONFIG_ATM_IDT77252=m
+# CONFIG_ATM_IDT77252_DEBUG is not set
+# CONFIG_ATM_IDT77252_RCV_ALL is not set
+CONFIG_ATM_IDT77252_USE_SUNI=y
+CONFIG_ATM_AMBASSADOR=m
+# CONFIG_ATM_AMBASSADOR_DEBUG is not set
+CONFIG_ATM_HORIZON=m
+# CONFIG_ATM_HORIZON_DEBUG is not set
+CONFIG_ATM_IA=m
+# CONFIG_ATM_IA_DEBUG is not set
+CONFIG_ATM_FORE200E_MAYBE=m
+CONFIG_ATM_FORE200E_PCA=y
+CONFIG_ATM_FORE200E_PCA_DEFAULT_FW=y
+CONFIG_ATM_FORE200E_USE_TASKLET=y
+CONFIG_ATM_FORE200E_TX_RETRY=16
+CONFIG_ATM_FORE200E_DEBUG=0
+CONFIG_ATM_FORE200E=m
+CONFIG_ATM_HE=m
+# CONFIG_ATM_HE_USE_SUNI is not set
+CONFIG_FDDI=y
+CONFIG_DEFXX=m
+CONFIG_SKFP=m
+CONFIG_HIPPI=y
+# CONFIG_ROADRUNNER is not set
+CONFIG_PPP=m
+CONFIG_PPP_MULTILINK=y
+CONFIG_PPP_FILTER=y
+CONFIG_PPP_ASYNC=m
+CONFIG_PPP_SYNC_TTY=m
+CONFIG_PPP_DEFLATE=m
+CONFIG_PPP_BSDCOMP=m
+CONFIG_PPPOE=m
+CONFIG_PPPOATM=m
+CONFIG_SLIP=m
+# CONFIG_SLIP_COMPRESSED is not set
+# CONFIG_SLIP_SMART is not set
+# CONFIG_SLIP_MODE_SLIP6 is not set
+CONFIG_NET_FC=y
+CONFIG_SHAPER=m
+CONFIG_NETCONSOLE=m
+CONFIG_ISDN=m
+# CONFIG_ISDN_I4L is not set
+CONFIG_ISDN_CAPI=m
+# CONFIG_ISDN_DRV_AVMB1_VERBOSE_REASON is not set
+CONFIG_ISDN_CAPI_MIDDLEWARE=y
+CONFIG_ISDN_CAPI_CAPI20=m
+# CONFIG_ISDN_CAPI_CAPIFS_BOOL is not set
+CONFIG_CAPI_AVM=y
+CONFIG_ISDN_DRV_AVMB1_B1PCI=m
+CONFIG_ISDN_DRV_AVMB1_B1PCIV4=y
+CONFIG_ISDN_DRV_AVMB1_B1PCMCIA=m
+CONFIG_ISDN_DRV_AVMB1_AVM_CS=m
+CONFIG_ISDN_DRV_AVMB1_T1PCI=m
+CONFIG_ISDN_DRV_AVMB1_C4=m
+CONFIG_CAPI_EICON=y
+CONFIG_ISDN_DIVAS=m
+CONFIG_ISDN_DIVAS_BRIPCI=y
+CONFIG_ISDN_DIVAS_PRIPCI=y
+CONFIG_ISDN_DIVAS_DIVACAPI=m
+CONFIG_ISDN_DIVAS_USERIDI=m
+CONFIG_ISDN_DIVAS_MAINT=m
+CONFIG_PHONE=m
+CONFIG_PHONE_IXJ=m
+CONFIG_PHONE_IXJ_PCMCIA=m
+CONFIG_INPUT=y
+CONFIG_INPUT_MOUSEDEV=y
+CONFIG_INPUT_MOUSEDEV_PSAUX=y
+CONFIG_INPUT_MOUSEDEV_SCREEN_X=1024
+CONFIG_INPUT_MOUSEDEV_SCREEN_Y=768
+CONFIG_INPUT_JOYDEV=m
+CONFIG_INPUT_TSDEV=m
+CONFIG_INPUT_TSDEV_SCREEN_X=240
+CONFIG_INPUT_TSDEV_SCREEN_Y=320
+CONFIG_INPUT_EVDEV=m
+CONFIG_INPUT_KEYBOARD=y
+CONFIG_KEYBOARD_ATKBD=m
+# CONFIG_KEYBOARD_SUNKBD is not set
+# CONFIG_KEYBOARD_LKKBD is not set
+# CONFIG_KEYBOARD_XTKBD is not set
+# CONFIG_KEYBOARD_NEWTON is not set
+CONFIG_INPUT_MOUSE=y
+CONFIG_MOUSE_PS2=m
+# CONFIG_MOUSE_SERIAL is not set
+CONFIG_MOUSE_APPLETOUCH=m
+# CONFIG_MOUSE_VSXXXAA is not set
+CONFIG_INPUT_JOYSTICK=y
+CONFIG_JOYSTICK_ANALOG=m
+CONFIG_JOYSTICK_A3D=m
+CONFIG_JOYSTICK_ADI=m
+CONFIG_JOYSTICK_COBRA=m
+CONFIG_JOYSTICK_GF2K=m
+CONFIG_JOYSTICK_GRIP=m
+CONFIG_JOYSTICK_GRIP_MP=m
+CONFIG_JOYSTICK_GUILLEMOT=m
+CONFIG_JOYSTICK_INTERACT=m
+CONFIG_JOYSTICK_SIDEWINDER=m
+CONFIG_JOYSTICK_TMDC=m
+CONFIG_JOYSTICK_IFORCE=m
+CONFIG_JOYSTICK_IFORCE_USB=y
+CONFIG_JOYSTICK_IFORCE_232=y
+CONFIG_JOYSTICK_WARRIOR=m
+CONFIG_JOYSTICK_MAGELLAN=m
+CONFIG_JOYSTICK_SPACEORB=m
+CONFIG_JOYSTICK_SPACEBALL=m
+CONFIG_JOYSTICK_STINGER=m
+CONFIG_JOYSTICK_TWIDJOY=m
+CONFIG_JOYSTICK_JOYDUMP=m
+CONFIG_JOYSTICK_XPAD=m
+CONFIG_INPUT_TABLET=y
+CONFIG_TABLET_USB_ACECAD=m
+CONFIG_TABLET_USB_AIPTEK=m
+CONFIG_TABLET_USB_GTCO=m
+CONFIG_TABLET_USB_KBTAB=m
+CONFIG_TABLET_USB_WACOM=m
+CONFIG_INPUT_TOUCHSCREEN=y
+CONFIG_TOUCHSCREEN_GUNZE=m
+CONFIG_TOUCHSCREEN_ELO=m
+CONFIG_TOUCHSCREEN_MTOUCH=m
+CONFIG_TOUCHSCREEN_MK712=m
+CONFIG_TOUCHSCREEN_USB_COMPOSITE=m
+CONFIG_INPUT_MISC=y
+CONFIG_INPUT_PCSPKR=m
+CONFIG_INPUT_UINPUT=m
+CONFIG_SERIO=m
+CONFIG_SERIO_I8042=m
+CONFIG_SERIO_SERPORT=m
+# CONFIG_SERIO_PCIPS2 is not set
+CONFIG_SERIO_LIBPS2=m
+CONFIG_SERIO_RAW=m
+CONFIG_GAMEPORT=m
+CONFIG_GAMEPORT_NS558=m
+CONFIG_GAMEPORT_L4=m
+CONFIG_GAMEPORT_EMU10K1=m
+CONFIG_GAMEPORT_FM801=m
+CONFIG_VT=y
+CONFIG_VT_CONSOLE=y
+CONFIG_HW_CONSOLE=y
+# CONFIG_SERIAL_NONSTANDARD is not set
+CONFIG_SERIAL_8250=y
+CONFIG_SERIAL_8250_CONSOLE=y
+CONFIG_SERIAL_8250_CS=m
+CONFIG_SERIAL_8250_NR_UARTS=16
+CONFIG_SERIAL_8250_RUNTIME_UARTS=4
+# CONFIG_SERIAL_8250_EXTENDED is not set
+CONFIG_SERIAL_CORE=y
+CONFIG_SERIAL_CORE_CONSOLE=y
+CONFIG_SERIAL_PMACZILOG=y
+CONFIG_SERIAL_PMACZILOG_CONSOLE=y
+CONFIG_SERIAL_JSM=m
+CONFIG_PRINTER=m
+CONFIG_IPMI_HANDLER=m
+# CONFIG_IPMI_PANIC_EVENT is not set
+CONFIG_IPMI_DEVICE_INTERFACE=m
+CONFIG_IPMI_SI=m
+CONFIG_IPMI_WATCHDOG=m
+CONFIG_IPMI_POWEROFF=m
+CONFIG_WATCHDOG=y
+# CONFIG_WATCHDOG_NOWAYOUT is not set
+CONFIG_SOFT_WATCHDOG=m
+CONFIG_PCIPCWATCHDOG=m
+CONFIG_WDTPCI=m
+CONFIG_WDT_501_PCI=y
+CONFIG_USBPCWATCHDOG=m
+CONFIG_NVRAM=y
+CONFIG_GEN_RTC=y
+CONFIG_GEN_RTC_X=y
+CONFIG_DTLK=m
+CONFIG_R3964=m
+CONFIG_APPLICOM=m
+CONFIG_AGP=m
+CONFIG_AGP_SIS=m
+CONFIG_AGP_UNINORTH=m
+CONFIG_AGP_VIA=m
+CONFIG_DRM=m
+CONFIG_DRM_TDFX=m
+CONFIG_DRM_R128=m
+CONFIG_DRM_RADEON=m
+CONFIG_DRM_MGA=m
+# CONFIG_DRM_SIS is not set
+# CONFIG_RAW_DRIVER is not set
+CONFIG_I2C=y
+CONFIG_I2C_CHARDEV=m
+CONFIG_I2C_ALGOBIT=y
+CONFIG_I2C_ALGOPCF=m
+CONFIG_I2C_ALGOPCA=m
+# CONFIG_I2C_ALI1535 is not set
+# CONFIG_I2C_ALI1563 is not set
+# CONFIG_I2C_ALI15X3 is not set
+# CONFIG_I2C_AMD756 is not set
+# CONFIG_I2C_AMD8111 is not set
+CONFIG_I2C_HYDRA=m
+# CONFIG_I2C_I801 is not set
+# CONFIG_I2C_I810 is not set
+# CONFIG_I2C_PIIX4 is not set
+CONFIG_I2C_POWERMAC=m
+CONFIG_I2C_MPC=m
+# CONFIG_I2C_NFORCE2 is not set
+CONFIG_I2C_PARPORT_LIGHT=m
+CONFIG_I2C_PROSAVAGE=m
+CONFIG_I2C_SAVAGE4=m
+CONFIG_SCx200_ACB=m
+CONFIG_I2C_SIS5595=m
+CONFIG_I2C_SIS630=m
+CONFIG_I2C_SIS96X=m
+# CONFIG_I2C_STUB is not set
+CONFIG_I2C_VIA=m
+CONFIG_I2C_VIAPRO=m
+CONFIG_I2C_VOODOO3=m
+CONFIG_I2C_PCA_ISA=m
+CONFIG_SENSORS_ADM1021=m
+CONFIG_SENSORS_ADM1025=m
+CONFIG_SENSORS_ADM1026=m
+CONFIG_SENSORS_ADM1031=m
+CONFIG_SENSORS_ASB100=m
+CONFIG_SENSORS_DS1621=m
+CONFIG_SENSORS_F71805F=m
+CONFIG_SENSORS_FSCHER=m
+CONFIG_SENSORS_FSCPOS=m
+CONFIG_SENSORS_GL518SM=m
+CONFIG_SENSORS_GL520SM=m
+CONFIG_SENSORS_IT87=m
+CONFIG_SENSORS_LM63=m
+CONFIG_SENSORS_LM75=m
+CONFIG_SENSORS_LM77=m
+CONFIG_SENSORS_LM78=m
+CONFIG_SENSORS_LM80=m
+CONFIG_SENSORS_LM83=m
+CONFIG_SENSORS_LM85=m
+CONFIG_SENSORS_LM87=m
+CONFIG_SENSORS_LM90=m
+CONFIG_SENSORS_LM92=m
+CONFIG_SENSORS_MAX1619=m
+CONFIG_SENSORS_PC87360=m
+CONFIG_SENSORS_SMSC47B397=m
+CONFIG_SENSORS_SIS5595=m
+CONFIG_SENSORS_SMSC47M1=m
+CONFIG_SENSORS_VIA686A=m
+CONFIG_SENSORS_W83781D=m
+CONFIG_SENSORS_W83L785TS=m
+CONFIG_SENSORS_W83627HF=m
+CONFIG_SENSORS_DS1337=m
+CONFIG_SENSORS_EEPROM=m
+CONFIG_SENSORS_PCF8574=m
+CONFIG_SENSORS_PCF8591=m
+CONFIG_SENSORS_M41T00=m
+# CONFIG_I2C_DEBUG_CORE is not set
+# CONFIG_I2C_DEBUG_ALGO is not set
+# CONFIG_I2C_DEBUG_BUS is not set
+# CONFIG_I2C_DEBUG_CHIP is not set
+CONFIG_VIDEO_DEV=m
+CONFIG_VIDEO_BT848=m
+CONFIG_VIDEO_CPIA=m
+CONFIG_VIDEO_CPIA_USB=m
+CONFIG_VIDEO_SAA5246A=m
+CONFIG_VIDEO_SAA5249=m
+CONFIG_TUNER_3036=m
+CONFIG_VIDEO_STRADIS=m
+CONFIG_VIDEO_ZORAN=m
+CONFIG_VIDEO_ZORAN_BUZ=m
+CONFIG_VIDEO_ZORAN_DC10=m
+CONFIG_VIDEO_ZORAN_DC30=m
+CONFIG_VIDEO_ZORAN_LML33=m
+CONFIG_VIDEO_ZORAN_LML33R10=m
+CONFIG_VIDEO_MXB=m
+CONFIG_VIDEO_DPC=m
+CONFIG_VIDEO_HEXIUM_ORION=m
+CONFIG_VIDEO_HEXIUM_GEMINI=m
+CONFIG_VIDEO_CX88=m
+CONFIG_VIDEO_CX88_DVB=m
+CONFIG_VIDEO_OVCAMCHIP=m
+CONFIG_RADIO_GEMTEK_PCI=m
+CONFIG_RADIO_MAXIRADIO=m
+CONFIG_RADIO_MAESTRO=m
+CONFIG_DVB_CORE=m
+CONFIG_VIDEO_SAA7146=m
+CONFIG_VIDEO_SAA7146_VV=m
+CONFIG_VIDEO_TUNER=m
+CONFIG_VIDEO_BUF=m
+CONFIG_VIDEO_BUF_DVB=m
+CONFIG_VIDEO_BTCX=m
+CONFIG_VIDEO_IR=m
+CONFIG_VIDEO_TVEEPROM=m
+CONFIG_FB=y
+CONFIG_FB_CFB_IMAGEBLIT=y
+CONFIG_FB_MACMODES=y
+CONFIG_FB_MODE_HELPERS=y
+CONFIG_FB_TILEBLITTING=y
+CONFIG_FB_CIRRUS=m
+# CONFIG_FB_PM2 is not set
+# CONFIG_FB_CYBER2000 is not set
+CONFIG_FB_OF=y
+CONFIG_FB_CT65550=y
+# CONFIG_FB_ASILIANT is not set
+# CONFIG_FB_VGA16 is not set
+CONFIG_FB_NVIDIA=y
+# CONFIG_FB_RIVA is not set
+# CONFIG_FB_RIVA_I2C is not set
+# CONFIG_FB_RIVA_DEBUG is not set
+CONFIG_FB_MATROX=y
+CONFIG_FB_MATROX_MILLENIUM=y
+CONFIG_FB_MATROX_MYSTIQUE=y
+CONFIG_FB_MATROX_G=y
+CONFIG_FB_MATROX_I2C=m
+CONFIG_FB_MATROX_MAVEN=m
+CONFIG_FB_MATROX_MULTIHEAD=y
+CONFIG_FB_RADEON=y
+CONFIG_FB_RADEON_I2C=y
+# CONFIG_FB_RADEON_DEBUG is not set
+CONFIG_FB_ATY128=y
+CONFIG_FB_ATY=y
+CONFIG_FB_ATY_CT=y
+CONFIG_FB_ATY_GENERIC_LCD=y
+CONFIG_FB_ATY_GX=y
+CONFIG_FB_SAVAGE=m
+CONFIG_FB_SAVAGE_I2C=y
+CONFIG_FB_SAVAGE_ACCEL=y
+CONFIG_FB_SIS=y
+CONFIG_FB_SIS_300=y
+CONFIG_FB_SIS_315=y
+CONFIG_FB_NEOMAGIC=m
+CONFIG_FB_KYRO=m
+CONFIG_FB_3DFX=y
+# CONFIG_FB_3DFX_ACCEL is not set
+CONFIG_FB_VOODOO1=y
+CONFIG_FB_TRIDENT=m
+CONFIG_FB_TRIDENT_ACCEL=y
+CONFIG_FB_IBM_GXT4500=m
+CONFIG_FB_S1D13XXX=m
+# CONFIG_FB_VIRTUAL is not set
+CONFIG_VGA_CONSOLE=y
+CONFIG_DUMMY_CONSOLE=y
+CONFIG_FRAMEBUFFER_CONSOLE=y
+# CONFIG_FONTS is not set
+CONFIG_FONT_8x8=y
+CONFIG_FONT_8x16=y
+CONFIG_LOGO=y
+# CONFIG_LOGO_LINUX_MONO is not set
+CONFIG_LOGO_LINUX_VGA16=y
+# CONFIG_LOGO_LINUX_CLUT224 is not set
+CONFIG_SOUND=m
+CONFIG_DMASOUND=m
+CONFIG_SND=m
+CONFIG_SND_TIMER=m
+CONFIG_SND_PCM=m
+CONFIG_SND_HWDEP=m
+CONFIG_SND_SEQUENCER=m
+# CONFIG_SND_SEQ_DUMMY is not set
+CONFIG_SND_OSSEMUL=y
+CONFIG_SND_MIXER_OSS=m
+CONFIG_SND_PCM_OSS=m
+CONFIG_SND_SEQUENCER_OSS=y
+# CONFIG_SND_VERBOSE_PRINTK is not set
+# CONFIG_SND_DEBUG is not set
+CONFIG_SND_MPU401_UART=m
+CONFIG_SND_OPL3_LIB=m
+CONFIG_SND_VX_LIB=m
+# CONFIG_SND_DUMMY is not set
+# CONFIG_SND_VIRMIDI is not set
+# CONFIG_SND_MTPAV is not set
+# CONFIG_SND_SERIAL_U16550 is not set
+# CONFIG_SND_MPU401 is not set
+CONFIG_SND_AC97_CODEC=m
+# CONFIG_SND_ALI5451 is not set
+CONFIG_SND_ATIIXP=m
+CONFIG_SND_ATIIXP_MODEM=m
+CONFIG_SND_AU8810=m
+CONFIG_SND_AU8820=m
+CONFIG_SND_AU8830=m
+CONFIG_SND_AZT3328=m
+CONFIG_SND_BT87X=m
+# CONFIG_SND_BT87X_OVERCLOCK is not set
+CONFIG_SND_CS46XX=m
+CONFIG_SND_CS46XX_NEW_DSP=y
+CONFIG_SND_CS4281=m
+CONFIG_SND_EMU10K1=m
+CONFIG_SND_EMU10K1X=m
+CONFIG_SND_CA0106=m
+CONFIG_SND_KORG1212=m
+CONFIG_SND_MIXART=m
+CONFIG_SND_NM256=m
+CONFIG_SND_RME32=m
+CONFIG_SND_RME96=m
+CONFIG_SND_RME9652=m
+CONFIG_SND_HDSP=m
+CONFIG_SND_TRIDENT=m
+CONFIG_SND_YMFPCI=m
+CONFIG_SND_ALS4000=m
+CONFIG_SND_CMIPCI=m
+CONFIG_SND_ENS1370=m
+CONFIG_SND_ENS1371=m
+CONFIG_SND_ES1938=m
+CONFIG_SND_ES1968=m
+CONFIG_SND_MAESTRO3=m
+CONFIG_SND_FM801=m
+CONFIG_SND_FM801_TEA575X_BOOL=y
+CONFIG_SND_FM801_TEA575X=m
+CONFIG_SND_ICE1712=m
+CONFIG_SND_ICE1724=m
+# CONFIG_SND_INTEL8X0 is not set
+# CONFIG_SND_INTEL8X0M is not set
+CONFIG_SND_SONICVIBES=m
+CONFIG_SND_VIA82XX=m
+CONFIG_SND_VIA82XX_MODEM=m
+CONFIG_SND_VX222=m
+CONFIG_SND_HDA_INTEL=m
+CONFIG_SND_POWERMAC=m
+CONFIG_SND_AOA=m
+CONFIG_SND_AOA_FABRIC_LAYOUT=m
+CONFIG_SND_AOA_ONYX=m
+CONFIG_SND_AOA_TAS=m
+CONFIG_SND_AOA_TOONIE=m
+CONFIG_SND_AOA_SOUNDBUS=m
+CONFIG_SND_AOA_SOUNDBUS_I2S=m
+CONFIG_SND_USB_AUDIO=m
+CONFIG_SND_USB_USX2Y=m
+# CONFIG_SOUND_PRIME is not set
+CONFIG_USB_ARCH_HAS_HCD=y
+CONFIG_USB_ARCH_HAS_OHCI=y
+CONFIG_USB=y
+# CONFIG_USB_DEBUG is not set
+CONFIG_USB_DEVICEFS=y
+CONFIG_USB_DYNAMIC_MINORS=y
+# CONFIG_USB_SUSPEND is not set
+# CONFIG_USB_OTG is not set
+CONFIG_USB_EHCI_HCD=m
+CONFIG_USB_EHCI_SPLIT_ISO=y
+CONFIG_USB_EHCI_ROOT_HUB_TT=y
+CONFIG_USB_OHCI_HCD=y
+CONFIG_USB_OHCI_HCD_PCI=y
+CONFIG_USB_OHCI_HCD_PPC_SOC=y
+CONFIG_USB_OHCI_HCD_PPC_OF=y
+CONFIG_USB_OHCI_HCD_PPC_OF_BE=y
+CONFIG_USB_OHCI_HCD_PPC_OF_LE=y
+CONFIG_USB_UHCI_HCD=m
+CONFIG_USB_SL811_HCD=m
+CONFIG_USB_SL811_CS=m
+CONFIG_USB_ACM=m
+CONFIG_USB_PRINTER=m
+CONFIG_USB_STORAGE=m
+# CONFIG_USB_STORAGE_DEBUG is not set
+CONFIG_USB_STORAGE_DATAFAB=y
+CONFIG_USB_STORAGE_FREECOM=y
+CONFIG_USB_STORAGE_ISD200=y
+CONFIG_USB_STORAGE_DPCM=y
+CONFIG_USB_STORAGE_USBAT=y
+CONFIG_USB_STORAGE_SDDR09=y
+CONFIG_USB_STORAGE_SDDR55=y
+CONFIG_USB_STORAGE_JUMPSHOT=y
+CONFIG_USB_HID=m
+CONFIG_USB_HIDINPUT_POWERBOOK=y
+CONFIG_HID_FF=y
+CONFIG_HID_PID=y
+CONFIG_LOGITECH_FF=y
+CONFIG_THRUSTMASTER_FF=y
+CONFIG_USB_HIDDEV=y
+# CONFIG_USB_KBD is not set
+# CONFIG_USB_MOUSE is not set
+CONFIG_USB_MDC800=m
+CONFIG_USB_MICROTEK=m
+CONFIG_USB_VICAM=m
+CONFIG_USB_DSBR=m
+CONFIG_USB_IBMCAM=m
+CONFIG_USB_KONICAWC=m
+CONFIG_USB_OV511=m
+CONFIG_USB_SE401=m
+CONFIG_USB_SN9C102=m
+CONFIG_USB_STV680=m
+CONFIG_USB_W9968CF=m
+CONFIG_USB_PWC=m
+CONFIG_USB_CATC=m
+CONFIG_USB_KAWETH=m
+CONFIG_USB_PEGASUS=m
+CONFIG_USB_RTL8150=m
+CONFIG_USB_USBNET=m
+CONFIG_USB_ALI_M5632=y
+CONFIG_USB_AN2720=y
+CONFIG_USB_BELKIN=y
+CONFIG_USB_ARMLINUX=y
+CONFIG_USB_EPSON2888=y
+CONFIG_USB_ZD1201=m
+CONFIG_USB_AUERSWALD=m
+CONFIG_USB_RIO500=m
+CONFIG_USB_LEGOTOWER=m
+CONFIG_USB_LCD=m
+CONFIG_USB_LED=m
+CONFIG_USB_CYTHERM=m
+CONFIG_USB_PHIDGETKIT=m
+CONFIG_USB_PHIDGETSERVO=m
+CONFIG_USB_IDMOUSE=m
+CONFIG_USB_SISUSBVGA=m
+CONFIG_USB_TEST=m
+CONFIG_USB_ATM=m
+CONFIG_USB_SPEEDTOUCH=m
+CONFIG_USB_GADGET=m
+# CONFIG_USB_GADGET_DEBUG_FILES is not set
+CONFIG_USB_GADGET_NET2280=y
+CONFIG_USB_NET2280=m
+# CONFIG_USB_GADGET_PXA2XX is not set
+# CONFIG_USB_GADGET_GOKU is not set
+# CONFIG_USB_GADGET_LH7A40X is not set
+# CONFIG_USB_GADGET_OMAP is not set
+# CONFIG_USB_GADGET_DUMMY_HCD is not set
+CONFIG_USB_GADGET_DUALSPEED=y
+CONFIG_USB_ZERO=m
+CONFIG_USB_ETH=m
+CONFIG_USB_ETH_RNDIS=y
+CONFIG_USB_GADGETFS=m
+CONFIG_USB_FILE_STORAGE=m
+CONFIG_USB_FILE_STORAGE_TEST=y
+CONFIG_USB_G_SERIAL=m
+CONFIG_MMC=m
+# CONFIG_MMC_DEBUG is not set
+CONFIG_MMC_BLOCK=m
+CONFIG_MMC_WBSD=m
+CONFIG_JBD=m
+# CONFIG_ACORN_PARTITION is not set
+# CONFIG_OSF_PARTITION is not set
+CONFIG_AMIGA_PARTITION=y
+# CONFIG_ATARI_PARTITION is not set
+CONFIG_MAC_PARTITION=y
+# CONFIG_BSD_DISKLABEL is not set
+# CONFIG_MINIX_SUBPARTITION is not set
+# CONFIG_SOLARIS_X86_PARTITION is not set
+# CONFIG_UNIXWARE_DISKLABEL is not set
+# CONFIG_LDM_PARTITION is not set
+# CONFIG_SGI_PARTITION is not set
+# CONFIG_ULTRIX_PARTITION is not set
+# CONFIG_SUN_PARTITION is not set
+# CONFIG_EFI_PARTITION is not set
+CONFIG_CRC_CCITT=m
+CONFIG_CRC32=y
+CONFIG_PROFILING=y
+CONFIG_OPROFILE=m
+# CONFIG_BDI_SWITCH is not set
+CONFIG_BOOTX_TEXT=y
+CONFIG_KEXEC=y
+CONFIG_PMAC_MEDIABAY=y
+CONFIG_SND_POWERMAC_AUTO_DRC=y
+CONFIG_HIBERNATION=y
+CONFIG_PM_STD_PARTITION=""
+CONFIG_HOTPLUG=y
+# CONFIG_HOTPLUG_CPU is not set
+CONFIG_PPC_INDIRECT_PCI=y
+CONFIG_PM_LEGACY=y
+CONFIG_PPC_I8259=y
+CONFIG_WINDFARM=m
+CONFIG_FB_NVIDIA_I2C=y
+# CONFIG_SPARSEMEM_MANUAL is not set
+# CONFIG_DISCONTIGMEM_MANUAL is not set
+CONFIG_SPLIT_PTLOCK_CPUS=4
+CONFIG_PPC_MPC106=y
+CONFIG_PPC_MERGE=y
+CONFIG_MPIC=y
+CONFIG_DEBUGGER=y
+CONFIG_PPC_RTAS=y
+# CONFIG_MMIO_NVRAM is not set
+# CONFIG_PPC_82xx is not set
+# CONFIG_RTAS_ERROR_LOGGING is not set
+CONFIG_ARCH_SPARSEMEM_ENABLE=y
+# CONFIG_XMON_DEFAULT is not set
+# CONFIG_GENERIC_TBSYNC is not set
+# CONFIG_EMBEDDED6xx is not set
+# CONFIG_PPC_ISERIES is not set
+CONFIG_PPC_STD_MMU_32=y
+CONFIG_WATCHDOG_RTAS=m
+# CONFIG_HOTPLUG_PCI is not set
+CONFIG_RTAS_PROC=y
+# CONFIG_PPC_83xx is not set
+# CONFIG_PPC_85xx is not set
+CONFIG_XMON=y
+CONFIG_CC_OPTIMIZE_FOR_SIZE=y
+# CONFIG_IPW2100 is not set
+CONFIG_HVC_RTAS=y
+CONFIG_SCSI_ARCMSR=m

Added: dists/sid/linux-2.6/debian/config/powerpc/config.apus
==============================================================================
--- (empty file)
+++ dists/sid/linux-2.6/debian/config/powerpc/config.apus	Mon Nov 26 20:06:56 2007
@@ -0,0 +1,153 @@
+#
+# Automatically generated make config: don't edit
+# Linux kernel version: 2.6.12
+# Sun Jul 31 18:13:08 2005
+#
+CONFIG_MMU=y
+CONFIG_GENERIC_HARDIRQS=y
+CONFIG_RWSEM_XCHGADD_ALGORITHM=y
+CONFIG_GENERIC_CALIBRATE_DELAY=y
+CONFIG_PPC=y
+CONFIG_PPC32=y
+CONFIG_GENERIC_NVRAM=y
+CONFIG_SCHED_NO_NO_OMIT_FRAME_POINTER=y
+
+#
+# Code maturity level options
+#
+CONFIG_EXPERIMENTAL=y
+
+#
+# General setup
+#
+CONFIG_LOCALVERSION=""
+CONFIG_SWAP=y
+CONFIG_SYSVIPC=y
+CONFIG_POSIX_MQUEUE=y
+CONFIG_BSD_PROCESS_ACCT=y
+# CONFIG_BSD_PROCESS_ACCT_V3 is not set
+# CONFIG_IKCONFIG is not set
+# CONFIG_KALLSYMS_ALL is not set
+CONFIG_BASE_FULL=y
+CONFIG_CC_ALIGN_FUNCTIONS=0
+CONFIG_CC_ALIGN_LABELS=0
+CONFIG_CC_ALIGN_LOOPS=0
+CONFIG_CC_ALIGN_JUMPS=0
+CONFIG_BASE_SMALL=0
+
+#
+# Loadable module support
+#
+CONFIG_MODULES=y
+CONFIG_OBSOLETE_MODPARM=y
+CONFIG_KMOD=y
+
+#
+# Processor
+#
+CONFIG_6xx=y
+CONFIG_A2065=y
+CONFIG_A2091_SCSI=y
+CONFIG_A2232=m
+CONFIG_A3000_SCSI=y
+CONFIG_ABSTRACT_CONSOLE=y
+CONFIG_AFFS_FS=y
+CONFIG_AMIGA=y
+CONFIG_AMIGA_BUILTIN_SERIAL=y
+CONFIG_AMIGA_FLOPPY=y
+CONFIG_AMIGA_PARTITION=y
+CONFIG_AMIGA_PCMCIA=y
+CONFIG_APNE=y
+# CONFIG_PPC_MULTIPLATFORM is not set
+CONFIG_APUS=y
+CONFIG_APUS_FAST_EXCEPT=y
+CONFIG_ARIADNE=y
+CONFIG_ATARI_PARTITION=y
+CONFIG_BLK_DEV_BUDDHA=y
+CONFIG_BLK_DEV_GAYLE=y
+CONFIG_LOGO_LINUX_VGA16=y
+CONFIG_OKTAGON_SCSI=y
+CONFIG_PARPORT_AMIGA=m
+CONFIG_PARTITION_ADVANCED=y
+CONFIG_PPC32=y
+CONFIG_PPC=y
+CONFIG_PPC_FPU=y
+CONFIG_PPC_STD_MMU=y
+CONFIG_ZORRO=y
+CONFIG_ZORRO_NAMES=y
+CONFIG_GVPIOEXT=m
+# CONFIG_SMP is not set
+CONFIG_GVPIOEXT_LP=m
+CONFIG_GVPIOEXT_PLIP=m
+CONFIG_MULTIFACE_III_TTY=m
+CONFIG_WHIPPET_SERIAL=m
+CONFIG_SERIAL_CONSOLE=y
+CONFIG_HEARTBEAT=y
+# CONFIG_PCI_PERMEDIA is not set
+CONFIG_AMIGA_Z2RAM=m
+CONFIG_BLK_DEV_IDEDOUBLER=y
+CONFIG_GVP11_SCSI=m
+CONFIG_ZORRO8390=m
+CONFIG_MOUSE_AMIGA=m
+CONFIG_JOYSTICK_AMIGA=m
+CONFIG_FB_AMIGA_OCS=y
+CONFIG_FB_AMIGA_ECS=y
+CONFIG_FB_FM2=y
+CONFIG_PROC_HARDWARE=y
+# CONFIG_IRPORT_SIR is not set
+CONFIG_PARPORT_MFC3=m
+CONFIG_PARIDE=n
+# CONFIG_SCSI_PPA is not set
+CONFIG_SCSI_IMM=m
+CONFIG_SCSI_IZIP_EPP16=y
+CONFIG_SCSI_IZIP_SLOW_CTR=y
+CONFIG_PLIP=m
+CONFIG_JOYSTICK_DB9=m
+CONFIG_JOYSTICK_GAMECON=m
+CONFIG_JOYSTICK_TURBOGRAFX=m
+CONFIG_SERIO_PARKBD=m
+CONFIG_LP_CONSOLE=y
+CONFIG_PPDEV=n
+CONFIG_TIPAR=m
+CONFIG_I2C_PARPORT=m
+CONFIG_VIDEO_BWQCAM=m
+CONFIG_VIDEO_CQCAM=m
+CONFIG_VIDEO_W9966=m
+CONFIG_VIDEO_CPIA_PP=m
+CONFIG_BAYCOM_PAR=m
+CONFIG_BAYCOM_EPP=m
+# CONFIG_PCMCIA_PCNET is not set
+# CONFIG_PCMCIA_AXNET is not set
+# CONFIG_OKTAGON_SCSI is not set
+# CONFIG_FB_CT65550 is not set
+# CONFIG_FB_CONTROL is not set
+# CONFIG_FB_PLATINUM is not set
+# CONFIG_FB_VALKYRIE is not set
+CONFIG_BOOT_LOAD=0x00800000
+CONFIG_CC_ALIGN_FUNCTIONS=0
+CONFIG_CC_ALIGN_JUMPS=0
+CONFIG_CC_ALIGN_LABELS=0
+CONFIG_CC_ALIGN_LOOPS=0
+CONFIG_DEBUG_KERNEL=y
+CONFIG_DMASOUND=m
+CONFIG_DMASOUND_PAULA=m
+CONFIG_FB=y
+CONFIG_FB_AMIGA=y
+CONFIG_FB_AMIGA_AGA=y
+CONFIG_GENERIC_ISA_DMA=y
+CONFIG_GENERIC_NVRAM=y
+CONFIG_HIGHMEM_START=0xfe000000
+CONFIG_HW_CONSOLE=y
+CONFIG_HYDRA=y
+CONFIG_KERNEL_START=0xc0000000
+CONFIG_KEYBOARD_AMIGA=y
+CONFIG_LOGO_LINUX_CLUT224=y
+CONFIG_LOGO_LINUX_MONO=y
+# CONFIG_FASTLANE_SCSI is not set
+# CONFIG_CYBERSTORMII_SCSI is not set
+# CONFIG_CYBERSTORM_SCSI is not set
+# CONFIG_BLZ1230_SCSI is not set
+# CONFIG_BLZ2060_SCSI is not set
+# CONFIG_IPMI_HANDLER is not set
+# CONFIG_FB_SIS is not set
+# CONFIG_SND_AOA is not set

Added: dists/sid/linux-2.6/debian/config/powerpc/config.powerpc
==============================================================================
--- (empty file)
+++ dists/sid/linux-2.6/debian/config/powerpc/config.powerpc	Mon Nov 26 20:06:56 2007
@@ -0,0 +1,22 @@
+# CONFIG_APUS is not set
+CONFIG_PPC32=y
+# CONFIG_SMP is not set
+CONFIG_PM_STD_PARTITION=""
+# CONFIG_IRPORT_SIR is not set
+CONFIG_PCMCIA_XIRTULIP=m
+CONFIG_MAC_FLOPPY=y
+CONFIG_FLATMEM_MANUAL=y
+CONFIG_FB_CONTROL=y
+CONFIG_FB_PLATINUM=y
+CONFIG_FB_VALKYRIE=y
+CONFIG_FB_IMSTT=y
+# CONFIG_PPC64 is not set
+CONFIG_CLASSIC32=y
+CONFIG_SERIAL_MPC52xx=y
+CONFIG_SERIAL_MPC52xx_CONSOLE=y
+CONFIG_SERIAL_MPC52xx_CONSOLE_BAUD=115200
+CONFIG_MII=y
+CONFIG_PATA_MPC52xx=m
+CONFIG_SENSORS_AMS=m
+CONFIG_SENSORS_AMS_PMU=y
+CONFIG_SENSORS_AMS_I2C=y

Added: dists/sid/linux-2.6/debian/config/powerpc/config.powerpc-miboot
==============================================================================
--- (empty file)
+++ dists/sid/linux-2.6/debian/config/powerpc/config.powerpc-miboot	Mon Nov 26 20:06:56 2007
@@ -0,0 +1,74 @@
+# CONFIG_APUS is not set
+CONFIG_PPC32=y
+CONFIG_MAC_FLOPPY=y
+# CONFIG_SMP is not set
+# CONFIG_BSD_PROCESS_ACCT is not set
+# CONFIG_AUDIT is not set
+CONFIG_EMBEDDED=y
+# CONFIG_BASE_FULL is not set
+CONFIG_CC_OPTIMIZE_FOR_SIZE=y
+CONFIG_BASE_SMALL=1
+# CONFIG_ALTIVEC is not set
+# CONFIG_TAU is not set
+# CONFIG_CPU_FREQ is not set
+# CONFIG_PM is not set
+# CONFIG_HIGHMEM is not set
+# CONFIG_PREP_RESIDUAL is not set
+# CONFIG_LBD is not set
+# CONFIG_THERM_WINDTUNNEL is not set
+# CONFIG_THERM_ADT746X is not set
+# CONFIG_NETFILTER is not set
+# CONFIG_NET_SCHED is not set
+# CONFIG_NETPOLL_TRAP is not set
+# CONFIG_HAMRADIO is not set
+# CONFIG_BT is not set
+# CONFIG_FDDI is not set
+# CONFIG_HIPPI is not set
+# CONFIG_NET_FC is not set
+CONFIG_SERIAL_8250=m
+# CONFIG_FB_OF is not set
+# CONFIG_FB_NVIDIA is not set
+# CONFIG_FB_RIVA is not set
+# CONFIG_FB_MATROX is not set
+# CONFIG_FB_RADEON is not set
+CONFIG_FB_3DFX=m
+CONFIG_FB_VOODOO1=m
+# CONFIG_VGA_CONSOLE is not set
+# CONFIG_INFINIBAND is not set
+# CONFIG_DNOTIFY is not set
+# CONFIG_PROC_KCORE is not set
+# CONFIG_NCPFS_NFS_NS is not set
+# CONFIG_NCPFS_OS2_NS is not set
+# CONFIG_NCPFS_NLS is not set
+# CONFIG_NCPFS_EXTRAS is not set
+# CONFIG_AMIGA_PARTITION is not set
+# CONFIG_MSDOS_PARTITION is not set
+# CONFIG_PROFILING is not set
+# CONFIG_BOOTX_TEXT is not set
+# CONFIG_KEYS is not set
+# CONFIG_SECURITY is not set
+CONFIG_CHR_DEV_SCH=m
+# CONFIG_MEGARAID_LEGACY is not set
+CONFIG_IRDA=m
+CONFIG_PCMCIA_XIRTULIP=m
+# CONFIG_IRPORT_SIR is not set
+# CONFIG_PMAC_BACKLIGHT is not set
+# CONFIG_HIBERNATION is not set
+CONFIG_DEFAULT_DEADLINE=y
+CONFIG_FLATMEM_MANUAL=y
+CONFIG_IOSCHED_NOOP=y
+# CONFIG_IOSCHED_AS is not set
+CONFIG_IOSCHED_DEADLINE=y
+# CONFIG_IOSCHED_CFQ is not set
+# CONFIG_DEFAULT_AS is not set
+# CONFIG_DEFAULT_CFQ is not set
+# CONFIG_DEFAULT_NOOP is not set
+
+CONFIG_FB_CONTROL=y
+CONFIG_FB_PLATINUM=y
+CONFIG_FB_VALKYRIE=y
+CONFIG_FB_IMSTT=y
+# CONFIG_PPC64 is not set
+CONFIG_CLASSIC32=y
+CONFIG_FB_SIS=m
+

Added: dists/sid/linux-2.6/debian/config/powerpc/config.powerpc-smp
==============================================================================
--- (empty file)
+++ dists/sid/linux-2.6/debian/config/powerpc/config.powerpc-smp	Mon Nov 26 20:06:56 2007
@@ -0,0 +1,15 @@
+# CONFIG_APUS is not set
+CONFIG_PPC32=y
+CONFIG_LOCK_KERNEL=y
+CONFIG_STOP_MACHINE=y
+CONFIG_SMP=y
+CONFIG_IRQ_ALL_CPUS=y
+CONFIG_NR_CPUS=4
+# CONFIG_MAC_FLOPPY is not set
+CONFIG_FLATMEM_MANUAL=y
+CONFIG_FB_CONTROL=y
+CONFIG_FB_PLATINUM=y
+CONFIG_FB_VALKYRIE=y
+CONFIG_FB_IMSTT=y
+# CONFIG_PPC64 is not set
+CONFIG_CLASSIC32=y

Added: dists/sid/linux-2.6/debian/config/powerpc/config.powerpc64
==============================================================================
--- (empty file)
+++ dists/sid/linux-2.6/debian/config/powerpc/config.powerpc64	Mon Nov 26 20:06:56 2007
@@ -0,0 +1,101 @@
+# CONFIG_APUS is not set
+CONFIG_PPC64=y
+CONFIG_64BIT=y
+CONFIG_COMPAT=y
+# CONFIG_DEBUGGER is not set
+CONFIG_EEH=y
+# CONFIG_FB_ATY128 is not set
+# CONFIG_FB_CONTROL is not set
+# CONFIG_FB_IMSTT is not set
+# CONFIG_FB_PLATINUM is not set
+# CONFIG_FB_VALKYRIE is not set
+# CONFIG_FB_NVIDIA is not set
+CONFIG_FORCE_MAX_ZONEORDER=13
+# CONFIG_GEN_RTC is not set
+CONFIG_HANGCHECK_TIMER=m
+# CONFIG_HOTPLUG_PCI is not set
+CONFIG_HVC_CONSOLE=y
+CONFIG_HVCS=m
+CONFIG_IBMVETH=m
+CONFIG_IBMVIO=y
+CONFIG_IOMMU_VMERGE=y
+# CONFIG_IRQSTACKS is not set
+CONFIG_KEYS_COMPAT=y
+# CONFIG_KPROBES is not set
+CONFIG_LOCK_KERNEL=y
+CONFIG_LPARCFG=m
+CONFIG_MEGARAID_LEGACY=m
+CONFIG_NR_CPUS=32
+CONFIG_ARCH_SPARSEMEM_ENABLE=y
+CONFIG_SELECT_MEMORY_MODEL=y
+# CONFIG_FLATMEM_MANUAL is not set
+# CONFIG_DISCONTIGMEM_MANUAL is not set
+CONFIG_SPARSEMEM_MANUAL=y
+CONFIG_SPARSEMEM=y
+CONFIG_HAVE_MEMORY_PRESENT=y
+# CONFIG_SPARSEMEM_STATIC is not set
+CONFIG_SPARSEMEM_EXTREME=y
+# CONFIG_MEMORY_HOTPLUG is not set
+CONFIG_NUMA=y
+# CONFIG_POWER4_ONLY is not set
+# CONFIG_PPC_ISERIES is not set
+CONFIG_PPC_MAPLE=y
+CONFIG_PPC_PMAC64=y
+CONFIG_PPC_PSERIES=y
+CONFIG_PPC_RTAS=y
+CONFIG_PPC_SPLPAR=y
+CONFIG_RTAS_FLASH=m
+CONFIG_RTAS_PROC=y
+# CONFIG_RTC is not set
+CONFIG_SCANLOG=m
+CONFIG_SCHED_SMT=y
+CONFIG_SCSI_QLOGIC_1280=m
+CONFIG_SCSI_IBMVSCSI=m
+CONFIG_SCSI_IBMVSCSIS=m
+# CONFIG_SERIAL_ICOM is not set
+CONFIG_SMP=y
+CONFIG_STOP_MACHINE=y
+CONFIG_SYSVIPC_COMPAT=y
+CONFIG_U3_DART=y
+CONFIG_WATCHDOG_RTAS=m
+CONFIG_ARCH_SELECT_MEMORY_MODEL=y
+CONFIG_ARCH_FLATMEM_ENABLE=y
+CONFIG_ARCH_DISCONTIGMEM_ENABLE=y
+CONFIG_ARCH_DISCONTIGMEM_DEFAULT=y
+CONFIG_DISCONTIGMEM=y
+CONFIG_IRQ_ALL_CPUS=y
+CONFIG_MPIC=y
+CONFIG_NEED_MULTIPLE_NODES=y
+CONFIG_XICS=y
+CONFIG_NODES_SPAN_OTHER_NODES=y
+# CONFIG_PPC_MPC106 is not set
+CONFIG_CPU_FREQ_PMAC64=y
+CONFIG_PPC_MERGE=y
+CONFIG_MMIO_NVRAM=y
+CONFIG_PPC_CELL=y
+CONFIG_RTAS_ERROR_LOGGING=y
+CONFIG_GENERIC_TBSYNC=y
+# CONFIG_EMBEDDED6xx is not set
+CONFIG_ARCH_SPARSEMEM_DEFAULT=y
+# CONFIG_PPC_64K_PAGES is not set
+# CONFIG_PPC_INDIRECT_PCI is not set
+# CONFIG_PPC_82xx is not set
+# CONFIG_PPC_83xx is not set
+CONFIG_POWER3=y
+CONFIG_POWER4=y
+CONFIG_WINDFARM=m
+CONFIG_WINDFARM_PM91=m
+CONFIG_WINDFARM_PM112=m
+CONFIG_SPLIT_PTLOCK_CPUS=4096
+CONFIG_WINDFARM_PM81=m
+CONFIG_KERNEL_START=0xc000000000000000
+# CONFIG_MAC_FLOPPY is not set
+# CONFIG_IBMEBUS is not set
+CONFIG_SPU_FS=m
+CONFIG_SPIDER_NET=m
+# CONFIG_LPARCFG is not set
+CONFIG_VIRT_CPU_ACCOUNTING=y
+CONFIG_MIGRATION=y
+CONFIG_CMDLINE="console=hvsi0 console=hvc0 console=ttyS0,9600 console=tty0"
+# CONFIG_MV643XX_ETH is not set
+CONFIG_BLK_DEV_AMD74XX=m

Added: dists/sid/linux-2.6/debian/config/powerpc/config.prep
==============================================================================
--- (empty file)
+++ dists/sid/linux-2.6/debian/config/powerpc/config.prep	Mon Nov 26 20:06:56 2007
@@ -0,0 +1,20 @@
+# CONFIG_APUS is not set
+CONFIG_PPC32=y
+# CONFIG_SMP is not set
+CONFIG_PM_STD_PARTITION=""
+# CONFIG_IRPORT_SIR is not set
+CONFIG_PCMCIA_XIRTULIP=m
+CONFIG_MAC_FLOPPY=y
+CONFIG_FLATMEM_MANUAL=y
+CONFIG_FB_CONTROL=y
+CONFIG_FB_PLATINUM=y
+CONFIG_FB_VALKYRIE=y
+CONFIG_FB_IMSTT=y
+# CONFIG_PPC64 is not set
+CONFIG_CLASSIC32=y
+# CONFIG_PPC_CHRP is not set
+# CONFIG_PREP_RESIDUAL is not set
+# CONFIG_WINDFARM is not set
+CONFIG_BROKEN_ON_SMP=y
+CONFIG_CPU_FREQ_TABLE=m
+# CONFIG_SND_AOA is not set

Added: dists/sid/linux-2.6/debian/config/powerpc/defines
==============================================================================
--- (empty file)
+++ dists/sid/linux-2.6/debian/config/powerpc/defines	Mon Nov 26 20:06:56 2007
@@ -0,0 +1,39 @@
+[base]
+featuresets:
+ vserver
+flavours:
+ powerpc
+ powerpc-smp
+ powerpc-miboot
+ powerpc64
+# prep
+# apus
+kernel-header-dirs: powerpc ppc m68k
+kernel-arch: powerpc
+kpkg-subarch: ppc
+
+[apus_base]
+depends: mkvmlinuz (>= 24)
+kernel-arch: ppc
+
+[prep_base]
+class: PReP PowerPC
+depends: mkvmlinuz (>= 24)
+kernel-arch: ppc
+kpkg-subarch: prep
+
+[powerpc_base]
+class: uniprocessor 32-bit PowerPC
+depends: mkvmlinuz (>= 24)
+
+[powerpc-smp_base]
+class: multiprocessor 32-bit PowerPC
+depends: mkvmlinuz (>= 24)
+
+[powerpc-miboot_base]
+class: 32-bit PowerPC for miboot floppy
+depends: mkvmlinuz (>= 24)
+
+[powerpc64_base]
+class: 64-bit PowerPC
+kpkg-subarch: powerpc64

Added: dists/sid/linux-2.6/debian/config/powerpc/modules
==============================================================================
--- (empty file)
+++ dists/sid/linux-2.6/debian/config/powerpc/modules	Mon Nov 26 20:06:56 2007
@@ -0,0 +1,213 @@
+kernel/fs/affs/affs.ko
+kernel/drivers/cdrom/cdrom.ko
+kernel/drivers/ide/ide-cd.ko
+kernel/drivers/scsi/sr_mod.ko
+kernel/fs/ext2/ext2.ko
+kernel/fs/ext3/ext3.ko
+kernel/fs/jbd/jbd.ko
+kernel/fs/fat/fat.ko
+kernel/fs/nls/nls_cp437.ko
+kernel/fs/nls/nls_iso8859-1.ko
+kernel/fs/vfat/vfat.ko
+kernel/drivers/ieee1394/ieee1394.ko
+kernel/drivers/ieee1394/ohci1394.ko
+kernel/drivers/ieee1394/sbp2.ko
+kernel/drivers/base/firmware_class.ko
+kernel/drivers/block/floppy.ko
+kernel/fs/mbcache.ko
+kernel/fs/nls/nls_utf8.ko
+kernel/fs/hfs/hfs.ko
+kernel/fs/hfsplus/hfsplus.ko
+kernel/drivers/ide/ide-disk.ko
+kernel/drivers/ide/ide-floppy.ko
+kernel/drivers/ide/ide-tape.ko
+kernel/drivers/ide/pci/aec62xx.ko
+kernel/drivers/ide/pci/cmd64x.ko
+kernel/drivers/ide/pci/generic.ko
+kernel/drivers/ide/pci/hpt34x.ko
+kernel/drivers/ide/pci/hpt366.ko
+kernel/drivers/ide/pci/ns87415.ko
+kernel/drivers/ide/pci/pdc202xx_new.ko
+kernel/drivers/ide/pci/pdc202xx_old.ko
+kernel/drivers/ide/pci/sc1200.ko
+kernel/drivers/ide/pci/siimage.ko
+kernel/drivers/ide/pci/sl82c105.ko
+kernel/drivers/ide/pci/trm290.ko
+kernel/drivers/ide/pci/via82cxxx.ko
+kernel/fs/isofs/isofs.ko
+kernel/drivers/input/keyboard/atkbd.ko
+kernel/drivers/input/serio/i8042.ko
+kernel/drivers/input/serio/libps2.ko
+kernel/drivers/input/serio/serio.ko
+kernel/drivers/usb/input/usbhid.ko
+kernel/net/ipv6/ipv6.ko
+kernel/drivers/net/irda/irtty-sir.ko
+kernel/drivers/net/irda/sir-dev.ko
+kernel/net/irda/ircomm/ircomm-tty.ko
+kernel/net/irda/ircomm/ircomm.ko
+kernel/net/irda/irda.ko
+kernel/net/irda/irlan/irlan.ko
+kernel/net/irda/irnet/irnet.ko
+kernel/fs/jfs/jfs.ko
+kernel/drivers/block/loop.ko
+kernel/drivers/md/dm-crypt.ko
+kernel/drivers/md/dm-mirror.ko
+kernel/drivers/md/dm-mod.ko
+kernel/drivers/md/dm-snapshot.ko
+kernel/drivers/md/linear.ko
+kernel/drivers/md/md-mod.ko
+kernel/drivers/md/multipath.ko
+kernel/drivers/md/raid0.ko
+kernel/drivers/md/raid1.ko
+kernel/drivers/md/raid5.ko
+kernel/drivers/md/xor.ko
+kernel/drivers/input/evdev.ko
+kernel/drivers/input/mouse/psmouse.ko
+kernel/drivers/net/dl2k.ko
+kernel/drivers/net/fealnx.ko
+kernel/drivers/net/hamachi.ko
+kernel/drivers/net/ixgb/ixgb.ko
+kernel/drivers/net/ns83820.ko
+kernel/drivers/net/r8169.ko
+kernel/drivers/net/s2io.ko
+kernel/drivers/net/sk98lin/sk98lin.ko
+kernel/drivers/net/starfire.ko
+kernel/drivers/net/tokenring/3c359.ko
+kernel/drivers/net/tokenring/abyss.ko
+kernel/drivers/net/tokenring/olympic.ko
+kernel/drivers/net/tokenring/tms380tr.ko
+kernel/drivers/net/tokenring/tmspci.ko
+kernel/drivers/net/tulip/de2104x.ko
+kernel/drivers/net/tulip/de4x5.ko
+kernel/drivers/net/tulip/dmfe.ko
+kernel/drivers/net/tulip/winbond-840.ko
+kernel/drivers/net/wireless/prism54/prism54.ko
+kernel/drivers/net/yellowfin.ko
+kernel/drivers/ieee1394/eth1394.ko
+kernel/drivers/net/3c59x.ko
+kernel/drivers/net/8139cp.ko
+kernel/drivers/net/8139too.ko
+kernel/drivers/net/appletalk/ipddp.ko
+kernel/drivers/net/b44.ko
+kernel/drivers/net/dummy.ko
+kernel/drivers/net/e100.ko
+kernel/drivers/net/e1000/e1000.ko
+kernel/drivers/net/eepro100.ko
+kernel/drivers/net/epic100.ko
+kernel/drivers/net/mv643xx_eth.ko
+kernel/drivers/net/natsemi.ko
+kernel/drivers/net/ne2k-pci.ko
+kernel/drivers/net/pcnet32.ko
+kernel/drivers/net/sis900.ko
+kernel/drivers/net/sundance.ko
+kernel/drivers/net/sungem.ko
+kernel/drivers/net/sungem_phy.ko
+kernel/drivers/net/sunhme.ko
+kernel/drivers/net/tulip/tulip.ko
+kernel/drivers/net/typhoon.ko
+kernel/drivers/net/via-rhine.ko
+kernel/drivers/net/wireless/airport.ko
+kernel/drivers/net/wireless/orinoco_pci.ko
+kernel/drivers/net/wireless/orinoco_plx.ko
+kernel/drivers/net/wireless/orinoco_tmd.ko
+kernel/net/appletalk/appletalk.ko
+kernel/drivers/net/arcnet/arcnet.ko
+kernel/drivers/net/arcnet/com20020.ko
+kernel/drivers/net/pcmcia/3c574_cs.ko
+kernel/drivers/net/pcmcia/3c589_cs.ko
+kernel/drivers/net/pcmcia/axnet_cs.ko
+kernel/drivers/net/pcmcia/com20020_cs.ko
+kernel/drivers/net/pcmcia/fmvj18x_cs.ko
+kernel/drivers/net/pcmcia/nmclan_cs.ko
+kernel/drivers/net/pcmcia/pcnet_cs.ko
+kernel/drivers/net/pcmcia/smc91c92_cs.ko
+kernel/drivers/net/pcmcia/xirc2ps_cs.ko
+kernel/drivers/net/tulip/xircom_cb.ko
+kernel/drivers/net/wireless/airo_cs.ko
+kernel/drivers/net/wireless/atmel.ko
+kernel/drivers/net/wireless/atmel_cs.ko
+kernel/drivers/net/wireless/netwave_cs.ko
+kernel/drivers/net/wireless/orinoco_cs.ko
+kernel/drivers/net/wireless/ray_cs.ko
+kernel/drivers/net/wireless/wavelan_cs.ko
+kernel/drivers/net/wireless/wl3501_cs.ko
+kernel/drivers/net/8390.ko
+kernel/drivers/net/mii.ko
+kernel/drivers/net/wireless/airo.ko
+kernel/drivers/net/wireless/hermes.ko
+kernel/drivers/net/wireless/orinoco.ko
+kernel/drivers/pcmcia/i82092.ko
+kernel/drivers/pcmcia/pcmcia.ko
+kernel/drivers/pcmcia/pcmcia_core.ko
+kernel/drivers/pcmcia/pd6729.ko
+kernel/drivers/pcmcia/rsrc_nonstatic.ko
+kernel/drivers/pcmcia/yenta_socket.ko
+kernel/drivers/ide/legacy/ide-cs.ko
+kernel/drivers/net/ppp_async.ko
+kernel/drivers/net/ppp_deflate.ko
+kernel/drivers/net/ppp_generic.ko
+kernel/drivers/net/ppp_synctty.ko
+kernel/drivers/net/pppoe.ko
+kernel/drivers/net/pppox.ko
+kernel/drivers/net/slhc.ko
+kernel/lib/crc-ccitt.ko
+kernel/lib/zlib_deflate/zlib_deflate.ko
+kernel/fs/reiserfs/reiserfs.ko
+kernel/drivers/block/sx8.ko
+kernel/drivers/scsi/ahci.ko
+kernel/drivers/scsi/libata.ko
+kernel/drivers/scsi/sata_mv.ko
+kernel/drivers/scsi/sata_nv.ko
+kernel/drivers/scsi/sata_promise.ko
+kernel/drivers/scsi/sata_qstor.ko
+kernel/drivers/scsi/sata_sil.ko
+kernel/drivers/scsi/sata_sis.ko
+kernel/drivers/scsi/sata_svw.ko
+kernel/drivers/scsi/sata_sx4.ko
+kernel/drivers/scsi/sata_uli.ko
+kernel/drivers/scsi/sata_via.ko
+kernel/drivers/scsi/sata_vsc.ko
+kernel/drivers/scsi/BusLogic.ko
+kernel/drivers/scsi/aic7xxx/aic79xx.ko
+kernel/drivers/scsi/aic7xxx/aic7xxx.ko
+kernel/drivers/scsi/scsi_transport_spi.ko
+kernel/drivers/scsi/sym53c8xx_2/sym53c8xx.ko
+kernel/drivers/scsi/scsi_mod.ko
+kernel/drivers/scsi/sd_mod.ko
+kernel/drivers/block/DAC960.ko
+kernel/drivers/block/cciss.ko
+kernel/drivers/block/cpqarray.ko
+kernel/drivers/message/fusion/mptbase.ko
+kernel/drivers/message/fusion/mptscsih.ko
+kernel/drivers/scsi/3w-xxxx.ko
+kernel/drivers/scsi/aacraid/aacraid.ko
+kernel/drivers/scsi/aic7xxx_old.ko
+kernel/drivers/scsi/ch.ko
+kernel/drivers/scsi/dc395x.ko
+kernel/drivers/scsi/eata.ko
+kernel/drivers/scsi/ips.ko
+kernel/drivers/scsi/megaraid/megaraid_mbox.ko
+kernel/drivers/scsi/megaraid/megaraid_mm.ko
+kernel/drivers/scsi/osst.ko
+kernel/drivers/scsi/st.ko
+kernel/drivers/scsi/a100u2w.ko
+kernel/drivers/scsi/atp870u.ko
+kernel/drivers/scsi/dmx3191d.ko
+kernel/drivers/scsi/ipr.ko
+kernel/drivers/scsi/qlogicfas408.ko
+kernel/drivers/scsi/qlogicfc.ko
+kernel/drivers/scsi/sg.ko
+kernel/drivers/scsi/tmscsim.ko
+kernel/drivers/char/pcmcia/synclink_cs.ko
+kernel/drivers/net/wan/hdlc.ko
+kernel/drivers/net/wan/syncppp.ko
+kernel/drivers/usb/serial/usbserial.ko
+kernel/net/lapb/lapb.ko
+kernel/fs/ufs/ufs.ko
+kernel/drivers/usb/core/usbcore.ko
+kernel/drivers/usb/host/ehci-hcd.ko
+kernel/drivers/usb/host/ohci-hcd.ko
+kernel/drivers/usb/host/uhci-hcd.ko
+kernel/drivers/usb/storage/usb-storage.ko
+kernel/fs/exportfs/exportfs.ko
+kernel/fs/xfs/xfs.ko

Added: dists/sid/linux-2.6/debian/config/powerpc/modules.README
==============================================================================
--- (empty file)
+++ dists/sid/linux-2.6/debian/config/powerpc/modules.README	Mon Nov 26 20:06:56 2007
@@ -0,0 +1,58 @@
+Just for info, and to avoid bad blood or anything, this is for now just an
+experimentation to be able to test and experiment my ideas, before it is either
+abandoned, or declared good enough to be generalized. The main caveat joeyh had
+about this when we discussed it in the past, apart from it being just words and 
+nobody doing the work behind it, was the effect the multiplication of .udeb 
+packages had on the d-i Packages file parsing on low-memory systems. Especially
+as it seems d-i maintains three simultaneous in-memory copies of this Package 
+file, not sure why exactly, but this could be obtimized maybe, but see 7) also.
+
+The plan goes as follows : 
+
+  1) We will provide one .udeb per module, this will bring it to 600 or so
+  .udebs for powerpc, for the three flavours (not counting apus or upcoming
+  nubus/legacy-iseries).
+
+  2) Each udeb description will be taken from the appropriate Kconfig file in
+  the future, not sure how to best do that, though, we could match the modules
+  to Makefiles, and then to CONFIG_ entries, which we take the description
+  from the corresponding Kconfig. Maybe a better solution would be to list the
+  modules per CONFIG_ entry, and make one .udeb per main CONFIG_ option. This 
+  would be easier to track in the long end also.
+
+  3) Module/udeb dependency is taken from the depmod output or directly from
+  the modules.
+
+  4) In the future, we should list only the main CONFIG_ options, and package
+  the modules in grouping, and list only the modules we actually need.
+  The modules only pulled in by dependency should be automatically split out
+  into packages that should never be used directly, and in a minimum way, using
+  a bit of graph analysis to determine the minimum set of such packages.
+  The problem with that is how to take the name and description of those
+  non-primary packages in an automated way.
+
+  5) We really need a way to make the config option choice / module list more
+  robust, as the split-config thingy is not all that sane right now, and there
+  is no easy link from modules to config options. Needs more investigation.
+
+  6) It may be possible that the packaging infrastructure still has some
+  trouble with this approach, even after those 2 years or so since the d-i team
+  chose to split its kernel-udeb packages. This needs solving before we go with
+  this for all arches, so let's experiment a bit with powerpc only.
+
+  7) To ease the weight of this multiplication on .udeb packages on the d-i
+  Packages parsing, one could imagine to split off a separate Packages file for
+  each kernel flavour, residing in .../debian-installer/kernel/<version>-<abi>-<flavour>.
+  Not sure if all three d-i Packages parsing parts can handle multiple sources,
+  i think not, but this is something which it would be worth to fix independently
+  of this issue.
+
+
+Well, that is it, works needs done, but i sincerely think this is the right
+option for this, especially given the poor status of the inter-arch synchronization
+the d-i team has done with the kernel .udebs, and they rejecting all responsability
+to porters.
+
+Friendly,
+
+Sven Luther

Added: dists/sid/linux-2.6/debian/config/powerpc/modules.powerpc
==============================================================================
--- (empty file)
+++ dists/sid/linux-2.6/debian/config/powerpc/modules.powerpc	Mon Nov 26 20:06:56 2007
@@ -0,0 +1,12 @@
+kernel/drivers/net/defxx.ko
+kernel/drivers/net/skfp/skfp.ko
+kernel/drivers/net/tlan.ko
+kernel/drivers/net/tokenring/lanstreamer.ko
+kernel/drivers/net/bmac.ko
+kernel/drivers/net/mace.ko
+kernel/drivers/net/pcmcia/ibmtr_cs.ko
+kernel/drivers/net/tulip/xircom_tulip_cb.ko
+kernel/drivers/scsi/3w-9xxx.ko
+kernel/drivers/scsi/dpt_i2o.ko
+kernel/drivers/scsi/mac53c94.ko
+kernel/drivers/scsi/mesh.ko

Added: dists/sid/linux-2.6/debian/config/powerpc/modules.powerpc-miboot
==============================================================================
--- (empty file)
+++ dists/sid/linux-2.6/debian/config/powerpc/modules.powerpc-miboot	Mon Nov 26 20:06:56 2007
@@ -0,0 +1,10 @@
+kernel/drivers/net/tlan.ko
+kernel/drivers/net/tokenring/lanstreamer.ko
+kernel/drivers/net/bmac.ko
+kernel/drivers/net/mace.ko
+kernel/drivers/net/pcmcia/ibmtr_cs.ko
+kernel/drivers/net/tulip/xircom_tulip_cb.ko
+kernel/drivers/scsi/3w-9xxx.ko
+kernel/drivers/scsi/dpt_i2o.ko
+kernel/drivers/scsi/mac53c94.ko
+kernel/drivers/scsi/mesh.ko

Added: dists/sid/linux-2.6/debian/config/powerpc/modules.powerpc64
==============================================================================
--- (empty file)
+++ dists/sid/linux-2.6/debian/config/powerpc/modules.powerpc64	Mon Nov 26 20:06:56 2007
@@ -0,0 +1,6 @@
+kernel/arch/ppc64/kernel/hvcserver.ko
+kernel/drivers/char/hvcs.ko
+kernel/drivers/net/defxx.ko
+kernel/drivers/net/skfp/skfp.ko
+kernel/drivers/net/ibmveth.ko
+kernel/drivers/scsi/ibmvscsi/ibmvscsic.ko

Added: dists/sid/linux-2.6/debian/config/powerpc/vserver/defines
==============================================================================
--- (empty file)
+++ dists/sid/linux-2.6/debian/config/powerpc/vserver/defines	Mon Nov 26 20:06:56 2007
@@ -0,0 +1,14 @@
+[base]
+flavours:
+ powerpc
+ powerpc64
+
+[image]
+recommends: util-vserver
+
+[powerpc_image]
+configs: powerpc/config.powerpc-smp
+
+[powerpc64_image]
+configs: powerpc/config.powerpc64
+

Added: dists/sid/linux-2.6/debian/config/s390/config
==============================================================================
--- (empty file)
+++ dists/sid/linux-2.6/debian/config/s390/config	Mon Nov 26 20:06:56 2007
@@ -0,0 +1,173 @@
+#
+# Processor type and features
+#
+CONFIG_SMP=y
+CONFIG_NR_CPUS=32
+CONFIG_HOTPLUG_CPU=y
+CONFIG_MATHEMU=y
+CONFIG_COMPAT=y
+CONFIG_S390_SWITCH_AMODE=y
+CONFIG_S390_EXEC_PROTECT=y
+
+#
+# Code generation options
+#
+CONFIG_PACK_STACK=y
+# CONFIG_SMALL_STACK is not set
+# CONFIG_CHECK_STACK is not set
+# CONFIG_WARN_STACK is not set
+
+#
+# I/O subsystem configuration
+#
+CONFIG_MACHCHK_WARNING=y
+CONFIG_QDIO=y
+# CONFIG_QDIO_DEBUG is not set
+
+#
+# Misc
+#
+CONFIG_IPL=y
+
+# CONFIG_PROCESS_DEBUG is not set
+CONFIG_PFAULT=y
+# CONFIG_SHARED_KERNEL is not set
+CONFIG_CMM=y
+CONFIG_CMM_PROC=y
+CONFIG_CMM_IUCV=y
+CONFIG_VIRT_TIMER=y
+CONFIG_VIRT_CPU_ACCOUNTING=y
+CONFIG_APPLDATA_BASE=y
+CONFIG_APPLDATA_MEM=m
+CONFIG_APPLDATA_OS=m
+CONFIG_APPLDATA_NET_SUM=m
+
+CONFIG_NO_IDLE_HZ=y
+CONFIG_NO_IDLE_HZ_INIT=y
+CONFIG_S390_HYPFS_FS=y
+CONFIG_KEXEC=y
+# CONFIG_ZFCPDUMP is not set
+
+#
+# Networking options
+#
+CONFIG_IUCV=m
+CONFIG_AFIUCV=m
+
+#
+# S/390 block device drivers
+#
+CONFIG_BLK_DEV_XPRAM=m
+CONFIG_DCSSBLK=m
+CONFIG_DASD=m
+# CONFIG_DASD_PROFILE is not set
+CONFIG_DASD_ECKD=m
+CONFIG_DASD_FBA=m
+CONFIG_DASD_DIAG=m
+# CONFIG_DASD_EER is not set
+
+#
+# SCSI Transports
+#
+CONFIG_ZFCP=m
+
+#
+# S/390 network device drivers
+#
+CONFIG_LCS=m
+CONFIG_CTC=m
+CONFIG_NETIUCV=m
+CONFIG_SMSGIUCV=m
+CONFIG_CLAW=m
+CONFIG_QETH=m
+CONFIG_QETH_IPV6=y
+CONFIG_QETH_VLAN=y
+
+#
+# S/390 character device drivers
+#
+CONFIG_TN3270=y
+CONFIG_TN3270_TTY=y
+CONFIG_TN3270_FS=m
+CONFIG_TN3270_CONSOLE=y
+CONFIG_TN3215=y
+CONFIG_TN3215_CONSOLE=y
+CONFIG_SCLP_TTY=y
+CONFIG_SCLP_CONSOLE=y
+CONFIG_SCLP_VT220_TTY=y
+CONFIG_SCLP_VT220_CONSOLE=y
+CONFIG_SCLP_CPI=m
+CONFIG_S390_TAPE=m
+CONFIG_S390_TAPE_BLOCK=y
+CONFIG_S390_TAPE_34XX=m
+CONFIG_S390_TAPE_3590=m
+CONFIG_VMLOGRDR=m
+CONFIG_VMCP=m
+CONFIG_MONREADER=m
+CONFIG_MONWRITER=m
+CONFIG_S390_VMUR=m
+
+#
+# Instrumentation Support
+#
+# CONFIG_PROFILING is not set
+# CONFIG_KPROBES is not set
+
+CONFIG_STANDALONE=y
+# CONFIG_SCSI_DEBUG is not set
+CONFIG_BLK_DEV_LOOP=m
+# CONFIG_BLK_DEV_CRYPTOLOOP is not set
+# CONFIG_BLK_DEV_NBD is not set
+CONFIG_BLK_DEV_RAM_SIZE=24576
+CONFIG_BLK_DEV_INITRD=y
+# CONFIG_CDROM_PKTCDVD is not set
+# CONFIG_ATA_OVER_ETH is not set
+# CONFIG_DM_MULTIPATH_EMC is not set
+# CONFIG_WATCHDOG is not set
+CONFIG_Z90CRYPT=m
+CONFIG_IPV6=y
+# CONFIG_ATM is not set
+# CONFIG_BRIDGE is not set
+# CONFIG_DECNET is not set
+CONFIG_LLC=y
+# CONFIG_LLC2 is not set
+# CONFIG_IPX is not set
+# CONFIG_ATALK is not set
+# CONFIG_X25 is not set
+# CONFIG_LAPB is not set
+# CONFIG_ECONET is not set
+# CONFIG_WAN_ROUTER is not set
+# CONFIG_NET_SCHED is not set
+# CONFIG_NETPOLL is not set
+# CONFIG_NET_POLL_CONTROLLER is not set
+# CONFIG_HAMRADIO is not set
+# CONFIG_IRDA is not set
+# CONFIG_BT is not set
+# CONFIG_DUMMY is not set
+# CONFIG_NET_RADIO is not set
+# CONFIG_WAN is not set
+# CONFIG_PPP is not set
+# CONFIG_SLIP is not set
+# CONFIG_SHAPER is not set
+# CONFIG_NETCONSOLE is not set
+# CONFIG_ACORN_PARTITION is not set
+# CONFIG_OSF_PARTITION is not set
+# CONFIG_AMIGA_PARTITION is not set
+# CONFIG_ATARI_PARTITION is not set
+CONFIG_IBM_PARTITION=y
+# CONFIG_MAC_PARTITION is not set
+CONFIG_BSD_DISKLABEL=y
+# CONFIG_MINIX_SUBPARTITION is not set
+# CONFIG_SOLARIS_X86_PARTITION is not set
+# CONFIG_UNIXWARE_DISKLABEL is not set
+# CONFIG_LDM_PARTITION is not set
+# CONFIG_SGI_PARTITION is not set
+# CONFIG_ULTRIX_PARTITION is not set
+# CONFIG_SUN_PARTITION is not set
+# CONFIG_EFI_PARTITION is not set
+CONFIG_CRYPTO_SHA1_S390=m
+CONFIG_CRYPTO_SHA256_S390=m
+CONFIG_CRYPTO_DES_S390=m
+CONFIG_CRYPTO_AES_S390=m
+# CONFIG_CRC_CCITT is not set
+CONFIG_CRC32=m

Added: dists/sid/linux-2.6/debian/config/s390/config.s390
==============================================================================
--- (empty file)
+++ dists/sid/linux-2.6/debian/config/s390/config.s390	Mon Nov 26 20:06:56 2007
@@ -0,0 +1,6 @@
+# CONFIG_64BIT is not set
+CONFIG_MARCH_G5=y
+# CONFIG_MARCH_Z900 is not set
+# CONFIG_MARCH_Z990 is not set
+# CONFIG_IPL_TAPE is not set
+CONFIG_IPL_VM=y

Added: dists/sid/linux-2.6/debian/config/s390/config.s390-tape
==============================================================================
--- (empty file)
+++ dists/sid/linux-2.6/debian/config/s390/config.s390-tape	Mon Nov 26 20:06:56 2007
@@ -0,0 +1,6 @@
+# CONFIG_64BIT is not set
+CONFIG_MARCH_G5=y
+# CONFIG_MARCH_Z900 is not set
+# CONFIG_MARCH_Z990 is not set
+CONFIG_IPL_TAPE=y
+# CONFIG_IPL_VM is not set

Added: dists/sid/linux-2.6/debian/config/s390/config.s390x
==============================================================================
--- (empty file)
+++ dists/sid/linux-2.6/debian/config/s390/config.s390x	Mon Nov 26 20:06:56 2007
@@ -0,0 +1,6 @@
+CONFIG_64BIT=y
+# CONFIG_MARCH_G5 is not set
+CONFIG_MARCH_Z900=y
+# CONFIG_MARCH_Z990 is not set
+# CONFIG_IPL_TAPE is not set
+CONFIG_IPL_VM=y

Added: dists/sid/linux-2.6/debian/config/s390/defines
==============================================================================
--- (empty file)
+++ dists/sid/linux-2.6/debian/config/s390/defines	Mon Nov 26 20:06:56 2007
@@ -0,0 +1,29 @@
+[base]
+featuresets:
+ vserver
+flavours:
+ s390
+ s390-tape
+ s390x
+kernel-arch: s390
+kernel-header-dirs: s390
+
+[image]
+desc: This kernel has support to IPL (boot) from a VM reader or DASD device.
+suggests: s390-tools
+
+[s390_base]
+class: IBM S/390
+
+[s390-tape_base]
+class: IBM S/390 tape
+modules: false
+
+[s390-tape_image]
+desc: This kernel has support to IPL (boot) from a tape.
+initramfs: false
+type: plain-s390-tape
+
+[s390x_base]
+class: IBM zSeries
+

Added: dists/sid/linux-2.6/debian/config/s390/vserver/defines
==============================================================================
--- (empty file)
+++ dists/sid/linux-2.6/debian/config/s390/vserver/defines	Mon Nov 26 20:06:56 2007
@@ -0,0 +1,6 @@
+[base]
+flavours: s390x
+
+[s390x_image]
+configs: s390/config.s390x
+

Added: dists/sid/linux-2.6/debian/config/sparc/config
==============================================================================
--- (empty file)
+++ dists/sid/linux-2.6/debian/config/sparc/config	Mon Nov 26 20:06:56 2007
@@ -0,0 +1,404 @@
+CONFIG_SND_HWDEP=m
+# Native Language Support
+# Open Sound System
+# LED Triggers
+# CONFIG_FB_S1D13XXX is not set
+# CONFIG_NCPFS_IOCTL_LOCKING is not set
+CONFIG_SND_PCM=m
+# CONFIG_FB_VIRTUAL is not set
+# CONFIG_SERIO_PARKBD is not set
+CONFIG_SND_SUN_CS4231=m
+CONFIG_GENERIC_ISA_DMA=y
+# CONFIG_MMC is not set
+# CONFIG_OSF_PARTITION is not set
+CONFIG_SND_OPL3_LIB=m
+# Plug and Play support
+# CONFIG_BLK_DEV_DAC960 is not set
+# CONFIG_SND_AZT3328 is not set
+CONFIG_SND_OSSEMUL=y
+# CONFIG_BT is not set
+CONFIG_EFS_FS=m
+CONFIG_ARPD=y
+CONFIG_PPP_BSDCOMP=m
+CONFIG_SUNQE=m
+# CONFIG_WAN is not set
+# CONFIG_ARCNET is not set
+# CONFIG_SUN_BPP is not set
+CONFIG_SND_AC97_CODEC=m
+# CONFIG_NFS_DIRECTIO is not set
+# Console display driver support
+# CONFIG_DISCONTIGMEM_MANUAL is not set
+CONFIG_SERIAL_JSM=m
+# SCSI Transport Attributes
+# CONFIG_SND_HDSP is not set
+CONFIG_LLC2=m
+# Block devices
+# CONFIG_BLK_CPQ_DA is not set
+CONFIG_INPUT_KEYBOARD=y
+CONFIG_INPUT_MOUSEDEV_PSAUX=y
+# CONFIG_IP_PNP_BOOTP is not set
+# Telephony Support
+CONFIG_SND=m
+CONFIG_SUN_OPENPROMIO=y
+CONFIG_SUN_MOSTEK_RTC=y
+# CONFIG_SND_SONICVIBES is not set
+CONFIG_PPP=m
+# Real Time Clock
+CONFIG_RPCSEC_GSS_KRB5=m
+# CONFIG_LAPB is not set
+CONFIG_BLK_DEV_FD=y
+CONFIG_DUMMY_CONSOLE=y
+# CONFIG_SCSI_FUTURE_DOMAIN is not set
+# CONFIG_SND_CS46XX is not set
+# CONFIG_FB_IMSTT is not set
+CONFIG_INPUT_MISC=y
+CONFIG_SND_SUN_DBRI=m
+CONFIG_BRIDGE=m
+# CONFIG_SGI_PARTITION is not set
+CONFIG_CRC_CCITT=m
+# CONFIG_SCSI_DC390T is not set
+# CONFIG_BACKLIGHT_LCD_SUPPORT is not set
+# CONFIG_SND_ES1938 is not set
+# Userland interfaces
+# CONFIG_NCPFS_STRONG is not set
+# Misc devices
+CONFIG_HFSPLUS_FS=m
+CONFIG_SUN_IO=y
+# CONFIG_INPUT_EVBUG is not set
+# Wireless LAN (non-hamradio)
+# CONFIG_HP100 is not set
+# I2C support
+# CONFIG_DVB is not set
+# CONFIG_BLK_DEV_UMEM is not set
+CONFIG_PPP_FILTER=y
+CONFIG_INPUT=y
+# CONFIG_IPMI_HANDLER is not set
+# RTC interfaces
+# CONFIG_USB_GADGET is not set
+# CONFIG_FB_P9100 is not set
+# CONFIG_FB_ASILIANT is not set
+# CONFIG_SND_SERIAL_U16550 is not set
+# CONFIG_SND_ES1968 is not set
+# Some SCSI devices (e.g. CD jukebox) support multiple LUNs
+# CONFIG_IKCONFIG is not set
+# CONFIG_SND_VIA82XX_MODEM is not set
+CONFIG_INPUT_SPARCSPKR=m
+CONFIG_SERIO_LIBPS2=y
+# CONFIG_SND_FM801 is not set
+CONFIG_PLIP=m
+# Code maturity level options
+CONFIG_SERIAL_SUNCORE=y
+# CONFIG_FB_VOODOO1 is not set
+# CONFIG_MAC_PARTITION is not set
+# CONFIG_R3964 is not set
+# CONFIG_CODA_FS_OLD_API is not set
+# Queueing/Scheduling
+CONFIG_AFS_FS=m
+# CONFIG_AFS_DEBUG is not set
+# Cryptographic options
+CONFIG_SND_MPU401_UART=m
+# CONFIG_IP_SCTP is not set
+# CONFIG_HAMACHI is not set
+CONFIG_NCPFS_NFS_NS=y
+# Serial drivers
+# ISDN subsystem
+# CONFIG_NETPOLL_TRAP is not set
+# CONFIG_W1 is not set
+# CONFIG_SND_MTPAV is not set
+# CONFIG_SND_AU8810 is not set
+# Kernel hacking
+CONFIG_SND_TIMER=m
+CONFIG_SPLIT_PTLOCK_CPUS=4
+# Ethernet (10 or 100Mbit)
+# ATA/ATAPI/MFM/RLL support
+CONFIG_FB_SBUS=y
+CONFIG_NETCONSOLE=m
+# SCSI device support
+# CONFIG_SND_CS4281 is not set
+# Multimedia devices
+# CONFIG_SND_NM256 is not set
+CONFIG_UID16=y
+# CONFIG_HIPPI is not set
+CONFIG_UFS_FS=m
+CONFIG_IPX=m
+CONFIG_PPP_ASYNC=m
+CONFIG_LLC=m
+# File systems
+# CONFIG_PARPORT_GSC is not set
+CONFIG_PPP_MULTILINK=y
+# CONFIG_HAMRADIO is not set
+# CONFIG_IPX_INTERN is not set
+CONFIG_SCSI_LPFC=m
+# LED drivers
+# CONFIG_SND_RME96 is not set
+# CD-ROM/DVD Filesystems
+# CONFIG_FB_CIRRUS is not set
+# USB Gadget Support
+CONFIG_NET_POLL_CONTROLLER=y
+# CONFIG_INPUT_JOYDEV is not set
+CONFIG_INPUT_MOUSEDEV=y
+CONFIG_ATALK=m
+CONFIG_IP_PNP_RARP=y
+CONFIG_INPUT_MOUSE=y
+# CONFIG_SND_VX222 is not set
+# CONFIG_I2O is not set
+CONFIG_DECNET=m
+# CONFIG_SND_MIXART is not set
+# CONFIG_KEYBOARD_NEWTON is not set
+CONFIG_PARPORT_SUNBPP=m
+CONFIG_SOUND=m
+# CONFIG_ECONET is not set
+# CONFIG_SND_BT87X is not set
+CONFIG_NET_FC=y
+CONFIG_SCSI_QLOGIC_1280=m
+# Digital Video Broadcasting Devices
+CONFIG_PARPORT_NOT_PC=y
+# CONFIG_PHONE is not set
+CONFIG_CODA_FS=m
+CONFIG_SND_MIXER_OSS=m
+# CONFIG_X25 is not set
+# CONFIG_CIFS_XATTR is not set
+# Input device support
+# CONFIG_TR is not set
+# CONFIG_SND_CA0106 is not set
+CONFIG_SERIAL_CORE=y
+CONFIG_SLIP=m
+CONFIG_LOGO=y
+# CONFIG_ATM is not set
+# CONFIG_SND_RME32 is not set
+CONFIG_USB_ARCH_HAS_OHCI=y
+CONFIG_FB=y
+# CONFIG_KEYBOARD_XTKBD is not set
+# Network device support
+CONFIG_PPPOE=m
+CONFIG_AFFS_FS=m
+# Device Drivers
+# CONFIG_TIPAR is not set
+# CONFIG_SLIP_MODE_SLIP6 is not set
+CONFIG_NCPFS_OS2_NS=y
+# Miscellaneous filesystems
+# CONFIG_EFI_PARTITION is not set
+# Connector - unified userspace <-> kernelspace linker
+# CONFIG_RAW_DRIVER is not set
+# DOS/FAT/NT Filesystems
+CONFIG_SMB_FS=m
+# CONFIG_SMB_NLS_DEFAULT is not set
+CONFIG_PRINTER=m
+# Graphics support
+CONFIG_SBUSCHAR=y
+# CONFIG_SND_YMFPCI is not set
+# CONFIG_SND_KORG1212 is not set
+# CONFIG_SND_ATIIXP is not set
+CONFIG_SUNLANCE=m
+CONFIG_SUN_AUXIO=y
+# CONFIG_FB_PCI is not set
+# Ethernet (1000 Mbit)
+# CONFIG_SND_INTEL8X0M is not set
+# CONFIG_SOUND_PRIME is not set
+# CONFIG_QNX4FS_FS is not set
+# Generic devices
+# CONFIG_SND_ATIIXP_MODEM is not set
+# Watchdog Cards
+# CONFIG_EMBEDDED is not set
+CONFIG_HAPPYMEAL=m
+# Ethernet (10000 Mbit)
+# CONFIG_FB_NEOMAGIC is not set
+# CONFIG_SND_VERBOSE_PRINTK is not set
+CONFIG_PROM_CONSOLE=y
+# RTC drivers
+# Linux kernel version: 2.6.17
+# CONFIG_LP_CONSOLE is not set
+CONFIG_DEBUG_BUGVERBOSE=y
+CONFIG_SUNRPC_GSS=m
+# Input Device Drivers
+# InfiniBand support
+# CONFIG_NCPFS_PACKET_SIGNING is not set
+# Core Netfilter Configuration
+# DCCP CCIDs Configuration (EXPERIMENTAL)
+# CONFIG_SERIO_PCIPS2 is not set
+# Logo configuration
+CONFIG_INPUT_EVDEV=m
+# CONFIG_SCSI_IPS is not set
+# CONFIG_DEV_APPLETALK is not set
+CONFIG_SCSI_QLOGICPTI=m
+CONFIG_IP_PNP=y
+# CONFIG_SND_TRIDENT is not set
+# CONFIG_BEFS_DEBUG is not set
+CONFIG_PCI=y
+# Hardware Monitoring support
+# CONFIG_FB_TILEBLITTING is not set
+# CONFIG_SND_AU8820 is not set
+# CONFIG_ISDN is not set
+# MMC/SD Card support
+# CONFIG_SCSI_INIA100 is not set
+# SCSI support type (disk, tape, CD-ROM)
+CONFIG_KEYBOARD_ATKBD=y
+# CONFIG_SCSI_DEBUG is not set
+# ARCnet devices
+# CONFIG_SND_AU8830 is not set
+# CONFIG_INPUT_JOYSTICK is not set
+CONFIG_SUN_OPENPROMFS=m
+# Sound
+CONFIG_SLIP_SMART=y
+# CONFIG_MOUSE_VSXXXAA is not set
+# IO Schedulers
+# DCCP Configuration (EXPERIMENTAL)
+# CONFIG_PPDEV is not set
+# IPMI
+# Hardware crypto devices
+# CONFIG_SENSORS_F71805F is not set
+CONFIG_DECNET_ROUTER=y
+CONFIG_SND_SUN_AMD7930=m
+# CONFIG_SND_ICE1712 is not set
+# Ftape, the floppy tape device driver
+# PHY device support
+# CONFIG_FB_NVIDIA is not set
+# CONFIG_NET_RADIO is not set
+# CONFIG_VXFS_FS is not set
+# Generic Driver Options
+# CONFIG_SERIO_SERPORT is not set
+# EDAC - error detection and reporting (RAS) (EXPERIMENTAL)
+CONFIG_DUMMY=m
+CONFIG_SCSI_SUNESP=m
+CONFIG_FB_CG6=y
+# Wan interfaces
+CONFIG_PARPORT_1284=y
+# TPM devices
+# LED devices
+# USB support
+# CONFIG_SERIO_RAW is not set
+CONFIG_INPUT_MOUSEDEV_SCREEN_Y=768
+CONFIG_HPFS_FS=m
+# CONFIG_ADFS_FS is not set
+# CONFIG_INPUT_UINPUT is not set
+# SPI Protocol Masters
+# CONFIG_FONT_SUN12x22 is not set
+# CONFIG_LOGO_LINUX_VGA16 is not set
+CONFIG_ATA_OVER_ETH=m
+# IEEE 1394 (FireWire) support
+CONFIG_BFS_FS=m
+CONFIG_BLK_DEV_INITRD=y
+CONFIG_INPUT_MOUSEDEV_SCREEN_X=1024
+# CONFIG_FB_TRIDENT is not set
+# CONFIG_IRDA is not set
+CONFIG_VT_CONSOLE=y
+# Library routines
+CONFIG_JBD=m
+CONFIG_KEYBOARD_SUNKBD=y
+CONFIG_NETPOLL=y
+# CONFIG_GAMEPORT is not set
+# Classification
+# CONFIG_SERIAL_NONSTANDARD is not set
+CONFIG_FS_MBCACHE=y
+# CONFIG_WAN_ROUTER is not set
+# CONFIG_INPUT_TOUCHSCREEN is not set
+# Block layer
+# CONFIG_SND_INTEL8X0 is not set
+# CONFIG_FB_3DFX is not set
+# Non-8250 serial port support
+# SCSI low-level drivers
+# ALSA Sparc devices
+# Token Ring devices
+# Multi-device support (RAID and LVM)
+# Loadable module support
+# Memory Technology Devices (MTD)
+CONFIG_CRC32=y
+# CONFIG_ASFS_FS is not set
+CONFIG_SUN_PARTITION=y
+# CONFIG_ATARI_PARTITION is not set
+# CONFIG_WATCHDOG is not set
+# CONFIG_UNIXWARE_DISKLABEL is not set
+CONFIG_SUNBMAC=m
+# I2O device support
+CONFIG_PARPORT=m
+CONFIG_KEYBOARD_LKKBD=m
+CONFIG_NCP_FS=m
+# NOTE: USB_STORAGE enables SCSI, and 'SCSI disk support'
+# CONFIG_ACORN_PARTITION is not set
+# CONFIG_FB_SIS is not set
+CONFIG_SHAPER=m
+# CONFIG_LOGO_LINUX_MONO is not set
+# CONFIG_NCPFS_EXTRAS is not set
+CONFIG_PPP_SYNC_TTY=m
+CONFIG_SBUS=y
+# Hardware I/O ports
+CONFIG_SPARC=y
+# CONFIG_SND_DEBUG is not set
+# CONFIG_R8169 is not set
+CONFIG_FONT_SUN8x16=y
+CONFIG_BNX2=m
+# CONFIG_FB_RIVA is not set
+# CONFIG_MTD is not set
+# CONFIG_ULTRIX_PARTITION is not set
+# CONFIG_DTLK is not set
+CONFIG_VT=y
+CONFIG_CC_OPTIMIZE_FOR_SIZE=y
+# Advanced Linux Sound Architecture
+CONFIG_SND_PCM_OSS=m
+CONFIG_USB_ARCH_HAS_HCD=y
+# CONFIG_SND_DUMMY is not set
+# Misc Linux/SPARC drivers
+CONFIG_SERIAL_SUNZILOG_CONSOLE=y
+# PCI devices
+CONFIG_RPCSEC_GSS_SPKM3=m
+CONFIG_SERIAL_SUNZILOG=y
+CONFIG_SYSV_FS=m
+CONFIG_BLK_DEV_NBD=m
+CONFIG_PPP_DEFLATE=m
+# CONFIG_IP_PNP_DHCP is not set
+# TIPC Configuration (EXPERIMENTAL)
+# CONFIG_CIFS_STATS is not set
+# CONFIG_FONTS is not set
+# Network testing
+# CONFIG_INPUT_TSDEV is not set
+# Pseudo filesystems
+# CONFIG_SND_VIA82XX is not set
+CONFIG_SERIO_I8042=y
+# CONFIG_SND_RME9652 is not set
+CONFIG_EXT2_FS=y
+# CONFIG_NET_IPGRE is not set
+# SPI support
+# CONFIG_SND_MPU401 is not set
+# General setup
+# CONFIG_FB_KYRO is not set
+# CONFIG_NCPFS_SMALLDOS is not set
+# CONFIG_MINIX_SUBPARTITION is not set
+CONFIG_BEFS_FS=m
+# CONFIG_CIFS_EXPERIMENTAL is not set
+# CONFIG_NCPFS_NLS is not set
+# Tulip family network device support
+# CONFIG_LDM_PARTITION is not set
+# Character devices
+# QoS and/or fair queueing
+# General machine setup
+CONFIG_HFS_FS=m
+CONFIG_SERIO=y
+# Fusion MPT device support
+# CONFIG_AMIGA_PARTITION is not set
+# Parallel port support
+# CONFIG_SND_ICE1724 is not set
+CONFIG_HW_CONSOLE=y
+# SPI Master Controller Drivers
+# CONFIG_BSD_DISKLABEL is not set
+# CONFIG_FB_SAVAGE is not set
+CONFIG_GENERIC_FIND_NEXT_BIT=y
+# CONFIG_FB_MATROX is not set
+# Partition Types
+# CONFIG_SND_EMU10K1X is not set
+# Security options
+# CONFIG_APPLICOM is not set
+CONFIG_FRAMEBUFFER_CONSOLE=y
+# Automatically generated make config: don't edit
+# CONFIG_SOLARIS_X86_PARTITION is not set
+CONFIG_CIFS=m
+# Dallas's 1-wire bus
+CONFIG_SLIP_COMPRESSED=y
+# CONFIG_FB_MACMODES is not set
+# CONFIG_BLK_CPQ_CISS_DA is not set
+CONFIG_SERIAL_CORE_CONSOLE=y
+CONFIG_FB_CFB_IMAGEBLIT=y
+# Network File Systems
+# CONFIG_SND_HDA_INTEL is not set
+# MII PHY device drivers
+CONFIG_SCSI_ARCMSR=m
+# CONFIG_SCSI_SCAN_ASYNC is not set

Added: dists/sid/linux-2.6/debian/config/sparc/config.sparc32
==============================================================================
--- (empty file)
+++ dists/sid/linux-2.6/debian/config/sparc/config.sparc32	Mon Nov 26 20:06:56 2007
@@ -0,0 +1,96 @@
+# CONFIG_CDROM_PKTCDVD is not set
+# CONFIG_NET_PCI is not set
+# CONFIG_FB_PM2 is not set
+# CONFIG_SCSI_DC395x is not set
+# CONFIG_SCSI_ACARD is not set
+# CONFIG_FB_CYBER2000 is not set
+CONFIG_MOUSE_PS2=m
+CONFIG_SPARC32=y
+# CONFIG_MEGARAID_LEGACY is not set
+# CONFIG_AUDIT is not set
+CONFIG_FLATMEM_MANUAL=y
+# CONFIG_LOGO_SUN_CLUT224 is not set
+# CONFIG_SPARSEMEM_MANUAL is not set
+# CONFIG_SND_SEQUENCER is not set
+CONFIG_FB_CG14=y
+# CONFIG_SCSI_NSP32 is not set
+# CONFIG_FDDI is not set
+# CONFIG_SCSI_AIC7XXX is not set
+CONFIG_RWSEM_GENERIC_SPINLOCK=y
+# CONFIG_FB_MODE_HELPERS is not set
+# CONFIG_SND_ENS1370 is not set
+# CONFIG_SUN4 is not set
+# CONFIG_SCSI_CONSTANTS is not set
+# CONFIG_SCSI_AACRAID is not set
+# CONFIG_DL2K is not set
+# CONFIG_IDE is not set
+# CONFIG_NET_VENDOR_3COM is not set
+CONFIG_LOG_BUF_SHIFT=14
+# CONFIG_E1000 is not set
+# CONFIG_NS83820 is not set
+# CONFIG_IP_ADVANCED_ROUTER is not set
+# CONFIG_SCSI_INITIO is not set
+# CONFIG_SCSI_AIC7XXX_OLD is not set
+# CONFIG_SUN_JSFLASH is not set
+CONFIG_LOGO_LINUX_CLUT224=y
+# CONFIG_BSD_PROCESS_ACCT is not set
+# CONFIG_S2IO is not set
+# CONFIG_REISERFS_FS_SECURITY is not set
+# CONFIG_SCSI_3W_9XXX is not set
+# CONFIG_SND_CMIPCI is not set
+CONFIG_FB_TCX=y
+# CONFIG_SECURITY is not set
+# CONFIG_FB_ATY128 is not set
+# CONFIG_TADPOLE_TS102_UCTRL is not set
+CONFIG_HIGHMEM=y
+# CONFIG_SCSI_SYM53C8XX_2 is not set
+# CONFIG_ZISOFS is not set
+# CONFIG_MEGARAID_NEWGEN is not set
+# CONFIG_SND_ENS1371 is not set
+CONFIG_SPARC_LED=m
+CONFIG_SERIAL_SUNSAB=m
+CONFIG_BLK_DEV_CRYPTOLOOP=m
+CONFIG_SUN_PM=y
+# CONFIG_QFMT_V1 is not set
+# CONFIG_I2C is not set
+# CONFIG_SND_ALI5451 is not set
+# CONFIG_FB_RADEON is not set
+# CONFIG_SUNGEM is not set
+# CONFIG_NET_TULIP is not set
+# CONFIG_SUNOS_EMUL is not set
+# CONFIG_STANDALONE is not set
+# Sat Sep 16 21:12:18 2006
+# CONFIG_SCSI_IPR is not set
+# CONFIG_YELLOWFIN is not set
+CONFIG_BLK_DEV_RAM_SIZE=8192
+# CONFIG_BLK_DEV_SX8 is not set
+CONFIG_BLK_DEV_LOOP=m
+# CONFIG_BLK_DEV_3W_XXXX_RAID is not set
+# CONFIG_KEYS is not set
+# CONFIG_MYRI_SBUS is not set
+# CONFIG_DRM is not set
+# CONFIG_SCSI_DPT_I2O is not set
+# CONFIG_TIGON3 is not set
+# CONFIG_IXGB is not set
+# CONFIG_SUN_VIDEOPIX is not set
+# CONFIG_VIDEO_DEV is not set
+# CONFIG_SERIAL_SUNSU is not set
+# CONFIG_SCSI_DMX3191D is not set
+# CONFIG_SMP is not set
+# CONFIG_FIREWIRE is not set
+# CONFIG_HWMON_VID is not set
+CONFIG_FB_BW2=y
+# CONFIG_NTFS_FS is not set
+# CONFIG_RTC is not set
+# CONFIG_USB is not set
+CONFIG_BINFMT_AOUT=y
+CONFIG_FB_CG3=y
+CONFIG_FB_LEO=y
+CONFIG_SERIAL_CONSOLE=y
+# CONFIG_SCSI_AIC79XX is not set
+CONFIG_MOUSE_SERIAL=m
+# CONFIG_SCSI_LOGGING is not set
+CONFIG_BROKEN_ON_SMP=y
+# CONFIG_SND_MAESTRO3 is not set
+# CONFIG_SND_EMU10K1 is not set
+# CONFIG_INFINIBAND is not set

Added: dists/sid/linux-2.6/debian/config/sparc/config.sparc64
==============================================================================
--- (empty file)
+++ dists/sid/linux-2.6/debian/config/sparc/config.sparc64	Mon Nov 26 20:06:56 2007
@@ -0,0 +1,386 @@
+CONFIG_FB_MODE_HELPERS=y
+# USB Device Class drivers
+CONFIG_E1000=m
+CONFIG_USB_SISUSBVGA=m
+CONFIG_SOLARIS_EMUL=m
+CONFIG_VIDEO_TUNER=m
+CONFIG_SND_SEQUENCER_OSS=y
+CONFIG_BLK_DEV_IDEDISK=m
+CONFIG_SCSI_SYM53C8XX_MAX_TAGS=64
+CONFIG_I2C_PARPORT_LIGHT=m
+CONFIG_USB_OHCI_LITTLE_ENDIAN=y
+CONFIG_DRM_TDFX=m
+# CONFIG_EEPRO100 is not set
+CONFIG_FDDI=y
+CONFIG_USB_EHCI_HCD=m
+CONFIG_SERIAL_SUNSAB=y
+CONFIG_NET_TULIP=y
+# CONFIG_SENSORS_LM78 is not set
+# CONFIG_SENSORS_LM80 is not set
+# CONFIG_I2C_DEBUG_CORE is not set
+# CONFIG_SENSORS_GL518SM is not set
+# CONFIG_VIDEO_SAA5249 is not set
+# CONFIG_USB_EHCI_SPLIT_ISO is not set
+# CONFIG_SENSORS_ADM1021 is not set
+# CONFIG_I2C_SIS96X is not set
+# CONFIG_FB_RADEON_DEBUG is not set
+# CONFIG_LOGO_LINUX_CLUT224 is not set
+# CONFIG_SENSORS_MAX1619 is not set
+# Fibre Channel support
+CONFIG_DISPLAY7SEG=m
+CONFIG_USB_UHCI_HCD=m
+# CONFIG_SCSI_IPR_TRACE is not set
+# CONFIG_DE4X5 is not set
+# CONFIG_PARPORT_PC_SUPERIO is not set
+CONFIG_SND_EMU10K1=m
+# CONFIG_VIDEO_STRADIS is not set
+# CONFIG_FLATMEM_MANUAL is not set
+CONFIG_SCSI_PLUTO=m
+CONFIG_VIDEO_TVEEPROM=m
+CONFIG_MOUSE_SERIAL=y
+# CONFIG_USB_STORAGE_DEBUG is not set
+CONFIG_OBP_FLASH=m
+CONFIG_FB_PM2=y
+# CONFIG_I2C_VIAPRO is not set
+CONFIG_USB_OHCI_HCD=m
+CONFIG_IXGB=m
+CONFIG_SCSI_SYM53C8XX_2=m
+CONFIG_SPARC32_COMPAT=y
+# CONFIG_BLK_DEV_AMD74XX is not set
+CONFIG_BINFMT_ELF32=y
+CONFIG_BLK_DEV_CMD64X=m
+CONFIG_USB_MDC800=m
+# CONFIG_TUNER_3036 is not set
+# CONFIG_SPARC64_PAGE_SIZE_64KB is not set
+# CONFIG_I2C_ALI1535 is not set
+# CONFIG_I2C_ALI1563 is not set
+CONFIG_S2IO=m
+# CONFIG_SND_RTCTIMER is not set
+# CONFIG_HID_FF is not set
+CONFIG_I2C_ALGOPCA=m
+# CONFIG_8139TOO_TUNE_TWISTER is not set
+# CONFIG_SENSORS_LM87 is not set
+CONFIG_SCSI_SYM53C8XX_DMA_ADDRESSING_MODE=1
+CONFIG_I2C_CHARDEV=m
+CONFIG_SYSVIPC_COMPAT=y
+# CONFIG_I2C_DEBUG_BUS is not set
+CONFIG_USB_KAWETH=m
+# CONFIG_SPARC64_PAGE_SIZE_4MB is not set
+# CONFIG_SCSI_IZIP_EPP16 is not set
+# CONFIG_I2C_STUB is not set
+# CONFIG_BLK_DEV_HPT34X is not set
+CONFIG_WINBOND_840=m
+CONFIG_ADAPTEC_STARFIRE=m
+# CONFIG_FB_BW2 is not set
+# CONFIG_BLK_DEV_UB is not set
+CONFIG_FC4_SOC=m
+CONFIG_USB_CYTHERM=m
+CONFIG_BLK_DEV_GENERIC=m
+CONFIG_FONT_8x16=y
+# CONFIG_VIDEO_CPIA is not set
+# CONFIG_VIDEO_HEXIUM_GEMINI is not set
+CONFIG_USB_STORAGE_SDDR55=y
+CONFIG_ENVCTRL=m
+# CONFIG_BLK_DEV_AEC62XX is not set
+# CONFIG_BLK_DEV_HD is not set
+# USB devices
+# CONFIG_USB_OV511 is not set
+CONFIG_LOGO_SUN_CLUT224=y
+# CONFIG_USB_DEBUG is not set
+# Miscellaneous I2C Chip support
+CONFIG_BROKEN_ON_SMP=y
+# Miscellaneous USB options
+CONFIG_PCI_DOMAINS=y
+CONFIG_BLK_DEV_VIA82CXXX=m
+# USB Miscellaneous drivers
+# CONFIG_SENSORS_ADM1031 is not set
+CONFIG_BLK_DEV_CS5530=m
+# CONFIG_PARPORT_PC_FIFO is not set
+# CONFIG_SENSORS_PCF8574 is not set
+CONFIG_SND_ENS1371=m
+# CONFIG_SCSI_IPR_DUMP is not set
+# CONFIG_TULIP_MWI is not set
+# CONFIG_I2C_AMD756 is not set
+# CONFIG_IDE_ARM is not set
+# CONFIG_VIDEO_OVCAMCHIP is not set
+CONFIG_SND_MAESTRO3=m
+CONFIG_DL2K=m
+CONFIG_USB_AN2720=y
+CONFIG_BLK_DEV_IDECD=m
+# CONFIG_CMDLINE_BOOL is not set
+# CONFIG_I2C_SIS630 is not set
+CONFIG_I2C_ALGOPCF=m
+CONFIG_I2C=m
+CONFIG_COMPAT=y
+CONFIG_DRM_RADEON=m
+CONFIG_BLK_DEV_RAM_SIZE=16384
+# USB Serial Converter support
+# CONFIG_CDROM_PKTCDVD_WCACHE is not set
+# CONFIG_SENSORS_ADM1026 is not set
+CONFIG_STANDALONE=y
+CONFIG_USB_RIO500=m
+CONFIG_USB_BELKIN=y
+# CONFIG_FB_PM2_FIFO_DISCONNECT is not set
+CONFIG_64BIT=y
+# CONFIG_USB_KONICAWC is not set
+# CONFIG_USB_STORAGE_USBAT is not set
+CONFIG_LOG_BUF_SHIFT=14
+# Executable file formats
+# USB port drivers
+# CONFIG_SENSORS_LM90 is not set
+# CONFIG_SENSORS_FSCHER is not set
+CONFIG_USB_USBNET=m
+# CONFIG_SPARC64_PAGE_SIZE_512KB is not set
+# CONFIG_USB_IDMOUSE is not set
+# CONFIG_SENSORS_EEPROM is not set
+# CONFIG_USB_USS720 is not set
+CONFIG_SND_ALI5451=m
+CONFIG_CDROM_PKTCDVD=m
+CONFIG_USB_CATC=m
+CONFIG_MEGARAID_MM=m
+CONFIG_CDROM_PKTCDVD_BUFFERS=8
+CONFIG_ARCH_SPARSEMEM_ENABLE=y
+CONFIG_MEGARAID_NEWGEN=y
+CONFIG_SCSI_SYM53C8XX_DEFAULT_TAGS=16
+CONFIG_VIDEO_BUF=m
+# CONFIG_VIDEO_SAA5246A is not set
+# CONFIG_I2C_VOODOO3 is not set
+CONFIG_BLK_DEV_NS87415=m
+CONFIG_RTC=y
+CONFIG_YELLOWFIN=m
+CONFIG_R8169=m
+CONFIG_SERIAL_SUNHV=y
+# CONFIG_BLK_DEV_IDE_SATA is not set
+# CONFIG_DEFXX is not set
+# CONFIG_RADIO_MAESTRO is not set
+CONFIG_FC4=m
+# CONFIG_FB_TCX is not set
+# CONFIG_I2C_PROSAVAGE is not set
+# CONFIG_I2C_VIA is not set
+# Video Capture Adapters
+CONFIG_USB_STORAGE_SDDR09=y
+CONFIG_B44=m
+# CONFIG_USB_KBTAB is not set
+CONFIG_RWSEM_XCHGADD_ALGORITHM=y
+# CONFIG_SENSORS_LM75 is not set
+CONFIG_DM9102=m
+# USB Network Adapters
+CONFIG_USB_STORAGE_FREECOM=y
+# CONFIG_FB_ATY_GENERIC_LCD is not set
+# Subsystem Options
+CONFIG_BLK_DEV_SIIMAGE=m
+# CONFIG_USB_AUERSWALD is not set
+# CONFIG_VIDEO_CX88 is not set
+# CONFIG_SENSORS_FSCPOS is not set
+CONFIG_SND_CMIPCI=m
+CONFIG_LARGE_ALLOCS=y
+CONFIG_FB_ATY=y
+CONFIG_SERIAL_SUNSU_CONSOLE=y
+# Sat Sep 16 21:13:13 2006
+CONFIG_BLK_DEV_ALI15X3=m
+# CONFIG_USB_PWC is not set
+CONFIG_PCNET32=m
+# CONFIG_USB_PHIDGETKIT is not set
+# CONFIG_SENSORS_W83L785TS is not set
+# CONFIG_SENSORS_LM63 is not set
+CONFIG_IDE=y
+# CONFIG_SENSORS_SIS5595 is not set
+# CONFIG_SCSI_IZIP_SLOW_CTR is not set
+CONFIG_VIDEO_BTCX=m
+CONFIG_I2C_ALGOBIT=m
+# CONFIG_SENSORS_GL520SM is not set
+# may also be needed; see USB_STORAGE Help for more information
+# CONFIG_SENSORS_W83627HF is not set
+# CONFIG_BLK_DEV_SLC90E66 is not set
+CONFIG_NATSEMI=m
+# USB Imaging devices
+# CONFIG_SENSORS_PCF8591 is not set
+CONFIG_SND_SEQ_DUMMY=m
+# CONFIG_I2C_DEBUG_CHIP is not set
+# CONFIG_USB_TEST is not set
+# CONFIG_USB_ACM is not set
+CONFIG_FC4_SOCAL=m
+CONFIG_VIA_VELOCITY=m
+# CONFIG_VIDEO_CQCAM is not set
+# CONFIG_SENSORS_W83781D is not set
+CONFIG_USB_STORAGE_ISD200=y
+# CONFIG_PROFILING is not set
+# I2C Hardware Bus support
+# CONFIG_VIDEO_MXB is not set
+CONFIG_BLK_DEV_CS5520=m
+# CONFIG_PARIDE is not set
+# CONFIG_USB_DSBR is not set
+# CONFIG_VIDEO_BWQCAM is not set
+# CONFIG_USB_PHIDGETSERVO is not set
+# CONFIG_FB_CG3 is not set
+CONFIG_FB_ATY128=y
+# CONFIG_CPU_FREQ is not set
+# CONFIG_VIDEO_DPC is not set
+# CONFIG_8139TOO_PIO is not set
+# CONFIG_USB_RTL8150 is not set
+CONFIG_IDEDMA_ONLYDISK=y
+CONFIG_BLK_DEV_LOOP=y
+CONFIG_SPARC64_PAGE_SIZE_8KB=y
+# CONFIG_BLK_DEV_CRYPTOLOOP is not set
+# CONFIG_AMD8111_ETH is not set
+CONFIG_BLK_DEV_SVWKS=m
+# CONFIG_SENSORS_SMSC47M1 is not set
+# CONFIG_IDEDMA_IVB is not set
+# CONFIG_PDC202XX_BURST is not set
+# CONFIG_SENSORS_ASB100 is not set
+# CONFIG_BLK_DEV_SC1200 is not set
+CONFIG_USB_MICROTEK=m
+# CONFIG_8139CP is not set
+# CONFIG_SENSORS_SMSC47B397 is not set
+# Radio Adapters
+CONFIG_FB_ATY_CT=y
+# CONFIG_RADIO_MAXIRADIO is not set
+CONFIG_USB_HID=y
+# USB Host Controller Drivers
+CONFIG_DRM_MGA=m
+# CONFIG_USB_HIDDEV is not set
+# CONFIG_BLK_DEV_PIIX is not set
+CONFIG_SUNDANCE=m
+# CONFIG_BLK_DEV_OPTI621 is not set
+CONFIG_SND_VIRMIDI=m
+# CONFIG_USB_SL811_HCD is not set
+# CONFIG_SENSORS_LM92 is not set
+CONFIG_BLK_DEV_TRM290=m
+CONFIG_MEGARAID_LEGACY=m
+# CONFIG_IDEDISK_MULTI_MODE is not set
+# CONFIG_SENSORS_LM85 is not set
+# CONFIG_USB_DYNAMIC_MINORS is not set
+# CONFIG_BLK_DEV_OFFBOARD is not set
+CONFIG_EPIC100=m
+# CONFIG_I2C_PCA_ISA is not set
+CONFIG_USB_ALI_M5632=y
+CONFIG_SERIAL_SUNSAB_CONSOLE=y
+CONFIG_NET_VENDOR_3COM=y
+# CONFIG_USB_OTG is not set
+CONFIG_USB_DEVICEFS=y
+# CONFIG_I2C_AMD8111 is not set
+CONFIG_PARPORT_PC=m
+# CONFIG_BLK_DEV_HPT366 is not set
+# USB DSL modem support
+CONFIG_BLK_DEV_PDC202XX_OLD=m
+# CONFIG_USB_IBMCAM is not set
+CONFIG_TIGON3=m
+# CONFIG_RADIO_GEMTEK_PCI is not set
+CONFIG_IDE_GENERIC=m
+CONFIG_SKFP=m
+# CONFIG_USB_W9968CF is not set
+# FC4 drivers
+# V4L USB devices
+CONFIG_VORTEX=m
+CONFIG_BLK_DEV_IDE=y
+# CONFIG_FB_LEO is not set
+CONFIG_FB_ATY_GX=y
+CONFIG_TULIP=m
+CONFIG_BLK_DEV_PDC202XX_NEW=m
+CONFIG_FB_RADEON=y
+CONFIG_SND_ENS1370=m
+# CONFIG_I2C_PIIX4 is not set
+CONFIG_BLK_DEV_IDEFLOPPY=m
+CONFIG_BLK_DEV_IDEPCI=y
+# CONFIG_SENSORS_DS1621 is not set
+# CONFIG_I2C_SAVAGE4 is not set
+# CONFIG_SENSORS_IT87 is not set
+CONFIG_VIA_RHINE=m
+# CONFIG_I2C_DEBUG_ALGO is not set
+# CONFIG_BINFMT_AOUT32 is not set
+CONFIG_SCSI_IMM=m
+# CONFIG_USB_STORAGE_JUMPSHOT is not set
+CONFIG_NE2K_PCI=m
+# CONFIG_USB_EHCI_ROOT_HUB_TT is not set
+# CONFIG_8139_OLD_RX_RESET is not set
+# CONFIG_I2C_ALI15X3 is not set
+CONFIG_SUNDANCE_MMIO=y
+CONFIG_SCSI_FCAL=m
+# CONFIG_BLK_DEV_TRIFLEX is not set
+CONFIG_SCSI_IPR=m
+# Please see Documentation/ide.txt for help/info on IDE drives
+CONFIG_BLK_DEV_SX8=m
+CONFIG_SCSI_DC395x=m
+# CONFIG_VIDEO_HEXIUM_ORION is not set
+CONFIG_ARCH_SELECT_MEMORY_MODEL=y
+CONFIG_FB_FFB=y
+CONFIG_SPARSEMEM=y
+CONFIG_SCSI_INITIO=m
+# CONFIG_8139TOO_8129 is not set
+# CONFIG_I2C_NFORCE2 is not set
+CONFIG_USB_EPSON2888=y
+# CONFIG_DE2104X is not set
+# IDE chipset support/bugfixes
+# CONFIG_VIDEO_ZORAN is not set
+CONFIG_SPARSEMEM_MANUAL=y
+CONFIG_VIDEO_BT848=m
+# CONFIG_FB_CG14 is not set
+# CONFIG_SMP is not set
+# CONFIG_USB_VICAM is not set
+CONFIG_SERIAL_SUNSU=y
+# CONFIG_SENSORS_LM83 is not set
+CONFIG_HAVE_MEMORY_PRESENT=y
+# Instrumentation Support
+CONFIG_BLK_DEV_IDEDMA=y
+# CONFIG_USB_SE401 is not set
+# CONFIG_USB_SN9C102 is not set
+CONFIG_BLK_DEV_IDETAPE=m
+CONFIG_SPARC64=y
+CONFIG_SUNGEM=m
+CONFIG_ARCH_SPARSEMEM_DEFAULT=y
+# CONFIG_USB_STV680 is not set
+# CONFIG_I2C_SIS5595 is not set
+# CONFIG_SND_USB_AUDIO is not set
+CONFIG_USB_PRINTER=m
+CONFIG_DRM=y
+CONFIG_BLK_DEV_IDEDMA_PCI=y
+CONFIG_SND_SEQUENCER=m
+CONFIG_BBC_I2C=m
+CONFIG_FEALNX=m
+# CONFIG_FORCEDETH is not set
+CONFIG_I2C_PARPORT=m
+CONFIG_DRM_R128=m
+# CONFIG_BLK_DEV_IDEDMA_FORCED is not set
+# Encoders and Decoders
+# USB Input Devices
+# CONFIG_KPROBES is not set
+CONFIG_USB_STORAGE=m
+CONFIG_MYRI_SBUS=m
+CONFIG_MOUSE_PS2=y
+CONFIG_8139TOO=m
+# CONFIG_I2C_I801 is not set
+CONFIG_SCSI_DMX3191D=m
+# CONFIG_TULIP_MMIO is not set
+CONFIG_USB_LED=m
+CONFIG_USB_PEGASUS=m
+# CONFIG_SENSORS_LM77 is not set
+CONFIG_USB_STORAGE_DPCM=y
+# CONFIG_USB_LEGOTOWER is not set
+# CONFIG_VIA_RHINE_MMIO is not set
+# FC4 targets
+CONFIG_USB_LCD=m
+CONFIG_USB=y
+# CONFIG_I2C_I810 is not set
+# CONFIG_SENSORS_VIA686A is not set
+CONFIG_SPARSEMEM_EXTREME=y
+# CONFIG_SENSORS_PC87360 is not set
+# CONFIG_FB_RADEON_I2C is not set
+CONFIG_E100=m
+# Protocol Drivers
+CONFIG_VIDEO_IR=m
+CONFIG_SIS900=m
+# CONFIG_USB_STORAGE_DATAFAB is not set
+CONFIG_NET_PCI=y
+# CONFIG_WDC_ALI15X3 is not set
+# CONFIG_SENSORS_DS1337 is not set
+# CONFIG_VIDEO_W9966 is not set
+# CONFIG_IDEPCI_SHARE_IRQ is not set
+# I2C Algorithms
+# CONFIG_SENSORS_ADM1025 is not set
+CONFIG_TYPHOON=m
+CONFIG_MEGARAID_MAILBOX=m
+CONFIG_BLK_DEV_CY82C693=m
+CONFIG_SCSI_PPA=m
+CONFIG_NS83820=m
+CONFIG_VIDEO_V4L1_COMPAT=y
+CONFIG_USB_ARMLINUX=y

Added: dists/sid/linux-2.6/debian/config/sparc/config.sparc64-smp
==============================================================================
--- (empty file)
+++ dists/sid/linux-2.6/debian/config/sparc/config.sparc64-smp	Mon Nov 26 20:06:56 2007
@@ -0,0 +1,389 @@
+CONFIG_FB_MODE_HELPERS=y
+# USB Device Class drivers
+CONFIG_E1000=m
+CONFIG_USB_SISUSBVGA=m
+CONFIG_SOLARIS_EMUL=m
+CONFIG_VIDEO_TUNER=m
+CONFIG_SND_SEQUENCER_OSS=y
+CONFIG_BLK_DEV_IDEDISK=m
+CONFIG_SCSI_SYM53C8XX_MAX_TAGS=64
+CONFIG_I2C_PARPORT_LIGHT=m
+CONFIG_USB_OHCI_LITTLE_ENDIAN=y
+CONFIG_DRM_TDFX=m
+# CONFIG_EEPRO100 is not set
+CONFIG_FDDI=y
+CONFIG_USB_EHCI_HCD=m
+CONFIG_SERIAL_SUNSAB=y
+CONFIG_NET_TULIP=y
+# CONFIG_SENSORS_LM78 is not set
+# CONFIG_SENSORS_LM80 is not set
+# CONFIG_I2C_DEBUG_CORE is not set
+# CONFIG_SENSORS_GL518SM is not set
+# CONFIG_VIDEO_SAA5249 is not set
+# CONFIG_USB_EHCI_SPLIT_ISO is not set
+# CONFIG_SENSORS_ADM1021 is not set
+# CONFIG_I2C_SIS96X is not set
+# CONFIG_FB_RADEON_DEBUG is not set
+# CONFIG_LOGO_LINUX_CLUT224 is not set
+# CONFIG_SENSORS_MAX1619 is not set
+# Fibre Channel support
+CONFIG_DISPLAY7SEG=m
+CONFIG_USB_UHCI_HCD=m
+# CONFIG_SCSI_IPR_TRACE is not set
+# CONFIG_DE4X5 is not set
+# CONFIG_PARPORT_PC_SUPERIO is not set
+CONFIG_SND_EMU10K1=m
+# CONFIG_VIDEO_STRADIS is not set
+# CONFIG_FLATMEM_MANUAL is not set
+CONFIG_SCSI_PLUTO=m
+CONFIG_VIDEO_TVEEPROM=m
+CONFIG_MOUSE_SERIAL=y
+# CONFIG_USB_STORAGE_DEBUG is not set
+CONFIG_OBP_FLASH=m
+CONFIG_FB_PM2=y
+# CONFIG_I2C_VIAPRO is not set
+CONFIG_USB_OHCI_HCD=m
+CONFIG_IXGB=m
+CONFIG_SCSI_SYM53C8XX_2=m
+CONFIG_SPARC32_COMPAT=y
+# CONFIG_BLK_DEV_AMD74XX is not set
+CONFIG_BINFMT_ELF32=y
+CONFIG_BLK_DEV_CMD64X=m
+CONFIG_USB_MDC800=m
+# CONFIG_TUNER_3036 is not set
+# CONFIG_SPARC64_PAGE_SIZE_64KB is not set
+# CONFIG_I2C_ALI1535 is not set
+# CONFIG_I2C_ALI1563 is not set
+CONFIG_S2IO=m
+# CONFIG_SND_RTCTIMER is not set
+# CONFIG_HID_FF is not set
+CONFIG_I2C_ALGOPCA=m
+# CONFIG_8139TOO_TUNE_TWISTER is not set
+# CONFIG_SENSORS_LM87 is not set
+CONFIG_SCSI_SYM53C8XX_DMA_ADDRESSING_MODE=1
+CONFIG_I2C_CHARDEV=m
+CONFIG_SYSVIPC_COMPAT=y
+# CONFIG_I2C_DEBUG_BUS is not set
+CONFIG_LOCK_KERNEL=y
+CONFIG_USB_KAWETH=m
+# CONFIG_SPARC64_PAGE_SIZE_4MB is not set
+# CONFIG_SCSI_IZIP_EPP16 is not set
+# CONFIG_I2C_STUB is not set
+# CONFIG_BLK_DEV_HPT34X is not set
+CONFIG_WINBOND_840=m
+CONFIG_ADAPTEC_STARFIRE=m
+# CONFIG_FB_BW2 is not set
+# CONFIG_BLK_DEV_UB is not set
+CONFIG_FC4_SOC=m
+CONFIG_USB_CYTHERM=m
+CONFIG_BLK_DEV_GENERIC=m
+CONFIG_FONT_8x16=y
+# CONFIG_VIDEO_CPIA is not set
+# CONFIG_VIDEO_HEXIUM_GEMINI is not set
+CONFIG_USB_STORAGE_SDDR55=y
+CONFIG_ENVCTRL=m
+# CONFIG_BLK_DEV_AEC62XX is not set
+# CONFIG_BLK_DEV_HD is not set
+# USB devices
+# CONFIG_USB_OV511 is not set
+CONFIG_LOGO_SUN_CLUT224=y
+# CONFIG_USB_DEBUG is not set
+# Miscellaneous I2C Chip support
+# Miscellaneous USB options
+CONFIG_PCI_DOMAINS=y
+CONFIG_BLK_DEV_VIA82CXXX=m
+# USB Miscellaneous drivers
+# CONFIG_SENSORS_ADM1031 is not set
+CONFIG_BLK_DEV_CS5530=m
+# CONFIG_PARPORT_PC_FIFO is not set
+# CONFIG_SENSORS_PCF8574 is not set
+CONFIG_SND_ENS1371=m
+# CONFIG_SCSI_IPR_DUMP is not set
+# CONFIG_TULIP_MWI is not set
+# CONFIG_I2C_AMD756 is not set
+CONFIG_SCHED_SMT=y
+# CONFIG_VIDEO_OVCAMCHIP is not set
+CONFIG_SND_MAESTRO3=m
+CONFIG_DL2K=m
+CONFIG_USB_AN2720=y
+CONFIG_BLK_DEV_IDECD=m
+# CONFIG_CMDLINE_BOOL is not set
+# CONFIG_I2C_SIS630 is not set
+CONFIG_SMP=y
+CONFIG_I2C_ALGOPCF=m
+CONFIG_I2C=m
+CONFIG_COMPAT=y
+CONFIG_DRM_RADEON=m
+CONFIG_BLK_DEV_RAM_SIZE=16384
+CONFIG_I2C_PARPORT=m
+# CONFIG_CDROM_PKTCDVD_WCACHE is not set
+# CONFIG_SENSORS_ADM1026 is not set
+CONFIG_STANDALONE=y
+CONFIG_USB_RIO500=m
+CONFIG_USB_BELKIN=y
+# CONFIG_FB_PM2_FIFO_DISCONNECT is not set
+CONFIG_64BIT=y
+# CONFIG_USB_KONICAWC is not set
+# CONFIG_USB_STORAGE_USBAT is not set
+# Executable file formats
+# USB port drivers
+# CONFIG_SENSORS_LM90 is not set
+# CONFIG_SENSORS_FSCHER is not set
+CONFIG_USB_USBNET=m
+# CONFIG_SPARC64_PAGE_SIZE_512KB is not set
+# CONFIG_USB_IDMOUSE is not set
+# CONFIG_SENSORS_EEPROM is not set
+# CONFIG_USB_USS720 is not set
+CONFIG_SND_ALI5451=m
+CONFIG_CDROM_PKTCDVD=m
+CONFIG_USB_CATC=m
+CONFIG_MEGARAID_MM=m
+CONFIG_CDROM_PKTCDVD_BUFFERS=8
+CONFIG_ARCH_SPARSEMEM_ENABLE=y
+CONFIG_MEGARAID_NEWGEN=y
+CONFIG_SCSI_SYM53C8XX_DEFAULT_TAGS=16
+CONFIG_VIDEO_BUF=m
+# CONFIG_VIDEO_SAA5246A is not set
+# CONFIG_I2C_VOODOO3 is not set
+CONFIG_BLK_DEV_NS87415=m
+CONFIG_RTC=y
+CONFIG_YELLOWFIN=m
+CONFIG_R8169=m
+CONFIG_SERIAL_SUNHV=y
+# CONFIG_BLK_DEV_IDE_SATA is not set
+# CONFIG_DEFXX is not set
+# CONFIG_RADIO_MAESTRO is not set
+CONFIG_FC4=m
+# CONFIG_FB_TCX is not set
+# CONFIG_I2C_PROSAVAGE is not set
+# CONFIG_I2C_VIA is not set
+# Video Capture Adapters
+CONFIG_USB_STORAGE_SDDR09=y
+CONFIG_B44=m
+# CONFIG_USB_KBTAB is not set
+CONFIG_RWSEM_XCHGADD_ALGORITHM=y
+# CONFIG_SENSORS_LM75 is not set
+CONFIG_DM9102=m
+# USB Network Adapters
+CONFIG_USB_STORAGE_FREECOM=y
+# CONFIG_FB_ATY_GENERIC_LCD is not set
+# Subsystem Options
+CONFIG_BLK_DEV_SIIMAGE=m
+# CONFIG_USB_AUERSWALD is not set
+# CONFIG_VIDEO_CX88 is not set
+# CONFIG_SENSORS_FSCPOS is not set
+CONFIG_SND_CMIPCI=m
+CONFIG_LARGE_ALLOCS=y
+CONFIG_FB_ATY=y
+CONFIG_SERIAL_SUNSU_CONSOLE=y
+CONFIG_BLK_DEV_ALI15X3=m
+# CONFIG_USB_PWC is not set
+CONFIG_PCNET32=m
+# CONFIG_USB_PHIDGETKIT is not set
+# CONFIG_SENSORS_W83L785TS is not set
+# CONFIG_SENSORS_LM63 is not set
+CONFIG_IDE=y
+# CONFIG_SENSORS_SIS5595 is not set
+# CONFIG_SCSI_IZIP_SLOW_CTR is not set
+CONFIG_VIDEO_BTCX=m
+CONFIG_I2C_ALGOBIT=m
+# CONFIG_SENSORS_GL520SM is not set
+# may also be needed; see USB_STORAGE Help for more information
+# CONFIG_SENSORS_W83627HF is not set
+# CONFIG_BLK_DEV_SLC90E66 is not set
+CONFIG_NATSEMI=m
+# USB Imaging devices
+# CONFIG_SENSORS_PCF8591 is not set
+CONFIG_SND_SEQ_DUMMY=m
+# CONFIG_I2C_DEBUG_CHIP is not set
+# CONFIG_USB_TEST is not set
+# CONFIG_USB_ACM is not set
+CONFIG_FC4_SOCAL=m
+CONFIG_VIA_VELOCITY=m
+# CONFIG_VIDEO_CQCAM is not set
+# CONFIG_SENSORS_W83781D is not set
+CONFIG_USB_STORAGE_ISD200=y
+# CONFIG_PROFILING is not set
+# I2C Hardware Bus support
+# CONFIG_VIDEO_MXB is not set
+CONFIG_BLK_DEV_CS5520=m
+# CONFIG_PARIDE is not set
+# CONFIG_USB_DSBR is not set
+# CONFIG_VIDEO_BWQCAM is not set
+# CONFIG_USB_PHIDGETSERVO is not set
+# CONFIG_FB_CG3 is not set
+CONFIG_FB_ATY128=y
+# CONFIG_CPU_FREQ is not set
+# CONFIG_VIDEO_DPC is not set
+# CONFIG_8139TOO_PIO is not set
+# CONFIG_USB_RTL8150 is not set
+CONFIG_IDEDMA_ONLYDISK=y
+CONFIG_BLK_DEV_LOOP=y
+CONFIG_SPARC64_PAGE_SIZE_8KB=y
+# CONFIG_BLK_DEV_CRYPTOLOOP is not set
+# CONFIG_AMD8111_ETH is not set
+CONFIG_BLK_DEV_SVWKS=m
+# CONFIG_SENSORS_SMSC47M1 is not set
+# CONFIG_IDEDMA_IVB is not set
+# CONFIG_PDC202XX_BURST is not set
+# CONFIG_SENSORS_ASB100 is not set
+# CONFIG_BLK_DEV_SC1200 is not set
+CONFIG_USB_MICROTEK=m
+# CONFIG_8139CP is not set
+# CONFIG_SENSORS_SMSC47B397 is not set
+# Radio Adapters
+CONFIG_FB_ATY_CT=y
+# CONFIG_RADIO_MAXIRADIO is not set
+CONFIG_USB_HID=y
+# USB Host Controller Drivers
+CONFIG_DRM_MGA=m
+# CONFIG_USB_HIDDEV is not set
+# CONFIG_BLK_DEV_PIIX is not set
+CONFIG_SUNDANCE=m
+# CONFIG_BLK_DEV_OPTI621 is not set
+CONFIG_SND_VIRMIDI=m
+# CONFIG_USB_SL811_HCD is not set
+# CONFIG_SENSORS_LM92 is not set
+CONFIG_BLK_DEV_TRM290=m
+CONFIG_MEGARAID_LEGACY=m
+# CONFIG_IDEDISK_MULTI_MODE is not set
+# CONFIG_SENSORS_LM85 is not set
+# CONFIG_IDE_ARM is not set
+# CONFIG_USB_DYNAMIC_MINORS is not set
+# CONFIG_BLK_DEV_OFFBOARD is not set
+CONFIG_EPIC100=m
+CONFIG_LOG_BUF_SHIFT=15
+# CONFIG_I2C_PCA_ISA is not set
+CONFIG_USB_ALI_M5632=y
+CONFIG_SERIAL_SUNSAB_CONSOLE=y
+CONFIG_NET_VENDOR_3COM=y
+# CONFIG_USB_OTG is not set
+CONFIG_USB_DEVICEFS=y
+# CONFIG_I2C_AMD8111 is not set
+CONFIG_PARPORT_PC=m
+# CONFIG_BLK_DEV_HPT366 is not set
+# USB DSL modem support
+CONFIG_BLK_DEV_PDC202XX_OLD=m
+# CONFIG_USB_IBMCAM is not set
+CONFIG_TIGON3=m
+# CONFIG_RADIO_GEMTEK_PCI is not set
+CONFIG_USB_LCD=m
+# Sat Sep 16 21:14:07 2006
+CONFIG_SKFP=m
+# CONFIG_USB_W9968CF is not set
+# FC4 drivers
+# V4L USB devices
+CONFIG_VORTEX=m
+CONFIG_BLK_DEV_IDE=y
+# CONFIG_FB_LEO is not set
+CONFIG_FB_ATY_GX=y
+CONFIG_TULIP=m
+CONFIG_BLK_DEV_PDC202XX_NEW=m
+CONFIG_FB_RADEON=y
+CONFIG_SND_ENS1370=m
+# CONFIG_I2C_PIIX4 is not set
+CONFIG_BLK_DEV_IDEFLOPPY=m
+CONFIG_BLK_DEV_IDEPCI=y
+# CONFIG_SENSORS_DS1621 is not set
+# CONFIG_I2C_SAVAGE4 is not set
+# CONFIG_SENSORS_IT87 is not set
+CONFIG_VIA_RHINE=m
+# CONFIG_I2C_DEBUG_ALGO is not set
+# CONFIG_BINFMT_AOUT32 is not set
+CONFIG_SCSI_IMM=m
+# CONFIG_USB_STORAGE_JUMPSHOT is not set
+CONFIG_NE2K_PCI=m
+# CONFIG_USB_EHCI_ROOT_HUB_TT is not set
+# CONFIG_8139_OLD_RX_RESET is not set
+# CONFIG_I2C_ALI15X3 is not set
+CONFIG_SUNDANCE_MMIO=y
+CONFIG_SCSI_FCAL=m
+# CONFIG_BLK_DEV_TRIFLEX is not set
+CONFIG_SCSI_IPR=m
+# Please see Documentation/ide.txt for help/info on IDE drives
+CONFIG_BLK_DEV_SX8=m
+CONFIG_STOP_MACHINE=y
+# CONFIG_VIDEO_HEXIUM_ORION is not set
+CONFIG_ARCH_SELECT_MEMORY_MODEL=y
+CONFIG_FB_FFB=y
+CONFIG_SPARSEMEM=y
+CONFIG_SCSI_INITIO=m
+# CONFIG_8139TOO_8129 is not set
+# CONFIG_I2C_NFORCE2 is not set
+CONFIG_USB_EPSON2888=y
+# CONFIG_DE2104X is not set
+# IDE chipset support/bugfixes
+# CONFIG_VIDEO_ZORAN is not set
+CONFIG_SPARSEMEM_MANUAL=y
+CONFIG_VIDEO_BT848=m
+# CONFIG_FB_CG14 is not set
+CONFIG_E100=m
+# CONFIG_USB_VICAM is not set
+CONFIG_SERIAL_SUNSU=y
+# CONFIG_SENSORS_LM83 is not set
+CONFIG_HAVE_MEMORY_PRESENT=y
+# Instrumentation Support
+CONFIG_BLK_DEV_IDEDMA=y
+# CONFIG_USB_SE401 is not set
+# CONFIG_USB_SN9C102 is not set
+CONFIG_BLK_DEV_IDETAPE=m
+CONFIG_SPARC64=y
+CONFIG_SUNGEM=m
+CONFIG_ARCH_SPARSEMEM_DEFAULT=y
+# CONFIG_USB_STV680 is not set
+# CONFIG_I2C_SIS5595 is not set
+# CONFIG_SND_USB_AUDIO is not set
+CONFIG_USB_PRINTER=m
+CONFIG_DRM=y
+CONFIG_BLK_DEV_IDEDMA_PCI=y
+CONFIG_SND_SEQUENCER=m
+CONFIG_BBC_I2C=m
+CONFIG_FEALNX=m
+# CONFIG_FORCEDETH is not set
+# USB Serial Converter support
+CONFIG_DRM_R128=m
+# CONFIG_BLK_DEV_IDEDMA_FORCED is not set
+# Encoders and Decoders
+CONFIG_NR_CPUS=32
+# USB Input Devices
+# CONFIG_KPROBES is not set
+CONFIG_USB_STORAGE=m
+CONFIG_MYRI_SBUS=m
+CONFIG_MOUSE_PS2=y
+CONFIG_8139TOO=m
+# CONFIG_I2C_I801 is not set
+CONFIG_SCSI_DMX3191D=m
+# CONFIG_TULIP_MMIO is not set
+CONFIG_USB_LED=m
+CONFIG_USB_PEGASUS=m
+# CONFIG_SENSORS_LM77 is not set
+CONFIG_USB_STORAGE_DPCM=y
+# CONFIG_USB_LEGOTOWER is not set
+# CONFIG_VIA_RHINE_MMIO is not set
+# FC4 targets
+CONFIG_IDE_GENERIC=m
+CONFIG_USB=y
+# CONFIG_I2C_I810 is not set
+# CONFIG_SENSORS_VIA686A is not set
+CONFIG_SPARSEMEM_EXTREME=y
+# CONFIG_SENSORS_PC87360 is not set
+# CONFIG_FB_RADEON_I2C is not set
+CONFIG_SCSI_DC395x=m
+# Protocol Drivers
+CONFIG_VIDEO_IR=m
+CONFIG_SIS900=m
+# CONFIG_USB_STORAGE_DATAFAB is not set
+CONFIG_NET_PCI=y
+# CONFIG_WDC_ALI15X3 is not set
+# CONFIG_SENSORS_DS1337 is not set
+# CONFIG_VIDEO_W9966 is not set
+# CONFIG_IDEPCI_SHARE_IRQ is not set
+# I2C Algorithms
+# CONFIG_SENSORS_ADM1025 is not set
+CONFIG_TYPHOON=m
+CONFIG_MEGARAID_MAILBOX=m
+CONFIG_BLK_DEV_CY82C693=m
+CONFIG_SCSI_PPA=m
+CONFIG_NS83820=m
+CONFIG_VIDEO_V4L1_COMPAT=y
+CONFIG_USB_ARMLINUX=y

Added: dists/sid/linux-2.6/debian/config/sparc/defines
==============================================================================
--- (empty file)
+++ dists/sid/linux-2.6/debian/config/sparc/defines	Mon Nov 26 20:06:56 2007
@@ -0,0 +1,34 @@
+[base]
+featuresets:
+ vserver
+flavours:
+# sparc32
+ sparc64
+ sparc64-smp
+kernel-header-dirs: sparc sparc64
+
+[image]
+suggests: silo, fdutils
+type: kernel-package
+
+[libc-dev]
+arch: sparc64
+
+[sparc32_base]
+class: uniprocessor sparc32 (sun4m)
+kernel-arch: sparc
+kpkg-subarch: sparc
+
+[sparc32_image]
+image-postproc: sparc32-image-postproc
+
+[sparc64_base]
+class: uniprocessor 64-bit UltraSPARC
+kernel-arch: sparc64
+kpkg-subarch: sparc64
+
+[sparc64-smp_base]
+class: multiprocessor 64-bit UltraSPARC
+kernel-arch: sparc64
+kpkg-subarch: sparc64
+

Added: dists/sid/linux-2.6/debian/config/sparc/vserver/defines
==============================================================================
--- (empty file)
+++ dists/sid/linux-2.6/debian/config/sparc/vserver/defines	Mon Nov 26 20:06:56 2007
@@ -0,0 +1,9 @@
+[base]
+flavours:
+ sparc64
+
+[image]
+recommends: util-vserver, libc6-sparc64
+
+[sparc64_image]
+configs: sparc/config.sparc64-smp

Modified: dists/sid/linux-2.6/debian/lib/python/debian_linux/config.py
==============================================================================
--- dists/sid/linux-2.6/debian/lib/python/debian_linux/config.py	(original)
+++ dists/sid/linux-2.6/debian/lib/python/debian_linux/config.py	Mon Nov 26 20:06:56 2007
@@ -1,13 +1,11 @@
 import os, os.path, re, sys, textwrap
 
 __all__ = [
+    'ConfigCoreDump',
+    'ConfigCoreHierarchy',
     'ConfigParser',
-    'ConfigReader',
-    'ConfigReaderCore',
 ]
 
-_marker = object()
-
 class SchemaItemBoolean(object):
     def __call__(self, i):
         i = i.strip().lower()
@@ -27,220 +25,210 @@
             return []
         return [j.strip() for j in re.split(self.type, i)]
 
-class ConfigReader(dict):
-    config_name = "defines"
-
-    def __init__(self, dirs = []):
-        self._dirs = dirs
-
-    def __getitem__(self, key):
-        return self.get(key)
-
-    def _update(self, ret, inputkey):
-        for key, value in super(ConfigReader, self).get(tuple(inputkey), {}).iteritems():
-            ret[key] = value
-
-    def getFiles(self, name):
-        return [os.path.join(i, name) for i in self._dirs if i]
-
-    def get(self, key, default = _marker):
-        if isinstance(key, basestring):
-            key = key,
-
-        ret = super(ConfigReader, self).get(tuple(key), default)
-        if ret == _marker:
-            raise KeyError, key
-        return ret
-
-    def merge(self, section, *args):
+class ConfigCore(dict):
+    def merge(self, section, arch = None, featureset = None, flavour = None):
         ret = {}
-        for i in xrange(0, len(args) + 1):
-            ret.update(self.get(tuple([section] + list(args[:i])), {}))
+        ret.update(self.get((section,), {}))
+        if featureset:
+            ret.update(self.get((section, None, featureset), {}))
+        if arch:
+            ret.update(self.get((section, arch), {}))
+        if arch and featureset:
+            ret.update(self.get((section, arch, featureset), {}))
+        if arch and featureset and flavour:
+            ret.update(self.get((section, arch, None, flavour), {}))
+            ret.update(self.get((section, arch, featureset, flavour), {}))
         return ret
 
-    def sections(self):
-        return super(ConfigReader, self).keys()
+    def dump(self, fp):
+        sections = self.keys()
+        sections.sort()
+        for section in sections:
+            fp.write('[%r]\n' % (section,))
+            items = self[section]
+            items_keys = items.keys()
+            items_keys.sort()
+            for item in items:
+                fp.write('%s: %r\n' % (item, items[item]))
+            fp.write('\n')
+
+class ConfigCoreDump(ConfigCore):
+    def __init__(self, config = None, fp = None):
+        super(ConfigCoreDump, self).__init__(self)
+        if config is not None:
+            self.update(config)
+        if fp is not None:
+            from ConfigParser import RawConfigParser
+            config = RawConfigParser()
+            config.readfp(fp)
+            for section in config.sections():
+                section_real = eval(section)
+                data = {}
+                for key, value in config.items(section):
+                    value_real = eval(value)
+                    data[key] = value_real
+                self[section_real] = data
+
+class ConfigCoreHierarchy(ConfigCore):
+    config_name = "defines"
 
-class ConfigReaderCore(ConfigReader):
-    schema = {
-        'arches': SchemaItemList(),
-        'available': SchemaItemBoolean(),
-        'configs': SchemaItemList(),
-        'flavours': SchemaItemList(),
-        'initramfs': SchemaItemBoolean(),
-        'initramfs-generators': SchemaItemList(),
-        'modules': SchemaItemBoolean(),
-        'subarches': SchemaItemList(),
-        'versions': SchemaItemList(),
+    schemas = {
+        'base': {
+            'arches': SchemaItemList(),
+            'enabled': SchemaItemBoolean(),
+            'featuresets': SchemaItemList(),
+            'flavours': SchemaItemList(),
+            'modules': SchemaItemBoolean(),
+        },
+        'image': {
+            'configs': SchemaItemList(),
+            'initramfs': SchemaItemBoolean(),
+            'initramfs-generators': SchemaItemList(),
+        },
+        'relations': {
+        },
+        'xen': {
+            'dom0-support': SchemaItemBoolean(),
+            'versions': SchemaItemList(),
+        }
     }
 
     def __init__(self, dirs = []):
-        super(ConfigReaderCore, self).__init__(dirs)
-        self._readBase()
+        super(ConfigCoreHierarchy, self).__init__()
+        self._dirs = dirs
+        self._read_base()
 
-    def _readArch(self, arch):
-        files = self.getFiles("%s/%s" % (arch, self.config_name))
-        config = ConfigParser(self.schema, files)
+    def _read_arch(self, arch):
+        config = ConfigParser(self.schemas)
+        config.read(self.get_files("%s/%s" % (arch, self.config_name)))
 
-        subarches = config['base',].get('subarches', [])
+        featuresets = config['base',].get('featuresets', [])
         flavours = config['base',].get('flavours', [])
 
         for section in iter(config):
-            real = list(section)
-            # TODO
-            if real[-1] in subarches:
-                real[0:0] = ['base', arch]
-            elif real[-1] in flavours:
-                real[0:0] = ['base', arch, 'none']
+            if section[0] in featuresets:
+                real = (section[-1], arch, section[0])
+            elif len(section) > 1:
+                real = (section[-1], arch, None) + section[:-1]
             else:
-                real[0:0] = [real.pop()]
-                if real[-1] in flavours:
-                    real[1:1] = [arch, 'none']
-                else:
-                    real[1:1] = [arch]
-            real = tuple(real)
+                real = (section[-1], arch) + section[:-1]
             s = self.get(real, {})
             s.update(config[section])
             self[tuple(real)] = s
 
-        for subarch in subarches:
-            if self.has_key(('base', arch, subarch)):
-                avail = self['base', arch, subarch].get('available', True)
-            else:
-                avail = True
-            if avail:
-                self._readSubarch(arch, subarch)
-
-        base = self['base', arch]
-        base['subarches'] = subarches
+        for featureset in featuresets:
+            self._read_arch_featureset(arch, featureset)
 
         if flavours:
-            subarches.insert(0, 'none')
+            base = self['base', arch]
+            featuresets.insert(0, 'none')
+            base['featuresets'] = featuresets
             del base['flavours']
             self['base', arch] = base
-            self['base', arch, 'none'] = {'flavours': flavours}
-            for flavour in flavours:
-                self._readFlavour(arch, 'none', flavour)
-
-    def _readBase(self):
-        files = self.getFiles(self.config_name)
-        config = ConfigParser(self.schema, files)
+            self['base', arch, 'none'] = {'flavours': flavours, 'implicit-flavour': True}
+
+    def _read_arch_featureset(self, arch, featureset):
+        config = ConfigParser(self.schemas)
+        config.read(self.get_files("%s/%s/%s" % (arch, featureset, self.config_name)))
+
+        flavours = config['base',].get('flavours', [])
+
+        for section in iter(config):
+            real = (section[-1], arch, featureset) + section[:-1]
+            s = self.get(real, {})
+            s.update(config[section])
+            self[tuple(real)] = s
+
+    def _read_base(self):
+        config = ConfigParser(self.schemas)
+        config.read(self.get_files(self.config_name))
 
         arches = config['base',]['arches']
+        featuresets = config['base',].get('featuresets', [])
 
         for section in iter(config):
-            real = list(section)
-            if real[-1] in arches:
-                real.insert(0, 'base')
+            if section[0].startswith('featureset-'):
+                real = (section[-1], None, section[0].lstrip('featureset-'))
             else:
-                real.insert(0, real.pop())
-            self[tuple(real)] = config[section]
+                real = (section[-1],) + section[1:]
+            self[real] = config[section]
 
         for arch in arches:
-            try:
-                avail = self['base', arch].get('available', True)
-            except KeyError:
-                avail = True
-            if avail:
-                self._readArch(arch)
-
-    def _readFlavour(self, arch, subarch, flavour):
-        if not self.has_key(('base', arch, subarch, flavour)):
-            if subarch == 'none':
-                import warnings
-                warnings.warn('No config entry for flavour %s, subarch none, arch %s' % (flavour, arch), DeprecationWarning)
-            self['base', arch, subarch, flavour] = {}
-
-    def _readSubarch(self, arch, subarch):
-        files = self.getFiles("%s/%s/%s" % (arch, subarch, self.config_name))
-        config = ConfigParser(self.schema, files)
-
-        flavours = config['base',].get('flavours', [])
+            self._read_arch(arch)
+        for featureset in featuresets:
+            self._read_featureset(featureset)
+
+    def _read_featureset(self, featureset):
+        config = ConfigParser(self.schemas)
+        config.read(self.get_files("featureset-%s/%s" % (featureset, self.config_name)))
 
         for section in iter(config):
-            real = list(section)
-            if real[-1] in flavours:
-                real[0:0] = ['base', arch, subarch]
-            else:
-                real[0:0] = [real.pop(), arch, subarch]
-            real = tuple(real)
+            real = (section[-1], None, featureset)
             s = self.get(real, {})
             s.update(config[section])
-            self[tuple(real)] = s
-
-        for flavour in flavours:
-            self._readFlavour(arch, subarch, flavour)
+            self[real] = s
 
-    def merge(self, section, arch = None, subarch = None, flavour = None):
-        ret = {}
-        ret.update(self.get((section,), {}))
-        if arch:
-            ret.update(self.get((section, arch), {}))
-        if flavour and subarch and subarch != 'none':
-            ret.update(self.get((section, arch, 'none', flavour), {}))
-        if subarch:
-            ret.update(self.get((section, arch, subarch), {}))
-        if flavour:
-            ret.update(self.get((section, arch, subarch, flavour), {}))
-        return ret
+    def get_files(self, name):
+        return [os.path.join(i, name) for i in self._dirs if i]
 
 class ConfigParser(object):
-    __slots__ = 'configs', 'schema'
+    __slots__ = '_config', 'schemas'
 
-    def __init__(self, schema, files):
-        self.configs = []
-        self.schema = schema
-        fps = []
-        for i in files:
-            try:
-                fps.append(file(i))
-            except Exception: pass
-        if not fps:
-            raise RuntimeError("No files found")
-        for f in fps:
-            import ConfigParser
-            config = ConfigParser.ConfigParser()
-            config.readfp(f)
-            self.configs.append(config)
+    def __init__(self, schemas):
+        self.schemas = schemas
+
+        from ConfigParser import RawConfigParser
+        self._config = config = RawConfigParser()
 
     def __getitem__(self, key):
-        return self.items(key)
+        return self._convert()[key]
 
     def __iter__(self):
-        return iter(self.sections())
+        return iter(self._convert())
+
+    def __str__(self):
+        return '<%s(%s)>' % (self.__class__.__name__, self._convert())
 
-    def items(self, section, var = {}):
+    def _convert(self):
         ret = {}
-        section = '_'.join(section)
-        exceptions = []
-        for config in self.configs:
-            try:
-                items = config.items(section)
-            except ConfigParser.NoSectionError, e:
-                exceptions.append(e)
+        for section in self._config.sections():
+            data = {}
+            for key, value in self._config.items(section):
+                data[key] = value
+            s1 = section.split('_')
+            if s1[-1] in self.schemas:
+                ret[tuple(s1)] = self.SectionSchema(data, self.schemas[s1[-1]])
             else:
-                for key, value in items:
-                    try:
-                        value = self.schema[key](value)
-                    except KeyError: pass
-                    ret[key] = value
-        if len(exceptions) == len(self.configs):
-            raise exceptions[0]
+                ret[(section,)] = self.Section(data)
         return ret
 
-    def sections(self):
-        sections = []
-        for config in self.configs:
-            for section in config.sections():
-                section = tuple(section.split('_'))
-                if section not in sections:
-                    sections.append(section)
-        return sections
+    def keys(self):
+        return self._convert().keys()
+
+    def read(self, data):
+        return self._config.read(data)
+
+    class Section(dict):
+        def __init__(self, data):
+            super(ConfigParser.Section, self).__init__(data)
+
+        def __str__(self):
+            return '<%s(%s)>' % (self.__class__.__name__, self._data)
+
+    class SectionSchema(Section):
+        __slots__ = ()
+
+        def __init__(self, data, schema):
+            for key in data.keys():
+                try:
+                    data[key] = schema[key](data[key])
+                except KeyError: pass
+            super(ConfigParser.SectionSchema, self).__init__(data)
 
 if __name__ == '__main__':
     import sys
-    config = config_reader()
-    sections = config.sections()
+    config = ConfigReaderCore(['debian/config'])
+    sections = config.keys()
     sections.sort()
     for section in sections:
         print "[%s]" % (section,)

Modified: dists/sid/linux-2.6/debian/lib/python/debian_linux/debian.py
==============================================================================
--- dists/sid/linux-2.6/debian/lib/python/debian_linux/debian.py	(original)
+++ dists/sid/linux-2.6/debian/lib/python/debian_linux/debian.py	Mon Nov 26 20:06:56 2007
@@ -105,7 +105,10 @@
     )
 )?
 (?:
-    \.dfsg\.\d+
+    \.dfsg\.
+    (?P<dfsg>
+        \d+
+    )
 )?
 -
 (?:[^-]+)
@@ -126,6 +129,7 @@
             self.linux_upstream = '-'.join((d['version'], d['modifier']))
         else:
             self.linux_upstream = d['version']
+        self.linux_dfsg = d['dfsg']
  
 class PackageFieldList(list):
     def __init__(self, value = None):

Modified: dists/sid/linux-2.6/debian/lib/python/debian_linux/gencontrol.py
==============================================================================
--- dists/sid/linux-2.6/debian/lib/python/debian_linux/gencontrol.py	(original)
+++ dists/sid/linux-2.6/debian/lib/python/debian_linux/gencontrol.py	Mon Nov 26 20:06:56 2007
@@ -1,6 +1,5 @@
-from config import *
 from debian import *
-from utils import *
+from utils import SortedDict
 
 class PackagesList(SortedDict):
     def append(self, package):
@@ -10,6 +9,52 @@
         for package in packages:
             self[package['Package']] = package
 
+class Makefile(object):
+    def __init__(self):
+        self.rules = {}
+        self.add('.NOTPARALLEL')
+
+    def add(self, name, deps = None, cmds = None):
+        if name in self.rules:
+            self.rules[name].add(deps, cmds)
+        else:
+            self.rules[name] = self.Rule(name, deps, cmds)
+
+    def write(self, out):
+        r = self.rules.keys()
+        r.sort()
+        for i in r:
+            self.rules[i].write(out)
+
+    class Rule(object):
+        def __init__(self, name, deps = None, cmds = None):
+            self.name = name
+            self.deps, self.cmds = set(), []
+            self.add(deps, cmds)
+
+        def add(self, deps = None, cmds = None):
+            if deps is not None:
+                self.deps.update(deps)
+            if cmds is not None:
+                self.cmds.append(cmds)
+
+        def write(self, out):
+            deps_string = ''
+            if self.deps:
+                deps = list(self.deps)
+                deps.sort()
+                deps_string = ' ' + ' '.join(deps)
+
+            if self.cmds:
+                if deps_string:
+                    out.write('%s::%s\n' % (self.name, deps_string))
+                for c in self.cmds:
+                    out.write('%s::\n' % self.name)
+                    for i in c:
+                        out.write('\t%s\n' % i)
+            else:
+                out.write('%s:%s\n' % (self.name, deps_string))
+
 class MakeFlags(dict):
     def __repr__(self):
         repr = super(flags, self).__repr__()
@@ -24,20 +69,18 @@
 class Gencontrol(object):
     makefile_targets = ('binary-arch', 'build', 'setup', 'source')
 
-    def __init__(self, underlay = None):
-        self.config = ConfigReaderCore([underlay, "debian/arch"])
-        self.templates = Templates()
+    def __init__(self, config, templates):
+        self.config, self.templates = config, templates
 
     def __call__(self):
         packages = PackagesList()
-        makefile = [('.NOTPARALLEL:', ())]
+        makefile = Makefile()
 
         self.do_source(packages)
         self.do_main(packages, makefile)
         self.do_extra(packages, makefile)
 
-        self.write_control(packages.itervalues())
-        self.write_makefile(makefile)
+        self.write(packages, makefile)
 
     def do_source(self, packages):
         source = self.templates["control.source"]
@@ -67,9 +110,7 @@
         })
 
     def do_main_makefile(self, makefile, makeflags, extra):
-        cmds_binary_indep = []
-        cmds_binary_indep.append(("$(MAKE) -f debian/rules.real binary-indep %s" % makeflags,))
-        makefile.append(("binary-indep:", cmds_binary_indep))
+        makefile.add('binary-indep', cmds = ["$(MAKE) -f debian/rules.real binary-indep %s" % makeflags])
 
     def do_main_packages(self, packages, extra):
         pass
@@ -97,23 +138,16 @@
                 if i.has_key('X-Version-Overwrite-Epoch'):
                         tmp.append("-v1:%s" % self.version['source'])
                 cmds.append("$(MAKE) -f debian/rules.real install-dummy DH_OPTIONS='-p%s' GENCONTROL_ARGS='%s'" % (i['Package'], ' '.join(tmp)))
-            makefile.append("binary-arch-%s:: binary-arch-%s-extra" % (arch, arch))
-            makefile.append(("binary-arch-%s-extra:" % arch, cmds))
+            makefile.add('binary-arch_%s' % arch ['binary-arch_%s_extra' % arch])
+            makefile.add("binary-arch_%s_extra" % arch, cmds = cmds)
 
     def do_arch(self, packages, makefile, arch, vars, makeflags, extra):
-        config_entry = self.config['base', arch]
-        vars.update(config_entry)
+        config_base = self.config['base', arch]
+        vars.update(config_base)
         vars['arch'] = arch
 
-        if not config_entry.get('available', True):
-            for i in self.makefile_targets:
-                makefile.append(("%s-%s:" % (i, arch), ["@echo Architecture %s is not available!" % arch, "@exit 1"]))
-            return
-
         makeflags['ARCH'] = arch
 
-        vars['localversion'] = ''
-
         self.do_arch_setup(vars, makeflags, arch, extra)
         self.do_arch_makefile(makefile, arch, makeflags, extra)
         self.do_arch_packages(packages, makefile, arch, vars, makeflags, extra)
@@ -124,49 +158,58 @@
 
     def do_arch_makefile(self, makefile, arch, makeflags, extra):
         for i in self.makefile_targets:
-            makefile.append("%s:: %s-%s" % (i, i, arch))
-            makefile.append("%s-%s:: %s-%s-real" % (i, arch, i, arch))
+            target1 = i
+            target2 = "%s_%s" % (i, arch)
+            makefile.add(target1, [target2])
+            makefile.add(target2, ['%s_real' % target2])
+            makefile.add('%s_real' % target2)
 
     def do_arch_packages(self, packages, makefile, arch, vars, makeflags, extra):
-        for i in self.makefile_targets:
-            makefile.append("%s-%s-real:" % (i, arch))
+        pass
 
     def do_arch_recurse(self, packages, makefile, arch, vars, makeflags, extra):
-        for subarch in self.config['base', arch]['subarches']:
-            self.do_subarch(packages, makefile, arch, subarch, vars.copy(), makeflags.copy(), extra)
+        for featureset in self.config['base', arch]['featuresets']:
+            self.do_featureset(packages, makefile, arch, featureset, vars.copy(), makeflags.copy(), extra)
 
-    def do_subarch(self, packages, makefile, arch, subarch, vars, makeflags, extra):
-        config_entry = self.config['base', arch, subarch]
-        vars.update(config_entry)
+    def do_featureset(self, packages, makefile, arch, featureset, vars, makeflags, extra):
+        config_base = self.config.merge('base', arch, featureset)
+        vars.update(config_base)
+
+        if not config_base.get('enabled', True):
+            return
+
+        makeflags['FEATURESET'] = featureset
+
+        vars['localversion'] = ''
+        if featureset != 'none':
+            vars['localversion'] = '-' + featureset
 
-        makeflags['SUBARCH'] = subarch
-        if subarch != 'none':
-            vars['localversion'] += '-' + subarch
-
-        self.do_subarch_setup(vars, makeflags, arch, subarch, extra)
-        self.do_subarch_makefile(makefile, arch, subarch, makeflags, extra)
-        self.do_subarch_packages(packages, makefile, arch, subarch, vars, makeflags, extra)
-        self.do_subarch_recurse(packages, makefile, arch, subarch, vars, makeflags, extra)
+        self.do_featureset_setup(vars, makeflags, arch, featureset, extra)
+        self.do_featureset_makefile(makefile, arch, featureset, makeflags, extra)
+        self.do_featureset_packages(packages, makefile, arch, featureset, vars, makeflags, extra)
+        self.do_featureset_recurse(packages, makefile, arch, featureset, vars, makeflags, extra)
 
-    def do_subarch_setup(self, vars, makeflags, arch, subarch, extra):
+    def do_featureset_setup(self, vars, makeflags, arch, featureset, extra):
         pass
 
-    def do_subarch_makefile(self, makefile, arch, subarch, makeflags, extra):
+    def do_featureset_makefile(self, makefile, arch, featureset, makeflags, extra):
         for i in self.makefile_targets:
-            makefile.append("%s-%s:: %s-%s-%s" % (i, arch, i, arch, subarch))
-            makefile.append("%s-%s-%s:: %s-%s-%s-real" % (i, arch, subarch, i, arch, subarch))
+            target1 = "%s_%s" % (i, arch)
+            target2 = "%s_%s_%s" % (i, arch, featureset)
+            makefile.add(target1, [target2])
+            makefile.add(target2, ['%s_real' % target2])
+            makefile.add('%s_real' % target2)
 
-    def do_subarch_packages(self, packages, makefile, arch, subarch, vars, makeflags, extra):
-        for i in self.makefile_targets:
-            makefile.append("%s-%s-%s-real:" % (i, arch, subarch))
+    def do_featureset_packages(self, packages, makefile, arch, featureset, vars, makeflags, extra):
+        pass
 
-    def do_subarch_recurse(self, packages, makefile, arch, subarch, vars, makeflags, extra):
-        for flavour in self.config['base', arch, subarch]['flavours']:
-            self.do_flavour(packages, makefile, arch, subarch, flavour, vars.copy(), makeflags.copy(), extra)
-
-    def do_flavour(self, packages, makefile, arch, subarch, flavour, vars, makeflags, extra):
-        config_entry = self.config.merge('base', arch, subarch, flavour)
-        vars.update(config_entry)
+    def do_featureset_recurse(self, packages, makefile, arch, featureset, vars, makeflags, extra):
+        for flavour in self.config['base', arch, featureset]['flavours']:
+            self.do_flavour(packages, makefile, arch, featureset, flavour, vars.copy(), makeflags.copy(), extra)
+
+    def do_flavour(self, packages, makefile, arch, featureset, flavour, vars, makeflags, extra):
+        config_base = self.config.merge('base', arch, featureset, flavour)
+        vars.update(config_base)
 
         if not vars.has_key('longclass'):
             vars['longclass'] = vars['class']
@@ -174,11 +217,11 @@
         makeflags['FLAVOUR'] = flavour
         vars['localversion'] += '-' + flavour
 
-        self.do_flavour_setup(vars, makeflags, arch, subarch, flavour, extra)
-        self.do_flavour_makefile(makefile, arch, subarch, flavour, makeflags, extra)
-        self.do_flavour_packages(packages, makefile, arch, subarch, flavour, vars, makeflags, extra)
+        self.do_flavour_setup(vars, makeflags, arch, featureset, flavour, extra)
+        self.do_flavour_makefile(makefile, arch, featureset, flavour, makeflags, extra)
+        self.do_flavour_packages(packages, makefile, arch, featureset, flavour, vars, makeflags, extra)
 
-    def do_flavour_setup(self, vars, makeflags, arch, subarch, flavour, extra):
+    def do_flavour_setup(self, vars, makeflags, arch, featureset, flavour, extra):
         for i in (
             ('kernel-arch', 'KERNEL_ARCH'),
             ('localversion', 'LOCALVERSION'),
@@ -186,12 +229,15 @@
             if vars.has_key(i[0]):
                 makeflags[i[1]] = vars[i[0]]
 
-    def do_flavour_makefile(self, makefile, arch, subarch, flavour, makeflags, extra):
+    def do_flavour_makefile(self, makefile, arch, featureset, flavour, makeflags, extra):
         for i in self.makefile_targets:
-            makefile.append("%s-%s-%s:: %s-%s-%s-%s" % (i, arch, subarch, i, arch, subarch, flavour))
-            makefile.append("%s-%s-%s-%s:: %s-%s-%s-%s-real" % (i, arch, subarch, flavour, i, arch, subarch, flavour))
+            target1 = "%s_%s_%s" % (i, arch, featureset)
+            target2 = "%s_%s_%s_%s" % (i, arch, featureset, flavour)
+            makefile.add(target1, [target2])
+            makefile.add(target2, ['%s_real' % target2])
+            makefile.add('%s_real' % target2)
 
-    def do_flavour_packages(self, packages, makefile, arch, subarch, flavour, vars, makeflags, extra):
+    def do_flavour_packages(self, packages, makefile, arch, featureset, flavour, vars, makeflags, extra):
         pass
 
     def process_relation(self, key, e, in_e, vars):
@@ -247,21 +293,22 @@
             return vars[match.group(1)]
         return re.sub(r'@([-_a-z]+)@', subst, s)
 
+    def write(self, packages, makefile):
+        self.write_control(packages.itervalues())
+        self.write_makefile(makefile)
+
+    def write_config(self):
+        f = file("debian/config.dump", 'w')
+        self.config.write(f)
+        f.close()
+
     def write_control(self, list):
         self.write_rfc822(file("debian/control", 'w'), list)
 
-    def write_makefile(self, out_list):
-        out = file("debian/rules.gen", 'w')
-        for item in out_list:
-            if isinstance(item, (list, tuple)):
-                out.write("%s\n" % item[0])
-                cmd_list = item[1]
-                if isinstance(cmd_list, basestring):
-                    cmd_list = cmd_list.split('\n')
-                for j in cmd_list:
-                    out.write("\t%s\n" % j)
-            else:
-                out.write("%s\n" % item)
+    def write_makefile(self, makefile):
+        f = file("debian/rules.gen", 'w')
+        makefile.write(f)
+        f.close()
 
     def write_rfc822(self, f, list):
         for entry in list:

Added: dists/sid/linux-2.6/debian/lib/python/debian_linux/patches.py
==============================================================================
--- (empty file)
+++ dists/sid/linux-2.6/debian/lib/python/debian_linux/patches.py	Mon Nov 26 20:06:56 2007
@@ -0,0 +1,179 @@
+import os, shutil
+
+class Operation(object):
+    def __init__(self, name, data):
+        self.name, self.data = name, data
+
+    def __call__(self, dir = '.', reverse = False):
+        try:
+            if not reverse:
+                self.do(dir)
+            else:
+                self.do_reverse(dir)
+            self._log(True)
+        except:
+            self._log(False)
+            raise
+
+    def _log(self, result):
+        if result:
+            s = "OK"
+        else:
+            s = "FAIL"
+        print """  (%s) %-4s %s""" % (self.operation, s, self.name)
+
+    def do(self, dir):
+        raise NotImplementedError
+
+    def do_reverse(self, dir):
+        raise NotImplementedError
+
+class OperationPatch(Operation):
+    def __init__(self, name, fp, data):
+        super(OperationPatch, self).__init__(name, data)
+        self.fp = fp
+
+    def _call(self, dir, extraargs):
+        cmdline = "cd %s; patch -p1 -f -s -t --no-backup-if-mismatch %s" % (dir, extraargs)
+        f = os.popen(cmdline, 'wb')
+        shutil.copyfileobj(self.fp, f)
+        if f.close():
+            raise RuntimeError("Patch failed")
+
+    def patch_push(self, dir):
+        self._call(dir, '--fuzz=1')
+
+    def patch_pop(self, dir):
+        self._call(dir, '-R')
+
+class OperationPatchPush(OperationPatch):
+    operation = '+'
+
+    do = OperationPatch.patch_push
+    do_reverse = OperationPatch.patch_pop
+
+class OperationPatchPop(OperationPatch):
+    operation = '-'
+
+    do = OperationPatch.patch_pop
+    do_reverse = OperationPatch.patch_push
+
+class SubOperation(Operation):
+    def _log(self, result):
+        if result:
+            s = "OK"
+        else:
+            s = "FAIL"
+        print """    %-10s %-4s %s""" % ('(%s)' % self.operation, s, self.name)
+
+class SubOperationFilesRemove(SubOperation):
+    operation = "remove"
+
+    def do(self, dir):
+        dir = os.path.join(dir, self.name)
+        if os.path.isdir(dir):
+            shutil.rmtree(dir)
+        else:
+            os.unlink(dir)
+
+class SubOperationFilesUnifdef(SubOperation):
+    operation = "unifdef"
+
+    def do(self, dir):
+        filename = os.path.join(dir, self.name)
+        cmdline = "unifdef %s %s" % (filename, ' '.join(self.data))
+        f = os.popen(cmdline, 'rb')
+        data = f.read()
+        ret = f.close()
+        if ret is None:
+            raise RuntimeError("unifdef of %s removed nothing" % self.name)
+        elif ret != 256:
+            raise RuntimeError("unifdef failed")
+        f1 = file(filename, 'wb')
+        f1.write(data)
+        f1.close()
+
+class OperationFiles(Operation):
+    operation = 'X'
+
+    suboperations = {
+        'remove': SubOperationFilesRemove,
+        'rm': SubOperationFilesRemove,
+        'unifdef': SubOperationFilesUnifdef,
+    }
+
+    def __init__(self, name, fp, data):
+        super(OperationFiles, self).__init__(name, data)
+
+        ops = []
+
+        for line in fp:
+            line = line.strip()
+            if not line or line[0] == '#':
+                continue
+
+            items = line.split()
+            operation, filename = items[:2]
+            data = items[2:]
+
+            if operation not in self.suboperations:
+                raise RuntimeError('Undefined operation "%s" in series %s' % (operation, name))
+
+            ops.append(self.suboperations[operation](filename, data))
+
+        self.ops = ops
+
+    def do(self, dir):
+        for i in self.ops:
+            i(dir = dir)
+
+class PatchSeries(list):
+    operations = {
+        '+': OperationPatchPush,
+        '-': OperationPatchPop,
+        'X': OperationFiles,
+    }
+
+    def __init__(self, name, root, fp):
+        self.name, self.root = name, root
+
+        from gzip import GzipFile
+        from bz2 import BZ2File
+
+        for line in fp:
+            line = line.strip()
+
+            if not len(line) or line[0] == '#':
+                continue
+
+            items = line.split(' ')
+            operation, filename = items[:2]
+            data = dict(i.split('=', 1) for i in items[2:])
+
+            if operation in self.operations:
+                f = os.path.join(self.root, filename)
+                for suffix, cls in (('', file), ('.bz2', BZ2File), ('.gz', GzipFile)):
+                    f1 = f + suffix
+                    if os.path.exists(f1):
+                        fp = cls(f1)
+                        break
+                else:
+                    raise RuntimeError("Can't find patch %s for series %s" % (filename, self.name))
+            else:
+                raise RuntimeError('Undefined operation "%s" in series %s' % (operation, name))
+
+            self.append(self.operations[operation](filename, fp, data))
+
+    def __call__(self, cond = bool, dir = '.', reverse = False):
+        if not reverse:
+            for i in self:
+                if cond(i):
+                    i(dir = dir, reverse = False)
+        else:
+            for i in self[::-1]:
+                if cond(i):
+                    i(dir = dir, reverse = True)
+
+    def __repr__(self):
+        return '<%s object for %s>' % (self.__class__.__name__, self.name)
+

Modified: dists/sid/linux-2.6/debian/lib/python/debian_linux/utils.py
==============================================================================
--- dists/sid/linux-2.6/debian/lib/python/debian_linux/utils.py	(original)
+++ dists/sid/linux-2.6/debian/lib/python/debian_linux/utils.py	Mon Nov 26 20:06:56 2007
@@ -1,4 +1,4 @@
-import debian, re, textwrap
+import debian, re, os, textwrap
 
 class SortedDict(dict):
     __slots__ = '_list',
@@ -32,30 +32,33 @@
             yield self[i]
 
 class Templates(dict):
-    def __init__(self, dir = "debian/templates"):
-        self.dir = dir
+    def __init__(self, dirs = ["debian/templates"]):
+        self.dirs = dirs
 
     def __getitem__(self, key):
         try:
-            return dict.__getitem__(self, key)
+            return super(Templates, self).__getitem__(key)
         except KeyError: pass
-        ret = self._read(key)
-        dict.__setitem__(self, key, ret)
-        return ret
+        value = self._read(key)
+        super(Templates, self).__setitem__(key, value)
+        return value
 
     def __setitem__(self, key, value):
         raise NotImplemented()
 
     def _read(self, name):
         prefix, id = name.split('.', 1)
-        f = file("%s/%s.in" % (self.dir, name))
 
-        if prefix == 'control':
-            return self._readControl(f)
+        for dir in self.dirs:
+            filename = "%s/%s.in" % (dir, name)
+            if os.path.exists(filename):
+                f = file(filename)
+                if prefix == 'control':
+                    return self._read_control(f)
+                return f.read()
+        raise KeyError(name)
 
-        return f.read()
-
-    def _readControl(self, f):
+    def _read_control(self, f):
         entries = []
 
         while True:

Modified: dists/sid/linux-2.6/debian/modules/gencontrol.py
==============================================================================
--- dists/sid/linux-2.6/debian/modules/gencontrol.py	(original)
+++ dists/sid/linux-2.6/debian/modules/gencontrol.py	Mon Nov 26 20:06:56 2007
@@ -1,4 +1,5 @@
-#!/usr/bin/env python2.4
+#!/usr/bin/env python
+
 import sys
 sys.path.append(sys.path[0] + "/../lib/python")
 import debian_linux.gencontrol
@@ -44,17 +45,12 @@
                 package['Architecture'] = [arch]
                 packages.append(package)
 
-        makeflags_string = ' '.join(["%s='%s'" % i for i in makeflags.iteritems()])
-
-        cmds_binary_arch = []
-        cmds_binary_arch.append(("$(MAKE) -f debian/rules.real binary-arch-flavour %s" % makeflags_string,))
-        cmds_build = []
-        cmds_build.append(("$(MAKE) -f debian/rules.real build %s" % makeflags_string,))
-        cmds_setup = []
-        cmds_setup.append(("$(MAKE) -f debian/rules.real setup-flavour %s" % makeflags_string,))
-        makefile.append(("binary-arch-%s-%s-%s-real:" % (arch, subarch, flavour), cmds_binary_arch))
-        makefile.append(("build-%s-%s-%s-real:" % (arch, subarch, flavour), cmds_build))
-        makefile.append(("setup-%s-%s-%s-real:" % (arch, subarch, flavour), cmds_setup))
+        cmds_binary_arch = ["$(MAKE) -f debian/rules.real binary-arch-flavour %s" % makeflags]
+        cmds_build = ["$(MAKE) -f debian/rules.real build %s" % makeflags]
+        cmds_setup = ["$(MAKE) -f debian/rules.real setup-flavour %s" % makeflags]
+        makefile.add('binary-arch_%s_%s_%s_real' % (arch, subarch, flavour), cmds = cmds_binary_arch)
+        makefile.add('build_%s_%s_%s_real' % (arch, subarch, flavour), cmds = cmds_build)
+        makefile.add('setup_%s_%s_%s_real' % (arch, subarch, flavour), cmds = cmds_setup)
 
     def process_config_version(self, config):
         entry = config['version',]

Modified: dists/sid/linux-2.6/debian/modules/rules.include
==============================================================================
--- dists/sid/linux-2.6/debian/modules/rules.include	(original)
+++ dists/sid/linux-2.6/debian/modules/rules.include	Mon Nov 26 20:06:56 2007
@@ -12,7 +12,7 @@
 build: debian/control $(BUILD_STAMP)
 $(BUILD_STAMP): $(BUILD_DIR) $(STAMPS_DIR)
 	dh_testdir
-	$(MAKE) -f debian/rules.gen build-$(DEB_HOST_ARCH)
+	$(MAKE) -f debian/rules.gen build_$(DEB_HOST_ARCH)
 	touch $@
 
 $(BUILD_DIR) $(STAMPS_DIR):
@@ -29,7 +29,7 @@
 
 binary-arch:
 	dh_testdir
-	$(MAKE) -f debian/rules.gen binary-arch-$(DEB_HOST_ARCH)
+	$(MAKE) -f debian/rules.gen binary-arch_$(DEB_HOST_ARCH)
 
 binary:	binary-indep binary-arch
 
@@ -37,19 +37,15 @@
 CONTROL_FILES += $(wildcard debian/arch/defines) $(wildcard debian/arch/*/defines) $(wildcard debian/arch/*/*/defines)
 GENCONTROL = $(__MODULES_DIR)gencontrol.py
 debian/control debian/rules.gen: $(CONTROL_FILES)
-	if [ -f debian/control ] && [ -f debian/control.md5sum ] && [ -f debian/rules.gen ]; then \
-		if [ "$(__BINNMU)" ]; then \
-			if ! grep -v debian/changelog debian/control.md5sum | md5sum --check - --status; then \
-				$(MAKE) -f debian/rules debian/control-real; \
-			fi \
-		else \
-			if ! md5sum --check debian/control.md5sum --status; then \
-				$(MAKE) -f debian/rules debian/control-real; \
-			fi \
-		fi \
-	else \
-		$(MAKE) -f debian/rules debian/control-real; \
-	fi
+ifeq ($(wildcard debian/control.md5sum),)
+	$(MAKE) -f debian/rules debian/control-real
+else ifeq ($(__BINNMU),)
+	md5sum --check debian/control.md5sum --status || \
+		$(MAKE) -f debian/rules debian/control-real
+else
+	grep -v debian/changelog debian/control.md5sum | md5sum --check - --status || \
+		$(MAKE) -f debian/rules debian/control-real
+endif
 
 debian/control-real: $(CONTROL_FILES)
 	$(GENCONTROL) $(__MODULES_DIR)..

Added: dists/sid/linux-2.6/debian/patches/bugfix/all/2.6.23.1
==============================================================================
--- (empty file)
+++ dists/sid/linux-2.6/debian/patches/bugfix/all/2.6.23.1	Mon Nov 26 20:06:56 2007
@@ -0,0 +1,95 @@
+diff --git a/drivers/ata/sata_mv.c b/drivers/ata/sata_mv.c
+index cb7dec9..d9832e2 100644
+--- a/drivers/ata/sata_mv.c
++++ b/drivers/ata/sata_mv.c
+@@ -69,10 +69,11 @@
+ #include <linux/device.h>
+ #include <scsi/scsi_host.h>
+ #include <scsi/scsi_cmnd.h>
++#include <scsi/scsi_device.h>
+ #include <linux/libata.h>
+ 
+ #define DRV_NAME	"sata_mv"
+-#define DRV_VERSION	"1.0"
++#define DRV_VERSION	"1.01"
+ 
+ enum {
+ 	/* BAR's are enumerated in terms of pci_resource_start() terms */
+@@ -420,6 +421,7 @@ static void mv_error_handler(struct ata_port *ap);
+ static void mv_post_int_cmd(struct ata_queued_cmd *qc);
+ static void mv_eh_freeze(struct ata_port *ap);
+ static void mv_eh_thaw(struct ata_port *ap);
++static int mv_slave_config(struct scsi_device *sdev);
+ static int mv_init_one(struct pci_dev *pdev, const struct pci_device_id *ent);
+ 
+ static void mv5_phy_errata(struct mv_host_priv *hpriv, void __iomem *mmio,
+@@ -457,7 +459,7 @@ static struct scsi_host_template mv5_sht = {
+ 	.use_clustering		= 1,
+ 	.proc_name		= DRV_NAME,
+ 	.dma_boundary		= MV_DMA_BOUNDARY,
+-	.slave_configure	= ata_scsi_slave_config,
++	.slave_configure	= mv_slave_config,
+ 	.slave_destroy		= ata_scsi_slave_destroy,
+ 	.bios_param		= ata_std_bios_param,
+ };
+@@ -475,7 +477,7 @@ static struct scsi_host_template mv6_sht = {
+ 	.use_clustering		= 1,
+ 	.proc_name		= DRV_NAME,
+ 	.dma_boundary		= MV_DMA_BOUNDARY,
+-	.slave_configure	= ata_scsi_slave_config,
++	.slave_configure	= mv_slave_config,
+ 	.slave_destroy		= ata_scsi_slave_destroy,
+ 	.bios_param		= ata_std_bios_param,
+ };
+@@ -763,6 +765,17 @@ static void mv_irq_clear(struct ata_port *ap)
+ {
+ }
+ 
++static int mv_slave_config(struct scsi_device *sdev)
++{
++	int rc = ata_scsi_slave_config(sdev);
++	if (rc)
++		return rc;
++
++	blk_queue_max_phys_segments(sdev->request_queue, MV_MAX_SG_CT / 2);
++
++	return 0;	/* scsi layer doesn't check return value, sigh */
++}
++
+ static void mv_set_edma_ptrs(void __iomem *port_mmio,
+ 			     struct mv_host_priv *hpriv,
+ 			     struct mv_port_priv *pp)
+@@ -1130,10 +1143,9 @@ static void mv_port_stop(struct ata_port *ap)
+  *      LOCKING:
+  *      Inherited from caller.
+  */
+-static unsigned int mv_fill_sg(struct ata_queued_cmd *qc)
++static void mv_fill_sg(struct ata_queued_cmd *qc)
+ {
+ 	struct mv_port_priv *pp = qc->ap->private_data;
+-	unsigned int n_sg = 0;
+ 	struct scatterlist *sg;
+ 	struct mv_sg *mv_sg;
+ 
+@@ -1151,7 +1163,7 @@ static unsigned int mv_fill_sg(struct ata_queued_cmd *qc)
+ 
+ 			mv_sg->addr = cpu_to_le32(addr & 0xffffffff);
+ 			mv_sg->addr_hi = cpu_to_le32((addr >> 16) >> 16);
+-			mv_sg->flags_size = cpu_to_le32(len);
++			mv_sg->flags_size = cpu_to_le32(len & 0xffff);
+ 
+ 			sg_len -= len;
+ 			addr += len;
+@@ -1160,12 +1172,9 @@ static unsigned int mv_fill_sg(struct ata_queued_cmd *qc)
+ 				mv_sg->flags_size |= cpu_to_le32(EPRD_FLAG_END_OF_TBL);
+ 
+ 			mv_sg++;
+-			n_sg++;
+ 		}
+ 
+ 	}
+-
+-	return n_sg;
+ }
+ 
+ static inline void mv_crqb_pack_cmd(__le16 *cmdw, u8 data, u8 addr, unsigned last)

Added: dists/sid/linux-2.6/debian/patches/bugfix/all/git-ieee1394.patch
==============================================================================
--- (empty file)
+++ dists/sid/linux-2.6/debian/patches/bugfix/all/git-ieee1394.patch	Mon Nov 26 20:06:56 2007
@@ -0,0 +1,2021 @@
+GIT 1e56c106f0879872f6f2426b533ca5bfb712bb5b git+ssh://master.kernel.org/pub/scm/linux/kernel/git/ieee1394/linux1394-2.6.git
+
+commit 1e56c106f0879872f6f2426b533ca5bfb712bb5b
+Author: Stefan Richter <stefanr at s5r6.in-berlin.de>
+Date:   Mon Aug 20 21:58:30 2007 +0200
+
+    firewire: fw-ohci: log posted write errors
+    
+    Signed-off-by: Stefan Richter <stefanr at s5r6.in-berlin.de>
+
+commit 95ea4f3877086febb49111950c88c0346debf21d
+Author: Stefan Richter <stefanr at s5r6.in-berlin.de>
+Date:   Mon Aug 20 21:41:22 2007 +0200
+
+    firewire: fw-ohci: reorder includes
+    
+    Signed-off-by: Stefan Richter <stefanr at s5r6.in-berlin.de>
+
+commit 48b797fa451d57b34270a0a8b839ad6fc1e42840
+Author: Stefan Richter <stefanr at s5r6.in-berlin.de>
+Date:   Mon Aug 20 21:40:30 2007 +0200
+
+    firewire: fw-ohci: fix includes
+    
+    Add used includes, remove unused includes.
+    
+    Signed-off-by: Stefan Richter <stefanr at s5r6.in-berlin.de>
+
+commit ff8a2c410630d25bbc53ae82f76001993a6af023
+Author: Stefan Richter <stefanr at s5r6.in-berlin.de>
+Date:   Sat Aug 25 14:08:19 2007 +0200
+
+    firewire: fw-ohci: enforce read order for selfID generation
+    
+    It seems unlikely, but access to self_id_cpu[0] could at least in theory
+    be deferred until after the loop over self_id_cpu[1..n] or even after
+    the subsequent reg_read.  Enforce the desired order by a read barrier.
+    
+    Also prevent the reg_read from being reordered relative to the for loop.
+    This isn't necessary if the loop's conditional printk counts as an
+    implicit barrier, but better make it explicit.
+    
+    (self_id_cpu[] is a coherent DMA buffer.)
+    
+    Signed-off-by: Stefan Richter <stefanr at s5r6.in-berlin.de>
+
+commit 6c314f0edf49fece250382e2220e65960b5bbe21
+Author: Stefan Richter <stefanr at s5r6.in-berlin.de>
+Date:   Sun Aug 12 12:51:18 2007 +0200
+
+    firewire: fw-sbp2: use an own workqueue (fix system responsiveness)
+    
+    Firewire-sbp2 did very uncooperative things in the kernel's shared
+    workqueue:  Sleeping until reception of management status from the
+    target for up to 2 seconds, and performing SCSI inquiry and all of the
+    setup of SCSI command set drivers via scsi_add_device.  If there were
+    transient or permanent error conditions, this caused long blockage of
+    the kernel's events process, noticeable e.g. by blocked keyboard input.
+    
+    We now allocate a workqueue process exclusive to fw-sbp2.  As a side
+    effect, this also increases parallelism of fw-sbp2's login and reconnect
+    work versus fw-core's device discovery and device update work which is
+    performed in the shared workqueue.
+    
+    Signed-off-by: Stefan Richter <stefanr at s5r6.in-berlin.de>
+    Signed-off-by: Kristian Høgsberg <krh at redhat.com>
+
+commit 3f9d5a5152a1561c2fb80445227374c07dbce842
+Author: Stefan Richter <stefanr at s5r6.in-berlin.de>
+Date:   Mon Aug 13 17:48:25 2007 +0200
+
+    firewire: fw-sbp2: expose module parameter for workarounds
+    
+    On rare occasions, the ability to set one of the workaround flags at
+    runtime may save the day.
+    
+    People who experience I/O errors with firewire-sbp2 while the old sbp2
+    driver worked for them should try workarounds=1 and report to the devel
+    mailinglist whether that improves things.  Firewire-sbp2 defaults to the
+    SCSI stack's maximum transfer size per command, while sbp2 limits them
+    to 128 kBytes.  Flag 1 accomplishes just that.
+    
+    Signed-off-by: Stefan Richter <stefanr at s5r6.in-berlin.de>
+
+commit 07fcbcaf01d69a8ce20e6b9722a72f0943bca9d3
+Author: Stefan Richter <stefanr at s5r6.in-berlin.de>
+Date:   Sat Aug 25 14:05:28 2007 +0200
+
+    firewire: fw-sbp2: add support for multiple logical units per target
+    
+    Fixes "New firewire stack only recognizing half of a chain of drives",
+    https://bugzilla.redhat.com/bugzilla/show_bug.cgi?id=242254
+    
+    Signed-off-by: Stefan Richter <stefanr at s5r6.in-berlin.de>
+
+commit ec8d5dc0e1967445964298c07612215c9b1ddd6e
+Author: Stefan Richter <stefanr at s5r6.in-berlin.de>
+Date:   Sat Aug 25 10:40:42 2007 +0200
+
+    firewire: fw-sbp2: always enable IRQs before calling command ORB callback
+    
+    On IOMMU-less noncoherent architectures, orb->callback will memcpy the
+    whole SCSI command buffer for READ-like SCSI commands.  It is therefore
+    friendlier to enable IRQs before the call, like before patch "Add
+    ref-counting for sbp2 orbs".
+    
+    Signed-off-by: Stefan Richter <stefanr at s5r6.in-berlin.de>
+
+commit ba57dc0ea32c276cd07c83993b99546be862c699
+Author: Stefan Richter <stefanr at s5r6.in-berlin.de>
+Date:   Fri Aug 3 20:56:31 2007 +0200
+
+    firewire: fw-core: local variable shadows a global one
+    
+    Sparse warned about it although it was apparently harmless:
+    
+    drivers/firewire/fw-cdev.c:624:23: warning: symbol 'interrupt' shadows an earlier one
+    include/asm/hw_irq.h:29:13: originally declared here
+    
+    Signed-off-by: Stefan Richter <stefanr at s5r6.in-berlin.de>
+
+commit c5cf4a73611a91c91f0761596d19a37d772d2182
+Author: Stefan Richter <stefanr at s5r6.in-berlin.de>
+Date:   Tue Jul 17 02:10:16 2007 +0200
+
+    firewire: optimize fw_core_add_address_handler
+    
+    Potentially avoids unnecessary loop runs.
+    Guarantee quadlet-aligned starts of address regions.
+    Document the return values.
+    
+    Signed-off-by: Stefan Richter <stefanr at s5r6.in-berlin.de>
+
+commit 3743cc44c82342e744aa564f27c3e1fdd74ba3d0
+Author: Kristian Høgsberg <krh at redhat.com>
+Date:   Tue Jun 5 19:27:05 2007 -0400
+
+    firewire: Fix pci resume to not pass in a __be32 config rom.
+    
+    The ohci_enable() function shared between pci_probe and pci_resume
+    takes a host endian config rom, but ohci->config_rom is __be32.  This
+    sets up the config rom in the wrong endian on little endian machine,
+    specifically, BusOptions will be initialized to a 0 max receive size.
+    
+    This patch changes the way we reuse the config rom so that we avoid
+    this problem.
+    
+    Signed-off-by: Kristian Hoegsberg <krh at redhat.com>
+    Signed-off-by: Stefan Richter <stefanr at s5r6.in-berlin.de>
+
+commit 6dc2aad465cc074bbe68e2e84b89a22428dc80c3
+Author: Satyam Sharma <satyam at infradead.org>
+Date:   Wed Aug 15 20:05:38 2007 +0530
+
+    ieee1394: Fix kthread stopping in nodemgr_host_thread
+    
+    The nodemgr host thread can exit on its own even when kthread_should_stop
+    is not true, on receiving a signal (might never happen in practice, as
+    it ignores signals). But considering kthread_stop() must not be mixed with
+    kthreads that can exit on their own, I think changing the code like this
+    is clearer. This change means the thread can cut its sleep short when
+    receive a signal but looking at the code around, that sounds okay (and
+    again, it might never actually recieve a signal in practice).
+    
+    Signed-off-by: Satyam Sharma <satyam at infradead.org>
+    Signed-off-by: Stefan Richter <stefanr at s5r6.in-berlin.de>
+
+commit 20b5cd8637514b6f5b4961a4360013ad519432eb
+Author: Stefan Richter <stefanr at s5r6.in-berlin.de>
+Date:   Sat Aug 11 11:52:08 2007 +0200
+
+    ieee1394: sbp2: fix unsafe iteration over list of devices
+    
+    sbp2_host_reset and sbp2_handle_status_write are not serialized against
+    sbp2_alloc_device and sbp2_remove_device.
+    
+    Signed-off-by: Stefan Richter <stefanr at s5r6.in-berlin.de>
+
+commit bca76d2f599125f169375e4a7300e8c22532f75a
+Author: Stefan Richter <stefanr at s5r6.in-berlin.de>
+Date:   Sun Jul 29 00:01:35 2007 +0200
+
+    ieee1394: pcilynx: superfluous local variables
+    
+    Signed-off-by: Stefan Richter <stefanr at s5r6.in-berlin.de>
+
+commit b8ebfcfe1499644b7bd0144ddb4c3ef5362f617c
+Author: Stefan Richter <stefanr at s5r6.in-berlin.de>
+Date:   Sat Jul 28 23:45:03 2007 +0200
+
+    ieee1394: eth1394: fix lock imbalance
+    
+    bad_proto can be reached from points which did not take priv->lock.
+    
+    Signed-off-by: Stefan Richter <stefanr at s5r6.in-berlin.de>
+
+commit 2f2bda15d415132132517e242442367b33ca0890
+Author: Stefan Richter <stefanr at s5r6.in-berlin.de>
+Date:   Sat Jul 28 23:44:25 2007 +0200
+
+    ieee1394: eth1394: superfluous local variable
+    
+    Signed-off-by: Stefan Richter <stefanr at s5r6.in-berlin.de>
+
+commit 5ac0464c61124914166e260404f1b9b98f5decb7
+Author: Stefan Richter <stefanr at s5r6.in-berlin.de>
+Date:   Sat Aug 25 17:27:14 2007 +0200
+
+    roll back to origin
+
+commit 6ed8a4627fbbc94d8176d31470054a566b43c4d0
+Author: Satyam Sharma <satyam at infradead.org>
+Date:   Wed Aug 15 20:05:38 2007 +0530
+
+    ieee1394: Fix kthread stopping in nodemgr_host_thread
+    
+    The nodemgr host thread can exit on its own even when kthread_should_stop
+    is not true, on receiving a signal (might never happen in practice, as
+    it ignores signals). But considering kthread_stop() must not be mixed with
+    kthreads that can exit on their own, I think changing the code like this
+    is clearer. This change means the thread can cut its sleep short when
+    receive a signal but looking at the code around, that sounds okay (and
+    again, it might never actually recieve a signal in practice).
+    
+    Signed-off-by: Satyam Sharma <satyam at infradead.org>
+    Signed-off-by: Stefan Richter <stefanr at s5r6.in-berlin.de>
+
+commit 585e9c455ac48003d932c2ed8f0c06106b8ee123
+Author: Stefan Richter <stefanr at s5r6.in-berlin.de>
+Date:   Wed Aug 15 21:44:51 2007 +0200
+
+    firewire: fw-sbp2: expose module parameter for workarounds, amendment
+    
+    Reduce nesting depth.  Will be rolled into
+    549b7b036d091a114ccfbc5e90b39970df54b5a3 when pushed upstream.
+
+commit 98e0b80c3369bf3e415a503d0705edc5eadd4742
+Author: Stefan Richter <stefanr at s5r6.in-berlin.de>
+Date:   Sun Aug 12 12:51:18 2007 +0200
+
+    firewire: fw-sbp2: use an own workqueue (fix system responsiveness)
+    
+    Firewire-sbp2 did very uncooperative things in the kernel's shared
+    workqueue:  Sleeping until reception of management status from the
+    target for up to 2 seconds, and performing SCSI inquiry and all of the
+    setup of SCSI command set drivers via scsi_add_device.  If there were
+    transient or permanent error conditions, this caused long blockage of
+    the kernel's events process, noticeable e.g. by blocked keyboard input.
+    
+    We now allocate a workqueue process exclusive to fw-sbp2.  As a side
+    effect, this also increases parallelism of fw-sbp2's login and reconnect
+    work versus fw-core's device discovery and device update work which is
+    performed in the shared workqueue.
+    
+    Signed-off-by: Stefan Richter <stefanr at s5r6.in-berlin.de>
+
+commit 549b7b036d091a114ccfbc5e90b39970df54b5a3
+Author: Stefan Richter <stefanr at s5r6.in-berlin.de>
+Date:   Sun Aug 12 12:51:18 2007 +0200
+
+    firewire: fw-sbp2: expose module parameter for workarounds
+    
+    On rare occasions, the ability to set one of the workaround flags at
+    runtime may save the day.
+    
+    People who experience I/O errors with firewire-sbp2 while the old sbp2
+    driver worked for them should try workarounds=1 and report to the devel
+    mailinglist whether that improves things.  Firewire-sbp2 defaults to the
+    SCSI stack's maximum transfer size per command, while sbp2 limits them
+    to 128 kBytes.  Flag 1 accomplishes just that.
+    
+    Signed-off-by: Stefan Richter <stefanr at s5r6.in-berlin.de>
+
+commit b911abe15da18ba4fe4a40239dadd2dcf9dcf705
+Author: Stefan Richter <stefanr at s5r6.in-berlin.de>
+Date:   Sat Aug 11 11:52:08 2007 +0200
+
+    ieee1394: sbp2: fix unsafe iteration over list of devices
+    
+    sbp2_host_reset and sbp2_handle_status_write are not serialized against
+    sbp2_alloc_device and sbp2_remove_device.
+    
+    Signed-off-by: Stefan Richter <stefanr at s5r6.in-berlin.de>
+
+commit 3cdafc2494f6d07a974c6566d7a0c34fdb6027a8
+Author: Stefan Richter <stefanr at s5r6.in-berlin.de>
+Date:   Sat Aug 11 11:51:16 2007 +0200
+
+    ieee1394: sbp2: fix sbp2_remove_device for error cases
+    
+    Bug found by Olaf Hering <olh at suse.de>:
+    sbp2util_remove_command_orb_pool requires a valid lu->hi pointer.
+    
+    Signed-off-by: Stefan Richter <stefanr at s5r6.in-berlin.de>
+
+commit ce72b81c6049f0969832ff3f604f12ddd9d68cd4
+Author: Stefan Richter <stefanr at s5r6.in-berlin.de>
+Date:   Sun Aug 12 13:20:25 2007 +0200
+
+    firewire: fw-sbp2: add support for multiple logical units per target, amendment
+    
+    Keep printing firmware_revision in dmesg, rather than
+    firmware_revision & 0xffffff00.
+    
+    Will be rolled into the previous commit when pushed upstream.
+    
+    Signed-off-by: Stefan Richter <stefanr at s5r6.in-berlin.de>
+
+commit 9166079a38d292f45ba59fe293c1ffaf11d0d56f
+Author: Stefan Richter <stefanr at s5r6.in-berlin.de>
+Date:   Sat Aug 4 15:54:58 2007 +0200
+
+    firewire: fw-sbp2: add support for multiple logical units per target
+    
+    Fixes "New firewire stack only recognizing half of a chain of drives",
+    https://bugzilla.redhat.com/bugzilla/show_bug.cgi?id=242254
+    
+    Signed-off-by: Stefan Richter <stefanr at s5r6.in-berlin.de>
+
+commit 24f667e69f9493bfc09398d9149d998cf329afe9
+Author: Stefan Richter <stefanr at s5r6.in-berlin.de>
+Date:   Tue Jul 17 02:10:16 2007 +0200
+
+    firewire: optimize fw_core_add_address_handler
+    
+    Potentially avoids unnecessary loop runs.
+    Guarantee quadlet-aligned starts of address regions.
+    Document the return values.
+    
+    Signed-off-by: Stefan Richter <stefanr at s5r6.in-berlin.de>
+
+commit 12a2f56154610b63d06fe902db0783ceb44bcc4e
+Author: Kristian Høgsberg <krh at redhat.com>
+Date:   Tue Jun 5 19:27:05 2007 -0400
+
+    firewire: Fix pci resume to not pass in a __be32 config rom.
+    
+    The ohci_enable() function shared between pci_probe and pci_resume
+    takes a host endian config rom, but ohci->config_rom is __be32.  This
+    sets up the config rom in the wrong endian on little endian machine,
+    specifically, BusOptions will be initialized to a 0 max receive size.
+    
+    This patch changes the way we reuse the config rom so that we avoid
+    this problem.
+    
+    Signed-off-by: Kristian Hoegsberg <krh at redhat.com>
+    Signed-off-by: Stefan Richter <stefanr at s5r6.in-berlin.de>
+
+commit bad1bfb50d0f13d1f07f9973517a898a5e192e3d
+Author: Stefan Richter <stefanr at s5r6.in-berlin.de>
+Date:   Fri Aug 3 20:56:31 2007 +0200
+
+    firewire: fw-core: local variable shadows a global one
+    
+    Sparse warned about it although it was apparently harmless:
+    
+    drivers/firewire/fw-cdev.c:624:23: warning: symbol 'interrupt' shadows an earlier one
+    include/asm/hw_irq.h:29:13: originally declared here
+    
+    Signed-off-by: Stefan Richter <stefanr at s5r6.in-berlin.de>
+
+commit da9f857d30b890ff9d22bab72baf653d4875236f
+Author: Stefan Richter <stefanr at s5r6.in-berlin.de>
+Date:   Sat Aug 4 19:07:42 2007 +0200
+
+    roll back last firewire commits
+
+commit 619111d849ac2ef32123f71eb9af71b39a465c9a
+Author: Stefan Richter <stefanr at s5r6.in-berlin.de>
+Date:   Thu Aug 2 20:13:13 2007 +0200
+
+    Revert "firewire: fw-core: shrink the init function"
+    
+    This reverts commit a2354f71f88568c2fb295664c6a80d89b93324bb.
+
+commit 6ad42edd81e948e2f3278d0d3e5f4a36f83eca3c
+Author: Stefan Richter <stefanr at s5r6.in-berlin.de>
+Date:   Wed Aug 1 20:30:36 2007 +0200
+
+    ieee1394: revert "sbp2: enforce 32bit DMA mapping"
+    
+    Revert commit 0555659d63c285ceb7ead3115532e1b71b0f27a7 from 2.6.22-rc1.
+    The dma_set_mask call somehow failed on a PowerMac G5, PPC64:
+    http://lkml.org/lkml/2007/8/1/344
+    
+    Should there ever occur a DMA mapping beyond the physical DMA range, a
+    proper SBP-2 firmware will report transport errors.  So let's leave it
+    at that.
+    
+    Signed-off-by: Stefan Richter <stefanr at s5r6.in-berlin.de>
+    Tested-by: Olaf Hering <olh at suse.de>
+
+commit a3d08165feaefb8bd5b294d5f464e30b904566a0
+Author: Stefan Richter <stefanr at s5r6.in-berlin.de>
+Date:   Sun Jul 29 00:01:35 2007 +0200
+
+    ieee1394: pcilynx: superfluous local variables
+    
+    Signed-off-by: Stefan Richter <stefanr at s5r6.in-berlin.de>
+
+commit 05495f9042c5aeed5d17f29531bc637e75c399f0
+Author: Stefan Richter <stefanr at s5r6.in-berlin.de>
+Date:   Sat Jul 28 23:45:03 2007 +0200
+
+    ieee1394: eth1394: fix lock imbalance
+    
+    bad_proto can be reached from points which did not take priv->lock.
+    
+    Signed-off-by: Stefan Richter <stefanr at s5r6.in-berlin.de>
+
+commit 9fc5fd1a634bf3ddb2bfc077b341d044e2b666de
+Author: Stefan Richter <stefanr at s5r6.in-berlin.de>
+Date:   Sat Jul 28 23:44:25 2007 +0200
+
+    ieee1394: eth1394: superfluous local variable
+    
+    Signed-off-by: Stefan Richter <stefanr at s5r6.in-berlin.de>
+
+commit a2354f71f88568c2fb295664c6a80d89b93324bb
+Author: Stefan Richter <stefanr at s5r6.in-berlin.de>
+Date:   Sun Jul 29 20:40:04 2007 +0200
+
+    firewire: fw-core: shrink the init function
+    
+    by 208 bytes on x86-64, 112 bytes on i586.
+    
+    Signed-off-by: Stefan Richter <stefanr at s5r6.in-berlin.de>
+
+commit 52c32d15ad031b8a3d8e5e119792609a6721d47d
+Author: Stefan Richter <stefanr at s5r6.in-berlin.de>
+Date:   Sun Jul 29 20:40:04 2007 +0200
+
+    firewire: fw-core: make two variables static
+    
+    Signed-off-by: Stefan Richter <stefanr at s5r6.in-berlin.de>
+
+commit ab0f04efa6fa31b485424e28a3661ce764194367
+Author: Stefan Richter <stefanr at s5r6.in-berlin.de>
+Date:   Thu Jul 26 01:43:40 2007 +0200
+
+    firewire: fw-sbp2: remove some log messages
+    
+    Signed-off-by: Stefan Richter <stefanr at s5r6.in-berlin.de>
+
+commit ed6a36016077d831b92f8a775f340a96aa4960f5
+Author: Stefan Richter <stefanr at s5r6.in-berlin.de>
+Date:   Sun Jul 29 19:40:07 2007 +0200
+
+    firewire: fw-sbp2: add support for multiple logical units per target
+    
+    This makes multiple logical units on a single target accessible to
+    fw-sbp2.  Successfully tested with the IOI FWB-IDE01AB dual LU bridge.
+    
+    Signed-off-by: Stefan Richter <stefanr at s5r6.in-berlin.de>
+
+commit a8b974f5e01aba031a767a28616d439bb5be94cd
+Author: Stefan Richter <stefanr at s5r6.in-berlin.de>
+Date:   Sun Jul 29 03:04:15 2007 +0200
+
+    firewire: fw-sbp2: split logical unit data from target data
+    
+    struct sbp2_device is replaced by struct sbp2_target and struct
+    sbp2_logical_unit.  This prepares support of multiple logical units per
+    target.
+    
+    Signed-off-by: Stefan Richter <stefanr at s5r6.in-berlin.de>
+
+commit a2fb3f0b42e9d0012fe0036b8f8d4371ba4b858b
+Author: Stefan Richter <stefanr at s5r6.in-berlin.de>
+Date:   Sun Jul 29 03:03:07 2007 +0200
+
+    firewire: fw-sbp2: use one Scsi_Host for all targets
+    
+    This rework prepares support of multiple logical units per target.
+    Instead of one instance of struct Scsi_Host per target, only one
+    Scsi_Host global to fw-sbp2 is now used.  We could also use one
+    Scsi_Host per FireWire host, but that would add more overhead for no
+    real benefit.
+    
+    The following user-visible changes result:
+    
+      - The generic device of the Scsi_Host is registered as a platform
+        device.  Hence it and the target devices and logical unit devices
+        will be sitting below /sys/devices/platform/host*/ rather than
+        within the PCI devices tree.
+    
+      - In the SCSI stack's H:C:T:L tuple, the H is now constant for all
+        fw-sbp2 devices but the T is unique.  We currently allocate T as
+        stupidly as the H was allocated before:  It is simply increased
+        whenever a target is added.
+    
+    Neither of these changes should affect userspace, because none of the
+    mentioned device properties have been of any interest to userspace
+    before.
+    
+    Signed-off-by: Stefan Richter <stefanr at s5r6.in-berlin.de>
+
+commit 1fbbb13a05fdc8cf8e778aa834d2e31e68193ee4
+Author: Stefan Richter <stefanr at s5r6.in-berlin.de>
+Date:   Thu Jul 26 01:38:39 2007 +0200
+
+    firewire: remove unused macros
+    
+    Signed-off-by: Stefan Richter <stefanr at s5r6.in-berlin.de>
+
+commit d9b6313c4d390dc6f4388c07d40ce0d606258458
+Author: Stefan Richter <stefanr at s5r6.in-berlin.de>
+Date:   Sun Jul 29 01:50:37 2007 +0200
+
+    firewire: fw-sbp2: sanitize list handling
+    
+      - The ORB list iteration unsafely removed list items under itself.
+    
+      - The "ORB found" logic relied on implementation details of
+        list_for_each_entry and was unreadable.
+    
+    Signed-off-by: Stefan Richter <stefanr at s5r6.in-berlin.de>
+
+commit 644f24f97935b8de286eb6f6e6a2e67251958ce0
+Author: Stefan Richter <stefanr at s5r6.in-berlin.de>
+Date:   Wed Jul 25 19:18:08 2007 +0200
+
+    firewire: fw-ohci: dma_free_coherent needs IRQs enabled
+    
+    Signed-off-by: Stefan Richter <stefanr at s5r6.in-berlin.de>
+
+commit 5b402b97b6f98823f5950ca61d850f552ff042c9
+Author: Stefan Richter <stefanr at s5r6.in-berlin.de>
+Date:   Sat Jul 21 22:43:05 2007 +0200
+
+    firewire: fw-sbp2: set correct maximum payload (fixes CardBus adapters)
+    
+    As far as I know, all CardBus FireWire 400 adapters have a maximum
+    payload of 1024 bytes which is less than the speed-dependent limit of
+    2048 bytes.  Fw-sbp2 has to take the host adapter's limit into account.
+    
+    This apparently fixes Juju's incompatibility with my CardBus cards, a
+    NEC based card and a VIA based card.
+    
+    Signed-off-by: Stefan Richter <stefanr at s5r6.in-berlin.de>
+
+commit 4e7210a2d7eac65134bcb340bd3814e5adba2c1d
+Author: Stefan Richter <stefanr at s5r6.in-berlin.de>
+Date:   Sat Jul 21 17:51:22 2007 +0200
+
+    ieee1394: sbp2: more correct Kconfig dependencies
+    
+    Make the option SBP2_PHYS_DMA available on all architectures where it
+    compiles.  This includes x86-64 where I runtime-tested it successfully.
+    
+    Signed-off-by: Stefan Richter <stefanr at s5r6.in-berlin.de>
+
+commit 62d8f1e2e8efadb6d8f7d9c802adebef98c0081e
+Author: Stefan Richter <stefanr at s5r6.in-berlin.de>
+Date:   Tue Jul 17 02:10:16 2007 +0200
+
+    firewire: optimize fw_core_add_address_handler
+    
+    Potentially avoids unnecessary loop runs.
+    Guarantee quadlet-aligned starts of address regions.
+    Document the return values.
+    
+    Signed-off-by: Stefan Richter <stefanr at s5r6.in-berlin.de>
+
+commit ccfab837384b2f125a2d1c179caf70032cbaecc8
+Author: Kristian Høgsberg <krh at redhat.com>
+Date:   Tue Jun 5 19:27:05 2007 -0400
+
+    firewire: Fix pci resume to not pass in a __be32 config rom.
+    
+    The ohci_enable() function shared between pci_probe and pci_resume
+    takes a host endian config rom, but ohci->config_rom is __be32.  This
+    sets up the config rom in the wrong endian on little endian machine,
+    specifically, BusOptions will be initialized to a 0 max receive size.
+    
+    This patch changes the way we reuse the config rom so that we avoid
+    this problem.
+    
+    Signed-off-by: Kristian Hoegsberg <krh at redhat.com>
+    Signed-off-by: Stefan Richter <stefanr at s5r6.in-berlin.de>
+Signed-off-by: Andrew Morton <akpm at linux-foundation.org>
+---
+
+ drivers/firewire/fw-cdev.c        |   21 
+ drivers/firewire/fw-device.h      |    5 
+ drivers/firewire/fw-ohci.c        |   66 +-
+ drivers/firewire/fw-sbp2.c        |  655 ++++++++++++++++------------
+ drivers/firewire/fw-transaction.c |   12 
+ drivers/ieee1394/eth1394.c        |   16 
+ drivers/ieee1394/nodemgr.c        |    3 
+ drivers/ieee1394/pcilynx.c        |    3 
+ drivers/ieee1394/sbp2.c           |   15 
+ 9 files changed, 474 insertions(+), 322 deletions(-)
+
+diff -puN drivers/firewire/fw-cdev.c~git-ieee1394 drivers/firewire/fw-cdev.c
+--- a/drivers/firewire/fw-cdev.c~git-ieee1394
++++ a/drivers/firewire/fw-cdev.c
+@@ -621,20 +621,19 @@ iso_callback(struct fw_iso_context *cont
+ 	     size_t header_length, void *header, void *data)
+ {
+ 	struct client *client = data;
+-	struct iso_interrupt *interrupt;
++	struct iso_interrupt *irq;
+ 
+-	interrupt = kzalloc(sizeof(*interrupt) + header_length, GFP_ATOMIC);
+-	if (interrupt == NULL)
++	irq = kzalloc(sizeof(*irq) + header_length, GFP_ATOMIC);
++	if (irq == NULL)
+ 		return;
+ 
+-	interrupt->interrupt.type      = FW_CDEV_EVENT_ISO_INTERRUPT;
+-	interrupt->interrupt.closure   = client->iso_closure;
+-	interrupt->interrupt.cycle     = cycle;
+-	interrupt->interrupt.header_length = header_length;
+-	memcpy(interrupt->interrupt.header, header, header_length);
+-	queue_event(client, &interrupt->event,
+-		    &interrupt->interrupt,
+-		    sizeof(interrupt->interrupt) + header_length, NULL, 0);
++	irq->interrupt.type      = FW_CDEV_EVENT_ISO_INTERRUPT;
++	irq->interrupt.closure   = client->iso_closure;
++	irq->interrupt.cycle     = cycle;
++	irq->interrupt.header_length = header_length;
++	memcpy(irq->interrupt.header, header, header_length);
++	queue_event(client, &irq->event, &irq->interrupt,
++		    sizeof(irq->interrupt) + header_length, NULL, 0);
+ }
+ 
+ static int ioctl_create_iso_context(struct client *client, void *buffer)
+diff -puN drivers/firewire/fw-device.h~git-ieee1394 drivers/firewire/fw-device.h
+--- a/drivers/firewire/fw-device.h~git-ieee1394
++++ a/drivers/firewire/fw-device.h
+@@ -102,11 +102,6 @@ fw_unit(struct device *dev)
+ #define CSR_INSTANCE		0x18
+ #define CSR_DIRECTORY_ID	0x20
+ 
+-#define SBP2_COMMAND_SET_SPECIFIER	0x38
+-#define SBP2_COMMAND_SET		0x39
+-#define SBP2_COMMAND_SET_REVISION	0x3b
+-#define SBP2_FIRMWARE_REVISION		0x3c
+-
+ struct fw_csr_iterator {
+ 	u32 *p;
+ 	u32 *end;
+diff -puN drivers/firewire/fw-ohci.c~git-ieee1394 drivers/firewire/fw-ohci.c
+--- a/drivers/firewire/fw-ohci.c~git-ieee1394
++++ a/drivers/firewire/fw-ohci.c
+@@ -18,21 +18,23 @@
+  * Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
+  */
+ 
+-#include <linux/kernel.h>
+-#include <linux/module.h>
+-#include <linux/init.h>
+-#include <linux/interrupt.h>
+-#include <linux/pci.h>
++#include <linux/compiler.h>
+ #include <linux/delay.h>
+-#include <linux/poll.h>
+ #include <linux/dma-mapping.h>
++#include <linux/gfp.h>
++#include <linux/init.h>
++#include <linux/interrupt.h>
++#include <linux/kernel.h>
+ #include <linux/mm.h>
++#include <linux/module.h>
++#include <linux/pci.h>
++#include <linux/spinlock.h>
+ 
+-#include <asm/uaccess.h>
+-#include <asm/semaphore.h>
++#include <asm/page.h>
++#include <asm/system.h>
+ 
+-#include "fw-transaction.h"
+ #include "fw-ohci.h"
++#include "fw-transaction.h"
+ 
+ #define DESCRIPTOR_OUTPUT_MORE		0
+ #define DESCRIPTOR_OUTPUT_LAST		(1 << 12)
+@@ -926,12 +928,14 @@ static void bus_reset_tasklet(unsigned l
+ 
+ 	self_id_count = (reg_read(ohci, OHCI1394_SelfIDCount) >> 3) & 0x3ff;
+ 	generation = (le32_to_cpu(ohci->self_id_cpu[0]) >> 16) & 0xff;
++	rmb();
+ 
+ 	for (i = 1, j = 0; j < self_id_count; i += 2, j++) {
+ 		if (ohci->self_id_cpu[i] != ~ohci->self_id_cpu[i + 1])
+ 			fw_error("inconsistent self IDs\n");
+ 		ohci->self_id_buffer[j] = le32_to_cpu(ohci->self_id_cpu[i]);
+ 	}
++	rmb();
+ 
+ 	/*
+ 	 * Check the consistency of the self IDs we just read.  The
+@@ -972,8 +976,10 @@ static void bus_reset_tasklet(unsigned l
+ 	 */
+ 
+ 	if (ohci->next_config_rom != NULL) {
+-		free_rom     = ohci->config_rom;
+-		free_rom_bus = ohci->config_rom_bus;
++		if (ohci->next_config_rom != ohci->config_rom) {
++			free_rom      = ohci->config_rom;
++			free_rom_bus  = ohci->config_rom_bus;
++		}
+ 		ohci->config_rom      = ohci->next_config_rom;
+ 		ohci->config_rom_bus  = ohci->next_config_rom_bus;
+ 		ohci->next_config_rom = NULL;
+@@ -1046,6 +1052,9 @@ static irqreturn_t irq_handler(int irq, 
+ 		iso_event &= ~(1 << i);
+ 	}
+ 
++	if (unlikely(event & OHCI1394_postedWriteErr))
++		fw_error("PCI posted write error\n");
++
+ 	if (event & OHCI1394_cycle64Seconds) {
+ 		cycle_time = reg_read(ohci, OHCI1394_IsochronousCycleTimer);
+ 		if ((cycle_time & 0x80000000) == 0)
+@@ -1119,8 +1128,8 @@ static int ohci_enable(struct fw_card *c
+ 		  OHCI1394_RQPkt | OHCI1394_RSPkt |
+ 		  OHCI1394_reqTxComplete | OHCI1394_respTxComplete |
+ 		  OHCI1394_isochRx | OHCI1394_isochTx |
+-		  OHCI1394_masterIntEnable |
+-		  OHCI1394_cycle64Seconds);
++		  OHCI1394_postedWriteErr | OHCI1394_cycle64Seconds |
++		  OHCI1394_masterIntEnable);
+ 
+ 	/* Activate link_on bit and contender bit in our self ID packets.*/
+ 	if (ohci_update_phy_reg(card, 4, 0,
+@@ -1146,19 +1155,30 @@ static int ohci_enable(struct fw_card *c
+ 	 * the right values in the bus reset tasklet.
+ 	 */
+ 
+-	ohci->next_config_rom =
+-		dma_alloc_coherent(ohci->card.device, CONFIG_ROM_SIZE,
+-				   &ohci->next_config_rom_bus, GFP_KERNEL);
+-	if (ohci->next_config_rom == NULL)
+-		return -ENOMEM;
++	if (config_rom) {
++		ohci->next_config_rom =
++			dma_alloc_coherent(ohci->card.device, CONFIG_ROM_SIZE,
++					   &ohci->next_config_rom_bus,
++					   GFP_KERNEL);
++		if (ohci->next_config_rom == NULL)
++			return -ENOMEM;
+ 
+-	memset(ohci->next_config_rom, 0, CONFIG_ROM_SIZE);
+-	fw_memcpy_to_be32(ohci->next_config_rom, config_rom, length * 4);
++		memset(ohci->next_config_rom, 0, CONFIG_ROM_SIZE);
++		fw_memcpy_to_be32(ohci->next_config_rom, config_rom, length * 4);
++	} else {
++		/*
++		 * In the suspend case, config_rom is NULL, which
++		 * means that we just reuse the old config rom.
++		 */
++		ohci->next_config_rom = ohci->config_rom;
++		ohci->next_config_rom_bus = ohci->config_rom_bus;
++	}
+ 
+-	ohci->next_header = config_rom[0];
++	ohci->next_header = be32_to_cpu(ohci->next_config_rom[0]);
+ 	ohci->next_config_rom[0] = 0;
+ 	reg_write(ohci, OHCI1394_ConfigROMhdr, 0);
+-	reg_write(ohci, OHCI1394_BusOptions, config_rom[2]);
++	reg_write(ohci, OHCI1394_BusOptions,
++		  be32_to_cpu(ohci->next_config_rom[2]));
+ 	reg_write(ohci, OHCI1394_ConfigROMmap, ohci->next_config_rom_bus);
+ 
+ 	reg_write(ohci, OHCI1394_AsReqFilterHiSet, 0x80000000);
+@@ -1966,7 +1986,7 @@ static int pci_resume(struct pci_dev *pd
+ 		return err;
+ 	}
+ 
+-	return ohci_enable(&ohci->card, ohci->config_rom, CONFIG_ROM_SIZE);
++	return ohci_enable(&ohci->card, NULL, 0);
+ }
+ #endif
+ 
+diff -puN drivers/firewire/fw-sbp2.c~git-ieee1394 drivers/firewire/fw-sbp2.c
+--- a/drivers/firewire/fw-sbp2.c~git-ieee1394
++++ a/drivers/firewire/fw-sbp2.c
+@@ -37,11 +37,12 @@
+ #include <linux/dma-mapping.h>
+ #include <linux/blkdev.h>
+ #include <linux/string.h>
++#include <linux/stringify.h>
+ #include <linux/timer.h>
++#include <linux/workqueue.h>
+ 
+ #include <scsi/scsi.h>
+ #include <scsi/scsi_cmnd.h>
+-#include <scsi/scsi_dbg.h>
+ #include <scsi/scsi_device.h>
+ #include <scsi/scsi_host.h>
+ 
+@@ -61,36 +62,94 @@ module_param_named(exclusive_login, sbp2
+ MODULE_PARM_DESC(exclusive_login, "Exclusive login to sbp2 device "
+ 		 "(default = Y, use N for concurrent initiators)");
+ 
++/*
++ * Flags for firmware oddities
++ *
++ * - 128kB max transfer
++ *   Limit transfer size. Necessary for some old bridges.
++ *
++ * - 36 byte inquiry
++ *   When scsi_mod probes the device, let the inquiry command look like that
++ *   from MS Windows.
++ *
++ * - skip mode page 8
++ *   Suppress sending of mode_sense for mode page 8 if the device pretends to
++ *   support the SCSI Primary Block commands instead of Reduced Block Commands.
++ *
++ * - fix capacity
++ *   Tell sd_mod to correct the last sector number reported by read_capacity.
++ *   Avoids access beyond actual disk limits on devices with an off-by-one bug.
++ *   Don't use this with devices which don't have this bug.
++ *
++ * - override internal blacklist
++ *   Instead of adding to the built-in blacklist, use only the workarounds
++ *   specified in the module load parameter.
++ *   Useful if a blacklist entry interfered with a non-broken device.
++ */
++#define SBP2_WORKAROUND_128K_MAX_TRANS	0x1
++#define SBP2_WORKAROUND_INQUIRY_36	0x2
++#define SBP2_WORKAROUND_MODE_SENSE_8	0x4
++#define SBP2_WORKAROUND_FIX_CAPACITY	0x8
++#define SBP2_WORKAROUND_OVERRIDE	0x100
++
++static int sbp2_param_workarounds;
++module_param_named(workarounds, sbp2_param_workarounds, int, 0644);
++MODULE_PARM_DESC(workarounds, "Work around device bugs (default = 0"
++	", 128kB max transfer = " __stringify(SBP2_WORKAROUND_128K_MAX_TRANS)
++	", 36 byte inquiry = "    __stringify(SBP2_WORKAROUND_INQUIRY_36)
++	", skip mode page 8 = "   __stringify(SBP2_WORKAROUND_MODE_SENSE_8)
++	", fix capacity = "       __stringify(SBP2_WORKAROUND_FIX_CAPACITY)
++	", override internal blacklist = " __stringify(SBP2_WORKAROUND_OVERRIDE)
++	", or a combination)");
++
+ /* I don't know why the SCSI stack doesn't define something like this... */
+ typedef void (*scsi_done_fn_t)(struct scsi_cmnd *);
+ 
+ static const char sbp2_driver_name[] = "sbp2";
+ 
+-struct sbp2_device {
+-	struct kref kref;
+-	struct fw_unit *unit;
++/*
++ * We create one struct sbp2_logical_unit per SBP-2 Logical Unit Number Entry
++ * and one struct scsi_device per sbp2_logical_unit.
++ */
++struct sbp2_logical_unit {
++	struct sbp2_target *tgt;
++	struct list_head link;
++	struct scsi_device *sdev;
+ 	struct fw_address_handler address_handler;
+ 	struct list_head orb_list;
+-	u64 management_agent_address;
++
+ 	u64 command_block_agent_address;
+-	u32 workarounds;
++	u16 lun;
+ 	int login_id;
+ 
+ 	/*
+-	 * We cache these addresses and only update them once we've
+-	 * logged in or reconnected to the sbp2 device.  That way, any
+-	 * IO to the device will automatically fail and get retried if
+-	 * it happens in a window where the device is not ready to
+-	 * handle it (e.g. after a bus reset but before we reconnect).
++	 * The generation is updated once we've logged in or reconnected
++	 * to the logical unit.  Thus, I/O to the device will automatically
++	 * fail and get retried if it happens in a window where the device
++	 * is not ready, e.g. after a bus reset but before we reconnect.
+ 	 */
+-	int node_id;
+-	int address_high;
+ 	int generation;
+-
+ 	int retries;
+ 	struct delayed_work work;
+ };
+ 
++/*
++ * We create one struct sbp2_target per IEEE 1212 Unit Directory
++ * and one struct Scsi_Host per sbp2_target.
++ */
++struct sbp2_target {
++	struct kref kref;
++	struct fw_unit *unit;
++
++	u64 management_agent_address;
++	int directory_id;
++	int node_id;
++	int address_high;
++
++	unsigned workarounds;
++	struct list_head lu_list;
++};
++
+ #define SBP2_MAX_SG_ELEMENT_LENGTH	0xf000
+ #define SBP2_MAX_SECTORS		255	/* Max sectors supported */
+ #define SBP2_ORB_TIMEOUT		2000	/* Timeout in ms */
+@@ -101,17 +160,9 @@ struct sbp2_device {
+ #define SBP2_DIRECTION_FROM_MEDIA	0x1
+ 
+ /* Unit directory keys */
+-#define SBP2_COMMAND_SET_SPECIFIER	0x38
+-#define SBP2_COMMAND_SET		0x39
+-#define SBP2_COMMAND_SET_REVISION	0x3b
+-#define SBP2_FIRMWARE_REVISION		0x3c
+-
+-/* Flags for detected oddities and brokeness */
+-#define SBP2_WORKAROUND_128K_MAX_TRANS	0x1
+-#define SBP2_WORKAROUND_INQUIRY_36	0x2
+-#define SBP2_WORKAROUND_MODE_SENSE_8	0x4
+-#define SBP2_WORKAROUND_FIX_CAPACITY	0x8
+-#define SBP2_WORKAROUND_OVERRIDE	0x100
++#define SBP2_CSR_FIRMWARE_REVISION	0x3c
++#define SBP2_CSR_LOGICAL_UNIT_NUMBER	0x14
++#define SBP2_CSR_LOGICAL_UNIT_DIRECTORY	0xd4
+ 
+ /* Management orb opcodes */
+ #define SBP2_LOGIN_REQUEST		0x0
+@@ -219,7 +270,7 @@ struct sbp2_command_orb {
+ 	} request;
+ 	struct scsi_cmnd *cmd;
+ 	scsi_done_fn_t done;
+-	struct fw_unit *unit;
++	struct sbp2_logical_unit *lu;
+ 
+ 	struct sbp2_pointer page_table[SG_ALL] __attribute__((aligned(8)));
+ 	dma_addr_t page_table_bus;
+@@ -295,7 +346,7 @@ sbp2_status_write(struct fw_card *card, 
+ 		  unsigned long long offset,
+ 		  void *payload, size_t length, void *callback_data)
+ {
+-	struct sbp2_device *sd = callback_data;
++	struct sbp2_logical_unit *lu = callback_data;
+ 	struct sbp2_orb *orb;
+ 	struct sbp2_status status;
+ 	size_t header_size;
+@@ -319,7 +370,7 @@ sbp2_status_write(struct fw_card *card, 
+ 
+ 	/* Lookup the orb corresponding to this status write. */
+ 	spin_lock_irqsave(&card->lock, flags);
+-	list_for_each_entry(orb, &sd->orb_list, link) {
++	list_for_each_entry(orb, &lu->orb_list, link) {
+ 		if (STATUS_GET_ORB_HIGH(status) == 0 &&
+ 		    STATUS_GET_ORB_LOW(status) == orb->request_bus) {
+ 			orb->rcode = RCODE_COMPLETE;
+@@ -329,7 +380,7 @@ sbp2_status_write(struct fw_card *card, 
+ 	}
+ 	spin_unlock_irqrestore(&card->lock, flags);
+ 
+-	if (&orb->link != &sd->orb_list)
++	if (&orb->link != &lu->orb_list)
+ 		orb->callback(orb, &status);
+ 	else
+ 		fw_error("status write for unknown orb\n");
+@@ -361,20 +412,20 @@ complete_transaction(struct fw_card *car
+ 		orb->rcode = rcode;
+ 	if (orb->rcode != RCODE_COMPLETE) {
+ 		list_del(&orb->link);
++		spin_unlock_irqrestore(&card->lock, flags);
+ 		orb->callback(orb, NULL);
++	} else {
++		spin_unlock_irqrestore(&card->lock, flags);
+ 	}
+ 
+-	spin_unlock_irqrestore(&card->lock, flags);
+-
+ 	kref_put(&orb->kref, free_orb);
+ }
+ 
+ static void
+-sbp2_send_orb(struct sbp2_orb *orb, struct fw_unit *unit,
++sbp2_send_orb(struct sbp2_orb *orb, struct sbp2_logical_unit *lu,
+ 	      int node_id, int generation, u64 offset)
+ {
+-	struct fw_device *device = fw_device(unit->device.parent);
+-	struct sbp2_device *sd = unit->device.driver_data;
++	struct fw_device *device = fw_device(lu->tgt->unit->device.parent);
+ 	unsigned long flags;
+ 
+ 	orb->pointer.high = 0;
+@@ -382,7 +433,7 @@ sbp2_send_orb(struct sbp2_orb *orb, stru
+ 	fw_memcpy_to_be32(&orb->pointer, &orb->pointer, sizeof(orb->pointer));
+ 
+ 	spin_lock_irqsave(&device->card->lock, flags);
+-	list_add_tail(&orb->link, &sd->orb_list);
++	list_add_tail(&orb->link, &lu->orb_list);
+ 	spin_unlock_irqrestore(&device->card->lock, flags);
+ 
+ 	/* Take a ref for the orb list and for the transaction callback. */
+@@ -395,10 +446,9 @@ sbp2_send_orb(struct sbp2_orb *orb, stru
+ 			complete_transaction, orb);
+ }
+ 
+-static int sbp2_cancel_orbs(struct fw_unit *unit)
++static int sbp2_cancel_orbs(struct sbp2_logical_unit *lu)
+ {
+-	struct fw_device *device = fw_device(unit->device.parent);
+-	struct sbp2_device *sd = unit->device.driver_data;
++	struct fw_device *device = fw_device(lu->tgt->unit->device.parent);
+ 	struct sbp2_orb *orb, *next;
+ 	struct list_head list;
+ 	unsigned long flags;
+@@ -406,7 +456,7 @@ static int sbp2_cancel_orbs(struct fw_un
+ 
+ 	INIT_LIST_HEAD(&list);
+ 	spin_lock_irqsave(&device->card->lock, flags);
+-	list_splice_init(&sd->orb_list, &list);
++	list_splice_init(&lu->orb_list, &list);
+ 	spin_unlock_irqrestore(&device->card->lock, flags);
+ 
+ 	list_for_each_entry_safe(orb, next, &list, link) {
+@@ -433,11 +483,11 @@ complete_management_orb(struct sbp2_orb 
+ }
+ 
+ static int
+-sbp2_send_management_orb(struct fw_unit *unit, int node_id, int generation,
+-			 int function, int lun, void *response)
++sbp2_send_management_orb(struct sbp2_logical_unit *lu, int node_id,
++			 int generation, int function, int lun_or_login_id,
++			 void *response)
+ {
+-	struct fw_device *device = fw_device(unit->device.parent);
+-	struct sbp2_device *sd = unit->device.driver_data;
++	struct fw_device *device = fw_device(lu->tgt->unit->device.parent);
+ 	struct sbp2_management_orb *orb;
+ 	int retval = -ENOMEM;
+ 
+@@ -458,12 +508,12 @@ sbp2_send_management_orb(struct fw_unit 
+ 	orb->request.misc =
+ 		MANAGEMENT_ORB_NOTIFY |
+ 		MANAGEMENT_ORB_FUNCTION(function) |
+-		MANAGEMENT_ORB_LUN(lun);
++		MANAGEMENT_ORB_LUN(lun_or_login_id);
+ 	orb->request.length =
+ 		MANAGEMENT_ORB_RESPONSE_LENGTH(sizeof(orb->response));
+ 
+-	orb->request.status_fifo.high = sd->address_handler.offset >> 32;
+-	orb->request.status_fifo.low  = sd->address_handler.offset;
++	orb->request.status_fifo.high = lu->address_handler.offset >> 32;
++	orb->request.status_fifo.low  = lu->address_handler.offset;
+ 
+ 	if (function == SBP2_LOGIN_REQUEST) {
+ 		orb->request.misc |=
+@@ -482,14 +532,14 @@ sbp2_send_management_orb(struct fw_unit 
+ 	if (dma_mapping_error(orb->base.request_bus))
+ 		goto fail_mapping_request;
+ 
+-	sbp2_send_orb(&orb->base, unit,
+-		      node_id, generation, sd->management_agent_address);
++	sbp2_send_orb(&orb->base, lu, node_id, generation,
++		      lu->tgt->management_agent_address);
+ 
+ 	wait_for_completion_timeout(&orb->done,
+ 				    msecs_to_jiffies(SBP2_ORB_TIMEOUT));
+ 
+ 	retval = -EIO;
+-	if (sbp2_cancel_orbs(unit) == 0) {
++	if (sbp2_cancel_orbs(lu) == 0) {
+ 		fw_error("orb reply timed out, rcode=0x%02x\n",
+ 			 orb->base.rcode);
+ 		goto out;
+@@ -534,10 +584,9 @@ complete_agent_reset_write(struct fw_car
+ 	kfree(t);
+ }
+ 
+-static int sbp2_agent_reset(struct fw_unit *unit)
++static int sbp2_agent_reset(struct sbp2_logical_unit *lu)
+ {
+-	struct fw_device *device = fw_device(unit->device.parent);
+-	struct sbp2_device *sd = unit->device.driver_data;
++	struct fw_device *device = fw_device(lu->tgt->unit->device.parent);
+ 	struct fw_transaction *t;
+ 	static u32 zero;
+ 
+@@ -546,181 +595,272 @@ static int sbp2_agent_reset(struct fw_un
+ 		return -ENOMEM;
+ 
+ 	fw_send_request(device->card, t, TCODE_WRITE_QUADLET_REQUEST,
+-			sd->node_id, sd->generation, device->max_speed,
+-			sd->command_block_agent_address + SBP2_AGENT_RESET,
++			lu->tgt->node_id, lu->generation, device->max_speed,
++			lu->command_block_agent_address + SBP2_AGENT_RESET,
+ 			&zero, sizeof(zero), complete_agent_reset_write, t);
+ 
+ 	return 0;
+ }
+ 
+-static void sbp2_reconnect(struct work_struct *work);
+-static struct scsi_host_template scsi_driver_template;
+-
+-static void release_sbp2_device(struct kref *kref)
++static void sbp2_release_target(struct kref *kref)
+ {
+-	struct sbp2_device *sd = container_of(kref, struct sbp2_device, kref);
+-	struct Scsi_Host *host =
+-		container_of((void *)sd, struct Scsi_Host, hostdata[0]);
+-
+-	scsi_remove_host(host);
+-	sbp2_send_management_orb(sd->unit, sd->node_id, sd->generation,
+-				 SBP2_LOGOUT_REQUEST, sd->login_id, NULL);
+-	fw_core_remove_address_handler(&sd->address_handler);
+-	fw_notify("removed sbp2 unit %s\n", sd->unit->device.bus_id);
+-	put_device(&sd->unit->device);
+-	scsi_host_put(host);
++	struct sbp2_target *tgt = container_of(kref, struct sbp2_target, kref);
++	struct sbp2_logical_unit *lu, *next;
++	struct Scsi_Host *shost =
++		container_of((void *)tgt, struct Scsi_Host, hostdata[0]);
++
++	list_for_each_entry_safe(lu, next, &tgt->lu_list, link) {
++		if (lu->sdev)
++			scsi_remove_device(lu->sdev);
++
++		sbp2_send_management_orb(lu, tgt->node_id, lu->generation,
++				SBP2_LOGOUT_REQUEST, lu->login_id, NULL);
++		fw_core_remove_address_handler(&lu->address_handler);
++		list_del(&lu->link);
++		kfree(lu);
++	}
++	scsi_remove_host(shost);
++	fw_notify("released %s\n", tgt->unit->device.bus_id);
++
++	put_device(&tgt->unit->device);
++	scsi_host_put(shost);
+ }
+ 
++static struct workqueue_struct *sbp2_wq;
++
++static void sbp2_reconnect(struct work_struct *work);
++
+ static void sbp2_login(struct work_struct *work)
+ {
+-	struct sbp2_device *sd =
+-		container_of(work, struct sbp2_device, work.work);
+-	struct Scsi_Host *host =
+-		container_of((void *)sd, struct Scsi_Host, hostdata[0]);
+-	struct fw_unit *unit = sd->unit;
++	struct sbp2_logical_unit *lu =
++		container_of(work, struct sbp2_logical_unit, work.work);
++	struct Scsi_Host *shost =
++		container_of((void *)lu->tgt, struct Scsi_Host, hostdata[0]);
++	struct scsi_device *sdev;
++	struct scsi_lun eight_bytes_lun;
++	struct fw_unit *unit = lu->tgt->unit;
+ 	struct fw_device *device = fw_device(unit->device.parent);
+ 	struct sbp2_login_response response;
+-	int generation, node_id, local_node_id, lun, retval;
+-
+-	/* FIXME: Make this work for multi-lun devices. */
+-	lun = 0;
++	int generation, node_id, local_node_id;
+ 
+ 	generation    = device->card->generation;
+ 	node_id       = device->node->node_id;
+ 	local_node_id = device->card->local_node->node_id;
+ 
+-	if (sbp2_send_management_orb(unit, node_id, generation,
+-				     SBP2_LOGIN_REQUEST, lun, &response) < 0) {
+-		if (sd->retries++ < 5) {
+-			schedule_delayed_work(&sd->work, DIV_ROUND_UP(HZ, 5));
++	if (sbp2_send_management_orb(lu, node_id, generation,
++				SBP2_LOGIN_REQUEST, lu->lun, &response) < 0) {
++		if (lu->retries++ < 5) {
++			queue_delayed_work(sbp2_wq, &lu->work,
++					   DIV_ROUND_UP(HZ, 5));
+ 		} else {
+-			fw_error("failed to login to %s\n",
+-				 unit->device.bus_id);
+-			kref_put(&sd->kref, release_sbp2_device);
++			fw_error("failed to login to %s LUN %04x\n",
++				 unit->device.bus_id, lu->lun);
++			kref_put(&lu->tgt->kref, sbp2_release_target);
+ 		}
+ 		return;
+ 	}
+ 
+-	sd->generation   = generation;
+-	sd->node_id      = node_id;
+-	sd->address_high = local_node_id << 16;
++	lu->generation        = generation;
++	lu->tgt->node_id      = node_id;
++	lu->tgt->address_high = local_node_id << 16;
+ 
+ 	/* Get command block agent offset and login id. */
+-	sd->command_block_agent_address =
++	lu->command_block_agent_address =
+ 		((u64) (response.command_block_agent.high & 0xffff) << 32) |
+ 		response.command_block_agent.low;
+-	sd->login_id = LOGIN_RESPONSE_GET_LOGIN_ID(response);
++	lu->login_id = LOGIN_RESPONSE_GET_LOGIN_ID(response);
+ 
+-	fw_notify("logged in to sbp2 unit %s (%d retries)\n",
+-		  unit->device.bus_id, sd->retries);
+-	fw_notify(" - management_agent_address:    0x%012llx\n",
+-		  (unsigned long long) sd->management_agent_address);
+-	fw_notify(" - command_block_agent_address: 0x%012llx\n",
+-		  (unsigned long long) sd->command_block_agent_address);
+-	fw_notify(" - status write address:        0x%012llx\n",
+-		  (unsigned long long) sd->address_handler.offset);
++	fw_notify("logged in to %s LUN %04x (%d retries)\n",
++		  unit->device.bus_id, lu->lun, lu->retries);
+ 
+ #if 0
+ 	/* FIXME: The linux1394 sbp2 does this last step. */
+ 	sbp2_set_busy_timeout(scsi_id);
+ #endif
+ 
+-	PREPARE_DELAYED_WORK(&sd->work, sbp2_reconnect);
+-	sbp2_agent_reset(unit);
++	PREPARE_DELAYED_WORK(&lu->work, sbp2_reconnect);
++	sbp2_agent_reset(lu);
+ 
+-	/* FIXME: Loop over luns here. */
+-	lun = 0;
+-	retval = scsi_add_device(host, 0, 0, lun);
+-	if (retval < 0) {
+-		sbp2_send_management_orb(unit, sd->node_id, sd->generation,
+-					 SBP2_LOGOUT_REQUEST, sd->login_id,
+-					 NULL);
++	memset(&eight_bytes_lun, 0, sizeof(eight_bytes_lun));
++	eight_bytes_lun.scsi_lun[0] = (lu->lun >> 8) & 0xff;
++	eight_bytes_lun.scsi_lun[1] = lu->lun & 0xff;
++
++	sdev = __scsi_add_device(shost, 0, 0,
++				 scsilun_to_int(&eight_bytes_lun), lu);
++	if (IS_ERR(sdev)) {
++		sbp2_send_management_orb(lu, node_id, generation,
++				SBP2_LOGOUT_REQUEST, lu->login_id, NULL);
+ 		/*
+ 		 * Set this back to sbp2_login so we fall back and
+ 		 * retry login on bus reset.
+ 		 */
+-		PREPARE_DELAYED_WORK(&sd->work, sbp2_login);
++		PREPARE_DELAYED_WORK(&lu->work, sbp2_login);
++	} else {
++		lu->sdev = sdev;
++		scsi_device_put(sdev);
+ 	}
+-	kref_put(&sd->kref, release_sbp2_device);
++	kref_put(&lu->tgt->kref, sbp2_release_target);
+ }
+ 
+-static int sbp2_probe(struct device *dev)
++static int sbp2_add_logical_unit(struct sbp2_target *tgt, int lun_entry)
++{
++	struct sbp2_logical_unit *lu;
++
++	lu = kmalloc(sizeof(*lu), GFP_KERNEL);
++	if (!lu)
++		return -ENOMEM;
++
++	lu->address_handler.length           = 0x100;
++	lu->address_handler.address_callback = sbp2_status_write;
++	lu->address_handler.callback_data    = lu;
++
++	if (fw_core_add_address_handler(&lu->address_handler,
++					&fw_high_memory_region) < 0) {
++		kfree(lu);
++		return -ENOMEM;
++	}
++
++	lu->tgt  = tgt;
++	lu->sdev = NULL;
++	lu->lun  = lun_entry & 0xffff;
++	lu->retries = 0;
++	INIT_LIST_HEAD(&lu->orb_list);
++	INIT_DELAYED_WORK(&lu->work, sbp2_login);
++
++	list_add_tail(&lu->link, &tgt->lu_list);
++	return 0;
++}
++
++static int sbp2_scan_logical_unit_dir(struct sbp2_target *tgt, u32 *directory)
+ {
+-	struct fw_unit *unit = fw_unit(dev);
+-	struct fw_device *device = fw_device(unit->device.parent);
+-	struct sbp2_device *sd;
+ 	struct fw_csr_iterator ci;
+-	struct Scsi_Host *host;
+-	int i, key, value, err;
+-	u32 model, firmware_revision;
++	int key, value;
+ 
+-	err = -ENOMEM;
+-	host = scsi_host_alloc(&scsi_driver_template, sizeof(*sd));
+-	if (host == NULL)
+-		goto fail;
++	fw_csr_iterator_init(&ci, directory);
++	while (fw_csr_iterator_next(&ci, &key, &value))
++		if (key == SBP2_CSR_LOGICAL_UNIT_NUMBER &&
++		    sbp2_add_logical_unit(tgt, value) < 0)
++			return -ENOMEM;
++	return 0;
++}
+ 
+-	sd = (struct sbp2_device *) host->hostdata;
+-	unit->device.driver_data = sd;
+-	sd->unit = unit;
+-	INIT_LIST_HEAD(&sd->orb_list);
+-	kref_init(&sd->kref);
+-
+-	sd->address_handler.length = 0x100;
+-	sd->address_handler.address_callback = sbp2_status_write;
+-	sd->address_handler.callback_data = sd;
+-
+-	err = fw_core_add_address_handler(&sd->address_handler,
+-					  &fw_high_memory_region);
+-	if (err < 0)
+-		goto fail_host;
+-
+-	err = fw_device_enable_phys_dma(device);
+-	if (err < 0)
+-		goto fail_address_handler;
+-
+-	err = scsi_add_host(host, &unit->device);
+-	if (err < 0)
+-		goto fail_address_handler;
++static int sbp2_scan_unit_dir(struct sbp2_target *tgt, u32 *directory,
++			      u32 *model, u32 *firmware_revision)
++{
++	struct fw_csr_iterator ci;
++	int key, value;
+ 
+-	/*
+-	 * Scan unit directory to get management agent address,
+-	 * firmware revison and model.  Initialize firmware_revision
+-	 * and model to values that wont match anything in our table.
+-	 */
+-	firmware_revision = 0xff000000;
+-	model = 0xff000000;
+-	fw_csr_iterator_init(&ci, unit->directory);
++	fw_csr_iterator_init(&ci, directory);
+ 	while (fw_csr_iterator_next(&ci, &key, &value)) {
+ 		switch (key) {
++
+ 		case CSR_DEPENDENT_INFO | CSR_OFFSET:
+-			sd->management_agent_address =
+-				0xfffff0000000ULL + 4 * value;
++			tgt->management_agent_address =
++					CSR_REGISTER_BASE + 4 * value;
+ 			break;
+-		case SBP2_FIRMWARE_REVISION:
+-			firmware_revision = value;
++
++		case CSR_DIRECTORY_ID:
++			tgt->directory_id = value;
+ 			break;
++
+ 		case CSR_MODEL:
+-			model = value;
++			*model = value;
++			break;
++
++		case SBP2_CSR_FIRMWARE_REVISION:
++			*firmware_revision = value;
++			break;
++
++		case SBP2_CSR_LOGICAL_UNIT_NUMBER:
++			if (sbp2_add_logical_unit(tgt, value) < 0)
++				return -ENOMEM;
++			break;
++
++		case SBP2_CSR_LOGICAL_UNIT_DIRECTORY:
++			if (sbp2_scan_logical_unit_dir(tgt, ci.p + value) < 0)
++				return -ENOMEM;
+ 			break;
+ 		}
+ 	}
++	return 0;
++}
++
++static void sbp2_init_workarounds(struct sbp2_target *tgt, u32 model,
++				  u32 firmware_revision)
++{
++	int i;
++	unsigned w = sbp2_param_workarounds;
++
++	if (w)
++		fw_notify("Please notify linux1394-devel at lists.sourceforge.net "
++			  "if you need the workarounds parameter for %s\n",
++			  tgt->unit->device.bus_id);
++
++	if (w & SBP2_WORKAROUND_OVERRIDE)
++		goto out;
+ 
+ 	for (i = 0; i < ARRAY_SIZE(sbp2_workarounds_table); i++) {
++
+ 		if (sbp2_workarounds_table[i].firmware_revision !=
+ 		    (firmware_revision & 0xffffff00))
+ 			continue;
++
+ 		if (sbp2_workarounds_table[i].model != model &&
+ 		    sbp2_workarounds_table[i].model != ~0)
+ 			continue;
+-		sd->workarounds |= sbp2_workarounds_table[i].workarounds;
++
++		w |= sbp2_workarounds_table[i].workarounds;
+ 		break;
+ 	}
+-
+-	if (sd->workarounds)
+-		fw_notify("Workarounds for node %s: 0x%x "
++ out:
++	if (w)
++		fw_notify("Workarounds for %s: 0x%x "
+ 			  "(firmware_revision 0x%06x, model_id 0x%06x)\n",
+-			  unit->device.bus_id,
+-			  sd->workarounds, firmware_revision, model);
++			  tgt->unit->device.bus_id,
++			  w, firmware_revision, model);
++	tgt->workarounds = w;
++}
++
++static struct scsi_host_template scsi_driver_template;
++
++static int sbp2_probe(struct device *dev)
++{
++	struct fw_unit *unit = fw_unit(dev);
++	struct fw_device *device = fw_device(unit->device.parent);
++	struct sbp2_target *tgt;
++	struct sbp2_logical_unit *lu;
++	struct Scsi_Host *shost;
++	u32 model, firmware_revision;
++
++	shost = scsi_host_alloc(&scsi_driver_template, sizeof(*tgt));
++	if (shost == NULL)
++		return -ENOMEM;
++
++	tgt = (struct sbp2_target *)shost->hostdata;
++	unit->device.driver_data = tgt;
++	tgt->unit = unit;
++	kref_init(&tgt->kref);
++	INIT_LIST_HEAD(&tgt->lu_list);
++
++	if (fw_device_enable_phys_dma(device) < 0)
++		goto fail_shost_put;
++
++	if (scsi_add_host(shost, &unit->device) < 0)
++		goto fail_shost_put;
++
++	/* Initialize to values that won't match anything in our table. */
++	firmware_revision = 0xff000000;
++	model = 0xff000000;
++
++	/* implicit directory ID */
++	tgt->directory_id = ((unit->directory - device->config_rom) * 4
++			     + CSR_CONFIG_ROM) & 0xffffff;
++
++	if (sbp2_scan_unit_dir(tgt, unit->directory, &model,
++			       &firmware_revision) < 0)
++		goto fail_tgt_put;
++
++	sbp2_init_workarounds(tgt, model, firmware_revision);
+ 
+ 	get_device(&unit->device);
+ 
+@@ -729,35 +869,34 @@ static int sbp2_probe(struct device *dev
+ 	 * reschedule retries. Always get the ref before scheduling
+ 	 * work.
+ 	 */
+-	INIT_DELAYED_WORK(&sd->work, sbp2_login);
+-	if (schedule_delayed_work(&sd->work, 0))
+-		kref_get(&sd->kref);
+-
++	list_for_each_entry(lu, &tgt->lu_list, link)
++		if (queue_delayed_work(sbp2_wq, &lu->work, 0))
++			kref_get(&tgt->kref);
+ 	return 0;
+ 
+- fail_address_handler:
+-	fw_core_remove_address_handler(&sd->address_handler);
+- fail_host:
+-	scsi_host_put(host);
+- fail:
+-	return err;
++ fail_tgt_put:
++	kref_put(&tgt->kref, sbp2_release_target);
++	return -ENOMEM;
++
++ fail_shost_put:
++	scsi_host_put(shost);
++	return -ENOMEM;
+ }
+ 
+ static int sbp2_remove(struct device *dev)
+ {
+ 	struct fw_unit *unit = fw_unit(dev);
+-	struct sbp2_device *sd = unit->device.driver_data;
+-
+-	kref_put(&sd->kref, release_sbp2_device);
++	struct sbp2_target *tgt = unit->device.driver_data;
+ 
++	kref_put(&tgt->kref, sbp2_release_target);
+ 	return 0;
+ }
+ 
+ static void sbp2_reconnect(struct work_struct *work)
+ {
+-	struct sbp2_device *sd =
+-		container_of(work, struct sbp2_device, work.work);
+-	struct fw_unit *unit = sd->unit;
++	struct sbp2_logical_unit *lu =
++		container_of(work, struct sbp2_logical_unit, work.work);
++	struct fw_unit *unit = lu->tgt->unit;
+ 	struct fw_device *device = fw_device(unit->device.parent);
+ 	int generation, node_id, local_node_id;
+ 
+@@ -765,40 +904,49 @@ static void sbp2_reconnect(struct work_s
+ 	node_id       = device->node->node_id;
+ 	local_node_id = device->card->local_node->node_id;
+ 
+-	if (sbp2_send_management_orb(unit, node_id, generation,
++	if (sbp2_send_management_orb(lu, node_id, generation,
+ 				     SBP2_RECONNECT_REQUEST,
+-				     sd->login_id, NULL) < 0) {
+-		if (sd->retries++ >= 5) {
++				     lu->login_id, NULL) < 0) {
++		if (lu->retries++ >= 5) {
+ 			fw_error("failed to reconnect to %s\n",
+ 				 unit->device.bus_id);
+ 			/* Fall back and try to log in again. */
+-			sd->retries = 0;
+-			PREPARE_DELAYED_WORK(&sd->work, sbp2_login);
++			lu->retries = 0;
++			PREPARE_DELAYED_WORK(&lu->work, sbp2_login);
+ 		}
+-		schedule_delayed_work(&sd->work, DIV_ROUND_UP(HZ, 5));
++		queue_delayed_work(sbp2_wq, &lu->work, DIV_ROUND_UP(HZ, 5));
+ 		return;
+ 	}
+ 
+-	sd->generation   = generation;
+-	sd->node_id      = node_id;
+-	sd->address_high = local_node_id << 16;
+-
+-	fw_notify("reconnected to unit %s (%d retries)\n",
+-		  unit->device.bus_id, sd->retries);
+-	sbp2_agent_reset(unit);
+-	sbp2_cancel_orbs(unit);
+-	kref_put(&sd->kref, release_sbp2_device);
++	lu->generation        = generation;
++	lu->tgt->node_id      = node_id;
++	lu->tgt->address_high = local_node_id << 16;
++
++	fw_notify("reconnected to %s LUN %04x (%d retries)\n",
++		  unit->device.bus_id, lu->lun, lu->retries);
++
++	sbp2_agent_reset(lu);
++	sbp2_cancel_orbs(lu);
++
++	kref_put(&lu->tgt->kref, sbp2_release_target);
+ }
+ 
+ static void sbp2_update(struct fw_unit *unit)
+ {
+-	struct fw_device *device = fw_device(unit->device.parent);
+-	struct sbp2_device *sd = unit->device.driver_data;
++	struct sbp2_target *tgt = unit->device.driver_data;
++	struct sbp2_logical_unit *lu;
+ 
+-	sd->retries = 0;
+-	fw_device_enable_phys_dma(device);
+-	if (schedule_delayed_work(&sd->work, 0))
+-		kref_get(&sd->kref);
++	fw_device_enable_phys_dma(fw_device(unit->device.parent));
++
++	/*
++	 * Fw-core serializes sbp2_update() against sbp2_remove().
++	 * Iteration over tgt->lu_list is therefore safe here.
++	 */
++	list_for_each_entry(lu, &tgt->lu_list, link) {
++		lu->retries = 0;
++		if (queue_delayed_work(sbp2_wq, &lu->work, 0))
++			kref_get(&tgt->kref);
++	}
+ }
+ 
+ #define SBP2_UNIT_SPEC_ID_ENTRY	0x0000609e
+@@ -868,13 +1016,12 @@ complete_command_orb(struct sbp2_orb *ba
+ {
+ 	struct sbp2_command_orb *orb =
+ 		container_of(base_orb, struct sbp2_command_orb, base);
+-	struct fw_unit *unit = orb->unit;
+-	struct fw_device *device = fw_device(unit->device.parent);
++	struct fw_device *device = fw_device(orb->lu->tgt->unit->device.parent);
+ 	int result;
+ 
+ 	if (status != NULL) {
+ 		if (STATUS_GET_DEAD(*status))
+-			sbp2_agent_reset(unit);
++			sbp2_agent_reset(orb->lu);
+ 
+ 		switch (STATUS_GET_RESPONSE(*status)) {
+ 		case SBP2_STATUS_REQUEST_COMPLETE:
+@@ -918,12 +1065,10 @@ complete_command_orb(struct sbp2_orb *ba
+ 	orb->done(orb->cmd);
+ }
+ 
+-static int sbp2_command_orb_map_scatterlist(struct sbp2_command_orb *orb)
++static int
++sbp2_map_scatterlist(struct sbp2_command_orb *orb, struct fw_device *device,
++		     struct sbp2_logical_unit *lu)
+ {
+-	struct sbp2_device *sd =
+-		(struct sbp2_device *)orb->cmd->device->host->hostdata;
+-	struct fw_unit *unit = sd->unit;
+-	struct fw_device *device = fw_device(unit->device.parent);
+ 	struct scatterlist *sg;
+ 	int sg_len, l, i, j, count;
+ 	dma_addr_t sg_addr;
+@@ -942,10 +1087,9 @@ static int sbp2_command_orb_map_scatterl
+ 	 * tables.
+ 	 */
+ 	if (count == 1 && sg_dma_len(sg) < SBP2_MAX_SG_ELEMENT_LENGTH) {
+-		orb->request.data_descriptor.high = sd->address_high;
++		orb->request.data_descriptor.high = lu->tgt->address_high;
+ 		orb->request.data_descriptor.low  = sg_dma_address(sg);
+-		orb->request.misc |=
+-			COMMAND_ORB_DATA_SIZE(sg_dma_len(sg));
++		orb->request.misc |= COMMAND_ORB_DATA_SIZE(sg_dma_len(sg));
+ 		return 0;
+ 	}
+ 
+@@ -989,7 +1133,7 @@ static int sbp2_command_orb_map_scatterl
+ 	 * initiator (i.e. us), but data_descriptor can refer to data
+ 	 * on other nodes so we need to put our ID in descriptor.high.
+ 	 */
+-	orb->request.data_descriptor.high = sd->address_high;
++	orb->request.data_descriptor.high = lu->tgt->address_high;
+ 	orb->request.data_descriptor.low  = orb->page_table_bus;
+ 	orb->request.misc |=
+ 		COMMAND_ORB_PAGE_TABLE_PRESENT |
+@@ -1008,12 +1152,11 @@ static int sbp2_command_orb_map_scatterl
+ 
+ static int sbp2_scsi_queuecommand(struct scsi_cmnd *cmd, scsi_done_fn_t done)
+ {
+-	struct sbp2_device *sd =
+-		(struct sbp2_device *)cmd->device->host->hostdata;
+-	struct fw_unit *unit = sd->unit;
+-	struct fw_device *device = fw_device(unit->device.parent);
++	struct sbp2_logical_unit *lu = cmd->device->hostdata;
++	struct fw_device *device = fw_device(lu->tgt->unit->device.parent);
+ 	struct sbp2_command_orb *orb;
+ 	unsigned max_payload;
++	int retval = SCSI_MLQUEUE_HOST_BUSY;
+ 
+ 	/*
+ 	 * Bidirectional commands are not yet implemented, and unknown
+@@ -1029,14 +1172,14 @@ static int sbp2_scsi_queuecommand(struct
+ 	orb = kzalloc(sizeof(*orb), GFP_ATOMIC);
+ 	if (orb == NULL) {
+ 		fw_notify("failed to alloc orb\n");
+-		goto fail_alloc;
++		return SCSI_MLQUEUE_HOST_BUSY;
+ 	}
+ 
+ 	/* Initialize rcode to something not RCODE_COMPLETE. */
+ 	orb->base.rcode = -1;
+ 	kref_init(&orb->base.kref);
+ 
+-	orb->unit = unit;
++	orb->lu   = lu;
+ 	orb->done = done;
+ 	orb->cmd  = cmd;
+ 
+@@ -1062,8 +1205,8 @@ static int sbp2_scsi_queuecommand(struct
+ 		orb->request.misc |=
+ 			COMMAND_ORB_DIRECTION(SBP2_DIRECTION_TO_MEDIA);
+ 
+-	if (scsi_sg_count(cmd) && sbp2_command_orb_map_scatterlist(orb) < 0)
+-		goto fail_mapping;
++	if (scsi_sg_count(cmd) && sbp2_map_scatterlist(orb, device, lu) < 0)
++		goto out;
+ 
+ 	fw_memcpy_to_be32(&orb->request, &orb->request, sizeof(orb->request));
+ 
+@@ -1076,49 +1219,47 @@ static int sbp2_scsi_queuecommand(struct
+ 		dma_map_single(device->card->device, &orb->request,
+ 			       sizeof(orb->request), DMA_TO_DEVICE);
+ 	if (dma_mapping_error(orb->base.request_bus))
+-		goto fail_mapping;
+-
+-	sbp2_send_orb(&orb->base, unit, sd->node_id, sd->generation,
+-		      sd->command_block_agent_address + SBP2_ORB_POINTER);
+-
+-	kref_put(&orb->base.kref, free_orb);
+-	return 0;
++		goto out;
+ 
+- fail_mapping:
++	sbp2_send_orb(&orb->base, lu, lu->tgt->node_id, lu->generation,
++		      lu->command_block_agent_address + SBP2_ORB_POINTER);
++	retval = 0;
++ out:
+ 	kref_put(&orb->base.kref, free_orb);
+- fail_alloc:
+-	return SCSI_MLQUEUE_HOST_BUSY;
++	return retval;
+ }
+ 
+ static int sbp2_scsi_slave_alloc(struct scsi_device *sdev)
+ {
+-	struct sbp2_device *sd = (struct sbp2_device *)sdev->host->hostdata;
++	struct sbp2_logical_unit *lu = sdev->hostdata;
+ 
+ 	sdev->allow_restart = 1;
+ 
+-	if (sd->workarounds & SBP2_WORKAROUND_INQUIRY_36)
++	if (lu->tgt->workarounds & SBP2_WORKAROUND_INQUIRY_36)
+ 		sdev->inquiry_len = 36;
++
+ 	return 0;
+ }
+ 
+ static int sbp2_scsi_slave_configure(struct scsi_device *sdev)
+ {
+-	struct sbp2_device *sd = (struct sbp2_device *)sdev->host->hostdata;
+-	struct fw_unit *unit = sd->unit;
++	struct sbp2_logical_unit *lu = sdev->hostdata;
+ 
+ 	sdev->use_10_for_rw = 1;
+ 
+ 	if (sdev->type == TYPE_ROM)
+ 		sdev->use_10_for_ms = 1;
++
+ 	if (sdev->type == TYPE_DISK &&
+-	    sd->workarounds & SBP2_WORKAROUND_MODE_SENSE_8)
++	    lu->tgt->workarounds & SBP2_WORKAROUND_MODE_SENSE_8)
+ 		sdev->skip_ms_page_8 = 1;
+-	if (sd->workarounds & SBP2_WORKAROUND_FIX_CAPACITY) {
+-		fw_notify("setting fix_capacity for %s\n", unit->device.bus_id);
++
++	if (lu->tgt->workarounds & SBP2_WORKAROUND_FIX_CAPACITY)
+ 		sdev->fix_capacity = 1;
+-	}
+-	if (sd->workarounds & SBP2_WORKAROUND_128K_MAX_TRANS)
++
++	if (lu->tgt->workarounds & SBP2_WORKAROUND_128K_MAX_TRANS)
+ 		blk_queue_max_sectors(sdev->request_queue, 128 * 1024 / 512);
++
+ 	return 0;
+ }
+ 
+@@ -1128,13 +1269,11 @@ static int sbp2_scsi_slave_configure(str
+  */
+ static int sbp2_scsi_abort(struct scsi_cmnd *cmd)
+ {
+-	struct sbp2_device *sd =
+-		(struct sbp2_device *)cmd->device->host->hostdata;
+-	struct fw_unit *unit = sd->unit;
++	struct sbp2_logical_unit *lu = cmd->device->hostdata;
+ 
+ 	fw_notify("sbp2_scsi_abort\n");
+-	sbp2_agent_reset(unit);
+-	sbp2_cancel_orbs(unit);
++	sbp2_agent_reset(lu);
++	sbp2_cancel_orbs(lu);
+ 
+ 	return SUCCESS;
+ }
+@@ -1151,37 +1290,18 @@ sbp2_sysfs_ieee1394_id_show(struct devic
+ 			    char *buf)
+ {
+ 	struct scsi_device *sdev = to_scsi_device(dev);
+-	struct sbp2_device *sd;
+-	struct fw_unit *unit;
++	struct sbp2_logical_unit *lu;
+ 	struct fw_device *device;
+-	u32 directory_id;
+-	struct fw_csr_iterator ci;
+-	int key, value, lun;
+ 
+ 	if (!sdev)
+ 		return 0;
+-	sd = (struct sbp2_device *)sdev->host->hostdata;
+-	unit = sd->unit;
+-	device = fw_device(unit->device.parent);
+-
+-	/* implicit directory ID */
+-	directory_id = ((unit->directory - device->config_rom) * 4
+-			+ CSR_CONFIG_ROM) & 0xffffff;
+-
+-	/* explicit directory ID, overrides implicit ID if present */
+-	fw_csr_iterator_init(&ci, unit->directory);
+-	while (fw_csr_iterator_next(&ci, &key, &value))
+-		if (key == CSR_DIRECTORY_ID) {
+-			directory_id = value;
+-			break;
+-		}
+ 
+-	/* FIXME: Make this work for multi-lun devices. */
+-	lun = 0;
++	lu = sdev->hostdata;
++	device = fw_device(lu->tgt->unit->device.parent);
+ 
+ 	return sprintf(buf, "%08x%08x:%06x:%04x\n",
+ 			device->config_rom[3], device->config_rom[4],
+-			directory_id, lun);
++			lu->tgt->directory_id, lu->lun);
+ }
+ 
+ static DEVICE_ATTR(ieee1394_id, S_IRUGO, sbp2_sysfs_ieee1394_id_show, NULL);
+@@ -1219,12 +1339,17 @@ MODULE_ALIAS("sbp2");
+ 
+ static int __init sbp2_init(void)
+ {
++	sbp2_wq = create_singlethread_workqueue(KBUILD_MODNAME);
++	if (!sbp2_wq)
++		return -ENOMEM;
++
+ 	return driver_register(&sbp2_driver.driver);
+ }
+ 
+ static void __exit sbp2_cleanup(void)
+ {
+ 	driver_unregister(&sbp2_driver.driver);
++	destroy_workqueue(sbp2_wq);
+ }
+ 
+ module_init(sbp2_init);
+diff -puN drivers/firewire/fw-transaction.c~git-ieee1394 drivers/firewire/fw-transaction.c
+--- a/drivers/firewire/fw-transaction.c~git-ieee1394
++++ a/drivers/firewire/fw-transaction.c
+@@ -410,7 +410,12 @@ EXPORT_SYMBOL(fw_unit_space_region);
+  * controller.  When a request is received that falls within the
+  * specified address range, the specified callback is invoked.  The
+  * parameters passed to the callback give the details of the
+- * particular request
++ * particular request.
++ *
++ * Return value:  0 on success, non-zero otherwise.
++ * The start offset of the handler's address region is determined by
++ * fw_core_add_address_handler() and is returned in handler->offset.
++ * The offset is quadlet-aligned.
+  */
+ int
+ fw_core_add_address_handler(struct fw_address_handler *handler,
+@@ -422,14 +427,15 @@ fw_core_add_address_handler(struct fw_ad
+ 
+ 	spin_lock_irqsave(&address_handler_lock, flags);
+ 
+-	handler->offset = region->start;
++	handler->offset = roundup(region->start, 4);
+ 	while (handler->offset + handler->length <= region->end) {
+ 		other =
+ 		    lookup_overlapping_address_handler(&address_handler_list,
+ 						       handler->offset,
+ 						       handler->length);
+ 		if (other != NULL) {
+-			handler->offset += other->length;
++			handler->offset =
++			    roundup(other->offset + other->length, 4);
+ 		} else {
+ 			list_add_tail(&handler->link, &address_handler_list);
+ 			ret = 0;
+diff -puN drivers/ieee1394/eth1394.c~git-ieee1394 drivers/ieee1394/eth1394.c
+--- a/drivers/ieee1394/eth1394.c~git-ieee1394
++++ a/drivers/ieee1394/eth1394.c
+@@ -1148,8 +1148,6 @@ static int ether1394_data_handler(struct
+ 			pdg->sz++;
+ 			lh = find_partial_datagram(pdgl, dgl);
+ 		} else {
+-			struct partial_datagram *pd;
+-
+ 			pd = list_entry(lh, struct partial_datagram, list);
+ 
+ 			if (fragment_overlap(&pd->frag_info, fg_off, fg_len)) {
+@@ -1217,23 +1215,19 @@ static int ether1394_data_handler(struct
+ 		priv->stats.rx_errors++;
+ 		priv->stats.rx_dropped++;
+ 		dev_kfree_skb_any(skb);
+-		goto bad_proto;
+-	}
+-
+-	if (netif_rx(skb) == NET_RX_DROP) {
++	} else if (netif_rx(skb) == NET_RX_DROP) {
+ 		priv->stats.rx_errors++;
+ 		priv->stats.rx_dropped++;
+-		goto bad_proto;
++	} else {
++		priv->stats.rx_packets++;
++		priv->stats.rx_bytes += skb->len;
+ 	}
+ 
+-	/* Statistics */
+-	priv->stats.rx_packets++;
+-	priv->stats.rx_bytes += skb->len;
++	spin_unlock_irqrestore(&priv->lock, flags);
+ 
+ bad_proto:
+ 	if (netif_queue_stopped(dev))
+ 		netif_wake_queue(dev);
+-	spin_unlock_irqrestore(&priv->lock, flags);
+ 
+ 	dev->last_rx = jiffies;
+ 
+diff -puN drivers/ieee1394/nodemgr.c~git-ieee1394 drivers/ieee1394/nodemgr.c
+--- a/drivers/ieee1394/nodemgr.c~git-ieee1394
++++ a/drivers/ieee1394/nodemgr.c
+@@ -1712,7 +1712,8 @@ static int nodemgr_host_thread(void *__h
+ 		 * to make sure things settle down. */
+ 		g = get_hpsb_generation(host);
+ 		for (i = 0; i < 4 ; i++) {
+-			if (msleep_interruptible(63) || kthread_should_stop())
++			msleep_interruptible(63);
++			if (kthread_should_stop())
+ 				goto exit;
+ 
+ 			/* Now get the generation in which the node ID's we collect
+diff -puN drivers/ieee1394/pcilynx.c~git-ieee1394 drivers/ieee1394/pcilynx.c
+--- a/drivers/ieee1394/pcilynx.c~git-ieee1394
++++ a/drivers/ieee1394/pcilynx.c
+@@ -765,7 +765,6 @@ static int lynx_devctl(struct hpsb_host 
+                 } else {
+                         struct ti_pcl pcl;
+                         u32 ack;
+-                        struct hpsb_packet *packet;
+ 
+                         PRINT(KERN_INFO, lynx->id, "cancelling async packet, that was already in PCL");
+ 
+@@ -1470,8 +1469,6 @@ static int __devinit add_card(struct pci
+                         if (i2c_transfer(i2c_ad, msg, 2) < 0) {
+                                 PRINT(KERN_ERR, lynx->id, "unable to read bus info block from i2c");
+                         } else {
+-                                int i;
+-
+                                 PRINT(KERN_INFO, lynx->id, "got bus info block from serial eeprom");
+ 				/* FIXME: probably we shoud rewrite the max_rec, max_ROM(1394a),
+ 				 * generation(1394a) and link_spd(1394a) field and recalculate
+diff -puN drivers/ieee1394/sbp2.c~git-ieee1394 drivers/ieee1394/sbp2.c
+--- a/drivers/ieee1394/sbp2.c~git-ieee1394
++++ a/drivers/ieee1394/sbp2.c
+@@ -242,6 +242,8 @@ static int sbp2_max_speed_and_size(struc
+ 
+ static const u8 sbp2_speedto_max_payload[] = { 0x7, 0x8, 0x9, 0xA, 0xB, 0xC };
+ 
++static DEFINE_RWLOCK(sbp2_hi_logical_units_lock);
++
+ static struct hpsb_highlevel sbp2_highlevel = {
+ 	.name		= SBP2_DEVICE_NAME,
+ 	.host_reset	= sbp2_host_reset,
+@@ -732,6 +734,7 @@ static struct sbp2_lu *sbp2_alloc_device
+ 	struct sbp2_fwhost_info *hi;
+ 	struct Scsi_Host *shost = NULL;
+ 	struct sbp2_lu *lu = NULL;
++	unsigned long flags;
+ 
+ 	lu = kzalloc(sizeof(*lu), GFP_KERNEL);
+ 	if (!lu) {
+@@ -784,7 +787,9 @@ static struct sbp2_lu *sbp2_alloc_device
+ 
+ 	lu->hi = hi;
+ 
++	write_lock_irqsave(&sbp2_hi_logical_units_lock, flags);
+ 	list_add_tail(&lu->lu_list, &hi->logical_units);
++	write_unlock_irqrestore(&sbp2_hi_logical_units_lock, flags);
+ 
+ 	/* Register the status FIFO address range. We could use the same FIFO
+ 	 * for targets at different nodes. However we need different FIFOs per
+@@ -828,16 +833,20 @@ static void sbp2_host_reset(struct hpsb_
+ {
+ 	struct sbp2_fwhost_info *hi;
+ 	struct sbp2_lu *lu;
++	unsigned long flags;
+ 
+ 	hi = hpsb_get_hostinfo(&sbp2_highlevel, host);
+ 	if (!hi)
+ 		return;
++
++	read_lock_irqsave(&sbp2_hi_logical_units_lock, flags);
+ 	list_for_each_entry(lu, &hi->logical_units, lu_list)
+ 		if (likely(atomic_read(&lu->state) !=
+ 			   SBP2LU_STATE_IN_SHUTDOWN)) {
+ 			atomic_set(&lu->state, SBP2LU_STATE_IN_RESET);
+ 			scsi_block_requests(lu->shost);
+ 		}
++	read_unlock_irqrestore(&sbp2_hi_logical_units_lock, flags);
+ }
+ 
+ static int sbp2_start_device(struct sbp2_lu *lu)
+@@ -919,6 +928,7 @@ alloc_fail:
+ static void sbp2_remove_device(struct sbp2_lu *lu)
+ {
+ 	struct sbp2_fwhost_info *hi;
++	unsigned long flags;
+ 
+ 	if (!lu)
+ 		return;
+@@ -933,7 +943,9 @@ static void sbp2_remove_device(struct sb
+ 	flush_scheduled_work();
+ 	sbp2util_remove_command_orb_pool(lu, hi->host);
+ 
++	write_lock_irqsave(&sbp2_hi_logical_units_lock, flags);
+ 	list_del(&lu->lu_list);
++	write_unlock_irqrestore(&sbp2_hi_logical_units_lock, flags);
+ 
+ 	if (lu->login_response)
+ 		dma_free_coherent(hi->host->device.parent,
+@@ -1707,6 +1719,7 @@ static int sbp2_handle_status_write(stru
+ 	}
+ 
+ 	/* Find the unit which wrote the status. */
++	read_lock_irqsave(&sbp2_hi_logical_units_lock, flags);
+ 	list_for_each_entry(lu_tmp, &hi->logical_units, lu_list) {
+ 		if (lu_tmp->ne->nodeid == nodeid &&
+ 		    lu_tmp->status_fifo_addr == addr) {
+@@ -1714,6 +1727,8 @@ static int sbp2_handle_status_write(stru
+ 			break;
+ 		}
+ 	}
++	read_unlock_irqrestore(&sbp2_hi_logical_units_lock, flags);
++
+ 	if (unlikely(!lu)) {
+ 		SBP2_ERR("lu is NULL - device is gone?");
+ 		return RCODE_ADDRESS_ERROR;
+_

Added: dists/sid/linux-2.6/debian/patches/bugfix/all/stable/2.6.23.2.patch
==============================================================================
--- (empty file)
+++ dists/sid/linux-2.6/debian/patches/bugfix/all/stable/2.6.23.2.patch	Mon Nov 26 20:06:56 2007
@@ -0,0 +1,693 @@
+diff --git a/Documentation/ja_JP/HOWTO b/Documentation/ja_JP/HOWTO
+index 9f08dab..d9d832c 100644
+--- a/Documentation/ja_JP/HOWTO
++++ b/Documentation/ja_JP/HOWTO
+@@ -1,4 +1,4 @@
+-NOTE:
++NOTE:
+ This is a version of Documentation/HOWTO translated into Japanese.
+ This document is maintained by Tsugikazu Shibata <tshibata at ab.jp.nec.com>
+ and the JF Project team <www.linux.or.jp/JF>.
+@@ -11,14 +11,14 @@ for non English (read: Japanese) speakers and is not intended as a
+ fork. So if you have any comments or updates for this file, please try
+ to update the original English file first.
+ 
+-Last Updated: 2007/07/18
++Last Updated: 2007/09/23
+ ==================================
+ これは、
+-linux-2.6.22/Documentation/HOWTO
++linux-2.6.23/Documentation/HOWTO
+ の和訳です。
+ 
+ 翻訳団体: JF プロジェクト < http://www.linux.or.jp/JF/ >
+-翻訳日: 2007/07/16
++翻訳日: 2007/09/19
+ 翻訳者: Tsugikazu Shibata <tshibata at ab dot jp dot nec dot com>
+ 校正者: 松倉さん <nbh--mats at nifty dot com>
+          小林 雅典さん (Masanori Kobayasi) <zap03216 at nifty dot ne dot jp>
+@@ -27,6 +27,7 @@ linux-2.6.22/Documentation/HOWTO
+          野口さん (Kenji Noguchi) <tokyo246 at gmail dot com>
+          河内さん (Takayoshi Kochi) <t-kochi at bq dot jp dot nec dot com>
+          岩本さん (iwamoto) <iwamoto.kn at ncos dot nec dot co dot jp>
++         内田さん (Satoshi Uchida) <s-uchida at ap dot jp dot nec dot com>
+ ==================================
+ 
+ Linux カーネル開発のやり方
+@@ -40,7 +41,7 @@ Linux カーネル開発コミュニティと共に活動するやり方を学ã
+ 手助けになります。
+ 
+ もし、このドキュメントのどこかが古くなっていた場合には、このドキュメン
+-トの最後にリストしたメンテナーにパッチを送ってください。
++トの最後にリストしたメンテナにパッチを送ってください。
+ 
+ はじめに
+ ---------
+@@ -59,7 +60,7 @@ Linux カーネル開発コミュニティと共に活動するやり方を学ã
+ ネル開発者には必要です。アーキテクチャ向けの低レベル部分の開発をするの
+ でなければ、(どんなアーキテクチャでも)アセンブリ(訳注: 言語)は必要あり
+ ません。以下の本は、C 言語の十分な知識や何年もの経験に取って代わるもの
+-ではありませんが、少なくともリファレンスとしてはいい本です。
++ではありませんが、少なくともリファレンスとしては良い本です。
+  - "The C Programming Language" by Kernighan and Ritchie [Prentice Hall]
+  -『プログラミング言語C第2版』(B.W. カーニハン/D.M. リッチー著 石田晴久訳) [共立出版]
+  - "Practical C Programming" by Steve Oualline [O'Reilly]
+@@ -76,7 +77,7 @@ Linux カーネル開発コミュニティと共に活動するやり方を学ã
+ ときどき、カーネルがツールチェインや C 言語拡張に置いている前提がどう
+ なっているのかわかりにくいことがあり、また、残念なことに決定的なリファ
+ レンスは存在しません。情報を得るには、gcc の info ページ( info gcc )を
+-みてください。
++見てください。
+ 
+ あなたは既存の開発コミュニティと一緒に作業する方法を学ぼうとしているこ
+ とに留意してください。そのコミュニティは、コーディング、スタイル、
+@@ -92,7 +93,7 @@ Linux カーネル開発コミュニティと共に活動するやり方を学ã
+ 
+ Linux カーネルのソースコードは GPL ライセンスの下でリリースされていま
+ す。ライセンスの詳細については、ソースツリーのメインディレクトリに存在
+-する、COPYING のファイルをみてください。もしライセンスについてさらに質
++する、COPYING のファイルを見てください。もしライセンスについてさらに質
+ 問があれば、Linux Kernel メーリングリストに質問するのではなく、どうぞ
+ 法律家に相談してください。メーリングリストの人達は法律家ではなく、法的
+ 問題については彼らの声明はあてにするべきではありません。
+@@ -109,7 +110,8 @@ Linux カーネルソースツリーは幅広い範囲のドキュメントをå
+ 新しいドキュメントファイルも追加することを勧めます。
+ カーネルの変更が、カーネルがユーザ空間に公開しているインターフェイスの
+ 変更を引き起こす場合、その変更を説明するマニュアルページのパッチや情報
+-をマニュアルページのメンテナ mtk-manpages at gmx.net に送ることを勧めます。
++をマニュアルページのメンテナ mtk-manpages at gmx.net に送ることを勧めま
++す。
+ 
+ 以下はカーネルソースツリーに含まれている読んでおくべきファイルの一覧で
+ す-
+@@ -117,7 +119,7 @@ Linux カーネルソースツリーは幅広い範囲のドキュメントをå
+   README
+     このファイルは Linuxカーネルの簡単な背景とカーネルを設定(訳注
+     configure )し、生成(訳注 build )するために必要なことは何かが書かれ
+-    ています。カーネルに関して初めての人はここからスタートするとよいで
++    ています。カーネルに関して初めての人はここからスタートすると良いで
+     しょう。
+ 
+   Documentation/Changes
+@@ -128,7 +130,7 @@ Linux カーネルソースツリーは幅広い範囲のドキュメントをå
+   Documentation/CodingStyle
+     これは Linux カーネルのコーディングスタイルと背景にある理由を記述
+     しています。全ての新しいコードはこのドキュメントにあるガイドライン
+-    に従っていることを期待されています。大部分のメンテナーはこれらのルー
++    に従っていることを期待されています。大部分のメンテナはこれらのルー
+     ルに従っているものだけを受け付け、多くの人は正しいスタイルのコード
+     だけをレビューします。
+ 
+@@ -168,16 +170,16 @@ Linux カーネルソースツリーは幅広い範囲のドキュメントをå
+     支援してください。
+ 
+   Documentation/ManagementStyle
+-    このドキュメントは Linux カーネルのメンテナー達がどう行動するか、
++    このドキュメントは Linux カーネルのメンテナ達がどう行動するか、
+     彼らの手法の背景にある共有されている精神について記述しています。こ
+     れはカーネル開発の初心者なら(もしくは、単に興味があるだけの人でも)
+-    重要です。なぜならこのドキュメントは、カーネルメンテナー達の独特な
++    重要です。なぜならこのドキュメントは、カーネルメンテナ達の独特な
+     行動についての多くの誤解や混乱を解消するからです。
+ 
+   Documentation/stable_kernel_rules.txt
+     このファイルはどのように stable カーネルのリリースが行われるかのルー
+     ルが記述されています。そしてこれらのリリースの中のどこかで変更を取
+-    り入れてもらいたい場合に何をすればいいかが示されています。
++    り入れてもらいたい場合に何をすれば良いかが示されています。
+ 
+   Documentation/kernel-docs.txt
+   カーネル開発に付随する外部ドキュメントのリストです。もしあなたが
+@@ -218,9 +220,9 @@ web サイトには、コードの構成、サブシステム、現在存在すã
+ ここには、また、カーネルのコンパイルのやり方やパッチの当て方などの間接
+ 的な基本情報も記述されています。
+ 
+-あなたがどこからスタートしてよいかわからないが、Linux カーネル開発コミュ
++あなたがどこからスタートして良いかわからないが、Linux カーネル開発コミュ
+ ニティに参加して何かすることをさがしている場合には、Linux kernel
+-Janitor's プロジェクトにいけばよいでしょう -
++Janitor's プロジェクトにいけば良いでしょう -
+ 	http://janitor.kernelnewbies.org/
+ ここはそのようなスタートをするのにうってつけの場所です。ここには、
+ Linux カーネルソースツリーの中に含まれる、きれいにし、修正しなければな
+@@ -243,7 +245,7 @@ Linux カーネルソースツリーの中に含まれる、きれいにし、ä¿
+ 自己参照方式で、索引がついた web 形式で、ソースコードを参照することが
+ できます。この最新の素晴しいカーネルコードのリポジトリは以下で見つかり
+ ます-
+-	http://sosdg.org/~coywolf/lxr/
++	http://sosdg.org/~qiyong/lxr/
+ 
+ 開発プロセス
+ -----------------------
+@@ -265,9 +267,9 @@ Linux カーネルの開発プロセスは現在幾つかの異なるメインã‚
+ 以下のとおり-
+ 
+   - 新しいカーネルがリリースされた直後に、2週間の特別期間が設けられ、
+-    この期間中に、メンテナー達は Linus に大きな差分を送ることができま
+-    す。このような差分は通常 -mm カーネルに数週間含まれてきたパッチで
+-    す。 大きな変更は git(カーネルのソース管理ツール、詳細は
++    この期間中に、メンテナ達は Linus に大きな差分を送ることができます。
++    このような差分は通常 -mm カーネルに数週間含まれてきたパッチです。
++    大きな変更は git(カーネルのソース管理ツール、詳細は
+     http://git.or.cz/  参照) を使って送るのが好ましいやり方ですが、パッ
+     チファイルの形式のまま送るのでも十分です。
+ 
+@@ -285,6 +287,10 @@ Linux カーネルの開発プロセスは現在幾つかの異なるメインã‚
+     に安定した状態にあると判断したときにリリースされます。目標は毎週新
+     しい -rc カーネルをリリースすることです。
+ 
++   - 以下の URL で各 -rc リリースに存在する既知の後戻り問題のリスト
++     が追跡されます-
++     http://kernelnewbies.org/known_regressions
++
+   - このプロセスはカーネルが 「準備ができた」と考えられるまで継続しま
+     す。このプロセスはだいたい 6週間継続します。
+ 
+@@ -331,8 +337,8 @@ Andrew は個別のサブシステムカーネルツリーとパッチを全てé
+ linux-kernel メーリングリストで収集された多数のパッチと同時に一つにま
+ とめます。
+ このツリーは新機能とパッチが検証される場となります。ある期間の間パッチ
+-が -mm に入って価値を証明されたら、Andrew やサブシステムメンテナが、メ
+-インラインへ入れるように Linus にプッシュします。
++が -mm に入って価値を証明されたら、Andrew やサブシステムメンテナが、
++メインラインへ入れるように Linus にプッシュします。
+ 
+ メインカーネルツリーに含めるために Linus に送る前に、すべての新しいパッ
+ チが -mm ツリーでテストされることが強く推奨されます。
+@@ -460,7 +466,7 @@ MAINTAINERS ファイルにリストがありますので参照してくださã
+ せん-
+ 彼らはあなたのパッチの行毎にコメントを入れたいので、そのためにはそうす
+ るしかありません。あなたのメールプログラムが空白やタブを圧縮しないよう
+-に確認した方がいいです。最初の良いテストとしては、自分にメールを送って
++に確認した方が良いです。最初の良いテストとしては、自分にメールを送って
+ みて、そのパッチを自分で当ててみることです。もしそれがうまく行かないな
+ ら、あなたのメールプログラムを直してもらうか、正しく動くように変えるべ
+ きです。
+@@ -507,14 +513,14 @@ MAINTAINERS ファイルにリストがありますので参照してくださã
+ とも普通のことです。これはあなたのパッチが受け入れられないということで
+ は *ありません*、そしてあなた自身に反対することを意味するのでも *ありま
+ せん*。単に自分のパッチに対して指摘された問題を全て修正して再送すれば
+-いいのです。
++良いのです。
+ 
+ 
+ カーネルコミュニティと企業組織のちがい
+ -----------------------------------------------------------------
+ 
+ カーネルコミュニティは大部分の伝統的な会社の開発環境とは異ったやり方で
+-動いています。以下は問題を避けるためにできるとよいことののリストです-
++動いています。以下は問題を避けるためにできると良いことのリストです-
+ 
+   あなたの提案する変更について言うときのうまい言い方:
+ 
+@@ -525,7 +531,7 @@ MAINTAINERS ファイルにリストがありますので参照してくださã
+     - "以下は一連の小さなパッチ群ですが..."
+     - "これは典型的なマシンでの性能を向上させます.."
+ 
+-  やめた方がいい悪い言い方:
++  やめた方が良い悪い言い方:
+ 
+     - このやり方で AIX/ptx/Solaris ではできたので、できるはずだ
+     - 私はこれを20年もの間やってきた、だから
+@@ -575,10 +581,10 @@ Linux カーネルコミュニティは、一度に大量のコードの塊をå–
+ 
+ 1) 小さいパッチはあなたのパッチが適用される見込みを大きくします、カー
+    ネルの人達はパッチが正しいかどうかを確認する時間や労力をかけないか
+-   らです。5行のパッチはメンテナがたった1秒見るだけで適用できます。し
+-   かし、500行のパッチは、正しいことをレビューするのに数時間かかるかも
+-   しれません(時間はパッチのサイズなどにより指数関数に比例してかかりま
+-   す)
++   らです。5行のパッチはメンテナがたった1秒見るだけで適用できます。
++   しかし、500行のパッチは、正しいことをレビューするのに数時間かかるか
++   もしれません(時間はパッチのサイズなどにより指数関数に比例してかかり
++   ます)
+ 
+    小さいパッチは何かあったときにデバッグもとても簡単になります。パッ
+    チを1個1個取り除くのは、とても大きなパッチを当てた後に(かつ、何かお
+@@ -587,23 +593,23 @@ Linux カーネルコミュニティは、一度に大量のコードの塊をå–
+ 2) 小さいパッチを送るだけでなく、送るまえに、書き直して、シンプルにす
+    る(もしくは、単に順番を変えるだけでも)ことも、とても重要です。
+ 
+-以下はカーネル開発者の Al Viro のたとえ話しです:
++以下はカーネル開発者の Al Viro のたとえ話です:
+ 
+         "生徒の数学の宿題を採点する先生のことを考えてみてください、先
+-        生は生徒が解に到達するまでの試行錯誤をみたいとは思わないでしょ
+-        う。先生は簡潔な最高の解をみたいのです。良い生徒はこれを知って
++        生は生徒が解に到達するまでの試行錯誤を見たいとは思わないでしょ
++        う。先生は簡潔な最高の解を見たいのです。良い生徒はこれを知って
+         おり、そして最終解の前の中間作業を提出することは決してないので
+         す"
+ 
+-        カーネル開発でもこれは同じです。メンテナー達とレビューア達は、
+-        問題を解決する解の背後になる思考プロセスをみたいとは思いません。
+-        彼らは単純であざやかな解決方法をみたいのです。
++        カーネル開発でもこれは同じです。メンテナ達とレビューア達は、
++        問題を解決する解の背後になる思考プロセスを見たいとは思いません。
++        彼らは単純であざやかな解決方法を見たいのです。
+ 
+ あざやかな解を説明するのと、コミュニティと共に仕事をし、未解決の仕事を
+ 議論することのバランスをキープするのは難しいかもしれません。
+ ですから、開発プロセスの早期段階で改善のためのフィードバックをもらうよ
+-うにするのもいいですが、変更点を小さい部分に分割して全体ではまだ完成し
+-ていない仕事を(部分的に)取り込んでもらえるようにすることもいいことです。
++うにするのも良いですが、変更点を小さい部分に分割して全体ではまだ完成し
++ていない仕事を(部分的に)取り込んでもらえるようにすることも良いことです。
+ 
+ また、でき上がっていないものや、"将来直す" ようなパッチを、本流に含め
+ てもらうように送っても、それは受け付けられないことを理解してください。
+@@ -629,7 +635,7 @@ Linux カーネルコミュニティは、一度に大量のコードの塊をå–
+   - テスト結果
+ 
+ これについて全てがどのようにあるべきかについての詳細は、以下のドキュメ
+-ントの ChangeLog セクションをみてください-
++ントの ChangeLog セクションを見てください-
+   "The Perfect Patch"
+       http://www.zip.com.au/~akpm/linux/patches/stuff/tpp.txt
+ 
+diff --git a/Makefile b/Makefile
+index c244a02..c6d545c 100644
+diff --git a/block/ll_rw_blk.c b/block/ll_rw_blk.c
+index ed39313..026cf24 100644
+--- a/block/ll_rw_blk.c
++++ b/block/ll_rw_blk.c
+@@ -819,7 +819,6 @@ static int __blk_free_tags(struct blk_queue_tag *bqt)
+ 	retval = atomic_dec_and_test(&bqt->refcnt);
+ 	if (retval) {
+ 		BUG_ON(bqt->busy);
+-		BUG_ON(!list_empty(&bqt->busy_list));
+ 
+ 		kfree(bqt->tag_index);
+ 		bqt->tag_index = NULL;
+@@ -931,7 +930,6 @@ static struct blk_queue_tag *__blk_queue_init_tags(struct request_queue *q,
+ 	if (init_tag_map(q, tags, depth))
+ 		goto fail;
+ 
+-	INIT_LIST_HEAD(&tags->busy_list);
+ 	tags->busy = 0;
+ 	atomic_set(&tags->refcnt, 1);
+ 	return tags;
+@@ -982,6 +980,7 @@ int blk_queue_init_tags(struct request_queue *q, int depth,
+ 	 */
+ 	q->queue_tags = tags;
+ 	q->queue_flags |= (1 << QUEUE_FLAG_QUEUED);
++	INIT_LIST_HEAD(&q->tag_busy_list);
+ 	return 0;
+ fail:
+ 	kfree(tags);
+@@ -1152,7 +1151,7 @@ int blk_queue_start_tag(struct request_queue *q, struct request *rq)
+ 	rq->tag = tag;
+ 	bqt->tag_index[tag] = rq;
+ 	blkdev_dequeue_request(rq);
+-	list_add(&rq->queuelist, &bqt->busy_list);
++	list_add(&rq->queuelist, &q->tag_busy_list);
+ 	bqt->busy++;
+ 	return 0;
+ }
+@@ -1173,11 +1172,10 @@ EXPORT_SYMBOL(blk_queue_start_tag);
+  **/
+ void blk_queue_invalidate_tags(struct request_queue *q)
+ {
+-	struct blk_queue_tag *bqt = q->queue_tags;
+ 	struct list_head *tmp, *n;
+ 	struct request *rq;
+ 
+-	list_for_each_safe(tmp, n, &bqt->busy_list) {
++	list_for_each_safe(tmp, n, &q->tag_busy_list) {
+ 		rq = list_entry_rq(tmp);
+ 
+ 		if (rq->tag == -1) {
+diff --git a/fs/locks.c b/fs/locks.c
+index c795eaa..494f250 100644
+--- a/fs/locks.c
++++ b/fs/locks.c
+@@ -694,11 +694,20 @@ EXPORT_SYMBOL(posix_test_lock);
+  * Note: the above assumption may not be true when handling lock requests
+  * from a broken NFS client. But broken NFS clients have a lot more to
+  * worry about than proper deadlock detection anyway... --okir
++ *
++ * However, the failure of this assumption (also possible in the case of
++ * multiple tasks sharing the same open file table) also means there's no
++ * guarantee that the loop below will terminate.  As a hack, we give up
++ * after a few iterations.
+  */
++
++#define MAX_DEADLK_ITERATIONS 10
++
+ static int posix_locks_deadlock(struct file_lock *caller_fl,
+ 				struct file_lock *block_fl)
+ {
+ 	struct list_head *tmp;
++	int i = 0;
+ 
+ next_task:
+ 	if (posix_same_owner(caller_fl, block_fl))
+@@ -706,6 +715,8 @@ next_task:
+ 	list_for_each(tmp, &blocked_list) {
+ 		struct file_lock *fl = list_entry(tmp, struct file_lock, fl_link);
+ 		if (posix_same_owner(fl, block_fl)) {
++			if (i++ > MAX_DEADLK_ITERATIONS)
++				return 0;
+ 			fl = fl->fl_next;
+ 			block_fl = fl;
+ 			goto next_task;
+diff --git a/fs/proc/array.c b/fs/proc/array.c
+index ee4814d..20d7ae4 100644
+--- a/fs/proc/array.c
++++ b/fs/proc/array.c
+@@ -351,7 +351,8 @@ static cputime_t task_utime(struct task_struct *p)
+ 	}
+ 	utime = (clock_t)temp;
+ 
+-	return clock_t_to_cputime(utime);
++	p->prev_utime = max(p->prev_utime, clock_t_to_cputime(utime));
++	return p->prev_utime;
+ }
+ 
+ static cputime_t task_stime(struct task_struct *p)
+@@ -366,7 +367,8 @@ static cputime_t task_stime(struct task_struct *p)
+ 	stime = nsec_to_clock_t(p->se.sum_exec_runtime) -
+ 			cputime_to_clock_t(task_utime(p));
+ 
+-	return clock_t_to_cputime(stime);
++	p->prev_stime = max(p->prev_stime, clock_t_to_cputime(stime));
++	return p->prev_stime;
+ }
+ #endif
+ 
+diff --git a/fs/splice.c b/fs/splice.c
+index e95a362..02c39ae 100644
+--- a/fs/splice.c
++++ b/fs/splice.c
+@@ -1390,10 +1390,10 @@ static int pipe_to_user(struct pipe_inode_info *pipe, struct pipe_buffer *buf,
+ 	if (copy_to_user(sd->u.userptr, src + buf->offset, sd->len))
+ 		ret = -EFAULT;
+ 
++	buf->ops->unmap(pipe, buf, src);
+ out:
+ 	if (ret > 0)
+ 		sd->u.userptr += ret;
+-	buf->ops->unmap(pipe, buf, src);
+ 	return ret;
+ }
+ 
+diff --git a/include/linux/blkdev.h b/include/linux/blkdev.h
+index b126c6f..d26bbb0 100644
+--- a/include/linux/blkdev.h
++++ b/include/linux/blkdev.h
+@@ -356,7 +356,6 @@ enum blk_queue_state {
+ struct blk_queue_tag {
+ 	struct request **tag_index;	/* map of busy tags */
+ 	unsigned long *tag_map;		/* bit map of free/busy tags */
+-	struct list_head busy_list;	/* fifo list of busy tags */
+ 	int busy;			/* current depth */
+ 	int max_depth;			/* what we will send to device */
+ 	int real_max_depth;		/* what the array can hold */
+@@ -451,6 +450,7 @@ struct request_queue
+ 	unsigned int		dma_alignment;
+ 
+ 	struct blk_queue_tag	*queue_tags;
++	struct list_head	tag_busy_list;
+ 
+ 	unsigned int		nr_sorted;
+ 	unsigned int		in_flight;
+diff --git a/include/linux/sched.h b/include/linux/sched.h
+index 313c6b6..f509fbd 100644
+--- a/include/linux/sched.h
++++ b/include/linux/sched.h
+@@ -1022,6 +1022,7 @@ struct task_struct {
+ 
+ 	unsigned int rt_priority;
+ 	cputime_t utime, stime;
++	cputime_t prev_utime, prev_stime;
+ 	unsigned long nvcsw, nivcsw; /* context switch counts */
+ 	struct timespec start_time; 		/* monotonic time */
+ 	struct timespec real_start_time;	/* boot based time */
+diff --git a/kernel/fork.c b/kernel/fork.c
+index 33f12f4..f299d45 100644
+--- a/kernel/fork.c
++++ b/kernel/fork.c
+@@ -1045,6 +1045,8 @@ static struct task_struct *copy_process(unsigned long clone_flags,
+ 
+ 	p->utime = cputime_zero;
+ 	p->stime = cputime_zero;
++	p->prev_utime = cputime_zero;
++	p->prev_stime = cputime_zero;
+ 
+ #ifdef CONFIG_TASK_XACCT
+ 	p->rchar = 0;		/* I/O counter: bytes read */
+diff --git a/kernel/futex_compat.c b/kernel/futex_compat.c
+index 2c2e295..f938c23 100644
+--- a/kernel/futex_compat.c
++++ b/kernel/futex_compat.c
+@@ -29,6 +29,15 @@ fetch_robust_entry(compat_uptr_t *uentry, struct robust_list __user **entry,
+ 	return 0;
+ }
+ 
++static void __user *futex_uaddr(struct robust_list *entry,
++				compat_long_t futex_offset)
++{
++	compat_uptr_t base = ptr_to_compat(entry);
++	void __user *uaddr = compat_ptr(base + futex_offset);
++
++	return uaddr;
++}
++
+ /*
+  * Walk curr->robust_list (very carefully, it's a userspace list!)
+  * and mark any locks found there dead, and notify any waiters.
+@@ -75,11 +84,13 @@ void compat_exit_robust_list(struct task_struct *curr)
+ 		 * A pending lock might already be on the list, so
+ 		 * dont process it twice:
+ 		 */
+-		if (entry != pending)
+-			if (handle_futex_death((void __user *)entry + futex_offset,
+-						curr, pi))
+-				return;
++		if (entry != pending) {
++			void __user *uaddr = futex_uaddr(entry,
++							 futex_offset);
+ 
++			if (handle_futex_death(uaddr, curr, pi))
++				return;
++		}
+ 		if (rc)
+ 			return;
+ 		uentry = next_uentry;
+@@ -93,9 +104,11 @@ void compat_exit_robust_list(struct task_struct *curr)
+ 
+ 		cond_resched();
+ 	}
+-	if (pending)
+-		handle_futex_death((void __user *)pending + futex_offset,
+-				   curr, pip);
++	if (pending) {
++		void __user *uaddr = futex_uaddr(pending, futex_offset);
++
++		handle_futex_death(uaddr, curr, pip);
++	}
+ }
+ 
+ asmlinkage long
+diff --git a/kernel/lockdep.c b/kernel/lockdep.c
+index 734da57..42ae4a5 100644
+--- a/kernel/lockdep.c
++++ b/kernel/lockdep.c
+@@ -1521,7 +1521,7 @@ cache_hit:
+ }
+ 
+ static int validate_chain(struct task_struct *curr, struct lockdep_map *lock,
+-	       	struct held_lock *hlock, int chain_head)
++	       	struct held_lock *hlock, int chain_head, u64 chain_key)
+ {
+ 	/*
+ 	 * Trylock needs to maintain the stack of held locks, but it
+@@ -1534,7 +1534,7 @@ static int validate_chain(struct task_struct *curr, struct lockdep_map *lock,
+ 	 * graph_lock for us)
+ 	 */
+ 	if (!hlock->trylock && (hlock->check == 2) &&
+-			lookup_chain_cache(curr->curr_chain_key, hlock->class)) {
++			lookup_chain_cache(chain_key, hlock->class)) {
+ 		/*
+ 		 * Check whether last held lock:
+ 		 *
+@@ -1576,7 +1576,7 @@ static int validate_chain(struct task_struct *curr, struct lockdep_map *lock,
+ #else
+ static inline int validate_chain(struct task_struct *curr,
+ 	       	struct lockdep_map *lock, struct held_lock *hlock,
+-		int chain_head)
++		int chain_head, u64 chain_key)
+ {
+ 	return 1;
+ }
+@@ -2450,11 +2450,11 @@ static int __lock_acquire(struct lockdep_map *lock, unsigned int subclass,
+ 		chain_head = 1;
+ 	}
+ 	chain_key = iterate_chain_key(chain_key, id);
+-	curr->curr_chain_key = chain_key;
+ 
+-	if (!validate_chain(curr, lock, hlock, chain_head))
++	if (!validate_chain(curr, lock, hlock, chain_head, chain_key))
+ 		return 0;
+ 
++	curr->curr_chain_key = chain_key;
+ 	curr->lockdep_depth++;
+ 	check_chain_key(curr);
+ #ifdef CONFIG_DEBUG_LOCKDEP
+diff --git a/kernel/params.c b/kernel/params.c
+index 4e57732..5e5651f 100644
+--- a/kernel/params.c
++++ b/kernel/params.c
+@@ -595,13 +595,16 @@ static void __init param_sysfs_builtin(void)
+ 
+ 	for (i=0; i < __stop___param - __start___param; i++) {
+ 		char *dot;
++		size_t max_name_len;
+ 
+ 		kp = &__start___param[i];
++		max_name_len =
++			min_t(size_t, MAX_KBUILD_MODNAME, strlen(kp->name));
+ 
+-		/* We do not handle args without periods. */
+-		dot = memchr(kp->name, '.', MAX_KBUILD_MODNAME);
++		dot = memchr(kp->name, '.', max_name_len);
+ 		if (!dot) {
+-			DEBUGP("couldn't find period in %s\n", kp->name);
++			DEBUGP("couldn't find period in first %d characters "
++			       "of %s\n", MAX_KBUILD_MODNAME, kp->name);
+ 			continue;
+ 		}
+ 		name_len = dot - kp->name;
+diff --git a/kernel/softlockup.c b/kernel/softlockup.c
+index 708d488..e557c44 100644
+--- a/kernel/softlockup.c
++++ b/kernel/softlockup.c
+@@ -80,10 +80,11 @@ void softlockup_tick(void)
+ 	print_timestamp = per_cpu(print_timestamp, this_cpu);
+ 
+ 	/* report at most once a second */
+-	if (print_timestamp < (touch_timestamp + 1) ||
+-		did_panic ||
+-			!per_cpu(watchdog_task, this_cpu))
++	if ((print_timestamp >= touch_timestamp &&
++			print_timestamp < (touch_timestamp + 1)) ||
++			did_panic || !per_cpu(watchdog_task, this_cpu)) {
+ 		return;
++	}
+ 
+ 	/* do not print during early bootup: */
+ 	if (unlikely(system_state != SYSTEM_RUNNING)) {
+diff --git a/mm/filemap.c b/mm/filemap.c
+index 15c8413..14ca63f 100644
+--- a/mm/filemap.c
++++ b/mm/filemap.c
+@@ -1312,7 +1312,7 @@ int filemap_fault(struct vm_area_struct *vma, struct vm_fault *vmf)
+ 
+ 	size = (i_size_read(inode) + PAGE_CACHE_SIZE - 1) >> PAGE_CACHE_SHIFT;
+ 	if (vmf->pgoff >= size)
+-		goto outside_data_content;
++		return VM_FAULT_SIGBUS;
+ 
+ 	/* If we don't want any read-ahead, don't bother */
+ 	if (VM_RandomReadHint(vma))
+@@ -1389,7 +1389,7 @@ retry_find:
+ 	if (unlikely(vmf->pgoff >= size)) {
+ 		unlock_page(page);
+ 		page_cache_release(page);
+-		goto outside_data_content;
++		return VM_FAULT_SIGBUS;
+ 	}
+ 
+ 	/*
+@@ -1400,15 +1400,6 @@ retry_find:
+ 	vmf->page = page;
+ 	return ret | VM_FAULT_LOCKED;
+ 
+-outside_data_content:
+-	/*
+-	 * An external ptracer can access pages that normally aren't
+-	 * accessible..
+-	 */
+-	if (vma->vm_mm == current->mm)
+-		return VM_FAULT_SIGBUS;
+-
+-	/* Fall through to the non-read-ahead case */
+ no_cached_page:
+ 	/*
+ 	 * We're only likely to ever get here if MADV_RANDOM is in
+diff --git a/mm/page-writeback.c b/mm/page-writeback.c
+index 4472036..97ddc58 100644
+--- a/mm/page-writeback.c
++++ b/mm/page-writeback.c
+@@ -672,8 +672,10 @@ retry:
+ 
+ 			ret = (*writepage)(page, wbc, data);
+ 
+-			if (unlikely(ret == AOP_WRITEPAGE_ACTIVATE))
++			if (unlikely(ret == AOP_WRITEPAGE_ACTIVATE)) {
+ 				unlock_page(page);
++				ret = 0;
++			}
+ 			if (ret || (--(wbc->nr_to_write) <= 0))
+ 				done = 1;
+ 			if (wbc->nonblocking && bdi_write_congested(bdi)) {
+diff --git a/mm/shmem.c b/mm/shmem.c
+index fcd19d3..95558e4 100644
+--- a/mm/shmem.c
++++ b/mm/shmem.c
+@@ -916,6 +916,21 @@ static int shmem_writepage(struct page *page, struct writeback_control *wbc)
+ 	struct inode *inode;
+ 
+ 	BUG_ON(!PageLocked(page));
++	/*
++	 * shmem_backing_dev_info's capabilities prevent regular writeback or
++	 * sync from ever calling shmem_writepage; but a stacking filesystem
++	 * may use the ->writepage of its underlying filesystem, in which case
++	 * we want to do nothing when that underlying filesystem is tmpfs
++	 * (writing out to swap is useful as a response to memory pressure, but
++	 * of no use to stabilize the data) - just redirty the page, unlock it
++	 * and claim success in this case.  AOP_WRITEPAGE_ACTIVATE, and the
++	 * page_mapped check below, must be avoided unless we're in reclaim.
++	 */
++	if (!wbc->for_reclaim) {
++		set_page_dirty(page);
++		unlock_page(page);
++		return 0;
++	}
+ 	BUG_ON(page_mapped(page));
+ 
+ 	mapping = page->mapping;
+diff --git a/mm/slub.c b/mm/slub.c
+index addb20a..c1f2fda 100644
+--- a/mm/slub.c
++++ b/mm/slub.c
+@@ -1501,28 +1501,8 @@ new_slab:
+ 	page = new_slab(s, gfpflags, node);
+ 	if (page) {
+ 		cpu = smp_processor_id();
+-		if (s->cpu_slab[cpu]) {
+-			/*
+-			 * Someone else populated the cpu_slab while we
+-			 * enabled interrupts, or we have gotten scheduled
+-			 * on another cpu. The page may not be on the
+-			 * requested node even if __GFP_THISNODE was
+-			 * specified. So we need to recheck.
+-			 */
+-			if (node == -1 ||
+-				page_to_nid(s->cpu_slab[cpu]) == node) {
+-				/*
+-				 * Current cpuslab is acceptable and we
+-				 * want the current one since its cache hot
+-				 */
+-				discard_slab(s, page);
+-				page = s->cpu_slab[cpu];
+-				slab_lock(page);
+-				goto load_freelist;
+-			}
+-			/* New slab does not fit our expectations */
++		if (s->cpu_slab[cpu])
+ 			flush_slab(s, s->cpu_slab[cpu], cpu);
+-		}
+ 		slab_lock(page);
+ 		SetSlabFrozen(page);
+ 		s->cpu_slab[cpu] = page;

Added: dists/sid/linux-2.6/debian/patches/bugfix/all/stable/2.6.23.3.patch
==============================================================================
--- (empty file)
+++ dists/sid/linux-2.6/debian/patches/bugfix/all/stable/2.6.23.3.patch	Mon Nov 26 20:06:56 2007
@@ -0,0 +1,1001 @@
+diff --git a/Makefile b/Makefile
+index c6d545c..b0c2c32 100644
+diff --git a/arch/i386/boot/boot.h b/arch/i386/boot/boot.h
+index 20bab94..3eeb9e5 100644
+--- a/arch/i386/boot/boot.h
++++ b/arch/i386/boot/boot.h
+@@ -17,6 +17,8 @@
+ #ifndef BOOT_BOOT_H
+ #define BOOT_BOOT_H
+ 
++#define STACK_SIZE	512	/* Minimum number of bytes for stack */
++
+ #ifndef __ASSEMBLY__
+ 
+ #include <stdarg.h>
+@@ -198,8 +200,6 @@ static inline int isdigit(int ch)
+ }
+ 
+ /* Heap -- available for dynamic lists. */
+-#define STACK_SIZE	512	/* Minimum number of bytes for stack */
+-
+ extern char _end[];
+ extern char *HEAP;
+ extern char *heap_end;
+@@ -216,9 +216,9 @@ static inline char *__get_heap(size_t s, size_t a, size_t n)
+ #define GET_HEAP(type, n) \
+ 	((type *)__get_heap(sizeof(type),__alignof__(type),(n)))
+ 
+-static inline int heap_free(void)
++static inline bool heap_free(size_t n)
+ {
+-	return heap_end-HEAP;
++	return (int)(heap_end-HEAP) >= (int)n;
+ }
+ 
+ /* copy.S */
+diff --git a/arch/i386/boot/header.S b/arch/i386/boot/header.S
+index f3140e5..fff7059 100644
+--- a/arch/i386/boot/header.S
++++ b/arch/i386/boot/header.S
+@@ -173,7 +173,8 @@ ramdisk_size:	.long	0		# its size in bytes
+ bootsect_kludge:
+ 		.long	0		# obsolete
+ 
+-heap_end_ptr:	.word	_end+1024	# (Header version 0x0201 or later)
++heap_end_ptr:	.word	_end+STACK_SIZE-512
++					# (Header version 0x0201 or later)
+ 					# space from here (exclusive) down to
+ 					# end of setup code can be used by setup
+ 					# for local heap purposes.
+@@ -225,28 +226,53 @@ start_of_setup:
+ 	int	$0x13
+ #endif
+ 
+-# We will have entered with %cs = %ds+0x20, normalize %cs so
+-# it is on par with the other segments.
+-	pushw	%ds
+-	pushw	$setup2
+-	lretw
+-
+-setup2:
+ # Force %es = %ds
+ 	movw	%ds, %ax
+ 	movw	%ax, %es
+ 	cld
+ 
+-# Stack paranoia: align the stack and make sure it is good
+-# for both 16- and 32-bit references.  In particular, if we
+-# were meant to have been using the full 16-bit segment, the
+-# caller might have set %sp to zero, which breaks %esp-based
+-# references.
+-	andw	$~3, %sp	# dword align (might as well...)
+-	jnz	1f
+-	movw	$0xfffc, %sp	# Make sure we're not zero
+-1:	movzwl	%sp, %esp	# Clear upper half of %esp
+-	sti
++# Apparently some ancient versions of LILO invoked the kernel
++# with %ss != %ds, which happened to work by accident for the
++# old code.  If the CAN_USE_HEAP flag is set in loadflags, or
++# %ss != %ds, then adjust the stack pointer.
++
++	# Smallest possible stack we can tolerate
++	movw	$(_end+STACK_SIZE), %cx
++
++	movw	heap_end_ptr, %dx
++	addw	$512, %dx
++	jnc	1f
++	xorw	%dx, %dx	# Wraparound - whole segment available
++1:	testb	$CAN_USE_HEAP, loadflags
++	jnz	2f
++
++	# No CAN_USE_HEAP
++	movw	%ss, %dx
++	cmpw	%ax, %dx	# %ds == %ss?
++	movw	%sp, %dx
++	# If so, assume %sp is reasonably set, otherwise use
++	# the smallest possible stack.
++	jne	4f		# -> Smallest possible stack...
++
++	# Make sure the stack is at least minimum size.  Take a value
++	# of zero to mean "full segment."
++2:
++	andw	$~3, %dx	# dword align (might as well...)
++	jnz	3f
++	movw	$0xfffc, %dx	# Make sure we're not zero
++3:	cmpw	%cx, %dx
++	jnb	5f
++4:	movw	%cx, %dx	# Minimum value we can possibly use
++5:	movw	%ax, %ss
++	movzwl	%dx, %esp	# Clear upper half of %esp
++	sti			# Now we should have a working stack
++
++# We will have entered with %cs = %ds+0x20, normalize %cs so
++# it is on par with the other segments.
++	pushw	%ds
++	pushw	$6f
++	lretw
++6:
+ 
+ # Check signature at end of setup
+ 	cmpl	$0x5a5aaa55, setup_sig
+diff --git a/arch/i386/boot/video-bios.c b/arch/i386/boot/video-bios.c
+index 68e65d9..ed0672a 100644
+--- a/arch/i386/boot/video-bios.c
++++ b/arch/i386/boot/video-bios.c
+@@ -79,7 +79,7 @@ static int bios_probe(void)
+ 	video_bios.modes = GET_HEAP(struct mode_info, 0);
+ 
+ 	for (mode = 0x14; mode <= 0x7f; mode++) {
+-		if (heap_free() < sizeof(struct mode_info))
++		if (!heap_free(sizeof(struct mode_info)))
+ 			break;
+ 
+ 		if (mode_defined(VIDEO_FIRST_BIOS+mode))
+diff --git a/arch/i386/boot/video-vesa.c b/arch/i386/boot/video-vesa.c
+index 1921907..4716b9a 100644
+--- a/arch/i386/boot/video-vesa.c
++++ b/arch/i386/boot/video-vesa.c
+@@ -57,7 +57,7 @@ static int vesa_probe(void)
+ 	while ((mode = rdfs16(mode_ptr)) != 0xffff) {
+ 		mode_ptr += 2;
+ 
+-		if (heap_free() < sizeof(struct mode_info))
++		if (!heap_free(sizeof(struct mode_info)))
+ 			break;	/* Heap full, can't save mode info */
+ 
+ 		if (mode & ~0x1ff)
+diff --git a/arch/i386/boot/video.c b/arch/i386/boot/video.c
+index e4ba897..ad9712f 100644
+--- a/arch/i386/boot/video.c
++++ b/arch/i386/boot/video.c
+@@ -371,7 +371,7 @@ static void save_screen(void)
+ 	saved.curx = boot_params.screen_info.orig_x;
+ 	saved.cury = boot_params.screen_info.orig_y;
+ 
+-	if (heap_free() < saved.x*saved.y*sizeof(u16)+512)
++	if (!heap_free(saved.x*saved.y*sizeof(u16)+512))
+ 		return;		/* Not enough heap to save the screen */
+ 
+ 	saved.data = GET_HEAP(u16, saved.x*saved.y);
+diff --git a/arch/i386/kernel/tsc.c b/arch/i386/kernel/tsc.c
+index a39280b..7f6add1 100644
+--- a/arch/i386/kernel/tsc.c
++++ b/arch/i386/kernel/tsc.c
+@@ -137,7 +137,7 @@ unsigned long native_calculate_cpu_khz(void)
+ {
+ 	unsigned long long start, end;
+ 	unsigned long count;
+-	u64 delta64;
++	u64 delta64 = (u64)ULLONG_MAX;
+ 	int i;
+ 	unsigned long flags;
+ 
+@@ -149,6 +149,7 @@ unsigned long native_calculate_cpu_khz(void)
+ 		rdtscll(start);
+ 		mach_countup(&count);
+ 		rdtscll(end);
++		delta64 = min(delta64, (end - start));
+ 	}
+ 	/*
+ 	 * Error: ECTCNEVERSET
+@@ -159,8 +160,6 @@ unsigned long native_calculate_cpu_khz(void)
+ 	if (count <= 1)
+ 		goto err;
+ 
+-	delta64 = end - start;
+-
+ 	/* cpu freq too fast: */
+ 	if (delta64 > (1ULL<<32))
+ 		goto err;
+diff --git a/arch/i386/xen/enlighten.c b/arch/i386/xen/enlighten.c
+index f01bfcd..1ba2408 100644
+--- a/arch/i386/xen/enlighten.c
++++ b/arch/i386/xen/enlighten.c
+@@ -56,7 +56,23 @@ DEFINE_PER_CPU(enum paravirt_lazy_mode, xen_lazy_mode);
+ 
+ DEFINE_PER_CPU(struct vcpu_info *, xen_vcpu);
+ DEFINE_PER_CPU(struct vcpu_info, xen_vcpu_info);
+-DEFINE_PER_CPU(unsigned long, xen_cr3);
++
++/*
++ * Note about cr3 (pagetable base) values:
++ *
++ * xen_cr3 contains the current logical cr3 value; it contains the
++ * last set cr3.  This may not be the current effective cr3, because
++ * its update may be being lazily deferred.  However, a vcpu looking
++ * at its own cr3 can use this value knowing that it everything will
++ * be self-consistent.
++ *
++ * xen_current_cr3 contains the actual vcpu cr3; it is set once the
++ * hypercall to set the vcpu cr3 is complete (so it may be a little
++ * out of date, but it will never be set early).  If one vcpu is
++ * looking at another vcpu's cr3 value, it should use this variable.
++ */
++DEFINE_PER_CPU(unsigned long, xen_cr3);	 /* cr3 stored as physaddr */
++DEFINE_PER_CPU(unsigned long, xen_current_cr3);	 /* actual vcpu cr3 */
+ 
+ struct start_info *xen_start_info;
+ EXPORT_SYMBOL_GPL(xen_start_info);
+@@ -100,7 +116,7 @@ static void __init xen_vcpu_setup(int cpu)
+ 	info.mfn = virt_to_mfn(vcpup);
+ 	info.offset = offset_in_page(vcpup);
+ 
+-	printk(KERN_DEBUG "trying to map vcpu_info %d at %p, mfn %x, offset %d\n",
++	printk(KERN_DEBUG "trying to map vcpu_info %d at %p, mfn %llx, offset %d\n",
+ 	       cpu, vcpup, info.mfn, info.offset);
+ 
+ 	/* Check to see if the hypervisor will put the vcpu_info
+@@ -632,32 +648,36 @@ static unsigned long xen_read_cr3(void)
+ 	return x86_read_percpu(xen_cr3);
+ }
+ 
++static void set_current_cr3(void *v)
++{
++	x86_write_percpu(xen_current_cr3, (unsigned long)v);
++}
++
+ static void xen_write_cr3(unsigned long cr3)
+ {
++	struct mmuext_op *op;
++	struct multicall_space mcs;
++	unsigned long mfn = pfn_to_mfn(PFN_DOWN(cr3));
++
+ 	BUG_ON(preemptible());
+ 
+-	if (cr3 == x86_read_percpu(xen_cr3)) {
+-		/* just a simple tlb flush */
+-		xen_flush_tlb();
+-		return;
+-	}
++	mcs = xen_mc_entry(sizeof(*op));  /* disables interrupts */
+ 
++	/* Update while interrupts are disabled, so its atomic with
++	   respect to ipis */
+ 	x86_write_percpu(xen_cr3, cr3);
+ 
++	op = mcs.args;
++	op->cmd = MMUEXT_NEW_BASEPTR;
++	op->arg1.mfn = mfn;
+ 
+-	{
+-		struct mmuext_op *op;
+-		struct multicall_space mcs = xen_mc_entry(sizeof(*op));
+-		unsigned long mfn = pfn_to_mfn(PFN_DOWN(cr3));
+-
+-		op = mcs.args;
+-		op->cmd = MMUEXT_NEW_BASEPTR;
+-		op->arg1.mfn = mfn;
++	MULTI_mmuext_op(mcs.mc, op, 1, NULL, DOMID_SELF);
+ 
+-		MULTI_mmuext_op(mcs.mc, op, 1, NULL, DOMID_SELF);
++	/* Update xen_update_cr3 once the batch has actually
++	   been submitted. */
++	xen_mc_callback(set_current_cr3, (void *)cr3);
+ 
+-		xen_mc_issue(PARAVIRT_LAZY_CPU);
+-	}
++	xen_mc_issue(PARAVIRT_LAZY_CPU);  /* interrupts restored */
+ }
+ 
+ /* Early in boot, while setting up the initial pagetable, assume
+@@ -1113,6 +1133,7 @@ asmlinkage void __init xen_start_kernel(void)
+ 	/* keep using Xen gdt for now; no urgent need to change it */
+ 
+ 	x86_write_percpu(xen_cr3, __pa(pgd));
++	x86_write_percpu(xen_current_cr3, __pa(pgd));
+ 
+ #ifdef CONFIG_SMP
+ 	/* Don't do the full vcpu_info placement stuff until we have a
+diff --git a/arch/i386/xen/mmu.c b/arch/i386/xen/mmu.c
+index 874db0c..c476dfa 100644
+--- a/arch/i386/xen/mmu.c
++++ b/arch/i386/xen/mmu.c
+@@ -515,20 +515,43 @@ static void drop_other_mm_ref(void *info)
+ 
+ 	if (__get_cpu_var(cpu_tlbstate).active_mm == mm)
+ 		leave_mm(smp_processor_id());
++
++	/* If this cpu still has a stale cr3 reference, then make sure
++	   it has been flushed. */
++	if (x86_read_percpu(xen_current_cr3) == __pa(mm->pgd)) {
++		load_cr3(swapper_pg_dir);
++		arch_flush_lazy_cpu_mode();
++	}
+ }
+ 
+ static void drop_mm_ref(struct mm_struct *mm)
+ {
++	cpumask_t mask;
++	unsigned cpu;
++
+ 	if (current->active_mm == mm) {
+ 		if (current->mm == mm)
+ 			load_cr3(swapper_pg_dir);
+ 		else
+ 			leave_mm(smp_processor_id());
++		arch_flush_lazy_cpu_mode();
++	}
++
++	/* Get the "official" set of cpus referring to our pagetable. */
++	mask = mm->cpu_vm_mask;
++
++	/* It's possible that a vcpu may have a stale reference to our
++	   cr3, because its in lazy mode, and it hasn't yet flushed
++	   its set of pending hypercalls yet.  In this case, we can
++	   look at its actual current cr3 value, and force it to flush
++	   if needed. */
++	for_each_online_cpu(cpu) {
++		if (per_cpu(xen_current_cr3, cpu) == __pa(mm->pgd))
++			cpu_set(cpu, mask);
+ 	}
+ 
+-	if (!cpus_empty(mm->cpu_vm_mask))
+-		xen_smp_call_function_mask(mm->cpu_vm_mask, drop_other_mm_ref,
+-					   mm, 1);
++	if (!cpus_empty(mask))
++		xen_smp_call_function_mask(mask, drop_other_mm_ref, mm, 1);
+ }
+ #else
+ static void drop_mm_ref(struct mm_struct *mm)
+diff --git a/arch/i386/xen/multicalls.c b/arch/i386/xen/multicalls.c
+index c837e8e..ce9c4b4 100644
+--- a/arch/i386/xen/multicalls.c
++++ b/arch/i386/xen/multicalls.c
+@@ -32,7 +32,11 @@
+ struct mc_buffer {
+ 	struct multicall_entry entries[MC_BATCH];
+ 	u64 args[MC_ARGS];
+-	unsigned mcidx, argidx;
++	struct callback {
++		void (*fn)(void *);
++		void *data;
++	} callbacks[MC_BATCH];
++	unsigned mcidx, argidx, cbidx;
+ };
+ 
+ static DEFINE_PER_CPU(struct mc_buffer, mc_buffer);
+@@ -43,6 +47,7 @@ void xen_mc_flush(void)
+ 	struct mc_buffer *b = &__get_cpu_var(mc_buffer);
+ 	int ret = 0;
+ 	unsigned long flags;
++	int i;
+ 
+ 	BUG_ON(preemptible());
+ 
+@@ -51,8 +56,6 @@ void xen_mc_flush(void)
+ 	local_irq_save(flags);
+ 
+ 	if (b->mcidx) {
+-		int i;
+-
+ 		if (HYPERVISOR_multicall(b->entries, b->mcidx) != 0)
+ 			BUG();
+ 		for (i = 0; i < b->mcidx; i++)
+@@ -65,6 +68,13 @@ void xen_mc_flush(void)
+ 
+ 	local_irq_restore(flags);
+ 
++	for(i = 0; i < b->cbidx; i++) {
++		struct callback *cb = &b->callbacks[i];
++
++		(*cb->fn)(cb->data);
++	}
++	b->cbidx = 0;
++
+ 	BUG_ON(ret);
+ }
+ 
+@@ -88,3 +98,16 @@ struct multicall_space __xen_mc_entry(size_t args)
+ 
+ 	return ret;
+ }
++
++void xen_mc_callback(void (*fn)(void *), void *data)
++{
++	struct mc_buffer *b = &__get_cpu_var(mc_buffer);
++	struct callback *cb;
++
++	if (b->cbidx == MC_BATCH)
++		xen_mc_flush();
++
++	cb = &b->callbacks[b->cbidx++];
++	cb->fn = fn;
++	cb->data = data;
++}
+diff --git a/arch/i386/xen/multicalls.h b/arch/i386/xen/multicalls.h
+index e6f7530..e3ed9c8 100644
+--- a/arch/i386/xen/multicalls.h
++++ b/arch/i386/xen/multicalls.h
+@@ -42,4 +42,7 @@ static inline void xen_mc_issue(unsigned mode)
+ 	local_irq_restore(x86_read_percpu(xen_mc_irq_flags));
+ }
+ 
++/* Set up a callback to be called when the current batch is flushed */
++void xen_mc_callback(void (*fn)(void *), void *data);
++
+ #endif /* _XEN_MULTICALLS_H */
+diff --git a/arch/i386/xen/xen-ops.h b/arch/i386/xen/xen-ops.h
+index b9aaea4..c69708b 100644
+--- a/arch/i386/xen/xen-ops.h
++++ b/arch/i386/xen/xen-ops.h
+@@ -11,6 +11,7 @@ void xen_copy_trap_info(struct trap_info *traps);
+ 
+ DECLARE_PER_CPU(struct vcpu_info *, xen_vcpu);
+ DECLARE_PER_CPU(unsigned long, xen_cr3);
++DECLARE_PER_CPU(unsigned long, xen_current_cr3);
+ 
+ extern struct start_info *xen_start_info;
+ extern struct shared_info *HYPERVISOR_shared_info;
+diff --git a/arch/mips/mm/c-r4k.c b/arch/mips/mm/c-r4k.c
+index bad5719..9da2a42 100644
+--- a/arch/mips/mm/c-r4k.c
++++ b/arch/mips/mm/c-r4k.c
+@@ -360,11 +360,26 @@ static void r4k___flush_cache_all(void)
+ 	r4k_on_each_cpu(local_r4k___flush_cache_all, NULL, 1, 1);
+ }
+ 
++static inline int has_valid_asid(const struct mm_struct *mm)
++{
++#if defined(CONFIG_MIPS_MT_SMP) || defined(CONFIG_MIPS_MT_SMTC)
++	int i;
++
++	for_each_online_cpu(i)
++		if (cpu_context(i, mm))
++			return 1;
++
++	return 0;
++#else
++	return cpu_context(smp_processor_id(), mm);
++#endif
++}
++
+ static inline void local_r4k_flush_cache_range(void * args)
+ {
+ 	struct vm_area_struct *vma = args;
+ 
+-	if (!(cpu_context(smp_processor_id(), vma->vm_mm)))
++	if (!(has_valid_asid(vma->vm_mm)))
+ 		return;
+ 
+ 	r4k_blast_dcache();
+@@ -383,7 +398,7 @@ static inline void local_r4k_flush_cache_mm(void * args)
+ {
+ 	struct mm_struct *mm = args;
+ 
+-	if (!cpu_context(smp_processor_id(), mm))
++	if (!has_valid_asid(mm))
+ 		return;
+ 
+ 	/*
+@@ -434,7 +449,7 @@ static inline void local_r4k_flush_cache_page(void *args)
+ 	 * If ownes no valid ASID yet, cannot possibly have gotten
+ 	 * this page into the cache.
+ 	 */
+-	if (cpu_context(smp_processor_id(), mm) == 0)
++	if (!has_valid_asid(mm))
+ 		return;
+ 
+ 	addr &= PAGE_MASK;
+diff --git a/arch/powerpc/math-emu/math.c b/arch/powerpc/math-emu/math.c
+index 69058b2..381306b 100644
+--- a/arch/powerpc/math-emu/math.c
++++ b/arch/powerpc/math-emu/math.c
+@@ -407,11 +407,16 @@ do_mathemu(struct pt_regs *regs)
+ 
+ 	case XE:
+ 		idx = (insn >> 16) & 0x1f;
+-		if (!idx)
+-			goto illegal;
+-
+ 		op0 = (void *)&current->thread.fpr[(insn >> 21) & 0x1f];
+-		op1 = (void *)(regs->gpr[idx] + regs->gpr[(insn >> 11) & 0x1f]);
++		if (!idx) {
++			if (((insn >> 1) & 0x3ff) == STFIWX)
++				op1 = (void *)(regs->gpr[(insn >> 11) & 0x1f]);
++			else
++				goto illegal;
++		} else {
++			op1 = (void *)(regs->gpr[idx] + regs->gpr[(insn >> 11) & 0x1f]);
++		}
++
+ 		break;
+ 
+ 	case XEU:
+diff --git a/arch/powerpc/platforms/cell/axon_msi.c b/arch/powerpc/platforms/cell/axon_msi.c
+index 4c9ab5b..c767065 100644
+--- a/arch/powerpc/platforms/cell/axon_msi.c
++++ b/arch/powerpc/platforms/cell/axon_msi.c
+@@ -126,7 +126,7 @@ static struct axon_msic *find_msi_translator(struct pci_dev *dev)
+ 	const phandle *ph;
+ 	struct axon_msic *msic = NULL;
+ 
+-	dn = pci_device_to_OF_node(dev);
++	dn = of_node_get(pci_device_to_OF_node(dev));
+ 	if (!dn) {
+ 		dev_dbg(&dev->dev, "axon_msi: no pci_dn found\n");
+ 		return NULL;
+@@ -183,7 +183,7 @@ static int setup_msi_msg_address(struct pci_dev *dev, struct msi_msg *msg)
+ 	int len;
+ 	const u32 *prop;
+ 
+-	dn = pci_device_to_OF_node(dev);
++	dn = of_node_get(pci_device_to_OF_node(dev));
+ 	if (!dn) {
+ 		dev_dbg(&dev->dev, "axon_msi: no pci_dn found\n");
+ 		return -ENODEV;
+diff --git a/arch/sparc64/kernel/sys_sparc.c b/arch/sparc64/kernel/sys_sparc.c
+index d108eeb..6bf7bcd 100644
+--- a/arch/sparc64/kernel/sys_sparc.c
++++ b/arch/sparc64/kernel/sys_sparc.c
+@@ -319,7 +319,7 @@ unsigned long get_fb_unmapped_area(struct file *filp, unsigned long orig_addr, u
+ 
+ 	if (flags & MAP_FIXED) {
+ 		/* Ok, don't mess with it. */
+-		return get_unmapped_area(NULL, addr, len, pgoff, flags);
++		return get_unmapped_area(NULL, orig_addr, len, pgoff, flags);
+ 	}
+ 	flags &= ~MAP_SHARED;
+ 
+diff --git a/arch/sparc64/lib/xor.S b/arch/sparc64/lib/xor.S
+index a79c888..f44f58f 100644
+--- a/arch/sparc64/lib/xor.S
++++ b/arch/sparc64/lib/xor.S
+@@ -491,12 +491,12 @@ xor_niagara_4:		/* %o0=bytes, %o1=dest, %o2=src1, %o3=src2, %o4=src3 */
+ 	ldda		[%i1 + 0x10] %asi, %i2	/* %i2/%i3 = src1 + 0x10 */
+ 	xor		%g2, %i4, %g2
+ 	xor		%g3, %i5, %g3
+-	ldda		[%i7 + 0x10] %asi, %i4	/* %i4/%i5 = src2 + 0x10 */
++	ldda		[%l7 + 0x10] %asi, %i4	/* %i4/%i5 = src2 + 0x10 */
+ 	xor		%l0, %g2, %l0
+ 	xor		%l1, %g3, %l1
+ 	stxa		%l0, [%i0 + 0x00] %asi
+ 	stxa		%l1, [%i0 + 0x08] %asi
+-	ldda		[%i6 + 0x10] %asi, %g2	/* %g2/%g3 = src3 + 0x10 */
++	ldda		[%l6 + 0x10] %asi, %g2	/* %g2/%g3 = src3 + 0x10 */
+ 	ldda		[%i0 + 0x10] %asi, %l0	/* %l0/%l1 = dest + 0x10 */
+ 
+ 	xor		%i4, %i2, %i4
+@@ -504,12 +504,12 @@ xor_niagara_4:		/* %o0=bytes, %o1=dest, %o2=src1, %o3=src2, %o4=src3 */
+ 	ldda		[%i1 + 0x20] %asi, %i2	/* %i2/%i3 = src1 + 0x20 */
+ 	xor		%g2, %i4, %g2
+ 	xor		%g3, %i5, %g3
+-	ldda		[%i7 + 0x20] %asi, %i4	/* %i4/%i5 = src2 + 0x20 */
++	ldda		[%l7 + 0x20] %asi, %i4	/* %i4/%i5 = src2 + 0x20 */
+ 	xor		%l0, %g2, %l0
+ 	xor		%l1, %g3, %l1
+ 	stxa		%l0, [%i0 + 0x10] %asi
+ 	stxa		%l1, [%i0 + 0x18] %asi
+-	ldda		[%i6 + 0x20] %asi, %g2	/* %g2/%g3 = src3 + 0x20 */
++	ldda		[%l6 + 0x20] %asi, %g2	/* %g2/%g3 = src3 + 0x20 */
+ 	ldda		[%i0 + 0x20] %asi, %l0	/* %l0/%l1 = dest + 0x20 */
+ 
+ 	xor		%i4, %i2, %i4
+@@ -517,12 +517,12 @@ xor_niagara_4:		/* %o0=bytes, %o1=dest, %o2=src1, %o3=src2, %o4=src3 */
+ 	ldda		[%i1 + 0x30] %asi, %i2	/* %i2/%i3 = src1 + 0x30 */
+ 	xor		%g2, %i4, %g2
+ 	xor		%g3, %i5, %g3
+-	ldda		[%i7 + 0x30] %asi, %i4	/* %i4/%i5 = src2 + 0x30 */
++	ldda		[%l7 + 0x30] %asi, %i4	/* %i4/%i5 = src2 + 0x30 */
+ 	xor		%l0, %g2, %l0
+ 	xor		%l1, %g3, %l1
+ 	stxa		%l0, [%i0 + 0x20] %asi
+ 	stxa		%l1, [%i0 + 0x28] %asi
+-	ldda		[%i6 + 0x30] %asi, %g2	/* %g2/%g3 = src3 + 0x30 */
++	ldda		[%l6 + 0x30] %asi, %g2	/* %g2/%g3 = src3 + 0x30 */
+ 	ldda		[%i0 + 0x30] %asi, %l0	/* %l0/%l1 = dest + 0x30 */
+ 
+ 	prefetch	[%i1 + 0x40], #one_read
+diff --git a/arch/um/Makefile b/arch/um/Makefile
+index 989224f..c3a399e 100644
+--- a/arch/um/Makefile
++++ b/arch/um/Makefile
+@@ -60,7 +60,8 @@ SYS_DIR		:= $(ARCH_DIR)/include/sysdep-$(SUBARCH)
+ 
+ CFLAGS += $(CFLAGS-y) -D__arch_um__ -DSUBARCH=\"$(SUBARCH)\"	\
+ 	$(ARCH_INCLUDE) $(MODE_INCLUDE) -Dvmap=kernel_vmap	\
+-	-Din6addr_loopback=kernel_in6addr_loopback
++	-Din6addr_loopback=kernel_in6addr_loopback \
++	-Din6addr_any=kernel_in6addr_any
+ 
+ AFLAGS += $(ARCH_INCLUDE)
+ 
+diff --git a/arch/um/include/common-offsets.h b/arch/um/include/common-offsets.h
+index 6eee343..2378ff4 100644
+--- a/arch/um/include/common-offsets.h
++++ b/arch/um/include/common-offsets.h
+@@ -10,6 +10,7 @@ OFFSET(HOST_TASK_PID, task_struct, pid);
+ 
+ DEFINE(UM_KERN_PAGE_SIZE, PAGE_SIZE);
+ DEFINE(UM_KERN_PAGE_MASK, PAGE_MASK);
++DEFINE(UM_KERN_PAGE_SHIFT, PAGE_SHIFT);
+ DEFINE(UM_NSEC_PER_SEC, NSEC_PER_SEC);
+ 
+ DEFINE_STR(UM_KERN_EMERG, KERN_EMERG);
+diff --git a/arch/um/include/sysdep-i386/stub.h b/arch/um/include/sysdep-i386/stub.h
+index 4fffae7..19c85f3 100644
+--- a/arch/um/include/sysdep-i386/stub.h
++++ b/arch/um/include/sysdep-i386/stub.h
+@@ -9,7 +9,6 @@
+ #include <sys/mman.h>
+ #include <asm/ptrace.h>
+ #include <asm/unistd.h>
+-#include <asm/page.h>
+ #include "stub-data.h"
+ #include "kern_constants.h"
+ #include "uml-config.h"
+@@ -19,7 +18,7 @@ extern void stub_clone_handler(void);
+ 
+ #define STUB_SYSCALL_RET EAX
+ #define STUB_MMAP_NR __NR_mmap2
+-#define MMAP_OFFSET(o) ((o) >> PAGE_SHIFT)
++#define MMAP_OFFSET(o) ((o) >> UM_KERN_PAGE_SHIFT)
+ 
+ static inline long stub_syscall0(long syscall)
+ {
+diff --git a/arch/um/kernel/skas/clone.c b/arch/um/kernel/skas/clone.c
+index 47b812b..885a125 100644
+--- a/arch/um/kernel/skas/clone.c
++++ b/arch/um/kernel/skas/clone.c
+@@ -3,7 +3,6 @@
+ #include <sys/mman.h>
+ #include <sys/time.h>
+ #include <asm/unistd.h>
+-#include <asm/page.h>
+ #include "ptrace_user.h"
+ #include "skas.h"
+ #include "stub-data.h"
+diff --git a/arch/um/os-Linux/main.c b/arch/um/os-Linux/main.c
+index e85f499..919c25b 100644
+--- a/arch/um/os-Linux/main.c
++++ b/arch/um/os-Linux/main.c
+@@ -12,7 +12,6 @@
+ #include <sys/resource.h>
+ #include <sys/mman.h>
+ #include <sys/user.h>
+-#include <asm/page.h>
+ #include "kern_util.h"
+ #include "as-layout.h"
+ #include "mem_user.h"
+diff --git a/arch/um/os-Linux/skas/mem.c b/arch/um/os-Linux/skas/mem.c
+index 0f7df4e..9fbf210 100644
+--- a/arch/um/os-Linux/skas/mem.c
++++ b/arch/um/os-Linux/skas/mem.c
+@@ -9,7 +9,6 @@
+ #include <unistd.h>
+ #include <sys/mman.h>
+ #include <sys/wait.h>
+-#include <asm/page.h>
+ #include <asm/unistd.h>
+ #include "mem_user.h"
+ #include "mem.h"
+diff --git a/arch/um/os-Linux/skas/process.c b/arch/um/os-Linux/skas/process.c
+index ba9af8d..607d2b8 100644
+--- a/arch/um/os-Linux/skas/process.c
++++ b/arch/um/os-Linux/skas/process.c
+@@ -182,7 +182,7 @@ static int userspace_tramp(void *stack)
+ 
+ 	ptrace(PTRACE_TRACEME, 0, 0, 0);
+ 
+-	init_new_thread_signals();
++	signal(SIGTERM, SIG_DFL);
+ 	err = set_interval(1);
+ 	if(err)
+ 		panic("userspace_tramp - setting timer failed, errno = %d\n",
+diff --git a/arch/um/os-Linux/start_up.c b/arch/um/os-Linux/start_up.c
+index 46f6139..f4f2981 100644
+--- a/arch/um/os-Linux/start_up.c
++++ b/arch/um/os-Linux/start_up.c
+@@ -19,7 +19,6 @@
+ #include <sys/mman.h>
+ #include <sys/resource.h>
+ #include <asm/unistd.h>
+-#include <asm/page.h>
+ #include <sys/types.h>
+ #include "kern_util.h"
+ #include "user.h"
+diff --git a/arch/um/os-Linux/tt.c b/arch/um/os-Linux/tt.c
+index bcf9359..5dc113d 100644
+--- a/arch/um/os-Linux/tt.c
++++ b/arch/um/os-Linux/tt.c
+@@ -17,7 +17,6 @@
+ #include <sys/mman.h>
+ #include <asm/ptrace.h>
+ #include <asm/unistd.h>
+-#include <asm/page.h>
+ #include "kern_util.h"
+ #include "user.h"
+ #include "signal_kern.h"
+diff --git a/arch/um/os-Linux/util.c b/arch/um/os-Linux/util.c
+index 7cbcf48..ef09543 100644
+--- a/arch/um/os-Linux/util.c
++++ b/arch/um/os-Linux/util.c
+@@ -105,6 +105,44 @@ int setjmp_wrapper(void (*proc)(void *, void *), ...)
+ 
+ void os_dump_core(void)
+ {
++	int pid;
++
+ 	signal(SIGSEGV, SIG_DFL);
++
++	/*
++	 * We are about to SIGTERM this entire process group to ensure that
++	 * nothing is around to run after the kernel exits.  The
++	 * kernel wants to abort, not die through SIGTERM, so we
++	 * ignore it here.
++	 */
++
++	signal(SIGTERM, SIG_IGN);
++	kill(0, SIGTERM);
++	/*
++	 * Most of the other processes associated with this UML are
++	 * likely sTopped, so give them a SIGCONT so they see the
++	 * SIGTERM.
++	 */
++	kill(0, SIGCONT);
++
++	/*
++	 * Now, having sent signals to everyone but us, make sure they
++	 * die by ptrace.  Processes can survive what's been done to
++	 * them so far - the mechanism I understand is receiving a
++	 * SIGSEGV and segfaulting immediately upon return.  There is
++	 * always a SIGSEGV pending, and (I'm guessing) signals are
++	 * processed in numeric order so the SIGTERM (signal 15 vs
++	 * SIGSEGV being signal 11) is never handled.
++	 *
++	 * Run a waitpid loop until we get some kind of error.
++	 * Hopefully, it's ECHILD, but there's not a lot we can do if
++	 * it's something else.  Tell os_kill_ptraced_process not to
++	 * wait for the child to report its death because there's
++	 * nothing reasonable to do if that fails.
++	 */
++
++	while ((pid = waitpid(-1, NULL, WNOHANG)) > 0)
++		os_kill_ptraced_process(pid, 0);
++
+ 	abort();
+ }
+diff --git a/arch/um/sys-i386/user-offsets.c b/arch/um/sys-i386/user-offsets.c
+index 29118cf..5142415 100644
+--- a/arch/um/sys-i386/user-offsets.c
++++ b/arch/um/sys-i386/user-offsets.c
+@@ -2,9 +2,9 @@
+ #include <stddef.h>
+ #include <signal.h>
+ #include <sys/poll.h>
++#include <sys/user.h>
+ #include <sys/mman.h>
+ #include <asm/ptrace.h>
+-#include <asm/user.h>
+ 
+ #define DEFINE(sym, val) \
+ 	asm volatile("\n->" #sym " %0 " #val : : "i" (val))
+@@ -48,8 +48,8 @@ void foo(void)
+ 	OFFSET(HOST_SC_FP_ST, _fpstate, _st);
+ 	OFFSET(HOST_SC_FXSR_ENV, _fpstate, _fxsr_env);
+ 
+-	DEFINE_LONGS(HOST_FP_SIZE, sizeof(struct user_i387_struct));
+-	DEFINE_LONGS(HOST_XFP_SIZE, sizeof(struct user_fxsr_struct));
++	DEFINE_LONGS(HOST_FP_SIZE, sizeof(struct user_fpregs_struct));
++	DEFINE_LONGS(HOST_XFP_SIZE, sizeof(struct user_fpxregs_struct));
+ 
+ 	DEFINE(HOST_IP, EIP);
+ 	DEFINE(HOST_SP, UESP);
+diff --git a/arch/um/sys-x86_64/user-offsets.c b/arch/um/sys-x86_64/user-offsets.c
+index 0d5fd76..f1ef2a8 100644
+--- a/arch/um/sys-x86_64/user-offsets.c
++++ b/arch/um/sys-x86_64/user-offsets.c
+@@ -3,17 +3,10 @@
+ #include <signal.h>
+ #include <sys/poll.h>
+ #include <sys/mman.h>
++#include <sys/user.h>
+ #define __FRAME_OFFSETS
+ #include <asm/ptrace.h>
+ #include <asm/types.h>
+-/* For some reason, x86_64 defines u64 and u32 only in <pci/types.h>, which I
+- * refuse to include here, even though they're used throughout the headers.
+- * These are used in asm/user.h, and that include can't be avoided because of
+- * the sizeof(struct user_regs_struct) below.
+- */
+-typedef __u64 u64;
+-typedef __u32 u32;
+-#include <asm/user.h>
+ 
+ #define DEFINE(sym, val) \
+         asm volatile("\n->" #sym " %0 " #val : : "i" (val))
+diff --git a/arch/x86_64/mm/init.c b/arch/x86_64/mm/init.c
+index 458893b..e2d6bad 100644
+--- a/arch/x86_64/mm/init.c
++++ b/arch/x86_64/mm/init.c
+@@ -734,12 +734,6 @@ int in_gate_area_no_task(unsigned long addr)
+ 	return (addr >= VSYSCALL_START) && (addr < VSYSCALL_END);
+ }
+ 
+-void * __init alloc_bootmem_high_node(pg_data_t *pgdat, unsigned long size)
+-{
+-	return __alloc_bootmem_core(pgdat->bdata, size,
+-			SMP_CACHE_BYTES, (4UL*1024*1024*1024), 0);
+-}
+-
+ const char *arch_vma_name(struct vm_area_struct *vma)
+ {
+ 	if (vma->vm_mm && vma->vm_start == (long)vma->vm_mm->context.vdso)
+diff --git a/arch/x86_64/mm/pageattr.c b/arch/x86_64/mm/pageattr.c
+index 10b9809..0416ffb 100644
+--- a/arch/x86_64/mm/pageattr.c
++++ b/arch/x86_64/mm/pageattr.c
+@@ -229,9 +229,14 @@ void global_flush_tlb(void)
+ 	struct page *pg, *next;
+ 	struct list_head l;
+ 
+-	down_read(&init_mm.mmap_sem);
++	/*
++	 * Write-protect the semaphore, to exclude two contexts
++	 * doing a list_replace_init() call in parallel and to
++	 * exclude new additions to the deferred_pages list:
++	 */
++	down_write(&init_mm.mmap_sem);
+ 	list_replace_init(&deferred_pages, &l);
+-	up_read(&init_mm.mmap_sem);
++	up_write(&init_mm.mmap_sem);
+ 
+ 	flush_map(&l);
+ 
+diff --git a/fs/xfs/linux-2.6/xfs_buf.c b/fs/xfs/linux-2.6/xfs_buf.c
+index b0f0e58..be9e65b 100644
+--- a/fs/xfs/linux-2.6/xfs_buf.c
++++ b/fs/xfs/linux-2.6/xfs_buf.c
+@@ -187,6 +187,19 @@ free_address(
+ {
+ 	a_list_t	*aentry;
+ 
++#ifdef CONFIG_XEN
++	/*
++	 * Xen needs to be able to make sure it can get an exclusive
++	 * RO mapping of pages it wants to turn into a pagetable.  If
++	 * a newly allocated page is also still being vmap()ed by xfs,
++	 * it will cause pagetable construction to fail.  This is a
++	 * quick workaround to always eagerly unmap pages so that Xen
++	 * is happy.
++	 */
++	vunmap(addr);
++	return;
++#endif
++
+ 	aentry = kmalloc(sizeof(a_list_t), GFP_NOWAIT);
+ 	if (likely(aentry)) {
+ 		spin_lock(&as_lock);
+diff --git a/include/asm-mips/hazards.h b/include/asm-mips/hazards.h
+index 6a5fa32..684f622 100644
+--- a/include/asm-mips/hazards.h
++++ b/include/asm-mips/hazards.h
+@@ -10,11 +10,12 @@
+ #ifndef _ASM_HAZARDS_H
+ #define _ASM_HAZARDS_H
+ 
+-
+ #ifdef __ASSEMBLY__
+ #define ASMMACRO(name, code...) .macro name; code; .endm
+ #else
+ 
++#include <asm/cpu-features.h>
++
+ #define ASMMACRO(name, code...)						\
+ __asm__(".macro " #name "; " #code "; .endm");				\
+ 									\
+@@ -86,6 +87,57 @@ do {									\
+ 	: "=r" (tmp));							\
+ } while (0)
+ 
++#elif defined(CONFIG_CPU_MIPSR1)
++
++/*
++ * These are slightly complicated by the fact that we guarantee R1 kernels to
++ * run fine on R2 processors.
++ */
++ASMMACRO(mtc0_tlbw_hazard,
++	_ssnop; _ssnop; _ehb
++	)
++ASMMACRO(tlbw_use_hazard,
++	_ssnop; _ssnop; _ssnop; _ehb
++	)
++ASMMACRO(tlb_probe_hazard,
++	 _ssnop; _ssnop; _ssnop; _ehb
++	)
++ASMMACRO(irq_enable_hazard,
++	 _ssnop; _ssnop; _ssnop; _ehb
++	)
++ASMMACRO(irq_disable_hazard,
++	_ssnop; _ssnop; _ssnop; _ehb
++	)
++ASMMACRO(back_to_back_c0_hazard,
++	 _ssnop; _ssnop; _ssnop; _ehb
++	)
++/*
++ * gcc has a tradition of misscompiling the previous construct using the
++ * address of a label as argument to inline assembler.  Gas otoh has the
++ * annoying difference between la and dla which are only usable for 32-bit
++ * rsp. 64-bit code, so can't be used without conditional compilation.
++ * The alterantive is switching the assembler to 64-bit code which happens
++ * to work right even for 32-bit code ...
++ */
++#define __instruction_hazard()						\
++do {									\
++	unsigned long tmp;						\
++									\
++	__asm__ __volatile__(						\
++	"	.set	mips64r2				\n"	\
++	"	dla	%0, 1f					\n"	\
++	"	jr.hb	%0					\n"	\
++	"	.set	mips0					\n"	\
++	"1:							\n"	\
++	: "=r" (tmp));							\
++} while (0)
++
++#define instruction_hazard()						\
++do {									\
++	if (cpu_has_mips_r2)						\
++		__instruction_hazard();					\
++} while (0)
++
+ #elif defined(CONFIG_CPU_R10000)
+ 
+ /*
+diff --git a/include/linux/bootmem.h b/include/linux/bootmem.h
+index c83534e..0365ec9 100644
+--- a/include/linux/bootmem.h
++++ b/include/linux/bootmem.h
+@@ -59,7 +59,6 @@ extern void *__alloc_bootmem_core(struct bootmem_data *bdata,
+ 				  unsigned long align,
+ 				  unsigned long goal,
+ 				  unsigned long limit);
+-extern void *alloc_bootmem_high_node(pg_data_t *pgdat, unsigned long size);
+ 
+ #ifndef CONFIG_HAVE_ARCH_BOOTMEM_NODE
+ extern void reserve_bootmem(unsigned long addr, unsigned long size);
+diff --git a/include/xen/interface/vcpu.h b/include/xen/interface/vcpu.h
+index ff61ea3..b05d8a6 100644
+--- a/include/xen/interface/vcpu.h
++++ b/include/xen/interface/vcpu.h
+@@ -160,8 +160,9 @@ struct vcpu_set_singleshot_timer {
+  */
+ #define VCPUOP_register_vcpu_info   10  /* arg == struct vcpu_info */
+ struct vcpu_register_vcpu_info {
+-    uint32_t mfn;               /* mfn of page to place vcpu_info */
+-    uint32_t offset;            /* offset within page */
++    uint64_t mfn;    /* mfn of page to place vcpu_info */
++    uint32_t offset; /* offset within page */
++    uint32_t rsvd;   /* unused */
+ };
+ 
+ #endif /* __XEN_PUBLIC_VCPU_H__ */
+diff --git a/mm/sparse.c b/mm/sparse.c
+index 239f5a7..1facdff 100644
+--- a/mm/sparse.c
++++ b/mm/sparse.c
+@@ -215,12 +215,6 @@ static int __meminit sparse_init_one_section(struct mem_section *ms,
+ 	return 1;
+ }
+ 
+-__attribute__((weak)) __init
+-void *alloc_bootmem_high_node(pg_data_t *pgdat, unsigned long size)
+-{
+-	return NULL;
+-}
+-
+ static struct page __init *sparse_early_mem_map_alloc(unsigned long pnum)
+ {
+ 	struct page *map;
+@@ -231,11 +225,6 @@ static struct page __init *sparse_early_mem_map_alloc(unsigned long pnum)
+ 	if (map)
+ 		return map;
+ 
+-  	map = alloc_bootmem_high_node(NODE_DATA(nid),
+-                       sizeof(struct page) * PAGES_PER_SECTION);
+-	if (map)
+-		return map;
+-
+ 	map = alloc_bootmem_node(NODE_DATA(nid),
+ 			sizeof(struct page) * PAGES_PER_SECTION);
+ 	if (map)

Added: dists/sid/linux-2.6/debian/patches/bugfix/all/stable/2.6.23.4.patch
==============================================================================
--- (empty file)
+++ dists/sid/linux-2.6/debian/patches/bugfix/all/stable/2.6.23.4.patch	Mon Nov 26 20:06:56 2007
@@ -0,0 +1,875 @@
+diff --git a/Makefile b/Makefile
+index b0c2c32..0c34409 100644
+diff --git a/include/linux/netlink.h b/include/linux/netlink.h
+index 83d8239..63af986 100644
+--- a/include/linux/netlink.h
++++ b/include/linux/netlink.h
+@@ -175,7 +175,7 @@ extern int netlink_unregister_notifier(struct notifier_block *nb);
+ /* finegrained unicast helpers: */
+ struct sock *netlink_getsockbyfilp(struct file *filp);
+ int netlink_attachskb(struct sock *sk, struct sk_buff *skb, int nonblock,
+-		long timeo, struct sock *ssk);
++		      long *timeo, struct sock *ssk);
+ void netlink_detachskb(struct sock *sk, struct sk_buff *skb);
+ int netlink_sendskb(struct sock *sk, struct sk_buff *skb, int protocol);
+ 
+diff --git a/include/linux/skbuff.h b/include/linux/skbuff.h
+index a656cec..ed2c458 100644
+--- a/include/linux/skbuff.h
++++ b/include/linux/skbuff.h
+@@ -41,8 +41,7 @@
+ #define SKB_DATA_ALIGN(X)	(((X) + (SMP_CACHE_BYTES - 1)) & \
+ 				 ~(SMP_CACHE_BYTES - 1))
+ #define SKB_WITH_OVERHEAD(X)	\
+-	(((X) - sizeof(struct skb_shared_info)) & \
+-	 ~(SMP_CACHE_BYTES - 1))
++	((X) - SKB_DATA_ALIGN(sizeof(struct skb_shared_info)))
+ #define SKB_MAX_ORDER(X, ORDER) \
+ 	SKB_WITH_OVERHEAD((PAGE_SIZE << (ORDER)) - (X))
+ #define SKB_MAX_HEAD(X)		(SKB_MAX_ORDER((X), 0))
+diff --git a/include/net/9p/9p.h b/include/net/9p/9p.h
+index 88884d3..7726ff4 100644
+--- a/include/net/9p/9p.h
++++ b/include/net/9p/9p.h
+@@ -412,6 +412,18 @@ int p9_idpool_check(int id, struct p9_idpool *p);
+ 
+ int p9_error_init(void);
+ int p9_errstr2errno(char *, int);
++
++#ifdef CONFIG_SYSCTL
+ int __init p9_sysctl_register(void);
+ void __exit p9_sysctl_unregister(void);
++#else
++static inline int p9_sysctl_register(void)
++{
++	return 0;
++}
++static inline void p9_sysctl_unregister(void)
++{
++}
++#endif
++
+ #endif /* NET_9P_H */
+diff --git a/include/net/sock.h b/include/net/sock.h
+index dfeb8b1..bdd9ebe 100644
+--- a/include/net/sock.h
++++ b/include/net/sock.h
+@@ -1199,14 +1199,16 @@ static inline struct sk_buff *sk_stream_alloc_pskb(struct sock *sk,
+ 						   gfp_t gfp)
+ {
+ 	struct sk_buff *skb;
+-	int hdr_len;
+ 
+-	hdr_len = SKB_DATA_ALIGN(sk->sk_prot->max_header);
+-	skb = alloc_skb_fclone(size + hdr_len, gfp);
++	skb = alloc_skb_fclone(size + sk->sk_prot->max_header, gfp);
+ 	if (skb) {
+ 		skb->truesize += mem;
+ 		if (sk_stream_wmem_schedule(sk, skb->truesize)) {
+-			skb_reserve(skb, hdr_len);
++			/*
++			 * Make sure that we have exactly size bytes
++			 * available to the caller, no more, no less.
++			 */
++			skb_reserve(skb, skb_tailroom(skb) - size);
+ 			return skb;
+ 		}
+ 		__kfree_skb(skb);
+diff --git a/ipc/mqueue.c b/ipc/mqueue.c
+index 145d5a0..1c0de2c 100644
+--- a/ipc/mqueue.c
++++ b/ipc/mqueue.c
+@@ -1014,6 +1014,8 @@ asmlinkage long sys_mq_notify(mqd_t mqdes,
+ 			return -EINVAL;
+ 		}
+ 		if (notification.sigev_notify == SIGEV_THREAD) {
++			long timeo;
++
+ 			/* create the notify skb */
+ 			nc = alloc_skb(NOTIFY_COOKIE_LEN, GFP_KERNEL);
+ 			ret = -ENOMEM;
+@@ -1042,8 +1044,8 @@ retry:
+ 				goto out;
+ 			}
+ 
+-			ret = netlink_attachskb(sock, nc, 0,
+-					MAX_SCHEDULE_TIMEOUT, NULL);
++			timeo = MAX_SCHEDULE_TIMEOUT;
++			ret = netlink_attachskb(sock, nc, 0, &timeo, NULL);
+ 			if (ret == 1)
+ 		       		goto retry;
+ 			if (ret) {
+diff --git a/net/8021q/vlan.c b/net/8021q/vlan.c
+index 2a54691..ef3f789 100644
+--- a/net/8021q/vlan.c
++++ b/net/8021q/vlan.c
+@@ -629,6 +629,10 @@ static int vlan_device_event(struct notifier_block *unused, unsigned long event,
+ 			if (!vlandev)
+ 				continue;
+ 
++			flgs = vlandev->flags;
++			if (!(flgs & IFF_UP))
++				continue;
++
+ 			vlan_sync_address(dev, vlandev);
+ 		}
+ 		break;
+@@ -740,6 +744,7 @@ static int vlan_ioctl_handler(void __user *arg)
+ 		vlan_dev_set_ingress_priority(dev,
+ 					      args.u.skb_priority,
+ 					      args.vlan_qos);
++		err = 0;
+ 		break;
+ 
+ 	case SET_VLAN_EGRESS_PRIORITY_CMD:
+diff --git a/net/ieee80211/ieee80211_crypt_tkip.c b/net/ieee80211/ieee80211_crypt_tkip.c
+index 5a48d8e..7f11dd9 100644
+--- a/net/ieee80211/ieee80211_crypt_tkip.c
++++ b/net/ieee80211/ieee80211_crypt_tkip.c
+@@ -584,7 +584,7 @@ static void michael_mic_hdr(struct sk_buff *skb, u8 * hdr)
+ 	if (stype & IEEE80211_STYPE_QOS_DATA) {
+ 		const struct ieee80211_hdr_3addrqos *qoshdr =
+ 			(struct ieee80211_hdr_3addrqos *)skb->data;
+-		hdr[12] = qoshdr->qos_ctl & cpu_to_le16(IEEE80211_QCTL_TID);
++		hdr[12] = le16_to_cpu(qoshdr->qos_ctl) & IEEE80211_QCTL_TID;
+ 	} else
+ 		hdr[12] = 0;		/* priority */
+ 
+diff --git a/net/ieee80211/softmac/ieee80211softmac_wx.c b/net/ieee80211/softmac/ieee80211softmac_wx.c
+index 5742dc8..2b0b4c7 100644
+--- a/net/ieee80211/softmac/ieee80211softmac_wx.c
++++ b/net/ieee80211/softmac/ieee80211softmac_wx.c
+@@ -469,7 +469,7 @@ ieee80211softmac_wx_set_mlme(struct net_device *dev,
+ {
+ 	struct ieee80211softmac_device *mac = ieee80211_priv(dev);
+ 	struct iw_mlme *mlme = (struct iw_mlme *)extra;
+-	u16 reason = cpu_to_le16(mlme->reason_code);
++	u16 reason = mlme->reason_code;
+ 	struct ieee80211softmac_network *net;
+ 	int err = -EINVAL;
+ 
+diff --git a/net/ipv4/ipcomp.c b/net/ipv4/ipcomp.c
+index e787044..a8a9f13 100644
+--- a/net/ipv4/ipcomp.c
++++ b/net/ipv4/ipcomp.c
+@@ -17,6 +17,7 @@
+ #include <asm/scatterlist.h>
+ #include <asm/semaphore.h>
+ #include <linux/crypto.h>
++#include <linux/err.h>
+ #include <linux/pfkeyv2.h>
+ #include <linux/percpu.h>
+ #include <linux/smp.h>
+@@ -355,7 +356,7 @@ static struct crypto_comp **ipcomp_alloc_tfms(const char *alg_name)
+ 	for_each_possible_cpu(cpu) {
+ 		struct crypto_comp *tfm = crypto_alloc_comp(alg_name, 0,
+ 							    CRYPTO_ALG_ASYNC);
+-		if (!tfm)
++		if (IS_ERR(tfm))
+ 			goto error;
+ 		*per_cpu_ptr(tfms, cpu) = tfm;
+ 	}
+diff --git a/net/ipv6/ipcomp6.c b/net/ipv6/ipcomp6.c
+index 473f165..9dd1ebc 100644
+--- a/net/ipv6/ipcomp6.c
++++ b/net/ipv6/ipcomp6.c
+@@ -37,6 +37,7 @@
+ #include <asm/scatterlist.h>
+ #include <asm/semaphore.h>
+ #include <linux/crypto.h>
++#include <linux/err.h>
+ #include <linux/pfkeyv2.h>
+ #include <linux/random.h>
+ #include <linux/percpu.h>
+@@ -366,7 +367,7 @@ static struct crypto_comp **ipcomp6_alloc_tfms(const char *alg_name)
+ 	for_each_possible_cpu(cpu) {
+ 		struct crypto_comp *tfm = crypto_alloc_comp(alg_name, 0,
+ 							    CRYPTO_ALG_ASYNC);
+-		if (!tfm)
++		if (IS_ERR(tfm))
+ 			goto error;
+ 		*per_cpu_ptr(tfms, cpu) = tfm;
+ 	}
+diff --git a/net/mac80211/ieee80211.c b/net/mac80211/ieee80211.c
+index ff2172f..9e0da6e 100644
+--- a/net/mac80211/ieee80211.c
++++ b/net/mac80211/ieee80211.c
+@@ -350,7 +350,7 @@ static int ieee80211_get_radiotap_len(struct sk_buff *skb)
+ 	struct ieee80211_radiotap_header *hdr =
+ 		(struct ieee80211_radiotap_header *) skb->data;
+ 
+-	return le16_to_cpu(hdr->it_len);
++	return le16_to_cpu(get_unaligned(&hdr->it_len));
+ }
+ 
+ #ifdef CONFIG_MAC80211_LOWTX_FRAME_DUMP
+@@ -1680,46 +1680,54 @@ int ieee80211_monitor_start_xmit(struct sk_buff *skb,
+ 	struct ieee80211_tx_packet_data *pkt_data;
+ 	struct ieee80211_radiotap_header *prthdr =
+ 		(struct ieee80211_radiotap_header *)skb->data;
+-	u16 len;
++	u16 len_rthdr;
+ 
+-	/*
+-	 * there must be a radiotap header at the
+-	 * start in this case
+-	 */
+-	if (unlikely(prthdr->it_version)) {
+-		/* only version 0 is supported */
+-		dev_kfree_skb(skb);
+-		return NETDEV_TX_OK;
+-	}
++	/* check for not even having the fixed radiotap header part */
++	if (unlikely(skb->len < sizeof(struct ieee80211_radiotap_header)))
++		goto fail; /* too short to be possibly valid */
++
++	/* is it a header version we can trust to find length from? */
++	if (unlikely(prthdr->it_version))
++		goto fail; /* only version 0 is supported */
++
++	/* then there must be a radiotap header with a length we can use */
++	len_rthdr = ieee80211_get_radiotap_len(skb);
++
++	/* does the skb contain enough to deliver on the alleged length? */
++	if (unlikely(skb->len < len_rthdr))
++		goto fail; /* skb too short for claimed rt header extent */
+ 
+ 	skb->dev = local->mdev;
+ 
+ 	pkt_data = (struct ieee80211_tx_packet_data *)skb->cb;
+ 	memset(pkt_data, 0, sizeof(*pkt_data));
++	/* needed because we set skb device to master */
+ 	pkt_data->ifindex = dev->ifindex;
++
+ 	pkt_data->mgmt_iface = 0;
+ 	pkt_data->do_not_encrypt = 1;
+ 
+-	/* above needed because we set skb device to master */
+-
+ 	/*
+ 	 * fix up the pointers accounting for the radiotap
+ 	 * header still being in there.  We are being given
+ 	 * a precooked IEEE80211 header so no need for
+ 	 * normal processing
+ 	 */
+-	len = le16_to_cpu(get_unaligned(&prthdr->it_len));
+-	skb_set_mac_header(skb, len);
+-	skb_set_network_header(skb, len + sizeof(struct ieee80211_hdr));
+-	skb_set_transport_header(skb, len + sizeof(struct ieee80211_hdr));
+-
++	skb_set_mac_header(skb, len_rthdr);
+ 	/*
+-	 * pass the radiotap header up to
+-	 * the next stage intact
++	 * these are just fixed to the end of the rt area since we
++	 * don't have any better information and at this point, nobody cares
+ 	 */
+-	dev_queue_xmit(skb);
++	skb_set_network_header(skb, len_rthdr);
++	skb_set_transport_header(skb, len_rthdr);
+ 
++	/* pass the radiotap header up to the next stage intact */
++	dev_queue_xmit(skb);
+ 	return NETDEV_TX_OK;
++
++fail:
++	dev_kfree_skb(skb);
++	return NETDEV_TX_OK; /* meaning, we dealt with the skb */
+ }
+ 
+ 
+@@ -2836,9 +2844,10 @@ ieee80211_rx_h_data(struct ieee80211_txrx_data *rx)
+ 		memcpy(dst, hdr->addr1, ETH_ALEN);
+ 		memcpy(src, hdr->addr3, ETH_ALEN);
+ 
+-		if (sdata->type != IEEE80211_IF_TYPE_STA) {
++		if (sdata->type != IEEE80211_IF_TYPE_STA ||
++		    (is_multicast_ether_addr(dst) &&
++		     !compare_ether_addr(src, dev->dev_addr)))
+ 			return TXRX_DROP;
+-		}
+ 		break;
+ 	case 0:
+ 		/* DA SA BSSID */
+diff --git a/net/mac80211/ieee80211_ioctl.c b/net/mac80211/ieee80211_ioctl.c
+index e7904db..7b5b801 100644
+--- a/net/mac80211/ieee80211_ioctl.c
++++ b/net/mac80211/ieee80211_ioctl.c
+@@ -687,10 +687,11 @@ static int ieee80211_ioctl_giwap(struct net_device *dev,
+ 
+ static int ieee80211_ioctl_siwscan(struct net_device *dev,
+ 				   struct iw_request_info *info,
+-				   struct iw_point *data, char *extra)
++				   union iwreq_data *wrqu, char *extra)
+ {
+ 	struct ieee80211_local *local = wdev_priv(dev->ieee80211_ptr);
+ 	struct ieee80211_sub_if_data *sdata = IEEE80211_DEV_TO_SUB_IF(dev);
++	struct iw_scan_req *req = NULL;
+ 	u8 *ssid = NULL;
+ 	size_t ssid_len = 0;
+ 
+@@ -715,6 +716,14 @@ static int ieee80211_ioctl_siwscan(struct net_device *dev,
+ 		return -EOPNOTSUPP;
+ 	}
+ 
++	/* if SSID was specified explicitly then use that */
++	if (wrqu->data.length == sizeof(struct iw_scan_req) &&
++	    wrqu->data.flags & IW_SCAN_THIS_ESSID) {
++		req = (struct iw_scan_req *)extra;
++		ssid = req->essid;
++		ssid_len = req->essid_len;
++	}
++
+ 	return ieee80211_sta_req_scan(dev, ssid, ssid_len);
+ }
+ 
+diff --git a/net/mac80211/ieee80211_sta.c b/net/mac80211/ieee80211_sta.c
+index 0d99b68..73d39e1 100644
+--- a/net/mac80211/ieee80211_sta.c
++++ b/net/mac80211/ieee80211_sta.c
+@@ -12,7 +12,6 @@
+  */
+ 
+ /* TODO:
+- * BSS table: use <BSSID,SSID> as the key to support multi-SSID APs
+  * order BSS list by RSSI(?) ("quality of AP")
+  * scan result table filtering (by capability (privacy, IBSS/BSS, WPA/RSN IE,
+  *    SSID)
+@@ -61,7 +60,8 @@
+ static void ieee80211_send_probe_req(struct net_device *dev, u8 *dst,
+ 				     u8 *ssid, size_t ssid_len);
+ static struct ieee80211_sta_bss *
+-ieee80211_rx_bss_get(struct net_device *dev, u8 *bssid);
++ieee80211_rx_bss_get(struct net_device *dev, u8 *bssid, int channel,
++		     u8 *ssid, u8 ssid_len);
+ static void ieee80211_rx_bss_put(struct net_device *dev,
+ 				 struct ieee80211_sta_bss *bss);
+ static int ieee80211_sta_find_ibss(struct net_device *dev,
+@@ -108,15 +108,11 @@ struct ieee802_11_elems {
+ 	u8 wmm_param_len;
+ };
+ 
+-typedef enum { ParseOK = 0, ParseUnknown = 1, ParseFailed = -1 } ParseRes;
+-
+-
+-static ParseRes ieee802_11_parse_elems(u8 *start, size_t len,
+-				       struct ieee802_11_elems *elems)
++static void ieee802_11_parse_elems(u8 *start, size_t len,
++				   struct ieee802_11_elems *elems)
+ {
+ 	size_t left = len;
+ 	u8 *pos = start;
+-	int unknown = 0;
+ 
+ 	memset(elems, 0, sizeof(*elems));
+ 
+@@ -127,15 +123,8 @@ static ParseRes ieee802_11_parse_elems(u8 *start, size_t len,
+ 		elen = *pos++;
+ 		left -= 2;
+ 
+-		if (elen > left) {
+-#if 0
+-			if (net_ratelimit())
+-				printk(KERN_DEBUG "IEEE 802.11 element parse "
+-				       "failed (id=%d elen=%d left=%d)\n",
+-				       id, elen, left);
+-#endif
+-			return ParseFailed;
+-		}
++		if (elen > left)
++			return;
+ 
+ 		switch (id) {
+ 		case WLAN_EID_SSID:
+@@ -202,28 +191,15 @@ static ParseRes ieee802_11_parse_elems(u8 *start, size_t len,
+ 			elems->ext_supp_rates_len = elen;
+ 			break;
+ 		default:
+-#if 0
+-			printk(KERN_DEBUG "IEEE 802.11 element parse ignored "
+-				      "unknown element (id=%d elen=%d)\n",
+-				      id, elen);
+-#endif
+-			unknown++;
+ 			break;
+ 		}
+ 
+ 		left -= elen;
+ 		pos += elen;
+ 	}
+-
+-	/* Do not trigger error if left == 1 as Apple Airport base stations
+-	 * send AssocResps that are one spurious byte too long. */
+-
+-	return unknown ? ParseUnknown : ParseOK;
+ }
+ 
+ 
+-
+-
+ static int ecw2cw(int ecw)
+ {
+ 	int cw = 1;
+@@ -387,6 +363,7 @@ static void ieee80211_set_associated(struct net_device *dev,
+ 				     struct ieee80211_if_sta *ifsta, int assoc)
+ {
+ 	union iwreq_data wrqu;
++	struct ieee80211_local *local = wdev_priv(dev->ieee80211_ptr);
+ 	struct ieee80211_sub_if_data *sdata = IEEE80211_DEV_TO_SUB_IF(dev);
+ 
+ 	if (ifsta->associated == assoc)
+@@ -401,7 +378,9 @@ static void ieee80211_set_associated(struct net_device *dev,
+ 		if (sdata->type != IEEE80211_IF_TYPE_STA)
+ 			return;
+ 
+-		bss = ieee80211_rx_bss_get(dev, ifsta->bssid);
++		bss = ieee80211_rx_bss_get(dev, ifsta->bssid,
++					   local->hw.conf.channel,
++					   ifsta->ssid, ifsta->ssid_len);
+ 		if (bss) {
+ 			if (bss->has_erp_value)
+ 				ieee80211_handle_erp_ie(dev, bss->erp_value);
+@@ -543,7 +522,8 @@ static void ieee80211_send_assoc(struct net_device *dev,
+ 		capab |= WLAN_CAPABILITY_SHORT_SLOT_TIME |
+ 			WLAN_CAPABILITY_SHORT_PREAMBLE;
+ 	}
+-	bss = ieee80211_rx_bss_get(dev, ifsta->bssid);
++	bss = ieee80211_rx_bss_get(dev, ifsta->bssid, local->hw.conf.channel,
++				   ifsta->ssid, ifsta->ssid_len);
+ 	if (bss) {
+ 		if (bss->capability & WLAN_CAPABILITY_PRIVACY)
+ 			capab |= WLAN_CAPABILITY_PRIVACY;
+@@ -695,6 +675,7 @@ static void ieee80211_send_disassoc(struct net_device *dev,
+ static int ieee80211_privacy_mismatch(struct net_device *dev,
+ 				      struct ieee80211_if_sta *ifsta)
+ {
++	struct ieee80211_local *local = wdev_priv(dev->ieee80211_ptr);
+ 	struct ieee80211_sta_bss *bss;
+ 	int res = 0;
+ 
+@@ -702,7 +683,8 @@ static int ieee80211_privacy_mismatch(struct net_device *dev,
+ 	    ifsta->key_mgmt != IEEE80211_KEY_MGMT_NONE)
+ 		return 0;
+ 
+-	bss = ieee80211_rx_bss_get(dev, ifsta->bssid);
++	bss = ieee80211_rx_bss_get(dev, ifsta->bssid, local->hw.conf.channel,
++				   ifsta->ssid, ifsta->ssid_len);
+ 	if (!bss)
+ 		return 0;
+ 
+@@ -901,12 +883,7 @@ static void ieee80211_auth_challenge(struct net_device *dev,
+ 
+ 	printk(KERN_DEBUG "%s: replying to auth challenge\n", dev->name);
+ 	pos = mgmt->u.auth.variable;
+-	if (ieee802_11_parse_elems(pos, len - (pos - (u8 *) mgmt), &elems)
+-	    == ParseFailed) {
+-		printk(KERN_DEBUG "%s: failed to parse Auth(challenge)\n",
+-		       dev->name);
+-		return;
+-	}
++	ieee802_11_parse_elems(pos, len - (pos - (u8 *) mgmt), &elems);
+ 	if (!elems.challenge) {
+ 		printk(KERN_DEBUG "%s: no challenge IE in shared key auth "
+ 		       "frame\n", dev->name);
+@@ -1174,15 +1151,11 @@ static void ieee80211_rx_mgmt_assoc_resp(struct net_device *dev,
+ 	capab_info = le16_to_cpu(mgmt->u.assoc_resp.capab_info);
+ 	status_code = le16_to_cpu(mgmt->u.assoc_resp.status_code);
+ 	aid = le16_to_cpu(mgmt->u.assoc_resp.aid);
+-	if ((aid & (BIT(15) | BIT(14))) != (BIT(15) | BIT(14)))
+-		printk(KERN_DEBUG "%s: invalid aid value %d; bits 15:14 not "
+-		       "set\n", dev->name, aid);
+-	aid &= ~(BIT(15) | BIT(14));
+ 
+ 	printk(KERN_DEBUG "%s: RX %sssocResp from " MAC_FMT " (capab=0x%x "
+ 	       "status=%d aid=%d)\n",
+ 	       dev->name, reassoc ? "Rea" : "A", MAC_ARG(mgmt->sa),
+-	       capab_info, status_code, aid);
++	       capab_info, status_code, aid & ~(BIT(15) | BIT(14)));
+ 
+ 	if (status_code != WLAN_STATUS_SUCCESS) {
+ 		printk(KERN_DEBUG "%s: AP denied association (code=%d)\n",
+@@ -1192,13 +1165,13 @@ static void ieee80211_rx_mgmt_assoc_resp(struct net_device *dev,
+ 		return;
+ 	}
+ 
++	if ((aid & (BIT(15) | BIT(14))) != (BIT(15) | BIT(14)))
++		printk(KERN_DEBUG "%s: invalid aid value %d; bits 15:14 not "
++		       "set\n", dev->name, aid);
++	aid &= ~(BIT(15) | BIT(14));
++
+ 	pos = mgmt->u.assoc_resp.variable;
+-	if (ieee802_11_parse_elems(pos, len - (pos - (u8 *) mgmt), &elems)
+-	    == ParseFailed) {
+-		printk(KERN_DEBUG "%s: failed to parse AssocResp\n",
+-		       dev->name);
+-		return;
+-	}
++	ieee802_11_parse_elems(pos, len - (pos - (u8 *) mgmt), &elems);
+ 
+ 	if (!elems.supp_rates) {
+ 		printk(KERN_DEBUG "%s: no SuppRates element in AssocResp\n",
+@@ -1210,7 +1183,9 @@ static void ieee80211_rx_mgmt_assoc_resp(struct net_device *dev,
+ 	 * update our stored copy */
+ 	if (elems.erp_info && elems.erp_info_len >= 1) {
+ 		struct ieee80211_sta_bss *bss
+-			= ieee80211_rx_bss_get(dev, ifsta->bssid);
++			= ieee80211_rx_bss_get(dev, ifsta->bssid,
++					       local->hw.conf.channel,
++					       ifsta->ssid, ifsta->ssid_len);
+ 		if (bss) {
+ 			bss->erp_value = elems.erp_info[0];
+ 			bss->has_erp_value = 1;
+@@ -1240,7 +1215,9 @@ static void ieee80211_rx_mgmt_assoc_resp(struct net_device *dev,
+ 			       " AP\n", dev->name);
+ 			return;
+ 		}
+-		bss = ieee80211_rx_bss_get(dev, ifsta->bssid);
++		bss = ieee80211_rx_bss_get(dev, ifsta->bssid,
++					   local->hw.conf.channel,
++					   ifsta->ssid, ifsta->ssid_len);
+ 		if (bss) {
+ 			sta->last_rssi = bss->rssi;
+ 			sta->last_signal = bss->signal;
+@@ -1321,7 +1298,8 @@ static void __ieee80211_rx_bss_hash_del(struct net_device *dev,
+ 
+ 
+ static struct ieee80211_sta_bss *
+-ieee80211_rx_bss_add(struct net_device *dev, u8 *bssid)
++ieee80211_rx_bss_add(struct net_device *dev, u8 *bssid, int channel,
++		     u8 *ssid, u8 ssid_len)
+ {
+ 	struct ieee80211_local *local = wdev_priv(dev->ieee80211_ptr);
+ 	struct ieee80211_sta_bss *bss;
+@@ -1332,6 +1310,11 @@ ieee80211_rx_bss_add(struct net_device *dev, u8 *bssid)
+ 	atomic_inc(&bss->users);
+ 	atomic_inc(&bss->users);
+ 	memcpy(bss->bssid, bssid, ETH_ALEN);
++	bss->channel = channel;
++	if (ssid && ssid_len <= IEEE80211_MAX_SSID_LEN) {
++		memcpy(bss->ssid, ssid, ssid_len);
++		bss->ssid_len = ssid_len;
++	}
+ 
+ 	spin_lock_bh(&local->sta_bss_lock);
+ 	/* TODO: order by RSSI? */
+@@ -1343,7 +1326,8 @@ ieee80211_rx_bss_add(struct net_device *dev, u8 *bssid)
+ 
+ 
+ static struct ieee80211_sta_bss *
+-ieee80211_rx_bss_get(struct net_device *dev, u8 *bssid)
++ieee80211_rx_bss_get(struct net_device *dev, u8 *bssid, int channel,
++		     u8 *ssid, u8 ssid_len)
+ {
+ 	struct ieee80211_local *local = wdev_priv(dev->ieee80211_ptr);
+ 	struct ieee80211_sta_bss *bss;
+@@ -1351,7 +1335,10 @@ ieee80211_rx_bss_get(struct net_device *dev, u8 *bssid)
+ 	spin_lock_bh(&local->sta_bss_lock);
+ 	bss = local->sta_bss_hash[STA_HASH(bssid)];
+ 	while (bss) {
+-		if (memcmp(bss->bssid, bssid, ETH_ALEN) == 0) {
++		if (!memcmp(bss->bssid, bssid, ETH_ALEN) &&
++		    bss->channel == channel &&
++		    bss->ssid_len == ssid_len &&
++		    (ssid_len == 0 || !memcmp(bss->ssid, ssid, ssid_len))) {
+ 			atomic_inc(&bss->users);
+ 			break;
+ 		}
+@@ -1413,7 +1400,7 @@ static void ieee80211_rx_bss_info(struct net_device *dev,
+ 	struct ieee80211_local *local = wdev_priv(dev->ieee80211_ptr);
+ 	struct ieee802_11_elems elems;
+ 	size_t baselen;
+-	int channel, invalid = 0, clen;
++	int channel, clen;
+ 	struct ieee80211_sta_bss *bss;
+ 	struct sta_info *sta;
+ 	struct ieee80211_sub_if_data *sdata = IEEE80211_DEV_TO_SUB_IF(dev);
+@@ -1457,9 +1444,7 @@ static void ieee80211_rx_bss_info(struct net_device *dev,
+ #endif /* CONFIG_MAC80211_IBSS_DEBUG */
+ 	}
+ 
+-	if (ieee802_11_parse_elems(mgmt->u.beacon.variable, len - baselen,
+-				   &elems) == ParseFailed)
+-		invalid = 1;
++	ieee802_11_parse_elems(mgmt->u.beacon.variable, len - baselen, &elems);
+ 
+ 	if (sdata->type == IEEE80211_IF_TYPE_IBSS && elems.supp_rates &&
+ 	    memcmp(mgmt->bssid, sdata->u.sta.bssid, ETH_ALEN) == 0 &&
+@@ -1519,9 +1504,11 @@ static void ieee80211_rx_bss_info(struct net_device *dev,
+ 	else
+ 		channel = rx_status->channel;
+ 
+-	bss = ieee80211_rx_bss_get(dev, mgmt->bssid);
++	bss = ieee80211_rx_bss_get(dev, mgmt->bssid, channel,
++				   elems.ssid, elems.ssid_len);
+ 	if (!bss) {
+-		bss = ieee80211_rx_bss_add(dev, mgmt->bssid);
++		bss = ieee80211_rx_bss_add(dev, mgmt->bssid, channel,
++					   elems.ssid, elems.ssid_len);
+ 		if (!bss)
+ 			return;
+ 	} else {
+@@ -1547,10 +1534,6 @@ static void ieee80211_rx_bss_info(struct net_device *dev,
+ 
+ 	bss->beacon_int = le16_to_cpu(mgmt->u.beacon.beacon_int);
+ 	bss->capability = le16_to_cpu(mgmt->u.beacon.capab_info);
+-	if (elems.ssid && elems.ssid_len <= IEEE80211_MAX_SSID_LEN) {
+-		memcpy(bss->ssid, elems.ssid, elems.ssid_len);
+-		bss->ssid_len = elems.ssid_len;
+-	}
+ 
+ 	bss->supp_rates_len = 0;
+ 	if (elems.supp_rates) {
+@@ -1621,7 +1604,6 @@ static void ieee80211_rx_bss_info(struct net_device *dev,
+ 
+ 
+ 	bss->hw_mode = rx_status->phymode;
+-	bss->channel = channel;
+ 	bss->freq = rx_status->freq;
+ 	if (channel != rx_status->channel &&
+ 	    (bss->hw_mode == MODE_IEEE80211G ||
+@@ -1681,9 +1663,7 @@ static void ieee80211_rx_mgmt_beacon(struct net_device *dev,
+ 	if (baselen > len)
+ 		return;
+ 
+-	if (ieee802_11_parse_elems(mgmt->u.beacon.variable, len - baselen,
+-				   &elems) == ParseFailed)
+-		return;
++	ieee802_11_parse_elems(mgmt->u.beacon.variable, len - baselen, &elems);
+ 
+ 	if (elems.erp_info && elems.erp_info_len >= 1)
+ 		ieee80211_handle_erp_ie(dev, elems.erp_info[0]);
+@@ -2332,7 +2312,7 @@ static int ieee80211_sta_create_ibss(struct net_device *dev,
+ {
+ 	struct ieee80211_local *local = wdev_priv(dev->ieee80211_ptr);
+ 	struct ieee80211_sta_bss *bss;
+-	struct ieee80211_sub_if_data *sdata;
++	struct ieee80211_sub_if_data *sdata = IEEE80211_DEV_TO_SUB_IF(dev);
+ 	struct ieee80211_hw_mode *mode;
+ 	u8 bssid[ETH_ALEN], *pos;
+ 	int i;
+@@ -2354,18 +2334,17 @@ static int ieee80211_sta_create_ibss(struct net_device *dev,
+ 	printk(KERN_DEBUG "%s: Creating new IBSS network, BSSID " MAC_FMT "\n",
+ 	       dev->name, MAC_ARG(bssid));
+ 
+-	bss = ieee80211_rx_bss_add(dev, bssid);
++	bss = ieee80211_rx_bss_add(dev, bssid, local->hw.conf.channel,
++				   sdata->u.sta.ssid, sdata->u.sta.ssid_len);
+ 	if (!bss)
+ 		return -ENOMEM;
+ 
+-	sdata = IEEE80211_DEV_TO_SUB_IF(dev);
+ 	mode = local->oper_hw_mode;
+ 
+ 	if (local->hw.conf.beacon_int == 0)
+ 		local->hw.conf.beacon_int = 100;
+ 	bss->beacon_int = local->hw.conf.beacon_int;
+ 	bss->hw_mode = local->hw.conf.phymode;
+-	bss->channel = local->hw.conf.channel;
+ 	bss->freq = local->hw.conf.freq;
+ 	bss->last_update = jiffies;
+ 	bss->capability = WLAN_CAPABILITY_IBSS;
+@@ -2425,7 +2404,8 @@ static int ieee80211_sta_find_ibss(struct net_device *dev,
+ 	       MAC_FMT "\n", MAC_ARG(bssid), MAC_ARG(ifsta->bssid));
+ #endif /* CONFIG_MAC80211_IBSS_DEBUG */
+ 	if (found && memcmp(ifsta->bssid, bssid, ETH_ALEN) != 0 &&
+-	    (bss = ieee80211_rx_bss_get(dev, bssid))) {
++	    (bss = ieee80211_rx_bss_get(dev, bssid, local->hw.conf.channel,
++					ifsta->ssid, ifsta->ssid_len))) {
+ 		printk(KERN_DEBUG "%s: Selected IBSS BSSID " MAC_FMT
+ 		       " based on configured SSID\n",
+ 		       dev->name, MAC_ARG(bssid));
+diff --git a/net/netfilter/nf_conntrack_proto_tcp.c b/net/netfilter/nf_conntrack_proto_tcp.c
+index eb3fe74..70c5b7d 100644
+--- a/net/netfilter/nf_conntrack_proto_tcp.c
++++ b/net/netfilter/nf_conntrack_proto_tcp.c
+@@ -831,6 +831,22 @@ static int tcp_packet(struct nf_conn *conntrack,
+ 	tuple = &conntrack->tuplehash[dir].tuple;
+ 
+ 	switch (new_state) {
++	case TCP_CONNTRACK_SYN_SENT:
++		if (old_state < TCP_CONNTRACK_TIME_WAIT)
++			break;
++		if ((conntrack->proto.tcp.seen[!dir].flags &
++			IP_CT_TCP_FLAG_CLOSE_INIT)
++		    || (conntrack->proto.tcp.last_dir == dir
++		        && conntrack->proto.tcp.last_index == TCP_RST_SET)) {
++			/* Attempt to reopen a closed/aborted connection.
++			 * Delete this connection and look up again. */
++			write_unlock_bh(&tcp_lock);
++			if (del_timer(&conntrack->timeout))
++				conntrack->timeout.function((unsigned long)
++							    conntrack);
++			return -NF_REPEAT;
++		}
++		/* Fall through */
+ 	case TCP_CONNTRACK_IGNORE:
+ 		/* Ignored packets:
+ 		 *
+@@ -879,27 +895,6 @@ static int tcp_packet(struct nf_conn *conntrack,
+ 			nf_log_packet(pf, 0, skb, NULL, NULL, NULL,
+ 				  "nf_ct_tcp: invalid state ");
+ 		return -NF_ACCEPT;
+-	case TCP_CONNTRACK_SYN_SENT:
+-		if (old_state < TCP_CONNTRACK_TIME_WAIT)
+-			break;
+-		if ((conntrack->proto.tcp.seen[dir].flags &
+-			IP_CT_TCP_FLAG_CLOSE_INIT)
+-		    || after(ntohl(th->seq),
+-			     conntrack->proto.tcp.seen[dir].td_end)) {
+-			/* Attempt to reopen a closed connection.
+-			* Delete this connection and look up again. */
+-			write_unlock_bh(&tcp_lock);
+-			if (del_timer(&conntrack->timeout))
+-				conntrack->timeout.function((unsigned long)
+-							    conntrack);
+-			return -NF_REPEAT;
+-		} else {
+-			write_unlock_bh(&tcp_lock);
+-			if (LOG_INVALID(IPPROTO_TCP))
+-				nf_log_packet(pf, 0, skb, NULL, NULL,
+-					      NULL, "nf_ct_tcp: invalid SYN");
+-			return -NF_ACCEPT;
+-		}
+ 	case TCP_CONNTRACK_CLOSE:
+ 		if (index == TCP_RST_SET
+ 		    && ((test_bit(IPS_SEEN_REPLY_BIT, &conntrack->status)
+@@ -932,6 +927,7 @@ static int tcp_packet(struct nf_conn *conntrack,
+      in_window:
+ 	/* From now on we have got in-window packets */
+ 	conntrack->proto.tcp.last_index = index;
++	conntrack->proto.tcp.last_dir = dir;
+ 
+ 	pr_debug("tcp_conntracks: ");
+ 	NF_CT_DUMP_TUPLE(tuple);
+diff --git a/net/netlink/af_netlink.c b/net/netlink/af_netlink.c
+index 5681ce3..1a0fcc5 100644
+--- a/net/netlink/af_netlink.c
++++ b/net/netlink/af_netlink.c
+@@ -744,7 +744,7 @@ struct sock *netlink_getsockbyfilp(struct file *filp)
+  * 1: repeat lookup - reference dropped while waiting for socket memory.
+  */
+ int netlink_attachskb(struct sock *sk, struct sk_buff *skb, int nonblock,
+-		long timeo, struct sock *ssk)
++		      long *timeo, struct sock *ssk)
+ {
+ 	struct netlink_sock *nlk;
+ 
+@@ -753,7 +753,7 @@ int netlink_attachskb(struct sock *sk, struct sk_buff *skb, int nonblock,
+ 	if (atomic_read(&sk->sk_rmem_alloc) > sk->sk_rcvbuf ||
+ 	    test_bit(0, &nlk->state)) {
+ 		DECLARE_WAITQUEUE(wait, current);
+-		if (!timeo) {
++		if (!*timeo) {
+ 			if (!ssk || nlk_sk(ssk)->pid == 0)
+ 				netlink_overrun(sk);
+ 			sock_put(sk);
+@@ -767,7 +767,7 @@ int netlink_attachskb(struct sock *sk, struct sk_buff *skb, int nonblock,
+ 		if ((atomic_read(&sk->sk_rmem_alloc) > sk->sk_rcvbuf ||
+ 		     test_bit(0, &nlk->state)) &&
+ 		    !sock_flag(sk, SOCK_DEAD))
+-			timeo = schedule_timeout(timeo);
++			*timeo = schedule_timeout(*timeo);
+ 
+ 		__set_current_state(TASK_RUNNING);
+ 		remove_wait_queue(&nlk->wait, &wait);
+@@ -775,7 +775,7 @@ int netlink_attachskb(struct sock *sk, struct sk_buff *skb, int nonblock,
+ 
+ 		if (signal_pending(current)) {
+ 			kfree_skb(skb);
+-			return sock_intr_errno(timeo);
++			return sock_intr_errno(*timeo);
+ 		}
+ 		return 1;
+ 	}
+@@ -839,7 +839,7 @@ retry:
+ 		kfree_skb(skb);
+ 		return PTR_ERR(sk);
+ 	}
+-	err = netlink_attachskb(sk, skb, nonblock, timeo, ssk);
++	err = netlink_attachskb(sk, skb, nonblock, &timeo, ssk);
+ 	if (err == 1)
+ 		goto retry;
+ 	if (err)
+diff --git a/net/sched/cls_u32.c b/net/sched/cls_u32.c
+index d4d5d2f..fceb75b 100644
+--- a/net/sched/cls_u32.c
++++ b/net/sched/cls_u32.c
+@@ -91,7 +91,7 @@ static struct tc_u_common *u32_list;
+ 
+ static __inline__ unsigned u32_hash_fold(u32 key, struct tc_u32_sel *sel, u8 fshift)
+ {
+-	unsigned h = (key & sel->hmask)>>fshift;
++	unsigned h = ntohl(key & sel->hmask)>>fshift;
+ 
+ 	return h;
+ }
+@@ -615,7 +615,7 @@ static int u32_change(struct tcf_proto *tp, unsigned long base, u32 handle,
+ 	n->handle = handle;
+ {
+ 	u8 i = 0;
+-	u32 mask = s->hmask;
++	u32 mask = ntohl(s->hmask);
+ 	if (mask) {
+ 		while (!(mask & 1)) {
+ 			i++;
+diff --git a/net/sched/sch_api.c b/net/sched/sch_api.c
+index dee0d5f..8f1bcf6 100644
+--- a/net/sched/sch_api.c
++++ b/net/sched/sch_api.c
+@@ -1225,10 +1225,13 @@ EXPORT_SYMBOL(tcf_destroy_chain);
+ #ifdef CONFIG_PROC_FS
+ static int psched_show(struct seq_file *seq, void *v)
+ {
++	struct timespec ts;
++
++	hrtimer_get_res(CLOCK_MONOTONIC, &ts);
+ 	seq_printf(seq, "%08x %08x %08x %08x\n",
+ 		   (u32)NSEC_PER_USEC, (u32)PSCHED_US2NS(1),
+ 		   1000000,
+-		   (u32)NSEC_PER_SEC/(u32)ktime_to_ns(KTIME_MONOTONIC_RES));
++		   (u32)NSEC_PER_SEC/(u32)ktime_to_ns(timespec_to_ktime(ts)));
+ 
+ 	return 0;
+ }
+diff --git a/net/sched/sch_teql.c b/net/sched/sch_teql.c
+index 0968184..cb5754b 100644
+--- a/net/sched/sch_teql.c
++++ b/net/sched/sch_teql.c
+@@ -249,6 +249,9 @@ __teql_resolve(struct sk_buff *skb, struct sk_buff *skb_res, struct net_device *
+ static __inline__ int
+ teql_resolve(struct sk_buff *skb, struct sk_buff *skb_res, struct net_device *dev)
+ {
++	if (dev->qdisc == &noop_qdisc)
++		return -ENODEV;
++
+ 	if (dev->hard_header == NULL ||
+ 	    skb->dst == NULL ||
+ 	    skb->dst->neighbour == NULL)
+diff --git a/net/socket.c b/net/socket.c
+index b09eb90..8e5be74 100644
+--- a/net/socket.c
++++ b/net/socket.c
+@@ -1245,11 +1245,14 @@ asmlinkage long sys_socketpair(int family, int type, int protocol,
+ 		goto out_release_both;
+ 
+ 	fd1 = sock_alloc_fd(&newfile1);
+-	if (unlikely(fd1 < 0))
++	if (unlikely(fd1 < 0)) {
++		err = fd1;
+ 		goto out_release_both;
++	}
+ 
+ 	fd2 = sock_alloc_fd(&newfile2);
+ 	if (unlikely(fd2 < 0)) {
++		err = fd2;
+ 		put_filp(newfile1);
+ 		put_unused_fd(fd1);
+ 		goto out_release_both;
+@@ -2230,6 +2233,7 @@ int kernel_accept(struct socket *sock, struct socket **newsock, int flags)
+ 	err = sock->ops->accept(sock, *newsock, flags);
+ 	if (err < 0) {
+ 		sock_release(*newsock);
++		*newsock = NULL;
+ 		goto done;
+ 	}
+ 

Added: dists/sid/linux-2.6/debian/patches/bugfix/all/stable/2.6.23.5.patch
==============================================================================
--- (empty file)
+++ dists/sid/linux-2.6/debian/patches/bugfix/all/stable/2.6.23.5.patch	Mon Nov 26 20:06:56 2007
@@ -0,0 +1,951 @@
+diff --git a/Makefile b/Makefile
+index 0c34409..e11814e 100644
+diff --git a/drivers/net/ehea/ehea_qmr.c b/drivers/net/ehea/ehea_qmr.c
+index c82e245..329a252 100644
+--- a/drivers/net/ehea/ehea_qmr.c
++++ b/drivers/net/ehea/ehea_qmr.c
+@@ -563,8 +563,7 @@ int ehea_destroy_qp(struct ehea_qp *qp)
+ int ehea_create_busmap( void )
+ {
+ 	u64 vaddr = EHEA_BUSMAP_START;
+-	unsigned long abs_max_pfn = 0;
+-	unsigned long sec_max_pfn;
++	unsigned long high_section_index = 0;
+ 	int i;
+ 
+ 	/*
+@@ -574,14 +573,10 @@ int ehea_create_busmap( void )
+ 	ehea_bmap.valid_sections = 0;
+ 
+ 	for (i = 0; i < NR_MEM_SECTIONS; i++)
+-		if (valid_section_nr(i)) {
+-			sec_max_pfn = section_nr_to_pfn(i);
+-			if (sec_max_pfn > abs_max_pfn)
+-				abs_max_pfn = sec_max_pfn;
+-			ehea_bmap.valid_sections++;
+-		}
++		if (valid_section_nr(i))
++			high_section_index = i;
+ 
+-	ehea_bmap.entries = abs_max_pfn / EHEA_PAGES_PER_SECTION + 1;
++	ehea_bmap.entries = high_section_index + 1;
+ 	ehea_bmap.vaddr = vmalloc(ehea_bmap.entries * sizeof(*ehea_bmap.vaddr));
+ 
+ 	if (!ehea_bmap.vaddr)
+@@ -593,6 +588,7 @@ int ehea_create_busmap( void )
+ 		if (pfn_valid(pfn)) {
+ 			ehea_bmap.vaddr[i] = vaddr;
+ 			vaddr += EHEA_SECTSIZE;
++			ehea_bmap.valid_sections++;
+ 		} else
+ 			ehea_bmap.vaddr[i] = 0;
+ 	}
+@@ -637,7 +633,7 @@ int ehea_reg_kernel_mr(struct ehea_adapter *adapter, struct ehea_mr *mr)
+ 
+ 	mr_len = ehea_bmap.valid_sections * EHEA_SECTSIZE;
+ 
+-	pt =  kzalloc(EHEA_MAX_RPAGE * sizeof(u64), GFP_KERNEL);
++	pt =  kzalloc(PAGE_SIZE, GFP_KERNEL);
+ 	if (!pt) {
+ 		ehea_error("no mem");
+ 		ret = -ENOMEM;
+@@ -660,8 +656,8 @@ int ehea_reg_kernel_mr(struct ehea_adapter *adapter, struct ehea_mr *mr)
+ 			void *sectbase = __va(i << SECTION_SIZE_BITS);
+ 			unsigned long k = 0;
+ 
+-			for (j = 0; j < (PAGES_PER_SECTION / EHEA_MAX_RPAGE);
+-			      j++) {
++			for (j = 0; j < (EHEA_PAGES_PER_SECTION /
++					 EHEA_MAX_RPAGE); j++) {
+ 
+ 				for (m = 0; m < EHEA_MAX_RPAGE; m++) {
+ 					pg = sectbase + ((k++) * EHEA_PAGESIZE);
+diff --git a/drivers/net/ehea/ehea_qmr.h b/drivers/net/ehea/ehea_qmr.h
+index b71f845..352cb38 100644
+--- a/drivers/net/ehea/ehea_qmr.h
++++ b/drivers/net/ehea/ehea_qmr.h
+@@ -39,7 +39,7 @@
+ #define EHEA_PAGESHIFT         12
+ #define EHEA_PAGESIZE          (1UL << EHEA_PAGESHIFT)
+ #define EHEA_SECTSIZE          (1UL << 24)
+-#define EHEA_PAGES_PER_SECTION (EHEA_SECTSIZE >> PAGE_SHIFT)
++#define EHEA_PAGES_PER_SECTION (EHEA_SECTSIZE >> EHEA_PAGESHIFT)
+ 
+ #if (1UL << SECTION_SIZE_BITS) < EHEA_SECTSIZE
+ #error eHEA module can't work if kernel sectionsize < ehea sectionsize
+diff --git a/drivers/net/forcedeth.c b/drivers/net/forcedeth.c
+index 1938d6d..d68796e 100644
+--- a/drivers/net/forcedeth.c
++++ b/drivers/net/forcedeth.c
+@@ -988,7 +988,7 @@ static void nv_enable_irq(struct net_device *dev)
+ 		if (np->msi_flags & NV_MSI_X_ENABLED)
+ 			enable_irq(np->msi_x_entry[NV_MSI_X_VECTOR_ALL].vector);
+ 		else
+-			enable_irq(dev->irq);
++			enable_irq(np->pci_dev->irq);
+ 	} else {
+ 		enable_irq(np->msi_x_entry[NV_MSI_X_VECTOR_RX].vector);
+ 		enable_irq(np->msi_x_entry[NV_MSI_X_VECTOR_TX].vector);
+@@ -1004,7 +1004,7 @@ static void nv_disable_irq(struct net_device *dev)
+ 		if (np->msi_flags & NV_MSI_X_ENABLED)
+ 			disable_irq(np->msi_x_entry[NV_MSI_X_VECTOR_ALL].vector);
+ 		else
+-			disable_irq(dev->irq);
++			disable_irq(np->pci_dev->irq);
+ 	} else {
+ 		disable_irq(np->msi_x_entry[NV_MSI_X_VECTOR_RX].vector);
+ 		disable_irq(np->msi_x_entry[NV_MSI_X_VECTOR_TX].vector);
+@@ -1601,7 +1601,7 @@ static void nv_do_rx_refill(unsigned long data)
+ 		if (np->msi_flags & NV_MSI_X_ENABLED)
+ 			disable_irq(np->msi_x_entry[NV_MSI_X_VECTOR_ALL].vector);
+ 		else
+-			disable_irq(dev->irq);
++			disable_irq(np->pci_dev->irq);
+ 	} else {
+ 		disable_irq(np->msi_x_entry[NV_MSI_X_VECTOR_RX].vector);
+ 	}
+@@ -1619,7 +1619,7 @@ static void nv_do_rx_refill(unsigned long data)
+ 		if (np->msi_flags & NV_MSI_X_ENABLED)
+ 			enable_irq(np->msi_x_entry[NV_MSI_X_VECTOR_ALL].vector);
+ 		else
+-			enable_irq(dev->irq);
++			enable_irq(np->pci_dev->irq);
+ 	} else {
+ 		enable_irq(np->msi_x_entry[NV_MSI_X_VECTOR_RX].vector);
+ 	}
+@@ -3557,10 +3557,12 @@ static int nv_request_irq(struct net_device *dev, int intr_test)
+ 	if (ret != 0 && np->msi_flags & NV_MSI_CAPABLE) {
+ 		if ((ret = pci_enable_msi(np->pci_dev)) == 0) {
+ 			np->msi_flags |= NV_MSI_ENABLED;
++			dev->irq = np->pci_dev->irq;
+ 			if (request_irq(np->pci_dev->irq, handler, IRQF_SHARED, dev->name, dev) != 0) {
+ 				printk(KERN_INFO "forcedeth: request_irq failed %d\n", ret);
+ 				pci_disable_msi(np->pci_dev);
+ 				np->msi_flags &= ~NV_MSI_ENABLED;
++				dev->irq = np->pci_dev->irq;
+ 				goto out_err;
+ 			}
+ 
+@@ -3623,7 +3625,7 @@ static void nv_do_nic_poll(unsigned long data)
+ 		if (np->msi_flags & NV_MSI_X_ENABLED)
+ 			disable_irq_lockdep(np->msi_x_entry[NV_MSI_X_VECTOR_ALL].vector);
+ 		else
+-			disable_irq_lockdep(dev->irq);
++			disable_irq_lockdep(np->pci_dev->irq);
+ 		mask = np->irqmask;
+ 	} else {
+ 		if (np->nic_poll_irq & NVREG_IRQ_RX_ALL) {
+@@ -3641,6 +3643,8 @@ static void nv_do_nic_poll(unsigned long data)
+ 	}
+ 	np->nic_poll_irq = 0;
+ 
++	/* disable_irq() contains synchronize_irq, thus no irq handler can run now */
++
+ 	if (np->recover_error) {
+ 		np->recover_error = 0;
+ 		printk(KERN_INFO "forcedeth: MAC in recoverable error state\n");
+@@ -3677,7 +3681,6 @@ static void nv_do_nic_poll(unsigned long data)
+ 		}
+ 	}
+ 
+-	/* FIXME: Do we need synchronize_irq(dev->irq) here? */
+ 
+ 	writel(mask, base + NvRegIrqMask);
+ 	pci_push(base);
+@@ -3690,7 +3693,7 @@ static void nv_do_nic_poll(unsigned long data)
+ 		if (np->msi_flags & NV_MSI_X_ENABLED)
+ 			enable_irq_lockdep(np->msi_x_entry[NV_MSI_X_VECTOR_ALL].vector);
+ 		else
+-			enable_irq_lockdep(dev->irq);
++			enable_irq_lockdep(np->pci_dev->irq);
+ 	} else {
+ 		if (np->nic_poll_irq & NVREG_IRQ_RX_ALL) {
+ 			nv_nic_irq_rx(0, dev);
+@@ -4943,7 +4946,7 @@ static int nv_close(struct net_device *dev)
+ 	np->in_shutdown = 1;
+ 	spin_unlock_irq(&np->lock);
+ 	netif_poll_disable(dev);
+-	synchronize_irq(dev->irq);
++	synchronize_irq(np->pci_dev->irq);
+ 
+ 	del_timer_sync(&np->oom_kick);
+ 	del_timer_sync(&np->nic_poll);
+@@ -5563,6 +5566,22 @@ static struct pci_device_id pci_tbl[] = {
+ 		PCI_DEVICE(PCI_VENDOR_ID_NVIDIA, PCI_DEVICE_ID_NVIDIA_NVENET_31),
+ 		.driver_data = DEV_NEED_TIMERIRQ|DEV_NEED_LINKTIMER|DEV_HAS_HIGH_DMA|DEV_HAS_POWER_CNTRL|DEV_HAS_MSI|DEV_HAS_PAUSEFRAME_TX|DEV_HAS_STATISTICS_V2|DEV_HAS_TEST_EXTENDED|DEV_HAS_MGMT_UNIT|DEV_HAS_CORRECT_MACADDR,
+ 	},
++	{	/* MCP77 Ethernet Controller */
++		PCI_DEVICE(PCI_VENDOR_ID_NVIDIA, PCI_DEVICE_ID_NVIDIA_NVENET_32),
++		.driver_data = DEV_NEED_TIMERIRQ|DEV_NEED_LINKTIMER|DEV_HAS_CHECKSUM|DEV_HAS_HIGH_DMA|DEV_HAS_MSI|DEV_HAS_POWER_CNTRL|DEV_HAS_PAUSEFRAME_TX|DEV_HAS_STATISTICS_V2|DEV_HAS_TEST_EXTENDED|DEV_HAS_MGMT_UNIT,
++	},
++	{	/* MCP77 Ethernet Controller */
++		PCI_DEVICE(PCI_VENDOR_ID_NVIDIA, PCI_DEVICE_ID_NVIDIA_NVENET_33),
++		.driver_data = DEV_NEED_TIMERIRQ|DEV_NEED_LINKTIMER|DEV_HAS_CHECKSUM|DEV_HAS_HIGH_DMA|DEV_HAS_MSI|DEV_HAS_POWER_CNTRL|DEV_HAS_PAUSEFRAME_TX|DEV_HAS_STATISTICS_V2|DEV_HAS_TEST_EXTENDED|DEV_HAS_MGMT_UNIT,
++	},
++	{	/* MCP77 Ethernet Controller */
++		PCI_DEVICE(PCI_VENDOR_ID_NVIDIA, PCI_DEVICE_ID_NVIDIA_NVENET_34),
++		.driver_data = DEV_NEED_TIMERIRQ|DEV_NEED_LINKTIMER|DEV_HAS_CHECKSUM|DEV_HAS_HIGH_DMA|DEV_HAS_MSI|DEV_HAS_POWER_CNTRL|DEV_HAS_PAUSEFRAME_TX|DEV_HAS_STATISTICS_V2|DEV_HAS_TEST_EXTENDED|DEV_HAS_MGMT_UNIT,
++	},
++	{	/* MCP77 Ethernet Controller */
++		PCI_DEVICE(PCI_VENDOR_ID_NVIDIA, PCI_DEVICE_ID_NVIDIA_NVENET_35),
++		.driver_data = DEV_NEED_TIMERIRQ|DEV_NEED_LINKTIMER|DEV_HAS_CHECKSUM|DEV_HAS_HIGH_DMA|DEV_HAS_MSI|DEV_HAS_POWER_CNTRL|DEV_HAS_PAUSEFRAME_TX|DEV_HAS_STATISTICS_V2|DEV_HAS_TEST_EXTENDED|DEV_HAS_MGMT_UNIT,
++	},
+ 	{0,},
+ };
+ 
+diff --git a/drivers/net/pppol2tp.c b/drivers/net/pppol2tp.c
+index abe91cb..7da0d07 100644
+--- a/drivers/net/pppol2tp.c
++++ b/drivers/net/pppol2tp.c
+@@ -487,7 +487,7 @@ static int pppol2tp_recv_core(struct sock *sock, struct sk_buff *skb)
+ {
+ 	struct pppol2tp_session *session = NULL;
+ 	struct pppol2tp_tunnel *tunnel;
+-	unsigned char *ptr;
++	unsigned char *ptr, *optr;
+ 	u16 hdrflags;
+ 	u16 tunnel_id, session_id;
+ 	int length;
+@@ -495,7 +495,7 @@ static int pppol2tp_recv_core(struct sock *sock, struct sk_buff *skb)
+ 
+ 	tunnel = pppol2tp_sock_to_tunnel(sock);
+ 	if (tunnel == NULL)
+-		goto error;
++		goto no_tunnel;
+ 
+ 	/* UDP always verifies the packet length. */
+ 	__skb_pull(skb, sizeof(struct udphdr));
+@@ -508,7 +508,7 @@ static int pppol2tp_recv_core(struct sock *sock, struct sk_buff *skb)
+ 	}
+ 
+ 	/* Point to L2TP header */
+-	ptr = skb->data;
++	optr = ptr = skb->data;
+ 
+ 	/* Get L2TP header flags */
+ 	hdrflags = ntohs(*(__be16*)ptr);
+@@ -636,12 +636,14 @@ static int pppol2tp_recv_core(struct sock *sock, struct sk_buff *skb)
+ 	/* If offset bit set, skip it. */
+ 	if (hdrflags & L2TP_HDRFLAG_O) {
+ 		offset = ntohs(*(__be16 *)ptr);
+-		skb->transport_header += 2 + offset;
+-		if (!pskb_may_pull(skb, skb_transport_offset(skb) + 2))
+-			goto discard;
++		ptr += 2 + offset;
+ 	}
+ 
+-	__skb_pull(skb, skb_transport_offset(skb));
++	offset = ptr - optr;
++	if (!pskb_may_pull(skb, offset))
++		goto discard;
++
++	__skb_pull(skb, offset);
+ 
+ 	/* Skip PPP header, if present.	 In testing, Microsoft L2TP clients
+ 	 * don't send the PPP header (PPP header compression enabled), but
+@@ -651,6 +653,9 @@ static int pppol2tp_recv_core(struct sock *sock, struct sk_buff *skb)
+ 	 * Note that skb->data[] isn't dereferenced from a u16 ptr here since
+ 	 * the field may be unaligned.
+ 	 */
++	if (!pskb_may_pull(skb, 2))
++		goto discard;
++
+ 	if ((skb->data[0] == 0xff) && (skb->data[1] == 0x03))
+ 		skb_pull(skb, 2);
+ 
+@@ -708,6 +713,10 @@ discard:
+ 	return 0;
+ 
+ error:
++	/* Put UDP header back */
++	__skb_push(skb, sizeof(struct udphdr));
++
++no_tunnel:
+ 	return 1;
+ }
+ 
+@@ -1049,6 +1058,8 @@ static int pppol2tp_xmit(struct ppp_channel *chan, struct sk_buff *skb)
+ 	/* Get routing info from the tunnel socket */
+ 	dst_release(skb->dst);
+ 	skb->dst = sk_dst_get(sk_tun);
++	skb_orphan(skb);
++	skb->sk = sk_tun;
+ 
+ 	/* Queue the packet to IP for output */
+ 	len = skb->len;
+diff --git a/drivers/net/skge.c b/drivers/net/skge.c
+index e3d8520..b3d4728 100644
+--- a/drivers/net/skge.c
++++ b/drivers/net/skge.c
+@@ -57,7 +57,7 @@
+ #define TX_WATCHDOG		(5 * HZ)
+ #define NAPI_WEIGHT		64
+ #define BLINK_MS		250
+-#define LINK_HZ			(HZ/2)
++#define LINK_HZ			HZ
+ 
+ MODULE_DESCRIPTION("SysKonnect Gigabit Ethernet driver");
+ MODULE_AUTHOR("Stephen Hemminger <shemminger at linux-foundation.org>");
+@@ -992,19 +992,15 @@ static void xm_link_down(struct skge_hw *hw, int port)
+ {
+ 	struct net_device *dev = hw->dev[port];
+ 	struct skge_port *skge = netdev_priv(dev);
+-	u16 cmd, msk;
++	u16 cmd = xm_read16(hw, port, XM_MMU_CMD);
+ 
+-	if (hw->phy_type == SK_PHY_XMAC) {
+-		msk = xm_read16(hw, port, XM_IMSK);
+-		msk |= XM_IS_INP_ASS | XM_IS_LIPA_RC | XM_IS_RX_PAGE | XM_IS_AND;
+-		xm_write16(hw, port, XM_IMSK, msk);
+-	}
++	xm_write16(hw, port, XM_IMSK, XM_IMSK_DISABLE);
+ 
+-	cmd = xm_read16(hw, port, XM_MMU_CMD);
+ 	cmd &= ~(XM_MMU_ENA_RX | XM_MMU_ENA_TX);
+ 	xm_write16(hw, port, XM_MMU_CMD, cmd);
++
+ 	/* dummy read to ensure writing */
+-	(void) xm_read16(hw, port, XM_MMU_CMD);
++	xm_read16(hw, port, XM_MMU_CMD);
+ 
+ 	if (netif_carrier_ok(dev))
+ 		skge_link_down(skge);
+@@ -1100,7 +1096,7 @@ static void genesis_reset(struct skge_hw *hw, int port)
+ 
+ 	/* reset the statistics module */
+ 	xm_write32(hw, port, XM_GP_PORT, XM_GP_RES_STAT);
+-	xm_write16(hw, port, XM_IMSK, 0xffff);	/* disable XMAC IRQs */
++	xm_write16(hw, port, XM_IMSK, XM_IMSK_DISABLE);
+ 	xm_write32(hw, port, XM_MODE, 0);		/* clear Mode Reg */
+ 	xm_write16(hw, port, XM_TX_CMD, 0);	/* reset TX CMD Reg */
+ 	xm_write16(hw, port, XM_RX_CMD, 0);	/* reset RX CMD Reg */
+@@ -1138,7 +1134,7 @@ static void bcom_check_link(struct skge_hw *hw, int port)
+ 	u16 status;
+ 
+ 	/* read twice because of latch */
+-	(void) xm_phy_read(hw, port, PHY_BCOM_STAT);
++	xm_phy_read(hw, port, PHY_BCOM_STAT);
+ 	status = xm_phy_read(hw, port, PHY_BCOM_STAT);
+ 
+ 	if ((status & PHY_ST_LSYNC) == 0) {
+@@ -1339,7 +1335,7 @@ static void xm_phy_init(struct skge_port *skge)
+ 	mod_timer(&skge->link_timer, jiffies + LINK_HZ);
+ }
+ 
+-static void xm_check_link(struct net_device *dev)
++static int xm_check_link(struct net_device *dev)
+ {
+ 	struct skge_port *skge = netdev_priv(dev);
+ 	struct skge_hw *hw = skge->hw;
+@@ -1347,25 +1343,25 @@ static void xm_check_link(struct net_device *dev)
+ 	u16 status;
+ 
+ 	/* read twice because of latch */
+-	(void) xm_phy_read(hw, port, PHY_XMAC_STAT);
++	xm_phy_read(hw, port, PHY_XMAC_STAT);
+ 	status = xm_phy_read(hw, port, PHY_XMAC_STAT);
+ 
+ 	if ((status & PHY_ST_LSYNC) == 0) {
+ 		xm_link_down(hw, port);
+-		return;
++		return 0;
+ 	}
+ 
+ 	if (skge->autoneg == AUTONEG_ENABLE) {
+ 		u16 lpa, res;
+ 
+ 		if (!(status & PHY_ST_AN_OVER))
+-			return;
++			return 0;
+ 
+ 		lpa = xm_phy_read(hw, port, PHY_XMAC_AUNE_LP);
+ 		if (lpa & PHY_B_AN_RF) {
+ 			printk(KERN_NOTICE PFX "%s: remote fault\n",
+ 			       dev->name);
+-			return;
++			return 0;
+ 		}
+ 
+ 		res = xm_phy_read(hw, port, PHY_XMAC_RES_ABI);
+@@ -1381,7 +1377,7 @@ static void xm_check_link(struct net_device *dev)
+ 		default:
+ 			printk(KERN_NOTICE PFX "%s: duplex mismatch\n",
+ 			       dev->name);
+-			return;
++			return 0;
+ 		}
+ 
+ 		/* We are using IEEE 802.3z/D5.0 Table 37-4 */
+@@ -1405,11 +1401,14 @@ static void xm_check_link(struct net_device *dev)
+ 
+ 	if (!netif_carrier_ok(dev))
+ 		genesis_link_up(skge);
++	return 1;
+ }
+ 
+ /* Poll to check for link coming up.
++ *
+  * Since internal PHY is wired to a level triggered pin, can't
+- * get an interrupt when carrier is detected.
++ * get an interrupt when carrier is detected, need to poll for
++ * link coming up.
+  */
+ static void xm_link_timer(unsigned long arg)
+ {
+@@ -1417,29 +1416,35 @@ static void xm_link_timer(unsigned long arg)
+ 	struct net_device *dev = skge->netdev;
+  	struct skge_hw *hw = skge->hw;
+ 	int port = skge->port;
++	int i;
++	unsigned long flags;
+ 
+ 	if (!netif_running(dev))
+ 		return;
+ 
+-	if (netif_carrier_ok(dev)) {
++	spin_lock_irqsave(&hw->phy_lock, flags);
++
++	/*
++	 * Verify that the link by checking GPIO register three times.
++	 * This pin has the signal from the link_sync pin connected to it.
++	 */
++	for (i = 0; i < 3; i++) {
++		if (xm_read16(hw, port, XM_GP_PORT) & XM_GP_INP_ASS)
++			goto link_down;
++	}
++
++        /* Re-enable interrupt to detect link down */
++	if (xm_check_link(dev)) {
++		u16 msk = xm_read16(hw, port, XM_IMSK);
++		msk &= ~XM_IS_INP_ASS;
++		xm_write16(hw, port, XM_IMSK, msk);
+ 		xm_read16(hw, port, XM_ISRC);
+-		if (!(xm_read16(hw, port, XM_ISRC) & XM_IS_INP_ASS))
+-			goto nochange;
+ 	} else {
+-		if (xm_read32(hw, port, XM_GP_PORT) & XM_GP_INP_ASS)
+-			goto nochange;
+-		xm_read16(hw, port, XM_ISRC);
+-		if (xm_read16(hw, port, XM_ISRC) & XM_IS_INP_ASS)
+-			goto nochange;
++link_down:
++		mod_timer(&skge->link_timer,
++			  round_jiffies(jiffies + LINK_HZ));
+ 	}
+-
+-	spin_lock(&hw->phy_lock);
+-	xm_check_link(dev);
+-	spin_unlock(&hw->phy_lock);
+-
+-nochange:
+-	if (netif_running(dev))
+-		mod_timer(&skge->link_timer, jiffies + LINK_HZ);
++	spin_unlock_irqrestore(&hw->phy_lock, flags);
+ }
+ 
+ static void genesis_mac_init(struct skge_hw *hw, int port)
+@@ -1683,14 +1688,16 @@ static void genesis_mac_intr(struct skge_hw *hw, int port)
+ 		printk(KERN_DEBUG PFX "%s: mac interrupt status 0x%x\n",
+ 		       skge->netdev->name, status);
+ 
+-	if (hw->phy_type == SK_PHY_XMAC &&
+-	    (status & (XM_IS_INP_ASS | XM_IS_LIPA_RC)))
+-		xm_link_down(hw, port);
++	if (hw->phy_type == SK_PHY_XMAC && (status & XM_IS_INP_ASS)) {
++  		xm_link_down(hw, port);
++		mod_timer(&skge->link_timer, jiffies + 1);
++	}
+ 
+ 	if (status & XM_IS_TXF_UR) {
+ 		xm_write32(hw, port, XM_MODE, XM_MD_FTF);
+ 		++skge->net_stats.tx_fifo_errors;
+ 	}
++
+ 	if (status & XM_IS_RXF_OV) {
+ 		xm_write32(hw, port, XM_MODE, XM_MD_FRF);
+ 		++skge->net_stats.rx_fifo_errors;
+@@ -1750,11 +1757,12 @@ static void genesis_link_up(struct skge_port *skge)
+ 	}
+ 
+ 	xm_write32(hw, port, XM_MODE, mode);
+-	msk = XM_DEF_MSK;
+-	if (hw->phy_type != SK_PHY_XMAC)
+-		msk |= XM_IS_INP_ASS;	/* disable GP0 interrupt bit */
+ 
++	/* Turn on detection of Tx underrun, Rx overrun */
++	msk = xm_read16(hw, port, XM_IMSK);
++	msk &= ~(XM_IS_RXF_OV | XM_IS_TXF_UR);
+ 	xm_write16(hw, port, XM_IMSK, msk);
++
+ 	xm_read16(hw, port, XM_ISRC);
+ 
+ 	/* get MMU Command Reg. */
+@@ -2185,7 +2193,7 @@ static void yukon_mac_intr(struct skge_hw *hw, int port)
+ 	u8 status = skge_read8(hw, SK_REG(port, GMAC_IRQ_SRC));
+ 
+ 	if (netif_msg_intr(skge))
+-		printk(KERN_DEBUG PFX "%s: mac interrupt status 0x%x\n",
++		printk(KERN_DEBUG PFX "%s: yukon mac interrupt status 0x%x\n",
+ 		       dev->name, status);
+ 
+ 	if (status & GM_IS_RX_FF_OR) {
+diff --git a/drivers/net/skge.h b/drivers/net/skge.h
+index edd7146..323d6c6 100644
+--- a/drivers/net/skge.h
++++ b/drivers/net/skge.h
+@@ -2193,11 +2193,9 @@ enum {
+ 	XM_IS_TXF_UR	= 1<<2,	/* Bit  2:	Transmit FIFO Underrun */
+ 	XM_IS_TX_COMP	= 1<<1,	/* Bit  1:	Frame Tx Complete */
+ 	XM_IS_RX_COMP	= 1<<0,	/* Bit  0:	Frame Rx Complete */
+-};
+-
+-#define XM_DEF_MSK	(~(XM_IS_INP_ASS | XM_IS_LIPA_RC | \
+-			   XM_IS_RXF_OV | XM_IS_TXF_UR))
+ 
++	XM_IMSK_DISABLE	= 0xffff,
++};
+ 
+ /*	XM_HW_CFG	16 bit r/w	Hardware Config Register */
+ enum {
+diff --git a/drivers/net/sky2.c b/drivers/net/sky2.c
+index ea117fc..2575077 100644
+--- a/drivers/net/sky2.c
++++ b/drivers/net/sky2.c
+@@ -603,21 +603,22 @@ static void sky2_phy_init(struct sky2_hw *hw, unsigned port)
+ static void sky2_phy_power(struct sky2_hw *hw, unsigned port, int onoff)
+ {
+ 	u32 reg1;
+-	static const u32 phy_power[]
+-		= { PCI_Y2_PHY1_POWD, PCI_Y2_PHY2_POWD };
+-
+-	/* looks like this XL is back asswards .. */
+-	if (hw->chip_id == CHIP_ID_YUKON_XL && hw->chip_rev > 1)
+-		onoff = !onoff;
++	static const u32 phy_power[] = { PCI_Y2_PHY1_POWD, PCI_Y2_PHY2_POWD };
++	static const u32 coma_mode[] = { PCI_Y2_PHY1_COMA, PCI_Y2_PHY2_COMA };
+ 
+ 	sky2_write8(hw, B2_TST_CTRL1, TST_CFG_WRITE_ON);
+ 	reg1 = sky2_pci_read32(hw, PCI_DEV_REG1);
++
+ 	if (onoff)
+ 		/* Turn off phy power saving */
+ 		reg1 &= ~phy_power[port];
+ 	else
+ 		reg1 |= phy_power[port];
+ 
++	if (onoff && hw->chip_id == CHIP_ID_YUKON_XL && hw->chip_rev > 1)
++		reg1 |= coma_mode[port];
++
++
+ 	sky2_pci_write32(hw, PCI_DEV_REG1, reg1);
+ 	sky2_pci_read32(hw, PCI_DEV_REG1);
+ 	sky2_write8(hw, B2_TST_CTRL1, TST_CFG_WRITE_OFF);
+@@ -2246,20 +2247,26 @@ static int sky2_status_intr(struct sky2_hw *hw, int to_do)
+ 	while (hw->st_idx != hwidx) {
+ 		struct sky2_port *sky2;
+ 		struct sky2_status_le *le  = hw->st_le + hw->st_idx;
+-		unsigned port = le->css & CSS_LINK_BIT;
++		unsigned port;
+ 		struct net_device *dev;
+ 		struct sk_buff *skb;
+ 		u32 status;
+ 		u16 length;
++		u8 opcode = le->opcode;
++
++		if (!(opcode & HW_OWNER))
++			break;
+ 
+ 		hw->st_idx = RING_NEXT(hw->st_idx, STATUS_RING_SIZE);
+ 
++		port = le->css & CSS_LINK_BIT;
+ 		dev = hw->dev[port];
+ 		sky2 = netdev_priv(dev);
+ 		length = le16_to_cpu(le->length);
+ 		status = le32_to_cpu(le->status);
+ 
+-		switch (le->opcode & ~HW_OWNER) {
++		le->opcode = 0;
++		switch (opcode & ~HW_OWNER) {
+ 		case OP_RXSTAT:
+ 			++rx[port];
+ 			skb = sky2_receive(dev, length, status);
+@@ -2352,7 +2359,7 @@ static int sky2_status_intr(struct sky2_hw *hw, int to_do)
+ 		default:
+ 			if (net_ratelimit())
+ 				printk(KERN_WARNING PFX
+-				       "unknown status opcode 0x%x\n", le->opcode);
++				       "unknown status opcode 0x%x\n", opcode);
+ 		}
+ 	}
+ 
+@@ -3564,20 +3571,64 @@ static void sky2_get_regs(struct net_device *dev, struct ethtool_regs *regs,
+ {
+ 	const struct sky2_port *sky2 = netdev_priv(dev);
+ 	const void __iomem *io = sky2->hw->regs;
++	unsigned int b;
+ 
+ 	regs->version = 1;
+-	memset(p, 0, regs->len);
+ 
+-	memcpy_fromio(p, io, B3_RAM_ADDR);
+-
+-	/* skip diagnostic ram region */
+-	memcpy_fromio(p + B3_RI_WTO_R1, io + B3_RI_WTO_R1, 0x2000 - B3_RI_WTO_R1);
++	for (b = 0; b < 128; b++) {
++		/* This complicated switch statement is to make sure and
++		 * only access regions that are unreserved.
++		 * Some blocks are only valid on dual port cards.
++		 * and block 3 has some special diagnostic registers that
++		 * are poison.
++		 */
++		switch (b) {
++		case 3:
++			/* skip diagnostic ram region */
++			memcpy_fromio(p + 0x10, io + 0x10, 128 - 0x10);
++			break;
+ 
+-	/* copy GMAC registers */
+-	memcpy_fromio(p + BASE_GMAC_1, io + BASE_GMAC_1, 0x1000);
+-	if (sky2->hw->ports > 1)
+-		memcpy_fromio(p + BASE_GMAC_2, io + BASE_GMAC_2, 0x1000);
++		/* dual port cards only */
++		case 5:		/* Tx Arbiter 2 */
++		case 9: 	/* RX2 */
++		case 14 ... 15:	/* TX2 */
++		case 17: case 19: /* Ram Buffer 2 */
++		case 22 ... 23: /* Tx Ram Buffer 2 */
++		case 25: 	/* Rx MAC Fifo 1 */
++		case 27: 	/* Tx MAC Fifo 2 */
++		case 31:	/* GPHY 2 */
++		case 40 ... 47: /* Pattern Ram 2 */
++		case 52: case 54: /* TCP Segmentation 2 */
++		case 112 ... 116: /* GMAC 2 */
++			if (sky2->hw->ports == 1)
++				goto reserved;
++			/* fall through */
++		case 0:		/* Control */
++		case 2:		/* Mac address */
++		case 4:		/* Tx Arbiter 1 */
++		case 7:		/* PCI express reg */
++		case 8:		/* RX1 */
++		case 12 ... 13: /* TX1 */
++		case 16: case 18:/* Rx Ram Buffer 1 */
++		case 20 ... 21: /* Tx Ram Buffer 1 */
++		case 24: 	/* Rx MAC Fifo 1 */
++		case 26: 	/* Tx MAC Fifo 1 */
++		case 28 ... 29: /* Descriptor and status unit */
++		case 30:	/* GPHY 1*/
++		case 32 ... 39: /* Pattern Ram 1 */
++		case 48: case 50: /* TCP Segmentation 1 */
++		case 56 ... 60:	/* PCI space */
++		case 80 ... 84:	/* GMAC 1 */
++			memcpy_fromio(p, io, 128);
++			break;
++		default:
++reserved:
++			memset(p, 0, 128);
++		}
+ 
++		p += 128;
++		io += 128;
++	}
+ }
+ 
+ /* In order to do Jumbo packets on these chips, need to turn off the
+diff --git a/drivers/net/tg3.c b/drivers/net/tg3.c
+index 9034a05..f80721e 100644
+--- a/drivers/net/tg3.c
++++ b/drivers/net/tg3.c
+@@ -64,8 +64,8 @@
+ 
+ #define DRV_MODULE_NAME		"tg3"
+ #define PFX DRV_MODULE_NAME	": "
+-#define DRV_MODULE_VERSION	"3.81"
+-#define DRV_MODULE_RELDATE	"September 5, 2007"
++#define DRV_MODULE_VERSION	"3.81.1"
++#define DRV_MODULE_RELDATE	"October 18, 2007"
+ 
+ #define TG3_DEF_MAC_MODE	0
+ #define TG3_DEF_RX_MODE		0
+@@ -4874,6 +4874,12 @@ static void tg3_restore_pci_state(struct tg3 *tp)
+ 
+ 	pci_write_config_dword(tp->pdev, TG3PCI_COMMAND, tp->pci_cmd);
+ 
++	if (!(tp->tg3_flags2 & TG3_FLG2_PCI_EXPRESS)) {
++		pci_write_config_byte(tp->pdev, PCI_CACHE_LINE_SIZE,
++				      tp->pci_cacheline_sz);
++		pci_write_config_byte(tp->pdev, PCI_LATENCY_TIMER,
++				      tp->pci_lat_timer);
++	}
+ 	/* Make sure PCI-X relaxed ordering bit is clear. */
+ 	pci_read_config_dword(tp->pdev, TG3PCI_X_CAPS, &val);
+ 	val &= ~PCIX_CAPS_RELAXED_ORDERING;
+diff --git a/drivers/net/wireless/ipw2100.c b/drivers/net/wireless/ipw2100.c
+index 8990585..e690609 100644
+--- a/drivers/net/wireless/ipw2100.c
++++ b/drivers/net/wireless/ipw2100.c
+@@ -2102,12 +2102,46 @@ static void isr_indicate_rf_kill(struct ipw2100_priv *priv, u32 status)
+ 	queue_delayed_work(priv->workqueue, &priv->rf_kill, round_jiffies(HZ));
+ }
+ 
++static void send_scan_event(void *data)
++{
++	struct ipw2100_priv *priv = data;
++	union iwreq_data wrqu;
++
++	wrqu.data.length = 0;
++	wrqu.data.flags = 0;
++	wireless_send_event(priv->net_dev, SIOCGIWSCAN, &wrqu, NULL);
++}
++
++static void ipw2100_scan_event_later(struct work_struct *work)
++{
++	send_scan_event(container_of(work, struct ipw2100_priv,
++					scan_event_later.work));
++}
++
++static void ipw2100_scan_event_now(struct work_struct *work)
++{
++	send_scan_event(container_of(work, struct ipw2100_priv,
++					scan_event_now));
++}
++
+ static void isr_scan_complete(struct ipw2100_priv *priv, u32 status)
+ {
+ 	IPW_DEBUG_SCAN("scan complete\n");
+ 	/* Age the scan results... */
+ 	priv->ieee->scans++;
+ 	priv->status &= ~STATUS_SCANNING;
++
++	/* Only userspace-requested scan completion events go out immediately */
++	if (!priv->user_requested_scan) {
++		if (!delayed_work_pending(&priv->scan_event_later))
++			queue_delayed_work(priv->workqueue,
++					&priv->scan_event_later,
++					round_jiffies(msecs_to_jiffies(4000)));
++	} else {
++		priv->user_requested_scan = 0;
++		cancel_delayed_work(&priv->scan_event_later);
++		queue_work(priv->workqueue, &priv->scan_event_now);
++	}
+ }
+ 
+ #ifdef CONFIG_IPW2100_DEBUG
+@@ -4376,6 +4410,7 @@ static void ipw2100_kill_workqueue(struct ipw2100_priv *priv)
+ 		cancel_delayed_work(&priv->wx_event_work);
+ 		cancel_delayed_work(&priv->hang_check);
+ 		cancel_delayed_work(&priv->rf_kill);
++		cancel_delayed_work(&priv->scan_event_later);
+ 		destroy_workqueue(priv->workqueue);
+ 		priv->workqueue = NULL;
+ 	}
+@@ -6118,6 +6153,8 @@ static struct net_device *ipw2100_alloc_device(struct pci_dev *pci_dev,
+ 	INIT_DELAYED_WORK(&priv->wx_event_work, ipw2100_wx_event_work);
+ 	INIT_DELAYED_WORK(&priv->hang_check, ipw2100_hang_check);
+ 	INIT_DELAYED_WORK(&priv->rf_kill, ipw2100_rf_kill);
++	INIT_WORK(&priv->scan_event_now, ipw2100_scan_event_now);
++	INIT_DELAYED_WORK(&priv->scan_event_later, ipw2100_scan_event_later);
+ 
+ 	tasklet_init(&priv->irq_tasklet, (void (*)(unsigned long))
+ 		     ipw2100_irq_tasklet, (unsigned long)priv);
+@@ -7427,6 +7464,8 @@ static int ipw2100_wx_set_scan(struct net_device *dev,
+ 	}
+ 
+ 	IPW_DEBUG_WX("Initiating scan...\n");
++
++	priv->user_requested_scan = 1;
+ 	if (ipw2100_set_scan_options(priv) || ipw2100_start_scan(priv)) {
+ 		IPW_DEBUG_WX("Start scan failed.\n");
+ 
+diff --git a/drivers/net/wireless/ipw2100.h b/drivers/net/wireless/ipw2100.h
+index de7d384..1ee3348 100644
+--- a/drivers/net/wireless/ipw2100.h
++++ b/drivers/net/wireless/ipw2100.h
+@@ -588,6 +588,10 @@ struct ipw2100_priv {
+ 	struct delayed_work wx_event_work;
+ 	struct delayed_work hang_check;
+ 	struct delayed_work rf_kill;
++	struct work_struct scan_event_now;
++	struct delayed_work scan_event_later;
++
++	int user_requested_scan;
+ 
+ 	u32 interrupts;
+ 	int tx_interrupts;
+diff --git a/drivers/net/wireless/libertas/11d.c b/drivers/net/wireless/libertas/11d.c
+index 4cf0ff7..0560270 100644
+--- a/drivers/net/wireless/libertas/11d.c
++++ b/drivers/net/wireless/libertas/11d.c
+@@ -562,7 +562,7 @@ int libertas_cmd_802_11d_domain_info(wlan_private * priv,
+ 		       nr_subband * sizeof(struct ieeetypes_subbandset));
+ 
+ 		cmd->size = cpu_to_le16(sizeof(pdomaininfo->action) +
+-					     domain->header.len +
++					     le16_to_cpu(domain->header.len) +
+ 					     sizeof(struct mrvlietypesheader) +
+ 					     S_DS_GEN);
+ 	} else {
+diff --git a/drivers/net/wireless/libertas/cmd.c b/drivers/net/wireless/libertas/cmd.c
+index 4a8f5dc..86fff8d 100644
+--- a/drivers/net/wireless/libertas/cmd.c
++++ b/drivers/net/wireless/libertas/cmd.c
+@@ -185,14 +185,12 @@ static int wlan_cmd_802_11_set_wep(wlan_private * priv,
+ 
+ 			switch (pkey->len) {
+ 			case KEY_LEN_WEP_40:
+-				wep->keytype[i] =
+-					cpu_to_le16(cmd_type_wep_40_bit);
++				wep->keytype[i] = cmd_type_wep_40_bit;
+ 				memmove(&wep->keymaterial[i], pkey->key,
+ 				        pkey->len);
+ 				break;
+ 			case KEY_LEN_WEP_104:
+-				wep->keytype[i] =
+-					cpu_to_le16(cmd_type_wep_104_bit);
++				wep->keytype[i] = cmd_type_wep_104_bit;
+ 				memmove(&wep->keymaterial[i], pkey->key,
+ 				        pkey->len);
+ 				break;
+diff --git a/drivers/net/wireless/libertas/wext.c b/drivers/net/wireless/libertas/wext.c
+index 2fcc3bf..873c405 100644
+--- a/drivers/net/wireless/libertas/wext.c
++++ b/drivers/net/wireless/libertas/wext.c
+@@ -973,7 +973,7 @@ static struct iw_statistics *wlan_get_wireless_stats(struct net_device *dev)
+ 	/* Quality by TX errors */
+ 	priv->wstats.discard.retries = priv->stats.tx_errors;
+ 
+-	tx_retries = le16_to_cpu(adapter->logmsg.retry);
++	tx_retries = le32_to_cpu(adapter->logmsg.retry);
+ 
+ 	if (tx_retries > 75)
+ 		tx_qual = (90 - tx_retries) * POOR / 15;
+@@ -989,10 +989,10 @@ static struct iw_statistics *wlan_get_wireless_stats(struct net_device *dev)
+ 		    (PERFECT - VERY_GOOD) / 50 + VERY_GOOD;
+ 	quality = min(quality, tx_qual);
+ 
+-	priv->wstats.discard.code = le16_to_cpu(adapter->logmsg.wepundecryptable);
+-	priv->wstats.discard.fragment = le16_to_cpu(adapter->logmsg.rxfrag);
++	priv->wstats.discard.code = le32_to_cpu(adapter->logmsg.wepundecryptable);
++	priv->wstats.discard.fragment = le32_to_cpu(adapter->logmsg.rxfrag);
+ 	priv->wstats.discard.retries = tx_retries;
+-	priv->wstats.discard.misc = le16_to_cpu(adapter->logmsg.ackfailure);
++	priv->wstats.discard.misc = le32_to_cpu(adapter->logmsg.ackfailure);
+ 
+ 	/* Calculate quality */
+ 	priv->wstats.qual.qual = max(quality, (u32)100);
+diff --git a/drivers/net/wireless/rtl8187_dev.c b/drivers/net/wireless/rtl8187_dev.c
+index e61c6d5..66704b8 100644
+--- a/drivers/net/wireless/rtl8187_dev.c
++++ b/drivers/net/wireless/rtl8187_dev.c
+@@ -78,7 +78,8 @@ static int rtl8187_tx(struct ieee80211_hw *dev, struct sk_buff *skb,
+ 	struct rtl8187_tx_hdr *hdr;
+ 	struct rtl8187_tx_info *info;
+ 	struct urb *urb;
+-	u32 tmp;
++	__le16 rts_dur = 0;
++	u32 flags;
+ 
+ 	urb = usb_alloc_urb(0, GFP_ATOMIC);
+ 	if (!urb) {
+@@ -86,24 +87,24 @@ static int rtl8187_tx(struct ieee80211_hw *dev, struct sk_buff *skb,
+ 		return 0;
+ 	}
+ 
+-	hdr = (struct rtl8187_tx_hdr *)skb_push(skb, sizeof(*hdr));
+-	tmp = skb->len - sizeof(*hdr);
+-	tmp |= RTL8187_TX_FLAG_NO_ENCRYPT;
+-	tmp |= control->rts_cts_rate << 19;
+-	tmp |= control->tx_rate << 24;
+-	if (ieee80211_get_morefrag((struct ieee80211_hdr *)skb))
+-		tmp |= RTL8187_TX_FLAG_MORE_FRAG;
++	flags = skb->len;
++	flags |= RTL8187_TX_FLAG_NO_ENCRYPT;
++	flags |= control->rts_cts_rate << 19;
++	flags |= control->tx_rate << 24;
++	if (ieee80211_get_morefrag((struct ieee80211_hdr *)skb->data))
++		flags |= RTL8187_TX_FLAG_MORE_FRAG;
+ 	if (control->flags & IEEE80211_TXCTL_USE_RTS_CTS) {
+-		tmp |= RTL8187_TX_FLAG_RTS;
+-		hdr->rts_duration =
+-			ieee80211_rts_duration(dev, skb->len, control);
++		flags |= RTL8187_TX_FLAG_RTS;
++		rts_dur = ieee80211_rts_duration(dev, skb->len, control);
+ 	}
+ 	if (control->flags & IEEE80211_TXCTL_USE_CTS_PROTECT)
+-		tmp |= RTL8187_TX_FLAG_CTS;
+-	hdr->flags = cpu_to_le32(tmp);
++		flags |= RTL8187_TX_FLAG_CTS;
++
++	hdr = (struct rtl8187_tx_hdr *)skb_push(skb, sizeof(*hdr));
++	hdr->flags = cpu_to_le32(flags);
+ 	hdr->len = 0;
+-	tmp = control->retry_limit << 8;
+-	hdr->retry = cpu_to_le32(tmp);
++	hdr->rts_duration = rts_dur;
++	hdr->retry = cpu_to_le32(control->retry_limit << 8);
+ 
+ 	info = (struct rtl8187_tx_info *)skb->cb;
+ 	info->control = kmemdup(control, sizeof(*control), GFP_ATOMIC);
+diff --git a/drivers/net/wireless/zd1201.c b/drivers/net/wireless/zd1201.c
+index 935b144..d5c0c66 100644
+--- a/drivers/net/wireless/zd1201.c
++++ b/drivers/net/wireless/zd1201.c
+@@ -327,8 +327,8 @@ static void zd1201_usbrx(struct urb *urb)
+ 			memcpy(skb_put(skb, 6), &data[datalen-8], 6);
+ 			memcpy(skb_put(skb, 2), &data[datalen-24], 2);
+ 			memcpy(skb_put(skb, len), data, len);
+-			skb->dev->last_rx = jiffies;
+ 			skb->protocol = eth_type_trans(skb, zd->dev);
++			skb->dev->last_rx = jiffies;
+ 			zd->stats.rx_packets++;
+ 			zd->stats.rx_bytes += skb->len;
+ 			netif_rx(skb);
+@@ -384,8 +384,8 @@ static void zd1201_usbrx(struct urb *urb)
+ 			memcpy(skb_put(skb, 2), &data[6], 2);
+ 			memcpy(skb_put(skb, len), data+8, len);
+ 		}
+-		skb->dev->last_rx = jiffies;
+ 		skb->protocol = eth_type_trans(skb, zd->dev);
++		skb->dev->last_rx = jiffies;
+ 		zd->stats.rx_packets++;
+ 		zd->stats.rx_bytes += skb->len;
+ 		netif_rx(skb);
+diff --git a/drivers/net/wireless/zd1211rw/zd_usb.c b/drivers/net/wireless/zd1211rw/zd_usb.c
+index a9c339e..5326301 100644
+--- a/drivers/net/wireless/zd1211rw/zd_usb.c
++++ b/drivers/net/wireless/zd1211rw/zd_usb.c
+@@ -1041,14 +1041,17 @@ error:
+ static void disconnect(struct usb_interface *intf)
+ {
+ 	struct net_device *netdev = zd_intf_to_netdev(intf);
+-	struct zd_mac *mac = zd_netdev_mac(netdev);
+-	struct zd_usb *usb = &mac->chip.usb;
++	struct zd_mac *mac;
++	struct zd_usb *usb;
+ 
+ 	/* Either something really bad happened, or we're just dealing with
+ 	 * a DEVICE_INSTALLER. */
+ 	if (netdev == NULL)
+ 		return;
+ 
++	mac = zd_netdev_mac(netdev);
++	usb = &mac->chip.usb;
++
+ 	dev_dbg_f(zd_usb_dev(usb), "\n");
+ 
+ 	zd_netdev_disconnect(netdev);
+diff --git a/include/linux/pci_ids.h b/include/linux/pci_ids.h
+index 55f307f..85d434b 100644
+--- a/include/linux/pci_ids.h
++++ b/include/linux/pci_ids.h
+@@ -1233,6 +1233,10 @@
+ #define PCI_DEVICE_ID_NVIDIA_NFORCE_MCP67_IDE       0x0560
+ #define PCI_DEVICE_ID_NVIDIA_NFORCE_MCP73_IDE       0x056C
+ #define PCI_DEVICE_ID_NVIDIA_NFORCE_MCP77_IDE       0x0759
++#define PCI_DEVICE_ID_NVIDIA_NVENET_32              0x0760
++#define PCI_DEVICE_ID_NVIDIA_NVENET_33              0x0761
++#define PCI_DEVICE_ID_NVIDIA_NVENET_34              0x0762
++#define PCI_DEVICE_ID_NVIDIA_NVENET_35              0x0763
+ 
+ #define PCI_VENDOR_ID_IMS		0x10e0
+ #define PCI_DEVICE_ID_IMS_TT128		0x9128

Added: dists/sid/linux-2.6/debian/patches/bugfix/all/stable/2.6.23.6.patch
==============================================================================
--- (empty file)
+++ dists/sid/linux-2.6/debian/patches/bugfix/all/stable/2.6.23.6.patch	Mon Nov 26 20:06:56 2007
@@ -0,0 +1,1597 @@
+diff --git a/Makefile b/Makefile
+index e11814e..798ffe9 100644
+diff --git a/drivers/acpi/sleep/main.c b/drivers/acpi/sleep/main.c
+index 2cbb9aa..37b651e 100644
+--- a/drivers/acpi/sleep/main.c
++++ b/drivers/acpi/sleep/main.c
+@@ -170,8 +170,8 @@ static int acpi_pm_finish(suspend_state_t pm_state)
+ {
+ 	u32 acpi_state = acpi_target_sleep_state;
+ 
+-	acpi_leave_sleep_state(acpi_state);
+ 	acpi_disable_wakeup_device(acpi_state);
++	acpi_leave_sleep_state(acpi_state);
+ 
+ 	/* reset firmware waking vector */
+ 	acpi_set_firmware_waking_vector((acpi_physical_address) 0);
+@@ -256,8 +256,8 @@ static int acpi_hibernation_enter(void)
+ 
+ static void acpi_hibernation_finish(void)
+ {
+-	acpi_leave_sleep_state(ACPI_STATE_S4);
+ 	acpi_disable_wakeup_device(ACPI_STATE_S4);
++	acpi_leave_sleep_state(ACPI_STATE_S4);
+ 
+ 	/* reset firmware waking vector */
+ 	acpi_set_firmware_waking_vector((acpi_physical_address) 0);
+@@ -389,6 +389,7 @@ static void acpi_power_off(void)
+ 	/* acpi_sleep_prepare(ACPI_STATE_S5) should have already been called */
+ 	printk("%s called\n", __FUNCTION__);
+ 	local_irq_disable();
++	acpi_enable_wakeup_device(ACPI_STATE_S5);
+ 	acpi_enter_sleep_state(ACPI_STATE_S5);
+ }
+ 
+diff --git a/drivers/ata/ahci.c b/drivers/ata/ahci.c
+index c168203..d684208 100644
+--- a/drivers/ata/ahci.c
++++ b/drivers/ata/ahci.c
+@@ -41,6 +41,7 @@
+ #include <linux/interrupt.h>
+ #include <linux/dma-mapping.h>
+ #include <linux/device.h>
++#include <linux/dmi.h>
+ #include <scsi/scsi_host.h>
+ #include <scsi/scsi_cmnd.h>
+ #include <linux/libata.h>
+@@ -231,6 +232,7 @@ static void ahci_freeze(struct ata_port *ap);
+ static void ahci_thaw(struct ata_port *ap);
+ static void ahci_error_handler(struct ata_port *ap);
+ static void ahci_vt8251_error_handler(struct ata_port *ap);
++static void ahci_p5wdh_error_handler(struct ata_port *ap);
+ static void ahci_post_internal_cmd(struct ata_queued_cmd *qc);
+ static int ahci_port_resume(struct ata_port *ap);
+ static unsigned int ahci_fill_sg(struct ata_queued_cmd *qc, void *cmd_tbl);
+@@ -329,6 +331,40 @@ static const struct ata_port_operations ahci_vt8251_ops = {
+ 	.port_stop		= ahci_port_stop,
+ };
+ 
++static const struct ata_port_operations ahci_p5wdh_ops = {
++	.port_disable		= ata_port_disable,
++
++	.check_status		= ahci_check_status,
++	.check_altstatus	= ahci_check_status,
++	.dev_select		= ata_noop_dev_select,
++
++	.tf_read		= ahci_tf_read,
++
++	.qc_prep		= ahci_qc_prep,
++	.qc_issue		= ahci_qc_issue,
++
++	.irq_clear		= ahci_irq_clear,
++	.irq_on			= ata_dummy_irq_on,
++	.irq_ack		= ata_dummy_irq_ack,
++
++	.scr_read		= ahci_scr_read,
++	.scr_write		= ahci_scr_write,
++
++	.freeze			= ahci_freeze,
++	.thaw			= ahci_thaw,
++
++	.error_handler		= ahci_p5wdh_error_handler,
++	.post_internal_cmd	= ahci_post_internal_cmd,
++
++#ifdef CONFIG_PM
++	.port_suspend		= ahci_port_suspend,
++	.port_resume		= ahci_port_resume,
++#endif
++
++	.port_start		= ahci_port_start,
++	.port_stop		= ahci_port_stop,
++};
++
+ static const struct ata_port_info ahci_port_info[] = {
+ 	/* board_ahci */
+ 	{
+@@ -1176,6 +1212,52 @@ static int ahci_vt8251_hardreset(struct ata_port *ap, unsigned int *class,
+ 	return rc ?: -EAGAIN;
+ }
+ 
++static int ahci_p5wdh_hardreset(struct ata_port *ap, unsigned int *class,
++				unsigned long deadline)
++{
++	struct ahci_port_priv *pp = ap->private_data;
++	u8 *d2h_fis = pp->rx_fis + RX_FIS_D2H_REG;
++	struct ata_taskfile tf;
++	int rc;
++
++	ahci_stop_engine(ap);
++
++	/* clear D2H reception area to properly wait for D2H FIS */
++	ata_tf_init(ap->device, &tf);
++	tf.command = 0x80;
++	ata_tf_to_fis(&tf, 0, 0, d2h_fis);
++
++	rc = sata_port_hardreset(ap, sata_ehc_deb_timing(&ap->eh_context),
++				 deadline);
++
++	ahci_start_engine(ap);
++
++	if (rc || ata_port_offline(ap))
++		return rc;
++
++	/* spec mandates ">= 2ms" before checking status */
++	msleep(150);
++
++	/* The pseudo configuration device on SIMG4726 attached to
++	 * ASUS P5W-DH Deluxe doesn't send signature FIS after
++	 * hardreset if no device is attached to the first downstream
++	 * port && the pseudo device locks up on SRST w/ PMP==0.  To
++	 * work around this, wait for !BSY only briefly.  If BSY isn't
++	 * cleared, perform CLO and proceed to IDENTIFY (achieved by
++	 * ATA_LFLAG_NO_SRST and ATA_LFLAG_ASSUME_ATA).
++	 *
++	 * Wait for two seconds.  Devices attached to downstream port
++	 * which can't process the following IDENTIFY after this will
++	 * have to be reset again.  For most cases, this should
++	 * suffice while making probing snappish enough.
++	 */
++	rc = ata_wait_ready(ap, jiffies + 2 * HZ);
++	if (rc)
++		ahci_kick_engine(ap, 0);
++
++	return 0;
++}
++
+ static void ahci_postreset(struct ata_port *ap, unsigned int *class)
+ {
+ 	void __iomem *port_mmio = ahci_port_base(ap);
+@@ -1556,6 +1638,19 @@ static void ahci_vt8251_error_handler(struct ata_port *ap)
+ 		  ahci_postreset);
+ }
+ 
++static void ahci_p5wdh_error_handler(struct ata_port *ap)
++{
++	if (!(ap->pflags & ATA_PFLAG_FROZEN)) {
++		/* restart engine */
++		ahci_stop_engine(ap);
++		ahci_start_engine(ap);
++	}
++
++	/* perform recovery */
++	ata_do_eh(ap, ata_std_prereset, ahci_softreset, ahci_p5wdh_hardreset,
++		  ahci_postreset);
++}
++
+ static void ahci_post_internal_cmd(struct ata_queued_cmd *qc)
+ {
+ 	struct ata_port *ap = qc->ap;
+@@ -1802,6 +1897,51 @@ static void ahci_print_info(struct ata_host *host)
+ 		);
+ }
+ 
++/* On ASUS P5W DH Deluxe, the second port of PCI device 00:1f.2 is
++ * hardwired to on-board SIMG 4726.  The chipset is ICH8 and doesn't
++ * support PMP and the 4726 either directly exports the device
++ * attached to the first downstream port or acts as a hardware storage
++ * controller and emulate a single ATA device (can be RAID 0/1 or some
++ * other configuration).
++ *
++ * When there's no device attached to the first downstream port of the
++ * 4726, "Config Disk" appears, which is a pseudo ATA device to
++ * configure the 4726.  However, ATA emulation of the device is very
++ * lame.  It doesn't send signature D2H Reg FIS after the initial
++ * hardreset, pukes on SRST w/ PMP==0 and has bunch of other issues.
++ *
++ * The following function works around the problem by always using
++ * hardreset on the port and not depending on receiving signature FIS
++ * afterward.  If signature FIS isn't received soon, ATA class is
++ * assumed without follow-up softreset.
++ */
++static void ahci_p5wdh_workaround(struct ata_host *host)
++{
++	static struct dmi_system_id sysids[] = {
++		{
++			.ident = "P5W DH Deluxe",
++			.matches = {
++				DMI_MATCH(DMI_SYS_VENDOR,
++					  "ASUSTEK COMPUTER INC"),
++				DMI_MATCH(DMI_PRODUCT_NAME, "P5W DH Deluxe"),
++			},
++		},
++		{ }
++	};
++	struct pci_dev *pdev = to_pci_dev(host->dev);
++
++	if (pdev->bus->number == 0 && pdev->devfn == PCI_DEVFN(0x1f, 2) &&
++	    dmi_check_system(sysids)) {
++		struct ata_port *ap = host->ports[1];
++
++		dev_printk(KERN_INFO, &pdev->dev, "enabling ASUS P5W DH "
++			   "Deluxe on-board SIMG4726 workaround\n");
++
++		ap->ops = &ahci_p5wdh_ops;
++		ap->flags |= ATA_FLAG_NO_SRST | ATA_FLAG_ASSUME_ATA;
++	}
++}
++
+ static int ahci_init_one(struct pci_dev *pdev, const struct pci_device_id *ent)
+ {
+ 	static int printed_version;
+@@ -1863,6 +2003,9 @@ static int ahci_init_one(struct pci_dev *pdev, const struct pci_device_id *ent)
+ 			ap->ops = &ata_dummy_port_ops;
+ 	}
+ 
++	/* apply workaround for ASUS P5W DH Deluxe mainboard */
++	ahci_p5wdh_workaround(host);
++
+ 	/* initialize adapter */
+ 	rc = ahci_configure_dma_masks(pdev, hpriv->cap & HOST_CAP_64);
+ 	if (rc)
+diff --git a/drivers/ata/libata-core.c b/drivers/ata/libata-core.c
+index 772be09..78b670d 100644
+--- a/drivers/ata/libata-core.c
++++ b/drivers/ata/libata-core.c
+@@ -3793,11 +3793,18 @@ static const struct ata_blacklist_entry ata_device_blacklist [] = {
+ 	/* Drives which do spurious command completion */
+ 	{ "HTS541680J9SA00",	"SB2IC7EP",	ATA_HORKAGE_NONCQ, },
+ 	{ "HTS541612J9SA00",	"SBDIC7JP",	ATA_HORKAGE_NONCQ, },
++	{ "HDT722516DLA380",	"V43OA96A",	ATA_HORKAGE_NONCQ, },
+ 	{ "Hitachi HTS541616J9SA00", "SB4OC70P", ATA_HORKAGE_NONCQ, },
++	{ "Hitachi HTS542525K9SA00", "BBFOC31P", ATA_HORKAGE_NONCQ, },
+ 	{ "WDC WD740ADFD-00NLR1", NULL,		ATA_HORKAGE_NONCQ, },
++	{ "WDC WD3200AAJS-00RYA0", "12.01B01",	ATA_HORKAGE_NONCQ, },
+ 	{ "FUJITSU MHV2080BH",	"00840028",	ATA_HORKAGE_NONCQ, },
++	{ "ST9120822AS",	"3.CLF",	ATA_HORKAGE_NONCQ, },
+ 	{ "ST9160821AS",	"3.CLF",	ATA_HORKAGE_NONCQ, },
+-	{ "ST3160812AS",	"3.AD",		ATA_HORKAGE_NONCQ, },
++	{ "ST9160821AS",	"3.ALD",	ATA_HORKAGE_NONCQ, },
++	{ "ST9160821AS",	"3.CCD",	ATA_HORKAGE_NONCQ, },
++	{ "ST3160812AS",	"3.ADJ",	ATA_HORKAGE_NONCQ, },
++	{ "ST980813AS",		"3.ADB",	ATA_HORKAGE_NONCQ, },
+ 	{ "SAMSUNG HD401LJ",	"ZZ100-15",	ATA_HORKAGE_NONCQ, },
+ 
+ 	/* devices which puke on READ_NATIVE_MAX */
+diff --git a/drivers/ata/libata-eh.c b/drivers/ata/libata-eh.c
+index ac6ceed..6ebdbd8 100644
+--- a/drivers/ata/libata-eh.c
++++ b/drivers/ata/libata-eh.c
+@@ -1759,9 +1759,11 @@ static int ata_do_reset(struct ata_port *ap, ata_reset_fn_t reset,
+ 	return 0;
+ }
+ 
+-static int ata_eh_followup_srst_needed(int rc, int classify,
+-				       const unsigned int *classes)
++static int ata_eh_followup_srst_needed(struct ata_port *ap, int rc,
++				int classify, const unsigned int *classes)
+ {
++	if (ap->flags & ATA_FLAG_NO_SRST)
++		return 0;
+ 	if (rc == -EAGAIN)
+ 		return 1;
+ 	if (rc != 0)
+@@ -1792,7 +1794,8 @@ static int ata_eh_reset(struct ata_port *ap, int classify,
+ 	 */
+ 	action = ehc->i.action;
+ 	ehc->i.action &= ~ATA_EH_RESET_MASK;
+-	if (softreset && (!hardreset || (!sata_set_spd_needed(ap) &&
++	if (softreset && (!hardreset || (!(ap->flags & ATA_FLAG_NO_SRST) &&
++					 !sata_set_spd_needed(ap) &&
+ 					 !(action & ATA_EH_HARDRESET))))
+ 		ehc->i.action |= ATA_EH_SOFTRESET;
+ 	else
+@@ -1855,7 +1858,7 @@ static int ata_eh_reset(struct ata_port *ap, int classify,
+ 	rc = ata_do_reset(ap, reset, classes, deadline);
+ 
+ 	if (reset == hardreset &&
+-	    ata_eh_followup_srst_needed(rc, classify, classes)) {
++	    ata_eh_followup_srst_needed(ap, rc, classify, classes)) {
+ 		/* okay, let's do follow-up softreset */
+ 		reset = softreset;
+ 
+@@ -1870,8 +1873,8 @@ static int ata_eh_reset(struct ata_port *ap, int classify,
+ 		ata_eh_about_to_do(ap, NULL, ATA_EH_RESET_MASK);
+ 		rc = ata_do_reset(ap, reset, classes, deadline);
+ 
+-		if (rc == 0 && classify &&
+-		    classes[0] == ATA_DEV_UNKNOWN) {
++		if (rc == 0 && classify && classes[0] == ATA_DEV_UNKNOWN &&
++		    !(ap->flags & ATA_FLAG_ASSUME_ATA)) {
+ 			ata_port_printk(ap, KERN_ERR,
+ 					"classification failed\n");
+ 			rc = -EINVAL;
+@@ -1879,6 +1882,10 @@ static int ata_eh_reset(struct ata_port *ap, int classify,
+ 		}
+ 	}
+ 
++	/* if we skipped follow-up srst, clear rc */
++	if (rc == -EAGAIN)
++		rc = 0;
++
+ 	if (rc && try < ARRAY_SIZE(ata_eh_reset_timeouts)) {
+ 		unsigned long now = jiffies;
+ 
+@@ -1906,8 +1913,17 @@ static int ata_eh_reset(struct ata_port *ap, int classify,
+ 		/* After the reset, the device state is PIO 0 and the
+ 		 * controller state is undefined.  Record the mode.
+ 		 */
+-		for (i = 0; i < ATA_MAX_DEVICES; i++)
+-			ap->device[i].pio_mode = XFER_PIO_0;
++		for (i = 0; i < ata_port_max_devices(ap); i++) {
++			struct ata_device *dev = &ap->device[i];
++
++			dev->pio_mode = XFER_PIO_0;
++
++			if (ata_port_offline(ap))
++				continue;
++
++			if (ap->flags & ATA_FLAG_ASSUME_ATA)
++				classes[dev->devno] = ATA_DEV_ATA;
++		}
+ 
+ 		/* record current link speed */
+ 		if (sata_scr_read(ap, SCR_STATUS, &sstatus) == 0)
+diff --git a/drivers/char/drm/i915_irq.c b/drivers/char/drm/i915_irq.c
+index bb8e9e9..94d638e 100644
+--- a/drivers/char/drm/i915_irq.c
++++ b/drivers/char/drm/i915_irq.c
+@@ -553,7 +553,7 @@ int i915_vblank_swap(DRM_IOCTL_ARGS)
+ 		return DRM_ERR(EBUSY);
+ 	}
+ 
+-	vbl_swap = drm_calloc(1, sizeof(vbl_swap), DRM_MEM_DRIVER);
++	vbl_swap = drm_calloc(1, sizeof(*vbl_swap), DRM_MEM_DRIVER);
+ 
+ 	if (!vbl_swap) {
+ 		DRM_ERROR("Failed to allocate memory to queue swap\n");
+diff --git a/drivers/char/drm/radeon_cp.c b/drivers/char/drm/radeon_cp.c
+index af5790f..2e9fdb9 100644
+--- a/drivers/char/drm/radeon_cp.c
++++ b/drivers/char/drm/radeon_cp.c
+@@ -1679,7 +1679,7 @@ static int radeon_do_init_cp(struct drm_device * dev, drm_radeon_init_t * init)
+ 			dev_priv->gart_info.bus_addr =
+ 			    dev_priv->pcigart_offset + dev_priv->fb_location;
+ 			dev_priv->gart_info.mapping.offset =
+-			    dev_priv->gart_info.bus_addr;
++			    dev_priv->pcigart_offset + dev_priv->fb_aper_offset;
+ 			dev_priv->gart_info.mapping.size =
+ 			    dev_priv->gart_info.table_size;
+ 
+@@ -2291,7 +2291,8 @@ int radeon_driver_firstopen(struct drm_device *dev)
+ 	if (ret != 0)
+ 		return ret;
+ 
+-	ret = drm_addmap(dev, drm_get_resource_start(dev, 0),
++	dev_priv->fb_aper_offset = drm_get_resource_start(dev, 0);
++	ret = drm_addmap(dev, dev_priv->fb_aper_offset,
+ 			 drm_get_resource_len(dev, 0), _DRM_FRAME_BUFFER,
+ 			 _DRM_WRITE_COMBINING, &map);
+ 	if (ret != 0)
+diff --git a/drivers/char/drm/radeon_drv.h b/drivers/char/drm/radeon_drv.h
+index 3b3d935..41e91ea 100644
+--- a/drivers/char/drm/radeon_drv.h
++++ b/drivers/char/drm/radeon_drv.h
+@@ -293,6 +293,7 @@ typedef struct drm_radeon_private {
+ 
+ 	/* starting from here on, data is preserved accross an open */
+ 	uint32_t flags;		/* see radeon_chip_flags */
++	unsigned long fb_aper_offset;
+ } drm_radeon_private_t;
+ 
+ typedef struct drm_radeon_buf_priv {
+diff --git a/drivers/char/moxa.c b/drivers/char/moxa.c
+index ed76f0a..5000b3b 100644
+--- a/drivers/char/moxa.c
++++ b/drivers/char/moxa.c
+@@ -1040,14 +1040,14 @@ static void check_xmit_empty(unsigned long data)
+ 	struct moxa_port *ch;
+ 
+ 	ch = (struct moxa_port *) data;
+-	del_timer_sync(&moxa_ports[ch->port].emptyTimer);
+ 	if (ch->tty && (ch->statusflags & EMPTYWAIT)) {
+ 		if (MoxaPortTxQueue(ch->port) == 0) {
+ 			ch->statusflags &= ~EMPTYWAIT;
+ 			tty_wakeup(ch->tty);
+ 			return;
+ 		}
+-		mod_timer(&moxa_ports[ch->port].emptyTimer, jiffies + HZ);
++		mod_timer(&moxa_ports[ch->port].emptyTimer,
++				round_jiffies(jiffies + HZ));
+ 	} else
+ 		ch->statusflags &= ~EMPTYWAIT;
+ }
+diff --git a/drivers/char/rocket.c b/drivers/char/rocket.c
+index 56cbba7..94bb3d0 100644
+--- a/drivers/char/rocket.c
++++ b/drivers/char/rocket.c
+@@ -699,8 +699,8 @@ static void init_r_port(int board, int aiop, int chan, struct pci_dev *pci_dev)
+ 	spin_lock_init(&info->slock);
+ 	mutex_init(&info->write_mtx);
+ 	rp_table[line] = info;
+-	if (pci_dev)
+-		tty_register_device(rocket_driver, line, &pci_dev->dev);
++	tty_register_device(rocket_driver, line, pci_dev ? &pci_dev->dev :
++			NULL);
+ }
+ 
+ /*
+@@ -2434,7 +2434,7 @@ static int __init rp_init(void)
+ 	rocket_driver->init_termios.c_ispeed = 9600;
+ 	rocket_driver->init_termios.c_ospeed = 9600;
+ #ifdef ROCKET_SOFT_FLOW
+-	rocket_driver->flags |= TTY_DRIVER_REAL_RAW | TTY_DRIVER_DYNAMIC_DEV;
++	rocket_driver->flags |= TTY_DRIVER_REAL_RAW;
+ #endif
+ 	tty_set_operations(rocket_driver, &rocket_ops);
+ 
+@@ -2491,10 +2491,14 @@ static void rp_cleanup_module(void)
+ 	if (retval)
+ 		printk(KERN_INFO "Error %d while trying to unregister "
+ 		       "rocketport driver\n", -retval);
+-	put_tty_driver(rocket_driver);
+ 
+ 	for (i = 0; i < MAX_RP_PORTS; i++)
+-		kfree(rp_table[i]);
++		if (rp_table[i]) {
++			tty_unregister_device(rocket_driver, i);
++			kfree(rp_table[i]);
++		}
++
++	put_tty_driver(rocket_driver);
+ 
+ 	for (i = 0; i < NUM_BOARDS; i++) {
+ 		if (rcktpt_io_addr[i] <= 0 || is_PCI[i])
+diff --git a/drivers/hwmon/lm87.c b/drivers/hwmon/lm87.c
+index 988ae1c..1128153 100644
+--- a/drivers/hwmon/lm87.c
++++ b/drivers/hwmon/lm87.c
+@@ -129,7 +129,7 @@ static u8 LM87_REG_TEMP_LOW[3] = { 0x3A, 0x38, 0x2C };
+ 				 (((val) < 0 ? (val)-500 : (val)+500) / 1000))
+ 
+ #define FAN_FROM_REG(reg,div)	((reg) == 255 || (reg) == 0 ? 0 : \
+-				 1350000 + (reg)*(div) / 2) / ((reg)*(div))
++				 (1350000 + (reg)*(div) / 2) / ((reg)*(div)))
+ #define FAN_TO_REG(val,div)	((val)*(div) * 255 <= 1350000 ? 255 : \
+ 				 (1350000 + (val)*(div) / 2) / ((val)*(div)))
+ 
+@@ -145,7 +145,7 @@ static u8 LM87_REG_TEMP_LOW[3] = { 0x3A, 0x38, 0x2C };
+ #define CHAN_NO_FAN(nr)		(1 << (nr))
+ #define CHAN_TEMP3		(1 << 2)
+ #define CHAN_VCC_5V		(1 << 3)
+-#define CHAN_NO_VID		(1 << 8)
++#define CHAN_NO_VID		(1 << 7)
+ 
+ /*
+  * Functions declaration
+diff --git a/drivers/hwmon/w83627hf.c b/drivers/hwmon/w83627hf.c
+index 7a4a15f..329b599 100644
+--- a/drivers/hwmon/w83627hf.c
++++ b/drivers/hwmon/w83627hf.c
+@@ -391,6 +391,7 @@ static int __devexit w83627hf_remove(struct platform_device *pdev);
+ 
+ static int w83627hf_read_value(struct w83627hf_data *data, u16 reg);
+ static int w83627hf_write_value(struct w83627hf_data *data, u16 reg, u16 value);
++static void w83627hf_update_fan_div(struct w83627hf_data *data);
+ static struct w83627hf_data *w83627hf_update_device(struct device *dev);
+ static void w83627hf_init_device(struct platform_device *pdev);
+ 
+@@ -1244,6 +1245,7 @@ static int __devinit w83627hf_probe(struct platform_device *pdev)
+ 	data->fan_min[0] = w83627hf_read_value(data, W83781D_REG_FAN_MIN(1));
+ 	data->fan_min[1] = w83627hf_read_value(data, W83781D_REG_FAN_MIN(2));
+ 	data->fan_min[2] = w83627hf_read_value(data, W83781D_REG_FAN_MIN(3));
++	w83627hf_update_fan_div(data);
+ 
+ 	/* Register common device attributes */
+ 	if ((err = sysfs_create_group(&dev->kobj, &w83627hf_group)))
+@@ -1333,6 +1335,24 @@ static int __devexit w83627hf_remove(struct platform_device *pdev)
+ }
+ 
+ 
++/* Registers 0x50-0x5f are banked */
++static inline void w83627hf_set_bank(struct w83627hf_data *data, u16 reg)
++{
++	if ((reg & 0x00f0) == 0x50) {
++		outb_p(W83781D_REG_BANK, data->addr + W83781D_ADDR_REG_OFFSET);
++		outb_p(reg >> 8, data->addr + W83781D_DATA_REG_OFFSET);
++	}
++}
++
++/* Not strictly necessary, but play it safe for now */
++static inline void w83627hf_reset_bank(struct w83627hf_data *data, u16 reg)
++{
++	if (reg & 0xff00) {
++		outb_p(W83781D_REG_BANK, data->addr + W83781D_ADDR_REG_OFFSET);
++		outb_p(0, data->addr + W83781D_DATA_REG_OFFSET);
++	}
++}
++
+ static int w83627hf_read_value(struct w83627hf_data *data, u16 reg)
+ {
+ 	int res, word_sized;
+@@ -1343,12 +1363,7 @@ static int w83627hf_read_value(struct w83627hf_data *data, u16 reg)
+ 		  && (((reg & 0x00ff) == 0x50)
+ 		   || ((reg & 0x00ff) == 0x53)
+ 		   || ((reg & 0x00ff) == 0x55));
+-	if (reg & 0xff00) {
+-		outb_p(W83781D_REG_BANK,
+-		       data->addr + W83781D_ADDR_REG_OFFSET);
+-		outb_p(reg >> 8,
+-		       data->addr + W83781D_DATA_REG_OFFSET);
+-	}
++	w83627hf_set_bank(data, reg);
+ 	outb_p(reg & 0xff, data->addr + W83781D_ADDR_REG_OFFSET);
+ 	res = inb_p(data->addr + W83781D_DATA_REG_OFFSET);
+ 	if (word_sized) {
+@@ -1358,11 +1373,7 @@ static int w83627hf_read_value(struct w83627hf_data *data, u16 reg)
+ 		    (res << 8) + inb_p(data->addr +
+ 				       W83781D_DATA_REG_OFFSET);
+ 	}
+-	if (reg & 0xff00) {
+-		outb_p(W83781D_REG_BANK,
+-		       data->addr + W83781D_ADDR_REG_OFFSET);
+-		outb_p(0, data->addr + W83781D_DATA_REG_OFFSET);
+-	}
++	w83627hf_reset_bank(data, reg);
+ 	mutex_unlock(&data->lock);
+ 	return res;
+ }
+@@ -1433,12 +1444,7 @@ static int w83627hf_write_value(struct w83627hf_data *data, u16 reg, u16 value)
+ 		   || ((reg & 0xff00) == 0x200))
+ 		  && (((reg & 0x00ff) == 0x53)
+ 		   || ((reg & 0x00ff) == 0x55));
+-	if (reg & 0xff00) {
+-		outb_p(W83781D_REG_BANK,
+-		       data->addr + W83781D_ADDR_REG_OFFSET);
+-		outb_p(reg >> 8,
+-		       data->addr + W83781D_DATA_REG_OFFSET);
+-	}
++	w83627hf_set_bank(data, reg);
+ 	outb_p(reg & 0xff, data->addr + W83781D_ADDR_REG_OFFSET);
+ 	if (word_sized) {
+ 		outb_p(value >> 8,
+@@ -1448,11 +1454,7 @@ static int w83627hf_write_value(struct w83627hf_data *data, u16 reg, u16 value)
+ 	}
+ 	outb_p(value & 0xff,
+ 	       data->addr + W83781D_DATA_REG_OFFSET);
+-	if (reg & 0xff00) {
+-		outb_p(W83781D_REG_BANK,
+-		       data->addr + W83781D_ADDR_REG_OFFSET);
+-		outb_p(0, data->addr + W83781D_DATA_REG_OFFSET);
+-	}
++	w83627hf_reset_bank(data, reg);
+ 	mutex_unlock(&data->lock);
+ 	return 0;
+ }
+@@ -1556,6 +1558,24 @@ static void __devinit w83627hf_init_device(struct platform_device *pdev)
+ 			    | 0x01);
+ }
+ 
++static void w83627hf_update_fan_div(struct w83627hf_data *data)
++{
++	int reg;
++
++	reg = w83627hf_read_value(data, W83781D_REG_VID_FANDIV);
++	data->fan_div[0] = (reg >> 4) & 0x03;
++	data->fan_div[1] = (reg >> 6) & 0x03;
++	if (data->type != w83697hf) {
++		data->fan_div[2] = (w83627hf_read_value(data,
++				       W83781D_REG_PIN) >> 6) & 0x03;
++	}
++	reg = w83627hf_read_value(data, W83781D_REG_VBAT);
++	data->fan_div[0] |= (reg >> 3) & 0x04;
++	data->fan_div[1] |= (reg >> 4) & 0x04;
++	if (data->type != w83697hf)
++		data->fan_div[2] |= (reg >> 5) & 0x04;
++}
++
+ static struct w83627hf_data *w83627hf_update_device(struct device *dev)
+ {
+ 	struct w83627hf_data *data = dev_get_drvdata(dev);
+@@ -1633,18 +1653,8 @@ static struct w83627hf_data *w83627hf_update_device(struct device *dev)
+ 			  w83627hf_read_value(data, W83781D_REG_TEMP_HYST(3));
+ 		}
+ 
+-		i = w83627hf_read_value(data, W83781D_REG_VID_FANDIV);
+-		data->fan_div[0] = (i >> 4) & 0x03;
+-		data->fan_div[1] = (i >> 6) & 0x03;
+-		if (data->type != w83697hf) {
+-			data->fan_div[2] = (w83627hf_read_value(data,
+-					       W83781D_REG_PIN) >> 6) & 0x03;
+-		}
+-		i = w83627hf_read_value(data, W83781D_REG_VBAT);
+-		data->fan_div[0] |= (i >> 3) & 0x04;
+-		data->fan_div[1] |= (i >> 4) & 0x04;
+-		if (data->type != w83697hf)
+-			data->fan_div[2] |= (i >> 5) & 0x04;
++		w83627hf_update_fan_div(data);
++
+ 		data->alarms =
+ 		    w83627hf_read_value(data, W83781D_REG_ALARM1) |
+ 		    (w83627hf_read_value(data, W83781D_REG_ALARM2) << 8) |
+diff --git a/drivers/ide/pci/cs5535.c b/drivers/ide/pci/cs5535.c
+index 082ca7d..6102aa9 100644
+--- a/drivers/ide/pci/cs5535.c
++++ b/drivers/ide/pci/cs5535.c
+@@ -84,7 +84,7 @@ static void cs5535_set_speed(ide_drive_t *drive, u8 speed)
+ 
+ 	/* Set the PIO timings */
+ 	if ((speed & XFER_MODE) == XFER_PIO) {
+-		ide_drive_t *pair = &drive->hwif->drives[drive->dn ^ 1];
++		ide_drive_t *pair = ide_get_paired_drive(drive);
+ 		u8 cmd, pioa;
+ 
+ 		cmd = pioa = speed - XFER_PIO_0;
+diff --git a/drivers/ide/pci/serverworks.c b/drivers/ide/pci/serverworks.c
+index 9fead2e..e887058 100644
+--- a/drivers/ide/pci/serverworks.c
++++ b/drivers/ide/pci/serverworks.c
+@@ -97,6 +97,7 @@ static u8 svwks_udma_filter(ide_drive_t *drive)
+ 			mode = 2;
+ 
+ 		switch(mode) {
++		case 3:	 mask = 0x3f; break;
+ 		case 2:	 mask = 0x1f; break;
+ 		case 1:	 mask = 0x07; break;
+ 		default: mask = 0x00; break;
+diff --git a/drivers/ide/pci/siimage.c b/drivers/ide/pci/siimage.c
+index 50f6d17..713064d 100644
+--- a/drivers/ide/pci/siimage.c
++++ b/drivers/ide/pci/siimage.c
+@@ -180,7 +180,7 @@ static void sil_tune_pio(ide_drive_t *drive, u8 pio)
+ 	const u16 data_speed[]	= { 0x328a, 0x2283, 0x1104, 0x10c3, 0x10c1 };
+ 
+ 	ide_hwif_t *hwif	= HWIF(drive);
+-	ide_drive_t *pair	= &hwif->drives[drive->dn ^ 1];
++	ide_drive_t *pair	= ide_get_paired_drive(drive);
+ 	u32 speedt		= 0;
+ 	u16 speedp		= 0;
+ 	unsigned long addr	= siimage_seldev(drive, 0x04);
+diff --git a/drivers/infiniband/core/uverbs_cmd.c b/drivers/infiniband/core/uverbs_cmd.c
+index 01d7008..495c803 100644
+--- a/drivers/infiniband/core/uverbs_cmd.c
++++ b/drivers/infiniband/core/uverbs_cmd.c
+@@ -147,8 +147,12 @@ static struct ib_uobject *__idr_get_uobj(struct idr *idr, int id,
+ 
+ 	spin_lock(&ib_uverbs_idr_lock);
+ 	uobj = idr_find(idr, id);
+-	if (uobj)
+-		kref_get(&uobj->ref);
++	if (uobj) {
++		if (uobj->context == context)
++			kref_get(&uobj->ref);
++		else
++			uobj = NULL;
++	}
+ 	spin_unlock(&ib_uverbs_idr_lock);
+ 
+ 	return uobj;
+diff --git a/drivers/infiniband/hw/mthca/mthca_cmd.c b/drivers/infiniband/hw/mthca/mthca_cmd.c
+index acc9589..6966f94 100644
+--- a/drivers/infiniband/hw/mthca/mthca_cmd.c
++++ b/drivers/infiniband/hw/mthca/mthca_cmd.c
+@@ -290,6 +290,12 @@ static int mthca_cmd_post(struct mthca_dev *dev,
+ 		err = mthca_cmd_post_hcr(dev, in_param, out_param, in_modifier,
+ 					 op_modifier, op, token, event);
+ 
++	/*
++	 * Make sure that our HCR writes don't get mixed in with
++	 * writes from another CPU starting a FW command.
++	 */
++	mmiowb();
++
+ 	mutex_unlock(&dev->cmd.hcr_mutex);
+ 	return err;
+ }
+diff --git a/drivers/isdn/hardware/avm/b1.c b/drivers/isdn/hardware/avm/b1.c
+index 7a69a18..4484a64 100644
+--- a/drivers/isdn/hardware/avm/b1.c
++++ b/drivers/isdn/hardware/avm/b1.c
+@@ -321,12 +321,15 @@ void b1_reset_ctr(struct capi_ctr *ctrl)
+ 	avmctrl_info *cinfo = (avmctrl_info *)(ctrl->driverdata);
+ 	avmcard *card = cinfo->card;
+ 	unsigned int port = card->port;
++	unsigned long flags;
+ 
+ 	b1_reset(port);
+ 	b1_reset(port);
+ 
+ 	memset(cinfo->version, 0, sizeof(cinfo->version));
++	spin_lock_irqsave(&card->lock, flags);
+ 	capilib_release(&cinfo->ncci_head);
++	spin_unlock_irqrestore(&card->lock, flags);
+ 	capi_ctr_reseted(ctrl);
+ }
+ 
+@@ -361,9 +364,8 @@ void b1_release_appl(struct capi_ctr *ctrl, u16 appl)
+ 	unsigned int port = card->port;
+ 	unsigned long flags;
+ 
+-	capilib_release_appl(&cinfo->ncci_head, appl);
+-
+ 	spin_lock_irqsave(&card->lock, flags);
++	capilib_release_appl(&cinfo->ncci_head, appl);
+ 	b1_put_byte(port, SEND_RELEASE);
+ 	b1_put_word(port, appl);
+ 	spin_unlock_irqrestore(&card->lock, flags);
+@@ -380,27 +382,27 @@ u16 b1_send_message(struct capi_ctr *ctrl, struct sk_buff *skb)
+ 	u8 subcmd = CAPIMSG_SUBCOMMAND(skb->data);
+ 	u16 dlen, retval;
+ 
++	spin_lock_irqsave(&card->lock, flags);
+ 	if (CAPICMD(cmd, subcmd) == CAPI_DATA_B3_REQ) {
+ 		retval = capilib_data_b3_req(&cinfo->ncci_head,
+ 					     CAPIMSG_APPID(skb->data),
+ 					     CAPIMSG_NCCI(skb->data),
+ 					     CAPIMSG_MSGID(skb->data));
+-		if (retval != CAPI_NOERROR) 
++		if (retval != CAPI_NOERROR) {
++			spin_unlock_irqrestore(&card->lock, flags);
+ 			return retval;
++		}
+ 
+ 		dlen = CAPIMSG_DATALEN(skb->data);
+ 
+-	 	spin_lock_irqsave(&card->lock, flags);
+ 		b1_put_byte(port, SEND_DATA_B3_REQ);
+ 		b1_put_slice(port, skb->data, len);
+ 		b1_put_slice(port, skb->data + len, dlen);
+-		spin_unlock_irqrestore(&card->lock, flags);
+ 	} else {
+-	 	spin_lock_irqsave(&card->lock, flags);
+ 		b1_put_byte(port, SEND_MESSAGE);
+ 		b1_put_slice(port, skb->data, len);
+-		spin_unlock_irqrestore(&card->lock, flags);
+ 	}
++	spin_unlock_irqrestore(&card->lock, flags);
+ 
+ 	dev_kfree_skb_any(skb);
+ 	return CAPI_NOERROR;
+@@ -534,17 +536,17 @@ irqreturn_t b1_interrupt(int interrupt, void *devptr)
+ 
+ 		ApplId = (unsigned) b1_get_word(card->port);
+ 		MsgLen = b1_get_slice(card->port, card->msgbuf);
+-		spin_unlock_irqrestore(&card->lock, flags);
+ 		if (!(skb = alloc_skb(MsgLen, GFP_ATOMIC))) {
+ 			printk(KERN_ERR "%s: incoming packet dropped\n",
+ 					card->name);
++			spin_unlock_irqrestore(&card->lock, flags);
+ 		} else {
+ 			memcpy(skb_put(skb, MsgLen), card->msgbuf, MsgLen);
+ 			if (CAPIMSG_CMD(skb->data) == CAPI_DATA_B3_CONF)
+ 				capilib_data_b3_conf(&cinfo->ncci_head, ApplId,
+ 						     CAPIMSG_NCCI(skb->data),
+ 						     CAPIMSG_MSGID(skb->data));
+-
++			spin_unlock_irqrestore(&card->lock, flags);
+ 			capi_ctr_handle_message(ctrl, ApplId, skb);
+ 		}
+ 		break;
+@@ -554,21 +556,17 @@ irqreturn_t b1_interrupt(int interrupt, void *devptr)
+ 		ApplId = b1_get_word(card->port);
+ 		NCCI = b1_get_word(card->port);
+ 		WindowSize = b1_get_word(card->port);
+-		spin_unlock_irqrestore(&card->lock, flags);
+-
+ 		capilib_new_ncci(&cinfo->ncci_head, ApplId, NCCI, WindowSize);
+-
++		spin_unlock_irqrestore(&card->lock, flags);
+ 		break;
+ 
+ 	case RECEIVE_FREE_NCCI:
+ 
+ 		ApplId = b1_get_word(card->port);
+ 		NCCI = b1_get_word(card->port);
+-		spin_unlock_irqrestore(&card->lock, flags);
+-
+ 		if (NCCI != 0xffffffff)
+ 			capilib_free_ncci(&cinfo->ncci_head, ApplId, NCCI);
+-	       
++		spin_unlock_irqrestore(&card->lock, flags);
+ 		break;
+ 
+ 	case RECEIVE_START:
+diff --git a/drivers/isdn/hardware/avm/c4.c b/drivers/isdn/hardware/avm/c4.c
+index d58f927..8710cf6 100644
+--- a/drivers/isdn/hardware/avm/c4.c
++++ b/drivers/isdn/hardware/avm/c4.c
+@@ -727,6 +727,7 @@ static void c4_send_init(avmcard *card)
+ {
+ 	struct sk_buff *skb;
+ 	void *p;
++	unsigned long flags;
+ 
+ 	skb = alloc_skb(15, GFP_ATOMIC);
+ 	if (!skb) {
+@@ -744,12 +745,15 @@ static void c4_send_init(avmcard *card)
+ 	skb_put(skb, (u8 *)p - (u8 *)skb->data);
+ 
+ 	skb_queue_tail(&card->dma->send_queue, skb);
++	spin_lock_irqsave(&card->lock, flags);
+ 	c4_dispatch_tx(card);
++	spin_unlock_irqrestore(&card->lock, flags);
+ }
+ 
+ static int queue_sendconfigword(avmcard *card, u32 val)
+ {
+ 	struct sk_buff *skb;
++	unsigned long flags;
+ 	void *p;
+ 
+ 	skb = alloc_skb(3+4, GFP_ATOMIC);
+@@ -766,7 +770,9 @@ static int queue_sendconfigword(avmcard *card, u32 val)
+ 	skb_put(skb, (u8 *)p - (u8 *)skb->data);
+ 
+ 	skb_queue_tail(&card->dma->send_queue, skb);
++	spin_lock_irqsave(&card->lock, flags);
+ 	c4_dispatch_tx(card);
++	spin_unlock_irqrestore(&card->lock, flags);
+ 	return 0;
+ }
+ 
+@@ -986,7 +992,9 @@ static void c4_release_appl(struct capi_ctr *ctrl, u16 appl)
+ 	struct sk_buff *skb;
+ 	void *p;
+ 
++	spin_lock_irqsave(&card->lock, flags);
+ 	capilib_release_appl(&cinfo->ncci_head, appl);
++	spin_unlock_irqrestore(&card->lock, flags);
+ 
+ 	if (ctrl->cnr == card->cardnr) {
+ 		skb = alloc_skb(7, GFP_ATOMIC);
+@@ -1019,7 +1027,8 @@ static u16 c4_send_message(struct capi_ctr *ctrl, struct sk_buff *skb)
+ 	u16 retval = CAPI_NOERROR;
+ 	unsigned long flags;
+ 
+- 	if (CAPIMSG_CMD(skb->data) == CAPI_DATA_B3_REQ) {
++	spin_lock_irqsave(&card->lock, flags);
++	if (CAPIMSG_CMD(skb->data) == CAPI_DATA_B3_REQ) {
+ 		retval = capilib_data_b3_req(&cinfo->ncci_head,
+ 					     CAPIMSG_APPID(skb->data),
+ 					     CAPIMSG_NCCI(skb->data),
+@@ -1027,10 +1036,9 @@ static u16 c4_send_message(struct capi_ctr *ctrl, struct sk_buff *skb)
+ 	}
+ 	if (retval == CAPI_NOERROR) {
+ 		skb_queue_tail(&card->dma->send_queue, skb);
+-		spin_lock_irqsave(&card->lock, flags);
+ 		c4_dispatch_tx(card);
+-		spin_unlock_irqrestore(&card->lock, flags);
+ 	}
++	spin_unlock_irqrestore(&card->lock, flags);
+ 	return retval;
+ }
+ 
+diff --git a/drivers/md/bitmap.c b/drivers/md/bitmap.c
+index 927cb34..7c426d0 100644
+--- a/drivers/md/bitmap.c
++++ b/drivers/md/bitmap.c
+@@ -274,7 +274,7 @@ static int write_sb_page(struct bitmap *bitmap, struct page *page, int wait)
+ 			if (bitmap->offset < 0) {
+ 				/* DATA  BITMAP METADATA  */
+ 				if (bitmap->offset
+-				    + page->index * (PAGE_SIZE/512)
++				    + (long)(page->index * (PAGE_SIZE/512))
+ 				    + size/512 > 0)
+ 					/* bitmap runs in to metadata */
+ 					return -EINVAL;
+diff --git a/drivers/md/dm-delay.c b/drivers/md/dm-delay.c
+index 6928c13..9538331 100644
+--- a/drivers/md/dm-delay.c
++++ b/drivers/md/dm-delay.c
+@@ -305,7 +305,7 @@ static int delay_status(struct dm_target *ti, status_type_t type,
+ 		       (unsigned long long) dc->start_read,
+ 		       dc->read_delay);
+ 		if (dc->dev_write)
+-			DMEMIT("%s %llu %u", dc->dev_write->name,
++			DMEMIT(" %s %llu %u", dc->dev_write->name,
+ 			       (unsigned long long) dc->start_write,
+ 			       dc->write_delay);
+ 		break;
+diff --git a/drivers/md/dm.c b/drivers/md/dm.c
+index 2120155..998d450 100644
+--- a/drivers/md/dm.c
++++ b/drivers/md/dm.c
+@@ -1064,12 +1064,14 @@ static struct mapped_device *alloc_dev(int minor)
+ 	return NULL;
+ }
+ 
++static void unlock_fs(struct mapped_device *md);
++
+ static void free_dev(struct mapped_device *md)
+ {
+ 	int minor = md->disk->first_minor;
+ 
+ 	if (md->suspended_bdev) {
+-		thaw_bdev(md->suspended_bdev, NULL);
++		unlock_fs(md);
+ 		bdput(md->suspended_bdev);
+ 	}
+ 	mempool_destroy(md->tio_pool);
+diff --git a/drivers/md/raid5.c b/drivers/md/raid5.c
+index f96dea9..3808f52 100644
+--- a/drivers/md/raid5.c
++++ b/drivers/md/raid5.c
+@@ -377,7 +377,12 @@ static unsigned long get_stripe_work(struct stripe_head *sh)
+ 		ack++;
+ 
+ 	sh->ops.count -= ack;
+-	BUG_ON(sh->ops.count < 0);
++	if (unlikely(sh->ops.count < 0)) {
++		printk(KERN_ERR "pending: %#lx ops.pending: %#lx ops.ack: %#lx "
++			"ops.complete: %#lx\n", pending, sh->ops.pending,
++			sh->ops.ack, sh->ops.complete);
++		BUG();
++	}
+ 
+ 	return pending;
+ }
+@@ -551,8 +556,7 @@ static void ops_complete_biofill(void *stripe_head_ref)
+ 			}
+ 		}
+ 	}
+-	clear_bit(STRIPE_OP_BIOFILL, &sh->ops.ack);
+-	clear_bit(STRIPE_OP_BIOFILL, &sh->ops.pending);
++	set_bit(STRIPE_OP_BIOFILL, &sh->ops.complete);
+ 
+ 	return_io(return_bi);
+ 
+@@ -2630,6 +2634,13 @@ static void handle_stripe5(struct stripe_head *sh)
+ 	s.expanded = test_bit(STRIPE_EXPAND_READY, &sh->state);
+ 	/* Now to look around and see what can be done */
+ 
++	/* clean-up completed biofill operations */
++	if (test_bit(STRIPE_OP_BIOFILL, &sh->ops.complete)) {
++		clear_bit(STRIPE_OP_BIOFILL, &sh->ops.pending);
++		clear_bit(STRIPE_OP_BIOFILL, &sh->ops.ack);
++		clear_bit(STRIPE_OP_BIOFILL, &sh->ops.complete);
++	}
++
+ 	rcu_read_lock();
+ 	for (i=disks; i--; ) {
+ 		mdk_rdev_t *rdev;
+diff --git a/drivers/pci/msi.c b/drivers/pci/msi.c
+index be1df85..87e0161 100644
+--- a/drivers/pci/msi.c
++++ b/drivers/pci/msi.c
+@@ -132,7 +132,7 @@ void read_msi_msg(unsigned int irq, struct msi_msg *msg)
+ 			pci_read_config_word(dev, msi_data_reg(pos, 1), &data);
+ 		} else {
+ 			msg->address_hi = 0;
+-			pci_read_config_word(dev, msi_data_reg(pos, 1), &data);
++			pci_read_config_word(dev, msi_data_reg(pos, 0), &data);
+ 		}
+ 		msg->data = data;
+ 		break;
+diff --git a/drivers/scsi/hptiop.c b/drivers/scsi/hptiop.c
+index 0e579ca..ffdd0da 100644
+--- a/drivers/scsi/hptiop.c
++++ b/drivers/scsi/hptiop.c
+@@ -365,8 +365,9 @@ static void hptiop_host_request_callback(struct hptiop_hba *hba, u32 tag)
+ 		scp->result = SAM_STAT_CHECK_CONDITION;
+ 		memset(&scp->sense_buffer,
+ 				0, sizeof(scp->sense_buffer));
+-		memcpy(&scp->sense_buffer,
+-			&req->sg_list, le32_to_cpu(req->dataxfer_length));
++		memcpy(&scp->sense_buffer, &req->sg_list,
++				min(sizeof(scp->sense_buffer),
++					le32_to_cpu(req->dataxfer_length)));
+ 		break;
+ 
+ 	default:
+diff --git a/drivers/usb/core/hcd.h b/drivers/usb/core/hcd.h
+index b5ebb73..6e2382e 100644
+--- a/drivers/usb/core/hcd.h
++++ b/drivers/usb/core/hcd.h
+@@ -19,6 +19,8 @@
+ 
+ #ifdef __KERNEL__
+ 
++#include <linux/rwsem.h>
++
+ /* This file contains declarations of usbcore internals that are mostly
+  * used or exposed by Host Controller Drivers.
+  */
+@@ -454,5 +456,9 @@ static inline void usbmon_urb_complete(struct usb_bus *bus, struct urb *urb) {}
+ 		: (in_interrupt () ? "in_interrupt" : "can sleep"))
+ 
+ 
+-#endif /* __KERNEL__ */
++/* This rwsem is for use only by the hub driver and ehci-hcd.
++ * Nobody else should touch it.
++ */
++extern struct rw_semaphore ehci_cf_port_reset_rwsem;
+ 
++#endif /* __KERNEL__ */
+diff --git a/drivers/usb/core/hub.c b/drivers/usb/core/hub.c
+index f7b337f..c3adffa 100644
+--- a/drivers/usb/core/hub.c
++++ b/drivers/usb/core/hub.c
+@@ -125,6 +125,12 @@ MODULE_PARM_DESC(use_both_schemes,
+ 		"try the other device initialization scheme if the "
+ 		"first one fails");
+ 
++/* Mutual exclusion for EHCI CF initialization.  This interferes with
++ * port reset on some companion controllers.
++ */
++DECLARE_RWSEM(ehci_cf_port_reset_rwsem);
++EXPORT_SYMBOL_GPL(ehci_cf_port_reset_rwsem);
++
+ 
+ static inline char *portspeed(int portstatus)
+ {
+@@ -1460,6 +1466,11 @@ static int hub_port_reset(struct usb_hub *hub, int port1,
+ {
+ 	int i, status;
+ 
++	/* Block EHCI CF initialization during the port reset.
++	 * Some companion controllers don't like it when they mix.
++	 */
++	down_read(&ehci_cf_port_reset_rwsem);
++
+ 	/* Reset the port */
+ 	for (i = 0; i < PORT_RESET_TRIES; i++) {
+ 		status = set_port_feature(hub->hdev,
+@@ -1490,7 +1501,7 @@ static int hub_port_reset(struct usb_hub *hub, int port1,
+ 			usb_set_device_state(udev, status
+ 					? USB_STATE_NOTATTACHED
+ 					: USB_STATE_DEFAULT);
+-			return status;
++			goto done;
+ 		}
+ 
+ 		dev_dbg (hub->intfdev,
+@@ -1503,6 +1514,8 @@ static int hub_port_reset(struct usb_hub *hub, int port1,
+ 		"Cannot enable port %i.  Maybe the USB cable is bad?\n",
+ 		port1);
+ 
++ done:
++	up_read(&ehci_cf_port_reset_rwsem);
+ 	return status;
+ }
+ 
+diff --git a/drivers/usb/core/quirks.c b/drivers/usb/core/quirks.c
+index ebf3dc2..d42c561 100644
+--- a/drivers/usb/core/quirks.c
++++ b/drivers/usb/core/quirks.c
+@@ -32,52 +32,6 @@ static const struct usb_device_id usb_quirk_list[] = {
+ 	{ USB_DEVICE(0x0204, 0x6025), .driver_info = USB_QUIRK_RESET_RESUME },
+ 	/* HP 5300/5370C scanner */
+ 	{ USB_DEVICE(0x03f0, 0x0701), .driver_info = USB_QUIRK_STRING_FETCH_255 },
+-	/* Hewlett-Packard PhotoSmart 720 / PhotoSmart 935 (storage) */
+-	{ USB_DEVICE(0x03f0, 0x4002), .driver_info = USB_QUIRK_NO_AUTOSUSPEND },
+-
+-	/* SGS Thomson Microelectronics 4in1 card reader */
+-	{ USB_DEVICE(0x0483, 0x0321), .driver_info = USB_QUIRK_NO_AUTOSUSPEND },
+-
+-	/* Acer Peripherals Inc. (now BenQ Corp.) Prisa 640BU */
+-	{ USB_DEVICE(0x04a5, 0x207e), .driver_info = USB_QUIRK_NO_AUTOSUSPEND },
+-	/* Benq S2W 3300U */
+-	{ USB_DEVICE(0x04a5, 0x20b0), .driver_info = USB_QUIRK_NO_AUTOSUSPEND },
+-	/* Canon, Inc. CanoScan N1240U/LiDE30 */
+-	{ USB_DEVICE(0x04a9, 0x220e), .driver_info = USB_QUIRK_NO_AUTOSUSPEND },
+-	/* Canon, Inc. CanoScan N650U/N656U */
+-	{ USB_DEVICE(0x04a9, 0x2206), .driver_info = USB_QUIRK_NO_AUTOSUSPEND },
+-	/* Canon, Inc. CanoScan 1220U */
+-	{ USB_DEVICE(0x04a9, 0x2207), .driver_info = USB_QUIRK_NO_AUTOSUSPEND },
+-	/* Canon, Inc. CanoScan N670U/N676U/LiDE 20 */
+-	{ USB_DEVICE(0x04a9, 0x220d), .driver_info = USB_QUIRK_NO_AUTOSUSPEND },
+-	/* old Cannon scanner */
+-	{ USB_DEVICE(0x04a9, 0x2220), .driver_info = USB_QUIRK_NO_AUTOSUSPEND },
+-	/* Seiko Epson Corp. Perfection 1200 */
+-	{ USB_DEVICE(0x04b8, 0x0104), .driver_info = USB_QUIRK_NO_AUTOSUSPEND },
+-	/* Seiko Epson Corp. Perfection 660 */
+-	{ USB_DEVICE(0x04b8, 0x0114), .driver_info = USB_QUIRK_NO_AUTOSUSPEND },
+-	/* Epson Perfection 1260 Photo */
+-	{ USB_DEVICE(0x04b8, 0x011d), .driver_info = USB_QUIRK_NO_AUTOSUSPEND },
+-	/* Seiko Epson Corp - Perfection 1670 */
+-	{ USB_DEVICE(0x04b8, 0x011f), .driver_info = USB_QUIRK_NO_AUTOSUSPEND },
+-	/* EPSON Perfection 2480 */
+-	{ USB_DEVICE(0x04b8, 0x0121), .driver_info = USB_QUIRK_NO_AUTOSUSPEND },
+-	/* Seiko Epson Corp.*/
+-	{ USB_DEVICE(0x04b8, 0x0122), .driver_info = USB_QUIRK_NO_AUTOSUSPEND },
+-	/* Samsung ML-2010 printer */
+-	{ USB_DEVICE(0x04e8, 0x326c), .driver_info = USB_QUIRK_NO_AUTOSUSPEND },
+-	/* Samsung ML-2510 Series printer */
+-	{ USB_DEVICE(0x04e8, 0x327e), .driver_info = USB_QUIRK_NO_AUTOSUSPEND },
+-	/* Elsa MicroLink 56k (V.250) */
+-	{ USB_DEVICE(0x05cc, 0x2267), .driver_info = USB_QUIRK_NO_AUTOSUSPEND },
+-	/* Ultima Electronics Corp.*/
+-	{ USB_DEVICE(0x05d8, 0x4005), .driver_info = USB_QUIRK_NO_AUTOSUSPEND },
+-
+-	/* Genesys USB-to-IDE */
+-	{ USB_DEVICE(0x0503, 0x0702), .driver_info = USB_QUIRK_NO_AUTOSUSPEND },
+-
+-	/* USB Graphical LCD - EEH Datalink GmbH */
+-	{ USB_DEVICE(0x060c, 0x04eb), .driver_info = USB_QUIRK_NO_AUTOSUSPEND },
+ 
+ 	/* INTEL VALUE SSD */
+ 	{ USB_DEVICE(0x8086, 0xf1a5), .driver_info = USB_QUIRK_RESET_RESUME },
+@@ -85,44 +39,15 @@ static const struct usb_device_id usb_quirk_list[] = {
+ 	/* M-Systems Flash Disk Pioneers */
+ 	{ USB_DEVICE(0x08ec, 0x1000), .driver_info = USB_QUIRK_RESET_RESUME },
+ 
+-	/* Agfa Snapscan1212u */
+-	{ USB_DEVICE(0x06bd, 0x2061), .driver_info = USB_QUIRK_NO_AUTOSUSPEND },
+-	/* Seagate RSS LLC */
+-	{ USB_DEVICE(0x0bc2, 0x3000), .driver_info = USB_QUIRK_NO_AUTOSUSPEND },
+-	/* Umax [hex] Astra 3400U */
+-	{ USB_DEVICE(0x1606, 0x0060), .driver_info = USB_QUIRK_NO_AUTOSUSPEND },
+-
+ 	/* Philips PSC805 audio device */
+ 	{ USB_DEVICE(0x0471, 0x0155), .driver_info = USB_QUIRK_RESET_RESUME },
+ 
+-	/* Alcor multi-card reader */
+-	{ USB_DEVICE(0x058f, 0x6366), .driver_info = USB_QUIRK_NO_AUTOSUSPEND },
+-
+-	/* Canon EOS 5D in PC Connection mode */
+-	{ USB_DEVICE(0x04a9, 0x3101), .driver_info = USB_QUIRK_NO_AUTOSUSPEND },
+-
+-	/* RIM Blackberry */
+-	{ USB_DEVICE(0x0fca, 0x0001), .driver_info = USB_QUIRK_NO_AUTOSUSPEND },
+-	{ USB_DEVICE(0x0fca, 0x0004), .driver_info = USB_QUIRK_NO_AUTOSUSPEND },
+-	{ USB_DEVICE(0x0fca, 0x0006), .driver_info = USB_QUIRK_NO_AUTOSUSPEND },
+-
+-	/* Apple iPhone */
+-	{ USB_DEVICE(0x05ac, 0x1290), .driver_info = USB_QUIRK_NO_AUTOSUSPEND },
+-
+ 	/* SKYMEDI USB_DRIVE */
+ 	{ USB_DEVICE(0x1516, 0x8628), .driver_info = USB_QUIRK_RESET_RESUME },
+ 
+ 	{ }  /* terminating entry must be last */
+ };
+ 
+-static void usb_autosuspend_quirk(struct usb_device *udev)
+-{
+-#ifdef	CONFIG_USB_SUSPEND
+-	/* disable autosuspend, but allow the user to re-enable it via sysfs */
+-	udev->autosuspend_disabled = 1;
+-#endif
+-}
+-
+ static const struct usb_device_id *find_id(struct usb_device *udev)
+ {
+ 	const struct usb_device_id *id = usb_quirk_list;
+@@ -149,13 +74,9 @@ void usb_detect_quirks(struct usb_device *udev)
+ 		dev_dbg(&udev->dev, "USB quirks for this device: %x\n",
+ 				udev->quirks);
+ 
+-	/* do any special quirk handling here if needed */
+-	if (udev->quirks & USB_QUIRK_NO_AUTOSUSPEND)
+-		usb_autosuspend_quirk(udev);
+-
+ 	/* By default, disable autosuspend for all non-hubs */
+ #ifdef	CONFIG_USB_SUSPEND
+ 	if (udev->descriptor.bDeviceClass != USB_CLASS_HUB)
+-		udev->autosuspend_delay = -1;
++		udev->autosuspend_disabled = 1;
+ #endif
+ }
+diff --git a/drivers/usb/core/urb.c b/drivers/usb/core/urb.c
+index be63022..3da7979 100644
+--- a/drivers/usb/core/urb.c
++++ b/drivers/usb/core/urb.c
+@@ -358,7 +358,7 @@ int usb_submit_urb(struct urb *urb, gfp_t mem_flags)
+ 
+ 	/* enforce simple/standard policy */
+ 	allowed = (URB_NO_TRANSFER_DMA_MAP | URB_NO_SETUP_DMA_MAP |
+-			URB_NO_INTERRUPT);
++			URB_NO_INTERRUPT | URB_FREE_BUFFER);
+ 	switch (temp) {
+ 	case PIPE_BULK:
+ 		if (is_out)
+diff --git a/drivers/usb/gadget/ether.c b/drivers/usb/gadget/ether.c
+index 593e235..d57de87 100644
+--- a/drivers/usb/gadget/ether.c
++++ b/drivers/usb/gadget/ether.c
+@@ -1989,8 +1989,20 @@ static int eth_start_xmit (struct sk_buff *skb, struct net_device *net)
+ 	}
+ 
+ 	spin_lock_irqsave(&dev->req_lock, flags);
++	/*
++	 * this freelist can be empty if an interrupt triggered disconnect()
++	 * and reconfigured the gadget (shutting down this queue) after the
++	 * network stack decided to xmit but before we got the spinlock.
++	 */
++	if (list_empty(&dev->tx_reqs)) {
++		spin_unlock_irqrestore(&dev->req_lock, flags);
++		return 1;
++	}
++
+ 	req = container_of (dev->tx_reqs.next, struct usb_request, list);
+ 	list_del (&req->list);
++
++	/* temporarily stop TX queue when the freelist empties */
+ 	if (list_empty (&dev->tx_reqs))
+ 		netif_stop_queue (net);
+ 	spin_unlock_irqrestore(&dev->req_lock, flags);
+diff --git a/drivers/usb/host/ehci-hcd.c b/drivers/usb/host/ehci-hcd.c
+index 35cdba1..31310ca 100644
+--- a/drivers/usb/host/ehci-hcd.c
++++ b/drivers/usb/host/ehci-hcd.c
+@@ -570,10 +570,18 @@ static int ehci_run (struct usb_hcd *hcd)
+ 	 * are explicitly handed to companion controller(s), so no TT is
+ 	 * involved with the root hub.  (Except where one is integrated,
+ 	 * and there's no companion controller unless maybe for USB OTG.)
++	 *
++	 * Turning on the CF flag will transfer ownership of all ports
++	 * from the companions to the EHCI controller.  If any of the
++	 * companions are in the middle of a port reset at the time, it
++	 * could cause trouble.  Write-locking ehci_cf_port_reset_rwsem
++	 * guarantees that no resets are in progress.
+ 	 */
++	down_write(&ehci_cf_port_reset_rwsem);
+ 	hcd->state = HC_STATE_RUNNING;
+ 	ehci_writel(ehci, FLAG_CF, &ehci->regs->configured_flag);
+ 	ehci_readl(ehci, &ehci->regs->command);	/* unblock posted writes */
++	up_write(&ehci_cf_port_reset_rwsem);
+ 
+ 	temp = HC_VERSION(ehci_readl(ehci, &ehci->caps->hc_capbase));
+ 	ehci_info (ehci,
+diff --git a/drivers/usb/serial/generic.c b/drivers/usb/serial/generic.c
+index 88a2c7d..9eb4a65 100644
+--- a/drivers/usb/serial/generic.c
++++ b/drivers/usb/serial/generic.c
+@@ -208,14 +208,15 @@ int usb_serial_generic_write(struct usb_serial_port *port, const unsigned char *
+ 
+ 	/* only do something if we have a bulk out endpoint */
+ 	if (serial->num_bulk_out) {
+-		spin_lock_bh(&port->lock);
++		unsigned long flags;
++		spin_lock_irqsave(&port->lock, flags);
+ 		if (port->write_urb_busy) {
+-			spin_unlock_bh(&port->lock);
++			spin_unlock_irqrestore(&port->lock, flags);
+ 			dbg("%s - already writing", __FUNCTION__);
+ 			return 0;
+ 		}
+ 		port->write_urb_busy = 1;
+-		spin_unlock_bh(&port->lock);
++		spin_unlock_irqrestore(&port->lock, flags);
+ 
+ 		count = (count > port->bulk_out_size) ? port->bulk_out_size : count;
+ 
+diff --git a/drivers/video/platinumfb.c b/drivers/video/platinumfb.c
+index 8503e73..cbe71a5 100644
+--- a/drivers/video/platinumfb.c
++++ b/drivers/video/platinumfb.c
+@@ -17,6 +17,8 @@
+  *  more details.
+  */
+ 
++#undef DEBUG
++
+ #include <linux/module.h>
+ #include <linux/kernel.h>
+ #include <linux/errno.h>
+@@ -535,33 +537,35 @@ static int __devinit platinumfb_probe(struct of_device* odev,
+ 	volatile __u8		*fbuffer;
+ 	int			bank0, bank1, bank2, bank3, rc;
+ 
+-	printk(KERN_INFO "platinumfb: Found Apple Platinum video hardware\n");
++	dev_info(&odev->dev, "Found Apple Platinum video hardware\n");
+ 
+ 	info = framebuffer_alloc(sizeof(*pinfo), &odev->dev);
+-	if (info == NULL)
++	if (info == NULL) {
++		dev_err(&odev->dev, "Failed to allocate fbdev !\n");
+ 		return -ENOMEM;
++	}
+ 	pinfo = info->par;
+ 
+ 	if (of_address_to_resource(dp, 0, &pinfo->rsrc_reg) ||
+ 	    of_address_to_resource(dp, 1, &pinfo->rsrc_fb)) {
+-		printk(KERN_ERR "platinumfb: Can't get resources\n");
+-		framebuffer_release(info);
+-		return -ENXIO;
+-	}
+-	if (!request_mem_region(pinfo->rsrc_reg.start,
+-				pinfo->rsrc_reg.start -
+-				pinfo->rsrc_reg.end + 1,
+-				"platinumfb registers")) {
++		dev_err(&odev->dev, "Can't get resources\n");
+ 		framebuffer_release(info);
+ 		return -ENXIO;
+ 	}
++	dev_dbg(&odev->dev, " registers  : 0x%llx...0x%llx\n",
++		(unsigned long long)pinfo->rsrc_reg.start,
++		(unsigned long long)pinfo->rsrc_reg.end);
++	dev_dbg(&odev->dev, " framebuffer: 0x%llx...0x%llx\n",
++		(unsigned long long)pinfo->rsrc_fb.start,
++		(unsigned long long)pinfo->rsrc_fb.end);
++
++	/* Do not try to request register space, they overlap with the
++	 * northbridge and that can fail. Only request framebuffer
++	 */
+ 	if (!request_mem_region(pinfo->rsrc_fb.start,
+-				pinfo->rsrc_fb.start
+-				- pinfo->rsrc_fb.end + 1,
++				pinfo->rsrc_fb.end - pinfo->rsrc_fb.start + 1,
+ 				"platinumfb framebuffer")) {
+-		release_mem_region(pinfo->rsrc_reg.start,
+-				   pinfo->rsrc_reg.end -
+-				   pinfo->rsrc_reg.start + 1);
++		printk(KERN_ERR "platinumfb: Can't request framebuffer !\n");
+ 		framebuffer_release(info);
+ 		return -ENXIO;
+ 	}
+@@ -600,7 +604,8 @@ static int __devinit platinumfb_probe(struct of_device* odev,
+ 	bank2 = fbuffer[0x200000] == 0x56;
+ 	bank3 = fbuffer[0x300000] == 0x78;
+ 	pinfo->total_vram = (bank0 + bank1 + bank2 + bank3) * 0x100000;
+-	printk(KERN_INFO "platinumfb: Total VRAM = %dMB (%d%d%d%d)\n", (int) (pinfo->total_vram / 1024 / 1024),
++	printk(KERN_INFO "platinumfb: Total VRAM = %dMB (%d%d%d%d)\n",
++	       (unsigned int) (pinfo->total_vram / 1024 / 1024),
+ 	       bank3, bank2, bank1, bank0);
+ 
+ 	/*
+@@ -644,16 +649,15 @@ static int __devexit platinumfb_remove(struct of_device* odev)
+         unregister_framebuffer (info);
+ 	
+ 	/* Unmap frame buffer and registers */
++	iounmap(pinfo->frame_buffer);
++	iounmap(pinfo->platinum_regs);
++	iounmap(pinfo->cmap_regs);
++
+ 	release_mem_region(pinfo->rsrc_fb.start,
+ 			   pinfo->rsrc_fb.end -
+ 			   pinfo->rsrc_fb.start + 1);
+-	release_mem_region(pinfo->rsrc_reg.start,
+-			   pinfo->rsrc_reg.end -
+-			   pinfo->rsrc_reg.start + 1);
+-	iounmap(pinfo->frame_buffer);
+-	iounmap(pinfo->platinum_regs);
++
+ 	release_mem_region(pinfo->cmap_regs_phys, 0x1000);
+-	iounmap(pinfo->cmap_regs);
+ 
+ 	framebuffer_release(info);
+ 
+diff --git a/include/linux/ide.h b/include/linux/ide.h
+index b9f66c1..20528c0 100644
+--- a/include/linux/ide.h
++++ b/include/linux/ide.h
+@@ -1437,4 +1437,11 @@ static inline int hwif_to_node(ide_hwif_t *hwif)
+ 	return dev ? pcibus_to_node(dev->bus) : -1;
+ }
+ 
++static inline ide_drive_t *ide_get_paired_drive(ide_drive_t *drive)
++{
++	ide_hwif_t *hwif	= HWIF(drive);
++
++	return &hwif->drives[(drive->dn ^ 1) & 1];
++}
++
+ #endif /* _IDE_H */
+diff --git a/include/linux/libata.h b/include/linux/libata.h
+index a67bb90..9ccca8f 100644
+--- a/include/linux/libata.h
++++ b/include/linux/libata.h
+@@ -177,6 +177,8 @@ enum {
+ 	ATA_FLAG_IGN_SIMPLEX	= (1 << 15), /* ignore SIMPLEX */
+ 	ATA_FLAG_NO_IORDY	= (1 << 16), /* controller lacks iordy */
+ 	ATA_FLAG_ACPI_SATA	= (1 << 17), /* need native SATA ACPI layout */
++	ATA_FLAG_NO_SRST	= (1 << 18),
++	ATA_FLAG_ASSUME_ATA	= (1 << 19),
+ 
+ 	/* The following flag belongs to ap->pflags but is kept in
+ 	 * ap->flags because it's referenced in many LLDs and will be
+diff --git a/include/linux/usb/quirks.h b/include/linux/usb/quirks.h
+index 8da374c..2692ec9 100644
+--- a/include/linux/usb/quirks.h
++++ b/include/linux/usb/quirks.h
+@@ -4,11 +4,8 @@
+  * belong here.
+  */
+ 
+-/* device must not be autosuspended */
+-#define USB_QUIRK_NO_AUTOSUSPEND	0x00000001
+-
+ /* string descriptors must not be fetched using a 255-byte read */
+-#define USB_QUIRK_STRING_FETCH_255	0x00000002
++#define USB_QUIRK_STRING_FETCH_255	0x00000001
+ 
+ /* device can't resume correctly so reset it instead */
+-#define USB_QUIRK_RESET_RESUME		0x00000004
++#define USB_QUIRK_RESET_RESUME		0x00000002
+diff --git a/sound/core/Makefile b/sound/core/Makefile
+index 5a01c76..05f5cdc 100644
+--- a/sound/core/Makefile
++++ b/sound/core/Makefile
+@@ -14,7 +14,8 @@ endif
+ snd-pcm-objs := pcm.o pcm_native.o pcm_lib.o pcm_timer.o pcm_misc.o \
+ 		pcm_memory.o
+ 
+-snd-page-alloc-objs := memalloc.o sgbuf.o
++snd-page-alloc-y := memalloc.o
++snd-page-alloc-$(CONFIG_HAS_DMA) += sgbuf.o
+ 
+ snd-rawmidi-objs  := rawmidi.o
+ snd-timer-objs    := timer.o
+diff --git a/sound/core/memalloc.c b/sound/core/memalloc.c
+index 9b5656d..6f99b6f 100644
+--- a/sound/core/memalloc.c
++++ b/sound/core/memalloc.c
+@@ -206,6 +206,7 @@ void snd_free_pages(void *ptr, size_t size)
+  *
+  */
+ 
++#ifdef CONFIG_HAS_DMA
+ /* allocate the coherent DMA pages */
+ static void *snd_malloc_dev_pages(struct device *dev, size_t size, dma_addr_t *dma)
+ {
+@@ -239,6 +240,7 @@ static void snd_free_dev_pages(struct device *dev, size_t size, void *ptr,
+ 	dec_snd_pages(pg);
+ 	dma_free_coherent(dev, PAGE_SIZE << pg, ptr, dma);
+ }
++#endif /* CONFIG_HAS_DMA */
+ 
+ #ifdef CONFIG_SBUS
+ 
+@@ -312,12 +314,14 @@ int snd_dma_alloc_pages(int type, struct device *device, size_t size,
+ 		dmab->area = snd_malloc_sbus_pages(device, size, &dmab->addr);
+ 		break;
+ #endif
++#ifdef CONFIG_HAS_DMA
+ 	case SNDRV_DMA_TYPE_DEV:
+ 		dmab->area = snd_malloc_dev_pages(device, size, &dmab->addr);
+ 		break;
+ 	case SNDRV_DMA_TYPE_DEV_SG:
+ 		snd_malloc_sgbuf_pages(device, size, dmab, NULL);
+ 		break;
++#endif
+ 	default:
+ 		printk(KERN_ERR "snd-malloc: invalid device type %d\n", type);
+ 		dmab->area = NULL;
+@@ -383,12 +387,14 @@ void snd_dma_free_pages(struct snd_dma_buffer *dmab)
+ 		snd_free_sbus_pages(dmab->dev.dev, dmab->bytes, dmab->area, dmab->addr);
+ 		break;
+ #endif
++#ifdef CONFIG_HAS_DMA
+ 	case SNDRV_DMA_TYPE_DEV:
+ 		snd_free_dev_pages(dmab->dev.dev, dmab->bytes, dmab->area, dmab->addr);
+ 		break;
+ 	case SNDRV_DMA_TYPE_DEV_SG:
+ 		snd_free_sgbuf_pages(dmab);
+ 		break;
++#endif
+ 	default:
+ 		printk(KERN_ERR "snd-malloc: invalid device type %d\n", dmab->dev.type);
+ 	}
+diff --git a/sound/pci/emu10k1/emumixer.c b/sound/pci/emu10k1/emumixer.c
+index 7b2c1dc..5bff700 100644
+--- a/sound/pci/emu10k1/emumixer.c
++++ b/sound/pci/emu10k1/emumixer.c
+@@ -871,7 +871,7 @@ static struct snd_kcontrol_new snd_emu10k1_spdif_mask_control =
+ 	.access =	SNDRV_CTL_ELEM_ACCESS_READ,
+ 	.iface =        SNDRV_CTL_ELEM_IFACE_PCM,
+ 	.name =         SNDRV_CTL_NAME_IEC958("",PLAYBACK,MASK),
+-	.count =	4,
++	.count =	3,
+ 	.info =         snd_emu10k1_spdif_info,
+ 	.get =          snd_emu10k1_spdif_get_mask
+ };
+@@ -880,7 +880,7 @@ static struct snd_kcontrol_new snd_emu10k1_spdif_control =
+ {
+ 	.iface =	SNDRV_CTL_ELEM_IFACE_PCM,
+ 	.name =         SNDRV_CTL_NAME_IEC958("",PLAYBACK,DEFAULT),
+-	.count =	4,
++	.count =	3,
+ 	.info =         snd_emu10k1_spdif_info,
+ 	.get =          snd_emu10k1_spdif_get,
+ 	.put =          snd_emu10k1_spdif_put
+diff --git a/sound/pci/hda/patch_sigmatel.c b/sound/pci/hda/patch_sigmatel.c
+index 3f25de7..d46e7e4 100644
+--- a/sound/pci/hda/patch_sigmatel.c
++++ b/sound/pci/hda/patch_sigmatel.c
+@@ -162,8 +162,9 @@ static hda_nid_t stac925x_dac_nids[1] = {
+         0x02,
+ };
+ 
+-static hda_nid_t stac925x_dmic_nids[1] = {
+-	0x15, 
++#define STAC925X_NUM_DMICS	1
++static hda_nid_t stac925x_dmic_nids[STAC925X_NUM_DMICS + 1] = {
++	0x15, 0
+ };
+ 
+ static hda_nid_t stac922x_adc_nids[2] = {
+@@ -190,8 +191,9 @@ static hda_nid_t stac9205_mux_nids[2] = {
+         0x19, 0x1a
+ };
+ 
+-static hda_nid_t stac9205_dmic_nids[2] = {
+-        0x17, 0x18,
++#define STAC9205_NUM_DMICS	2
++static hda_nid_t stac9205_dmic_nids[STAC9205_NUM_DMICS + 1] = {
++        0x17, 0x18, 0
+ };
+ 
+ static hda_nid_t stac9200_pin_nids[8] = {
+@@ -1182,7 +1184,8 @@ static int stac92xx_add_dyn_out_pins(struct hda_codec *codec, struct auto_pin_cf
+ 	case 3:
+ 		/* add line-in as side */
+ 		if (cfg->input_pins[AUTO_PIN_LINE] && num_dacs > 3) {
+-			cfg->line_out_pins[3] = cfg->input_pins[AUTO_PIN_LINE];
++			cfg->line_out_pins[cfg->line_outs] =
++				cfg->input_pins[AUTO_PIN_LINE];
+ 			spec->line_switch = 1;
+ 			cfg->line_outs++;
+ 		}
+@@ -1190,12 +1193,14 @@ static int stac92xx_add_dyn_out_pins(struct hda_codec *codec, struct auto_pin_cf
+ 	case 2:
+ 		/* add line-in as clfe and mic as side */
+ 		if (cfg->input_pins[AUTO_PIN_LINE] && num_dacs > 2) {
+-			cfg->line_out_pins[2] = cfg->input_pins[AUTO_PIN_LINE];
++			cfg->line_out_pins[cfg->line_outs] =
++				cfg->input_pins[AUTO_PIN_LINE];
+ 			spec->line_switch = 1;
+ 			cfg->line_outs++;
+ 		}
+ 		if (cfg->input_pins[AUTO_PIN_MIC] && num_dacs > 3) {
+-			cfg->line_out_pins[3] = cfg->input_pins[AUTO_PIN_MIC];
++			cfg->line_out_pins[cfg->line_outs] =
++				cfg->input_pins[AUTO_PIN_MIC];
+ 			spec->mic_switch = 1;
+ 			cfg->line_outs++;
+ 		}
+@@ -1203,12 +1208,14 @@ static int stac92xx_add_dyn_out_pins(struct hda_codec *codec, struct auto_pin_cf
+ 	case 1:
+ 		/* add line-in as surr and mic as clfe */
+ 		if (cfg->input_pins[AUTO_PIN_LINE] && num_dacs > 1) {
+-			cfg->line_out_pins[1] = cfg->input_pins[AUTO_PIN_LINE];
++			cfg->line_out_pins[cfg->line_outs] =
++				cfg->input_pins[AUTO_PIN_LINE];
+ 			spec->line_switch = 1;
+ 			cfg->line_outs++;
+ 		}
+ 		if (cfg->input_pins[AUTO_PIN_MIC] && num_dacs > 2) {
+-			cfg->line_out_pins[2] = cfg->input_pins[AUTO_PIN_MIC];
++			cfg->line_out_pins[cfg->line_outs] =
++				cfg->input_pins[AUTO_PIN_MIC];
+ 			spec->mic_switch = 1;
+ 			cfg->line_outs++;
+ 		}
+@@ -2058,7 +2065,7 @@ static int patch_stac925x(struct hda_codec *codec)
+ 	case 0x83847633: /* STAC9202D */
+ 	case 0x83847636: /* STAC9251  */
+ 	case 0x83847637: /* STAC9251D */
+-		spec->num_dmics = 1;
++		spec->num_dmics = STAC925X_NUM_DMICS;
+ 		spec->dmic_nids = stac925x_dmic_nids;
+ 		break;
+ 	default:
+@@ -2302,7 +2309,7 @@ static int patch_stac9205(struct hda_codec *codec)
+ 	spec->mux_nids = stac9205_mux_nids;
+ 	spec->num_muxes = ARRAY_SIZE(stac9205_mux_nids);
+ 	spec->dmic_nids = stac9205_dmic_nids;
+-	spec->num_dmics = ARRAY_SIZE(stac9205_dmic_nids);
++	spec->num_dmics = STAC9205_NUM_DMICS;
+ 	spec->dmux_nid = 0x1d;
+ 
+ 	spec->init = stac9205_core_init;
+diff --git a/sound/pci/rme9652/hdsp.c b/sound/pci/rme9652/hdsp.c
+index 3b3ef65..75dcb9a 100644
+--- a/sound/pci/rme9652/hdsp.c
++++ b/sound/pci/rme9652/hdsp.c
+@@ -3108,6 +3108,9 @@ static int hdsp_dds_offset(struct hdsp *hdsp)
+ 	unsigned int dds_value = hdsp->dds_value;
+ 	int system_sample_rate = hdsp->system_sample_rate;
+ 
++	if (!dds_value)
++		return 0;
++
+ 	n = DDS_NUMERATOR;
+ 	/*
+ 	 * dds_value = n / rate
+diff --git a/sound/usb/usbmixer.c b/sound/usb/usbmixer.c
+index 325d4b6..19776e7 100644
+--- a/sound/usb/usbmixer.c
++++ b/sound/usb/usbmixer.c
+@@ -1483,7 +1483,7 @@ static int parse_audio_selector_unit(struct mixer_build *state, int unitid, unsi
+ 	struct snd_kcontrol *kctl;
+ 	char **namelist;
+ 
+-	if (! num_ins || desc[0] < 6 + num_ins) {
++	if (! num_ins || desc[0] < 5 + num_ins) {
+ 		snd_printk(KERN_ERR "invalid SELECTOR UNIT descriptor %d\n", unitid);
+ 		return -EINVAL;
+ 	}

Added: dists/sid/linux-2.6/debian/patches/bugfix/all/stable/2.6.23.7.patch
==============================================================================
--- (empty file)
+++ dists/sid/linux-2.6/debian/patches/bugfix/all/stable/2.6.23.7.patch	Mon Nov 26 20:06:56 2007
@@ -0,0 +1,137 @@
+diff --git a/Makefile b/Makefile
+index 798ffe9..c0feac2 100644
+diff --git a/fs/minix/itree_v1.c b/fs/minix/itree_v1.c
+index 1a5f3bf..82d6554 100644
+--- a/fs/minix/itree_v1.c
++++ b/fs/minix/itree_v1.c
+@@ -23,11 +23,16 @@ static inline block_t *i_data(struct inode *inode)
+ static int block_to_path(struct inode * inode, long block, int offsets[DEPTH])
+ {
+ 	int n = 0;
++	char b[BDEVNAME_SIZE];
+ 
+ 	if (block < 0) {
+-		printk("minix_bmap: block<0\n");
++		printk("MINIX-fs: block_to_path: block %ld < 0 on dev %s\n",
++			block, bdevname(inode->i_sb->s_bdev, b));
+ 	} else if (block >= (minix_sb(inode->i_sb)->s_max_size/BLOCK_SIZE)) {
+-		printk("minix_bmap: block>big\n");
++		if (printk_ratelimit())
++			printk("MINIX-fs: block_to_path: "
++			       "block %ld too big on dev %s\n",
++				block, bdevname(inode->i_sb->s_bdev, b));
+ 	} else if (block < 7) {
+ 		offsets[n++] = block;
+ 	} else if ((block -= 7) < 512) {
+diff --git a/fs/minix/itree_v2.c b/fs/minix/itree_v2.c
+index ad8f0de..f230109 100644
+--- a/fs/minix/itree_v2.c
++++ b/fs/minix/itree_v2.c
+@@ -23,12 +23,17 @@ static inline block_t *i_data(struct inode *inode)
+ static int block_to_path(struct inode * inode, long block, int offsets[DEPTH])
+ {
+ 	int n = 0;
++	char b[BDEVNAME_SIZE];
+ 	struct super_block *sb = inode->i_sb;
+ 
+ 	if (block < 0) {
+-		printk("minix_bmap: block<0\n");
++		printk("MINIX-fs: block_to_path: block %ld < 0 on dev %s\n",
++			block, bdevname(sb->s_bdev, b));
+ 	} else if (block >= (minix_sb(inode->i_sb)->s_max_size/sb->s_blocksize)) {
+-		printk("minix_bmap: block>big\n");
++		if (printk_ratelimit())
++			printk("MINIX-fs: block_to_path: "
++			       "block %ld too big on dev %s\n",
++				block, bdevname(sb->s_bdev, b));
+ 	} else if (block < 7) {
+ 		offsets[n++] = block;
+ 	} else if ((block -= 7) < 256) {
+diff --git a/fs/nfs/write.c b/fs/nfs/write.c
+index 0d7a77c..a2a4865 100644
+--- a/fs/nfs/write.c
++++ b/fs/nfs/write.c
+@@ -167,8 +167,6 @@ static void nfs_mark_uptodate(struct page *page, unsigned int base, unsigned int
+ 		return;
+ 	if (count != nfs_page_length(page))
+ 		return;
+-	if (count != PAGE_CACHE_SIZE)
+-		zero_user_page(page, count, PAGE_CACHE_SIZE - count, KM_USER0);
+ 	SetPageUptodate(page);
+ }
+ 
+@@ -643,7 +641,8 @@ static struct nfs_page * nfs_update_request(struct nfs_open_context* ctx,
+ 				return ERR_PTR(error);
+ 			}
+ 			spin_unlock(&inode->i_lock);
+-			return new;
++			req = new;
++			goto zero_page;
+ 		}
+ 		spin_unlock(&inode->i_lock);
+ 
+@@ -671,13 +670,23 @@ static struct nfs_page * nfs_update_request(struct nfs_open_context* ctx,
+ 	if (offset < req->wb_offset) {
+ 		req->wb_offset = offset;
+ 		req->wb_pgbase = offset;
+-		req->wb_bytes = rqend - req->wb_offset;
++		req->wb_bytes = max(end, rqend) - req->wb_offset;
++		goto zero_page;
+ 	}
+ 
+ 	if (end > rqend)
+ 		req->wb_bytes = end - req->wb_offset;
+ 
+ 	return req;
++zero_page:
++	/* If this page might potentially be marked as up to date,
++	 * then we need to zero any uninitalised data. */
++	if (req->wb_pgbase == 0 && req->wb_bytes != PAGE_CACHE_SIZE
++			&& !PageUptodate(req->wb_page))
++		zero_user_page(req->wb_page, req->wb_bytes,
++				PAGE_CACHE_SIZE - req->wb_bytes,
++				KM_USER0);
++	return req;
+ }
+ 
+ int nfs_flush_incompatible(struct file *file, struct page *page)
+diff --git a/fs/ocfs2/aops.c b/fs/ocfs2/aops.c
+index f37f25c..0b5e35f 100644
+--- a/fs/ocfs2/aops.c
++++ b/fs/ocfs2/aops.c
+@@ -661,6 +661,27 @@ static void ocfs2_clear_page_regions(struct page *page,
+ }
+ 
+ /*
++ * Nonsparse file systems fully allocate before we get to the write
++ * code. This prevents ocfs2_write() from tagging the write as an
++ * allocating one, which means ocfs2_map_page_blocks() might try to
++ * read-in the blocks at the tail of our file. Avoid reading them by
++ * testing i_size against each block offset.
++ */
++static int ocfs2_should_read_blk(struct inode *inode, struct page *page,
++				 unsigned int block_start)
++{
++	u64 offset = page_offset(page) + block_start;
++
++	if (ocfs2_sparse_alloc(OCFS2_SB(inode->i_sb)))
++		return 1;
++
++	if (i_size_read(inode) > offset)
++		return 1;
++
++	return 0;
++}
++
++/*
+  * Some of this taken from block_prepare_write(). We already have our
+  * mapping by now though, and the entire write will be allocating or
+  * it won't, so not much need to use BH_New.
+@@ -713,6 +734,7 @@ int ocfs2_map_page_blocks(struct page *page, u64 *p_blkno,
+ 				set_buffer_uptodate(bh);
+ 		} else if (!buffer_uptodate(bh) && !buffer_delay(bh) &&
+ 			   !buffer_new(bh) &&
++			   ocfs2_should_read_blk(inode, page, block_start) &&
+ 			   (block_start < from || block_end > to)) {
+ 			ll_rw_block(READ, 1, &bh);
+ 			*wait_bh++=bh;

Added: dists/sid/linux-2.6/debian/patches/bugfix/all/stable/2.6.23.8.patch
==============================================================================
--- (empty file)
+++ dists/sid/linux-2.6/debian/patches/bugfix/all/stable/2.6.23.8.patch	Mon Nov 26 20:06:56 2007
@@ -0,0 +1,39 @@
+diff --git a/Makefile b/Makefile
+index c0feac2..435a3d7 100644
+diff --git a/kernel/exit.c b/kernel/exit.c
+index 993369e..096c27d 100644
+--- a/kernel/exit.c
++++ b/kernel/exit.c
+@@ -1362,8 +1362,7 @@ static int wait_task_stopped(struct task_struct *p, int delayed_group_leader,
+ 		int why = (p->ptrace & PT_PTRACED) ? CLD_TRAPPED : CLD_STOPPED;
+ 
+ 		exit_code = p->exit_code;
+-		if (unlikely(!exit_code) ||
+-		    unlikely(p->state & TASK_TRACED))
++		if (unlikely(!exit_code) || unlikely(p->exit_state))
+ 			goto bail_ref;
+ 		return wait_noreap_copyout(p, pid, uid,
+ 					   why, (exit_code << 8) | 0x7f,
+diff --git a/net/ipv4/tcp_input.c b/net/ipv4/tcp_input.c
+index f893e90..c9298a7 100644
+--- a/net/ipv4/tcp_input.c
++++ b/net/ipv4/tcp_input.c
+@@ -1012,6 +1012,9 @@ tcp_sacktag_write_queue(struct sock *sk, struct sk_buff *ack_skb, u32 prior_snd_
+ 	if (before(TCP_SKB_CB(ack_skb)->ack_seq, prior_snd_una - tp->max_window))
+ 		return 0;
+ 
++	if (!tp->packets_out)
++		goto out;
++
+ 	/* SACK fastpath:
+ 	 * if the only SACK change is the increase of the end_seq of
+ 	 * the first block then only apply that SACK block
+@@ -1280,6 +1283,8 @@ tcp_sacktag_write_queue(struct sock *sk, struct sk_buff *ack_skb, u32 prior_snd_
+ 	    (!tp->frto_highmark || after(tp->snd_una, tp->frto_highmark)))
+ 		tcp_update_reordering(sk, ((tp->fackets_out + 1) - reord), 0);
+ 
++out:
++
+ #if FASTRETRANS_DEBUG > 0
+ 	BUG_TRAP((int)tp->sacked_out >= 0);
+ 	BUG_TRAP((int)tp->lost_out >= 0);

Added: dists/sid/linux-2.6/debian/patches/bugfix/alpha/asm-subarchs.patch
==============================================================================
--- (empty file)
+++ dists/sid/linux-2.6/debian/patches/bugfix/alpha/asm-subarchs.patch	Mon Nov 26 20:06:56 2007
@@ -0,0 +1,40 @@
+--- source/include/asm-alpha/compiler.h.orig	2006-09-19 20:42:06.000000000 -0700
++++ source/include/asm-alpha/compiler.h	2006-11-06 17:10:00.000000000 -0800
+@@ -78,16 +78,20 @@
+ #else
+ #define __kernel_ldbu(mem)				\
+   ({ unsigned char __kir;				\
+-     __asm__("ldbu %0,%1" : "=r"(__kir) : "m"(mem));	\
++     __asm__(".arch ev56;				\
++             ldbu %0,%1" : "=r"(__kir) : "m"(mem));	\
+      __kir; })
+ #define __kernel_ldwu(mem)				\
+   ({ unsigned short __kir;				\
+-     __asm__("ldwu %0,%1" : "=r"(__kir) : "m"(mem));	\
++     __asm__(".arch ev56;				\
++             ldwu %0,%1" : "=r"(__kir) : "m"(mem));	\
+      __kir; })
+-#define __kernel_stb(val,mem) \
+-  __asm__("stb %1,%0" : "=m"(mem) : "r"(val))
+-#define __kernel_stw(val,mem) \
+-  __asm__("stw %1,%0" : "=m"(mem) : "r"(val))
++#define __kernel_stb(val,mem)				\
++  __asm__(".arch ev56;					\
++          stb %1,%0" : "=m"(mem) : "r"(val))
++#define __kernel_stw(val,mem)				\
++  __asm__(".arch ev56;					\
++          stw %1,%0" : "=m"(mem) : "r"(val))
+ #endif
+ 
+ #ifdef __KERNEL__
+--- source/arch/alpha/kernel/sys_titan.c.orig	2006-11-06 23:17:50.000000000 -0800
++++ source/arch/alpha/kernel/sys_titan.c	2006-11-06 23:17:04.000000000 -0800
+@@ -257,7 +257,7 @@
+ 	 */
+ 	while (mask) {
+ 		/* convert to SRM vector... priority is <63> -> <0> */
+-		__asm__("ctlz %1, %0" : "=r"(vector) : "r"(mask));
++		__asm__(".arch ev6; ctlz %1, %0" : "=r"(vector) : "r"(mask));
+ 		vector = 63 - vector;
+ 		mask &= ~(1UL << vector);	/* clear it out 	 */
+ 		vector = 0x900 + (vector << 4);	/* convert to SRM vector */

Added: dists/sid/linux-2.6/debian/patches/bugfix/alpha/srm-env-fixes.patch
==============================================================================
--- (empty file)
+++ dists/sid/linux-2.6/debian/patches/bugfix/alpha/srm-env-fixes.patch	Mon Nov 26 20:06:56 2007
@@ -0,0 +1,273 @@
+Hi Linus!
+
+Please pull from
+git://git.kernel.org/pub/scm/linux/kernel/git/jbglaw/vax-linux.git ,
+branch `upstream-linus'. Despite the repo's name, it contains a fix
+for the srm_env driver on Alpha:
+
+ arch/alpha/kernel/srm_env.c |   84 ++++++++++++++-----------------------------
+ 1 files changed, 27 insertions(+), 57 deletions(-)
+
+commit 16b7f4dcd340875625714438a812ea06400f9666
+Author: Jan-Benedict Glaw <jbglaw at lug-owl.de>
+Date:   Tue Nov 7 23:50:37 2006 +0100
+
+    Update for the srm_env driver.
+    
+    This patch contains a fix for a bug introduced more than a year ago
+    (not setting *eof) and updates whitespace a bit.
+    
+    Signed-off-by: Jan-Benedict Glaw <jbglaw at lug-owl.de>
+
+
+
+--- a/arch/alpha/kernel/srm_env.c
++++ b/arch/alpha/kernel/srm_env.c
+@@ -2,7 +2,7 @@
+  * srm_env.c - Access to SRM environment
+  *             variables through linux' procfs
+  *
+- * Copyright (C) 2001-2002 Jan-Benedict Glaw <jbglaw at lug-owl.de>
++ * (C) 2001,2002,2006 by Jan-Benedict Glaw <jbglaw at lug-owl.de>
+  *
+  * This driver is at all a modified version of Erik Mouw's
+  * Documentation/DocBook/procfs_example.c, so: thank
+@@ -21,7 +21,7 @@
+  * 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,
+@@ -29,33 +29,6 @@
+  *
+  */
+ 
+-/*
+- * Changelog
+- * ~~~~~~~~~
+- *
+- * Thu, 22 Aug 2002 15:10:43 +0200
+- * 	- Update Config.help entry. I got a number of emails asking
+- * 	  me to tell their senders if they could make use of this
+- * 	  piece of code... So: "SRM is something like BIOS for your
+- * 	  Alpha"
+- * 	- Update code formatting a bit to better conform CodingStyle
+- * 	  rules.
+- * 	- So this is v0.0.5, with no changes (except formatting)
+- * 	
+- * Wed, 22 May 2002 00:11:21 +0200
+- * 	- Fix typo on comment (SRC -> SRM)
+- * 	- Call this "Version 0.0.4"
+- *
+- * Tue,  9 Apr 2002 18:44:40 +0200
+- * 	- Implement access by variable name and additionally
+- * 	  by number. This is done by creating two subdirectories
+- * 	  where one holds all names (like the old directory
+- * 	  did) and the other holding 256 files named like "0",
+- * 	  "1" and so on.
+- * 	- Call this "Version 0.0.3"
+- *
+- */
+-
+ #include <linux/kernel.h>
+ #include <linux/module.h>
+ #include <linux/init.h>
+@@ -67,7 +40,7 @@ #include <asm/machvec.h>
+ #define BASE_DIR	"srm_environment"	/* Subdir in /proc/		*/
+ #define NAMED_DIR	"named_variables"	/* Subdir for known variables	*/
+ #define NUMBERED_DIR	"numbered_variables"	/* Subdir for all variables	*/
+-#define VERSION		"0.0.5"			/* Module version		*/
++#define VERSION		"0.0.6"			/* Module version		*/
+ #define NAME		"srm_env"		/* Module name			*/
+ 
+ MODULE_AUTHOR("Jan-Benedict Glaw <jbglaw at lug-owl.de>");
+@@ -106,7 +79,6 @@ static srm_env_t	srm_named_entries[] = {
+ static srm_env_t	srm_numbered_entries[256];
+ 
+ 
+-
+ static int
+ srm_env_read(char *page, char **start, off_t off, int count, int *eof,
+ 		void *data)
+@@ -115,21 +87,23 @@ srm_env_read(char *page, char **start, o
+ 	unsigned long	ret;
+ 	srm_env_t	*entry;
+ 
+-	if(off != 0)
+-		return -EFAULT;
++	if (off != 0) {
++		*eof = 1;
++		return 0;
++	}
+ 
+ 	entry	= (srm_env_t *) data;
+ 	ret	= callback_getenv(entry->id, page, count);
+ 
+-	if((ret >> 61) == 0)
++	if ((ret >> 61) == 0) {
+ 		nbytes = (int) ret;
+-	else
++		*eof = 1;
++	} else
+ 		nbytes = -EFAULT;
+ 
+ 	return nbytes;
+ }
+ 
+-
+ static int
+ srm_env_write(struct file *file, const char __user *buffer, unsigned long count,
+ 		void *data)
+@@ -155,7 +129,7 @@ srm_env_write(struct file *file, const c
+ 
+ 	ret1 = callback_setenv(entry->id, buf, count);
+ 	if ((ret1 >> 61) == 0) {
+-		do 
++		do
+ 			ret2 = callback_save_env();
+ 		while((ret2 >> 61) == 1);
+ 		res = (int) ret1;
+@@ -172,14 +146,14 @@ srm_env_cleanup(void)
+ 	srm_env_t	*entry;
+ 	unsigned long	var_num;
+ 
+-	if(base_dir) {
++	if (base_dir) {
+ 		/*
+ 		 * Remove named entries
+ 		 */
+-		if(named_dir) {
++		if (named_dir) {
+ 			entry = srm_named_entries;
+-			while(entry->name != NULL && entry->id != 0) {
+-				if(entry->proc_entry) {
++			while (entry->name != NULL && entry->id != 0) {
++				if (entry->proc_entry) {
+ 					remove_proc_entry(entry->name,
+ 							named_dir);
+ 					entry->proc_entry = NULL;
+@@ -192,11 +166,11 @@ srm_env_cleanup(void)
+ 		/*
+ 		 * Remove numbered entries
+ 		 */
+-		if(numbered_dir) {
+-			for(var_num = 0; var_num <= 255; var_num++) {
++		if (numbered_dir) {
++			for (var_num = 0; var_num <= 255; var_num++) {
+ 				entry =	&srm_numbered_entries[var_num];
+ 
+-				if(entry->proc_entry) {
++				if (entry->proc_entry) {
+ 					remove_proc_entry(entry->name,
+ 							numbered_dir);
+ 					entry->proc_entry	= NULL;
+@@ -212,7 +186,6 @@ srm_env_cleanup(void)
+ 	return;
+ }
+ 
+-
+ static int __init
+ srm_env_init(void)
+ {
+@@ -222,7 +195,7 @@ srm_env_init(void)
+ 	/*
+ 	 * Check system
+ 	 */
+-	if(!alpha_using_srm) {
++	if (!alpha_using_srm) {
+ 		printk(KERN_INFO "%s: This Alpha system doesn't "
+ 				"know about SRM (or you've booted "
+ 				"SRM->MILO->Linux, which gets "
+@@ -233,14 +206,14 @@ srm_env_init(void)
+ 	/*
+ 	 * Init numbers
+ 	 */
+-	for(var_num = 0; var_num <= 255; var_num++)
++	for (var_num = 0; var_num <= 255; var_num++)
+ 		sprintf(number[var_num], "%ld", var_num);
+ 
+ 	/*
+ 	 * Create base directory
+ 	 */
+ 	base_dir = proc_mkdir(BASE_DIR, NULL);
+-	if(base_dir == NULL) {
++	if (!base_dir) {
+ 		printk(KERN_ERR "Couldn't create base dir /proc/%s\n",
+ 				BASE_DIR);
+ 		goto cleanup;
+@@ -251,7 +224,7 @@ srm_env_init(void)
+ 	 * Create per-name subdirectory
+ 	 */
+ 	named_dir = proc_mkdir(NAMED_DIR, base_dir);
+-	if(named_dir == NULL) {
++	if (!named_dir) {
+ 		printk(KERN_ERR "Couldn't create dir /proc/%s/%s\n",
+ 				BASE_DIR, NAMED_DIR);
+ 		goto cleanup;
+@@ -262,7 +235,7 @@ srm_env_init(void)
+ 	 * Create per-number subdirectory
+ 	 */
+ 	numbered_dir = proc_mkdir(NUMBERED_DIR, base_dir);
+-	if(numbered_dir == NULL) {
++	if (!numbered_dir) {
+ 		printk(KERN_ERR "Couldn't create dir /proc/%s/%s\n",
+ 				BASE_DIR, NUMBERED_DIR);
+ 		goto cleanup;
+@@ -274,10 +247,10 @@ srm_env_init(void)
+ 	 * Create all named nodes
+ 	 */
+ 	entry = srm_named_entries;
+-	while(entry->name != NULL && entry->id != 0) {
++	while (entry->name && entry->id) {
+ 		entry->proc_entry = create_proc_entry(entry->name,
+ 				0644, named_dir);
+-		if(entry->proc_entry == NULL)
++		if (!entry->proc_entry)
+ 			goto cleanup;
+ 
+ 		entry->proc_entry->data		= (void *) entry;
+@@ -291,13 +264,13 @@ srm_env_init(void)
+ 	/*
+ 	 * Create all numbered nodes
+ 	 */
+-	for(var_num = 0; var_num <= 255; var_num++) {
++	for (var_num = 0; var_num <= 255; var_num++) {
+ 		entry = &srm_numbered_entries[var_num];
+ 		entry->name = number[var_num];
+ 
+ 		entry->proc_entry = create_proc_entry(entry->name,
+ 				0644, numbered_dir);
+-		if(entry->proc_entry == NULL)
++		if (!entry->proc_entry)
+ 			goto cleanup;
+ 
+ 		entry->id			= var_num;
+@@ -318,7 +291,6 @@ cleanup:
+ 	return -ENOMEM;
+ }
+ 
+-
+ static void __exit
+ srm_env_exit(void)
+ {
+@@ -328,7 +300,5 @@ srm_env_exit(void)
+ 	return;
+ }
+ 
+-
+ module_init(srm_env_init);
+ module_exit(srm_env_exit);
+-
+-- 
+      Jan-Benedict Glaw      jbglaw at lug-owl.de              +49-172-7608481
+Signature of:                 Gib Dein Bestes. Dann übertriff Dich selbst!
+the second  :
+
+
+-- 
+      Jan-Benedict Glaw      jbglaw at lug-owl.de              +49-172-7608481
+Signature of:               http://www.eyrie.org/~eagle/faqs/questions.html
+the second  :

Added: dists/sid/linux-2.6/debian/patches/bugfix/arm/binutils-notes.patch
==============================================================================
--- (empty file)
+++ dists/sid/linux-2.6/debian/patches/bugfix/arm/binutils-notes.patch	Mon Nov 26 20:06:56 2007
@@ -0,0 +1,19 @@
+Needed otherwise you get a 3 GB kernel file
+
+From: Lennert Buytenhek <buytenh at wantstofly.org>
+Subject: Re: What's queued for 2.6.24
+Date: Wed, 3 Oct 2007 16:12:06 +0200
+
+diff -ur linux-2.6.23-rc4.orig/arch/arm/Makefile linux-2.6.23-rc4/arch/arm/Makefile
+--- linux-2.6.23-rc4.orig/arch/arm/Makefile	2007-08-28 11:07:38.000000000 +0200
++++ linux-2.6.23-rc4/arch/arm/Makefile	2007-10-03 16:09:12.000000000 +0200
+@@ -12,7 +12,7 @@
+ 
+ LDFLAGS_vmlinux	:=-p --no-undefined -X
+ CPPFLAGS_vmlinux.lds = -DTEXT_OFFSET=$(TEXT_OFFSET)
+-OBJCOPYFLAGS	:=-O binary -R .note -R .comment -S
++OBJCOPYFLAGS	:=-O binary -R .note -R .note.gnu.build-id -R .comment -S
+ GZFLAGS		:=-9
+ #CFLAGS		+=-pipe
+ # Explicitly specifiy 32-bit ARM ISA since toolchain default can be -mthumb:
+

Added: dists/sid/linux-2.6/debian/patches/bugfix/arm/disable-bcm43xx.patch
==============================================================================
--- (empty file)
+++ dists/sid/linux-2.6/debian/patches/bugfix/arm/disable-bcm43xx.patch	Mon Nov 26 20:06:56 2007
@@ -0,0 +1,10 @@
+--- a/drivers/net/wireless/bcm43xx/Kconfig	2007-09-27 12:50:43.000000000 +0000
++++ b/drivers/net/wireless/bcm43xx/Kconfig	2007-09-27 12:51:08.000000000 +0000
+@@ -1,6 +1,6 @@
+ config BCM43XX
+ 	tristate "Broadcom BCM43xx wireless support"
+-	depends on PCI && IEEE80211 && IEEE80211_SOFTMAC && WLAN_80211 && EXPERIMENTAL
++	depends on PCI && IEEE80211 && IEEE80211_SOFTMAC && WLAN_80211 && EXPERIMENTAL && (!ARM || BROKEN)
+ 	select WIRELESS_EXT
+ 	select FW_LOADER
+ 	select HW_RANDOM

Added: dists/sid/linux-2.6/debian/patches/bugfix/arm/disable-chelsio_t3.patch
==============================================================================
--- (empty file)
+++ dists/sid/linux-2.6/debian/patches/bugfix/arm/disable-chelsio_t3.patch	Mon Nov 26 20:06:56 2007
@@ -0,0 +1,13 @@
+diff --git a/drivers/net/Kconfig b/drivers/net/Kconfig
+index 81ef81c..c53c9b6 100644
+--- a/drivers/net/Kconfig
++++ b/drivers/net/Kconfig
+@@ -2379,7 +2379,7 @@ config CHELSIO_T1_NAPI
+ 
+ config CHELSIO_T3
+ 	tristate "Chelsio Communications T3 10Gb Ethernet support"
+-	depends on PCI
++	depends on PCI && (!ARM || BROKEN)
+ 	select FW_LOADER
+ 	help
+ 	  This driver supports Chelsio T3-based gigabit and 10Gb Ethernet

Added: dists/sid/linux-2.6/debian/patches/bugfix/arm/disable-dvb_b2c2_flexcop.patch
==============================================================================
--- (empty file)
+++ dists/sid/linux-2.6/debian/patches/bugfix/arm/disable-dvb_b2c2_flexcop.patch	Mon Nov 26 20:06:56 2007
@@ -0,0 +1,12 @@
+diff --git a/drivers/media/dvb/b2c2/Kconfig b/drivers/media/dvb/b2c2/Kconfig
+index 3197aeb..36b1524 100644
+--- a/drivers/media/dvb/b2c2/Kconfig
++++ b/drivers/media/dvb/b2c2/Kconfig
+@@ -1,6 +1,6 @@
+ config DVB_B2C2_FLEXCOP
+ 	tristate "Technisat/B2C2 FlexCopII(b) and FlexCopIII adapters"
+-	depends on DVB_CORE && I2C
++	depends on DVB_CORE && I2C && (!ARM || BROKEN)
+ 	select DVB_PLL if !DVB_FE_CUSTOMISE
+ 	select DVB_STV0299 if !DVB_FE_CUSTOMISE
+ 	select DVB_MT352 if !DVB_FE_CUSTOMISE

Added: dists/sid/linux-2.6/debian/patches/bugfix/arm/disable-dvb_budget.patch
==============================================================================
--- (empty file)
+++ dists/sid/linux-2.6/debian/patches/bugfix/arm/disable-dvb_budget.patch	Mon Nov 26 20:06:56 2007
@@ -0,0 +1,13 @@
+diff --git a/drivers/media/dvb/ttpci/Kconfig b/drivers/media/dvb/ttpci/Kconfig
+index 6d53289..5f0428a 100644
+--- a/drivers/media/dvb/ttpci/Kconfig
++++ b/drivers/media/dvb/ttpci/Kconfig
+@@ -59,7 +59,7 @@ config DVB_AV7110_OSD
+ 
+ config DVB_BUDGET
+ 	tristate "Budget cards"
+-	depends on DVB_CORE && PCI && I2C && VIDEO_V4L1
++	depends on DVB_CORE && PCI && I2C && VIDEO_V4L1 && (!ARM || BROKEN)
+ 	select VIDEO_SAA7146
+ 	select DVB_STV0299 if !DVB_FE_CUSTOMISE
+ 	select DVB_VES1X93 if !DVB_FE_CUSTOMISE

Added: dists/sid/linux-2.6/debian/patches/bugfix/arm/disable-netxen_nic.patch
==============================================================================
--- (empty file)
+++ dists/sid/linux-2.6/debian/patches/bugfix/arm/disable-netxen_nic.patch	Mon Nov 26 20:06:56 2007
@@ -0,0 +1,13 @@
+diff --git a/drivers/net/Kconfig b/drivers/net/Kconfig
+index c53c9b6..1ed5527 100644
+--- a/drivers/net/Kconfig
++++ b/drivers/net/Kconfig
+@@ -2488,7 +2488,7 @@ config MYRI10GE
+ 
+ config NETXEN_NIC
+ 	tristate "NetXen Multi port (1/10) Gigabit Ethernet NIC"
+-	depends on PCI && (!SPARC32 || BROKEN)
++	depends on PCI && (!SPARC32 || BROKEN) && (!ARM || BROKEN)
+ 	help
+ 	  This enables the support for NetXen's Gigabit Ethernet card.
+ 

Added: dists/sid/linux-2.6/debian/patches/bugfix/arm/disable-scsi_acard.patch
==============================================================================
--- (empty file)
+++ dists/sid/linux-2.6/debian/patches/bugfix/arm/disable-scsi_acard.patch	Mon Nov 26 20:06:56 2007
@@ -0,0 +1,13 @@
+diff --git a/drivers/scsi/Kconfig b/drivers/scsi/Kconfig
+index 6f2c71e..3fce8f4 100644
+--- a/drivers/scsi/Kconfig
++++ b/drivers/scsi/Kconfig
+@@ -378,7 +378,7 @@ config SCSI_7000FASST
+ 
+ config SCSI_ACARD
+ 	tristate "ACARD SCSI support"
+-	depends on PCI && SCSI
++	depends on PCI && SCSI && (!ARM || BROKEN)
+ 	help
+ 	  This driver supports the ACARD SCSI host adapter.
+ 	  Support Chip <ATP870 ATP876 ATP880 ATP885>

Added: dists/sid/linux-2.6/debian/patches/bugfix/arm/disable-video_bt848.patch
==============================================================================
--- (empty file)
+++ dists/sid/linux-2.6/debian/patches/bugfix/arm/disable-video_bt848.patch	Mon Nov 26 20:06:56 2007
@@ -0,0 +1,12 @@
+diff --git a/drivers/media/video/bt8xx/Kconfig b/drivers/media/video/bt8xx/Kconfig
+index 58eae88..21558f9 100644
+--- a/drivers/media/video/bt8xx/Kconfig
++++ b/drivers/media/video/bt8xx/Kconfig
+@@ -1,6 +1,6 @@
+ config VIDEO_BT848
+ 	tristate "BT848 Video For Linux"
+-	depends on VIDEO_DEV && PCI && I2C && VIDEO_V4L1
++	depends on VIDEO_DEV && PCI && I2C && VIDEO_V4L1 && (!ARM || BROKEN)
+ 	select I2C_ALGOBIT
+ 	select FW_LOADER
+ 	select VIDEO_BTCX

Added: dists/sid/linux-2.6/debian/patches/bugfix/fdomain-pci-id-table.patch
==============================================================================
--- (empty file)
+++ dists/sid/linux-2.6/debian/patches/bugfix/fdomain-pci-id-table.patch	Mon Nov 26 20:06:56 2007
@@ -0,0 +1,31 @@
+From: Ben Collins <bcollins at ubuntu.com>
+Date: Fri, 11 Nov 2005 20:01:26 +0000 (-0500)
+Subject: [UBUNTU:scsi] Add basic hotplug support to fdomain
+X-Git-Tag: v2.6.15-rc1
+X-Git-Url: http://kernel.org/git/?p=linux/kernel/git/bcollins/ubuntu-2.6.git;a=commitdiff;h=e82633eb19c4b390846a6eecd72204b696448954
+
+[UBUNTU:scsi] Add basic hotplug support to some drivers
+
+UpstreamStatus: Unsubmitted
+
+Signed-off-by: Ben Collins <bcollins at ubuntu.com>
+---
+
+--- a/drivers/scsi/fdomain.c
++++ b/drivers/scsi/fdomain.c
+@@ -1720,6 +1720,15 @@ static int fdomain_16x0_release(struct S
+ 	return 0;
+ }
+ 
++#ifndef PCMCIA
++static struct pci_device_id fdomain_pci_tbl[] __devinitdata = {
++	{ PCI_VENDOR_ID_FD, PCI_DEVICE_ID_FD_36C70,
++	  PCI_ANY_ID, PCI_ANY_ID, 0, 0, 0UL },
++	{ }
++};
++MODULE_DEVICE_TABLE(pci, fdomain_pci_tbl);
++#endif
++
+ struct scsi_host_template fdomain_driver_template = {
+ 	.module			= THIS_MODULE,
+ 	.name			= "fdomain",

Added: dists/sid/linux-2.6/debian/patches/bugfix/mips/bcm1480-pci-build-fix.patch
==============================================================================
--- (empty file)
+++ dists/sid/linux-2.6/debian/patches/bugfix/mips/bcm1480-pci-build-fix.patch	Mon Nov 26 20:06:56 2007
@@ -0,0 +1,37 @@
+The appended patch restores building the bcm1480 kernel. The brokenness
+noted there is apparently not immediately fatal, as the resulting kernel
+successfully drives a SATA RAID on PCI-X.
+
+Presumably the sb1250 pcibios_map_irq is broken in the same way. 
+
+
+Thiemo
+
+
+Signed-Off-By: Thiemo Seufer <ths at networkno.de>
+
+diff --git a/arch/mips/pci/pci-bcm1480.c b/arch/mips/pci/pci-bcm1480.c
+index 2b4e30c..0193aad 100644
+--- a/arch/mips/pci/pci-bcm1480.c
++++ b/arch/mips/pci/pci-bcm1480.c
+@@ -76,7 +76,7 @@ static inline void WRITECFG32(u32 addr, u32 data)
+ 
+ int pcibios_map_irq(const struct pci_dev *dev, u8 slot, u8 pin)
+ {
+-	This is b0rked.
++	/* XXX: This is b0rked. */
+ 	return dev->irq;
+ }
+ 
+diff --git a/arch/mips/pci/pci-sb1250.c b/arch/mips/pci/pci-sb1250.c
+index c1ac649..7af499e 100644
+--- a/arch/mips/pci/pci-sb1250.c
++++ b/arch/mips/pci/pci-sb1250.c
+@@ -86,6 +86,7 @@ static inline void WRITECFG32(u32 addr, u32 data)
+ 
+ int pcibios_map_irq(const struct pci_dev *dev, u8 slot, u8 pin)
+ {
++	/* XXX: This is b0rked. */
+ 	return dev->irq;
+ }
+ 

Added: dists/sid/linux-2.6/debian/patches/bugfix/mips/ip22-fix-eisa-interrupt-setup.patch
==============================================================================
--- (empty file)
+++ dists/sid/linux-2.6/debian/patches/bugfix/mips/ip22-fix-eisa-interrupt-setup.patch	Mon Nov 26 20:06:56 2007
@@ -0,0 +1,192 @@
+
+Signed-off-by: Thomas Bogendoerfer <tsbogend at alpha.franken.de>
+---
+ arch/mips/Kconfig              |    1 +
+ arch/mips/sgi-ip22/ip22-eisa.c |  134 +---------------------------------------
+ 2 files changed, 3 insertions(+), 132 deletions(-)
+
+diff --git a/arch/mips/Kconfig b/arch/mips/Kconfig
+index 2f2ce0c..84059da 100644
+--- a/arch/mips/Kconfig
++++ b/arch/mips/Kconfig
+@@ -328,6 +328,7 @@
+ 	select BOOT_ELF32
+ 	select DMA_NONCOHERENT
+ 	select HW_HAS_EISA
++	select I8259
+ 	select IP22_CPU_SCACHE
+ 	select IRQ_CPU
+ 	select GENERIC_ISA_DMA_SUPPORT_BROKEN
+diff --git a/arch/mips/sgi-ip22/ip22-eisa.c b/arch/mips/sgi-ip22/ip22-eisa.c
+index 26854fb..1617241 100644
+--- a/arch/mips/sgi-ip22/ip22-eisa.c
++++ b/arch/mips/sgi-ip22/ip22-eisa.c
+@@ -36,6 +36,7 @@
+ #include <asm/sgi/ioc.h>
+ #include <asm/sgi/mc.h>
+ #include <asm/sgi/ip22.h>
++#include <asm/i8259.h>
+ 
+ /* I2 has four EISA slots. */
+ #define IP22_EISA_MAX_SLOTS	  4
+@@ -93,126 +94,11 @@ static irqreturn_t ip22_eisa_intr(int irq, void *dev_id)
+ 	return IRQ_NONE;
+ }
+ 
+-static void enable_eisa1_irq(unsigned int irq)
+-{
+-	u8 mask;
+-
+-	mask = inb(EISA_INT1_MASK);
+-	mask &= ~((u8) (1 << irq));
+-	outb(mask, EISA_INT1_MASK);
+-}
+-
+-static unsigned int startup_eisa1_irq(unsigned int irq)
+-{
+-	u8 edge;
+-
+-	/* Only use edge interrupts for EISA */
+-
+-	edge = inb(EISA_INT1_EDGE_LEVEL);
+-	edge &= ~((u8) (1 << irq));
+-	outb(edge, EISA_INT1_EDGE_LEVEL);
+-
+-	enable_eisa1_irq(irq);
+-	return 0;
+-}
+-
+-static void disable_eisa1_irq(unsigned int irq)
+-{
+-	u8 mask;
+-
+-	mask = inb(EISA_INT1_MASK);
+-	mask |= ((u8) (1 << irq));
+-	outb(mask, EISA_INT1_MASK);
+-}
+-
+-static void mask_and_ack_eisa1_irq(unsigned int irq)
+-{
+-	disable_eisa1_irq(irq);
+-
+-	outb(0x20, EISA_INT1_CTRL);
+-}
+-
+-static void end_eisa1_irq(unsigned int irq)
+-{
+-	if (!(irq_desc[irq].status & (IRQ_DISABLED | IRQ_INPROGRESS)))
+-		enable_eisa1_irq(irq);
+-}
+-
+-static struct irq_chip ip22_eisa1_irq_type = {
+-	.name		= "IP22 EISA",
+-	.startup	= startup_eisa1_irq,
+-	.ack		= mask_and_ack_eisa1_irq,
+-	.mask		= disable_eisa1_irq,
+-	.mask_ack	= mask_and_ack_eisa1_irq,
+-	.unmask		= enable_eisa1_irq,
+-	.end		= end_eisa1_irq,
+-};
+-
+-static void enable_eisa2_irq(unsigned int irq)
+-{
+-	u8 mask;
+-
+-	mask = inb(EISA_INT2_MASK);
+-	mask &= ~((u8) (1 << (irq - 8)));
+-	outb(mask, EISA_INT2_MASK);
+-}
+-
+-static unsigned int startup_eisa2_irq(unsigned int irq)
+-{
+-	u8 edge;
+-
+-	/* Only use edge interrupts for EISA */
+-
+-	edge = inb(EISA_INT2_EDGE_LEVEL);
+-	edge &= ~((u8) (1 << (irq - 8)));
+-	outb(edge, EISA_INT2_EDGE_LEVEL);
+-
+-	enable_eisa2_irq(irq);
+-	return 0;
+-}
+-
+-static void disable_eisa2_irq(unsigned int irq)
+-{
+-	u8 mask;
+-
+-	mask = inb(EISA_INT2_MASK);
+-	mask |= ((u8) (1 << (irq - 8)));
+-	outb(mask, EISA_INT2_MASK);
+-}
+-
+-static void mask_and_ack_eisa2_irq(unsigned int irq)
+-{
+-	disable_eisa2_irq(irq);
+-
+-	outb(0x20, EISA_INT2_CTRL);
+-}
+-
+-static void end_eisa2_irq(unsigned int irq)
+-{
+-	if (!(irq_desc[irq].status & (IRQ_DISABLED | IRQ_INPROGRESS)))
+-		enable_eisa2_irq(irq);
+-}
+-
+-static struct irq_chip ip22_eisa2_irq_type = {
+-	.name		= "IP22 EISA",
+-	.startup	= startup_eisa2_irq,
+-	.ack		= mask_and_ack_eisa2_irq,
+-	.mask		= disable_eisa2_irq,
+-	.mask_ack	= mask_and_ack_eisa2_irq,
+-	.unmask		= enable_eisa2_irq,
+-	.end		= end_eisa2_irq,
+-};
+-
+ static struct irqaction eisa_action = {
+ 	.handler	= ip22_eisa_intr,
+ 	.name		= "EISA",
+ };
+ 
+-static struct irqaction cascade_action = {
+-	.handler	= no_action,
+-	.name		= "EISA cascade",
+-};
+-
+ int __init ip22_eisa_init(void)
+ {
+ 	int i, c;
+@@ -248,29 +134,13 @@ int __init ip22_eisa_init(void)
+ 	outb(1, EISA_EXT_NMI_RESET_CTRL);
+ 	udelay(50);	/* Wait long enough for the dust to settle */
+ 	outb(0, EISA_EXT_NMI_RESET_CTRL);
+-	outb(0x11, EISA_INT1_CTRL);
+-	outb(0x11, EISA_INT2_CTRL);
+-	outb(0, EISA_INT1_MASK);
+-	outb(8, EISA_INT2_MASK);
+-	outb(4, EISA_INT1_MASK);
+-	outb(2, EISA_INT2_MASK);
+-	outb(1, EISA_INT1_MASK);
+-	outb(1, EISA_INT2_MASK);
+-	outb(0xfb, EISA_INT1_MASK);
+-	outb(0xff, EISA_INT2_MASK);
+ 	outb(0, EISA_DMA2_WRITE_SINGLE);
+ 
+-	for (i = SGINT_EISA; i < (SGINT_EISA + EISA_MAX_IRQ); i++) {
+-		if (i < (SGINT_EISA + 8))
+-			set_irq_chip(i, &ip22_eisa1_irq_type);
+-		else
+-			set_irq_chip(i, &ip22_eisa2_irq_type);
+-	}
++	init_i8259_irqs();
+ 
+ 	/* Cannot use request_irq because of kmalloc not being ready at such
+ 	 * an early stage. Yes, I've been bitten... */
+ 	setup_irq(SGI_EISA_IRQ, &eisa_action);
+-	setup_irq(SGINT_EISA + 2, &cascade_action);
+ 
+ 	EISA_bus = 1;
+ 	return 0;
+-- 
+1.4.4.4
+

Added: dists/sid/linux-2.6/debian/patches/bugfix/mips/ip22-fix-eprom-access.patch
==============================================================================
--- (empty file)
+++ dists/sid/linux-2.6/debian/patches/bugfix/mips/ip22-fix-eprom-access.patch	Mon Nov 26 20:06:56 2007
@@ -0,0 +1,89 @@
+
+Signed-off-by: Thomas Bogendoerfer <tsbogend at alpha.franken.de>
+---
+ arch/mips/sgi-ip22/ip22-nvram.c |   40 ++++++++++++++++++++------------------
+ 1 files changed, 21 insertions(+), 19 deletions(-)
+
+diff --git a/arch/mips/sgi-ip22/ip22-nvram.c b/arch/mips/sgi-ip22/ip22-nvram.c
+index e19d60d..0177566 100644
+--- a/arch/mips/sgi-ip22/ip22-nvram.c
++++ b/arch/mips/sgi-ip22/ip22-nvram.c
+@@ -32,19 +32,19 @@
+ 	for (x=0; x<100000; x++) __asm__ __volatile__(""); })
+ 
+ #define eeprom_cs_on(ptr) ({	\
+-	*ptr &= ~EEPROM_DATO;	\
+-	*ptr &= ~EEPROM_ECLK;	\
+-	*ptr &= ~EEPROM_EPROT;	\
+-	delay();		\
+-	*ptr |= EEPROM_CSEL;	\
+-	*ptr |= EEPROM_ECLK; })
++	__raw_writel(__raw_readl(ptr) & ~EEPROM_DATO, ptr);	\
++	__raw_writel(__raw_readl(ptr) & ~EEPROM_ECLK, ptr);	\
++	__raw_writel(__raw_readl(ptr) & ~EEPROM_EPROT, ptr);	\
++	delay();		                                \
++	__raw_writel(__raw_readl(ptr) | EEPROM_CSEL, ptr);	\
++	__raw_writel(__raw_readl(ptr) | EEPROM_ECLK, ptr); })
+ 
+ 
+ #define eeprom_cs_off(ptr) ({	\
+-	*ptr &= ~EEPROM_ECLK;	\
+-	*ptr &= ~EEPROM_CSEL;	\
+-	*ptr |= EEPROM_EPROT;	\
+-	*ptr |= EEPROM_ECLK; })
++	__raw_writel(__raw_readl(ptr) & ~EEPROM_ECLK, ptr);	\
++	__raw_writel(__raw_readl(ptr) & ~EEPROM_CSEL, ptr);	\
++	__raw_writel(__raw_readl(ptr) | EEPROM_EPROT, ptr);	\
++	__raw_writel(__raw_readl(ptr) | EEPROM_ECLK, ptr); })
+ 
+ #define	BITS_IN_COMMAND	11
+ /*
+@@ -60,15 +60,17 @@ static inline void eeprom_cmd(unsigned int *ctrl, unsigned cmd, unsigned reg)
+ 	ser_cmd = cmd | (reg << (16 - BITS_IN_COMMAND));
+ 	for (i = 0; i < BITS_IN_COMMAND; i++) {
+ 		if (ser_cmd & (1<<15))	/* if high order bit set */
+-			writel(readl(ctrl) | EEPROM_DATO, ctrl);
++			__raw_writel(__raw_readl(ctrl) | EEPROM_DATO, ctrl);
+ 		else
+-			writel(readl(ctrl) & ~EEPROM_DATO, ctrl);
+-		writel(readl(ctrl) & ~EEPROM_ECLK, ctrl);
+-		writel(readl(ctrl) | EEPROM_ECLK, ctrl);
++			__raw_writel(__raw_readl(ctrl) & ~EEPROM_DATO, ctrl);
++		__raw_writel(__raw_readl(ctrl) & ~EEPROM_ECLK, ctrl);
++		delay();
++		__raw_writel(__raw_readl(ctrl) | EEPROM_ECLK, ctrl);
++		delay();
+ 		ser_cmd <<= 1;
+ 	}
+ 	/* see data sheet timing diagram */
+-	writel(readl(ctrl) & ~EEPROM_DATO, ctrl);
++	__raw_writel(__raw_readl(ctrl) & ~EEPROM_DATO, ctrl);
+ }
+ 
+ unsigned short ip22_eeprom_read(unsigned int *ctrl, int reg)
+@@ -76,18 +78,18 @@ unsigned short ip22_eeprom_read(unsigned int *ctrl, int reg)
+ 	unsigned short res = 0;
+ 	int i;
+ 
+-	writel(readl(ctrl) & ~EEPROM_EPROT, ctrl);
++	__raw_writel(__raw_readl(ctrl) & ~EEPROM_EPROT, ctrl);
+ 	eeprom_cs_on(ctrl);
+ 	eeprom_cmd(ctrl, EEPROM_READ, reg);
+ 
+ 	/* clock the data ouf of serial mem */
+ 	for (i = 0; i < 16; i++) {
+-		writel(readl(ctrl) & ~EEPROM_ECLK, ctrl);
++		__raw_writel(__raw_readl(ctrl) & ~EEPROM_ECLK, ctrl);
+ 		delay();
+-		writel(readl(ctrl) | EEPROM_ECLK, ctrl);
++		__raw_writel(__raw_readl(ctrl) | EEPROM_ECLK, ctrl);
+ 		delay();
+ 		res <<= 1;
+-		if (readl(ctrl) & EEPROM_DATI)
++		if (__raw_readl(ctrl) & EEPROM_DATI)
+ 			res |= 1;
+ 	}
+ 
+-- 
+1.4.4.4
+

Added: dists/sid/linux-2.6/debian/patches/bugfix/powerpc/drivers_macintosh-broken.patch
==============================================================================
--- (empty file)
+++ dists/sid/linux-2.6/debian/patches/bugfix/powerpc/drivers_macintosh-broken.patch	Mon Nov 26 20:06:56 2007
@@ -0,0 +1,12 @@
+diff --git a/drivers/macintosh/Kconfig b/drivers/macintosh/Kconfig
+index a9e747c..9e02447 100644
+--- a/drivers/macintosh/Kconfig
++++ b/drivers/macintosh/Kconfig
+@@ -1,6 +1,6 @@
+ 
+ menu "Macintosh device drivers"
+-	depends on PPC || MAC || X86
++	depends on PPC_MAC || PPC_CHRP || MAC || X86
+ 
+ config ADB
+ 	bool "Apple Desktop Bus (ADB) support"

Added: dists/sid/linux-2.6/debian/patches/bugfix/powerpc/interrupt-alignement.patch
==============================================================================
--- (empty file)
+++ dists/sid/linux-2.6/debian/patches/bugfix/powerpc/interrupt-alignement.patch	Mon Nov 26 20:06:56 2007
@@ -0,0 +1,94 @@
+# Fixes exceptions alignement. 
+# Author: Benjamin Herrenschmidt benh at kernel.crashing.org 
+# Reference: http://ozlabs.org/pipermail/linuxppc-dev/2006-November/027453.html
+# Upstream: will be pushed upstream.
+
+The alignment exception used to only check the exception table for
+-EFAULT, not for other errors. That opens an oops window if we can
+coerce the kernel into getting an alignment exception for other reasons
+in what would normally be a user-protected accessor, which can be done
+via some of the futex ops. This fixes it by always checking the
+exception tables.
+
+Signed-off-by: Benjamin Herrenschmidt <benh at kernel.crashing.org>
+---
+
+Paul: this version sets the correct si_code
+
+This is 2.6.19 material and should probably go into stable as well.
+(Greg: take it if paulus acks it and it applies :)
+
+Index: linux-work/arch/powerpc/kernel/traps.c
+===================================================================
+--- linux-work.orig/arch/powerpc/kernel/traps.c	2006-11-01 14:59:07.000000000 +1100
++++ linux-work/arch/powerpc/kernel/traps.c	2006-11-01 15:01:06.000000000 +1100
+@@ -843,7 +843,7 @@ void __kprobes program_check_exception(s
+ 
+ void alignment_exception(struct pt_regs *regs)
+ {
+-	int fixed = 0;
++	int sig, code, fixed = 0;
+ 
+ 	/* we don't implement logging of alignment exceptions */
+ 	if (!(current->thread.align_ctl & PR_UNALIGN_SIGBUS))
+@@ -857,14 +857,16 @@ void alignment_exception(struct pt_regs 
+ 
+ 	/* Operand address was bad */
+ 	if (fixed == -EFAULT) {
+-		if (user_mode(regs))
+-			_exception(SIGSEGV, regs, SEGV_ACCERR, regs->dar);
+-		else
+-			/* Search exception table */
+-			bad_page_fault(regs, regs->dar, SIGSEGV);
+-		return;
++		sig = SIGSEGV;
++		code = SEGV_ACCERR;
++	} else {
++		sig = SIGBUS;
++		code = BUS_ADRALN;
+ 	}
+-	_exception(SIGBUS, regs, BUS_ADRALN, regs->dar);
++	if (user_mode(regs))
++		_exception(sig, regs, code, regs->dar);
++	else
++		bad_page_fault(regs, regs->dar, sig);
+ }
+ 
+ void StackOverflow(struct pt_regs *regs)
+Index: linux-work/arch/ppc/kernel/traps.c
+===================================================================
+--- linux-work.orig/arch/ppc/kernel/traps.c	2006-11-01 14:59:07.000000000 +1100
++++ linux-work/arch/ppc/kernel/traps.c	2006-11-01 15:01:32.000000000 +1100
+@@ -708,7 +708,7 @@ void single_step_exception(struct pt_reg
+ 
+ void alignment_exception(struct pt_regs *regs)
+ {
+-	int fixed;
++	int sig, code, fixed = 0;
+ 
+ 	fixed = fix_alignment(regs);
+ 	if (fixed == 1) {
+@@ -717,14 +717,16 @@ void alignment_exception(struct pt_regs 
+ 		return;
+ 	}
+ 	if (fixed == -EFAULT) {
+-		/* fixed == -EFAULT means the operand address was bad */
+-		if (user_mode(regs))
+-			_exception(SIGSEGV, regs, SEGV_ACCERR, regs->dar);
+-		else
+-			bad_page_fault(regs, regs->dar, SIGSEGV);
+-		return;
++		sig = SIGSEGV;
++		code = SEGV_ACCERR;
++	} else {
++		sig = SIGBUS;
++		code = BUS_ADRALN;
+ 	}
+-	_exception(SIGBUS, regs, BUS_ADRALN, regs->dar);
++	if (user_mode(regs))
++		_exception(sig, regs, code, regs->dar);
++	else
++		bad_page_fault(regs, regs->dar, sig);
+ }
+ 
+ void StackOverflow(struct pt_regs *regs)

Added: dists/sid/linux-2.6/debian/patches/bugfix/serial_core-suspend_oops.patch
==============================================================================
--- (empty file)
+++ dists/sid/linux-2.6/debian/patches/bugfix/serial_core-suspend_oops.patch	Mon Nov 26 20:06:56 2007
@@ -0,0 +1,78 @@
+From git-commits-head-owner at vger.kernel.org Wed Oct  4 17:49:26 2006
+
+commit a6b93a908508810c5d51dd9b390283345af6f2d9
+tree 71b48d3a659a025ebf333abfeec7b828becb60cb
+parent fe59d5372ae719ca4550958f1e5bb4dd6eeac9cd
+author Russell King <rmk at dyn-67.arm.linux.org.uk> 1159719460 +0100
+committer Russell King <rmk+kernel at arm.linux.org.uk> 1159719460 +0100
+
+[SERIAL] Fix oops when removing suspended serial port
+
+A serial card might have been removed when the system is resumed.
+This results in a suspended port being shut down, which results in
+the ports shutdown method being called twice in a row.  This causes
+BUGs.  Avoid this by tracking the suspended state separately from
+the initialised state.
+
+Signed-off-by: Russell King <rmk+kernel at arm.linux.org.uk>
+
+fixed lined offset -maks
+
+ drivers/serial/serial_core.c |    9 +++++++--
+ include/linux/serial_core.h  |    1 +
+ 2 files changed, 8 insertions(+), 2 deletions(-)
+
+diff --git a/drivers/serial/serial_core.c b/drivers/serial/serial_core.c
+index d814bb1..397147a 100644
+--- a/drivers/serial/serial_core.c
++++ b/drivers/serial/serial_core.c
+@@ -1932,6 +1932,9 @@ #endif
+ 	if (state->info && state->info->flags & UIF_INITIALIZED) {
+ 		const struct uart_ops *ops = port->ops;
+ 
++		state->info->flags = (state->info->flags & ~UIF_INITIALIZED)
++				     | UIF_SUSPENDED;
++
+ 		spin_lock_irq(&port->lock);
+ 		ops->stop_tx(port);
+ 		ops->set_mctrl(port, 0);
+@@ -1991,7 +1994,7 @@ #endif
+ 		console_start(port->cons);
+ 	}
+ 
+-	if (state->info && state->info->flags & UIF_INITIALIZED) {
++	if (state->info && state->info->flags & UIF_SUSPENDED) {
+ 		const struct uart_ops *ops = port->ops;
+ 		int ret;
+ 
+@@ -2003,15 +2006,17 @@ #endif
+ 			ops->set_mctrl(port, port->mctrl);
+ 			ops->start_tx(port);
+ 			spin_unlock_irq(&port->lock);
++			state->info->flags |= UIF_INITIALIZED;
+ 		} else {
+ 			/*
+ 			 * Failed to resume - maybe hardware went away?
+ 			 * Clear the "initialized" flag so we won't try
+ 			 * to call the low level drivers shutdown method.
+ 			 */
+-			state->info->flags &= ~UIF_INITIALIZED;
+ 			uart_shutdown(state);
+ 		}
++
++		state->info->flags &= ~UIF_SUSPENDED;
+ 	}
+ 
+ 	mutex_unlock(&state->mutex);
+diff --git a/include/linux/serial_core.h b/include/linux/serial_core.h
+index 86501a3..f9fdf97 100644
+--- a/include/linux/serial_core.h
++++ b/include/linux/serial_core.h
+@@ -319,6 +319,7 @@ #define UIF_CHECK_CD		((__force uif_t) (
+ #define UIF_CTS_FLOW		((__force uif_t) (1 << 26))
+ #define UIF_NORMAL_ACTIVE	((__force uif_t) (1 << 29))
+ #define UIF_INITIALIZED		((__force uif_t) (1 << 31))
++#define UIF_SUSPENDED		((__force uif_t) (1 << 30))
+ 
+ 	int			blocked_open;
+ 

Added: dists/sid/linux-2.6/debian/patches/bugfix/serial_cs-resume.patch
==============================================================================
--- (empty file)
+++ dists/sid/linux-2.6/debian/patches/bugfix/serial_cs-resume.patch	Mon Nov 26 20:06:56 2007
@@ -0,0 +1,40 @@
+commit fe59d5372ae719ca4550958f1e5bb4dd6eeac9cd
+tree 08ac6bf26961f7bfba6c371f566333c030dd5d77
+parent bcf5111a58c7db968c3fb9cd77e340a5e076f549
+author Russell King <rmk at dyn-67.arm.linux.org.uk> 1159719247 +0100
+committer Russell King <rmk+kernel at arm.linux.org.uk> 1159719247 +0100
+
+[SERIAL] Fix resume handling bug
+
+Unfortunately, pcmcia_dev_present() returns false when a device is
+suspended, so checking this on resume does not work too well.  Omit
+this test.
+
+Signed-off-by: Russell King <rmk+kernel at arm.linux.org.uk>
+
+backported patch from the fedora patchset. -maks
+
+diff --git a/drivers/serial/serial_cs.c b/drivers/serial/serial_cs.c
+index cbf260b..06a246a 100644
+--- a/drivers/serial/serial_cs.c
++++ b/drivers/serial/serial_cs.c
+@@ -185,14 +185,12 @@ static int serial_suspend(struct pcmcia_
+ 
+ static int serial_resume(struct pcmcia_device *link)
+ {
+-	if (pcmcia_dev_present(link)) {
+-		struct serial_info *info = link->priv;
+-		int i;
++	struct serial_info *info = link->priv;
++	int i;
+ 
+-		for (i = 0; i < info->ndev; i++)
+-			serial8250_resume_port(info->line[i]);
+-		wakeup_card(info);
+-	}
++	for (i = 0; i < info->ndev; i++)
++		serial8250_resume_port(info->line[i]);
++	wakeup_card(info);
+ 
+ 	return 0;
+ }

Added: dists/sid/linux-2.6/debian/patches/bugfix/sparc/bus-id-size.patch
==============================================================================
--- (empty file)
+++ dists/sid/linux-2.6/debian/patches/bugfix/sparc/bus-id-size.patch	Mon Nov 26 20:06:56 2007
@@ -0,0 +1,96 @@
+diff -aur a/arch/sparc/kernel/ebus.c b/arch/sparc/kernel/ebus.c
+--- a/arch/sparc/kernel/ebus.c	2006-09-19 20:42:06.000000000 -0700
++++ b/arch/sparc/kernel/ebus.c	2006-10-27 19:19:51.000000000 -0700
+@@ -237,12 +237,12 @@
+ 	dev->ofdev.node = dp;
+ 	dev->ofdev.dev.parent = &dev->bus->ofdev.dev;
+ 	dev->ofdev.dev.bus = &ebus_bus_type;
+-	strcpy(dev->ofdev.dev.bus_id, dp->path_component_name);
++	sprintf(dev->ofdev.dev.bus_id, "ebus[%08x]", dp->node);
+ 
+ 	/* Register with core */
+ 	if (of_device_register(&dev->ofdev) != 0)
+ 		printk(KERN_DEBUG "ebus: device registration error for %s!\n",
+-		       dev->ofdev.dev.bus_id);
++		       dp->path_component_name);
+ 
+ 	if ((dp = dp->child) != NULL) {
+ 		dev->children = (struct linux_ebus_child *)
+diff -aur a/arch/sparc/kernel/of_device.c b/arch/sparc/kernel/of_device.c
+--- a/arch/sparc/kernel/of_device.c	2006-09-19 20:42:06.000000000 -0700
++++ b/arch/sparc/kernel/of_device.c	2006-10-27 19:19:51.000000000 -0700
+@@ -652,7 +652,7 @@
+ 	if (!parent)
+ 		strcpy(op->dev.bus_id, "root");
+ 	else
+-		strcpy(op->dev.bus_id, dp->path_component_name);
++		sprintf(op->dev.bus_id, "%08x", dp->node);
+ 
+ 	if (of_device_register(op)) {
+ 		printk("%s: Could not register of device.\n",
+Only in b/arch/sparc/kernel: of_device.c.orig
+diff -aur a/arch/sparc64/kernel/ebus.c b/arch/sparc64/kernel/ebus.c
+--- a/arch/sparc64/kernel/ebus.c	2006-09-19 20:42:06.000000000 -0700
++++ b/arch/sparc64/kernel/ebus.c	2006-10-27 19:19:51.000000000 -0700
+@@ -389,12 +389,12 @@
+ 	dev->ofdev.node = dp;
+ 	dev->ofdev.dev.parent = &dev->bus->ofdev.dev;
+ 	dev->ofdev.dev.bus = &ebus_bus_type;
+-	strcpy(dev->ofdev.dev.bus_id, dp->path_component_name);
++	sprintf(dev->ofdev.dev.bus_id, "ebus[%08x]", dp->node);
+ 
+ 	/* Register with core */
+ 	if (of_device_register(&dev->ofdev) != 0)
+ 		printk(KERN_DEBUG "ebus: device registration error for %s!\n",
+-		       dev->ofdev.dev.bus_id);
++		       dp->path_component_name);
+ 
+ 	dp = dp->child;
+ 	if (dp) {
+diff -aur a/arch/sparc64/kernel/isa.c b/arch/sparc64/kernel/isa.c
+--- a/arch/sparc64/kernel/isa.c	2006-09-19 20:42:06.000000000 -0700
++++ b/arch/sparc64/kernel/isa.c	2006-10-27 19:19:51.000000000 -0700
+@@ -115,12 +115,12 @@
+ 		isa_dev->ofdev.node = dp;
+ 		isa_dev->ofdev.dev.parent = &isa_br->ofdev.dev;
+ 		isa_dev->ofdev.dev.bus = &isa_bus_type;
+-		strcpy(isa_dev->ofdev.dev.bus_id, dp->path_component_name);
++		sprintf(isa_dev->ofdev.dev.bus_id, "isa[%08x]", dp->node);
+ 
+ 		/* Register with core */
+ 		if (of_device_register(&isa_dev->ofdev) != 0) {
+ 			printk(KERN_DEBUG "isa: device registration error for %s!\n",
+-			       isa_dev->ofdev.dev.bus_id);
++			       dp->path_component_name);
+ 			kfree(isa_dev);
+ 			goto next_sibling;
+ 		}
+diff -aur a/arch/sparc64/kernel/of_device.c b/arch/sparc64/kernel/of_device.c
+--- a/arch/sparc64/kernel/of_device.c	2006-09-19 20:42:06.000000000 -0700
++++ b/arch/sparc64/kernel/of_device.c	2006-10-27 19:22:22.000000000 -0700
+@@ -842,7 +842,7 @@
+ 	if (!parent)
+ 		strcpy(op->dev.bus_id, "root");
+ 	else
+-		strcpy(op->dev.bus_id, dp->path_component_name);
++		sprintf(op->dev.bus_id, "%08x", dp->node);
+ 
+ 	if (of_device_register(op)) {
+ 		printk("%s: Could not register of device.\n",
+diff -aur a/drivers/sbus/sbus.c b/drivers/sbus/sbus.c
+--- a/drivers/sbus/sbus.c	2006-09-19 20:42:06.000000000 -0700
++++ b/drivers/sbus/sbus.c	2006-10-27 19:19:51.000000000 -0700
+@@ -61,11 +61,11 @@
+ 	else
+ 		sdev->ofdev.dev.parent = &sdev->bus->ofdev.dev;
+ 	sdev->ofdev.dev.bus = &sbus_bus_type;
+-	strcpy(sdev->ofdev.dev.bus_id, dp->path_component_name);
++	sprintf(sdev->ofdev.dev.bus_id, "sbus[%08x]", dp->node);
+ 
+ 	if (of_device_register(&sdev->ofdev) != 0)
+ 		printk(KERN_DEBUG "sbus: device registration error for %s!\n",
+-		       sdev->ofdev.dev.bus_id);
++		       dp->path_component_name);
+ }
+ 
+ static void __init sbus_bus_ranges_init(struct device_node *dp, struct sbus_bus *sbus)

Added: dists/sid/linux-2.6/debian/patches/bugfix/sparc/compat-alloc-user-space-alignment.patch
==============================================================================
--- (empty file)
+++ dists/sid/linux-2.6/debian/patches/bugfix/sparc/compat-alloc-user-space-alignment.patch	Mon Nov 26 20:06:56 2007
@@ -0,0 +1,42 @@
+commit a94b1d1fd7ca3129e1d38d38167779fa6ee69780
+Author: David S. Miller <davem at sunset.davemloft.net>
+Date:   Sun Oct 22 21:53:30 2006 -0700
+
+    [SPARC64]: 8-byte align return value from compat_alloc_user_space()
+    
+    Otherwise we get a ton of unaligned exceptions, for cases such
+    as compat_sys_msgrcv() which go:
+    
+    	p = compat_alloc_user_space(second + sizeof(struct msgbuf));
+    
+    and here 'second' can for example be an arbitrary odd value.
+    
+    Based upon a bug report from Jurij Smakov.
+    
+    Signed-off-by: David S. Miller <davem at davemloft.net>
+
+diff --git a/include/asm-sparc64/compat.h b/include/asm-sparc64/compat.h
+index c73935d..36511ca 100644
+--- a/include/asm-sparc64/compat.h
++++ b/include/asm-sparc64/compat.h
+@@ -164,7 +164,7 @@ static inline compat_uptr_t ptr_to_compa
+ 	return (u32)(unsigned long)uptr;
+ }
+ 
+-static __inline__ void __user *compat_alloc_user_space(long len)
++static inline void __user *compat_alloc_user_space(long len)
+ {
+ 	struct pt_regs *regs = current_thread_info()->kregs;
+ 	unsigned long usp = regs->u_regs[UREG_I6];
+@@ -174,7 +174,10 @@ static __inline__ void __user *compat_al
+ 	else
+ 		usp &= 0xffffffffUL;
+ 
+-	return (void __user *) (usp - len);
++	usp -= len;
++	usp &= ~0x7UL;
++
++	return (void __user *) usp;
+ }
+ 
+ struct compat_ipc64_perm {

Added: dists/sid/linux-2.6/debian/patches/bugfix/sparc/sunblade1k-boot-fix.patch
==============================================================================
--- (empty file)
+++ dists/sid/linux-2.6/debian/patches/bugfix/sparc/sunblade1k-boot-fix.patch	Mon Nov 26 20:06:56 2007
@@ -0,0 +1,48 @@
+--- a/arch/sparc64/kernel/prom.c	2006-09-19 20:42:06.000000000 -0700
++++ b/arch/sparc64/kernel/prom.c	2006-10-31 22:41:07.000000000 -0800
+@@ -794,7 +794,7 @@
+ 	return virt_irq;
+ }
+ 
+-static void schizo_irq_trans_init(struct device_node *dp)
++static void __schizo_irq_trans_init(struct device_node *dp, int is_tomatillo)
+ {
+ 	struct linux_prom64_registers *regs;
+ 	struct schizo_irq_data *irq_data;
+@@ -808,11 +808,24 @@
+ 	dp->irq_trans->data = irq_data;
+ 
+ 	irq_data->pbm_regs = regs[0].phys_addr;
+-	irq_data->sync_reg = regs[3].phys_addr + 0x1a18UL;
++	if (is_tomatillo)
++		irq_data->sync_reg = regs[3].phys_addr + 0x1a18UL;
++	else
++		irq_data->sync_reg = 0UL;
+ 	irq_data->portid = of_getintprop_default(dp, "portid", 0);
+ 	irq_data->chip_version = of_getintprop_default(dp, "version#", 0);
+ }
+ 
++static void schizo_irq_trans_init(struct device_node *dp)
++{
++	__schizo_irq_trans_init(dp, 0);
++}
++
++static void tomatillo_irq_trans_init(struct device_node *dp)
++{
++	__schizo_irq_trans_init(dp, 1);
++}
++
+ static unsigned int pci_sun4v_irq_build(struct device_node *dp,
+ 					unsigned int devino,
+ 					void *_data)
+@@ -1051,8 +1064,8 @@
+ 	{ "pci108e,8001", schizo_irq_trans_init },
+ 	{ "SUNW,schizo+", schizo_irq_trans_init },
+ 	{ "pci108e,8002", schizo_irq_trans_init },
+-	{ "SUNW,tomatillo", schizo_irq_trans_init },
+-	{ "pci108e,a801", schizo_irq_trans_init },
++	{ "SUNW,tomatillo", tomatillo_irq_trans_init },
++	{ "pci108e,a801", tomatillo_irq_trans_init },
+ 	{ "SUNW,sun4v-pci", pci_sun4v_irq_trans_init },
+ };
+ #endif

Added: dists/sid/linux-2.6/debian/patches/bugfix/sparc/t1k-cpu-lockup.patch
==============================================================================
--- (empty file)
+++ dists/sid/linux-2.6/debian/patches/bugfix/sparc/t1k-cpu-lockup.patch	Mon Nov 26 20:06:56 2007
@@ -0,0 +1,37 @@
+diff --git a/include/asm-sparc64/futex.h b/include/asm-sparc64/futex.h
+index dee4020..7392fc4 100644
+--- a/include/asm-sparc64/futex.h
++++ b/include/asm-sparc64/futex.h
+@@ -87,24 +87,22 @@ static inline int
+ futex_atomic_cmpxchg_inatomic(int __user *uaddr, int oldval, int newval)
+ {
+ 	__asm__ __volatile__(
+-	"\n1:	lduwa	[%2] %%asi, %0\n"
+-	"2:	casa	[%2] %%asi, %0, %1\n"
+-	"3:\n"
++	"\n1:	casa	[%3] %%asi, %2, %0\n"
++	"2:\n"
+ 	"	.section .fixup,#alloc,#execinstr\n"
+ 	"	.align	4\n"
+-	"4:	ba	3b\n"
+-	"	 mov	%3, %0\n"
++	"3:	ba	2b\n"
++	"	 mov	%4, %0\n"
+ 	"	.previous\n"
+ 	"	.section __ex_table,\"a\"\n"
+ 	"	.align	4\n"
+-	"	.word	1b, 4b\n"
+-	"	.word	2b, 4b\n"
++	"	.word	1b, 3b\n"
+ 	"	.previous\n"
+-	: "=&r" (oldval)
+-	: "r" (newval), "r" (uaddr), "i" (-EFAULT)
++	: "=r" (newval)
++	: "0" (newval), "r" (oldval), "r" (uaddr), "i" (-EFAULT)
+ 	: "memory");
+ 
+-	return oldval;
++	return newval;
+ }
+ 
+ #endif /* !(_SPARC64_FUTEX_H) */

Added: dists/sid/linux-2.6/debian/patches/debian/dfsg/drivers-atm.patch
==============================================================================
--- (empty file)
+++ dists/sid/linux-2.6/debian/patches/debian/dfsg/drivers-atm.patch	Mon Nov 26 20:06:56 2007
@@ -0,0 +1,115 @@
+diff --git a/drivers/atm/Kconfig b/drivers/atm/Kconfig
+index b554eda..8f8de2e 100644
+--- a/drivers/atm/Kconfig
++++ b/drivers/atm/Kconfig
+@@ -247,2 +247,3 @@ config ATM_AMBASSADOR
+ 	tristate "Madge Ambassador (Collage PCI 155 Server)"
++	depends on BROKEN
+ 	depends on PCI && VIRT_TO_BUS
+@@ -345,2 +346,3 @@ config ATM_FORE200E_PCA
+ 	bool "PCA-200E support"
++	depends on BROKEN
+ 	depends on ATM_FORE200E_MAYBE && PCI
+@@ -349,26 +351,5 @@ config ATM_FORE200E_PCA
+ 
+-config ATM_FORE200E_PCA_DEFAULT_FW
+-	bool "Use default PCA-200E firmware (normally enabled)"
+-	depends on ATM_FORE200E_PCA
+-	help
+-	  Use the default PCA-200E firmware data shipped with the driver.
+-
+-	  Normal users do not have to deal with the firmware stuff, so
+-	  they should say Y here.
+-
+-config ATM_FORE200E_PCA_FW
+-	string "Pathname of user-supplied binary firmware"
+-	depends on ATM_FORE200E_PCA && !ATM_FORE200E_PCA_DEFAULT_FW
+-	default ""
+-	help
+-	  This defines the pathname of an alternative PCA-200E binary
+-	  firmware image supplied by the user. This pathname may be
+-	  absolute or relative to the drivers/atm directory.
+-
+-	  The driver comes with an adequate firmware image, so normal users do
+-	  not have to supply an alternative one. They just say Y to "Use
+-	  default PCA-200E firmware" instead.
+-
+ config ATM_FORE200E_SBA
+ 	bool "SBA-200E support"
++	depends on BROKEN
+ 	depends on ATM_FORE200E_MAYBE && SBUS
+@@ -377,24 +358,2 @@ config ATM_FORE200E_SBA
+ 
+-config ATM_FORE200E_SBA_DEFAULT_FW
+-	bool "Use default SBA-200E firmware (normally enabled)"
+-	depends on ATM_FORE200E_SBA
+-	help
+-	  Use the default SBA-200E firmware data shipped with the driver.
+-
+-	  Normal users do not have to deal with the firmware stuff, so
+-	  they should say Y here.
+-
+-config ATM_FORE200E_SBA_FW
+-	string "Pathname of user-supplied binary firmware"
+-	depends on ATM_FORE200E_SBA && !ATM_FORE200E_SBA_DEFAULT_FW
+-	default ""
+-	help
+-	  This defines the pathname of an alternative SBA-200E binary
+-	  firmware image supplied by the user. This pathname may be
+-	  absolute or relative to the drivers/atm directory.
+-
+-	  The driver comes with an adequate firmware image, so normal users do
+-	  not have to supply an alternative one. They just say Y to "Use
+-	  default SBA-200E firmware", above.
+-
+ config ATM_FORE200E_USE_TASKLET
+diff --git a/drivers/atm/Makefile b/drivers/atm/Makefile
+index 1b16f81..3b2fd66 100644
+--- a/drivers/atm/Makefile
++++ b/drivers/atm/Makefile
+@@ -5,10 +5,2 @@
+ fore_200e-objs	:= fore200e.o
+-hostprogs-y	:= fore200e_mkfirm
+-
+-# Files generated that shall be removed upon make clean
+-clean-files := atmsar11.bin atmsar11.bin1 atmsar11.bin2 pca200e.bin \
+-	pca200e.bin1 pca200e.bin2 pca200e_ecd.bin pca200e_ecd.bin1 \
+-	pca200e_ecd.bin2 sba200e_ecd.bin sba200e_ecd.bin1 sba200e_ecd.bin2
+-# Firmware generated that shall be removed upon make clean
+-clean-files += fore200e_pca_fw.c fore200e_sba_fw.c
+ 
+@@ -38,17 +30,2 @@ obj-$(CONFIG_ATM_LANAI)		+= lanai.o
+ 
+-ifeq ($(CONFIG_ATM_FORE200E_PCA),y)
+-  fore_200e-objs		+= fore200e_pca_fw.o
+-  # guess the target endianess to choose the right PCA-200E firmware image
+-  ifeq ($(CONFIG_ATM_FORE200E_PCA_DEFAULT_FW),y)
+-    byteorder.h			:= include$(if $(patsubst $(srctree),,$(objtree)),2)/asm/byteorder.h
+-    CONFIG_ATM_FORE200E_PCA_FW	:= $(obj)/pca200e$(if $(shell $(CC) $(CPPFLAGS) -E -dM $(byteorder.h) | grep ' __LITTLE_ENDIAN '),.bin,_ecd.bin2)
+-  endif
+-endif
+-
+-ifeq ($(CONFIG_ATM_FORE200E_SBA),y)
+-  fore_200e-objs		+= fore200e_sba_fw.o
+-  ifeq ($(CONFIG_ATM_FORE200E_SBA_DEFAULT_FW),y)
+-    CONFIG_ATM_FORE200E_SBA_FW	:= $(obj)/sba200e_ecd.bin2
+-  endif
+-endif
+ obj-$(CONFIG_ATM_HE)		+= he.o
+@@ -58,16 +35 @@ endif
+ 
+-# FORE Systems 200E-series firmware magic
+-$(obj)/fore200e_pca_fw.c: $(patsubst "%", %, $(CONFIG_ATM_FORE200E_PCA_FW)) \
+-			  $(obj)/fore200e_mkfirm
+-	$(obj)/fore200e_mkfirm -k -b _fore200e_pca_fw \
+-	  -i $(CONFIG_ATM_FORE200E_PCA_FW) -o $@
+-
+-$(obj)/fore200e_sba_fw.c: $(patsubst "%", %, $(CONFIG_ATM_FORE200E_SBA_FW)) \
+-			  $(obj)/fore200e_mkfirm
+-	$(obj)/fore200e_mkfirm -k -b _fore200e_sba_fw \
+-	  -i $(CONFIG_ATM_FORE200E_SBA_FW) -o $@
+-
+-# deal with the various suffixes of the binary firmware images
+-$(obj)/%.bin $(obj)/%.bin1 $(obj)/%.bin2: $(src)/%.data
+-	objcopy -Iihex $< -Obinary $@.gz
+-	gzip -n -df $@.gz

Added: dists/sid/linux-2.6/debian/patches/debian/dfsg/drivers-char-computone.patch
==============================================================================
--- (empty file)
+++ dists/sid/linux-2.6/debian/patches/debian/dfsg/drivers-char-computone.patch	Mon Nov 26 20:06:56 2007
@@ -0,0 +1,22 @@
+--- a/drivers/char/Kconfig
++++ b/drivers/char/Kconfig
+@@ -100,15 +99,0 @@
+-config COMPUTONE
+-	tristate "Computone IntelliPort Plus serial support"
+-	depends on SERIAL_NONSTANDARD && (ISA || EISA || PCI)
+-	---help---
+-	  This driver supports the entire family of Intelliport II/Plus
+-	  controllers with the exception of the MicroChannel controllers and
+-	  products previous to the Intelliport II. These are multiport cards,
+-	  which give you many serial ports. You would need something like this
+-	  to connect more than two modems to your Linux box, for instance in
+-	  order to become a dial-in server. If you have a card like that, say
+-	  Y here and read <file:Documentation/computone.txt>.
+-
+-	  To compile this driver as modules, choose M here: the
+-	  modules will be called ip2 and ip2main.
+-
+--- a/drivers/char/Makefile
++++ b/drivers/char/Makefile
+@@ -36 +35,0 @@
+-obj-$(CONFIG_COMPUTONE)		+= ip2/

Added: dists/sid/linux-2.6/debian/patches/debian/dfsg/drivers-media-dvb-ttusb-budget.patch
==============================================================================
--- (empty file)
+++ dists/sid/linux-2.6/debian/patches/debian/dfsg/drivers-media-dvb-ttusb-budget.patch	Mon Nov 26 20:06:56 2007
@@ -0,0 +1,8 @@
+diff --git a/drivers/media/dvb/ttusb-budget/Kconfig b/drivers/media/dvb/ttusb-budget/Kconfig
+index f546bcc..1b24079 100644
+--- a/drivers/media/dvb/ttusb-budget/Kconfig
++++ b/drivers/media/dvb/ttusb-budget/Kconfig
+@@ -2,2 +2,3 @@ config DVB_TTUSB_BUDGET
+ 	tristate "Technotrend/Hauppauge Nova-USB devices"
++	depends on BROKEN
+ 	depends on DVB_CORE && USB && I2C

Modified: dists/sid/linux-2.6/debian/patches/debian/dfsg/drivers-media-video-dabus.patch
==============================================================================
--- dists/sid/linux-2.6/debian/patches/debian/dfsg/drivers-media-video-dabus.patch	(original)
+++ dists/sid/linux-2.6/debian/patches/debian/dfsg/drivers-media-video-dabus.patch	Mon Nov 26 20:06:56 2007
@@ -1,10 +1,8 @@
 diff -ruN a/drivers/media/Kconfig b/drivers/media/Kconfig
 --- a/drivers/media/Kconfig	2007-02-04 19:44:54.000000000 +0100
 +++ b/drivers/media/Kconfig	2007-02-05 16:24:30.000000000 +0100
-@@ -85,18 +85,4 @@
- 	tristate
- 	depends on I2C
- 
+@@ -85,16 +85,0 @@
+-if DAB
 -config USB_DABUSB
 -	tristate "DABUSB driver"
 -	depends on USB
@@ -18,16 +16,10 @@
 -
 -	  To compile this driver as a module, choose M here: the
 -	  module will be called dabusb.
+-endif # DAB
 -
- endmenu
 diff -ruN a/drivers/media/video/Makefile b/drivers/media/video/Makefile
 --- a/drivers/media/video/Makefile	2007-02-04 19:44:54.000000000 +0100
 +++ b/drivers/media/video/Makefile	2007-02-05 16:24:30.000000000 +0100
-@@ -94,7 +94,6 @@
- obj-$(CONFIG_VIDEO_CAFE_CCIC) += cafe_ccic.o
- obj-$(CONFIG_VIDEO_OV7670) 	+= ov7670.o
- 
+@@ -94,1 +94,0 @@
 -obj-$(CONFIG_USB_DABUSB)        += dabusb.o
- obj-$(CONFIG_USB_OV511)         += ov511.o
- obj-$(CONFIG_USB_SE401)         += se401.o
- obj-$(CONFIG_USB_STV680)        += stv680.o

Added: dists/sid/linux-2.6/debian/patches/debian/dfsg/drivers-net-acenic-remove.patch
==============================================================================
--- (empty file)
+++ dists/sid/linux-2.6/debian/patches/debian/dfsg/drivers-net-acenic-remove.patch	Mon Nov 26 20:06:56 2007
@@ -0,0 +1,12 @@
+diff --git a/drivers/net/Kconfig b/drivers/net/Kconfig
+index 5b9e17b..5a827af 100644
+--- a/drivers/net/Kconfig
++++ b/drivers/net/Kconfig
+@@ -1983,6 +1983,7 @@ if NETDEV_1000
+ 
+ config ACENIC
+ 	tristate "Alteon AceNIC/3Com 3C985/NetGear GA620 Gigabit support"
++	depends on BROKEN
+ 	depends on PCI
+ 	---help---
+ 	  Say Y here if you have an Alteon AceNIC, 3Com 3C985(B), NetGear

Added: dists/sid/linux-2.6/debian/patches/debian/dfsg/drivers-net-bnx2-disable.patch
==============================================================================
--- (empty file)
+++ dists/sid/linux-2.6/debian/patches/debian/dfsg/drivers-net-bnx2-disable.patch	Mon Nov 26 20:06:56 2007
@@ -0,0 +1,6 @@
+--- a/drivers/net/Kconfig
++++ b/drivers/net/Kconfig
+@@ -2327,2 +2327,3 @@ config BNX2
+ 	tristate "Broadcom NetXtremeII support"
++	depends on BROKEN
+ 	depends on PCI

Modified: dists/sid/linux-2.6/debian/patches/debian/dfsg/drivers-net-dgrs.patch
==============================================================================
--- dists/sid/linux-2.6/debian/patches/debian/dfsg/drivers-net-dgrs.patch	(original)
+++ dists/sid/linux-2.6/debian/patches/debian/dfsg/drivers-net-dgrs.patch	Mon Nov 26 20:06:56 2007
@@ -1,10 +1,7 @@
 diff -ruN a/drivers/net/Kconfig b/drivers/net/Kconfig
 --- a/drivers/net/Kconfig	2007-02-04 19:44:54.000000000 +0100
 +++ b/drivers/net/Kconfig	2007-02-05 16:31:22.000000000 +0100
-@@ -1471,21 +1471,6 @@
- 	tristate "TOSHIBA TC35815 Ethernet support"
- 	depends on NET_PCI && PCI && TOSHIBA_JMR3927
- 
+@@ -1471,15 +1471,0 @@
 -config DGRS
 -	tristate "Digi Intl. RightSwitch SE-X support"
 -	depends on NET_PCI && (PCI || EISA)
@@ -20,17 +17,8 @@
 -	  <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
 diff -ruN a/drivers/net/Makefile b/drivers/net/Makefile
 --- a/drivers/net/Makefile	2007-02-04 19:44:54.000000000 +0100
 +++ b/drivers/net/Makefile	2007-02-05 16:31:22.000000000 +0100
-@@ -38,7 +38,6 @@
- 
- obj-$(CONFIG_OAKNET) += oaknet.o 8390.o
- 
+@@ -38,1 +38,0 @@
 -obj-$(CONFIG_DGRS) += dgrs.o
- obj-$(CONFIG_VORTEX) += 3c59x.o
- obj-$(CONFIG_TYPHOON) += typhoon.o
- obj-$(CONFIG_NE2K_PCI) += ne2k-pci.o 8390.o

Added: dists/sid/linux-2.6/debian/patches/debian/dfsg/drivers-net-hamradio-yam.patch
==============================================================================
--- (empty file)
+++ dists/sid/linux-2.6/debian/patches/debian/dfsg/drivers-net-hamradio-yam.patch	Mon Nov 26 20:06:56 2007
@@ -0,0 +1,8 @@
+diff --git a/drivers/net/hamradio/Kconfig b/drivers/net/hamradio/Kconfig
+index 36d2c7d..2fcffaf 100644
+--- a/drivers/net/hamradio/Kconfig
++++ b/drivers/net/hamradio/Kconfig
+@@ -183,2 +183,3 @@ config YAM
+ 	tristate "YAM driver for AX.25"
++	depends on BROKEN
+ 	depends on AX25 && !S390

Added: dists/sid/linux-2.6/debian/patches/debian/dfsg/drivers-net-myri.patch
==============================================================================
--- (empty file)
+++ dists/sid/linux-2.6/debian/patches/debian/dfsg/drivers-net-myri.patch	Mon Nov 26 20:06:56 2007
@@ -0,0 +1,8 @@
+diff --git a/drivers/net/Kconfig b/drivers/net/Kconfig
+index c551925..b09086b 100644
+--- a/drivers/net/Kconfig
++++ b/drivers/net/Kconfig
+@@ -2075,2 +2075,3 @@ config MYRI_SBUS
+ 	tristate "MyriCOM Gigabit Ethernet support"
++	depends on BROKEN
+ 	depends on SBUS

Added: dists/sid/linux-2.6/debian/patches/debian/dfsg/drivers-net-tg3-fix-simple.patch
==============================================================================
--- (empty file)
+++ dists/sid/linux-2.6/debian/patches/debian/dfsg/drivers-net-tg3-fix-simple.patch	Mon Nov 26 20:06:56 2007
@@ -0,0 +1,283 @@
+--- a/drivers/net/Kconfig
++++ b/drivers/net/Kconfig
+@@ -2229,7 +2229,6 @@
+ 
+ config TIGON3
+ 	tristate "Broadcom Tigon3 support"
+-	depends on BROKEN
+ 	depends on PCI
+ 	help
+ 	  This driver supports Broadcom Tigon3 based gigabit Ethernet cards.
+--- a/drivers/net/tg3.c
++++ b/drivers/net/tg3.c
+@@ -5124,11 +5124,6 @@
+ }
+ 
+ 
+-#define RX_CPU_SCRATCH_BASE	0x30000
+-#define RX_CPU_SCRATCH_SIZE	0x04000
+-#define TX_CPU_SCRATCH_BASE	0x34000
+-#define TX_CPU_SCRATCH_SIZE	0x04000
+-
+ /* tp->lock is held. */
+ static int tg3_halt_cpu(struct tg3 *tp, u32 offset)
+ {
+@@ -5177,205 +5172,6 @@
+ 	return 0;
+ }
+ 
+-struct fw_info {
+-	unsigned int text_base;
+-	unsigned int text_len;
+-	const u32 *text_data;
+-	unsigned int rodata_base;
+-	unsigned int rodata_len;
+-	const u32 *rodata_data;
+-	unsigned int data_base;
+-	unsigned int data_len;
+-	const u32 *data_data;
+-};
+-
+-/* tp->lock is held. */
+-static int tg3_load_firmware_cpu(struct tg3 *tp, u32 cpu_base, u32 cpu_scratch_base,
+-				 int cpu_scratch_size, struct fw_info *info)
+-{
+-	int err, lock_err, i;
+-	void (*write_op)(struct tg3 *, u32, u32);
+-
+-	if (cpu_base == TX_CPU_BASE &&
+-	    (tp->tg3_flags2 & TG3_FLG2_5705_PLUS)) {
+-		printk(KERN_ERR PFX "tg3_load_firmware_cpu: Trying to load "
+-		       "TX cpu firmware on %s which is 5705.\n",
+-		       tp->dev->name);
+-		return -EINVAL;
+-	}
+-
+-	if (tp->tg3_flags2 & TG3_FLG2_5705_PLUS)
+-		write_op = tg3_write_mem;
+-	else
+-		write_op = tg3_write_indirect_reg32;
+-
+-	/* It is possible that bootcode is still loading at this point.
+-	 * Get the nvram lock first before halting the cpu.
+-	 */
+-	lock_err = tg3_nvram_lock(tp);
+-	err = tg3_halt_cpu(tp, cpu_base);
+-	if (!lock_err)
+-		tg3_nvram_unlock(tp);
+-	if (err)
+-		goto out;
+-
+-	for (i = 0; i < cpu_scratch_size; i += sizeof(u32))
+-		write_op(tp, cpu_scratch_base + i, 0);
+-	tw32(cpu_base + CPU_STATE, 0xffffffff);
+-	tw32(cpu_base + CPU_MODE, tr32(cpu_base+CPU_MODE)|CPU_MODE_HALT);
+-	for (i = 0; i < (info->text_len / sizeof(u32)); i++)
+-		write_op(tp, (cpu_scratch_base +
+-			      (info->text_base & 0xffff) +
+-			      (i * sizeof(u32))),
+-			 (info->text_data ?
+-			  info->text_data[i] : 0));
+-	for (i = 0; i < (info->rodata_len / sizeof(u32)); i++)
+-		write_op(tp, (cpu_scratch_base +
+-			      (info->rodata_base & 0xffff) +
+-			      (i * sizeof(u32))),
+-			 (info->rodata_data ?
+-			  info->rodata_data[i] : 0));
+-	for (i = 0; i < (info->data_len / sizeof(u32)); i++)
+-		write_op(tp, (cpu_scratch_base +
+-			      (info->data_base & 0xffff) +
+-			      (i * sizeof(u32))),
+-			 (info->data_data ?
+-			  info->data_data[i] : 0));
+-
+-	err = 0;
+-
+-out:
+-	return err;
+-}
+-
+-/* tp->lock is held. */
+-static int tg3_load_5701_a0_firmware_fix(struct tg3 *tp)
+-{
+-	struct fw_info info;
+-	int err, i;
+-
+-	info.text_base = TG3_FW_TEXT_ADDR;
+-	info.text_len = TG3_FW_TEXT_LEN;
+-	info.text_data = &tg3FwText[0];
+-	info.rodata_base = TG3_FW_RODATA_ADDR;
+-	info.rodata_len = TG3_FW_RODATA_LEN;
+-	info.rodata_data = &tg3FwRodata[0];
+-	info.data_base = TG3_FW_DATA_ADDR;
+-	info.data_len = TG3_FW_DATA_LEN;
+-	info.data_data = NULL;
+-
+-	err = tg3_load_firmware_cpu(tp, RX_CPU_BASE,
+-				    RX_CPU_SCRATCH_BASE, RX_CPU_SCRATCH_SIZE,
+-				    &info);
+-	if (err)
+-		return err;
+-
+-	err = tg3_load_firmware_cpu(tp, TX_CPU_BASE,
+-				    TX_CPU_SCRATCH_BASE, TX_CPU_SCRATCH_SIZE,
+-				    &info);
+-	if (err)
+-		return err;
+-
+-	/* Now startup only the RX cpu. */
+-	tw32(RX_CPU_BASE + CPU_STATE, 0xffffffff);
+-	tw32_f(RX_CPU_BASE + CPU_PC,    TG3_FW_TEXT_ADDR);
+-
+-	for (i = 0; i < 5; i++) {
+-		if (tr32(RX_CPU_BASE + CPU_PC) == TG3_FW_TEXT_ADDR)
+-			break;
+-		tw32(RX_CPU_BASE + CPU_STATE, 0xffffffff);
+-		tw32(RX_CPU_BASE + CPU_MODE,  CPU_MODE_HALT);
+-		tw32_f(RX_CPU_BASE + CPU_PC,    TG3_FW_TEXT_ADDR);
+-		udelay(1000);
+-	}
+-	if (i >= 5) {
+-		printk(KERN_ERR PFX "tg3_load_firmware fails for %s "
+-		       "to set RX CPU PC, is %08x should be %08x\n",
+-		       tp->dev->name, tr32(RX_CPU_BASE + CPU_PC),
+-		       TG3_FW_TEXT_ADDR);
+-		return -ENODEV;
+-	}
+-	tw32(RX_CPU_BASE + CPU_STATE, 0xffffffff);
+-	tw32_f(RX_CPU_BASE + CPU_MODE,  0x00000000);
+-
+-	return 0;
+-}
+-
+-
+-
+-/* tp->lock is held. */
+-static int tg3_load_tso_firmware(struct tg3 *tp)
+-{
+-	struct fw_info info;
+-	unsigned long cpu_base, cpu_scratch_base, cpu_scratch_size;
+-	int err, i;
+-
+-	if (tp->tg3_flags2 & TG3_FLG2_HW_TSO)
+-		return 0;
+-
+-	if (GET_ASIC_REV(tp->pci_chip_rev_id) == ASIC_REV_5705) {
+-		info.text_base = TG3_TSO5_FW_TEXT_ADDR;
+-		info.text_len = TG3_TSO5_FW_TEXT_LEN;
+-		info.text_data = &tg3Tso5FwText[0];
+-		info.rodata_base = TG3_TSO5_FW_RODATA_ADDR;
+-		info.rodata_len = TG3_TSO5_FW_RODATA_LEN;
+-		info.rodata_data = &tg3Tso5FwRodata[0];
+-		info.data_base = TG3_TSO5_FW_DATA_ADDR;
+-		info.data_len = TG3_TSO5_FW_DATA_LEN;
+-		info.data_data = &tg3Tso5FwData[0];
+-		cpu_base = RX_CPU_BASE;
+-		cpu_scratch_base = NIC_SRAM_MBUF_POOL_BASE5705;
+-		cpu_scratch_size = (info.text_len +
+-				    info.rodata_len +
+-				    info.data_len +
+-				    TG3_TSO5_FW_SBSS_LEN +
+-				    TG3_TSO5_FW_BSS_LEN);
+-	} else {
+-		info.text_base = TG3_TSO_FW_TEXT_ADDR;
+-		info.text_len = TG3_TSO_FW_TEXT_LEN;
+-		info.text_data = &tg3TsoFwText[0];
+-		info.rodata_base = TG3_TSO_FW_RODATA_ADDR;
+-		info.rodata_len = TG3_TSO_FW_RODATA_LEN;
+-		info.rodata_data = &tg3TsoFwRodata[0];
+-		info.data_base = TG3_TSO_FW_DATA_ADDR;
+-		info.data_len = TG3_TSO_FW_DATA_LEN;
+-		info.data_data = &tg3TsoFwData[0];
+-		cpu_base = TX_CPU_BASE;
+-		cpu_scratch_base = TX_CPU_SCRATCH_BASE;
+-		cpu_scratch_size = TX_CPU_SCRATCH_SIZE;
+-	}
+-
+-	err = tg3_load_firmware_cpu(tp, cpu_base,
+-				    cpu_scratch_base, cpu_scratch_size,
+-				    &info);
+-	if (err)
+-		return err;
+-
+-	/* Now startup the cpu. */
+-	tw32(cpu_base + CPU_STATE, 0xffffffff);
+-	tw32_f(cpu_base + CPU_PC,    info.text_base);
+-
+-	for (i = 0; i < 5; i++) {
+-		if (tr32(cpu_base + CPU_PC) == info.text_base)
+-			break;
+-		tw32(cpu_base + CPU_STATE, 0xffffffff);
+-		tw32(cpu_base + CPU_MODE,  CPU_MODE_HALT);
+-		tw32_f(cpu_base + CPU_PC,    info.text_base);
+-		udelay(1000);
+-	}
+-	if (i >= 5) {
+-		printk(KERN_ERR PFX "tg3_load_tso_firmware fails for %s "
+-		       "to set CPU PC, is %08x should be %08x\n",
+-		       tp->dev->name, tr32(cpu_base + CPU_PC),
+-		       info.text_base);
+-		return -ENODEV;
+-	}
+-	tw32(cpu_base + CPU_STATE, 0xffffffff);
+-	tw32_f(cpu_base + CPU_MODE,  0x00000000);
+-	return 0;
+-}
+-
+-
+ /* tp->lock is held. */
+ static void __tg3_set_mac_addr(struct tg3 *tp, int skip_mac_1)
+ {
+@@ -5590,18 +5386,8 @@
+ 		tw32(BUFMGR_DMA_DESC_POOL_SIZE, NIC_SRAM_DMA_DESC_POOL_SIZE);
+ 	}
+ 	else if (tp->tg3_flags2 & TG3_FLG2_TSO_CAPABLE) {
+-		int fw_len;
+-
+-		fw_len = (TG3_TSO5_FW_TEXT_LEN +
+-			  TG3_TSO5_FW_RODATA_LEN +
+-			  TG3_TSO5_FW_DATA_LEN +
+-			  TG3_TSO5_FW_SBSS_LEN +
+-			  TG3_TSO5_FW_BSS_LEN);
+-		fw_len = (fw_len + (0x80 - 1)) & ~(0x80 - 1);
+-		tw32(BUFMGR_MB_POOL_ADDR,
+-		     NIC_SRAM_MBUF_POOL_BASE5705 + fw_len);
+-		tw32(BUFMGR_MB_POOL_SIZE,
+-		     NIC_SRAM_MBUF_POOL_SIZE5705 - fw_len - 0xa00);
++		tw32(BUFMGR_MB_POOL_ADDR, NIC_SRAM_MBUF_POOL_BASE5705);
++		tw32(BUFMGR_MB_POOL_SIZE, NIC_SRAM_MBUF_POOL_SIZE5705 - 0xa00);
+ 	}
+ 
+ 	if (tp->dev->mtu <= ETH_DATA_LEN) {
+@@ -5980,18 +5766,6 @@
+ 	tw32(SNDBDI_MODE, SNDBDI_MODE_ENABLE | SNDBDI_MODE_ATTN_ENABLE);
+ 	tw32(SNDBDS_MODE, SNDBDS_MODE_ENABLE | SNDBDS_MODE_ATTN_ENABLE);
+ 
+-	if (tp->pci_chip_rev_id == CHIPREV_ID_5701_A0) {
+-		err = tg3_load_5701_a0_firmware_fix(tp);
+-		if (err)
+-			return err;
+-	}
+-
+-	if (tp->tg3_flags2 & TG3_FLG2_TSO_CAPABLE) {
+-		err = tg3_load_tso_firmware(tp);
+-		if (err)
+-			return err;
+-	}
+-
+ 	tp->tx_mode = TX_MODE_ENABLE;
+ 	tw32_f(MAC_TX_MODE, tp->tx_mode);
+ 	udelay(100);
+@@ -11284,6 +11058,12 @@
+ 		goto err_out_iounmap;
+ 	}
+ 
++	if (tp->pci_chip_rev_id == CHIPREV_ID_5701_A0) {                                                                        
++		printk(KERN_ERR PFX "5701 A0 firmware fix not available, aborting.\n");
++		err = -ENODEV;
++		goto err_out_iounmap;
++        }     
++
+ 	/* The EPB bridge inside 5714, 5715, and 5780 and any
+ 	 * device behind the EPB cannot support DMA addresses > 40-bit.
+ 	 * On 64-bit systems with IOMMU, use 40-bit dma_mask.

Added: dists/sid/linux-2.6/debian/patches/debian/dfsg/drivers-net-tg3-mark.patch
==============================================================================
--- (empty file)
+++ dists/sid/linux-2.6/debian/patches/debian/dfsg/drivers-net-tg3-mark.patch	Mon Nov 26 20:06:56 2007
@@ -0,0 +1,30 @@
+--- a/drivers/net/tg3.c
++++ b/drivers/net/tg3.c
+@@ -5131,6 +5131,7 @@ static int tg3_halt(struct tg3 *tp, int kind, int silent)
+ 	return 0;
+ }
+ 
++#ifdef REMOVE_DFSG
+ #define TG3_FW_RELEASE_MAJOR	0x0
+ #define TG3_FW_RELASE_MINOR	0x0
+ #define TG3_FW_RELEASE_FIX	0x0
+@@ -5255,4 +5256,5 @@ u32 tg3FwData[(TG3_FW_DATA_LEN / sizeof(u32)) + 1] = {
+ };
+ #endif
++#endif /* REMOVE_DFSG */
+ 
+ #define RX_CPU_SCRATCH_BASE	0x30000
+@@ -5433,6 +5435,7 @@ static int tg3_load_5701_a0_firmware_fix(struct tg3 *tp)
+ }
+ 
+ 
++#ifdef REMOVE_DFSG
+ #define TG3_TSO_FW_RELEASE_MAJOR	0x1
+ #define TG3_TSO_FW_RELASE_MINOR		0x6
+ #define TG3_TSO_FW_RELEASE_FIX		0x0
+@@ -5936,4 +5939,5 @@ static const u32 tg3Tso5FwData[(TG3_TSO5_FW_DATA_LEN / 4) + 1] = {
+ 	0x00000000, 0x00000000, 0x00000000,
+ };
++#endif /* REMOVE_DFSG */
+ 
+ /* tp->lock is held. */

Added: dists/sid/linux-2.6/debian/patches/debian/dfsg/drivers-net-tg3-remove.patch
==============================================================================
--- (empty file)
+++ dists/sid/linux-2.6/debian/patches/debian/dfsg/drivers-net-tg3-remove.patch	Mon Nov 26 20:06:56 2007
@@ -0,0 +1,27 @@
+--- a/drivers/net/Kconfig
++++ b/drivers/net/Kconfig
+@@ -2229,6 +2229,7 @@ config VIA_VELOCITY
+ 
+ config TIGON3
+ 	tristate "Broadcom Tigon3 support"
++	depends on BROKEN
+ 	depends on PCI
+ 	help
+ 	  This driver supports Broadcom Tigon3 based gigabit Ethernet cards.
+--- a/drivers/net/tg3.c
++++ b/drivers/net/tg3.c
+@@ -5,14 +5,6 @@
+  * Copyright (C) 2001, 2002, 2003 Jeff Garzik (jgarzik at pobox.com)
+  * Copyright (C) 2004 Sun Microsystems Inc.
+  * Copyright (C) 2005-2007 Broadcom Corporation.
+- *
+- * Firmware is:
+- *	Derived from proprietary unpublished source code,
+- *	Copyright (C) 2000-2003 Broadcom Corporation.
+- *
+- *	Permission is hereby granted for the distribution of this firmware
+- *	data in hexadecimal or equivalent format, provided this copyright
+- *	notice is accompanying it.
+  */
+ 
+ 

Modified: dists/sid/linux-2.6/debian/patches/debian/dfsg/drivers-net-tokenring-3c359-smctr.patch
==============================================================================
--- dists/sid/linux-2.6/debian/patches/debian/dfsg/drivers-net-tokenring-3c359-smctr.patch	(original)
+++ dists/sid/linux-2.6/debian/patches/debian/dfsg/drivers-net-tokenring-3c359-smctr.patch	Mon Nov 26 20:06:56 2007
@@ -1,13 +1,10 @@
 diff -ruN a/drivers/net/tokenring/Kconfig b/drivers/net/tokenring/Kconfig
 --- a/drivers/net/tokenring/Kconfig	2006-11-29 21:57:37.000000000 +0000
 +++ b/drivers/net/tokenring/Kconfig	2007-01-05 15:26:27.000000000 +0000
-@@ -64,24 +64,6 @@
- 	  To compile this driver as a module, choose M here: the module will be
- 	  called lanstreamer.
- 
+@@ -64,18 +64,0 @@
 -config 3C359
 -	tristate "3Com 3C359 Token Link Velocity XL adapter support"
--	depends on TR && PCI
+-	depends on PCI
 -	---help---
 -	  This is support for the 3Com PCI Velocity XL cards, specifically
 -	  the 3Com 3C359, please note this is not for the 3C339 cards, you
@@ -23,16 +20,10 @@
 -	  Linux Token Ring Project site for the latest information at
 -	  <http://www.linuxtr.net>
 -
- config TMS380TR
- 	tristate "Generic TMS380 Token Ring ISA/PCI adapter support"
- 	depends on TR && (PCI || ISA && ISA_DMA_API || MCA)
-@@ -166,21 +148,5 @@
- 	  To compile this driver as a module, choose M here: the module will be
- 	  called madgemc.
- 
+@@ -166,16 +148,0 @@
 -config SMCTR
 -	tristate "SMC ISA/MCA adapter support"
--	depends on TR && (ISA || MCA_LEGACY) && (BROKEN || !64BIT)
+-	depends on (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
@@ -46,14 +37,9 @@
 -	  To compile this driver as a module, choose M here: the module will be
 -	  called smctr.
 -
- endmenu
- 
 diff -ruN a/drivers/net/tokenring/Makefile b/drivers/net/tokenring/Makefile
 --- a/drivers/net/tokenring/Makefile	2006-11-29 21:57:37.000000000 +0000
 +++ b/drivers/net/tokenring/Makefile	2007-01-05 15:26:04.000000000 +0000
-@@ -11,5 +11,3 @@
- obj-$(CONFIG_PROTEON) 	+= proteon.o
- obj-$(CONFIG_TMSPCI) 	+= tmspci.o
- obj-$(CONFIG_SKISA) 	+= skisa.o
+@@ -11,2 +11,0 @@
 -obj-$(CONFIG_SMCTR) 	+= smctr.o
 -obj-$(CONFIG_3C359)	+= 3c359.o

Added: dists/sid/linux-2.6/debian/patches/debian/dfsg/drivers-scsi-qlogicpti.patch
==============================================================================
--- (empty file)
+++ dists/sid/linux-2.6/debian/patches/debian/dfsg/drivers-scsi-qlogicpti.patch	Mon Nov 26 20:06:56 2007
@@ -0,0 +1,8 @@
+diff --git a/drivers/scsi/Kconfig b/drivers/scsi/Kconfig
+index 6f2c71e..53c9aca 100644
+--- a/drivers/scsi/Kconfig
++++ b/drivers/scsi/Kconfig
+@@ -1306,2 +1306,3 @@ config SCSI_QLOGICPTI
+ 	tristate "PTI Qlogic, ISP Driver"
++	depends on BROKEN
+ 	depends on SBUS && SCSI

Added: dists/sid/linux-2.6/debian/patches/debian/dfsg/drivers-usb-serial-keyspan-remove.patch
==============================================================================
--- (empty file)
+++ dists/sid/linux-2.6/debian/patches/debian/dfsg/drivers-usb-serial-keyspan-remove.patch	Mon Nov 26 20:06:56 2007
@@ -0,0 +1,97 @@
+diff --git a/drivers/usb/serial/Kconfig b/drivers/usb/serial/Kconfig
+index 43d6db6..61c13e3 100644
+--- a/drivers/usb/serial/Kconfig
++++ b/drivers/usb/serial/Kconfig
+@@ -285,6 +285,7 @@ config USB_SERIAL_KEYSPAN_PDA
+ 
+ config USB_SERIAL_KEYSPAN
+ 	tristate "USB Keyspan USA-xxx Serial Driver"
++	depends on BROKEN
+ 	depends on USB_SERIAL
+ 	---help---
+ 	  Say Y here if you want to use Keyspan USB to serial converter
+@@ -297,84 +298,6 @@ config USB_SERIAL_KEYSPAN
+ 	  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

Modified: dists/sid/linux-2.6/debian/patches/debian/dfsg/files-1
==============================================================================
--- dists/sid/linux-2.6/debian/patches/debian/dfsg/files-1	(original)
+++ dists/sid/linux-2.6/debian/patches/debian/dfsg/files-1	Mon Nov 26 20:06:56 2007
@@ -1,46 +1,84 @@
-drivers/media/video/dabfirmware.h
-drivers/media/video/dabusb.c
-drivers/media/video/dabusb.h
-
-drivers/net/dgrs.c
-drivers/net/dgrs_es4h.h
-drivers/net/dgrs.h
-drivers/net/dgrs_ether.h
-drivers/net/dgrs_firmware.c
-drivers/net/dgrs_asstruct.h
-drivers/net/dgrs_plx9060.h
-drivers/net/dgrs_i82596.h
-drivers/net/dgrs_bcomm.h
-
-drivers/usb/misc/emi62.c
-drivers/usb/misc/emi62_fw_s.h
-drivers/usb/misc/emi62_fw_m.h
-
-drivers/usb/misc/emi26.c
-drivers/usb/misc/emi26_fw.h
-
-drivers/net/tokenring/3c359_microcode.h
-drivers/net/tokenring/3c359.h
-drivers/net/tokenring/3c359.c
-
-drivers/net/tokenring/smctr.h
-drivers/net/tokenring/smctr_firmware.h
-drivers/net/tokenring/smctr.c
-
-drivers/net/appletalk/cops.h
-drivers/net/appletalk/cops_ltdrv.h
-drivers/net/appletalk/cops.c
-drivers/net/appletalk/cops_ffdrv.h
-
-drivers/usb/serial/keyspan_usa19_fw.h
-drivers/usb/serial/keyspan_usa19qi_fw.h
-drivers/usb/serial/keyspan_usa19qw_fw.h
-drivers/usb/serial/keyspan_usa18x_fw.h
-drivers/usb/serial/keyspan_usa19w_fw.h
-drivers/usb/serial/keyspan_usa49wlc_fw.h
-drivers/usb/serial/keyspan_usa28xb_fw.h
-drivers/usb/serial/keyspan_usa28x_fw.h
-drivers/usb/serial/keyspan_usa49w_fw.h
-drivers/usb/serial/keyspan_usa28xa_fw.h
-drivers/usb/serial/keyspan_usa28_fw.h
-drivers/usb/serial/keyspan_mpr_fw.h
+rm Documentation/netlabel/draft-ietf-cipso-ipsecurity-01.txt
+
+rm drivers/atm/atmsar11.data
+rm drivers/atm/atmsar11.regions
+rm drivers/atm/atmsar11.start
+rm drivers/atm/fore200e_firmware_copyright
+rm drivers/atm/fore200e_mkfirm.c
+rm drivers/atm/pca200e.data
+rm drivers/atm/pca200e_ecd.data
+rm drivers/atm/sba200e_ecd.data
+
+rm drivers/char/ip2
+
+rm drivers/media/dvb/ttusb-budget/dvb-ttusb-dspbootcode.h
+
+rm drivers/media/video/dabfirmware.h
+rm drivers/media/video/dabusb.c
+rm drivers/media/video/dabusb.h
+
+rm drivers/net/acenic_firmware.h
+
+unifdef drivers/net/tg3.c -UREMOVE_DFSG
+
+rm drivers/net/appletalk/cops.c
+rm drivers/net/appletalk/cops.h
+rm drivers/net/appletalk/cops_ffdrv.h
+rm drivers/net/appletalk/cops_ltdrv.h
+
+rm drivers/net/bnx2_fw.h
+rm drivers/net/bnx2_fw2.h
+
+rm drivers/net/dgrs.c
+rm drivers/net/dgrs.h
+rm drivers/net/dgrs_asstruct.h
+rm drivers/net/dgrs_bcomm.h
+rm drivers/net/dgrs_es4h.h
+rm drivers/net/dgrs_ether.h
+rm drivers/net/dgrs_firmware.c
+rm drivers/net/dgrs_i82596.h
+rm drivers/net/dgrs_plx9060.h
+
+rm drivers/net/hamradio/yam1200.h
+rm drivers/net/hamradio/yam9600.h
+
+rm drivers/net/myri_code.h
+
+rm drivers/net/tokenring/3c359.c
+rm drivers/net/tokenring/3c359.h
+rm drivers/net/tokenring/3c359_microcode.h
+
+rm drivers/net/tokenring/smctr.c
+rm drivers/net/tokenring/smctr.h
+rm drivers/net/tokenring/smctr_firmware.h
+
+rm drivers/scsi/qlogicpti_asm.c
+
+rm drivers/usb/misc/emi26.c
+rm drivers/usb/misc/emi26_fw.h
+
+rm drivers/usb/misc/emi62.c
+rm drivers/usb/misc/emi62_fw_m.h
+rm drivers/usb/misc/emi62_fw_s.h
+
+rm drivers/usb/serial/keyspan_mpr_fw.h
+rm drivers/usb/serial/keyspan_usa18x_fw.h
+rm drivers/usb/serial/keyspan_usa19_fw.h
+rm drivers/usb/serial/keyspan_usa19qi_fw.h
+rm drivers/usb/serial/keyspan_usa19qw_fw.h
+rm drivers/usb/serial/keyspan_usa19w_fw.h
+rm drivers/usb/serial/keyspan_usa28_fw.h
+rm drivers/usb/serial/keyspan_usa28xa_fw.h
+rm drivers/usb/serial/keyspan_usa28xb_fw.h
+rm drivers/usb/serial/keyspan_usa28x_fw.h
+rm drivers/usb/serial/keyspan_usa49w_fw.h
+rm drivers/usb/serial/keyspan_usa49wlc_fw.h
+
+rm sound/pci/cs46xx/cs46xx_image.h
+rm sound/pci/cs46xx/imgs
+unifdef sound/pci/korg1212/korg1212.c -UCONFIG_SND_KORG1212_FIRMWARE_IN_KERNEL
+rm sound/pci/korg1212/korg1212-firmware.h
+unifdef sound/pci/maestro3.c -UCONFIG_SND_MAESTRO3_FIRMWARE_IN_KERNEL
+rm sound/pci/ymfpci/ymfpci_image.h
+unifdef sound/pci/ymfpci/ymfpci_main.c -UCONFIG_SND_YMFPCI_FIRMWARE_IN_KERNEL
+

Added: dists/sid/linux-2.6/debian/patches/debian/dfsg/sound-pci.patch
==============================================================================
--- (empty file)
+++ dists/sid/linux-2.6/debian/patches/debian/dfsg/sound-pci.patch	Mon Nov 26 20:06:56 2007
@@ -0,0 +1,77 @@
+--- a/sound/pci/Kconfig
++++ b/sound/pci/Kconfig
+@@ -199,2 +199,3 @@ config SND_CS46XX
+ 	tristate "Cirrus Logic (Sound Fusion) CS4280/CS461x/CS462x/CS463x"
++	depends on BROKEN
+ 	depends on SND
+@@ -587,7 +587,7 @@ config SND_INTEL8X0M
+ config SND_KORG1212
+ 	tristate "Korg 1212 IO"
+ 	depends on SND
+-	select FW_LOADER if !SND_KORG1212_FIRMWARE_IN_KERNEL
++	select FW_LOADER
+ 	select SND_PCM
+ 	help
+ 	  Say Y here to include support for Korg 1212IO soundcards.
+@@ -595,19 +595,10 @@ config SND_KORG1212
+ 	  To compile this driver as a module, choose M here: the module
+ 	  will be called snd-korg1212.
+ 
+-config SND_KORG1212_FIRMWARE_IN_KERNEL
+-	bool "In-kernel firmware for Korg1212 driver"
+-	depends on SND_KORG1212
+-	default y
+-	help
+-	  Say Y here to include the static firmware built in the kernel
+-	  for the Korg1212 driver.  If you choose N here, you need to
+-	  install the firmware files from the alsa-firmware package.
+-
+ config SND_MAESTRO3
+ 	tristate "ESS Allegro/Maestro3"
+ 	depends on SND
+-	select FW_LOADER if !SND_MAESTRO3_FIRMWARE_IN_KERNEL
++	select FW_LOADER
+ 	select SND_AC97_CODEC
+ 	help
+ 	  Say Y here to include support for soundcards based on ESS Maestro 3
+@@ -616,15 +607,6 @@ config SND_MAESTRO3
+ 	  To compile this driver as a module, choose M here: the module
+ 	  will be called snd-maestro3.
+ 
+-config SND_MAESTRO3_FIRMWARE_IN_KERNEL
+-	bool "In-kernel firmware for Maestro3 driver"
+-	depends on SND_MAESTRO3
+-	default y
+-	help
+-	  Say Y here to include the static firmware built in the kernel
+-	  for the Maestro3 driver.  If you choose N here, you need to
+-	  install the firmware files from the alsa-firmware package.
+-
+ config SND_MIXART
+ 	tristate "Digigram miXart"
+ 	depends on SND
+@@ -766,7 +748,7 @@ config SND_VX222
+ config SND_YMFPCI
+ 	tristate "Yamaha YMF724/740/744/754"
+ 	depends on SND
+-	select FW_LOADER if !SND_YMFPCI_FIRMWARE_IN_KERNEL
++	select FW_LOADER
+ 	select SND_OPL3_LIB
+ 	select SND_MPU401_UART
+ 	select SND_AC97_CODEC
+@@ -777,15 +759,6 @@ config SND_YMFPCI
+ 	  To compile this driver as a module, choose M here: the module
+ 	  will be called snd-ymfpci.
+ 
+-config SND_YMFPCI_FIRMWARE_IN_KERNEL
+-	bool "In-kernel firmware for YMFPCI driver"
+-	depends on SND_YMFPCI
+-	default y
+-	help
+-	  Say Y here to include the static firmware built in the kernel
+-	  for the YMFPCI driver.  If you choose N here, you need to
+-	  install the firmware files from the alsa-firmware package.
+-
+ config SND_AC97_POWER_SAVE
+ 	bool "AC97 Power-Saving Mode"
+ 	depends on SND_AC97_CODEC && EXPERIMENTAL

Modified: dists/sid/linux-2.6/debian/patches/debian/drivers-ata-ata_piix-postpone-pata.patch
==============================================================================
--- dists/sid/linux-2.6/debian/patches/debian/drivers-ata-ata_piix-postpone-pata.patch	(original)
+++ dists/sid/linux-2.6/debian/patches/debian/drivers-ata-ata_piix-postpone-pata.patch	Mon Nov 26 20:06:56 2007
@@ -2,7 +2,7 @@
 index b952c58..5634cc1 100644
 --- a/drivers/ata/ata_piix.c
 +++ b/drivers/ata/ata_piix.c
-@@ -164,44 +164,6 @@ static void ich_set_dmamode (struct ata_port *ap, struct ata_device *adev);
+@@ -164,46 +164,6 @@ static void ich_set_dmamode (struct ata_port *ap, struct ata_device *adev);
  static unsigned int in_module_init = 1;
  
  static const struct pci_device_id piix_pci_tbl[] = {
@@ -43,6 +43,8 @@
 -	/* ICH7/7-R (i945, i975) UDMA 100*/
 -	{ 0x8086, 0x27DF, PCI_ANY_ID, PCI_ANY_ID, 0, 0, ich_pata_133 },
 -	{ 0x8086, 0x269E, PCI_ANY_ID, PCI_ANY_ID, 0, 0, ich_pata_100 },
+-	/* ICH8 Mobile PATA Controller */
+-	{ 0x8086, 0x2850, PCI_ANY_ID, PCI_ANY_ID, 0, 0, ich_pata_100 },
 -
  	/* NOTE: The following PCI ids must be kept in sync with the
  	 * list in drivers/pci/quirks.c.

Modified: dists/sid/linux-2.6/debian/patches/debian/powerpc-mkvmlinuz-support-powerpc.patch
==============================================================================
--- dists/sid/linux-2.6/debian/patches/debian/powerpc-mkvmlinuz-support-powerpc.patch	(original)
+++ dists/sid/linux-2.6/debian/patches/debian/powerpc-mkvmlinuz-support-powerpc.patch	Mon Nov 26 20:06:56 2007
@@ -2,9 +2,9 @@
 index 6238b58..edfbed7 100644
 --- a/arch/powerpc/Makefile
 +++ b/arch/powerpc/Makefile
-@@ -151,13 +151,19 @@ CPPFLAGS_vmlinux.lds	:= -Upowerpc
+@@ -151,13 +151,19 @@
  
- BOOT_TARGETS = zImage zImage.initrd zImage.dts zImage.dts_initrd uImage
+ BOOT_TARGETS = zImage zImage.initrd uImage
  
 +BOOT_TARGETS_SPECIAL = mkvmlinuz_support_install
 +

Modified: dists/sid/linux-2.6/debian/patches/debian/scripts-kconfig-reportoldconfig.patch
==============================================================================
--- dists/sid/linux-2.6/debian/patches/debian/scripts-kconfig-reportoldconfig.patch	(original)
+++ dists/sid/linux-2.6/debian/patches/debian/scripts-kconfig-reportoldconfig.patch	Mon Nov 26 20:06:56 2007
@@ -24,9 +24,9 @@
 +updateoldconfig: $(obj)/conf
 +	$< -U arch/$(ARCH)/Kconfig
 +
- update-po-config: $(obj)/kxgettext
- 	xgettext --default-domain=linux \
-           --add-comments --keyword=_ --keyword=N_ \
+ # Create new linux.po file
+ # Adjust charset to UTF-8 in .po file to accept UTF-8 in Kconfig files
+ # The symlink is used to repair a deficiency in arch/um
 diff --git a/scripts/kconfig/conf.c b/scripts/kconfig/conf.c
 index 4dcb886..b5e1b25 100644
 --- a/scripts/kconfig/conf.c
@@ -196,10 +196,10 @@
 --- a/scripts/kconfig/confdata.c
 +++ b/scripts/kconfig/confdata.c
 @@ -338,8 +338,6 @@ int conf_read(const char *name)
- 		/* maybe print value in verbose mode... */
- 	sym_ok:
- 		if (sym_has_value(sym) && !sym_is_choice_value(sym)) {
--			if (sym->visible == no)
+ 			 * doesn't quite work if the Kconfig and the saved
+ 			 * configuration disagree.
+ 			 */
+-			if (sym->visible == no && !conf_unsaved)
 -				sym->flags &= ~SYMBOL_DEF_USER;
  			switch (sym->type) {
  			case S_STRING:

Added: dists/sid/linux-2.6/debian/patches/features/all/e1000e-20070806.patch
==============================================================================
--- (empty file)
+++ dists/sid/linux-2.6/debian/patches/features/all/e1000e-20070806.patch	Mon Nov 26 20:06:56 2007
@@ -0,0 +1,18164 @@
+From b0d321c026f3c3f2b53df13e1d9bc1fe21ce129a Mon Sep 17 00:00:00 2001
+From: Auke Kok <auke-jan.h.kok at intel.com>
+Date: Mon, 6 Aug 2007 14:14:44 -0700
+Subject: [PATCH] e1000e: New pci-express e1000 driver (currently for ICH9 devices only)
+
+This driver implements support for the ICH9 on-board LAN ethernet
+device. The device is similar to ICH8.
+
+The driver encompasses code to support 82571/2/3, es2lan and ICH8
+devices as well, but those device IDs are disabled and will be
+"lifted" from the e1000 driver over one at a time once this driver
+receives some more live time.
+
+Changes to the last snapshot posted are exclusively in the internal
+hardware API organization. Many thanks to Jeff Garzik for jumping in
+and getting this organized with a keen eye on the future layout.
+
+Signed-off-by: Auke Kok <auke-jan.h.kok at intel.com>
+---
+ drivers/net/Kconfig          |   23 +
+ drivers/net/Makefile         |    1 +
+ drivers/net/e1000e/82571.c   | 1382 +++++++++++++
+ drivers/net/e1000e/Makefile  |   37 +
+ drivers/net/e1000e/defines.h |  738 +++++++
+ drivers/net/e1000e/e1000.h   |  518 +++++
+ drivers/net/e1000e/es2lan.c  | 1255 ++++++++++++
+ drivers/net/e1000e/ethtool.c | 1763 +++++++++++++++++
+ drivers/net/e1000e/hw.h      |  862 +++++++++
+ drivers/net/e1000e/ich8lan.c | 2297 ++++++++++++++++++++++
+ drivers/net/e1000e/lib.c     | 2528 ++++++++++++++++++++++++
+ drivers/net/e1000e/netdev.c  | 4413 ++++++++++++++++++++++++++++++++++++++++++
+ drivers/net/e1000e/param.c   |  382 ++++
+ drivers/net/e1000e/phy.c     | 1821 +++++++++++++++++
+ 14 files changed, 18020 insertions(+), 0 deletions(-)
+ create mode 100644 drivers/net/e1000e/82571.c
+ create mode 100644 drivers/net/e1000e/Makefile
+ create mode 100644 drivers/net/e1000e/defines.h
+ create mode 100644 drivers/net/e1000e/e1000.h
+ create mode 100644 drivers/net/e1000e/es2lan.c
+ create mode 100644 drivers/net/e1000e/ethtool.c
+ create mode 100644 drivers/net/e1000e/hw.h
+ create mode 100644 drivers/net/e1000e/ich8lan.c
+ create mode 100644 drivers/net/e1000e/lib.c
+ create mode 100644 drivers/net/e1000e/netdev.c
+ create mode 100644 drivers/net/e1000e/param.c
+ create mode 100644 drivers/net/e1000e/phy.c
+
+diff --git a/drivers/net/Kconfig b/drivers/net/Kconfig
+index 81ef81c..e5f2f02 100644
+--- a/drivers/net/Kconfig
++++ b/drivers/net/Kconfig
+@@ -2059,6 +2059,29 @@ config E1000_DISABLE_PACKET_SPLIT
+ 
+ 	  If in doubt, say N.
+ 
++config E1000E
++	tristate "Intel(R) PRO/1000 PCI-Express Gigabit Ethernet support"
++	depends on PCI
++	---help---
++	  This driver supports the PCI-Express Intel(R) PRO/1000 gigabit
++	  ethernet family of adapters. For PCI or PCI-X e1000 adapters,
++	  use the regular e1000 driver For more information on how to
++	  identify your adapter, go to the Adapter & Driver ID Guide at:
++
++	  <http://support.intel.com/support/network/adapter/pro100/21397.htm>
++
++	  For general information and support, go to the Intel support
++	  website at:
++
++	  <http://support.intel.com>
++
++	  More specific information on configuring the driver is in
++	  <file:Documentation/networking/e1000e.txt>.
++
++	  To compile this driver as a module, choose M here and read
++	  <file:Documentation/networking/net-modules.txt>.  The module
++	  will be called e1000e.
++
+ source "drivers/net/ixp2000/Kconfig"
+ 
+ config MYRI_SBUS
+diff --git a/drivers/net/Makefile b/drivers/net/Makefile
+index e684212..4140a0c 100644
+--- a/drivers/net/Makefile
++++ b/drivers/net/Makefile
+@@ -3,6 +3,7 @@
+ #
+ 
+ obj-$(CONFIG_E1000) += e1000/
++obj-$(CONFIG_E1000E) += e1000e/
+ obj-$(CONFIG_IBM_EMAC) += ibm_emac/
+ obj-$(CONFIG_IXGB) += ixgb/
+ obj-$(CONFIG_CHELSIO_T1) += chelsio/
+diff --git a/drivers/net/e1000e/82571.c b/drivers/net/e1000e/82571.c
+new file mode 100644
+index 0000000..a1b9d16
+--- /dev/null
++++ b/drivers/net/e1000e/82571.c
+@@ -0,0 +1,1382 @@
++/*******************************************************************************
++
++  Intel PRO/1000 Linux driver
++  Copyright(c) 1999 - 2007 Intel Corporation.
++
++  This program is free software; you can redistribute it and/or modify it
++  under the terms and conditions of the GNU General Public License,
++  version 2, as published by the Free Software Foundation.
++
++  This program is distributed in the hope 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.,
++  51 Franklin St - Fifth Floor, Boston, MA 02110-1301 USA.
++
++  The full GNU General Public License is included in this distribution in
++  the file called "COPYING".
++
++  Contact Information:
++  Linux NICS <linux.nics at intel.com>
++  e1000-devel Mailing List <e1000-devel at lists.sourceforge.net>
++  Intel Corporation, 5200 N.E. Elam Young Parkway, Hillsboro, OR 97124-6497
++
++*******************************************************************************/
++
++/*
++ * 82571EB Gigabit Ethernet Controller
++ * 82571EB Gigabit Ethernet Controller (Fiber)
++ * 82572EI Gigabit Ethernet Controller (Copper)
++ * 82572EI Gigabit Ethernet Controller (Fiber)
++ * 82572EI Gigabit Ethernet Controller
++ * 82573V Gigabit Ethernet Controller (Copper)
++ * 82573E Gigabit Ethernet Controller (Copper)
++ * 82573L Gigabit Ethernet Controller
++ */
++
++#include "e1000.h"
++
++#define ID_LED_RESERVED_F746 0xF746
++#define ID_LED_DEFAULT_82573 ((ID_LED_DEF1_DEF2 << 12) | \
++			      (ID_LED_OFF1_ON2  <<  8) | \
++			      (ID_LED_DEF1_DEF2 <<  4) | \
++			      (ID_LED_DEF1_DEF2))
++
++#define E1000_GCR_L1_ACT_WITHOUT_L0S_RX 0x08000000
++
++static s32 e1000_get_phy_id_82571(struct e1000_hw *hw);
++static s32 e1000_setup_copper_link_82571(struct e1000_hw *hw);
++static s32 e1000_setup_fiber_serdes_link_82571(struct e1000_hw *hw);
++static s32 e1000_get_phy_id_82571(struct e1000_hw *hw);
++static s32 e1000_write_nvm_eewr_82571(struct e1000_hw *hw, u16 offset,
++				      u16 words, u16 *data);
++static s32 e1000_fix_nvm_checksum_82571(struct e1000_hw *hw);
++static void e1000_initialize_hw_bits_82571(struct e1000_hw *hw);
++static s32 e1000_setup_link_82571(struct e1000_hw *hw);
++static void e1000_clear_hw_cntrs_82571(struct e1000_hw *hw);
++
++/**
++ *  e1000_init_phy_params_82571 - Init PHY func ptrs.
++ *  @hw: pointer to the HW structure
++ *
++ *  This is a function pointer entry point called by the api module.
++ **/
++static s32 e1000_init_phy_params_82571(struct e1000_hw *hw)
++{
++	struct e1000_phy_info *phy = &hw->phy;
++	s32 ret_val = E1000_SUCCESS;
++
++	if (hw->media_type != e1000_media_type_copper) {
++		phy->type = e1000_phy_none;
++		goto out;
++	}
++
++	phy->addr			 = 1;
++	phy->autoneg_mask		 = AUTONEG_ADVERTISE_SPEED_DEFAULT;
++	phy->reset_delay_us		 = 100;
++
++	switch (hw->mac.type) {
++	case e1000_82571:
++	case e1000_82572:
++		phy->type		 = e1000_phy_igp_2;
++		break;
++	case e1000_82573:
++		phy->type		 = e1000_phy_m88;
++		break;
++	default:
++		ret_val = -E1000_ERR_PHY;
++		goto out;
++		break;
++	}
++
++	/* This can only be done after all function pointers are setup. */
++	ret_val = e1000_get_phy_id_82571(hw);
++
++	/* Verify phy id */
++	switch (hw->mac.type) {
++	case e1000_82571:
++	case e1000_82572:
++		if (phy->id != IGP01E1000_I_PHY_ID) {
++			ret_val = -E1000_ERR_PHY;
++			goto out;
++		}
++		break;
++	case e1000_82573:
++		if (phy->id != M88E1111_I_PHY_ID) {
++			ret_val = -E1000_ERR_PHY;
++			goto out;
++		}
++		break;
++	default:
++		ret_val = -E1000_ERR_PHY;
++		goto out;
++		break;
++	}
++
++out:
++	return ret_val;
++}
++
++/**
++ *  e1000_init_nvm_params_82571 - Init NVM func ptrs.
++ *  @hw: pointer to the HW structure
++ *
++ *  This is a function pointer entry point called by the api module.
++ **/
++static s32 e1000_init_nvm_params_82571(struct e1000_hw *hw)
++{
++	struct e1000_nvm_info *nvm = &hw->nvm;
++	u32 eecd = er32(EECD);
++	u16 size;
++
++	nvm->opcode_bits = 8;
++	nvm->delay_usec = 1;
++	switch (nvm->override) {
++	case e1000_nvm_override_spi_large:
++		nvm->page_size = 32;
++		nvm->address_bits = 16;
++		break;
++	case e1000_nvm_override_spi_small:
++		nvm->page_size = 8;
++		nvm->address_bits = 8;
++		break;
++	default:
++		nvm->page_size = eecd & E1000_EECD_ADDR_BITS ? 32 : 8;
++		nvm->address_bits = eecd & E1000_EECD_ADDR_BITS ? 16 : 8;
++		break;
++	}
++
++	switch (hw->mac.type) {
++	case e1000_82573:
++		if (((eecd >> 15) & 0x3) == 0x3) {
++			nvm->type = e1000_nvm_flash_hw;
++			nvm->word_size = 2048;
++			/* Autonomous Flash update bit must be cleared due
++			 * to Flash update issue.
++			 */
++			eecd &= ~E1000_EECD_AUPDEN;
++			ew32(EECD, eecd);
++			break;
++		}
++		/* Fall Through */
++	default:
++		nvm->type	= e1000_nvm_eeprom_spi;
++		size = (u16)((eecd & E1000_EECD_SIZE_EX_MASK) >>
++				  E1000_EECD_SIZE_EX_SHIFT);
++		/* Added to a constant, "size" becomes the left-shift value
++		 * for setting word_size.
++		 */
++		size += NVM_WORD_SIZE_BASE_SHIFT;
++		nvm->word_size	= 1 << size;
++		break;
++	}
++
++	return E1000_SUCCESS;
++}
++
++/**
++ *  e1000_init_mac_params_82571 - Init MAC func ptrs.
++ *  @hw: pointer to the HW structure
++ *
++ *  This is a function pointer entry point called by the api module.
++ **/
++static s32 e1000_init_mac_params_82571(struct e1000_adapter *adapter)
++{
++	struct e1000_hw *hw = &adapter->hw;
++	struct e1000_mac_info *mac = &hw->mac;
++	struct e1000_mac_operations *func = &mac->ops;
++	s32 ret_val = E1000_SUCCESS;
++
++	/* Set media type */
++	switch (adapter->pdev->device) {
++	case E1000_DEV_ID_82571EB_FIBER:
++	case E1000_DEV_ID_82572EI_FIBER:
++	case E1000_DEV_ID_82571EB_QUAD_FIBER:
++		hw->media_type = e1000_media_type_fiber;
++		break;
++	case E1000_DEV_ID_82571EB_SERDES:
++	case E1000_DEV_ID_82572EI_SERDES:
++		hw->media_type = e1000_media_type_internal_serdes;
++		break;
++	default:
++		hw->media_type = e1000_media_type_copper;
++		break;
++	}
++
++	/* Set mta register count */
++	mac->mta_reg_count = 128;
++	/* Set rar entry count */
++	mac->rar_entry_count = E1000_RAR_ENTRIES;
++	/* Set if manageability features are enabled. */
++	mac->arc_subsystem_valid =
++		(er32(FWSM) & E1000_FWSM_MODE_MASK) ? 1 : 0;
++
++	/* check for link */
++	switch (hw->media_type) {
++	case e1000_media_type_copper:
++		func->setup_physical_interface = e1000_setup_copper_link_82571;
++		func->check_for_link = e1000_check_for_copper_link;
++		func->get_link_up_info = e1000_get_speed_and_duplex_copper;
++		break;
++	case e1000_media_type_fiber:
++		func->setup_physical_interface = e1000_setup_fiber_serdes_link_82571;
++		func->check_for_link = e1000_check_for_fiber_link;
++		func->get_link_up_info = e1000_get_speed_and_duplex_fiber_serdes;
++		break;
++	case e1000_media_type_internal_serdes:
++		func->setup_physical_interface = e1000_setup_fiber_serdes_link_82571;
++		func->check_for_link = e1000_check_for_serdes_link;
++		func->get_link_up_info = e1000_get_speed_and_duplex_fiber_serdes;
++		break;
++	default:
++		ret_val = -E1000_ERR_CONFIG;
++		goto out;
++		break;
++	}
++
++out:
++	return ret_val;
++}
++
++static s32 e1000_get_invariants_82571(struct e1000_adapter *adapter)
++{
++	struct e1000_hw *hw = &adapter->hw;
++	static int global_quad_port_a; /* global port a indication */
++	struct pci_dev *pdev = adapter->pdev;
++	u16 eeprom_data = 0;
++	int is_port_b = er32(STATUS) & E1000_STATUS_FUNC_1;
++	s32 rc;
++
++	rc = e1000_init_mac_params_82571(adapter);
++	if (rc)
++		return rc;
++
++	rc = e1000_init_nvm_params_82571(hw);
++	if (rc)
++		return rc;
++
++	rc = e1000_init_phy_params_82571(hw);
++	if (rc)
++		return rc;
++
++	/* tag quad port adapters first, it's used below */
++	switch (pdev->device) {
++	case E1000_DEV_ID_82571EB_QUAD_COPPER:
++	case E1000_DEV_ID_82571EB_QUAD_FIBER:
++	case E1000_DEV_ID_82571EB_QUAD_COPPER_LP:
++		adapter->flags |= FLAG_IS_QUAD_PORT;
++		/* mark the first port */
++		if (global_quad_port_a == 0)
++			adapter->flags |= FLAG_IS_QUAD_PORT_A;
++		/* Reset for multiple quad port adapters */
++		global_quad_port_a++;
++		if (global_quad_port_a == 4)
++			global_quad_port_a = 0;
++		break;
++	default:
++		break;
++	}
++
++	switch (adapter->hw.mac.type) {
++	case e1000_82571:
++		/* these dual ports don't have WoL on port B at all */
++		if (((pdev->device == E1000_DEV_ID_82571EB_FIBER) ||
++		     (pdev->device == E1000_DEV_ID_82571EB_SERDES) ||
++		     (pdev->device == E1000_DEV_ID_82571EB_COPPER)) &&
++		    (is_port_b))
++			adapter->flags &= ~FLAG_HAS_WOL;
++		/* quad ports only support WoL on port A */
++		if (adapter->flags & FLAG_IS_QUAD_PORT &&
++		    (!adapter->flags & FLAG_IS_QUAD_PORT_A))
++			adapter->flags &= ~FLAG_HAS_WOL;
++		break;
++
++	case e1000_82573:
++		if (pdev->device == E1000_DEV_ID_82573L) {
++			e1000_read_nvm(&adapter->hw, NVM_INIT_3GIO_3, 1,
++				       &eeprom_data);
++			if (eeprom_data & NVM_WORD1A_ASPM_MASK)
++				adapter->flags &= ~FLAG_HAS_JUMBO_FRAMES;
++		}
++		break;
++	default:
++		break;
++	}
++
++	return E1000_SUCCESS;
++}
++
++/**
++ *  e1000_get_phy_id_82571 - Retrieve the PHY ID and revision
++ *  @hw: pointer to the HW structure
++ *
++ *  Reads the PHY registers and stores the PHY ID and possibly the PHY
++ *  revision in the hardware structure.
++ **/
++static s32 e1000_get_phy_id_82571(struct e1000_hw *hw)
++{
++	struct e1000_phy_info *phy = &hw->phy;
++	s32 ret_val = E1000_SUCCESS;
++
++	switch (hw->mac.type) {
++	case e1000_82571:
++	case e1000_82572:
++		/* The 82571 firmware may still be configuring the PHY.
++		 * In this case, we cannot access the PHY until the
++		 * configuration is done.  So we explicitly set the
++		 * PHY ID. */
++		phy->id = IGP01E1000_I_PHY_ID;
++		break;
++	case e1000_82573:
++		ret_val = e1000_get_phy_id(hw);
++		break;
++	default:
++		ret_val = -E1000_ERR_PHY;
++		break;
++	}
++
++	return ret_val;
++}
++
++/**
++ *  e1000_get_hw_semaphore_82571 - Acquire hardware semaphore
++ *  @hw: pointer to the HW structure
++ *
++ *  Acquire the HW semaphore to access the PHY or NVM
++ **/
++static s32 e1000_get_hw_semaphore_82571(struct e1000_hw *hw)
++{
++	u32 swsm;
++	s32 ret_val = E1000_SUCCESS;
++	s32 timeout = hw->nvm.word_size + 1;
++	s32 i = 0;
++
++	/* Get the FW semaphore. */
++	for (i = 0; i < timeout; i++) {
++		swsm = er32(SWSM);
++		ew32(SWSM, swsm | E1000_SWSM_SWESMBI);
++
++		/* Semaphore acquired if bit latched */
++		if (er32(SWSM) & E1000_SWSM_SWESMBI)
++			break;
++
++		udelay(50);
++	}
++
++	if (i == timeout) {
++		/* Release semaphores */
++		e1000_put_hw_semaphore(hw);
++		hw_dbg(hw, "Driver can't access the NVM\n");
++		ret_val = -E1000_ERR_NVM;
++		goto out;
++	}
++
++out:
++	return ret_val;
++}
++
++/**
++ *  e1000_put_hw_semaphore_82571 - Release hardware semaphore
++ *  @hw: pointer to the HW structure
++ *
++ *  Release hardware semaphore used to access the PHY or NVM
++ **/
++static void e1000_put_hw_semaphore_82571(struct e1000_hw *hw)
++{
++	u32 swsm;
++
++	swsm = er32(SWSM);
++
++	swsm &= ~E1000_SWSM_SWESMBI;
++
++	ew32(SWSM, swsm);
++}
++
++/**
++ *  e1000_acquire_nvm_82571 - Request for access to the EEPROM
++ *  @hw: pointer to the HW structure
++ *
++ *  To gain access to the EEPROM, first we must obtain a hardware semaphore.
++ *  Then for non-82573 hardware, set the EEPROM access request bit and wait
++ *  for EEPROM access grant bit.  If the access grant bit is not set, release
++ *  hardware semaphore.
++ **/
++static s32 e1000_acquire_nvm_82571(struct e1000_hw *hw)
++{
++	s32 ret_val;
++
++	ret_val = e1000_get_hw_semaphore_82571(hw);
++	if (ret_val)
++		goto out;
++
++	if (hw->mac.type != e1000_82573)
++		ret_val = e1000_acquire_nvm(hw);
++
++	if (ret_val)
++		e1000_put_hw_semaphore_82571(hw);
++
++out:
++	return ret_val;
++}
++
++/**
++ *  e1000_release_nvm_82571 - Release exclusive access to EEPROM
++ *  @hw: pointer to the HW structure
++ *
++ *  Stop any current commands to the EEPROM and clear the EEPROM request bit.
++ **/
++static void e1000_release_nvm_82571(struct e1000_hw *hw)
++{
++	e1000_release_nvm(hw);
++	e1000_put_hw_semaphore_82571(hw);
++}
++
++/**
++ *  e1000_write_nvm_82571 - Write to EEPROM using appropriate interface
++ *  @hw: pointer to the HW structure
++ *  @offset: offset within the EEPROM to be written to
++ *  @words: number of words to write
++ *  @data: 16 bit word(s) to be written to the EEPROM
++ *
++ *  For non-82573 silicon, write data to EEPROM at offset using SPI interface.
++ *
++ *  If e1000_update_nvm_checksum is not called after this function, the
++ *  EEPROM will most likley contain an invalid checksum.
++ **/
++static s32 e1000_write_nvm_82571(struct e1000_hw *hw, u16 offset, u16 words,
++				 u16 *data)
++{
++	s32 ret_val = E1000_SUCCESS;
++
++	switch (hw->mac.type) {
++	case e1000_82573:
++		ret_val = e1000_write_nvm_eewr_82571(hw, offset, words, data);
++		break;
++	case e1000_82571:
++	case e1000_82572:
++		ret_val = e1000_write_nvm_spi(hw, offset, words, data);
++		break;
++	default:
++		ret_val = -E1000_ERR_NVM;
++		break;
++	}
++
++	return ret_val;
++}
++
++/**
++ *  e1000_update_nvm_checksum_82571 - Update EEPROM checksum
++ *  @hw: pointer to the HW structure
++ *
++ *  Updates the EEPROM checksum by reading/adding each word of the EEPROM
++ *  up to the checksum.  Then calculates the EEPROM checksum and writes the
++ *  value to the EEPROM.
++ **/
++static s32 e1000_update_nvm_checksum_82571(struct e1000_hw *hw)
++{
++	u32 eecd;
++	s32 ret_val;
++	u16 i;
++
++	ret_val = e1000_update_nvm_checksum_generic(hw);
++	if (ret_val)
++		goto out;
++
++	/* If our nvm is an EEPROM, then we're done
++	 * otherwise, commit the checksum to the flash NVM. */
++	if (hw->nvm.type != e1000_nvm_flash_hw)
++		goto out;
++
++	/* Check for pending operations. */
++	for (i = 0; i < E1000_FLASH_UPDATES; i++) {
++		msleep(1);
++		if ((er32(EECD) & E1000_EECD_FLUPD) == 0)
++			break;
++	}
++
++	if (i == E1000_FLASH_UPDATES) {
++		ret_val = -E1000_ERR_NVM;
++		goto out;
++	}
++
++	/* Reset the firmware if using STM opcode. */
++	if ((er32(FLOP) & 0xFF00) == E1000_STM_OPCODE) {
++		/* The enabling of and the actual reset must be done
++		 * in two write cycles.
++		 */
++		ew32(HICR, E1000_HICR_FW_RESET_ENABLE);
++		e1e_flush();
++		ew32(HICR, E1000_HICR_FW_RESET);
++	}
++
++	/* Commit the write to flash */
++	eecd = er32(EECD) | E1000_EECD_FLUPD;
++	ew32(EECD, eecd);
++
++	for (i = 0; i < E1000_FLASH_UPDATES; i++) {
++		msleep(1);
++		if ((er32(EECD) & E1000_EECD_FLUPD) == 0)
++			break;
++	}
++
++	if (i == E1000_FLASH_UPDATES) {
++		ret_val = -E1000_ERR_NVM;
++		goto out;
++	}
++
++out:
++	return ret_val;
++}
++
++/**
++ *  e1000_validate_nvm_checksum_82571 - Validate EEPROM checksum
++ *  @hw: pointer to the HW structure
++ *
++ *  Calculates the EEPROM checksum by reading/adding each word of the EEPROM
++ *  and then verifies that the sum of the EEPROM is equal to 0xBABA.
++ **/
++static s32 e1000_validate_nvm_checksum_82571(struct e1000_hw *hw)
++{
++	if (hw->nvm.type == e1000_nvm_flash_hw)
++		e1000_fix_nvm_checksum_82571(hw);
++
++	return e1000_validate_nvm_checksum_generic(hw);
++}
++
++/**
++ *  e1000_write_nvm_eewr_82571 - Write to EEPROM for 82573 silicon
++ *  @hw: pointer to the HW structure
++ *  @offset: offset within the EEPROM to be written to
++ *  @words: number of words to write
++ *  @data: 16 bit word(s) to be written to the EEPROM
++ *
++ *  After checking for invalid values, poll the EEPROM to ensure the previous
++ *  command has completed before trying to write the next word.  After write
++ *  poll for completion.
++ *
++ *  If e1000_update_nvm_checksum is not called after this function, the
++ *  EEPROM will most likley contain an invalid checksum.
++ **/
++static s32 e1000_write_nvm_eewr_82571(struct e1000_hw *hw, u16 offset,
++				      u16 words, u16 *data)
++{
++	struct e1000_nvm_info *nvm = &hw->nvm;
++	u32 i;
++	u32 eewr = 0;
++	s32 ret_val = 0;
++
++	/* A check for invalid values:  offset too large, too many words,
++	 * and not enough words. */
++	if ((offset >= nvm->word_size) || (words > (nvm->word_size - offset)) ||
++	    (words == 0)) {
++		hw_dbg(hw, "nvm parameter(s) out of bounds\n");
++		ret_val = -E1000_ERR_NVM;
++		goto out;
++	}
++
++	for (i = 0; i < words; i++) {
++		eewr = (data[i] << E1000_NVM_RW_REG_DATA) |
++		       ((offset+i) << E1000_NVM_RW_ADDR_SHIFT) |
++		       E1000_NVM_RW_REG_START;
++
++		ret_val = e1000_poll_eerd_eewr_done(hw, E1000_NVM_POLL_WRITE);
++		if (ret_val)
++			break;
++
++		ew32(EEWR, eewr);
++
++		ret_val = e1000_poll_eerd_eewr_done(hw, E1000_NVM_POLL_WRITE);
++		if (ret_val)
++			break;
++	}
++
++out:
++	return ret_val;
++}
++
++/**
++ *  e1000_get_cfg_done_82571 - Poll for configuration done
++ *  @hw: pointer to the HW structure
++ *
++ *  Reads the management control register for the config done bit to be set.
++ **/
++static s32 e1000_get_cfg_done_82571(struct e1000_hw *hw)
++{
++	s32 timeout = PHY_CFG_TIMEOUT;
++	s32 ret_val = E1000_SUCCESS;
++
++	while (timeout) {
++		if (er32(EEMNGCTL) &
++		    E1000_NVM_CFG_DONE_PORT_0)
++			break;
++		msleep(1);
++		timeout--;
++	}
++	if (!timeout) {
++		hw_dbg(hw, "MNG configuration cycle has not completed.\n");
++		ret_val = -E1000_ERR_RESET;
++		goto out;
++	}
++
++out:
++	return ret_val;
++}
++
++/**
++ *  e1000_set_d0_lplu_state_82571 - Set Low Power Linkup D0 state
++ *  @hw: pointer to the HW structure
++ *  @active: TRUE to enable LPLU, FALSE to disable
++ *
++ *  Sets the LPLU D0 state according to the active flag.  When activating LPLU
++ *  this function also disables smart speed and vice versa.  LPLU will not be
++ *  activated unless the device autonegotiation advertisement meets standards
++ *  of either 10 or 10/100 or 10/100/1000 at all duplexes.  This is a function
++ *  pointer entry point only called by PHY setup routines.
++ **/
++static s32 e1000_set_d0_lplu_state_82571(struct e1000_hw *hw, bool active)
++{
++	struct e1000_phy_info *phy = &hw->phy;
++	s32 ret_val;
++	u16 data;
++
++	ret_val = e1e_rphy(hw, IGP02E1000_PHY_POWER_MGMT, &data);
++	if (ret_val)
++		goto out;
++
++	if (active) {
++		data |= IGP02E1000_PM_D0_LPLU;
++		ret_val = e1e_wphy(hw, IGP02E1000_PHY_POWER_MGMT, data);
++		if (ret_val)
++			goto out;
++
++		/* When LPLU is enabled, we should disable SmartSpeed */
++		ret_val = e1e_rphy(hw, IGP01E1000_PHY_PORT_CONFIG, &data);
++		data &= ~IGP01E1000_PSCFR_SMART_SPEED;
++		ret_val = e1e_wphy(hw, IGP01E1000_PHY_PORT_CONFIG, data);
++		if (ret_val)
++			goto out;
++	} else {
++		data &= ~IGP02E1000_PM_D0_LPLU;
++		ret_val = e1e_wphy(hw, IGP02E1000_PHY_POWER_MGMT, data);
++		/* LPLU and SmartSpeed are mutually exclusive.  LPLU is used
++		 * during Dx states where the power conservation is most
++		 * important.  During driver activity we should enable
++		 * SmartSpeed, so performance is maintained. */
++		if (phy->smart_speed == e1000_smart_speed_on) {
++			ret_val = e1e_rphy(hw, IGP01E1000_PHY_PORT_CONFIG,
++						     &data);
++			if (ret_val)
++				goto out;
++
++			data |= IGP01E1000_PSCFR_SMART_SPEED;
++			ret_val = e1e_wphy(hw, IGP01E1000_PHY_PORT_CONFIG,
++						     data);
++			if (ret_val)
++				goto out;
++		} else if (phy->smart_speed == e1000_smart_speed_off) {
++			ret_val = e1e_rphy(hw, IGP01E1000_PHY_PORT_CONFIG,
++						     &data);
++			if (ret_val)
++				goto out;
++
++			data &= ~IGP01E1000_PSCFR_SMART_SPEED;
++			ret_val = e1e_wphy(hw, IGP01E1000_PHY_PORT_CONFIG,
++						     data);
++			if (ret_val)
++				goto out;
++		}
++	}
++
++out:
++	return ret_val;
++}
++
++/**
++ *  e1000_reset_hw_82571 - Reset hardware
++ *  @hw: pointer to the HW structure
++ *
++ *  This resets the hardware into a known state.  This is a
++ *  function pointer entry point called by the api module.
++ **/
++static s32 e1000_reset_hw_82571(struct e1000_hw *hw)
++{
++	u32 ctrl;
++	u32 extcnf_ctrl;
++	u32 ctrl_ext;
++	u32 icr;
++	s32 ret_val;
++	u16 i = 0;
++
++	/* Prevent the PCI-E bus from sticking if there is no TLP connection
++	 * on the last TLP read/write transaction when MAC is reset.
++	 */
++	ret_val = e1000_disable_pcie_master(hw);
++	if (ret_val)
++		hw_dbg(hw, "PCI-E Master disable polling has failed.\n");
++
++	hw_dbg(hw, "Masking off all interrupts\n");
++	ew32(IMC, 0xffffffff);
++
++	ew32(RCTL, 0);
++	ew32(TCTL, E1000_TCTL_PSP);
++	e1e_flush();
++
++	msleep(10);
++
++	/* Must acquire the MDIO ownership before MAC reset.
++	 * Ownership defaults to firmware after a reset. */
++	if (hw->mac.type == e1000_82573) {
++		extcnf_ctrl = er32(EXTCNF_CTRL);
++		extcnf_ctrl |= E1000_EXTCNF_CTRL_MDIO_SW_OWNERSHIP;
++
++		do {
++			ew32(EXTCNF_CTRL, extcnf_ctrl);
++			extcnf_ctrl = er32(EXTCNF_CTRL);
++
++			if (extcnf_ctrl & E1000_EXTCNF_CTRL_MDIO_SW_OWNERSHIP)
++				break;
++
++			extcnf_ctrl |= E1000_EXTCNF_CTRL_MDIO_SW_OWNERSHIP;
++
++			msleep(2);
++			i++;
++		} while (i < MDIO_OWNERSHIP_TIMEOUT);
++	}
++
++	ctrl = er32(CTRL);
++
++	hw_dbg(hw, "Issuing a global reset to MAC\n");
++	ew32(CTRL, ctrl | E1000_CTRL_RST);
++
++	if (hw->nvm.type == e1000_nvm_flash_hw) {
++		udelay(10);
++		ctrl_ext = er32(CTRL_EXT);
++		ctrl_ext |= E1000_CTRL_EXT_EE_RST;
++		ew32(CTRL_EXT, ctrl_ext);
++		e1e_flush();
++	}
++
++	ret_val = e1000_get_auto_rd_done(hw);
++	if (ret_val)
++		/* We don't want to continue accessing MAC registers. */
++		goto out;
++
++	/* Phy configuration from NVM just starts after EECD_AUTO_RD is set.
++	 * Need to wait for Phy configuration completion before accessing
++	 * NVM and Phy.
++	 */
++	if (hw->mac.type == e1000_82573)
++		msleep(25);
++
++	/* Clear any pending interrupt events. */
++	ew32(IMC, 0xffffffff);
++	icr = er32(ICR);
++
++out:
++	return ret_val;
++}
++
++/**
++ *  e1000_init_hw_82571 - Initialize hardware
++ *  @hw: pointer to the HW structure
++ *
++ *  This inits the hardware readying it for operation.
++ **/
++static s32 e1000_init_hw_82571(struct e1000_hw *hw)
++{
++	struct e1000_mac_info *mac = &hw->mac;
++	u32 reg_data;
++	s32 ret_val;
++	u16 i;
++	u16 rar_count = mac->rar_entry_count;
++
++	e1000_initialize_hw_bits_82571(hw);
++
++	/* Initialize identification LED */
++	ret_val = e1000_id_led_init(hw);
++	if (ret_val) {
++		hw_dbg(hw, "Error initializing identification LED\n");
++		goto out;
++	}
++
++	/* Disabling VLAN filtering */
++	hw_dbg(hw, "Initializing the IEEE VLAN\n");
++	e1000_clear_vfta(hw);
++
++	/* Setup the receive address. */
++	/* If, however, a locally administered address was assigned to the
++	 * 82571, we must reserve a RAR for it to work around an issue where
++	 * resetting one port will reload the MAC on the other port.
++	 */
++	if (e1000_get_laa_state_82571(hw))
++		rar_count--;
++	e1000_init_rx_addrs(hw, rar_count);
++
++	/* Zero out the Multicast HASH table */
++	hw_dbg(hw, "Zeroing the MTA\n");
++	for (i = 0; i < mac->mta_reg_count; i++)
++		E1000_WRITE_REG_ARRAY(hw, E1000_MTA, i, 0);
++
++	/* Setup link and flow control */
++	ret_val = e1000_setup_link_82571(hw);
++
++	/* Set the transmit descriptor write-back policy */
++	reg_data = er32(TXDCTL);
++	reg_data = (reg_data & ~E1000_TXDCTL_WTHRESH) |
++		   E1000_TXDCTL_FULL_TX_DESC_WB |
++		   E1000_TXDCTL_COUNT_DESC;
++	ew32(TXDCTL, reg_data);
++
++	/* ...for both queues. */
++	if (mac->type != e1000_82573) {
++		reg_data = er32(TXDCTL1);
++		reg_data = (reg_data & ~E1000_TXDCTL_WTHRESH) |
++			   E1000_TXDCTL_FULL_TX_DESC_WB |
++			   E1000_TXDCTL_COUNT_DESC;
++		ew32(TXDCTL1, reg_data);
++	} else {
++		e1000_enable_tx_pkt_filtering(hw);
++		reg_data = er32(GCR);
++		reg_data |= E1000_GCR_L1_ACT_WITHOUT_L0S_RX;
++		ew32(GCR, reg_data);
++	}
++
++	/* Clear all of the statistics registers (clear on read).  It is
++	 * important that we do this after we have tried to establish link
++	 * because the symbol error count will increment wildly if there
++	 * is no link.
++	 */
++	e1000_clear_hw_cntrs_82571(hw);
++
++out:
++	return ret_val;
++}
++
++/**
++ *  e1000_initialize_hw_bits_82571 - Initialize hardware-dependent bits
++ *  @hw: pointer to the HW structure
++ *
++ *  Initializes required hardware-dependent bits needed for normal operation.
++ **/
++static void e1000_initialize_hw_bits_82571(struct e1000_hw *hw)
++{
++	u32 reg;
++
++	/* Transmit Descriptor Control 0 */
++	reg = er32(TXDCTL);
++	reg |= (1 << 22);
++	ew32(TXDCTL, reg);
++
++	/* Transmit Descriptor Control 1 */
++	reg = er32(TXDCTL1);
++	reg |= (1 << 22);
++	ew32(TXDCTL1, reg);
++
++	/* Transmit Arbitration Control 0 */
++	reg = er32(TARC0);
++	reg &= ~(0xF << 27); /* 30:27 */
++	switch (hw->mac.type) {
++	case e1000_82571:
++	case e1000_82572:
++		reg |= (1 << 23) | (1 << 24) | (1 << 25) | (1 << 26);
++		break;
++	default:
++		break;
++	}
++	ew32(TARC0, reg);
++
++	/* Transmit Arbitration Control 1 */
++	reg = er32(TARC1);
++	switch (hw->mac.type) {
++	case e1000_82571:
++	case e1000_82572:
++		reg &= ~((1 << 29) | (1 << 30));
++		reg |= (1 << 22) | (1 << 24) | (1 << 25) | (1 << 26);
++		if (er32(TCTL) & E1000_TCTL_MULR)
++			reg &= ~(1 << 28);
++		else
++			reg |= (1 << 28);
++		ew32(TARC1, reg);
++		break;
++	default:
++		break;
++	}
++
++	/* Device Control */
++	if (hw->mac.type == e1000_82573) {
++		reg = er32(CTRL);
++		reg &= ~(1 << 29);
++		ew32(CTRL, reg);
++	}
++
++	/* Extended Device Control */
++	if (hw->mac.type == e1000_82573) {
++		reg = er32(CTRL_EXT);
++		reg &= ~(1 << 23);
++		reg |= (1 << 22);
++		ew32(CTRL_EXT, reg);
++	}
++}
++
++/**
++ *  e1000_clear_vfta - Clear VLAN filter table
++ *  @hw: pointer to the HW structure
++ *
++ *  Clears the register array which contains the VLAN filter table by
++ *  setting all the values to 0.
++ **/
++void e1000_clear_vfta(struct e1000_hw *hw)
++{
++	u32 offset;
++	u32 vfta_value = 0;
++	u32 vfta_offset = 0;
++	u32 vfta_bit_in_reg = 0;
++
++	if (hw->mac.type == e1000_82573) {
++		if (hw->mng_cookie.vlan_id != 0) {
++			/* The VFTA is a 4096b bit-field, each identifying
++			 * a single VLAN ID.  The following operations
++			 * determine which 32b entry (i.e. offset) into the
++			 * array we want to set the VLAN ID (i.e. bit) of
++			 * the manageability unit.
++			 */
++			vfta_offset = (hw->mng_cookie.vlan_id >>
++				       E1000_VFTA_ENTRY_SHIFT) &
++				      E1000_VFTA_ENTRY_MASK;
++			vfta_bit_in_reg = 1 << (hw->mng_cookie.vlan_id &
++					       E1000_VFTA_ENTRY_BIT_SHIFT_MASK);
++		}
++	}
++	for (offset = 0; offset < E1000_VLAN_FILTER_TBL_SIZE; offset++) {
++		/* If the offset we want to clear is the same offset of the
++		 * manageability VLAN ID, then clear all bits except that of
++		 * the manageability unit.
++		 */
++		vfta_value = (offset == vfta_offset) ? vfta_bit_in_reg : 0;
++		E1000_WRITE_REG_ARRAY(hw, E1000_VFTA, offset, vfta_value);
++		e1e_flush();
++	}
++}
++
++/**
++ *  e1000_mc_addr_list_update_82571 - Update Multicast addresses
++ *  @hw: pointer to the HW structure
++ *  @mc_addr_list: array of multicast addresses to program
++ *  @mc_addr_count: number of multicast addresses to program
++ *  @rar_used_count: the first RAR register free to program
++ *  @rar_count: total number of supported Receive Address Registers
++ *
++ *  Updates the Receive Address Registers and Multicast Table Array.
++ *  The caller must have a packed mc_addr_list of multicast addresses.
++ *  The parameter rar_count will usually be hw->mac.rar_entry_count
++ *  unless there are workarounds that change this.
++ **/
++static void e1000_mc_addr_list_update_82571(struct e1000_hw *hw,
++					    u8 *mc_addr_list,
++					    u32 mc_addr_count,
++					    u32 rar_used_count,
++					    u32 rar_count)
++{
++	if (e1000_get_laa_state_82571(hw))
++		rar_count--;
++
++	e1000_mc_addr_list_update_generic(hw, mc_addr_list, mc_addr_count,
++					  rar_used_count, rar_count);
++}
++
++/**
++ *  e1000_setup_link_82571 - Setup flow control and link settings
++ *  @hw: pointer to the HW structure
++ *
++ *  Determines which flow control settings to use, then configures flow
++ *  control.  Calls the appropriate media-specific link configuration
++ *  function.  Assuming the adapter has a valid link partner, a valid link
++ *  should be established.  Assumes the hardware has previously been reset
++ *  and the transmitter and receiver are not enabled.
++ **/
++static s32 e1000_setup_link_82571(struct e1000_hw *hw)
++{
++	/* 82573 does not have a word in the NVM to determine
++	 * the default flow control setting, so we explicitly
++	 * set it to full.
++	 */
++	if (hw->mac.type == e1000_82573)
++		hw->mac.fc = e1000_fc_full;
++
++	return e1000_setup_link(hw);
++}
++
++/**
++ *  e1000_setup_copper_link_82571 - Configure copper link settings
++ *  @hw: pointer to the HW structure
++ *
++ *  Configures the link for auto-neg or forced speed and duplex.  Then we check
++ *  for link, once link is established calls to configure collision distance
++ *  and flow control are called.
++ **/
++static s32 e1000_setup_copper_link_82571(struct e1000_hw *hw)
++{
++	u32 ctrl;
++	u32 led_ctrl;
++	s32 ret_val;
++
++	ctrl = er32(CTRL);
++	ctrl |= E1000_CTRL_SLU;
++	ctrl &= ~(E1000_CTRL_FRCSPD | E1000_CTRL_FRCDPX);
++	ew32(CTRL, ctrl);
++
++	switch (hw->phy.type) {
++	case e1000_phy_m88:
++		ret_val = e1000_copper_link_setup_m88(hw);
++		break;
++	case e1000_phy_igp_2:
++		ret_val = e1000_copper_link_setup_igp(hw);
++		/* Setup activity LED */
++		led_ctrl = er32(LEDCTL);
++		led_ctrl &= IGP_ACTIVITY_LED_MASK;
++		led_ctrl |= (IGP_ACTIVITY_LED_ENABLE | IGP_LED3_MODE);
++		ew32(LEDCTL, led_ctrl);
++		break;
++	default:
++		ret_val = -E1000_ERR_PHY;
++		break;
++	}
++
++	if (ret_val)
++		goto out;
++
++	ret_val = e1000_setup_copper_link(hw);
++
++out:
++	return ret_val;
++}
++
++/**
++ *  e1000_setup_fiber_serdes_link_82571 - Setup link for fiber/serdes
++ *  @hw: pointer to the HW structure
++ *
++ *  Configures collision distance and flow control for fiber and serdes links.
++ *  Upon successful setup, poll for link.
++ **/
++static s32 e1000_setup_fiber_serdes_link_82571(struct e1000_hw *hw)
++{
++	switch (hw->mac.type) {
++	case e1000_82571:
++	case e1000_82572:
++		/* If SerDes loopback mode is entered, there is no form
++		 * of reset to take the adapter out of that mode.  So we
++		 * have to explicitly take the adapter out of loopback
++		 * mode.  This prevents drivers from twidling their thumbs
++		 * if another tool failed to take it out of loopback mode.
++		 */
++		ew32(SCTL,
++				E1000_SCTL_DISABLE_SERDES_LOOPBACK);
++		break;
++	default:
++		break;
++	}
++
++	return e1000_setup_fiber_serdes_link(hw);
++}
++
++/**
++ *  e1000_valid_led_default_82571 - Verify a valid default LED config
++ *  @hw: pointer to the HW structure
++ *  @data: pointer to the NVM (EEPROM)
++ *
++ *  Read the EEPROM for the current default LED configuration.  If the
++ *  LED configuration is not valid, set to a valid LED configuration.
++ **/
++static s32 e1000_valid_led_default_82571(struct e1000_hw *hw, u16 *data)
++{
++	s32 ret_val;
++
++	ret_val = e1000_read_nvm(hw, NVM_ID_LED_SETTINGS, 1, data);
++	if (ret_val) {
++		hw_dbg(hw, "NVM Read Error\n");
++		goto out;
++	}
++
++	if (hw->mac.type == e1000_82573 &&
++	    *data == ID_LED_RESERVED_F746)
++		*data = ID_LED_DEFAULT_82573;
++	else if (*data == ID_LED_RESERVED_0000 ||
++		 *data == ID_LED_RESERVED_FFFF)
++		*data = ID_LED_DEFAULT;
++
++out:
++	return ret_val;
++}
++
++/**
++ *  e1000_get_laa_state_82571 - Get locally administered address state
++ *  @hw: pointer to the HW structure
++ *
++ *  Retrieve and return the current locally administed address state.
++ **/
++bool e1000_get_laa_state_82571(struct e1000_hw *hw)
++{
++	if (hw->mac.type != e1000_82571)
++		return 0;
++
++	return hw->dev_spec.e82571.laa_is_present;
++}
++
++/**
++ *  e1000_set_laa_state_82571 - Set locally administered address state
++ *  @hw: pointer to the HW structure
++ *  @state: enable/disable locally administered address
++ *
++ *  Enable/Disable the current locally administed address state.
++ **/
++void e1000_set_laa_state_82571(struct e1000_hw *hw, bool state)
++{
++	if (hw->mac.type != e1000_82571)
++		goto out;
++
++	hw->dev_spec.e82571.laa_is_present = state;
++
++	/* If workaround is activated... */
++	if (state)
++		/* Hold a copy of the LAA in RAR[14] This is done so that
++		 * between the time RAR[0] gets clobbered and the time it
++		 * gets fixed, the actual LAA is in one of the RARs and no
++		 * incoming packets directed to this port are dropped.
++		 * Eventually the LAA will be in RAR[0] and RAR[14].
++		 */
++		e1000_rar_set(hw, hw->mac.addr, hw->mac.rar_entry_count - 1);
++
++out:
++	return;
++}
++
++/**
++ *  e1000_fix_nvm_checksum_82571 - Fix EEPROM checksum
++ *  @hw: pointer to the HW structure
++ *
++ *  Verifies that the EEPROM has completed the update.  After updating the
++ *  EEPROM, we need to check bit 15 in work 0x23 for the checksum fix.  If
++ *  the checksum fix is not implemented, we need to set the bit and update
++ *  the checksum.  Otherwise, if bit 15 is set and the checksum is incorrect,
++ *  we need to return bad checksum.
++ **/
++static s32 e1000_fix_nvm_checksum_82571(struct e1000_hw *hw)
++{
++	struct e1000_nvm_info *nvm = &hw->nvm;
++	s32 ret_val = E1000_SUCCESS;
++	u16 data;
++
++	if (nvm->type != e1000_nvm_flash_hw)
++		goto out;
++
++	/* Check bit 4 of word 10h.  If it is 0, firmware is done updating
++	 * 10h-12h.  Checksum may need to be fixed.
++	 */
++	ret_val = e1000_read_nvm(hw, 0x10, 1, &data);
++	if (ret_val)
++		goto out;
++
++	if (!(data & 0x10)) {
++		/* Read 0x23 and check bit 15.  This bit is a 1
++		 * when the checksum has already been fixed.  If
++		 * the checksum is still wrong and this bit is a
++		 * 1, we need to return bad checksum.  Otherwise,
++		 * we need to set this bit to a 1 and update the
++		 * checksum.
++		 */
++		ret_val = e1000_read_nvm(hw, 0x23, 1, &data);
++		if (ret_val)
++			goto out;
++
++		if (!(data & 0x8000)) {
++			data |= 0x8000;
++			ret_val = e1000_write_nvm(hw, 0x23, 1, &data);
++			if (ret_val)
++				goto out;
++			ret_val = e1000_update_nvm_checksum(hw);
++		}
++	}
++
++out:
++	return ret_val;
++}
++
++/**
++ *  e1000_clear_hw_cntrs_82571 - Clear device specific hardware counters
++ *  @hw: pointer to the HW structure
++ *
++ *  Clears the hardware counters by reading the counter registers.
++ **/
++static void e1000_clear_hw_cntrs_82571(struct e1000_hw *hw)
++{
++	u32 temp;
++
++	e1000_clear_hw_cntrs_base(hw);
++
++	temp = er32(PRC64);
++	temp = er32(PRC127);
++	temp = er32(PRC255);
++	temp = er32(PRC511);
++	temp = er32(PRC1023);
++	temp = er32(PRC1522);
++	temp = er32(PTC64);
++	temp = er32(PTC127);
++	temp = er32(PTC255);
++	temp = er32(PTC511);
++	temp = er32(PTC1023);
++	temp = er32(PTC1522);
++
++	temp = er32(ALGNERRC);
++	temp = er32(RXERRC);
++	temp = er32(TNCRS);
++	temp = er32(CEXTERR);
++	temp = er32(TSCTC);
++	temp = er32(TSCTFC);
++
++	temp = er32(MGTPRC);
++	temp = er32(MGTPDC);
++	temp = er32(MGTPTC);
++
++	temp = er32(IAC);
++	temp = er32(ICRXOC);
++
++	temp = er32(ICRXPTC);
++	temp = er32(ICRXATC);
++	temp = er32(ICTXPTC);
++	temp = er32(ICTXATC);
++	temp = er32(ICTXQEC);
++	temp = er32(ICTXQMTC);
++	temp = er32(ICRXDMTC);
++}
++
++static struct e1000_mac_operations e82571_mac_ops = {
++	.mng_mode_enab		= E1000_MNG_IAMT_MODE << E1000_FWSM_MODE_SHIFT,
++	/* .check_for_link: media type dependent */
++	.cleanup_led		= e1000_cleanup_led_generic,
++	.clear_hw_cntrs		= e1000_clear_hw_cntrs_82571,
++	.get_bus_info		= e1000_get_bus_info_pcie,
++	/* .get_link_up_info: media type dependent */
++	.led_on			= e1000_led_on_generic,
++	.led_off		= e1000_led_off_generic,
++	.mc_addr_list_update	= e1000_mc_addr_list_update_82571,
++	.reset_hw		= e1000_reset_hw_82571,
++	.init_hw		= e1000_init_hw_82571,
++	.setup_link		= e1000_setup_link_82571,
++	/* .setup_physical_interface: media type dependent */
++};
++
++static struct e1000_phy_operations e82_phy_ops_igp = {
++	.acquire_phy		= e1000_get_hw_semaphore_82571,
++	.check_reset_block	= e1000_check_reset_block_generic,
++	.commit_phy		= NULL,
++	.force_speed_duplex	= e1000_phy_force_speed_duplex_igp,
++	.get_cfg_done		= e1000_get_cfg_done_82571,
++	.get_cable_length	= e1000_get_cable_length_igp_2,
++	.get_phy_info		= e1000_get_phy_info_igp,
++	.read_phy_reg		= e1000_read_phy_reg_igp,
++	.release_phy		= e1000_put_hw_semaphore_82571,
++	.reset_phy		= e1000_phy_hw_reset_generic,
++	.set_d0_lplu_state	= e1000_set_d0_lplu_state_82571,
++	.set_d3_lplu_state	= e1000_set_d3_lplu_state,
++	.write_phy_reg		= e1000_write_phy_reg_igp,
++};
++
++static struct e1000_phy_operations e82_phy_ops_m88 = {
++	.acquire_phy		= e1000_get_hw_semaphore_82571,
++	.check_reset_block	= e1000_check_reset_block_generic,
++	.commit_phy		= e1000_phy_sw_reset,
++	.force_speed_duplex	= e1000_phy_force_speed_duplex_m88,
++	.get_cfg_done		= e1000_get_cfg_done,
++	.get_cable_length	= e1000_get_cable_length_m88,
++	.get_phy_info		= e1000_get_phy_info_m88,
++	.read_phy_reg		= e1000_read_phy_reg_m88,
++	.release_phy		= e1000_put_hw_semaphore_82571,
++	.reset_phy		= e1000_phy_hw_reset_generic,
++	.set_d0_lplu_state	= e1000_set_d0_lplu_state_82571,
++	.set_d3_lplu_state	= e1000_set_d3_lplu_state,
++	.write_phy_reg		= e1000_write_phy_reg_m88,
++};
++
++static struct e1000_nvm_operations e82571_nvm_ops = {
++	.acquire_nvm		= e1000_acquire_nvm_82571,
++	.read_nvm		= e1000_read_nvm_spi,
++	.release_nvm		= e1000_release_nvm_82571,
++	.update_nvm		= e1000_update_nvm_checksum_82571,
++	.valid_led_default	= e1000_valid_led_default_82571,
++	.validate_nvm		= e1000_validate_nvm_checksum_82571,
++	.write_nvm		= e1000_write_nvm_82571,
++};
++
++static struct e1000_nvm_operations e82573_nvm_ops = {
++	.acquire_nvm		= e1000_acquire_nvm_82571,
++	.read_nvm		= e1000_read_nvm_eerd,
++	.release_nvm		= e1000_release_nvm_82571,
++	.update_nvm		= e1000_update_nvm_checksum_82571,
++	.valid_led_default	= e1000_valid_led_default_82571,
++	.validate_nvm		= e1000_validate_nvm_checksum_82571,
++	.write_nvm		= e1000_write_nvm_82571,
++};
++
++struct e1000_info e1000_82571_info = {
++	.mac			= e1000_82571,
++	.flags			= FLAG_HAS_HW_VLAN_FILTER
++				  | FLAG_HAS_JUMBO_FRAMES
++				  | FLAG_HAS_STATS_PTC_PRC
++				  | FLAG_HAS_WOL
++				  | FLAG_APME_IN_CTRL3
++				  | FLAG_RX_CSUM_ENABLED
++				  | FLAG_HAS_CTRLEXT_ON_LOAD
++				  | FLAG_HAS_STATS_ICR_ICT
++				  | FLAG_HAS_SMART_POWER_DOWN
++				  | FLAG_RESET_OVERWRITES_LAA /* errata */
++				  | FLAG_TARC_SPEED_MODE_BIT /* errata */
++				  | FLAG_APME_CHECK_PORT_B,
++	.pba			= 38,
++	.get_invariants		= e1000_get_invariants_82571,
++	.mac_ops		= &e82571_mac_ops,
++	.phy_ops		= &e82_phy_ops_igp,
++	.nvm_ops		= &e82571_nvm_ops,
++};
++
++struct e1000_info e1000_82572_info = {
++	.mac			= e1000_82572,
++	.flags			= FLAG_HAS_HW_VLAN_FILTER
++				  | FLAG_HAS_JUMBO_FRAMES
++				  | FLAG_HAS_STATS_PTC_PRC
++				  | FLAG_HAS_WOL
++				  | FLAG_APME_IN_CTRL3
++				  | FLAG_RX_CSUM_ENABLED
++				  | FLAG_HAS_CTRLEXT_ON_LOAD
++				  | FLAG_HAS_STATS_ICR_ICT
++				  | FLAG_TARC_SPEED_MODE_BIT, /* errata */
++	.pba			= 38,
++	.get_invariants		= e1000_get_invariants_82571,
++	.mac_ops		= &e82571_mac_ops,
++	.phy_ops		= &e82_phy_ops_igp,
++	.nvm_ops		= &e82571_nvm_ops,
++};
++
++struct e1000_info e1000_82573_info = {
++	.mac			= e1000_82573,
++	.flags			= FLAG_HAS_HW_VLAN_FILTER
++				  | FLAG_HAS_JUMBO_FRAMES
++				  | FLAG_HAS_STATS_PTC_PRC
++				  | FLAG_HAS_WOL
++				  | FLAG_APME_IN_CTRL3
++				  | FLAG_RX_CSUM_ENABLED
++				  | FLAG_HAS_STATS_ICR_ICT
++				  | FLAG_HAS_SMART_POWER_DOWN
++				  | FLAG_HAS_AMT
++				  | FLAG_HAS_ASPM
++				  | FLAG_HAS_ERT
++				  | FLAG_HAS_SWSM_ON_LOAD,
++	.pba			= 20,
++	.get_invariants		= e1000_get_invariants_82571,
++	.mac_ops		= &e82571_mac_ops,
++	.phy_ops		= &e82_phy_ops_m88,
++	.nvm_ops		= &e82573_nvm_ops,
++};
++
+diff --git a/drivers/net/e1000e/Makefile b/drivers/net/e1000e/Makefile
+new file mode 100644
+index 0000000..650f866
+--- /dev/null
++++ b/drivers/net/e1000e/Makefile
+@@ -0,0 +1,37 @@
++################################################################################
++#
++# Intel PRO/1000 Linux driver
++# Copyright(c) 1999 - 2007 Intel Corporation.
++#
++# This program is free software; you can redistribute it and/or modify it
++# under the terms and conditions of the GNU General Public License,
++# version 2, as published by the Free Software Foundation.
++#
++# This program is distributed in the hope 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.,
++# 51 Franklin St - Fifth Floor, Boston, MA 02110-1301 USA.
++#
++# The full GNU General Public License is included in this distribution in
++# the file called "COPYING".
++#
++# Contact Information:
++# Linux NICS <linux.nics at intel.com>
++# e1000-devel Mailing List <e1000-devel at lists.sourceforge.net>
++# Intel Corporation, 5200 N.E. Elam Young Parkway, Hillsboro, OR 97124-6497
++#
++################################################################################
++
++#
++# Makefile for the Intel(R) PRO/1000 ethernet driver
++#
++
++obj-$(CONFIG_E1000E) += e1000e.o
++
++e1000e-objs := 82571.o ich8lan.o es2lan.o \
++	       lib.o phy.o param.o ethtool.o netdev.o
++
+diff --git a/drivers/net/e1000e/defines.h b/drivers/net/e1000e/defines.h
+new file mode 100644
+index 0000000..e0a36f1
+--- /dev/null
++++ b/drivers/net/e1000e/defines.h
+@@ -0,0 +1,738 @@
++/*******************************************************************************
++
++  Intel PRO/1000 Linux driver
++  Copyright(c) 1999 - 2007 Intel Corporation.
++
++  This program is free software; you can redistribute it and/or modify it
++  under the terms and conditions of the GNU General Public License,
++  version 2, as published by the Free Software Foundation.
++
++  This program is distributed in the hope 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.,
++  51 Franklin St - Fifth Floor, Boston, MA 02110-1301 USA.
++
++  The full GNU General Public License is included in this distribution in
++  the file called "COPYING".
++
++  Contact Information:
++  Linux NICS <linux.nics at intel.com>
++  e1000-devel Mailing List <e1000-devel at lists.sourceforge.net>
++  Intel Corporation, 5200 N.E. Elam Young Parkway, Hillsboro, OR 97124-6497
++
++*******************************************************************************/
++
++#ifndef _E1000_DEFINES_H_
++#define _E1000_DEFINES_H_
++
++#define E1000_TXD_POPTS_IXSM 0x01       /* Insert IP checksum */
++#define E1000_TXD_POPTS_TXSM 0x02       /* Insert TCP/UDP checksum */
++#define E1000_TXD_CMD_EOP    0x01000000 /* End of Packet */
++#define E1000_TXD_CMD_IFCS   0x02000000 /* Insert FCS (Ethernet CRC) */
++#define E1000_TXD_CMD_IC     0x04000000 /* Insert Checksum */
++#define E1000_TXD_CMD_RS     0x08000000 /* Report Status */
++#define E1000_TXD_CMD_RPS    0x10000000 /* Report Packet Sent */
++#define E1000_TXD_CMD_DEXT   0x20000000 /* Descriptor extension (0 = legacy) */
++#define E1000_TXD_CMD_VLE    0x40000000 /* Add VLAN tag */
++#define E1000_TXD_CMD_IDE    0x80000000 /* Enable Tidv register */
++#define E1000_TXD_STAT_DD    0x00000001 /* Descriptor Done */
++#define E1000_TXD_STAT_EC    0x00000002 /* Excess Collisions */
++#define E1000_TXD_STAT_LC    0x00000004 /* Late Collisions */
++#define E1000_TXD_STAT_TU    0x00000008 /* Transmit underrun */
++#define E1000_TXD_CMD_TCP    0x01000000 /* TCP packet */
++#define E1000_TXD_CMD_IP     0x02000000 /* IP packet */
++#define E1000_TXD_CMD_TSE    0x04000000 /* TCP Seg enable */
++#define E1000_TXD_STAT_TC    0x00000004 /* Tx Underrun */
++
++/* Number of Transmit and Receive Descriptors must be a multiple of 8 */
++#define REQ_TX_DESCRIPTOR_MULTIPLE  8
++#define REQ_RX_DESCRIPTOR_MULTIPLE  8
++
++/* Definitions for power management and wakeup registers */
++/* Wake Up Control */
++#define E1000_WUC_APME       0x00000001 /* APM Enable */
++#define E1000_WUC_PME_EN     0x00000002 /* PME Enable */
++
++/* Wake Up Filter Control */
++#define E1000_WUFC_LNKC 0x00000001 /* Link Status Change Wakeup Enable */
++#define E1000_WUFC_MAG  0x00000002 /* Magic Packet Wakeup Enable */
++#define E1000_WUFC_EX   0x00000004 /* Directed Exact Wakeup Enable */
++#define E1000_WUFC_MC   0x00000008 /* Directed Multicast Wakeup Enable */
++#define E1000_WUFC_BC   0x00000010 /* Broadcast Wakeup Enable */
++
++/* Extended Device Control */
++#define E1000_CTRL_EXT_SDP7_DATA 0x00000080 /* Value of SW Defineable Pin 7 */
++#define E1000_CTRL_EXT_EE_RST    0x00002000 /* Reinitialize from EEPROM */
++#define E1000_CTRL_EXT_RO_DIS    0x00020000 /* Relaxed Ordering disable */
++#define E1000_CTRL_EXT_LINK_MODE_MASK 0x00C00000
++#define E1000_CTRL_EXT_LINK_MODE_PCIE_SERDES  0x00C00000
++#define E1000_CTRL_EXT_DRV_LOAD       0x10000000 /* Driver loaded bit for FW */
++#define E1000_CTRL_EXT_IAME           0x08000000 /* Interrupt acknowledge Auto-mask */
++#define E1000_CTRL_EXT_INT_TIMER_CLR  0x20000000 /* Clear Interrupt timers after IMS clear */
++
++/* Receive Decriptor bit definitions */
++#define E1000_RXD_STAT_DD       0x01    /* Descriptor Done */
++#define E1000_RXD_STAT_EOP      0x02    /* End of Packet */
++#define E1000_RXD_STAT_IXSM     0x04    /* Ignore checksum */
++#define E1000_RXD_STAT_VP       0x08    /* IEEE VLAN Packet */
++#define E1000_RXD_STAT_UDPCS    0x10    /* UDP xsum caculated */
++#define E1000_RXD_STAT_TCPCS    0x20    /* TCP xsum calculated */
++#define E1000_RXD_ERR_CE        0x01    /* CRC Error */
++#define E1000_RXD_ERR_SE        0x02    /* Symbol Error */
++#define E1000_RXD_ERR_SEQ       0x04    /* Sequence Error */
++#define E1000_RXD_ERR_CXE       0x10    /* Carrier Extension Error */
++#define E1000_RXD_ERR_TCPE      0x20    /* TCP/UDP Checksum Error */
++#define E1000_RXD_ERR_RXE       0x80    /* Rx Data Error */
++#define E1000_RXD_SPC_VLAN_MASK 0x0FFF  /* VLAN ID is in lower 12 bits */
++
++#define E1000_RXDEXT_STATERR_CE    0x01000000
++#define E1000_RXDEXT_STATERR_SE    0x02000000
++#define E1000_RXDEXT_STATERR_SEQ   0x04000000
++#define E1000_RXDEXT_STATERR_CXE   0x10000000
++#define E1000_RXDEXT_STATERR_RXE   0x80000000
++
++/* mask to determine if packets should be dropped due to frame errors */
++#define E1000_RXD_ERR_FRAME_ERR_MASK ( \
++    E1000_RXD_ERR_CE  |                \
++    E1000_RXD_ERR_SE  |                \
++    E1000_RXD_ERR_SEQ |                \
++    E1000_RXD_ERR_CXE |                \
++    E1000_RXD_ERR_RXE)
++
++/* Same mask, but for extended and packet split descriptors */
++#define E1000_RXDEXT_ERR_FRAME_ERR_MASK ( \
++    E1000_RXDEXT_STATERR_CE  |            \
++    E1000_RXDEXT_STATERR_SE  |            \
++    E1000_RXDEXT_STATERR_SEQ |            \
++    E1000_RXDEXT_STATERR_CXE |            \
++    E1000_RXDEXT_STATERR_RXE)
++
++#define E1000_RXDPS_HDRSTAT_HDRSP              0x00008000
++
++/* Management Control */
++#define E1000_MANC_SMBUS_EN      0x00000001 /* SMBus Enabled - RO */
++#define E1000_MANC_ASF_EN        0x00000002 /* ASF Enabled - RO */
++#define E1000_MANC_ARP_EN        0x00002000 /* Enable ARP Request Filtering */
++#define E1000_MANC_RCV_TCO_EN    0x00020000 /* Receive TCO Packets Enabled */
++#define E1000_MANC_BLK_PHY_RST_ON_IDE   0x00040000 /* Block phy resets */
++#define E1000_MANC_EN_MAC_ADDR_FILTER   0x00100000 /* Enable MAC address
++						    * filtering */
++#define E1000_MANC_EN_MNG2HOST   0x00200000 /* Enable MNG packets to host
++					     * memory */
++
++/* Receive Control */
++#define E1000_RCTL_EN             0x00000002    /* enable */
++#define E1000_RCTL_SBP            0x00000004    /* store bad packet */
++#define E1000_RCTL_UPE            0x00000008    /* unicast promiscuous enable */
++#define E1000_RCTL_MPE            0x00000010    /* multicast promiscuous enab */
++#define E1000_RCTL_LPE            0x00000020    /* long packet enable */
++#define E1000_RCTL_LBM_NO         0x00000000    /* no loopback mode */
++#define E1000_RCTL_LBM_MAC        0x00000040    /* MAC loopback mode */
++#define E1000_RCTL_LBM_TCVR       0x000000C0    /* tcvr loopback mode */
++#define E1000_RCTL_DTYP_PS        0x00000400    /* Packet Split descriptor */
++#define E1000_RCTL_RDMTS_HALF     0x00000000    /* rx desc min threshold size */
++#define E1000_RCTL_MO_SHIFT       12            /* multicast offset shift */
++#define E1000_RCTL_BAM            0x00008000    /* broadcast enable */
++/* these buffer sizes are valid if E1000_RCTL_BSEX is 0 */
++#define E1000_RCTL_SZ_2048        0x00000000    /* rx buffer size 2048 */
++#define E1000_RCTL_SZ_1024        0x00010000    /* rx buffer size 1024 */
++#define E1000_RCTL_SZ_512         0x00020000    /* rx buffer size 512 */
++#define E1000_RCTL_SZ_256         0x00030000    /* rx buffer size 256 */
++/* these buffer sizes are valid if E1000_RCTL_BSEX is 1 */
++#define E1000_RCTL_SZ_16384       0x00010000    /* rx buffer size 16384 */
++#define E1000_RCTL_SZ_8192        0x00020000    /* rx buffer size 8192 */
++#define E1000_RCTL_SZ_4096        0x00030000    /* rx buffer size 4096 */
++#define E1000_RCTL_VFE            0x00040000    /* vlan filter enable */
++#define E1000_RCTL_CFIEN          0x00080000    /* canonical form enable */
++#define E1000_RCTL_CFI            0x00100000    /* canonical form indicator */
++#define E1000_RCTL_BSEX           0x02000000    /* Buffer size extension */
++#define E1000_RCTL_SECRC          0x04000000    /* Strip Ethernet CRC */
++
++/* Use byte values for the following shift parameters
++ * Usage:
++ *     psrctl |= (((ROUNDUP(value0, 128) >> E1000_PSRCTL_BSIZE0_SHIFT) &
++ *                  E1000_PSRCTL_BSIZE0_MASK) |
++ *                ((ROUNDUP(value1, 1024) >> E1000_PSRCTL_BSIZE1_SHIFT) &
++ *                  E1000_PSRCTL_BSIZE1_MASK) |
++ *                ((ROUNDUP(value2, 1024) << E1000_PSRCTL_BSIZE2_SHIFT) &
++ *                  E1000_PSRCTL_BSIZE2_MASK) |
++ *                ((ROUNDUP(value3, 1024) << E1000_PSRCTL_BSIZE3_SHIFT) |;
++ *                  E1000_PSRCTL_BSIZE3_MASK))
++ * where value0 = [128..16256],  default=256
++ *       value1 = [1024..64512], default=4096
++ *       value2 = [0..64512],    default=4096
++ *       value3 = [0..64512],    default=0
++ */
++
++#define E1000_PSRCTL_BSIZE0_MASK   0x0000007F
++#define E1000_PSRCTL_BSIZE1_MASK   0x00003F00
++#define E1000_PSRCTL_BSIZE2_MASK   0x003F0000
++#define E1000_PSRCTL_BSIZE3_MASK   0x3F000000
++
++#define E1000_PSRCTL_BSIZE0_SHIFT  7            /* Shift _right_ 7 */
++#define E1000_PSRCTL_BSIZE1_SHIFT  2            /* Shift _right_ 2 */
++#define E1000_PSRCTL_BSIZE2_SHIFT  6            /* Shift _left_ 6 */
++#define E1000_PSRCTL_BSIZE3_SHIFT 14            /* Shift _left_ 14 */
++
++/* SWFW_SYNC Definitions */
++#define E1000_SWFW_EEP_SM   0x1
++#define E1000_SWFW_PHY0_SM  0x2
++#define E1000_SWFW_PHY1_SM  0x4
++
++/* Device Control */
++#define E1000_CTRL_FD       0x00000001  /* Full duplex.0=half; 1=full */
++#define E1000_CTRL_GIO_MASTER_DISABLE 0x00000004 /*Blocks new Master requests */
++#define E1000_CTRL_LRST     0x00000008  /* Link reset. 0=normal,1=reset */
++#define E1000_CTRL_ASDE     0x00000020  /* Auto-speed detect enable */
++#define E1000_CTRL_SLU      0x00000040  /* Set link up (Force Link) */
++#define E1000_CTRL_ILOS     0x00000080  /* Invert Loss-Of Signal */
++#define E1000_CTRL_SPD_SEL  0x00000300  /* Speed Select Mask */
++#define E1000_CTRL_SPD_10   0x00000000  /* Force 10Mb */
++#define E1000_CTRL_SPD_100  0x00000100  /* Force 100Mb */
++#define E1000_CTRL_SPD_1000 0x00000200  /* Force 1Gb */
++#define E1000_CTRL_FRCSPD   0x00000800  /* Force Speed */
++#define E1000_CTRL_FRCDPX   0x00001000  /* Force Duplex */
++#define E1000_CTRL_SWDPIN0  0x00040000  /* SWDPIN 0 value */
++#define E1000_CTRL_SWDPIN1  0x00080000  /* SWDPIN 1 value */
++#define E1000_CTRL_SWDPIO0  0x00400000  /* SWDPIN 0 Input or output */
++#define E1000_CTRL_RST      0x04000000  /* Global reset */
++#define E1000_CTRL_RFCE     0x08000000  /* Receive Flow Control enable */
++#define E1000_CTRL_TFCE     0x10000000  /* Transmit flow control enable */
++#define E1000_CTRL_VME      0x40000000  /* IEEE VLAN mode enable */
++#define E1000_CTRL_PHY_RST  0x80000000  /* PHY Reset */
++
++/* Bit definitions for the Management Data IO (MDIO) and Management Data
++ * Clock (MDC) pins in the Device Control Register.
++ */
++
++/* Device Status */
++#define E1000_STATUS_FD         0x00000001      /* Full duplex.0=half,1=full */
++#define E1000_STATUS_LU         0x00000002      /* Link up.0=no,1=link */
++#define E1000_STATUS_FUNC_MASK  0x0000000C      /* PCI Function Mask */
++#define E1000_STATUS_FUNC_SHIFT 2
++#define E1000_STATUS_FUNC_1     0x00000004      /* Function 1 */
++#define E1000_STATUS_TXOFF      0x00000010      /* transmission paused */
++#define E1000_STATUS_SPEED_10   0x00000000      /* Speed 10Mb/s */
++#define E1000_STATUS_SPEED_100  0x00000040      /* Speed 100Mb/s */
++#define E1000_STATUS_SPEED_1000 0x00000080      /* Speed 1000Mb/s */
++#define E1000_STATUS_LAN_INIT_DONE 0x00000200   /* Lan Init Completion by NVM */
++#define E1000_STATUS_GIO_MASTER_ENABLE 0x00080000 /* Status of Master requests. */
++
++/* Constants used to intrepret the masked PCI-X bus speed. */
++
++#define HALF_DUPLEX 1
++#define FULL_DUPLEX 2
++
++
++#define ADVERTISE_10_HALF                 0x0001
++#define ADVERTISE_10_FULL                 0x0002
++#define ADVERTISE_100_HALF                0x0004
++#define ADVERTISE_100_FULL                0x0008
++#define ADVERTISE_1000_HALF               0x0010 /* Not used, just FYI */
++#define ADVERTISE_1000_FULL               0x0020
++
++/* 1000/H is not supported, nor spec-compliant. */
++#define E1000_ALL_SPEED_DUPLEX ( ADVERTISE_10_HALF |   ADVERTISE_10_FULL | \
++				ADVERTISE_100_HALF |  ADVERTISE_100_FULL | \
++						     ADVERTISE_1000_FULL)
++#define E1000_ALL_NOT_GIG      ( ADVERTISE_10_HALF |   ADVERTISE_10_FULL | \
++				ADVERTISE_100_HALF |  ADVERTISE_100_FULL)
++#define E1000_ALL_100_SPEED    (ADVERTISE_100_HALF |  ADVERTISE_100_FULL)
++#define E1000_ALL_10_SPEED      (ADVERTISE_10_HALF |   ADVERTISE_10_FULL)
++#define E1000_ALL_HALF_DUPLEX   (ADVERTISE_10_HALF |  ADVERTISE_100_HALF)
++
++#define AUTONEG_ADVERTISE_SPEED_DEFAULT   E1000_ALL_SPEED_DUPLEX
++
++/* LED Control */
++#define E1000_LEDCTL_LED0_MODE_MASK       0x0000000F
++#define E1000_LEDCTL_LED0_MODE_SHIFT      0
++#define E1000_LEDCTL_LED0_IVRT            0x00000040
++#define E1000_LEDCTL_LED0_BLINK           0x00000080
++
++#define E1000_LEDCTL_MODE_LED_ON        0xE
++#define E1000_LEDCTL_MODE_LED_OFF       0xF
++
++/* Transmit Descriptor bit definitions */
++#define E1000_TXD_DTYP_D     0x00100000 /* Data Descriptor */
++#define E1000_TXD_POPTS_IXSM 0x01       /* Insert IP checksum */
++#define E1000_TXD_POPTS_TXSM 0x02       /* Insert TCP/UDP checksum */
++#define E1000_TXD_CMD_EOP    0x01000000 /* End of Packet */
++#define E1000_TXD_CMD_IFCS   0x02000000 /* Insert FCS (Ethernet CRC) */
++#define E1000_TXD_CMD_IC     0x04000000 /* Insert Checksum */
++#define E1000_TXD_CMD_RS     0x08000000 /* Report Status */
++#define E1000_TXD_CMD_RPS    0x10000000 /* Report Packet Sent */
++#define E1000_TXD_CMD_DEXT   0x20000000 /* Descriptor extension (0 = legacy) */
++#define E1000_TXD_CMD_VLE    0x40000000 /* Add VLAN tag */
++#define E1000_TXD_CMD_IDE    0x80000000 /* Enable Tidv register */
++#define E1000_TXD_STAT_DD    0x00000001 /* Descriptor Done */
++#define E1000_TXD_STAT_EC    0x00000002 /* Excess Collisions */
++#define E1000_TXD_STAT_LC    0x00000004 /* Late Collisions */
++#define E1000_TXD_STAT_TU    0x00000008 /* Transmit underrun */
++#define E1000_TXD_CMD_TCP    0x01000000 /* TCP packet */
++#define E1000_TXD_CMD_IP     0x02000000 /* IP packet */
++#define E1000_TXD_CMD_TSE    0x04000000 /* TCP Seg enable */
++#define E1000_TXD_STAT_TC    0x00000004 /* Tx Underrun */
++
++/* Transmit Control */
++#define E1000_TCTL_EN     0x00000002    /* enable tx */
++#define E1000_TCTL_PSP    0x00000008    /* pad short packets */
++#define E1000_TCTL_CT     0x00000ff0    /* collision threshold */
++#define E1000_TCTL_COLD   0x003ff000    /* collision distance */
++#define E1000_TCTL_RTLC   0x01000000    /* Re-transmit on late collision */
++#define E1000_TCTL_MULR   0x10000000    /* Multiple request support */
++
++/* Transmit Arbitration Count */
++
++/* SerDes Control */
++#define E1000_SCTL_DISABLE_SERDES_LOOPBACK 0x0400
++
++/* Receive Checksum Control */
++#define E1000_RXCSUM_TUOFL     0x00000200   /* TCP / UDP checksum offload */
++#define E1000_RXCSUM_IPPCSE    0x00001000   /* IP payload checksum enable */
++
++/* Header split receive */
++#define E1000_RFCTL_EXTEN               0x00008000
++#define E1000_RFCTL_IPV6_EX_DIS         0x00010000
++#define E1000_RFCTL_NEW_IPV6_EXT_DIS    0x00020000
++
++/* Collision related configuration parameters */
++#define E1000_COLLISION_THRESHOLD       15
++#define E1000_CT_SHIFT                  4
++#define E1000_COLLISION_DISTANCE        63
++#define E1000_COLD_SHIFT                12
++
++/* Default values for the transmit IPG register */
++#define DEFAULT_82543_TIPG_IPGT_COPPER 8
++
++#define E1000_TIPG_IPGT_MASK  0x000003FF
++
++#define DEFAULT_82543_TIPG_IPGR1 8
++#define E1000_TIPG_IPGR1_SHIFT  10
++
++#define DEFAULT_82543_TIPG_IPGR2 6
++#define DEFAULT_80003ES2LAN_TIPG_IPGR2 7
++#define E1000_TIPG_IPGR2_SHIFT  20
++
++#define MAX_JUMBO_FRAME_SIZE    0x3F00
++
++/* Extended Configuration Control and Size */
++#define E1000_EXTCNF_CTRL_MDIO_SW_OWNERSHIP      0x00000020
++#define E1000_EXTCNF_CTRL_LCD_WRITE_ENABLE       0x00000001
++#define E1000_EXTCNF_CTRL_SWFLAG                 0x00000020
++#define E1000_EXTCNF_SIZE_EXT_PCIE_LENGTH_MASK   0x00FF0000
++#define E1000_EXTCNF_SIZE_EXT_PCIE_LENGTH_SHIFT          16
++#define E1000_EXTCNF_CTRL_EXT_CNF_POINTER_MASK   0x0FFF0000
++#define E1000_EXTCNF_CTRL_EXT_CNF_POINTER_SHIFT          16
++
++#define E1000_PHY_CTRL_D0A_LPLU           0x00000002
++#define E1000_PHY_CTRL_NOND0A_LPLU        0x00000004
++#define E1000_PHY_CTRL_NOND0A_GBE_DISABLE 0x00000008
++#define E1000_PHY_CTRL_GBE_DISABLE        0x00000040
++
++#define E1000_KABGTXD_BGSQLBIAS           0x00050000
++
++/* PBA constants */
++#define E1000_PBA_8K  0x0008    /* 8KB, default Rx allocation */
++#define E1000_PBA_16K 0x0010    /* 16KB, default TX allocation */
++
++#define E1000_PBS_16K E1000_PBA_16K
++
++#define IFS_MAX       80
++#define IFS_MIN       40
++#define IFS_RATIO     4
++#define IFS_STEP      10
++#define MIN_NUM_XMITS 1000
++
++/* SW Semaphore Register */
++#define E1000_SWSM_SMBI         0x00000001 /* Driver Semaphore bit */
++#define E1000_SWSM_SWESMBI      0x00000002 /* FW Semaphore bit */
++#define E1000_SWSM_DRV_LOAD     0x00000008 /* Driver Loaded Bit */
++
++/* Interrupt Cause Read */
++#define E1000_ICR_TXDW          0x00000001 /* Transmit desc written back */
++#define E1000_ICR_LSC           0x00000004 /* Link Status Change */
++#define E1000_ICR_RXSEQ         0x00000008 /* rx sequence error */
++#define E1000_ICR_RXDMT0        0x00000010 /* rx desc min. threshold (0) */
++#define E1000_ICR_RXT0          0x00000080 /* rx timer intr (ring 0) */
++#define E1000_ICR_INT_ASSERTED  0x80000000 /* If this bit asserted, the driver should claim the interrupt */
++
++/* This defines the bits that are set in the Interrupt Mask
++ * Set/Read Register.  Each bit is documented below:
++ *   o RXT0   = Receiver Timer Interrupt (ring 0)
++ *   o TXDW   = Transmit Descriptor Written Back
++ *   o RXDMT0 = Receive Descriptor Minimum Threshold hit (ring 0)
++ *   o RXSEQ  = Receive Sequence Error
++ *   o LSC    = Link Status Change
++ */
++#define IMS_ENABLE_MASK ( \
++    E1000_IMS_RXT0   |    \
++    E1000_IMS_TXDW   |    \
++    E1000_IMS_RXDMT0 |    \
++    E1000_IMS_RXSEQ  |    \
++    E1000_IMS_LSC)
++
++/* Interrupt Mask Set */
++#define E1000_IMS_TXDW      E1000_ICR_TXDW      /* Transmit desc written back */
++#define E1000_IMS_LSC       E1000_ICR_LSC       /* Link Status Change */
++#define E1000_IMS_RXSEQ     E1000_ICR_RXSEQ     /* rx sequence error */
++#define E1000_IMS_RXDMT0    E1000_ICR_RXDMT0    /* rx desc min. threshold */
++#define E1000_IMS_RXT0      E1000_ICR_RXT0      /* rx timer intr */
++
++/* Interrupt Cause Set */
++#define E1000_ICS_LSC       E1000_ICR_LSC       /* Link Status Change */
++#define E1000_ICS_RXDMT0    E1000_ICR_RXDMT0    /* rx desc min. threshold */
++
++/* Transmit Descriptor Control */
++#define E1000_TXDCTL_PTHRESH 0x0000003F /* TXDCTL Prefetch Threshold */
++#define E1000_TXDCTL_WTHRESH 0x003F0000 /* TXDCTL Writeback Threshold */
++#define E1000_TXDCTL_FULL_TX_DESC_WB 0x01010000 /* GRAN=1, WTHRESH=1 */
++#define E1000_TXDCTL_MAX_TX_DESC_PREFETCH 0x0100001F /* GRAN=1, PTHRESH=31 */
++#define E1000_TXDCTL_COUNT_DESC 0x00400000 /* Enable the counting of desc.
++					      still to be processed. */
++
++/* Flow Control Constants */
++#define FLOW_CONTROL_ADDRESS_LOW  0x00C28001
++#define FLOW_CONTROL_ADDRESS_HIGH 0x00000100
++#define FLOW_CONTROL_TYPE         0x8808
++
++/* 802.1q VLAN Packet Size */
++#define E1000_VLAN_FILTER_TBL_SIZE 128  /* VLAN Filter Table (4096 bits) */
++
++/* Receive Address */
++/* Number of high/low register pairs in the RAR. The RAR (Receive Address
++ * Registers) holds the directed and multicast addresses that we monitor.
++ * Technically, we have 16 spots.  However, we reserve one of these spots
++ * (RAR[15]) for our directed address used by controllers with
++ * manageability enabled, allowing us room for 15 multicast addresses.
++ */
++#define E1000_RAR_ENTRIES     15
++#define E1000_RAH_AV  0x80000000        /* Receive descriptor valid */
++
++/* Error Codes */
++#define E1000_SUCCESS      0
++#define E1000_ERR_NVM      1
++#define E1000_ERR_PHY      2
++#define E1000_ERR_CONFIG   3
++#define E1000_ERR_PARAM    4
++#define E1000_ERR_MAC_INIT 5
++#define E1000_ERR_PHY_TYPE 6
++#define E1000_ERR_RESET   9
++#define E1000_ERR_MASTER_REQUESTS_PENDING 10
++#define E1000_ERR_HOST_INTERFACE_COMMAND 11
++#define E1000_BLK_PHY_RESET   12
++#define E1000_ERR_SWFW_SYNC 13
++#define E1000_NOT_IMPLEMENTED 14
++
++/* Loop limit on how long we wait for auto-negotiation to complete */
++#define FIBER_LINK_UP_LIMIT               50
++#define COPPER_LINK_UP_LIMIT              10
++#define PHY_AUTO_NEG_LIMIT                45
++#define PHY_FORCE_LIMIT                   20
++/* Number of 100 microseconds we wait for PCI Express master disable */
++#define MASTER_DISABLE_TIMEOUT      800
++/* Number of milliseconds we wait for PHY configuration done after MAC reset */
++#define PHY_CFG_TIMEOUT             100
++/* Number of 2 milliseconds we wait for acquiring MDIO ownership. */
++#define MDIO_OWNERSHIP_TIMEOUT      10
++/* Number of milliseconds for NVM auto read done after MAC reset. */
++#define AUTO_READ_DONE_TIMEOUT      10
++
++/* Flow Control */
++#define E1000_FCRTL_XONE 0x80000000     /* Enable XON frame transmission */
++
++/* Transmit Configuration Word */
++#define E1000_TXCW_FD         0x00000020        /* TXCW full duplex */
++#define E1000_TXCW_PAUSE      0x00000080        /* TXCW sym pause request */
++#define E1000_TXCW_ASM_DIR    0x00000100        /* TXCW astm pause direction */
++#define E1000_TXCW_PAUSE_MASK 0x00000180        /* TXCW pause request mask */
++#define E1000_TXCW_ANE        0x80000000        /* Auto-neg enable */
++
++/* Receive Configuration Word */
++#define E1000_RXCW_IV         0x08000000        /* Receive config invalid */
++#define E1000_RXCW_C          0x20000000        /* Receive config */
++#define E1000_RXCW_SYNCH      0x40000000        /* Receive config synch */
++
++/* PCI Express Control */
++#define E1000_GCR_RXD_NO_SNOOP          0x00000001
++#define E1000_GCR_RXDSCW_NO_SNOOP       0x00000002
++#define E1000_GCR_RXDSCR_NO_SNOOP       0x00000004
++#define E1000_GCR_TXD_NO_SNOOP          0x00000008
++#define E1000_GCR_TXDSCW_NO_SNOOP       0x00000010
++#define E1000_GCR_TXDSCR_NO_SNOOP       0x00000020
++
++#define PCIE_NO_SNOOP_ALL (E1000_GCR_RXD_NO_SNOOP         | \
++			   E1000_GCR_RXDSCW_NO_SNOOP      | \
++			   E1000_GCR_RXDSCR_NO_SNOOP      | \
++			   E1000_GCR_TXD_NO_SNOOP         | \
++			   E1000_GCR_TXDSCW_NO_SNOOP      | \
++			   E1000_GCR_TXDSCR_NO_SNOOP)
++
++/* PHY Control Register */
++#define MII_CR_FULL_DUPLEX      0x0100  /* FDX =1, half duplex =0 */
++#define MII_CR_RESTART_AUTO_NEG 0x0200  /* Restart auto negotiation */
++#define MII_CR_POWER_DOWN       0x0800  /* Power down */
++#define MII_CR_AUTO_NEG_EN      0x1000  /* Auto Neg Enable */
++#define MII_CR_LOOPBACK         0x4000  /* 0 = normal, 1 = loopback */
++#define MII_CR_RESET            0x8000  /* 0 = normal, 1 = PHY reset */
++#define MII_CR_SPEED_1000       0x0040
++#define MII_CR_SPEED_100        0x2000
++#define MII_CR_SPEED_10         0x0000
++
++/* PHY Status Register */
++#define MII_SR_LINK_STATUS       0x0004 /* Link Status 1 = link */
++#define MII_SR_AUTONEG_COMPLETE  0x0020 /* Auto Neg Complete */
++
++/* Autoneg Advertisement Register */
++#define NWAY_AR_10T_HD_CAPS      0x0020   /* 10T   Half Duplex Capable */
++#define NWAY_AR_10T_FD_CAPS      0x0040   /* 10T   Full Duplex Capable */
++#define NWAY_AR_100TX_HD_CAPS    0x0080   /* 100TX Half Duplex Capable */
++#define NWAY_AR_100TX_FD_CAPS    0x0100   /* 100TX Full Duplex Capable */
++#define NWAY_AR_PAUSE            0x0400   /* Pause operation desired */
++#define NWAY_AR_ASM_DIR          0x0800   /* Asymmetric Pause Direction bit */
++
++/* Link Partner Ability Register (Base Page) */
++#define NWAY_LPAR_PAUSE          0x0400 /* LP Pause operation desired */
++#define NWAY_LPAR_ASM_DIR        0x0800 /* LP Asymmetric Pause Direction bit */
++
++/* Autoneg Expansion Register */
++
++/* 1000BASE-T Control Register */
++#define CR_1000T_HD_CAPS         0x0100 /* Advertise 1000T HD capability */
++#define CR_1000T_FD_CAPS         0x0200 /* Advertise 1000T FD capability  */
++					/* 0=DTE device */
++#define CR_1000T_MS_VALUE        0x0800 /* 1=Configure PHY as Master */
++					/* 0=Configure PHY as Slave */
++#define CR_1000T_MS_ENABLE       0x1000 /* 1=Master/Slave manual config value */
++					/* 0=Automatic Master/Slave config */
++
++/* 1000BASE-T Status Register */
++#define SR_1000T_REMOTE_RX_STATUS 0x1000 /* Remote receiver OK */
++#define SR_1000T_LOCAL_RX_STATUS  0x2000 /* Local receiver OK */
++
++
++/* PHY 1000 MII Register/Bit Definitions */
++/* PHY Registers defined by IEEE */
++#define PHY_CONTROL      0x00 /* Control Register */
++#define PHY_STATUS       0x01 /* Status Regiser */
++#define PHY_ID1          0x02 /* Phy Id Reg (word 1) */
++#define PHY_ID2          0x03 /* Phy Id Reg (word 2) */
++#define PHY_AUTONEG_ADV  0x04 /* Autoneg Advertisement */
++#define PHY_LP_ABILITY   0x05 /* Link Partner Ability (Base Page) */
++#define PHY_1000T_CTRL   0x09 /* 1000Base-T Control Reg */
++#define PHY_1000T_STATUS 0x0A /* 1000Base-T Status Reg */
++
++/* NVM Control */
++#define E1000_EECD_SK        0x00000001 /* NVM Clock */
++#define E1000_EECD_CS        0x00000002 /* NVM Chip Select */
++#define E1000_EECD_DI        0x00000004 /* NVM Data In */
++#define E1000_EECD_DO        0x00000008 /* NVM Data Out */
++#define E1000_EECD_REQ       0x00000040 /* NVM Access Request */
++#define E1000_EECD_GNT       0x00000080 /* NVM Access Grant */
++#define E1000_EECD_SIZE      0x00000200 /* NVM Size (0=64 word 1=256 word) */
++#define E1000_EECD_ADDR_BITS 0x00000400 /* NVM Addressing bits based on type
++					 * (0-small, 1-large) */
++#define E1000_NVM_GRANT_ATTEMPTS   1000 /* NVM # attempts to gain grant */
++#define E1000_EECD_AUTO_RD          0x00000200  /* NVM Auto Read done */
++#define E1000_EECD_SIZE_EX_MASK     0x00007800  /* NVM Size */
++#define E1000_EECD_SIZE_EX_SHIFT     11
++#define E1000_EECD_FLUPD     0x00080000 /* Update FLASH */
++#define E1000_EECD_AUPDEN    0x00100000 /* Enable Autonomous FLASH update */
++#define E1000_EECD_SEC1VAL   0x00400000 /* Sector One Valid */
++
++#define E1000_NVM_RW_REG_DATA   16   /* Offset to data in NVM read/write registers */
++#define E1000_NVM_RW_REG_DONE   2    /* Offset to READ/WRITE done bit */
++#define E1000_NVM_RW_REG_START  1    /* Start operation */
++#define E1000_NVM_RW_ADDR_SHIFT 2    /* Shift to the address bits */
++#define E1000_NVM_POLL_WRITE    1    /* Flag for polling for write complete */
++#define E1000_NVM_POLL_READ     0    /* Flag for polling for read complete */
++#define E1000_FLASH_UPDATES  2000
++
++/* NVM Word Offsets */
++#define NVM_ID_LED_SETTINGS        0x0004
++#define NVM_INIT_CONTROL2_REG      0x000F
++#define NVM_INIT_CONTROL3_PORT_B   0x0014
++#define NVM_INIT_3GIO_3            0x001A
++#define NVM_INIT_CONTROL3_PORT_A   0x0024
++#define NVM_CFG                    0x0012
++#define NVM_CHECKSUM_REG           0x003F
++
++#define E1000_NVM_CFG_DONE_PORT_0  0x40000 /* MNG config cycle done */
++#define E1000_NVM_CFG_DONE_PORT_1  0x80000 /* ...for second port */
++
++/* Mask bits for fields in Word 0x0f of the NVM */
++#define NVM_WORD0F_PAUSE_MASK       0x3000
++#define NVM_WORD0F_PAUSE            0x1000
++#define NVM_WORD0F_ASM_DIR          0x2000
++
++/* Mask bits for fields in Word 0x1a of the NVM */
++#define NVM_WORD1A_ASPM_MASK  0x000C
++
++/* For checksumming, the sum of all words in the NVM should equal 0xBABA. */
++#define NVM_SUM                    0xBABA
++
++#define NVM_WORD_SIZE_BASE_SHIFT   6
++
++/* NVM Commands - Microwire */
++
++/* NVM Commands - SPI */
++#define NVM_MAX_RETRY_SPI          5000 /* Max wait of 5ms, for RDY signal */
++#define NVM_READ_OPCODE_SPI        0x03 /* NVM read opcode */
++#define NVM_WRITE_OPCODE_SPI       0x02 /* NVM write opcode */
++#define NVM_A8_OPCODE_SPI          0x08 /* opcode bit-3 = address bit-8 */
++#define NVM_WREN_OPCODE_SPI        0x06 /* NVM set Write Enable latch */
++#define NVM_RDSR_OPCODE_SPI        0x05 /* NVM read Status register */
++
++/* SPI NVM Status Register */
++#define NVM_STATUS_RDY_SPI         0x01
++
++/* Word definitions for ID LED Settings */
++#define ID_LED_RESERVED_0000 0x0000
++#define ID_LED_RESERVED_FFFF 0xFFFF
++#define ID_LED_DEFAULT       ((ID_LED_OFF1_ON2  << 12) | \
++			      (ID_LED_OFF1_OFF2 <<  8) | \
++			      (ID_LED_DEF1_DEF2 <<  4) | \
++			      (ID_LED_DEF1_DEF2))
++#define ID_LED_DEF1_DEF2     0x1
++#define ID_LED_DEF1_ON2      0x2
++#define ID_LED_DEF1_OFF2     0x3
++#define ID_LED_ON1_DEF2      0x4
++#define ID_LED_ON1_ON2       0x5
++#define ID_LED_ON1_OFF2      0x6
++#define ID_LED_OFF1_DEF2     0x7
++#define ID_LED_OFF1_ON2      0x8
++#define ID_LED_OFF1_OFF2     0x9
++
++#define IGP_ACTIVITY_LED_MASK   0xFFFFF0FF
++#define IGP_ACTIVITY_LED_ENABLE 0x0300
++#define IGP_LED3_MODE           0x07000000
++
++/* PCI/PCI-X/PCI-EX Config space */
++#define PCI_HEADER_TYPE_REGISTER     0x0E
++#define PCIE_LINK_STATUS             0x12
++
++#define PCI_HEADER_TYPE_MULTIFUNC    0x80
++#define PCIE_LINK_WIDTH_MASK         0x3F0
++#define PCIE_LINK_WIDTH_SHIFT        4
++
++#define PHY_REVISION_MASK      0xFFFFFFF0
++#define MAX_PHY_REG_ADDRESS    0x1F  /* 5 bit address bus (0-0x1F) */
++#define MAX_PHY_MULTI_PAGE_REG 0xF
++
++/* Bit definitions for valid PHY IDs. */
++/* I = Integrated
++ * E = External
++ */
++#define M88E1000_E_PHY_ID    0x01410C50
++#define M88E1000_I_PHY_ID    0x01410C30
++#define M88E1011_I_PHY_ID    0x01410C20
++#define IGP01E1000_I_PHY_ID  0x02A80380
++#define M88E1111_I_PHY_ID    0x01410CC0
++#define GG82563_E_PHY_ID     0x01410CA0
++#define IGP03E1000_E_PHY_ID  0x02A80390
++#define IFE_E_PHY_ID         0x02A80330
++#define IFE_PLUS_E_PHY_ID    0x02A80320
++#define IFE_C_E_PHY_ID       0x02A80310
++
++/* M88E1000 Specific Registers */
++#define M88E1000_PHY_SPEC_CTRL     0x10  /* PHY Specific Control Register */
++#define M88E1000_PHY_SPEC_STATUS   0x11  /* PHY Specific Status Register */
++#define M88E1000_EXT_PHY_SPEC_CTRL 0x14  /* Extended PHY Specific Control */
++
++#define M88E1000_PHY_PAGE_SELECT   0x1D  /* Reg 29 for page number setting */
++#define M88E1000_PHY_GEN_CONTROL   0x1E  /* Its meaning depends on reg 29 */
++
++/* M88E1000 PHY Specific Control Register */
++#define M88E1000_PSCR_POLARITY_REVERSAL 0x0002 /* 1=Polarity Reversal enabled */
++#define M88E1000_PSCR_MDI_MANUAL_MODE  0x0000  /* MDI Crossover Mode bits 6:5 */
++					       /* Manual MDI configuration */
++#define M88E1000_PSCR_MDIX_MANUAL_MODE 0x0020  /* Manual MDIX configuration */
++#define M88E1000_PSCR_AUTO_X_1000T     0x0040  /* 1000BASE-T: Auto crossover,
++						*  100BASE-TX/10BASE-T:
++						*  MDI Mode
++						*/
++#define M88E1000_PSCR_AUTO_X_MODE      0x0060  /* Auto crossover enabled
++						* all speeds.
++						*/
++					/* 1=Enable Extended 10BASE-T distance
++					 * (Lower 10BASE-T RX Threshold)
++					 * 0=Normal 10BASE-T RX Threshold */
++					/* 1=5-Bit interface in 100BASE-TX
++					 * 0=MII interface in 100BASE-TX */
++#define M88E1000_PSCR_ASSERT_CRS_ON_TX     0x0800 /* 1=Assert CRS on Transmit */
++
++/* M88E1000 PHY Specific Status Register */
++#define M88E1000_PSSR_REV_POLARITY       0x0002 /* 1=Polarity reversed */
++#define M88E1000_PSSR_DOWNSHIFT          0x0020 /* 1=Downshifted */
++#define M88E1000_PSSR_MDIX               0x0040 /* 1=MDIX; 0=MDI */
++#define M88E1000_PSSR_CABLE_LENGTH       0x0380 /* 0=<50M;1=50-80M;2=80-110M;
++					    * 3=110-140M;4=>140M */
++#define M88E1000_PSSR_SPEED              0xC000 /* Speed, bits 14:15 */
++#define M88E1000_PSSR_1000MBS            0x8000 /* 10=1000Mbs */
++
++#define M88E1000_PSSR_CABLE_LENGTH_SHIFT 7
++
++/* Number of times we will attempt to autonegotiate before downshifting if we
++ * are the master */
++#define M88E1000_EPSCR_MASTER_DOWNSHIFT_MASK 0x0C00
++#define M88E1000_EPSCR_MASTER_DOWNSHIFT_1X   0x0000
++/* Number of times we will attempt to autonegotiate before downshifting if we
++ * are the slave */
++#define M88E1000_EPSCR_SLAVE_DOWNSHIFT_MASK  0x0300
++#define M88E1000_EPSCR_SLAVE_DOWNSHIFT_1X    0x0100
++#define M88E1000_EPSCR_TX_CLK_25      0x0070 /* 25  MHz TX_CLK */
++
++/* M88EC018 Rev 2 specific DownShift settings */
++#define M88EC018_EPSCR_DOWNSHIFT_COUNTER_MASK  0x0E00
++#define M88EC018_EPSCR_DOWNSHIFT_COUNTER_5X    0x0800
++
++/* Bits...
++ * 15-5: page
++ * 4-0: register offset
++ */
++#define GG82563_PAGE_SHIFT        5
++#define GG82563_REG(page, reg)    \
++	(((page) << GG82563_PAGE_SHIFT) | ((reg) & MAX_PHY_REG_ADDRESS))
++#define GG82563_MIN_ALT_REG       30
++
++/* GG82563 Specific Registers */
++#define GG82563_PHY_SPEC_CTRL           \
++	GG82563_REG(0, 16) /* PHY Specific Control */
++#define GG82563_PHY_PAGE_SELECT         \
++	GG82563_REG(0, 22) /* Page Select */
++#define GG82563_PHY_SPEC_CTRL_2         \
++	GG82563_REG(0, 26) /* PHY Specific Control 2 */
++#define GG82563_PHY_PAGE_SELECT_ALT     \
++	GG82563_REG(0, 29) /* Alternate Page Select */
++
++#define GG82563_PHY_MAC_SPEC_CTRL       \
++	GG82563_REG(2, 21) /* MAC Specific Control Register */
++
++#define GG82563_PHY_DSP_DISTANCE    \
++	GG82563_REG(5, 26) /* DSP Distance */
++
++/* Page 193 - Port Control Registers */
++#define GG82563_PHY_KMRN_MODE_CTRL   \
++	GG82563_REG(193, 16) /* Kumeran Mode Control */
++#define GG82563_PHY_PWR_MGMT_CTRL       \
++	GG82563_REG(193, 20) /* Power Management Control */
++
++/* Page 194 - KMRN Registers */
++#define GG82563_PHY_INBAND_CTRL         \
++	GG82563_REG(194, 18) /* Inband Control */
++
++/* MDI Control */
++#define E1000_MDIC_REG_SHIFT 16
++#define E1000_MDIC_PHY_SHIFT 21
++#define E1000_MDIC_OP_WRITE  0x04000000
++#define E1000_MDIC_OP_READ   0x08000000
++#define E1000_MDIC_READY     0x10000000
++#define E1000_MDIC_ERROR     0x40000000
++
++/* SerDes Control */
++#define E1000_GEN_POLL_TIMEOUT          640
++
++#endif /* _E1000_DEFINES_H_ */
+diff --git a/drivers/net/e1000e/e1000.h b/drivers/net/e1000e/e1000.h
+new file mode 100644
+index 0000000..65c31d3
+--- /dev/null
++++ b/drivers/net/e1000e/e1000.h
+@@ -0,0 +1,518 @@
++/*******************************************************************************
++
++  Intel PRO/1000 Linux driver
++  Copyright(c) 1999 - 2007 Intel Corporation.
++
++  This program is free software; you can redistribute it and/or modify it
++  under the terms and conditions of the GNU General Public License,
++  version 2, as published by the Free Software Foundation.
++
++  This program is distributed in the hope 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.,
++  51 Franklin St - Fifth Floor, Boston, MA 02110-1301 USA.
++
++  The full GNU General Public License is included in this distribution in
++  the file called "COPYING".
++
++  Contact Information:
++  Linux NICS <linux.nics at intel.com>
++  e1000-devel Mailing List <e1000-devel at lists.sourceforge.net>
++  Intel Corporation, 5200 N.E. Elam Young Parkway, Hillsboro, OR 97124-6497
++
++*******************************************************************************/
++
++/* Linux PRO/1000 Ethernet Driver main header file */
++
++#ifndef _E1000_H_
++#define _E1000_H_
++
++#include <linux/netdevice.h>
++#include <linux/ethtool.h>
++#include <linux/pci.h>
++#include <asm/io.h>
++
++#include "hw.h"
++
++struct e1000_info;
++
++#define ndev_printk(level, netdev, format, arg...) \
++	printk(level "%s: %s: " format, (netdev)->dev.parent->bus_id, \
++	       (netdev)->name, ## arg)
++
++#ifdef DEBUG
++#define ndev_dbg(netdev, format, arg...) \
++	ndev_printk(KERN_DEBUG , netdev, format, ## arg)
++#else
++#define ndev_dbg(netdev, format, arg...) do { (void)(netdev); } while (0)
++#endif
++
++#define ndev_err(netdev, format, arg...) \
++	ndev_printk(KERN_ERR , netdev, format, ## arg)
++#define ndev_info(netdev, format, arg...) \
++	ndev_printk(KERN_INFO , netdev, format, ## arg)
++#define ndev_warn(netdev, format, arg...) \
++	ndev_printk(KERN_WARNING , netdev, format, ## arg)
++#define ndev_notice(netdev, format, arg...) \
++	ndev_printk(KERN_NOTICE , netdev, format, ## arg)
++
++
++/* TX/RX descriptor defines */
++#define E1000_DEFAULT_TXD		256
++#define E1000_MAX_TXD			4096
++#define E1000_MIN_TXD			80
++
++#define E1000_DEFAULT_RXD		256
++#define E1000_MAX_RXD			4096
++#define E1000_MIN_RXD			80
++
++/* Early Receive defines */
++#define E1000_ERT_2048			0x100
++
++#define E1000_FC_PAUSE_TIME		0x0680 /* 858 usec */
++
++/* How many Tx Descriptors do we need to call netif_wake_queue ? */
++/* How many Rx Buffers do we bundle into one write to the hardware ? */
++#define E1000_RX_BUFFER_WRITE		16 /* Must be power of 2 */
++
++#define AUTO_ALL_MODES			0
++#define E1000_EEPROM_APME		0x0400
++
++#define E1000_MNG_VLAN_NONE		(-1)
++
++/* Number of packet split data buffers (not including the header buffer) */
++#define PS_PAGE_BUFFERS			(MAX_PS_BUFFERS - 1)
++
++enum e1000_boards {
++	board_82571,
++	board_82572,
++	board_82573,
++	board_80003es2lan,
++	board_ich8lan,
++	board_ich9lan,
++};
++
++struct e1000_queue_stats {
++	u64 packets;
++	u64 bytes;
++};
++
++struct e1000_ps_page {
++	struct page *page;
++	u64 dma; /* must be u64 - written to hw */
++};
++
++/*
++ * wrappers around a pointer to a socket buffer,
++ * so a DMA handle can be stored along with the buffer
++ */
++struct e1000_buffer {
++	dma_addr_t dma;
++	struct sk_buff *skb;
++	union {
++		/* TX */
++		struct {
++			unsigned long time_stamp;
++			u16 length;
++			u16 next_to_watch;
++		};
++		/* RX */
++		struct page *page;
++	};
++
++};
++
++struct e1000_ring {
++	void *desc;			/* pointer to ring memory  */
++	dma_addr_t dma;			/* phys address of ring    */
++	unsigned int size;		/* length of ring in bytes */
++	unsigned int count;		/* number of desc. in ring */
++
++	u16 next_to_use;
++	u16 next_to_clean;
++
++	u16 head;
++	u16 tail;
++
++	/* array of buffer information structs */
++	struct e1000_buffer *buffer_info;
++
++	union {
++		/* for TX */
++		struct {
++			bool last_tx_tso; /* used to mark tso desc.  */
++		};
++		/* for RX */
++		struct {
++			/* arrays of page information for packet split */
++			struct e1000_ps_page *ps_pages;
++			struct sk_buff *rx_skb_top;
++		};
++	};
++
++	struct e1000_queue_stats stats;
++};
++
++/* board specific private data structure */
++struct e1000_adapter {
++	struct timer_list watchdog_timer;
++	struct timer_list phy_info_timer;
++	struct timer_list blink_timer;
++
++	struct work_struct reset_task;
++	struct work_struct watchdog_task;
++
++	const struct e1000_info *ei;
++
++	struct vlan_group *vlgrp;
++	u32 bd_number;
++	u32 rx_buffer_len;
++	u16 mng_vlan_id;
++	u16 link_speed;
++	u16 link_duplex;
++
++	spinlock_t tx_queue_lock; /* prevent concurrent tail updates */
++
++	/* this is still needed for 82571 and above */
++	atomic_t irq_sem;
++
++	/* track device up/down/testing state */
++	unsigned long state;
++
++	/* Interrupt Throttle Rate */
++	u32 itr;
++	u32 itr_setting;
++	u16 tx_itr;
++	u16 rx_itr;
++
++	/*
++	 * TX
++	 */
++	struct e1000_ring *tx_ring /* One per active queue */
++						____cacheline_aligned_in_smp;
++
++	unsigned long tx_queue_len;
++	unsigned int restart_queue;
++	u32 txd_cmd;
++
++	bool detect_tx_hung;
++	u8 tx_timeout_factor;
++
++	u32 tx_int_delay;
++	u32 tx_abs_int_delay;
++
++	unsigned int total_tx_bytes;
++	unsigned int total_tx_packets;
++	unsigned int total_rx_bytes;
++	unsigned int total_rx_packets;
++
++	/* TX stats */
++	u64 tpt_old;
++	u64 colc_old;
++	u64 gotcl_old;
++	u32 gotcl;
++	u32 tx_timeout_count;
++	u32 tx_fifo_head;
++	u32 tx_head_addr;
++	u32 tx_fifo_size;
++
++	/*
++	 * RX
++	 */
++	bool (*clean_rx) (struct e1000_adapter *adapter,
++			  int *work_done, int work_to_do)
++						____cacheline_aligned_in_smp;
++	void (*alloc_rx_buf) (struct e1000_adapter *adapter,
++			      int cleaned_count);
++	struct e1000_ring *rx_ring;
++
++	u32 rx_int_delay;
++	u32 rx_abs_int_delay;
++
++	/* RX stats */
++	u64 hw_csum_err;
++	u64 hw_csum_good;
++	u64 rx_hdr_split;
++	u64 gorcl_old;
++	u32 gorcl;
++	u32 alloc_rx_buff_failed;
++
++	unsigned int rx_ps_pages;
++	u16 rx_ps_bsize0;
++
++	/* OS defined structs */
++	struct net_device *netdev;
++	struct pci_dev *pdev;
++	struct net_device_stats net_stats;
++	spinlock_t stats_lock;      /* prevent concurrent stats updates */
++
++	/* structs defined in e1000_hw.h */
++	struct e1000_hw hw;
++
++	struct e1000_hw_stats stats;
++	struct e1000_phy_info phy_info;
++	struct e1000_phy_stats phy_stats;
++
++	struct e1000_ring test_tx_ring;
++	struct e1000_ring test_rx_ring;
++	u32 test_icr;
++
++	u32 msg_enable;
++
++	u32 eeprom_wol;
++	u32 wol;
++	u32 pba;
++
++	u8 fc_autoneg;
++
++	unsigned long led_status;
++
++	unsigned int flags;
++};
++
++struct e1000_info {
++	enum e1000_mac_type	mac;
++	unsigned int		flags;
++	u32			pba;
++	s32			(*get_invariants)(struct e1000_adapter *);
++	struct e1000_mac_operations *mac_ops;
++	struct e1000_phy_operations *phy_ops;
++	struct e1000_nvm_operations *nvm_ops;
++};
++
++/* hardware capability, feature, and workaround flags */
++#define FLAG_HAS_AMT                      (1 << 0)
++#define FLAG_HAS_FLASH                    (1 << 1)
++#define FLAG_HAS_HW_VLAN_FILTER           (1 << 2)
++#define FLAG_HAS_WOL                      (1 << 3)
++#define FLAG_HAS_ERT                      (1 << 4)
++#define FLAG_HAS_CTRLEXT_ON_LOAD          (1 << 5)
++#define FLAG_HAS_SWSM_ON_LOAD             (1 << 6)
++#define FLAG_HAS_JUMBO_FRAMES             (1 << 7)
++#define FLAG_HAS_ASPM                     (1 << 8)
++#define FLAG_HAS_STATS_ICR_ICT            (1 << 9)
++#define FLAG_HAS_STATS_PTC_PRC            (1 << 10)
++#define FLAG_HAS_SMART_POWER_DOWN         (1 << 11)
++#define FLAG_IS_QUAD_PORT_A               (1 << 12)
++#define FLAG_IS_QUAD_PORT                 (1 << 13)
++#define FLAG_TIPG_MEDIUM_FOR_80003ESLAN   (1 << 14)
++#define FLAG_APME_IN_WUC                  (1 << 15)
++#define FLAG_APME_IN_CTRL3                (1 << 16)
++#define FLAG_APME_CHECK_PORT_B            (1 << 17)
++#define FLAG_DISABLE_FC_PAUSE_TIME        (1 << 18)
++#define FLAG_NO_WAKE_UCAST                (1 << 19)
++#define FLAG_MNG_PT_ENABLED               (1 << 20)
++#define FLAG_RESET_OVERWRITES_LAA         (1 << 21)
++#define FLAG_TARC_SPEED_MODE_BIT          (1 << 22)
++#define FLAG_TARC_SET_BIT_ZERO            (1 << 23)
++#define FLAG_RX_NEEDS_RESTART             (1 << 24)
++#define FLAG_LSC_GIG_SPEED_DROP           (1 << 25)
++#define FLAG_SMART_POWER_DOWN             (1 << 26)
++#define FLAG_MSI_ENABLED                  (1 << 27)
++#define FLAG_RX_CSUM_ENABLED              (1 << 28)
++#define FLAG_TSO_FORCE                    (1 << 29)
++
++#define E1000_RX_DESC_PS(R, i)	    \
++	(&(((union e1000_rx_desc_packet_split *)((R).desc))[i]))
++#define E1000_GET_DESC(R, i, type)	(&(((struct type *)((R).desc))[i]))
++#define E1000_RX_DESC(R, i)		E1000_GET_DESC(R, i, e1000_rx_desc)
++#define E1000_TX_DESC(R, i)		E1000_GET_DESC(R, i, e1000_tx_desc)
++#define E1000_CONTEXT_DESC(R, i)	E1000_GET_DESC(R, i, e1000_context_desc)
++
++enum e1000_state_t {
++	__E1000_TESTING,
++	__E1000_RESETTING,
++	__E1000_DOWN
++};
++
++enum latency_range {
++	lowest_latency = 0,
++	low_latency = 1,
++	bulk_latency = 2,
++	latency_invalid = 255
++};
++
++extern char e1000_driver_name[];
++extern const char e1000_driver_version[];
++
++extern void e1000_check_options(struct e1000_adapter *adapter);
++extern void e1000_set_ethtool_ops(struct net_device *netdev);
++
++extern int e1000_up(struct e1000_adapter *adapter);
++extern void e1000_down(struct e1000_adapter *adapter);
++extern void e1000_reinit_locked(struct e1000_adapter *adapter);
++extern void e1000_reset(struct e1000_adapter *adapter);
++extern void e1000_power_up_phy(struct e1000_adapter *adapter);
++extern int e1000_setup_rx_resources(struct e1000_adapter *adapter);
++extern int e1000_setup_tx_resources(struct e1000_adapter *adapter);
++extern void e1000_free_rx_resources(struct e1000_adapter *adapter);
++extern void e1000_free_tx_resources(struct e1000_adapter *adapter);
++extern void e1000_update_stats(struct e1000_adapter *adapter);
++
++extern unsigned int copybreak;
++
++extern char *e1000_get_hw_dev_name(struct e1000_hw *hw);
++
++extern struct e1000_info e1000_82571_info;
++extern struct e1000_info e1000_82572_info;
++extern struct e1000_info e1000_82573_info;
++extern struct e1000_info e1000_ich8_info;
++extern struct e1000_info e1000_ich9_info;
++extern struct e1000_info e1000_es2_info;
++
++extern s32  e1000_commit_phy(struct e1000_hw *hw);
++extern s32  e1000_set_d0_lplu_state(struct e1000_hw *hw, bool active);
++
++extern bool e1000_enable_mng_pass_thru(struct e1000_hw *hw);
++
++extern bool e1000_get_laa_state_82571(struct e1000_hw *hw);
++extern void e1000_set_laa_state_82571(struct e1000_hw *hw, bool state);
++
++extern void e1000_set_kmrn_lock_loss_workaround_ich8lan(struct e1000_hw *hw,
++						 bool state);
++extern void e1000_igp3_phy_powerdown_workaround_ich8lan(struct e1000_hw *hw);
++extern void e1000_gig_downshift_workaround_ich8lan(struct e1000_hw *hw);
++
++extern s32 e1000_check_for_copper_link(struct e1000_hw *hw);
++extern s32 e1000_check_for_fiber_link(struct e1000_hw *hw);
++extern s32 e1000_check_for_serdes_link(struct e1000_hw *hw);
++extern s32 e1000_cleanup_led_generic(struct e1000_hw *hw);
++extern s32 e1000_led_on_generic(struct e1000_hw *hw);
++extern s32 e1000_led_off_generic(struct e1000_hw *hw);
++extern s32 e1000_get_bus_info_pcie(struct e1000_hw *hw);
++extern s32 e1000_get_speed_and_duplex_copper(struct e1000_hw *hw, u16 *speed, u16 *duplex);
++extern s32 e1000_get_speed_and_duplex_fiber_serdes(struct e1000_hw *hw, u16 *speed, u16 *duplex);
++extern s32 e1000_disable_pcie_master(struct e1000_hw *hw);
++extern s32 e1000_get_auto_rd_done(struct e1000_hw *hw);
++extern s32 e1000_id_led_init(struct e1000_hw *hw);
++extern void e1000_clear_hw_cntrs_base(struct e1000_hw *hw);
++extern s32 e1000_setup_fiber_serdes_link(struct e1000_hw *hw);
++extern s32 e1000_copper_link_setup_m88(struct e1000_hw *hw);
++extern s32 e1000_copper_link_setup_igp(struct e1000_hw *hw);
++extern s32 e1000_setup_link(struct e1000_hw *hw);
++extern void e1000_clear_vfta(struct e1000_hw *hw);
++extern void e1000_init_rx_addrs(struct e1000_hw *hw, u16 rar_count);
++extern void e1000_mc_addr_list_update_generic(struct e1000_hw *hw,
++				       u8 *mc_addr_list, u32 mc_addr_count,
++				       u32 rar_used_count, u32 rar_count);
++extern void e1000_rar_set(struct e1000_hw *hw, u8 *addr, u32 index);
++extern s32 e1000_set_fc_watermarks(struct e1000_hw *hw);
++extern void e1000_set_pcie_no_snoop(struct e1000_hw *hw, u32 no_snoop);
++extern s32 e1000_get_hw_semaphore(struct e1000_hw *hw);
++extern s32 e1000_valid_led_default(struct e1000_hw *hw, u16 *data);
++extern void e1000_config_collision_dist(struct e1000_hw *hw);
++extern s32 e1000_config_fc_after_link_up(struct e1000_hw *hw);
++extern s32 e1000_force_mac_fc(struct e1000_hw *hw);
++extern s32 e1000_blink_led(struct e1000_hw *hw);
++extern void e1000_write_vfta(struct e1000_hw *hw, u32 offset, u32 value);
++extern void e1000_reset_adaptive(struct e1000_hw *hw);
++extern void e1000_update_adaptive(struct e1000_hw *hw);
++
++extern s32 e1000_setup_copper_link(struct e1000_hw *hw);
++extern s32 e1000_get_phy_id(struct e1000_hw *hw);
++extern void e1000_put_hw_semaphore(struct e1000_hw *hw);
++extern s32 e1000_check_reset_block_generic(struct e1000_hw *hw);
++extern s32 e1000_phy_force_speed_duplex_igp(struct e1000_hw *hw);
++extern s32 e1000_get_cable_length_igp_2(struct e1000_hw *hw);
++extern s32 e1000_get_phy_info_igp(struct e1000_hw *hw);
++extern s32 e1000_read_phy_reg_igp(struct e1000_hw *hw, u32 offset, u16 *data);
++extern s32 e1000_phy_hw_reset_generic(struct e1000_hw *hw);
++extern s32 e1000_set_d3_lplu_state(struct e1000_hw *hw, bool active);
++extern s32 e1000_write_phy_reg_igp(struct e1000_hw *hw, u32 offset, u16 data);
++extern s32 e1000_phy_sw_reset(struct e1000_hw *hw);
++extern s32 e1000_phy_force_speed_duplex_m88(struct e1000_hw *hw);
++extern s32 e1000_get_cfg_done(struct e1000_hw *hw);
++extern s32 e1000_get_cable_length_m88(struct e1000_hw *hw);
++extern s32 e1000_get_phy_info_m88(struct e1000_hw *hw);
++extern s32 e1000_read_phy_reg_m88(struct e1000_hw *hw, u32 offset, u16 *data);
++extern s32 e1000_write_phy_reg_m88(struct e1000_hw *hw, u32 offset, u16 data);
++extern enum e1000_phy_type e1000_get_phy_type_from_id(u32 phy_id);
++extern void e1000_phy_force_speed_duplex_setup(struct e1000_hw *hw, u16 *phy_ctrl);
++extern s32 e1000_write_kmrn_reg(struct e1000_hw *hw, u32 offset, u16 data);
++extern s32 e1000_read_kmrn_reg(struct e1000_hw *hw, u32 offset, u16 *data);
++extern s32 e1000_phy_has_link_generic(struct e1000_hw *hw, u32 iterations,
++			       u32 usec_interval, bool *success);
++extern s32 e1000_phy_reset_dsp(struct e1000_hw *hw);
++extern s32 e1000_check_downshift(struct e1000_hw *hw);
++extern s32 e1000_wait_autoneg(struct e1000_hw *hw);
++
++static inline s32 e1000_phy_hw_reset(struct e1000_hw *hw)
++{
++	return hw->phy.ops.reset_phy(hw);
++}
++
++static inline s32 e1000_check_reset_block(struct e1000_hw *hw)
++{
++	return hw->phy.ops.check_reset_block(hw);
++}
++
++static inline s32 e1e_rphy(struct e1000_hw *hw, u32 offset, u16 *data)
++{
++	return hw->phy.ops.read_phy_reg(hw, offset, data);
++}
++
++static inline s32 e1e_wphy(struct e1000_hw *hw, u32 offset, u16 data)
++{
++	return hw->phy.ops.write_phy_reg(hw, offset, data);
++}
++
++static inline s32 e1000_get_cable_length(struct e1000_hw *hw)
++{
++	return hw->phy.ops.get_cable_length(hw);
++}
++
++extern s32 e1000_acquire_nvm(struct e1000_hw *hw);
++extern s32 e1000_write_nvm_spi(struct e1000_hw *hw, u16 offset, u16 words, u16 *data);
++extern s32 e1000_update_nvm_checksum_generic(struct e1000_hw *hw);
++extern s32 e1000_poll_eerd_eewr_done(struct e1000_hw *hw, int ee_reg);
++extern s32 e1000_read_nvm_spi(struct e1000_hw *hw, u16 offset, u16 words, u16 *data);
++extern s32 e1000_read_nvm_eerd(struct e1000_hw *hw, u16 offset, u16 words, u16 *data);
++extern s32 e1000_validate_nvm_checksum_generic(struct e1000_hw *hw);
++extern void e1000_release_nvm(struct e1000_hw *hw);
++extern void e1000_reload_nvm(struct e1000_hw *hw);
++extern s32 e1000_read_mac_addr(struct e1000_hw *hw);
++
++static inline s32 e1000_validate_nvm_checksum(struct e1000_hw *hw)
++{
++	return hw->nvm.ops.validate_nvm(hw);
++}
++
++static inline s32 e1000_update_nvm_checksum(struct e1000_hw *hw)
++{
++	return hw->nvm.ops.update_nvm(hw);
++}
++
++static inline s32 e1000_read_nvm(struct e1000_hw *hw, u16 offset, u16 words, u16 *data)
++{
++	return hw->nvm.ops.read_nvm(hw, offset, words, data);
++}
++
++static inline s32 e1000_write_nvm(struct e1000_hw *hw, u16 offset, u16 words, u16 *data)
++{
++	return hw->nvm.ops.write_nvm(hw, offset, words, data);
++}
++
++static inline s32 e1000_get_phy_info(struct e1000_hw *hw)
++{
++	return hw->phy.ops.get_phy_info(hw);
++}
++
++extern bool e1000_check_mng_mode(struct e1000_hw *hw);
++extern bool e1000_enable_tx_pkt_filtering(struct e1000_hw *hw);
++extern s32 e1000_mng_write_dhcp_info(struct e1000_hw *hw, u8 *buffer, u16 length);
++
++static inline u32 __er32(struct e1000_hw *hw, unsigned long reg)
++{
++	return readl(hw->hw_addr + reg);
++}
++
++static inline void __ew32(struct e1000_hw *hw, unsigned long reg, u32 val)
++{
++	writel(val, hw->hw_addr + reg);
++}
++
++#endif /* _E1000_H_ */
+diff --git a/drivers/net/e1000e/es2lan.c b/drivers/net/e1000e/es2lan.c
+new file mode 100644
+index 0000000..b5143e9
+--- /dev/null
++++ b/drivers/net/e1000e/es2lan.c
+@@ -0,0 +1,1255 @@
++/*******************************************************************************
++
++  Intel PRO/1000 Linux driver
++  Copyright(c) 1999 - 2007 Intel Corporation.
++
++  This program is free software; you can redistribute it and/or modify it
++  under the terms and conditions of the GNU General Public License,
++  version 2, as published by the Free Software Foundation.
++
++  This program is distributed in the hope 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.,
++  51 Franklin St - Fifth Floor, Boston, MA 02110-1301 USA.
++
++  The full GNU General Public License is included in this distribution in
++  the file called "COPYING".
++
++  Contact Information:
++  Linux NICS <linux.nics at intel.com>
++  e1000-devel Mailing List <e1000-devel at lists.sourceforge.net>
++  Intel Corporation, 5200 N.E. Elam Young Parkway, Hillsboro, OR 97124-6497
++
++*******************************************************************************/
++
++/*
++ * 80003ES2LAN Gigabit Ethernet Controller (Copper)
++ * 80003ES2LAN Gigabit Ethernet Controller (Serdes)
++ */
++
++#include "e1000.h"
++
++#define E1000_KMRNCTRLSTA_OFFSET_FIFO_CTRL	 0x00
++#define E1000_KMRNCTRLSTA_OFFSET_INB_CTRL	 0x02
++#define E1000_KMRNCTRLSTA_OFFSET_HD_CTRL	 0x10
++
++#define E1000_KMRNCTRLSTA_FIFO_CTRL_RX_BYPASS	 0x0008
++#define E1000_KMRNCTRLSTA_FIFO_CTRL_TX_BYPASS	 0x0800
++#define E1000_KMRNCTRLSTA_INB_CTRL_DIS_PADDING	 0x0010
++
++#define E1000_KMRNCTRLSTA_HD_CTRL_10_100_DEFAULT 0x0004
++#define E1000_KMRNCTRLSTA_HD_CTRL_1000_DEFAULT	 0x0000
++
++#define E1000_TCTL_EXT_GCEX_MASK 0x000FFC00 /* Gigabit Carry Extend Padding */
++#define DEFAULT_TCTL_EXT_GCEX_80003ES2LAN	 0x00010000
++
++#define DEFAULT_TIPG_IPGT_1000_80003ES2LAN	 0x8
++#define DEFAULT_TIPG_IPGT_10_100_80003ES2LAN	 0x9
++
++/* GG82563 PHY Specific Status Register (Page 0, Register 16 */
++#define GG82563_PSCR_POLARITY_REVERSAL_DISABLE	 0x0002 /* 1=Reversal Disab. */
++#define GG82563_PSCR_CROSSOVER_MODE_MASK	 0x0060
++#define GG82563_PSCR_CROSSOVER_MODE_MDI		 0x0000 /* 00=Manual MDI */
++#define GG82563_PSCR_CROSSOVER_MODE_MDIX	 0x0020 /* 01=Manual MDIX */
++#define GG82563_PSCR_CROSSOVER_MODE_AUTO	 0x0060 /* 11=Auto crossover */
++
++/* PHY Specific Control Register 2 (Page 0, Register 26) */
++#define GG82563_PSCR2_REVERSE_AUTO_NEG		 0x2000
++						/* 1=Reverse Auto-Negotiation */
++
++/* MAC Specific Control Register (Page 2, Register 21) */
++/* Tx clock speed for Link Down and 1000BASE-T for the following speeds */
++#define GG82563_MSCR_TX_CLK_MASK		 0x0007
++#define GG82563_MSCR_TX_CLK_10MBPS_2_5		 0x0004
++#define GG82563_MSCR_TX_CLK_100MBPS_25		 0x0005
++#define GG82563_MSCR_TX_CLK_1000MBPS_25		 0x0007
++
++#define GG82563_MSCR_ASSERT_CRS_ON_TX		 0x0010 /* 1=Assert */
++
++/* DSP Distance Register (Page 5, Register 26) */
++#define GG82563_DSPD_CABLE_LENGTH		 0x0007 /* 0 = <50M
++							   1 = 50-80M
++							   2 = 80-110M
++							   3 = 110-140M
++							   4 = >140M */
++
++/* Kumeran Mode Control Register (Page 193, Register 16) */
++#define GG82563_KMCR_PASS_FALSE_CARRIER		 0x0800
++
++/* Power Management Control Register (Page 193, Register 20) */
++#define GG82563_PMCR_ENABLE_ELECTRICAL_IDLE	 0x0001
++					   /* 1=Enable SERDES Electrical Idle */
++
++/* In-Band Control Register (Page 194, Register 18) */
++#define GG82563_ICR_DIS_PADDING			 0x0010 /* Disable Padding */
++
++/* A table for the GG82563 cable length where the range is defined
++ * with a lower bound at "index" and the upper bound at
++ * "index + 5".
++ */
++static const u16 e1000_gg82563_cable_length_table[] =
++	 { 0, 60, 115, 150, 150, 60, 115, 150, 180, 180, 0xFF };
++
++static s32 e1000_setup_copper_link_80003es2lan(struct e1000_hw *hw);
++static s32 e1000_acquire_swfw_sync_80003es2lan(struct e1000_hw *hw, u16 mask);
++static void e1000_release_swfw_sync_80003es2lan(struct e1000_hw *hw, u16 mask);
++static void e1000_initialize_hw_bits_80003es2lan(struct e1000_hw *hw);
++static void e1000_clear_hw_cntrs_80003es2lan(struct e1000_hw *hw);
++static s32 e1000_cfg_kmrn_1000_80003es2lan(struct e1000_hw *hw);
++static s32 e1000_cfg_kmrn_10_100_80003es2lan(struct e1000_hw *hw, u16 duplex);
++
++/**
++ *  e1000_init_phy_params_80003es2lan - Init ESB2 PHY func ptrs.
++ *  @hw: pointer to the HW structure
++ *
++ *  This is a function pointer entry point called by the api module.
++ **/
++static s32 e1000_init_phy_params_80003es2lan(struct e1000_hw *hw)
++{
++	struct e1000_phy_info *phy = &hw->phy;
++	s32 ret_val = E1000_SUCCESS;
++
++	if (hw->media_type != e1000_media_type_copper) {
++		phy->type	= e1000_phy_none;
++		goto out;
++	}
++
++	phy->addr		= 1;
++	phy->autoneg_mask	= AUTONEG_ADVERTISE_SPEED_DEFAULT;
++	phy->reset_delay_us      = 100;
++	phy->type		= e1000_phy_gg82563;
++
++	/* This can only be done after all function pointers are setup. */
++	ret_val = e1000_get_phy_id(hw);
++
++	/* Verify phy id */
++	if (phy->id != GG82563_E_PHY_ID) {
++		ret_val = -E1000_ERR_PHY;
++		goto out;
++	}
++
++out:
++	return ret_val;
++}
++
++/**
++ *  e1000_init_nvm_params_80003es2lan - Init ESB2 NVM func ptrs.
++ *  @hw: pointer to the HW structure
++ *
++ *  This is a function pointer entry point called by the api module.
++ **/
++static s32 e1000_init_nvm_params_80003es2lan(struct e1000_hw *hw)
++{
++	struct e1000_nvm_info *nvm = &hw->nvm;
++	u32 eecd = er32(EECD);
++	u16 size;
++
++	nvm->opcode_bits	= 8;
++	nvm->delay_usec	 = 1;
++	switch (nvm->override) {
++	case e1000_nvm_override_spi_large:
++		nvm->page_size    = 32;
++		nvm->address_bits = 16;
++		break;
++	case e1000_nvm_override_spi_small:
++		nvm->page_size    = 8;
++		nvm->address_bits = 8;
++		break;
++	default:
++		nvm->page_size    = eecd & E1000_EECD_ADDR_BITS ? 32 : 8;
++		nvm->address_bits = eecd & E1000_EECD_ADDR_BITS ? 16 : 8;
++		break;
++	}
++
++	nvm->type	       = e1000_nvm_eeprom_spi;
++
++	size = (u16)((eecd & E1000_EECD_SIZE_EX_MASK) >>
++			  E1000_EECD_SIZE_EX_SHIFT);
++
++	/* Added to a constant, "size" becomes the left-shift value
++	 * for setting word_size.
++	 */
++	size += NVM_WORD_SIZE_BASE_SHIFT;
++	nvm->word_size	= 1 << size;
++
++	return E1000_SUCCESS;
++}
++
++/**
++ *  e1000_init_mac_params_80003es2lan - Init ESB2 MAC func ptrs.
++ *  @hw: pointer to the HW structure
++ *
++ *  This is a function pointer entry point called by the api module.
++ **/
++static s32 e1000_init_mac_params_80003es2lan(struct e1000_adapter *adapter)
++{
++	struct e1000_hw *hw = &adapter->hw;
++	struct e1000_mac_info *mac = &hw->mac;
++	struct e1000_mac_operations *func = &mac->ops;
++	s32 ret_val = E1000_SUCCESS;
++
++	/* Set media type */
++	switch (adapter->pdev->device) {
++	case E1000_DEV_ID_80003ES2LAN_SERDES_DPT:
++		hw->media_type = e1000_media_type_internal_serdes;
++		break;
++	default:
++		hw->media_type = e1000_media_type_copper;
++		break;
++	}
++
++	/* Set mta register count */
++	mac->mta_reg_count = 128;
++	/* Set rar entry count */
++	mac->rar_entry_count = E1000_RAR_ENTRIES;
++	/* Set if manageability features are enabled. */
++	mac->arc_subsystem_valid =
++		(er32(FWSM) & E1000_FWSM_MODE_MASK) ? 1 : 0;
++
++	/* check for link */
++	switch (hw->media_type) {
++	case e1000_media_type_copper:
++		func->setup_physical_interface = e1000_setup_copper_link_80003es2lan;
++		func->check_for_link = e1000_check_for_copper_link;
++		break;
++	case e1000_media_type_fiber:
++		func->setup_physical_interface = e1000_setup_fiber_serdes_link;
++		func->check_for_link = e1000_check_for_fiber_link;
++		break;
++	case e1000_media_type_internal_serdes:
++		func->setup_physical_interface = e1000_setup_fiber_serdes_link;
++		func->check_for_link = e1000_check_for_serdes_link;
++		break;
++	default:
++		ret_val = -E1000_ERR_CONFIG;
++		goto out;
++		break;
++	}
++
++out:
++	return ret_val;
++}
++
++static s32 e1000_get_invariants_80003es2lan(struct e1000_adapter *adapter)
++{
++	struct e1000_hw *hw = &adapter->hw;
++	s32 rc;
++
++	rc = e1000_init_mac_params_80003es2lan(adapter);
++	if (rc)
++		return rc;
++
++	rc = e1000_init_nvm_params_80003es2lan(hw);
++	if (rc)
++		return rc;
++
++	rc = e1000_init_phy_params_80003es2lan(hw);
++	if (rc)
++		return rc;
++
++	return E1000_SUCCESS;
++}
++
++/**
++ *  e1000_acquire_phy_80003es2lan - Acquire rights to access PHY
++ *  @hw: pointer to the HW structure
++ *
++ *  A wrapper to acquire access rights to the correct PHY.  This is a
++ *  function pointer entry point called by the api module.
++ **/
++static s32 e1000_acquire_phy_80003es2lan(struct e1000_hw *hw)
++{
++	u16 mask;
++
++	mask = hw->bus.func ? E1000_SWFW_PHY1_SM : E1000_SWFW_PHY0_SM;
++
++	return e1000_acquire_swfw_sync_80003es2lan(hw, mask);
++}
++
++/**
++ *  e1000_release_phy_80003es2lan - Release rights to access PHY
++ *  @hw: pointer to the HW structure
++ *
++ *  A wrapper to release access rights to the correct PHY.  This is a
++ *  function pointer entry point called by the api module.
++ **/
++static void e1000_release_phy_80003es2lan(struct e1000_hw *hw)
++{
++	u16 mask;
++
++	mask = hw->bus.func ? E1000_SWFW_PHY1_SM : E1000_SWFW_PHY0_SM;
++	e1000_release_swfw_sync_80003es2lan(hw, mask);
++}
++
++/**
++ *  e1000_acquire_nvm_80003es2lan - Acquire rights to access NVM
++ *  @hw: pointer to the HW structure
++ *
++ *  Acquire the semaphore to access the EEPROM.  This is a function
++ *  pointer entry point called by the api module.
++ **/
++static s32 e1000_acquire_nvm_80003es2lan(struct e1000_hw *hw)
++{
++	s32 ret_val;
++
++	ret_val = e1000_acquire_swfw_sync_80003es2lan(hw, E1000_SWFW_EEP_SM);
++	if (ret_val)
++		goto out;
++
++	ret_val = e1000_acquire_nvm(hw);
++
++	if (ret_val)
++		e1000_release_swfw_sync_80003es2lan(hw, E1000_SWFW_EEP_SM);
++
++out:
++	return ret_val;
++}
++
++/**
++ *  e1000_release_nvm_80003es2lan - Relinquish rights to access NVM
++ *  @hw: pointer to the HW structure
++ *
++ *  Release the semaphore used to access the EEPROM.  This is a
++ *  function pointer entry point called by the api module.
++ **/
++static void e1000_release_nvm_80003es2lan(struct e1000_hw *hw)
++{
++	e1000_release_nvm(hw);
++	e1000_release_swfw_sync_80003es2lan(hw, E1000_SWFW_EEP_SM);
++}
++
++/**
++ *  e1000_acquire_swfw_sync_80003es2lan - Acquire SW/FW semaphore
++ *  @hw: pointer to the HW structure
++ *  @mask: specifies which semaphore to acquire
++ *
++ *  Acquire the SW/FW semaphore to access the PHY or NVM.  The mask
++ *  will also specify which port we're acquiring the lock for.
++ **/
++static s32 e1000_acquire_swfw_sync_80003es2lan(struct e1000_hw *hw, u16 mask)
++{
++	u32 swfw_sync;
++	u32 swmask = mask;
++	u32 fwmask = mask << 16;
++	s32 ret_val = E1000_SUCCESS;
++	s32 i = 0;
++	s32 timeout = 200;
++
++	while (i < timeout) {
++		if (e1000_get_hw_semaphore(hw)) {
++			ret_val = -E1000_ERR_SWFW_SYNC;
++			goto out;
++		}
++
++		swfw_sync = er32(SW_FW_SYNC);
++		if (!(swfw_sync & (fwmask | swmask)))
++			break;
++
++		/* Firmware currently using resource (fwmask)
++		 * or other software thread using resource (swmask) */
++		e1000_put_hw_semaphore(hw);
++		mdelay(5);
++		i++;
++	}
++
++	if (i == timeout) {
++		hw_dbg(hw,
++		       "Driver can't access resource, SW_FW_SYNC timeout.\n");
++		ret_val = -E1000_ERR_SWFW_SYNC;
++		goto out;
++	}
++
++	swfw_sync |= swmask;
++	ew32(SW_FW_SYNC, swfw_sync);
++
++	e1000_put_hw_semaphore(hw);
++
++out:
++	return ret_val;
++}
++
++/**
++ *  e1000_release_swfw_sync_80003es2lan - Release SW/FW semaphore
++ *  @hw: pointer to the HW structure
++ *  @mask: specifies which semaphore to acquire
++ *
++ *  Release the SW/FW semaphore used to access the PHY or NVM.  The mask
++ *  will also specify which port we're releasing the lock for.
++ **/
++static void e1000_release_swfw_sync_80003es2lan(struct e1000_hw *hw, u16 mask)
++{
++	u32 swfw_sync;
++
++	while (e1000_get_hw_semaphore(hw) != E1000_SUCCESS);
++	/* Empty */
++
++	swfw_sync = er32(SW_FW_SYNC);
++	swfw_sync &= ~mask;
++	ew32(SW_FW_SYNC, swfw_sync);
++
++	e1000_put_hw_semaphore(hw);
++}
++
++/**
++ *  e1000_read_phy_reg_gg82563_80003es2lan - Read GG82563 PHY register
++ *  @hw: pointer to the HW structure
++ *  @offset: offset of the register to read
++ *  @data: pointer to the data returned from the operation
++ *
++ *  Read the GG82563 PHY register.  This is a function pointer entry
++ *  point called by the api module.
++ **/
++static s32 e1000_read_phy_reg_gg82563_80003es2lan(struct e1000_hw *hw,
++						  u32 offset, u16 *data)
++{
++	s32 ret_val;
++	u32 page_select;
++	u16 temp;
++
++	/* Select Configuration Page */
++	if ((offset & MAX_PHY_REG_ADDRESS) < GG82563_MIN_ALT_REG)
++		page_select = GG82563_PHY_PAGE_SELECT;
++	else
++		/* Use Alternative Page Select register to access
++		 * registers 30 and 31
++		 */
++		page_select = GG82563_PHY_PAGE_SELECT_ALT;
++
++	temp = (u16)((u16)offset >> GG82563_PAGE_SHIFT);
++	ret_val = e1000_write_phy_reg_m88(hw, page_select, temp);
++	if (ret_val)
++		goto out;
++
++	/* The "ready" bit in the MDIC register may be incorrectly set
++	 * before the device has completed the "Page Select" MDI
++	 * transaction.  So we wait 200us after each MDI command...
++	 */
++	udelay(200);
++
++	/* ...and verify the command was successful. */
++	ret_val = e1000_read_phy_reg_m88(hw, page_select, &temp);
++
++	if (((u16)offset >> GG82563_PAGE_SHIFT) != temp) {
++		ret_val = -E1000_ERR_PHY;
++		goto out;
++	}
++
++	udelay(200);
++
++	ret_val = e1000_read_phy_reg_m88(hw,
++					 MAX_PHY_REG_ADDRESS & offset,
++					 data);
++
++	udelay(200);
++
++out:
++	return ret_val;
++}
++
++/**
++ *  e1000_write_phy_reg_gg82563_80003es2lan - Write GG82563 PHY register
++ *  @hw: pointer to the HW structure
++ *  @offset: offset of the register to read
++ *  @data: value to write to the register
++ *
++ *  Write to the GG82563 PHY register.  This is a function pointer entry
++ *  point called by the api module.
++ **/
++static s32 e1000_write_phy_reg_gg82563_80003es2lan(struct e1000_hw *hw,
++						   u32 offset, u16 data)
++{
++	s32 ret_val;
++	u32 page_select;
++	u16 temp;
++
++	/* Select Configuration Page */
++	if ((offset & MAX_PHY_REG_ADDRESS) < GG82563_MIN_ALT_REG)
++		page_select = GG82563_PHY_PAGE_SELECT;
++	else
++		/* Use Alternative Page Select register to access
++		 * registers 30 and 31
++		 */
++		page_select = GG82563_PHY_PAGE_SELECT_ALT;
++
++	temp = (u16)((u16)offset >> GG82563_PAGE_SHIFT);
++	ret_val = e1000_write_phy_reg_m88(hw, page_select, temp);
++	if (ret_val)
++		goto out;
++
++
++	/* The "ready" bit in the MDIC register may be incorrectly set
++	 * before the device has completed the "Page Select" MDI
++	 * transaction.  So we wait 200us after each MDI command...
++	 */
++	udelay(200);
++
++	/* ...and verify the command was successful. */
++	ret_val = e1000_read_phy_reg_m88(hw, page_select, &temp);
++
++	if (((u16)offset >> GG82563_PAGE_SHIFT) != temp) {
++		ret_val = -E1000_ERR_PHY;
++		goto out;
++	}
++
++	udelay(200);
++
++	ret_val = e1000_write_phy_reg_m88(hw,
++					  MAX_PHY_REG_ADDRESS & offset,
++					  data);
++
++	udelay(200);
++
++out:
++	return ret_val;
++}
++
++/**
++ *  e1000_write_nvm_80003es2lan - Write to ESB2 NVM
++ *  @hw: pointer to the HW structure
++ *  @offset: offset of the register to read
++ *  @words: number of words to write
++ *  @data: buffer of data to write to the NVM
++ *
++ *  Write "words" of data to the ESB2 NVM.  This is a function
++ *  pointer entry point called by the api module.
++ **/
++static s32 e1000_write_nvm_80003es2lan(struct e1000_hw *hw, u16 offset,
++				       u16 words, u16 *data)
++{
++	return e1000_write_nvm_spi(hw, offset, words, data);
++}
++
++/**
++ *  e1000_get_cfg_done_80003es2lan - Wait for configuration to complete
++ *  @hw: pointer to the HW structure
++ *
++ *  Wait a specific amount of time for manageability processes to complete.
++ *  This is a function pointer entry point called by the phy module.
++ **/
++static s32 e1000_get_cfg_done_80003es2lan(struct e1000_hw *hw)
++{
++	s32 timeout = PHY_CFG_TIMEOUT;
++	s32 ret_val = E1000_SUCCESS;
++	u32 mask = E1000_NVM_CFG_DONE_PORT_0;
++
++	if (hw->bus.func == 1)
++		mask = E1000_NVM_CFG_DONE_PORT_1;
++
++	while (timeout) {
++		if (er32(EEMNGCTL) & mask)
++			break;
++		msleep(1);
++		timeout--;
++	}
++	if (!timeout) {
++		hw_dbg(hw, "MNG configuration cycle has not completed.\n");
++		ret_val = -E1000_ERR_RESET;
++		goto out;
++	}
++
++out:
++	return ret_val;
++}
++
++/**
++ *  e1000_phy_force_speed_duplex_80003es2lan - Force PHY speed and duplex
++ *  @hw: pointer to the HW structure
++ *
++ *  Force the speed and duplex settings onto the PHY.  This is a
++ *  function pointer entry point called by the phy module.
++ **/
++static s32 e1000_phy_force_speed_duplex_80003es2lan(struct e1000_hw *hw)
++{
++	s32 ret_val;
++	u16 phy_data;
++	bool link;
++
++	/* Clear Auto-Crossover to force MDI manually.  M88E1000 requires MDI
++	 * forced whenever speed and duplex are forced.
++	 */
++	ret_val = e1e_rphy(hw, M88E1000_PHY_SPEC_CTRL, &phy_data);
++	if (ret_val)
++		goto out;
++
++	phy_data &= ~GG82563_PSCR_CROSSOVER_MODE_AUTO;
++	ret_val = e1e_wphy(hw, GG82563_PHY_SPEC_CTRL, phy_data);
++	if (ret_val)
++		goto out;
++
++	hw_dbg(hw, "GG82563 PSCR: %X\n", phy_data);
++
++	ret_val = e1e_rphy(hw, PHY_CONTROL, &phy_data);
++	if (ret_val)
++		goto out;
++
++	e1000_phy_force_speed_duplex_setup(hw, &phy_data);
++
++	/* Reset the phy to commit changes. */
++	phy_data |= MII_CR_RESET;
++
++	ret_val = e1e_wphy(hw, PHY_CONTROL, phy_data);
++	if (ret_val)
++		goto out;
++
++	udelay(1);
++
++	if (hw->phy.wait_for_link) {
++		hw_dbg(hw, "Waiting for forced speed/duplex link "
++			 "on GG82563 phy.\n");
++
++		ret_val = e1000_phy_has_link_generic(hw, PHY_FORCE_LIMIT,
++						     100000, &link);
++		if (ret_val)
++			goto out;
++
++		if (!link) {
++			/* We didn't get link.
++			 * Reset the DSP and cross our fingers.
++			 */
++			ret_val = e1000_phy_reset_dsp(hw);
++			if (ret_val)
++				goto out;
++		}
++
++		/* Try once more */
++		ret_val = e1000_phy_has_link_generic(hw, PHY_FORCE_LIMIT,
++						     100000, &link);
++		if (ret_val)
++			goto out;
++	}
++
++	ret_val = e1e_rphy(hw, GG82563_PHY_MAC_SPEC_CTRL, &phy_data);
++	if (ret_val)
++		goto out;
++
++	/* Resetting the phy means we need to verify the TX_CLK corresponds
++	 * to the link speed.  10Mbps -> 2.5MHz, else 25MHz.
++	 */
++	phy_data &= ~GG82563_MSCR_TX_CLK_MASK;
++	if (hw->mac.forced_speed_duplex & E1000_ALL_10_SPEED)
++		phy_data |= GG82563_MSCR_TX_CLK_10MBPS_2_5;
++	else
++		phy_data |= GG82563_MSCR_TX_CLK_100MBPS_25;
++
++	/* In addition, we must re-enable CRS on Tx for both half and full
++	 * duplex.
++	 */
++	phy_data |= GG82563_MSCR_ASSERT_CRS_ON_TX;
++	ret_val = e1e_wphy(hw, GG82563_PHY_MAC_SPEC_CTRL, phy_data);
++
++out:
++	return ret_val;
++}
++
++/**
++ *  e1000_get_cable_length_80003es2lan - Set approximate cable length
++ *  @hw: pointer to the HW structure
++ *
++ *  Find the approximate cable length as measured by the GG82563 PHY.
++ *  This is a function pointer entry point called by the phy module.
++ **/
++static s32 e1000_get_cable_length_80003es2lan(struct e1000_hw *hw)
++{
++	struct e1000_phy_info *phy = &hw->phy;
++	s32 ret_val;
++	u16 phy_data;
++	u16 index;
++
++	ret_val = e1e_rphy(hw, GG82563_PHY_DSP_DISTANCE, &phy_data);
++	if (ret_val)
++		goto out;
++
++	index = phy_data & GG82563_DSPD_CABLE_LENGTH;
++	phy->min_cable_length = e1000_gg82563_cable_length_table[index];
++	phy->max_cable_length = e1000_gg82563_cable_length_table[index+5];
++
++	phy->cable_length = (phy->min_cable_length + phy->max_cable_length) / 2;
++
++out:
++	return ret_val;
++}
++
++/**
++ *  e1000_get_link_up_info_80003es2lan - Report speed and duplex
++ *  @hw: pointer to the HW structure
++ *  @speed: pointer to speed buffer
++ *  @duplex: pointer to duplex buffer
++ *
++ *  Retrieve the current speed and duplex configuration.
++ *  This is a function pointer entry point called by the api module.
++ **/
++static s32 e1000_get_link_up_info_80003es2lan(struct e1000_hw *hw, u16 *speed,
++					      u16 *duplex)
++{
++	s32 ret_val;
++
++	if (hw->media_type == e1000_media_type_copper) {
++		ret_val = e1000_get_speed_and_duplex_copper(hw,
++								    speed,
++								    duplex);
++		if (ret_val)
++			goto out;
++		if (*speed == SPEED_1000)
++			ret_val = e1000_cfg_kmrn_1000_80003es2lan(hw);
++		else
++			ret_val = e1000_cfg_kmrn_10_100_80003es2lan(hw,
++							      *duplex);
++	} else {
++		ret_val = e1000_get_speed_and_duplex_fiber_serdes(hw,
++								  speed,
++								  duplex);
++	}
++
++out:
++	return ret_val;
++}
++
++/**
++ *  e1000_reset_hw_80003es2lan - Reset the ESB2 controller
++ *  @hw: pointer to the HW structure
++ *
++ *  Perform a global reset to the ESB2 controller.
++ *  This is a function pointer entry point called by the api module.
++ **/
++static s32 e1000_reset_hw_80003es2lan(struct e1000_hw *hw)
++{
++	u32 ctrl;
++	u32 icr;
++	s32 ret_val;
++
++	/* Prevent the PCI-E bus from sticking if there is no TLP connection
++	 * on the last TLP read/write transaction when MAC is reset.
++	 */
++	ret_val = e1000_disable_pcie_master(hw);
++	if (ret_val)
++		hw_dbg(hw, "PCI-E Master disable polling has failed.\n");
++
++	hw_dbg(hw, "Masking off all interrupts\n");
++	ew32(IMC, 0xffffffff);
++
++	ew32(RCTL, 0);
++	ew32(TCTL, E1000_TCTL_PSP);
++	e1e_flush();
++
++	msleep(10);
++
++	ctrl = er32(CTRL);
++
++	hw_dbg(hw, "Issuing a global reset to MAC\n");
++	ew32(CTRL, ctrl | E1000_CTRL_RST);
++
++	ret_val = e1000_get_auto_rd_done(hw);
++	if (ret_val)
++		/* We don't want to continue accessing MAC registers. */
++		goto out;
++
++	/* Clear any pending interrupt events. */
++	ew32(IMC, 0xffffffff);
++	icr = er32(ICR);
++
++out:
++	return ret_val;
++}
++
++/**
++ *  e1000_init_hw_80003es2lan - Initialize the ESB2 controller
++ *  @hw: pointer to the HW structure
++ *
++ *  Initialize the hw bits, LED, VFTA, MTA, link and hw counters.
++ *  This is a function pointer entry point called by the api module.
++ **/
++static s32 e1000_init_hw_80003es2lan(struct e1000_hw *hw)
++{
++	struct e1000_mac_info *mac = &hw->mac;
++	u32 reg_data;
++	s32 ret_val;
++	u16 i;
++
++	e1000_initialize_hw_bits_80003es2lan(hw);
++
++	/* Initialize identification LED */
++	ret_val = e1000_id_led_init(hw);
++	if (ret_val) {
++		hw_dbg(hw, "Error initializing identification LED\n");
++		goto out;
++	}
++
++	/* Disabling VLAN filtering */
++	hw_dbg(hw, "Initializing the IEEE VLAN\n");
++	e1000_clear_vfta(hw);
++
++	/* Setup the receive address. */
++	e1000_init_rx_addrs(hw, mac->rar_entry_count);
++
++	/* Zero out the Multicast HASH table */
++	hw_dbg(hw, "Zeroing the MTA\n");
++	for (i = 0; i < mac->mta_reg_count; i++)
++		E1000_WRITE_REG_ARRAY(hw, E1000_MTA, i, 0);
++
++	/* Setup link and flow control */
++	ret_val = e1000_setup_link(hw);
++
++	/* Set the transmit descriptor write-back policy */
++	reg_data = er32(TXDCTL);
++	reg_data = (reg_data & ~E1000_TXDCTL_WTHRESH) |
++		   E1000_TXDCTL_FULL_TX_DESC_WB | E1000_TXDCTL_COUNT_DESC;
++	ew32(TXDCTL, reg_data);
++
++	/* ...for both queues. */
++	reg_data = er32(TXDCTL1);
++	reg_data = (reg_data & ~E1000_TXDCTL_WTHRESH) |
++		   E1000_TXDCTL_FULL_TX_DESC_WB | E1000_TXDCTL_COUNT_DESC;
++	ew32(TXDCTL1, reg_data);
++
++	/* Enable retransmit on late collisions */
++	reg_data = er32(TCTL);
++	reg_data |= E1000_TCTL_RTLC;
++	ew32(TCTL, reg_data);
++
++	/* Configure Gigabit Carry Extend Padding */
++	reg_data = er32(TCTL_EXT);
++	reg_data &= ~E1000_TCTL_EXT_GCEX_MASK;
++	reg_data |= DEFAULT_TCTL_EXT_GCEX_80003ES2LAN;
++	ew32(TCTL_EXT, reg_data);
++
++	/* Configure Transmit Inter-Packet Gap */
++	reg_data = er32(TIPG);
++	reg_data &= ~E1000_TIPG_IPGT_MASK;
++	reg_data |= DEFAULT_TIPG_IPGT_1000_80003ES2LAN;
++	ew32(TIPG, reg_data);
++
++	reg_data = E1000_READ_REG_ARRAY(hw, E1000_FFLT, 0x0001);
++	reg_data &= ~0x00100000;
++	E1000_WRITE_REG_ARRAY(hw, E1000_FFLT, 0x0001, reg_data);
++
++	/* Clear all of the statistics registers (clear on read).  It is
++	 * important that we do this after we have tried to establish link
++	 * because the symbol error count will increment wildly if there
++	 * is no link.
++	 */
++	e1000_clear_hw_cntrs_80003es2lan(hw);
++
++out:
++	return ret_val;
++}
++
++/**
++ *  e1000_initialize_hw_bits_80003es2lan - Init hw bits of ESB2
++ *  @hw: pointer to the HW structure
++ *
++ *  Initializes required hardware-dependent bits needed for normal operation.
++ **/
++static void e1000_initialize_hw_bits_80003es2lan(struct e1000_hw *hw)
++{
++	u32 reg;
++
++	/* Transmit Descriptor Control 0 */
++	reg = er32(TXDCTL);
++	reg |= (1 << 22);
++	ew32(TXDCTL, reg);
++
++	/* Transmit Descriptor Control 1 */
++	reg = er32(TXDCTL1);
++	reg |= (1 << 22);
++	ew32(TXDCTL1, reg);
++
++	/* Transmit Arbitration Control 0 */
++	reg = er32(TARC0);
++	reg &= ~(0xF << 27); /* 30:27 */
++	if (hw->media_type != e1000_media_type_copper)
++		reg &= ~(1 << 20);
++	ew32(TARC0, reg);
++
++	/* Transmit Arbitration Control 1 */
++	reg = er32(TARC1);
++	if (er32(TCTL) & E1000_TCTL_MULR)
++		reg &= ~(1 << 28);
++	else
++		reg |= (1 << 28);
++	ew32(TARC1, reg);
++}
++
++/**
++ *  e1000_copper_link_setup_gg82563_80003es2lan - Configure GG82563 Link
++ *  @hw: pointer to the HW structure
++ *
++ *  Setup some GG82563 PHY registers for obtaining link
++ **/
++static s32 e1000_copper_link_setup_gg82563_80003es2lan(struct e1000_hw *hw)
++{
++	struct   e1000_phy_info *phy = &hw->phy;
++	s32  ret_val;
++	u32 ctrl_ext;
++	u16 data;
++
++	ret_val = e1e_rphy(hw, GG82563_PHY_MAC_SPEC_CTRL,
++				     &data);
++	if (ret_val)
++		goto out;
++
++	data |= GG82563_MSCR_ASSERT_CRS_ON_TX;
++	/* Use 25MHz for both link down and 1000Base-T for Tx clock. */
++	data |= GG82563_MSCR_TX_CLK_1000MBPS_25;
++
++	ret_val = e1e_wphy(hw, GG82563_PHY_MAC_SPEC_CTRL,
++				      data);
++	if (ret_val)
++		goto out;
++
++	/* Options:
++	 *   MDI/MDI-X = 0 (default)
++	 *   0 - Auto for all speeds
++	 *   1 - MDI mode
++	 *   2 - MDI-X mode
++	 *   3 - Auto for 1000Base-T only (MDI-X for 10/100Base-T modes)
++	 */
++	ret_val = e1e_rphy(hw, GG82563_PHY_SPEC_CTRL, &data);
++	if (ret_val)
++		goto out;
++
++	data &= ~GG82563_PSCR_CROSSOVER_MODE_MASK;
++
++	switch (phy->mdix) {
++	case 1:
++		data |= GG82563_PSCR_CROSSOVER_MODE_MDI;
++		break;
++	case 2:
++		data |= GG82563_PSCR_CROSSOVER_MODE_MDIX;
++		break;
++	case 0:
++	default:
++		data |= GG82563_PSCR_CROSSOVER_MODE_AUTO;
++		break;
++	}
++
++	/* Options:
++	 *   disable_polarity_correction = 0 (default)
++	 *       Automatic Correction for Reversed Cable Polarity
++	 *   0 - Disabled
++	 *   1 - Enabled
++	 */
++	data &= ~GG82563_PSCR_POLARITY_REVERSAL_DISABLE;
++	if (phy->disable_polarity_correction)
++		data |= GG82563_PSCR_POLARITY_REVERSAL_DISABLE;
++
++	ret_val = e1e_wphy(hw, GG82563_PHY_SPEC_CTRL, data);
++	if (ret_val)
++		goto out;
++
++	/* SW Reset the PHY so all changes take effect */
++	ret_val = e1000_commit_phy(hw);
++	if (ret_val) {
++		hw_dbg(hw, "Error Resetting the PHY\n");
++		goto out;
++	}
++
++	/* Bypass RX and TX FIFO's */
++	ret_val = e1000_write_kmrn_reg(hw,
++				E1000_KMRNCTRLSTA_OFFSET_FIFO_CTRL,
++				E1000_KMRNCTRLSTA_FIFO_CTRL_RX_BYPASS |
++					E1000_KMRNCTRLSTA_FIFO_CTRL_TX_BYPASS);
++	if (ret_val)
++		goto out;
++
++	ret_val = e1e_rphy(hw, GG82563_PHY_SPEC_CTRL_2, &data);
++	if (ret_val)
++		goto out;
++
++	data &= ~GG82563_PSCR2_REVERSE_AUTO_NEG;
++	ret_val = e1e_wphy(hw, GG82563_PHY_SPEC_CTRL_2, data);
++	if (ret_val)
++		goto out;
++
++	ctrl_ext = er32(CTRL_EXT);
++	ctrl_ext &= ~(E1000_CTRL_EXT_LINK_MODE_MASK);
++	ew32(CTRL_EXT, ctrl_ext);
++
++	ret_val = e1e_rphy(hw, GG82563_PHY_PWR_MGMT_CTRL, &data);
++	if (ret_val)
++		goto out;
++
++	/* Do not init these registers when the HW is in IAMT mode, since the
++	 * firmware will have already initialized them.  We only initialize
++	 * them if the HW is not in IAMT mode.
++	 */
++	if (!e1000_check_mng_mode(hw)) {
++		/* Enable Electrical Idle on the PHY */
++		data |= GG82563_PMCR_ENABLE_ELECTRICAL_IDLE;
++		ret_val = e1e_wphy(hw, GG82563_PHY_PWR_MGMT_CTRL, data);
++		if (ret_val)
++			goto out;
++
++		ret_val = e1e_rphy(hw, GG82563_PHY_KMRN_MODE_CTRL, &data);
++		if (ret_val)
++			goto out;
++
++		data &= ~GG82563_KMCR_PASS_FALSE_CARRIER;
++		ret_val = e1e_wphy(hw, GG82563_PHY_KMRN_MODE_CTRL, data);
++		if (ret_val)
++			goto out;
++	}
++
++	/* Workaround: Disable padding in Kumeran interface in the MAC
++	 * and in the PHY to avoid CRC errors.
++	 */
++	ret_val = e1e_rphy(hw, GG82563_PHY_INBAND_CTRL, &data);
++	if (ret_val)
++		goto out;
++
++	data |= GG82563_ICR_DIS_PADDING;
++	ret_val = e1e_wphy(hw, GG82563_PHY_INBAND_CTRL, data);
++	if (ret_val)
++		goto out;
++
++out:
++	return ret_val;
++}
++
++/**
++ *  e1000_setup_copper_link_80003es2lan - Setup Copper Link for ESB2
++ *  @hw: pointer to the HW structure
++ *
++ *  Essentially a wrapper for setting up all things "copper" related.
++ *  This is a function pointer entry point called by the mac module.
++ **/
++static s32 e1000_setup_copper_link_80003es2lan(struct e1000_hw *hw)
++{
++	u32 ctrl;
++	s32  ret_val;
++	u16 reg_data;
++
++	ctrl = er32(CTRL);
++	ctrl |= E1000_CTRL_SLU;
++	ctrl &= ~(E1000_CTRL_FRCSPD | E1000_CTRL_FRCDPX);
++	ew32(CTRL, ctrl);
++
++	/* Set the mac to wait the maximum time between each
++	 * iteration and increase the max iterations when
++	 * polling the phy; this fixes erroneous timeouts at 10Mbps. */
++	ret_val = e1000_write_kmrn_reg(hw, GG82563_REG(0x34, 4), 0xFFFF);
++	if (ret_val)
++		goto out;
++	ret_val = e1000_read_kmrn_reg(hw, GG82563_REG(0x34, 9), &reg_data);
++	if (ret_val)
++		goto out;
++	reg_data |= 0x3F;
++	ret_val = e1000_write_kmrn_reg(hw, GG82563_REG(0x34, 9), reg_data);
++	if (ret_val)
++		goto out;
++	ret_val = e1000_read_kmrn_reg(hw,
++				      E1000_KMRNCTRLSTA_OFFSET_INB_CTRL,
++				      &reg_data);
++	if (ret_val)
++		goto out;
++	reg_data |= E1000_KMRNCTRLSTA_INB_CTRL_DIS_PADDING;
++	ret_val = e1000_write_kmrn_reg(hw,
++				       E1000_KMRNCTRLSTA_OFFSET_INB_CTRL,
++				       reg_data);
++	if (ret_val)
++		goto out;
++
++	ret_val = e1000_copper_link_setup_gg82563_80003es2lan(hw);
++	if (ret_val)
++		goto out;
++
++	ret_val = e1000_setup_copper_link(hw);
++
++out:
++	return ret_val;
++}
++
++/**
++ *  e1000_cfg_kmrn_10_100_80003es2lan - Apply "quirks" for 10/100 operation
++ *  @hw: pointer to the HW structure
++ *  @duplex: current duplex setting
++ *
++ *  Configure the KMRN interface by applying last minute quirks for
++ *  10/100 operation.
++ **/
++static s32 e1000_cfg_kmrn_10_100_80003es2lan(struct e1000_hw *hw, u16 duplex)
++{
++	s32 ret_val = E1000_SUCCESS;
++	u32 tipg;
++	u16 reg_data;
++
++	reg_data = E1000_KMRNCTRLSTA_HD_CTRL_10_100_DEFAULT;
++	ret_val = e1000_write_kmrn_reg(hw,
++				       E1000_KMRNCTRLSTA_OFFSET_HD_CTRL,
++				       reg_data);
++	if (ret_val)
++		goto out;
++
++	/* Configure Transmit Inter-Packet Gap */
++	tipg = er32(TIPG);
++	tipg &= ~E1000_TIPG_IPGT_MASK;
++	tipg |= DEFAULT_TIPG_IPGT_10_100_80003ES2LAN;
++	ew32(TIPG, tipg);
++
++	ret_val = e1e_rphy(hw, GG82563_PHY_KMRN_MODE_CTRL, &reg_data);
++	if (ret_val)
++		goto out;
++
++	if (duplex == HALF_DUPLEX)
++		reg_data |= GG82563_KMCR_PASS_FALSE_CARRIER;
++	else
++		reg_data &= ~GG82563_KMCR_PASS_FALSE_CARRIER;
++
++	ret_val = e1e_wphy(hw, GG82563_PHY_KMRN_MODE_CTRL, reg_data);
++
++out:
++	return ret_val;
++}
++
++/**
++ *  e1000_cfg_kmrn_1000_80003es2lan - Apply "quirks" for gigabit operation
++ *  @hw: pointer to the HW structure
++ *
++ *  Configure the KMRN interface by applying last minute quirks for
++ *  gigabit operation.
++ **/
++static s32 e1000_cfg_kmrn_1000_80003es2lan(struct e1000_hw *hw)
++{
++	s32 ret_val = E1000_SUCCESS;
++	u16 reg_data;
++	u32 tipg;
++
++	reg_data = E1000_KMRNCTRLSTA_HD_CTRL_1000_DEFAULT;
++	ret_val = e1000_write_kmrn_reg(hw,
++				       E1000_KMRNCTRLSTA_OFFSET_HD_CTRL,
++				       reg_data);
++	if (ret_val)
++		goto out;
++
++	/* Configure Transmit Inter-Packet Gap */
++	tipg = er32(TIPG);
++	tipg &= ~E1000_TIPG_IPGT_MASK;
++	tipg |= DEFAULT_TIPG_IPGT_1000_80003ES2LAN;
++	ew32(TIPG, tipg);
++
++	ret_val = e1e_rphy(hw, GG82563_PHY_KMRN_MODE_CTRL, &reg_data);
++	if (ret_val)
++		goto out;
++
++	reg_data &= ~GG82563_KMCR_PASS_FALSE_CARRIER;
++	ret_val = e1e_wphy(hw, GG82563_PHY_KMRN_MODE_CTRL, reg_data);
++
++out:
++	return ret_val;
++}
++
++/**
++ *  e1000_clear_hw_cntrs_80003es2lan - Clear device specific hardware counters
++ *  @hw: pointer to the HW structure
++ *
++ *  Clears the hardware counters by reading the counter registers.
++ **/
++static void e1000_clear_hw_cntrs_80003es2lan(struct e1000_hw *hw)
++{
++	u32 temp;
++
++	e1000_clear_hw_cntrs_base(hw);
++
++	temp = er32(PRC64);
++	temp = er32(PRC127);
++	temp = er32(PRC255);
++	temp = er32(PRC511);
++	temp = er32(PRC1023);
++	temp = er32(PRC1522);
++	temp = er32(PTC64);
++	temp = er32(PTC127);
++	temp = er32(PTC255);
++	temp = er32(PTC511);
++	temp = er32(PTC1023);
++	temp = er32(PTC1522);
++
++	temp = er32(ALGNERRC);
++	temp = er32(RXERRC);
++	temp = er32(TNCRS);
++	temp = er32(CEXTERR);
++	temp = er32(TSCTC);
++	temp = er32(TSCTFC);
++
++	temp = er32(MGTPRC);
++	temp = er32(MGTPDC);
++	temp = er32(MGTPTC);
++
++	temp = er32(IAC);
++	temp = er32(ICRXOC);
++
++	temp = er32(ICRXPTC);
++	temp = er32(ICRXATC);
++	temp = er32(ICTXPTC);
++	temp = er32(ICTXATC);
++	temp = er32(ICTXQEC);
++	temp = er32(ICTXQMTC);
++	temp = er32(ICRXDMTC);
++}
++
++static struct e1000_mac_operations es2_mac_ops = {
++	.mng_mode_enab		= E1000_MNG_IAMT_MODE << E1000_FWSM_MODE_SHIFT,
++	/* check_for_link dependent on media type */
++	.cleanup_led		= e1000_cleanup_led_generic,
++	.clear_hw_cntrs		= e1000_clear_hw_cntrs_80003es2lan,
++	.get_bus_info		= e1000_get_bus_info_pcie,
++	.get_link_up_info	= e1000_get_link_up_info_80003es2lan,
++	.led_on			= e1000_led_on_generic,
++	.led_off		= e1000_led_off_generic,
++	.mc_addr_list_update	= e1000_mc_addr_list_update_generic,
++	.reset_hw		= e1000_reset_hw_80003es2lan,
++	.init_hw		= e1000_init_hw_80003es2lan,
++	.setup_link		= e1000_setup_link,
++	/* setup_physical_interface dependent on media type */
++};
++
++static struct e1000_phy_operations es2_phy_ops = {
++	.acquire_phy		= e1000_acquire_phy_80003es2lan,
++	.check_reset_block	= e1000_check_reset_block_generic,
++	.commit_phy	 	= e1000_phy_sw_reset,
++	.force_speed_duplex 	= e1000_phy_force_speed_duplex_80003es2lan,
++	.get_cfg_done       	= e1000_get_cfg_done_80003es2lan,
++	.get_cable_length   	= e1000_get_cable_length_80003es2lan,
++	.get_phy_info       	= e1000_get_phy_info_m88,
++	.read_phy_reg       	= e1000_read_phy_reg_gg82563_80003es2lan,
++	.release_phy		= e1000_release_phy_80003es2lan,
++	.reset_phy	  	= e1000_phy_hw_reset_generic,
++	.set_d0_lplu_state  	= NULL,
++	.set_d3_lplu_state  	= e1000_set_d3_lplu_state,
++	.write_phy_reg      	= e1000_write_phy_reg_gg82563_80003es2lan,
++};
++
++static struct e1000_nvm_operations es2_nvm_ops = {
++	.acquire_nvm		= e1000_acquire_nvm_80003es2lan,
++	.read_nvm		= e1000_read_nvm_eerd,
++	.release_nvm		= e1000_release_nvm_80003es2lan,
++	.update_nvm		= e1000_update_nvm_checksum_generic,
++	.valid_led_default	= e1000_valid_led_default,
++	.validate_nvm		= e1000_validate_nvm_checksum_generic,
++	.write_nvm		= e1000_write_nvm_80003es2lan,
++};
++
++struct e1000_info e1000_es2_info = {
++	.mac			= e1000_80003es2lan,
++	.flags			= FLAG_HAS_HW_VLAN_FILTER
++				  | FLAG_HAS_JUMBO_FRAMES
++				  | FLAG_HAS_STATS_PTC_PRC
++				  | FLAG_HAS_WOL
++				  | FLAG_APME_IN_CTRL3
++				  | FLAG_RX_CSUM_ENABLED
++				  | FLAG_HAS_CTRLEXT_ON_LOAD
++				  | FLAG_HAS_STATS_ICR_ICT
++				  | FLAG_RX_NEEDS_RESTART /* errata */
++				  | FLAG_TARC_SET_BIT_ZERO /* errata */
++				  | FLAG_APME_CHECK_PORT_B
++				  | FLAG_DISABLE_FC_PAUSE_TIME /* errata */
++				  | FLAG_TIPG_MEDIUM_FOR_80003ESLAN,
++	.pba			= 38,
++	.get_invariants		= e1000_get_invariants_80003es2lan,
++	.mac_ops		= &es2_mac_ops,
++	.phy_ops		= &es2_phy_ops,
++	.nvm_ops		= &es2_nvm_ops,
++};
++
+diff --git a/drivers/net/e1000e/ethtool.c b/drivers/net/e1000e/ethtool.c
+new file mode 100644
+index 0000000..6c417ea
+--- /dev/null
++++ b/drivers/net/e1000e/ethtool.c
+@@ -0,0 +1,1763 @@
++/*******************************************************************************
++
++  Intel PRO/1000 Linux driver
++  Copyright(c) 1999 - 2007 Intel Corporation.
++
++  This program is free software; you can redistribute it and/or modify it
++  under the terms and conditions of the GNU General Public License,
++  version 2, as published by the Free Software Foundation.
++
++  This program is distributed in the hope 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.,
++  51 Franklin St - Fifth Floor, Boston, MA 02110-1301 USA.
++
++  The full GNU General Public License is included in this distribution in
++  the file called "COPYING".
++
++  Contact Information:
++  Linux NICS <linux.nics at intel.com>
++  e1000-devel Mailing List <e1000-devel at lists.sourceforge.net>
++  Intel Corporation, 5200 N.E. Elam Young Parkway, Hillsboro, OR 97124-6497
++
++*******************************************************************************/
++
++/* ethtool support for e1000 */
++
++#include <linux/netdevice.h>
++
++#include <linux/ethtool.h>
++
++#include "e1000.h"
++
++struct e1000_stats {
++	char stat_string[ETH_GSTRING_LEN];
++	int sizeof_stat;
++	int stat_offset;
++};
++
++#define E1000_STAT(m) sizeof(((struct e1000_adapter *)0)->m), \
++		      offsetof(struct e1000_adapter, m)
++static const struct e1000_stats e1000_gstrings_stats[] = {
++	{ "rx_packets", E1000_STAT(stats.gprc) },
++	{ "tx_packets", E1000_STAT(stats.gptc) },
++	{ "rx_bytes", E1000_STAT(stats.gorcl) },
++	{ "tx_bytes", E1000_STAT(stats.gotcl) },
++	{ "rx_broadcast", E1000_STAT(stats.bprc) },
++	{ "tx_broadcast", E1000_STAT(stats.bptc) },
++	{ "rx_multicast", E1000_STAT(stats.mprc) },
++	{ "tx_multicast", E1000_STAT(stats.mptc) },
++	{ "rx_errors", E1000_STAT(net_stats.rx_errors) },
++	{ "tx_errors", E1000_STAT(net_stats.tx_errors) },
++	{ "tx_dropped", E1000_STAT(net_stats.tx_dropped) },
++	{ "multicast", E1000_STAT(stats.mprc) },
++	{ "collisions", E1000_STAT(stats.colc) },
++	{ "rx_length_errors", E1000_STAT(net_stats.rx_length_errors) },
++	{ "rx_over_errors", E1000_STAT(net_stats.rx_over_errors) },
++	{ "rx_crc_errors", E1000_STAT(stats.crcerrs) },
++	{ "rx_frame_errors", E1000_STAT(net_stats.rx_frame_errors) },
++	{ "rx_no_buffer_count", E1000_STAT(stats.rnbc) },
++	{ "rx_missed_errors", E1000_STAT(stats.mpc) },
++	{ "tx_aborted_errors", E1000_STAT(stats.ecol) },
++	{ "tx_carrier_errors", E1000_STAT(stats.tncrs) },
++	{ "tx_fifo_errors", E1000_STAT(net_stats.tx_fifo_errors) },
++	{ "tx_heartbeat_errors", E1000_STAT(net_stats.tx_heartbeat_errors) },
++	{ "tx_window_errors", E1000_STAT(stats.latecol) },
++	{ "tx_abort_late_coll", E1000_STAT(stats.latecol) },
++	{ "tx_deferred_ok", E1000_STAT(stats.dc) },
++	{ "tx_single_coll_ok", E1000_STAT(stats.scc) },
++	{ "tx_multi_coll_ok", E1000_STAT(stats.mcc) },
++	{ "tx_timeout_count", E1000_STAT(tx_timeout_count) },
++	{ "tx_restart_queue", E1000_STAT(restart_queue) },
++	{ "rx_long_length_errors", E1000_STAT(stats.roc) },
++	{ "rx_short_length_errors", E1000_STAT(stats.ruc) },
++	{ "rx_align_errors", E1000_STAT(stats.algnerrc) },
++	{ "tx_tcp_seg_good", E1000_STAT(stats.tsctc) },
++	{ "tx_tcp_seg_failed", E1000_STAT(stats.tsctfc) },
++	{ "rx_flow_control_xon", E1000_STAT(stats.xonrxc) },
++	{ "rx_flow_control_xoff", E1000_STAT(stats.xoffrxc) },
++	{ "tx_flow_control_xon", E1000_STAT(stats.xontxc) },
++	{ "tx_flow_control_xoff", E1000_STAT(stats.xofftxc) },
++	{ "rx_long_byte_count", E1000_STAT(stats.gorcl) },
++	{ "rx_csum_offload_good", E1000_STAT(hw_csum_good) },
++	{ "rx_csum_offload_errors", E1000_STAT(hw_csum_err) },
++	{ "rx_header_split", E1000_STAT(rx_hdr_split) },
++	{ "alloc_rx_buff_failed", E1000_STAT(alloc_rx_buff_failed) },
++	{ "tx_smbus", E1000_STAT(stats.mgptc) },
++	{ "rx_smbus", E1000_STAT(stats.mgprc) },
++	{ "dropped_smbus", E1000_STAT(stats.mgpdc) },
++};
++
++#define E1000_GLOBAL_STATS_LEN	\
++	sizeof(e1000_gstrings_stats) / sizeof(struct e1000_stats)
++#define E1000_STATS_LEN (E1000_GLOBAL_STATS_LEN)
++static const char e1000_gstrings_test[][ETH_GSTRING_LEN] = {
++	"Register test  (offline)", "Eeprom test    (offline)",
++	"Interrupt test (offline)", "Loopback test  (offline)",
++	"Link test   (on/offline)"
++};
++#define E1000_TEST_LEN sizeof(e1000_gstrings_test) / ETH_GSTRING_LEN
++
++static int e1000_get_settings(struct net_device *netdev,
++			      struct ethtool_cmd *ecmd)
++{
++	struct e1000_adapter *adapter = netdev_priv(netdev);
++	struct e1000_hw *hw = &adapter->hw;
++
++	if (hw->media_type == e1000_media_type_copper) {
++
++		ecmd->supported = (SUPPORTED_10baseT_Half |
++				   SUPPORTED_10baseT_Full |
++				   SUPPORTED_100baseT_Half |
++				   SUPPORTED_100baseT_Full |
++				   SUPPORTED_1000baseT_Full |
++				   SUPPORTED_Autoneg |
++				   SUPPORTED_TP);
++		if (hw->phy.type == e1000_phy_ife)
++			ecmd->supported &= ~SUPPORTED_1000baseT_Full;
++		ecmd->advertising = ADVERTISED_TP;
++
++		if (hw->mac.autoneg == 1) {
++			ecmd->advertising |= ADVERTISED_Autoneg;
++			/* the e1000 autoneg seems to match ethtool nicely */
++			ecmd->advertising |= hw->phy.autoneg_advertised;
++		}
++
++		ecmd->port = PORT_TP;
++		ecmd->phy_address = hw->phy.addr;
++		ecmd->transceiver = XCVR_INTERNAL;
++
++	} else {
++		ecmd->supported   = (SUPPORTED_1000baseT_Full |
++				     SUPPORTED_FIBRE |
++				     SUPPORTED_Autoneg);
++
++		ecmd->advertising = (ADVERTISED_1000baseT_Full |
++				     ADVERTISED_FIBRE |
++				     ADVERTISED_Autoneg);
++
++		ecmd->port = PORT_FIBRE;
++		ecmd->transceiver = XCVR_EXTERNAL;
++	}
++
++	if (er32(STATUS) & E1000_STATUS_LU) {
++
++		adapter->hw.mac.ops.get_link_up_info(hw, &adapter->link_speed,
++						  &adapter->link_duplex);
++		ecmd->speed = adapter->link_speed;
++
++		/* unfortunately FULL_DUPLEX != DUPLEX_FULL
++		 *	  and HALF_DUPLEX != DUPLEX_HALF */
++
++		if (adapter->link_duplex == FULL_DUPLEX)
++			ecmd->duplex = DUPLEX_FULL;
++		else
++			ecmd->duplex = DUPLEX_HALF;
++	} else {
++		ecmd->speed = -1;
++		ecmd->duplex = -1;
++	}
++
++	ecmd->autoneg = ((hw->media_type == e1000_media_type_fiber) ||
++			 hw->mac.autoneg) ? AUTONEG_ENABLE : AUTONEG_DISABLE;
++	return 0;
++}
++
++static int e1000_set_spd_dplx(struct e1000_adapter *adapter, u16 spddplx)
++{
++	struct e1000_mac_info *mac = &adapter->hw.mac;
++
++	mac->autoneg = 0;
++
++	/* Fiber NICs only allow 1000 gbps Full duplex */
++	if ((adapter->hw.media_type == e1000_media_type_fiber) &&
++		spddplx != (SPEED_1000 + DUPLEX_FULL)) {
++		ndev_err(adapter->netdev, "Unsupported Speed/Duplex "
++			 "configuration\n");
++		return -EINVAL;
++	}
++
++	switch (spddplx) {
++	case SPEED_10 + DUPLEX_HALF:
++		mac->forced_speed_duplex = ADVERTISE_10_HALF;
++		break;
++	case SPEED_10 + DUPLEX_FULL:
++		mac->forced_speed_duplex = ADVERTISE_10_FULL;
++		break;
++	case SPEED_100 + DUPLEX_HALF:
++		mac->forced_speed_duplex = ADVERTISE_100_HALF;
++		break;
++	case SPEED_100 + DUPLEX_FULL:
++		mac->forced_speed_duplex = ADVERTISE_100_FULL;
++		break;
++	case SPEED_1000 + DUPLEX_FULL:
++		mac->autoneg = 1;
++		adapter->hw.phy.autoneg_advertised = ADVERTISE_1000_FULL;
++		break;
++	case SPEED_1000 + DUPLEX_HALF: /* not supported */
++	default:
++		ndev_err(adapter->netdev, "Unsupported Speed/Duplex "
++			 "configuration\n");
++		return -EINVAL;
++	}
++	return 0;
++}
++
++static int e1000_set_settings(struct net_device *netdev,
++			      struct ethtool_cmd *ecmd)
++{
++	struct e1000_adapter *adapter = netdev_priv(netdev);
++	struct e1000_hw *hw = &adapter->hw;
++
++	/* When SoL/IDER sessions are active, autoneg/speed/duplex
++	 * cannot be changed */
++	if (e1000_check_reset_block(hw)) {
++		ndev_err(netdev, "Cannot change link "
++			 "characteristics when SoL/IDER is active.\n");
++		return -EINVAL;
++	}
++
++	while (test_and_set_bit(__E1000_RESETTING, &adapter->state))
++		msleep(1);
++
++	if (ecmd->autoneg == AUTONEG_ENABLE) {
++		hw->mac.autoneg = 1;
++		if (hw->media_type == e1000_media_type_fiber)
++			hw->phy.autoneg_advertised = ADVERTISED_1000baseT_Full |
++						     ADVERTISED_FIBRE |
++						     ADVERTISED_Autoneg;
++		else
++			hw->phy.autoneg_advertised = ecmd->advertising |
++						     ADVERTISED_TP |
++						     ADVERTISED_Autoneg;
++		ecmd->advertising = hw->phy.autoneg_advertised;
++	} else {
++		if (e1000_set_spd_dplx(adapter, ecmd->speed + ecmd->duplex)) {
++			clear_bit(__E1000_RESETTING, &adapter->state);
++			return -EINVAL;
++		}
++	}
++
++	/* reset the link */
++
++	if (netif_running(adapter->netdev)) {
++		e1000_down(adapter);
++		e1000_up(adapter);
++	} else {
++		e1000_reset(adapter);
++	}
++
++	clear_bit(__E1000_RESETTING, &adapter->state);
++	return 0;
++}
++
++static void e1000_get_pauseparam(struct net_device *netdev,
++				 struct ethtool_pauseparam *pause)
++{
++	struct e1000_adapter *adapter = netdev_priv(netdev);
++	struct e1000_hw *hw = &adapter->hw;
++
++	pause->autoneg =
++		(adapter->fc_autoneg ? AUTONEG_ENABLE : AUTONEG_DISABLE);
++
++	if (hw->mac.fc == e1000_fc_rx_pause) {
++		pause->rx_pause = 1;
++	} else if (hw->mac.fc == e1000_fc_tx_pause) {
++		pause->tx_pause = 1;
++	} else if (hw->mac.fc == e1000_fc_full) {
++		pause->rx_pause = 1;
++		pause->tx_pause = 1;
++	}
++}
++
++static int e1000_set_pauseparam(struct net_device *netdev,
++				struct ethtool_pauseparam *pause)
++{
++	struct e1000_adapter *adapter = netdev_priv(netdev);
++	struct e1000_hw *hw = &adapter->hw;
++	int retval = 0;
++
++	adapter->fc_autoneg = pause->autoneg;
++
++	while (test_and_set_bit(__E1000_RESETTING, &adapter->state))
++		msleep(1);
++
++	if (pause->rx_pause && pause->tx_pause)
++		hw->mac.fc = e1000_fc_full;
++	else if (pause->rx_pause && !pause->tx_pause)
++		hw->mac.fc = e1000_fc_rx_pause;
++	else if (!pause->rx_pause && pause->tx_pause)
++		hw->mac.fc = e1000_fc_tx_pause;
++	else if (!pause->rx_pause && !pause->tx_pause)
++		hw->mac.fc = e1000_fc_none;
++
++	hw->mac.original_fc = hw->mac.fc;
++
++	if (adapter->fc_autoneg == AUTONEG_ENABLE) {
++		if (netif_running(adapter->netdev)) {
++			e1000_down(adapter);
++			e1000_up(adapter);
++		} else {
++			e1000_reset(adapter);
++		}
++	} else {
++		retval = ((hw->media_type == e1000_media_type_fiber) ?
++			  hw->mac.ops.setup_link(hw) : e1000_force_mac_fc(hw));
++	}
++
++	clear_bit(__E1000_RESETTING, &adapter->state);
++	return retval;
++}
++
++static u32 e1000_get_rx_csum(struct net_device *netdev)
++{
++	struct e1000_adapter *adapter = netdev_priv(netdev);
++	return (adapter->flags & FLAG_RX_CSUM_ENABLED);
++}
++
++static int e1000_set_rx_csum(struct net_device *netdev, u32 data)
++{
++	struct e1000_adapter *adapter = netdev_priv(netdev);
++
++	if (data)
++		adapter->flags |= FLAG_RX_CSUM_ENABLED;
++	else
++		adapter->flags &= ~FLAG_RX_CSUM_ENABLED;
++
++	if (netif_running(netdev))
++		e1000_reinit_locked(adapter);
++	else
++		e1000_reset(adapter);
++	return 0;
++}
++
++static u32 e1000_get_tx_csum(struct net_device *netdev)
++{
++	return ((netdev->features & NETIF_F_HW_CSUM) != 0);
++}
++
++static int e1000_set_tx_csum(struct net_device *netdev, u32 data)
++{
++	if (data)
++		netdev->features |= NETIF_F_HW_CSUM;
++	else
++		netdev->features &= ~NETIF_F_HW_CSUM;
++
++	return 0;
++}
++
++static int e1000_set_tso(struct net_device *netdev, u32 data)
++{
++	struct e1000_adapter *adapter = netdev_priv(netdev);
++
++	if (data) {
++		netdev->features |= NETIF_F_TSO;
++		netdev->features |= NETIF_F_TSO6;
++	} else {
++		netdev->features &= ~NETIF_F_TSO;
++		netdev->features &= ~NETIF_F_TSO6;
++	}
++
++	ndev_info(netdev, "TSO is %s\n",
++		  data ? "Enabled" : "Disabled");
++	adapter->flags |= FLAG_TSO_FORCE;
++	return 0;
++}
++
++static u32 e1000_get_msglevel(struct net_device *netdev)
++{
++	struct e1000_adapter *adapter = netdev_priv(netdev);
++	return adapter->msg_enable;
++}
++
++static void e1000_set_msglevel(struct net_device *netdev, u32 data)
++{
++	struct e1000_adapter *adapter = netdev_priv(netdev);
++	adapter->msg_enable = data;
++}
++
++static int e1000_get_regs_len(struct net_device *netdev)
++{
++#define E1000_REGS_LEN 32 /* overestimate */
++	return E1000_REGS_LEN * sizeof(u32);
++}
++
++static void e1000_get_regs(struct net_device *netdev,
++			   struct ethtool_regs *regs, void *p)
++{
++	struct e1000_adapter *adapter = netdev_priv(netdev);
++	struct e1000_hw *hw = &adapter->hw;
++	u32 *regs_buff = p;
++	u16 phy_data;
++	u8 revision_id;
++
++	memset(p, 0, E1000_REGS_LEN * sizeof(u32));
++
++	pci_read_config_byte(adapter->pdev, PCI_REVISION_ID, &revision_id);
++
++	regs->version = (1 << 24) | (revision_id << 16) | adapter->pdev->device;
++
++	regs_buff[0]  = er32(CTRL);
++	regs_buff[1]  = er32(STATUS);
++
++	regs_buff[2]  = er32(RCTL);
++	regs_buff[3]  = er32(RDLEN);
++	regs_buff[4]  = er32(RDH);
++	regs_buff[5]  = er32(RDT);
++	regs_buff[6]  = er32(RDTR);
++
++	regs_buff[7]  = er32(TCTL);
++	regs_buff[8]  = er32(TDLEN);
++	regs_buff[9]  = er32(TDH);
++	regs_buff[10] = er32(TDT);
++	regs_buff[11] = er32(TIDV);
++
++	regs_buff[12] = adapter->hw.phy.type;  /* PHY type (IGP=1, M88=0) */
++	if (hw->phy.type == e1000_phy_m88) {
++		e1e_rphy(hw, M88E1000_PHY_SPEC_STATUS, &phy_data);
++		regs_buff[13] = (u32)phy_data; /* cable length */
++		regs_buff[14] = 0;  /* Dummy (to align w/ IGP phy reg dump) */
++		regs_buff[15] = 0;  /* Dummy (to align w/ IGP phy reg dump) */
++		regs_buff[16] = 0;  /* Dummy (to align w/ IGP phy reg dump) */
++		e1e_rphy(hw, M88E1000_PHY_SPEC_CTRL, &phy_data);
++		regs_buff[17] = (u32)phy_data; /* extended 10bt distance */
++		regs_buff[18] = regs_buff[13]; /* cable polarity */
++		regs_buff[19] = 0;  /* Dummy (to align w/ IGP phy reg dump) */
++		regs_buff[20] = regs_buff[17]; /* polarity correction */
++		/* phy receive errors */
++		regs_buff[22] = adapter->phy_stats.receive_errors;
++		regs_buff[23] = regs_buff[13]; /* mdix mode */
++	}
++	regs_buff[21] = adapter->phy_stats.idle_errors;  /* phy idle errors */
++	e1e_rphy(hw, PHY_1000T_STATUS, &phy_data);
++	regs_buff[24] = (u32)phy_data;  /* phy local receiver status */
++	regs_buff[25] = regs_buff[24];  /* phy remote receiver status */
++}
++
++static int e1000_get_eeprom_len(struct net_device *netdev)
++{
++	struct e1000_adapter *adapter = netdev_priv(netdev);
++	return adapter->hw.nvm.word_size * 2;
++}
++
++static int e1000_get_eeprom(struct net_device *netdev,
++			    struct ethtool_eeprom *eeprom, u8 *bytes)
++{
++	struct e1000_adapter *adapter = netdev_priv(netdev);
++	struct e1000_hw *hw = &adapter->hw;
++	u16 *eeprom_buff;
++	int first_word;
++	int last_word;
++	int ret_val = 0;
++	u16 i;
++
++	if (eeprom->len == 0)
++		return -EINVAL;
++
++	eeprom->magic = adapter->pdev->vendor | (adapter->pdev->device << 16);
++
++	first_word = eeprom->offset >> 1;
++	last_word = (eeprom->offset + eeprom->len - 1) >> 1;
++
++	eeprom_buff = kmalloc(sizeof(u16) *
++			(last_word - first_word + 1), GFP_KERNEL);
++	if (!eeprom_buff)
++		return -ENOMEM;
++
++	if (hw->nvm.type == e1000_nvm_eeprom_spi) {
++		ret_val = e1000_read_nvm(hw, first_word,
++					 last_word - first_word + 1,
++					 eeprom_buff);
++	} else {
++		for (i = 0; i < last_word - first_word + 1; i++) {
++			ret_val = e1000_read_nvm(hw, first_word + i, 1,
++						      &eeprom_buff[i]);
++			if (ret_val)
++				break;
++		}
++	}
++
++	/* Device's eeprom is always little-endian, word addressable */
++	for (i = 0; i < last_word - first_word + 1; i++)
++		le16_to_cpus(&eeprom_buff[i]);
++
++	memcpy(bytes, (u8 *)eeprom_buff + (eeprom->offset & 1), eeprom->len);
++	kfree(eeprom_buff);
++
++	return ret_val;
++}
++
++static int e1000_set_eeprom(struct net_device *netdev,
++			    struct ethtool_eeprom *eeprom, u8 *bytes)
++{
++	struct e1000_adapter *adapter = netdev_priv(netdev);
++	struct e1000_hw *hw = &adapter->hw;
++	u16 *eeprom_buff;
++	void *ptr;
++	int max_len;
++	int first_word;
++	int last_word;
++	int ret_val = 0;
++	u16 i;
++
++	if (eeprom->len == 0)
++		return -EOPNOTSUPP;
++
++	if (eeprom->magic != (adapter->pdev->vendor | (adapter->pdev->device << 16)))
++		return -EFAULT;
++
++	max_len = hw->nvm.word_size * 2;
++
++	first_word = eeprom->offset >> 1;
++	last_word = (eeprom->offset + eeprom->len - 1) >> 1;
++	eeprom_buff = kmalloc(max_len, GFP_KERNEL);
++	if (!eeprom_buff)
++		return -ENOMEM;
++
++	ptr = (void *)eeprom_buff;
++
++	if (eeprom->offset & 1) {
++		/* need read/modify/write of first changed EEPROM word */
++		/* only the second byte of the word is being modified */
++		ret_val = e1000_read_nvm(hw, first_word, 1, &eeprom_buff[0]);
++		ptr++;
++	}
++	if (((eeprom->offset + eeprom->len) & 1) && (ret_val == 0))
++		/* need read/modify/write of last changed EEPROM word */
++		/* only the first byte of the word is being modified */
++		ret_val = e1000_read_nvm(hw, last_word, 1,
++				  &eeprom_buff[last_word - first_word]);
++
++	/* Device's eeprom is always little-endian, word addressable */
++	for (i = 0; i < last_word - first_word + 1; i++)
++		le16_to_cpus(&eeprom_buff[i]);
++
++	memcpy(ptr, bytes, eeprom->len);
++
++	for (i = 0; i < last_word - first_word + 1; i++)
++		eeprom_buff[i] = cpu_to_le16(eeprom_buff[i]);
++
++	ret_val = e1000_write_nvm(hw, first_word,
++				  last_word - first_word + 1, eeprom_buff);
++
++	/* Update the checksum over the first part of the EEPROM if needed
++	 * and flush shadow RAM for 82573 controllers */
++	if ((ret_val == 0) && ((first_word <= NVM_CHECKSUM_REG) ||
++			       (hw->mac.type == e1000_82573)))
++		e1000_update_nvm_checksum(hw);
++
++	kfree(eeprom_buff);
++	return ret_val;
++}
++
++static void e1000_get_drvinfo(struct net_device *netdev,
++			      struct ethtool_drvinfo *drvinfo)
++{
++	struct e1000_adapter *adapter = netdev_priv(netdev);
++	char firmware_version[32];
++	u16 eeprom_data;
++
++	strncpy(drvinfo->driver,  e1000_driver_name, 32);
++	strncpy(drvinfo->version, e1000_driver_version, 32);
++
++	/* EEPROM image version # is reported as firmware version # for
++	 * PCI-E controllers */
++	e1000_read_nvm(&adapter->hw, 5, 1, &eeprom_data);
++	sprintf(firmware_version, "%d.%d-%d",
++		(eeprom_data & 0xF000) >> 12,
++		(eeprom_data & 0x0FF0) >> 4,
++		eeprom_data & 0x000F);
++
++	strncpy(drvinfo->fw_version, firmware_version, 32);
++	strncpy(drvinfo->bus_info, pci_name(adapter->pdev), 32);
++	drvinfo->n_stats = E1000_STATS_LEN;
++	drvinfo->testinfo_len = E1000_TEST_LEN;
++	drvinfo->regdump_len = e1000_get_regs_len(netdev);
++	drvinfo->eedump_len = e1000_get_eeprom_len(netdev);
++}
++
++static void e1000_get_ringparam(struct net_device *netdev,
++				struct ethtool_ringparam *ring)
++{
++	struct e1000_adapter *adapter = netdev_priv(netdev);
++	struct e1000_ring *tx_ring = adapter->tx_ring;
++	struct e1000_ring *rx_ring = adapter->rx_ring;
++
++	ring->rx_max_pending = E1000_MAX_RXD;
++	ring->tx_max_pending = E1000_MAX_TXD;
++	ring->rx_mini_max_pending = 0;
++	ring->rx_jumbo_max_pending = 0;
++	ring->rx_pending = rx_ring->count;
++	ring->tx_pending = tx_ring->count;
++	ring->rx_mini_pending = 0;
++	ring->rx_jumbo_pending = 0;
++}
++
++static int e1000_set_ringparam(struct net_device *netdev,
++			       struct ethtool_ringparam *ring)
++{
++	struct e1000_adapter *adapter = netdev_priv(netdev);
++	struct e1000_ring *tx_ring, *tx_old;
++	struct e1000_ring *rx_ring, *rx_old;
++	int err;
++
++	if ((ring->rx_mini_pending) || (ring->rx_jumbo_pending))
++		return -EINVAL;
++
++	while (test_and_set_bit(__E1000_RESETTING, &adapter->state))
++		msleep(1);
++
++	if (netif_running(adapter->netdev))
++		e1000_down(adapter);
++
++	tx_old = adapter->tx_ring;
++	rx_old = adapter->rx_ring;
++
++	err = -ENOMEM;
++	tx_ring = kzalloc(sizeof(struct e1000_ring), GFP_KERNEL);
++	if (!tx_ring)
++		goto err_alloc_tx;
++
++	rx_ring = kzalloc(sizeof(struct e1000_ring), GFP_KERNEL);
++	if (!rx_ring)
++		goto err_alloc_rx;
++
++	adapter->tx_ring = tx_ring;
++	adapter->rx_ring = rx_ring;
++
++	rx_ring->count = max(ring->rx_pending, (u32)E1000_MIN_RXD);
++	rx_ring->count = min(rx_ring->count, (u32)(E1000_MAX_RXD));
++	rx_ring->count = ALIGN(rx_ring->count, REQ_RX_DESCRIPTOR_MULTIPLE);
++
++	tx_ring->count = max(ring->tx_pending, (u32)E1000_MIN_TXD);
++	tx_ring->count = min(tx_ring->count, (u32)(E1000_MAX_TXD));
++	tx_ring->count = ALIGN(tx_ring->count, REQ_TX_DESCRIPTOR_MULTIPLE);
++
++	if (netif_running(adapter->netdev)) {
++		/* Try to get new resources before deleting old */
++		err = e1000_setup_rx_resources(adapter);
++		if (err)
++			goto err_setup_rx;
++		err = e1000_setup_tx_resources(adapter);
++		if (err)
++			goto err_setup_tx;
++
++		/* save the new, restore the old in order to free it,
++		 * then restore the new back again */
++		adapter->rx_ring = rx_old;
++		adapter->tx_ring = tx_old;
++		e1000_free_rx_resources(adapter);
++		e1000_free_tx_resources(adapter);
++		kfree(tx_old);
++		kfree(rx_old);
++		adapter->rx_ring = rx_ring;
++		adapter->tx_ring = tx_ring;
++		err = e1000_up(adapter);
++		if (err)
++			goto err_setup;
++	}
++
++	clear_bit(__E1000_RESETTING, &adapter->state);
++	return 0;
++err_setup_tx:
++	e1000_free_rx_resources(adapter);
++err_setup_rx:
++	adapter->rx_ring = rx_old;
++	adapter->tx_ring = tx_old;
++	kfree(rx_ring);
++err_alloc_rx:
++	kfree(tx_ring);
++err_alloc_tx:
++	e1000_up(adapter);
++err_setup:
++	clear_bit(__E1000_RESETTING, &adapter->state);
++	return err;
++}
++
++#define REG_PATTERN_TEST(R, M, W) REG_PATTERN_TEST_ARRAY(R, 0, M, W)
++#define REG_PATTERN_TEST_ARRAY(reg, offset, mask, writeable)		      \
++{									      \
++	u32 _pat;							      \
++	u32 _value;							      \
++	u32 _test[] = {0x5A5A5A5A, 0xA5A5A5A5, 0x00000000, 0xFFFFFFFF};	      \
++	for (_pat = 0; _pat < ARRAY_SIZE(_test); _pat++) {		      \
++		E1000_WRITE_REG_ARRAY(hw, reg, offset,	      \
++				      (_test[_pat] & writeable));	      \
++		_value = E1000_READ_REG_ARRAY(hw, reg, offset);     \
++		if (_value != (_test[_pat] & writeable & mask)) {	      \
++			ndev_err(netdev, "pattern test reg %04X "             \
++				 "failed: got 0x%08X expected 0x%08X\n",      \
++				 reg + offset,  \
++				 value, (_test[_pat] & writeable & mask));    \
++			*data = reg;					      \
++			return 1;					      \
++		}							      \
++	}								      \
++}
++
++#define REG_SET_AND_CHECK(R, M, W)					      \
++{									      \
++	u32 _value;							      \
++	__ew32(hw, R, W & M);						\
++	_value = __er32(hw, R);						\
++	if ((W & M) != (_value & M)) {					      \
++		ndev_err(netdev, "set/check reg %04X test failed: "           \
++			 "got 0x%08X expected 0x%08X\n", R, (_value & M),     \
++			 (W & M));					      \
++		*data = R;						      \
++		return 1;						      \
++	}								      \
++}
++
++static int e1000_reg_test(struct e1000_adapter *adapter, u64 *data)
++{
++	struct e1000_hw *hw = &adapter->hw;
++	struct e1000_mac_info *mac = &adapter->hw.mac;
++	struct net_device *netdev = adapter->netdev;
++	u32 value;
++	u32 before;
++	u32 after;
++	u32 i;
++	u32 toggle;
++
++	/* The status register is Read Only, so a write should fail.
++	 * Some bits that get toggled are ignored.
++	 */
++	switch (mac->type) {
++	/* there are several bits on newer hardware that are r/w */
++	case e1000_82571:
++	case e1000_82572:
++	case e1000_80003es2lan:
++		toggle = 0x7FFFF3FF;
++		break;
++	case e1000_82573:
++	case e1000_ich8lan:
++	case e1000_ich9lan:
++		toggle = 0x7FFFF033;
++		break;
++	default:
++		toggle = 0xFFFFF833;
++		break;
++	}
++
++	before = er32(STATUS);
++	value = (er32(STATUS) & toggle);
++	ew32(STATUS, toggle);
++	after = er32(STATUS) & toggle;
++	if (value != after) {
++		ndev_err(netdev, "failed STATUS register test got: "
++			 "0x%08X expected: 0x%08X\n", after, value);
++		*data = 1;
++		return 1;
++	}
++	/* restore previous status */
++	ew32(STATUS, before);
++
++	if ((mac->type != e1000_ich8lan) &&
++	    (mac->type != e1000_ich9lan)) {
++		REG_PATTERN_TEST(E1000_FCAL, 0xFFFFFFFF, 0xFFFFFFFF);
++		REG_PATTERN_TEST(E1000_FCAH, 0x0000FFFF, 0xFFFFFFFF);
++		REG_PATTERN_TEST(E1000_FCT, 0x0000FFFF, 0xFFFFFFFF);
++		REG_PATTERN_TEST(E1000_VET, 0x0000FFFF, 0xFFFFFFFF);
++	}
++
++	REG_PATTERN_TEST(E1000_RDTR, 0x0000FFFF, 0xFFFFFFFF);
++	REG_PATTERN_TEST(E1000_RDBAH, 0xFFFFFFFF, 0xFFFFFFFF);
++	REG_PATTERN_TEST(E1000_RDLEN, 0x000FFF80, 0x000FFFFF);
++	REG_PATTERN_TEST(E1000_RDH, 0x0000FFFF, 0x0000FFFF);
++	REG_PATTERN_TEST(E1000_RDT, 0x0000FFFF, 0x0000FFFF);
++	REG_PATTERN_TEST(E1000_FCRTH, 0x0000FFF8, 0x0000FFF8);
++	REG_PATTERN_TEST(E1000_FCTTV, 0x0000FFFF, 0x0000FFFF);
++	REG_PATTERN_TEST(E1000_TIPG, 0x3FFFFFFF, 0x3FFFFFFF);
++	REG_PATTERN_TEST(E1000_TDBAH, 0xFFFFFFFF, 0xFFFFFFFF);
++	REG_PATTERN_TEST(E1000_TDLEN, 0x000FFF80, 0x000FFFFF);
++
++	REG_SET_AND_CHECK(E1000_RCTL, 0xFFFFFFFF, 0x00000000);
++
++	before = (((mac->type == e1000_ich8lan) ||
++		   (mac->type == e1000_ich9lan)) ? 0x06C3B33E : 0x06DFB3FE);
++	REG_SET_AND_CHECK(E1000_RCTL, before, 0x003FFFFB);
++	REG_SET_AND_CHECK(E1000_TCTL, 0xFFFFFFFF, 0x00000000);
++
++	REG_SET_AND_CHECK(E1000_RCTL, 0xFFFFFFFF, 0x01FFFFFF);
++	REG_PATTERN_TEST(E1000_RDBAL, 0xFFFFF000, 0xFFFFFFFF);
++	REG_PATTERN_TEST(E1000_TXCW, 0x0000FFFF, 0x0000FFFF);
++	REG_PATTERN_TEST(E1000_TDBAL, 0xFFFFF000, 0xFFFFFFFF);
++
++	for (i = 0; i < mac->mta_reg_count; i++)
++		REG_PATTERN_TEST_ARRAY(E1000_MTA, i, 0xFFFFFFFF, 0xFFFFFFFF);
++
++	*data = 0;
++	return 0;
++}
++
++static int e1000_eeprom_test(struct e1000_adapter *adapter, u64 *data)
++{
++	u16 temp;
++	u16 checksum = 0;
++	u16 i;
++
++	*data = 0;
++	/* Read and add up the contents of the EEPROM */
++	for (i = 0; i < (NVM_CHECKSUM_REG + 1); i++) {
++		if ((e1000_read_nvm(&adapter->hw, i, 1, &temp)) < 0) {
++			*data = 1;
++			break;
++		}
++		checksum += temp;
++	}
++
++	/* If Checksum is not Correct return error else test passed */
++	if ((checksum != (u16) NVM_SUM) && !(*data))
++		*data = 2;
++
++	return *data;
++}
++
++static irqreturn_t e1000_test_intr(int irq, void *data)
++{
++	struct net_device *netdev = (struct net_device *) data;
++	struct e1000_adapter *adapter = netdev_priv(netdev);
++	struct e1000_hw *hw = &adapter->hw;
++
++	adapter->test_icr |= er32(ICR);
++
++	return IRQ_HANDLED;
++}
++
++static int e1000_intr_test(struct e1000_adapter *adapter, u64 *data)
++{
++	struct net_device *netdev = adapter->netdev;
++	struct e1000_hw *hw = &adapter->hw;
++	u32 mask;
++	u32 shared_int = 1;
++	u32 irq = adapter->pdev->irq;
++	int i;
++
++	*data = 0;
++
++	/* NOTE: we don't test MSI interrupts here, yet */
++	/* Hook up test interrupt handler just for this test */
++	if (!request_irq(irq, &e1000_test_intr, IRQF_PROBE_SHARED, netdev->name,
++			 netdev)) {
++		shared_int = 0;
++	} else if (request_irq(irq, &e1000_test_intr, IRQF_SHARED,
++		 netdev->name, netdev)) {
++		*data = 1;
++		return -1;
++	}
++	ndev_info(netdev, "testing %s interrupt\n",
++		  (shared_int ? "shared" : "unshared"));
++
++	/* Disable all the interrupts */
++	ew32(IMC, 0xFFFFFFFF);
++	msleep(10);
++
++	/* Test each interrupt */
++	for (i = 0; i < 10; i++) {
++
++		if (((adapter->hw.mac.type == e1000_ich8lan) ||
++		     (adapter->hw.mac.type == e1000_ich9lan)) && i == 8)
++			continue;
++
++		/* Interrupt to test */
++		mask = 1 << i;
++
++		if (!shared_int) {
++			/* Disable the interrupt to be reported in
++			 * the cause register and then force the same
++			 * interrupt and see if one gets posted.  If
++			 * an interrupt was posted to the bus, the
++			 * test failed.
++			 */
++			adapter->test_icr = 0;
++			ew32(IMC, mask);
++			ew32(ICS, mask);
++			msleep(10);
++
++			if (adapter->test_icr & mask) {
++				*data = 3;
++				break;
++			}
++		}
++
++		/* Enable the interrupt to be reported in
++		 * the cause register and then force the same
++		 * interrupt and see if one gets posted.  If
++		 * an interrupt was not posted to the bus, the
++		 * test failed.
++		 */
++		adapter->test_icr = 0;
++		ew32(IMS, mask);
++		ew32(ICS, mask);
++		msleep(10);
++
++		if (!(adapter->test_icr & mask)) {
++			*data = 4;
++			break;
++		}
++
++		if (!shared_int) {
++			/* Disable the other interrupts to be reported in
++			 * the cause register and then force the other
++			 * interrupts and see if any get posted.  If
++			 * an interrupt was posted to the bus, the
++			 * test failed.
++			 */
++			adapter->test_icr = 0;
++			ew32(IMC, ~mask & 0x00007FFF);
++			ew32(ICS, ~mask & 0x00007FFF);
++			msleep(10);
++
++			if (adapter->test_icr) {
++				*data = 5;
++				break;
++			}
++		}
++	}
++
++	/* Disable all the interrupts */
++	ew32(IMC, 0xFFFFFFFF);
++	msleep(10);
++
++	/* Unhook test interrupt handler */
++	free_irq(irq, netdev);
++
++	return *data;
++}
++
++static void e1000_free_desc_rings(struct e1000_adapter *adapter)
++{
++	struct e1000_ring *tx_ring = &adapter->test_tx_ring;
++	struct e1000_ring *rx_ring = &adapter->test_rx_ring;
++	struct pci_dev *pdev = adapter->pdev;
++	int i;
++
++	if (tx_ring->desc && tx_ring->buffer_info) {
++		for (i = 0; i < tx_ring->count; i++) {
++			if (tx_ring->buffer_info[i].dma)
++				pci_unmap_single(pdev,
++					tx_ring->buffer_info[i].dma,
++					tx_ring->buffer_info[i].length,
++					PCI_DMA_TODEVICE);
++			if (tx_ring->buffer_info[i].skb)
++				dev_kfree_skb(tx_ring->buffer_info[i].skb);
++		}
++	}
++
++	if (rx_ring->desc && rx_ring->buffer_info) {
++		for (i = 0; i < rx_ring->count; i++) {
++			if (rx_ring->buffer_info[i].dma)
++				pci_unmap_single(pdev,
++					rx_ring->buffer_info[i].dma,
++					2048, PCI_DMA_FROMDEVICE);
++			if (rx_ring->buffer_info[i].skb)
++				dev_kfree_skb(rx_ring->buffer_info[i].skb);
++		}
++	}
++
++	if (tx_ring->desc) {
++		pci_free_consistent(pdev, tx_ring->size, tx_ring->desc,
++				    tx_ring->dma);
++		tx_ring->desc = NULL;
++	}
++	if (rx_ring->desc) {
++		pci_free_consistent(pdev, rx_ring->size, rx_ring->desc,
++				    rx_ring->dma);
++		rx_ring->desc = NULL;
++	}
++
++	kfree(tx_ring->buffer_info);
++	tx_ring->buffer_info = NULL;
++	kfree(rx_ring->buffer_info);
++	rx_ring->buffer_info = NULL;
++}
++
++static int e1000_setup_desc_rings(struct e1000_adapter *adapter)
++{
++	struct e1000_ring *tx_ring = &adapter->test_tx_ring;
++	struct e1000_ring *rx_ring = &adapter->test_rx_ring;
++	struct pci_dev *pdev = adapter->pdev;
++	struct e1000_hw *hw = &adapter->hw;
++	u32 rctl;
++	int size;
++	int i;
++	int ret_val;
++
++	/* Setup Tx descriptor ring and Tx buffers */
++
++	if (!tx_ring->count)
++		tx_ring->count = E1000_DEFAULT_TXD;
++
++	size = tx_ring->count * sizeof(struct e1000_buffer);
++	tx_ring->buffer_info = kmalloc(size, GFP_KERNEL);
++	if (!tx_ring->buffer_info) {
++		ret_val = 1;
++		goto err_nomem;
++	}
++	memset(tx_ring->buffer_info, 0, size);
++
++	tx_ring->size = tx_ring->count * sizeof(struct e1000_tx_desc);
++	tx_ring->size = ALIGN(tx_ring->size, 4096);
++	tx_ring->desc = pci_alloc_consistent(pdev, tx_ring->size,
++			&tx_ring->dma);
++	if (!tx_ring->desc) {
++		ret_val = 2;
++		goto err_nomem;
++	}
++	memset(tx_ring->desc, 0, tx_ring->size);
++	tx_ring->next_to_use = 0;
++	tx_ring->next_to_clean = 0;
++
++	ew32(TDBAL,
++			((u64) tx_ring->dma & 0x00000000FFFFFFFF));
++	ew32(TDBAH, ((u64) tx_ring->dma >> 32));
++	ew32(TDLEN,
++			tx_ring->count * sizeof(struct e1000_tx_desc));
++	ew32(TDH, 0);
++	ew32(TDT, 0);
++	ew32(TCTL,
++			E1000_TCTL_PSP | E1000_TCTL_EN |
++			E1000_COLLISION_THRESHOLD << E1000_CT_SHIFT |
++			E1000_COLLISION_DISTANCE << E1000_COLD_SHIFT);
++
++	for (i = 0; i < tx_ring->count; i++) {
++		struct e1000_tx_desc *tx_desc = E1000_TX_DESC(*tx_ring, i);
++		struct sk_buff *skb;
++		unsigned int skb_size = 1024;
++
++		skb = alloc_skb(skb_size, GFP_KERNEL);
++		if (!skb) {
++			ret_val = 3;
++			goto err_nomem;
++		}
++		skb_put(skb, skb_size);
++		tx_ring->buffer_info[i].skb = skb;
++		tx_ring->buffer_info[i].length = skb->len;
++		tx_ring->buffer_info[i].dma =
++			pci_map_single(pdev, skb->data, skb->len,
++				       PCI_DMA_TODEVICE);
++		tx_desc->buffer_addr = cpu_to_le64(
++					 tx_ring->buffer_info[i].dma);
++		tx_desc->lower.data = cpu_to_le32(skb->len);
++		tx_desc->lower.data |= cpu_to_le32(E1000_TXD_CMD_EOP |
++						   E1000_TXD_CMD_IFCS |
++						   E1000_TXD_CMD_RPS);
++		tx_desc->upper.data = 0;
++	}
++
++	/* Setup Rx descriptor ring and Rx buffers */
++
++	if (!rx_ring->count)
++		rx_ring->count = E1000_DEFAULT_RXD;
++
++	size = rx_ring->count * sizeof(struct e1000_buffer);
++	rx_ring->buffer_info = kmalloc(size, GFP_KERNEL);
++	if (!rx_ring->buffer_info) {
++		ret_val = 4;
++		goto err_nomem;
++	}
++	memset(rx_ring->buffer_info, 0, size);
++
++	rx_ring->size = rx_ring->count * sizeof(struct e1000_rx_desc);
++	rx_ring->desc = pci_alloc_consistent(pdev, rx_ring->size,
++					     &rx_ring->dma);
++	if (!rx_ring->desc) {
++		ret_val = 5;
++		goto err_nomem;
++	}
++	memset(rx_ring->desc, 0, rx_ring->size);
++	rx_ring->next_to_use = 0;
++	rx_ring->next_to_clean = 0;
++
++	rctl = er32(RCTL);
++	ew32(RCTL, rctl & ~E1000_RCTL_EN);
++	ew32(RDBAL, ((u64) rx_ring->dma & 0xFFFFFFFF));
++	ew32(RDBAH, ((u64) rx_ring->dma >> 32));
++	ew32(RDLEN, rx_ring->size);
++	ew32(RDH, 0);
++	ew32(RDT, 0);
++	rctl = E1000_RCTL_EN | E1000_RCTL_BAM | E1000_RCTL_SZ_2048 |
++		E1000_RCTL_LBM_NO | E1000_RCTL_RDMTS_HALF |
++		(adapter->hw.mac.mc_filter_type << E1000_RCTL_MO_SHIFT);
++	ew32(RCTL, rctl);
++
++	for (i = 0; i < rx_ring->count; i++) {
++		struct e1000_rx_desc *rx_desc = E1000_RX_DESC(*rx_ring, i);
++		struct sk_buff *skb;
++
++		skb = alloc_skb(2048 + NET_IP_ALIGN, GFP_KERNEL);
++		if (!skb) {
++			ret_val = 6;
++			goto err_nomem;
++		}
++		skb_reserve(skb, NET_IP_ALIGN);
++		rx_ring->buffer_info[i].skb = skb;
++		rx_ring->buffer_info[i].dma =
++			pci_map_single(pdev, skb->data, 2048,
++				       PCI_DMA_FROMDEVICE);
++		rx_desc->buffer_addr =
++			cpu_to_le64(rx_ring->buffer_info[i].dma);
++		memset(skb->data, 0x00, skb->len);
++	}
++
++	return 0;
++
++err_nomem:
++	e1000_free_desc_rings(adapter);
++	return ret_val;
++}
++
++static void e1000_phy_disable_receiver(struct e1000_adapter *adapter)
++{
++	/* Write out to PHY registers 29 and 30 to disable the Receiver. */
++	e1e_wphy(&adapter->hw, 29, 0x001F);
++	e1e_wphy(&adapter->hw, 30, 0x8FFC);
++	e1e_wphy(&adapter->hw, 29, 0x001A);
++	e1e_wphy(&adapter->hw, 30, 0x8FF0);
++}
++
++static int e1000_integrated_phy_loopback(struct e1000_adapter *adapter)
++{
++	struct e1000_hw *hw = &adapter->hw;
++	u32 ctrl_reg = 0;
++	u32 stat_reg = 0;
++
++	adapter->hw.mac.autoneg = 0;
++
++	if (adapter->hw.phy.type == e1000_phy_m88) {
++		/* Auto-MDI/MDIX Off */
++		e1e_wphy(hw, M88E1000_PHY_SPEC_CTRL, 0x0808);
++		/* reset to update Auto-MDI/MDIX */
++		e1e_wphy(hw, PHY_CONTROL, 0x9140);
++		/* autoneg off */
++		e1e_wphy(hw, PHY_CONTROL, 0x8140);
++	} else if (adapter->hw.phy.type == e1000_phy_gg82563)
++		e1e_wphy(hw, GG82563_PHY_KMRN_MODE_CTRL, 0x1CC);
++
++	ctrl_reg = er32(CTRL);
++
++	if (adapter->hw.phy.type == e1000_phy_ife) {
++		/* force 100, set loopback */
++		e1e_wphy(hw, PHY_CONTROL, 0x6100);
++
++		/* Now set up the MAC to the same speed/duplex as the PHY. */
++		ctrl_reg &= ~E1000_CTRL_SPD_SEL; /* Clear the speed sel bits */
++		ctrl_reg |= (E1000_CTRL_FRCSPD | /* Set the Force Speed Bit */
++			     E1000_CTRL_FRCDPX | /* Set the Force Duplex Bit */
++			     E1000_CTRL_SPD_100 |/* Force Speed to 100 */
++			     E1000_CTRL_FD);	 /* Force Duplex to FULL */
++	} else {
++		/* force 1000, set loopback */
++		e1e_wphy(hw, PHY_CONTROL, 0x4140);
++
++		/* Now set up the MAC to the same speed/duplex as the PHY. */
++		ctrl_reg = er32(CTRL);
++		ctrl_reg &= ~E1000_CTRL_SPD_SEL; /* Clear the speed sel bits */
++		ctrl_reg |= (E1000_CTRL_FRCSPD | /* Set the Force Speed Bit */
++			     E1000_CTRL_FRCDPX | /* Set the Force Duplex Bit */
++			     E1000_CTRL_SPD_1000 |/* Force Speed to 1000 */
++			     E1000_CTRL_FD);	 /* Force Duplex to FULL */
++	}
++
++	if (adapter->hw.media_type == e1000_media_type_copper &&
++	   adapter->hw.phy.type == e1000_phy_m88) {
++		ctrl_reg |= E1000_CTRL_ILOS; /* Invert Loss of Signal */
++	} else {
++		/* Set the ILOS bit on the fiber Nic if half duplex link is
++		 * detected. */
++		stat_reg = er32(STATUS);
++		if ((stat_reg & E1000_STATUS_FD) == 0)
++			ctrl_reg |= (E1000_CTRL_ILOS | E1000_CTRL_SLU);
++	}
++
++	ew32(CTRL, ctrl_reg);
++
++	/* Disable the receiver on the PHY so when a cable is plugged in, the
++	 * PHY does not begin to autoneg when a cable is reconnected to the NIC.
++	 */
++	if (adapter->hw.phy.type == e1000_phy_m88)
++		e1000_phy_disable_receiver(adapter);
++
++	udelay(500);
++
++	return 0;
++}
++
++static int e1000_set_82571_fiber_loopback(struct e1000_adapter *adapter)
++{
++	struct e1000_hw *hw = &adapter->hw;
++	u32 ctrl = er32(CTRL);
++	int link = 0;
++
++	/* special requirements for 82571/82572 fiber adapters */
++
++	/* jump through hoops to make sure link is up because serdes
++	 * link is hardwired up */
++	ctrl |= E1000_CTRL_SLU;
++	ew32(CTRL, ctrl);
++
++	/* disable autoneg */
++	ctrl = er32(TXCW);
++	ctrl &= ~(1 << 31);
++	ew32(TXCW, ctrl);
++
++	link = (er32(STATUS) & E1000_STATUS_LU);
++
++	if (!link) {
++		/* set invert loss of signal */
++		ctrl = er32(CTRL);
++		ctrl |= E1000_CTRL_ILOS;
++		ew32(CTRL, ctrl);
++	}
++
++	/* special write to serdes control register to enable SerDes analog
++	 * loopback */
++#define E1000_SERDES_LB_ON 0x410
++	ew32(SCTL, E1000_SERDES_LB_ON);
++	msleep(10);
++
++	return 0;
++}
++
++/* only call this for fiber/serdes connections to es2lan */
++static int e1000_set_es2lan_mac_loopback(struct e1000_adapter *adapter)
++{
++	struct e1000_hw *hw = &adapter->hw;
++	u32 ctrlext = er32(CTRL_EXT);
++	u32 ctrl = er32(CTRL);
++
++	/* save CTRL_EXT to restore later, reuse an empty variable (unused
++	   on mac_type 80003es2lan) */
++	adapter->tx_fifo_head = ctrlext;
++
++	/* clear the serdes mode bits, putting the device into mac loopback */
++	ctrlext &= ~E1000_CTRL_EXT_LINK_MODE_PCIE_SERDES;
++	ew32(CTRL_EXT, ctrlext);
++
++	/* force speed to 1000/FD, link up */
++	ctrl &= ~(E1000_CTRL_SPD_1000 | E1000_CTRL_SPD_100);
++	ctrl |= (E1000_CTRL_SLU | E1000_CTRL_FRCSPD | E1000_CTRL_FRCDPX |
++		 E1000_CTRL_SPD_1000 | E1000_CTRL_FD);
++	ew32(CTRL, ctrl);
++
++	/* set mac loopback */
++	ctrl = er32(RCTL);
++	ctrl |= E1000_RCTL_LBM_MAC;
++	ew32(RCTL, ctrl);
++
++	/* set testing mode parameters (no need to reset later) */
++#define KMRNCTRLSTA_OPMODE (0x1F << 16)
++#define KMRNCTRLSTA_OPMODE_1GB_FD_GMII 0x0582
++	ew32(KMRNCTRLSTA,
++		(KMRNCTRLSTA_OPMODE | KMRNCTRLSTA_OPMODE_1GB_FD_GMII));
++
++	return 0;
++}
++
++static int e1000_setup_loopback_test(struct e1000_adapter *adapter)
++{
++	struct e1000_hw *hw = &adapter->hw;
++	u32 rctl;
++
++	if (hw->media_type == e1000_media_type_fiber ||
++	    hw->media_type == e1000_media_type_internal_serdes) {
++		switch (hw->mac.type) {
++		case e1000_80003es2lan:
++			return e1000_set_es2lan_mac_loopback(adapter);
++			break;
++		case e1000_82571:
++		case e1000_82572:
++			return e1000_set_82571_fiber_loopback(adapter);
++			break;
++		default:
++			rctl = er32(RCTL);
++			rctl |= E1000_RCTL_LBM_TCVR;
++			ew32(RCTL, rctl);
++			return 0;
++		}
++	} else if (hw->media_type == e1000_media_type_copper) {
++		return e1000_integrated_phy_loopback(adapter);
++	}
++
++	return 7;
++}
++
++static void e1000_loopback_cleanup(struct e1000_adapter *adapter)
++{
++	struct e1000_hw *hw = &adapter->hw;
++	u32 rctl;
++	u16 phy_reg;
++
++	rctl = er32(RCTL);
++	rctl &= ~(E1000_RCTL_LBM_TCVR | E1000_RCTL_LBM_MAC);
++	ew32(RCTL, rctl);
++
++	switch (hw->mac.type) {
++	case e1000_80003es2lan:
++		if (hw->media_type == e1000_media_type_fiber ||
++		    hw->media_type == e1000_media_type_internal_serdes) {
++			/* restore CTRL_EXT, stealing space from tx_fifo_head */
++			ew32(CTRL_EXT,
++					adapter->tx_fifo_head);
++			adapter->tx_fifo_head = 0;
++		}
++		/* fall through */
++	case e1000_82571:
++	case e1000_82572:
++		if (hw->media_type == e1000_media_type_fiber ||
++		    hw->media_type == e1000_media_type_internal_serdes) {
++#define E1000_SERDES_LB_OFF 0x400
++			ew32(SCTL, E1000_SERDES_LB_OFF);
++			msleep(10);
++			break;
++		}
++		/* Fall Through */
++	default:
++		hw->mac.autoneg = 1;
++		if (hw->phy.type == e1000_phy_gg82563)
++			e1e_wphy(hw, GG82563_PHY_KMRN_MODE_CTRL, 0x180);
++		e1e_rphy(hw, PHY_CONTROL, &phy_reg);
++		if (phy_reg & MII_CR_LOOPBACK) {
++			phy_reg &= ~MII_CR_LOOPBACK;
++			e1e_wphy(hw, PHY_CONTROL, phy_reg);
++			e1000_commit_phy(hw);
++		}
++		break;
++	}
++}
++
++static void e1000_create_lbtest_frame(struct sk_buff *skb,
++				      unsigned int frame_size)
++{
++	memset(skb->data, 0xFF, frame_size);
++	frame_size &= ~1;
++	memset(&skb->data[frame_size / 2], 0xAA, frame_size / 2 - 1);
++	memset(&skb->data[frame_size / 2 + 10], 0xBE, 1);
++	memset(&skb->data[frame_size / 2 + 12], 0xAF, 1);
++}
++
++static int e1000_check_lbtest_frame(struct sk_buff *skb,
++				    unsigned int frame_size)
++{
++	frame_size &= ~1;
++	if (*(skb->data + 3) == 0xFF)
++		if ((*(skb->data + frame_size / 2 + 10) == 0xBE) &&
++		   (*(skb->data + frame_size / 2 + 12) == 0xAF))
++			return 0;
++	return 13;
++}
++
++static int e1000_run_loopback_test(struct e1000_adapter *adapter)
++{
++	struct e1000_ring *tx_ring = &adapter->test_tx_ring;
++	struct e1000_ring *rx_ring = &adapter->test_rx_ring;
++	struct pci_dev *pdev = adapter->pdev;
++	struct e1000_hw *hw = &adapter->hw;
++	int i, j, k, l;
++	int lc;
++	int good_cnt;
++	int ret_val = 0;
++	unsigned long time;
++
++	ew32(RDT, rx_ring->count - 1);
++
++	/* Calculate the loop count based on the largest descriptor ring
++	 * The idea is to wrap the largest ring a number of times using 64
++	 * send/receive pairs during each loop
++	 */
++
++	if (rx_ring->count <= tx_ring->count)
++		lc = ((tx_ring->count / 64) * 2) + 1;
++	else
++		lc = ((rx_ring->count / 64) * 2) + 1;
++
++	k = 0;
++	l = 0;
++	for (j = 0; j <= lc; j++) { /* loop count loop */
++		for (i = 0; i < 64; i++) { /* send the packets */
++			e1000_create_lbtest_frame(
++				tx_ring->buffer_info[i].skb, 1024);
++			pci_dma_sync_single_for_device(pdev,
++					tx_ring->buffer_info[k].dma,
++					tx_ring->buffer_info[k].length,
++					PCI_DMA_TODEVICE);
++			k++;
++			if (k == tx_ring->count)
++				k = 0;
++		}
++		ew32(TDT, k);
++		msleep(200);
++		time = jiffies; /* set the start time for the receive */
++		good_cnt = 0;
++		do { /* receive the sent packets */
++			pci_dma_sync_single_for_cpu(pdev,
++					rx_ring->buffer_info[l].dma, 2048,
++					PCI_DMA_FROMDEVICE);
++
++			ret_val = e1000_check_lbtest_frame(
++					rx_ring->buffer_info[l].skb, 1024);
++			if (!ret_val)
++				good_cnt++;
++			l++;
++			if (l == rx_ring->count)
++				l = 0;
++			/* time + 20 msecs (200 msecs on 2.4) is more than
++			 * enough time to complete the receives, if it's
++			 * exceeded, break and error off
++			 */
++		} while (good_cnt < 64 && jiffies < (time + 20));
++		if (good_cnt != 64) {
++			ret_val = 13; /* ret_val is the same as mis-compare */
++			break;
++		}
++		if (jiffies >= (time + 2)) {
++			ret_val = 14; /* error code for time out error */
++			break;
++		}
++	} /* end loop count loop */
++	return ret_val;
++}
++
++static int e1000_loopback_test(struct e1000_adapter *adapter, u64 *data)
++{
++	/* PHY loopback cannot be performed if SoL/IDER
++	 * sessions are active */
++	if (e1000_check_reset_block(&adapter->hw)) {
++		ndev_err(adapter->netdev, "Cannot do PHY loopback test "
++			 "when SoL/IDER is active.\n");
++		*data = 0;
++		goto out;
++	}
++
++	*data = e1000_setup_desc_rings(adapter);
++	if (data)
++		goto out;
++
++	*data = e1000_setup_loopback_test(adapter);
++	if (data)
++		goto err_loopback;
++
++	*data = e1000_run_loopback_test(adapter);
++	e1000_loopback_cleanup(adapter);
++
++err_loopback:
++	e1000_free_desc_rings(adapter);
++out:
++	return *data;
++}
++
++static int e1000_link_test(struct e1000_adapter *adapter, u64 *data)
++{
++	struct e1000_hw *hw = &adapter->hw;
++
++	*data = 0;
++	if (hw->media_type == e1000_media_type_internal_serdes) {
++		int i = 0;
++		hw->mac.serdes_has_link = 0;
++
++		/* On some blade server designs, link establishment
++		 * could take as long as 2-3 minutes */
++		do {
++			hw->mac.ops.check_for_link(hw);
++			if (hw->mac.serdes_has_link)
++				return *data;
++			msleep(20);
++		} while (i++ < 3750);
++
++		*data = 1;
++	} else {
++		hw->mac.ops.check_for_link(hw);
++		if (hw->mac.autoneg)
++			msleep(4000);
++
++		if (!(er32(STATUS) &
++		      E1000_STATUS_LU))
++			*data = 1;
++	}
++	return *data;
++}
++
++static int e1000_diag_test_count(struct net_device *netdev)
++{
++	return E1000_TEST_LEN;
++}
++
++static void e1000_diag_test(struct net_device *netdev,
++			    struct ethtool_test *eth_test, u64 *data)
++{
++	struct e1000_adapter *adapter = netdev_priv(netdev);
++	u16 autoneg_advertised;
++	u8 forced_speed_duplex;
++	u8 autoneg;
++	bool if_running = netif_running(netdev);
++
++	set_bit(__E1000_TESTING, &adapter->state);
++	if (eth_test->flags == ETH_TEST_FL_OFFLINE) {
++		/* Offline tests */
++
++		/* save speed, duplex, autoneg settings */
++		autoneg_advertised = adapter->hw.phy.autoneg_advertised;
++		forced_speed_duplex = adapter->hw.mac.forced_speed_duplex;
++		autoneg = adapter->hw.mac.autoneg;
++
++		ndev_info(netdev, "offline testing starting\n");
++
++		/* Link test performed before hardware reset so autoneg doesn't
++		 * interfere with test result */
++		if (e1000_link_test(adapter, &data[4]))
++			eth_test->flags |= ETH_TEST_FL_FAILED;
++
++		if (if_running)
++			/* indicate we're in test mode */
++			dev_close(netdev);
++		else
++			e1000_reset(adapter);
++
++		if (e1000_reg_test(adapter, &data[0]))
++			eth_test->flags |= ETH_TEST_FL_FAILED;
++
++		e1000_reset(adapter);
++		if (e1000_eeprom_test(adapter, &data[1]))
++			eth_test->flags |= ETH_TEST_FL_FAILED;
++
++		e1000_reset(adapter);
++		if (e1000_intr_test(adapter, &data[2]))
++			eth_test->flags |= ETH_TEST_FL_FAILED;
++
++		e1000_reset(adapter);
++		/* make sure the phy is powered up */
++		e1000_power_up_phy(adapter);
++		if (e1000_loopback_test(adapter, &data[3]))
++			eth_test->flags |= ETH_TEST_FL_FAILED;
++
++		/* restore speed, duplex, autoneg settings */
++		adapter->hw.phy.autoneg_advertised = autoneg_advertised;
++		adapter->hw.mac.forced_speed_duplex = forced_speed_duplex;
++		adapter->hw.mac.autoneg = autoneg;
++
++		/* force this routine to wait until autoneg complete/timeout */
++		adapter->hw.phy.wait_for_link = 1;
++		e1000_reset(adapter);
++		adapter->hw.phy.wait_for_link = 0;
++
++		clear_bit(__E1000_TESTING, &adapter->state);
++		if (if_running)
++			dev_open(netdev);
++	} else {
++		ndev_info(netdev, "online testing starting\n");
++		/* Online tests */
++		if (e1000_link_test(adapter, &data[4]))
++			eth_test->flags |= ETH_TEST_FL_FAILED;
++
++		/* Online tests aren't run; pass by default */
++		data[0] = 0;
++		data[1] = 0;
++		data[2] = 0;
++		data[3] = 0;
++
++		clear_bit(__E1000_TESTING, &adapter->state);
++	}
++	msleep_interruptible(4 * 1000);
++}
++
++static void e1000_get_wol(struct net_device *netdev,
++			  struct ethtool_wolinfo *wol)
++{
++	struct e1000_adapter *adapter = netdev_priv(netdev);
++
++	wol->supported = 0;
++	wol->wolopts = 0;
++
++	if (!(adapter->flags & FLAG_HAS_WOL))
++		return;
++
++	wol->supported = WAKE_UCAST | WAKE_MCAST |
++			 WAKE_BCAST | WAKE_MAGIC;
++
++	/* apply any specific unsupported masks here */
++	if (adapter->flags & FLAG_NO_WAKE_UCAST) {
++		wol->supported &= ~WAKE_UCAST;
++
++		if (adapter->wol & E1000_WUFC_EX)
++			ndev_err(netdev, "Interface does not support "
++				 "directed (unicast) frame wake-up packets\n");
++	}
++
++	if (adapter->wol & E1000_WUFC_EX)
++		wol->wolopts |= WAKE_UCAST;
++	if (adapter->wol & E1000_WUFC_MC)
++		wol->wolopts |= WAKE_MCAST;
++	if (adapter->wol & E1000_WUFC_BC)
++		wol->wolopts |= WAKE_BCAST;
++	if (adapter->wol & E1000_WUFC_MAG)
++		wol->wolopts |= WAKE_MAGIC;
++}
++
++static int e1000_set_wol(struct net_device *netdev,
++			 struct ethtool_wolinfo *wol)
++{
++	struct e1000_adapter *adapter = netdev_priv(netdev);
++
++	if (wol->wolopts & (WAKE_PHY | WAKE_ARP | WAKE_MAGICSECURE))
++		return -EOPNOTSUPP;
++
++	if (!(adapter->flags & FLAG_HAS_WOL))
++		return wol->wolopts ? -EOPNOTSUPP : 0;
++
++	/* these settings will always override what we currently have */
++	adapter->wol = 0;
++
++	if (wol->wolopts & WAKE_UCAST)
++		adapter->wol |= E1000_WUFC_EX;
++	if (wol->wolopts & WAKE_MCAST)
++		adapter->wol |= E1000_WUFC_MC;
++	if (wol->wolopts & WAKE_BCAST)
++		adapter->wol |= E1000_WUFC_BC;
++	if (wol->wolopts & WAKE_MAGIC)
++		adapter->wol |= E1000_WUFC_MAG;
++
++	return 0;
++}
++
++/* toggle LED 4 times per second = 2 "blinks" per second */
++#define E1000_ID_INTERVAL	(HZ/4)
++
++/* bit defines for adapter->led_status */
++#define E1000_LED_ON		0
++
++static void e1000_led_blink_callback(unsigned long data)
++{
++	struct e1000_adapter *adapter = (struct e1000_adapter *) data;
++
++	if (test_and_change_bit(E1000_LED_ON, &adapter->led_status))
++		adapter->hw.mac.ops.led_off(&adapter->hw);
++	else
++		adapter->hw.mac.ops.led_on(&adapter->hw);
++
++	mod_timer(&adapter->blink_timer, jiffies + E1000_ID_INTERVAL);
++}
++
++static int e1000_phys_id(struct net_device *netdev, u32 data)
++{
++	struct e1000_adapter *adapter = netdev_priv(netdev);
++
++	if (!data || data > (u32)(MAX_SCHEDULE_TIMEOUT / HZ))
++		data = (u32)(MAX_SCHEDULE_TIMEOUT / HZ);
++
++	if (adapter->hw.phy.type == e1000_phy_ife) {
++		if (!adapter->blink_timer.function) {
++			init_timer(&adapter->blink_timer);
++			adapter->blink_timer.function =
++				e1000_led_blink_callback;
++			adapter->blink_timer.data = (unsigned long) adapter;
++		}
++		mod_timer(&adapter->blink_timer, jiffies);
++		msleep_interruptible(data * 1000);
++		del_timer_sync(&adapter->blink_timer);
++		e1e_wphy(&adapter->hw,
++				    IFE_PHY_SPECIAL_CONTROL_LED, 0);
++	} else {
++		e1000_blink_led(&adapter->hw);
++		msleep_interruptible(data * 1000);
++	}
++
++	adapter->hw.mac.ops.led_off(&adapter->hw);
++	clear_bit(E1000_LED_ON, &adapter->led_status);
++	adapter->hw.mac.ops.cleanup_led(&adapter->hw);
++
++	return 0;
++}
++
++static int e1000_nway_reset(struct net_device *netdev)
++{
++	struct e1000_adapter *adapter = netdev_priv(netdev);
++	if (netif_running(netdev))
++		e1000_reinit_locked(adapter);
++	return 0;
++}
++
++static int e1000_get_stats_count(struct net_device *netdev)
++{
++	return E1000_STATS_LEN;
++}
++
++static void e1000_get_ethtool_stats(struct net_device *netdev,
++				    struct ethtool_stats *stats,
++				    u64 *data)
++{
++	struct e1000_adapter *adapter = netdev_priv(netdev);
++	int i;
++
++	e1000_update_stats(adapter);
++	for (i = 0; i < E1000_GLOBAL_STATS_LEN; i++) {
++		char *p = (char *)adapter+e1000_gstrings_stats[i].stat_offset;
++		data[i] = (e1000_gstrings_stats[i].sizeof_stat ==
++			sizeof(u64)) ? *(u64 *)p : *(u32 *)p;
++	}
++}
++
++static void e1000_get_strings(struct net_device *netdev, u32 stringset,
++			      u8 *data)
++{
++	u8 *p = data;
++	int i;
++
++	switch (stringset) {
++	case ETH_SS_TEST:
++		memcpy(data, *e1000_gstrings_test,
++			E1000_TEST_LEN*ETH_GSTRING_LEN);
++		break;
++	case ETH_SS_STATS:
++		for (i = 0; i < E1000_GLOBAL_STATS_LEN; i++) {
++			memcpy(p, e1000_gstrings_stats[i].stat_string,
++			       ETH_GSTRING_LEN);
++			p += ETH_GSTRING_LEN;
++		}
++		break;
++	}
++}
++
++static const struct ethtool_ops e1000_ethtool_ops = {
++	.get_settings		= e1000_get_settings,
++	.set_settings		= e1000_set_settings,
++	.get_drvinfo		= e1000_get_drvinfo,
++	.get_regs_len		= e1000_get_regs_len,
++	.get_regs		= e1000_get_regs,
++	.get_wol		= e1000_get_wol,
++	.set_wol		= e1000_set_wol,
++	.get_msglevel		= e1000_get_msglevel,
++	.set_msglevel		= e1000_set_msglevel,
++	.nway_reset		= e1000_nway_reset,
++	.get_link		= ethtool_op_get_link,
++	.get_eeprom_len		= e1000_get_eeprom_len,
++	.get_eeprom		= e1000_get_eeprom,
++	.set_eeprom		= e1000_set_eeprom,
++	.get_ringparam		= e1000_get_ringparam,
++	.set_ringparam		= e1000_set_ringparam,
++	.get_pauseparam		= e1000_get_pauseparam,
++	.set_pauseparam		= e1000_set_pauseparam,
++	.get_rx_csum		= e1000_get_rx_csum,
++	.set_rx_csum		= e1000_set_rx_csum,
++	.get_tx_csum		= e1000_get_tx_csum,
++	.set_tx_csum		= e1000_set_tx_csum,
++	.get_sg			= ethtool_op_get_sg,
++	.set_sg			= ethtool_op_set_sg,
++	.get_tso		= ethtool_op_get_tso,
++	.set_tso		= e1000_set_tso,
++	.self_test_count	= e1000_diag_test_count,
++	.self_test		= e1000_diag_test,
++	.get_strings		= e1000_get_strings,
++	.phys_id		= e1000_phys_id,
++	.get_stats_count	= e1000_get_stats_count,
++	.get_ethtool_stats	= e1000_get_ethtool_stats,
++};
++
++void e1000_set_ethtool_ops(struct net_device *netdev)
++{
++	SET_ETHTOOL_OPS(netdev, &e1000_ethtool_ops);
++}
+diff --git a/drivers/net/e1000e/hw.h b/drivers/net/e1000e/hw.h
+new file mode 100644
+index 0000000..4d562c4
+--- /dev/null
++++ b/drivers/net/e1000e/hw.h
+@@ -0,0 +1,862 @@
++/*******************************************************************************
++
++  Intel PRO/1000 Linux driver
++  Copyright(c) 1999 - 2007 Intel Corporation.
++
++  This program is free software; you can redistribute it and/or modify it
++  under the terms and conditions of the GNU General Public License,
++  version 2, as published by the Free Software Foundation.
++
++  This program is distributed in the hope 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.,
++  51 Franklin St - Fifth Floor, Boston, MA 02110-1301 USA.
++
++  The full GNU General Public License is included in this distribution in
++  the file called "COPYING".
++
++  Contact Information:
++  Linux NICS <linux.nics at intel.com>
++  e1000-devel Mailing List <e1000-devel at lists.sourceforge.net>
++  Intel Corporation, 5200 N.E. Elam Young Parkway, Hillsboro, OR 97124-6497
++
++*******************************************************************************/
++
++#ifndef _E1000_HW_H_
++#define _E1000_HW_H_
++
++struct e1000_hw;
++struct e1000_adapter;
++
++#include "defines.h"
++
++#define er32(reg)	__er32(hw, E1000_##reg)
++#define ew32(reg,val)	__ew32(hw, E1000_##reg, (val))
++#define e1e_flush()	er32(STATUS)
++
++#define E1000_WRITE_REG_ARRAY(a, reg, offset, value) \
++	(writel((value), ((a)->hw_addr + reg + ((offset) << 2))))
++
++#define E1000_READ_REG_ARRAY(a, reg, offset) \
++	(readl((a)->hw_addr + reg + ((offset) << 2)))
++
++enum e1e_registers {
++	E1000_CTRL     = 0x00000, /* Device Control - RW */
++	E1000_STATUS   = 0x00008, /* Device Status - RO */
++	E1000_EECD     = 0x00010, /* EEPROM/Flash Control - RW */
++	E1000_EERD     = 0x00014, /* EEPROM Read - RW */
++	E1000_CTRL_EXT = 0x00018, /* Extended Device Control - RW */
++	E1000_FLA      = 0x0001C, /* Flash Access - RW */
++	E1000_MDIC     = 0x00020, /* MDI Control - RW */
++	E1000_SCTL     = 0x00024, /* SerDes Control - RW */
++	E1000_FCAL     = 0x00028, /* Flow Control Address Low - RW */
++	E1000_FCAH     = 0x0002C, /* Flow Control Address High -RW */
++	E1000_FEXTNVM  = 0x00028, /* Future Extended NVM - RW */
++	E1000_FCT      = 0x00030, /* Flow Control Type - RW */
++	E1000_VET      = 0x00038, /* VLAN Ether Type - RW */
++	E1000_ICR      = 0x000C0, /* Interrupt Cause Read - R/clr */
++	E1000_ITR      = 0x000C4, /* Interrupt Throttling Rate - RW */
++	E1000_ICS      = 0x000C8, /* Interrupt Cause Set - WO */
++	E1000_IMS      = 0x000D0, /* Interrupt Mask Set - RW */
++	E1000_IMC      = 0x000D8, /* Interrupt Mask Clear - WO */
++	E1000_IAM      = 0x000E0, /* Interrupt Acknowledge Auto Mask */
++	E1000_RCTL     = 0x00100, /* RX Control - RW */
++	E1000_FCTTV    = 0x00170, /* Flow Control Transmit Timer Value - RW */
++	E1000_TXCW     = 0x00178, /* TX Configuration Word - RW */
++	E1000_RXCW     = 0x00180, /* RX Configuration Word - RO */
++	E1000_TCTL     = 0x00400, /* TX Control - RW */
++	E1000_TCTL_EXT = 0x00404, /* Extended TX Control - RW */
++	E1000_TIPG     = 0x00410, /* TX Inter-packet gap -RW */
++	E1000_AIT      = 0x00458, /* Adaptive Interframe Spacing Throttle - RW */
++	E1000_LEDCTL   = 0x00E00, /* LED Control - RW */
++	E1000_EXTCNF_CTRL  = 0x00F00, /* Extended Configuration Control */
++	E1000_EXTCNF_SIZE  = 0x00F08, /* Extended Configuration Size */
++	E1000_PHY_CTRL     = 0x00F10, /* PHY Control Register in CSR */
++	E1000_PBA      = 0x01000, /* Packet Buffer Allocation - RW */
++	E1000_PBS      = 0x01008, /* Packet Buffer Size */
++	E1000_EEMNGCTL = 0x01010, /* MNG EEprom Control */
++	E1000_EEWR     = 0x0102C, /* EEPROM Write Register - RW */
++	E1000_FLOP     = 0x0103C, /* FLASH Opcode Register */
++	E1000_ERT      = 0x02008, /* Early Rx Threshold - RW */
++	E1000_FCRTL    = 0x02160, /* Flow Control Receive Threshold Low - RW */
++	E1000_FCRTH    = 0x02168, /* Flow Control Receive Threshold High - RW */
++	E1000_PSRCTL   = 0x02170, /* Packet Split Receive Control - RW */
++	E1000_RDBAL    = 0x02800, /* RX Descriptor Base Address Low - RW */
++	E1000_RDBAH    = 0x02804, /* RX Descriptor Base Address High - RW */
++	E1000_RDLEN    = 0x02808, /* RX Descriptor Length - RW */
++	E1000_RDH      = 0x02810, /* RX Descriptor Head - RW */
++	E1000_RDT      = 0x02818, /* RX Descriptor Tail - RW */
++	E1000_RDTR     = 0x02820, /* RX Delay Timer - RW */
++	E1000_RADV     = 0x0282C, /* RX Interrupt Absolute Delay Timer - RW */
++
++/* Convenience macros
++ *
++ * Note: "_n" is the queue number of the register to be written to.
++ *
++ * Example usage:
++ * E1000_RDBAL_REG(current_rx_queue)
++ *
++ */
++#define E1000_RDBAL_REG(_n)   (E1000_RDBAL + (_n << 8))
++	E1000_KABGTXD  = 0x03004, /* AFE Band Gap Transmit Ref Data */
++	E1000_TDBAL    = 0x03800, /* TX Descriptor Base Address Low - RW */
++	E1000_TDBAH    = 0x03804, /* TX Descriptor Base Address High - RW */
++	E1000_TDLEN    = 0x03808, /* TX Descriptor Length - RW */
++	E1000_TDH      = 0x03810, /* TX Descriptor Head - RW */
++	E1000_TDT      = 0x03818, /* TX Descriptor Tail - RW */
++	E1000_TIDV     = 0x03820, /* TX Interrupt Delay Value - RW */
++	E1000_TXDCTL   = 0x03828, /* TX Descriptor Control - RW */
++	E1000_TADV     = 0x0382C, /* TX Interrupt Absolute Delay Val - RW */
++	E1000_TARC0    = 0x03840, /* TX Arbitration Count (0) */
++	E1000_TXDCTL1  = 0x03928, /* TX Descriptor Control (1) - RW */
++	E1000_TARC1    = 0x03940, /* TX Arbitration Count (1) */
++	E1000_CRCERRS  = 0x04000, /* CRC Error Count - R/clr */
++	E1000_ALGNERRC = 0x04004, /* Alignment Error Count - R/clr */
++	E1000_SYMERRS  = 0x04008, /* Symbol Error Count - R/clr */
++	E1000_RXERRC   = 0x0400C, /* Receive Error Count - R/clr */
++	E1000_MPC      = 0x04010, /* Missed Packet Count - R/clr */
++	E1000_SCC      = 0x04014, /* Single Collision Count - R/clr */
++	E1000_ECOL     = 0x04018, /* Excessive Collision Count - R/clr */
++	E1000_MCC      = 0x0401C, /* Multiple Collision Count - R/clr */
++	E1000_LATECOL  = 0x04020, /* Late Collision Count - R/clr */
++	E1000_COLC     = 0x04028, /* Collision Count - R/clr */
++	E1000_DC       = 0x04030, /* Defer Count - R/clr */
++	E1000_TNCRS    = 0x04034, /* TX-No CRS - R/clr */
++	E1000_SEC      = 0x04038, /* Sequence Error Count - R/clr */
++	E1000_CEXTERR  = 0x0403C, /* Carrier Extension Error Count - R/clr */
++	E1000_RLEC     = 0x04040, /* Receive Length Error Count - R/clr */
++	E1000_XONRXC   = 0x04048, /* XON RX Count - R/clr */
++	E1000_XONTXC   = 0x0404C, /* XON TX Count - R/clr */
++	E1000_XOFFRXC  = 0x04050, /* XOFF RX Count - R/clr */
++	E1000_XOFFTXC  = 0x04054, /* XOFF TX Count - R/clr */
++	E1000_FCRUC    = 0x04058, /* Flow Control RX Unsupported Count- R/clr */
++	E1000_PRC64    = 0x0405C, /* Packets RX (64 bytes) - R/clr */
++	E1000_PRC127   = 0x04060, /* Packets RX (65-127 bytes) - R/clr */
++	E1000_PRC255   = 0x04064, /* Packets RX (128-255 bytes) - R/clr */
++	E1000_PRC511   = 0x04068, /* Packets RX (255-511 bytes) - R/clr */
++	E1000_PRC1023  = 0x0406C, /* Packets RX (512-1023 bytes) - R/clr */
++	E1000_PRC1522  = 0x04070, /* Packets RX (1024-1522 bytes) - R/clr */
++	E1000_GPRC     = 0x04074, /* Good Packets RX Count - R/clr */
++	E1000_BPRC     = 0x04078, /* Broadcast Packets RX Count - R/clr */
++	E1000_MPRC     = 0x0407C, /* Multicast Packets RX Count - R/clr */
++	E1000_GPTC     = 0x04080, /* Good Packets TX Count - R/clr */
++	E1000_GORCL    = 0x04088, /* Good Octets RX Count Low - R/clr */
++	E1000_GORCH    = 0x0408C, /* Good Octets RX Count High - R/clr */
++	E1000_GOTCL    = 0x04090, /* Good Octets TX Count Low - R/clr */
++	E1000_GOTCH    = 0x04094, /* Good Octets TX Count High - R/clr */
++	E1000_RNBC     = 0x040A0, /* RX No Buffers Count - R/clr */
++	E1000_RUC      = 0x040A4, /* RX Undersize Count - R/clr */
++	E1000_RFC      = 0x040A8, /* RX Fragment Count - R/clr */
++	E1000_ROC      = 0x040AC, /* RX Oversize Count - R/clr */
++	E1000_RJC      = 0x040B0, /* RX Jabber Count - R/clr */
++	E1000_MGTPRC   = 0x040B4, /* Management Packets RX Count - R/clr */
++	E1000_MGTPDC   = 0x040B8, /* Management Packets Dropped Count - R/clr */
++	E1000_MGTPTC   = 0x040BC, /* Management Packets TX Count - R/clr */
++	E1000_TORL     = 0x040C0, /* Total Octets RX Low - R/clr */
++	E1000_TORH     = 0x040C4, /* Total Octets RX High - R/clr */
++	E1000_TOTL     = 0x040C8, /* Total Octets TX Low - R/clr */
++	E1000_TOTH     = 0x040CC, /* Total Octets TX High - R/clr */
++	E1000_TPR      = 0x040D0, /* Total Packets RX - R/clr */
++	E1000_TPT      = 0x040D4, /* Total Packets TX - R/clr */
++	E1000_PTC64    = 0x040D8, /* Packets TX (64 bytes) - R/clr */
++	E1000_PTC127   = 0x040DC, /* Packets TX (65-127 bytes) - R/clr */
++	E1000_PTC255   = 0x040E0, /* Packets TX (128-255 bytes) - R/clr */
++	E1000_PTC511   = 0x040E4, /* Packets TX (256-511 bytes) - R/clr */
++	E1000_PTC1023  = 0x040E8, /* Packets TX (512-1023 bytes) - R/clr */
++	E1000_PTC1522  = 0x040EC, /* Packets TX (1024-1522 Bytes) - R/clr */
++	E1000_MPTC     = 0x040F0, /* Multicast Packets TX Count - R/clr */
++	E1000_BPTC     = 0x040F4, /* Broadcast Packets TX Count - R/clr */
++	E1000_TSCTC    = 0x040F8, /* TCP Segmentation Context TX - R/clr */
++	E1000_TSCTFC   = 0x040FC, /* TCP Segmentation Context TX Fail - R/clr */
++	E1000_IAC      = 0x04100, /* Interrupt Assertion Count */
++	E1000_ICRXPTC  = 0x04104, /* Irq Cause Rx Packet Timer Expire Count */
++	E1000_ICRXATC  = 0x04108, /* Irq Cause Rx Abs Timer Expire Count */
++	E1000_ICTXPTC  = 0x0410C, /* Irq Cause Tx Packet Timer Expire Count */
++	E1000_ICTXATC  = 0x04110, /* Irq Cause Tx Abs Timer Expire Count */
++	E1000_ICTXQEC  = 0x04118, /* Irq Cause Tx Queue Empty Count */
++	E1000_ICTXQMTC = 0x0411C, /* Irq Cause Tx Queue MinThreshold Count */
++	E1000_ICRXDMTC = 0x04120, /* Irq Cause Rx Desc MinThreshold Count */
++	E1000_ICRXOC   = 0x04124, /* Irq Cause Receiver Overrun Count */
++	E1000_RXCSUM   = 0x05000, /* RX Checksum Control - RW */
++	E1000_RFCTL    = 0x05008, /* Receive Filter Control*/
++	E1000_MTA      = 0x05200, /* Multicast Table Array - RW Array */
++	E1000_RA       = 0x05400, /* Receive Address - RW Array */
++	E1000_VFTA     = 0x05600, /* VLAN Filter Table Array - RW Array */
++	E1000_WUC      = 0x05800, /* Wakeup Control - RW */
++	E1000_WUFC     = 0x05808, /* Wakeup Filter Control - RW */
++	E1000_WUS      = 0x05810, /* Wakeup Status - RO */
++	E1000_MANC     = 0x05820, /* Management Control - RW */
++	E1000_FFLT     = 0x05F00, /* Flexible Filter Length Table - RW Array */
++	E1000_HOST_IF  = 0x08800, /* Host Interface */
++
++	E1000_KMRNCTRLSTA = 0x00034, /* MAC-PHY interface - RW */
++	E1000_MANC2H    = 0x05860, /* Management Control To Host - RW */
++	E1000_SW_FW_SYNC = 0x05B5C, /* Software-Firmware Synchronization - RW */
++	E1000_GCR	= 0x05B00, /* PCI-Ex Control */
++	E1000_FACTPS    = 0x05B30, /* Function Active and Power State to MNG */
++	E1000_SWSM      = 0x05B50, /* SW Semaphore */
++	E1000_FWSM      = 0x05B54, /* FW Semaphore */
++	E1000_HICR      = 0x08F00, /* Host Inteface Control */
++};
++
++/* RSS registers */
++
++/* IGP01E1000 Specific Registers */
++#define IGP01E1000_PHY_PORT_CONFIG	0x10 /* Port Config */
++#define IGP01E1000_PHY_PORT_STATUS	0x11 /* Status */
++#define IGP01E1000_PHY_PORT_CTRL	0x12 /* Control */
++#define IGP01E1000_PHY_LINK_HEALTH	0x13 /* PHY Link Health */
++#define IGP02E1000_PHY_POWER_MGMT	0x19 /* Power Management */
++#define IGP01E1000_PHY_PAGE_SELECT	0x1F /* Page Select */
++
++#define IGP01E1000_PHY_PCS_INIT_REG	0x00B4
++#define IGP01E1000_PHY_POLARITY_MASK	0x0078
++
++#define IGP01E1000_PSCR_AUTO_MDIX	0x1000
++#define IGP01E1000_PSCR_FORCE_MDI_MDIX	0x2000 /* 0=MDI, 1=MDIX */
++
++#define IGP01E1000_PSCFR_SMART_SPEED	0x0080
++
++#define IGP02E1000_PM_SPD		0x0001 /* Smart Power Down */
++#define IGP02E1000_PM_D0_LPLU		0x0002 /* For D0a states */
++#define IGP02E1000_PM_D3_LPLU		0x0004 /* For all other states */
++
++#define IGP01E1000_PLHR_SS_DOWNGRADE	0x8000
++
++#define IGP01E1000_PSSR_POLARITY_REVERSED	0x0002
++#define IGP01E1000_PSSR_MDIX			0x0008
++#define IGP01E1000_PSSR_SPEED_MASK		0xC000
++#define IGP01E1000_PSSR_SPEED_1000MBPS		0xC000
++
++#define IGP02E1000_PHY_CHANNEL_NUM		4
++#define IGP02E1000_PHY_AGC_A			0x11B1
++#define IGP02E1000_PHY_AGC_B			0x12B1
++#define IGP02E1000_PHY_AGC_C			0x14B1
++#define IGP02E1000_PHY_AGC_D			0x18B1
++
++#define IGP02E1000_AGC_LENGTH_SHIFT	9 /* Course - 15:13, Fine - 12:9 */
++#define IGP02E1000_AGC_LENGTH_MASK	0x7F
++#define IGP02E1000_AGC_RANGE		15
++
++/* manage.c */
++#define E1000_VFTA_ENTRY_SHIFT		5
++#define E1000_VFTA_ENTRY_MASK		0x7F
++#define E1000_VFTA_ENTRY_BIT_SHIFT_MASK	0x1F
++
++#define E1000_HICR_EN			0x01  /* Enable bit - RO */
++#define E1000_HICR_C			0x02  /* Driver sets this bit when done
++					       * to put command in RAM */
++#define E1000_HICR_FW_RESET_ENABLE	0x40
++#define E1000_HICR_FW_RESET		0x80
++
++#define E1000_FWSM_MODE_MASK		0xE
++#define E1000_FWSM_MODE_SHIFT		1
++
++#define E1000_MNG_IAMT_MODE		0x3
++#define E1000_MNG_DHCP_COOKIE_LENGTH	0x10
++#define E1000_MNG_DHCP_COOKIE_OFFSET	0x6F0
++#define E1000_MNG_DHCP_COMMAND_TIMEOUT	10
++#define E1000_MNG_DHCP_TX_PAYLOAD_CMD	64
++#define E1000_MNG_DHCP_COOKIE_STATUS_PARSING	0x1
++#define E1000_MNG_DHCP_COOKIE_STATUS_VLAN	0x2
++
++/* nvm.c */
++#define E1000_STM_OPCODE  0xDB00
++
++#define E1000_KMRNCTRLSTA_OFFSET	0x001F0000
++#define E1000_KMRNCTRLSTA_OFFSET_SHIFT	16
++#define E1000_KMRNCTRLSTA_REN		0x00200000
++#define E1000_KMRNCTRLSTA_DIAG_OFFSET	0x3    /* Kumeran Diagnostic */
++#define E1000_KMRNCTRLSTA_DIAG_NELPBK	0x1000 /* Nearend Loopback mode */
++
++#define IFE_PHY_EXTENDED_STATUS_CONTROL	0x10
++#define IFE_PHY_SPECIAL_CONTROL		0x11 /* 100BaseTx PHY Special Control */
++#define IFE_PHY_SPECIAL_CONTROL_LED	0x1B /* PHY Special and LED Control */
++#define IFE_PHY_MDIX_CONTROL		0x1C /* MDI/MDI-X Control */
++
++/* IFE PHY Extended Status Control */
++#define IFE_PESC_POLARITY_REVERSED	0x0100
++
++/* IFE PHY Special Control */
++#define IFE_PSC_AUTO_POLARITY_DISABLE		0x0010
++#define IFE_PSC_FORCE_POLARITY			0x0020
++
++/* IFE PHY Special Control and LED Control */
++#define IFE_PSCL_PROBE_MODE		0x0020
++#define IFE_PSCL_PROBE_LEDS_OFF		0x0006 /* Force LEDs 0 and 2 off */
++#define IFE_PSCL_PROBE_LEDS_ON		0x0007 /* Force LEDs 0 and 2 on */
++
++/* IFE PHY MDIX Control */
++#define IFE_PMC_MDIX_STATUS	0x0020 /* 1=MDI-X, 0=MDI */
++#define IFE_PMC_FORCE_MDIX	0x0040 /* 1=force MDI-X, 0=force MDI */
++#define IFE_PMC_AUTO_MDIX	0x0080 /* 1=enable auto MDI/MDI-X, 0=disable */
++
++#define E1000_CABLE_LENGTH_UNDEFINED	0xFF
++
++#define E1000_DEV_ID_82571EB_COPPER		0x105E
++#define E1000_DEV_ID_82571EB_FIBER		0x105F
++#define E1000_DEV_ID_82571EB_SERDES		0x1060
++#define E1000_DEV_ID_82571EB_QUAD_COPPER	0x10A4
++#define E1000_DEV_ID_82571EB_QUAD_FIBER		0x10A5
++#define E1000_DEV_ID_82571EB_QUAD_COPPER_LP	0x10BC
++#define E1000_DEV_ID_82572EI_COPPER		0x107D
++#define E1000_DEV_ID_82572EI_FIBER		0x107E
++#define E1000_DEV_ID_82572EI_SERDES		0x107F
++#define E1000_DEV_ID_82572EI			0x10B9
++#define E1000_DEV_ID_82573E			0x108B
++#define E1000_DEV_ID_82573E_IAMT		0x108C
++#define E1000_DEV_ID_82573L			0x109A
++
++#define E1000_DEV_ID_80003ES2LAN_COPPER_DPT	0x1096
++#define E1000_DEV_ID_80003ES2LAN_SERDES_DPT	0x1098
++#define E1000_DEV_ID_80003ES2LAN_COPPER_SPT	0x10BA
++#define E1000_DEV_ID_80003ES2LAN_SERDES_SPT	0x10BB
++
++#define E1000_DEV_ID_ICH8_IGP_M_AMT		0x1049
++#define E1000_DEV_ID_ICH8_IGP_AMT		0x104A
++#define E1000_DEV_ID_ICH8_IGP_C			0x104B
++#define E1000_DEV_ID_ICH8_IFE			0x104C
++#define E1000_DEV_ID_ICH8_IFE_GT		0x10C4
++#define E1000_DEV_ID_ICH8_IFE_G			0x10C5
++#define E1000_DEV_ID_ICH8_IGP_M			0x104D
++#define E1000_DEV_ID_ICH9_IGP_AMT		0x10BD
++#define E1000_DEV_ID_ICH9_IGP_C			0x294C
++#define E1000_DEV_ID_ICH9_IFE			0x10C0
++#define E1000_DEV_ID_ICH9_IFE_GT		0x10C3
++#define E1000_DEV_ID_ICH9_IFE_G			0x10C2
++
++#define E1000_FUNC_1 1
++
++enum e1000_mac_type {
++	e1000_82571,
++	e1000_82572,
++	e1000_82573,
++	e1000_80003es2lan,
++	e1000_ich8lan,
++	e1000_ich9lan,
++};
++
++enum e1000_media_type {
++	e1000_media_type_unknown = 0,
++	e1000_media_type_copper = 1,
++	e1000_media_type_fiber = 2,
++	e1000_media_type_internal_serdes = 3,
++	e1000_num_media_types
++};
++
++enum e1000_nvm_type {
++	e1000_nvm_unknown = 0,
++	e1000_nvm_none,
++	e1000_nvm_eeprom_spi,
++	e1000_nvm_flash_hw,
++	e1000_nvm_flash_sw
++};
++
++enum e1000_nvm_override {
++	e1000_nvm_override_none = 0,
++	e1000_nvm_override_spi_small,
++	e1000_nvm_override_spi_large
++};
++
++enum e1000_phy_type {
++	e1000_phy_unknown = 0,
++	e1000_phy_none,
++	e1000_phy_m88,
++	e1000_phy_igp,
++	e1000_phy_igp_2,
++	e1000_phy_gg82563,
++	e1000_phy_igp_3,
++	e1000_phy_ife,
++};
++
++enum e1000_bus_width {
++	e1000_bus_width_unknown = 0,
++	e1000_bus_width_pcie_x1,
++	e1000_bus_width_pcie_x2,
++	e1000_bus_width_pcie_x4 = 4,
++	e1000_bus_width_32,
++	e1000_bus_width_64,
++	e1000_bus_width_reserved
++};
++
++enum e1000_1000t_rx_status {
++	e1000_1000t_rx_status_not_ok = 0,
++	e1000_1000t_rx_status_ok,
++	e1000_1000t_rx_status_undefined = 0xFF
++};
++
++enum e1000_rev_polarity{
++	e1000_rev_polarity_normal = 0,
++	e1000_rev_polarity_reversed,
++	e1000_rev_polarity_undefined = 0xFF
++};
++
++enum e1000_fc_mode {
++	e1000_fc_none = 0,
++	e1000_fc_rx_pause,
++	e1000_fc_tx_pause,
++	e1000_fc_full,
++	e1000_fc_default = 0xFF
++};
++
++enum e1000_ms_type {
++	e1000_ms_hw_default = 0,
++	e1000_ms_force_master,
++	e1000_ms_force_slave,
++	e1000_ms_auto
++};
++
++enum e1000_smart_speed {
++	e1000_smart_speed_default = 0,
++	e1000_smart_speed_on,
++	e1000_smart_speed_off
++};
++
++/* Receive Descriptor */
++struct e1000_rx_desc {
++	u64 buffer_addr; /* Address of the descriptor's data buffer */
++	u16 length;      /* Length of data DMAed into data buffer */
++	u16 csum;	/* Packet checksum */
++	u8  status;      /* Descriptor status */
++	u8  errors;      /* Descriptor Errors */
++	u16 special;
++};
++
++/* Receive Descriptor - Extended */
++union e1000_rx_desc_extended {
++	struct {
++		u64 buffer_addr;
++		u64 reserved;
++	} read;
++	struct {
++		struct {
++			u32 mrq;	      /* Multiple Rx Queues */
++			union {
++				u32 rss;	    /* RSS Hash */
++				struct {
++					u16 ip_id;  /* IP id */
++					u16 csum;   /* Packet Checksum */
++				} csum_ip;
++			} hi_dword;
++		} lower;
++		struct {
++			u32 status_error;     /* ext status/error */
++			u16 length;
++			u16 vlan;	     /* VLAN tag */
++		} upper;
++	} wb;  /* writeback */
++};
++
++#define MAX_PS_BUFFERS 4
++/* Receive Descriptor - Packet Split */
++union e1000_rx_desc_packet_split {
++	struct {
++		/* one buffer for protocol header(s), three data buffers */
++		u64 buffer_addr[MAX_PS_BUFFERS];
++	} read;
++	struct {
++		struct {
++			u32 mrq;	      /* Multiple Rx Queues */
++			union {
++				u32 rss;	      /* RSS Hash */
++				struct {
++					u16 ip_id;    /* IP id */
++					u16 csum;     /* Packet Checksum */
++				} csum_ip;
++			} hi_dword;
++		} lower;
++		struct {
++			u32 status_error;     /* ext status/error */
++			u16 length0;	  /* length of buffer 0 */
++			u16 vlan;	     /* VLAN tag */
++		} middle;
++		struct {
++			u16 header_status;
++			u16 length[3];	/* length of buffers 1-3 */
++		} upper;
++		u64 reserved;
++	} wb; /* writeback */
++};
++
++/* Transmit Descriptor */
++struct e1000_tx_desc {
++	u64 buffer_addr;      /* Address of the descriptor's data buffer */
++	union {
++		u32 data;
++		struct {
++			u16 length;    /* Data buffer length */
++			u8 cso;	/* Checksum offset */
++			u8 cmd;	/* Descriptor control */
++		} flags;
++	} lower;
++	union {
++		u32 data;
++		struct {
++			u8 status;     /* Descriptor status */
++			u8 css;	/* Checksum start */
++			u16 special;
++		} fields;
++	} upper;
++};
++
++/* Offload Context Descriptor */
++struct e1000_context_desc {
++	union {
++		u32 ip_config;
++		struct {
++			u8 ipcss;      /* IP checksum start */
++			u8 ipcso;      /* IP checksum offset */
++			u16 ipcse;     /* IP checksum end */
++		} ip_fields;
++	} lower_setup;
++	union {
++		u32 tcp_config;
++		struct {
++			u8 tucss;      /* TCP checksum start */
++			u8 tucso;      /* TCP checksum offset */
++			u16 tucse;     /* TCP checksum end */
++		} tcp_fields;
++	} upper_setup;
++	u32 cmd_and_length;
++	union {
++		u32 data;
++		struct {
++			u8 status;     /* Descriptor status */
++			u8 hdr_len;    /* Header length */
++			u16 mss;       /* Maximum segment size */
++		} fields;
++	} tcp_seg_setup;
++};
++
++/* Offload data descriptor */
++struct e1000_data_desc {
++	u64 buffer_addr;   /* Address of the descriptor's buffer address */
++	union {
++		u32 data;
++		struct {
++			u16 length;    /* Data buffer length */
++			u8 typ_len_ext;
++			u8 cmd;
++		} flags;
++	} lower;
++	union {
++		u32 data;
++		struct {
++			u8 status;     /* Descriptor status */
++			u8 popts;      /* Packet Options */
++			u16 special;   /* */
++		} fields;
++	} upper;
++};
++
++/* Statistics counters collected by the MAC */
++struct e1000_hw_stats {
++	u64 crcerrs;
++	u64 algnerrc;
++	u64 symerrs;
++	u64 rxerrc;
++	u64 mpc;
++	u64 scc;
++	u64 ecol;
++	u64 mcc;
++	u64 latecol;
++	u64 colc;
++	u64 dc;
++	u64 tncrs;
++	u64 sec;
++	u64 cexterr;
++	u64 rlec;
++	u64 xonrxc;
++	u64 xontxc;
++	u64 xoffrxc;
++	u64 xofftxc;
++	u64 fcruc;
++	u64 prc64;
++	u64 prc127;
++	u64 prc255;
++	u64 prc511;
++	u64 prc1023;
++	u64 prc1522;
++	u64 gprc;
++	u64 bprc;
++	u64 mprc;
++	u64 gptc;
++	u64 gorcl;
++	u64 gorch;
++	u64 gotcl;
++	u64 gotch;
++	u64 rnbc;
++	u64 ruc;
++	u64 rfc;
++	u64 roc;
++	u64 rjc;
++	u64 mgprc;
++	u64 mgpdc;
++	u64 mgptc;
++	u64 torl;
++	u64 torh;
++	u64 totl;
++	u64 toth;
++	u64 tpr;
++	u64 tpt;
++	u64 ptc64;
++	u64 ptc127;
++	u64 ptc255;
++	u64 ptc511;
++	u64 ptc1023;
++	u64 ptc1522;
++	u64 mptc;
++	u64 bptc;
++	u64 tsctc;
++	u64 tsctfc;
++	u64 iac;
++	u64 icrxptc;
++	u64 icrxatc;
++	u64 ictxptc;
++	u64 ictxatc;
++	u64 ictxqec;
++	u64 ictxqmtc;
++	u64 icrxdmtc;
++	u64 icrxoc;
++};
++
++struct e1000_phy_stats {
++	u32 idle_errors;
++	u32 receive_errors;
++};
++
++struct e1000_host_mng_dhcp_cookie {
++	u32 signature;
++	u8  status;
++	u8  reserved0;
++	u16 vlan_id;
++	u32 reserved1;
++	u16 reserved2;
++	u8  reserved3;
++	u8  checksum;
++};
++
++/* Host Interface "Rev 1" */
++struct e1000_host_command_header {
++	u8 command_id;
++	u8 command_length;
++	u8 command_options;
++	u8 checksum;
++};
++
++#define E1000_HI_MAX_DATA_LENGTH     252
++struct e1000_host_command_info {
++	struct e1000_host_command_header command_header;
++	u8 command_data[E1000_HI_MAX_DATA_LENGTH];
++};
++
++/* Host Interface "Rev 2" */
++struct e1000_host_mng_command_header {
++	u8  command_id;
++	u8  checksum;
++	u16 reserved1;
++	u16 reserved2;
++	u16 command_length;
++};
++
++#define E1000_HI_MAX_MNG_DATA_LENGTH 0x6F8
++struct e1000_host_mng_command_info {
++	struct e1000_host_mng_command_header command_header;
++	u8 command_data[E1000_HI_MAX_MNG_DATA_LENGTH];
++};
++
++/* Function pointers and static data for the MAC. */
++struct e1000_mac_operations {
++	u32			mng_mode_enab;
++
++	s32  (*check_for_link)(struct e1000_hw *);
++	s32  (*cleanup_led)(struct e1000_hw *);
++	void (*clear_hw_cntrs)(struct e1000_hw *);
++	s32  (*get_bus_info)(struct e1000_hw *);
++	s32  (*get_link_up_info)(struct e1000_hw *, u16 *, u16 *);
++	s32  (*led_on)(struct e1000_hw *);
++	s32  (*led_off)(struct e1000_hw *);
++	void (*mc_addr_list_update)(struct e1000_hw *, u8 *, u32, u32,
++					 u32);
++	s32  (*reset_hw)(struct e1000_hw *);
++	s32  (*init_hw)(struct e1000_hw *);
++	s32  (*setup_link)(struct e1000_hw *);
++	s32  (*setup_physical_interface)(struct e1000_hw *);
++};
++
++/* Function pointers for the PHY. */
++struct e1000_phy_operations {
++	s32  (*acquire_phy)(struct e1000_hw *);
++	s32  (*check_reset_block)(struct e1000_hw *);
++	s32  (*commit_phy)(struct e1000_hw *);
++	s32  (*force_speed_duplex)(struct e1000_hw *);
++	s32  (*get_cfg_done)(struct e1000_hw *hw);
++	s32  (*get_cable_length)(struct e1000_hw *);
++	s32  (*get_phy_info)(struct e1000_hw *);
++	s32  (*read_phy_reg)(struct e1000_hw *, u32, u16 *);
++	void (*release_phy)(struct e1000_hw *);
++	s32  (*reset_phy)(struct e1000_hw *);
++	s32  (*set_d0_lplu_state)(struct e1000_hw *, bool);
++	s32  (*set_d3_lplu_state)(struct e1000_hw *, bool);
++	s32  (*write_phy_reg)(struct e1000_hw *, u32, u16);
++};
++
++/* Function pointers for the NVM. */
++struct e1000_nvm_operations {
++	s32  (*acquire_nvm)(struct e1000_hw *);
++	s32  (*read_nvm)(struct e1000_hw *, u16, u16, u16 *);
++	void (*release_nvm)(struct e1000_hw *);
++	s32  (*update_nvm)(struct e1000_hw *);
++	s32  (*valid_led_default)(struct e1000_hw *, u16 *);
++	s32  (*validate_nvm)(struct e1000_hw *);
++	s32  (*write_nvm)(struct e1000_hw *, u16, u16, u16 *);
++};
++
++struct e1000_mac_info {
++	struct e1000_mac_operations ops;
++
++	u8 addr[6];
++	u8 perm_addr[6];
++
++	enum e1000_mac_type type;
++	enum e1000_fc_mode  fc;
++	enum e1000_fc_mode  original_fc;
++
++	u32 collision_delta;
++	u32 ledctl_default;
++	u32 ledctl_mode1;
++	u32 ledctl_mode2;
++	u32 max_frame_size;
++	u32 mc_filter_type;
++	u32 min_frame_size;
++	u32 tx_packet_delta;
++	u32 txcw;
++
++	u16 current_ifs_val;
++	u16 ifs_max_val;
++	u16 ifs_min_val;
++	u16 ifs_ratio;
++	u16 ifs_step_size;
++	u16 mta_reg_count;
++	u16 rar_entry_count;
++	u16 fc_high_water;
++	u16 fc_low_water;
++	u16 fc_pause_time;
++
++	u8  forced_speed_duplex;
++
++	bool arc_subsystem_valid;
++	bool autoneg;
++	bool autoneg_failed;
++	bool get_link_status;
++	bool in_ifs_mode;
++	bool serdes_has_link;
++	bool tx_pkt_filtering;
++};
++
++struct e1000_phy_info {
++	struct e1000_phy_operations ops;
++
++	enum e1000_phy_type type;
++
++	enum e1000_1000t_rx_status local_rx;
++	enum e1000_1000t_rx_status remote_rx;
++	enum e1000_ms_type ms_type;
++	enum e1000_ms_type original_ms_type;
++	enum e1000_rev_polarity cable_polarity;
++	enum e1000_smart_speed smart_speed;
++
++	u32 addr;
++	u32 id;
++	u32 reset_delay_us; /* in usec */
++	u32 revision;
++
++	u16 autoneg_advertised;
++	u16 autoneg_mask;
++	u16 cable_length;
++	u16 max_cable_length;
++	u16 min_cable_length;
++
++	u8 mdix;
++
++	bool disable_polarity_correction;
++	bool is_mdix;
++	bool polarity_correction;
++	bool speed_downgraded;
++	bool wait_for_link;
++};
++
++struct e1000_nvm_info {
++	struct e1000_nvm_operations ops;
++
++	enum e1000_nvm_type type;
++	enum e1000_nvm_override override;
++
++	u32 flash_bank_size;
++	u32 flash_base_addr;
++
++	u16 word_size;
++	u16 delay_usec;
++	u16 address_bits;
++	u16 opcode_bits;
++	u16 page_size;
++};
++
++struct e1000_bus_info {
++	enum e1000_bus_width width;
++
++	u16 func;
++};
++
++struct e1000_dev_spec_82571 {
++	bool laa_is_present;
++};
++
++struct e1000_shadow_ram {
++	u16  value;
++	bool modified;
++};
++
++#define E1000_ICH8_SHADOW_RAM_WORDS		2048
++
++struct e1000_dev_spec_ich8lan {
++	bool kmrn_lock_loss_workaround_enabled;
++	struct e1000_shadow_ram shadow_ram[E1000_ICH8_SHADOW_RAM_WORDS];
++};
++
++struct e1000_hw {
++	struct e1000_adapter *adapter;
++
++	u8 __iomem *hw_addr;
++	u8 __iomem *flash_address;
++
++	struct e1000_mac_info  mac;
++	struct e1000_phy_info  phy;
++	struct e1000_nvm_info  nvm;
++	struct e1000_bus_info  bus;
++	struct e1000_host_mng_dhcp_cookie mng_cookie;
++
++	union {
++		struct e1000_dev_spec_82571	e82571;
++		struct e1000_dev_spec_ich8lan	ich8lan;
++	} dev_spec;
++
++	enum e1000_media_type media_type;
++};
++
++#ifdef DEBUG
++#define hw_dbg(hw, format, arg...) \
++	printk(KERN_DEBUG, "%s: " format, e1000_get_hw_dev_name(hw), ##arg);
++#else
++static inline int __attribute__ ((format (printf, 2, 3)))
++hw_dbg(struct e1000_hw *hw, const char *format, ...)
++{
++	return 0;
++}
++#endif
++
++#endif
+diff --git a/drivers/net/e1000e/ich8lan.c b/drivers/net/e1000e/ich8lan.c
+new file mode 100644
+index 0000000..5967139
+--- /dev/null
++++ b/drivers/net/e1000e/ich8lan.c
+@@ -0,0 +1,2297 @@
++/*******************************************************************************
++
++  Intel PRO/1000 Linux driver
++  Copyright(c) 1999 - 2007 Intel Corporation.
++
++  This program is free software; you can redistribute it and/or modify it
++  under the terms and conditions of the GNU General Public License,
++  version 2, as published by the Free Software Foundation.
++
++  This program is distributed in the hope 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.,
++  51 Franklin St - Fifth Floor, Boston, MA 02110-1301 USA.
++
++  The full GNU General Public License is included in this distribution in
++  the file called "COPYING".
++
++  Contact Information:
++  Linux NICS <linux.nics at intel.com>
++  e1000-devel Mailing List <e1000-devel at lists.sourceforge.net>
++  Intel Corporation, 5200 N.E. Elam Young Parkway, Hillsboro, OR 97124-6497
++
++*******************************************************************************/
++
++/*
++ * 82562G-2 10/100 Network Connection
++ * 82562GT 10/100 Network Connection
++ * 82562GT-2 10/100 Network Connection
++ * 82562V 10/100 Network Connection
++ * 82562V-2 10/100 Network Connection
++ * 82566DC-2 Gigabit Network Connection
++ * 82566DC Gigabit Network Connection
++ * 82566DM-2 Gigabit Network Connection
++ * 82566DM Gigabit Network Connection
++ * 82566MC Gigabit Network Connection
++ * 82566MM Gigabit Network Connection
++ */
++
++#include "e1000.h"
++
++#define ICH_FLASH_GFPREG		0x0000
++#define ICH_FLASH_HSFSTS		0x0004
++#define ICH_FLASH_HSFCTL		0x0006
++#define ICH_FLASH_FADDR			0x0008
++#define ICH_FLASH_FDATA0		0x0010
++
++#define ICH_FLASH_READ_COMMAND_TIMEOUT	500
++#define ICH_FLASH_WRITE_COMMAND_TIMEOUT	500
++#define ICH_FLASH_ERASE_COMMAND_TIMEOUT	3000000
++#define ICH_FLASH_LINEAR_ADDR_MASK	0x00FFFFFF
++#define ICH_FLASH_CYCLE_REPEAT_COUNT	10
++
++#define ICH_CYCLE_READ			0
++#define ICH_CYCLE_WRITE			2
++#define ICH_CYCLE_ERASE			3
++
++#define FLASH_GFPREG_BASE_MASK		0x1FFF
++#define FLASH_SECTOR_ADDR_SHIFT		12
++
++#define ICH_FLASH_SEG_SIZE_256		256
++#define ICH_FLASH_SEG_SIZE_4K		4096
++#define ICH_FLASH_SEG_SIZE_8K		8192
++#define ICH_FLASH_SEG_SIZE_64K		65536
++
++
++#define E1000_ICH_FWSM_RSPCIPHY	0x00000040 /* Reset PHY on PCI Reset */
++
++#define E1000_ICH_MNG_IAMT_MODE		0x2
++
++#define ID_LED_DEFAULT_ICH8LAN  ((ID_LED_DEF1_DEF2 << 12) | \
++				 (ID_LED_DEF1_OFF2 <<  8) | \
++				 (ID_LED_DEF1_ON2  <<  4) | \
++				 (ID_LED_DEF1_DEF2))
++
++#define E1000_ICH_NVM_SIG_WORD		0x13
++#define E1000_ICH_NVM_SIG_MASK		0xC000
++
++#define E1000_ICH8_LAN_INIT_TIMEOUT	1500
++
++#define E1000_FEXTNVM_SW_CONFIG		1
++#define E1000_FEXTNVM_SW_CONFIG_ICH8M (1 << 27) /* Bit redefined for ICH8M :/ */
++
++#define PCIE_ICH8_SNOOP_ALL		PCIE_NO_SNOOP_ALL
++
++#define E1000_ICH_RAR_ENTRIES		7
++
++#define PHY_PAGE_SHIFT 5
++#define PHY_REG(page, reg) (((page) << PHY_PAGE_SHIFT) | \
++			   ((reg) & MAX_PHY_REG_ADDRESS))
++#define IGP3_KMRN_DIAG  PHY_REG(770, 19) /* KMRN Diagnostic */
++#define IGP3_VR_CTRL    PHY_REG(776, 18) /* Voltage Regulator Control */
++
++#define IGP3_KMRN_DIAG_PCS_LOCK_LOSS	0x0002
++#define IGP3_VR_CTRL_DEV_POWERDOWN_MODE_MASK 0x0300
++#define IGP3_VR_CTRL_MODE_SHUTDOWN	0x0200
++
++/* ICH GbE Flash Hardware Sequencing Flash Status Register bit breakdown */
++/* Offset 04h HSFSTS */
++union ich8_hws_flash_status {
++	struct ich8_hsfsts {
++		u16 flcdone    :1; /* bit 0 Flash Cycle Done */
++		u16 flcerr     :1; /* bit 1 Flash Cycle Error */
++		u16 dael       :1; /* bit 2 Direct Access error Log */
++		u16 berasesz   :2; /* bit 4:3 Sector Erase Size */
++		u16 flcinprog  :1; /* bit 5 flash cycle in Progress */
++		u16 reserved1  :2; /* bit 13:6 Reserved */
++		u16 reserved2  :6; /* bit 13:6 Reserved */
++		u16 fldesvalid :1; /* bit 14 Flash Descriptor Valid */
++		u16 flockdn    :1; /* bit 15 Flash Config Lock-Down */
++	} hsf_status;
++	u16 regval;
++};
++
++/* ICH GbE Flash Hardware Sequencing Flash control Register bit breakdown */
++/* Offset 06h FLCTL */
++union ich8_hws_flash_ctrl {
++	struct ich8_hsflctl {
++		u16 flcgo      :1;   /* 0 Flash Cycle Go */
++		u16 flcycle    :2;   /* 2:1 Flash Cycle */
++		u16 reserved   :5;   /* 7:3 Reserved  */
++		u16 fldbcount  :2;   /* 9:8 Flash Data Byte Count */
++		u16 flockdn    :6;   /* 15:10 Reserved */
++	} hsf_ctrl;
++	u16 regval;
++};
++
++/* ICH Flash Region Access Permissions */
++union ich8_hws_flash_regacc {
++	struct ich8_flracc {
++		u32 grra      :8; /* 0:7 GbE region Read Access */
++		u32 grwa      :8; /* 8:15 GbE region Write Access */
++		u32 gmrag     :8; /* 23:16 GbE Master Read Access Grant */
++		u32 gmwag     :8; /* 31:24 GbE Master Write Access Grant */
++	} hsf_flregacc;
++	u16 regval;
++};
++
++static s32 e1000_setup_link_ich8lan(struct e1000_hw *hw);
++static void e1000_clear_hw_cntrs_ich8lan(struct e1000_hw *hw);
++static void e1000_initialize_hw_bits_ich8lan(struct e1000_hw *hw);
++static s32 e1000_check_polarity_ife_ich8lan(struct e1000_hw *hw);
++static s32 e1000_erase_flash_bank_ich8lan(struct e1000_hw *hw, u32 bank);
++static s32 e1000_retry_write_flash_byte_ich8lan(struct e1000_hw *hw,
++						u32 offset, u8 byte);
++static s32 e1000_read_flash_word_ich8lan(struct e1000_hw *hw, u32 offset,
++					 u16 *data);
++static s32 e1000_read_flash_data_ich8lan(struct e1000_hw *hw, u32 offset,
++					 u8 size, u16 *data);
++static s32 e1000_setup_copper_link_ich8lan(struct e1000_hw *hw);
++static s32 e1000_kmrn_lock_loss_workaround_ich8lan(struct e1000_hw *hw);
++
++static inline u16 __er16flash(struct e1000_hw *hw, unsigned long reg)
++{
++	return readw(hw->flash_address + reg);
++}
++
++static inline u32 __er32flash(struct e1000_hw *hw, unsigned long reg)
++{
++	return readl(hw->flash_address + reg);
++}
++
++static inline void __ew16flash(struct e1000_hw *hw, unsigned long reg, u16 val)
++{
++	writew(val, hw->flash_address + reg);
++}
++
++static inline void __ew32flash(struct e1000_hw *hw, unsigned long reg, u32 val)
++{
++	writel(val, hw->flash_address + reg);
++}
++
++#define er16flash(reg)		__er16flash(hw, (reg))
++#define er32flash(reg)		__er32flash(hw, (reg))
++#define ew16flash(reg,val)	__ew16flash(hw, (reg), (val))
++#define ew32flash(reg,val)	__ew32flash(hw, (reg), (val))
++
++/**
++ *  e1000_init_phy_params_ich8lan - Initialize PHY function pointers
++ *  @hw: pointer to the HW structure
++ *
++ *  Initialize family-specific PHY parameters and function pointers.
++ **/
++static s32 e1000_init_phy_params_ich8lan(struct e1000_hw *hw)
++{
++	struct e1000_phy_info *phy = &hw->phy;
++	s32 ret_val = E1000_SUCCESS;
++	u16 i = 0;
++
++	phy->addr			= 1;
++	phy->reset_delay_us		= 100;
++
++	phy->id = 0;
++	while ((e1000_phy_unknown == e1000_get_phy_type_from_id(phy->id)) &&
++	       (i++ < 100)) {
++		msleep(1);
++		ret_val = e1000_get_phy_id(hw);
++		if (ret_val)
++			goto out;
++	}
++
++	/* Verify phy id */
++	switch (phy->id) {
++	case IGP03E1000_E_PHY_ID:
++		phy->type = e1000_phy_igp_3;
++		phy->autoneg_mask = AUTONEG_ADVERTISE_SPEED_DEFAULT;
++		break;
++	case IFE_E_PHY_ID:
++	case IFE_PLUS_E_PHY_ID:
++	case IFE_C_E_PHY_ID:
++		phy->type = e1000_phy_ife;
++		phy->autoneg_mask = E1000_ALL_NOT_GIG;
++		break;
++	default:
++		ret_val = -E1000_ERR_PHY;
++		goto out;
++	}
++
++out:
++	return ret_val;
++}
++
++/**
++ *  e1000_init_nvm_params_ich8lan - Initialize NVM function pointers
++ *  @hw: pointer to the HW structure
++ *
++ *  Initialize family-specific NVM parameters and function
++ *  pointers.
++ **/
++static s32 e1000_init_nvm_params_ich8lan(struct e1000_hw *hw)
++{
++	struct e1000_nvm_info *nvm = &hw->nvm;
++	struct e1000_dev_spec_ich8lan *dev_spec = &hw->dev_spec.ich8lan;
++	u32 gfpreg;
++	u32 sector_base_addr;
++	u32 sector_end_addr;
++	s32 ret_val = E1000_SUCCESS;
++	u16 i;
++
++	/* Can't read flash registers if the register set isn't mapped.
++	 */
++	if (!hw->flash_address) {
++		hw_dbg(hw, "ERROR: Flash registers not mapped\n");
++		ret_val = -E1000_ERR_CONFIG;
++		goto out;
++	}
++
++	nvm->type = e1000_nvm_flash_sw;
++
++	gfpreg = er32flash(ICH_FLASH_GFPREG);
++
++	/* sector_X_addr is a "sector"-aligned address (4096 bytes)
++	 * Add 1 to sector_end_addr since this sector is included in
++	 * the overall size. */
++	sector_base_addr = gfpreg & FLASH_GFPREG_BASE_MASK;
++	sector_end_addr = ((gfpreg >> 16) & FLASH_GFPREG_BASE_MASK) + 1;
++
++	/* flash_base_addr is byte-aligned */
++	nvm->flash_base_addr = sector_base_addr << FLASH_SECTOR_ADDR_SHIFT;
++
++	/* find total size of the NVM, then cut in half since the total
++	 * size represents two separate NVM banks. */
++	nvm->flash_bank_size = (sector_end_addr - sector_base_addr)
++				<< FLASH_SECTOR_ADDR_SHIFT;
++	nvm->flash_bank_size /= 2;
++	/* Adjust to word count */
++	nvm->flash_bank_size /= sizeof(u16);
++
++	nvm->word_size = E1000_ICH8_SHADOW_RAM_WORDS;
++
++	/* Clear shadow ram */
++	for (i = 0; i < nvm->word_size; i++) {
++		dev_spec->shadow_ram[i].modified = 0;
++		dev_spec->shadow_ram[i].value    = 0xFFFF;
++	}
++
++out:
++	return ret_val;
++}
++
++/**
++ *  e1000_init_mac_params_ich8lan - Initialize MAC function pointers
++ *  @hw: pointer to the HW structure
++ *
++ *  Initialize family-specific MAC parameters and function
++ *  pointers.
++ **/
++static s32 e1000_init_mac_params_ich8lan(struct e1000_adapter *adapter)
++{
++	struct e1000_hw *hw = &adapter->hw;
++	struct e1000_mac_info *mac = &hw->mac;
++
++	/* Set media type function pointer */
++	hw->media_type = e1000_media_type_copper;
++
++	/* Set mta register count */
++	mac->mta_reg_count = 32;
++	/* Set rar entry count */
++	mac->rar_entry_count = E1000_ICH_RAR_ENTRIES;
++	if (mac->type == e1000_ich8lan)
++		mac->rar_entry_count--;
++	/* Set if manageability features are enabled. */
++	mac->arc_subsystem_valid = 1;
++
++	/* Enable PCS Lock-loss workaround for ICH8 */
++	if (mac->type == e1000_ich8lan)
++		e1000_set_kmrn_lock_loss_workaround_ich8lan(hw, 1);
++
++	return E1000_SUCCESS;
++}
++
++static s32 e1000_get_invariants_ich8lan(struct e1000_adapter *adapter)
++{
++	struct e1000_hw *hw = &adapter->hw;
++	s32 rc;
++
++	rc = e1000_init_mac_params_ich8lan(adapter);
++	if (rc)
++		return rc;
++
++	rc = e1000_init_nvm_params_ich8lan(hw);
++	if (rc)
++		return rc;
++
++	rc = e1000_init_phy_params_ich8lan(hw);
++	if (rc)
++		return rc;
++
++	if ((adapter->hw.mac.type == e1000_ich8lan) &&
++	    (adapter->hw.phy.type == e1000_phy_igp_3))
++		adapter->flags |= FLAG_LSC_GIG_SPEED_DROP;
++
++	return E1000_SUCCESS;
++}
++
++/**
++ *  e1000_acquire_swflag_ich8lan - Acquire software control flag
++ *  @hw: pointer to the HW structure
++ *
++ *  Acquires the software control flag for performing NVM and PHY
++ *  operations.  This is a function pointer entry point only called by
++ *  read/write routines for the PHY and NVM parts.
++ **/
++static s32 e1000_acquire_swflag_ich8lan(struct e1000_hw *hw)
++{
++	u32 extcnf_ctrl;
++	u32 timeout = PHY_CFG_TIMEOUT;
++	s32 ret_val = E1000_SUCCESS;
++
++	while (timeout) {
++		extcnf_ctrl = er32(EXTCNF_CTRL);
++		extcnf_ctrl |= E1000_EXTCNF_CTRL_SWFLAG;
++		ew32(EXTCNF_CTRL, extcnf_ctrl);
++
++		extcnf_ctrl = er32(EXTCNF_CTRL);
++		if (extcnf_ctrl & E1000_EXTCNF_CTRL_SWFLAG)
++			break;
++		mdelay(1);
++		timeout--;
++	}
++
++	if (!timeout) {
++		hw_dbg(hw, "FW or HW has locked the resource for too long.\n");
++		ret_val = -E1000_ERR_CONFIG;
++		goto out;
++	}
++
++out:
++	return ret_val;
++}
++
++/**
++ *  e1000_release_swflag_ich8lan - Release software control flag
++ *  @hw: pointer to the HW structure
++ *
++ *  Releases the software control flag for performing NVM and PHY operations.
++ *  This is a function pointer entry point only called by read/write
++ *  routines for the PHY and NVM parts.
++ **/
++static void e1000_release_swflag_ich8lan(struct e1000_hw *hw)
++{
++	u32 extcnf_ctrl;
++
++	extcnf_ctrl = er32(EXTCNF_CTRL);
++	extcnf_ctrl &= ~E1000_EXTCNF_CTRL_SWFLAG;
++	ew32(EXTCNF_CTRL, extcnf_ctrl);
++}
++
++/**
++ *  e1000_check_reset_block_ich8lan - Check if PHY reset is blocked
++ *  @hw: pointer to the HW structure
++ *
++ *  Checks if firmware is blocking the reset of the PHY.
++ *  This is a function pointer entry point only called by
++ *  reset routines.
++ **/
++static s32 e1000_check_reset_block_ich8lan(struct e1000_hw *hw)
++{
++	u32 fwsm;
++
++	fwsm = er32(FWSM);
++
++	return (fwsm & E1000_ICH_FWSM_RSPCIPHY) ? E1000_SUCCESS
++						: E1000_BLK_PHY_RESET;
++}
++
++/**
++ *  e1000_phy_force_speed_duplex_ich8lan - Force PHY speed & duplex
++ *  @hw: pointer to the HW structure
++ *
++ *  Forces the speed and duplex settings of the PHY.
++ *  This is a function pointer entry point only called by
++ *  PHY setup routines.
++ **/
++static s32 e1000_phy_force_speed_duplex_ich8lan(struct e1000_hw *hw)
++{
++	struct e1000_phy_info *phy = &hw->phy;
++	s32 ret_val;
++	u16 data;
++	bool link;
++
++	if (phy->type != e1000_phy_ife) {
++		ret_val = e1000_phy_force_speed_duplex_igp(hw);
++		goto out;
++	}
++
++	ret_val = e1e_rphy(hw, PHY_CONTROL, &data);
++	if (ret_val)
++		goto out;
++
++	e1000_phy_force_speed_duplex_setup(hw, &data);
++
++	ret_val = e1e_wphy(hw, PHY_CONTROL, data);
++	if (ret_val)
++		goto out;
++
++	/* Disable MDI-X support for 10/100 */
++	ret_val = e1e_rphy(hw, IFE_PHY_MDIX_CONTROL, &data);
++	if (ret_val)
++		goto out;
++
++	data &= ~IFE_PMC_AUTO_MDIX;
++	data &= ~IFE_PMC_FORCE_MDIX;
++
++	ret_val = e1e_wphy(hw, IFE_PHY_MDIX_CONTROL, data);
++	if (ret_val)
++		goto out;
++
++	hw_dbg(hw, "IFE PMC: %X\n", data);
++
++	udelay(1);
++
++	if (phy->wait_for_link) {
++		hw_dbg(hw, "Waiting for forced speed/duplex link on IFE phy.\n");
++
++		ret_val = e1000_phy_has_link_generic(hw,
++						     PHY_FORCE_LIMIT,
++						     100000,
++						     &link);
++		if (ret_val)
++			goto out;
++
++		if (!link)
++			hw_dbg(hw, "Link taking longer than expected.\n");
++
++		/* Try once more */
++		ret_val = e1000_phy_has_link_generic(hw,
++						     PHY_FORCE_LIMIT,
++						     100000,
++						     &link);
++		if (ret_val)
++			goto out;
++	}
++
++out:
++	return ret_val;
++}
++
++/**
++ *  e1000_phy_hw_reset_ich8lan - Performs a PHY reset
++ *  @hw: pointer to the HW structure
++ *
++ *  Resets the PHY
++ *  This is a function pointer entry point called by drivers
++ *  or other shared routines.
++ **/
++static s32 e1000_phy_hw_reset_ich8lan(struct e1000_hw *hw)
++{
++	struct e1000_phy_info *phy = &hw->phy;
++	u32 i;
++	u32 data, cnf_size, cnf_base_addr, sw_cfg_mask;
++	s32 ret_val;
++	u16 loop = E1000_ICH8_LAN_INIT_TIMEOUT;
++	u16 word_addr, reg_data, reg_addr, phy_page = 0;
++
++	ret_val = e1000_phy_hw_reset_generic(hw);
++	if (ret_val)
++		goto out;
++
++	/* Initialize the PHY from the NVM on ICH platforms.  This
++	 * is needed due to an issue where the NVM configuration is
++	 * not properly autoloaded after power transitions.
++	 * Therefore, after each PHY reset, we will load the
++	 * configuration data out of the NVM manually.
++	 */
++	if (hw->mac.type == e1000_ich8lan && phy->type == e1000_phy_igp_3) {
++		struct e1000_adapter *adapter = hw->adapter;
++
++		/* Check if SW needs configure the PHY */
++		if ((adapter->pdev->device == E1000_DEV_ID_ICH8_IGP_M_AMT) ||
++		    (adapter->pdev->device == E1000_DEV_ID_ICH8_IGP_M))
++			sw_cfg_mask = E1000_FEXTNVM_SW_CONFIG_ICH8M;
++		else
++			sw_cfg_mask = E1000_FEXTNVM_SW_CONFIG;
++
++		data = er32(FEXTNVM);
++		if (!(data & sw_cfg_mask))
++			goto out;
++
++		/* Wait for basic configuration completes before proceeding*/
++		do {
++			data = er32(STATUS);
++			data &= E1000_STATUS_LAN_INIT_DONE;
++			udelay(100);
++		} while ((!data) && --loop);
++
++		/* If basic configuration is incomplete before the above loop
++		 * count reaches 0, loading the configuration from NVM will
++		 * leave the PHY in a bad state possibly resulting in no link.
++		 */
++		if (loop == 0) {
++			hw_dbg(hw, "LAN_INIT_DONE not set, increase timeout\n");
++		}
++
++		/* Clear the Init Done bit for the next init event */
++		data = er32(STATUS);
++		data &= ~E1000_STATUS_LAN_INIT_DONE;
++		ew32(STATUS, data);
++
++		/* Make sure HW does not configure LCD from PHY
++		 * extended configuration before SW configuration */
++		data = er32(EXTCNF_CTRL);
++		if (data & E1000_EXTCNF_CTRL_LCD_WRITE_ENABLE)
++			goto out;
++
++		cnf_size = er32(EXTCNF_SIZE);
++		cnf_size &= E1000_EXTCNF_SIZE_EXT_PCIE_LENGTH_MASK;
++		cnf_size >>= E1000_EXTCNF_SIZE_EXT_PCIE_LENGTH_SHIFT;
++		if (!cnf_size)
++			goto out;
++
++		cnf_base_addr = data & E1000_EXTCNF_CTRL_EXT_CNF_POINTER_MASK;
++		cnf_base_addr >>= E1000_EXTCNF_CTRL_EXT_CNF_POINTER_SHIFT;
++
++		/* Configure LCD from extended configuration
++		 * region. */
++
++		/* cnf_base_addr is in DWORD */
++		word_addr = (u16)(cnf_base_addr << 1);
++
++		for (i = 0; i < cnf_size; i++) {
++			ret_val = e1000_read_nvm(hw,
++						(word_addr + i * 2),
++						1,
++						&reg_data);
++			if (ret_val)
++				goto out;
++
++			ret_val = e1000_read_nvm(hw,
++						(word_addr + i * 2 + 1),
++						1,
++						&reg_addr);
++			if (ret_val)
++				goto out;
++
++			/* Save off the PHY page for future writes. */
++			if (reg_addr == IGP01E1000_PHY_PAGE_SELECT) {
++				phy_page = reg_data;
++				continue;
++			}
++
++			reg_addr |= phy_page;
++
++			ret_val = e1e_wphy(hw, (u32)reg_addr, reg_data);
++			if (ret_val)
++				goto out;
++		}
++	}
++
++out:
++	return ret_val;
++}
++
++/**
++ *  e1000_get_phy_info_ife_ich8lan - Retrieves various IFE PHY states
++ *  @hw: pointer to the HW structure
++ *
++ *  Populates "phy" structure with various feature states.
++ *  This function is only called by other family-specific
++ *  routines.
++ **/
++static s32 e1000_get_phy_info_ife_ich8lan(struct e1000_hw *hw)
++{
++	struct e1000_phy_info *phy = &hw->phy;
++	s32 ret_val;
++	u16 data;
++	bool link;
++
++	ret_val = e1000_phy_has_link_generic(hw, 1, 0, &link);
++	if (ret_val)
++		goto out;
++
++	if (!link) {
++		hw_dbg(hw, "Phy info is only valid if link is up\n");
++		ret_val = -E1000_ERR_CONFIG;
++		goto out;
++	}
++
++	ret_val = e1e_rphy(hw, IFE_PHY_SPECIAL_CONTROL, &data);
++	if (ret_val)
++		goto out;
++	phy->polarity_correction = (!(data & IFE_PSC_AUTO_POLARITY_DISABLE));
++
++	if (phy->polarity_correction) {
++		ret_val = e1000_check_polarity_ife_ich8lan(hw);
++		if (ret_val)
++			goto out;
++	} else {
++		/* Polarity is forced */
++		phy->cable_polarity = (data & IFE_PSC_FORCE_POLARITY)
++				      ? e1000_rev_polarity_reversed
++				      : e1000_rev_polarity_normal;
++	}
++
++	ret_val = e1e_rphy(hw, IFE_PHY_MDIX_CONTROL, &data);
++	if (ret_val)
++		goto out;
++
++	phy->is_mdix = (data & IFE_PMC_MDIX_STATUS);
++
++	/* The following parameters are undefined for 10/100 operation. */
++	phy->cable_length = E1000_CABLE_LENGTH_UNDEFINED;
++	phy->local_rx = e1000_1000t_rx_status_undefined;
++	phy->remote_rx = e1000_1000t_rx_status_undefined;
++
++out:
++	return ret_val;
++}
++
++/**
++ *  e1000_get_phy_info_ich8lan - Calls appropriate PHY type get_phy_info
++ *  @hw: pointer to the HW structure
++ *
++ *  Wrapper for calling the get_phy_info routines for the appropriate phy type.
++ *  This is a function pointer entry point called by drivers
++ *  or other shared routines.
++ **/
++static s32 e1000_get_phy_info_ich8lan(struct e1000_hw *hw)
++{
++	s32 ret_val = -E1000_ERR_PHY_TYPE;
++
++	switch (hw->phy.type) {
++	case e1000_phy_ife:
++		ret_val = e1000_get_phy_info_ife_ich8lan(hw);
++		break;
++	case e1000_phy_igp_3:
++		ret_val = e1000_get_phy_info_igp(hw);
++		break;
++	default:
++		break;
++	}
++
++	return ret_val;
++}
++
++/**
++ *  e1000_check_polarity_ife_ich8lan - Check cable polarity for IFE PHY
++ *  @hw: pointer to the HW structure
++ *
++ *  Polarity is determined on the polarity reveral feature being enabled.
++ *  This function is only called by other family-specific
++ *  routines.
++ **/
++static s32 e1000_check_polarity_ife_ich8lan(struct e1000_hw *hw)
++{
++	struct e1000_phy_info *phy = &hw->phy;
++	s32 ret_val;
++	u16 phy_data, offset, mask;
++
++	/* Polarity is determined based on the reversal feature
++	 * being enabled.
++	 */
++	if (phy->polarity_correction) {
++		offset	= IFE_PHY_EXTENDED_STATUS_CONTROL;
++		mask	= IFE_PESC_POLARITY_REVERSED;
++	} else {
++		offset	= IFE_PHY_SPECIAL_CONTROL;
++		mask	= IFE_PSC_FORCE_POLARITY;
++	}
++
++	ret_val = e1e_rphy(hw, offset, &phy_data);
++
++	if (!ret_val)
++		phy->cable_polarity = (phy_data & mask)
++				      ? e1000_rev_polarity_reversed
++				      : e1000_rev_polarity_normal;
++
++	return ret_val;
++}
++
++/**
++ *  e1000_set_d0_lplu_state_ich8lan - Set Low Power Linkup D0 state
++ *  @hw: pointer to the HW structure
++ *  @active: TRUE to enable LPLU, FALSE to disable
++ *
++ *  Sets the LPLU D0 state according to the active flag.  When
++ *  activating LPLU this function also disables smart speed
++ *  and vice versa.  LPLU will not be activated unless the
++ *  device autonegotiation advertisement meets standards of
++ *  either 10 or 10/100 or 10/100/1000 at all duplexes.
++ *  This is a function pointer entry point only called by
++ *  PHY setup routines.
++ **/
++static s32 e1000_set_d0_lplu_state_ich8lan(struct e1000_hw *hw, bool active)
++{
++	struct e1000_phy_info *phy = &hw->phy;
++	u32 phy_ctrl;
++	s32 ret_val = E1000_SUCCESS;
++	u16 data;
++
++	if (phy->type != e1000_phy_igp_3)
++		goto out;
++
++	phy_ctrl = er32(PHY_CTRL);
++
++	if (active) {
++		phy_ctrl |= E1000_PHY_CTRL_D0A_LPLU;
++		ew32(PHY_CTRL, phy_ctrl);
++
++		/* Call gig speed drop workaround on LPLU before accessing
++		 * any PHY registers */
++		if ((hw->mac.type == e1000_ich8lan) &&
++		    (hw->phy.type == e1000_phy_igp_3))
++			e1000_gig_downshift_workaround_ich8lan(hw);
++
++		/* When LPLU is enabled, we should disable SmartSpeed */
++		ret_val = e1e_rphy(hw, IGP01E1000_PHY_PORT_CONFIG, &data);
++		data &= ~IGP01E1000_PSCFR_SMART_SPEED;
++		ret_val = e1e_wphy(hw, IGP01E1000_PHY_PORT_CONFIG, data);
++		if (ret_val)
++			goto out;
++	} else {
++		phy_ctrl &= ~E1000_PHY_CTRL_D0A_LPLU;
++		ew32(PHY_CTRL, phy_ctrl);
++
++		/* LPLU and SmartSpeed are mutually exclusive.  LPLU is used
++		 * during Dx states where the power conservation is most
++		 * important.  During driver activity we should enable
++		 * SmartSpeed, so performance is maintained. */
++		if (phy->smart_speed == e1000_smart_speed_on) {
++			ret_val = e1e_rphy(hw, IGP01E1000_PHY_PORT_CONFIG,
++						    &data);
++			if (ret_val)
++				goto out;
++
++			data |= IGP01E1000_PSCFR_SMART_SPEED;
++			ret_val = e1e_wphy(hw, IGP01E1000_PHY_PORT_CONFIG,
++						     data);
++			if (ret_val)
++				goto out;
++		} else if (phy->smart_speed == e1000_smart_speed_off) {
++			ret_val = e1e_rphy(hw, IGP01E1000_PHY_PORT_CONFIG,
++						    &data);
++			if (ret_val)
++				goto out;
++
++			data &= ~IGP01E1000_PSCFR_SMART_SPEED;
++			ret_val = e1e_wphy(hw, IGP01E1000_PHY_PORT_CONFIG,
++						     data);
++			if (ret_val)
++				goto out;
++		}
++	}
++
++out:
++	return ret_val;
++}
++
++/**
++ *  e1000_set_d3_lplu_state_ich8lan - Set Low Power Linkup D3 state
++ *  @hw: pointer to the HW structure
++ *  @active: TRUE to enable LPLU, FALSE to disable
++ *
++ *  Sets the LPLU D3 state according to the active flag.  When
++ *  activating LPLU this function also disables smart speed
++ *  and vice versa.  LPLU will not be activated unless the
++ *  device autonegotiation advertisement meets standards of
++ *  either 10 or 10/100 or 10/100/1000 at all duplexes.
++ *  This is a function pointer entry point only called by
++ *  PHY setup routines.
++ **/
++static s32 e1000_set_d3_lplu_state_ich8lan(struct e1000_hw *hw, bool active)
++{
++	struct e1000_phy_info *phy = &hw->phy;
++	u32 phy_ctrl;
++	s32 ret_val = E1000_SUCCESS;
++	u16 data;
++
++	phy_ctrl = er32(PHY_CTRL);
++
++	if (!active) {
++		phy_ctrl &= ~E1000_PHY_CTRL_NOND0A_LPLU;
++		ew32(PHY_CTRL, phy_ctrl);
++		/* LPLU and SmartSpeed are mutually exclusive.  LPLU is used
++		 * during Dx states where the power conservation is most
++		 * important.  During driver activity we should enable
++		 * SmartSpeed, so performance is maintained. */
++		if (phy->smart_speed == e1000_smart_speed_on) {
++			ret_val = e1e_rphy(hw,
++						    IGP01E1000_PHY_PORT_CONFIG,
++						    &data);
++			if (ret_val)
++				goto out;
++
++			data |= IGP01E1000_PSCFR_SMART_SPEED;
++			ret_val = e1e_wphy(hw,
++						     IGP01E1000_PHY_PORT_CONFIG,
++						     data);
++			if (ret_val)
++				goto out;
++		} else if (phy->smart_speed == e1000_smart_speed_off) {
++			ret_val = e1e_rphy(hw,
++						    IGP01E1000_PHY_PORT_CONFIG,
++						    &data);
++			if (ret_val)
++				goto out;
++
++			data &= ~IGP01E1000_PSCFR_SMART_SPEED;
++			ret_val = e1e_wphy(hw,
++						     IGP01E1000_PHY_PORT_CONFIG,
++						     data);
++			if (ret_val)
++				goto out;
++		}
++	} else if ((phy->autoneg_advertised == E1000_ALL_SPEED_DUPLEX) ||
++		   (phy->autoneg_advertised == E1000_ALL_NOT_GIG) ||
++		   (phy->autoneg_advertised == E1000_ALL_10_SPEED)) {
++		phy_ctrl |= E1000_PHY_CTRL_NOND0A_LPLU;
++		ew32(PHY_CTRL, phy_ctrl);
++
++		/* Call gig speed drop workaround on LPLU before accessing
++		 * any PHY registers */
++		if ((hw->mac.type == e1000_ich8lan) &&
++		    (hw->phy.type == e1000_phy_igp_3))
++			e1000_gig_downshift_workaround_ich8lan(hw);
++
++		/* When LPLU is enabled, we should disable SmartSpeed */
++		ret_val = e1e_rphy(hw,
++					    IGP01E1000_PHY_PORT_CONFIG,
++					    &data);
++		if (ret_val)
++			goto out;
++
++		data &= ~IGP01E1000_PSCFR_SMART_SPEED;
++		ret_val = e1e_wphy(hw,
++					     IGP01E1000_PHY_PORT_CONFIG,
++					     data);
++	}
++
++out:
++	return ret_val;
++}
++
++/**
++ *  e1000_read_nvm_ich8lan - Read word(s) from the NVM
++ *  @hw: pointer to the HW structure
++ *  @offset: The offset (in bytes) of the word(s) to read.
++ *  @words: Size of data to read in words
++ *  @data: Pointer to the word(s) to read at offset.
++ *
++ *  Reads a word(s) from the NVM using the flash access registers.
++ **/
++static s32 e1000_read_nvm_ich8lan(struct e1000_hw *hw, u16 offset, u16 words,
++				  u16 *data)
++{
++	struct e1000_nvm_info *nvm = &hw->nvm;
++	struct e1000_dev_spec_ich8lan *dev_spec = &hw->dev_spec.ich8lan;
++	u32 act_offset;
++	s32 ret_val = E1000_SUCCESS;
++	u16 i, word;
++
++	if ((offset >= nvm->word_size) || (words > nvm->word_size - offset) ||
++	    (words == 0)) {
++		hw_dbg(hw, "nvm parameter(s) out of bounds\n");
++		ret_val = -E1000_ERR_NVM;
++		goto out;
++	}
++
++	ret_val = e1000_acquire_swflag_ich8lan(hw);
++	if (ret_val)
++		goto out;
++
++	/* Start with the bank offset, then add the relative offset. */
++	act_offset = (er32(EECD) & E1000_EECD_SEC1VAL)
++		     ? nvm->flash_bank_size
++		     : 0;
++	act_offset += offset;
++
++	for (i = 0; i < words; i++) {
++		if ((dev_spec->shadow_ram) &&
++		    (dev_spec->shadow_ram[offset+i].modified)) {
++			data[i] = dev_spec->shadow_ram[offset+i].value;
++		} else {
++			ret_val = e1000_read_flash_word_ich8lan(hw,
++								act_offset + i,
++								&word);
++			if (ret_val)
++				break;
++			data[i] = word;
++		}
++	}
++
++	e1000_release_swflag_ich8lan(hw);
++
++out:
++	return ret_val;
++}
++
++/**
++ *  e1000_flash_cycle_init_ich8lan - Initialize flash
++ *  @hw: pointer to the HW structure
++ *
++ *  This function does initial flash setup so that a new read/write/erase cycle
++ *  can be started.
++ **/
++static s32 e1000_flash_cycle_init_ich8lan(struct e1000_hw *hw)
++{
++	union ich8_hws_flash_status hsfsts;
++	s32 ret_val = -E1000_ERR_NVM;
++	s32 i = 0;
++
++	hsfsts.regval = er16flash(ICH_FLASH_HSFSTS);
++
++	/* Check if the flash descriptor is valid */
++	if (hsfsts.hsf_status.fldesvalid == 0) {
++		hw_dbg(hw, "Flash descriptor invalid.  "
++			 "SW Sequencing must be used.");
++		goto out;
++	}
++
++	/* Clear FCERR and DAEL in hw status by writing 1 */
++	hsfsts.hsf_status.flcerr = 1;
++	hsfsts.hsf_status.dael = 1;
++
++	ew16flash(ICH_FLASH_HSFSTS, hsfsts.regval);
++
++	/* Either we should have a hardware SPI cycle in progress
++	 * bit to check against, in order to start a new cycle or
++	 * FDONE bit should be changed in the hardware so that it
++	 * is 1 after harware reset, which can then be used as an
++	 * indication whether a cycle is in progress or has been
++	 * completed.
++	 */
++
++	if (hsfsts.hsf_status.flcinprog == 0) {
++		/* There is no cycle running at present,
++		 * so we can start a cycle */
++		/* Begin by setting Flash Cycle Done. */
++		hsfsts.hsf_status.flcdone = 1;
++		ew16flash(ICH_FLASH_HSFSTS, hsfsts.regval);
++		ret_val = E1000_SUCCESS;
++	} else {
++		/* otherwise poll for sometime so the current
++		 * cycle has a chance to end before giving up. */
++		for (i = 0; i < ICH_FLASH_READ_COMMAND_TIMEOUT; i++) {
++			hsfsts.regval = __er16flash(hw, ICH_FLASH_HSFSTS);
++			if (hsfsts.hsf_status.flcinprog == 0) {
++				ret_val = E1000_SUCCESS;
++				break;
++			}
++			udelay(1);
++		}
++		if (ret_val == E1000_SUCCESS) {
++			/* Successful in waiting for previous cycle to timeout,
++			 * now set the Flash Cycle Done. */
++			hsfsts.hsf_status.flcdone = 1;
++			ew16flash(ICH_FLASH_HSFSTS, hsfsts.regval);
++		} else {
++			hw_dbg(hw, "Flash controller busy, cannot get access");
++		}
++	}
++
++out:
++	return ret_val;
++}
++
++/**
++ *  e1000_flash_cycle_ich8lan - Starts flash cycle (read/write/erase)
++ *  @hw: pointer to the HW structure
++ *  @timeout: maximum time to wait for completion
++ *
++ *  This function starts a flash cycle and waits for its completion.
++ **/
++static s32 e1000_flash_cycle_ich8lan(struct e1000_hw *hw, u32 timeout)
++{
++	union ich8_hws_flash_ctrl hsflctl;
++	union ich8_hws_flash_status hsfsts;
++	s32 ret_val = -E1000_ERR_NVM;
++	u32 i = 0;
++
++	/* Start a cycle by writing 1 in Flash Cycle Go in Hw Flash Control */
++	hsflctl.regval = er16flash(ICH_FLASH_HSFCTL);
++	hsflctl.hsf_ctrl.flcgo = 1;
++	ew16flash(ICH_FLASH_HSFCTL, hsflctl.regval);
++
++	/* wait till FDONE bit is set to 1 */
++	do {
++		hsfsts.regval = er16flash(ICH_FLASH_HSFSTS);
++		if (hsfsts.hsf_status.flcdone == 1)
++			break;
++		udelay(1);
++	} while (i++ < timeout);
++
++	if (hsfsts.hsf_status.flcdone == 1 && hsfsts.hsf_status.flcerr == 0)
++		ret_val = E1000_SUCCESS;
++
++	return ret_val;
++}
++
++/**
++ *  e1000_read_flash_word_ich8lan - Read word from flash
++ *  @hw: pointer to the HW structure
++ *  @offset: offset to data location
++ *  @data: pointer to the location for storing the data
++ *
++ *  Reads the flash word at offset into data.  Offset is converted
++ *  to bytes before read.
++ **/
++static s32 e1000_read_flash_word_ich8lan(struct e1000_hw *hw, u32 offset,
++					 u16 *data)
++{
++	s32 ret_val;
++
++	if (!data) {
++		ret_val = -E1000_ERR_NVM;
++		goto out;
++	}
++
++	/* Must convert offset into bytes. */
++	offset <<= 1;
++
++	ret_val = e1000_read_flash_data_ich8lan(hw, offset, 2, data);
++
++out:
++	return ret_val;
++}
++
++/**
++ *  e1000_read_flash_data_ich8lan - Read byte or word from NVM
++ *  @hw: pointer to the HW structure
++ *  @offset: The offset (in bytes) of the byte or word to read.
++ *  @size: Size of data to read, 1=byte 2=word
++ *  @data: Pointer to the word to store the value read.
++ *
++ *  Reads a byte or word from the NVM using the flash access registers.
++ **/
++static s32 e1000_read_flash_data_ich8lan(struct e1000_hw *hw, u32 offset,
++					 u8 size, u16 *data)
++{
++	union ich8_hws_flash_status hsfsts;
++	union ich8_hws_flash_ctrl hsflctl;
++	u32 flash_linear_addr;
++	u32 flash_data = 0;
++	s32 ret_val = -E1000_ERR_NVM;
++	u8 count = 0;
++
++	if (size < 1  || size > 2 || offset > ICH_FLASH_LINEAR_ADDR_MASK)
++		goto out;
++
++	flash_linear_addr = (ICH_FLASH_LINEAR_ADDR_MASK & offset) +
++			    hw->nvm.flash_base_addr;
++
++	do {
++		udelay(1);
++		/* Steps */
++		ret_val = e1000_flash_cycle_init_ich8lan(hw);
++		if (ret_val != E1000_SUCCESS)
++			break;
++
++		hsflctl.regval = er16flash(ICH_FLASH_HSFCTL);
++		/* 0b/1b corresponds to 1 or 2 byte size, respectively. */
++		hsflctl.hsf_ctrl.fldbcount = size - 1;
++		hsflctl.hsf_ctrl.flcycle = ICH_CYCLE_READ;
++		ew16flash(ICH_FLASH_HSFCTL, hsflctl.regval);
++
++		ew32flash(ICH_FLASH_FADDR, flash_linear_addr);
++
++		ret_val = e1000_flash_cycle_ich8lan(hw,
++						ICH_FLASH_READ_COMMAND_TIMEOUT);
++
++		/* Check if FCERR is set to 1, if set to 1, clear it
++		 * and try the whole sequence a few more times, else
++		 * read in (shift in) the Flash Data0, the order is
++		 * least significant byte first msb to lsb */
++		if (ret_val == E1000_SUCCESS) {
++			flash_data = er32flash(ICH_FLASH_FDATA0);
++			if (size == 1) {
++				*data = (u8)(flash_data & 0x000000FF);
++			} else if (size == 2) {
++				*data = (u16)(flash_data & 0x0000FFFF);
++			}
++			break;
++		} else {
++			/* If we've gotten here, then things are probably
++			 * completely hosed, but if the error condition is
++			 * detected, it won't hurt to give it another try...
++			 * ICH_FLASH_CYCLE_REPEAT_COUNT times.
++			 */
++			hsfsts.regval = er16flash(ICH_FLASH_HSFSTS);
++			if (hsfsts.hsf_status.flcerr == 1) {
++				/* Repeat for some time before giving up. */
++				continue;
++			} else if (hsfsts.hsf_status.flcdone == 0) {
++				hw_dbg(hw, "Timeout error - flash cycle "
++					 "did not complete.");
++				break;
++			}
++		}
++	} while (count++ < ICH_FLASH_CYCLE_REPEAT_COUNT);
++
++out:
++	return ret_val;
++}
++
++/**
++ *  e1000_write_nvm_ich8lan - Write word(s) to the NVM
++ *  @hw: pointer to the HW structure
++ *  @offset: The offset (in bytes) of the word(s) to write.
++ *  @words: Size of data to write in words
++ *  @data: Pointer to the word(s) to write at offset.
++ *
++ *  Writes a byte or word to the NVM using the flash access registers.
++ **/
++static s32 e1000_write_nvm_ich8lan(struct e1000_hw *hw, u16 offset, u16 words,
++				   u16 *data)
++{
++	struct e1000_nvm_info *nvm = &hw->nvm;
++	struct e1000_dev_spec_ich8lan *dev_spec = &hw->dev_spec.ich8lan;
++	s32 ret_val = E1000_SUCCESS;
++	u16 i;
++
++	if ((offset >= nvm->word_size) || (words > nvm->word_size - offset) ||
++	    (words == 0)) {
++		hw_dbg(hw, "nvm parameter(s) out of bounds\n");
++		ret_val = -E1000_ERR_NVM;
++		goto out;
++	}
++
++	ret_val = e1000_acquire_swflag_ich8lan(hw);
++	if (ret_val)
++		goto out;
++
++	for (i = 0; i < words; i++) {
++		dev_spec->shadow_ram[offset+i].modified = 1;
++		dev_spec->shadow_ram[offset+i].value = data[i];
++	}
++
++	e1000_release_swflag_ich8lan(hw);
++
++out:
++	return ret_val;
++}
++
++/**
++ *  e1000_update_nvm_checksum_ich8lan - Update the checksum for NVM
++ *  @hw: pointer to the HW structure
++ *
++ *  The NVM checksum is updated by calling the generic update_nvm_checksum,
++ *  which writes the checksum to the shadow ram.  The changes in the shadow
++ *  ram are then committed to the EEPROM by processing each bank at a time
++ *  checking for the modified bit and writing only the pending changes.
++ *  After a succesful commit, the shadow ram is cleared and is ready for
++ *  future writes.
++ **/
++static s32 e1000_update_nvm_checksum_ich8lan(struct e1000_hw *hw)
++{
++	struct e1000_nvm_info *nvm = &hw->nvm;
++	struct e1000_dev_spec_ich8lan *dev_spec = &hw->dev_spec.ich8lan;
++	u32 i, act_offset, new_bank_offset, old_bank_offset;
++	s32 ret_val;
++	u16 data;
++
++	ret_val = e1000_update_nvm_checksum_generic(hw);
++	if (ret_val)
++		goto out;
++
++	if (nvm->type != e1000_nvm_flash_sw)
++		goto out;
++
++	ret_val = e1000_acquire_swflag_ich8lan(hw);
++	if (ret_val)
++		goto out;
++
++	/* We're writing to the opposite bank so if we're on bank 1,
++	 * write to bank 0 etc.  We also need to erase the segment that
++	 * is going to be written */
++	if (!(er32(EECD) & E1000_EECD_SEC1VAL)) {
++		new_bank_offset = nvm->flash_bank_size;
++		old_bank_offset = 0;
++		e1000_erase_flash_bank_ich8lan(hw, 1);
++	} else {
++		old_bank_offset = nvm->flash_bank_size;
++		new_bank_offset = 0;
++		e1000_erase_flash_bank_ich8lan(hw, 0);
++	}
++
++	for (i = 0; i < E1000_ICH8_SHADOW_RAM_WORDS; i++) {
++		/* Determine whether to write the value stored
++		 * in the other NVM bank or a modified value stored
++		 * in the shadow RAM */
++		if (dev_spec->shadow_ram[i].modified) {
++			data = dev_spec->shadow_ram[i].value;
++		} else {
++			e1000_read_flash_word_ich8lan(hw,
++						      i + old_bank_offset,
++						      &data);
++		}
++
++		/* If the word is 0x13, then make sure the signature bits
++		 * (15:14) are 11b until the commit has completed.
++		 * This will allow us to write 10b which indicates the
++		 * signature is valid.  We want to do this after the write
++		 * has completed so that we don't mark the segment valid
++		 * while the write is still in progress */
++		if (i == E1000_ICH_NVM_SIG_WORD)
++			data |= E1000_ICH_NVM_SIG_MASK;
++
++		/* Convert offset to bytes. */
++		act_offset = (i + new_bank_offset) << 1;
++
++		udelay(100);
++		/* Write the bytes to the new bank. */
++		ret_val = e1000_retry_write_flash_byte_ich8lan(hw,
++							       act_offset,
++							       (u8)data);
++		if (ret_val)
++			break;
++
++		udelay(100);
++		ret_val = e1000_retry_write_flash_byte_ich8lan(hw,
++							  act_offset + 1,
++							  (u8)(data >> 8));
++		if (ret_val)
++			break;
++	}
++
++	/* Don't bother writing the segment valid bits if sector
++	 * programming failed. */
++	if (ret_val) {
++		hw_dbg(hw, "Flash commit failed.\n");
++		e1000_release_swflag_ich8lan(hw);
++		goto out;
++	}
++
++	/* Finally validate the new segment by setting bit 15:14
++	 * to 10b in word 0x13 , this can be done without an
++	 * erase as well since these bits are 11 to start with
++	 * and we need to change bit 14 to 0b */
++	act_offset = new_bank_offset + E1000_ICH_NVM_SIG_WORD;
++	e1000_read_flash_word_ich8lan(hw, act_offset, &data);
++	data &= 0xBFFF;
++	ret_val = e1000_retry_write_flash_byte_ich8lan(hw,
++						       act_offset * 2 + 1,
++						       (u8)(data >> 8));
++	if (ret_val) {
++		e1000_release_swflag_ich8lan(hw);
++		goto out;
++	}
++
++	/* And invalidate the previously valid segment by setting
++	 * its signature word (0x13) high_byte to 0b. This can be
++	 * done without an erase because flash erase sets all bits
++	 * to 1's. We can write 1's to 0's without an erase */
++	act_offset = (old_bank_offset + E1000_ICH_NVM_SIG_WORD) * 2 + 1;
++	ret_val = e1000_retry_write_flash_byte_ich8lan(hw, act_offset, 0);
++	if (ret_val) {
++		e1000_release_swflag_ich8lan(hw);
++		goto out;
++	}
++
++	/* Great!  Everything worked, we can now clear the cached entries. */
++	for (i = 0; i < E1000_ICH8_SHADOW_RAM_WORDS; i++) {
++		dev_spec->shadow_ram[i].modified = 0;
++		dev_spec->shadow_ram[i].value = 0xFFFF;
++	}
++
++	e1000_release_swflag_ich8lan(hw);
++
++	/* Reload the EEPROM, or else modifications will not appear
++	 * until after the next adapter reset.
++	 */
++	e1000_reload_nvm(hw);
++	msleep(10);
++
++out:
++	return ret_val;
++}
++
++/**
++ *  e1000_validate_nvm_checksum_ich8lan - Validate EEPROM checksum
++ *  @hw: pointer to the HW structure
++ *
++ *  Check to see if checksum needs to be fixed by reading bit 6 in word 0x19.
++ *  If the bit is 0, that the EEPROM had been modified, but the checksum was not
++ *  calculated, in which case we need to calculate the checksum and set bit 6.
++ **/
++static s32 e1000_validate_nvm_checksum_ich8lan(struct e1000_hw *hw)
++{
++	s32 ret_val = E1000_SUCCESS;
++	u16 data;
++
++	/* Read 0x19 and check bit 6.  If this bit is 0, the checksum
++	 * needs to be fixed.  This bit is an indication that the NVM
++	 * was prepared by OEM software and did not calculate the
++	 * checksum...a likely scenario.
++	 */
++	ret_val = e1000_read_nvm(hw, 0x19, 1, &data);
++	if (ret_val)
++		goto out;
++
++	if ((data & 0x40) == 0) {
++		data |= 0x40;
++		ret_val = e1000_write_nvm(hw, 0x19, 1, &data);
++		if (ret_val)
++			goto out;
++		ret_val = e1000_update_nvm_checksum(hw);
++		if (ret_val)
++			goto out;
++	}
++
++	ret_val = e1000_validate_nvm_checksum_generic(hw);
++
++out:
++	return ret_val;
++}
++
++/**
++ *  e1000_write_flash_data_ich8lan - Writes bytes to the NVM
++ *  @hw: pointer to the HW structure
++ *  @offset: The offset (in bytes) of the byte/word to read.
++ *  @size: Size of data to read, 1=byte 2=word
++ *  @data: The byte(s) to write to the NVM.
++ *
++ *  Writes one/two bytes to the NVM using the flash access registers.
++ **/
++static s32 e1000_write_flash_data_ich8lan(struct e1000_hw *hw, u32 offset,
++					  u8 size, u16 data)
++{
++	union ich8_hws_flash_status hsfsts;
++	union ich8_hws_flash_ctrl hsflctl;
++	u32 flash_linear_addr;
++	u32 flash_data = 0;
++	s32 ret_val = -E1000_ERR_NVM;
++	u8 count = 0;
++
++	if (size < 1 || size > 2 || data > size * 0xff ||
++	    offset > ICH_FLASH_LINEAR_ADDR_MASK)
++		goto out;
++
++	flash_linear_addr = (ICH_FLASH_LINEAR_ADDR_MASK & offset) +
++			    hw->nvm.flash_base_addr;
++
++	do {
++		udelay(1);
++		/* Steps */
++		ret_val = e1000_flash_cycle_init_ich8lan(hw);
++		if (ret_val != E1000_SUCCESS)
++			break;
++
++		hsflctl.regval = er16flash(ICH_FLASH_HSFCTL);
++		/* 0b/1b corresponds to 1 or 2 byte size, respectively. */
++		hsflctl.hsf_ctrl.fldbcount = size -1;
++		hsflctl.hsf_ctrl.flcycle = ICH_CYCLE_WRITE;
++		ew16flash(ICH_FLASH_HSFCTL, hsflctl.regval);
++
++		ew32flash(ICH_FLASH_FADDR, flash_linear_addr);
++
++		if (size == 1)
++			flash_data = (u32)data & 0x00FF;
++		else
++			flash_data = (u32)data;
++
++		ew32flash(ICH_FLASH_FDATA0, flash_data);
++
++		/* check if FCERR is set to 1 , if set to 1, clear it
++		 * and try the whole sequence a few more times else done */
++		ret_val = e1000_flash_cycle_ich8lan(hw,
++					       ICH_FLASH_WRITE_COMMAND_TIMEOUT);
++		if (ret_val == E1000_SUCCESS) {
++			break;
++		} else {
++			/* If we're here, then things are most likely
++			 * completely hosed, but if the error condition
++			 * is detected, it won't hurt to give it another
++			 * try...ICH_FLASH_CYCLE_REPEAT_COUNT times.
++			 */
++			hsfsts.regval = er16flash(ICH_FLASH_HSFSTS);
++			if (hsfsts.hsf_status.flcerr == 1) {
++				/* Repeat for some time before giving up. */
++				continue;
++			} else if (hsfsts.hsf_status.flcdone == 0) {
++				hw_dbg(hw, "Timeout error - flash cycle "
++					 "did not complete.");
++				break;
++			}
++		}
++	} while (count++ < ICH_FLASH_CYCLE_REPEAT_COUNT);
++
++out:
++	return ret_val;
++}
++
++/**
++ *  e1000_write_flash_byte_ich8lan - Write a single byte to NVM
++ *  @hw: pointer to the HW structure
++ *  @offset: The index of the byte to read.
++ *  @data: The byte to write to the NVM.
++ *
++ *  Writes a single byte to the NVM using the flash access registers.
++ **/
++static s32 e1000_write_flash_byte_ich8lan(struct e1000_hw *hw, u32 offset,
++					  u8 data)
++{
++	u16 word = (u16)data;
++
++	return e1000_write_flash_data_ich8lan(hw, offset, 1, word);
++}
++
++/**
++ *  e1000_retry_write_flash_byte_ich8lan - Writes a single byte to NVM
++ *  @hw: pointer to the HW structure
++ *  @offset: The offset of the byte to write.
++ *  @byte: The byte to write to the NVM.
++ *
++ *  Writes a single byte to the NVM using the flash access registers.
++ *  Goes through a retry algorithm before giving up.
++ **/
++static s32 e1000_retry_write_flash_byte_ich8lan(struct e1000_hw *hw,
++						u32 offset, u8 byte)
++{
++	s32 ret_val;
++	u16 program_retries;
++
++	ret_val = e1000_write_flash_byte_ich8lan(hw, offset, byte);
++	if (ret_val == E1000_SUCCESS)
++		goto out;
++
++	for (program_retries = 0; program_retries < 100; program_retries++) {
++		hw_dbg(hw, "Retrying Byte %2.2X at offset %u\n", byte, offset);
++		udelay(100);
++		ret_val = e1000_write_flash_byte_ich8lan(hw, offset, byte);
++		if (ret_val == E1000_SUCCESS)
++			break;
++	}
++	if (program_retries == 100) {
++		ret_val = -E1000_ERR_NVM;
++		goto out;
++	}
++
++out:
++	return ret_val;
++}
++
++/**
++ *  e1000_erase_flash_bank_ich8lan - Erase a bank (4k) from NVM
++ *  @hw: pointer to the HW structure
++ *  @bank: 0 for first bank, 1 for second bank, etc.
++ *
++ *  Erases the bank specified. Each bank is a 4k block. Banks are 0 based.
++ *  bank N is 4096 * N + flash_reg_addr.
++ **/
++static s32 e1000_erase_flash_bank_ich8lan(struct e1000_hw *hw, u32 bank)
++{
++	struct e1000_nvm_info *nvm = &hw->nvm;
++	union ich8_hws_flash_status hsfsts;
++	union ich8_hws_flash_ctrl hsflctl;
++	u32 flash_linear_addr;
++	/* bank size is in 16bit words - adjust to bytes */
++	u32 flash_bank_size = nvm->flash_bank_size * 2;
++	s32  ret_val = E1000_SUCCESS;
++	s32  count = 0;
++	s32  j, iteration, sector_size;
++
++	hsfsts.regval = er16flash(ICH_FLASH_HSFSTS);
++
++	/* Determine HW Sector size: Read BERASE bits of hw flash status
++	 * register */
++	/* 00: The Hw sector is 256 bytes, hence we need to erase 16
++	 *     consecutive sectors.  The start index for the nth Hw sector
++	 *     can be calculated as = bank * 4096 + n * 256
++	 * 01: The Hw sector is 4K bytes, hence we need to erase 1 sector.
++	 *     The start index for the nth Hw sector can be calculated
++	 *     as = bank * 4096
++	 * 10: The Hw sector is 8K bytes, nth sector = bank * 8192
++	 *     (ich9 only, otherwise error condition)
++	 * 11: The Hw sector is 64K bytes, nth sector = bank * 65536
++	 */
++	switch (hsfsts.hsf_status.berasesz) {
++	case 0:
++		/* Hw sector size 256 */
++		sector_size = ICH_FLASH_SEG_SIZE_256;
++		iteration = flash_bank_size / ICH_FLASH_SEG_SIZE_256;
++		break;
++	case 1:
++		sector_size = ICH_FLASH_SEG_SIZE_4K;
++		iteration = flash_bank_size / ICH_FLASH_SEG_SIZE_4K;
++		break;
++	case 2:
++		if (hw->mac.type == e1000_ich9lan) {
++			sector_size = ICH_FLASH_SEG_SIZE_8K;
++			iteration = flash_bank_size / ICH_FLASH_SEG_SIZE_8K;
++		} else {
++			ret_val = -E1000_ERR_NVM;
++			goto out;
++		}
++		break;
++	case 3:
++		sector_size = ICH_FLASH_SEG_SIZE_64K;
++		iteration = flash_bank_size / ICH_FLASH_SEG_SIZE_64K;
++		break;
++	default:
++		ret_val = -E1000_ERR_NVM;
++		goto out;
++	}
++
++	/* Start with the base address, then add the sector offset. */
++	flash_linear_addr = hw->nvm.flash_base_addr;
++	flash_linear_addr += (bank) ? (sector_size * iteration) : 0;
++
++	for (j = 0; j < iteration ; j++) {
++		do {
++			/* Steps */
++			ret_val = e1000_flash_cycle_init_ich8lan(hw);
++			if (ret_val)
++				goto out;
++
++			/* Write a value 11 (block Erase) in Flash
++			 * Cycle field in hw flash control */
++			hsflctl.regval = er16flash(ICH_FLASH_HSFCTL);
++			hsflctl.hsf_ctrl.flcycle = ICH_CYCLE_ERASE;
++			ew16flash(ICH_FLASH_HSFCTL, hsflctl.regval);
++
++			/* Write the last 24 bits of an index within the
++			 * block into Flash Linear address field in Flash
++			 * Address.
++			 */
++			flash_linear_addr += (j * sector_size);
++			ew32flash(ICH_FLASH_FADDR, flash_linear_addr);
++
++			ret_val = e1000_flash_cycle_ich8lan(hw,
++					       ICH_FLASH_ERASE_COMMAND_TIMEOUT);
++			if (ret_val == E1000_SUCCESS) {
++				break;
++			} else {
++				/* Check if FCERR is set to 1.  If 1,
++				 * clear it and try the whole sequence
++				 * a few more times else Done */
++				hsfsts.regval = er16flash(ICH_FLASH_HSFSTS);
++				if (hsfsts.hsf_status.flcerr == 1) {
++					/* repeat for some time before
++					 * giving up */
++					continue;
++				} else if (hsfsts.hsf_status.flcdone == 0)
++					goto out;
++			}
++		} while (++count < ICH_FLASH_CYCLE_REPEAT_COUNT);
++	}
++
++out:
++	return ret_val;
++}
++
++/**
++ *  e1000_valid_led_default_ich8lan - Set the default LED settings
++ *  @hw: pointer to the HW structure
++ *  @data: Pointer to the LED settings
++ *
++ *  Reads the LED default settings from the NVM to data.  If the NVM LED
++ *  settings is all 0's or F's, set the LED default to a valid LED default
++ *  setting.
++ **/
++static s32 e1000_valid_led_default_ich8lan(struct e1000_hw *hw, u16 *data)
++{
++	s32 ret_val;
++
++	ret_val = e1000_read_nvm(hw, NVM_ID_LED_SETTINGS, 1, data);
++	if (ret_val) {
++		hw_dbg(hw, "NVM Read Error\n");
++		goto out;
++	}
++
++	if (*data == ID_LED_RESERVED_0000 ||
++	    *data == ID_LED_RESERVED_FFFF)
++		*data = ID_LED_DEFAULT_ICH8LAN;
++
++out:
++	return ret_val;
++}
++
++/**
++ *  e1000_get_bus_info_ich8lan - Get/Set the bus type and width
++ *  @hw: pointer to the HW structure
++ *
++ *  ICH8 use the PCI Express bus, but does not contain a PCI Express Capability
++ *  register, so the the bus width is hard coded.
++ **/
++static s32 e1000_get_bus_info_ich8lan(struct e1000_hw *hw)
++{
++	struct e1000_bus_info *bus = &hw->bus;
++	s32 ret_val;
++
++	ret_val = e1000_get_bus_info_pcie(hw);
++
++	/* ICH devices are "PCI Express"-ish.  They have
++	 * a configuration space, but do not contain
++	 * PCI Express Capability registers, so bus width
++	 * must be hardcoded.
++	 */
++	if (bus->width == e1000_bus_width_unknown)
++		bus->width = e1000_bus_width_pcie_x1;
++
++	return ret_val;
++}
++
++/**
++ *  e1000_reset_hw_ich8lan - Reset the hardware
++ *  @hw: pointer to the HW structure
++ *
++ *  Does a full reset of the hardware which includes a reset of the PHY and
++ *  MAC.
++ **/
++static s32 e1000_reset_hw_ich8lan(struct e1000_hw *hw)
++{
++	u32 ctrl, icr, kab;
++	s32 ret_val;
++
++	/* Prevent the PCI-E bus from sticking if there is no TLP connection
++	 * on the last TLP read/write transaction when MAC is reset.
++	 */
++	ret_val = e1000_disable_pcie_master(hw);
++	if (ret_val) {
++		hw_dbg(hw, "PCI-E Master disable polling has failed.\n");
++	}
++
++	hw_dbg(hw, "Masking off all interrupts\n");
++	ew32(IMC, 0xffffffff);
++
++	/* Disable the Transmit and Receive units.  Then delay to allow
++	 * any pending transactions to complete before we hit the MAC
++	 * with the global reset.
++	 */
++	ew32(RCTL, 0);
++	ew32(TCTL, E1000_TCTL_PSP);
++	e1e_flush();
++
++	msleep(10);
++
++	/* Workaround for ICH8 bit corruption issue in FIFO memory */
++	if (hw->mac.type == e1000_ich8lan) {
++		/* Set Tx and Rx buffer allocation to 8k apiece. */
++		ew32(PBA, E1000_PBA_8K);
++		/* Set Packet Buffer Size to 16k. */
++		ew32(PBS, E1000_PBS_16K);
++	}
++
++	ctrl = er32(CTRL);
++
++	if (!e1000_check_reset_block(hw)) {
++		/* PHY HW reset requires MAC CORE reset at the same
++		 * time to make sure the interface between MAC and the
++		 * external PHY is reset.
++		 */
++		ctrl |= E1000_CTRL_PHY_RST;
++	}
++	ret_val = e1000_acquire_swflag_ich8lan(hw);
++	hw_dbg(hw, "Issuing a global reset to ich8lan");
++	ew32(CTRL, (ctrl | E1000_CTRL_RST));
++	msleep(20);
++
++	ret_val = e1000_get_auto_rd_done(hw);
++	if (ret_val) {
++		/*
++		 * When auto config read does not complete, do not
++		 * return with an error. This can happen in situations
++		 * where there is no eeprom and prevents getting link.
++		 */
++		hw_dbg(hw, "Auto Read Done did not complete\n");
++	}
++
++	ew32(IMC, 0xffffffff);
++	icr = er32(ICR);
++
++	kab = er32(KABGTXD);
++	kab |= E1000_KABGTXD_BGSQLBIAS;
++	ew32(KABGTXD, kab);
++
++	return ret_val;
++}
++
++/**
++ *  e1000_init_hw_ich8lan - Initialize the hardware
++ *  @hw: pointer to the HW structure
++ *
++ *  Prepares the hardware for transmit and receive by doing the following:
++ *   - initialize hardware bits
++ *   - initialize LED identification
++ *   - setup receive address registers
++ *   - setup flow control
++ *   - setup transmit discriptors
++ *   - clear statistics
++ **/
++static s32 e1000_init_hw_ich8lan(struct e1000_hw *hw)
++{
++	struct e1000_mac_info *mac = &hw->mac;
++	u32 ctrl_ext, txdctl, snoop;
++	s32 ret_val;
++	u16 i;
++
++	e1000_initialize_hw_bits_ich8lan(hw);
++
++	/* Initialize identification LED */
++	ret_val = e1000_id_led_init(hw);
++	if (ret_val) {
++		hw_dbg(hw, "Error initializing identification LED\n");
++		goto out;
++	}
++
++	/* Setup the receive address. */
++	e1000_init_rx_addrs(hw, mac->rar_entry_count);
++
++	/* Zero out the Multicast HASH table */
++	hw_dbg(hw, "Zeroing the MTA\n");
++	for (i = 0; i < mac->mta_reg_count; i++)
++		E1000_WRITE_REG_ARRAY(hw, E1000_MTA, i, 0);
++
++	/* Setup link and flow control */
++	ret_val = e1000_setup_link_ich8lan(hw);
++
++	/* Set the transmit descriptor write-back policy for both queues */
++	txdctl = er32(TXDCTL);
++	txdctl = (txdctl & ~E1000_TXDCTL_WTHRESH) |
++		 E1000_TXDCTL_FULL_TX_DESC_WB;
++	txdctl = (txdctl & ~E1000_TXDCTL_PTHRESH) |
++		 E1000_TXDCTL_MAX_TX_DESC_PREFETCH;
++	ew32(TXDCTL, txdctl);
++	txdctl = er32(TXDCTL1);
++	txdctl = (txdctl & ~E1000_TXDCTL_WTHRESH) |
++		 E1000_TXDCTL_FULL_TX_DESC_WB;
++	txdctl = (txdctl & ~E1000_TXDCTL_PTHRESH) |
++		 E1000_TXDCTL_MAX_TX_DESC_PREFETCH;
++	ew32(TXDCTL1, txdctl);
++
++	/* ICH8 has opposite polarity of no_snoop bits.
++	 * By default, we should use snoop behavior. */
++	if (mac->type == e1000_ich8lan)
++		snoop = PCIE_ICH8_SNOOP_ALL;
++	else
++		snoop = (u32) ~(PCIE_NO_SNOOP_ALL);
++	e1000_set_pcie_no_snoop(hw, snoop);
++
++	ctrl_ext = er32(CTRL_EXT);
++	ctrl_ext |= E1000_CTRL_EXT_RO_DIS;
++	ew32(CTRL_EXT, ctrl_ext);
++
++	/* Clear all of the statistics registers (clear on read).  It is
++	 * important that we do this after we have tried to establish link
++	 * because the symbol error count will increment wildly if there
++	 * is no link.
++	 */
++	e1000_clear_hw_cntrs_ich8lan(hw);
++
++out:
++	return ret_val;
++}
++/**
++ *  e1000_initialize_hw_bits_ich8lan - Initialize required hardware bits
++ *  @hw: pointer to the HW structure
++ *
++ *  Sets/Clears required hardware bits necessary for correctly setting up the
++ *  hardware for transmit and receive.
++ **/
++static void e1000_initialize_hw_bits_ich8lan(struct e1000_hw *hw)
++{
++	u32 reg;
++
++	/* Extended Device Control */
++	reg = er32(CTRL_EXT);
++	reg |= (1 << 22);
++	ew32(CTRL_EXT, reg);
++
++	/* Transmit Descriptor Control 0 */
++	reg = er32(TXDCTL);
++	reg |= (1 << 22);
++	ew32(TXDCTL, reg);
++
++	/* Transmit Descriptor Control 1 */
++	reg = er32(TXDCTL1);
++	reg |= (1 << 22);
++	ew32(TXDCTL1, reg);
++
++	/* Transmit Arbitration Control 0 */
++	reg = er32(TARC0);
++	if (hw->mac.type == e1000_ich8lan)
++		reg |= (1 << 28) | (1 << 29);
++	reg |= (1 << 23) | (1 << 24) | (1 << 26) | (1 << 27);
++	ew32(TARC0, reg);
++
++	/* Transmit Arbitration Control 1 */
++	reg = er32(TARC1);
++	if (er32(TCTL) & E1000_TCTL_MULR)
++		reg &= ~(1 << 28);
++	else
++		reg |= (1 << 28);
++	reg |= (1 << 24) | (1 << 26) | (1 << 30);
++	ew32(TARC1, reg);
++
++	/* Device Status */
++	if (hw->mac.type == e1000_ich8lan) {
++		reg = er32(STATUS);
++		reg &= ~(1 << 31);
++		ew32(STATUS, reg);
++	}
++}
++
++/**
++ *  e1000_setup_link_ich8lan - Setup flow control and link settings
++ *  @hw: pointer to the HW structure
++ *
++ *  Determines which flow control settings to use, then configures flow
++ *  control.  Calls the appropriate media-specific link configuration
++ *  function.  Assuming the adapter has a valid link partner, a valid link
++ *  should be established.  Assumes the hardware has previously been reset
++ *  and the transmitter and receiver are not enabled.
++ **/
++static s32 e1000_setup_link_ich8lan(struct e1000_hw *hw)
++{
++	struct e1000_mac_info *mac = &hw->mac;
++	s32 ret_val = E1000_SUCCESS;
++
++	if (e1000_check_reset_block(hw))
++		goto out;
++
++	/* ICH parts do not have a word in the NVM to determine
++	 * the default flow control setting, so we explicitly
++	 * set it to full.
++	 */
++	if (mac->fc == e1000_fc_default)
++		mac->fc = e1000_fc_full;
++
++	mac->original_fc = mac->fc;
++
++	hw_dbg(hw, "After fix-ups FlowControl is now = %x\n", mac->fc);
++
++	/* Continue to configure the copper link. */
++	ret_val = e1000_setup_copper_link_ich8lan(hw);
++	if (ret_val)
++		goto out;
++
++	ew32(FCTTV, mac->fc_pause_time);
++
++	ret_val = e1000_set_fc_watermarks(hw);
++
++out:
++	return ret_val;
++}
++
++/**
++ *  e1000_setup_copper_link_ich8lan - Configure MAC/PHY interface
++ *  @hw: pointer to the HW structure
++ *
++ *  Configures the kumeran interface to the PHY to wait the appropriate time
++ *  when polling the PHY, then call the generic setup_copper_link to finish
++ *  configuring the copper link.
++ **/
++static s32 e1000_setup_copper_link_ich8lan(struct e1000_hw *hw)
++{
++	u32 ctrl;
++	s32 ret_val;
++	u16 reg_data;
++
++	ctrl = er32(CTRL);
++	ctrl |= E1000_CTRL_SLU;
++	ctrl &= ~(E1000_CTRL_FRCSPD | E1000_CTRL_FRCDPX);
++	ew32(CTRL, ctrl);
++
++	/* Set the mac to wait the maximum time between each iteration
++	 * and increase the max iterations when polling the phy;
++	 * this fixes erroneous timeouts at 10Mbps. */
++	ret_val = e1000_write_kmrn_reg(hw, GG82563_REG(0x34, 4), 0xFFFF);
++	if (ret_val)
++		goto out;
++	ret_val = e1000_read_kmrn_reg(hw, GG82563_REG(0x34, 9), &reg_data);
++	if (ret_val)
++		goto out;
++	reg_data |= 0x3F;
++	ret_val = e1000_write_kmrn_reg(hw, GG82563_REG(0x34, 9), reg_data);
++	if (ret_val)
++		goto out;
++
++	if (hw->phy.type == e1000_phy_igp_3) {
++		ret_val = e1000_copper_link_setup_igp(hw);
++		if (ret_val)
++			goto out;
++	}
++
++	ret_val = e1000_setup_copper_link(hw);
++
++out:
++	return ret_val;
++}
++
++/**
++ *  e1000_get_link_up_info_ich8lan - Get current link speed and duplex
++ *  @hw: pointer to the HW structure
++ *  @speed: pointer to store current link speed
++ *  @duplex: pointer to store the current link duplex
++ *
++ *  Calls the generic get_speed_and_duplex to retreive the current link
++ *  information and then calls the Kumeran lock loss workaround for links at
++ *  gigabit speeds.
++ **/
++static s32 e1000_get_link_up_info_ich8lan(struct e1000_hw *hw, u16 *speed,
++					  u16 *duplex)
++{
++	s32 ret_val;
++
++	ret_val = e1000_get_speed_and_duplex_copper(hw, speed, duplex);
++	if (ret_val)
++		goto out;
++
++	if ((hw->mac.type == e1000_ich8lan) &&
++	    (hw->phy.type == e1000_phy_igp_3) &&
++	    (*speed == SPEED_1000)) {
++		ret_val = e1000_kmrn_lock_loss_workaround_ich8lan(hw);
++	}
++
++out:
++	return ret_val;
++}
++
++/**
++ *  e1000_kmrn_lock_loss_workaround_ich8lan - Kumeran workaround
++ *  @hw: pointer to the HW structure
++ *
++ *  Work-around for 82566 Kumeran PCS lock loss:
++ *  On link status change (i.e. PCI reset, speed change) and link is up and
++ *  speed is gigabit-
++ *    0) if workaround is optionally disabled do nothing
++ *    1) wait 1ms for Kumeran link to come up
++ *    2) check Kumeran Diagnostic register PCS lock loss bit
++ *    3) if not set the link is locked (all is good), otherwise...
++ *    4) reset the PHY
++ *    5) repeat up to 10 times
++ *  Note: this is only called for IGP3 copper when speed is 1gb.
++ **/
++static s32 e1000_kmrn_lock_loss_workaround_ich8lan(struct e1000_hw *hw)
++{
++	struct e1000_dev_spec_ich8lan *dev_spec = &hw->dev_spec.ich8lan;
++	u32 phy_ctrl;
++	s32 ret_val = E1000_SUCCESS;
++	u16 i, data;
++	bool link;
++
++	if (!dev_spec->kmrn_lock_loss_workaround_enabled)
++		goto out;
++
++	/* Make sure link is up before proceeding.  If not just return.
++	 * Attempting this while link is negotiating fouled up link
++	 * stability */
++	ret_val = e1000_phy_has_link_generic(hw, 1, 0, &link);
++	if (!link) {
++		ret_val = E1000_SUCCESS;
++		goto out;
++	}
++
++	for (i = 0; i < 10; i++) {
++		/* read once to clear */
++		ret_val = e1e_rphy(hw, IGP3_KMRN_DIAG, &data);
++		if (ret_val)
++			goto out;
++		/* and again to get new status */
++		ret_val = e1e_rphy(hw, IGP3_KMRN_DIAG, &data);
++		if (ret_val)
++			goto out;
++
++		/* check for PCS lock */
++		if (!(data & IGP3_KMRN_DIAG_PCS_LOCK_LOSS)) {
++			ret_val = E1000_SUCCESS;
++			goto out;
++		}
++
++		/* Issue PHY reset */
++		e1000_phy_hw_reset(hw);
++		mdelay(5);
++	}
++	/* Disable GigE link negotiation */
++	phy_ctrl = er32(PHY_CTRL);
++	phy_ctrl |= (E1000_PHY_CTRL_GBE_DISABLE |
++		     E1000_PHY_CTRL_NOND0A_GBE_DISABLE);
++	ew32(PHY_CTRL, phy_ctrl);
++
++	/* Call gig speed drop workaround on Giga disable before accessing
++	 * any PHY registers */
++	e1000_gig_downshift_workaround_ich8lan(hw);
++
++	/* unable to acquire PCS lock */
++	ret_val = -E1000_ERR_PHY;
++
++out:
++	return ret_val;
++}
++
++/**
++ *  e1000_set_kmrn_lock_loss_workaound_ich8lan - Set Kumeran workaround state
++ *  @hw: pointer to the HW structure
++ *  @state: boolean value used to set the current Kumaran workaround state
++ *
++ *  If ICH8, set the current Kumeran workaround state (enabled - TRUE
++ *  /disabled - FALSE).
++ **/
++void e1000_set_kmrn_lock_loss_workaround_ich8lan(struct e1000_hw *hw,
++						 bool state)
++{
++	struct e1000_dev_spec_ich8lan *dev_spec = &hw->dev_spec.ich8lan;
++
++	if (hw->mac.type != e1000_ich8lan) {
++		hw_dbg(hw, "Workaround applies to ICH8 only.\n");
++		goto out;
++	}
++
++	dev_spec->kmrn_lock_loss_workaround_enabled = state;
++
++out:
++	return;
++}
++
++/**
++ *  e1000_ipg3_phy_powerdown_workaround_ich8lan - Power down workaround on D3
++ *  @hw: pointer to the HW structure
++ *
++ *  Workaround for 82566 power-down on D3 entry:
++ *    1) disable gigabit link
++ *    2) write VR power-down enable
++ *    3) read it back
++ *  Continue if successful, else issue LCD reset and repeat
++ **/
++void e1000_igp3_phy_powerdown_workaround_ich8lan(struct e1000_hw *hw)
++{
++	u32 reg;
++	u16 data;
++	u8  retry = 0;
++
++	if (hw->phy.type != e1000_phy_igp_3)
++		goto out;
++
++	/* Try the workaround twice (if needed) */
++	do {
++		/* Disable link */
++		reg = er32(PHY_CTRL);
++		reg |= (E1000_PHY_CTRL_GBE_DISABLE |
++			E1000_PHY_CTRL_NOND0A_GBE_DISABLE);
++		ew32(PHY_CTRL, reg);
++
++		/* Call gig speed drop workaround on Giga disable before
++		 * accessing any PHY registers */
++		if (hw->mac.type == e1000_ich8lan)
++			e1000_gig_downshift_workaround_ich8lan(hw);
++
++		/* Write VR power-down enable */
++		e1e_rphy(hw, IGP3_VR_CTRL, &data);
++		data &= ~IGP3_VR_CTRL_DEV_POWERDOWN_MODE_MASK;
++		e1e_wphy(hw, IGP3_VR_CTRL, data | IGP3_VR_CTRL_MODE_SHUTDOWN);
++
++		/* Read it back and test */
++		e1e_rphy(hw, IGP3_VR_CTRL, &data);
++		data &= IGP3_VR_CTRL_DEV_POWERDOWN_MODE_MASK;
++		if ((data == IGP3_VR_CTRL_MODE_SHUTDOWN) || retry)
++			break;
++
++		/* Issue PHY reset and repeat at most one more time */
++		reg = er32(CTRL);
++		ew32(CTRL, reg | E1000_CTRL_PHY_RST);
++		retry++;
++	} while (retry);
++
++out:
++	return;
++}
++
++/**
++ *  e1000_gig_downshift_workaround_ich8lan - WoL from S5 stops working
++ *  @hw: pointer to the HW structure
++ *
++ *  Steps to take when dropping from 1Gb/s (eg. link cable removal (LSC),
++ *  LPLU, Giga disable, MDIC PHY reset):
++ *    1) Set Kumeran Near-end loopback
++ *    2) Clear Kumeran Near-end loopback
++ *  Should only be called for ICH8[m] devices with IGP_3 Phy.
++ **/
++void e1000_gig_downshift_workaround_ich8lan(struct e1000_hw *hw)
++{
++	s32 ret_val = E1000_SUCCESS;
++	u16 reg_data;
++
++	if ((hw->mac.type != e1000_ich8lan) ||
++	    (hw->phy.type != e1000_phy_igp_3))
++		goto out;
++
++	ret_val = e1000_read_kmrn_reg(hw, E1000_KMRNCTRLSTA_DIAG_OFFSET,
++				      &reg_data);
++	if (ret_val)
++		goto out;
++	reg_data |= E1000_KMRNCTRLSTA_DIAG_NELPBK;
++	ret_val = e1000_write_kmrn_reg(hw, E1000_KMRNCTRLSTA_DIAG_OFFSET,
++				       reg_data);
++	if (ret_val)
++		goto out;
++	reg_data &= ~E1000_KMRNCTRLSTA_DIAG_NELPBK;
++	ret_val = e1000_write_kmrn_reg(hw, E1000_KMRNCTRLSTA_DIAG_OFFSET,
++				       reg_data);
++out:
++	return;
++}
++
++/**
++ *  e1000_cleanup_led_ich8lan - Restore the default LED operation
++ *  @hw: pointer to the HW structure
++ *
++ *  Return the LED back to the default configuration.
++ **/
++static s32 e1000_cleanup_led_ich8lan(struct e1000_hw *hw)
++{
++	s32 ret_val = E1000_SUCCESS;
++
++	if (hw->phy.type == e1000_phy_ife)
++		ret_val = e1e_wphy(hw, IFE_PHY_SPECIAL_CONTROL_LED, 0);
++	else
++		ew32(LEDCTL, hw->mac.ledctl_default);
++
++	return ret_val;
++}
++
++/**
++ *  e1000_led_on_ich8lan - Turn LED's on
++ *  @hw: pointer to the HW structure
++ *
++ *  Turn on the LED's.
++ **/
++static s32 e1000_led_on_ich8lan(struct e1000_hw *hw)
++{
++	s32 ret_val = E1000_SUCCESS;
++
++	if (hw->phy.type == e1000_phy_ife)
++		ret_val = e1e_wphy(hw, IFE_PHY_SPECIAL_CONTROL_LED,
++				(IFE_PSCL_PROBE_MODE | IFE_PSCL_PROBE_LEDS_ON));
++	else
++		ew32(LEDCTL, hw->mac.ledctl_mode2);
++
++	return ret_val;
++}
++
++/**
++ *  e1000_led_off_ich8lan - Turn LED's off
++ *  @hw: pointer to the HW structure
++ *
++ *  Turn off the LED's.
++ **/
++static s32 e1000_led_off_ich8lan(struct e1000_hw *hw)
++{
++	s32 ret_val = E1000_SUCCESS;
++
++	if (hw->phy.type == e1000_phy_ife)
++		ret_val = e1e_wphy(hw,
++			       IFE_PHY_SPECIAL_CONTROL_LED,
++			       (IFE_PSCL_PROBE_MODE | IFE_PSCL_PROBE_LEDS_OFF));
++	else
++		ew32(LEDCTL, hw->mac.ledctl_mode1);
++
++	return ret_val;
++}
++
++/**
++ *  e1000_clear_hw_cntrs_ich8lan - Clear statistical counters
++ *  @hw: pointer to the HW structure
++ *
++ *  Clears hardware counters specific to the silicon family and calls
++ *  clear_hw_cntrs_generic to clear all general purpose counters.
++ **/
++static void e1000_clear_hw_cntrs_ich8lan(struct e1000_hw *hw)
++{
++	u32 temp;
++
++	e1000_clear_hw_cntrs_base(hw);
++
++	temp = er32(ALGNERRC);
++	temp = er32(RXERRC);
++	temp = er32(TNCRS);
++	temp = er32(CEXTERR);
++	temp = er32(TSCTC);
++	temp = er32(TSCTFC);
++
++	temp = er32(MGTPRC);
++	temp = er32(MGTPDC);
++	temp = er32(MGTPTC);
++
++	temp = er32(IAC);
++	temp = er32(ICRXOC);
++
++}
++
++static struct e1000_mac_operations ich8_mac_ops = {
++	.mng_mode_enab		= E1000_ICH_MNG_IAMT_MODE << E1000_FWSM_MODE_SHIFT,
++	.check_for_link		= e1000_check_for_copper_link,
++	.cleanup_led		= e1000_cleanup_led_ich8lan,
++	.clear_hw_cntrs		= e1000_clear_hw_cntrs_ich8lan,
++	.get_bus_info		= e1000_get_bus_info_ich8lan,
++	.get_link_up_info	= e1000_get_link_up_info_ich8lan,
++	.led_on			= e1000_led_on_ich8lan,
++	.led_off		= e1000_led_off_ich8lan,
++	.mc_addr_list_update	= e1000_mc_addr_list_update_generic,
++	.reset_hw		= e1000_reset_hw_ich8lan,
++	.init_hw		= e1000_init_hw_ich8lan,
++	.setup_link		= e1000_setup_link_ich8lan,
++	.setup_physical_interface= e1000_setup_copper_link_ich8lan,
++};
++
++static struct e1000_phy_operations ich8_phy_ops = {
++	.acquire_phy		= e1000_acquire_swflag_ich8lan,
++	.check_reset_block	= e1000_check_reset_block_ich8lan,
++	.commit_phy		= NULL,
++	.force_speed_duplex	= e1000_phy_force_speed_duplex_ich8lan,
++	.get_cfg_done		= e1000_get_cfg_done,
++	.get_cable_length	= e1000_get_cable_length_igp_2,
++	.get_phy_info		= e1000_get_phy_info_ich8lan,
++	.read_phy_reg		= e1000_read_phy_reg_igp,
++	.release_phy		= e1000_release_swflag_ich8lan,
++	.reset_phy		= e1000_phy_hw_reset_ich8lan,
++	.set_d0_lplu_state	= e1000_set_d0_lplu_state_ich8lan,
++	.set_d3_lplu_state	= e1000_set_d3_lplu_state_ich8lan,
++	.write_phy_reg		= e1000_write_phy_reg_igp,
++};
++
++static struct e1000_nvm_operations ich8_nvm_ops = {
++	.acquire_nvm		= e1000_acquire_swflag_ich8lan,
++	.read_nvm	 	= e1000_read_nvm_ich8lan,
++	.release_nvm		= e1000_release_swflag_ich8lan,
++	.update_nvm		= e1000_update_nvm_checksum_ich8lan,
++	.valid_led_default	= e1000_valid_led_default_ich8lan,
++	.validate_nvm		= e1000_validate_nvm_checksum_ich8lan,
++	.write_nvm		= e1000_write_nvm_ich8lan,
++};
++
++struct e1000_info e1000_ich8_info = {
++	.mac			= e1000_ich8lan,
++	.flags			= FLAG_HAS_WOL
++				  | FLAG_RX_CSUM_ENABLED
++				  | FLAG_HAS_CTRLEXT_ON_LOAD
++				  | FLAG_HAS_AMT
++				  | FLAG_HAS_FLASH
++				  | FLAG_APME_IN_WUC,
++	.pba			= 8,
++	.get_invariants		= e1000_get_invariants_ich8lan,
++	.mac_ops		= &ich8_mac_ops,
++	.phy_ops		= &ich8_phy_ops,
++	.nvm_ops		= &ich8_nvm_ops,
++};
++
++struct e1000_info e1000_ich9_info = {
++	.mac			= e1000_ich9lan,
++	.flags			= FLAG_HAS_JUMBO_FRAMES
++				  | FLAG_HAS_WOL
++				  | FLAG_RX_CSUM_ENABLED
++				  | FLAG_HAS_CTRLEXT_ON_LOAD
++				  | FLAG_HAS_AMT
++				  | FLAG_HAS_ERT
++				  | FLAG_HAS_FLASH
++				  | FLAG_APME_IN_WUC,
++	.pba			= 10,
++	.get_invariants		= e1000_get_invariants_ich8lan,
++	.mac_ops		= &ich8_mac_ops,
++	.phy_ops		= &ich8_phy_ops,
++	.nvm_ops		= &ich8_nvm_ops,
++};
++
+diff --git a/drivers/net/e1000e/lib.c b/drivers/net/e1000e/lib.c
+new file mode 100644
+index 0000000..21c16e0
+--- /dev/null
++++ b/drivers/net/e1000e/lib.c
+@@ -0,0 +1,2528 @@
++/*******************************************************************************
++
++  Intel PRO/1000 Linux driver
++  Copyright(c) 1999 - 2007 Intel Corporation.
++
++  This program is free software; you can redistribute it and/or modify it
++  under the terms and conditions of the GNU General Public License,
++  version 2, as published by the Free Software Foundation.
++
++  This program is distributed in the hope 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.,
++  51 Franklin St - Fifth Floor, Boston, MA 02110-1301 USA.
++
++  The full GNU General Public License is included in this distribution in
++  the file called "COPYING".
++
++  Contact Information:
++  Linux NICS <linux.nics at intel.com>
++  e1000-devel Mailing List <e1000-devel at lists.sourceforge.net>
++  Intel Corporation, 5200 N.E. Elam Young Parkway, Hillsboro, OR 97124-6497
++
++*******************************************************************************/
++
++#include <linux/netdevice.h>
++#include <linux/pci.h>
++
++#include "e1000.h"
++
++enum e1000_mng_mode {
++	e1000_mng_mode_none = 0,
++	e1000_mng_mode_asf,
++	e1000_mng_mode_pt,
++	e1000_mng_mode_ipmi,
++	e1000_mng_mode_host_if_only
++};
++
++#define E1000_FACTPS_MNGCG		0x20000000
++
++#define E1000_IAMT_SIGNATURE		0x544D4149 /* Intel(R) Active Management
++						    * Technology signature */
++
++/**
++ *  e1000_get_bus_info_pcie - Get PCIe bus information
++ *  @hw: pointer to the HW structure
++ *
++ *  Determines and stores the system bus information for a particular
++ *  network interface.  The following bus information is determined and stored:
++ *  bus speed, bus width, type (PCIe), and PCIe function.
++ **/
++s32 e1000_get_bus_info_pcie(struct e1000_hw *hw)
++{
++	struct e1000_bus_info *bus = &hw->bus;
++	struct e1000_adapter *adapter = hw->adapter;
++	u32 status;
++	u16 pcie_link_status, pci_header_type, cap_offset;
++
++	cap_offset = pci_find_capability(adapter->pdev, PCI_CAP_ID_EXP);
++	if (!cap_offset) {
++		bus->width = e1000_bus_width_unknown;
++	} else {
++		pci_read_config_word(adapter->pdev,
++				     cap_offset + PCIE_LINK_STATUS,
++				     &pcie_link_status);
++		bus->width = (enum e1000_bus_width)((pcie_link_status &
++						     PCIE_LINK_WIDTH_MASK) >>
++						    PCIE_LINK_WIDTH_SHIFT);
++	}
++
++	pci_read_config_word(adapter->pdev, PCI_HEADER_TYPE_REGISTER,
++			     &pci_header_type);
++	if (pci_header_type & PCI_HEADER_TYPE_MULTIFUNC) {
++		status = er32(STATUS);
++		bus->func = (status & E1000_STATUS_FUNC_MASK)
++			    >> E1000_STATUS_FUNC_SHIFT;
++	} else {
++		bus->func = 0;
++	}
++
++	return E1000_SUCCESS;
++}
++
++/**
++ *  e1000_write_vfta - Write value to VLAN filter table
++ *  @hw: pointer to the HW structure
++ *  @offset: register offset in VLAN filter table
++ *  @value: register value written to VLAN filter table
++ *
++ *  Writes value at the given offset in the register array which stores
++ *  the VLAN filter table.
++ **/
++void e1000_write_vfta(struct e1000_hw *hw, u32 offset, u32 value)
++{
++	E1000_WRITE_REG_ARRAY(hw, E1000_VFTA, offset, value);
++	e1e_flush();
++}
++
++/**
++ *  e1000_init_rx_addrs - Initialize receive address's
++ *  @hw: pointer to the HW structure
++ *  @rar_count: receive address registers
++ *
++ *  Setups the receive address registers by setting the base receive address
++ *  register to the devices MAC address and clearing all the other receive
++ *  address registers to 0.
++ **/
++void e1000_init_rx_addrs(struct e1000_hw *hw, u16 rar_count)
++{
++	u32 i;
++
++	/* Setup the receive address */
++	hw_dbg(hw, "Programming MAC Address into RAR[0]\n");
++
++	e1000_rar_set(hw, hw->mac.addr, 0);
++
++	/* Zero out the other (rar_entry_count - 1) receive addresses */
++	hw_dbg(hw, "Clearing RAR[1-%u]\n", rar_count-1);
++	for (i = 1; i < rar_count; i++) {
++		E1000_WRITE_REG_ARRAY(hw, E1000_RA, (i << 1), 0);
++		e1e_flush();
++		E1000_WRITE_REG_ARRAY(hw, E1000_RA, ((i << 1) + 1), 0);
++		e1e_flush();
++	}
++}
++
++/**
++ *  e1000_rar_set - Set receive address register
++ *  @hw: pointer to the HW structure
++ *  @addr: pointer to the receive address
++ *  @index: receive address array register
++ *
++ *  Sets the receive address array register at index to the address passed
++ *  in by addr.
++ **/
++void e1000_rar_set(struct e1000_hw *hw, u8 *addr, u32 index)
++{
++	u32 rar_low, rar_high;
++
++	/* HW expects these in little endian so we reverse the byte order
++	 * from network order (big endian) to little endian
++	 */
++	rar_low = ((u32) addr[0] |
++		   ((u32) addr[1] << 8) |
++		    ((u32) addr[2] << 16) | ((u32) addr[3] << 24));
++
++	rar_high = ((u32) addr[4] | ((u32) addr[5] << 8));
++
++	rar_high |= E1000_RAH_AV;
++
++	E1000_WRITE_REG_ARRAY(hw, E1000_RA, (index << 1), rar_low);
++	E1000_WRITE_REG_ARRAY(hw, E1000_RA, ((index << 1) + 1), rar_high);
++}
++
++/**
++ *  e1000_mta_set - Set multicast filter table address
++ *  @hw: pointer to the HW structure
++ *  @hash_value: determines the MTA register and bit to set
++ *
++ *  The multicast table address is a register array of 32-bit registers.
++ *  The hash_value is used to determine what register the bit is in, the
++ *  current value is read, the new bit is OR'd in and the new value is
++ *  written back into the register.
++ **/
++static void e1000_mta_set(struct e1000_hw *hw, u32 hash_value)
++{
++	u32 hash_bit, hash_reg, mta;
++
++	/* The MTA is a register array of 32-bit registers. It is
++	 * treated like an array of (32*mta_reg_count) bits.  We want to
++	 * set bit BitArray[hash_value]. So we figure out what register
++	 * the bit is in, read it, OR in the new bit, then write
++	 * back the new value.  The (hw->mac.mta_reg_count - 1) serves as a
++	 * mask to bits 31:5 of the hash value which gives us the
++	 * register we're modifying.  The hash bit within that register
++	 * is determined by the lower 5 bits of the hash value.
++	 */
++	hash_reg = (hash_value >> 5) & (hw->mac.mta_reg_count - 1);
++	hash_bit = hash_value & 0x1F;
++
++	mta = E1000_READ_REG_ARRAY(hw, E1000_MTA, hash_reg);
++
++	mta |= (1 << hash_bit);
++
++	E1000_WRITE_REG_ARRAY(hw, E1000_MTA, hash_reg, mta);
++	e1e_flush();
++}
++
++/**
++ *  e1000_hash_mc_addr - Generate a multicast hash value
++ *  @hw: pointer to the HW structure
++ *  @mc_addr: pointer to a multicast address
++ *
++ *  Generates a multicast address hash value which is used to determine
++ *  the multicast filter table array address and new table value.  See
++ *  e1000_mta_set_generic()
++ **/
++static u32 e1000_hash_mc_addr(struct e1000_hw *hw, u8 *mc_addr)
++{
++	u32 hash_value, hash_mask;
++	u8 bit_shift = 0;
++
++	/* Register count multiplied by bits per register */
++	hash_mask = (hw->mac.mta_reg_count * 32) - 1;
++
++	/* For a mc_filter_type of 0, bit_shift is the number of left-shifts
++	 * where 0xFF would still fall within the hash mask. */
++	while (hash_mask >> bit_shift != 0xFF)
++		bit_shift++;
++
++	/* The portion of the address that is used for the hash table
++	 * is determined by the mc_filter_type setting.
++	 * The algorithm is such that there is a total of 8 bits of shifting.
++	 * The bit_shift for a mc_filter_type of 0 represents the number of
++	 * left-shifts where the MSB of mc_addr[5] would still fall within
++	 * the hash_mask.  Case 0 does this exactly.  Since there are a total
++	 * of 8 bits of shifting, then mc_addr[4] will shift right the
++	 * remaining number of bits. Thus 8 - bit_shift.  The rest of the
++	 * cases are a variation of this algorithm...essentially raising the
++	 * number of bits to shift mc_addr[5] left, while still keeping the
++	 * 8-bit shifting total.
++	 */
++	/* For example, given the following Destination MAC Address and an
++	 * mta register count of 128 (thus a 4096-bit vector and 0xFFF mask),
++	 * we can see that the bit_shift for case 0 is 4.  These are the hash
++	 * values resulting from each mc_filter_type...
++	 * [0] [1] [2] [3] [4] [5]
++	 * 01  AA  00  12  34  56
++	 * LSB		 MSB
++	 *
++	 * case 0: hash_value = ((0x34 >> 4) | (0x56 << 4)) & 0xFFF = 0x563
++	 * case 1: hash_value = ((0x34 >> 3) | (0x56 << 5)) & 0xFFF = 0xAC6
++	 * case 2: hash_value = ((0x34 >> 2) | (0x56 << 6)) & 0xFFF = 0x163
++	 * case 3: hash_value = ((0x34 >> 0) | (0x56 << 8)) & 0xFFF = 0x634
++	 */
++	switch (hw->mac.mc_filter_type) {
++	default:
++	case 0:
++		break;
++	case 1:
++		bit_shift += 1;
++		break;
++	case 2:
++		bit_shift += 2;
++		break;
++	case 3:
++		bit_shift += 4;
++		break;
++	}
++
++	hash_value = hash_mask & (((mc_addr[4] >> (8 - bit_shift)) |
++				  (((u16) mc_addr[5]) << bit_shift)));
++
++	return hash_value;
++}
++
++/**
++ *  e1000_mc_addr_list_update_generic - Update Multicast addresses
++ *  @hw: pointer to the HW structure
++ *  @mc_addr_list: array of multicast addresses to program
++ *  @mc_addr_count: number of multicast addresses to program
++ *  @rar_used_count: the first RAR register free to program
++ *  @rar_count: total number of supported Receive Address Registers
++ *
++ *  Updates the Receive Address Registers and Multicast Table Array.
++ *  The caller must have a packed mc_addr_list of multicast addresses.
++ *  The parameter rar_count will usually be hw->mac.rar_entry_count
++ *  unless there are workarounds that change this.
++ **/
++void e1000_mc_addr_list_update_generic(struct e1000_hw *hw,
++				       u8 *mc_addr_list, u32 mc_addr_count,
++				       u32 rar_used_count, u32 rar_count)
++{
++	u32 hash_value;
++	u32 i;
++
++	/* Load the first set of multicast addresses into the exact
++	 * filters (RAR).  If there are not enough to fill the RAR
++	 * array, clear the filters.
++	 */
++	for (i = rar_used_count; i < rar_count; i++) {
++		if (mc_addr_count) {
++			e1000_rar_set(hw, mc_addr_list, i);
++			mc_addr_count--;
++			mc_addr_list += ETH_ALEN;
++		} else {
++			E1000_WRITE_REG_ARRAY(hw, E1000_RA, i << 1, 0);
++			e1e_flush();
++			E1000_WRITE_REG_ARRAY(hw, E1000_RA, (i << 1) + 1, 0);
++			e1e_flush();
++		}
++	}
++
++	/* Clear the old settings from the MTA */
++	hw_dbg(hw, "Clearing MTA\n");
++	for (i = 0; i < hw->mac.mta_reg_count; i++) {
++		E1000_WRITE_REG_ARRAY(hw, E1000_MTA, i, 0);
++		e1e_flush();
++	}
++
++	/* Load any remaining multicast addresses into the hash table. */
++	for (; mc_addr_count > 0; mc_addr_count--) {
++		hash_value = e1000_hash_mc_addr(hw, mc_addr_list);
++		hw_dbg(hw, "Hash value = 0x%03X\n", hash_value);
++		e1000_mta_set(hw, hash_value);
++		mc_addr_list += ETH_ALEN;
++	}
++}
++
++/**
++ *  e1000_clear_hw_cntrs_base - Clear base hardware counters
++ *  @hw: pointer to the HW structure
++ *
++ *  Clears the base hardware counters by reading the counter registers.
++ **/
++void e1000_clear_hw_cntrs_base(struct e1000_hw *hw)
++{
++	u32 temp;
++
++	temp = er32(CRCERRS);
++	temp = er32(SYMERRS);
++	temp = er32(MPC);
++	temp = er32(SCC);
++	temp = er32(ECOL);
++	temp = er32(MCC);
++	temp = er32(LATECOL);
++	temp = er32(COLC);
++	temp = er32(DC);
++	temp = er32(SEC);
++	temp = er32(RLEC);
++	temp = er32(XONRXC);
++	temp = er32(XONTXC);
++	temp = er32(XOFFRXC);
++	temp = er32(XOFFTXC);
++	temp = er32(FCRUC);
++	temp = er32(GPRC);
++	temp = er32(BPRC);
++	temp = er32(MPRC);
++	temp = er32(GPTC);
++	temp = er32(GORCL);
++	temp = er32(GORCH);
++	temp = er32(GOTCL);
++	temp = er32(GOTCH);
++	temp = er32(RNBC);
++	temp = er32(RUC);
++	temp = er32(RFC);
++	temp = er32(ROC);
++	temp = er32(RJC);
++	temp = er32(TORL);
++	temp = er32(TORH);
++	temp = er32(TOTL);
++	temp = er32(TOTH);
++	temp = er32(TPR);
++	temp = er32(TPT);
++	temp = er32(MPTC);
++	temp = er32(BPTC);
++}
++
++/**
++ *  e1000_check_for_copper_link - Check for link (Copper)
++ *  @hw: pointer to the HW structure
++ *
++ *  Checks to see of the link status of the hardware has changed.  If a
++ *  change in link status has been detected, then we read the PHY registers
++ *  to get the current speed/duplex if link exists.
++ **/
++s32 e1000_check_for_copper_link(struct e1000_hw *hw)
++{
++	struct e1000_mac_info *mac = &hw->mac;
++	s32 ret_val;
++	bool link;
++
++	/* We only want to go out to the PHY registers to see if Auto-Neg
++	 * has completed and/or if our link status has changed.  The
++	 * get_link_status flag is set upon receiving a Link Status
++	 * Change or Rx Sequence Error interrupt.
++	 */
++	if (!mac->get_link_status) {
++		ret_val = E1000_SUCCESS;
++		goto out;
++	}
++
++	/* First we want to see if the MII Status Register reports
++	 * link.  If so, then we want to get the current speed/duplex
++	 * of the PHY.
++	 */
++	ret_val = e1000_phy_has_link_generic(hw, 1, 0, &link);
++	if (ret_val)
++		goto out;
++
++	if (!link)
++		goto out; /* No link detected */
++
++	mac->get_link_status = 0;
++
++	/* Check if there was DownShift, must be checked
++	 * immediately after link-up */
++	e1000_check_downshift(hw);
++
++	/* If we are forcing speed/duplex, then we simply return since
++	 * we have already determined whether we have link or not.
++	 */
++	if (!mac->autoneg) {
++		ret_val = -E1000_ERR_CONFIG;
++		goto out;
++	}
++
++	/* Auto-Neg is enabled.  Auto Speed Detection takes care
++	 * of MAC speed/duplex configuration.  So we only need to
++	 * configure Collision Distance in the MAC.
++	 */
++	e1000_config_collision_dist(hw);
++
++	/* Configure Flow Control now that Auto-Neg has completed.
++	 * First, we need to restore the desired flow control
++	 * settings because we may have had to re-autoneg with a
++	 * different link partner.
++	 */
++	ret_val = e1000_config_fc_after_link_up(hw);
++	if (ret_val) {
++		hw_dbg(hw, "Error configuring flow control\n");
++	}
++
++out:
++	return ret_val;
++}
++
++/**
++ *  e1000_check_for_fiber_link - Check for link (Fiber)
++ *  @hw: pointer to the HW structure
++ *
++ *  Checks for link up on the hardware.  If link is not up and we have
++ *  a signal, then we need to force link up.
++ **/
++s32 e1000_check_for_fiber_link(struct e1000_hw *hw)
++{
++	struct e1000_mac_info *mac = &hw->mac;
++	u32 rxcw;
++	u32 ctrl;
++	u32 status;
++	s32 ret_val = E1000_SUCCESS;
++
++	ctrl = er32(CTRL);
++	status = er32(STATUS);
++	rxcw = er32(RXCW);
++
++	/* If we don't have link (auto-negotiation failed or link partner
++	 * cannot auto-negotiate), the cable is plugged in (we have signal),
++	 * and our link partner is not trying to auto-negotiate with us (we
++	 * are receiving idles or data), we need to force link up. We also
++	 * need to give auto-negotiation time to complete, in case the cable
++	 * was just plugged in. The autoneg_failed flag does this.
++	 */
++	/* (ctrl & E1000_CTRL_SWDPIN1) == 1 == have signal */
++	if ((ctrl & E1000_CTRL_SWDPIN1) && (!(status & E1000_STATUS_LU)) &&
++	    (!(rxcw & E1000_RXCW_C))) {
++		if (mac->autoneg_failed == 0) {
++			mac->autoneg_failed = 1;
++			goto out;
++		}
++		hw_dbg(hw, "NOT RXing /C/, disable AutoNeg and force link.\n");
++
++		/* Disable auto-negotiation in the TXCW register */
++		ew32(TXCW, (mac->txcw & ~E1000_TXCW_ANE));
++
++		/* Force link-up and also force full-duplex. */
++		ctrl = er32(CTRL);
++		ctrl |= (E1000_CTRL_SLU | E1000_CTRL_FD);
++		ew32(CTRL, ctrl);
++
++		/* Configure Flow Control after forcing link up. */
++		ret_val = e1000_config_fc_after_link_up(hw);
++		if (ret_val) {
++			hw_dbg(hw, "Error configuring flow control\n");
++			goto out;
++		}
++	} else if ((ctrl & E1000_CTRL_SLU) && (rxcw & E1000_RXCW_C)) {
++		/* If we are forcing link and we are receiving /C/ ordered
++		 * sets, re-enable auto-negotiation in the TXCW register
++		 * and disable forced link in the Device Control register
++		 * in an attempt to auto-negotiate with our link partner.
++		 */
++		hw_dbg(hw, "RXing /C/, enable AutoNeg and stop forcing link.\n");
++		ew32(TXCW, mac->txcw);
++		ew32(CTRL, (ctrl & ~E1000_CTRL_SLU));
++
++		mac->serdes_has_link = 1;
++	}
++
++out:
++	return ret_val;
++}
++
++/**
++ *  e1000_check_for_serdes_link - Check for link (Serdes)
++ *  @hw: pointer to the HW structure
++ *
++ *  Checks for link up on the hardware.  If link is not up and we have
++ *  a signal, then we need to force link up.
++ **/
++s32 e1000_check_for_serdes_link(struct e1000_hw *hw)
++{
++	struct e1000_mac_info *mac = &hw->mac;
++	u32 rxcw;
++	u32 ctrl;
++	u32 status;
++	s32 ret_val = E1000_SUCCESS;
++
++	ctrl = er32(CTRL);
++	status = er32(STATUS);
++	rxcw = er32(RXCW);
++
++	/* If we don't have link (auto-negotiation failed or link partner
++	 * cannot auto-negotiate), and our link partner is not trying to
++	 * auto-negotiate with us (we are receiving idles or data),
++	 * we need to force link up. We also need to give auto-negotiation
++	 * time to complete.
++	 */
++	/* (ctrl & E1000_CTRL_SWDPIN1) == 1 == have signal */
++	if ((!(status & E1000_STATUS_LU)) && (!(rxcw & E1000_RXCW_C))) {
++		if (mac->autoneg_failed == 0) {
++			mac->autoneg_failed = 1;
++			goto out;
++		}
++		hw_dbg(hw, "NOT RXing /C/, disable AutoNeg and force link.\n");
++
++		/* Disable auto-negotiation in the TXCW register */
++		ew32(TXCW, (mac->txcw & ~E1000_TXCW_ANE));
++
++		/* Force link-up and also force full-duplex. */
++		ctrl = er32(CTRL);
++		ctrl |= (E1000_CTRL_SLU | E1000_CTRL_FD);
++		ew32(CTRL, ctrl);
++
++		/* Configure Flow Control after forcing link up. */
++		ret_val = e1000_config_fc_after_link_up(hw);
++		if (ret_val) {
++			hw_dbg(hw, "Error configuring flow control\n");
++			goto out;
++		}
++	} else if ((ctrl & E1000_CTRL_SLU) && (rxcw & E1000_RXCW_C)) {
++		/* If we are forcing link and we are receiving /C/ ordered
++		 * sets, re-enable auto-negotiation in the TXCW register
++		 * and disable forced link in the Device Control register
++		 * in an attempt to auto-negotiate with our link partner.
++		 */
++		hw_dbg(hw, "RXing /C/, enable AutoNeg and stop forcing link.\n");
++		ew32(TXCW, mac->txcw);
++		ew32(CTRL, (ctrl & ~E1000_CTRL_SLU));
++
++		mac->serdes_has_link = 1;
++	} else if (!(E1000_TXCW_ANE & er32(TXCW))) {
++		/* If we force link for non-auto-negotiation switch, check
++		 * link status based on MAC synchronization for internal
++		 * serdes media type.
++		 */
++		/* SYNCH bit and IV bit are sticky. */
++		udelay(10);
++		if (E1000_RXCW_SYNCH & er32(RXCW)) {
++			if (!(rxcw & E1000_RXCW_IV)) {
++				mac->serdes_has_link = 1;
++				hw_dbg(hw, "SERDES: Link is up.\n");
++			}
++		} else {
++			mac->serdes_has_link = 0;
++			hw_dbg(hw, "SERDES: Link is down.\n");
++		}
++	}
++
++	if (E1000_TXCW_ANE & er32(TXCW)) {
++		status = er32(STATUS);
++		mac->serdes_has_link = (status & E1000_STATUS_LU);
++	}
++
++out:
++	return ret_val;
++}
++
++/**
++ *  e1000_set_default_fc_generic - Set flow control default values
++ *  @hw: pointer to the HW structure
++ *
++ *  Read the EEPROM for the default values for flow control and store the
++ *  values.
++ **/
++static s32 e1000_set_default_fc_generic(struct e1000_hw *hw)
++{
++	struct e1000_mac_info *mac = &hw->mac;
++	s32 ret_val = E1000_SUCCESS;
++	u16 nvm_data;
++
++	if (mac->fc != e1000_fc_default)
++		goto out;
++
++	/* Read and store word 0x0F of the EEPROM. This word contains bits
++	 * that determine the hardware's default PAUSE (flow control) mode,
++	 * a bit that determines whether the HW defaults to enabling or
++	 * disabling auto-negotiation, and the direction of the
++	 * SW defined pins. If there is no SW over-ride of the flow
++	 * control setting, then the variable hw->fc will
++	 * be initialized based on a value in the EEPROM.
++	 */
++	ret_val = e1000_read_nvm(hw, NVM_INIT_CONTROL2_REG, 1, &nvm_data);
++
++	if (ret_val) {
++		hw_dbg(hw, "NVM Read Error\n");
++		goto out;
++	}
++
++	if ((nvm_data & NVM_WORD0F_PAUSE_MASK) == 0)
++		mac->fc = e1000_fc_none;
++	else if ((nvm_data & NVM_WORD0F_PAUSE_MASK) ==
++		 NVM_WORD0F_ASM_DIR)
++		mac->fc = e1000_fc_tx_pause;
++	else
++		mac->fc = e1000_fc_full;
++
++out:
++	return ret_val;
++}
++
++/**
++ *  e1000_setup_link - Setup flow control and link settings
++ *  @hw: pointer to the HW structure
++ *
++ *  Determines which flow control settings to use, then configures flow
++ *  control.  Calls the appropriate media-specific link configuration
++ *  function.  Assuming the adapter has a valid link partner, a valid link
++ *  should be established.  Assumes the hardware has previously been reset
++ *  and the transmitter and receiver are not enabled.
++ **/
++s32 e1000_setup_link(struct e1000_hw *hw)
++{
++	struct e1000_mac_info *mac = &hw->mac;
++	s32 ret_val = E1000_SUCCESS;
++
++	/* In the case of the phy reset being blocked, we already have a link.
++	 * We do not need to set it up again.
++	 */
++	if (e1000_check_reset_block(hw))
++		goto out;
++
++	ret_val = e1000_set_default_fc_generic(hw);
++	if (ret_val)
++		goto out;
++
++	/* We want to save off the original Flow Control configuration just
++	 * in case we get disconnected and then reconnected into a different
++	 * hub or switch with different Flow Control capabilities.
++	 */
++	mac->original_fc = mac->fc;
++
++	hw_dbg(hw, "After fix-ups FlowControl is now = %x\n", mac->fc);
++
++	/* Call the necessary media_type subroutine to configure the link. */
++	ret_val = mac->ops.setup_physical_interface(hw);
++	if (ret_val)
++		goto out;
++
++	/* Initialize the flow control address, type, and PAUSE timer
++	 * registers to their default values.  This is done even if flow
++	 * control is disabled, because it does not hurt anything to
++	 * initialize these registers.
++	 */
++	hw_dbg(hw, "Initializing the Flow Control address, type and timer regs\n");
++	ew32(FCT, FLOW_CONTROL_TYPE);
++	ew32(FCAH, FLOW_CONTROL_ADDRESS_HIGH);
++	ew32(FCAL, FLOW_CONTROL_ADDRESS_LOW);
++
++	ew32(FCTTV, mac->fc_pause_time);
++
++	ret_val = e1000_set_fc_watermarks(hw);
++
++out:
++	return ret_val;
++}
++
++/**
++ *  e1000_commit_fc_settings_generic - Configure flow control
++ *  @hw: pointer to the HW structure
++ *
++ *  Write the flow control settings to the Transmit Config Word Register (TXCW)
++ *  base on the flow control settings in e1000_mac_info.
++ **/
++static s32 e1000_commit_fc_settings_generic(struct e1000_hw *hw)
++{
++	struct e1000_mac_info *mac = &hw->mac;
++	u32 txcw;
++	s32 ret_val = E1000_SUCCESS;
++
++	/* Check for a software override of the flow control settings, and
++	 * setup the device accordingly.  If auto-negotiation is enabled, then
++	 * software will have to set the "PAUSE" bits to the correct value in
++	 * the Transmit Config Word Register (TXCW) and re-start auto-
++	 * negotiation.  However, if auto-negotiation is disabled, then
++	 * software will have to manually configure the two flow control enable
++	 * bits in the CTRL register.
++	 *
++	 * The possible values of the "fc" parameter are:
++	 *      0:  Flow control is completely disabled
++	 *      1:  Rx flow control is enabled (we can receive pause frames,
++	 *	  but not send pause frames).
++	 *      2:  Tx flow control is enabled (we can send pause frames but we
++	 *	  do not support receiving pause frames).
++	 *      3:  Both Rx and TX flow control (symmetric) are enabled.
++	 */
++	switch (mac->fc) {
++	case e1000_fc_none:
++		/* Flow control completely disabled by a software over-ride. */
++		txcw = (E1000_TXCW_ANE | E1000_TXCW_FD);
++		break;
++	case e1000_fc_rx_pause:
++		/* RX Flow control is enabled and TX Flow control is disabled
++		 * by a software over-ride. Since there really isn't a way to
++		 * advertise that we are capable of RX Pause ONLY, we will
++		 * advertise that we support both symmetric and asymmetric RX
++		 * PAUSE.  Later, we will disable the adapter's ability to send
++		 * PAUSE frames.
++		 */
++		txcw = (E1000_TXCW_ANE | E1000_TXCW_FD | E1000_TXCW_PAUSE_MASK);
++		break;
++	case e1000_fc_tx_pause:
++		/* TX Flow control is enabled, and RX Flow control is disabled,
++		 * by a software over-ride.
++		 */
++		txcw = (E1000_TXCW_ANE | E1000_TXCW_FD | E1000_TXCW_ASM_DIR);
++		break;
++	case e1000_fc_full:
++		/* Flow control (both RX and TX) is enabled by a software
++		 * over-ride.
++		 */
++		txcw = (E1000_TXCW_ANE | E1000_TXCW_FD | E1000_TXCW_PAUSE_MASK);
++		break;
++	default:
++		hw_dbg(hw, "Flow control param set incorrectly\n");
++		ret_val = -E1000_ERR_CONFIG;
++		goto out;
++		break;
++	}
++
++	ew32(TXCW, txcw);
++	mac->txcw = txcw;
++
++out:
++	return ret_val;
++}
++
++/**
++ *  e1000_poll_fiber_serdes_link_generic - Poll for link up
++ *  @hw: pointer to the HW structure
++ *
++ *  Polls for link up by reading the status register, if link fails to come
++ *  up with auto-negotiation, then the link is forced if a signal is detected.
++ **/
++static s32 e1000_poll_fiber_serdes_link_generic(struct e1000_hw *hw)
++{
++	struct e1000_mac_info *mac = &hw->mac;
++	u32 i, status;
++	s32 ret_val = E1000_SUCCESS;
++
++	/* If we have a signal (the cable is plugged in, or assumed true for
++	 * serdes media) then poll for a "Link-Up" indication in the Device
++	 * Status Register.  Time-out if a link isn't seen in 500 milliseconds
++	 * seconds (Auto-negotiation should complete in less than 500
++	 * milliseconds even if the other end is doing it in SW).
++	 */
++	for (i = 0; i < FIBER_LINK_UP_LIMIT; i++) {
++		msleep(10);
++		status = er32(STATUS);
++		if (status & E1000_STATUS_LU)
++			break;
++	}
++	if (i == FIBER_LINK_UP_LIMIT) {
++		hw_dbg(hw, "Never got a valid link from auto-neg!!!\n");
++		mac->autoneg_failed = 1;
++		/* AutoNeg failed to achieve a link, so we'll call
++		 * mac->check_for_link. This routine will force the
++		 * link up if we detect a signal. This will allow us to
++		 * communicate with non-autonegotiating link partners.
++		 */
++		ret_val = mac->ops.check_for_link(hw);
++		if (ret_val) {
++			hw_dbg(hw, "Error while checking for link\n");
++			goto out;
++		}
++		mac->autoneg_failed = 0;
++	} else {
++		mac->autoneg_failed = 0;
++		hw_dbg(hw, "Valid Link Found\n");
++	}
++
++out:
++	return ret_val;
++}
++
++/**
++ *  e1000_setup_fiber_serdes_link - Setup link for fiber/serdes
++ *  @hw: pointer to the HW structure
++ *
++ *  Configures collision distance and flow control for fiber and serdes
++ *  links.  Upon successful setup, poll for link.
++ **/
++s32 e1000_setup_fiber_serdes_link(struct e1000_hw *hw)
++{
++	u32 ctrl;
++	s32 ret_val = E1000_SUCCESS;
++
++	ctrl = er32(CTRL);
++
++	/* Take the link out of reset */
++	ctrl &= ~E1000_CTRL_LRST;
++
++	e1000_config_collision_dist(hw);
++
++	ret_val = e1000_commit_fc_settings_generic(hw);
++	if (ret_val)
++		goto out;
++
++	/* Since auto-negotiation is enabled, take the link out of reset (the
++	 * link will be in reset, because we previously reset the chip). This
++	 * will restart auto-negotiation.  If auto-negotiation is successful
++	 * then the link-up status bit will be set and the flow control enable
++	 * bits (RFCE and TFCE) will be set according to their negotiated value.
++	 */
++	hw_dbg(hw, "Auto-negotiation enabled\n");
++
++	ew32(CTRL, ctrl);
++	e1e_flush();
++	msleep(1);
++
++	/* For these adapters, the SW defineable pin 1 is set when the optics
++	 * detect a signal.  If we have a signal, then poll for a "Link-Up"
++	 * indication.
++	 */
++	if (hw->media_type == e1000_media_type_internal_serdes ||
++	    (er32(CTRL) & E1000_CTRL_SWDPIN1)) {
++		ret_val = e1000_poll_fiber_serdes_link_generic(hw);
++	} else {
++		hw_dbg(hw, "No signal detected\n");
++	}
++
++out:
++	return ret_val;
++}
++
++/**
++ *  e1000_config_collision_dist - Configure collision distance
++ *  @hw: pointer to the HW structure
++ *
++ *  Configures the collision distance to the default value and is used
++ *  during link setup. Currently no func pointer exists and all
++ *  implementations are handled in the generic version of this function.
++ **/
++void e1000_config_collision_dist(struct e1000_hw *hw)
++{
++	u32 tctl;
++
++	tctl = er32(TCTL);
++
++	tctl &= ~E1000_TCTL_COLD;
++	tctl |= E1000_COLLISION_DISTANCE << E1000_COLD_SHIFT;
++
++	ew32(TCTL, tctl);
++	e1e_flush();
++}
++
++/**
++ *  e1000_set_fc_watermarks - Set flow control high/low watermarks
++ *  @hw: pointer to the HW structure
++ *
++ *  Sets the flow control high/low threshold (watermark) registers.  If
++ *  flow control XON frame transmission is enabled, then set XON frame
++ *  tansmission as well.
++ **/
++s32 e1000_set_fc_watermarks(struct e1000_hw *hw)
++{
++	struct e1000_mac_info *mac = &hw->mac;
++	s32 ret_val = E1000_SUCCESS;
++	u32 fcrtl = 0, fcrth = 0;
++
++	/* Set the flow control receive threshold registers.  Normally,
++	 * these registers will be set to a default threshold that may be
++	 * adjusted later by the driver's runtime code.  However, if the
++	 * ability to transmit pause frames is not enabled, then these
++	 * registers will be set to 0.
++	 */
++	if (mac->fc & e1000_fc_tx_pause) {
++		/* We need to set up the Receive Threshold high and low water
++		 * marks as well as (optionally) enabling the transmission of
++		 * XON frames.
++		 */
++		fcrtl = mac->fc_low_water;
++		fcrtl |= E1000_FCRTL_XONE;
++
++		fcrth = mac->fc_high_water;
++	}
++	ew32(FCRTL, fcrtl);
++	ew32(FCRTH, fcrth);
++
++	return ret_val;
++}
++
++/**
++ *  e1000_force_mac_fc - Force the MAC's flow control settings
++ *  @hw: pointer to the HW structure
++ *
++ *  Force the MAC's flow control settings.  Sets the TFCE and RFCE bits in the
++ *  device control register to reflect the adapter settings.  TFCE and RFCE
++ *  need to be explicitly set by software when a copper PHY is used because
++ *  autonegotiation is managed by the PHY rather than the MAC.  Software must
++ *  also configure these bits when link is forced on a fiber connection.
++ **/
++s32 e1000_force_mac_fc(struct e1000_hw *hw)
++{
++	struct e1000_mac_info *mac = &hw->mac;
++	u32 ctrl;
++	s32 ret_val = E1000_SUCCESS;
++
++	ctrl = er32(CTRL);
++
++	/* Because we didn't get link via the internal auto-negotiation
++	 * mechanism (we either forced link or we got link via PHY
++	 * auto-neg), we have to manually enable/disable transmit an
++	 * receive flow control.
++	 *
++	 * The "Case" statement below enables/disable flow control
++	 * according to the "mac->fc" parameter.
++	 *
++	 * The possible values of the "fc" parameter are:
++	 *      0:  Flow control is completely disabled
++	 *      1:  Rx flow control is enabled (we can receive pause
++	 *	  frames but not send pause frames).
++	 *      2:  Tx flow control is enabled (we can send pause frames
++	 *	  frames but we do not receive pause frames).
++	 *      3:  Both Rx and TX flow control (symmetric) is enabled.
++	 *  other:  No other values should be possible at this point.
++	 */
++	hw_dbg(hw, "mac->fc = %u\n", mac->fc);
++
++	switch (mac->fc) {
++	case e1000_fc_none:
++		ctrl &= (~(E1000_CTRL_TFCE | E1000_CTRL_RFCE));
++		break;
++	case e1000_fc_rx_pause:
++		ctrl &= (~E1000_CTRL_TFCE);
++		ctrl |= E1000_CTRL_RFCE;
++		break;
++	case e1000_fc_tx_pause:
++		ctrl &= (~E1000_CTRL_RFCE);
++		ctrl |= E1000_CTRL_TFCE;
++		break;
++	case e1000_fc_full:
++		ctrl |= (E1000_CTRL_TFCE | E1000_CTRL_RFCE);
++		break;
++	default:
++		hw_dbg(hw, "Flow control param set incorrectly\n");
++		ret_val = -E1000_ERR_CONFIG;
++		goto out;
++	}
++
++	ew32(CTRL, ctrl);
++
++out:
++	return ret_val;
++}
++
++/**
++ *  e1000_config_fc_after_link_up - Configures flow control after link
++ *  @hw: pointer to the HW structure
++ *
++ *  Checks the status of auto-negotiation after link up to ensure that the
++ *  speed and duplex were not forced.  If the link needed to be forced, then
++ *  flow control needs to be forced also.  If auto-negotiation is enabled
++ *  and did not fail, then we configure flow control based on our link
++ *  partner.
++ **/
++s32 e1000_config_fc_after_link_up(struct e1000_hw *hw)
++{
++	struct e1000_mac_info *mac = &hw->mac;
++	s32 ret_val = E1000_SUCCESS;
++	u16 mii_status_reg, mii_nway_adv_reg, mii_nway_lp_ability_reg;
++	u16 speed, duplex;
++
++	/* Check for the case where we have fiber media and auto-neg failed
++	 * so we had to force link.  In this case, we need to force the
++	 * configuration of the MAC to match the "fc" parameter.
++	 */
++	if (mac->autoneg_failed) {
++		if (hw->media_type == e1000_media_type_fiber ||
++		    hw->media_type == e1000_media_type_internal_serdes)
++			ret_val = e1000_force_mac_fc(hw);
++	} else {
++		if (hw->media_type == e1000_media_type_copper)
++			ret_val = e1000_force_mac_fc(hw);
++	}
++
++	if (ret_val) {
++		hw_dbg(hw, "Error forcing flow control settings\n");
++		goto out;
++	}
++
++	/* Check for the case where we have copper media and auto-neg is
++	 * enabled.  In this case, we need to check and see if Auto-Neg
++	 * has completed, and if so, how the PHY and link partner has
++	 * flow control configured.
++	 */
++	if ((hw->media_type == e1000_media_type_copper) && mac->autoneg) {
++		/* Read the MII Status Register and check to see if AutoNeg
++		 * has completed.  We read this twice because this reg has
++		 * some "sticky" (latched) bits.
++		 */
++		ret_val = e1e_rphy(hw, PHY_STATUS, &mii_status_reg);
++		if (ret_val)
++			goto out;
++		ret_val = e1e_rphy(hw, PHY_STATUS, &mii_status_reg);
++		if (ret_val)
++			goto out;
++
++		if (!(mii_status_reg & MII_SR_AUTONEG_COMPLETE)) {
++			hw_dbg(hw, "Copper PHY and Auto Neg "
++				 "has not completed.\n");
++			goto out;
++		}
++
++		/* The AutoNeg process has completed, so we now need to
++		 * read both the Auto Negotiation Advertisement
++		 * Register (Address 4) and the Auto_Negotiation Base
++		 * Page Ability Register (Address 5) to determine how
++		 * flow control was negotiated.
++		 */
++		ret_val = e1e_rphy(hw, PHY_AUTONEG_ADV, &mii_nway_adv_reg);
++		if (ret_val)
++			goto out;
++		ret_val = e1e_rphy(hw, PHY_LP_ABILITY, &mii_nway_lp_ability_reg);
++		if (ret_val)
++			goto out;
++
++		/* Two bits in the Auto Negotiation Advertisement Register
++		 * (Address 4) and two bits in the Auto Negotiation Base
++		 * Page Ability Register (Address 5) determine flow control
++		 * for both the PHY and the link partner.  The following
++		 * table, taken out of the IEEE 802.3ab/D6.0 dated March 25,
++		 * 1999, describes these PAUSE resolution bits and how flow
++		 * control is determined based upon these settings.
++		 * NOTE:  DC = Don't Care
++		 *
++		 *   LOCAL DEVICE  |   LINK PARTNER
++		 * PAUSE | ASM_DIR | PAUSE | ASM_DIR | NIC Resolution
++		 *-------|---------|-------|---------|--------------------
++		 *   0   |    0    |  DC   |   DC    | e1000_fc_none
++		 *   0   |    1    |   0   |   DC    | e1000_fc_none
++		 *   0   |    1    |   1   |    0    | e1000_fc_none
++		 *   0   |    1    |   1   |    1    | e1000_fc_tx_pause
++		 *   1   |    0    |   0   |   DC    | e1000_fc_none
++		 *   1   |   DC    |   1   |   DC    | e1000_fc_full
++		 *   1   |    1    |   0   |    0    | e1000_fc_none
++		 *   1   |    1    |   0   |    1    | e1000_fc_rx_pause
++		 *
++		 */
++		/* Are both PAUSE bits set to 1?  If so, this implies
++		 * Symmetric Flow Control is enabled at both ends.  The
++		 * ASM_DIR bits are irrelevant per the spec.
++		 *
++		 * For Symmetric Flow Control:
++		 *
++		 *   LOCAL DEVICE  |   LINK PARTNER
++		 * PAUSE | ASM_DIR | PAUSE | ASM_DIR | Result
++		 *-------|---------|-------|---------|--------------------
++		 *   1   |   DC    |   1   |   DC    | E1000_fc_full
++		 *
++		 */
++		if ((mii_nway_adv_reg & NWAY_AR_PAUSE) &&
++		    (mii_nway_lp_ability_reg & NWAY_LPAR_PAUSE)) {
++			/* Now we need to check if the user selected RX ONLY
++			 * of pause frames.  In this case, we had to advertise
++			 * FULL flow control because we could not advertise RX
++			 * ONLY. Hence, we must now check to see if we need to
++			 * turn OFF  the TRANSMISSION of PAUSE frames.
++			 */
++			if (mac->original_fc == e1000_fc_full) {
++				mac->fc = e1000_fc_full;
++				hw_dbg(hw, "Flow Control = FULL.\r\n");
++			} else {
++				mac->fc = e1000_fc_rx_pause;
++				hw_dbg(hw, "Flow Control = "
++					 "RX PAUSE frames only.\r\n");
++			}
++		}
++		/* For receiving PAUSE frames ONLY.
++		 *
++		 *   LOCAL DEVICE  |   LINK PARTNER
++		 * PAUSE | ASM_DIR | PAUSE | ASM_DIR | Result
++		 *-------|---------|-------|---------|--------------------
++		 *   0   |    1    |   1   |    1    | e1000_fc_tx_pause
++		 *
++		 */
++		else if (!(mii_nway_adv_reg & NWAY_AR_PAUSE) &&
++			  (mii_nway_adv_reg & NWAY_AR_ASM_DIR) &&
++			  (mii_nway_lp_ability_reg & NWAY_LPAR_PAUSE) &&
++			  (mii_nway_lp_ability_reg & NWAY_LPAR_ASM_DIR)) {
++			mac->fc = e1000_fc_tx_pause;
++			hw_dbg(hw, "Flow Control = TX PAUSE frames only.\r\n");
++		}
++		/* For transmitting PAUSE frames ONLY.
++		 *
++		 *   LOCAL DEVICE  |   LINK PARTNER
++		 * PAUSE | ASM_DIR | PAUSE | ASM_DIR | Result
++		 *-------|---------|-------|---------|--------------------
++		 *   1   |    1    |   0   |    1    | e1000_fc_rx_pause
++		 *
++		 */
++		else if ((mii_nway_adv_reg & NWAY_AR_PAUSE) &&
++			 (mii_nway_adv_reg & NWAY_AR_ASM_DIR) &&
++			 !(mii_nway_lp_ability_reg & NWAY_LPAR_PAUSE) &&
++			 (mii_nway_lp_ability_reg & NWAY_LPAR_ASM_DIR)) {
++			mac->fc = e1000_fc_rx_pause;
++			hw_dbg(hw, "Flow Control = RX PAUSE frames only.\r\n");
++		}
++		/* Per the IEEE spec, at this point flow control should be
++		 * disabled.  However, we want to consider that we could
++		 * be connected to a legacy switch that doesn't advertise
++		 * desired flow control, but can be forced on the link
++		 * partner.  So if we advertised no flow control, that is
++		 * what we will resolve to.  If we advertised some kind of
++		 * receive capability (Rx Pause Only or Full Flow Control)
++		 * and the link partner advertised none, we will configure
++		 * ourselves to enable Rx Flow Control only.  We can do
++		 * this safely for two reasons:  If the link partner really
++		 * didn't want flow control enabled, and we enable Rx, no
++		 * harm done since we won't be receiving any PAUSE frames
++		 * anyway.  If the intent on the link partner was to have
++		 * flow control enabled, then by us enabling RX only, we
++		 * can at least receive pause frames and process them.
++		 * This is a good idea because in most cases, since we are
++		 * predominantly a server NIC, more times than not we will
++		 * be asked to delay transmission of packets than asking
++		 * our link partner to pause transmission of frames.
++		 */
++		else if ((mac->original_fc == e1000_fc_none) ||
++			 (mac->original_fc == e1000_fc_tx_pause)) {
++			mac->fc = e1000_fc_none;
++			hw_dbg(hw, "Flow Control = NONE.\r\n");
++		} else {
++			mac->fc = e1000_fc_rx_pause;
++			hw_dbg(hw, "Flow Control = RX PAUSE frames only.\r\n");
++		}
++
++		/* Now we need to do one last check...  If we auto-
++		 * negotiated to HALF DUPLEX, flow control should not be
++		 * enabled per IEEE 802.3 spec.
++		 */
++		ret_val = mac->ops.get_link_up_info(hw, &speed, &duplex);
++		if (ret_val) {
++			hw_dbg(hw, "Error getting link speed and duplex\n");
++			goto out;
++		}
++
++		if (duplex == HALF_DUPLEX)
++			mac->fc = e1000_fc_none;
++
++		/* Now we call a subroutine to actually force the MAC
++		 * controller to use the correct flow control settings.
++		 */
++		ret_val = e1000_force_mac_fc(hw);
++		if (ret_val) {
++			hw_dbg(hw, "Error forcing flow control settings\n");
++			goto out;
++		}
++	}
++
++out:
++	return ret_val;
++}
++
++/**
++ *  e1000_get_speed_and_duplex_copper - Retreive current speed/duplex
++ *  @hw: pointer to the HW structure
++ *  @speed: stores the current speed
++ *  @duplex: stores the current duplex
++ *
++ *  Read the status register for the current speed/duplex and store the current
++ *  speed and duplex for copper connections.
++ **/
++s32 e1000_get_speed_and_duplex_copper(struct e1000_hw *hw, u16 *speed, u16 *duplex)
++{
++	u32 status;
++
++	status = er32(STATUS);
++	if (status & E1000_STATUS_SPEED_1000) {
++		*speed = SPEED_1000;
++		hw_dbg(hw, "1000 Mbs, ");
++	} else if (status & E1000_STATUS_SPEED_100) {
++		*speed = SPEED_100;
++		hw_dbg(hw, "100 Mbs, ");
++	} else {
++		*speed = SPEED_10;
++		hw_dbg(hw, "10 Mbs, ");
++	}
++
++	if (status & E1000_STATUS_FD) {
++		*duplex = FULL_DUPLEX;
++		hw_dbg(hw, "Full Duplex\n");
++	} else {
++		*duplex = HALF_DUPLEX;
++		hw_dbg(hw, "Half Duplex\n");
++	}
++
++	return E1000_SUCCESS;
++}
++
++/**
++ *  e1000_get_speed_and_duplex_fiber_serdes - Retreive current speed/duplex
++ *  @hw: pointer to the HW structure
++ *  @speed: stores the current speed
++ *  @duplex: stores the current duplex
++ *
++ *  Sets the speed and duplex to gigabit full duplex (the only possible option)
++ *  for fiber/serdes links.
++ **/
++s32 e1000_get_speed_and_duplex_fiber_serdes(struct e1000_hw *hw, u16 *speed, u16 *duplex)
++{
++	*speed = SPEED_1000;
++	*duplex = FULL_DUPLEX;
++
++	return E1000_SUCCESS;
++}
++
++/**
++ *  e1000_get_hw_semaphore - Acquire hardware semaphore
++ *  @hw: pointer to the HW structure
++ *
++ *  Acquire the HW semaphore to access the PHY or NVM
++ **/
++s32 e1000_get_hw_semaphore(struct e1000_hw *hw)
++{
++	u32 swsm;
++	s32 ret_val = E1000_SUCCESS;
++	s32 timeout = hw->nvm.word_size + 1;
++	s32 i = 0;
++
++	/* Get the SW semaphore */
++	while (i < timeout) {
++		swsm = er32(SWSM);
++		if (!(swsm & E1000_SWSM_SMBI))
++			break;
++
++		udelay(50);
++		i++;
++	}
++
++	if (i == timeout) {
++		hw_dbg(hw, "Driver can't access device - SMBI bit is set.\n");
++		ret_val = -E1000_ERR_NVM;
++		goto out;
++	}
++
++	/* Get the FW semaphore. */
++	for (i = 0; i < timeout; i++) {
++		swsm = er32(SWSM);
++		ew32(SWSM, swsm | E1000_SWSM_SWESMBI);
++
++		/* Semaphore acquired if bit latched */
++		if (er32(SWSM) & E1000_SWSM_SWESMBI)
++			break;
++
++		udelay(50);
++	}
++
++	if (i == timeout) {
++		/* Release semaphores */
++		e1000_put_hw_semaphore(hw);
++		hw_dbg(hw, "Driver can't access the NVM\n");
++		ret_val = -E1000_ERR_NVM;
++		goto out;
++	}
++
++out:
++	return ret_val;
++}
++
++/**
++ *  e1000_put_hw_semaphore - Release hardware semaphore
++ *  @hw: pointer to the HW structure
++ *
++ *  Release hardware semaphore used to access the PHY or NVM
++ **/
++void e1000_put_hw_semaphore(struct e1000_hw *hw)
++{
++	u32 swsm;
++
++	swsm = er32(SWSM);
++
++	swsm &= ~(E1000_SWSM_SMBI | E1000_SWSM_SWESMBI);
++
++	ew32(SWSM, swsm);
++}
++
++/**
++ *  e1000_get_auto_rd_done - Check for auto read completion
++ *  @hw: pointer to the HW structure
++ *
++ *  Check EEPROM for Auto Read done bit.
++ **/
++s32 e1000_get_auto_rd_done(struct e1000_hw *hw)
++{
++	s32 i = 0;
++	s32 ret_val = E1000_SUCCESS;
++
++	while (i < AUTO_READ_DONE_TIMEOUT) {
++		if (er32(EECD) & E1000_EECD_AUTO_RD)
++			break;
++		msleep(1);
++		i++;
++	}
++
++	if (i == AUTO_READ_DONE_TIMEOUT) {
++		hw_dbg(hw, "Auto read by HW from NVM has not completed.\n");
++		ret_val = -E1000_ERR_RESET;
++		goto out;
++	}
++
++out:
++	return ret_val;
++}
++
++/**
++ *  e1000_valid_led_default - Verify a valid default LED config
++ *  @hw: pointer to the HW structure
++ *  @data: pointer to the NVM (EEPROM)
++ *
++ *  Read the EEPROM for the current default LED configuration.  If the
++ *  LED configuration is not valid, set to a valid LED configuration.
++ **/
++s32 e1000_valid_led_default(struct e1000_hw *hw, u16 *data)
++{
++	s32 ret_val;
++
++	ret_val = e1000_read_nvm(hw, NVM_ID_LED_SETTINGS, 1, data);
++	if (ret_val) {
++		hw_dbg(hw, "NVM Read Error\n");
++		goto out;
++	}
++
++	if (*data == ID_LED_RESERVED_0000 || *data == ID_LED_RESERVED_FFFF)
++		*data = ID_LED_DEFAULT;
++
++out:
++	return ret_val;
++}
++
++/**
++ *  e1000_id_led_init -
++ *  @hw: pointer to the HW structure
++ *
++ **/
++s32 e1000_id_led_init(struct e1000_hw *hw)
++{
++	struct e1000_mac_info *mac = &hw->mac;
++	s32 ret_val;
++	const u32 ledctl_mask = 0x000000FF;
++	const u32 ledctl_on = E1000_LEDCTL_MODE_LED_ON;
++	const u32 ledctl_off = E1000_LEDCTL_MODE_LED_OFF;
++	u16 data, i, temp;
++	const u16 led_mask = 0x0F;
++
++	ret_val = hw->nvm.ops.valid_led_default(hw, &data);
++	if (ret_val)
++		goto out;
++
++	mac->ledctl_default = er32(LEDCTL);
++	mac->ledctl_mode1 = mac->ledctl_default;
++	mac->ledctl_mode2 = mac->ledctl_default;
++
++	for (i = 0; i < 4; i++) {
++		temp = (data >> (i << 2)) & led_mask;
++		switch (temp) {
++		case ID_LED_ON1_DEF2:
++		case ID_LED_ON1_ON2:
++		case ID_LED_ON1_OFF2:
++			mac->ledctl_mode1 &= ~(ledctl_mask << (i << 3));
++			mac->ledctl_mode1 |= ledctl_on << (i << 3);
++			break;
++		case ID_LED_OFF1_DEF2:
++		case ID_LED_OFF1_ON2:
++		case ID_LED_OFF1_OFF2:
++			mac->ledctl_mode1 &= ~(ledctl_mask << (i << 3));
++			mac->ledctl_mode1 |= ledctl_off << (i << 3);
++			break;
++		default:
++			/* Do nothing */
++			break;
++		}
++		switch (temp) {
++		case ID_LED_DEF1_ON2:
++		case ID_LED_ON1_ON2:
++		case ID_LED_OFF1_ON2:
++			mac->ledctl_mode2 &= ~(ledctl_mask << (i << 3));
++			mac->ledctl_mode2 |= ledctl_on << (i << 3);
++			break;
++		case ID_LED_DEF1_OFF2:
++		case ID_LED_ON1_OFF2:
++		case ID_LED_OFF1_OFF2:
++			mac->ledctl_mode2 &= ~(ledctl_mask << (i << 3));
++			mac->ledctl_mode2 |= ledctl_off << (i << 3);
++			break;
++		default:
++			/* Do nothing */
++			break;
++		}
++	}
++
++out:
++	return ret_val;
++}
++
++/**
++ *  e1000_cleanup_led_generic - Set LED config to default operation
++ *  @hw: pointer to the HW structure
++ *
++ *  Remove the current LED configuration and set the LED configuration
++ *  to the default value, saved from the EEPROM.
++ **/
++s32 e1000_cleanup_led_generic(struct e1000_hw *hw)
++{
++	ew32(LEDCTL, hw->mac.ledctl_default);
++
++	return E1000_SUCCESS;
++}
++
++/**
++ *  e1000_blink_led - Blink LED
++ *  @hw: pointer to the HW structure
++ *
++ *  Blink the led's which are set to be on.
++ **/
++s32 e1000_blink_led(struct e1000_hw *hw)
++{
++	u32 ledctl_blink = 0;
++	u32 i;
++
++	if (hw->media_type == e1000_media_type_fiber) {
++		/* always blink LED0 for PCI-E fiber */
++		ledctl_blink = E1000_LEDCTL_LED0_BLINK |
++		     (E1000_LEDCTL_MODE_LED_ON << E1000_LEDCTL_LED0_MODE_SHIFT);
++	} else {
++		/* set the blink bit for each LED that's "on" (0x0E)
++		 * in ledctl_mode2 */
++		ledctl_blink = hw->mac.ledctl_mode2;
++		for (i = 0; i < 4; i++)
++			if (((hw->mac.ledctl_mode2 >> (i * 8)) & 0xFF) ==
++			    E1000_LEDCTL_MODE_LED_ON)
++				ledctl_blink |= (E1000_LEDCTL_LED0_BLINK <<
++						 (i * 8));
++	}
++
++	ew32(LEDCTL, ledctl_blink);
++
++	return E1000_SUCCESS;
++}
++
++/**
++ *  e1000_led_on_generic - Turn LED on
++ *  @hw: pointer to the HW structure
++ *
++ *  Turn LED on.
++ **/
++s32 e1000_led_on_generic(struct e1000_hw *hw)
++{
++	u32 ctrl;
++
++	switch (hw->media_type) {
++	case e1000_media_type_fiber:
++		ctrl = er32(CTRL);
++		ctrl &= ~E1000_CTRL_SWDPIN0;
++		ctrl |= E1000_CTRL_SWDPIO0;
++		ew32(CTRL, ctrl);
++		break;
++	case e1000_media_type_copper:
++		ew32(LEDCTL, hw->mac.ledctl_mode2);
++		break;
++	default:
++		break;
++	}
++
++	return E1000_SUCCESS;
++}
++
++/**
++ *  e1000_led_off_generic - Turn LED off
++ *  @hw: pointer to the HW structure
++ *
++ *  Turn LED off.
++ **/
++s32 e1000_led_off_generic(struct e1000_hw *hw)
++{
++	u32 ctrl;
++
++	switch (hw->media_type) {
++	case e1000_media_type_fiber:
++		ctrl = er32(CTRL);
++		ctrl |= E1000_CTRL_SWDPIN0;
++		ctrl |= E1000_CTRL_SWDPIO0;
++		ew32(CTRL, ctrl);
++		break;
++	case e1000_media_type_copper:
++		ew32(LEDCTL, hw->mac.ledctl_mode1);
++		break;
++	default:
++		break;
++	}
++
++	return E1000_SUCCESS;
++}
++
++/**
++ *  e1000_set_pcie_no_snoop - Set PCI-express capabilities
++ *  @hw: pointer to the HW structure
++ *  @no_snoop: bitmap of snoop events
++ *
++ *  Set the PCI-express register to snoop for events enabled in 'no_snoop'.
++ **/
++void e1000_set_pcie_no_snoop(struct e1000_hw *hw, u32 no_snoop)
++{
++	u32 gcr;
++
++	if (no_snoop) {
++		gcr = er32(GCR);
++		gcr &= ~(PCIE_NO_SNOOP_ALL);
++		gcr |= no_snoop;
++		ew32(GCR, gcr);
++	}
++}
++
++/**
++ *  e1000_disable_pcie_master - Disables PCI-express master access
++ *  @hw: pointer to the HW structure
++ *
++ *  Returns 0 (E1000_SUCCESS) if successful, else returns -10
++ *  (-E1000_ERR_MASTER_REQUESTS_PENDING) if master disable bit has not casued
++ *  the master requests to be disabled.
++ *
++ *  Disables PCI-Express master access and verifies there are no pending
++ *  requests.
++ **/
++s32 e1000_disable_pcie_master(struct e1000_hw *hw)
++{
++	u32 ctrl;
++	s32 timeout = MASTER_DISABLE_TIMEOUT;
++	s32 ret_val = E1000_SUCCESS;
++
++	ctrl = er32(CTRL);
++	ctrl |= E1000_CTRL_GIO_MASTER_DISABLE;
++	ew32(CTRL, ctrl);
++
++	while (timeout) {
++		if (!(er32(STATUS) &
++		      E1000_STATUS_GIO_MASTER_ENABLE))
++			break;
++		udelay(100);
++		timeout--;
++	}
++
++	if (!timeout) {
++		hw_dbg(hw, "Master requests are pending.\n");
++		ret_val = -E1000_ERR_MASTER_REQUESTS_PENDING;
++		goto out;
++	}
++
++out:
++	return ret_val;
++}
++
++/**
++ *  e1000_reset_adaptive - Reset Adaptive Interframe Spacing
++ *  @hw: pointer to the HW structure
++ *
++ *  Reset the Adaptive Interframe Spacing throttle to default values.
++ **/
++void e1000_reset_adaptive(struct e1000_hw *hw)
++{
++	struct e1000_mac_info *mac = &hw->mac;
++
++	mac->current_ifs_val = 0;
++	mac->ifs_min_val = IFS_MIN;
++	mac->ifs_max_val = IFS_MAX;
++	mac->ifs_step_size = IFS_STEP;
++	mac->ifs_ratio = IFS_RATIO;
++
++	mac->in_ifs_mode = 0;
++	ew32(AIT, 0);
++}
++
++/**
++ *  e1000_update_adaptive - Update Adaptive Interframe Spacing
++ *  @hw: pointer to the HW structure
++ *
++ *  Update the Adaptive Interframe Spacing Throttle value based on the
++ *  time between transmitted packets and time between collisions.
++ **/
++void e1000_update_adaptive(struct e1000_hw *hw)
++{
++	struct e1000_mac_info *mac = &hw->mac;
++
++	if ((mac->collision_delta * mac->ifs_ratio) > mac->tx_packet_delta) {
++		if (mac->tx_packet_delta > MIN_NUM_XMITS) {
++			mac->in_ifs_mode = 1;
++			if (mac->current_ifs_val < mac->ifs_max_val) {
++				if (!mac->current_ifs_val)
++					mac->current_ifs_val = mac->ifs_min_val;
++				else
++					mac->current_ifs_val +=
++						mac->ifs_step_size;
++				ew32(AIT,
++						mac->current_ifs_val);
++			}
++		}
++	} else {
++		if (mac->in_ifs_mode &&
++		    (mac->tx_packet_delta <= MIN_NUM_XMITS)) {
++			mac->current_ifs_val = 0;
++			mac->in_ifs_mode = 0;
++			ew32(AIT, 0);
++		}
++	}
++}
++
++/**
++ *  e1000_raise_eec_clk - Raise EEPROM clock
++ *  @hw: pointer to the HW structure
++ *  @eecd: pointer to the EEPROM
++ *
++ *  Enable/Raise the EEPROM clock bit.
++ **/
++static void e1000_raise_eec_clk(struct e1000_hw *hw, u32 *eecd)
++{
++	*eecd = *eecd | E1000_EECD_SK;
++	ew32(EECD, *eecd);
++	e1e_flush();
++	udelay(hw->nvm.delay_usec);
++}
++
++/**
++ *  e1000_lower_eec_clk - Lower EEPROM clock
++ *  @hw: pointer to the HW structure
++ *  @eecd: pointer to the EEPROM
++ *
++ *  Clear/Lower the EEPROM clock bit.
++ **/
++static void e1000_lower_eec_clk(struct e1000_hw *hw, u32 *eecd)
++{
++	*eecd = *eecd & ~E1000_EECD_SK;
++	ew32(EECD, *eecd);
++	e1e_flush();
++	udelay(hw->nvm.delay_usec);
++}
++
++/**
++ *  e1000_shift_out_eec_bits - Shift data bits our to the EEPROM
++ *  @hw: pointer to the HW structure
++ *  @data: data to send to the EEPROM
++ *  @count: number of bits to shift out
++ *
++ *  We need to shift 'count' bits out to the EEPROM.  So, the value in the
++ *  "data" parameter will be shifted out to the EEPROM one bit at a time.
++ *  In order to do this, "data" must be broken down into bits.
++ **/
++static void e1000_shift_out_eec_bits(struct e1000_hw *hw, u16 data, u16 count)
++{
++	struct e1000_nvm_info *nvm = &hw->nvm;
++	u32 eecd = er32(EECD);
++	u32 mask;
++
++	mask = 0x01 << (count - 1);
++	if (nvm->type == e1000_nvm_eeprom_spi)
++		eecd |= E1000_EECD_DO;
++
++	do {
++		eecd &= ~E1000_EECD_DI;
++
++		if (data & mask)
++			eecd |= E1000_EECD_DI;
++
++		ew32(EECD, eecd);
++		e1e_flush();
++
++		udelay(nvm->delay_usec);
++
++		e1000_raise_eec_clk(hw, &eecd);
++		e1000_lower_eec_clk(hw, &eecd);
++
++		mask >>= 1;
++	} while (mask);
++
++	eecd &= ~E1000_EECD_DI;
++	ew32(EECD, eecd);
++}
++
++/**
++ *  e1000_shift_in_eec_bits - Shift data bits in from the EEPROM
++ *  @hw: pointer to the HW structure
++ *  @count: number of bits to shift in
++ *
++ *  In order to read a register from the EEPROM, we need to shift 'count' bits
++ *  in from the EEPROM.  Bits are "shifted in" by raising the clock input to
++ *  the EEPROM (setting the SK bit), and then reading the value of the data out
++ *  "DO" bit.  During this "shifting in" process the data in "DI" bit should
++ *  always be clear.
++ **/
++static u16 e1000_shift_in_eec_bits(struct e1000_hw *hw, u16 count)
++{
++	u32 eecd;
++	u32 i;
++	u16 data;
++
++	eecd = er32(EECD);
++
++	eecd &= ~(E1000_EECD_DO | E1000_EECD_DI);
++	data = 0;
++
++	for (i = 0; i < count; i++) {
++		data <<= 1;
++		e1000_raise_eec_clk(hw, &eecd);
++
++		eecd = er32(EECD);
++
++		eecd &= ~E1000_EECD_DI;
++		if (eecd & E1000_EECD_DO)
++			data |= 1;
++
++		e1000_lower_eec_clk(hw, &eecd);
++	}
++
++	return data;
++}
++
++/**
++ *  e1000_poll_eerd_eewr_done - Poll for EEPROM read/write completion
++ *  @hw: pointer to the HW structure
++ *  @ee_reg: EEPROM flag for polling
++ *
++ *  Polls the EEPROM status bit for either read or write completion based
++ *  upon the value of 'ee_reg'.
++ **/
++s32 e1000_poll_eerd_eewr_done(struct e1000_hw *hw, int ee_reg)
++{
++	u32 attempts = 100000;
++	u32 i, reg = 0;
++	s32 ret_val = -E1000_ERR_NVM;
++
++	for (i = 0; i < attempts; i++) {
++		if (ee_reg == E1000_NVM_POLL_READ)
++			reg = er32(EERD);
++		else
++			reg = er32(EEWR);
++
++		if (reg & E1000_NVM_RW_REG_DONE) {
++			ret_val = E1000_SUCCESS;
++			break;
++		}
++
++		udelay(5);
++	}
++
++	return ret_val;
++}
++
++/**
++ *  e1000_acquire_nvm - Generic request for access to EEPROM
++ *  @hw: pointer to the HW structure
++ *
++ *  Set the EEPROM access request bit and wait for EEPROM access grant bit.
++ *  Return successful if access grant bit set, else clear the request for
++ *  EEPROM access and return -E1000_ERR_NVM (-1).
++ **/
++s32 e1000_acquire_nvm(struct e1000_hw *hw)
++{
++	u32 eecd = er32(EECD);
++	s32 timeout = E1000_NVM_GRANT_ATTEMPTS;
++	s32 ret_val = E1000_SUCCESS;
++
++	ew32(EECD, eecd | E1000_EECD_REQ);
++	eecd = er32(EECD);
++
++	while (timeout) {
++		if (eecd & E1000_EECD_GNT)
++			break;
++		udelay(5);
++		eecd = er32(EECD);
++		timeout--;
++	}
++
++	if (!timeout) {
++		eecd &= ~E1000_EECD_REQ;
++		ew32(EECD, eecd);
++		hw_dbg(hw, "Could not acquire NVM grant\n");
++		ret_val = -E1000_ERR_NVM;
++	}
++
++	return ret_val;
++}
++
++/**
++ *  e1000_standby_nvm - Return EEPROM to standby state
++ *  @hw: pointer to the HW structure
++ *
++ *  Return the EEPROM to a standby state.
++ **/
++static void e1000_standby_nvm(struct e1000_hw *hw)
++{
++	struct e1000_nvm_info *nvm = &hw->nvm;
++	u32 eecd = er32(EECD);
++
++	if (nvm->type == e1000_nvm_eeprom_spi) {
++		/* Toggle CS to flush commands */
++		eecd |= E1000_EECD_CS;
++		ew32(EECD, eecd);
++		e1e_flush();
++		udelay(nvm->delay_usec);
++		eecd &= ~E1000_EECD_CS;
++		ew32(EECD, eecd);
++		e1e_flush();
++		udelay(nvm->delay_usec);
++	}
++}
++
++/**
++ *  e1000_stop_nvm - Terminate EEPROM command
++ *  @hw: pointer to the HW structure
++ *
++ *  Terminates the current command by inverting the EEPROM's chip select pin.
++ **/
++static void e1000_stop_nvm(struct e1000_hw *hw)
++{
++	u32 eecd;
++
++	eecd = er32(EECD);
++	if (hw->nvm.type == e1000_nvm_eeprom_spi) {
++		/* Pull CS high */
++		eecd |= E1000_EECD_CS;
++		e1000_lower_eec_clk(hw, &eecd);
++	}
++}
++
++/**
++ *  e1000_release_nvm - Release exclusive access to EEPROM
++ *  @hw: pointer to the HW structure
++ *
++ *  Stop any current commands to the EEPROM and clear the EEPROM request bit.
++ **/
++void e1000_release_nvm(struct e1000_hw *hw)
++{
++	u32 eecd;
++
++	e1000_stop_nvm(hw);
++
++	eecd = er32(EECD);
++	eecd &= ~E1000_EECD_REQ;
++	ew32(EECD, eecd);
++}
++
++/**
++ *  e1000_ready_nvm_eeprom - Prepares EEPROM for read/write
++ *  @hw: pointer to the HW structure
++ *
++ *  Setups the EEPROM for reading and writing.
++ **/
++static s32 e1000_ready_nvm_eeprom(struct e1000_hw *hw)
++{
++	struct e1000_nvm_info *nvm = &hw->nvm;
++	u32 eecd = er32(EECD);
++	s32 ret_val = E1000_SUCCESS;
++	u16 timeout = 0;
++	u8 spi_stat_reg;
++
++	if (nvm->type == e1000_nvm_eeprom_spi) {
++		/* Clear SK and CS */
++		eecd &= ~(E1000_EECD_CS | E1000_EECD_SK);
++		ew32(EECD, eecd);
++		udelay(1);
++		timeout = NVM_MAX_RETRY_SPI;
++
++		/* Read "Status Register" repeatedly until the LSB is cleared.
++		 * The EEPROM will signal that the command has been completed
++		 * by clearing bit 0 of the internal status register.  If it's
++		 * not cleared within 'timeout', then error out. */
++		while (timeout) {
++			e1000_shift_out_eec_bits(hw, NVM_RDSR_OPCODE_SPI,
++						 hw->nvm.opcode_bits);
++			spi_stat_reg = (u8)e1000_shift_in_eec_bits(hw, 8);
++			if (!(spi_stat_reg & NVM_STATUS_RDY_SPI))
++				break;
++
++			udelay(5);
++			e1000_standby_nvm(hw);
++			timeout--;
++		}
++
++		if (!timeout) {
++			hw_dbg(hw, "SPI NVM Status error\n");
++			ret_val = -E1000_ERR_NVM;
++			goto out;
++		}
++	}
++
++out:
++	return ret_val;
++}
++
++/**
++ *  e1000_read_nvm_spi - Read EEPROM's using SPI
++ *  @hw: pointer to the HW structure
++ *  @offset: offset of word in the EEPROM to read
++ *  @words: number of words to read
++ *  @data: word read from the EEPROM
++ *
++ *  Reads a 16 bit word from the EEPROM.
++ **/
++s32 e1000_read_nvm_spi(struct e1000_hw *hw, u16 offset, u16 words, u16 *data)
++{
++	struct e1000_nvm_info *nvm = &hw->nvm;
++	u32 i = 0;
++	s32 ret_val;
++	u16 word_in;
++	u8 read_opcode = NVM_READ_OPCODE_SPI;
++
++	/* A check for invalid values:  offset too large, too many words,
++	 * and not enough words. */
++	if ((offset >= nvm->word_size) || (words > (nvm->word_size - offset)) ||
++	    (words == 0)) {
++		hw_dbg(hw, "nvm parameter(s) out of bounds\n");
++		ret_val = -E1000_ERR_NVM;
++		goto out;
++	}
++
++	ret_val = nvm->ops.acquire_nvm(hw);
++	if (ret_val)
++		goto out;
++
++	ret_val = e1000_ready_nvm_eeprom(hw);
++	if (ret_val)
++		goto release;
++
++	e1000_standby_nvm(hw);
++
++	if ((nvm->address_bits == 8) && (offset >= 128))
++		read_opcode |= NVM_A8_OPCODE_SPI;
++
++	/* Send the READ command (opcode + addr) */
++	e1000_shift_out_eec_bits(hw, read_opcode, nvm->opcode_bits);
++	e1000_shift_out_eec_bits(hw, (u16)(offset*2), nvm->address_bits);
++
++	/* Read the data.  SPI NVMs increment the address with each byte
++	 * read and will roll over if reading beyond the end.  This allows
++	 * us to read the whole NVM from any offset */
++	for (i = 0; i < words; i++) {
++		word_in = e1000_shift_in_eec_bits(hw, 16);
++		data[i] = (word_in >> 8) | (word_in << 8);
++	}
++
++release:
++	nvm->ops.release_nvm(hw);
++
++out:
++	return ret_val;
++}
++
++/**
++ *  e1000_read_nvm_eerd - Reads EEPROM using EERD register
++ *  @hw: pointer to the HW structure
++ *  @offset: offset of word in the EEPROM to read
++ *  @words: number of words to read
++ *  @data: word read from the EEPROM
++ *
++ *  Reads a 16 bit word from the EEPROM using the EERD register.
++ **/
++s32 e1000_read_nvm_eerd(struct e1000_hw *hw, u16 offset, u16 words, u16 *data)
++{
++	struct e1000_nvm_info *nvm = &hw->nvm;
++	u32 i, eerd = 0;
++	s32 ret_val = E1000_SUCCESS;
++
++	/* A check for invalid values:  offset too large, too many words,
++	 * and not enough words. */
++	if ((offset >= nvm->word_size) || (words > (nvm->word_size - offset)) ||
++	    (words == 0)) {
++		hw_dbg(hw, "nvm parameter(s) out of bounds\n");
++		ret_val = -E1000_ERR_NVM;
++		goto out;
++	}
++
++	for (i = 0; i < words; i++) {
++		eerd = ((offset+i) << E1000_NVM_RW_ADDR_SHIFT) +
++		       E1000_NVM_RW_REG_START;
++
++		ew32(EERD, eerd);
++		ret_val = e1000_poll_eerd_eewr_done(hw, E1000_NVM_POLL_READ);
++		if (ret_val)
++			break;
++
++		data[i] = (er32(EERD) >>
++			   E1000_NVM_RW_REG_DATA);
++	}
++
++out:
++	return ret_val;
++}
++
++/**
++ *  e1000_write_nvm_spi - Write to EEPROM using SPI
++ *  @hw: pointer to the HW structure
++ *  @offset: offset within the EEPROM to be written to
++ *  @words: number of words to write
++ *  @data: 16 bit word(s) to be written to the EEPROM
++ *
++ *  Writes data to EEPROM at offset using SPI interface.
++ *
++ *  If e1000_update_nvm_checksum is not called after this function , the
++ *  EEPROM will most likley contain an invalid checksum.
++ **/
++s32 e1000_write_nvm_spi(struct e1000_hw *hw, u16 offset, u16 words, u16 *data)
++{
++	struct e1000_nvm_info *nvm = &hw->nvm;
++	s32 ret_val;
++	u16 widx = 0;
++
++	/* A check for invalid values:  offset too large, too many words,
++	 * and not enough words. */
++	if ((offset >= nvm->word_size) || (words > (nvm->word_size - offset)) ||
++	    (words == 0)) {
++		hw_dbg(hw, "nvm parameter(s) out of bounds\n");
++		ret_val = -E1000_ERR_NVM;
++		goto out;
++	}
++
++	ret_val = nvm->ops.acquire_nvm(hw);
++	if (ret_val)
++		goto out;
++
++	msleep(10);
++
++	while (widx < words) {
++		u8 write_opcode = NVM_WRITE_OPCODE_SPI;
++
++		ret_val = e1000_ready_nvm_eeprom(hw);
++		if (ret_val)
++			goto release;
++
++		e1000_standby_nvm(hw);
++
++		/* Send the WRITE ENABLE command (8 bit opcode) */
++		e1000_shift_out_eec_bits(hw, NVM_WREN_OPCODE_SPI,
++					 nvm->opcode_bits);
++
++		e1000_standby_nvm(hw);
++
++		/* Some SPI eeproms use the 8th address bit embedded in the
++		 * opcode */
++		if ((nvm->address_bits == 8) && (offset >= 128))
++			write_opcode |= NVM_A8_OPCODE_SPI;
++
++		/* Send the Write command (8-bit opcode + addr) */
++		e1000_shift_out_eec_bits(hw, write_opcode, nvm->opcode_bits);
++		e1000_shift_out_eec_bits(hw, (u16)((offset + widx) * 2),
++					 nvm->address_bits);
++
++		/* Loop to allow for up to whole page write of eeprom */
++		while (widx < words) {
++			u16 word_out = data[widx];
++			word_out = (word_out >> 8) | (word_out << 8);
++			e1000_shift_out_eec_bits(hw, word_out, 16);
++			widx++;
++
++			if ((((offset + widx) * 2) % nvm->page_size) == 0) {
++				e1000_standby_nvm(hw);
++				break;
++			}
++		}
++	}
++
++	msleep(10);
++release:
++	nvm->ops.release_nvm(hw);
++
++out:
++	return ret_val;
++}
++
++/**
++ *  e1000_read_mac_addr - Read device MAC address
++ *  @hw: pointer to the HW structure
++ *
++ *  Reads the device MAC address from the EEPROM and stores the value.
++ *  Since devices with two ports use the same EEPROM, we increment the
++ *  last bit in the MAC address for the second port.
++ **/
++s32 e1000_read_mac_addr(struct e1000_hw *hw)
++{
++	s32  ret_val = E1000_SUCCESS;
++	u16 offset, nvm_data, i;
++
++	for (i = 0; i < ETH_ALEN; i += 2) {
++		offset = i >> 1;
++		ret_val = e1000_read_nvm(hw, offset, 1, &nvm_data);
++		if (ret_val) {
++			hw_dbg(hw, "NVM Read Error\n");
++			goto out;
++		}
++		hw->mac.perm_addr[i] = (u8)(nvm_data & 0xFF);
++		hw->mac.perm_addr[i+1] = (u8)(nvm_data >> 8);
++	}
++
++	/* Flip last bit of mac address if we're on second port */
++	if (hw->bus.func == E1000_FUNC_1)
++		hw->mac.perm_addr[5] ^= 1;
++
++	for (i = 0; i < ETH_ALEN; i++)
++		hw->mac.addr[i] = hw->mac.perm_addr[i];
++
++out:
++	return ret_val;
++}
++
++/**
++ *  e1000_validate_nvm_checksum_generic - Validate EEPROM checksum
++ *  @hw: pointer to the HW structure
++ *
++ *  Calculates the EEPROM checksum by reading/adding each word of the EEPROM
++ *  and then verifies that the sum of the EEPROM is equal to 0xBABA.
++ **/
++s32 e1000_validate_nvm_checksum_generic(struct e1000_hw *hw)
++{
++	s32 ret_val = E1000_SUCCESS;
++	u16 checksum = 0;
++	u16 i, nvm_data;
++
++	for (i = 0; i < (NVM_CHECKSUM_REG + 1); i++) {
++		ret_val = e1000_read_nvm(hw, i, 1, &nvm_data);
++		if (ret_val) {
++			hw_dbg(hw, "NVM Read Error\n");
++			goto out;
++		}
++		checksum += nvm_data;
++	}
++
++	if (checksum != (u16) NVM_SUM) {
++		hw_dbg(hw, "NVM Checksum Invalid\n");
++		ret_val = -E1000_ERR_NVM;
++		goto out;
++	}
++
++out:
++	return ret_val;
++}
++
++/**
++ *  e1000_update_nvm_checksum_generic - Update EEPROM checksum
++ *  @hw: pointer to the HW structure
++ *
++ *  Updates the EEPROM checksum by reading/adding each word of the EEPROM
++ *  up to the checksum.  Then calculates the EEPROM checksum and writes the
++ *  value to the EEPROM.
++ **/
++s32 e1000_update_nvm_checksum_generic(struct e1000_hw *hw)
++{
++	s32  ret_val;
++	u16 checksum = 0;
++	u16 i, nvm_data;
++
++	for (i = 0; i < NVM_CHECKSUM_REG; i++) {
++		ret_val = e1000_read_nvm(hw, i, 1, &nvm_data);
++		if (ret_val) {
++			hw_dbg(hw, "NVM Read Error while updating checksum.\n");
++			goto out;
++		}
++		checksum += nvm_data;
++	}
++	checksum = (u16) NVM_SUM - checksum;
++	ret_val = e1000_write_nvm(hw, NVM_CHECKSUM_REG, 1, &checksum);
++	if (ret_val) {
++		hw_dbg(hw, "NVM Write Error while updating checksum.\n");
++	}
++
++out:
++	return ret_val;
++}
++
++/**
++ *  e1000_reload_nvm - Reloads EEPROM
++ *  @hw: pointer to the HW structure
++ *
++ *  Reloads the EEPROM by setting the "Reinitialize from EEPROM" bit in the
++ *  extended control register.
++ **/
++void e1000_reload_nvm(struct e1000_hw *hw)
++{
++	u32 ctrl_ext;
++
++	udelay(10);
++	ctrl_ext = er32(CTRL_EXT);
++	ctrl_ext |= E1000_CTRL_EXT_EE_RST;
++	ew32(CTRL_EXT, ctrl_ext);
++	e1e_flush();
++}
++
++/**
++ *  e1000_calculate_checksum - Calculate checksum for buffer
++ *  @buffer: pointer to EEPROM
++ *  @length: size of EEPROM to calculate a checksum for
++ *
++ *  Calculates the checksum for some buffer on a specified length.  The
++ *  checksum calculated is returned.
++ **/
++static u8 e1000_calculate_checksum(u8 *buffer, u32 length)
++{
++	u32 i;
++	u8  sum = 0;
++
++	if (!buffer)
++		return 0;
++
++	for (i = 0; i < length; i++)
++		sum += buffer[i];
++
++	return (u8) (0 - sum);
++}
++
++/**
++ *  e1000_mng_enable_host_if - Checks host interface is enabled
++ *  @hw: pointer to the HW structure
++ *
++ *  Returns E1000_success upon success, else E1000_ERR_HOST_INTERFACE_COMMAND
++ *
++ *  This function checks whether the HOST IF is enabled for command operaton
++ *  and also checks whether the previous command is completed.  It busy waits
++ *  in case of previous command is not completed.
++ **/
++static s32 e1000_mng_enable_host_if(struct e1000_hw *hw)
++{
++	u32 hicr;
++	s32 ret_val = E1000_SUCCESS;
++	u8  i;
++
++	/* Check that the host interface is enabled. */
++	hicr = er32(HICR);
++	if ((hicr & E1000_HICR_EN) == 0) {
++		hw_dbg(hw, "E1000_HOST_EN bit disabled.\n");
++		ret_val = -E1000_ERR_HOST_INTERFACE_COMMAND;
++		goto out;
++	}
++	/* check the previous command is completed */
++	for (i = 0; i < E1000_MNG_DHCP_COMMAND_TIMEOUT; i++) {
++		hicr = er32(HICR);
++		if (!(hicr & E1000_HICR_C))
++			break;
++		mdelay(1);
++	}
++
++	if (i == E1000_MNG_DHCP_COMMAND_TIMEOUT) {
++		hw_dbg(hw, "Previous command timeout failed .\n");
++		ret_val = -E1000_ERR_HOST_INTERFACE_COMMAND;
++		goto out;
++	}
++
++out:
++	return ret_val;
++}
++
++/**
++ *  e1000_check_mng_mode - check managament mode
++ *  @hw: pointer to the HW structure
++ *
++ *  Reads the firmware semaphore register and returns true (>0) if
++ *  manageability is enabled, else false (0).
++ **/
++bool e1000_check_mng_mode(struct e1000_hw *hw)
++{
++	u32 fwsm = er32(FWSM);
++
++	return (fwsm & E1000_FWSM_MODE_MASK) == hw->mac.ops.mng_mode_enab;
++}
++
++/**
++ *  e1000_enable_tx_pkt_filtering - Enable packet filtering on TX
++ *  @hw: pointer to the HW structure
++ *
++ *  Enables packet filtering on transmit packets if manageability is enabled
++ *  and host interface is enabled.
++ **/
++bool e1000_enable_tx_pkt_filtering(struct e1000_hw *hw)
++{
++	struct e1000_host_mng_dhcp_cookie *hdr = &hw->mng_cookie;
++	u32 *buffer = (u32 *)&hw->mng_cookie;
++	u32 offset;
++	s32 ret_val, hdr_csum, csum;
++	u8 i, len;
++	bool tx_filter = 1;
++
++	/* No manageability, no filtering */
++	if (!e1000_check_mng_mode(hw)) {
++		tx_filter = 0;
++		goto out;
++	}
++
++	/* If we can't read from the host interface for whatever
++	 * reason, disable filtering.
++	 */
++	ret_val = e1000_mng_enable_host_if(hw);
++	if (ret_val != E1000_SUCCESS) {
++		tx_filter = 0;
++		goto out;
++	}
++
++	/* Read in the header.  Length and offset are in dwords. */
++	len    = E1000_MNG_DHCP_COOKIE_LENGTH >> 2;
++	offset = E1000_MNG_DHCP_COOKIE_OFFSET >> 2;
++	for (i = 0; i < len; i++)
++		*(buffer + i) = E1000_READ_REG_ARRAY(hw, E1000_HOST_IF, offset + i);
++	hdr_csum = hdr->checksum;
++	hdr->checksum = 0;
++	csum = e1000_calculate_checksum((u8 *)hdr,
++					E1000_MNG_DHCP_COOKIE_LENGTH);
++	/* If either the checksums or signature don't match, then
++	 * the cookie area isn't considered valid, in which case we
++	 * take the safe route of assuming Tx filtering is enabled.
++	 */
++	if (hdr_csum != csum)
++		goto out;
++	if (hdr->signature != E1000_IAMT_SIGNATURE)
++		goto out;
++
++	/* Cookie area is valid, make the final check for filtering. */
++	if (!(hdr->status & E1000_MNG_DHCP_COOKIE_STATUS_PARSING))
++		tx_filter = 0;
++
++out:
++	hw->mac.tx_pkt_filtering = tx_filter;
++	return tx_filter;
++}
++
++/**
++ *  e1000_mng_write_cmd_header - Writes manageability command header
++ *  @hw: pointer to the HW structure
++ *  @hdr: pointer to the host interface command header
++ *
++ *  Writes the command header after does the checksum calculation.
++ **/
++s32 e1000_mng_write_cmd_header(struct e1000_hw *hw,
++				  struct e1000_host_mng_command_header *hdr)
++{
++	u16 i, length = sizeof(struct e1000_host_mng_command_header);
++
++	/* Write the whole command header structure with new checksum. */
++
++	hdr->checksum = e1000_calculate_checksum((u8 *)hdr, length);
++
++	length >>= 2;
++	/* Write the relevant command block into the ram area. */
++	for (i = 0; i < length; i++) {
++		E1000_WRITE_REG_ARRAY(hw, E1000_HOST_IF, i,
++					    *((u32 *) hdr + i));
++		e1e_flush();
++	}
++
++	return E1000_SUCCESS;
++}
++
++/**
++ *  e1000_mng_host_if_write - Writes to the manageability host interface
++ *  @hw: pointer to the HW structure
++ *  @buffer: pointer to the host interface buffer
++ *  @length: size of the buffer
++ *  @offset: location in the buffer to write to
++ *  @sum: sum of the data (not checksum)
++ *
++ *  This function writes the buffer content at the offset given on the host if.
++ *  It also does alignment considerations to do the writes in most efficient
++ *  way.  Also fills up the sum of the buffer in *buffer parameter.
++ **/
++static s32 e1000_mng_host_if_write(struct e1000_hw *hw, u8 *buffer,
++				   u16 length, u16 offset, u8 *sum)
++{
++	u8 *tmp;
++	u8 *bufptr = buffer;
++	u32 data = 0;
++	s32 ret_val = E1000_SUCCESS;
++	u16 remaining, i, j, prev_bytes;
++
++	/* sum = only sum of the data and it is not checksum */
++
++	if (length == 0 || offset + length > E1000_HI_MAX_MNG_DATA_LENGTH) {
++		ret_val = -E1000_ERR_PARAM;
++		goto out;
++	}
++
++	tmp = (u8 *)&data;
++	prev_bytes = offset & 0x3;
++	offset >>= 2;
++
++	if (prev_bytes) {
++		data = E1000_READ_REG_ARRAY(hw, E1000_HOST_IF, offset);
++		for (j = prev_bytes; j < sizeof(u32); j++) {
++			*(tmp + j) = *bufptr++;
++			*sum += *(tmp + j);
++		}
++		E1000_WRITE_REG_ARRAY(hw, E1000_HOST_IF, offset, data);
++		length -= j - prev_bytes;
++		offset++;
++	}
++
++	remaining = length & 0x3;
++	length -= remaining;
++
++	/* Calculate length in DWORDs */
++	length >>= 2;
++
++	/* The device driver writes the relevant command block into the
++	 * ram area. */
++	for (i = 0; i < length; i++) {
++		for (j = 0; j < sizeof(u32); j++) {
++			*(tmp + j) = *bufptr++;
++			*sum += *(tmp + j);
++		}
++
++		E1000_WRITE_REG_ARRAY(hw, E1000_HOST_IF, offset + i, data);
++	}
++	if (remaining) {
++		for (j = 0; j < sizeof(u32); j++) {
++			if (j < remaining)
++				*(tmp + j) = *bufptr++;
++			else
++				*(tmp + j) = 0;
++
++			*sum += *(tmp + j);
++		}
++		E1000_WRITE_REG_ARRAY(hw, E1000_HOST_IF, offset + i, data);
++	}
++
++out:
++	return ret_val;
++}
++
++/**
++ *  e1000_mng_write_dhcp_info - Writes DHCP info to host interface
++ *  @hw: pointer to the HW structure
++ *  @buffer: pointer to the host interface
++ *  @length: size of the buffer
++ *
++ *  Writes the DHCP information to the host interface.
++ **/
++s32 e1000_mng_write_dhcp_info(struct e1000_hw *hw, u8 *buffer, u16 length)
++{
++	struct e1000_host_mng_command_header hdr;
++	s32 ret_val;
++	u32 hicr;
++
++	hdr.command_id = E1000_MNG_DHCP_TX_PAYLOAD_CMD;
++	hdr.command_length = length;
++	hdr.reserved1 = 0;
++	hdr.reserved2 = 0;
++	hdr.checksum = 0;
++
++	/* Enable the host interface */
++	ret_val = e1000_mng_enable_host_if(hw);
++	if (ret_val)
++		goto out;
++
++	/* Populate the host interface with the contents of "buffer". */
++	ret_val = e1000_mng_host_if_write(hw, buffer, length,
++					  sizeof(hdr), &(hdr.checksum));
++	if (ret_val)
++		goto out;
++
++	/* Write the manageability command header */
++	ret_val = e1000_mng_write_cmd_header(hw, &hdr);
++	if (ret_val)
++		goto out;
++
++	/* Tell the ARC a new command is pending. */
++	hicr = er32(HICR);
++	ew32(HICR, hicr | E1000_HICR_C);
++
++out:
++	return ret_val;
++}
++
++/**
++ *  e1000_enable_mng_pass_thru - Enable processing of ARP's
++ *  @hw: pointer to the HW structure
++ *
++ *  Verifies the hardware needs to allow ARPs to be processed by the host.
++ **/
++bool e1000_enable_mng_pass_thru(struct e1000_hw *hw)
++{
++	u32 manc;
++	u32 fwsm, factps;
++	bool ret_val = 0;
++
++	manc = er32(MANC);
++
++	if (!(manc & E1000_MANC_RCV_TCO_EN) ||
++	    !(manc & E1000_MANC_EN_MAC_ADDR_FILTER))
++		goto out;
++
++	if (hw->mac.arc_subsystem_valid) {
++		fwsm = er32(FWSM);
++		factps = er32(FACTPS);
++
++		if (!(factps & E1000_FACTPS_MNGCG) &&
++		    ((fwsm & E1000_FWSM_MODE_MASK) ==
++		     (e1000_mng_mode_pt << E1000_FWSM_MODE_SHIFT))) {
++			ret_val = 1;
++			goto out;
++		}
++	} else {
++		if ((manc & E1000_MANC_SMBUS_EN) &&
++		    !(manc & E1000_MANC_ASF_EN)) {
++			ret_val = 1;
++			goto out;
++		}
++	}
++
++out:
++	return ret_val;
++}
++
+diff --git a/drivers/net/e1000e/netdev.c b/drivers/net/e1000e/netdev.c
+new file mode 100644
+index 0000000..2d0e78c
+--- /dev/null
++++ b/drivers/net/e1000e/netdev.c
+@@ -0,0 +1,4413 @@
++/*******************************************************************************
++
++  Intel PRO/1000 Linux driver
++  Copyright(c) 1999 - 2007 Intel Corporation.
++
++  This program is free software; you can redistribute it and/or modify it
++  under the terms and conditions of the GNU General Public License,
++  version 2, as published by the Free Software Foundation.
++
++  This program is distributed in the hope 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.,
++  51 Franklin St - Fifth Floor, Boston, MA 02110-1301 USA.
++
++  The full GNU General Public License is included in this distribution in
++  the file called "COPYING".
++
++  Contact Information:
++  Linux NICS <linux.nics at intel.com>
++  e1000-devel Mailing List <e1000-devel at lists.sourceforge.net>
++  Intel Corporation, 5200 N.E. Elam Young Parkway, Hillsboro, OR 97124-6497
++
++*******************************************************************************/
++
++#include <linux/module.h>
++#include <linux/types.h>
++#include <linux/init.h>
++#include <linux/vmalloc.h>
++#include <linux/pagemap.h>
++#include <linux/netdevice.h>
++#include <linux/tcp.h>
++#include <linux/ipv6.h>
++#include <net/checksum.h>
++#include <net/ip6_checksum.h>
++#include <linux/mii.h>
++#include <linux/ethtool.h>
++#include <linux/if_vlan.h>
++#include <linux/cpu.h>
++#include <linux/smp.h>
++
++#include "e1000.h"
++
++#define DRV_VERSION "0.2.0"
++char e1000_driver_name[] = "e1000e";
++const char e1000_driver_version[] = DRV_VERSION;
++
++const struct e1000_info * e1000_info_tbl[] = {
++	[board_82571]		= &e1000_82571_info,
++	[board_82572]		= &e1000_82572_info,
++	[board_82573]		= &e1000_82573_info,
++	[board_80003es2lan]	= &e1000_es2_info,
++	[board_ich8lan]		= &e1000_ich8_info,
++	[board_ich9lan]		= &e1000_ich9_info,
++};
++
++#ifdef DEBUG
++/**
++ * e1000_get_hw_dev_name - return device name string
++ * used by hardware layer to print debugging information
++ **/
++char *e1000_get_hw_dev_name(struct e1000_hw *hw)
++{
++	struct e1000_adapter *adapter = hw->back;
++	struct net_device *netdev = adapter->netdev;
++	return netdev->name;
++}
++#endif
++
++/**
++ * e1000_desc_unused - calculate if we have unused descriptors
++ **/
++static int e1000_desc_unused(struct e1000_ring *ring)
++{
++	if (ring->next_to_clean > ring->next_to_use)
++		return ring->next_to_clean - ring->next_to_use - 1;
++
++	return ring->count + ring->next_to_clean - ring->next_to_use - 1;
++}
++
++/**
++ * e1000_receive_skb - helper function to handle rx indications
++ * @adapter: board private structure
++ * @status: descriptor status field as written by hardware
++ * @vlan: descriptor vlan field as written by hardware (no le/be conversion)
++ * @skb: pointer to sk_buff to be indicated to stack
++ **/
++static void e1000_receive_skb(struct e1000_adapter *adapter,
++			      struct net_device *netdev,
++			      struct sk_buff *skb,
++			      u8 status, u16 vlan)
++{
++	skb->protocol = eth_type_trans(skb, netdev);
++
++	if (adapter->vlgrp && (status & E1000_RXD_STAT_VP))
++		vlan_hwaccel_receive_skb(skb, adapter->vlgrp,
++					 le16_to_cpu(vlan) &
++					 E1000_RXD_SPC_VLAN_MASK);
++	else
++		netif_receive_skb(skb);
++
++	netdev->last_rx = jiffies;
++}
++
++/**
++ * e1000_rx_checksum - Receive Checksum Offload for 82543
++ * @adapter:     board private structure
++ * @status_err:  receive descriptor status and error fields
++ * @csum:	receive descriptor csum field
++ * @sk_buff:     socket buffer with received data
++ **/
++static void e1000_rx_checksum(struct e1000_adapter *adapter, u32 status_err,
++			      u32 csum, struct sk_buff *skb)
++{
++	u16 status = (u16)status_err;
++	u8 errors = (u8)(status_err >> 24);
++	skb->ip_summed = CHECKSUM_NONE;
++
++	/* Ignore Checksum bit is set */
++	if (status & E1000_RXD_STAT_IXSM)
++		return;
++	/* TCP/UDP checksum error bit is set */
++	if (errors & E1000_RXD_ERR_TCPE) {
++		/* let the stack verify checksum errors */
++		adapter->hw_csum_err++;
++		return;
++	}
++
++	/* TCP/UDP Checksum has not been calculated */
++	if (!(status & (E1000_RXD_STAT_TCPCS | E1000_RXD_STAT_UDPCS)))
++		return;
++
++	/* It must be a TCP or UDP packet with a valid checksum */
++	if (status & E1000_RXD_STAT_TCPCS) {
++		/* TCP checksum is good */
++		skb->ip_summed = CHECKSUM_UNNECESSARY;
++	} else {
++		/* IP fragment with UDP payload */
++		/* Hardware complements the payload checksum, so we undo it
++		 * and then put the value in host order for further stack use.
++		 */
++		csum = ntohl(csum ^ 0xFFFF);
++		skb->csum = csum;
++		skb->ip_summed = CHECKSUM_COMPLETE;
++	}
++	adapter->hw_csum_good++;
++}
++
++/**
++ * e1000_alloc_rx_buffers - Replace used receive buffers; legacy & extended
++ * @adapter: address of board private structure
++ **/
++static void e1000_alloc_rx_buffers(struct e1000_adapter *adapter,
++				   int cleaned_count)
++{
++	struct net_device *netdev = adapter->netdev;
++	struct pci_dev *pdev = adapter->pdev;
++	struct e1000_ring *rx_ring = adapter->rx_ring;
++	struct e1000_rx_desc *rx_desc;
++	struct e1000_buffer *buffer_info;
++	struct sk_buff *skb;
++	unsigned int i;
++	unsigned int bufsz = adapter->rx_buffer_len + NET_IP_ALIGN;
++
++	i = rx_ring->next_to_use;
++	buffer_info = &rx_ring->buffer_info[i];
++
++	while (cleaned_count--) {
++		skb = buffer_info->skb;
++		if (skb) {
++			skb_trim(skb, 0);
++			goto map_skb;
++		}
++
++		skb = netdev_alloc_skb(netdev, bufsz);
++		if (!skb) {
++			/* Better luck next round */
++			adapter->alloc_rx_buff_failed++;
++			break;
++		}
++
++		/* Make buffer alignment 2 beyond a 16 byte boundary
++		 * this will result in a 16 byte aligned IP header after
++		 * the 14 byte MAC header is removed
++		 */
++		skb_reserve(skb, NET_IP_ALIGN);
++
++		buffer_info->skb = skb;
++map_skb:
++		buffer_info->dma = pci_map_single(pdev, skb->data,
++						  adapter->rx_buffer_len,
++						  PCI_DMA_FROMDEVICE);
++
++		rx_desc = E1000_RX_DESC(*rx_ring, i);
++		rx_desc->buffer_addr = cpu_to_le64(buffer_info->dma);
++
++		i++;
++		if (i == rx_ring->count)
++			i = 0;
++		buffer_info = &rx_ring->buffer_info[i];
++	}
++
++	if (rx_ring->next_to_use != i) {
++		rx_ring->next_to_use = i;
++		if (i-- == 0)
++			i = (rx_ring->count - 1);
++
++		/* Force memory writes to complete before letting h/w
++		 * know there are new descriptors to fetch.  (Only
++		 * applicable for weak-ordered memory model archs,
++		 * such as IA-64). */
++		wmb();
++		writel(i, adapter->hw.hw_addr + rx_ring->tail);
++	}
++}
++
++/**
++ * e1000_alloc_rx_buffers_ps - Replace used receive buffers; packet split
++ * @adapter: address of board private structure
++ **/
++static void e1000_alloc_rx_buffers_ps(struct e1000_adapter *adapter,
++				      int cleaned_count)
++{
++	struct net_device *netdev = adapter->netdev;
++	struct pci_dev *pdev = adapter->pdev;
++	union e1000_rx_desc_packet_split *rx_desc;
++	struct e1000_ring *rx_ring = adapter->rx_ring;
++	struct e1000_buffer *buffer_info;
++	struct e1000_ps_page *ps_page;
++	struct sk_buff *skb;
++	unsigned int i, j;
++
++	i = rx_ring->next_to_use;
++	buffer_info = &rx_ring->buffer_info[i];
++
++	while (cleaned_count--) {
++		rx_desc = E1000_RX_DESC_PS(*rx_ring, i);
++
++		for (j = 0; j < PS_PAGE_BUFFERS; j++) {
++			ps_page = &rx_ring->ps_pages[(i * PS_PAGE_BUFFERS)
++						     + j];
++			if (j < adapter->rx_ps_pages) {
++				if (!ps_page->page) {
++					ps_page->page = alloc_page(GFP_ATOMIC);
++					if (!ps_page->page) {
++						adapter->alloc_rx_buff_failed++;
++						goto no_buffers;
++					}
++					ps_page->dma = pci_map_page(pdev,
++							   ps_page->page,
++							   0, PAGE_SIZE,
++							   PCI_DMA_FROMDEVICE);
++				}
++				/*
++				 * Refresh the desc even if buffer_addrs
++				 * didn't change because each write-back
++				 * erases this info.
++				 */
++				rx_desc->read.buffer_addr[j+1] =
++				     cpu_to_le64(ps_page->dma);
++			} else {
++				rx_desc->read.buffer_addr[j+1] = ~0;
++			}
++		}
++
++		skb = netdev_alloc_skb(netdev,
++				       adapter->rx_ps_bsize0 + NET_IP_ALIGN);
++
++		if (!skb) {
++			adapter->alloc_rx_buff_failed++;
++			break;
++		}
++
++		/* Make buffer alignment 2 beyond a 16 byte boundary
++		 * this will result in a 16 byte aligned IP header after
++		 * the 14 byte MAC header is removed
++		 */
++		skb_reserve(skb, NET_IP_ALIGN);
++
++		buffer_info->skb = skb;
++		buffer_info->dma = pci_map_single(pdev, skb->data,
++						  adapter->rx_ps_bsize0,
++						  PCI_DMA_FROMDEVICE);
++
++		rx_desc->read.buffer_addr[0] = cpu_to_le64(buffer_info->dma);
++
++		i++;
++		if (i == rx_ring->count)
++			i = 0;
++		buffer_info = &rx_ring->buffer_info[i];
++	}
++
++no_buffers:
++	if (rx_ring->next_to_use != i) {
++		rx_ring->next_to_use = i;
++
++		if (!(i--))
++			i = (rx_ring->count - 1);
++
++		/* Force memory writes to complete before letting h/w
++		 * know there are new descriptors to fetch.  (Only
++		 * applicable for weak-ordered memory model archs,
++		 * such as IA-64). */
++		wmb();
++		/* Hardware increments by 16 bytes, but packet split
++		 * descriptors are 32 bytes...so we increment tail
++		 * twice as much.
++		 */
++		writel(i<<1, adapter->hw.hw_addr + rx_ring->tail);
++	}
++}
++
++/**
++ * e1000_alloc_rx_buffers_jumbo - Replace used jumbo receive buffers
++ *
++ * @adapter: address of board private structure
++ * @cleaned_count: number of buffers to allocate this pass
++ **/
++static void e1000_alloc_rx_buffers_jumbo(struct e1000_adapter *adapter,
++					 int cleaned_count)
++{
++	struct net_device *netdev = adapter->netdev;
++	struct pci_dev *pdev = adapter->pdev;
++	struct e1000_ring *rx_ring = adapter->rx_ring;
++	struct e1000_rx_desc *rx_desc;
++	struct e1000_buffer *buffer_info;
++	struct sk_buff *skb;
++	unsigned int i;
++	unsigned int bufsz = 256 -
++			     16 /*for skb_reserve */ -
++			     NET_IP_ALIGN;
++
++	i = rx_ring->next_to_use;
++	buffer_info = &rx_ring->buffer_info[i];
++
++	while (cleaned_count--) {
++		skb = buffer_info->skb;
++		if (skb) {
++			skb_trim(skb, 0);
++			goto check_page;
++		}
++
++		skb = netdev_alloc_skb(netdev, bufsz);
++		if (!skb) {
++			/* Better luck next round */
++			adapter->alloc_rx_buff_failed++;
++			break;
++		}
++
++		/* Make buffer alignment 2 beyond a 16 byte boundary
++		 * this will result in a 16 byte aligned IP header after
++		 * the 14 byte MAC header is removed
++		 */
++		skb_reserve(skb, NET_IP_ALIGN);
++
++		buffer_info->skb = skb;
++check_page:
++		/* allocate a new page if necessary */
++		if (!buffer_info->page) {
++			buffer_info->page = alloc_page(GFP_ATOMIC);
++			if (!buffer_info->page) {
++				adapter->alloc_rx_buff_failed++;
++				break;
++			}
++		}
++
++		if (!buffer_info->dma)
++			buffer_info->dma = pci_map_page(pdev,
++							buffer_info->page, 0,
++							PAGE_SIZE,
++							PCI_DMA_FROMDEVICE);
++
++		rx_desc = E1000_RX_DESC(*rx_ring, i);
++		rx_desc->buffer_addr = cpu_to_le64(buffer_info->dma);
++
++		i++;
++		if (i == rx_ring->count)
++			i = 0;
++		buffer_info = &rx_ring->buffer_info[i];
++	}
++
++	if (rx_ring->next_to_use != i) {
++		rx_ring->next_to_use = i;
++		if (i-- == 0)
++			i = (rx_ring->count - 1);
++
++		/* Force memory writes to complete before letting h/w
++		 * know there are new descriptors to fetch.  (Only
++		 * applicable for weak-ordered memory model archs,
++		 * such as IA-64). */
++		wmb();
++		writel(i, adapter->hw.hw_addr + rx_ring->tail);
++	}
++}
++
++/**
++ * e1000_clean_rx_irq - Send received data up the network stack; legacy
++ * @adapter: board private structure
++ *
++ * the return value indicates whether actual cleaning was done, there
++ * is no guarantee that everything was cleaned
++ **/
++static bool e1000_clean_rx_irq(struct e1000_adapter *adapter,
++			       int *work_done, int work_to_do)
++{
++	struct net_device *netdev = adapter->netdev;
++	struct pci_dev *pdev = adapter->pdev;
++	struct e1000_ring *rx_ring = adapter->rx_ring;
++	struct e1000_rx_desc *rx_desc, *next_rxd;
++	struct e1000_buffer *buffer_info, *next_buffer;
++	u32 length;
++	unsigned int i;
++	int cleaned_count = 0;
++	bool cleaned = 0;
++	unsigned int total_rx_bytes = 0, total_rx_packets = 0;
++
++	i = rx_ring->next_to_clean;
++	rx_desc = E1000_RX_DESC(*rx_ring, i);
++	buffer_info = &rx_ring->buffer_info[i];
++
++	while (rx_desc->status & E1000_RXD_STAT_DD) {
++		struct sk_buff *skb;
++		u8 status;
++
++		if (*work_done >= work_to_do)
++			break;
++		(*work_done)++;
++
++		status = rx_desc->status;
++		skb = buffer_info->skb;
++		buffer_info->skb = NULL;
++
++		prefetch(skb->data - NET_IP_ALIGN);
++
++		i++;
++		if (i == rx_ring->count)
++			i = 0;
++		next_rxd = E1000_RX_DESC(*rx_ring, i);
++		prefetch(next_rxd);
++
++		next_buffer = &rx_ring->buffer_info[i];
++
++		cleaned = 1;
++		cleaned_count++;
++		pci_unmap_single(pdev,
++				 buffer_info->dma,
++				 adapter->rx_buffer_len,
++				 PCI_DMA_FROMDEVICE);
++		buffer_info->dma = 0;
++
++		length = le16_to_cpu(rx_desc->length);
++
++		/* !EOP means multiple descriptors were used to store a single
++		 * packet, also make sure the frame isn't just CRC only */
++		if (!(status & E1000_RXD_STAT_EOP) || (length <= 4)) {
++			/* All receives must fit into a single buffer */
++			ndev_dbg(netdev, "%s: Receive packet consumed "
++				 "multiple buffers\n", netdev->name);
++			/* recycle */
++			buffer_info->skb = skb;
++			goto next_desc;
++		}
++
++		if (rx_desc->errors & E1000_RXD_ERR_FRAME_ERR_MASK) {
++			/* recycle */
++			buffer_info->skb = skb;
++			goto next_desc;
++		}
++
++		/* adjust length to remove Ethernet CRC */
++		length -= 4;
++
++		/* probably a little skewed due to removing CRC */
++		total_rx_bytes += length;
++		total_rx_packets++;
++
++		/* code added for copybreak, this should improve
++		 * performance for small packets with large amounts
++		 * of reassembly being done in the stack */
++		if (length < copybreak) {
++			struct sk_buff *new_skb =
++			    netdev_alloc_skb(netdev, length + NET_IP_ALIGN);
++			if (new_skb) {
++				skb_reserve(new_skb, NET_IP_ALIGN);
++				memcpy(new_skb->data - NET_IP_ALIGN,
++				       skb->data - NET_IP_ALIGN,
++				       length + NET_IP_ALIGN);
++				/* save the skb in buffer_info as good */
++				buffer_info->skb = skb;
++				skb = new_skb;
++			}
++			/* else just continue with the old one */
++		}
++		/* end copybreak code */
++		skb_put(skb, length);
++
++		/* Receive Checksum Offload */
++		e1000_rx_checksum(adapter,
++				  (u32)(status) |
++				  ((u32)(rx_desc->errors) << 24),
++				  le16_to_cpu(rx_desc->csum), skb);
++
++		e1000_receive_skb(adapter, netdev, skb,status,rx_desc->special);
++
++next_desc:
++		rx_desc->status = 0;
++
++		/* return some buffers to hardware, one at a time is too slow */
++		if (cleaned_count >= E1000_RX_BUFFER_WRITE) {
++			adapter->alloc_rx_buf(adapter, cleaned_count);
++			cleaned_count = 0;
++		}
++
++		/* use prefetched values */
++		rx_desc = next_rxd;
++		buffer_info = next_buffer;
++	}
++	rx_ring->next_to_clean = i;
++
++	cleaned_count = e1000_desc_unused(rx_ring);
++	if (cleaned_count)
++		adapter->alloc_rx_buf(adapter, cleaned_count);
++
++	adapter->total_rx_packets += total_rx_packets;
++	adapter->total_rx_bytes += total_rx_bytes;
++	return cleaned;
++}
++
++static void e1000_consume_page(struct e1000_buffer *bi, struct sk_buff *skb,
++			       u16 length)
++{
++	bi->page = NULL;
++	skb->len += length;
++	skb->data_len += length;
++	skb->truesize += length;
++}
++
++static void e1000_put_txbuf(struct e1000_adapter *adapter,
++			     struct e1000_buffer *buffer_info)
++{
++	if (buffer_info->dma) {
++		pci_unmap_page(adapter->pdev, buffer_info->dma,
++			       buffer_info->length, PCI_DMA_TODEVICE);
++		buffer_info->dma = 0;
++	}
++	if (buffer_info->skb) {
++		dev_kfree_skb_any(buffer_info->skb);
++		buffer_info->skb = NULL;
++	}
++}
++
++static void e1000_print_tx_hang(struct e1000_adapter *adapter)
++{
++	struct e1000_ring *tx_ring = adapter->tx_ring;
++	unsigned int i = tx_ring->next_to_clean;
++	unsigned int eop = tx_ring->buffer_info[i].next_to_watch;
++	struct e1000_tx_desc *eop_desc = E1000_TX_DESC(*tx_ring, eop);
++	struct net_device *netdev = adapter->netdev;
++
++	/* detected Tx unit hang */
++	ndev_err(netdev,
++		 "Detected Tx Unit Hang:\n"
++		 "  TDH                  <%x>\n"
++		 "  TDT                  <%x>\n"
++		 "  next_to_use          <%x>\n"
++		 "  next_to_clean        <%x>\n"
++		 "buffer_info[next_to_clean]:\n"
++		 "  time_stamp           <%lx>\n"
++		 "  next_to_watch        <%x>\n"
++		 "  jiffies              <%lx>\n"
++		 "  next_to_watch.status <%x>\n",
++		 readl(adapter->hw.hw_addr + tx_ring->head),
++		 readl(adapter->hw.hw_addr + tx_ring->tail),
++		 tx_ring->next_to_use,
++		 tx_ring->next_to_clean,
++		 tx_ring->buffer_info[eop].time_stamp,
++		 eop,
++		 jiffies,
++		 eop_desc->upper.fields.status);
++}
++
++/**
++ * e1000_clean_tx_irq - Reclaim resources after transmit completes
++ * @adapter: board private structure
++ *
++ * the return value indicates whether actual cleaning was done, there
++ * is no guarantee that everything was cleaned
++ **/
++static bool e1000_clean_tx_irq(struct e1000_adapter *adapter)
++{
++	struct net_device *netdev = adapter->netdev;
++	struct e1000_hw *hw = &adapter->hw;
++	struct e1000_ring *tx_ring = adapter->tx_ring;
++	struct e1000_tx_desc *tx_desc, *eop_desc;
++	struct e1000_buffer *buffer_info;
++	unsigned int i, eop;
++	unsigned int count = 0;
++	bool cleaned = 0;
++	unsigned int total_tx_bytes = 0, total_tx_packets = 0;
++
++	i = tx_ring->next_to_clean;
++	eop = tx_ring->buffer_info[i].next_to_watch;
++	eop_desc = E1000_TX_DESC(*tx_ring, eop);
++
++	while (eop_desc->upper.data & cpu_to_le32(E1000_TXD_STAT_DD)) {
++		for (cleaned = 0; !cleaned; ) {
++			tx_desc = E1000_TX_DESC(*tx_ring, i);
++			buffer_info = &tx_ring->buffer_info[i];
++			cleaned = (i == eop);
++
++			if (cleaned) {
++				struct sk_buff *skb = buffer_info->skb;
++				unsigned int segs, bytecount;
++				segs = skb_shinfo(skb)->gso_segs ?: 1;
++				/* multiply data chunks by size of headers */
++				bytecount = ((segs - 1) * skb_headlen(skb)) +
++					    skb->len;
++				total_tx_packets += segs;
++				total_tx_bytes += bytecount;
++			}
++
++			e1000_put_txbuf(adapter, buffer_info);
++			tx_desc->upper.data = 0;
++
++			i++;
++			if (i == tx_ring->count)
++				i = 0;
++		}
++
++		eop = tx_ring->buffer_info[i].next_to_watch;
++		eop_desc = E1000_TX_DESC(*tx_ring, eop);
++#define E1000_TX_WEIGHT 64
++		/* weight of a sort for tx, to avoid endless transmit cleanup */
++		if (count++ == E1000_TX_WEIGHT)
++			break;
++	}
++
++	tx_ring->next_to_clean = i;
++
++#define TX_WAKE_THRESHOLD 32
++	if (cleaned && netif_carrier_ok(netdev) &&
++		     e1000_desc_unused(tx_ring) >= TX_WAKE_THRESHOLD) {
++		/* Make sure that anybody stopping the queue after this
++		 * sees the new next_to_clean.
++		 */
++		smp_mb();
++
++		if (netif_queue_stopped(netdev) &&
++		    !(test_bit(__E1000_DOWN, &adapter->state))) {
++			netif_wake_queue(netdev);
++			++adapter->restart_queue;
++		}
++	}
++
++	if (adapter->detect_tx_hung) {
++		/* Detect a transmit hang in hardware, this serializes the
++		 * check with the clearing of time_stamp and movement of i */
++		adapter->detect_tx_hung = 0;
++		if (tx_ring->buffer_info[eop].dma &&
++		    time_after(jiffies, tx_ring->buffer_info[eop].time_stamp
++			       + (adapter->tx_timeout_factor * HZ))
++		    && !(er32(STATUS) &
++			 E1000_STATUS_TXOFF)) {
++			e1000_print_tx_hang(adapter);
++			netif_stop_queue(netdev);
++		}
++	}
++	adapter->total_tx_bytes += total_tx_bytes;
++	adapter->total_tx_packets += total_tx_packets;
++	return cleaned;
++}
++
++/**
++ * e1000_clean_rx_irq_jumbo - Send received data up the network stack; legacy
++ * @adapter: board private structure
++ *
++ * the return value indicates whether actual cleaning was done, there
++ * is no guarantee that everything was cleaned
++ **/
++static bool e1000_clean_rx_irq_jumbo(struct e1000_adapter *adapter,
++				     int *work_done, int work_to_do)
++{
++	struct net_device *netdev = adapter->netdev;
++	struct pci_dev *pdev = adapter->pdev;
++	struct e1000_ring *rx_ring = adapter->rx_ring;
++	struct e1000_rx_desc *rx_desc, *next_rxd;
++	struct e1000_buffer *buffer_info, *next_buffer;
++	u32 length;
++	unsigned int i;
++	int cleaned_count = 0;
++	bool cleaned = 0;
++	unsigned int total_rx_bytes = 0, total_rx_packets = 0;
++
++	i = rx_ring->next_to_clean;
++	rx_desc = E1000_RX_DESC(*rx_ring, i);
++	buffer_info = &rx_ring->buffer_info[i];
++
++	while (rx_desc->status & E1000_RXD_STAT_DD) {
++		struct sk_buff *skb;
++		u8 status;
++
++		if (*work_done >= work_to_do)
++			break;
++		(*work_done)++;
++
++		status = rx_desc->status;
++		skb = buffer_info->skb;
++		buffer_info->skb = NULL;
++
++		i++;
++		if (i == rx_ring->count)
++			i = 0;
++		next_rxd = E1000_RX_DESC(*rx_ring, i);
++		prefetch(next_rxd);
++
++		next_buffer = &rx_ring->buffer_info[i];
++
++		cleaned = 1;
++		cleaned_count++;
++		pci_unmap_page(pdev,
++			       buffer_info->dma,
++			       PAGE_SIZE,
++			       PCI_DMA_FROMDEVICE);
++		buffer_info->dma = 0;
++
++		length = le16_to_cpu(rx_desc->length);
++
++		/* errors is only valid for DD + EOP descriptors */
++		if ((status & E1000_RXD_STAT_EOP) &&
++		    (rx_desc->errors & E1000_RXD_ERR_FRAME_ERR_MASK)) {
++			/* recycle both page and skb */
++			buffer_info->skb = skb;
++			/* an error means any chain goes out the window too */
++			if (rx_ring->rx_skb_top)
++				dev_kfree_skb(rx_ring->rx_skb_top);
++			rx_ring->rx_skb_top = NULL;
++			goto next_desc;
++		}
++
++#define rxtop rx_ring->rx_skb_top
++		if (!(status & E1000_RXD_STAT_EOP)) {
++			/* this descriptor is only the beginning (or middle) */
++			if (!rxtop) {
++				/* this is the beginning of a chain */
++				rxtop = skb;
++				skb_fill_page_desc(rxtop, 0, buffer_info->page,
++						   0, length);
++			} else {
++				/* this is the middle of a chain */
++				skb_fill_page_desc(rxtop,
++						   skb_shinfo(rxtop)->nr_frags,
++						   buffer_info->page, 0,
++						   length);
++				/* re-use the skb, only consumed the page */
++				buffer_info->skb = skb;
++			}
++			e1000_consume_page(buffer_info, rxtop, length);
++			goto next_desc;
++		} else {
++			if (rxtop) {
++				/* end of the chain */
++				skb_fill_page_desc(rxtop,
++				    skb_shinfo(rxtop)->nr_frags,
++				    buffer_info->page, 0, length);
++				/* re-use the current skb, we only consumed the
++				 * page */
++				buffer_info->skb = skb;
++				skb = rxtop;
++				rxtop = NULL;
++				e1000_consume_page(buffer_info, skb, length);
++			} else {
++				/* no chain, got EOP, this buf is the packet
++				 * copybreak to save the put_page/alloc_page */
++				if (length <= copybreak &&
++				    skb_tailroom(skb) >= length) {
++					u8 *vaddr;
++					vaddr = kmap_atomic(buffer_info->page,
++							   KM_SKB_DATA_SOFTIRQ);
++					memcpy(skb_tail_pointer(skb),
++					       vaddr, length);
++					kunmap_atomic(vaddr,
++						      KM_SKB_DATA_SOFTIRQ);
++					/* re-use the page, so don't erase
++					 * buffer_info->page */
++					skb_put(skb, length);
++				} else {
++					skb_fill_page_desc(skb, 0,
++							   buffer_info->page, 0,
++							   length);
++					e1000_consume_page(buffer_info, skb,
++							   length);
++				}
++			}
++		}
++
++		/* Receive Checksum Offload XXX recompute due to CRC strip? */
++		e1000_rx_checksum(adapter,
++				  (u32)(status) |
++				  ((u32)(rx_desc->errors) << 24),
++				  le16_to_cpu(rx_desc->csum), skb);
++
++		pskb_trim(skb, skb->len - 4);
++
++		/* probably a little skewed due to removing CRC */
++		total_rx_bytes += skb->len;
++		total_rx_packets++;
++
++		/* eth type trans needs skb->data to point to something */
++		if (!pskb_may_pull(skb, ETH_HLEN)) {
++			ndev_err(netdev, "__pskb_pull_tail failed.\n");
++			dev_kfree_skb(skb);
++			goto next_desc;
++		}
++
++		e1000_receive_skb(adapter, netdev, skb,status,rx_desc->special);
++
++next_desc:
++		rx_desc->status = 0;
++
++		/* return some buffers to hardware, one at a time is too slow */
++		if (cleaned_count >= E1000_RX_BUFFER_WRITE) {
++			adapter->alloc_rx_buf(adapter, cleaned_count);
++			cleaned_count = 0;
++		}
++
++		/* use prefetched values */
++		rx_desc = next_rxd;
++		buffer_info = next_buffer;
++	}
++	rx_ring->next_to_clean = i;
++
++	cleaned_count = e1000_desc_unused(rx_ring);
++	if (cleaned_count)
++		adapter->alloc_rx_buf(adapter, cleaned_count);
++
++	adapter->total_rx_packets += total_rx_packets;
++	adapter->total_rx_bytes += total_rx_bytes;
++	return cleaned;
++}
++
++/**
++ * e1000_clean_rx_irq_ps - Send received data up the network stack; packet split
++ * @adapter: board private structure
++ *
++ * the return value indicates whether actual cleaning was done, there
++ * is no guarantee that everything was cleaned
++ **/
++static bool e1000_clean_rx_irq_ps(struct e1000_adapter *adapter,
++				  int *work_done, int work_to_do)
++{
++	union e1000_rx_desc_packet_split *rx_desc, *next_rxd;
++	struct net_device *netdev = adapter->netdev;
++	struct pci_dev *pdev = adapter->pdev;
++	struct e1000_ring *rx_ring = adapter->rx_ring;
++	struct e1000_buffer *buffer_info, *next_buffer;
++	struct e1000_ps_page *ps_page;
++	struct sk_buff *skb;
++	unsigned int i, j;
++	u32 length, staterr;
++	int cleaned_count = 0;
++	bool cleaned = 0;
++	unsigned int total_rx_bytes = 0, total_rx_packets = 0;
++
++	i = rx_ring->next_to_clean;
++	rx_desc = E1000_RX_DESC_PS(*rx_ring, i);
++	staterr = le32_to_cpu(rx_desc->wb.middle.status_error);
++	buffer_info = &rx_ring->buffer_info[i];
++
++	while (staterr & E1000_RXD_STAT_DD) {
++		if (*work_done >= work_to_do)
++			break;
++		(*work_done)++;
++		skb = buffer_info->skb;
++
++		/* in the packet split case this is header only */
++		prefetch(skb->data - NET_IP_ALIGN);
++
++		i++;
++		if (i == rx_ring->count)
++			i = 0;
++		next_rxd = E1000_RX_DESC_PS(*rx_ring, i);
++		prefetch(next_rxd);
++
++		next_buffer = &rx_ring->buffer_info[i];
++
++		cleaned = 1;
++		cleaned_count++;
++		pci_unmap_single(pdev, buffer_info->dma,
++				 adapter->rx_ps_bsize0,
++				 PCI_DMA_FROMDEVICE);
++		buffer_info->dma = 0;
++
++		if (!(staterr & E1000_RXD_STAT_EOP)) {
++			ndev_dbg(netdev, "%s: Packet Split buffers didn't pick "
++				 "up the full packet\n", netdev->name);
++			dev_kfree_skb_irq(skb);
++			goto next_desc;
++		}
++
++		if (staterr & E1000_RXDEXT_ERR_FRAME_ERR_MASK) {
++			dev_kfree_skb_irq(skb);
++			goto next_desc;
++		}
++
++		length = le16_to_cpu(rx_desc->wb.middle.length0);
++
++		if (!length) {
++			ndev_dbg(netdev, "%s: Last part of the packet spanning"
++				 " multiple descriptors\n", netdev->name);
++			dev_kfree_skb_irq(skb);
++			goto next_desc;
++		}
++
++		/* Good Receive */
++		skb_put(skb, length);
++
++		{
++		/* this looks ugly, but it seems compiler issues make it
++		   more efficient than reusing j */
++		int l1 = le16_to_cpu(rx_desc->wb.upper.length[0]);
++
++		/* page alloc/put takes too long and effects small packet
++		 * throughput, so unsplit small packets and save the alloc/put*/
++		if (l1 && (l1 <= copybreak) &&
++		    ((length + l1) <= adapter->rx_ps_bsize0)) {
++			u8 *vaddr;
++
++			ps_page = &rx_ring->ps_pages[i * PS_PAGE_BUFFERS];
++
++			/* there is no documentation about how to call
++			 * kmap_atomic, so we can't hold the mapping
++			 * very long */
++			pci_dma_sync_single_for_cpu(pdev, ps_page->dma,
++				PAGE_SIZE, PCI_DMA_FROMDEVICE);
++			vaddr = kmap_atomic(ps_page->page, KM_SKB_DATA_SOFTIRQ);
++			memcpy(skb_tail_pointer(skb), vaddr, l1);
++			kunmap_atomic(vaddr, KM_SKB_DATA_SOFTIRQ);
++			pci_dma_sync_single_for_device(pdev, ps_page->dma,
++				PAGE_SIZE, PCI_DMA_FROMDEVICE);
++			/* remove the CRC */
++			l1 -= 4;
++			skb_put(skb, l1);
++			goto copydone;
++		} /* if */
++		}
++
++		for (j = 0; j < PS_PAGE_BUFFERS; j++) {
++			length = le16_to_cpu(rx_desc->wb.upper.length[j]);
++			if (!length)
++				break;
++
++			ps_page = &rx_ring->ps_pages[(i * PS_PAGE_BUFFERS) + j];
++			pci_unmap_page(pdev, ps_page->dma, PAGE_SIZE,
++				       PCI_DMA_FROMDEVICE);
++			ps_page->dma = 0;
++			skb_fill_page_desc(skb, j, ps_page->page, 0, length);
++			ps_page->page = NULL;
++			skb->len += length;
++			skb->data_len += length;
++			skb->truesize += length;
++		}
++
++		/* strip the ethernet crc, problem is we're using pages now so
++		 * this whole operation can get a little cpu intensive */
++		pskb_trim(skb, skb->len - 4);
++
++copydone:
++		total_rx_bytes += skb->len;
++		total_rx_packets++;
++
++		e1000_rx_checksum(adapter, staterr, le16_to_cpu(
++			rx_desc->wb.lower.hi_dword.csum_ip.csum), skb);
++
++		if (rx_desc->wb.upper.header_status &
++			   cpu_to_le16(E1000_RXDPS_HDRSTAT_HDRSP))
++			adapter->rx_hdr_split++;
++
++		e1000_receive_skb(adapter, netdev, skb,
++				  staterr, rx_desc->wb.middle.vlan);
++
++next_desc:
++		rx_desc->wb.middle.status_error &= cpu_to_le32(~0xFF);
++		buffer_info->skb = NULL;
++
++		/* return some buffers to hardware, one at a time is too slow */
++		if (cleaned_count >= E1000_RX_BUFFER_WRITE) {
++			adapter->alloc_rx_buf(adapter, cleaned_count);
++			cleaned_count = 0;
++		}
++
++		/* use prefetched values */
++		rx_desc = next_rxd;
++		buffer_info = next_buffer;
++
++		staterr = le32_to_cpu(rx_desc->wb.middle.status_error);
++	}
++	rx_ring->next_to_clean = i;
++
++	cleaned_count = e1000_desc_unused(rx_ring);
++	if (cleaned_count)
++		adapter->alloc_rx_buf(adapter, cleaned_count);
++
++	adapter->total_rx_packets += total_rx_packets;
++	adapter->total_rx_bytes += total_rx_bytes;
++	return cleaned;
++}
++
++/**
++ * e1000_clean_rx_ring - Free Rx Buffers per Queue
++ * @adapter: board private structure
++ **/
++static void e1000_clean_rx_ring(struct e1000_adapter *adapter)
++{
++	struct e1000_ring *rx_ring = adapter->rx_ring;
++	struct e1000_buffer *buffer_info;
++	struct e1000_ps_page *ps_page;
++	struct pci_dev *pdev = adapter->pdev;
++	unsigned long size;
++	unsigned int i, j;
++
++	/* Free all the Rx ring sk_buffs */
++	for (i = 0; i < rx_ring->count; i++) {
++		buffer_info = &rx_ring->buffer_info[i];
++		if (buffer_info->dma) {
++			if (adapter->clean_rx == e1000_clean_rx_irq)
++				pci_unmap_single(pdev, buffer_info->dma,
++						 adapter->rx_buffer_len,
++						 PCI_DMA_FROMDEVICE);
++			else if (adapter->clean_rx == e1000_clean_rx_irq_jumbo)
++				pci_unmap_page(pdev, buffer_info->dma,
++					       PAGE_SIZE, PCI_DMA_FROMDEVICE);
++			else if (adapter->clean_rx == e1000_clean_rx_irq_ps)
++				pci_unmap_single(pdev, buffer_info->dma,
++						 adapter->rx_ps_bsize0,
++						 PCI_DMA_FROMDEVICE);
++			buffer_info->dma = 0;
++		}
++
++		if (buffer_info->page) {
++			put_page(buffer_info->page);
++			buffer_info->page = NULL;
++		}
++
++		if (buffer_info->skb) {
++			dev_kfree_skb(buffer_info->skb);
++			buffer_info->skb = NULL;
++		}
++
++		for (j = 0; j < PS_PAGE_BUFFERS; j++) {
++			ps_page = &rx_ring->ps_pages[(i * PS_PAGE_BUFFERS)
++						     + j];
++			if (!ps_page->page)
++				break;
++			pci_unmap_page(pdev, ps_page->dma, PAGE_SIZE,
++				       PCI_DMA_FROMDEVICE);
++			ps_page->dma = 0;
++			put_page(ps_page->page);
++			ps_page->page = NULL;
++		}
++	}
++
++	/* there also may be some cached data from a chained receive */
++	if (rx_ring->rx_skb_top) {
++		dev_kfree_skb(rx_ring->rx_skb_top);
++		rx_ring->rx_skb_top = NULL;
++	}
++
++	size = sizeof(struct e1000_buffer) * rx_ring->count;
++	memset(rx_ring->buffer_info, 0, size);
++	size = sizeof(struct e1000_ps_page)
++	       * (rx_ring->count * PS_PAGE_BUFFERS);
++	memset(rx_ring->ps_pages, 0, size);
++
++	/* Zero out the descriptor ring */
++	memset(rx_ring->desc, 0, rx_ring->size);
++
++	rx_ring->next_to_clean = 0;
++	rx_ring->next_to_use = 0;
++
++	writel(0, adapter->hw.hw_addr + rx_ring->head);
++	writel(0, adapter->hw.hw_addr + rx_ring->tail);
++}
++
++/**
++ * e1000_intr_msi - Interrupt Handler
++ * @irq: interrupt number
++ * @data: pointer to a network interface device structure
++ **/
++static irqreturn_t e1000_intr_msi(int irq, void *data)
++{
++	struct net_device *netdev = data;
++	struct e1000_adapter *adapter = netdev_priv(netdev);
++	struct e1000_hw *hw = &adapter->hw;
++	u32 icr = er32(ICR);
++
++	/* read ICR disables interrupts using IAM, so keep up with our
++	 * enable/disable accounting */
++	atomic_inc(&adapter->irq_sem);
++
++	if (icr & (E1000_ICR_RXSEQ | E1000_ICR_LSC)) {
++		hw->mac.get_link_status = 1;
++		/* ICH8 workaround-- Call gig speed drop workaround on cable
++		 * disconnect (LSC) before accessing any PHY registers */
++		if ((adapter->flags & FLAG_LSC_GIG_SPEED_DROP) &&
++		    (!(er32(STATUS) & E1000_STATUS_LU)))
++			e1000_gig_downshift_workaround_ich8lan(hw);
++
++		/* 80003ES2LAN workaround-- For packet buffer work-around on
++		 * link down event; disable receives here in the ISR and reset
++		 * adapter in watchdog */
++		if (netif_carrier_ok(netdev) &&
++		    adapter->flags & FLAG_RX_NEEDS_RESTART) {
++			/* disable receives */
++			u32 rctl = er32(RCTL);
++			ew32(RCTL, rctl & ~E1000_RCTL_EN);
++		}
++		/* guard against interrupt when we're going down */
++		if (!test_bit(__E1000_DOWN, &adapter->state))
++			mod_timer(&adapter->watchdog_timer, jiffies + 1);
++	}
++
++	if (netif_rx_schedule_prep(netdev)) {
++		adapter->total_tx_bytes = 0;
++		adapter->total_tx_packets = 0;
++		adapter->total_rx_bytes = 0;
++		adapter->total_rx_packets = 0;
++		__netif_rx_schedule(netdev);
++	} else {
++		atomic_dec(&adapter->irq_sem);
++	}
++
++	return IRQ_HANDLED;
++}
++
++/**
++ * e1000_intr - Interrupt Handler
++ * @irq: interrupt number
++ * @data: pointer to a network interface device structure
++ **/
++static irqreturn_t e1000_intr(int irq, void *data)
++{
++	struct net_device *netdev = data;
++	struct e1000_adapter *adapter = netdev_priv(netdev);
++	struct e1000_hw *hw = &adapter->hw;
++
++	u32 rctl, icr = er32(ICR);
++	if (!icr)
++		return IRQ_NONE;  /* Not our interrupt */
++
++	/* IMS will not auto-mask if INT_ASSERTED is not set, and if it is
++	 * not set, then the adapter didn't send an interrupt */
++	if (!(icr & E1000_ICR_INT_ASSERTED))
++		return IRQ_NONE;
++
++	/* Interrupt Auto-Mask...upon reading ICR,
++	 * interrupts are masked.  No need for the
++	 * IMC write, but it does mean we should
++	 * account for it ASAP. */
++	atomic_inc(&adapter->irq_sem);
++
++	if (icr & (E1000_ICR_RXSEQ | E1000_ICR_LSC)) {
++		hw->mac.get_link_status = 1;
++		/* ICH8 workaround-- Call gig speed drop workaround on cable
++		 * disconnect (LSC) before accessing any PHY registers */
++		if ((adapter->flags & FLAG_LSC_GIG_SPEED_DROP) &&
++		    (!(er32(STATUS) & E1000_STATUS_LU)))
++			e1000_gig_downshift_workaround_ich8lan(hw);
++
++		/* 80003ES2LAN workaround--
++		 * For packet buffer work-around on link down event;
++		 * disable receives here in the ISR and
++		 * reset adapter in watchdog
++		 */
++		if (netif_carrier_ok(netdev) &&
++		    (adapter->flags & FLAG_RX_NEEDS_RESTART)) {
++			/* disable receives */
++			rctl = er32(RCTL);
++			ew32(RCTL, rctl & ~E1000_RCTL_EN);
++		}
++		/* guard against interrupt when we're going down */
++		if (!test_bit(__E1000_DOWN, &adapter->state))
++			mod_timer(&adapter->watchdog_timer, jiffies + 1);
++	}
++
++	if (netif_rx_schedule_prep(netdev)) {
++		adapter->total_tx_bytes = 0;
++		adapter->total_tx_packets = 0;
++		adapter->total_rx_bytes = 0;
++		adapter->total_rx_packets = 0;
++		__netif_rx_schedule(netdev);
++	} else {
++		atomic_dec(&adapter->irq_sem);
++	}
++
++	return IRQ_HANDLED;
++}
++
++static int e1000_request_irq(struct e1000_adapter *adapter)
++{
++	struct net_device *netdev = adapter->netdev;
++	void (*handler) = &e1000_intr;
++	int irq_flags = IRQF_SHARED;
++	int err;
++
++	err = pci_enable_msi(adapter->pdev);
++	if (err) {
++		ndev_warn(netdev,
++		 "Unable to allocate MSI interrupt Error: %d\n", err);
++	} else {
++		adapter->flags |= FLAG_MSI_ENABLED;
++		handler = &e1000_intr_msi;
++		irq_flags = 0;
++	}
++
++	err = request_irq(adapter->pdev->irq, handler, irq_flags, netdev->name,
++			  netdev);
++	if (err) {
++		if (adapter->flags & FLAG_MSI_ENABLED)
++			pci_disable_msi(adapter->pdev);
++		ndev_err(netdev,
++		       "Unable to allocate interrupt Error: %d\n", err);
++	}
++
++	return err;
++}
++
++static void e1000_free_irq(struct e1000_adapter *adapter)
++{
++	struct net_device *netdev = adapter->netdev;
++
++	free_irq(adapter->pdev->irq, netdev);
++	if (adapter->flags & FLAG_MSI_ENABLED) {
++		pci_disable_msi(adapter->pdev);
++		adapter->flags &= ~FLAG_MSI_ENABLED;
++	}
++}
++
++/**
++ * e1000_irq_disable - Mask off interrupt generation on the NIC
++ **/
++static void e1000_irq_disable(struct e1000_adapter *adapter)
++{
++	struct e1000_hw *hw = &adapter->hw;
++
++	atomic_inc(&adapter->irq_sem);
++	ew32(IMC, ~0);
++	e1e_flush();
++	synchronize_irq(adapter->pdev->irq);
++}
++
++/**
++ * e1000_irq_enable - Enable default interrupt generation settings
++ **/
++static void e1000_irq_enable(struct e1000_adapter *adapter)
++{
++	struct e1000_hw *hw = &adapter->hw;
++
++	if (atomic_dec_and_test(&adapter->irq_sem)) {
++		ew32(IMS, IMS_ENABLE_MASK);
++		e1e_flush();
++	}
++}
++
++/**
++ * e1000_get_hw_control - get control of the h/w from f/w
++ * @adapter: address of board private structure
++ *
++ * e1000_get_hw_control sets {CTRL_EXT|FWSM}:DRV_LOAD bit.
++ * For ASF and Pass Through versions of f/w this means that
++ * the driver is loaded. For AMT version (only with 82573)
++ * of the f/w this means that the network i/f is open.
++ **/
++static void e1000_get_hw_control(struct e1000_adapter *adapter)
++{
++	struct e1000_hw *hw = &adapter->hw;
++	u32 ctrl_ext;
++	u32 swsm;
++
++	/* Let firmware know the driver has taken over */
++	if (adapter->flags & FLAG_HAS_SWSM_ON_LOAD) {
++		swsm = er32(SWSM);
++		ew32(SWSM, swsm | E1000_SWSM_DRV_LOAD);
++	} else if (adapter->flags & FLAG_HAS_CTRLEXT_ON_LOAD) {
++		ctrl_ext = er32(CTRL_EXT);
++		ew32(CTRL_EXT,
++				ctrl_ext | E1000_CTRL_EXT_DRV_LOAD);
++	}
++}
++
++/**
++ * e1000_release_hw_control - release control of the h/w to f/w
++ * @adapter: address of board private structure
++ *
++ * e1000_release_hw_control resets {CTRL_EXT|FWSM}:DRV_LOAD bit.
++ * For ASF and Pass Through versions of f/w this means that the
++ * driver is no longer loaded. For AMT version (only with 82573) i
++ * of the f/w this means that the network i/f is closed.
++ *
++ **/
++static void e1000_release_hw_control(struct e1000_adapter *adapter)
++{
++	struct e1000_hw *hw = &adapter->hw;
++	u32 ctrl_ext;
++	u32 swsm;
++
++	/* Let firmware taken over control of h/w */
++	if (adapter->flags & FLAG_HAS_SWSM_ON_LOAD) {
++		swsm = er32(SWSM);
++		ew32(SWSM, swsm & ~E1000_SWSM_DRV_LOAD);
++	} else if (adapter->flags & FLAG_HAS_CTRLEXT_ON_LOAD) {
++		ctrl_ext = er32(CTRL_EXT);
++		ew32(CTRL_EXT,
++				ctrl_ext & ~E1000_CTRL_EXT_DRV_LOAD);
++	}
++}
++
++static void e1000_release_manageability(struct e1000_adapter *adapter)
++{
++	if (adapter->flags & FLAG_MNG_PT_ENABLED) {
++		struct e1000_hw *hw = &adapter->hw;
++
++		u32 manc = er32(MANC);
++
++		/* re-enable hardware interception of ARP */
++		manc |= E1000_MANC_ARP_EN;
++		manc &= ~E1000_MANC_EN_MNG2HOST;
++
++		/* don't explicitly have to mess with MANC2H since
++		 * MANC has an enable disable that gates MANC2H */
++		ew32(MANC, manc);
++	}
++}
++
++/**
++ * @e1000_alloc_ring - allocate memory for a ring structure
++ **/
++static int e1000_alloc_ring_dma(struct e1000_adapter *adapter,
++				struct e1000_ring *ring)
++{
++	struct pci_dev *pdev = adapter->pdev;
++
++	ring->desc = pci_alloc_consistent(pdev, ring->size, &ring->dma);
++	if (!ring->desc)
++		return -ENOMEM;
++
++	return 0;
++}
++
++/**
++ * e1000_setup_tx_resources - allocate Tx resources (Descriptors)
++ * @adapter: board private structure
++ *
++ * Return 0 on success, negative on failure
++ **/
++int e1000_setup_tx_resources(struct e1000_adapter *adapter)
++{
++	struct e1000_ring *tx_ring = adapter->tx_ring;
++	int err = -ENOMEM, size;
++
++	size = sizeof(struct e1000_buffer) * tx_ring->count;
++	tx_ring->buffer_info = vmalloc(size);
++	if (!tx_ring->buffer_info)
++		goto err;
++	memset(tx_ring->buffer_info, 0, size);
++
++	/* round up to nearest 4K */
++	tx_ring->size = tx_ring->count * sizeof(struct e1000_tx_desc);
++	tx_ring->size = ALIGN(tx_ring->size, 4096);
++
++	err = e1000_alloc_ring_dma(adapter, tx_ring);
++	if (err)
++		goto err;
++
++	tx_ring->next_to_use = 0;
++	tx_ring->next_to_clean = 0;
++	spin_lock_init(&adapter->tx_queue_lock);
++
++	return 0;
++err:
++	vfree(tx_ring->buffer_info);
++	ndev_err(adapter->netdev,
++	"Unable to allocate memory for the transmit descriptor ring\n");
++	return err;
++}
++
++/**
++ * e1000_setup_rx_resources - allocate Rx resources (Descriptors)
++ * @adapter: board private structure
++ *
++ * Returns 0 on success, negative on failure
++ **/
++int e1000_setup_rx_resources(struct e1000_adapter *adapter)
++{
++	struct e1000_ring *rx_ring = adapter->rx_ring;
++	int size, desc_len, err = -ENOMEM;
++
++	size = sizeof(struct e1000_buffer) * rx_ring->count;
++	rx_ring->buffer_info = vmalloc(size);
++	if (!rx_ring->buffer_info)
++		goto err;
++	memset(rx_ring->buffer_info, 0, size);
++
++	rx_ring->ps_pages = kcalloc(rx_ring->count * PS_PAGE_BUFFERS,
++				    sizeof(struct e1000_ps_page),
++				    GFP_KERNEL);
++	if (!rx_ring->ps_pages)
++		goto err;
++
++	desc_len = sizeof(union e1000_rx_desc_packet_split);
++
++	/* Round up to nearest 4K */
++	rx_ring->size = rx_ring->count * desc_len;
++	rx_ring->size = ALIGN(rx_ring->size, 4096);
++
++	err = e1000_alloc_ring_dma(adapter, rx_ring);
++	if (err)
++		goto err;
++
++	rx_ring->next_to_clean = 0;
++	rx_ring->next_to_use = 0;
++	rx_ring->rx_skb_top = NULL;
++
++	return 0;
++err:
++	vfree(rx_ring->buffer_info);
++	kfree(rx_ring->ps_pages);
++	ndev_err(adapter->netdev,
++	"Unable to allocate memory for the transmit descriptor ring\n");
++	return err;
++}
++
++/**
++ * e1000_clean_tx_ring - Free Tx Buffers
++ * @adapter: board private structure
++ **/
++static void e1000_clean_tx_ring(struct e1000_adapter *adapter)
++{
++	struct e1000_ring *tx_ring = adapter->tx_ring;
++	struct e1000_buffer *buffer_info;
++	unsigned long size;
++	unsigned int i;
++
++	for (i = 0; i < tx_ring->count; i++) {
++		buffer_info = &tx_ring->buffer_info[i];
++		e1000_put_txbuf(adapter, buffer_info);
++	}
++
++	size = sizeof(struct e1000_buffer) * tx_ring->count;
++	memset(tx_ring->buffer_info, 0, size);
++
++	memset(tx_ring->desc, 0, tx_ring->size);
++
++	tx_ring->next_to_use = 0;
++	tx_ring->next_to_clean = 0;
++	tx_ring->last_tx_tso = 0;
++
++	writel(0, adapter->hw.hw_addr + tx_ring->head);
++	writel(0, adapter->hw.hw_addr + tx_ring->tail);
++}
++
++/**
++ * e1000_free_tx_resources - Free Tx Resources per Queue
++ * @adapter: board private structure
++ *
++ * Free all transmit software resources
++ **/
++void e1000_free_tx_resources(struct e1000_adapter *adapter)
++{
++	struct pci_dev *pdev = adapter->pdev;
++	struct e1000_ring *tx_ring = adapter->tx_ring;
++
++	e1000_clean_tx_ring(adapter);
++
++	vfree(tx_ring->buffer_info);
++	tx_ring->buffer_info = NULL;
++
++	pci_free_consistent(pdev, tx_ring->size, tx_ring->desc, tx_ring->dma);
++	tx_ring->desc = NULL;
++}
++
++/**
++ * e1000_free_rx_resources - Free Rx Resources
++ * @adapter: board private structure
++ *
++ * Free all receive software resources
++ **/
++
++void e1000_free_rx_resources(struct e1000_adapter *adapter)
++{
++	struct pci_dev *pdev = adapter->pdev;
++	struct e1000_ring *rx_ring = adapter->rx_ring;
++
++	e1000_clean_rx_ring(adapter);
++
++	vfree(rx_ring->buffer_info);
++	rx_ring->buffer_info = NULL;
++
++	kfree(rx_ring->ps_pages);
++	rx_ring->ps_pages = NULL;
++
++	pci_free_consistent(pdev, rx_ring->size, rx_ring->desc, rx_ring->dma);
++	rx_ring->desc = NULL;
++}
++
++/**
++ * e1000_update_itr - update the dynamic ITR value based on statistics
++ *      Stores a new ITR value based on packets and byte
++ *      counts during the last interrupt.  The advantage of per interrupt
++ *      computation is faster updates and more accurate ITR for the current
++ *      traffic pattern.  Constants in this function were computed
++ *      based on theoretical maximum wire speed and thresholds were set based
++ *      on testing data as well as attempting to minimize response time
++ *      while increasing bulk throughput.
++ *      this functionality is controlled by the InterruptThrottleRate module
++ *      parameter (see e1000_param.c)
++ * @adapter: pointer to adapter
++ * @itr_setting: current adapter->itr
++ * @packets: the number of packets during this measurement interval
++ * @bytes: the number of bytes during this measurement interval
++ **/
++static unsigned int e1000_update_itr(struct e1000_adapter *adapter,
++				     u16 itr_setting, int packets,
++				     int bytes)
++{
++	unsigned int retval = itr_setting;
++
++	if (packets == 0)
++		goto update_itr_done;
++
++	switch (itr_setting) {
++	case lowest_latency:
++		/* handle TSO and jumbo frames */
++		if (bytes/packets > 8000)
++			retval = bulk_latency;
++		else if ((packets < 5) && (bytes > 512)) {
++			retval = low_latency;
++		}
++		break;
++	case low_latency:  /* 50 usec aka 20000 ints/s */
++		if (bytes > 10000) {
++			/* this if handles the TSO accounting */
++			if (bytes/packets > 8000) {
++				retval = bulk_latency;
++			} else if ((packets < 10) || ((bytes/packets) > 1200)) {
++				retval = bulk_latency;
++			} else if ((packets > 35)) {
++				retval = lowest_latency;
++			}
++		} else if (bytes/packets > 2000) {
++			retval = bulk_latency;
++		} else if (packets <= 2 && bytes < 512) {
++			retval = lowest_latency;
++		}
++		break;
++	case bulk_latency: /* 250 usec aka 4000 ints/s */
++		if (bytes > 25000) {
++			if (packets > 35) {
++				retval = low_latency;
++			}
++		} else if (bytes < 6000) {
++			retval = low_latency;
++		}
++		break;
++	}
++
++update_itr_done:
++	return retval;
++}
++
++static void e1000_set_itr(struct e1000_adapter *adapter)
++{
++	struct e1000_hw *hw = &adapter->hw;
++	u16 current_itr;
++	u32 new_itr = adapter->itr;
++
++	/* for non-gigabit speeds, just fix the interrupt rate at 4000 */
++	if (adapter->link_speed != SPEED_1000) {
++		current_itr = 0;
++		new_itr = 4000;
++		goto set_itr_now;
++	}
++
++	adapter->tx_itr = e1000_update_itr(adapter,
++				    adapter->tx_itr,
++				    adapter->total_tx_packets,
++				    adapter->total_tx_bytes);
++	/* conservative mode (itr 3) eliminates the lowest_latency setting */
++	if (adapter->itr_setting == 3 && adapter->tx_itr == lowest_latency)
++		adapter->tx_itr = low_latency;
++
++	adapter->rx_itr = e1000_update_itr(adapter,
++				    adapter->rx_itr,
++				    adapter->total_rx_packets,
++				    adapter->total_rx_bytes);
++	/* conservative mode (itr 3) eliminates the lowest_latency setting */
++	if (adapter->itr_setting == 3 && adapter->rx_itr == lowest_latency)
++		adapter->rx_itr = low_latency;
++
++	current_itr = max(adapter->rx_itr, adapter->tx_itr);
++
++	switch (current_itr) {
++	/* counts and packets in update_itr are dependent on these numbers */
++	case lowest_latency:
++		new_itr = 70000;
++		break;
++	case low_latency:
++		new_itr = 20000; /* aka hwitr = ~200 */
++		break;
++	case bulk_latency:
++		new_itr = 4000;
++		break;
++	default:
++		break;
++	}
++
++set_itr_now:
++	if (new_itr != adapter->itr) {
++		/* this attempts to bias the interrupt rate towards Bulk
++		 * by adding intermediate steps when interrupt rate is
++		 * increasing */
++		new_itr = new_itr > adapter->itr ?
++			     min(adapter->itr + (new_itr >> 2), new_itr) :
++			     new_itr;
++		adapter->itr = new_itr;
++		ew32(ITR, 1000000000 / (new_itr * 256));
++	}
++}
++
++/**
++ * e1000_clean - NAPI Rx polling callback
++ * @adapter: board private structure
++ **/
++static int e1000_clean(struct net_device *poll_dev, int *budget)
++{
++	struct e1000_adapter *adapter;
++	int work_to_do = min(*budget, poll_dev->quota);
++	int tx_cleaned = 0, work_done = 0;
++
++	/* Must NOT use netdev_priv macro here. */
++	adapter = poll_dev->priv;
++
++	/* Keep link state information with original netdev */
++	if (!netif_carrier_ok(poll_dev))
++		goto quit_polling;
++
++	/* e1000_clean is called per-cpu.  This lock protects
++	 * tx_ring from being cleaned by multiple cpus
++	 * simultaneously.  A failure obtaining the lock means
++	 * tx_ring is currently being cleaned anyway. */
++	if (spin_trylock(&adapter->tx_queue_lock)) {
++		tx_cleaned = e1000_clean_tx_irq(adapter);
++		spin_unlock(&adapter->tx_queue_lock);
++	}
++
++	adapter->clean_rx(adapter, &work_done, work_to_do);
++	*budget -= work_done;
++	poll_dev->quota -= work_done;
++
++	/* If no Tx and not enough Rx work done, exit the polling mode */
++	if ((!tx_cleaned && (work_done == 0)) ||
++	   !netif_running(poll_dev)) {
++quit_polling:
++		if (adapter->itr_setting & 3)
++			e1000_set_itr(adapter);
++		netif_rx_complete(poll_dev);
++		if (test_bit(__E1000_DOWN, &adapter->state))
++			atomic_dec(&adapter->irq_sem);
++		else
++			e1000_irq_enable(adapter);
++		return 0;
++	}
++
++	return 1;
++}
++
++static void e1000_vlan_rx_add_vid(struct net_device *netdev, u16 vid)
++{
++	struct e1000_adapter *adapter = netdev_priv(netdev);
++	struct e1000_hw *hw = &adapter->hw;
++	u32 vfta, index;
++
++	/* don't update vlan cookie if already programmed */
++	if ((adapter->hw.mng_cookie.status &
++	     E1000_MNG_DHCP_COOKIE_STATUS_VLAN) &&
++	    (vid == adapter->mng_vlan_id))
++		return;
++	/* add VID to filter table */
++	index = (vid >> 5) & 0x7F;
++	vfta = E1000_READ_REG_ARRAY(hw, E1000_VFTA, index);
++	vfta |= (1 << (vid & 0x1F));
++	e1000_write_vfta(hw, index, vfta);
++}
++
++static void e1000_vlan_rx_kill_vid(struct net_device *netdev, u16 vid)
++{
++	struct e1000_adapter *adapter = netdev_priv(netdev);
++	struct e1000_hw *hw = &adapter->hw;
++	u32 vfta, index;
++
++	e1000_irq_disable(adapter);
++	vlan_group_set_device(adapter->vlgrp, vid, NULL);
++	e1000_irq_enable(adapter);
++
++	if ((adapter->hw.mng_cookie.status &
++	     E1000_MNG_DHCP_COOKIE_STATUS_VLAN) &&
++	    (vid == adapter->mng_vlan_id)) {
++		/* release control to f/w */
++		e1000_release_hw_control(adapter);
++		return;
++	}
++
++	/* remove VID from filter table */
++	index = (vid >> 5) & 0x7F;
++	vfta = E1000_READ_REG_ARRAY(hw, E1000_VFTA, index);
++	vfta &= ~(1 << (vid & 0x1F));
++	e1000_write_vfta(hw, index, vfta);
++}
++
++static void e1000_update_mng_vlan(struct e1000_adapter *adapter)
++{
++	struct net_device *netdev = adapter->netdev;
++	u16 vid = adapter->hw.mng_cookie.vlan_id;
++	u16 old_vid = adapter->mng_vlan_id;
++
++	if (!adapter->vlgrp)
++		return;
++
++	if (!vlan_group_get_device(adapter->vlgrp, vid)) {
++		adapter->mng_vlan_id = E1000_MNG_VLAN_NONE;
++		if (adapter->hw.mng_cookie.status &
++			E1000_MNG_DHCP_COOKIE_STATUS_VLAN) {
++			e1000_vlan_rx_add_vid(netdev, vid);
++			adapter->mng_vlan_id = vid;
++		}
++
++		if ((old_vid != (u16)E1000_MNG_VLAN_NONE) &&
++				(vid != old_vid) &&
++		    !vlan_group_get_device(adapter->vlgrp, old_vid))
++			e1000_vlan_rx_kill_vid(netdev, old_vid);
++	} else {
++		adapter->mng_vlan_id = vid;
++	}
++}
++
++
++static void e1000_vlan_rx_register(struct net_device *netdev,
++				   struct vlan_group *grp)
++{
++	struct e1000_adapter *adapter = netdev_priv(netdev);
++	struct e1000_hw *hw = &adapter->hw;
++	u32 ctrl, rctl;
++
++	e1000_irq_disable(adapter);
++	adapter->vlgrp = grp;
++
++	if (grp) {
++		/* enable VLAN tag insert/strip */
++		ctrl = er32(CTRL);
++		ctrl |= E1000_CTRL_VME;
++		ew32(CTRL, ctrl);
++
++		if (adapter->flags & FLAG_HAS_HW_VLAN_FILTER) {
++			/* enable VLAN receive filtering */
++			rctl = er32(RCTL);
++			rctl |= E1000_RCTL_VFE;
++			rctl &= ~E1000_RCTL_CFIEN;
++			ew32(RCTL, rctl);
++			e1000_update_mng_vlan(adapter);
++		}
++	} else {
++		/* disable VLAN tag insert/strip */
++		ctrl = er32(CTRL);
++		ctrl &= ~E1000_CTRL_VME;
++		ew32(CTRL, ctrl);
++
++		if (adapter->flags & FLAG_HAS_HW_VLAN_FILTER) {
++			/* disable VLAN filtering */
++			rctl = er32(RCTL);
++			rctl &= ~E1000_RCTL_VFE;
++			ew32(RCTL, rctl);
++			if (adapter->mng_vlan_id !=
++			    (u16)E1000_MNG_VLAN_NONE) {
++				e1000_vlan_rx_kill_vid(netdev,
++						       adapter->mng_vlan_id);
++				adapter->mng_vlan_id = E1000_MNG_VLAN_NONE;
++			}
++		}
++	}
++
++	e1000_irq_enable(adapter);
++}
++
++static void e1000_restore_vlan(struct e1000_adapter *adapter)
++{
++	u16 vid;
++
++	e1000_vlan_rx_register(adapter->netdev, adapter->vlgrp);
++
++	if (!adapter->vlgrp)
++		return;
++
++	for (vid = 0; vid < VLAN_GROUP_ARRAY_LEN; vid++) {
++		if (!vlan_group_get_device(adapter->vlgrp, vid))
++			continue;
++		e1000_vlan_rx_add_vid(adapter->netdev, vid);
++	}
++}
++
++static void e1000_init_manageability(struct e1000_adapter *adapter)
++{
++	struct e1000_hw *hw = &adapter->hw;
++	u32 manc, manc2h;
++
++	if (!(adapter->flags & FLAG_MNG_PT_ENABLED))
++		return;
++
++	manc = er32(MANC);
++
++	/* disable hardware interception of ARP */
++	manc &= ~(E1000_MANC_ARP_EN);
++
++	/* enable receiving management packets to the host. this will probably
++	 * generate destination unreachable messages from the host OS, but
++	 * the packets will be handled on SMBUS */
++	manc |= E1000_MANC_EN_MNG2HOST;
++	manc2h = er32(MANC2H);
++#define E1000_MNG2HOST_PORT_623 (1 << 5)
++#define E1000_MNG2HOST_PORT_664 (1 << 6)
++	manc2h |= E1000_MNG2HOST_PORT_623;
++	manc2h |= E1000_MNG2HOST_PORT_664;
++	ew32(MANC2H, manc2h);
++	ew32(MANC, manc);
++}
++
++/**
++ * e1000_configure_tx - Configure 8254x Transmit Unit after Reset
++ * @adapter: board private structure
++ *
++ * Configure the Tx unit of the MAC after a reset.
++ **/
++static void e1000_configure_tx(struct e1000_adapter *adapter)
++{
++	struct e1000_hw *hw = &adapter->hw;
++	struct e1000_ring *tx_ring = adapter->tx_ring;
++	u64 tdba;
++	u32 tdlen, tctl, tipg, tarc;
++	u32 ipgr1, ipgr2;
++
++	/* Setup the HW Tx Head and Tail descriptor pointers */
++	tdba = tx_ring->dma;
++	tdlen = tx_ring->count * sizeof(struct e1000_tx_desc);
++	ew32(TDBAL, (tdba & DMA_32BIT_MASK));
++	ew32(TDBAH, (tdba >> 32));
++	ew32(TDLEN, tdlen);
++	ew32(TDH, 0);
++	ew32(TDT, 0);
++	tx_ring->head = E1000_TDH;
++	tx_ring->tail = E1000_TDT;
++
++	/* Set the default values for the Tx Inter Packet Gap timer */
++	tipg = DEFAULT_82543_TIPG_IPGT_COPPER;          /*  8  */
++	ipgr1 = DEFAULT_82543_TIPG_IPGR1;               /*  8  */
++	ipgr2 = DEFAULT_82543_TIPG_IPGR2;               /*  6  */
++
++	if (adapter->flags & FLAG_TIPG_MEDIUM_FOR_80003ESLAN)
++		ipgr2 = DEFAULT_80003ES2LAN_TIPG_IPGR2; /*  7  */
++
++	tipg |= ipgr1 << E1000_TIPG_IPGR1_SHIFT;
++	tipg |= ipgr2 << E1000_TIPG_IPGR2_SHIFT;
++	ew32(TIPG, tipg);
++
++	/* Set the Tx Interrupt Delay register */
++	ew32(TIDV, adapter->tx_int_delay);
++	/* tx irq moderation */
++	ew32(TADV, adapter->tx_abs_int_delay);
++
++	/* Program the Transmit Control Register */
++	tctl = er32(TCTL);
++	tctl &= ~E1000_TCTL_CT;
++	tctl |= E1000_TCTL_PSP | E1000_TCTL_RTLC |
++		(E1000_COLLISION_THRESHOLD << E1000_CT_SHIFT);
++
++	if (adapter->flags & FLAG_TARC_SPEED_MODE_BIT) {
++		tarc = er32(TARC0);
++		/* set the speed mode bit, we'll clear it if we're not at
++		 * gigabit link later */
++#define SPEED_MODE_BIT (1 << 21)
++		tarc |= SPEED_MODE_BIT;
++		ew32(TARC0, tarc);
++	}
++
++	/* errata: program both queues to unweighted RR */
++	if (adapter->flags & FLAG_TARC_SET_BIT_ZERO) {
++		tarc = er32(TARC0);
++		tarc |= 1;
++		ew32(TARC0, tarc);
++		tarc = er32(TARC1);
++		tarc |= 1;
++		ew32(TARC1, tarc);
++	}
++
++	e1000_config_collision_dist(hw);
++
++	/* Setup Transmit Descriptor Settings for eop descriptor */
++	adapter->txd_cmd = E1000_TXD_CMD_EOP | E1000_TXD_CMD_IFCS;
++
++	/* only set IDE if we are delaying interrupts using the timers */
++	if (adapter->tx_int_delay)
++		adapter->txd_cmd |= E1000_TXD_CMD_IDE;
++
++	/* enable Report Status bit */
++	adapter->txd_cmd |= E1000_TXD_CMD_RS;
++
++	ew32(TCTL, tctl);
++
++	adapter->tx_queue_len = adapter->netdev->tx_queue_len;
++}
++
++/**
++ * e1000_setup_rctl - configure the receive control registers
++ * @adapter: Board private structure
++ **/
++#define PAGE_USE_COUNT(S) (((S) >> PAGE_SHIFT) + \
++			   (((S) & (PAGE_SIZE - 1)) ? 1 : 0))
++static void e1000_setup_rctl(struct e1000_adapter *adapter)
++{
++	struct e1000_hw *hw = &adapter->hw;
++	u32 rctl, rfctl;
++	u32 psrctl = 0;
++	u32 pages = 0;
++
++	/* Program MC offset vector base */
++	rctl = er32(RCTL);
++	rctl &= ~(3 << E1000_RCTL_MO_SHIFT);
++	rctl |= E1000_RCTL_EN | E1000_RCTL_BAM |
++		E1000_RCTL_LBM_NO | E1000_RCTL_RDMTS_HALF |
++		(adapter->hw.mac.mc_filter_type << E1000_RCTL_MO_SHIFT);
++
++	/* Do not Store bad packets */
++	rctl &= ~E1000_RCTL_SBP;
++
++	/* Enable Long Packet receive */
++	if (adapter->netdev->mtu <= ETH_DATA_LEN)
++		rctl &= ~E1000_RCTL_LPE;
++	else
++		rctl |= E1000_RCTL_LPE;
++
++	/* Setup buffer sizes */
++	rctl &= ~E1000_RCTL_SZ_4096;
++	rctl |= E1000_RCTL_BSEX;
++	switch (adapter->rx_buffer_len) {
++	case 256:
++		rctl |= E1000_RCTL_SZ_256;
++		rctl &= ~E1000_RCTL_BSEX;
++		break;
++	case 512:
++		rctl |= E1000_RCTL_SZ_512;
++		rctl &= ~E1000_RCTL_BSEX;
++		break;
++	case 1024:
++		rctl |= E1000_RCTL_SZ_1024;
++		rctl &= ~E1000_RCTL_BSEX;
++		break;
++	case 2048:
++	default:
++		rctl |= E1000_RCTL_SZ_2048;
++		rctl &= ~E1000_RCTL_BSEX;
++		break;
++	case 4096:
++		rctl |= E1000_RCTL_SZ_4096;
++		break;
++	case 8192:
++		rctl |= E1000_RCTL_SZ_8192;
++		break;
++	case 16384:
++		rctl |= E1000_RCTL_SZ_16384;
++		break;
++	}
++
++#ifndef CONFIG_E1000_DISABLE_PACKET_SPLIT
++	/*
++	 * 82571 and greater support packet-split where the protocol
++	 * header is placed in skb->data and the packet data is
++	 * placed in pages hanging off of skb_shinfo(skb)->nr_frags.
++	 * In the case of a non-split, skb->data is linearly filled,
++	 * followed by the page buffers.  Therefore, skb->data is
++	 * sized to hold the largest protocol header.
++	 *
++	 * allocations using alloc_page take too long for regular MTU
++	 * so only enable packet split for jumbo frames
++	 *
++	 * Using pages when the page size is greater than 16k wastes
++	 * a lot of memory, since we allocate 3 pages at all times
++	 * per packet.
++	 */
++	adapter->rx_ps_pages = 0;
++	pages = PAGE_USE_COUNT(adapter->netdev->mtu);
++	if ((pages <= 3) && (PAGE_SIZE <= 16384) && (rctl & E1000_RCTL_LPE))
++		adapter->rx_ps_pages = pages;
++#endif
++	if (adapter->rx_ps_pages) {
++		/* Configure extra packet-split registers */
++		rfctl = er32(RFCTL);
++		rfctl |= E1000_RFCTL_EXTEN;
++		/* disable packet split support for IPv6 extension headers,
++		 * because some malformed IPv6 headers can hang the RX */
++		rfctl |= (E1000_RFCTL_IPV6_EX_DIS |
++			  E1000_RFCTL_NEW_IPV6_EXT_DIS);
++
++		ew32(RFCTL, rfctl);
++
++		/* disable the stripping of CRC because it breaks
++		 * BMC firmware connected over SMBUS */
++		rctl |= E1000_RCTL_DTYP_PS /* | E1000_RCTL_SECRC */;
++
++		psrctl |= adapter->rx_ps_bsize0 >>
++			E1000_PSRCTL_BSIZE0_SHIFT;
++
++		switch (adapter->rx_ps_pages) {
++		case 3:
++			psrctl |= PAGE_SIZE <<
++				E1000_PSRCTL_BSIZE3_SHIFT;
++		case 2:
++			psrctl |= PAGE_SIZE <<
++				E1000_PSRCTL_BSIZE2_SHIFT;
++		case 1:
++			psrctl |= PAGE_SIZE >>
++				E1000_PSRCTL_BSIZE1_SHIFT;
++			break;
++		}
++
++		ew32(PSRCTL, psrctl);
++	}
++
++	ew32(RCTL, rctl);
++}
++
++/**
++ * e1000_configure_rx - Configure Receive Unit after Reset
++ * @adapter: board private structure
++ *
++ * Configure the Rx unit of the MAC after a reset.
++ **/
++static void e1000_configure_rx(struct e1000_adapter *adapter)
++{
++	struct e1000_hw *hw = &adapter->hw;
++	struct e1000_ring *rx_ring = adapter->rx_ring;
++	u64 rdba;
++	u32 rdlen, rctl, rxcsum, ctrl_ext;
++
++	if (adapter->rx_ps_pages) {
++		/* this is a 32 byte descriptor */
++		rdlen = rx_ring->count *
++			sizeof(union e1000_rx_desc_packet_split);
++		adapter->clean_rx = e1000_clean_rx_irq_ps;
++		adapter->alloc_rx_buf = e1000_alloc_rx_buffers_ps;
++	} else if (adapter->netdev->mtu > ETH_FRAME_LEN + VLAN_HLEN + 4) {
++		rdlen = rx_ring->count *
++			sizeof(struct e1000_rx_desc);
++		adapter->clean_rx = e1000_clean_rx_irq_jumbo;
++		adapter->alloc_rx_buf = e1000_alloc_rx_buffers_jumbo;
++	} else {
++		rdlen = rx_ring->count *
++			sizeof(struct e1000_rx_desc);
++		adapter->clean_rx = e1000_clean_rx_irq;
++		adapter->alloc_rx_buf = e1000_alloc_rx_buffers;
++	}
++
++	/* disable receives while setting up the descriptors */
++	rctl = er32(RCTL);
++	ew32(RCTL, rctl & ~E1000_RCTL_EN);
++	e1e_flush();
++	msleep(10);
++
++	/* set the Receive Delay Timer Register */
++	ew32(RDTR, adapter->rx_int_delay);
++
++	/* irq moderation */
++	ew32(RADV, adapter->rx_abs_int_delay);
++	if (adapter->itr_setting != 0)
++		ew32(ITR,
++			1000000000 / (adapter->itr * 256));
++
++	ctrl_ext = er32(CTRL_EXT);
++	/* Reset delay timers after every interrupt */
++	ctrl_ext |= E1000_CTRL_EXT_INT_TIMER_CLR;
++	/* Auto-Mask interrupts upon ICR access */
++	ctrl_ext |= E1000_CTRL_EXT_IAME;
++	ew32(IAM, 0xffffffff);
++	ew32(CTRL_EXT, ctrl_ext);
++	e1e_flush();
++
++	/* Setup the HW Rx Head and Tail Descriptor Pointers and
++	 * the Base and Length of the Rx Descriptor Ring */
++	rdba = rx_ring->dma;
++	ew32(RDBAL, (rdba & DMA_32BIT_MASK));
++	ew32(RDBAH, (rdba >> 32));
++	ew32(RDLEN, rdlen);
++	ew32(RDH, 0);
++	ew32(RDT, 0);
++	rx_ring->head = E1000_RDH;
++	rx_ring->tail = E1000_RDT;
++
++	/* Enable Receive Checksum Offload for TCP and UDP */
++	rxcsum = er32(RXCSUM);
++	if (adapter->flags & FLAG_RX_CSUM_ENABLED) {
++		rxcsum |= E1000_RXCSUM_TUOFL;
++
++		/* IPv4 payload checksum for UDP fragments must be
++		 * used in conjunction with packet-split. */
++		if (adapter->rx_ps_pages)
++			rxcsum |= E1000_RXCSUM_IPPCSE;
++	} else {
++		rxcsum &= ~E1000_RXCSUM_TUOFL;
++		/* no need to clear IPPCSE as it defaults to 0 */
++	}
++	ew32(RXCSUM, rxcsum);
++
++	/* Enable early receives on supported devices, only takes effect when
++	 * packet size is equal or larger than the specified value (in 8 byte
++	 * units), e.g. using jumbo frames when setting to E1000_ERT_2048 */
++	if ((adapter->flags & FLAG_HAS_ERT) &&
++	    (adapter->netdev->mtu > ETH_DATA_LEN))
++		ew32(ERT, E1000_ERT_2048);
++
++	/* Enable Receives */
++	ew32(RCTL, rctl);
++}
++
++/**
++ *  e1000_mc_addr_list_update - Update Multicast addresses
++ *  @hw: pointer to the HW structure
++ *  @mc_addr_list: array of multicast addresses to program
++ *  @mc_addr_count: number of multicast addresses to program
++ *  @rar_used_count: the first RAR register free to program
++ *  @rar_count: total number of supported Receive Address Registers
++ *
++ *  Updates the Receive Address Registers and Multicast Table Array.
++ *  The caller must have a packed mc_addr_list of multicast addresses.
++ *  The parameter rar_count will usually be hw->mac.rar_entry_count
++ *  unless there are workarounds that change this.  Currently no func pointer
++ *  exists and all implementations are handled in the generic version of this
++ *  function.
++ **/
++static void e1000_mc_addr_list_update(struct e1000_hw *hw, u8 *mc_addr_list,
++			       u32 mc_addr_count, u32 rar_used_count,
++			       u32 rar_count)
++{
++	hw->mac.ops.mc_addr_list_update(hw, mc_addr_list, mc_addr_count,
++				        rar_used_count, rar_count);
++}
++
++/**
++ * e1000_set_multi - Multicast and Promiscuous mode set
++ * @netdev: network interface device structure
++ *
++ * The set_multi entry point is called whenever the multicast address
++ * list or the network interface flags are updated.  This routine is
++ * responsible for configuring the hardware for proper multicast,
++ * promiscuous mode, and all-multi behavior.
++ **/
++static void e1000_set_multi(struct net_device *netdev)
++{
++	struct e1000_adapter *adapter = netdev_priv(netdev);
++	struct e1000_hw *hw = &adapter->hw;
++	struct e1000_mac_info *mac = &hw->mac;
++	struct dev_mc_list *mc_ptr;
++	u8  *mta_list;
++	u32 rctl;
++	int i;
++
++	/* Check for Promiscuous and All Multicast modes */
++
++	rctl = er32(RCTL);
++
++	if (netdev->flags & IFF_PROMISC) {
++		rctl |= (E1000_RCTL_UPE | E1000_RCTL_MPE);
++	} else if (netdev->flags & IFF_ALLMULTI) {
++		rctl |= E1000_RCTL_MPE;
++		rctl &= ~E1000_RCTL_UPE;
++	} else {
++		rctl &= ~(E1000_RCTL_UPE | E1000_RCTL_MPE);
++	}
++
++	ew32(RCTL, rctl);
++
++	if (netdev->mc_count) {
++		mta_list = kmalloc(netdev->mc_count * 6, GFP_ATOMIC);
++		if (!mta_list)
++			return;
++
++		/* prepare a packed array of only addresses. */
++		mc_ptr = netdev->mc_list;
++
++		for (i = 0; i < netdev->mc_count; i++) {
++			if (!mc_ptr)
++				break;
++			memcpy(mta_list + (i*ETH_ALEN), mc_ptr->dmi_addr,
++			       ETH_ALEN);
++			mc_ptr = mc_ptr->next;
++		}
++
++		e1000_mc_addr_list_update(hw, mta_list, i, 1,
++					  mac->rar_entry_count);
++		kfree(mta_list);
++	} else {
++		/*
++		 * if we're called from probe, we might not have
++		 * anything to do here, so clear out the list
++		 */
++		e1000_mc_addr_list_update(hw, NULL, 0, 1,
++					  mac->rar_entry_count);
++	}
++}
++
++/**
++ * e1000_configure - configure the hardware for RX and TX
++ * @adapter: private board structure
++ **/
++static void e1000_configure(struct e1000_adapter *adapter)
++{
++	e1000_set_multi(adapter->netdev);
++
++	e1000_restore_vlan(adapter);
++	e1000_init_manageability(adapter);
++
++	e1000_configure_tx(adapter);
++	e1000_setup_rctl(adapter);
++	e1000_configure_rx(adapter);
++	adapter->alloc_rx_buf(adapter,
++			      e1000_desc_unused(adapter->rx_ring));
++}
++
++/**
++ * e1000_power_up_phy - restore link in case the phy was powered down
++ * @adapter: address of board private structure
++ *
++ * The phy may be powered down to save power and turn off link when the
++ * driver is unloaded and wake on lan is not enabled (among others)
++ * *** this routine MUST be followed by a call to e1000_reset ***
++ **/
++void e1000_power_up_phy(struct e1000_adapter *adapter)
++{
++	u16 mii_reg = 0;
++
++	/* Just clear the power down bit to wake the phy back up */
++	if (adapter->hw.media_type == e1000_media_type_copper) {
++		/* according to the manual, the phy will retain its
++		 * settings across a power-down/up cycle */
++		e1e_rphy(&adapter->hw, PHY_CONTROL, &mii_reg);
++		mii_reg &= ~MII_CR_POWER_DOWN;
++		e1e_wphy(&adapter->hw, PHY_CONTROL, mii_reg);
++	}
++
++	adapter->hw.mac.ops.setup_link(&adapter->hw);
++}
++
++/**
++ * e1000_power_down_phy - Power down the PHY
++ *
++ * Power down the PHY so no link is implied when interface is down
++ * The PHY cannot be powered down is management or WoL is active
++ */
++static void e1000_power_down_phy(struct e1000_adapter *adapter)
++{
++	struct e1000_hw *hw = &adapter->hw;
++	u16 mii_reg;
++
++	/* WoL is enabled */
++	if (!adapter->wol)
++		return;
++
++	/* non-copper PHY? */
++	if (adapter->hw.media_type != e1000_media_type_copper)
++		return;
++
++	/* reset is blocked because of a SoL/IDER session */
++	if (e1000_check_mng_mode(hw) ||
++	    e1000_check_reset_block(hw))
++		return;
++
++	/* managebility (AMT) is enabled */
++	if (er32(MANC) & E1000_MANC_SMBUS_EN)
++		return;
++
++	/* power down the PHY */
++	e1e_rphy(hw, PHY_CONTROL, &mii_reg);
++	mii_reg |= MII_CR_POWER_DOWN;
++	e1e_wphy(hw, PHY_CONTROL, mii_reg);
++	mdelay(1);
++}
++
++/**
++ * e1000_reset - bring the hardware into a known good state
++ *
++ * This function boots the hardware and enables some settings that
++ * require a configuration cycle of the hardware - those cannot be
++ * set/changed during runtime. After reset the device needs to be
++ * properly configured for rx, tx etc.
++ */
++void e1000_reset(struct e1000_adapter *adapter)
++{
++	struct e1000_mac_info *mac = &adapter->hw.mac;
++	struct e1000_hw *hw = &adapter->hw;
++	u32 tx_space, min_tx_space, min_rx_space;
++	u16 hwm;
++
++	if (mac->max_frame_size > ETH_FRAME_LEN + ETH_FCS_LEN ) {
++		/* To maintain wire speed transmits, the Tx FIFO should be
++		 * large enough to accommodate two full transmit packets,
++		 * rounded up to the next 1KB and expressed in KB.  Likewise,
++		 * the Rx FIFO should be large enough to accommodate at least
++		 * one full receive packet and is similarly rounded up and
++		 * expressed in KB. */
++		adapter->pba = er32(PBA);
++		/* upper 16 bits has Tx packet buffer allocation size in KB */
++		tx_space = adapter->pba >> 16;
++		/* lower 16 bits has Rx packet buffer allocation size in KB */
++		adapter->pba &= 0xffff;
++		/* the tx fifo also stores 16 bytes of information about the tx
++		 * but don't include ethernet FCS because hardware appends it */
++		min_tx_space = (mac->max_frame_size +
++				sizeof(struct e1000_tx_desc) -
++				ETH_FCS_LEN) * 2;
++		min_tx_space = ALIGN(min_tx_space, 1024);
++		min_tx_space >>= 10;
++		/* software strips receive CRC, so leave room for it */
++		min_rx_space = mac->max_frame_size;
++		min_rx_space = ALIGN(min_rx_space, 1024);
++		min_rx_space >>= 10;
++
++		/* If current Tx allocation is less than the min Tx FIFO size,
++		 * and the min Tx FIFO size is less than the current Rx FIFO
++		 * allocation, take space away from current Rx allocation */
++		if (tx_space < min_tx_space &&
++		    ((min_tx_space - tx_space) < adapter->pba)) {
++			adapter->pba -= - (min_tx_space - tx_space);
++
++			/* if short on rx space, rx wins and must trump tx
++			 * adjustment or use Early Receive if available */
++			if ((adapter->pba < min_rx_space) &&
++			    (!(adapter->flags & FLAG_HAS_ERT)))
++				/* ERT enabled in e1000_configure_rx */
++				adapter->pba = min_rx_space;
++		}
++	}
++
++	ew32(PBA, adapter->pba);
++
++	/* flow control settings */
++	/* The high water mark must be low enough to fit one full frame
++	 * (or the size used for early receive) above it in the Rx FIFO.
++	 * Set it to the lower of:
++	 * - 90% of the Rx FIFO size, and
++	 * - the full Rx FIFO size minus the early receive size (for parts
++	 *   with ERT support assuming ERT set to E1000_ERT_2048), or
++	 * - the full Rx FIFO size minus one full frame */
++	if (adapter->flags & FLAG_HAS_ERT)
++		hwm = min(((adapter->pba << 10) * 9 / 10),
++			  ((adapter->pba << 10) - (E1000_ERT_2048 << 3)));
++	else
++		hwm = min(((adapter->pba << 10) * 9 / 10),
++			  ((adapter->pba << 10) - mac->max_frame_size));
++
++	mac->fc_high_water = hwm & 0xFFF8; /* 8-byte granularity */
++	mac->fc_low_water = mac->fc_high_water - 8;
++
++	if (adapter->flags & FLAG_DISABLE_FC_PAUSE_TIME)
++		mac->fc_pause_time = 0xFFFF;
++	else
++		mac->fc_pause_time = E1000_FC_PAUSE_TIME;
++	mac->fc = mac->original_fc;
++
++	/* Allow time for pending master requests to run */
++	mac->ops.reset_hw(hw);
++	ew32(WUC, 0);
++
++	if (mac->ops.init_hw(hw))
++		ndev_err(adapter->netdev, "Hardware Error\n");
++
++	e1000_update_mng_vlan(adapter);
++
++	/* Enable h/w to recognize an 802.1Q VLAN Ethernet packet */
++	ew32(VET, ETH_P_8021Q);
++
++	e1000_reset_adaptive(hw);
++	e1000_get_phy_info(hw);
++
++	if (!(adapter->flags & FLAG_SMART_POWER_DOWN)) {
++		u16 phy_data = 0;
++		/* speed up time to link by disabling smart power down, ignore
++		 * the return value of this function because there is nothing
++		 * different we would do if it failed */
++		e1e_rphy(hw, IGP02E1000_PHY_POWER_MGMT, &phy_data);
++		phy_data &= ~IGP02E1000_PM_SPD;
++		e1e_wphy(hw, IGP02E1000_PHY_POWER_MGMT, phy_data);
++	}
++
++	e1000_release_manageability(adapter);
++}
++
++int e1000_up(struct e1000_adapter *adapter)
++{
++	struct e1000_hw *hw = &adapter->hw;
++
++	/* hardware has been reset, we need to reload some things */
++	e1000_configure(adapter);
++
++	clear_bit(__E1000_DOWN, &adapter->state);
++
++	netif_poll_enable(adapter->netdev);
++	e1000_irq_enable(adapter);
++
++	/* fire a link change interrupt to start the watchdog */
++	ew32(ICS, E1000_ICS_LSC);
++	return 0;
++}
++
++void e1000_down(struct e1000_adapter *adapter)
++{
++	struct net_device *netdev = adapter->netdev;
++	struct e1000_hw *hw = &adapter->hw;
++	u32 tctl, rctl;
++
++	/* signal that we're down so the interrupt handler does not
++	 * reschedule our watchdog timer */
++	set_bit(__E1000_DOWN, &adapter->state);
++
++	/* disable receives in the hardware */
++	rctl = er32(RCTL);
++	ew32(RCTL, rctl & ~E1000_RCTL_EN);
++	/* flush and sleep below */
++
++	netif_stop_queue(netdev);
++
++	/* disable transmits in the hardware */
++	tctl = er32(TCTL);
++	tctl &= ~E1000_TCTL_EN;
++	ew32(TCTL, tctl);
++	/* flush both disables and wait for them to finish */
++	e1e_flush();
++	msleep(10);
++
++	netif_poll_disable(netdev);
++	e1000_irq_disable(adapter);
++
++	del_timer_sync(&adapter->watchdog_timer);
++	del_timer_sync(&adapter->phy_info_timer);
++
++	netdev->tx_queue_len = adapter->tx_queue_len;
++	netif_carrier_off(netdev);
++	adapter->link_speed = 0;
++	adapter->link_duplex = 0;
++
++	e1000_reset(adapter);
++	e1000_clean_tx_ring(adapter);
++	e1000_clean_rx_ring(adapter);
++
++	/*
++	 * TODO: for power management, we could drop the link and
++	 * pci_disable_device here.
++	 */
++}
++
++void e1000_reinit_locked(struct e1000_adapter *adapter)
++{
++	might_sleep();
++	while (test_and_set_bit(__E1000_RESETTING, &adapter->state))
++		msleep(1);
++	e1000_down(adapter);
++	e1000_up(adapter);
++	clear_bit(__E1000_RESETTING, &adapter->state);
++}
++
++/**
++ * e1000_sw_init - Initialize general software structures (struct e1000_adapter)
++ * @adapter: board private structure to initialize
++ *
++ * e1000_sw_init initializes the Adapter private data structure.
++ * Fields are initialized based on PCI device information and
++ * OS network device settings (MTU size).
++ **/
++static int __devinit e1000_sw_init(struct e1000_adapter *adapter)
++{
++	struct e1000_hw *hw = &adapter->hw;
++	struct net_device *netdev = adapter->netdev;
++
++	adapter->rx_buffer_len = ETH_FRAME_LEN + VLAN_HLEN + ETH_FCS_LEN;
++	adapter->rx_ps_bsize0 = 128;
++	hw->mac.max_frame_size = netdev->mtu + ETH_HLEN + ETH_FCS_LEN;
++	hw->mac.min_frame_size = ETH_ZLEN + ETH_FCS_LEN;
++
++	adapter->tx_ring = kzalloc(sizeof(struct e1000_ring), GFP_KERNEL);
++	if (!adapter->tx_ring)
++		goto err;
++
++	adapter->rx_ring = kzalloc(sizeof(struct e1000_ring), GFP_KERNEL);
++	if (!adapter->rx_ring)
++		goto err;
++
++	spin_lock_init(&adapter->tx_queue_lock);
++
++	/* Explicitly disable IRQ since the NIC can be in any state. */
++	atomic_set(&adapter->irq_sem, 0);
++	e1000_irq_disable(adapter);
++
++	spin_lock_init(&adapter->stats_lock);
++
++	set_bit(__E1000_DOWN, &adapter->state);
++	return 0;
++
++err:
++	ndev_err(netdev, "Unable to allocate memory for queues\n");
++	kfree(adapter->rx_ring);
++	kfree(adapter->tx_ring);
++	return -ENOMEM;
++}
++
++/**
++ * e1000_open - Called when a network interface is made active
++ * @netdev: network interface device structure
++ *
++ * Returns 0 on success, negative value on failure
++ *
++ * The open entry point is called when a network interface is made
++ * active by the system (IFF_UP).  At this point all resources needed
++ * for transmit and receive operations are allocated, the interrupt
++ * handler is registered with the OS, the watchdog timer is started,
++ * and the stack is notified that the interface is ready.
++ **/
++static int e1000_open(struct net_device *netdev)
++{
++	struct e1000_adapter *adapter = netdev_priv(netdev);
++	struct e1000_hw *hw = &adapter->hw;
++	int err;
++
++	/* disallow open during test */
++	if (test_bit(__E1000_TESTING, &adapter->state))
++		return -EBUSY;
++
++	/* allocate transmit descriptors */
++	err = e1000_setup_tx_resources(adapter);
++	if (err)
++		goto err_setup_tx;
++
++	/* allocate receive descriptors */
++	err = e1000_setup_rx_resources(adapter);
++	if (err)
++		goto err_setup_rx;
++
++	e1000_power_up_phy(adapter);
++
++	adapter->mng_vlan_id = E1000_MNG_VLAN_NONE;
++	if ((adapter->hw.mng_cookie.status &
++	     E1000_MNG_DHCP_COOKIE_STATUS_VLAN))
++		e1000_update_mng_vlan(adapter);
++
++	/* If AMT is enabled, let the firmware know that the network
++	 * interface is now open */
++	if ((adapter->flags & FLAG_HAS_AMT) &&
++	    e1000_check_mng_mode(&adapter->hw))
++		e1000_get_hw_control(adapter);
++
++	/* before we allocate an interrupt, we must be ready to handle it.
++	 * Setting DEBUG_SHIRQ in the kernel makes it fire an interrupt
++	 * as soon as we call pci_request_irq, so we have to setup our
++	 * clean_rx handler before we do so.  */
++	e1000_configure(adapter);
++
++	err = e1000_request_irq(adapter);
++	if (err)
++		goto err_req_irq;
++
++	/* From here on the code is the same as e1000_up() */
++	clear_bit(__E1000_DOWN, &adapter->state);
++
++	netif_poll_enable(netdev);
++
++	e1000_irq_enable(adapter);
++
++	/* fire a link status change interrupt to start the watchdog */
++	ew32(ICS, E1000_ICS_LSC);
++
++	return E1000_SUCCESS;
++
++err_req_irq:
++	e1000_release_hw_control(adapter);
++	e1000_power_down_phy(adapter);
++	e1000_free_rx_resources(adapter);
++err_setup_rx:
++	e1000_free_tx_resources(adapter);
++err_setup_tx:
++	e1000_reset(adapter);
++
++	return err;
++}
++
++/**
++ * e1000_close - Disables a network interface
++ * @netdev: network interface device structure
++ *
++ * Returns 0, this is not allowed to fail
++ *
++ * The close entry point is called when an interface is de-activated
++ * by the OS.  The hardware is still under the drivers control, but
++ * needs to be disabled.  A global MAC reset is issued to stop the
++ * hardware, and all transmit and receive resources are freed.
++ **/
++static int e1000_close(struct net_device *netdev)
++{
++	struct e1000_adapter *adapter = netdev_priv(netdev);
++
++	WARN_ON(test_bit(__E1000_RESETTING, &adapter->state));
++	e1000_down(adapter);
++	e1000_power_down_phy(adapter);
++	e1000_free_irq(adapter);
++
++	e1000_free_tx_resources(adapter);
++	e1000_free_rx_resources(adapter);
++
++	/* kill manageability vlan ID if supported, but not if a vlan with
++	 * the same ID is registered on the host OS (let 8021q kill it) */
++	if ((adapter->hw.mng_cookie.status &
++			  E1000_MNG_DHCP_COOKIE_STATUS_VLAN) &&
++	     !(adapter->vlgrp &&
++	       vlan_group_get_device(adapter->vlgrp, adapter->mng_vlan_id)))
++		e1000_vlan_rx_kill_vid(netdev, adapter->mng_vlan_id);
++
++	/* If AMT is enabled, let the firmware know that the network
++	 * interface is now closed */
++	if ((adapter->flags & FLAG_HAS_AMT) &&
++	    e1000_check_mng_mode(&adapter->hw))
++		e1000_release_hw_control(adapter);
++
++	return 0;
++}
++/**
++ * e1000_set_mac - Change the Ethernet Address of the NIC
++ * @netdev: network interface device structure
++ * @p: pointer to an address structure
++ *
++ * Returns 0 on success, negative on failure
++ **/
++static int e1000_set_mac(struct net_device *netdev, void *p)
++{
++	struct e1000_adapter *adapter = netdev_priv(netdev);
++	struct sockaddr *addr = p;
++
++	if (!is_valid_ether_addr(addr->sa_data))
++		return -EADDRNOTAVAIL;
++
++	memcpy(netdev->dev_addr, addr->sa_data, netdev->addr_len);
++	memcpy(adapter->hw.mac.addr, addr->sa_data, netdev->addr_len);
++
++	e1000_rar_set(&adapter->hw, adapter->hw.mac.addr, 0);
++
++	if (adapter->flags & FLAG_RESET_OVERWRITES_LAA) {
++		/* activate the work around */
++		e1000_set_laa_state_82571(&adapter->hw, 1);
++
++		/* Hold a copy of the LAA in RAR[14] This is done so that
++		 * between the time RAR[0] gets clobbered  and the time it
++		 * gets fixed (in e1000_watchdog), the actual LAA is in one
++		 * of the RARs and no incoming packets directed to this port
++		 * are dropped. Eventually the LAA will be in RAR[0] and
++		 * RAR[14] */
++		e1000_rar_set(&adapter->hw,
++			      adapter->hw.mac.addr,
++			      adapter->hw.mac.rar_entry_count - 1);
++	}
++
++	return 0;
++}
++
++/* Need to wait a few seconds after link up to get diagnostic information from
++ * the phy */
++static void e1000_update_phy_info(unsigned long data)
++{
++	struct e1000_adapter *adapter = (struct e1000_adapter *) data;
++	e1000_get_phy_info(&adapter->hw);
++}
++
++/**
++ * e1000_update_stats - Update the board statistics counters
++ * @adapter: board private structure
++ **/
++void e1000_update_stats(struct e1000_adapter *adapter)
++{
++	struct e1000_hw *hw = &adapter->hw;
++	struct pci_dev *pdev = adapter->pdev;
++	unsigned long irq_flags;
++	u16 phy_tmp;
++
++#define PHY_IDLE_ERROR_COUNT_MASK 0x00FF
++
++	/*
++	 * Prevent stats update while adapter is being reset, or if the pci
++	 * connection is down.
++	 */
++	if (adapter->link_speed == 0)
++		return;
++	if (pci_channel_offline(pdev))
++		return;
++
++	spin_lock_irqsave(&adapter->stats_lock, irq_flags);
++
++	/* these counters are modified from e1000_adjust_tbi_stats,
++	 * called from the interrupt context, so they must only
++	 * be written while holding adapter->stats_lock
++	 */
++
++	adapter->stats.crcerrs += er32(CRCERRS);
++	adapter->stats.gprc += er32(GPRC);
++	adapter->stats.gorcl += er32(GORCL);
++	adapter->stats.gorch += er32(GORCH);
++	adapter->stats.bprc += er32(BPRC);
++	adapter->stats.mprc += er32(MPRC);
++	adapter->stats.roc += er32(ROC);
++
++	if (adapter->flags & FLAG_HAS_STATS_PTC_PRC) {
++		adapter->stats.prc64 += er32(PRC64);
++		adapter->stats.prc127 += er32(PRC127);
++		adapter->stats.prc255 += er32(PRC255);
++		adapter->stats.prc511 += er32(PRC511);
++		adapter->stats.prc1023 += er32(PRC1023);
++		adapter->stats.prc1522 += er32(PRC1522);
++		adapter->stats.symerrs += er32(SYMERRS);
++		adapter->stats.sec += er32(SEC);
++	}
++
++	adapter->stats.mpc += er32(MPC);
++	adapter->stats.scc += er32(SCC);
++	adapter->stats.ecol += er32(ECOL);
++	adapter->stats.mcc += er32(MCC);
++	adapter->stats.latecol += er32(LATECOL);
++	adapter->stats.dc += er32(DC);
++	adapter->stats.rlec += er32(RLEC);
++	adapter->stats.xonrxc += er32(XONRXC);
++	adapter->stats.xontxc += er32(XONTXC);
++	adapter->stats.xoffrxc += er32(XOFFRXC);
++	adapter->stats.xofftxc += er32(XOFFTXC);
++	adapter->stats.fcruc += er32(FCRUC);
++	adapter->stats.gptc += er32(GPTC);
++	adapter->stats.gotcl += er32(GOTCL);
++	adapter->stats.gotch += er32(GOTCH);
++	adapter->stats.rnbc += er32(RNBC);
++	adapter->stats.ruc += er32(RUC);
++	adapter->stats.rfc += er32(RFC);
++	adapter->stats.rjc += er32(RJC);
++	adapter->stats.torl += er32(TORL);
++	adapter->stats.torh += er32(TORH);
++	adapter->stats.totl += er32(TOTL);
++	adapter->stats.toth += er32(TOTH);
++	adapter->stats.tpr += er32(TPR);
++
++	if (adapter->flags & FLAG_HAS_STATS_PTC_PRC) {
++		adapter->stats.ptc64 += er32(PTC64);
++		adapter->stats.ptc127 += er32(PTC127);
++		adapter->stats.ptc255 += er32(PTC255);
++		adapter->stats.ptc511 += er32(PTC511);
++		adapter->stats.ptc1023 += er32(PTC1023);
++		adapter->stats.ptc1522 += er32(PTC1522);
++	}
++
++	adapter->stats.mptc += er32(MPTC);
++	adapter->stats.bptc += er32(BPTC);
++
++	/* used for adaptive IFS */
++
++	hw->mac.tx_packet_delta = er32(TPT);
++	adapter->stats.tpt += hw->mac.tx_packet_delta;
++	hw->mac.collision_delta = er32(COLC);
++	adapter->stats.colc += hw->mac.collision_delta;
++
++	adapter->stats.algnerrc += er32(ALGNERRC);
++	adapter->stats.rxerrc += er32(RXERRC);
++	adapter->stats.tncrs += er32(TNCRS);
++	adapter->stats.cexterr += er32(CEXTERR);
++	adapter->stats.tsctc += er32(TSCTC);
++	adapter->stats.tsctfc += er32(TSCTFC);
++
++	adapter->stats.iac += er32(IAC);
++
++	if (adapter->flags & FLAG_HAS_STATS_ICR_ICT) {
++		adapter->stats.icrxoc += er32(ICRXOC);
++		adapter->stats.icrxptc += er32(ICRXPTC);
++		adapter->stats.icrxatc += er32(ICRXATC);
++		adapter->stats.ictxptc += er32(ICTXPTC);
++		adapter->stats.ictxatc += er32(ICTXATC);
++		adapter->stats.ictxqec += er32(ICTXQEC);
++		adapter->stats.ictxqmtc += er32(ICTXQMTC);
++		adapter->stats.icrxdmtc += er32(ICRXDMTC);
++	}
++
++	/* Fill out the OS statistics structure */
++	adapter->net_stats.rx_packets = adapter->stats.gprc;
++	adapter->net_stats.tx_packets = adapter->stats.gptc;
++	adapter->net_stats.rx_bytes = adapter->stats.gorcl;
++	adapter->net_stats.tx_bytes = adapter->stats.gotcl;
++	adapter->net_stats.multicast = adapter->stats.mprc;
++	adapter->net_stats.collisions = adapter->stats.colc;
++
++	/* Rx Errors */
++
++	/* RLEC on some newer hardware can be incorrect so build
++	* our own version based on RUC and ROC */
++	adapter->net_stats.rx_errors = adapter->stats.rxerrc +
++		adapter->stats.crcerrs + adapter->stats.algnerrc +
++		adapter->stats.ruc + adapter->stats.roc +
++		adapter->stats.cexterr;
++	adapter->net_stats.rx_length_errors = adapter->stats.ruc +
++					      adapter->stats.roc;
++	adapter->net_stats.rx_crc_errors = adapter->stats.crcerrs;
++	adapter->net_stats.rx_frame_errors = adapter->stats.algnerrc;
++	adapter->net_stats.rx_missed_errors = adapter->stats.mpc;
++
++	/* Tx Errors */
++	adapter->net_stats.tx_errors = adapter->stats.ecol +
++				       adapter->stats.latecol;
++	adapter->net_stats.tx_aborted_errors = adapter->stats.ecol;
++	adapter->net_stats.tx_window_errors = adapter->stats.latecol;
++	adapter->net_stats.tx_carrier_errors = adapter->stats.tncrs;
++
++	/* Tx Dropped needs to be maintained elsewhere */
++
++	/* Phy Stats */
++	if (hw->media_type == e1000_media_type_copper) {
++		if ((adapter->link_speed == SPEED_1000) &&
++		   (!e1e_rphy(hw, PHY_1000T_STATUS, &phy_tmp))) {
++			phy_tmp &= PHY_IDLE_ERROR_COUNT_MASK;
++			adapter->phy_stats.idle_errors += phy_tmp;
++		}
++	}
++
++	/* Management Stats */
++	adapter->stats.mgptc += er32(MGTPTC);
++	adapter->stats.mgprc += er32(MGTPRC);
++	adapter->stats.mgpdc += er32(MGTPDC);
++
++	spin_unlock_irqrestore(&adapter->stats_lock, irq_flags);
++}
++
++static void e1000_print_link_info(struct e1000_adapter *adapter)
++{
++	struct net_device *netdev = adapter->netdev;
++	struct e1000_hw *hw = &adapter->hw;
++	u32 ctrl = er32(CTRL);
++
++	ndev_info(netdev,
++		"Link is Up %d Mbps %s, Flow Control: %s\n",
++		adapter->link_speed,
++		(adapter->link_duplex == FULL_DUPLEX) ?
++				"Full Duplex" : "Half Duplex",
++		((ctrl & E1000_CTRL_TFCE) && (ctrl & E1000_CTRL_RFCE)) ?
++				"RX/TX" :
++		((ctrl & E1000_CTRL_RFCE) ? "RX" :
++		((ctrl & E1000_CTRL_TFCE) ? "TX" : "None" )));
++}
++
++/**
++ * e1000_watchdog - Timer Call-back
++ * @data: pointer to adapter cast into an unsigned long
++ **/
++static void e1000_watchdog(unsigned long data)
++{
++	struct e1000_adapter *adapter = (struct e1000_adapter *) data;
++
++	/* Do the rest outside of interrupt context */
++	schedule_work(&adapter->watchdog_task);
++
++	/* TODO: make this use queue_delayed_work() */
++}
++
++static void e1000_watchdog_task(struct work_struct *work)
++{
++	struct e1000_adapter *adapter = container_of(work,
++					struct e1000_adapter, watchdog_task);
++
++	struct net_device *netdev = adapter->netdev;
++	struct e1000_mac_info *mac = &adapter->hw.mac;
++	struct e1000_ring *tx_ring = adapter->tx_ring;
++	struct e1000_hw *hw = &adapter->hw;
++	u32 link, tctl;
++	s32 ret_val;
++	int tx_pending = 0;
++
++	if ((netif_carrier_ok(netdev)) &&
++	    (er32(STATUS) & E1000_STATUS_LU))
++		goto link_up;
++
++	ret_val = mac->ops.check_for_link(hw);
++	if ((ret_val == E1000_ERR_PHY) &&
++	    (adapter->hw.phy.type == e1000_phy_igp_3) &&
++	    (er32(CTRL) &
++	     E1000_PHY_CTRL_GBE_DISABLE)) {
++		/* See e1000_kmrn_lock_loss_workaround_ich8lan() */
++		ndev_info(netdev,
++			"Gigabit has been disabled, downgrading speed\n");
++	}
++
++	if ((e1000_enable_tx_pkt_filtering(hw)) &&
++	    (adapter->mng_vlan_id != adapter->hw.mng_cookie.vlan_id))
++		e1000_update_mng_vlan(adapter);
++
++	if ((adapter->hw.media_type == e1000_media_type_internal_serdes) &&
++	   !(er32(TXCW) & E1000_TXCW_ANE))
++		link = adapter->hw.mac.serdes_has_link;
++	else
++		link = er32(STATUS) & E1000_STATUS_LU;
++
++	if (link) {
++		if (!netif_carrier_ok(netdev)) {
++			bool txb2b = 1;
++			mac->ops.get_link_up_info(&adapter->hw,
++						   &adapter->link_speed,
++						   &adapter->link_duplex);
++			e1000_print_link_info(adapter);
++			/* tweak tx_queue_len according to speed/duplex
++			 * and adjust the timeout factor */
++			netdev->tx_queue_len = adapter->tx_queue_len;
++			adapter->tx_timeout_factor = 1;
++			switch (adapter->link_speed) {
++			case SPEED_10:
++				txb2b = 0;
++				netdev->tx_queue_len = 10;
++				adapter->tx_timeout_factor = 14;
++				break;
++			case SPEED_100:
++				txb2b = 0;
++				netdev->tx_queue_len = 100;
++				/* maybe add some timeout factor ? */
++				break;
++			}
++
++			/* workaround: re-program speed mode bit after
++			 * link-up event */
++			if ((adapter->flags & FLAG_TARC_SPEED_MODE_BIT) &&
++			    !txb2b) {
++				u32 tarc0;
++				tarc0 = er32(TARC0);
++				tarc0 &= ~SPEED_MODE_BIT;
++				ew32(TARC0, tarc0);
++			}
++
++			/* disable TSO for pcie and 10/100 speeds, to avoid
++			 * some hardware issues */
++			if (!(adapter->flags & FLAG_TSO_FORCE)) {
++				switch (adapter->link_speed) {
++				case SPEED_10:
++				case SPEED_100:
++					ndev_info(netdev,
++					"10/100 speed: disabling TSO\n");
++					netdev->features &= ~NETIF_F_TSO;
++					netdev->features &= ~NETIF_F_TSO6;
++					break;
++				case SPEED_1000:
++					netdev->features |= NETIF_F_TSO;
++					netdev->features |= NETIF_F_TSO6;
++					break;
++				default:
++					/* oops */
++					break;
++				}
++			}
++
++			/* enable transmits in the hardware, need to do this
++			 * after setting TARC0 */
++			tctl = er32(TCTL);
++			tctl |= E1000_TCTL_EN;
++			ew32(TCTL, tctl);
++
++			netif_carrier_on(netdev);
++			netif_wake_queue(netdev);
++
++			if (!test_bit(__E1000_DOWN, &adapter->state))
++				mod_timer(&adapter->phy_info_timer,
++					  round_jiffies(jiffies + 2 * HZ));
++		} else {
++			/* make sure the receive unit is started */
++			if (adapter->flags & FLAG_RX_NEEDS_RESTART) {
++				struct e1000_hw *hw = &adapter->hw;
++				u32 rctl = er32(RCTL);
++				ew32(RCTL, rctl |
++						E1000_RCTL_EN);
++			}
++		}
++	} else {
++		if (netif_carrier_ok(netdev)) {
++			adapter->link_speed = 0;
++			adapter->link_duplex = 0;
++			ndev_info(netdev, "Link is Down\n");
++			netif_carrier_off(netdev);
++			netif_stop_queue(netdev);
++			if (!test_bit(__E1000_DOWN, &adapter->state))
++				mod_timer(&adapter->phy_info_timer,
++					  round_jiffies(jiffies + 2 * HZ));
++
++			if (adapter->flags & FLAG_RX_NEEDS_RESTART)
++				schedule_work(&adapter->reset_task);
++		}
++	}
++
++link_up:
++	e1000_update_stats(adapter);
++
++	mac->tx_packet_delta = adapter->stats.tpt - adapter->tpt_old;
++	adapter->tpt_old = adapter->stats.tpt;
++	mac->collision_delta = adapter->stats.colc - adapter->colc_old;
++	adapter->colc_old = adapter->stats.colc;
++
++	adapter->gorcl = adapter->stats.gorcl - adapter->gorcl_old;
++	adapter->gorcl_old = adapter->stats.gorcl;
++	adapter->gotcl = adapter->stats.gotcl - adapter->gotcl_old;
++	adapter->gotcl_old = adapter->stats.gotcl;
++
++	e1000_update_adaptive(&adapter->hw);
++
++	if (!netif_carrier_ok(netdev)) {
++		tx_pending = (e1000_desc_unused(tx_ring) + 1 <
++			       tx_ring->count);
++		if (tx_pending) {
++			/* We've lost link, so the controller stops DMA,
++			 * but we've got queued Tx work that's never going
++			 * to get done, so reset controller to flush Tx.
++			 * (Do the reset outside of interrupt context). */
++			adapter->tx_timeout_count++;
++			schedule_work(&adapter->reset_task);
++		}
++	}
++
++	/* Cause software interrupt to ensure rx ring is cleaned */
++	ew32(ICS, E1000_ICS_RXDMT0);
++
++	/* Force detection of hung controller every watchdog period */
++	adapter->detect_tx_hung = 1;
++
++	/* With 82571 controllers, LAA may be overwritten due to controller
++	 * reset from the other port. Set the appropriate LAA in RAR[0] */
++	if (e1000_get_laa_state_82571(hw))
++		e1000_rar_set(hw, adapter->hw.mac.addr, 0);
++
++	/* Reset the timer */
++	if (!test_bit(__E1000_DOWN, &adapter->state))
++		mod_timer(&adapter->watchdog_timer,
++			  round_jiffies(jiffies + 2 * HZ));
++}
++
++#define E1000_TX_FLAGS_CSUM		0x00000001
++#define E1000_TX_FLAGS_VLAN		0x00000002
++#define E1000_TX_FLAGS_TSO		0x00000004
++#define E1000_TX_FLAGS_IPV4		0x00000008
++#define E1000_TX_FLAGS_VLAN_MASK	0xffff0000
++#define E1000_TX_FLAGS_VLAN_SHIFT	16
++
++static int e1000_tso(struct e1000_adapter *adapter,
++		     struct sk_buff *skb)
++{
++	struct e1000_ring *tx_ring = adapter->tx_ring;
++	struct e1000_context_desc *context_desc;
++	struct e1000_buffer *buffer_info;
++	unsigned int i;
++	u32 cmd_length = 0;
++	u16 ipcse = 0, tucse, mss;
++	u8 ipcss, ipcso, tucss, tucso, hdr_len;
++	int err;
++
++	if (skb_is_gso(skb)) {
++		if (skb_header_cloned(skb)) {
++			err = pskb_expand_head(skb, 0, 0, GFP_ATOMIC);
++			if (err)
++				return err;
++		}
++
++		hdr_len = skb_transport_offset(skb) + tcp_hdrlen(skb);
++		mss = skb_shinfo(skb)->gso_size;
++		if (skb->protocol == htons(ETH_P_IP)) {
++			struct iphdr *iph = ip_hdr(skb);
++			iph->tot_len = 0;
++			iph->check = 0;
++			tcp_hdr(skb)->check = ~csum_tcpudp_magic(iph->saddr,
++								 iph->daddr, 0,
++								 IPPROTO_TCP,
++								 0);
++			cmd_length = E1000_TXD_CMD_IP;
++			ipcse = skb_transport_offset(skb) - 1;
++		} else if (skb_shinfo(skb)->gso_type == SKB_GSO_TCPV6) {
++			ipv6_hdr(skb)->payload_len = 0;
++			tcp_hdr(skb)->check =
++				~csum_ipv6_magic(&ipv6_hdr(skb)->saddr,
++						 &ipv6_hdr(skb)->daddr,
++						 0, IPPROTO_TCP, 0);
++			ipcse = 0;
++		}
++		ipcss = skb_network_offset(skb);
++		ipcso = (void *)&(ip_hdr(skb)->check) - (void *)skb->data;
++		tucss = skb_transport_offset(skb);
++		tucso = (void *)&(tcp_hdr(skb)->check) - (void *)skb->data;
++		tucse = 0;
++
++		cmd_length |= (E1000_TXD_CMD_DEXT | E1000_TXD_CMD_TSE |
++			       E1000_TXD_CMD_TCP | (skb->len - (hdr_len)));
++
++		i = tx_ring->next_to_use;
++		context_desc = E1000_CONTEXT_DESC(*tx_ring, i);
++		buffer_info = &tx_ring->buffer_info[i];
++
++		context_desc->lower_setup.ip_fields.ipcss  = ipcss;
++		context_desc->lower_setup.ip_fields.ipcso  = ipcso;
++		context_desc->lower_setup.ip_fields.ipcse  = cpu_to_le16(ipcse);
++		context_desc->upper_setup.tcp_fields.tucss = tucss;
++		context_desc->upper_setup.tcp_fields.tucso = tucso;
++		context_desc->upper_setup.tcp_fields.tucse = cpu_to_le16(tucse);
++		context_desc->tcp_seg_setup.fields.mss     = cpu_to_le16(mss);
++		context_desc->tcp_seg_setup.fields.hdr_len = hdr_len;
++		context_desc->cmd_and_length = cpu_to_le32(cmd_length);
++
++		buffer_info->time_stamp = jiffies;
++		buffer_info->next_to_watch = i;
++
++		i++;
++		if (i == tx_ring->count)
++			i = 0;
++		tx_ring->next_to_use = i;
++
++		return 1;
++	}
++
++	return 0;
++}
++
++static bool e1000_tx_csum(struct e1000_adapter *adapter, struct sk_buff *skb)
++{
++	struct e1000_ring *tx_ring = adapter->tx_ring;
++	struct e1000_context_desc *context_desc;
++	struct e1000_buffer *buffer_info;
++	unsigned int i;
++	u8 css;
++
++	if (skb->ip_summed == CHECKSUM_PARTIAL) {
++		css = skb_transport_offset(skb);
++
++		i = tx_ring->next_to_use;
++		buffer_info = &tx_ring->buffer_info[i];
++		context_desc = E1000_CONTEXT_DESC(*tx_ring, i);
++
++		context_desc->lower_setup.ip_config = 0;
++		context_desc->upper_setup.tcp_fields.tucss = css;
++		context_desc->upper_setup.tcp_fields.tucso =
++					css + skb->csum_offset;
++		context_desc->upper_setup.tcp_fields.tucse = 0;
++		context_desc->tcp_seg_setup.data = 0;
++		context_desc->cmd_and_length = cpu_to_le32(E1000_TXD_CMD_DEXT);
++
++		buffer_info->time_stamp = jiffies;
++		buffer_info->next_to_watch = i;
++
++		i++;
++		if (i == tx_ring->count)
++			i = 0;
++		tx_ring->next_to_use = i;
++
++		return 1;
++	}
++
++	return 0;
++}
++
++#define E1000_MAX_PER_TXD	8192
++#define E1000_MAX_TXD_PWR	12
++
++static int e1000_tx_map(struct e1000_adapter *adapter,
++			struct sk_buff *skb, unsigned int first,
++			unsigned int max_per_txd, unsigned int nr_frags,
++			unsigned int mss)
++{
++	struct e1000_ring *tx_ring = adapter->tx_ring;
++	struct e1000_buffer *buffer_info;
++	unsigned int len = skb->len - skb->data_len;
++	unsigned int offset = 0, size, count = 0, i;
++	unsigned int f;
++
++	i = tx_ring->next_to_use;
++
++	while (len) {
++		buffer_info = &tx_ring->buffer_info[i];
++		size = min(len, max_per_txd);
++		/* Workaround for Controller erratum --
++		 * descriptor for non-tso packet in a linear SKB that follows a
++		 * tso gets written back prematurely before the data is fully
++		 * DMA'd to the controller */
++		if (tx_ring->last_tx_tso && !skb_is_gso(skb)) {
++			tx_ring->last_tx_tso = 0;
++			if (!skb->data_len)
++				size -= 4;
++		}
++
++		/* Workaround for premature desc write-backs
++		 * in TSO mode.  Append 4-byte sentinel desc */
++		if (mss && !nr_frags && size == len && size > 8)
++			size -= 4;
++
++		buffer_info->length = size;
++		/* set time_stamp *before* dma to help avoid a possible race */
++		buffer_info->time_stamp = jiffies;
++		buffer_info->dma =
++			pci_map_single(adapter->pdev,
++				skb->data + offset,
++				size,
++				PCI_DMA_TODEVICE);
++		buffer_info->next_to_watch = i;
++
++		len -= size;
++		offset += size;
++		count++;
++		i++;
++		if (i == tx_ring->count)
++			i = 0;
++	}
++
++	for (f = 0; f < nr_frags; f++) {
++		struct skb_frag_struct *frag;
++
++		frag = &skb_shinfo(skb)->frags[f];
++		len = frag->size;
++		offset = frag->page_offset;
++
++		while (len) {
++			buffer_info = &tx_ring->buffer_info[i];
++			size = min(len, max_per_txd);
++			/* Workaround for premature desc write-backs
++			 * in TSO mode.  Append 4-byte sentinel desc */
++			if (mss && f == (nr_frags-1) && size == len && size > 8)
++				size -= 4;
++
++			buffer_info->length = size;
++			buffer_info->time_stamp = jiffies;
++			buffer_info->dma =
++				pci_map_page(adapter->pdev,
++					frag->page,
++					offset,
++					size,
++					PCI_DMA_TODEVICE);
++			buffer_info->next_to_watch = i;
++
++			len -= size;
++			offset += size;
++			count++;
++
++			i++;
++			if (i == tx_ring->count)
++				i = 0;
++		}
++	}
++
++	if (i == 0)
++		i = tx_ring->count - 1;
++	else
++		i--;
++
++	tx_ring->buffer_info[i].skb = skb;
++	tx_ring->buffer_info[first].next_to_watch = i;
++
++	return count;
++}
++
++static void e1000_tx_queue(struct e1000_adapter *adapter,
++			   int tx_flags, int count)
++{
++	struct e1000_ring *tx_ring = adapter->tx_ring;
++	struct e1000_tx_desc *tx_desc = NULL;
++	struct e1000_buffer *buffer_info;
++	u32 txd_upper = 0, txd_lower = E1000_TXD_CMD_IFCS;
++	unsigned int i;
++
++	if (tx_flags & E1000_TX_FLAGS_TSO) {
++		txd_lower |= E1000_TXD_CMD_DEXT | E1000_TXD_DTYP_D |
++			     E1000_TXD_CMD_TSE;
++		txd_upper |= E1000_TXD_POPTS_TXSM << 8;
++
++		if (tx_flags & E1000_TX_FLAGS_IPV4)
++			txd_upper |= E1000_TXD_POPTS_IXSM << 8;
++	}
++
++	if (tx_flags & E1000_TX_FLAGS_CSUM) {
++		txd_lower |= E1000_TXD_CMD_DEXT | E1000_TXD_DTYP_D;
++		txd_upper |= E1000_TXD_POPTS_TXSM << 8;
++	}
++
++	if (tx_flags & E1000_TX_FLAGS_VLAN) {
++		txd_lower |= E1000_TXD_CMD_VLE;
++		txd_upper |= (tx_flags & E1000_TX_FLAGS_VLAN_MASK);
++	}
++
++	i = tx_ring->next_to_use;
++
++	while (count--) {
++		buffer_info = &tx_ring->buffer_info[i];
++		tx_desc = E1000_TX_DESC(*tx_ring, i);
++		tx_desc->buffer_addr = cpu_to_le64(buffer_info->dma);
++		tx_desc->lower.data =
++			cpu_to_le32(txd_lower | buffer_info->length);
++		tx_desc->upper.data = cpu_to_le32(txd_upper);
++
++		i++;
++		if (i == tx_ring->count)
++			i = 0;
++	}
++
++	tx_desc->lower.data |= cpu_to_le32(adapter->txd_cmd);
++
++	/* Force memory writes to complete before letting h/w
++	 * know there are new descriptors to fetch.  (Only
++	 * applicable for weak-ordered memory model archs,
++	 * such as IA-64). */
++	wmb();
++
++	tx_ring->next_to_use = i;
++	writel(i, adapter->hw.hw_addr + tx_ring->tail);
++	/* we need this if more than one processor can write to our tail
++	 * at a time, it synchronizes IO on IA64/Altix systems */
++	mmiowb();
++}
++
++#define MINIMUM_DHCP_PACKET_SIZE 282
++static int e1000_transfer_dhcp_info(struct e1000_adapter *adapter,
++				    struct sk_buff *skb)
++{
++	struct e1000_hw *hw =  &adapter->hw;
++	u16 length, offset;
++
++	if (vlan_tx_tag_present(skb)) {
++		if (!((vlan_tx_tag_get(skb) == adapter->hw.mng_cookie.vlan_id)
++		    && (adapter->hw.mng_cookie.status &
++			E1000_MNG_DHCP_COOKIE_STATUS_VLAN)))
++			return 0;
++	}
++
++	if (skb->len <= MINIMUM_DHCP_PACKET_SIZE)
++		return 0;
++
++	if (((struct ethhdr *) skb->data)->h_proto != htons(ETH_P_IP))
++		return 0;
++
++	{
++		const struct iphdr *ip = (struct iphdr *)((u8 *)skb->data+14);
++		struct udphdr *udp;
++
++		if (ip->protocol != IPPROTO_UDP)
++			return 0;
++
++		udp = (struct udphdr *)((u8 *)ip + (ip->ihl << 2));
++		if (ntohs(udp->dest) != 67)
++			return 0;
++
++		offset = (u8 *)udp + 8 - skb->data;
++		length = skb->len - offset;
++		return e1000_mng_write_dhcp_info(hw, (u8 *)udp + 8, length);
++	}
++
++	return 0;
++}
++
++static int __e1000_maybe_stop_tx(struct net_device *netdev, int size)
++{
++	struct e1000_adapter *adapter = netdev_priv(netdev);
++
++	netif_stop_queue(netdev);
++	/* Herbert's original patch had:
++	 *  smp_mb__after_netif_stop_queue();
++	 * but since that doesn't exist yet, just open code it. */
++	smp_mb();
++
++	/* We need to check again in a case another CPU has just
++	 * made room available. */
++	if (e1000_desc_unused(adapter->tx_ring) < size)
++		return -EBUSY;
++
++	/* A reprieve! */
++	netif_start_queue(netdev);
++	++adapter->restart_queue;
++	return 0;
++}
++
++static int e1000_maybe_stop_tx(struct net_device *netdev, int size)
++{
++	struct e1000_adapter *adapter = netdev_priv(netdev);
++
++	if (e1000_desc_unused(adapter->tx_ring) >= size)
++		return 0;
++	return __e1000_maybe_stop_tx(netdev, size);
++}
++
++#define TXD_USE_COUNT(S, X) (((S) >> (X)) + 1 )
++static int e1000_xmit_frame(struct sk_buff *skb, struct net_device *netdev)
++{
++	struct e1000_adapter *adapter = netdev_priv(netdev);
++	struct e1000_ring *tx_ring = adapter->tx_ring;
++	unsigned int first;
++	unsigned int max_per_txd = E1000_MAX_PER_TXD;
++	unsigned int max_txd_pwr = E1000_MAX_TXD_PWR;
++	unsigned int tx_flags = 0;
++	unsigned int len = skb->len;
++	unsigned long irq_flags;
++	unsigned int nr_frags = 0;
++	unsigned int mss = 0;
++	int count = 0;
++	int tso;
++	unsigned int f;
++	len -= skb->data_len;
++
++	if (test_bit(__E1000_DOWN, &adapter->state)) {
++		dev_kfree_skb_any(skb);
++		return NETDEV_TX_OK;
++	}
++
++	if (skb->len <= 0) {
++		dev_kfree_skb_any(skb);
++		return NETDEV_TX_OK;
++	}
++
++	mss = skb_shinfo(skb)->gso_size;
++	/* The controller does a simple calculation to
++	 * make sure there is enough room in the FIFO before
++	 * initiating the DMA for each buffer.  The calc is:
++	 * 4 = ceil(buffer len/mss).  To make sure we don't
++	 * overrun the FIFO, adjust the max buffer len if mss
++	 * drops. */
++	if (mss) {
++		u8 hdr_len;
++		max_per_txd = min(mss << 2, max_per_txd);
++		max_txd_pwr = fls(max_per_txd) - 1;
++
++		/* TSO Workaround for 82571/2/3 Controllers -- if skb->data
++		* points to just header, pull a few bytes of payload from
++		* frags into skb->data */
++		hdr_len = skb_transport_offset(skb) + tcp_hdrlen(skb);
++		if (skb->data_len && (hdr_len == (skb->len - skb->data_len))) {
++			unsigned int pull_size;
++
++			pull_size = min((unsigned int)4, skb->data_len);
++			if (!__pskb_pull_tail(skb, pull_size)) {
++				ndev_err(netdev,
++					 "__pskb_pull_tail failed.\n");
++				dev_kfree_skb_any(skb);
++				return NETDEV_TX_OK;
++			}
++			len = skb->len - skb->data_len;
++		}
++	}
++
++	/* reserve a descriptor for the offload context */
++	if ((mss) || (skb->ip_summed == CHECKSUM_PARTIAL))
++		count++;
++	count++;
++
++	/* Controller Erratum workaround */
++	if (!skb->data_len && tx_ring->last_tx_tso && !skb_is_gso(skb))
++		count++;
++
++	count += TXD_USE_COUNT(len, max_txd_pwr);
++
++	nr_frags = skb_shinfo(skb)->nr_frags;
++	for (f = 0; f < nr_frags; f++)
++		count += TXD_USE_COUNT(skb_shinfo(skb)->frags[f].size,
++				       max_txd_pwr);
++
++	if (adapter->hw.mac.tx_pkt_filtering)
++		e1000_transfer_dhcp_info(adapter, skb);
++
++	if (!spin_trylock_irqsave(&adapter->tx_queue_lock, irq_flags))
++		/* Collision - tell upper layer to requeue */
++		return NETDEV_TX_LOCKED;
++
++	/* need: count + 2 desc gap to keep tail from touching
++	 * head, otherwise try next time */
++	if (e1000_maybe_stop_tx(netdev, count + 2)) {
++		spin_unlock_irqrestore(&adapter->tx_queue_lock, irq_flags);
++		return NETDEV_TX_BUSY;
++	}
++
++	if (adapter->vlgrp && vlan_tx_tag_present(skb)) {
++		tx_flags |= E1000_TX_FLAGS_VLAN;
++		tx_flags |= (vlan_tx_tag_get(skb) << E1000_TX_FLAGS_VLAN_SHIFT);
++	}
++
++	first = tx_ring->next_to_use;
++
++	tso = e1000_tso(adapter, skb);
++	if (tso < 0) {
++		dev_kfree_skb_any(skb);
++		spin_unlock_irqrestore(&adapter->tx_queue_lock, irq_flags);
++		return NETDEV_TX_OK;
++	}
++
++	if (tso) {
++		tx_ring->last_tx_tso = 1;
++		tx_flags |= E1000_TX_FLAGS_TSO;
++	} else if (e1000_tx_csum(adapter, skb)) {
++		tx_flags |= E1000_TX_FLAGS_CSUM;
++	}
++
++	/* Old method was to assume IPv4 packet by default if TSO was enabled.
++	 * 82571 hardware supports TSO capabilities for IPv6 as well...
++	 * no longer assume, we must. */
++	if (skb->protocol == htons(ETH_P_IP))
++		tx_flags |= E1000_TX_FLAGS_IPV4;
++
++	e1000_tx_queue(adapter, tx_flags,
++		       e1000_tx_map(adapter, skb, first,
++				    max_per_txd, nr_frags, mss));
++
++	netdev->trans_start = jiffies;
++
++	/* Make sure there is space in the ring for the next send. */
++	e1000_maybe_stop_tx(netdev, MAX_SKB_FRAGS + 2);
++
++	spin_unlock_irqrestore(&adapter->tx_queue_lock, irq_flags);
++	return NETDEV_TX_OK;
++}
++
++/**
++ * e1000_tx_timeout - Respond to a Tx Hang
++ * @netdev: network interface device structure
++ **/
++static void e1000_tx_timeout(struct net_device *netdev)
++{
++	struct e1000_adapter *adapter = netdev_priv(netdev);
++
++	/* Do the reset outside of interrupt context */
++	adapter->tx_timeout_count++;
++	schedule_work(&adapter->reset_task);
++}
++
++static void e1000_reset_task(struct work_struct *work)
++{
++	struct e1000_adapter *adapter;
++	adapter = container_of(work, struct e1000_adapter, reset_task);
++
++	e1000_reinit_locked(adapter);
++}
++
++/**
++ * e1000_get_stats - Get System Network Statistics
++ * @netdev: network interface device structure
++ *
++ * Returns the address of the device statistics structure.
++ * The statistics are actually updated from the timer callback.
++ **/
++static struct net_device_stats *e1000_get_stats(struct net_device *netdev)
++{
++	struct e1000_adapter *adapter = netdev_priv(netdev);
++
++	/* only return the current stats */
++	return &adapter->net_stats;
++}
++
++/**
++ * e1000_change_mtu - Change the Maximum Transfer Unit
++ * @netdev: network interface device structure
++ * @new_mtu: new value for maximum frame size
++ *
++ * Returns 0 on success, negative on failure
++ **/
++static int e1000_change_mtu(struct net_device *netdev, int new_mtu)
++{
++	struct e1000_adapter *adapter = netdev_priv(netdev);
++	int max_frame = new_mtu + ETH_HLEN + ETH_FCS_LEN;
++
++	if ((max_frame < ETH_ZLEN + ETH_FCS_LEN) ||
++	    (max_frame > MAX_JUMBO_FRAME_SIZE)) {
++		ndev_err(netdev, "Invalid MTU setting\n");
++		return -EINVAL;
++	}
++
++	/* Jumbo frame size limits */
++	if (max_frame > ETH_FRAME_LEN + ETH_FCS_LEN) {
++		if (!(adapter->flags & FLAG_HAS_JUMBO_FRAMES)) {
++			ndev_err(netdev, "Jumbo Frames not supported.\n");
++			return -EINVAL;
++		}
++		if (adapter->hw.phy.type == e1000_phy_ife) {
++			ndev_err(netdev, "Jumbo Frames not supported.\n");
++			return -EINVAL;
++		}
++	}
++
++#define MAX_STD_JUMBO_FRAME_SIZE 9234
++	if (max_frame > MAX_STD_JUMBO_FRAME_SIZE) {
++		ndev_err(netdev, "MTU > 9216 not supported.\n");
++		return -EINVAL;
++	}
++
++	while (test_and_set_bit(__E1000_RESETTING, &adapter->state))
++		msleep(1);
++	/* e1000_down has a dependency on max_frame_size */
++	adapter->hw.mac.max_frame_size = max_frame;
++	if (netif_running(netdev))
++		e1000_down(adapter);
++
++	/* NOTE: netdev_alloc_skb reserves 16 bytes, and typically NET_IP_ALIGN
++	 * means we reserve 2 more, this pushes us to allocate from the next
++	 * larger slab size.
++	 * i.e. RXBUFFER_2048 --> size-4096 slab
++	 *  however with the new *_jumbo* routines, jumbo receives will use
++	 *  fragmented skbs */
++
++	if (max_frame <= 256)
++		adapter->rx_buffer_len = 256;
++	else if (max_frame <= 512)
++		adapter->rx_buffer_len = 512;
++	else if (max_frame <= 1024)
++		adapter->rx_buffer_len = 1024;
++	else if (max_frame <= 2048)
++		adapter->rx_buffer_len = 2048;
++	else
++		adapter->rx_buffer_len = 4096;
++
++	/* adjust allocation if LPE protects us, and we aren't using SBP */
++	if ((max_frame == ETH_FRAME_LEN + ETH_FCS_LEN) ||
++	     (max_frame == ETH_FRAME_LEN + VLAN_HLEN + ETH_FCS_LEN))
++		adapter->rx_buffer_len = ETH_FRAME_LEN + VLAN_HLEN
++					 + ETH_FCS_LEN ;
++
++	ndev_info(netdev, "changing MTU from %d to %d\n",
++		netdev->mtu, new_mtu);
++	netdev->mtu = new_mtu;
++
++	if (netif_running(netdev))
++		e1000_up(adapter);
++	else
++		e1000_reset(adapter);
++
++	clear_bit(__E1000_RESETTING, &adapter->state);
++
++	return 0;
++}
++
++static int e1000_mii_ioctl(struct net_device *netdev, struct ifreq *ifr,
++			   int cmd)
++{
++	struct e1000_adapter *adapter = netdev_priv(netdev);
++	struct mii_ioctl_data *data = if_mii(ifr);
++	unsigned long irq_flags;
++
++	if (adapter->hw.media_type != e1000_media_type_copper)
++		return -EOPNOTSUPP;
++
++	switch (cmd) {
++	case SIOCGMIIPHY:
++		data->phy_id = adapter->hw.phy.addr;
++		break;
++	case SIOCGMIIREG:
++		if (!capable(CAP_NET_ADMIN))
++			return -EPERM;
++		spin_lock_irqsave(&adapter->stats_lock, irq_flags);
++		if (e1e_rphy(&adapter->hw, data->reg_num & 0x1F,
++				   &data->val_out)) {
++			spin_unlock_irqrestore(&adapter->stats_lock, irq_flags);
++			return -EIO;
++		}
++		spin_unlock_irqrestore(&adapter->stats_lock, irq_flags);
++		break;
++	case SIOCSMIIREG:
++	default:
++		return -EOPNOTSUPP;
++	}
++	return E1000_SUCCESS;
++}
++
++static int e1000_ioctl(struct net_device *netdev, struct ifreq *ifr, int cmd)
++{
++	switch (cmd) {
++	case SIOCGMIIPHY:
++	case SIOCGMIIREG:
++	case SIOCSMIIREG:
++		return e1000_mii_ioctl(netdev, ifr, cmd);
++	default:
++		return -EOPNOTSUPP;
++	}
++}
++
++static int e1000_suspend(struct pci_dev *pdev, pm_message_t state)
++{
++	struct net_device *netdev = pci_get_drvdata(pdev);
++	struct e1000_adapter *adapter = netdev_priv(netdev);
++	struct e1000_hw *hw = &adapter->hw;
++	u32 ctrl, ctrl_ext, rctl, status;
++	u32 wufc = adapter->wol;
++	int retval = 0;
++
++	netif_device_detach(netdev);
++
++	if (netif_running(netdev)) {
++		WARN_ON(test_bit(__E1000_RESETTING, &adapter->state));
++		e1000_down(adapter);
++		e1000_free_irq(adapter);
++	}
++
++	retval = pci_save_state(pdev);
++	if (retval)
++		return retval;
++
++	status = er32(STATUS);
++	if (status & E1000_STATUS_LU)
++		wufc &= ~E1000_WUFC_LNKC;
++
++	if (wufc) {
++		e1000_setup_rctl(adapter);
++		e1000_set_multi(netdev);
++
++		/* turn on all-multi mode if wake on multicast is enabled */
++		if (wufc & E1000_WUFC_MC) {
++			rctl = er32(RCTL);
++			rctl |= E1000_RCTL_MPE;
++			ew32(RCTL, rctl);
++		}
++
++		ctrl = er32(CTRL);
++		/* advertise wake from D3Cold */
++		#define E1000_CTRL_ADVD3WUC 0x00100000
++		/* phy power management enable */
++		#define E1000_CTRL_EN_PHY_PWR_MGMT 0x00200000
++		ctrl |= E1000_CTRL_ADVD3WUC |
++			E1000_CTRL_EN_PHY_PWR_MGMT;
++		ew32(CTRL, ctrl);
++
++		if (adapter->hw.media_type == e1000_media_type_fiber ||
++		   adapter->hw.media_type == e1000_media_type_internal_serdes) {
++			/* keep the laser running in D3 */
++			ctrl_ext = er32(CTRL_EXT);
++			ctrl_ext |= E1000_CTRL_EXT_SDP7_DATA;
++			ew32(CTRL_EXT, ctrl_ext);
++		}
++
++		/* Allow time for pending master requests to run */
++		e1000_disable_pcie_master(&adapter->hw);
++
++		ew32(WUC, E1000_WUC_PME_EN);
++		ew32(WUFC, wufc);
++		pci_enable_wake(pdev, PCI_D3hot, 1);
++		pci_enable_wake(pdev, PCI_D3cold, 1);
++	} else {
++		ew32(WUC, 0);
++		ew32(WUFC, 0);
++		pci_enable_wake(pdev, PCI_D3hot, 0);
++		pci_enable_wake(pdev, PCI_D3cold, 0);
++	}
++
++	e1000_release_manageability(adapter);
++
++	/* make sure adapter isn't asleep if manageability is enabled */
++	if (adapter->flags & FLAG_MNG_PT_ENABLED) {
++		pci_enable_wake(pdev, PCI_D3hot, 1);
++		pci_enable_wake(pdev, PCI_D3cold, 1);
++	}
++
++	if (adapter->hw.phy.type == e1000_phy_igp_3)
++		e1000_igp3_phy_powerdown_workaround_ich8lan(&adapter->hw);
++
++	/* Release control of h/w to f/w.  If f/w is AMT enabled, this
++	 * would have already happened in close and is redundant. */
++	e1000_release_hw_control(adapter);
++
++	pci_disable_device(pdev);
++
++	pci_set_power_state(pdev, pci_choose_state(pdev, state));
++
++	return 0;
++}
++
++#ifdef CONFIG_PM
++static int e1000_resume(struct pci_dev *pdev)
++{
++	struct net_device *netdev = pci_get_drvdata(pdev);
++	struct e1000_adapter *adapter = netdev_priv(netdev);
++	struct e1000_hw *hw = &adapter->hw;
++	u32 err;
++
++	pci_set_power_state(pdev, PCI_D0);
++	pci_restore_state(pdev);
++	err = pci_enable_device(pdev);
++	if (err) {
++		dev_err(&pdev->dev,
++			"Cannot enable PCI device from suspend\n");
++		return err;
++	}
++
++	pci_set_master(pdev);
++
++	pci_enable_wake(pdev, PCI_D3hot, 0);
++	pci_enable_wake(pdev, PCI_D3cold, 0);
++
++	if (netif_running(netdev)) {
++		err = e1000_request_irq(adapter);
++		if (err)
++			return err;
++	}
++
++	e1000_power_up_phy(adapter);
++	e1000_reset(adapter);
++	ew32(WUS, ~0);
++
++	e1000_init_manageability(adapter);
++
++	if (netif_running(netdev))
++		e1000_up(adapter);
++
++	netif_device_attach(netdev);
++
++	/* If the controller has AMT, do not set DRV_LOAD until the interface
++	 * is up.  For all other cases, let the f/w know that the h/w is now
++	 * under the control of the driver. */
++	if (!(adapter->flags & FLAG_HAS_AMT) || !e1000_check_mng_mode(&adapter->hw))
++		e1000_get_hw_control(adapter);
++
++	return 0;
++}
++#endif
++
++static void e1000_shutdown(struct pci_dev *pdev)
++{
++	e1000_suspend(pdev, PMSG_SUSPEND);
++}
++
++#ifdef CONFIG_NET_POLL_CONTROLLER
++/*
++ * Polling 'interrupt' - used by things like netconsole to send skbs
++ * without having to re-enable interrupts. It's not called while
++ * the interrupt routine is executing.
++ */
++static void e1000_netpoll(struct net_device *netdev)
++{
++	struct e1000_adapter *adapter = netdev_priv(netdev);
++
++	disable_irq(adapter->pdev->irq);
++	e1000_intr(adapter->pdev->irq, netdev);
++
++	e1000_clean_tx_irq(adapter);
++
++	enable_irq(adapter->pdev->irq);
++}
++#endif
++
++/**
++ * e1000_io_error_detected - called when PCI error is detected
++ * @pdev: Pointer to PCI device
++ * @state: The current pci connection state
++ *
++ * This function is called after a PCI bus error affecting
++ * this device has been detected.
++ */
++static pci_ers_result_t e1000_io_error_detected(struct pci_dev *pdev,
++						pci_channel_state_t state)
++{
++	struct net_device *netdev = pci_get_drvdata(pdev);
++	struct e1000_adapter *adapter = netdev_priv(netdev);
++
++	netif_device_detach(netdev);
++
++	if (netif_running(netdev))
++		e1000_down(adapter);
++	pci_disable_device(pdev);
++
++	/* Request a slot slot reset. */
++	return PCI_ERS_RESULT_NEED_RESET;
++}
++
++/**
++ * e1000_io_slot_reset - called after the pci bus has been reset.
++ * @pdev: Pointer to PCI device
++ *
++ * Restart the card from scratch, as if from a cold-boot. Implementation
++ * resembles the first-half of the e1000_resume routine.
++ */
++static pci_ers_result_t e1000_io_slot_reset(struct pci_dev *pdev)
++{
++	struct net_device *netdev = pci_get_drvdata(pdev);
++	struct e1000_adapter *adapter = netdev_priv(netdev);
++	struct e1000_hw *hw = &adapter->hw;
++
++	if (pci_enable_device(pdev)) {
++		dev_err(&pdev->dev,
++			"Cannot re-enable PCI device after reset.\n");
++		return PCI_ERS_RESULT_DISCONNECT;
++	}
++	pci_set_master(pdev);
++
++	pci_enable_wake(pdev, PCI_D3hot, 0);
++	pci_enable_wake(pdev, PCI_D3cold, 0);
++
++	e1000_reset(adapter);
++	ew32(WUS, ~0);
++
++	return PCI_ERS_RESULT_RECOVERED;
++}
++
++/**
++ * e1000_io_resume - called when traffic can start flowing again.
++ * @pdev: Pointer to PCI device
++ *
++ * This callback is called when the error recovery driver tells us that
++ * its OK to resume normal operation. Implementation resembles the
++ * second-half of the e1000_resume routine.
++ */
++static void e1000_io_resume(struct pci_dev *pdev)
++{
++	struct net_device *netdev = pci_get_drvdata(pdev);
++	struct e1000_adapter *adapter = netdev_priv(netdev);
++
++	e1000_init_manageability(adapter);
++
++	if (netif_running(netdev)) {
++		if (e1000_up(adapter)) {
++			dev_err(&pdev->dev,
++				"can't bring device back up after reset\n");
++			return;
++		}
++	}
++
++	netif_device_attach(netdev);
++
++	/* If the controller has AMT, do not set DRV_LOAD until the interface
++	 * is up.  For all other cases, let the f/w know that the h/w is now
++	 * under the control of the driver. */
++	if (!(adapter->flags & FLAG_HAS_AMT) ||
++	    !e1000_check_mng_mode(&adapter->hw))
++		e1000_get_hw_control(adapter);
++
++}
++
++static void e1000_print_device_info(struct e1000_adapter *adapter)
++{
++	struct e1000_hw *hw = &adapter->hw;
++	struct net_device *netdev = adapter->netdev;
++
++	/* print bus type/speed/width info */
++	ndev_info(netdev, "(PCI Express:2.5GB/s:%s) "
++		  "%02x:%02x:%02x:%02x:%02x:%02x\n",
++		  /* bus width */
++		 ((hw->bus.width == e1000_bus_width_pcie_x4) ? "Width x4" :
++		  "Width x1"),
++		  /* MAC address */
++		  netdev->dev_addr[0], netdev->dev_addr[1],
++		  netdev->dev_addr[2], netdev->dev_addr[3],
++		  netdev->dev_addr[4], netdev->dev_addr[5]);
++	ndev_info(netdev, "Intel(R) PRO/%s Network Connection\n",
++		  (hw->phy.type == e1000_phy_ife)
++		   ? "10/100" : "1000");
++}
++
++/**
++ * e1000_probe - Device Initialization Routine
++ * @pdev: PCI device information struct
++ * @ent: entry in e1000_pci_tbl
++ *
++ * Returns 0 on success, negative on failure
++ *
++ * e1000_probe initializes an adapter identified by a pci_dev structure.
++ * The OS initialization, configuring of the adapter private structure,
++ * and a hardware reset occur.
++ **/
++static int __devinit e1000_probe(struct pci_dev *pdev,
++				 const struct pci_device_id *ent)
++{
++	struct net_device *netdev;
++	struct e1000_adapter *adapter;
++	struct e1000_hw *hw;
++	const struct e1000_info *ei = e1000_info_tbl[ent->driver_data];
++	unsigned long mmio_start, mmio_len;
++	unsigned long flash_start, flash_len;
++
++	static int cards_found;
++	int i, err, pci_using_dac;
++	u16 eeprom_data = 0;
++	u16 eeprom_apme_mask = E1000_EEPROM_APME;
++
++	err = pci_enable_device(pdev);
++	if (err)
++		return err;
++
++	pci_using_dac = 0;
++	err = pci_set_dma_mask(pdev, DMA_64BIT_MASK);
++	if (!err) {
++		err = pci_set_consistent_dma_mask(pdev, DMA_64BIT_MASK);
++		if (!err)
++			pci_using_dac = 1;
++	} else {
++		err = pci_set_dma_mask(pdev, DMA_32BIT_MASK);
++		if (err) {
++			err = pci_set_consistent_dma_mask(pdev,
++							  DMA_32BIT_MASK);
++			if (err) {
++				dev_err(&pdev->dev, "No usable DMA "
++					"configuration, aborting\n");
++				goto err_dma;
++			}
++		}
++	}
++
++	err = pci_request_regions(pdev, e1000_driver_name);
++	if (err)
++		goto err_pci_reg;
++
++	pci_set_master(pdev);
++
++	err = -ENOMEM;
++	netdev = alloc_etherdev(sizeof(struct e1000_adapter));
++	if (!netdev)
++		goto err_alloc_etherdev;
++
++	SET_MODULE_OWNER(netdev);
++	SET_NETDEV_DEV(netdev, &pdev->dev);
++
++	pci_set_drvdata(pdev, netdev);
++	adapter = netdev_priv(netdev);
++	hw = &adapter->hw;
++	adapter->netdev = netdev;
++	adapter->pdev = pdev;
++	adapter->ei = ei;
++	adapter->pba = ei->pba;
++	adapter->flags = ei->flags;
++	adapter->hw.adapter = adapter;
++	adapter->hw.mac.type = ei->mac;
++	adapter->msg_enable = (1 << NETIF_MSG_DRV | NETIF_MSG_PROBE) - 1;
++
++	mmio_start = pci_resource_start(pdev, 0);
++	mmio_len = pci_resource_len(pdev, 0);
++
++	err = -EIO;
++	adapter->hw.hw_addr = ioremap(mmio_start, mmio_len);
++	if (!adapter->hw.hw_addr)
++		goto err_ioremap;
++
++	if ((adapter->flags & FLAG_HAS_FLASH) &&
++	    (pci_resource_flags(pdev, 1) & IORESOURCE_MEM)) {
++		flash_start = pci_resource_start(pdev, 1);
++		flash_len = pci_resource_len(pdev, 1);
++		adapter->hw.flash_address = ioremap(flash_start, flash_len);
++		if (!adapter->hw.flash_address)
++			goto err_flashmap;
++	}
++
++	/* construct the net_device struct */
++	netdev->open			= &e1000_open;
++	netdev->stop			= &e1000_close;
++	netdev->hard_start_xmit		= &e1000_xmit_frame;
++	netdev->get_stats		= &e1000_get_stats;
++	netdev->set_multicast_list	= &e1000_set_multi;
++	netdev->set_mac_address		= &e1000_set_mac;
++	netdev->change_mtu		= &e1000_change_mtu;
++	netdev->do_ioctl		= &e1000_ioctl;
++	e1000_set_ethtool_ops(netdev);
++	netdev->tx_timeout		= &e1000_tx_timeout;
++	netdev->watchdog_timeo		= 5 * HZ;
++	netdev->poll			= &e1000_clean;
++	netdev->weight			= 64;
++	netdev->vlan_rx_register	= e1000_vlan_rx_register;
++	netdev->vlan_rx_add_vid		= e1000_vlan_rx_add_vid;
++	netdev->vlan_rx_kill_vid	= e1000_vlan_rx_kill_vid;
++#ifdef CONFIG_NET_POLL_CONTROLLER
++	netdev->poll_controller		= e1000_netpoll;
++#endif
++	strncpy(netdev->name, pci_name(pdev), sizeof(netdev->name) - 1);
++
++	netdev->mem_start = mmio_start;
++	netdev->mem_end = mmio_start + mmio_len;
++
++	adapter->bd_number = cards_found++;
++
++	/* setup adapter struct */
++	err = e1000_sw_init(adapter);
++	if (err)
++		goto err_sw_init;
++
++	err = -EIO;
++
++	memcpy(&hw->mac.ops, ei->mac_ops, sizeof(hw->mac.ops));
++	memcpy(&hw->nvm.ops, ei->nvm_ops, sizeof(hw->nvm.ops));
++	memcpy(&hw->phy.ops, ei->phy_ops, sizeof(hw->phy.ops));
++
++	err = ei->get_invariants(adapter);
++	if (err)
++		goto err_hw_init;
++
++	hw->mac.ops.get_bus_info(&adapter->hw);
++
++	adapter->hw.phy.wait_for_link = 0;
++
++	/* Copper options */
++	if (adapter->hw.media_type == e1000_media_type_copper) {
++		adapter->hw.phy.mdix = AUTO_ALL_MODES;
++		adapter->hw.phy.disable_polarity_correction = 0;
++		adapter->hw.phy.ms_type = e1000_ms_hw_default;
++	}
++
++	if (e1000_check_reset_block(&adapter->hw))
++		ndev_info(netdev,
++			  "PHY reset is blocked due to SOL/IDER session.\n");
++
++	netdev->features = NETIF_F_SG |
++			   NETIF_F_HW_CSUM |
++			   NETIF_F_HW_VLAN_TX |
++			   NETIF_F_HW_VLAN_RX;
++
++	if (adapter->flags & FLAG_HAS_HW_VLAN_FILTER)
++		netdev->features |= NETIF_F_HW_VLAN_FILTER;
++
++	netdev->features |= NETIF_F_TSO;
++	netdev->features |= NETIF_F_TSO6;
++
++	if (pci_using_dac)
++		netdev->features |= NETIF_F_HIGHDMA;
++
++	/* We should not be using LLTX anymore, but we are still TX faster with
++	 * it. */
++	netdev->features |= NETIF_F_LLTX;
++
++	if (e1000_enable_mng_pass_thru(&adapter->hw))
++		adapter->flags |= FLAG_MNG_PT_ENABLED;
++
++	/* before reading the NVM, reset the controller to
++	 * put the device in a known good starting state */
++	adapter->hw.mac.ops.reset_hw(&adapter->hw);
++
++	/*
++	 * systems with ASPM and others may see the checksum fail on the first
++	 * attempt. Let's give it a few tries
++	 */
++	for (i = 0;; i++) {
++		if (e1000_validate_nvm_checksum(&adapter->hw) >= 0)
++			break;
++		if (i == 2) {
++			ndev_err(netdev, "The NVM Checksum Is Not Valid\n");
++			err = -EIO;
++			goto err_eeprom;
++		}
++	}
++
++	/* copy the MAC address out of the NVM */
++	if (e1000_read_mac_addr(&adapter->hw))
++		ndev_err(netdev, "NVM Read Error while reading MAC address\n");
++
++	memcpy(netdev->dev_addr, adapter->hw.mac.addr, netdev->addr_len);
++	memcpy(netdev->perm_addr, adapter->hw.mac.addr, netdev->addr_len);
++
++	if (!is_valid_ether_addr(netdev->perm_addr)) {
++		ndev_err(netdev, "Invalid MAC Address: "
++			 "%02x:%02x:%02x:%02x:%02x:%02x\n",
++			 netdev->perm_addr[0], netdev->perm_addr[1],
++			 netdev->perm_addr[2], netdev->perm_addr[3],
++			 netdev->perm_addr[4], netdev->perm_addr[5]);
++		err = -EIO;
++		goto err_eeprom;
++	}
++
++	init_timer(&adapter->watchdog_timer);
++	adapter->watchdog_timer.function = &e1000_watchdog;
++	adapter->watchdog_timer.data = (unsigned long) adapter;
++
++	init_timer(&adapter->phy_info_timer);
++	adapter->phy_info_timer.function = &e1000_update_phy_info;
++	adapter->phy_info_timer.data = (unsigned long) adapter;
++
++	INIT_WORK(&adapter->reset_task, e1000_reset_task);
++	INIT_WORK(&adapter->watchdog_task, e1000_watchdog_task);
++
++	e1000_check_options(adapter);
++
++	/* Initialize link parameters. User can change them with ethtool */
++	adapter->hw.mac.autoneg = 1;
++	adapter->hw.mac.original_fc = e1000_fc_default;
++	adapter->hw.mac.fc = e1000_fc_default;
++	adapter->hw.phy.autoneg_advertised = 0x2f;
++
++	/* ring size defaults */
++	adapter->rx_ring->count = 256;
++	adapter->tx_ring->count = 256;
++
++	/*
++	 * Initial Wake on LAN setting - If APM wake is enabled in
++	 * the EEPROM, enable the ACPI Magic Packet filter
++	 */
++	if (adapter->flags & FLAG_APME_IN_WUC) {
++		/* APME bit in EEPROM is mapped to WUC.APME */
++		eeprom_data = er32(WUC);
++		eeprom_apme_mask = E1000_WUC_APME;
++	} else if (adapter->flags & FLAG_APME_IN_CTRL3) {
++		if (adapter->flags & FLAG_APME_CHECK_PORT_B &&
++		    (adapter->hw.bus.func == 1))
++			e1000_read_nvm(&adapter->hw,
++				NVM_INIT_CONTROL3_PORT_B, 1, &eeprom_data);
++		else
++			e1000_read_nvm(&adapter->hw,
++				NVM_INIT_CONTROL3_PORT_A, 1, &eeprom_data);
++	}
++
++	/* fetch WoL from EEPROM */
++	if (eeprom_data & eeprom_apme_mask)
++		adapter->eeprom_wol |= E1000_WUFC_MAG;
++
++	/*
++	 * now that we have the eeprom settings, apply the special cases
++	 * where the eeprom may be wrong or the board simply won't support
++	 * wake on lan on a particular port
++	 */
++	if (!(adapter->flags & FLAG_HAS_WOL))
++		adapter->eeprom_wol = 0;
++
++	/* initialize the wol settings based on the eeprom settings */
++	adapter->wol = adapter->eeprom_wol;
++
++	/* reset the hardware with the new settings */
++	e1000_reset(adapter);
++
++	/* If the controller has AMT, do not set DRV_LOAD until the interface
++	 * is up.  For all other cases, let the f/w know that the h/w is now
++	 * under the control of the driver. */
++	if (!(adapter->flags & FLAG_HAS_AMT) ||
++	    !e1000_check_mng_mode(&adapter->hw))
++		e1000_get_hw_control(adapter);
++
++	/* tell the stack to leave us alone until e1000_open() is called */
++	netif_carrier_off(netdev);
++	netif_stop_queue(netdev);
++	netif_poll_disable(netdev);
++
++	strcpy(netdev->name, "eth%d");
++	err = register_netdev(netdev);
++	if (err)
++		goto err_register;
++
++	e1000_print_device_info(adapter);
++
++	return 0;
++
++err_register:
++err_hw_init:
++	e1000_release_hw_control(adapter);
++err_eeprom:
++	if (!e1000_check_reset_block(&adapter->hw))
++		e1000_phy_hw_reset(&adapter->hw);
++
++	if (adapter->hw.flash_address)
++		iounmap(adapter->hw.flash_address);
++
++err_flashmap:
++	kfree(adapter->tx_ring);
++	kfree(adapter->rx_ring);
++err_sw_init:
++	iounmap(adapter->hw.hw_addr);
++err_ioremap:
++	free_netdev(netdev);
++err_alloc_etherdev:
++	pci_release_regions(pdev);
++err_pci_reg:
++err_dma:
++	pci_disable_device(pdev);
++	return err;
++}
++
++/**
++ * e1000_remove - Device Removal Routine
++ * @pdev: PCI device information struct
++ *
++ * e1000_remove is called by the PCI subsystem to alert the driver
++ * that it should release a PCI device.  The could be caused by a
++ * Hot-Plug event, or because the driver is going to be removed from
++ * memory.
++ **/
++static void __devexit e1000_remove(struct pci_dev *pdev)
++{
++	struct net_device *netdev = pci_get_drvdata(pdev);
++	struct e1000_adapter *adapter = netdev_priv(netdev);
++
++	/* flush_scheduled work may reschedule our watchdog task, so
++	 * explicitly disable watchdog tasks from being rescheduled  */
++	set_bit(__E1000_DOWN, &adapter->state);
++	del_timer_sync(&adapter->watchdog_timer);
++	del_timer_sync(&adapter->phy_info_timer);
++
++	flush_scheduled_work();
++
++	e1000_release_manageability(adapter);
++
++	/* Release control of h/w to f/w.  If f/w is AMT enabled, this
++	 * would have already happened in close and is redundant. */
++	e1000_release_hw_control(adapter);
++
++	unregister_netdev(netdev);
++
++	if (!e1000_check_reset_block(&adapter->hw))
++		e1000_phy_hw_reset(&adapter->hw);
++
++	kfree(adapter->tx_ring);
++	kfree(adapter->rx_ring);
++
++	iounmap(adapter->hw.hw_addr);
++	if (adapter->hw.flash_address)
++		iounmap(adapter->hw.flash_address);
++	pci_release_regions(pdev);
++
++	free_netdev(netdev);
++
++	pci_disable_device(pdev);
++}
++
++/* PCI Error Recovery (ERS) */
++static struct pci_error_handlers e1000_err_handler = {
++	.error_detected = e1000_io_error_detected,
++	.slot_reset = e1000_io_slot_reset,
++	.resume = e1000_io_resume,
++};
++
++static struct pci_device_id e1000e_pci_tbl[] = {
++	/*
++	 * Support for 82571/2/3, es2lan and ich8 will be phased in
++	 * stepwise.
++
++	{ PCI_VDEVICE(INTEL, E1000_DEV_ID_82571EB_COPPER), board_82571 },
++	{ PCI_VDEVICE(INTEL, E1000_DEV_ID_82571EB_FIBER), board_82571 },
++	{ PCI_VDEVICE(INTEL, E1000_DEV_ID_82571EB_QUAD_COPPER), board_82571 },
++	{ PCI_VDEVICE(INTEL, E1000_DEV_ID_82571EB_QUAD_COPPER_LP), board_82571 },
++	{ PCI_VDEVICE(INTEL, E1000_DEV_ID_82571EB_QUAD_FIBER), board_82571 },
++	{ PCI_VDEVICE(INTEL, E1000_DEV_ID_82571EB_SERDES), board_82571 },
++	{ PCI_VDEVICE(INTEL, E1000_DEV_ID_82572EI), board_82572 },
++	{ PCI_VDEVICE(INTEL, E1000_DEV_ID_82572EI_COPPER), board_82572 },
++	{ PCI_VDEVICE(INTEL, E1000_DEV_ID_82572EI_FIBER), board_82572 },
++	{ PCI_VDEVICE(INTEL, E1000_DEV_ID_82572EI_SERDES), board_82572 },
++	{ PCI_VDEVICE(INTEL, E1000_DEV_ID_82573E), board_82573 },
++	{ PCI_VDEVICE(INTEL, E1000_DEV_ID_82573E_IAMT), board_82573 },
++	{ PCI_VDEVICE(INTEL, E1000_DEV_ID_82573L), board_82573 },
++	{ PCI_VDEVICE(INTEL, E1000_DEV_ID_80003ES2LAN_COPPER_DPT),
++	  board_80003es2lan },
++	{ PCI_VDEVICE(INTEL, E1000_DEV_ID_80003ES2LAN_COPPER_SPT),
++	  board_80003es2lan },
++	{ PCI_VDEVICE(INTEL, E1000_DEV_ID_80003ES2LAN_SERDES_DPT),
++	  board_80003es2lan },
++	{ PCI_VDEVICE(INTEL, E1000_DEV_ID_80003ES2LAN_SERDES_SPT),
++	  board_80003es2lan },
++	{ PCI_VDEVICE(INTEL, E1000_DEV_ID_ICH8_IFE), board_ich8lan },
++	{ PCI_VDEVICE(INTEL, E1000_DEV_ID_ICH8_IFE_G), board_ich8lan },
++	{ PCI_VDEVICE(INTEL, E1000_DEV_ID_ICH8_IFE_GT), board_ich8lan },
++	{ PCI_VDEVICE(INTEL, E1000_DEV_ID_ICH8_IGP_AMT), board_ich8lan },
++	{ PCI_VDEVICE(INTEL, E1000_DEV_ID_ICH8_IGP_C), board_ich8lan },
++	{ PCI_VDEVICE(INTEL, E1000_DEV_ID_ICH8_IGP_M), board_ich8lan },
++	{ PCI_VDEVICE(INTEL, E1000_DEV_ID_ICH8_IGP_M_AMT), board_ich8lan },
++	*/
++
++	{ PCI_VDEVICE(INTEL, E1000_DEV_ID_ICH9_IFE), board_ich9lan },
++	{ PCI_VDEVICE(INTEL, E1000_DEV_ID_ICH9_IFE_G), board_ich9lan },
++	{ PCI_VDEVICE(INTEL, E1000_DEV_ID_ICH9_IFE_GT), board_ich9lan },
++	{ PCI_VDEVICE(INTEL, E1000_DEV_ID_ICH9_IGP_AMT), board_ich9lan },
++	{ PCI_VDEVICE(INTEL, E1000_DEV_ID_ICH9_IGP_C), board_ich9lan },
++
++	{ }	/* terminate list */
++};
++MODULE_DEVICE_TABLE(pci, e1000e_pci_tbl);
++
++/* PCI Device API Driver */
++static struct pci_driver e1000_driver = {
++	.name     = e1000_driver_name,
++	.id_table = e1000e_pci_tbl,
++	.probe    = e1000_probe,
++	.remove   = __devexit_p(e1000_remove),
++#ifdef CONFIG_PM
++	/* Power Managment Hooks */
++	.suspend  = e1000_suspend,
++	.resume   = e1000_resume,
++#endif
++	.shutdown = e1000_shutdown,
++	.err_handler = &e1000_err_handler
++};
++
++/**
++ * e1000_init_module - Driver Registration Routine
++ *
++ * e1000_init_module is the first routine called when the driver is
++ * loaded. All it does is register with the PCI subsystem.
++ **/
++static int __init e1000e_init_module(void)
++{
++	int ret;
++	printk(KERN_INFO "Intel(R) PRO/1000 Network Driver - %s\n",
++	       e1000_driver_version);
++	printk(KERN_INFO "Copyright (c) 1999-2007 Intel Corporation.\n");
++	ret = pci_register_driver(&e1000_driver);
++
++	return ret;
++}
++module_init(e1000e_init_module);
++
++/**
++ * e1000_exit_module - Driver Exit Cleanup Routine
++ *
++ * e1000_exit_module is called just before the driver is removed
++ * from memory.
++ **/
++static void __exit e1000e_exit_module(void)
++{
++	pci_unregister_driver(&e1000_driver);
++}
++module_exit(e1000e_exit_module);
++
++
++MODULE_AUTHOR("Intel Corporation, <linux.nics at intel.com>");
++MODULE_DESCRIPTION("Intel(R) PRO/1000 Network Driver");
++MODULE_LICENSE("GPL");
++MODULE_VERSION(DRV_VERSION);
++
++/* e1000_main.c */
+diff --git a/drivers/net/e1000e/param.c b/drivers/net/e1000e/param.c
+new file mode 100644
+index 0000000..9a70d22
+--- /dev/null
++++ b/drivers/net/e1000e/param.c
+@@ -0,0 +1,382 @@
++/*******************************************************************************
++
++  Intel PRO/1000 Linux driver
++  Copyright(c) 1999 - 2007 Intel Corporation.
++
++  This program is free software; you can redistribute it and/or modify it
++  under the terms and conditions of the GNU General Public License,
++  version 2, as published by the Free Software Foundation.
++
++  This program is distributed in the hope 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.,
++  51 Franklin St - Fifth Floor, Boston, MA 02110-1301 USA.
++
++  The full GNU General Public License is included in this distribution in
++  the file called "COPYING".
++
++  Contact Information:
++  Linux NICS <linux.nics at intel.com>
++  e1000-devel Mailing List <e1000-devel at lists.sourceforge.net>
++  Intel Corporation, 5200 N.E. Elam Young Parkway, Hillsboro, OR 97124-6497
++
++*******************************************************************************/
++
++#include <linux/netdevice.h>
++
++#include "e1000.h"
++
++/* This is the only thing that needs to be changed to adjust the
++ * maximum number of ports that the driver can manage.
++ */
++
++#define E1000_MAX_NIC 32
++
++#define OPTION_UNSET   -1
++#define OPTION_DISABLED 0
++#define OPTION_ENABLED  1
++
++#define COPYBREAK_DEFAULT 256
++unsigned int copybreak = COPYBREAK_DEFAULT;
++module_param(copybreak, uint, 0644);
++MODULE_PARM_DESC(copybreak,
++	"Maximum size of packet that is copied to a new buffer on receive");
++
++/* All parameters are treated the same, as an integer array of values.
++ * This macro just reduces the need to repeat the same declaration code
++ * over and over (plus this helps to avoid typo bugs).
++ */
++
++#define E1000_PARAM_INIT { [0 ... E1000_MAX_NIC] = OPTION_UNSET }
++#define E1000_PARAM(X, desc) \
++	static int __devinitdata X[E1000_MAX_NIC+1] = E1000_PARAM_INIT; \
++	static int num_##X; \
++	module_param_array_named(X, X, int, &num_##X, 0); \
++	MODULE_PARM_DESC(X, desc);
++
++
++/* Transmit Interrupt Delay in units of 1.024 microseconds
++ *  Tx interrupt delay needs to typically be set to something non zero
++ *
++ * Valid Range: 0-65535
++ */
++E1000_PARAM(TxIntDelay, "Transmit Interrupt Delay");
++#define DEFAULT_TIDV 8
++#define MAX_TXDELAY 0xFFFF
++#define MIN_TXDELAY 0
++
++/* Transmit Absolute Interrupt Delay in units of 1.024 microseconds
++ *
++ * Valid Range: 0-65535
++ */
++E1000_PARAM(TxAbsIntDelay, "Transmit Absolute Interrupt Delay");
++#define DEFAULT_TADV 32
++#define MAX_TXABSDELAY 0xFFFF
++#define MIN_TXABSDELAY 0
++
++/* Receive Interrupt Delay in units of 1.024 microseconds
++ *   hardware will likely hang if you set this to anything but zero.
++ *
++ * Valid Range: 0-65535
++ */
++E1000_PARAM(RxIntDelay, "Receive Interrupt Delay");
++#define DEFAULT_RDTR 0
++#define MAX_RXDELAY 0xFFFF
++#define MIN_RXDELAY 0
++
++/* Receive Absolute Interrupt Delay in units of 1.024 microseconds
++ *
++ * Valid Range: 0-65535
++ */
++E1000_PARAM(RxAbsIntDelay, "Receive Absolute Interrupt Delay");
++#define DEFAULT_RADV 8
++#define MAX_RXABSDELAY 0xFFFF
++#define MIN_RXABSDELAY 0
++
++/* Interrupt Throttle Rate (interrupts/sec)
++ *
++ * Valid Range: 100-100000 (0=off, 1=dynamic, 3=dynamic conservative)
++ */
++E1000_PARAM(InterruptThrottleRate, "Interrupt Throttling Rate");
++#define DEFAULT_ITR 3
++#define MAX_ITR 100000
++#define MIN_ITR 100
++
++/* Enable Smart Power Down of the PHY
++ *
++ * Valid Range: 0, 1
++ *
++ * Default Value: 0 (disabled)
++ */
++E1000_PARAM(SmartPowerDownEnable, "Enable PHY smart power down");
++
++/* Enable Kumeran Lock Loss workaround
++ *
++ * Valid Range: 0, 1
++ *
++ * Default Value: 1 (enabled)
++ */
++E1000_PARAM(KumeranLockLoss, "Enable Kumeran lock loss workaround");
++
++struct e1000_option {
++	enum { enable_option, range_option, list_option } type;
++	char *name;
++	char *err;
++	int  def;
++	union {
++		struct { /* range_option info */
++			int min;
++			int max;
++		} r;
++		struct { /* list_option info */
++			int nr;
++			struct e1000_opt_list { int i; char *str; } *p;
++		} l;
++	} arg;
++};
++
++static int __devinit e1000_validate_option(int *value,
++					   struct e1000_option *opt,
++					   struct e1000_adapter *adapter)
++{
++	if (*value == OPTION_UNSET) {
++		*value = opt->def;
++		return 0;
++	}
++
++	switch (opt->type) {
++	case enable_option:
++		switch (*value) {
++		case OPTION_ENABLED:
++			ndev_info(adapter->netdev, "%s Enabled\n", opt->name);
++			return 0;
++		case OPTION_DISABLED:
++			ndev_info(adapter->netdev, "%s Disabled\n", opt->name);
++			return 0;
++		}
++		break;
++	case range_option:
++		if (*value >= opt->arg.r.min && *value <= opt->arg.r.max) {
++			ndev_info(adapter->netdev,
++					"%s set to %i\n", opt->name, *value);
++			return 0;
++		}
++		break;
++	case list_option: {
++		int i;
++		struct e1000_opt_list *ent;
++
++		for (i = 0; i < opt->arg.l.nr; i++) {
++			ent = &opt->arg.l.p[i];
++			if (*value == ent->i) {
++				if (ent->str[0] != '\0')
++					ndev_info(adapter->netdev, "%s\n",
++						  ent->str);
++				return 0;
++			}
++		}
++	}
++		break;
++	default:
++		BUG();
++	}
++
++	ndev_info(adapter->netdev, "Invalid %s value specified (%i) %s\n",
++	       opt->name, *value, opt->err);
++	*value = opt->def;
++	return -1;
++}
++
++/**
++ * e1000_check_options - Range Checking for Command Line Parameters
++ * @adapter: board private structure
++ *
++ * This routine checks all command line parameters for valid user
++ * input.  If an invalid value is given, or if no user specified
++ * value exists, a default value is used.  The final value is stored
++ * in a variable in the adapter structure.
++ **/
++void __devinit e1000_check_options(struct e1000_adapter *adapter)
++{
++	struct e1000_hw *hw = &adapter->hw;
++	struct net_device *netdev = adapter->netdev;
++	int bd = adapter->bd_number;
++
++	if (bd >= E1000_MAX_NIC) {
++		ndev_notice(netdev,
++		       "Warning: no configuration for board #%i\n", bd);
++		ndev_notice(netdev, "Using defaults for all values\n");
++	}
++
++	{ /* Transmit Interrupt Delay */
++		struct e1000_option opt = {
++			.type = range_option,
++			.name = "Transmit Interrupt Delay",
++			.err  = "using default of "
++				__MODULE_STRING(DEFAULT_TIDV),
++			.def  = DEFAULT_TIDV,
++			.arg  = { .r = { .min = MIN_TXDELAY,
++					 .max = MAX_TXDELAY } }
++		};
++
++		if (num_TxIntDelay > bd) {
++			adapter->tx_int_delay = TxIntDelay[bd];
++			e1000_validate_option(&adapter->tx_int_delay, &opt,
++					      adapter);
++		} else {
++			adapter->tx_int_delay = opt.def;
++		}
++	}
++	{ /* Transmit Absolute Interrupt Delay */
++		struct e1000_option opt = {
++			.type = range_option,
++			.name = "Transmit Absolute Interrupt Delay",
++			.err  = "using default of "
++				__MODULE_STRING(DEFAULT_TADV),
++			.def  = DEFAULT_TADV,
++			.arg  = { .r = { .min = MIN_TXABSDELAY,
++					 .max = MAX_TXABSDELAY } }
++		};
++
++		if (num_TxAbsIntDelay > bd) {
++			adapter->tx_abs_int_delay = TxAbsIntDelay[bd];
++			e1000_validate_option(&adapter->tx_abs_int_delay, &opt,
++					      adapter);
++		} else {
++			adapter->tx_abs_int_delay = opt.def;
++		}
++	}
++	{ /* Receive Interrupt Delay */
++		struct e1000_option opt = {
++			.type = range_option,
++			.name = "Receive Interrupt Delay",
++			.err  = "using default of "
++				__MODULE_STRING(DEFAULT_RDTR),
++			.def  = DEFAULT_RDTR,
++			.arg  = { .r = { .min = MIN_RXDELAY,
++					 .max = MAX_RXDELAY } }
++		};
++
++		/* modify min and default if 82573 for slow ping w/a,
++		 * a value greater than 8 needs to be set for RDTR */
++		if (adapter->flags & FLAG_HAS_ASPM) {
++			opt.def = 32;
++			opt.arg.r.min = 8;
++		}
++
++		if (num_RxIntDelay > bd) {
++			adapter->rx_int_delay = RxIntDelay[bd];
++			e1000_validate_option(&adapter->rx_int_delay, &opt,
++					      adapter);
++		} else {
++			adapter->rx_int_delay = opt.def;
++		}
++	}
++	{ /* Receive Absolute Interrupt Delay */
++		struct e1000_option opt = {
++			.type = range_option,
++			.name = "Receive Absolute Interrupt Delay",
++			.err  = "using default of "
++				__MODULE_STRING(DEFAULT_RADV),
++			.def  = DEFAULT_RADV,
++			.arg  = { .r = { .min = MIN_RXABSDELAY,
++					 .max = MAX_RXABSDELAY } }
++		};
++
++		if (num_RxAbsIntDelay > bd) {
++			adapter->rx_abs_int_delay = RxAbsIntDelay[bd];
++			e1000_validate_option(&adapter->rx_abs_int_delay, &opt,
++					      adapter);
++		} else {
++			adapter->rx_abs_int_delay = opt.def;
++		}
++	}
++	{ /* Interrupt Throttling Rate */
++		struct e1000_option opt = {
++			.type = range_option,
++			.name = "Interrupt Throttling Rate (ints/sec)",
++			.err  = "using default of "
++				__MODULE_STRING(DEFAULT_ITR),
++			.def  = DEFAULT_ITR,
++			.arg  = { .r = { .min = MIN_ITR,
++					 .max = MAX_ITR } }
++		};
++
++		if (num_InterruptThrottleRate > bd) {
++			adapter->itr = InterruptThrottleRate[bd];
++			switch (adapter->itr) {
++			case 0:
++				ndev_info(netdev, "%s turned off\n",
++					opt.name);
++				break;
++			case 1:
++				ndev_info(netdev,
++					  "%s set to dynamic mode\n",
++					  opt.name);
++				adapter->itr_setting = adapter->itr;
++				adapter->itr = 20000;
++				break;
++			case 3:
++				ndev_info(netdev,
++					"%s set to dynamic conservative mode\n",
++					opt.name);
++				adapter->itr_setting = adapter->itr;
++				adapter->itr = 20000;
++				break;
++			default:
++				e1000_validate_option(&adapter->itr, &opt,
++					adapter);
++				/*
++				 * save the setting, because the dynamic bits
++				 * change itr. clear the lower two bits
++				 * because they are used as control
++				 */
++				adapter->itr_setting = adapter->itr & ~3;
++				break;
++			}
++		} else {
++			adapter->itr_setting = opt.def;
++			adapter->itr = 20000;
++		}
++	}
++	{ /* Smart Power Down */
++		struct e1000_option opt = {
++			.type = enable_option,
++			.name = "PHY Smart Power Down",
++			.err  = "defaulting to Disabled",
++			.def  = OPTION_DISABLED
++		};
++
++		if (num_SmartPowerDownEnable > bd) {
++			int spd = SmartPowerDownEnable[bd];
++			e1000_validate_option(&spd, &opt, adapter);
++			if ((adapter->flags & FLAG_HAS_SMART_POWER_DOWN)
++			    && spd)
++				adapter->flags |= FLAG_SMART_POWER_DOWN;
++		}
++	}
++	{ /* Kumeran Lock Loss Workaround */
++		struct e1000_option opt = {
++			.type = enable_option,
++			.name = "Kumeran Lock Loss Workaround",
++			.err  = "defaulting to Enabled",
++			.def  = OPTION_ENABLED
++		};
++
++		if (num_KumeranLockLoss > bd) {
++			int kmrn_lock_loss = KumeranLockLoss[bd];
++			e1000_validate_option(&kmrn_lock_loss, &opt, adapter);
++			if (hw->mac.type == e1000_ich8lan)
++				e1000_set_kmrn_lock_loss_workaround_ich8lan(hw,
++								kmrn_lock_loss);
++		} else {
++			if (hw->mac.type == e1000_ich8lan)
++				e1000_set_kmrn_lock_loss_workaround_ich8lan(hw,
++								       opt.def);
++		}
++	}
++}
+diff --git a/drivers/net/e1000e/phy.c b/drivers/net/e1000e/phy.c
+new file mode 100644
+index 0000000..6fd55e7
+--- /dev/null
++++ b/drivers/net/e1000e/phy.c
+@@ -0,0 +1,1821 @@
++/*******************************************************************************
++
++  Intel PRO/1000 Linux driver
++  Copyright(c) 1999 - 2007 Intel Corporation.
++
++  This program is free software; you can redistribute it and/or modify it
++  under the terms and conditions of the GNU General Public License,
++  version 2, as published by the Free Software Foundation.
++
++  This program is distributed in the hope 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.,
++  51 Franklin St - Fifth Floor, Boston, MA 02110-1301 USA.
++
++  The full GNU General Public License is included in this distribution in
++  the file called "COPYING".
++
++  Contact Information:
++  Linux NICS <linux.nics at intel.com>
++  e1000-devel Mailing List <e1000-devel at lists.sourceforge.net>
++  Intel Corporation, 5200 N.E. Elam Young Parkway, Hillsboro, OR 97124-6497
++
++*******************************************************************************/
++
++#include "e1000.h"
++
++static s32  e1000_get_phy_cfg_done(struct e1000_hw *hw);
++static s32  e1000_phy_force_speed_duplex(struct e1000_hw *hw);
++
++/* Cable length tables */
++static const u16 e1000_m88_cable_length_table[] =
++	{ 0, 50, 80, 110, 140, 140, E1000_CABLE_LENGTH_UNDEFINED };
++
++static const u16 e1000_igp_2_cable_length_table[] =
++	{ 0, 0, 0, 0, 0, 0, 0, 0, 3, 5, 8, 11, 13, 16, 18, 21, 0, 0, 0, 3,
++	  6, 10, 13, 16, 19, 23, 26, 29, 32, 35, 38, 41, 6, 10, 14, 18, 22,
++	  26, 30, 33, 37, 41, 44, 48, 51, 54, 58, 61, 21, 26, 31, 35, 40,
++	  44, 49, 53, 57, 61, 65, 68, 72, 75, 79, 82, 40, 45, 51, 56, 61,
++	  66, 70, 75, 79, 83, 87, 91, 94, 98, 101, 104, 60, 66, 72, 77, 82,
++	  87, 92, 96, 100, 104, 108, 111, 114, 117, 119, 121, 83, 89, 95,
++	  100, 105, 109, 113, 116, 119, 122, 124, 104, 109, 114, 118, 121,
++	  124};
++#define IGP02E1000_CABLE_LENGTH_TABLE_SIZE \
++		(sizeof(e1000_igp_2_cable_length_table) / \
++		 sizeof(e1000_igp_2_cable_length_table[0]))
++
++/**
++ *  e1000_check_reset_block_generic - Check if PHY reset is blocked
++ *  @hw: pointer to the HW structure
++ *
++ *  Read the PHY management control register and check whether a PHY reset
++ *  is blocked.  If a reset is not blocked return E1000_SUCCESS, otherwise
++ *  return E1000_BLK_PHY_RESET (12).
++ **/
++s32 e1000_check_reset_block_generic(struct e1000_hw *hw)
++{
++	u32 manc;
++
++	manc = er32(MANC);
++
++	return (manc & E1000_MANC_BLK_PHY_RST_ON_IDE) ?
++	       E1000_BLK_PHY_RESET : E1000_SUCCESS;
++}
++
++/**
++ *  e1000_get_phy_id - Retrieve the PHY ID and revision
++ *  @hw: pointer to the HW structure
++ *
++ *  Reads the PHY registers and stores the PHY ID and possibly the PHY
++ *  revision in the hardware structure.
++ **/
++s32 e1000_get_phy_id(struct e1000_hw *hw)
++{
++	struct e1000_phy_info *phy = &hw->phy;
++	s32 ret_val = E1000_SUCCESS;
++	u16 phy_id;
++
++	ret_val = e1e_rphy(hw, PHY_ID1, &phy_id);
++	if (ret_val)
++		goto out;
++
++	phy->id = (u32)(phy_id << 16);
++	udelay(20);
++	ret_val = e1e_rphy(hw, PHY_ID2, &phy_id);
++	if (ret_val)
++		goto out;
++
++	phy->id |= (u32)(phy_id & PHY_REVISION_MASK);
++	phy->revision = (u32)(phy_id & ~PHY_REVISION_MASK);
++
++out:
++	return ret_val;
++}
++
++/**
++ *  e1000_phy_reset_dsp - Reset PHY DSP
++ *  @hw: pointer to the HW structure
++ *
++ *  Reset the digital signal processor.
++ **/
++s32 e1000_phy_reset_dsp(struct e1000_hw *hw)
++{
++	s32 ret_val;
++
++	ret_val = e1e_wphy(hw, M88E1000_PHY_GEN_CONTROL, 0xC1);
++	if (ret_val)
++		goto out;
++
++	ret_val = e1e_wphy(hw, M88E1000_PHY_GEN_CONTROL, 0);
++
++out:
++	return ret_val;
++}
++
++/**
++ *  e1000_read_phy_reg_mdic - Read MDI control register
++ *  @hw: pointer to the HW structure
++ *  @offset: register offset to be read
++ *  @data: pointer to the read data
++ *
++ *  Reads the MDI control regsiter in the PHY at offset and stores the
++ *  information read to data.
++ **/
++static s32 e1000_read_phy_reg_mdic(struct e1000_hw *hw, u32 offset, u16 *data)
++{
++	struct e1000_phy_info *phy = &hw->phy;
++	u32 i, mdic = 0;
++	s32 ret_val = E1000_SUCCESS;
++
++	if (offset > MAX_PHY_REG_ADDRESS) {
++		hw_dbg(hw, "PHY Address %d is out of range\n", offset);
++		ret_val = -E1000_ERR_PARAM;
++		goto out;
++	}
++
++	/* Set up Op-code, Phy Address, and register offset in the MDI
++	 * Control register.  The MAC will take care of interfacing with the
++	 * PHY to retrieve the desired data.
++	 */
++	mdic = ((offset << E1000_MDIC_REG_SHIFT) |
++		(phy->addr << E1000_MDIC_PHY_SHIFT) |
++		(E1000_MDIC_OP_READ));
++
++	ew32(MDIC, mdic);
++
++	/* Poll the ready bit to see if the MDI read completed */
++	for (i = 0; i < 64; i++) {
++		udelay(50);
++		mdic = er32(MDIC);
++		if (mdic & E1000_MDIC_READY)
++			break;
++	}
++	if (!(mdic & E1000_MDIC_READY)) {
++		hw_dbg(hw, "MDI Read did not complete\n");
++		ret_val = -E1000_ERR_PHY;
++		goto out;
++	}
++	if (mdic & E1000_MDIC_ERROR) {
++		hw_dbg(hw, "MDI Error\n");
++		ret_val = -E1000_ERR_PHY;
++		goto out;
++	}
++	*data = (u16) mdic;
++
++out:
++	return ret_val;
++}
++
++/**
++ *  e1000_write_phy_reg_mdic - Write MDI control register
++ *  @hw: pointer to the HW structure
++ *  @offset: register offset to write to
++ *  @data: data to write to register at offset
++ *
++ *  Writes data to MDI control register in the PHY at offset.
++ **/
++static s32 e1000_write_phy_reg_mdic(struct e1000_hw *hw, u32 offset, u16 data)
++{
++	struct e1000_phy_info *phy = &hw->phy;
++	u32 i, mdic = 0;
++	s32 ret_val = E1000_SUCCESS;
++
++	if (offset > MAX_PHY_REG_ADDRESS) {
++		hw_dbg(hw, "PHY Address %d is out of range\n", offset);
++		ret_val = -E1000_ERR_PARAM;
++		goto out;
++	}
++
++	/* Set up Op-code, Phy Address, and register offset in the MDI
++	 * Control register.  The MAC will take care of interfacing with the
++	 * PHY to retrieve the desired data.
++	 */
++	mdic = (((u32)data) |
++		(offset << E1000_MDIC_REG_SHIFT) |
++		(phy->addr << E1000_MDIC_PHY_SHIFT) |
++		(E1000_MDIC_OP_WRITE));
++
++	ew32(MDIC, mdic);
++
++	/* Poll the ready bit to see if the MDI read completed */
++	for (i = 0; i < E1000_GEN_POLL_TIMEOUT; i++) {
++		udelay(5);
++		mdic = er32(MDIC);
++		if (mdic & E1000_MDIC_READY)
++			break;
++	}
++	if (!(mdic & E1000_MDIC_READY)) {
++		hw_dbg(hw, "MDI Write did not complete\n");
++		ret_val = -E1000_ERR_PHY;
++		goto out;
++	}
++
++out:
++	return ret_val;
++}
++
++/**
++ *  e1000_read_phy_reg_m88 - Read m88 PHY register
++ *  @hw: pointer to the HW structure
++ *  @offset: register offset to be read
++ *  @data: pointer to the read data
++ *
++ *  Acquires semaphore, if necessary, then reads the PHY register at offset
++ *  and storing the retrieved information in data.  Release any acquired
++ *  semaphores before exiting.
++ **/
++s32 e1000_read_phy_reg_m88(struct e1000_hw *hw, u32 offset, u16 *data)
++{
++	s32 ret_val;
++
++	ret_val = hw->phy.ops.acquire_phy(hw);
++	if (ret_val)
++		goto out;
++
++	ret_val = e1000_read_phy_reg_mdic(hw,
++					  MAX_PHY_REG_ADDRESS & offset,
++					  data);
++
++	hw->phy.ops.release_phy(hw);
++
++out:
++	return ret_val;
++}
++
++/**
++ *  e1000_write_phy_reg_m88 - Write m88 PHY register
++ *  @hw: pointer to the HW structure
++ *  @offset: register offset to write to
++ *  @data: data to write at register offset
++ *
++ *  Acquires semaphore, if necessary, then writes the data to PHY register
++ *  at the offset.  Release any acquired semaphores before exiting.
++ **/
++s32 e1000_write_phy_reg_m88(struct e1000_hw *hw, u32 offset, u16 data)
++{
++	s32 ret_val;
++
++	ret_val = hw->phy.ops.acquire_phy(hw);
++	if (ret_val)
++		goto out;
++
++	ret_val = e1000_write_phy_reg_mdic(hw,
++					   MAX_PHY_REG_ADDRESS & offset,
++					   data);
++
++	hw->phy.ops.release_phy(hw);
++
++out:
++	return ret_val;
++}
++
++/**
++ *  e1000_read_phy_reg_igp - Read igp PHY register
++ *  @hw: pointer to the HW structure
++ *  @offset: register offset to be read
++ *  @data: pointer to the read data
++ *
++ *  Acquires semaphore, if necessary, then reads the PHY register at offset
++ *  and storing the retrieved information in data.  Release any acquired
++ *  semaphores before exiting.
++ **/
++s32 e1000_read_phy_reg_igp(struct e1000_hw *hw, u32 offset, u16 *data)
++{
++	s32 ret_val;
++
++	ret_val = hw->phy.ops.acquire_phy(hw);
++	if (ret_val)
++		goto out;
++
++	if (offset > MAX_PHY_MULTI_PAGE_REG) {
++		ret_val = e1000_write_phy_reg_mdic(hw,
++						   IGP01E1000_PHY_PAGE_SELECT,
++						   (u16)offset);
++		if (ret_val) {
++			hw->phy.ops.release_phy(hw);
++			goto out;
++		}
++	}
++
++	ret_val = e1000_read_phy_reg_mdic(hw,
++					  MAX_PHY_REG_ADDRESS & offset,
++					  data);
++
++	hw->phy.ops.release_phy(hw);
++
++out:
++	return ret_val;
++}
++
++/**
++ *  e1000_write_phy_reg_igp - Write igp PHY register
++ *  @hw: pointer to the HW structure
++ *  @offset: register offset to write to
++ *  @data: data to write at register offset
++ *
++ *  Acquires semaphore, if necessary, then writes the data to PHY register
++ *  at the offset.  Release any acquired semaphores before exiting.
++ **/
++s32 e1000_write_phy_reg_igp(struct e1000_hw *hw, u32 offset, u16 data)
++{
++	s32 ret_val;
++
++	ret_val = hw->phy.ops.acquire_phy(hw);
++	if (ret_val)
++		goto out;
++
++	if (offset > MAX_PHY_MULTI_PAGE_REG) {
++		ret_val = e1000_write_phy_reg_mdic(hw,
++						   IGP01E1000_PHY_PAGE_SELECT,
++						   (u16)offset);
++		if (ret_val) {
++			hw->phy.ops.release_phy(hw);
++			goto out;
++		}
++	}
++
++	ret_val = e1000_write_phy_reg_mdic(hw,
++					   MAX_PHY_REG_ADDRESS & offset,
++					   data);
++
++	hw->phy.ops.release_phy(hw);
++
++out:
++	return ret_val;
++}
++
++/**
++ *  e1000_read_kmrn_reg - Read kumeran register
++ *  @hw: pointer to the HW structure
++ *  @offset: register offset to be read
++ *  @data: pointer to the read data
++ *
++ *  Acquires semaphore, if necessary.  Then reads the PHY register at offset
++ *  using the kumeran interface.  The information retrieved is stored in data.
++ *  Release any acquired semaphores before exiting.
++ **/
++s32 e1000_read_kmrn_reg(struct e1000_hw *hw, u32 offset, u16 *data)
++{
++	u32 kmrnctrlsta;
++	s32 ret_val;
++
++	ret_val = hw->phy.ops.acquire_phy(hw);
++	if (ret_val)
++		goto out;
++
++	kmrnctrlsta = ((offset << E1000_KMRNCTRLSTA_OFFSET_SHIFT) &
++		       E1000_KMRNCTRLSTA_OFFSET) | E1000_KMRNCTRLSTA_REN;
++	ew32(KMRNCTRLSTA, kmrnctrlsta);
++
++	udelay(2);
++
++	kmrnctrlsta = er32(KMRNCTRLSTA);
++	*data = (u16)kmrnctrlsta;
++
++	hw->phy.ops.release_phy(hw);
++
++out:
++	return ret_val;
++}
++
++/**
++ *  e1000_write_kmrn_reg - Write kumeran register
++ *  @hw: pointer to the HW structure
++ *  @offset: register offset to write to
++ *  @data: data to write at register offset
++ *
++ *  Acquires semaphore, if necessary.  Then write the data to PHY register
++ *  at the offset using the kumeran interface.  Release any acquired semaphores
++ *  before exiting.
++ **/
++s32 e1000_write_kmrn_reg(struct e1000_hw *hw, u32 offset, u16 data)
++{
++	u32 kmrnctrlsta;
++	s32 ret_val;
++
++	ret_val = hw->phy.ops.acquire_phy(hw);
++	if (ret_val)
++		goto out;
++
++	kmrnctrlsta = ((offset << E1000_KMRNCTRLSTA_OFFSET_SHIFT) &
++		       E1000_KMRNCTRLSTA_OFFSET) | data;
++	ew32(KMRNCTRLSTA, kmrnctrlsta);
++
++	udelay(2);
++	hw->phy.ops.release_phy(hw);
++
++out:
++	return ret_val;
++}
++
++/**
++ *  e1000_copper_link_setup_m88 - Setup m88 PHY's for copper link
++ *  @hw: pointer to the HW structure
++ *
++ *  Sets up MDI/MDI-X and polarity for m88 PHY's.  If necessary, transmit clock
++ *  and downshift values are set also.
++ **/
++s32 e1000_copper_link_setup_m88(struct e1000_hw *hw)
++{
++	struct e1000_phy_info *phy = &hw->phy;
++	s32 ret_val;
++	u16 phy_data;
++
++	/* Enable CRS on TX. This must be set for half-duplex operation. */
++	ret_val = e1e_rphy(hw, M88E1000_PHY_SPEC_CTRL, &phy_data);
++	if (ret_val)
++		goto out;
++
++	phy_data |= M88E1000_PSCR_ASSERT_CRS_ON_TX;
++
++	/* Options:
++	 *   MDI/MDI-X = 0 (default)
++	 *   0 - Auto for all speeds
++	 *   1 - MDI mode
++	 *   2 - MDI-X mode
++	 *   3 - Auto for 1000Base-T only (MDI-X for 10/100Base-T modes)
++	 */
++	phy_data &= ~M88E1000_PSCR_AUTO_X_MODE;
++
++	switch (phy->mdix) {
++	case 1:
++		phy_data |= M88E1000_PSCR_MDI_MANUAL_MODE;
++		break;
++	case 2:
++		phy_data |= M88E1000_PSCR_MDIX_MANUAL_MODE;
++		break;
++	case 3:
++		phy_data |= M88E1000_PSCR_AUTO_X_1000T;
++		break;
++	case 0:
++	default:
++		phy_data |= M88E1000_PSCR_AUTO_X_MODE;
++		break;
++	}
++
++	/* Options:
++	 *   disable_polarity_correction = 0 (default)
++	 *       Automatic Correction for Reversed Cable Polarity
++	 *   0 - Disabled
++	 *   1 - Enabled
++	 */
++	phy_data &= ~M88E1000_PSCR_POLARITY_REVERSAL;
++	if (phy->disable_polarity_correction == 1)
++		phy_data |= M88E1000_PSCR_POLARITY_REVERSAL;
++
++	ret_val = e1e_wphy(hw, M88E1000_PHY_SPEC_CTRL, phy_data);
++	if (ret_val)
++		goto out;
++
++	if (phy->revision < 4) {
++		/* Force TX_CLK in the Extended PHY Specific Control Register
++		 * to 25MHz clock.
++		 */
++		ret_val = e1e_rphy(hw, M88E1000_EXT_PHY_SPEC_CTRL, &phy_data);
++		if (ret_val)
++			goto out;
++
++		phy_data |= M88E1000_EPSCR_TX_CLK_25;
++
++		if ((phy->revision == 2) &&
++		    (phy->id == M88E1111_I_PHY_ID)) {
++			/* 82573L PHY - set the downshift counter to 5x. */
++			phy_data &= ~M88EC018_EPSCR_DOWNSHIFT_COUNTER_MASK;
++			phy_data |= M88EC018_EPSCR_DOWNSHIFT_COUNTER_5X;
++		} else {
++			/* Configure Master and Slave downshift values */
++			phy_data &= ~(M88E1000_EPSCR_MASTER_DOWNSHIFT_MASK |
++				      M88E1000_EPSCR_SLAVE_DOWNSHIFT_MASK);
++			phy_data |= (M88E1000_EPSCR_MASTER_DOWNSHIFT_1X |
++				     M88E1000_EPSCR_SLAVE_DOWNSHIFT_1X);
++		}
++		ret_val = e1e_wphy(hw, M88E1000_EXT_PHY_SPEC_CTRL, phy_data);
++		if (ret_val)
++			goto out;
++	}
++
++	/* Commit the changes. */
++	ret_val = e1000_commit_phy(hw);
++	if (ret_val) {
++		hw_dbg(hw, "Error committing the PHY changes\n");
++		goto out;
++	}
++
++out:
++	return ret_val;
++}
++
++/**
++ *  e1000_copper_link_setup_igp - Setup igp PHY's for copper link
++ *  @hw: pointer to the HW structure
++ *
++ *  Sets up LPLU, MDI/MDI-X, polarity, Smartspeed and Master/Slave config for
++ *  igp PHY's.
++ **/
++s32 e1000_copper_link_setup_igp(struct e1000_hw *hw)
++{
++	struct e1000_phy_info *phy = &hw->phy;
++	s32 ret_val;
++	u16 data;
++
++	ret_val = e1000_phy_hw_reset(hw);
++	if (ret_val) {
++		hw_dbg(hw, "Error resetting the PHY.\n");
++		goto out;
++	}
++
++	/* Wait 15ms for MAC to configure PHY from NVM settings. */
++	msleep(15);
++
++	/* disable lplu d0 during driver init */
++	ret_val = e1000_set_d0_lplu_state(hw, 0);
++	if (ret_val) {
++		hw_dbg(hw, "Error Disabling LPLU D0\n");
++		goto out;
++	}
++	/* Configure mdi-mdix settings */
++	ret_val = e1e_rphy(hw, IGP01E1000_PHY_PORT_CTRL, &data);
++	if (ret_val)
++		goto out;
++
++	data &= ~IGP01E1000_PSCR_AUTO_MDIX;
++
++	switch (phy->mdix) {
++	case 1:
++		data &= ~IGP01E1000_PSCR_FORCE_MDI_MDIX;
++		break;
++	case 2:
++		data |= IGP01E1000_PSCR_FORCE_MDI_MDIX;
++		break;
++	case 0:
++	default:
++		data |= IGP01E1000_PSCR_AUTO_MDIX;
++		break;
++	}
++	ret_val = e1e_wphy(hw, IGP01E1000_PHY_PORT_CTRL, data);
++	if (ret_val)
++		goto out;
++
++	/* set auto-master slave resolution settings */
++	if (hw->mac.autoneg) {
++		/* when autonegotiation advertisement is only 1000Mbps then we
++		 * should disable SmartSpeed and enable Auto MasterSlave
++		 * resolution as hardware default. */
++		if (phy->autoneg_advertised == ADVERTISE_1000_FULL) {
++			/* Disable SmartSpeed */
++			ret_val = e1e_rphy(hw, IGP01E1000_PHY_PORT_CONFIG,
++						     &data);
++			if (ret_val)
++				goto out;
++
++			data &= ~IGP01E1000_PSCFR_SMART_SPEED;
++			ret_val = e1e_wphy(hw, IGP01E1000_PHY_PORT_CONFIG,
++						     data);
++			if (ret_val)
++				goto out;
++
++			/* Set auto Master/Slave resolution process */
++			ret_val = e1e_rphy(hw, PHY_1000T_CTRL, &data);
++			if (ret_val)
++				goto out;
++
++			data &= ~CR_1000T_MS_ENABLE;
++			ret_val = e1e_wphy(hw, PHY_1000T_CTRL, data);
++			if (ret_val)
++				goto out;
++		}
++
++		ret_val = e1e_rphy(hw, PHY_1000T_CTRL, &data);
++		if (ret_val)
++			goto out;
++
++		/* load defaults for future use */
++		phy->original_ms_type = (data & CR_1000T_MS_ENABLE) ?
++			((data & CR_1000T_MS_VALUE) ?
++			e1000_ms_force_master :
++			e1000_ms_force_slave) :
++			e1000_ms_auto;
++
++		switch (phy->ms_type) {
++		case e1000_ms_force_master:
++			data |= (CR_1000T_MS_ENABLE | CR_1000T_MS_VALUE);
++			break;
++		case e1000_ms_force_slave:
++			data |= CR_1000T_MS_ENABLE;
++			data &= ~(CR_1000T_MS_VALUE);
++			break;
++		case e1000_ms_auto:
++			data &= ~CR_1000T_MS_ENABLE;
++		default:
++			break;
++		}
++		ret_val = e1e_wphy(hw, PHY_1000T_CTRL, data);
++		if (ret_val)
++			goto out;
++	}
++
++out:
++	return ret_val;
++}
++
++/**
++ *  e1000_phy_setup_autoneg - Configure PHY for auto-negotiation
++ *  @hw: pointer to the HW structure
++ *
++ *  Reads the MII auto-neg advertisement register and/or the 1000T control
++ *  register and if the PHY is already setup for auto-negotiation, then
++ *  return successful.  Otherwise, setup advertisement and flow control to
++ *  the appropriate values for the wanted auto-negotiation.
++ **/
++static s32 e1000_phy_setup_autoneg(struct e1000_hw *hw)
++{
++	struct e1000_phy_info *phy = &hw->phy;
++	s32 ret_val;
++	u16 mii_autoneg_adv_reg;
++	u16 mii_1000t_ctrl_reg = 0;
++
++	phy->autoneg_advertised &= phy->autoneg_mask;
++
++	/* Read the MII Auto-Neg Advertisement Register (Address 4). */
++	ret_val = e1e_rphy(hw, PHY_AUTONEG_ADV, &mii_autoneg_adv_reg);
++	if (ret_val)
++		goto out;
++
++	if (phy->autoneg_mask & ADVERTISE_1000_FULL) {
++		/* Read the MII 1000Base-T Control Register (Address 9). */
++		ret_val = e1e_rphy(hw, PHY_1000T_CTRL, &mii_1000t_ctrl_reg);
++		if (ret_val)
++			goto out;
++	}
++
++	/* Need to parse both autoneg_advertised and fc and set up
++	 * the appropriate PHY registers.  First we will parse for
++	 * autoneg_advertised software override.  Since we can advertise
++	 * a plethora of combinations, we need to check each bit
++	 * individually.
++	 */
++
++	/* First we clear all the 10/100 mb speed bits in the Auto-Neg
++	 * Advertisement Register (Address 4) and the 1000 mb speed bits in
++	 * the  1000Base-T Control Register (Address 9).
++	 */
++	mii_autoneg_adv_reg &= ~(NWAY_AR_100TX_FD_CAPS |
++				 NWAY_AR_100TX_HD_CAPS |
++				 NWAY_AR_10T_FD_CAPS   |
++				 NWAY_AR_10T_HD_CAPS);
++	mii_1000t_ctrl_reg &= ~(CR_1000T_HD_CAPS | CR_1000T_FD_CAPS);
++
++	hw_dbg(hw, "autoneg_advertised %x\n", phy->autoneg_advertised);
++
++	/* Do we want to advertise 10 Mb Half Duplex? */
++	if (phy->autoneg_advertised & ADVERTISE_10_HALF) {
++		hw_dbg(hw, "Advertise 10mb Half duplex\n");
++		mii_autoneg_adv_reg |= NWAY_AR_10T_HD_CAPS;
++	}
++
++	/* Do we want to advertise 10 Mb Full Duplex? */
++	if (phy->autoneg_advertised & ADVERTISE_10_FULL) {
++		hw_dbg(hw, "Advertise 10mb Full duplex\n");
++		mii_autoneg_adv_reg |= NWAY_AR_10T_FD_CAPS;
++	}
++
++	/* Do we want to advertise 100 Mb Half Duplex? */
++	if (phy->autoneg_advertised & ADVERTISE_100_HALF) {
++		hw_dbg(hw, "Advertise 100mb Half duplex\n");
++		mii_autoneg_adv_reg |= NWAY_AR_100TX_HD_CAPS;
++	}
++
++	/* Do we want to advertise 100 Mb Full Duplex? */
++	if (phy->autoneg_advertised & ADVERTISE_100_FULL) {
++		hw_dbg(hw, "Advertise 100mb Full duplex\n");
++		mii_autoneg_adv_reg |= NWAY_AR_100TX_FD_CAPS;
++	}
++
++	/* We do not allow the Phy to advertise 1000 Mb Half Duplex */
++	if (phy->autoneg_advertised & ADVERTISE_1000_HALF)
++		hw_dbg(hw, "Advertise 1000mb Half duplex request denied!\n");
++
++	/* Do we want to advertise 1000 Mb Full Duplex? */
++	if (phy->autoneg_advertised & ADVERTISE_1000_FULL) {
++		hw_dbg(hw, "Advertise 1000mb Full duplex\n");
++		mii_1000t_ctrl_reg |= CR_1000T_FD_CAPS;
++	}
++
++	/* Check for a software override of the flow control settings, and
++	 * setup the PHY advertisement registers accordingly.  If
++	 * auto-negotiation is enabled, then software will have to set the
++	 * "PAUSE" bits to the correct value in the Auto-Negotiation
++	 * Advertisement Register (PHY_AUTONEG_ADV) and re-start auto-
++	 * negotiation.
++	 *
++	 * The possible values of the "fc" parameter are:
++	 *      0:  Flow control is completely disabled
++	 *      1:  Rx flow control is enabled (we can receive pause frames
++	 *	  but not send pause frames).
++	 *      2:  Tx flow control is enabled (we can send pause frames
++	 *	  but we do not support receiving pause frames).
++	 *      3:  Both Rx and TX flow control (symmetric) are enabled.
++	 *  other:  No software override.  The flow control configuration
++	 *	  in the EEPROM is used.
++	 */
++	switch (hw->mac.fc) {
++	case e1000_fc_none:
++		/* Flow control (RX & TX) is completely disabled by a
++		 * software over-ride.
++		 */
++		mii_autoneg_adv_reg &= ~(NWAY_AR_ASM_DIR | NWAY_AR_PAUSE);
++		break;
++	case e1000_fc_rx_pause:
++		/* RX Flow control is enabled, and TX Flow control is
++		 * disabled, by a software over-ride.
++		 */
++		/* Since there really isn't a way to advertise that we are
++		 * capable of RX Pause ONLY, we will advertise that we
++		 * support both symmetric and asymmetric RX PAUSE.  Later
++		 * (in e1000_config_fc_after_link_up) we will disable the
++		 * hw's ability to send PAUSE frames.
++		 */
++		mii_autoneg_adv_reg |= (NWAY_AR_ASM_DIR | NWAY_AR_PAUSE);
++		break;
++	case e1000_fc_tx_pause:
++		/* TX Flow control is enabled, and RX Flow control is
++		 * disabled, by a software over-ride.
++		 */
++		mii_autoneg_adv_reg |= NWAY_AR_ASM_DIR;
++		mii_autoneg_adv_reg &= ~NWAY_AR_PAUSE;
++		break;
++	case e1000_fc_full:
++		/* Flow control (both RX and TX) is enabled by a software
++		 * over-ride.
++		 */
++		mii_autoneg_adv_reg |= (NWAY_AR_ASM_DIR | NWAY_AR_PAUSE);
++		break;
++	default:
++		hw_dbg(hw, "Flow control param set incorrectly\n");
++		ret_val = -E1000_ERR_CONFIG;
++		goto out;
++	}
++
++	ret_val = e1e_wphy(hw, PHY_AUTONEG_ADV, mii_autoneg_adv_reg);
++	if (ret_val)
++		goto out;
++
++	hw_dbg(hw, "Auto-Neg Advertising %x\n", mii_autoneg_adv_reg);
++
++	if (phy->autoneg_mask & ADVERTISE_1000_FULL) {
++		ret_val = e1e_wphy(hw, PHY_1000T_CTRL, mii_1000t_ctrl_reg);
++		if (ret_val)
++			goto out;
++	}
++
++out:
++	return ret_val;
++}
++
++/**
++ *  e1000_copper_link_autoneg - Setup/Enable autoneg for copper link
++ *  @hw: pointer to the HW structure
++ *
++ *  Performs initial bounds checking on autoneg advertisement parameter, then
++ *  configure to advertise the full capability.  Setup the PHY to autoneg
++ *  and restart the negotiation process between the link partner.  If
++ *  wait_for_link, then wait for autoneg to complete before exiting.
++ **/
++static s32 e1000_copper_link_autoneg(struct e1000_hw *hw)
++{
++	struct e1000_phy_info *phy = &hw->phy;
++	s32 ret_val;
++	u16 phy_ctrl;
++
++	/* Perform some bounds checking on the autoneg advertisement
++	 * parameter.
++	 */
++	phy->autoneg_advertised &= phy->autoneg_mask;
++
++	/* If autoneg_advertised is zero, we assume it was not defaulted
++	 * by the calling code so we set to advertise full capability.
++	 */
++	if (phy->autoneg_advertised == 0)
++		phy->autoneg_advertised = phy->autoneg_mask;
++
++	hw_dbg(hw, "Reconfiguring auto-neg advertisement params\n");
++	ret_val = e1000_phy_setup_autoneg(hw);
++	if (ret_val) {
++		hw_dbg(hw, "Error Setting up Auto-Negotiation\n");
++		goto out;
++	}
++	hw_dbg(hw, "Restarting Auto-Neg\n");
++
++	/* Restart auto-negotiation by setting the Auto Neg Enable bit and
++	 * the Auto Neg Restart bit in the PHY control register.
++	 */
++	ret_val = e1e_rphy(hw, PHY_CONTROL, &phy_ctrl);
++	if (ret_val)
++		goto out;
++
++	phy_ctrl |= (MII_CR_AUTO_NEG_EN | MII_CR_RESTART_AUTO_NEG);
++	ret_val = e1e_wphy(hw, PHY_CONTROL, phy_ctrl);
++	if (ret_val)
++		goto out;
++
++	/* Does the user want to wait for Auto-Neg to complete here, or
++	 * check at a later time (for example, callback routine).
++	 */
++	if (phy->wait_for_link) {
++		ret_val = e1000_wait_autoneg(hw);
++		if (ret_val) {
++			hw_dbg(hw, "Error while waiting for "
++				 "autoneg to complete\n");
++			goto out;
++		}
++	}
++
++	hw->mac.get_link_status = 1;
++
++out:
++	return ret_val;
++}
++
++/**
++ *  e1000_setup_copper_link - Configure copper link settings
++ *  @hw: pointer to the HW structure
++ *
++ *  Calls the appropriate function to configure the link for auto-neg or forced
++ *  speed and duplex.  Then we check for link, once link is established calls
++ *  to configure collision distance and flow control are called.  If link is
++ *  not established, we return -E1000_ERR_PHY (-2).
++ **/
++s32 e1000_setup_copper_link(struct e1000_hw *hw)
++{
++	s32 ret_val;
++	bool link;
++
++	if (hw->mac.autoneg) {
++		/* Setup autoneg and flow control advertisement and perform
++		 * autonegotiation. */
++		ret_val = e1000_copper_link_autoneg(hw);
++		if (ret_val)
++			goto out;
++	} else {
++		/* PHY will be set to 10H, 10F, 100H or 100F
++		 * depending on user settings. */
++		hw_dbg(hw, "Forcing Speed and Duplex\n");
++		ret_val = e1000_phy_force_speed_duplex(hw);
++		if (ret_val) {
++			hw_dbg(hw, "Error Forcing Speed and Duplex\n");
++			goto out;
++		}
++	}
++
++	/* Check link status. Wait up to 100 microseconds for link to become
++	 * valid.
++	 */
++	ret_val = e1000_phy_has_link_generic(hw,
++					     COPPER_LINK_UP_LIMIT,
++					     10,
++					     &link);
++	if (ret_val)
++		goto out;
++
++	if (link) {
++		hw_dbg(hw, "Valid link established!!!\n");
++		e1000_config_collision_dist(hw);
++		ret_val = e1000_config_fc_after_link_up(hw);
++	} else {
++		hw_dbg(hw, "Unable to establish link!!!\n");
++	}
++
++out:
++	return ret_val;
++}
++
++/**
++ *  e1000_phy_force_speed_duplex_igp - Force speed/duplex for igp PHY
++ *  @hw: pointer to the HW structure
++ *
++ *  Calls the PHY setup function to force speed and duplex.  Clears the
++ *  auto-crossover to force MDI manually.  Waits for link and returns
++ *  successful if link up is successful, else -E1000_ERR_PHY (-2).
++ **/
++s32 e1000_phy_force_speed_duplex_igp(struct e1000_hw *hw)
++{
++	struct e1000_phy_info *phy = &hw->phy;
++	s32 ret_val;
++	u16 phy_data;
++	bool link;
++
++	ret_val = e1e_rphy(hw, PHY_CONTROL, &phy_data);
++	if (ret_val)
++		goto out;
++
++	e1000_phy_force_speed_duplex_setup(hw, &phy_data);
++
++	ret_val = e1e_wphy(hw, PHY_CONTROL, phy_data);
++	if (ret_val)
++		goto out;
++
++	/* Clear Auto-Crossover to force MDI manually.  IGP requires MDI
++	 * forced whenever speed and duplex are forced.
++	 */
++	ret_val = e1e_rphy(hw, IGP01E1000_PHY_PORT_CTRL, &phy_data);
++	if (ret_val)
++		goto out;
++
++	phy_data &= ~IGP01E1000_PSCR_AUTO_MDIX;
++	phy_data &= ~IGP01E1000_PSCR_FORCE_MDI_MDIX;
++
++	ret_val = e1e_wphy(hw, IGP01E1000_PHY_PORT_CTRL, phy_data);
++	if (ret_val)
++		goto out;
++
++	hw_dbg(hw, "IGP PSCR: %X\n", phy_data);
++
++	udelay(1);
++
++	if (phy->wait_for_link) {
++		hw_dbg(hw, "Waiting for forced speed/duplex link on IGP phy.\n");
++
++		ret_val = e1000_phy_has_link_generic(hw,
++						     PHY_FORCE_LIMIT,
++						     100000,
++						     &link);
++		if (ret_val)
++			goto out;
++
++		if (!link)
++			hw_dbg(hw, "Link taking longer than expected.\n");
++
++		/* Try once more */
++		ret_val = e1000_phy_has_link_generic(hw,
++						     PHY_FORCE_LIMIT,
++						     100000,
++						     &link);
++		if (ret_val)
++			goto out;
++	}
++
++out:
++	return ret_val;
++}
++
++/**
++ *  e1000_phy_force_speed_duplex_m88 - Force speed/duplex for m88 PHY
++ *  @hw: pointer to the HW structure
++ *
++ *  Calls the PHY setup function to force speed and duplex.  Clears the
++ *  auto-crossover to force MDI manually.  Resets the PHY to commit the
++ *  changes.  If time expires while waiting for link up, we reset the DSP.
++ *  After reset, TX_CLK and CRS on TX must be set.  Return successful upon
++ *  successful completion, else return corresponding error code.
++ **/
++s32 e1000_phy_force_speed_duplex_m88(struct e1000_hw *hw)
++{
++	struct e1000_phy_info *phy = &hw->phy;
++	s32 ret_val;
++	u16 phy_data;
++	bool link;
++
++	/* Clear Auto-Crossover to force MDI manually.  M88E1000 requires MDI
++	 * forced whenever speed and duplex are forced.
++	 */
++	ret_val = e1e_rphy(hw, M88E1000_PHY_SPEC_CTRL, &phy_data);
++	if (ret_val)
++		goto out;
++
++	phy_data &= ~M88E1000_PSCR_AUTO_X_MODE;
++	ret_val = e1e_wphy(hw, M88E1000_PHY_SPEC_CTRL, phy_data);
++	if (ret_val)
++		goto out;
++
++	hw_dbg(hw, "M88E1000 PSCR: %X\n", phy_data);
++
++	ret_val = e1e_rphy(hw, PHY_CONTROL, &phy_data);
++	if (ret_val)
++		goto out;
++
++	e1000_phy_force_speed_duplex_setup(hw, &phy_data);
++
++	/* Reset the phy to commit changes. */
++	phy_data |= MII_CR_RESET;
++
++	ret_val = e1e_wphy(hw, PHY_CONTROL, phy_data);
++	if (ret_val)
++		goto out;
++
++	udelay(1);
++
++	if (phy->wait_for_link) {
++		hw_dbg(hw, "Waiting for forced speed/duplex link on M88 phy.\n");
++
++		ret_val = e1000_phy_has_link_generic(hw, PHY_FORCE_LIMIT,
++						     100000, &link);
++		if (ret_val)
++			goto out;
++
++		if (!link) {
++			/* We didn't get link.
++			 * Reset the DSP and cross our fingers.
++			 */
++			ret_val = e1e_wphy(hw, M88E1000_PHY_PAGE_SELECT, 0x001d);
++			if (ret_val)
++				goto out;
++			ret_val = e1000_phy_reset_dsp(hw);
++			if (ret_val)
++				goto out;
++		}
++
++		/* Try once more */
++		ret_val = e1000_phy_has_link_generic(hw, PHY_FORCE_LIMIT,
++						     100000, &link);
++		if (ret_val)
++			goto out;
++	}
++
++	ret_val = e1e_rphy(hw, M88E1000_EXT_PHY_SPEC_CTRL, &phy_data);
++	if (ret_val)
++		goto out;
++
++	/* Resetting the phy means we need to re-force TX_CLK in the
++	 * Extended PHY Specific Control Register to 25MHz clock from
++	 * the reset value of 2.5MHz.
++	 */
++	phy_data |= M88E1000_EPSCR_TX_CLK_25;
++	ret_val = e1e_wphy(hw, M88E1000_EXT_PHY_SPEC_CTRL, phy_data);
++	if (ret_val)
++		goto out;
++
++	/* In addition, we must re-enable CRS on Tx for both half and full
++	 * duplex.
++	 */
++	ret_val = e1e_rphy(hw, M88E1000_PHY_SPEC_CTRL, &phy_data);
++	if (ret_val)
++		goto out;
++
++	phy_data |= M88E1000_PSCR_ASSERT_CRS_ON_TX;
++	ret_val = e1e_wphy(hw, M88E1000_PHY_SPEC_CTRL, phy_data);
++
++out:
++	return ret_val;
++}
++
++/**
++ *  e1000_phy_force_speed_duplex_setup - Configure forced PHY speed/duplex
++ *  @hw: pointer to the HW structure
++ *  @phy_ctrl: pointer to current value of PHY_CONTROL
++ *
++ *  Forces speed and duplex on the PHY by doing the following: disable flow
++ *  control, force speed/duplex on the MAC, disable auto speed detection,
++ *  disable auto-negotiation, configure duplex, configure speed, configure
++ *  the collision distance, write configuration to CTRL register.  The
++ *  caller must write to the PHY_CONTROL register for these settings to
++ *  take affect.
++ **/
++void e1000_phy_force_speed_duplex_setup(struct e1000_hw *hw, u16 *phy_ctrl)
++{
++	struct e1000_mac_info *mac = &hw->mac;
++	u32 ctrl;
++
++	/* Turn off flow control when forcing speed/duplex */
++	mac->fc = e1000_fc_none;
++
++	/* Force speed/duplex on the mac */
++	ctrl = er32(CTRL);
++	ctrl |= (E1000_CTRL_FRCSPD | E1000_CTRL_FRCDPX);
++	ctrl &= ~E1000_CTRL_SPD_SEL;
++
++	/* Disable Auto Speed Detection */
++	ctrl &= ~E1000_CTRL_ASDE;
++
++	/* Disable autoneg on the phy */
++	*phy_ctrl &= ~MII_CR_AUTO_NEG_EN;
++
++	/* Forcing Full or Half Duplex? */
++	if (mac->forced_speed_duplex & E1000_ALL_HALF_DUPLEX) {
++		ctrl &= ~E1000_CTRL_FD;
++		*phy_ctrl &= ~MII_CR_FULL_DUPLEX;
++		hw_dbg(hw, "Half Duplex\n");
++	} else {
++		ctrl |= E1000_CTRL_FD;
++		*phy_ctrl |= MII_CR_FULL_DUPLEX;
++		hw_dbg(hw, "Full Duplex\n");
++	}
++
++	/* Forcing 10mb or 100mb? */
++	if (mac->forced_speed_duplex & E1000_ALL_100_SPEED) {
++		ctrl |= E1000_CTRL_SPD_100;
++		*phy_ctrl |= MII_CR_SPEED_100;
++		*phy_ctrl &= ~(MII_CR_SPEED_1000 | MII_CR_SPEED_10);
++		hw_dbg(hw, "Forcing 100mb\n");
++	} else {
++		ctrl &= ~(E1000_CTRL_SPD_1000 | E1000_CTRL_SPD_100);
++		*phy_ctrl |= MII_CR_SPEED_10;
++		*phy_ctrl &= ~(MII_CR_SPEED_1000 | MII_CR_SPEED_100);
++		hw_dbg(hw, "Forcing 10mb\n");
++	}
++
++	e1000_config_collision_dist(hw);
++
++	ew32(CTRL, ctrl);
++}
++
++/**
++ *  e1000_set_d3_lplu_state - Sets low power link up state for D3
++ *  @hw: pointer to the HW structure
++ *  @active: boolean used to enable/disable lplu
++ *
++ *  Success returns 0, Failure returns 1
++ *
++ *  The low power link up (lplu) state is set to the power management level D3
++ *  and SmartSpeed is disabled when active is true, else clear lplu for D3
++ *  and enable Smartspeed.  LPLU and Smartspeed are mutually exclusive.  LPLU
++ *  is used during Dx states where the power conservation is most important.
++ *  During driver activity, SmartSpeed should be enabled so performance is
++ *  maintained.
++ **/
++s32 e1000_set_d3_lplu_state(struct e1000_hw *hw, bool active)
++{
++	struct e1000_phy_info *phy = &hw->phy;
++	s32 ret_val;
++	u16 data;
++
++	ret_val = e1e_rphy(hw, IGP02E1000_PHY_POWER_MGMT, &data);
++	if (ret_val)
++		goto out;
++
++	if (!active) {
++		data &= ~IGP02E1000_PM_D3_LPLU;
++		ret_val = e1e_wphy(hw,
++					     IGP02E1000_PHY_POWER_MGMT,
++					     data);
++		if (ret_val)
++			goto out;
++		/* LPLU and SmartSpeed are mutually exclusive.  LPLU is used
++		 * during Dx states where the power conservation is most
++		 * important.  During driver activity we should enable
++		 * SmartSpeed, so performance is maintained. */
++		if (phy->smart_speed == e1000_smart_speed_on) {
++			ret_val = e1e_rphy(hw, IGP01E1000_PHY_PORT_CONFIG,
++						    &data);
++			if (ret_val)
++				goto out;
++
++			data |= IGP01E1000_PSCFR_SMART_SPEED;
++			ret_val = e1e_wphy(hw, IGP01E1000_PHY_PORT_CONFIG,
++						     data);
++			if (ret_val)
++				goto out;
++		} else if (phy->smart_speed == e1000_smart_speed_off) {
++			ret_val = e1e_rphy(hw, IGP01E1000_PHY_PORT_CONFIG,
++						     &data);
++			if (ret_val)
++				goto out;
++
++			data &= ~IGP01E1000_PSCFR_SMART_SPEED;
++			ret_val = e1e_wphy(hw, IGP01E1000_PHY_PORT_CONFIG,
++						     data);
++			if (ret_val)
++				goto out;
++		}
++	} else if ((phy->autoneg_advertised == E1000_ALL_SPEED_DUPLEX) ||
++		   (phy->autoneg_advertised == E1000_ALL_NOT_GIG) ||
++		   (phy->autoneg_advertised == E1000_ALL_10_SPEED)) {
++		data |= IGP02E1000_PM_D3_LPLU;
++		ret_val = e1e_wphy(hw, IGP02E1000_PHY_POWER_MGMT, data);
++		if (ret_val)
++			goto out;
++
++		/* When LPLU is enabled, we should disable SmartSpeed */
++		ret_val = e1e_rphy(hw, IGP01E1000_PHY_PORT_CONFIG, &data);
++		if (ret_val)
++			goto out;
++
++		data &= ~IGP01E1000_PSCFR_SMART_SPEED;
++		ret_val = e1e_wphy(hw, IGP01E1000_PHY_PORT_CONFIG, data);
++	}
++
++out:
++	return ret_val;
++}
++
++/**
++ *  e1000_check_downshift - Checks whether a downshift in speed occured
++ *  @hw: pointer to the HW structure
++ *
++ *  Success returns 0, Failure returns 1
++ *
++ *  A downshift is detected by querying the PHY link health.
++ **/
++s32 e1000_check_downshift(struct e1000_hw *hw)
++{
++	struct e1000_phy_info *phy = &hw->phy;
++	s32 ret_val;
++	u16 phy_data, offset, mask;
++
++	switch (phy->type) {
++	case e1000_phy_m88:
++	case e1000_phy_gg82563:
++		offset	= M88E1000_PHY_SPEC_STATUS;
++		mask	= M88E1000_PSSR_DOWNSHIFT;
++		break;
++	case e1000_phy_igp_2:
++	case e1000_phy_igp_3:
++		offset	= IGP01E1000_PHY_LINK_HEALTH;
++		mask	= IGP01E1000_PLHR_SS_DOWNGRADE;
++		break;
++	default:
++		/* speed downshift not supported */
++		phy->speed_downgraded = 0;
++		ret_val = E1000_SUCCESS;
++		goto out;
++	}
++
++	ret_val = e1e_rphy(hw, offset, &phy_data);
++
++	if (!ret_val)
++		phy->speed_downgraded = (phy_data & mask);
++
++out:
++	return ret_val;
++}
++
++/**
++ *  e1000_check_polarity_m88 - Checks the polarity.
++ *  @hw: pointer to the HW structure
++ *
++ *  Success returns 0, Failure returns -E1000_ERR_PHY (-2)
++ *
++ *  Polarity is determined based on the PHY specific status register.
++ **/
++static s32 e1000_check_polarity_m88(struct e1000_hw *hw)
++{
++	struct e1000_phy_info *phy = &hw->phy;
++	s32 ret_val;
++	u16 data;
++
++	ret_val = e1e_rphy(hw, M88E1000_PHY_SPEC_STATUS, &data);
++
++	if (!ret_val)
++		phy->cable_polarity = (data & M88E1000_PSSR_REV_POLARITY)
++				      ? e1000_rev_polarity_reversed
++				      : e1000_rev_polarity_normal;
++
++	return ret_val;
++}
++
++/**
++ *  e1000_check_polarity_igp - Checks the polarity.
++ *  @hw: pointer to the HW structure
++ *
++ *  Success returns 0, Failure returns -E1000_ERR_PHY (-2)
++ *
++ *  Polarity is determined based on the PHY port status register, and the
++ *  current speed (since there is no polarity at 100Mbps).
++ **/
++static  s32 e1000_check_polarity_igp(struct e1000_hw *hw)
++{
++	struct e1000_phy_info *phy = &hw->phy;
++	s32 ret_val;
++	u16 data, offset, mask;
++
++	/* Polarity is determined based on the speed of
++	 * our connection. */
++	ret_val = e1e_rphy(hw, IGP01E1000_PHY_PORT_STATUS, &data);
++	if (ret_val)
++		goto out;
++
++	if ((data & IGP01E1000_PSSR_SPEED_MASK) ==
++	    IGP01E1000_PSSR_SPEED_1000MBPS) {
++		offset	= IGP01E1000_PHY_PCS_INIT_REG;
++		mask	= IGP01E1000_PHY_POLARITY_MASK;
++	} else {
++		/* This really only applies to 10Mbps since
++		 * there is no polarity for 100Mbps (always 0).
++		 */
++		offset	= IGP01E1000_PHY_PORT_STATUS;
++		mask	= IGP01E1000_PSSR_POLARITY_REVERSED;
++	}
++
++	ret_val = e1e_rphy(hw, offset, &data);
++
++	if (!ret_val)
++		phy->cable_polarity = (data & mask)
++				      ? e1000_rev_polarity_reversed
++				      : e1000_rev_polarity_normal;
++
++out:
++	return ret_val;
++}
++
++/**
++ *  e1000_wait_autoneg - Wait for auto-neg compeletion
++ *  @hw: pointer to the HW structure
++ *
++ *  Waits for auto-negotiation to complete or for the auto-negotiation time
++ *  limit to expire, which ever happens first.
++ **/
++s32 e1000_wait_autoneg(struct e1000_hw *hw)
++{
++	s32 ret_val = E1000_SUCCESS;
++	u16 i, phy_status;
++
++	/* Break after autoneg completes or PHY_AUTO_NEG_LIMIT expires. */
++	for (i = PHY_AUTO_NEG_LIMIT; i > 0; i--) {
++		ret_val = e1e_rphy(hw, PHY_STATUS, &phy_status);
++		if (ret_val)
++			break;
++		ret_val = e1e_rphy(hw, PHY_STATUS, &phy_status);
++		if (ret_val)
++			break;
++		if (phy_status & MII_SR_AUTONEG_COMPLETE)
++			break;
++		msleep(100);
++	}
++
++	/* PHY_AUTO_NEG_TIME expiration doesn't guarantee auto-negotiation
++	 * has completed.
++	 */
++	return ret_val;
++}
++
++/**
++ *  e1000_phy_has_link_generic - Polls PHY for link
++ *  @hw: pointer to the HW structure
++ *  @iterations: number of times to poll for link
++ *  @usec_interval: delay between polling attempts
++ *  @success: pointer to whether polling was successful or not
++ *
++ *  Polls the PHY status register for link, 'iterations' number of times.
++ **/
++s32 e1000_phy_has_link_generic(struct e1000_hw *hw, u32 iterations,
++			       u32 usec_interval, bool *success)
++{
++	s32 ret_val = E1000_SUCCESS;
++	u16 i, phy_status;
++
++	for (i = 0; i < iterations; i++) {
++		/* Some PHYs require the PHY_STATUS register to be read
++		 * twice due to the link bit being sticky.  No harm doing
++		 * it across the board.
++		 */
++		ret_val = e1e_rphy(hw, PHY_STATUS, &phy_status);
++		if (ret_val)
++			break;
++		ret_val = e1e_rphy(hw, PHY_STATUS, &phy_status);
++		if (ret_val)
++			break;
++		if (phy_status & MII_SR_LINK_STATUS)
++			break;
++		if (usec_interval >= 1000)
++			mdelay(usec_interval/1000);
++		else
++			udelay(usec_interval);
++	}
++
++	*success = (i < iterations);
++
++	return ret_val;
++}
++
++/**
++ *  e1000_get_cable_length_m88 - Determine cable length for m88 PHY
++ *  @hw: pointer to the HW structure
++ *
++ *  Reads the PHY specific status register to retrieve the cable length
++ *  information.  The cable length is determined by averaging the minimum and
++ *  maximum values to get the "average" cable length.  The m88 PHY has four
++ *  possible cable length values, which are:
++ *	Register Value		Cable Length
++ *	0			< 50 meters
++ *	1			50 - 80 meters
++ *	2			80 - 110 meters
++ *	3			110 - 140 meters
++ *	4			> 140 meters
++ **/
++s32 e1000_get_cable_length_m88(struct e1000_hw *hw)
++{
++	struct e1000_phy_info *phy = &hw->phy;
++	s32 ret_val;
++	u16 phy_data, index;
++
++	ret_val = e1e_rphy(hw, M88E1000_PHY_SPEC_STATUS, &phy_data);
++	if (ret_val)
++		goto out;
++
++	index = (phy_data & M88E1000_PSSR_CABLE_LENGTH) >>
++		M88E1000_PSSR_CABLE_LENGTH_SHIFT;
++	phy->min_cable_length = e1000_m88_cable_length_table[index];
++	phy->max_cable_length = e1000_m88_cable_length_table[index+1];
++
++	phy->cable_length = (phy->min_cable_length + phy->max_cable_length) / 2;
++
++out:
++	return ret_val;
++}
++
++/**
++ *  e1000_get_cable_length_igp_2 - Determine cable length for igp2 PHY
++ *  @hw: pointer to the HW structure
++ *
++ *  The automatic gain control (agc) normalizes the amplitude of the
++ *  received signal, adjusting for the attenuation produced by the
++ *  cable.  By reading the AGC registers, which reperesent the
++ *  cobination of course and fine gain value, the value can be put
++ *  into a lookup table to obtain the approximate cable length
++ *  for each channel.
++ **/
++s32 e1000_get_cable_length_igp_2(struct e1000_hw *hw)
++{
++	struct e1000_phy_info *phy = &hw->phy;
++	s32 ret_val;
++	u16 phy_data, i, agc_value = 0;
++	u16 cur_agc_index, max_agc_index = 0;
++	u16 min_agc_index = IGP02E1000_CABLE_LENGTH_TABLE_SIZE - 1;
++	u16 agc_reg_array[IGP02E1000_PHY_CHANNEL_NUM] =
++							 {IGP02E1000_PHY_AGC_A,
++							  IGP02E1000_PHY_AGC_B,
++							  IGP02E1000_PHY_AGC_C,
++							  IGP02E1000_PHY_AGC_D};
++
++	/* Read the AGC registers for all channels */
++	for (i = 0; i < IGP02E1000_PHY_CHANNEL_NUM; i++) {
++		ret_val = e1e_rphy(hw, agc_reg_array[i], &phy_data);
++		if (ret_val)
++			goto out;
++
++		/* Getting bits 15:9, which represent the combination of
++		 * course and fine gain values.  The result is a number
++		 * that can be put into the lookup table to obtain the
++		 * approximate cable length. */
++		cur_agc_index = (phy_data >> IGP02E1000_AGC_LENGTH_SHIFT) &
++				IGP02E1000_AGC_LENGTH_MASK;
++
++		/* Array index bound check. */
++		if ((cur_agc_index >= IGP02E1000_CABLE_LENGTH_TABLE_SIZE) ||
++		    (cur_agc_index == 0)) {
++			ret_val = -E1000_ERR_PHY;
++			goto out;
++		}
++
++		/* Remove min & max AGC values from calculation. */
++		if (e1000_igp_2_cable_length_table[min_agc_index] >
++		    e1000_igp_2_cable_length_table[cur_agc_index])
++			min_agc_index = cur_agc_index;
++		if (e1000_igp_2_cable_length_table[max_agc_index] <
++		    e1000_igp_2_cable_length_table[cur_agc_index])
++			max_agc_index = cur_agc_index;
++
++		agc_value += e1000_igp_2_cable_length_table[cur_agc_index];
++	}
++
++	agc_value -= (e1000_igp_2_cable_length_table[min_agc_index] +
++		      e1000_igp_2_cable_length_table[max_agc_index]);
++	agc_value /= (IGP02E1000_PHY_CHANNEL_NUM - 2);
++
++	/* Calculate cable length with the error range of +/- 10 meters. */
++	phy->min_cable_length = ((agc_value - IGP02E1000_AGC_RANGE) > 0) ?
++				 (agc_value - IGP02E1000_AGC_RANGE) : 0;
++	phy->max_cable_length = agc_value + IGP02E1000_AGC_RANGE;
++
++	phy->cable_length = (phy->min_cable_length + phy->max_cable_length) / 2;
++
++out:
++	return ret_val;
++}
++
++/**
++ *  e1000_get_phy_info_m88 - Retrieve PHY information
++ *  @hw: pointer to the HW structure
++ *
++ *  Valid for only copper links.  Read the PHY status register (sticky read)
++ *  to verify that link is up.  Read the PHY special control register to
++ *  determine the polarity and 10base-T extended distance.  Read the PHY
++ *  special status register to determine MDI/MDIx and current speed.  If
++ *  speed is 1000, then determine cable length, local and remote receiver.
++ **/
++s32 e1000_get_phy_info_m88(struct e1000_hw *hw)
++{
++	struct e1000_phy_info *phy = &hw->phy;
++	s32  ret_val;
++	u16 phy_data;
++	bool link;
++
++	if (hw->media_type != e1000_media_type_copper) {
++		hw_dbg(hw, "Phy info is only valid for copper media\n");
++		ret_val = -E1000_ERR_CONFIG;
++		goto out;
++	}
++
++	ret_val = e1000_phy_has_link_generic(hw, 1, 0, &link);
++	if (ret_val)
++		goto out;
++
++	if (!link) {
++		hw_dbg(hw, "Phy info is only valid if link is up\n");
++		ret_val = -E1000_ERR_CONFIG;
++		goto out;
++	}
++
++	ret_val = e1e_rphy(hw, M88E1000_PHY_SPEC_CTRL, &phy_data);
++	if (ret_val)
++		goto out;
++
++	phy->polarity_correction = (phy_data &
++				    M88E1000_PSCR_POLARITY_REVERSAL);
++
++	ret_val = e1000_check_polarity_m88(hw);
++	if (ret_val)
++		goto out;
++
++	ret_val = e1e_rphy(hw, M88E1000_PHY_SPEC_STATUS, &phy_data);
++	if (ret_val)
++		goto out;
++
++	phy->is_mdix = (phy_data & M88E1000_PSSR_MDIX);
++
++	if ((phy_data & M88E1000_PSSR_SPEED) == M88E1000_PSSR_1000MBS) {
++		ret_val = e1000_get_cable_length(hw);
++		if (ret_val)
++			goto out;
++
++		ret_val = e1e_rphy(hw, PHY_1000T_STATUS, &phy_data);
++		if (ret_val)
++			goto out;
++
++		phy->local_rx = (phy_data & SR_1000T_LOCAL_RX_STATUS)
++				? e1000_1000t_rx_status_ok
++				: e1000_1000t_rx_status_not_ok;
++
++		phy->remote_rx = (phy_data & SR_1000T_REMOTE_RX_STATUS)
++				 ? e1000_1000t_rx_status_ok
++				 : e1000_1000t_rx_status_not_ok;
++	} else {
++		/* Set values to "undefined" */
++		phy->cable_length = E1000_CABLE_LENGTH_UNDEFINED;
++		phy->local_rx = e1000_1000t_rx_status_undefined;
++		phy->remote_rx = e1000_1000t_rx_status_undefined;
++	}
++
++out:
++	return ret_val;
++}
++
++/**
++ *  e1000_get_phy_info_igp - Retrieve igp PHY information
++ *  @hw: pointer to the HW structure
++ *
++ *  Read PHY status to determine if link is up.  If link is up, then
++ *  set/determine 10base-T extended distance and polarity correction.  Read
++ *  PHY port status to determine MDI/MDIx and speed.  Based on the speed,
++ *  determine on the cable length, local and remote receiver.
++ **/
++s32 e1000_get_phy_info_igp(struct e1000_hw *hw)
++{
++	struct e1000_phy_info *phy = &hw->phy;
++	s32 ret_val;
++	u16 data;
++	bool link;
++
++	ret_val = e1000_phy_has_link_generic(hw, 1, 0, &link);
++	if (ret_val)
++		goto out;
++
++	if (!link) {
++		hw_dbg(hw, "Phy info is only valid if link is up\n");
++		ret_val = -E1000_ERR_CONFIG;
++		goto out;
++	}
++
++	phy->polarity_correction = 1;
++
++	ret_val = e1000_check_polarity_igp(hw);
++	if (ret_val)
++		goto out;
++
++	ret_val = e1e_rphy(hw, IGP01E1000_PHY_PORT_STATUS, &data);
++	if (ret_val)
++		goto out;
++
++	phy->is_mdix = (data & IGP01E1000_PSSR_MDIX);
++
++	if ((data & IGP01E1000_PSSR_SPEED_MASK) ==
++	    IGP01E1000_PSSR_SPEED_1000MBPS) {
++		ret_val = e1000_get_cable_length(hw);
++		if (ret_val)
++			goto out;
++
++		ret_val = e1e_rphy(hw, PHY_1000T_STATUS, &data);
++		if (ret_val)
++			goto out;
++
++		phy->local_rx = (data & SR_1000T_LOCAL_RX_STATUS)
++				? e1000_1000t_rx_status_ok
++				: e1000_1000t_rx_status_not_ok;
++
++		phy->remote_rx = (data & SR_1000T_REMOTE_RX_STATUS)
++				 ? e1000_1000t_rx_status_ok
++				 : e1000_1000t_rx_status_not_ok;
++	} else {
++		phy->cable_length = E1000_CABLE_LENGTH_UNDEFINED;
++		phy->local_rx = e1000_1000t_rx_status_undefined;
++		phy->remote_rx = e1000_1000t_rx_status_undefined;
++	}
++
++out:
++	return ret_val;
++}
++
++/**
++ *  e1000_phy_sw_reset - PHY software reset
++ *  @hw: pointer to the HW structure
++ *
++ *  Does a software reset of the PHY by reading the PHY control register and
++ *  setting/write the control register reset bit to the PHY.
++ **/
++s32 e1000_phy_sw_reset(struct e1000_hw *hw)
++{
++	s32 ret_val;
++	u16 phy_ctrl;
++
++	ret_val = e1e_rphy(hw, PHY_CONTROL, &phy_ctrl);
++	if (ret_val)
++		goto out;
++
++	phy_ctrl |= MII_CR_RESET;
++	ret_val = e1e_wphy(hw, PHY_CONTROL, phy_ctrl);
++	if (ret_val)
++		goto out;
++
++	udelay(1);
++
++out:
++	return ret_val;
++}
++
++/**
++ *  e1000_phy_hw_reset_generic - PHY hardware reset
++ *  @hw: pointer to the HW structure
++ *
++ *  Verify the reset block is not blocking us from resetting.  Acquire
++ *  semaphore (if necessary) and read/set/write the device control reset
++ *  bit in the PHY.  Wait the appropriate delay time for the device to
++ *  reset and relase the semaphore (if necessary).
++ **/
++s32 e1000_phy_hw_reset_generic(struct e1000_hw *hw)
++{
++	struct e1000_phy_info *phy = &hw->phy;
++	s32  ret_val;
++	u32 ctrl;
++
++	ret_val = e1000_check_reset_block(hw);
++	if (ret_val) {
++		ret_val = E1000_SUCCESS;
++		goto out;
++	}
++
++	ret_val = phy->ops.acquire_phy(hw);
++	if (ret_val)
++		goto out;
++
++	ctrl = er32(CTRL);
++	ew32(CTRL, ctrl | E1000_CTRL_PHY_RST);
++	e1e_flush();
++
++	udelay(phy->reset_delay_us);
++
++	ew32(CTRL, ctrl);
++	e1e_flush();
++
++	udelay(150);
++
++	phy->ops.release_phy(hw);
++
++	ret_val = e1000_get_phy_cfg_done(hw);
++
++out:
++	return ret_val;
++}
++
++/**
++ *  e1000_get_cfg_done - Generic configuration done
++ *  @hw: pointer to the HW structure
++ *
++ *  Generic function to wait 10 milli-seconds for configuration to complete
++ *  and return success.
++ **/
++s32 e1000_get_cfg_done(struct e1000_hw *hw)
++{
++	mdelay(10);
++
++	return E1000_SUCCESS;
++}
++
++/* Internal function pointers */
++
++/**
++ *  e1000_get_phy_cfg_done - Generic PHY configuration done
++ *  @hw: pointer to the HW structure
++ *
++ *  Return success if silicon family did not implement a family specific
++ *  get_cfg_done function.
++ **/
++static s32 e1000_get_phy_cfg_done(struct e1000_hw *hw)
++{
++	if (hw->phy.ops.get_cfg_done)
++		return hw->phy.ops.get_cfg_done(hw);
++	else
++		return E1000_SUCCESS;
++}
++
++/**
++ *  e1000_phy_force_speed_duplex - Generic force PHY speed/duplex
++ *  @hw: pointer to the HW structure
++ *
++ *  When the silicon family has not implemented a forced speed/duplex
++ *  function for the PHY, simply return E1000_SUCCESS.
++ **/
++static s32 e1000_phy_force_speed_duplex(struct e1000_hw *hw)
++{
++	if (hw->phy.ops.force_speed_duplex)
++		return hw->phy.ops.force_speed_duplex(hw);
++	else
++		return E1000_SUCCESS;
++}
++
++/**
++ *  e1000_get_phy_type_from_id - Get PHY type from id
++ *  @phy_id: phy_id read from the phy
++ *
++ *  Returns the phy type from the id.
++ **/
++enum e1000_phy_type e1000_get_phy_type_from_id(u32 phy_id)
++{
++	enum e1000_phy_type phy_type = e1000_phy_unknown;
++
++	switch (phy_id) {
++	case M88E1000_I_PHY_ID:
++	case M88E1000_E_PHY_ID:
++	case M88E1111_I_PHY_ID:
++	case M88E1011_I_PHY_ID:
++		phy_type = e1000_phy_m88;
++		break;
++	case IGP01E1000_I_PHY_ID: /* IGP 1 & 2 share this */
++		phy_type = e1000_phy_igp_2;
++		break;
++	case GG82563_E_PHY_ID:
++		phy_type = e1000_phy_gg82563;
++		break;
++	case IGP03E1000_E_PHY_ID:
++		phy_type = e1000_phy_igp_3;
++		break;
++	case IFE_E_PHY_ID:
++	case IFE_PLUS_E_PHY_ID:
++	case IFE_C_E_PHY_ID:
++		phy_type = e1000_phy_ife;
++		break;
++	default:
++		phy_type = e1000_phy_unknown;
++		break;
++	}
++	return phy_type;
++}
++
++/**
++ *  e1000_commit_phy - Soft PHY reset
++ *  @hw: pointer to the HW structure
++ *
++ *  Performs a soft PHY reset on those that apply. This is a function pointer
++ *  entry point called by drivers.
++ **/
++s32 e1000_commit_phy(struct e1000_hw *hw)
++{
++	if (hw->phy.ops.commit_phy)
++		return hw->phy.ops.commit_phy(hw);
++	else
++		return E1000_SUCCESS;
++}
++
++/**
++ *  e1000_set_d0_lplu_state - Sets low power link up state for D0
++ *  @hw: pointer to the HW structure
++ *  @active: boolean used to enable/disable lplu
++ *
++ *  Success returns 0, Failure returns 1
++ *
++ *  The low power link up (lplu) state is set to the power management level D0
++ *  and SmartSpeed is disabled when active is true, else clear lplu for D0
++ *  and enable Smartspeed.  LPLU and Smartspeed are mutually exclusive.  LPLU
++ *  is used during Dx states where the power conservation is most important.
++ *  During driver activity, SmartSpeed should be enabled so performance is
++ *  maintained.  This is a function pointer entry point called by drivers.
++ **/
++s32 e1000_set_d0_lplu_state(struct e1000_hw *hw, bool active)
++{
++	if (hw->phy.ops.set_d0_lplu_state)
++		return hw->phy.ops.set_d0_lplu_state(hw, active);
++	else
++		return E1000_SUCCESS;
++}
+-- 
+1.5.0.6
+

Added: dists/sid/linux-2.6/debian/patches/features/all/e1000e-fixes.patch
==============================================================================
--- (empty file)
+++ dists/sid/linux-2.6/debian/patches/features/all/e1000e-fixes.patch	Mon Nov 26 20:06:56 2007
@@ -0,0 +1,8887 @@
+Return-Path: <netdev-owner at vger.kernel.org>
+From: Auke Kok <auke-jan.h.kok at intel.com>
+Subject: [PATCH] e1000e: Remove unused or empty labels
+To: jeff at garzik.org
+Cc: andi at firstfloor.org, netdev at vger.kernel.org,
+	john.ronciak at intel.com
+Date:	Wed, 08 Aug 2007 10:21:52 -0700
+Message-ID: <20070808172152.12223.94635.stgit at localhost.localdomain>
+User-Agent: StGIT/0.12.1
+
+Remove labels with only return, remove E1000_SUCCESS code and
+replace with 0. Remove most goto's.
+
+Signed-off-by: Auke Kok <auke-jan.h.kok at intel.com>
+---
+
+ drivers/net/e1000e/82571.c   |  138 +++++---------
+ drivers/net/e1000e/defines.h |    1 
+ drivers/net/e1000e/es2lan.c  |  162 +++++++----------
+ drivers/net/e1000e/ich8lan.c |  401 +++++++++++++++++-------------------------
+ drivers/net/e1000e/lib.c     |  314 +++++++++++++--------------------
+ drivers/net/e1000e/netdev.c  |    4 
+ drivers/net/e1000e/phy.c     |  278 ++++++++++++-----------------
+ 7 files changed, 521 insertions(+), 777 deletions(-)
+
+diff --git a/drivers/net/e1000e/82571.c b/drivers/net/e1000e/82571.c
+index a1b9d16..ddf2303 100644
+--- a/drivers/net/e1000e/82571.c
++++ b/drivers/net/e1000e/82571.c
+@@ -67,11 +67,11 @@ static void e1000_clear_hw_cntrs_82571(struct e1000_hw *hw);
+ static s32 e1000_init_phy_params_82571(struct e1000_hw *hw)
+ {
+ 	struct e1000_phy_info *phy = &hw->phy;
+-	s32 ret_val = E1000_SUCCESS;
++	s32 ret_val;
+ 
+ 	if (hw->media_type != e1000_media_type_copper) {
+ 		phy->type = e1000_phy_none;
+-		goto out;
++		return 0;
+ 	}
+ 
+ 	phy->addr			 = 1;
+@@ -87,8 +87,7 @@ static s32 e1000_init_phy_params_82571(struct e1000_hw *hw)
+ 		phy->type		 = e1000_phy_m88;
+ 		break;
+ 	default:
+-		ret_val = -E1000_ERR_PHY;
+-		goto out;
++		return -E1000_ERR_PHY;
+ 		break;
+ 	}
+ 
+@@ -99,25 +98,19 @@ static s32 e1000_init_phy_params_82571(struct e1000_hw *hw)
+ 	switch (hw->mac.type) {
+ 	case e1000_82571:
+ 	case e1000_82572:
+-		if (phy->id != IGP01E1000_I_PHY_ID) {
+-			ret_val = -E1000_ERR_PHY;
+-			goto out;
+-		}
++		if (phy->id != IGP01E1000_I_PHY_ID)
++			return -E1000_ERR_PHY;
+ 		break;
+ 	case e1000_82573:
+-		if (phy->id != M88E1111_I_PHY_ID) {
+-			ret_val = -E1000_ERR_PHY;
+-			goto out;
+-		}
++		if (phy->id != M88E1111_I_PHY_ID)
++			return -E1000_ERR_PHY;
+ 		break;
+ 	default:
+-		ret_val = -E1000_ERR_PHY;
+-		goto out;
++		return -E1000_ERR_PHY;
+ 		break;
+ 	}
+ 
+-out:
+-	return ret_val;
++	return 0;
+ }
+ 
+ /**
+@@ -174,7 +167,7 @@ static s32 e1000_init_nvm_params_82571(struct e1000_hw *hw)
+ 		break;
+ 	}
+ 
+-	return E1000_SUCCESS;
++	return 0;
+ }
+ 
+ /**
+@@ -188,7 +181,6 @@ static s32 e1000_init_mac_params_82571(struct e1000_adapter *adapter)
+ 	struct e1000_hw *hw = &adapter->hw;
+ 	struct e1000_mac_info *mac = &hw->mac;
+ 	struct e1000_mac_operations *func = &mac->ops;
+-	s32 ret_val = E1000_SUCCESS;
+ 
+ 	/* Set media type */
+ 	switch (adapter->pdev->device) {
+@@ -232,13 +224,11 @@ static s32 e1000_init_mac_params_82571(struct e1000_adapter *adapter)
+ 		func->get_link_up_info = e1000_get_speed_and_duplex_fiber_serdes;
+ 		break;
+ 	default:
+-		ret_val = -E1000_ERR_CONFIG;
+-		goto out;
++		return -E1000_ERR_CONFIG;
+ 		break;
+ 	}
+ 
+-out:
+-	return ret_val;
++	return 0;
+ }
+ 
+ static s32 e1000_get_invariants_82571(struct e1000_adapter *adapter)
+@@ -306,7 +296,7 @@ static s32 e1000_get_invariants_82571(struct e1000_adapter *adapter)
+ 		break;
+ 	}
+ 
+-	return E1000_SUCCESS;
++	return 0;
+ }
+ 
+ /**
+@@ -319,7 +309,6 @@ static s32 e1000_get_invariants_82571(struct e1000_adapter *adapter)
+ static s32 e1000_get_phy_id_82571(struct e1000_hw *hw)
+ {
+ 	struct e1000_phy_info *phy = &hw->phy;
+-	s32 ret_val = E1000_SUCCESS;
+ 
+ 	switch (hw->mac.type) {
+ 	case e1000_82571:
+@@ -331,14 +320,14 @@ static s32 e1000_get_phy_id_82571(struct e1000_hw *hw)
+ 		phy->id = IGP01E1000_I_PHY_ID;
+ 		break;
+ 	case e1000_82573:
+-		ret_val = e1000_get_phy_id(hw);
++		return e1000_get_phy_id(hw);
+ 		break;
+ 	default:
+-		ret_val = -E1000_ERR_PHY;
++		return -E1000_ERR_PHY;
+ 		break;
+ 	}
+ 
+-	return ret_val;
++	return 0;
+ }
+ 
+ /**
+@@ -350,7 +339,6 @@ static s32 e1000_get_phy_id_82571(struct e1000_hw *hw)
+ static s32 e1000_get_hw_semaphore_82571(struct e1000_hw *hw)
+ {
+ 	u32 swsm;
+-	s32 ret_val = E1000_SUCCESS;
+ 	s32 timeout = hw->nvm.word_size + 1;
+ 	s32 i = 0;
+ 
+@@ -370,12 +358,10 @@ static s32 e1000_get_hw_semaphore_82571(struct e1000_hw *hw)
+ 		/* Release semaphores */
+ 		e1000_put_hw_semaphore(hw);
+ 		hw_dbg(hw, "Driver can't access the NVM\n");
+-		ret_val = -E1000_ERR_NVM;
+-		goto out;
++		return -E1000_ERR_NVM;
+ 	}
+ 
+-out:
+-	return ret_val;
++	return 0;
+ }
+ 
+ /**
+@@ -410,7 +396,7 @@ static s32 e1000_acquire_nvm_82571(struct e1000_hw *hw)
+ 
+ 	ret_val = e1000_get_hw_semaphore_82571(hw);
+ 	if (ret_val)
+-		goto out;
++		return ret_val;
+ 
+ 	if (hw->mac.type != e1000_82573)
+ 		ret_val = e1000_acquire_nvm(hw);
+@@ -418,7 +404,6 @@ static s32 e1000_acquire_nvm_82571(struct e1000_hw *hw)
+ 	if (ret_val)
+ 		e1000_put_hw_semaphore_82571(hw);
+ 
+-out:
+ 	return ret_val;
+ }
+ 
+@@ -449,7 +434,7 @@ static void e1000_release_nvm_82571(struct e1000_hw *hw)
+ static s32 e1000_write_nvm_82571(struct e1000_hw *hw, u16 offset, u16 words,
+ 				 u16 *data)
+ {
+-	s32 ret_val = E1000_SUCCESS;
++	s32 ret_val;
+ 
+ 	switch (hw->mac.type) {
+ 	case e1000_82573:
+@@ -483,12 +468,12 @@ static s32 e1000_update_nvm_checksum_82571(struct e1000_hw *hw)
+ 
+ 	ret_val = e1000_update_nvm_checksum_generic(hw);
+ 	if (ret_val)
+-		goto out;
++		return ret_val;
+ 
+ 	/* If our nvm is an EEPROM, then we're done
+ 	 * otherwise, commit the checksum to the flash NVM. */
+ 	if (hw->nvm.type != e1000_nvm_flash_hw)
+-		goto out;
++		return ret_val;
+ 
+ 	/* Check for pending operations. */
+ 	for (i = 0; i < E1000_FLASH_UPDATES; i++) {
+@@ -497,10 +482,8 @@ static s32 e1000_update_nvm_checksum_82571(struct e1000_hw *hw)
+ 			break;
+ 	}
+ 
+-	if (i == E1000_FLASH_UPDATES) {
+-		ret_val = -E1000_ERR_NVM;
+-		goto out;
+-	}
++	if (i == E1000_FLASH_UPDATES)
++		return -E1000_ERR_NVM;
+ 
+ 	/* Reset the firmware if using STM opcode. */
+ 	if ((er32(FLOP) & 0xFF00) == E1000_STM_OPCODE) {
+@@ -522,13 +505,10 @@ static s32 e1000_update_nvm_checksum_82571(struct e1000_hw *hw)
+ 			break;
+ 	}
+ 
+-	if (i == E1000_FLASH_UPDATES) {
+-		ret_val = -E1000_ERR_NVM;
+-		goto out;
+-	}
++	if (i == E1000_FLASH_UPDATES)
++		return -E1000_ERR_NVM;
+ 
+-out:
+-	return ret_val;
++	return 0;
+ }
+ 
+ /**
+@@ -573,8 +553,7 @@ static s32 e1000_write_nvm_eewr_82571(struct e1000_hw *hw, u16 offset,
+ 	if ((offset >= nvm->word_size) || (words > (nvm->word_size - offset)) ||
+ 	    (words == 0)) {
+ 		hw_dbg(hw, "nvm parameter(s) out of bounds\n");
+-		ret_val = -E1000_ERR_NVM;
+-		goto out;
++		return -E1000_ERR_NVM;
+ 	}
+ 
+ 	for (i = 0; i < words; i++) {
+@@ -593,7 +572,6 @@ static s32 e1000_write_nvm_eewr_82571(struct e1000_hw *hw, u16 offset,
+ 			break;
+ 	}
+ 
+-out:
+ 	return ret_val;
+ }
+ 
+@@ -606,7 +584,6 @@ out:
+ static s32 e1000_get_cfg_done_82571(struct e1000_hw *hw)
+ {
+ 	s32 timeout = PHY_CFG_TIMEOUT;
+-	s32 ret_val = E1000_SUCCESS;
+ 
+ 	while (timeout) {
+ 		if (er32(EEMNGCTL) &
+@@ -617,12 +594,10 @@ static s32 e1000_get_cfg_done_82571(struct e1000_hw *hw)
+ 	}
+ 	if (!timeout) {
+ 		hw_dbg(hw, "MNG configuration cycle has not completed.\n");
+-		ret_val = -E1000_ERR_RESET;
+-		goto out;
++		return -E1000_ERR_RESET;
+ 	}
+ 
+-out:
+-	return ret_val;
++	return 0;
+ }
+ 
+ /**
+@@ -644,20 +619,20 @@ static s32 e1000_set_d0_lplu_state_82571(struct e1000_hw *hw, bool active)
+ 
+ 	ret_val = e1e_rphy(hw, IGP02E1000_PHY_POWER_MGMT, &data);
+ 	if (ret_val)
+-		goto out;
++		return ret_val;
+ 
+ 	if (active) {
+ 		data |= IGP02E1000_PM_D0_LPLU;
+ 		ret_val = e1e_wphy(hw, IGP02E1000_PHY_POWER_MGMT, data);
+ 		if (ret_val)
+-			goto out;
++			return ret_val;
+ 
+ 		/* When LPLU is enabled, we should disable SmartSpeed */
+ 		ret_val = e1e_rphy(hw, IGP01E1000_PHY_PORT_CONFIG, &data);
+ 		data &= ~IGP01E1000_PSCFR_SMART_SPEED;
+ 		ret_val = e1e_wphy(hw, IGP01E1000_PHY_PORT_CONFIG, data);
+ 		if (ret_val)
+-			goto out;
++			return ret_val;
+ 	} else {
+ 		data &= ~IGP02E1000_PM_D0_LPLU;
+ 		ret_val = e1e_wphy(hw, IGP02E1000_PHY_POWER_MGMT, data);
+@@ -669,29 +644,28 @@ static s32 e1000_set_d0_lplu_state_82571(struct e1000_hw *hw, bool active)
+ 			ret_val = e1e_rphy(hw, IGP01E1000_PHY_PORT_CONFIG,
+ 						     &data);
+ 			if (ret_val)
+-				goto out;
++				return ret_val;
+ 
+ 			data |= IGP01E1000_PSCFR_SMART_SPEED;
+ 			ret_val = e1e_wphy(hw, IGP01E1000_PHY_PORT_CONFIG,
+ 						     data);
+ 			if (ret_val)
+-				goto out;
++				return ret_val;
+ 		} else if (phy->smart_speed == e1000_smart_speed_off) {
+ 			ret_val = e1e_rphy(hw, IGP01E1000_PHY_PORT_CONFIG,
+ 						     &data);
+ 			if (ret_val)
+-				goto out;
++				return ret_val;
+ 
+ 			data &= ~IGP01E1000_PSCFR_SMART_SPEED;
+ 			ret_val = e1e_wphy(hw, IGP01E1000_PHY_PORT_CONFIG,
+ 						     data);
+ 			if (ret_val)
+-				goto out;
++				return ret_val;
+ 		}
+ 	}
+ 
+-out:
+-	return ret_val;
++	return 0;
+ }
+ 
+ /**
+@@ -762,7 +736,7 @@ static s32 e1000_reset_hw_82571(struct e1000_hw *hw)
+ 	ret_val = e1000_get_auto_rd_done(hw);
+ 	if (ret_val)
+ 		/* We don't want to continue accessing MAC registers. */
+-		goto out;
++		return ret_val;
+ 
+ 	/* Phy configuration from NVM just starts after EECD_AUTO_RD is set.
+ 	 * Need to wait for Phy configuration completion before accessing
+@@ -775,8 +749,7 @@ static s32 e1000_reset_hw_82571(struct e1000_hw *hw)
+ 	ew32(IMC, 0xffffffff);
+ 	icr = er32(ICR);
+ 
+-out:
+-	return ret_val;
++	return 0;
+ }
+ 
+ /**
+@@ -799,7 +772,7 @@ static s32 e1000_init_hw_82571(struct e1000_hw *hw)
+ 	ret_val = e1000_id_led_init(hw);
+ 	if (ret_val) {
+ 		hw_dbg(hw, "Error initializing identification LED\n");
+-		goto out;
++		return ret_val;
+ 	}
+ 
+ 	/* Disabling VLAN filtering */
+@@ -851,7 +824,6 @@ static s32 e1000_init_hw_82571(struct e1000_hw *hw)
+ 	 */
+ 	e1000_clear_hw_cntrs_82571(hw);
+ 
+-out:
+ 	return ret_val;
+ }
+ 
+@@ -1041,16 +1013,15 @@ static s32 e1000_setup_copper_link_82571(struct e1000_hw *hw)
+ 		ew32(LEDCTL, led_ctrl);
+ 		break;
+ 	default:
+-		ret_val = -E1000_ERR_PHY;
++		return -E1000_ERR_PHY;
+ 		break;
+ 	}
+ 
+ 	if (ret_val)
+-		goto out;
++		return ret_val;
+ 
+ 	ret_val = e1000_setup_copper_link(hw);
+ 
+-out:
+ 	return ret_val;
+ }
+ 
+@@ -1097,7 +1068,7 @@ static s32 e1000_valid_led_default_82571(struct e1000_hw *hw, u16 *data)
+ 	ret_val = e1000_read_nvm(hw, NVM_ID_LED_SETTINGS, 1, data);
+ 	if (ret_val) {
+ 		hw_dbg(hw, "NVM Read Error\n");
+-		goto out;
++		return ret_val;
+ 	}
+ 
+ 	if (hw->mac.type == e1000_82573 &&
+@@ -1107,8 +1078,7 @@ static s32 e1000_valid_led_default_82571(struct e1000_hw *hw, u16 *data)
+ 		 *data == ID_LED_RESERVED_FFFF)
+ 		*data = ID_LED_DEFAULT;
+ 
+-out:
+-	return ret_val;
++	return 0;
+ }
+ 
+ /**
+@@ -1135,7 +1105,7 @@ bool e1000_get_laa_state_82571(struct e1000_hw *hw)
+ void e1000_set_laa_state_82571(struct e1000_hw *hw, bool state)
+ {
+ 	if (hw->mac.type != e1000_82571)
+-		goto out;
++		return;
+ 
+ 	hw->dev_spec.e82571.laa_is_present = state;
+ 
+@@ -1148,9 +1118,6 @@ void e1000_set_laa_state_82571(struct e1000_hw *hw, bool state)
+ 		 * Eventually the LAA will be in RAR[0] and RAR[14].
+ 		 */
+ 		e1000_rar_set(hw, hw->mac.addr, hw->mac.rar_entry_count - 1);
+-
+-out:
+-	return;
+ }
+ 
+ /**
+@@ -1166,18 +1133,18 @@ out:
+ static s32 e1000_fix_nvm_checksum_82571(struct e1000_hw *hw)
+ {
+ 	struct e1000_nvm_info *nvm = &hw->nvm;
+-	s32 ret_val = E1000_SUCCESS;
++	s32 ret_val;
+ 	u16 data;
+ 
+ 	if (nvm->type != e1000_nvm_flash_hw)
+-		goto out;
++		return 0;
+ 
+ 	/* Check bit 4 of word 10h.  If it is 0, firmware is done updating
+ 	 * 10h-12h.  Checksum may need to be fixed.
+ 	 */
+ 	ret_val = e1000_read_nvm(hw, 0x10, 1, &data);
+ 	if (ret_val)
+-		goto out;
++		return ret_val;
+ 
+ 	if (!(data & 0x10)) {
+ 		/* Read 0x23 and check bit 15.  This bit is a 1
+@@ -1189,19 +1156,18 @@ static s32 e1000_fix_nvm_checksum_82571(struct e1000_hw *hw)
+ 		 */
+ 		ret_val = e1000_read_nvm(hw, 0x23, 1, &data);
+ 		if (ret_val)
+-			goto out;
++			return ret_val;
+ 
+ 		if (!(data & 0x8000)) {
+ 			data |= 0x8000;
+ 			ret_val = e1000_write_nvm(hw, 0x23, 1, &data);
+ 			if (ret_val)
+-				goto out;
++				return ret_val;
+ 			ret_val = e1000_update_nvm_checksum(hw);
+ 		}
+ 	}
+ 
+-out:
+-	return ret_val;
++	return 0;
+ }
+ 
+ /**
+diff --git a/drivers/net/e1000e/defines.h b/drivers/net/e1000e/defines.h
+index e0a36f1..ca80fde 100644
+--- a/drivers/net/e1000e/defines.h
++++ b/drivers/net/e1000e/defines.h
+@@ -413,7 +413,6 @@
+ #define E1000_RAH_AV  0x80000000        /* Receive descriptor valid */
+ 
+ /* Error Codes */
+-#define E1000_SUCCESS      0
+ #define E1000_ERR_NVM      1
+ #define E1000_ERR_PHY      2
+ #define E1000_ERR_CONFIG   3
+diff --git a/drivers/net/e1000e/es2lan.c b/drivers/net/e1000e/es2lan.c
+index b5143e9..5604c50 100644
+--- a/drivers/net/e1000e/es2lan.c
++++ b/drivers/net/e1000e/es2lan.c
+@@ -111,11 +111,11 @@ static s32 e1000_cfg_kmrn_10_100_80003es2lan(struct e1000_hw *hw, u16 duplex);
+ static s32 e1000_init_phy_params_80003es2lan(struct e1000_hw *hw)
+ {
+ 	struct e1000_phy_info *phy = &hw->phy;
+-	s32 ret_val = E1000_SUCCESS;
++	s32 ret_val;
+ 
+ 	if (hw->media_type != e1000_media_type_copper) {
+ 		phy->type	= e1000_phy_none;
+-		goto out;
++		return 0;
+ 	}
+ 
+ 	phy->addr		= 1;
+@@ -127,12 +127,9 @@ static s32 e1000_init_phy_params_80003es2lan(struct e1000_hw *hw)
+ 	ret_val = e1000_get_phy_id(hw);
+ 
+ 	/* Verify phy id */
+-	if (phy->id != GG82563_E_PHY_ID) {
+-		ret_val = -E1000_ERR_PHY;
+-		goto out;
+-	}
++	if (phy->id != GG82563_E_PHY_ID)
++		return -E1000_ERR_PHY;
+ 
+-out:
+ 	return ret_val;
+ }
+ 
+@@ -176,7 +173,7 @@ static s32 e1000_init_nvm_params_80003es2lan(struct e1000_hw *hw)
+ 	size += NVM_WORD_SIZE_BASE_SHIFT;
+ 	nvm->word_size	= 1 << size;
+ 
+-	return E1000_SUCCESS;
++	return 0;
+ }
+ 
+ /**
+@@ -190,7 +187,6 @@ static s32 e1000_init_mac_params_80003es2lan(struct e1000_adapter *adapter)
+ 	struct e1000_hw *hw = &adapter->hw;
+ 	struct e1000_mac_info *mac = &hw->mac;
+ 	struct e1000_mac_operations *func = &mac->ops;
+-	s32 ret_val = E1000_SUCCESS;
+ 
+ 	/* Set media type */
+ 	switch (adapter->pdev->device) {
+@@ -225,13 +221,11 @@ static s32 e1000_init_mac_params_80003es2lan(struct e1000_adapter *adapter)
+ 		func->check_for_link = e1000_check_for_serdes_link;
+ 		break;
+ 	default:
+-		ret_val = -E1000_ERR_CONFIG;
+-		goto out;
++		return -E1000_ERR_CONFIG;
+ 		break;
+ 	}
+ 
+-out:
+-	return ret_val;
++	return 0;
+ }
+ 
+ static s32 e1000_get_invariants_80003es2lan(struct e1000_adapter *adapter)
+@@ -251,7 +245,7 @@ static s32 e1000_get_invariants_80003es2lan(struct e1000_adapter *adapter)
+ 	if (rc)
+ 		return rc;
+ 
+-	return E1000_SUCCESS;
++	return 0;
+ }
+ 
+ /**
+@@ -298,14 +292,13 @@ static s32 e1000_acquire_nvm_80003es2lan(struct e1000_hw *hw)
+ 
+ 	ret_val = e1000_acquire_swfw_sync_80003es2lan(hw, E1000_SWFW_EEP_SM);
+ 	if (ret_val)
+-		goto out;
++		return ret_val;
+ 
+ 	ret_val = e1000_acquire_nvm(hw);
+ 
+ 	if (ret_val)
+ 		e1000_release_swfw_sync_80003es2lan(hw, E1000_SWFW_EEP_SM);
+ 
+-out:
+ 	return ret_val;
+ }
+ 
+@@ -335,15 +328,12 @@ static s32 e1000_acquire_swfw_sync_80003es2lan(struct e1000_hw *hw, u16 mask)
+ 	u32 swfw_sync;
+ 	u32 swmask = mask;
+ 	u32 fwmask = mask << 16;
+-	s32 ret_val = E1000_SUCCESS;
+ 	s32 i = 0;
+ 	s32 timeout = 200;
+ 
+ 	while (i < timeout) {
+-		if (e1000_get_hw_semaphore(hw)) {
+-			ret_val = -E1000_ERR_SWFW_SYNC;
+-			goto out;
+-		}
++		if (e1000_get_hw_semaphore(hw))
++			return -E1000_ERR_SWFW_SYNC;
+ 
+ 		swfw_sync = er32(SW_FW_SYNC);
+ 		if (!(swfw_sync & (fwmask | swmask)))
+@@ -359,8 +349,7 @@ static s32 e1000_acquire_swfw_sync_80003es2lan(struct e1000_hw *hw, u16 mask)
+ 	if (i == timeout) {
+ 		hw_dbg(hw,
+ 		       "Driver can't access resource, SW_FW_SYNC timeout.\n");
+-		ret_val = -E1000_ERR_SWFW_SYNC;
+-		goto out;
++		return -E1000_ERR_SWFW_SYNC;
+ 	}
+ 
+ 	swfw_sync |= swmask;
+@@ -368,8 +357,7 @@ static s32 e1000_acquire_swfw_sync_80003es2lan(struct e1000_hw *hw, u16 mask)
+ 
+ 	e1000_put_hw_semaphore(hw);
+ 
+-out:
+-	return ret_val;
++	return 0;
+ }
+ 
+ /**
+@@ -384,7 +372,7 @@ static void e1000_release_swfw_sync_80003es2lan(struct e1000_hw *hw, u16 mask)
+ {
+ 	u32 swfw_sync;
+ 
+-	while (e1000_get_hw_semaphore(hw) != E1000_SUCCESS);
++	while (e1000_get_hw_semaphore(hw) != 0);
+ 	/* Empty */
+ 
+ 	swfw_sync = er32(SW_FW_SYNC);
+@@ -422,7 +410,7 @@ static s32 e1000_read_phy_reg_gg82563_80003es2lan(struct e1000_hw *hw,
+ 	temp = (u16)((u16)offset >> GG82563_PAGE_SHIFT);
+ 	ret_val = e1000_write_phy_reg_m88(hw, page_select, temp);
+ 	if (ret_val)
+-		goto out;
++		return ret_val;
+ 
+ 	/* The "ready" bit in the MDIC register may be incorrectly set
+ 	 * before the device has completed the "Page Select" MDI
+@@ -435,7 +423,7 @@ static s32 e1000_read_phy_reg_gg82563_80003es2lan(struct e1000_hw *hw,
+ 
+ 	if (((u16)offset >> GG82563_PAGE_SHIFT) != temp) {
+ 		ret_val = -E1000_ERR_PHY;
+-		goto out;
++		return ret_val;
+ 	}
+ 
+ 	udelay(200);
+@@ -446,7 +434,6 @@ static s32 e1000_read_phy_reg_gg82563_80003es2lan(struct e1000_hw *hw,
+ 
+ 	udelay(200);
+ 
+-out:
+ 	return ret_val;
+ }
+ 
+@@ -478,7 +465,7 @@ static s32 e1000_write_phy_reg_gg82563_80003es2lan(struct e1000_hw *hw,
+ 	temp = (u16)((u16)offset >> GG82563_PAGE_SHIFT);
+ 	ret_val = e1000_write_phy_reg_m88(hw, page_select, temp);
+ 	if (ret_val)
+-		goto out;
++		return ret_val;
+ 
+ 
+ 	/* The "ready" bit in the MDIC register may be incorrectly set
+@@ -490,10 +477,8 @@ static s32 e1000_write_phy_reg_gg82563_80003es2lan(struct e1000_hw *hw,
+ 	/* ...and verify the command was successful. */
+ 	ret_val = e1000_read_phy_reg_m88(hw, page_select, &temp);
+ 
+-	if (((u16)offset >> GG82563_PAGE_SHIFT) != temp) {
+-		ret_val = -E1000_ERR_PHY;
+-		goto out;
+-	}
++	if (((u16)offset >> GG82563_PAGE_SHIFT) != temp)
++		return -E1000_ERR_PHY;
+ 
+ 	udelay(200);
+ 
+@@ -503,7 +488,6 @@ static s32 e1000_write_phy_reg_gg82563_80003es2lan(struct e1000_hw *hw,
+ 
+ 	udelay(200);
+ 
+-out:
+ 	return ret_val;
+ }
+ 
+@@ -533,7 +517,6 @@ static s32 e1000_write_nvm_80003es2lan(struct e1000_hw *hw, u16 offset,
+ static s32 e1000_get_cfg_done_80003es2lan(struct e1000_hw *hw)
+ {
+ 	s32 timeout = PHY_CFG_TIMEOUT;
+-	s32 ret_val = E1000_SUCCESS;
+ 	u32 mask = E1000_NVM_CFG_DONE_PORT_0;
+ 
+ 	if (hw->bus.func == 1)
+@@ -547,12 +530,10 @@ static s32 e1000_get_cfg_done_80003es2lan(struct e1000_hw *hw)
+ 	}
+ 	if (!timeout) {
+ 		hw_dbg(hw, "MNG configuration cycle has not completed.\n");
+-		ret_val = -E1000_ERR_RESET;
+-		goto out;
++		return -E1000_ERR_RESET;
+ 	}
+ 
+-out:
+-	return ret_val;
++	return 0;
+ }
+ 
+ /**
+@@ -573,18 +554,18 @@ static s32 e1000_phy_force_speed_duplex_80003es2lan(struct e1000_hw *hw)
+ 	 */
+ 	ret_val = e1e_rphy(hw, M88E1000_PHY_SPEC_CTRL, &phy_data);
+ 	if (ret_val)
+-		goto out;
++		return ret_val;
+ 
+ 	phy_data &= ~GG82563_PSCR_CROSSOVER_MODE_AUTO;
+ 	ret_val = e1e_wphy(hw, GG82563_PHY_SPEC_CTRL, phy_data);
+ 	if (ret_val)
+-		goto out;
++		return ret_val;
+ 
+ 	hw_dbg(hw, "GG82563 PSCR: %X\n", phy_data);
+ 
+ 	ret_val = e1e_rphy(hw, PHY_CONTROL, &phy_data);
+ 	if (ret_val)
+-		goto out;
++		return ret_val;
+ 
+ 	e1000_phy_force_speed_duplex_setup(hw, &phy_data);
+ 
+@@ -593,7 +574,7 @@ static s32 e1000_phy_force_speed_duplex_80003es2lan(struct e1000_hw *hw)
+ 
+ 	ret_val = e1e_wphy(hw, PHY_CONTROL, phy_data);
+ 	if (ret_val)
+-		goto out;
++		return ret_val;
+ 
+ 	udelay(1);
+ 
+@@ -604,7 +585,7 @@ static s32 e1000_phy_force_speed_duplex_80003es2lan(struct e1000_hw *hw)
+ 		ret_val = e1000_phy_has_link_generic(hw, PHY_FORCE_LIMIT,
+ 						     100000, &link);
+ 		if (ret_val)
+-			goto out;
++			return ret_val;
+ 
+ 		if (!link) {
+ 			/* We didn't get link.
+@@ -612,19 +593,19 @@ static s32 e1000_phy_force_speed_duplex_80003es2lan(struct e1000_hw *hw)
+ 			 */
+ 			ret_val = e1000_phy_reset_dsp(hw);
+ 			if (ret_val)
+-				goto out;
++				return ret_val;
+ 		}
+ 
+ 		/* Try once more */
+ 		ret_val = e1000_phy_has_link_generic(hw, PHY_FORCE_LIMIT,
+ 						     100000, &link);
+ 		if (ret_val)
+-			goto out;
++			return ret_val;
+ 	}
+ 
+ 	ret_val = e1e_rphy(hw, GG82563_PHY_MAC_SPEC_CTRL, &phy_data);
+ 	if (ret_val)
+-		goto out;
++		return ret_val;
+ 
+ 	/* Resetting the phy means we need to verify the TX_CLK corresponds
+ 	 * to the link speed.  10Mbps -> 2.5MHz, else 25MHz.
+@@ -641,7 +622,6 @@ static s32 e1000_phy_force_speed_duplex_80003es2lan(struct e1000_hw *hw)
+ 	phy_data |= GG82563_MSCR_ASSERT_CRS_ON_TX;
+ 	ret_val = e1e_wphy(hw, GG82563_PHY_MAC_SPEC_CTRL, phy_data);
+ 
+-out:
+ 	return ret_val;
+ }
+ 
+@@ -661,7 +641,7 @@ static s32 e1000_get_cable_length_80003es2lan(struct e1000_hw *hw)
+ 
+ 	ret_val = e1e_rphy(hw, GG82563_PHY_DSP_DISTANCE, &phy_data);
+ 	if (ret_val)
+-		goto out;
++		return ret_val;
+ 
+ 	index = phy_data & GG82563_DSPD_CABLE_LENGTH;
+ 	phy->min_cable_length = e1000_gg82563_cable_length_table[index];
+@@ -669,8 +649,7 @@ static s32 e1000_get_cable_length_80003es2lan(struct e1000_hw *hw)
+ 
+ 	phy->cable_length = (phy->min_cable_length + phy->max_cable_length) / 2;
+ 
+-out:
+-	return ret_val;
++	return 0;
+ }
+ 
+ /**
+@@ -692,7 +671,7 @@ static s32 e1000_get_link_up_info_80003es2lan(struct e1000_hw *hw, u16 *speed,
+ 								    speed,
+ 								    duplex);
+ 		if (ret_val)
+-			goto out;
++			return ret_val;
+ 		if (*speed == SPEED_1000)
+ 			ret_val = e1000_cfg_kmrn_1000_80003es2lan(hw);
+ 		else
+@@ -704,7 +683,6 @@ static s32 e1000_get_link_up_info_80003es2lan(struct e1000_hw *hw, u16 *speed,
+ 								  duplex);
+ 	}
+ 
+-out:
+ 	return ret_val;
+ }
+ 
+@@ -745,14 +723,13 @@ static s32 e1000_reset_hw_80003es2lan(struct e1000_hw *hw)
+ 	ret_val = e1000_get_auto_rd_done(hw);
+ 	if (ret_val)
+ 		/* We don't want to continue accessing MAC registers. */
+-		goto out;
++		return ret_val;
+ 
+ 	/* Clear any pending interrupt events. */
+ 	ew32(IMC, 0xffffffff);
+ 	icr = er32(ICR);
+ 
+-out:
+-	return ret_val;
++	return 0;
+ }
+ 
+ /**
+@@ -775,7 +752,7 @@ static s32 e1000_init_hw_80003es2lan(struct e1000_hw *hw)
+ 	ret_val = e1000_id_led_init(hw);
+ 	if (ret_val) {
+ 		hw_dbg(hw, "Error initializing identification LED\n");
+-		goto out;
++		return ret_val;
+ 	}
+ 
+ 	/* Disabling VLAN filtering */
+@@ -833,7 +810,6 @@ static s32 e1000_init_hw_80003es2lan(struct e1000_hw *hw)
+ 	 */
+ 	e1000_clear_hw_cntrs_80003es2lan(hw);
+ 
+-out:
+ 	return ret_val;
+ }
+ 
+@@ -881,15 +857,15 @@ static void e1000_initialize_hw_bits_80003es2lan(struct e1000_hw *hw)
+  **/
+ static s32 e1000_copper_link_setup_gg82563_80003es2lan(struct e1000_hw *hw)
+ {
+-	struct   e1000_phy_info *phy = &hw->phy;
+-	s32  ret_val;
++	struct e1000_phy_info *phy = &hw->phy;
++	s32 ret_val;
+ 	u32 ctrl_ext;
+ 	u16 data;
+ 
+ 	ret_val = e1e_rphy(hw, GG82563_PHY_MAC_SPEC_CTRL,
+ 				     &data);
+ 	if (ret_val)
+-		goto out;
++		return ret_val;
+ 
+ 	data |= GG82563_MSCR_ASSERT_CRS_ON_TX;
+ 	/* Use 25MHz for both link down and 1000Base-T for Tx clock. */
+@@ -898,7 +874,7 @@ static s32 e1000_copper_link_setup_gg82563_80003es2lan(struct e1000_hw *hw)
+ 	ret_val = e1e_wphy(hw, GG82563_PHY_MAC_SPEC_CTRL,
+ 				      data);
+ 	if (ret_val)
+-		goto out;
++		return ret_val;
+ 
+ 	/* Options:
+ 	 *   MDI/MDI-X = 0 (default)
+@@ -909,7 +885,7 @@ static s32 e1000_copper_link_setup_gg82563_80003es2lan(struct e1000_hw *hw)
+ 	 */
+ 	ret_val = e1e_rphy(hw, GG82563_PHY_SPEC_CTRL, &data);
+ 	if (ret_val)
+-		goto out;
++		return ret_val;
+ 
+ 	data &= ~GG82563_PSCR_CROSSOVER_MODE_MASK;
+ 
+@@ -938,13 +914,13 @@ static s32 e1000_copper_link_setup_gg82563_80003es2lan(struct e1000_hw *hw)
+ 
+ 	ret_val = e1e_wphy(hw, GG82563_PHY_SPEC_CTRL, data);
+ 	if (ret_val)
+-		goto out;
++		return ret_val;
+ 
+ 	/* SW Reset the PHY so all changes take effect */
+ 	ret_val = e1000_commit_phy(hw);
+ 	if (ret_val) {
+ 		hw_dbg(hw, "Error Resetting the PHY\n");
+-		goto out;
++		return ret_val;
+ 	}
+ 
+ 	/* Bypass RX and TX FIFO's */
+@@ -953,16 +929,16 @@ static s32 e1000_copper_link_setup_gg82563_80003es2lan(struct e1000_hw *hw)
+ 				E1000_KMRNCTRLSTA_FIFO_CTRL_RX_BYPASS |
+ 					E1000_KMRNCTRLSTA_FIFO_CTRL_TX_BYPASS);
+ 	if (ret_val)
+-		goto out;
++		return ret_val;
+ 
+ 	ret_val = e1e_rphy(hw, GG82563_PHY_SPEC_CTRL_2, &data);
+ 	if (ret_val)
+-		goto out;
++		return ret_val;
+ 
+ 	data &= ~GG82563_PSCR2_REVERSE_AUTO_NEG;
+ 	ret_val = e1e_wphy(hw, GG82563_PHY_SPEC_CTRL_2, data);
+ 	if (ret_val)
+-		goto out;
++		return ret_val;
+ 
+ 	ctrl_ext = er32(CTRL_EXT);
+ 	ctrl_ext &= ~(E1000_CTRL_EXT_LINK_MODE_MASK);
+@@ -970,7 +946,7 @@ static s32 e1000_copper_link_setup_gg82563_80003es2lan(struct e1000_hw *hw)
+ 
+ 	ret_val = e1e_rphy(hw, GG82563_PHY_PWR_MGMT_CTRL, &data);
+ 	if (ret_val)
+-		goto out;
++		return ret_val;
+ 
+ 	/* Do not init these registers when the HW is in IAMT mode, since the
+ 	 * firmware will have already initialized them.  We only initialize
+@@ -981,16 +957,16 @@ static s32 e1000_copper_link_setup_gg82563_80003es2lan(struct e1000_hw *hw)
+ 		data |= GG82563_PMCR_ENABLE_ELECTRICAL_IDLE;
+ 		ret_val = e1e_wphy(hw, GG82563_PHY_PWR_MGMT_CTRL, data);
+ 		if (ret_val)
+-			goto out;
++			return ret_val;
+ 
+ 		ret_val = e1e_rphy(hw, GG82563_PHY_KMRN_MODE_CTRL, &data);
+ 		if (ret_val)
+-			goto out;
++			return ret_val;
+ 
+ 		data &= ~GG82563_KMCR_PASS_FALSE_CARRIER;
+ 		ret_val = e1e_wphy(hw, GG82563_PHY_KMRN_MODE_CTRL, data);
+ 		if (ret_val)
+-			goto out;
++			return ret_val;
+ 	}
+ 
+ 	/* Workaround: Disable padding in Kumeran interface in the MAC
+@@ -998,15 +974,14 @@ static s32 e1000_copper_link_setup_gg82563_80003es2lan(struct e1000_hw *hw)
+ 	 */
+ 	ret_val = e1e_rphy(hw, GG82563_PHY_INBAND_CTRL, &data);
+ 	if (ret_val)
+-		goto out;
++		return ret_val;
+ 
+ 	data |= GG82563_ICR_DIS_PADDING;
+ 	ret_val = e1e_wphy(hw, GG82563_PHY_INBAND_CTRL, data);
+ 	if (ret_val)
+-		goto out;
++		return ret_val;
+ 
+-out:
+-	return ret_val;
++	return 0;
+ }
+ 
+ /**
+@@ -1019,7 +994,7 @@ out:
+ static s32 e1000_setup_copper_link_80003es2lan(struct e1000_hw *hw)
+ {
+ 	u32 ctrl;
+-	s32  ret_val;
++	s32 ret_val;
+ 	u16 reg_data;
+ 
+ 	ctrl = er32(CTRL);
+@@ -1032,34 +1007,33 @@ static s32 e1000_setup_copper_link_80003es2lan(struct e1000_hw *hw)
+ 	 * polling the phy; this fixes erroneous timeouts at 10Mbps. */
+ 	ret_val = e1000_write_kmrn_reg(hw, GG82563_REG(0x34, 4), 0xFFFF);
+ 	if (ret_val)
+-		goto out;
++		return ret_val;
+ 	ret_val = e1000_read_kmrn_reg(hw, GG82563_REG(0x34, 9), &reg_data);
+ 	if (ret_val)
+-		goto out;
++		return ret_val;
+ 	reg_data |= 0x3F;
+ 	ret_val = e1000_write_kmrn_reg(hw, GG82563_REG(0x34, 9), reg_data);
+ 	if (ret_val)
+-		goto out;
++		return ret_val;
+ 	ret_val = e1000_read_kmrn_reg(hw,
+ 				      E1000_KMRNCTRLSTA_OFFSET_INB_CTRL,
+ 				      &reg_data);
+ 	if (ret_val)
+-		goto out;
++		return ret_val;
+ 	reg_data |= E1000_KMRNCTRLSTA_INB_CTRL_DIS_PADDING;
+ 	ret_val = e1000_write_kmrn_reg(hw,
+ 				       E1000_KMRNCTRLSTA_OFFSET_INB_CTRL,
+ 				       reg_data);
+ 	if (ret_val)
+-		goto out;
++		return ret_val;
+ 
+ 	ret_val = e1000_copper_link_setup_gg82563_80003es2lan(hw);
+ 	if (ret_val)
+-		goto out;
++		return ret_val;
+ 
+ 	ret_val = e1000_setup_copper_link(hw);
+ 
+-out:
+-	return ret_val;
++	return 0;
+ }
+ 
+ /**
+@@ -1072,7 +1046,7 @@ out:
+  **/
+ static s32 e1000_cfg_kmrn_10_100_80003es2lan(struct e1000_hw *hw, u16 duplex)
+ {
+-	s32 ret_val = E1000_SUCCESS;
++	s32 ret_val;
+ 	u32 tipg;
+ 	u16 reg_data;
+ 
+@@ -1081,7 +1055,7 @@ static s32 e1000_cfg_kmrn_10_100_80003es2lan(struct e1000_hw *hw, u16 duplex)
+ 				       E1000_KMRNCTRLSTA_OFFSET_HD_CTRL,
+ 				       reg_data);
+ 	if (ret_val)
+-		goto out;
++		return ret_val;
+ 
+ 	/* Configure Transmit Inter-Packet Gap */
+ 	tipg = er32(TIPG);
+@@ -1091,7 +1065,7 @@ static s32 e1000_cfg_kmrn_10_100_80003es2lan(struct e1000_hw *hw, u16 duplex)
+ 
+ 	ret_val = e1e_rphy(hw, GG82563_PHY_KMRN_MODE_CTRL, &reg_data);
+ 	if (ret_val)
+-		goto out;
++		return ret_val;
+ 
+ 	if (duplex == HALF_DUPLEX)
+ 		reg_data |= GG82563_KMCR_PASS_FALSE_CARRIER;
+@@ -1100,8 +1074,7 @@ static s32 e1000_cfg_kmrn_10_100_80003es2lan(struct e1000_hw *hw, u16 duplex)
+ 
+ 	ret_val = e1e_wphy(hw, GG82563_PHY_KMRN_MODE_CTRL, reg_data);
+ 
+-out:
+-	return ret_val;
++	return 0;
+ }
+ 
+ /**
+@@ -1113,7 +1086,7 @@ out:
+  **/
+ static s32 e1000_cfg_kmrn_1000_80003es2lan(struct e1000_hw *hw)
+ {
+-	s32 ret_val = E1000_SUCCESS;
++	s32 ret_val;
+ 	u16 reg_data;
+ 	u32 tipg;
+ 
+@@ -1122,7 +1095,7 @@ static s32 e1000_cfg_kmrn_1000_80003es2lan(struct e1000_hw *hw)
+ 				       E1000_KMRNCTRLSTA_OFFSET_HD_CTRL,
+ 				       reg_data);
+ 	if (ret_val)
+-		goto out;
++		return ret_val;
+ 
+ 	/* Configure Transmit Inter-Packet Gap */
+ 	tipg = er32(TIPG);
+@@ -1132,12 +1105,11 @@ static s32 e1000_cfg_kmrn_1000_80003es2lan(struct e1000_hw *hw)
+ 
+ 	ret_val = e1e_rphy(hw, GG82563_PHY_KMRN_MODE_CTRL, &reg_data);
+ 	if (ret_val)
+-		goto out;
++		return ret_val;
+ 
+ 	reg_data &= ~GG82563_KMCR_PASS_FALSE_CARRIER;
+ 	ret_val = e1e_wphy(hw, GG82563_PHY_KMRN_MODE_CTRL, reg_data);
+ 
+-out:
+ 	return ret_val;
+ }
+ 
+diff --git a/drivers/net/e1000e/ich8lan.c b/drivers/net/e1000e/ich8lan.c
+index 5967139..042abd4 100644
+--- a/drivers/net/e1000e/ich8lan.c
++++ b/drivers/net/e1000e/ich8lan.c
+@@ -187,7 +187,7 @@ static inline void __ew32flash(struct e1000_hw *hw, unsigned long reg, u32 val)
+ static s32 e1000_init_phy_params_ich8lan(struct e1000_hw *hw)
+ {
+ 	struct e1000_phy_info *phy = &hw->phy;
+-	s32 ret_val = E1000_SUCCESS;
++	s32 ret_val;
+ 	u16 i = 0;
+ 
+ 	phy->addr			= 1;
+@@ -199,7 +199,7 @@ static s32 e1000_init_phy_params_ich8lan(struct e1000_hw *hw)
+ 		msleep(1);
+ 		ret_val = e1000_get_phy_id(hw);
+ 		if (ret_val)
+-			goto out;
++			return ret_val;
+ 	}
+ 
+ 	/* Verify phy id */
+@@ -215,12 +215,11 @@ static s32 e1000_init_phy_params_ich8lan(struct e1000_hw *hw)
+ 		phy->autoneg_mask = E1000_ALL_NOT_GIG;
+ 		break;
+ 	default:
+-		ret_val = -E1000_ERR_PHY;
+-		goto out;
++		return -E1000_ERR_PHY;
++		break;
+ 	}
+ 
+-out:
+-	return ret_val;
++	return 0;
+ }
+ 
+ /**
+@@ -237,15 +236,13 @@ static s32 e1000_init_nvm_params_ich8lan(struct e1000_hw *hw)
+ 	u32 gfpreg;
+ 	u32 sector_base_addr;
+ 	u32 sector_end_addr;
+-	s32 ret_val = E1000_SUCCESS;
+ 	u16 i;
+ 
+ 	/* Can't read flash registers if the register set isn't mapped.
+ 	 */
+ 	if (!hw->flash_address) {
+ 		hw_dbg(hw, "ERROR: Flash registers not mapped\n");
+-		ret_val = -E1000_ERR_CONFIG;
+-		goto out;
++		return -E1000_ERR_CONFIG;
+ 	}
+ 
+ 	nvm->type = e1000_nvm_flash_sw;
+@@ -277,8 +274,7 @@ static s32 e1000_init_nvm_params_ich8lan(struct e1000_hw *hw)
+ 		dev_spec->shadow_ram[i].value    = 0xFFFF;
+ 	}
+ 
+-out:
+-	return ret_val;
++	return 0;
+ }
+ 
+ /**
+@@ -309,7 +305,7 @@ static s32 e1000_init_mac_params_ich8lan(struct e1000_adapter *adapter)
+ 	if (mac->type == e1000_ich8lan)
+ 		e1000_set_kmrn_lock_loss_workaround_ich8lan(hw, 1);
+ 
+-	return E1000_SUCCESS;
++	return 0;
+ }
+ 
+ static s32 e1000_get_invariants_ich8lan(struct e1000_adapter *adapter)
+@@ -333,7 +329,7 @@ static s32 e1000_get_invariants_ich8lan(struct e1000_adapter *adapter)
+ 	    (adapter->hw.phy.type == e1000_phy_igp_3))
+ 		adapter->flags |= FLAG_LSC_GIG_SPEED_DROP;
+ 
+-	return E1000_SUCCESS;
++	return 0;
+ }
+ 
+ /**
+@@ -348,7 +344,6 @@ static s32 e1000_acquire_swflag_ich8lan(struct e1000_hw *hw)
+ {
+ 	u32 extcnf_ctrl;
+ 	u32 timeout = PHY_CFG_TIMEOUT;
+-	s32 ret_val = E1000_SUCCESS;
+ 
+ 	while (timeout) {
+ 		extcnf_ctrl = er32(EXTCNF_CTRL);
+@@ -364,12 +359,10 @@ static s32 e1000_acquire_swflag_ich8lan(struct e1000_hw *hw)
+ 
+ 	if (!timeout) {
+ 		hw_dbg(hw, "FW or HW has locked the resource for too long.\n");
+-		ret_val = -E1000_ERR_CONFIG;
+-		goto out;
++		return -E1000_ERR_CONFIG;
+ 	}
+ 
+-out:
+-	return ret_val;
++	return 0;
+ }
+ 
+ /**
+@@ -403,8 +396,7 @@ static s32 e1000_check_reset_block_ich8lan(struct e1000_hw *hw)
+ 
+ 	fwsm = er32(FWSM);
+ 
+-	return (fwsm & E1000_ICH_FWSM_RSPCIPHY) ? E1000_SUCCESS
+-						: E1000_BLK_PHY_RESET;
++	return (fwsm & E1000_ICH_FWSM_RSPCIPHY) ? 0 : E1000_BLK_PHY_RESET;
+ }
+ 
+ /**
+@@ -424,30 +416,30 @@ static s32 e1000_phy_force_speed_duplex_ich8lan(struct e1000_hw *hw)
+ 
+ 	if (phy->type != e1000_phy_ife) {
+ 		ret_val = e1000_phy_force_speed_duplex_igp(hw);
+-		goto out;
++		return ret_val;
+ 	}
+ 
+ 	ret_val = e1e_rphy(hw, PHY_CONTROL, &data);
+ 	if (ret_val)
+-		goto out;
++		return ret_val;
+ 
+ 	e1000_phy_force_speed_duplex_setup(hw, &data);
+ 
+ 	ret_val = e1e_wphy(hw, PHY_CONTROL, data);
+ 	if (ret_val)
+-		goto out;
++		return ret_val;
+ 
+ 	/* Disable MDI-X support for 10/100 */
+ 	ret_val = e1e_rphy(hw, IFE_PHY_MDIX_CONTROL, &data);
+ 	if (ret_val)
+-		goto out;
++		return ret_val;
+ 
+ 	data &= ~IFE_PMC_AUTO_MDIX;
+ 	data &= ~IFE_PMC_FORCE_MDIX;
+ 
+ 	ret_val = e1e_wphy(hw, IFE_PHY_MDIX_CONTROL, data);
+ 	if (ret_val)
+-		goto out;
++		return ret_val;
+ 
+ 	hw_dbg(hw, "IFE PMC: %X\n", data);
+ 
+@@ -461,7 +453,7 @@ static s32 e1000_phy_force_speed_duplex_ich8lan(struct e1000_hw *hw)
+ 						     100000,
+ 						     &link);
+ 		if (ret_val)
+-			goto out;
++			return ret_val;
+ 
+ 		if (!link)
+ 			hw_dbg(hw, "Link taking longer than expected.\n");
+@@ -472,11 +464,10 @@ static s32 e1000_phy_force_speed_duplex_ich8lan(struct e1000_hw *hw)
+ 						     100000,
+ 						     &link);
+ 		if (ret_val)
+-			goto out;
++			return ret_val;
+ 	}
+ 
+-out:
+-	return ret_val;
++	return 0;
+ }
+ 
+ /**
+@@ -498,7 +489,7 @@ static s32 e1000_phy_hw_reset_ich8lan(struct e1000_hw *hw)
+ 
+ 	ret_val = e1000_phy_hw_reset_generic(hw);
+ 	if (ret_val)
+-		goto out;
++		return ret_val;
+ 
+ 	/* Initialize the PHY from the NVM on ICH platforms.  This
+ 	 * is needed due to an issue where the NVM configuration is
+@@ -518,7 +509,7 @@ static s32 e1000_phy_hw_reset_ich8lan(struct e1000_hw *hw)
+ 
+ 		data = er32(FEXTNVM);
+ 		if (!(data & sw_cfg_mask))
+-			goto out;
++			return 0;
+ 
+ 		/* Wait for basic configuration completes before proceeding*/
+ 		do {
+@@ -544,13 +535,13 @@ static s32 e1000_phy_hw_reset_ich8lan(struct e1000_hw *hw)
+ 		 * extended configuration before SW configuration */
+ 		data = er32(EXTCNF_CTRL);
+ 		if (data & E1000_EXTCNF_CTRL_LCD_WRITE_ENABLE)
+-			goto out;
++			return 0;
+ 
+ 		cnf_size = er32(EXTCNF_SIZE);
+ 		cnf_size &= E1000_EXTCNF_SIZE_EXT_PCIE_LENGTH_MASK;
+ 		cnf_size >>= E1000_EXTCNF_SIZE_EXT_PCIE_LENGTH_SHIFT;
+ 		if (!cnf_size)
+-			goto out;
++			return 0;
+ 
+ 		cnf_base_addr = data & E1000_EXTCNF_CTRL_EXT_CNF_POINTER_MASK;
+ 		cnf_base_addr >>= E1000_EXTCNF_CTRL_EXT_CNF_POINTER_SHIFT;
+@@ -567,14 +558,14 @@ static s32 e1000_phy_hw_reset_ich8lan(struct e1000_hw *hw)
+ 						1,
+ 						&reg_data);
+ 			if (ret_val)
+-				goto out;
++				return ret_val;
+ 
+ 			ret_val = e1000_read_nvm(hw,
+ 						(word_addr + i * 2 + 1),
+ 						1,
+ 						&reg_addr);
+ 			if (ret_val)
+-				goto out;
++				return ret_val;
+ 
+ 			/* Save off the PHY page for future writes. */
+ 			if (reg_addr == IGP01E1000_PHY_PAGE_SELECT) {
+@@ -586,12 +577,11 @@ static s32 e1000_phy_hw_reset_ich8lan(struct e1000_hw *hw)
+ 
+ 			ret_val = e1e_wphy(hw, (u32)reg_addr, reg_data);
+ 			if (ret_val)
+-				goto out;
++				return ret_val;
+ 		}
+ 	}
+ 
+-out:
+-	return ret_val;
++	return 0;
+ }
+ 
+ /**
+@@ -611,23 +601,22 @@ static s32 e1000_get_phy_info_ife_ich8lan(struct e1000_hw *hw)
+ 
+ 	ret_val = e1000_phy_has_link_generic(hw, 1, 0, &link);
+ 	if (ret_val)
+-		goto out;
++		return ret_val;
+ 
+ 	if (!link) {
+ 		hw_dbg(hw, "Phy info is only valid if link is up\n");
+-		ret_val = -E1000_ERR_CONFIG;
+-		goto out;
++		return -E1000_ERR_CONFIG;
+ 	}
+ 
+ 	ret_val = e1e_rphy(hw, IFE_PHY_SPECIAL_CONTROL, &data);
+ 	if (ret_val)
+-		goto out;
++		return ret_val;
+ 	phy->polarity_correction = (!(data & IFE_PSC_AUTO_POLARITY_DISABLE));
+ 
+ 	if (phy->polarity_correction) {
+ 		ret_val = e1000_check_polarity_ife_ich8lan(hw);
+ 		if (ret_val)
+-			goto out;
++			return ret_val;
+ 	} else {
+ 		/* Polarity is forced */
+ 		phy->cable_polarity = (data & IFE_PSC_FORCE_POLARITY)
+@@ -637,7 +626,7 @@ static s32 e1000_get_phy_info_ife_ich8lan(struct e1000_hw *hw)
+ 
+ 	ret_val = e1e_rphy(hw, IFE_PHY_MDIX_CONTROL, &data);
+ 	if (ret_val)
+-		goto out;
++		return ret_val;
+ 
+ 	phy->is_mdix = (data & IFE_PMC_MDIX_STATUS);
+ 
+@@ -646,8 +635,7 @@ static s32 e1000_get_phy_info_ife_ich8lan(struct e1000_hw *hw)
+ 	phy->local_rx = e1000_1000t_rx_status_undefined;
+ 	phy->remote_rx = e1000_1000t_rx_status_undefined;
+ 
+-out:
+-	return ret_val;
++	return 0;
+ }
+ 
+ /**
+@@ -660,20 +648,18 @@ out:
+  **/
+ static s32 e1000_get_phy_info_ich8lan(struct e1000_hw *hw)
+ {
+-	s32 ret_val = -E1000_ERR_PHY_TYPE;
+-
+ 	switch (hw->phy.type) {
+ 	case e1000_phy_ife:
+-		ret_val = e1000_get_phy_info_ife_ich8lan(hw);
++		return e1000_get_phy_info_ife_ich8lan(hw);
+ 		break;
+ 	case e1000_phy_igp_3:
+-		ret_val = e1000_get_phy_info_igp(hw);
++		return e1000_get_phy_info_igp(hw);
+ 		break;
+ 	default:
+ 		break;
+ 	}
+ 
+-	return ret_val;
++	return -E1000_ERR_PHY_TYPE;
+ }
+ 
+ /**
+@@ -728,11 +714,11 @@ static s32 e1000_set_d0_lplu_state_ich8lan(struct e1000_hw *hw, bool active)
+ {
+ 	struct e1000_phy_info *phy = &hw->phy;
+ 	u32 phy_ctrl;
+-	s32 ret_val = E1000_SUCCESS;
++	s32 ret_val = 0;
+ 	u16 data;
+ 
+ 	if (phy->type != e1000_phy_igp_3)
+-		goto out;
++		return ret_val;
+ 
+ 	phy_ctrl = er32(PHY_CTRL);
+ 
+@@ -751,7 +737,7 @@ static s32 e1000_set_d0_lplu_state_ich8lan(struct e1000_hw *hw, bool active)
+ 		data &= ~IGP01E1000_PSCFR_SMART_SPEED;
+ 		ret_val = e1e_wphy(hw, IGP01E1000_PHY_PORT_CONFIG, data);
+ 		if (ret_val)
+-			goto out;
++			return ret_val;
+ 	} else {
+ 		phy_ctrl &= ~E1000_PHY_CTRL_D0A_LPLU;
+ 		ew32(PHY_CTRL, phy_ctrl);
+@@ -764,29 +750,28 @@ static s32 e1000_set_d0_lplu_state_ich8lan(struct e1000_hw *hw, bool active)
+ 			ret_val = e1e_rphy(hw, IGP01E1000_PHY_PORT_CONFIG,
+ 						    &data);
+ 			if (ret_val)
+-				goto out;
++				return ret_val;
+ 
+ 			data |= IGP01E1000_PSCFR_SMART_SPEED;
+ 			ret_val = e1e_wphy(hw, IGP01E1000_PHY_PORT_CONFIG,
+ 						     data);
+ 			if (ret_val)
+-				goto out;
++				return ret_val;
+ 		} else if (phy->smart_speed == e1000_smart_speed_off) {
+ 			ret_val = e1e_rphy(hw, IGP01E1000_PHY_PORT_CONFIG,
+ 						    &data);
+ 			if (ret_val)
+-				goto out;
++				return ret_val;
+ 
+ 			data &= ~IGP01E1000_PSCFR_SMART_SPEED;
+ 			ret_val = e1e_wphy(hw, IGP01E1000_PHY_PORT_CONFIG,
+ 						     data);
+ 			if (ret_val)
+-				goto out;
++				return ret_val;
+ 		}
+ 	}
+ 
+-out:
+-	return ret_val;
++	return 0;
+ }
+ 
+ /**
+@@ -806,7 +791,7 @@ static s32 e1000_set_d3_lplu_state_ich8lan(struct e1000_hw *hw, bool active)
+ {
+ 	struct e1000_phy_info *phy = &hw->phy;
+ 	u32 phy_ctrl;
+-	s32 ret_val = E1000_SUCCESS;
++	s32 ret_val;
+ 	u16 data;
+ 
+ 	phy_ctrl = er32(PHY_CTRL);
+@@ -823,27 +808,27 @@ static s32 e1000_set_d3_lplu_state_ich8lan(struct e1000_hw *hw, bool active)
+ 						    IGP01E1000_PHY_PORT_CONFIG,
+ 						    &data);
+ 			if (ret_val)
+-				goto out;
++				return ret_val;
+ 
+ 			data |= IGP01E1000_PSCFR_SMART_SPEED;
+ 			ret_val = e1e_wphy(hw,
+ 						     IGP01E1000_PHY_PORT_CONFIG,
+ 						     data);
+ 			if (ret_val)
+-				goto out;
++				return ret_val;
+ 		} else if (phy->smart_speed == e1000_smart_speed_off) {
+ 			ret_val = e1e_rphy(hw,
+ 						    IGP01E1000_PHY_PORT_CONFIG,
+ 						    &data);
+ 			if (ret_val)
+-				goto out;
++				return ret_val;
+ 
+ 			data &= ~IGP01E1000_PSCFR_SMART_SPEED;
+ 			ret_val = e1e_wphy(hw,
+ 						     IGP01E1000_PHY_PORT_CONFIG,
+ 						     data);
+ 			if (ret_val)
+-				goto out;
++				return ret_val;
+ 		}
+ 	} else if ((phy->autoneg_advertised == E1000_ALL_SPEED_DUPLEX) ||
+ 		   (phy->autoneg_advertised == E1000_ALL_NOT_GIG) ||
+@@ -862,7 +847,7 @@ static s32 e1000_set_d3_lplu_state_ich8lan(struct e1000_hw *hw, bool active)
+ 					    IGP01E1000_PHY_PORT_CONFIG,
+ 					    &data);
+ 		if (ret_val)
+-			goto out;
++			return ret_val;
+ 
+ 		data &= ~IGP01E1000_PSCFR_SMART_SPEED;
+ 		ret_val = e1e_wphy(hw,
+@@ -870,8 +855,7 @@ static s32 e1000_set_d3_lplu_state_ich8lan(struct e1000_hw *hw, bool active)
+ 					     data);
+ 	}
+ 
+-out:
+-	return ret_val;
++	return 0;
+ }
+ 
+ /**
+@@ -889,19 +873,18 @@ static s32 e1000_read_nvm_ich8lan(struct e1000_hw *hw, u16 offset, u16 words,
+ 	struct e1000_nvm_info *nvm = &hw->nvm;
+ 	struct e1000_dev_spec_ich8lan *dev_spec = &hw->dev_spec.ich8lan;
+ 	u32 act_offset;
+-	s32 ret_val = E1000_SUCCESS;
++	s32 ret_val;
+ 	u16 i, word;
+ 
+ 	if ((offset >= nvm->word_size) || (words > nvm->word_size - offset) ||
+ 	    (words == 0)) {
+ 		hw_dbg(hw, "nvm parameter(s) out of bounds\n");
+-		ret_val = -E1000_ERR_NVM;
+-		goto out;
++		return -E1000_ERR_NVM;
+ 	}
+ 
+ 	ret_val = e1000_acquire_swflag_ich8lan(hw);
+ 	if (ret_val)
+-		goto out;
++		return ret_val;
+ 
+ 	/* Start with the bank offset, then add the relative offset. */
+ 	act_offset = (er32(EECD) & E1000_EECD_SEC1VAL)
+@@ -925,7 +908,6 @@ static s32 e1000_read_nvm_ich8lan(struct e1000_hw *hw, u16 offset, u16 words,
+ 
+ 	e1000_release_swflag_ich8lan(hw);
+ 
+-out:
+ 	return ret_val;
+ }
+ 
+@@ -948,7 +930,7 @@ static s32 e1000_flash_cycle_init_ich8lan(struct e1000_hw *hw)
+ 	if (hsfsts.hsf_status.fldesvalid == 0) {
+ 		hw_dbg(hw, "Flash descriptor invalid.  "
+ 			 "SW Sequencing must be used.");
+-		goto out;
++		return -E1000_ERR_NVM;
+ 	}
+ 
+ 	/* Clear FCERR and DAEL in hw status by writing 1 */
+@@ -971,19 +953,19 @@ static s32 e1000_flash_cycle_init_ich8lan(struct e1000_hw *hw)
+ 		/* Begin by setting Flash Cycle Done. */
+ 		hsfsts.hsf_status.flcdone = 1;
+ 		ew16flash(ICH_FLASH_HSFSTS, hsfsts.regval);
+-		ret_val = E1000_SUCCESS;
++		ret_val = 0;
+ 	} else {
+ 		/* otherwise poll for sometime so the current
+ 		 * cycle has a chance to end before giving up. */
+ 		for (i = 0; i < ICH_FLASH_READ_COMMAND_TIMEOUT; i++) {
+ 			hsfsts.regval = __er16flash(hw, ICH_FLASH_HSFSTS);
+ 			if (hsfsts.hsf_status.flcinprog == 0) {
+-				ret_val = E1000_SUCCESS;
++				ret_val = 0;
+ 				break;
+ 			}
+ 			udelay(1);
+ 		}
+-		if (ret_val == E1000_SUCCESS) {
++		if (ret_val == 0) {
+ 			/* Successful in waiting for previous cycle to timeout,
+ 			 * now set the Flash Cycle Done. */
+ 			hsfsts.hsf_status.flcdone = 1;
+@@ -993,7 +975,6 @@ static s32 e1000_flash_cycle_init_ich8lan(struct e1000_hw *hw)
+ 		}
+ 	}
+ 
+-out:
+ 	return ret_val;
+ }
+ 
+@@ -1025,7 +1006,7 @@ static s32 e1000_flash_cycle_ich8lan(struct e1000_hw *hw, u32 timeout)
+ 	} while (i++ < timeout);
+ 
+ 	if (hsfsts.hsf_status.flcdone == 1 && hsfsts.hsf_status.flcerr == 0)
+-		ret_val = E1000_SUCCESS;
++		return 0;
+ 
+ 	return ret_val;
+ }
+@@ -1042,20 +1023,10 @@ static s32 e1000_flash_cycle_ich8lan(struct e1000_hw *hw, u32 timeout)
+ static s32 e1000_read_flash_word_ich8lan(struct e1000_hw *hw, u32 offset,
+ 					 u16 *data)
+ {
+-	s32 ret_val;
+-
+-	if (!data) {
+-		ret_val = -E1000_ERR_NVM;
+-		goto out;
+-	}
+-
+ 	/* Must convert offset into bytes. */
+ 	offset <<= 1;
+ 
+-	ret_val = e1000_read_flash_data_ich8lan(hw, offset, 2, data);
+-
+-out:
+-	return ret_val;
++	return e1000_read_flash_data_ich8lan(hw, offset, 2, data);
+ }
+ 
+ /**
+@@ -1078,7 +1049,7 @@ static s32 e1000_read_flash_data_ich8lan(struct e1000_hw *hw, u32 offset,
+ 	u8 count = 0;
+ 
+ 	if (size < 1  || size > 2 || offset > ICH_FLASH_LINEAR_ADDR_MASK)
+-		goto out;
++		return -E1000_ERR_NVM;
+ 
+ 	flash_linear_addr = (ICH_FLASH_LINEAR_ADDR_MASK & offset) +
+ 			    hw->nvm.flash_base_addr;
+@@ -1087,7 +1058,7 @@ static s32 e1000_read_flash_data_ich8lan(struct e1000_hw *hw, u32 offset,
+ 		udelay(1);
+ 		/* Steps */
+ 		ret_val = e1000_flash_cycle_init_ich8lan(hw);
+-		if (ret_val != E1000_SUCCESS)
++		if (ret_val != 0)
+ 			break;
+ 
+ 		hsflctl.regval = er16flash(ICH_FLASH_HSFCTL);
+@@ -1105,7 +1076,7 @@ static s32 e1000_read_flash_data_ich8lan(struct e1000_hw *hw, u32 offset,
+ 		 * and try the whole sequence a few more times, else
+ 		 * read in (shift in) the Flash Data0, the order is
+ 		 * least significant byte first msb to lsb */
+-		if (ret_val == E1000_SUCCESS) {
++		if (ret_val == 0) {
+ 			flash_data = er32flash(ICH_FLASH_FDATA0);
+ 			if (size == 1) {
+ 				*data = (u8)(flash_data & 0x000000FF);
+@@ -1131,7 +1102,6 @@ static s32 e1000_read_flash_data_ich8lan(struct e1000_hw *hw, u32 offset,
+ 		}
+ 	} while (count++ < ICH_FLASH_CYCLE_REPEAT_COUNT);
+ 
+-out:
+ 	return ret_val;
+ }
+ 
+@@ -1149,19 +1119,18 @@ static s32 e1000_write_nvm_ich8lan(struct e1000_hw *hw, u16 offset, u16 words,
+ {
+ 	struct e1000_nvm_info *nvm = &hw->nvm;
+ 	struct e1000_dev_spec_ich8lan *dev_spec = &hw->dev_spec.ich8lan;
+-	s32 ret_val = E1000_SUCCESS;
++	s32 ret_val;
+ 	u16 i;
+ 
+ 	if ((offset >= nvm->word_size) || (words > nvm->word_size - offset) ||
+ 	    (words == 0)) {
+ 		hw_dbg(hw, "nvm parameter(s) out of bounds\n");
+-		ret_val = -E1000_ERR_NVM;
+-		goto out;
++		return -E1000_ERR_NVM;
+ 	}
+ 
+ 	ret_val = e1000_acquire_swflag_ich8lan(hw);
+ 	if (ret_val)
+-		goto out;
++		return ret_val;
+ 
+ 	for (i = 0; i < words; i++) {
+ 		dev_spec->shadow_ram[offset+i].modified = 1;
+@@ -1170,8 +1139,7 @@ static s32 e1000_write_nvm_ich8lan(struct e1000_hw *hw, u16 offset, u16 words,
+ 
+ 	e1000_release_swflag_ich8lan(hw);
+ 
+-out:
+-	return ret_val;
++	return 0;
+ }
+ 
+ /**
+@@ -1195,14 +1163,14 @@ static s32 e1000_update_nvm_checksum_ich8lan(struct e1000_hw *hw)
+ 
+ 	ret_val = e1000_update_nvm_checksum_generic(hw);
+ 	if (ret_val)
+-		goto out;
++		return ret_val;;
+ 
+ 	if (nvm->type != e1000_nvm_flash_sw)
+-		goto out;
++		return ret_val;;
+ 
+ 	ret_val = e1000_acquire_swflag_ich8lan(hw);
+ 	if (ret_val)
+-		goto out;
++		return ret_val;;
+ 
+ 	/* We're writing to the opposite bank so if we're on bank 1,
+ 	 * write to bank 0 etc.  We also need to erase the segment that
+@@ -1262,7 +1230,7 @@ static s32 e1000_update_nvm_checksum_ich8lan(struct e1000_hw *hw)
+ 	if (ret_val) {
+ 		hw_dbg(hw, "Flash commit failed.\n");
+ 		e1000_release_swflag_ich8lan(hw);
+-		goto out;
++		return ret_val;
+ 	}
+ 
+ 	/* Finally validate the new segment by setting bit 15:14
+@@ -1277,7 +1245,7 @@ static s32 e1000_update_nvm_checksum_ich8lan(struct e1000_hw *hw)
+ 						       (u8)(data >> 8));
+ 	if (ret_val) {
+ 		e1000_release_swflag_ich8lan(hw);
+-		goto out;
++		return ret_val;
+ 	}
+ 
+ 	/* And invalidate the previously valid segment by setting
+@@ -1288,7 +1256,7 @@ static s32 e1000_update_nvm_checksum_ich8lan(struct e1000_hw *hw)
+ 	ret_val = e1000_retry_write_flash_byte_ich8lan(hw, act_offset, 0);
+ 	if (ret_val) {
+ 		e1000_release_swflag_ich8lan(hw);
+-		goto out;
++		return ret_val;
+ 	}
+ 
+ 	/* Great!  Everything worked, we can now clear the cached entries. */
+@@ -1305,7 +1273,6 @@ static s32 e1000_update_nvm_checksum_ich8lan(struct e1000_hw *hw)
+ 	e1000_reload_nvm(hw);
+ 	msleep(10);
+ 
+-out:
+ 	return ret_val;
+ }
+ 
+@@ -1319,7 +1286,7 @@ out:
+  **/
+ static s32 e1000_validate_nvm_checksum_ich8lan(struct e1000_hw *hw)
+ {
+-	s32 ret_val = E1000_SUCCESS;
++	s32 ret_val;
+ 	u16 data;
+ 
+ 	/* Read 0x19 and check bit 6.  If this bit is 0, the checksum
+@@ -1329,22 +1296,19 @@ static s32 e1000_validate_nvm_checksum_ich8lan(struct e1000_hw *hw)
+ 	 */
+ 	ret_val = e1000_read_nvm(hw, 0x19, 1, &data);
+ 	if (ret_val)
+-		goto out;
++		return ret_val;
+ 
+ 	if ((data & 0x40) == 0) {
+ 		data |= 0x40;
+ 		ret_val = e1000_write_nvm(hw, 0x19, 1, &data);
+ 		if (ret_val)
+-			goto out;
++			return ret_val;
+ 		ret_val = e1000_update_nvm_checksum(hw);
+ 		if (ret_val)
+-			goto out;
++			return ret_val;
+ 	}
+ 
+-	ret_val = e1000_validate_nvm_checksum_generic(hw);
+-
+-out:
+-	return ret_val;
++	return e1000_validate_nvm_checksum_generic(hw);
+ }
+ 
+ /**
+@@ -1363,12 +1327,12 @@ static s32 e1000_write_flash_data_ich8lan(struct e1000_hw *hw, u32 offset,
+ 	union ich8_hws_flash_ctrl hsflctl;
+ 	u32 flash_linear_addr;
+ 	u32 flash_data = 0;
+-	s32 ret_val = -E1000_ERR_NVM;
++	s32 ret_val;
+ 	u8 count = 0;
+ 
+ 	if (size < 1 || size > 2 || data > size * 0xff ||
+ 	    offset > ICH_FLASH_LINEAR_ADDR_MASK)
+-		goto out;
++		return -E1000_ERR_NVM;
+ 
+ 	flash_linear_addr = (ICH_FLASH_LINEAR_ADDR_MASK & offset) +
+ 			    hw->nvm.flash_base_addr;
+@@ -1377,7 +1341,7 @@ static s32 e1000_write_flash_data_ich8lan(struct e1000_hw *hw, u32 offset,
+ 		udelay(1);
+ 		/* Steps */
+ 		ret_val = e1000_flash_cycle_init_ich8lan(hw);
+-		if (ret_val != E1000_SUCCESS)
++		if (ret_val)
+ 			break;
+ 
+ 		hsflctl.regval = er16flash(ICH_FLASH_HSFCTL);
+@@ -1399,27 +1363,25 @@ static s32 e1000_write_flash_data_ich8lan(struct e1000_hw *hw, u32 offset,
+ 		 * and try the whole sequence a few more times else done */
+ 		ret_val = e1000_flash_cycle_ich8lan(hw,
+ 					       ICH_FLASH_WRITE_COMMAND_TIMEOUT);
+-		if (ret_val == E1000_SUCCESS) {
++		if (!ret_val)
++			break;
++
++		/* If we're here, then things are most likely
++		 * completely hosed, but if the error condition
++		 * is detected, it won't hurt to give it another
++		 * try...ICH_FLASH_CYCLE_REPEAT_COUNT times.
++		 */
++		hsfsts.regval = er16flash(ICH_FLASH_HSFSTS);
++		if (hsfsts.hsf_status.flcerr == 1)
++			/* Repeat for some time before giving up. */
++			continue;
++		if (hsfsts.hsf_status.flcdone == 0) {
++			hw_dbg(hw, "Timeout error - flash cycle "
++				 "did not complete.");
+ 			break;
+-		} else {
+-			/* If we're here, then things are most likely
+-			 * completely hosed, but if the error condition
+-			 * is detected, it won't hurt to give it another
+-			 * try...ICH_FLASH_CYCLE_REPEAT_COUNT times.
+-			 */
+-			hsfsts.regval = er16flash(ICH_FLASH_HSFSTS);
+-			if (hsfsts.hsf_status.flcerr == 1) {
+-				/* Repeat for some time before giving up. */
+-				continue;
+-			} else if (hsfsts.hsf_status.flcdone == 0) {
+-				hw_dbg(hw, "Timeout error - flash cycle "
+-					 "did not complete.");
+-				break;
+-			}
+ 		}
+ 	} while (count++ < ICH_FLASH_CYCLE_REPEAT_COUNT);
+ 
+-out:
+ 	return ret_val;
+ }
+ 
+@@ -1455,23 +1417,20 @@ static s32 e1000_retry_write_flash_byte_ich8lan(struct e1000_hw *hw,
+ 	u16 program_retries;
+ 
+ 	ret_val = e1000_write_flash_byte_ich8lan(hw, offset, byte);
+-	if (ret_val == E1000_SUCCESS)
+-		goto out;
++	if (!ret_val)
++		return ret_val;
+ 
+ 	for (program_retries = 0; program_retries < 100; program_retries++) {
+ 		hw_dbg(hw, "Retrying Byte %2.2X at offset %u\n", byte, offset);
+ 		udelay(100);
+ 		ret_val = e1000_write_flash_byte_ich8lan(hw, offset, byte);
+-		if (ret_val == E1000_SUCCESS)
++		if (!ret_val)
+ 			break;
+ 	}
+-	if (program_retries == 100) {
+-		ret_val = -E1000_ERR_NVM;
+-		goto out;
+-	}
++	if (program_retries == 100)
++		return -E1000_ERR_NVM;
+ 
+-out:
+-	return ret_val;
++	return 0;
+ }
+ 
+ /**
+@@ -1490,9 +1449,11 @@ static s32 e1000_erase_flash_bank_ich8lan(struct e1000_hw *hw, u32 bank)
+ 	u32 flash_linear_addr;
+ 	/* bank size is in 16bit words - adjust to bytes */
+ 	u32 flash_bank_size = nvm->flash_bank_size * 2;
+-	s32  ret_val = E1000_SUCCESS;
+-	s32  count = 0;
+-	s32  j, iteration, sector_size;
++	s32 ret_val;
++	s32 count = 0;
++	s32 iteration;
++	s32 sector_size;
++	s32 j;
+ 
+ 	hsfsts.regval = er16flash(ICH_FLASH_HSFSTS);
+ 
+@@ -1523,8 +1484,7 @@ static s32 e1000_erase_flash_bank_ich8lan(struct e1000_hw *hw, u32 bank)
+ 			sector_size = ICH_FLASH_SEG_SIZE_8K;
+ 			iteration = flash_bank_size / ICH_FLASH_SEG_SIZE_8K;
+ 		} else {
+-			ret_val = -E1000_ERR_NVM;
+-			goto out;
++			return -E1000_ERR_NVM;
+ 		}
+ 		break;
+ 	case 3:
+@@ -1532,8 +1492,7 @@ static s32 e1000_erase_flash_bank_ich8lan(struct e1000_hw *hw, u32 bank)
+ 		iteration = flash_bank_size / ICH_FLASH_SEG_SIZE_64K;
+ 		break;
+ 	default:
+-		ret_val = -E1000_ERR_NVM;
+-		goto out;
++		return -E1000_ERR_NVM;
+ 	}
+ 
+ 	/* Start with the base address, then add the sector offset. */
+@@ -1545,7 +1504,7 @@ static s32 e1000_erase_flash_bank_ich8lan(struct e1000_hw *hw, u32 bank)
+ 			/* Steps */
+ 			ret_val = e1000_flash_cycle_init_ich8lan(hw);
+ 			if (ret_val)
+-				goto out;
++				return ret_val;
+ 
+ 			/* Write a value 11 (block Erase) in Flash
+ 			 * Cycle field in hw flash control */
+@@ -1562,25 +1521,23 @@ static s32 e1000_erase_flash_bank_ich8lan(struct e1000_hw *hw, u32 bank)
+ 
+ 			ret_val = e1000_flash_cycle_ich8lan(hw,
+ 					       ICH_FLASH_ERASE_COMMAND_TIMEOUT);
+-			if (ret_val == E1000_SUCCESS) {
++			if (ret_val == 0)
+ 				break;
+-			} else {
+-				/* Check if FCERR is set to 1.  If 1,
+-				 * clear it and try the whole sequence
+-				 * a few more times else Done */
+-				hsfsts.regval = er16flash(ICH_FLASH_HSFSTS);
+-				if (hsfsts.hsf_status.flcerr == 1) {
+-					/* repeat for some time before
+-					 * giving up */
+-					continue;
+-				} else if (hsfsts.hsf_status.flcdone == 0)
+-					goto out;
+-			}
++
++			/* Check if FCERR is set to 1.  If 1,
++			 * clear it and try the whole sequence
++			 * a few more times else Done */
++			hsfsts.regval = er16flash(ICH_FLASH_HSFSTS);
++			if (hsfsts.hsf_status.flcerr == 1)
++				/* repeat for some time before
++				 * giving up */
++				continue;
++			else if (hsfsts.hsf_status.flcdone == 0)
++				return ret_val;
+ 		} while (++count < ICH_FLASH_CYCLE_REPEAT_COUNT);
+ 	}
+ 
+-out:
+-	return ret_val;
++	return 0;
+ }
+ 
+ /**
+@@ -1599,15 +1556,14 @@ static s32 e1000_valid_led_default_ich8lan(struct e1000_hw *hw, u16 *data)
+ 	ret_val = e1000_read_nvm(hw, NVM_ID_LED_SETTINGS, 1, data);
+ 	if (ret_val) {
+ 		hw_dbg(hw, "NVM Read Error\n");
+-		goto out;
++		return ret_val;
+ 	}
+ 
+ 	if (*data == ID_LED_RESERVED_0000 ||
+ 	    *data == ID_LED_RESERVED_FFFF)
+ 		*data = ID_LED_DEFAULT_ICH8LAN;
+ 
+-out:
+-	return ret_val;
++	return 0;
+ }
+ 
+ /**
+@@ -1735,7 +1691,7 @@ static s32 e1000_init_hw_ich8lan(struct e1000_hw *hw)
+ 	ret_val = e1000_id_led_init(hw);
+ 	if (ret_val) {
+ 		hw_dbg(hw, "Error initializing identification LED\n");
+-		goto out;
++		return ret_val;
+ 	}
+ 
+ 	/* Setup the receive address. */
+@@ -1782,8 +1738,7 @@ static s32 e1000_init_hw_ich8lan(struct e1000_hw *hw)
+ 	 */
+ 	e1000_clear_hw_cntrs_ich8lan(hw);
+ 
+-out:
+-	return ret_val;
++	return 0;
+ }
+ /**
+  *  e1000_initialize_hw_bits_ich8lan - Initialize required hardware bits
+@@ -1848,10 +1803,10 @@ static void e1000_initialize_hw_bits_ich8lan(struct e1000_hw *hw)
+ static s32 e1000_setup_link_ich8lan(struct e1000_hw *hw)
+ {
+ 	struct e1000_mac_info *mac = &hw->mac;
+-	s32 ret_val = E1000_SUCCESS;
++	s32 ret_val;
+ 
+ 	if (e1000_check_reset_block(hw))
+-		goto out;
++		return 0;
+ 
+ 	/* ICH parts do not have a word in the NVM to determine
+ 	 * the default flow control setting, so we explicitly
+@@ -1867,14 +1822,11 @@ static s32 e1000_setup_link_ich8lan(struct e1000_hw *hw)
+ 	/* Continue to configure the copper link. */
+ 	ret_val = e1000_setup_copper_link_ich8lan(hw);
+ 	if (ret_val)
+-		goto out;
++		return ret_val;
+ 
+ 	ew32(FCTTV, mac->fc_pause_time);
+ 
+-	ret_val = e1000_set_fc_watermarks(hw);
+-
+-out:
+-	return ret_val;
++	return e1000_set_fc_watermarks(hw);
+ }
+ 
+ /**
+@@ -1901,25 +1853,22 @@ static s32 e1000_setup_copper_link_ich8lan(struct e1000_hw *hw)
+ 	 * this fixes erroneous timeouts at 10Mbps. */
+ 	ret_val = e1000_write_kmrn_reg(hw, GG82563_REG(0x34, 4), 0xFFFF);
+ 	if (ret_val)
+-		goto out;
++		return ret_val;
+ 	ret_val = e1000_read_kmrn_reg(hw, GG82563_REG(0x34, 9), &reg_data);
+ 	if (ret_val)
+-		goto out;
++		return ret_val;
+ 	reg_data |= 0x3F;
+ 	ret_val = e1000_write_kmrn_reg(hw, GG82563_REG(0x34, 9), reg_data);
+ 	if (ret_val)
+-		goto out;
++		return ret_val;
+ 
+ 	if (hw->phy.type == e1000_phy_igp_3) {
+ 		ret_val = e1000_copper_link_setup_igp(hw);
+ 		if (ret_val)
+-			goto out;
++			return ret_val;
+ 	}
+ 
+-	ret_val = e1000_setup_copper_link(hw);
+-
+-out:
+-	return ret_val;
++	return e1000_setup_copper_link(hw);
+ }
+ 
+ /**
+@@ -1939,7 +1888,7 @@ static s32 e1000_get_link_up_info_ich8lan(struct e1000_hw *hw, u16 *speed,
+ 
+ 	ret_val = e1000_get_speed_and_duplex_copper(hw, speed, duplex);
+ 	if (ret_val)
+-		goto out;
++		return ret_val;
+ 
+ 	if ((hw->mac.type == e1000_ich8lan) &&
+ 	    (hw->phy.type == e1000_phy_igp_3) &&
+@@ -1947,7 +1896,6 @@ static s32 e1000_get_link_up_info_ich8lan(struct e1000_hw *hw, u16 *speed,
+ 		ret_val = e1000_kmrn_lock_loss_workaround_ich8lan(hw);
+ 	}
+ 
+-out:
+ 	return ret_val;
+ }
+ 
+@@ -1970,37 +1918,33 @@ static s32 e1000_kmrn_lock_loss_workaround_ich8lan(struct e1000_hw *hw)
+ {
+ 	struct e1000_dev_spec_ich8lan *dev_spec = &hw->dev_spec.ich8lan;
+ 	u32 phy_ctrl;
+-	s32 ret_val = E1000_SUCCESS;
++	s32 ret_val;
+ 	u16 i, data;
+ 	bool link;
+ 
+ 	if (!dev_spec->kmrn_lock_loss_workaround_enabled)
+-		goto out;
++		return 0;
+ 
+ 	/* Make sure link is up before proceeding.  If not just return.
+ 	 * Attempting this while link is negotiating fouled up link
+ 	 * stability */
+ 	ret_val = e1000_phy_has_link_generic(hw, 1, 0, &link);
+-	if (!link) {
+-		ret_val = E1000_SUCCESS;
+-		goto out;
+-	}
++	if (!link)
++		return 0;
+ 
+ 	for (i = 0; i < 10; i++) {
+ 		/* read once to clear */
+ 		ret_val = e1e_rphy(hw, IGP3_KMRN_DIAG, &data);
+ 		if (ret_val)
+-			goto out;
++			return ret_val;
+ 		/* and again to get new status */
+ 		ret_val = e1e_rphy(hw, IGP3_KMRN_DIAG, &data);
+ 		if (ret_val)
+-			goto out;
++			return ret_val;
+ 
+ 		/* check for PCS lock */
+-		if (!(data & IGP3_KMRN_DIAG_PCS_LOCK_LOSS)) {
+-			ret_val = E1000_SUCCESS;
+-			goto out;
+-		}
++		if (!(data & IGP3_KMRN_DIAG_PCS_LOCK_LOSS))
++			return 0;
+ 
+ 		/* Issue PHY reset */
+ 		e1000_phy_hw_reset(hw);
+@@ -2017,10 +1961,7 @@ static s32 e1000_kmrn_lock_loss_workaround_ich8lan(struct e1000_hw *hw)
+ 	e1000_gig_downshift_workaround_ich8lan(hw);
+ 
+ 	/* unable to acquire PCS lock */
+-	ret_val = -E1000_ERR_PHY;
+-
+-out:
+-	return ret_val;
++	return -E1000_ERR_PHY;
+ }
+ 
+ /**
+@@ -2038,13 +1979,10 @@ void e1000_set_kmrn_lock_loss_workaround_ich8lan(struct e1000_hw *hw,
+ 
+ 	if (hw->mac.type != e1000_ich8lan) {
+ 		hw_dbg(hw, "Workaround applies to ICH8 only.\n");
+-		goto out;
++		return;
+ 	}
+ 
+ 	dev_spec->kmrn_lock_loss_workaround_enabled = state;
+-
+-out:
+-	return;
+ }
+ 
+ /**
+@@ -2064,7 +2002,7 @@ void e1000_igp3_phy_powerdown_workaround_ich8lan(struct e1000_hw *hw)
+ 	u8  retry = 0;
+ 
+ 	if (hw->phy.type != e1000_phy_igp_3)
+-		goto out;
++		return;
+ 
+ 	/* Try the workaround twice (if needed) */
+ 	do {
+@@ -2095,9 +2033,6 @@ void e1000_igp3_phy_powerdown_workaround_ich8lan(struct e1000_hw *hw)
+ 		ew32(CTRL, reg | E1000_CTRL_PHY_RST);
+ 		retry++;
+ 	} while (retry);
+-
+-out:
+-	return;
+ }
+ 
+ /**
+@@ -2112,27 +2047,25 @@ out:
+  **/
+ void e1000_gig_downshift_workaround_ich8lan(struct e1000_hw *hw)
+ {
+-	s32 ret_val = E1000_SUCCESS;
++	s32 ret_val;
+ 	u16 reg_data;
+ 
+ 	if ((hw->mac.type != e1000_ich8lan) ||
+ 	    (hw->phy.type != e1000_phy_igp_3))
+-		goto out;
++		return;
+ 
+ 	ret_val = e1000_read_kmrn_reg(hw, E1000_KMRNCTRLSTA_DIAG_OFFSET,
+ 				      &reg_data);
+ 	if (ret_val)
+-		goto out;
++		return;
+ 	reg_data |= E1000_KMRNCTRLSTA_DIAG_NELPBK;
+ 	ret_val = e1000_write_kmrn_reg(hw, E1000_KMRNCTRLSTA_DIAG_OFFSET,
+ 				       reg_data);
+ 	if (ret_val)
+-		goto out;
++		return;
+ 	reg_data &= ~E1000_KMRNCTRLSTA_DIAG_NELPBK;
+ 	ret_val = e1000_write_kmrn_reg(hw, E1000_KMRNCTRLSTA_DIAG_OFFSET,
+ 				       reg_data);
+-out:
+-	return;
+ }
+ 
+ /**
+@@ -2143,14 +2076,11 @@ out:
+  **/
+ static s32 e1000_cleanup_led_ich8lan(struct e1000_hw *hw)
+ {
+-	s32 ret_val = E1000_SUCCESS;
+-
+ 	if (hw->phy.type == e1000_phy_ife)
+-		ret_val = e1e_wphy(hw, IFE_PHY_SPECIAL_CONTROL_LED, 0);
+-	else
+-		ew32(LEDCTL, hw->mac.ledctl_default);
++		return e1e_wphy(hw, IFE_PHY_SPECIAL_CONTROL_LED, 0);
+ 
+-	return ret_val;
++	ew32(LEDCTL, hw->mac.ledctl_default);
++	return 0;
+ }
+ 
+ /**
+@@ -2161,15 +2091,12 @@ static s32 e1000_cleanup_led_ich8lan(struct e1000_hw *hw)
+  **/
+ static s32 e1000_led_on_ich8lan(struct e1000_hw *hw)
+ {
+-	s32 ret_val = E1000_SUCCESS;
+-
+ 	if (hw->phy.type == e1000_phy_ife)
+-		ret_val = e1e_wphy(hw, IFE_PHY_SPECIAL_CONTROL_LED,
++		return e1e_wphy(hw, IFE_PHY_SPECIAL_CONTROL_LED,
+ 				(IFE_PSCL_PROBE_MODE | IFE_PSCL_PROBE_LEDS_ON));
+-	else
+-		ew32(LEDCTL, hw->mac.ledctl_mode2);
+ 
+-	return ret_val;
++	ew32(LEDCTL, hw->mac.ledctl_mode2);
++	return 0;
+ }
+ 
+ /**
+@@ -2180,16 +2107,12 @@ static s32 e1000_led_on_ich8lan(struct e1000_hw *hw)
+  **/
+ static s32 e1000_led_off_ich8lan(struct e1000_hw *hw)
+ {
+-	s32 ret_val = E1000_SUCCESS;
+-
+ 	if (hw->phy.type == e1000_phy_ife)
+-		ret_val = e1e_wphy(hw,
+-			       IFE_PHY_SPECIAL_CONTROL_LED,
++		return e1e_wphy(hw, IFE_PHY_SPECIAL_CONTROL_LED,
+ 			       (IFE_PSCL_PROBE_MODE | IFE_PSCL_PROBE_LEDS_OFF));
+-	else
+-		ew32(LEDCTL, hw->mac.ledctl_mode1);
+ 
+-	return ret_val;
++	ew32(LEDCTL, hw->mac.ledctl_mode1);
++	return 0;
+ }
+ 
+ /**
+diff --git a/drivers/net/e1000e/lib.c b/drivers/net/e1000e/lib.c
+index 21c16e0..d11b518 100644
+--- a/drivers/net/e1000e/lib.c
++++ b/drivers/net/e1000e/lib.c
+@@ -81,7 +81,7 @@ s32 e1000_get_bus_info_pcie(struct e1000_hw *hw)
+ 		bus->func = 0;
+ 	}
+ 
+-	return E1000_SUCCESS;
++	return 0;
+ }
+ 
+ /**
+@@ -378,10 +378,8 @@ s32 e1000_check_for_copper_link(struct e1000_hw *hw)
+ 	 * get_link_status flag is set upon receiving a Link Status
+ 	 * Change or Rx Sequence Error interrupt.
+ 	 */
+-	if (!mac->get_link_status) {
+-		ret_val = E1000_SUCCESS;
+-		goto out;
+-	}
++	if (!mac->get_link_status)
++		return 0;
+ 
+ 	/* First we want to see if the MII Status Register reports
+ 	 * link.  If so, then we want to get the current speed/duplex
+@@ -389,10 +387,10 @@ s32 e1000_check_for_copper_link(struct e1000_hw *hw)
+ 	 */
+ 	ret_val = e1000_phy_has_link_generic(hw, 1, 0, &link);
+ 	if (ret_val)
+-		goto out;
++		return ret_val;
+ 
+ 	if (!link)
+-		goto out; /* No link detected */
++		return ret_val; /* No link detected */
+ 
+ 	mac->get_link_status = 0;
+ 
+@@ -405,7 +403,7 @@ s32 e1000_check_for_copper_link(struct e1000_hw *hw)
+ 	 */
+ 	if (!mac->autoneg) {
+ 		ret_val = -E1000_ERR_CONFIG;
+-		goto out;
++		return ret_val;
+ 	}
+ 
+ 	/* Auto-Neg is enabled.  Auto Speed Detection takes care
+@@ -424,7 +422,6 @@ s32 e1000_check_for_copper_link(struct e1000_hw *hw)
+ 		hw_dbg(hw, "Error configuring flow control\n");
+ 	}
+ 
+-out:
+ 	return ret_val;
+ }
+ 
+@@ -441,7 +438,7 @@ s32 e1000_check_for_fiber_link(struct e1000_hw *hw)
+ 	u32 rxcw;
+ 	u32 ctrl;
+ 	u32 status;
+-	s32 ret_val = E1000_SUCCESS;
++	s32 ret_val;
+ 
+ 	ctrl = er32(CTRL);
+ 	status = er32(STATUS);
+@@ -459,7 +456,7 @@ s32 e1000_check_for_fiber_link(struct e1000_hw *hw)
+ 	    (!(rxcw & E1000_RXCW_C))) {
+ 		if (mac->autoneg_failed == 0) {
+ 			mac->autoneg_failed = 1;
+-			goto out;
++			return 0;
+ 		}
+ 		hw_dbg(hw, "NOT RXing /C/, disable AutoNeg and force link.\n");
+ 
+@@ -475,7 +472,7 @@ s32 e1000_check_for_fiber_link(struct e1000_hw *hw)
+ 		ret_val = e1000_config_fc_after_link_up(hw);
+ 		if (ret_val) {
+ 			hw_dbg(hw, "Error configuring flow control\n");
+-			goto out;
++			return ret_val;
+ 		}
+ 	} else if ((ctrl & E1000_CTRL_SLU) && (rxcw & E1000_RXCW_C)) {
+ 		/* If we are forcing link and we are receiving /C/ ordered
+@@ -490,8 +487,7 @@ s32 e1000_check_for_fiber_link(struct e1000_hw *hw)
+ 		mac->serdes_has_link = 1;
+ 	}
+ 
+-out:
+-	return ret_val;
++	return 0;
+ }
+ 
+ /**
+@@ -507,7 +503,7 @@ s32 e1000_check_for_serdes_link(struct e1000_hw *hw)
+ 	u32 rxcw;
+ 	u32 ctrl;
+ 	u32 status;
+-	s32 ret_val = E1000_SUCCESS;
++	s32 ret_val;
+ 
+ 	ctrl = er32(CTRL);
+ 	status = er32(STATUS);
+@@ -523,7 +519,7 @@ s32 e1000_check_for_serdes_link(struct e1000_hw *hw)
+ 	if ((!(status & E1000_STATUS_LU)) && (!(rxcw & E1000_RXCW_C))) {
+ 		if (mac->autoneg_failed == 0) {
+ 			mac->autoneg_failed = 1;
+-			goto out;
++			return 0;
+ 		}
+ 		hw_dbg(hw, "NOT RXing /C/, disable AutoNeg and force link.\n");
+ 
+@@ -539,7 +535,7 @@ s32 e1000_check_for_serdes_link(struct e1000_hw *hw)
+ 		ret_val = e1000_config_fc_after_link_up(hw);
+ 		if (ret_val) {
+ 			hw_dbg(hw, "Error configuring flow control\n");
+-			goto out;
++			return ret_val;
+ 		}
+ 	} else if ((ctrl & E1000_CTRL_SLU) && (rxcw & E1000_RXCW_C)) {
+ 		/* If we are forcing link and we are receiving /C/ ordered
+@@ -575,8 +571,7 @@ s32 e1000_check_for_serdes_link(struct e1000_hw *hw)
+ 		mac->serdes_has_link = (status & E1000_STATUS_LU);
+ 	}
+ 
+-out:
+-	return ret_val;
++	return 0;
+ }
+ 
+ /**
+@@ -589,11 +584,11 @@ out:
+ static s32 e1000_set_default_fc_generic(struct e1000_hw *hw)
+ {
+ 	struct e1000_mac_info *mac = &hw->mac;
+-	s32 ret_val = E1000_SUCCESS;
++	s32 ret_val;
+ 	u16 nvm_data;
+ 
+ 	if (mac->fc != e1000_fc_default)
+-		goto out;
++		return 0;
+ 
+ 	/* Read and store word 0x0F of the EEPROM. This word contains bits
+ 	 * that determine the hardware's default PAUSE (flow control) mode,
+@@ -607,7 +602,7 @@ static s32 e1000_set_default_fc_generic(struct e1000_hw *hw)
+ 
+ 	if (ret_val) {
+ 		hw_dbg(hw, "NVM Read Error\n");
+-		goto out;
++		return ret_val;
+ 	}
+ 
+ 	if ((nvm_data & NVM_WORD0F_PAUSE_MASK) == 0)
+@@ -618,8 +613,7 @@ static s32 e1000_set_default_fc_generic(struct e1000_hw *hw)
+ 	else
+ 		mac->fc = e1000_fc_full;
+ 
+-out:
+-	return ret_val;
++	return 0;
+ }
+ 
+ /**
+@@ -635,17 +629,17 @@ out:
+ s32 e1000_setup_link(struct e1000_hw *hw)
+ {
+ 	struct e1000_mac_info *mac = &hw->mac;
+-	s32 ret_val = E1000_SUCCESS;
++	s32 ret_val;
+ 
+ 	/* In the case of the phy reset being blocked, we already have a link.
+ 	 * We do not need to set it up again.
+ 	 */
+ 	if (e1000_check_reset_block(hw))
+-		goto out;
++		return 0;
+ 
+ 	ret_val = e1000_set_default_fc_generic(hw);
+ 	if (ret_val)
+-		goto out;
++		return ret_val;
+ 
+ 	/* We want to save off the original Flow Control configuration just
+ 	 * in case we get disconnected and then reconnected into a different
+@@ -658,7 +652,7 @@ s32 e1000_setup_link(struct e1000_hw *hw)
+ 	/* Call the necessary media_type subroutine to configure the link. */
+ 	ret_val = mac->ops.setup_physical_interface(hw);
+ 	if (ret_val)
+-		goto out;
++		return ret_val;
+ 
+ 	/* Initialize the flow control address, type, and PAUSE timer
+ 	 * registers to their default values.  This is done even if flow
+@@ -672,10 +666,7 @@ s32 e1000_setup_link(struct e1000_hw *hw)
+ 
+ 	ew32(FCTTV, mac->fc_pause_time);
+ 
+-	ret_val = e1000_set_fc_watermarks(hw);
+-
+-out:
+-	return ret_val;
++	return e1000_set_fc_watermarks(hw);
+ }
+ 
+ /**
+@@ -689,7 +680,6 @@ static s32 e1000_commit_fc_settings_generic(struct e1000_hw *hw)
+ {
+ 	struct e1000_mac_info *mac = &hw->mac;
+ 	u32 txcw;
+-	s32 ret_val = E1000_SUCCESS;
+ 
+ 	/* Check for a software override of the flow control settings, and
+ 	 * setup the device accordingly.  If auto-negotiation is enabled, then
+@@ -736,16 +726,14 @@ static s32 e1000_commit_fc_settings_generic(struct e1000_hw *hw)
+ 		break;
+ 	default:
+ 		hw_dbg(hw, "Flow control param set incorrectly\n");
+-		ret_val = -E1000_ERR_CONFIG;
+-		goto out;
++		return -E1000_ERR_CONFIG;
+ 		break;
+ 	}
+ 
+ 	ew32(TXCW, txcw);
+ 	mac->txcw = txcw;
+ 
+-out:
+-	return ret_val;
++	return 0;
+ }
+ 
+ /**
+@@ -759,7 +747,7 @@ static s32 e1000_poll_fiber_serdes_link_generic(struct e1000_hw *hw)
+ {
+ 	struct e1000_mac_info *mac = &hw->mac;
+ 	u32 i, status;
+-	s32 ret_val = E1000_SUCCESS;
++	s32 ret_val;
+ 
+ 	/* If we have a signal (the cable is plugged in, or assumed true for
+ 	 * serdes media) then poll for a "Link-Up" indication in the Device
+@@ -784,7 +772,7 @@ static s32 e1000_poll_fiber_serdes_link_generic(struct e1000_hw *hw)
+ 		ret_val = mac->ops.check_for_link(hw);
+ 		if (ret_val) {
+ 			hw_dbg(hw, "Error while checking for link\n");
+-			goto out;
++			return ret_val;
+ 		}
+ 		mac->autoneg_failed = 0;
+ 	} else {
+@@ -792,8 +780,7 @@ static s32 e1000_poll_fiber_serdes_link_generic(struct e1000_hw *hw)
+ 		hw_dbg(hw, "Valid Link Found\n");
+ 	}
+ 
+-out:
+-	return ret_val;
++	return 0;
+ }
+ 
+ /**
+@@ -806,7 +793,7 @@ out:
+ s32 e1000_setup_fiber_serdes_link(struct e1000_hw *hw)
+ {
+ 	u32 ctrl;
+-	s32 ret_val = E1000_SUCCESS;
++	s32 ret_val;
+ 
+ 	ctrl = er32(CTRL);
+ 
+@@ -817,7 +804,7 @@ s32 e1000_setup_fiber_serdes_link(struct e1000_hw *hw)
+ 
+ 	ret_val = e1000_commit_fc_settings_generic(hw);
+ 	if (ret_val)
+-		goto out;
++		return ret_val;
+ 
+ 	/* Since auto-negotiation is enabled, take the link out of reset (the
+ 	 * link will be in reset, because we previously reset the chip). This
+@@ -842,8 +829,7 @@ s32 e1000_setup_fiber_serdes_link(struct e1000_hw *hw)
+ 		hw_dbg(hw, "No signal detected\n");
+ 	}
+ 
+-out:
+-	return ret_val;
++	return 0;
+ }
+ 
+ /**
+@@ -878,7 +864,6 @@ void e1000_config_collision_dist(struct e1000_hw *hw)
+ s32 e1000_set_fc_watermarks(struct e1000_hw *hw)
+ {
+ 	struct e1000_mac_info *mac = &hw->mac;
+-	s32 ret_val = E1000_SUCCESS;
+ 	u32 fcrtl = 0, fcrth = 0;
+ 
+ 	/* Set the flow control receive threshold registers.  Normally,
+@@ -894,13 +879,12 @@ s32 e1000_set_fc_watermarks(struct e1000_hw *hw)
+ 		 */
+ 		fcrtl = mac->fc_low_water;
+ 		fcrtl |= E1000_FCRTL_XONE;
+-
+ 		fcrth = mac->fc_high_water;
+ 	}
+ 	ew32(FCRTL, fcrtl);
+ 	ew32(FCRTH, fcrth);
+ 
+-	return ret_val;
++	return 0;
+ }
+ 
+ /**
+@@ -917,7 +901,6 @@ s32 e1000_force_mac_fc(struct e1000_hw *hw)
+ {
+ 	struct e1000_mac_info *mac = &hw->mac;
+ 	u32 ctrl;
+-	s32 ret_val = E1000_SUCCESS;
+ 
+ 	ctrl = er32(CTRL);
+ 
+@@ -957,14 +940,12 @@ s32 e1000_force_mac_fc(struct e1000_hw *hw)
+ 		break;
+ 	default:
+ 		hw_dbg(hw, "Flow control param set incorrectly\n");
+-		ret_val = -E1000_ERR_CONFIG;
+-		goto out;
++		return -E1000_ERR_CONFIG;
+ 	}
+ 
+ 	ew32(CTRL, ctrl);
+ 
+-out:
+-	return ret_val;
++	return 0;
+ }
+ 
+ /**
+@@ -980,7 +961,7 @@ out:
+ s32 e1000_config_fc_after_link_up(struct e1000_hw *hw)
+ {
+ 	struct e1000_mac_info *mac = &hw->mac;
+-	s32 ret_val = E1000_SUCCESS;
++	s32 ret_val = 0;
+ 	u16 mii_status_reg, mii_nway_adv_reg, mii_nway_lp_ability_reg;
+ 	u16 speed, duplex;
+ 
+@@ -999,7 +980,7 @@ s32 e1000_config_fc_after_link_up(struct e1000_hw *hw)
+ 
+ 	if (ret_val) {
+ 		hw_dbg(hw, "Error forcing flow control settings\n");
+-		goto out;
++		return ret_val;
+ 	}
+ 
+ 	/* Check for the case where we have copper media and auto-neg is
+@@ -1014,15 +995,15 @@ s32 e1000_config_fc_after_link_up(struct e1000_hw *hw)
+ 		 */
+ 		ret_val = e1e_rphy(hw, PHY_STATUS, &mii_status_reg);
+ 		if (ret_val)
+-			goto out;
++			return ret_val;
+ 		ret_val = e1e_rphy(hw, PHY_STATUS, &mii_status_reg);
+ 		if (ret_val)
+-			goto out;
++			return ret_val;
+ 
+ 		if (!(mii_status_reg & MII_SR_AUTONEG_COMPLETE)) {
+ 			hw_dbg(hw, "Copper PHY and Auto Neg "
+ 				 "has not completed.\n");
+-			goto out;
++			return ret_val;
+ 		}
+ 
+ 		/* The AutoNeg process has completed, so we now need to
+@@ -1033,10 +1014,10 @@ s32 e1000_config_fc_after_link_up(struct e1000_hw *hw)
+ 		 */
+ 		ret_val = e1e_rphy(hw, PHY_AUTONEG_ADV, &mii_nway_adv_reg);
+ 		if (ret_val)
+-			goto out;
++			return ret_val;
+ 		ret_val = e1e_rphy(hw, PHY_LP_ABILITY, &mii_nway_lp_ability_reg);
+ 		if (ret_val)
+-			goto out;
++			return ret_val;
+ 
+ 		/* Two bits in the Auto Negotiation Advertisement Register
+ 		 * (Address 4) and two bits in the Auto Negotiation Base
+@@ -1155,7 +1136,7 @@ s32 e1000_config_fc_after_link_up(struct e1000_hw *hw)
+ 		ret_val = mac->ops.get_link_up_info(hw, &speed, &duplex);
+ 		if (ret_val) {
+ 			hw_dbg(hw, "Error getting link speed and duplex\n");
+-			goto out;
++			return ret_val;
+ 		}
+ 
+ 		if (duplex == HALF_DUPLEX)
+@@ -1167,12 +1148,11 @@ s32 e1000_config_fc_after_link_up(struct e1000_hw *hw)
+ 		ret_val = e1000_force_mac_fc(hw);
+ 		if (ret_val) {
+ 			hw_dbg(hw, "Error forcing flow control settings\n");
+-			goto out;
++			return ret_val;
+ 		}
+ 	}
+ 
+-out:
+-	return ret_val;
++	return 0;
+ }
+ 
+ /**
+@@ -1208,7 +1188,7 @@ s32 e1000_get_speed_and_duplex_copper(struct e1000_hw *hw, u16 *speed, u16 *dupl
+ 		hw_dbg(hw, "Half Duplex\n");
+ 	}
+ 
+-	return E1000_SUCCESS;
++	return 0;
+ }
+ 
+ /**
+@@ -1225,7 +1205,7 @@ s32 e1000_get_speed_and_duplex_fiber_serdes(struct e1000_hw *hw, u16 *speed, u16
+ 	*speed = SPEED_1000;
+ 	*duplex = FULL_DUPLEX;
+ 
+-	return E1000_SUCCESS;
++	return 0;
+ }
+ 
+ /**
+@@ -1237,7 +1217,6 @@ s32 e1000_get_speed_and_duplex_fiber_serdes(struct e1000_hw *hw, u16 *speed, u16
+ s32 e1000_get_hw_semaphore(struct e1000_hw *hw)
+ {
+ 	u32 swsm;
+-	s32 ret_val = E1000_SUCCESS;
+ 	s32 timeout = hw->nvm.word_size + 1;
+ 	s32 i = 0;
+ 
+@@ -1253,8 +1232,7 @@ s32 e1000_get_hw_semaphore(struct e1000_hw *hw)
+ 
+ 	if (i == timeout) {
+ 		hw_dbg(hw, "Driver can't access device - SMBI bit is set.\n");
+-		ret_val = -E1000_ERR_NVM;
+-		goto out;
++		return -E1000_ERR_NVM;
+ 	}
+ 
+ 	/* Get the FW semaphore. */
+@@ -1273,12 +1251,10 @@ s32 e1000_get_hw_semaphore(struct e1000_hw *hw)
+ 		/* Release semaphores */
+ 		e1000_put_hw_semaphore(hw);
+ 		hw_dbg(hw, "Driver can't access the NVM\n");
+-		ret_val = -E1000_ERR_NVM;
+-		goto out;
++		return -E1000_ERR_NVM;
+ 	}
+ 
+-out:
+-	return ret_val;
++	return 0;
+ }
+ 
+ /**
+@@ -1292,9 +1268,7 @@ void e1000_put_hw_semaphore(struct e1000_hw *hw)
+ 	u32 swsm;
+ 
+ 	swsm = er32(SWSM);
+-
+ 	swsm &= ~(E1000_SWSM_SMBI | E1000_SWSM_SWESMBI);
+-
+ 	ew32(SWSM, swsm);
+ }
+ 
+@@ -1307,7 +1281,6 @@ void e1000_put_hw_semaphore(struct e1000_hw *hw)
+ s32 e1000_get_auto_rd_done(struct e1000_hw *hw)
+ {
+ 	s32 i = 0;
+-	s32 ret_val = E1000_SUCCESS;
+ 
+ 	while (i < AUTO_READ_DONE_TIMEOUT) {
+ 		if (er32(EECD) & E1000_EECD_AUTO_RD)
+@@ -1318,12 +1291,10 @@ s32 e1000_get_auto_rd_done(struct e1000_hw *hw)
+ 
+ 	if (i == AUTO_READ_DONE_TIMEOUT) {
+ 		hw_dbg(hw, "Auto read by HW from NVM has not completed.\n");
+-		ret_val = -E1000_ERR_RESET;
+-		goto out;
++		return -E1000_ERR_RESET;
+ 	}
+ 
+-out:
+-	return ret_val;
++	return 0;
+ }
+ 
+ /**
+@@ -1341,14 +1312,13 @@ s32 e1000_valid_led_default(struct e1000_hw *hw, u16 *data)
+ 	ret_val = e1000_read_nvm(hw, NVM_ID_LED_SETTINGS, 1, data);
+ 	if (ret_val) {
+ 		hw_dbg(hw, "NVM Read Error\n");
+-		goto out;
++		return ret_val;
+ 	}
+ 
+ 	if (*data == ID_LED_RESERVED_0000 || *data == ID_LED_RESERVED_FFFF)
+ 		*data = ID_LED_DEFAULT;
+ 
+-out:
+-	return ret_val;
++	return 0;
+ }
+ 
+ /**
+@@ -1368,7 +1338,7 @@ s32 e1000_id_led_init(struct e1000_hw *hw)
+ 
+ 	ret_val = hw->nvm.ops.valid_led_default(hw, &data);
+ 	if (ret_val)
+-		goto out;
++		return ret_val;
+ 
+ 	mac->ledctl_default = er32(LEDCTL);
+ 	mac->ledctl_mode1 = mac->ledctl_default;
+@@ -1412,8 +1382,7 @@ s32 e1000_id_led_init(struct e1000_hw *hw)
+ 		}
+ 	}
+ 
+-out:
+-	return ret_val;
++	return 0;
+ }
+ 
+ /**
+@@ -1426,8 +1395,7 @@ out:
+ s32 e1000_cleanup_led_generic(struct e1000_hw *hw)
+ {
+ 	ew32(LEDCTL, hw->mac.ledctl_default);
+-
+-	return E1000_SUCCESS;
++	return 0;
+ }
+ 
+ /**
+@@ -1458,7 +1426,7 @@ s32 e1000_blink_led(struct e1000_hw *hw)
+ 
+ 	ew32(LEDCTL, ledctl_blink);
+ 
+-	return E1000_SUCCESS;
++	return 0;
+ }
+ 
+ /**
+@@ -1485,7 +1453,7 @@ s32 e1000_led_on_generic(struct e1000_hw *hw)
+ 		break;
+ 	}
+ 
+-	return E1000_SUCCESS;
++	return 0;
+ }
+ 
+ /**
+@@ -1512,7 +1480,7 @@ s32 e1000_led_off_generic(struct e1000_hw *hw)
+ 		break;
+ 	}
+ 
+-	return E1000_SUCCESS;
++	return 0;
+ }
+ 
+ /**
+@@ -1538,7 +1506,7 @@ void e1000_set_pcie_no_snoop(struct e1000_hw *hw, u32 no_snoop)
+  *  e1000_disable_pcie_master - Disables PCI-express master access
+  *  @hw: pointer to the HW structure
+  *
+- *  Returns 0 (E1000_SUCCESS) if successful, else returns -10
++ *  Returns 0 if successful, else returns -10
+  *  (-E1000_ERR_MASTER_REQUESTS_PENDING) if master disable bit has not casued
+  *  the master requests to be disabled.
+  *
+@@ -1549,7 +1517,6 @@ s32 e1000_disable_pcie_master(struct e1000_hw *hw)
+ {
+ 	u32 ctrl;
+ 	s32 timeout = MASTER_DISABLE_TIMEOUT;
+-	s32 ret_val = E1000_SUCCESS;
+ 
+ 	ctrl = er32(CTRL);
+ 	ctrl |= E1000_CTRL_GIO_MASTER_DISABLE;
+@@ -1565,12 +1532,10 @@ s32 e1000_disable_pcie_master(struct e1000_hw *hw)
+ 
+ 	if (!timeout) {
+ 		hw_dbg(hw, "Master requests are pending.\n");
+-		ret_val = -E1000_ERR_MASTER_REQUESTS_PENDING;
+-		goto out;
++		return -E1000_ERR_MASTER_REQUESTS_PENDING;
+ 	}
+ 
+-out:
+-	return ret_val;
++	return 0;
+ }
+ 
+ /**
+@@ -1748,7 +1713,6 @@ s32 e1000_poll_eerd_eewr_done(struct e1000_hw *hw, int ee_reg)
+ {
+ 	u32 attempts = 100000;
+ 	u32 i, reg = 0;
+-	s32 ret_val = -E1000_ERR_NVM;
+ 
+ 	for (i = 0; i < attempts; i++) {
+ 		if (ee_reg == E1000_NVM_POLL_READ)
+@@ -1756,15 +1720,13 @@ s32 e1000_poll_eerd_eewr_done(struct e1000_hw *hw, int ee_reg)
+ 		else
+ 			reg = er32(EEWR);
+ 
+-		if (reg & E1000_NVM_RW_REG_DONE) {
+-			ret_val = E1000_SUCCESS;
+-			break;
+-		}
++		if (reg & E1000_NVM_RW_REG_DONE)
++			return 0;
+ 
+ 		udelay(5);
+ 	}
+ 
+-	return ret_val;
++	return -E1000_ERR_NVM;
+ }
+ 
+ /**
+@@ -1779,7 +1741,6 @@ s32 e1000_acquire_nvm(struct e1000_hw *hw)
+ {
+ 	u32 eecd = er32(EECD);
+ 	s32 timeout = E1000_NVM_GRANT_ATTEMPTS;
+-	s32 ret_val = E1000_SUCCESS;
+ 
+ 	ew32(EECD, eecd | E1000_EECD_REQ);
+ 	eecd = er32(EECD);
+@@ -1796,10 +1757,10 @@ s32 e1000_acquire_nvm(struct e1000_hw *hw)
+ 		eecd &= ~E1000_EECD_REQ;
+ 		ew32(EECD, eecd);
+ 		hw_dbg(hw, "Could not acquire NVM grant\n");
+-		ret_val = -E1000_ERR_NVM;
++		return -E1000_ERR_NVM;
+ 	}
+ 
+-	return ret_val;
++	return 0;
+ }
+ 
+ /**
+@@ -1871,7 +1832,6 @@ static s32 e1000_ready_nvm_eeprom(struct e1000_hw *hw)
+ {
+ 	struct e1000_nvm_info *nvm = &hw->nvm;
+ 	u32 eecd = er32(EECD);
+-	s32 ret_val = E1000_SUCCESS;
+ 	u16 timeout = 0;
+ 	u8 spi_stat_reg;
+ 
+@@ -1900,13 +1860,11 @@ static s32 e1000_ready_nvm_eeprom(struct e1000_hw *hw)
+ 
+ 		if (!timeout) {
+ 			hw_dbg(hw, "SPI NVM Status error\n");
+-			ret_val = -E1000_ERR_NVM;
+-			goto out;
++			return -E1000_ERR_NVM;
+ 		}
+ 	}
+ 
+-out:
+-	return ret_val;
++	return 0;
+ }
+ 
+ /**
+@@ -1931,17 +1889,18 @@ s32 e1000_read_nvm_spi(struct e1000_hw *hw, u16 offset, u16 words, u16 *data)
+ 	if ((offset >= nvm->word_size) || (words > (nvm->word_size - offset)) ||
+ 	    (words == 0)) {
+ 		hw_dbg(hw, "nvm parameter(s) out of bounds\n");
+-		ret_val = -E1000_ERR_NVM;
+-		goto out;
++		return -E1000_ERR_NVM;
+ 	}
+ 
+ 	ret_val = nvm->ops.acquire_nvm(hw);
+ 	if (ret_val)
+-		goto out;
++		return ret_val;
+ 
+ 	ret_val = e1000_ready_nvm_eeprom(hw);
+-	if (ret_val)
+-		goto release;
++	if (ret_val) {
++		nvm->ops.release_nvm(hw);
++		return ret_val;
++	}
+ 
+ 	e1000_standby_nvm(hw);
+ 
+@@ -1960,11 +1919,8 @@ s32 e1000_read_nvm_spi(struct e1000_hw *hw, u16 offset, u16 words, u16 *data)
+ 		data[i] = (word_in >> 8) | (word_in << 8);
+ 	}
+ 
+-release:
+ 	nvm->ops.release_nvm(hw);
+-
+-out:
+-	return ret_val;
++	return 0;
+ }
+ 
+ /**
+@@ -1980,15 +1936,14 @@ s32 e1000_read_nvm_eerd(struct e1000_hw *hw, u16 offset, u16 words, u16 *data)
+ {
+ 	struct e1000_nvm_info *nvm = &hw->nvm;
+ 	u32 i, eerd = 0;
+-	s32 ret_val = E1000_SUCCESS;
++	s32 ret_val;
+ 
+ 	/* A check for invalid values:  offset too large, too many words,
+ 	 * and not enough words. */
+ 	if ((offset >= nvm->word_size) || (words > (nvm->word_size - offset)) ||
+ 	    (words == 0)) {
+ 		hw_dbg(hw, "nvm parameter(s) out of bounds\n");
+-		ret_val = -E1000_ERR_NVM;
+-		goto out;
++		return -E1000_ERR_NVM;
+ 	}
+ 
+ 	for (i = 0; i < words; i++) {
+@@ -2004,7 +1959,6 @@ s32 e1000_read_nvm_eerd(struct e1000_hw *hw, u16 offset, u16 words, u16 *data)
+ 			   E1000_NVM_RW_REG_DATA);
+ 	}
+ 
+-out:
+ 	return ret_val;
+ }
+ 
+@@ -2031,13 +1985,12 @@ s32 e1000_write_nvm_spi(struct e1000_hw *hw, u16 offset, u16 words, u16 *data)
+ 	if ((offset >= nvm->word_size) || (words > (nvm->word_size - offset)) ||
+ 	    (words == 0)) {
+ 		hw_dbg(hw, "nvm parameter(s) out of bounds\n");
+-		ret_val = -E1000_ERR_NVM;
+-		goto out;
++		return -E1000_ERR_NVM;
+ 	}
+ 
+ 	ret_val = nvm->ops.acquire_nvm(hw);
+ 	if (ret_val)
+-		goto out;
++		return ret_val;
+ 
+ 	msleep(10);
+ 
+@@ -2045,8 +1998,10 @@ s32 e1000_write_nvm_spi(struct e1000_hw *hw, u16 offset, u16 words, u16 *data)
+ 		u8 write_opcode = NVM_WRITE_OPCODE_SPI;
+ 
+ 		ret_val = e1000_ready_nvm_eeprom(hw);
+-		if (ret_val)
+-			goto release;
++		if (ret_val) {
++			nvm->ops.release_nvm(hw);
++			return ret_val;
++		}
+ 
+ 		e1000_standby_nvm(hw);
+ 
+@@ -2081,11 +2036,7 @@ s32 e1000_write_nvm_spi(struct e1000_hw *hw, u16 offset, u16 words, u16 *data)
+ 	}
+ 
+ 	msleep(10);
+-release:
+-	nvm->ops.release_nvm(hw);
+-
+-out:
+-	return ret_val;
++	return 0;
+ }
+ 
+ /**
+@@ -2098,7 +2049,7 @@ out:
+  **/
+ s32 e1000_read_mac_addr(struct e1000_hw *hw)
+ {
+-	s32  ret_val = E1000_SUCCESS;
++	s32 ret_val;
+ 	u16 offset, nvm_data, i;
+ 
+ 	for (i = 0; i < ETH_ALEN; i += 2) {
+@@ -2106,7 +2057,7 @@ s32 e1000_read_mac_addr(struct e1000_hw *hw)
+ 		ret_val = e1000_read_nvm(hw, offset, 1, &nvm_data);
+ 		if (ret_val) {
+ 			hw_dbg(hw, "NVM Read Error\n");
+-			goto out;
++			return ret_val;
+ 		}
+ 		hw->mac.perm_addr[i] = (u8)(nvm_data & 0xFF);
+ 		hw->mac.perm_addr[i+1] = (u8)(nvm_data >> 8);
+@@ -2119,8 +2070,7 @@ s32 e1000_read_mac_addr(struct e1000_hw *hw)
+ 	for (i = 0; i < ETH_ALEN; i++)
+ 		hw->mac.addr[i] = hw->mac.perm_addr[i];
+ 
+-out:
+-	return ret_val;
++	return 0;
+ }
+ 
+ /**
+@@ -2132,7 +2082,7 @@ out:
+  **/
+ s32 e1000_validate_nvm_checksum_generic(struct e1000_hw *hw)
+ {
+-	s32 ret_val = E1000_SUCCESS;
++	s32 ret_val;
+ 	u16 checksum = 0;
+ 	u16 i, nvm_data;
+ 
+@@ -2140,19 +2090,17 @@ s32 e1000_validate_nvm_checksum_generic(struct e1000_hw *hw)
+ 		ret_val = e1000_read_nvm(hw, i, 1, &nvm_data);
+ 		if (ret_val) {
+ 			hw_dbg(hw, "NVM Read Error\n");
+-			goto out;
++			return ret_val;
+ 		}
+ 		checksum += nvm_data;
+ 	}
+ 
+ 	if (checksum != (u16) NVM_SUM) {
+ 		hw_dbg(hw, "NVM Checksum Invalid\n");
+-		ret_val = -E1000_ERR_NVM;
+-		goto out;
++		return -E1000_ERR_NVM;
+ 	}
+ 
+-out:
+-	return ret_val;
++	return 0;
+ }
+ 
+ /**
+@@ -2165,7 +2113,7 @@ out:
+  **/
+ s32 e1000_update_nvm_checksum_generic(struct e1000_hw *hw)
+ {
+-	s32  ret_val;
++	s32 ret_val;
+ 	u16 checksum = 0;
+ 	u16 i, nvm_data;
+ 
+@@ -2173,17 +2121,15 @@ s32 e1000_update_nvm_checksum_generic(struct e1000_hw *hw)
+ 		ret_val = e1000_read_nvm(hw, i, 1, &nvm_data);
+ 		if (ret_val) {
+ 			hw_dbg(hw, "NVM Read Error while updating checksum.\n");
+-			goto out;
++			return ret_val;
+ 		}
+ 		checksum += nvm_data;
+ 	}
+ 	checksum = (u16) NVM_SUM - checksum;
+ 	ret_val = e1000_write_nvm(hw, NVM_CHECKSUM_REG, 1, &checksum);
+-	if (ret_val) {
++	if (ret_val)
+ 		hw_dbg(hw, "NVM Write Error while updating checksum.\n");
+-	}
+ 
+-out:
+ 	return ret_val;
+ }
+ 
+@@ -2240,15 +2186,13 @@ static u8 e1000_calculate_checksum(u8 *buffer, u32 length)
+ static s32 e1000_mng_enable_host_if(struct e1000_hw *hw)
+ {
+ 	u32 hicr;
+-	s32 ret_val = E1000_SUCCESS;
+-	u8  i;
++	u8 i;
+ 
+ 	/* Check that the host interface is enabled. */
+ 	hicr = er32(HICR);
+ 	if ((hicr & E1000_HICR_EN) == 0) {
+ 		hw_dbg(hw, "E1000_HOST_EN bit disabled.\n");
+-		ret_val = -E1000_ERR_HOST_INTERFACE_COMMAND;
+-		goto out;
++		return -E1000_ERR_HOST_INTERFACE_COMMAND;
+ 	}
+ 	/* check the previous command is completed */
+ 	for (i = 0; i < E1000_MNG_DHCP_COMMAND_TIMEOUT; i++) {
+@@ -2260,12 +2204,10 @@ static s32 e1000_mng_enable_host_if(struct e1000_hw *hw)
+ 
+ 	if (i == E1000_MNG_DHCP_COMMAND_TIMEOUT) {
+ 		hw_dbg(hw, "Previous command timeout failed .\n");
+-		ret_val = -E1000_ERR_HOST_INTERFACE_COMMAND;
+-		goto out;
++		return -E1000_ERR_HOST_INTERFACE_COMMAND;
+ 	}
+ 
+-out:
+-	return ret_val;
++	return 0;
+ }
+ 
+ /**
+@@ -2296,21 +2238,20 @@ bool e1000_enable_tx_pkt_filtering(struct e1000_hw *hw)
+ 	u32 offset;
+ 	s32 ret_val, hdr_csum, csum;
+ 	u8 i, len;
+-	bool tx_filter = 1;
+ 
+ 	/* No manageability, no filtering */
+ 	if (!e1000_check_mng_mode(hw)) {
+-		tx_filter = 0;
+-		goto out;
++		hw->mac.tx_pkt_filtering = 0;
++		return 0;
+ 	}
+ 
+ 	/* If we can't read from the host interface for whatever
+ 	 * reason, disable filtering.
+ 	 */
+ 	ret_val = e1000_mng_enable_host_if(hw);
+-	if (ret_val != E1000_SUCCESS) {
+-		tx_filter = 0;
+-		goto out;
++	if (ret_val != 0) {
++		hw->mac.tx_pkt_filtering = 0;
++		return ret_val;
+ 	}
+ 
+ 	/* Read in the header.  Length and offset are in dwords. */
+@@ -2326,18 +2267,19 @@ bool e1000_enable_tx_pkt_filtering(struct e1000_hw *hw)
+ 	 * the cookie area isn't considered valid, in which case we
+ 	 * take the safe route of assuming Tx filtering is enabled.
+ 	 */
+-	if (hdr_csum != csum)
+-		goto out;
+-	if (hdr->signature != E1000_IAMT_SIGNATURE)
+-		goto out;
++	if ((hdr_csum != csum) || (hdr->signature != E1000_IAMT_SIGNATURE)) {
++		hw->mac.tx_pkt_filtering = 1;
++		return 1;
++	}
+ 
+ 	/* Cookie area is valid, make the final check for filtering. */
+-	if (!(hdr->status & E1000_MNG_DHCP_COOKIE_STATUS_PARSING))
+-		tx_filter = 0;
++	if (!(hdr->status & E1000_MNG_DHCP_COOKIE_STATUS_PARSING)) {
++		hw->mac.tx_pkt_filtering = 0;
++		return 0;
++	}
+ 
+-out:
+-	hw->mac.tx_pkt_filtering = tx_filter;
+-	return tx_filter;
++	hw->mac.tx_pkt_filtering = 1;
++	return 1;
+ }
+ 
+ /**
+@@ -2364,7 +2306,7 @@ s32 e1000_mng_write_cmd_header(struct e1000_hw *hw,
+ 		e1e_flush();
+ 	}
+ 
+-	return E1000_SUCCESS;
++	return 0;
+ }
+ 
+ /**
+@@ -2385,15 +2327,12 @@ static s32 e1000_mng_host_if_write(struct e1000_hw *hw, u8 *buffer,
+ 	u8 *tmp;
+ 	u8 *bufptr = buffer;
+ 	u32 data = 0;
+-	s32 ret_val = E1000_SUCCESS;
+ 	u16 remaining, i, j, prev_bytes;
+ 
+ 	/* sum = only sum of the data and it is not checksum */
+ 
+-	if (length == 0 || offset + length > E1000_HI_MAX_MNG_DATA_LENGTH) {
+-		ret_val = -E1000_ERR_PARAM;
+-		goto out;
+-	}
++	if (length == 0 || offset + length > E1000_HI_MAX_MNG_DATA_LENGTH)
++		return -E1000_ERR_PARAM;
+ 
+ 	tmp = (u8 *)&data;
+ 	prev_bytes = offset & 0x3;
+@@ -2438,8 +2377,7 @@ static s32 e1000_mng_host_if_write(struct e1000_hw *hw, u8 *buffer,
+ 		E1000_WRITE_REG_ARRAY(hw, E1000_HOST_IF, offset + i, data);
+ 	}
+ 
+-out:
+-	return ret_val;
++	return 0;
+ }
+ 
+ /**
+@@ -2465,25 +2403,24 @@ s32 e1000_mng_write_dhcp_info(struct e1000_hw *hw, u8 *buffer, u16 length)
+ 	/* Enable the host interface */
+ 	ret_val = e1000_mng_enable_host_if(hw);
+ 	if (ret_val)
+-		goto out;
++		return ret_val;
+ 
+ 	/* Populate the host interface with the contents of "buffer". */
+ 	ret_val = e1000_mng_host_if_write(hw, buffer, length,
+ 					  sizeof(hdr), &(hdr.checksum));
+ 	if (ret_val)
+-		goto out;
++		return ret_val;
+ 
+ 	/* Write the manageability command header */
+ 	ret_val = e1000_mng_write_cmd_header(hw, &hdr);
+ 	if (ret_val)
+-		goto out;
++		return ret_val;
+ 
+ 	/* Tell the ARC a new command is pending. */
+ 	hicr = er32(HICR);
+ 	ew32(HICR, hicr | E1000_HICR_C);
+ 
+-out:
+-	return ret_val;
++	return 0;
+ }
+ 
+ /**
+@@ -2502,7 +2439,7 @@ bool e1000_enable_mng_pass_thru(struct e1000_hw *hw)
+ 
+ 	if (!(manc & E1000_MANC_RCV_TCO_EN) ||
+ 	    !(manc & E1000_MANC_EN_MAC_ADDR_FILTER))
+-		goto out;
++		return ret_val;
+ 
+ 	if (hw->mac.arc_subsystem_valid) {
+ 		fwsm = er32(FWSM);
+@@ -2512,17 +2449,16 @@ bool e1000_enable_mng_pass_thru(struct e1000_hw *hw)
+ 		    ((fwsm & E1000_FWSM_MODE_MASK) ==
+ 		     (e1000_mng_mode_pt << E1000_FWSM_MODE_SHIFT))) {
+ 			ret_val = 1;
+-			goto out;
++			return ret_val;
+ 		}
+ 	} else {
+ 		if ((manc & E1000_MANC_SMBUS_EN) &&
+ 		    !(manc & E1000_MANC_ASF_EN)) {
+ 			ret_val = 1;
+-			goto out;
++			return ret_val;
+ 		}
+ 	}
+ 
+-out:
+ 	return ret_val;
+ }
+ 
+diff --git a/drivers/net/e1000e/netdev.c b/drivers/net/e1000e/netdev.c
+index 2d0e78c..c8d50cc 100644
+--- a/drivers/net/e1000e/netdev.c
++++ b/drivers/net/e1000e/netdev.c
+@@ -2584,7 +2584,7 @@ static int e1000_open(struct net_device *netdev)
+ 	/* fire a link status change interrupt to start the watchdog */
+ 	ew32(ICS, E1000_ICS_LSC);
+ 
+-	return E1000_SUCCESS;
++	return 0;
+ 
+ err_req_irq:
+ 	e1000_release_hw_control(adapter);
+@@ -3667,7 +3667,7 @@ static int e1000_mii_ioctl(struct net_device *netdev, struct ifreq *ifr,
+ 	default:
+ 		return -EOPNOTSUPP;
+ 	}
+-	return E1000_SUCCESS;
++	return 0;
+ }
+ 
+ static int e1000_ioctl(struct net_device *netdev, struct ifreq *ifr, int cmd)
+diff --git a/drivers/net/e1000e/phy.c b/drivers/net/e1000e/phy.c
+index 6fd55e7..d7947b0 100644
+--- a/drivers/net/e1000e/phy.c
++++ b/drivers/net/e1000e/phy.c
+@@ -53,7 +53,7 @@ static const u16 e1000_igp_2_cable_length_table[] =
+  *  @hw: pointer to the HW structure
+  *
+  *  Read the PHY management control register and check whether a PHY reset
+- *  is blocked.  If a reset is not blocked return E1000_SUCCESS, otherwise
++ *  is blocked.  If a reset is not blocked return 0, otherwise
+  *  return E1000_BLK_PHY_RESET (12).
+  **/
+ s32 e1000_check_reset_block_generic(struct e1000_hw *hw)
+@@ -63,7 +63,7 @@ s32 e1000_check_reset_block_generic(struct e1000_hw *hw)
+ 	manc = er32(MANC);
+ 
+ 	return (manc & E1000_MANC_BLK_PHY_RST_ON_IDE) ?
+-	       E1000_BLK_PHY_RESET : E1000_SUCCESS;
++	       E1000_BLK_PHY_RESET : 0;
+ }
+ 
+ /**
+@@ -76,24 +76,23 @@ s32 e1000_check_reset_block_generic(struct e1000_hw *hw)
+ s32 e1000_get_phy_id(struct e1000_hw *hw)
+ {
+ 	struct e1000_phy_info *phy = &hw->phy;
+-	s32 ret_val = E1000_SUCCESS;
++	s32 ret_val;
+ 	u16 phy_id;
+ 
+ 	ret_val = e1e_rphy(hw, PHY_ID1, &phy_id);
+ 	if (ret_val)
+-		goto out;
++		return ret_val;
+ 
+ 	phy->id = (u32)(phy_id << 16);
+ 	udelay(20);
+ 	ret_val = e1e_rphy(hw, PHY_ID2, &phy_id);
+ 	if (ret_val)
+-		goto out;
++		return ret_val;
+ 
+ 	phy->id |= (u32)(phy_id & PHY_REVISION_MASK);
+ 	phy->revision = (u32)(phy_id & ~PHY_REVISION_MASK);
+ 
+-out:
+-	return ret_val;
++	return 0;
+ }
+ 
+ /**
+@@ -108,12 +107,9 @@ s32 e1000_phy_reset_dsp(struct e1000_hw *hw)
+ 
+ 	ret_val = e1e_wphy(hw, M88E1000_PHY_GEN_CONTROL, 0xC1);
+ 	if (ret_val)
+-		goto out;
++		return ret_val;
+ 
+-	ret_val = e1e_wphy(hw, M88E1000_PHY_GEN_CONTROL, 0);
+-
+-out:
+-	return ret_val;
++	return e1e_wphy(hw, M88E1000_PHY_GEN_CONTROL, 0);
+ }
+ 
+ /**
+@@ -129,12 +125,10 @@ static s32 e1000_read_phy_reg_mdic(struct e1000_hw *hw, u32 offset, u16 *data)
+ {
+ 	struct e1000_phy_info *phy = &hw->phy;
+ 	u32 i, mdic = 0;
+-	s32 ret_val = E1000_SUCCESS;
+ 
+ 	if (offset > MAX_PHY_REG_ADDRESS) {
+ 		hw_dbg(hw, "PHY Address %d is out of range\n", offset);
+-		ret_val = -E1000_ERR_PARAM;
+-		goto out;
++		return -E1000_ERR_PARAM;
+ 	}
+ 
+ 	/* Set up Op-code, Phy Address, and register offset in the MDI
+@@ -156,18 +150,15 @@ static s32 e1000_read_phy_reg_mdic(struct e1000_hw *hw, u32 offset, u16 *data)
+ 	}
+ 	if (!(mdic & E1000_MDIC_READY)) {
+ 		hw_dbg(hw, "MDI Read did not complete\n");
+-		ret_val = -E1000_ERR_PHY;
+-		goto out;
++		return -E1000_ERR_PHY;
+ 	}
+ 	if (mdic & E1000_MDIC_ERROR) {
+ 		hw_dbg(hw, "MDI Error\n");
+-		ret_val = -E1000_ERR_PHY;
+-		goto out;
++		return -E1000_ERR_PHY;
+ 	}
+ 	*data = (u16) mdic;
+ 
+-out:
+-	return ret_val;
++	return 0;
+ }
+ 
+ /**
+@@ -182,12 +173,10 @@ static s32 e1000_write_phy_reg_mdic(struct e1000_hw *hw, u32 offset, u16 data)
+ {
+ 	struct e1000_phy_info *phy = &hw->phy;
+ 	u32 i, mdic = 0;
+-	s32 ret_val = E1000_SUCCESS;
+ 
+ 	if (offset > MAX_PHY_REG_ADDRESS) {
+ 		hw_dbg(hw, "PHY Address %d is out of range\n", offset);
+-		ret_val = -E1000_ERR_PARAM;
+-		goto out;
++		return -E1000_ERR_PARAM;
+ 	}
+ 
+ 	/* Set up Op-code, Phy Address, and register offset in the MDI
+@@ -210,12 +199,10 @@ static s32 e1000_write_phy_reg_mdic(struct e1000_hw *hw, u32 offset, u16 data)
+ 	}
+ 	if (!(mdic & E1000_MDIC_READY)) {
+ 		hw_dbg(hw, "MDI Write did not complete\n");
+-		ret_val = -E1000_ERR_PHY;
+-		goto out;
++		return -E1000_ERR_PHY;
+ 	}
+ 
+-out:
+-	return ret_val;
++	return 0;
+ }
+ 
+ /**
+@@ -234,7 +221,7 @@ s32 e1000_read_phy_reg_m88(struct e1000_hw *hw, u32 offset, u16 *data)
+ 
+ 	ret_val = hw->phy.ops.acquire_phy(hw);
+ 	if (ret_val)
+-		goto out;
++		return ret_val;
+ 
+ 	ret_val = e1000_read_phy_reg_mdic(hw,
+ 					  MAX_PHY_REG_ADDRESS & offset,
+@@ -242,7 +229,6 @@ s32 e1000_read_phy_reg_m88(struct e1000_hw *hw, u32 offset, u16 *data)
+ 
+ 	hw->phy.ops.release_phy(hw);
+ 
+-out:
+ 	return ret_val;
+ }
+ 
+@@ -261,7 +247,7 @@ s32 e1000_write_phy_reg_m88(struct e1000_hw *hw, u32 offset, u16 data)
+ 
+ 	ret_val = hw->phy.ops.acquire_phy(hw);
+ 	if (ret_val)
+-		goto out;
++		return ret_val;
+ 
+ 	ret_val = e1000_write_phy_reg_mdic(hw,
+ 					   MAX_PHY_REG_ADDRESS & offset,
+@@ -269,7 +255,6 @@ s32 e1000_write_phy_reg_m88(struct e1000_hw *hw, u32 offset, u16 data)
+ 
+ 	hw->phy.ops.release_phy(hw);
+ 
+-out:
+ 	return ret_val;
+ }
+ 
+@@ -289,7 +274,7 @@ s32 e1000_read_phy_reg_igp(struct e1000_hw *hw, u32 offset, u16 *data)
+ 
+ 	ret_val = hw->phy.ops.acquire_phy(hw);
+ 	if (ret_val)
+-		goto out;
++		return ret_val;
+ 
+ 	if (offset > MAX_PHY_MULTI_PAGE_REG) {
+ 		ret_val = e1000_write_phy_reg_mdic(hw,
+@@ -297,7 +282,7 @@ s32 e1000_read_phy_reg_igp(struct e1000_hw *hw, u32 offset, u16 *data)
+ 						   (u16)offset);
+ 		if (ret_val) {
+ 			hw->phy.ops.release_phy(hw);
+-			goto out;
++			return ret_val;
+ 		}
+ 	}
+ 
+@@ -307,7 +292,6 @@ s32 e1000_read_phy_reg_igp(struct e1000_hw *hw, u32 offset, u16 *data)
+ 
+ 	hw->phy.ops.release_phy(hw);
+ 
+-out:
+ 	return ret_val;
+ }
+ 
+@@ -326,7 +310,7 @@ s32 e1000_write_phy_reg_igp(struct e1000_hw *hw, u32 offset, u16 data)
+ 
+ 	ret_val = hw->phy.ops.acquire_phy(hw);
+ 	if (ret_val)
+-		goto out;
++		return ret_val;
+ 
+ 	if (offset > MAX_PHY_MULTI_PAGE_REG) {
+ 		ret_val = e1000_write_phy_reg_mdic(hw,
+@@ -334,7 +318,7 @@ s32 e1000_write_phy_reg_igp(struct e1000_hw *hw, u32 offset, u16 data)
+ 						   (u16)offset);
+ 		if (ret_val) {
+ 			hw->phy.ops.release_phy(hw);
+-			goto out;
++			return ret_val;
+ 		}
+ 	}
+ 
+@@ -344,7 +328,6 @@ s32 e1000_write_phy_reg_igp(struct e1000_hw *hw, u32 offset, u16 data)
+ 
+ 	hw->phy.ops.release_phy(hw);
+ 
+-out:
+ 	return ret_val;
+ }
+ 
+@@ -365,7 +348,7 @@ s32 e1000_read_kmrn_reg(struct e1000_hw *hw, u32 offset, u16 *data)
+ 
+ 	ret_val = hw->phy.ops.acquire_phy(hw);
+ 	if (ret_val)
+-		goto out;
++		return ret_val;
+ 
+ 	kmrnctrlsta = ((offset << E1000_KMRNCTRLSTA_OFFSET_SHIFT) &
+ 		       E1000_KMRNCTRLSTA_OFFSET) | E1000_KMRNCTRLSTA_REN;
+@@ -378,7 +361,6 @@ s32 e1000_read_kmrn_reg(struct e1000_hw *hw, u32 offset, u16 *data)
+ 
+ 	hw->phy.ops.release_phy(hw);
+ 
+-out:
+ 	return ret_val;
+ }
+ 
+@@ -399,7 +381,7 @@ s32 e1000_write_kmrn_reg(struct e1000_hw *hw, u32 offset, u16 data)
+ 
+ 	ret_val = hw->phy.ops.acquire_phy(hw);
+ 	if (ret_val)
+-		goto out;
++		return ret_val;
+ 
+ 	kmrnctrlsta = ((offset << E1000_KMRNCTRLSTA_OFFSET_SHIFT) &
+ 		       E1000_KMRNCTRLSTA_OFFSET) | data;
+@@ -408,7 +390,6 @@ s32 e1000_write_kmrn_reg(struct e1000_hw *hw, u32 offset, u16 data)
+ 	udelay(2);
+ 	hw->phy.ops.release_phy(hw);
+ 
+-out:
+ 	return ret_val;
+ }
+ 
+@@ -428,7 +409,7 @@ s32 e1000_copper_link_setup_m88(struct e1000_hw *hw)
+ 	/* Enable CRS on TX. This must be set for half-duplex operation. */
+ 	ret_val = e1e_rphy(hw, M88E1000_PHY_SPEC_CTRL, &phy_data);
+ 	if (ret_val)
+-		goto out;
++		return ret_val;
+ 
+ 	phy_data |= M88E1000_PSCR_ASSERT_CRS_ON_TX;
+ 
+@@ -469,7 +450,7 @@ s32 e1000_copper_link_setup_m88(struct e1000_hw *hw)
+ 
+ 	ret_val = e1e_wphy(hw, M88E1000_PHY_SPEC_CTRL, phy_data);
+ 	if (ret_val)
+-		goto out;
++		return ret_val;
+ 
+ 	if (phy->revision < 4) {
+ 		/* Force TX_CLK in the Extended PHY Specific Control Register
+@@ -477,7 +458,7 @@ s32 e1000_copper_link_setup_m88(struct e1000_hw *hw)
+ 		 */
+ 		ret_val = e1e_rphy(hw, M88E1000_EXT_PHY_SPEC_CTRL, &phy_data);
+ 		if (ret_val)
+-			goto out;
++			return ret_val;
+ 
+ 		phy_data |= M88E1000_EPSCR_TX_CLK_25;
+ 
+@@ -495,17 +476,14 @@ s32 e1000_copper_link_setup_m88(struct e1000_hw *hw)
+ 		}
+ 		ret_val = e1e_wphy(hw, M88E1000_EXT_PHY_SPEC_CTRL, phy_data);
+ 		if (ret_val)
+-			goto out;
++			return ret_val;
+ 	}
+ 
+ 	/* Commit the changes. */
+ 	ret_val = e1000_commit_phy(hw);
+-	if (ret_val) {
++	if (ret_val)
+ 		hw_dbg(hw, "Error committing the PHY changes\n");
+-		goto out;
+-	}
+ 
+-out:
+ 	return ret_val;
+ }
+ 
+@@ -525,7 +503,7 @@ s32 e1000_copper_link_setup_igp(struct e1000_hw *hw)
+ 	ret_val = e1000_phy_hw_reset(hw);
+ 	if (ret_val) {
+ 		hw_dbg(hw, "Error resetting the PHY.\n");
+-		goto out;
++		return ret_val;
+ 	}
+ 
+ 	/* Wait 15ms for MAC to configure PHY from NVM settings. */
+@@ -535,12 +513,12 @@ s32 e1000_copper_link_setup_igp(struct e1000_hw *hw)
+ 	ret_val = e1000_set_d0_lplu_state(hw, 0);
+ 	if (ret_val) {
+ 		hw_dbg(hw, "Error Disabling LPLU D0\n");
+-		goto out;
++		return ret_val;
+ 	}
+ 	/* Configure mdi-mdix settings */
+ 	ret_val = e1e_rphy(hw, IGP01E1000_PHY_PORT_CTRL, &data);
+ 	if (ret_val)
+-		goto out;
++		return ret_val;
+ 
+ 	data &= ~IGP01E1000_PSCR_AUTO_MDIX;
+ 
+@@ -558,7 +536,7 @@ s32 e1000_copper_link_setup_igp(struct e1000_hw *hw)
+ 	}
+ 	ret_val = e1e_wphy(hw, IGP01E1000_PHY_PORT_CTRL, data);
+ 	if (ret_val)
+-		goto out;
++		return ret_val;
+ 
+ 	/* set auto-master slave resolution settings */
+ 	if (hw->mac.autoneg) {
+@@ -570,28 +548,28 @@ s32 e1000_copper_link_setup_igp(struct e1000_hw *hw)
+ 			ret_val = e1e_rphy(hw, IGP01E1000_PHY_PORT_CONFIG,
+ 						     &data);
+ 			if (ret_val)
+-				goto out;
++				return ret_val;
+ 
+ 			data &= ~IGP01E1000_PSCFR_SMART_SPEED;
+ 			ret_val = e1e_wphy(hw, IGP01E1000_PHY_PORT_CONFIG,
+ 						     data);
+ 			if (ret_val)
+-				goto out;
++				return ret_val;
+ 
+ 			/* Set auto Master/Slave resolution process */
+ 			ret_val = e1e_rphy(hw, PHY_1000T_CTRL, &data);
+ 			if (ret_val)
+-				goto out;
++				return ret_val;
+ 
+ 			data &= ~CR_1000T_MS_ENABLE;
+ 			ret_val = e1e_wphy(hw, PHY_1000T_CTRL, data);
+ 			if (ret_val)
+-				goto out;
++				return ret_val;
+ 		}
+ 
+ 		ret_val = e1e_rphy(hw, PHY_1000T_CTRL, &data);
+ 		if (ret_val)
+-			goto out;
++			return ret_val;
+ 
+ 		/* load defaults for future use */
+ 		phy->original_ms_type = (data & CR_1000T_MS_ENABLE) ?
+@@ -614,11 +592,8 @@ s32 e1000_copper_link_setup_igp(struct e1000_hw *hw)
+ 			break;
+ 		}
+ 		ret_val = e1e_wphy(hw, PHY_1000T_CTRL, data);
+-		if (ret_val)
+-			goto out;
+ 	}
+ 
+-out:
+ 	return ret_val;
+ }
+ 
+@@ -643,13 +618,13 @@ static s32 e1000_phy_setup_autoneg(struct e1000_hw *hw)
+ 	/* Read the MII Auto-Neg Advertisement Register (Address 4). */
+ 	ret_val = e1e_rphy(hw, PHY_AUTONEG_ADV, &mii_autoneg_adv_reg);
+ 	if (ret_val)
+-		goto out;
++		return ret_val;
+ 
+ 	if (phy->autoneg_mask & ADVERTISE_1000_FULL) {
+ 		/* Read the MII 1000Base-T Control Register (Address 9). */
+ 		ret_val = e1e_rphy(hw, PHY_1000T_CTRL, &mii_1000t_ctrl_reg);
+ 		if (ret_val)
+-			goto out;
++			return ret_val;
+ 	}
+ 
+ 	/* Need to parse both autoneg_advertised and fc and set up
+@@ -757,22 +732,19 @@ static s32 e1000_phy_setup_autoneg(struct e1000_hw *hw)
+ 	default:
+ 		hw_dbg(hw, "Flow control param set incorrectly\n");
+ 		ret_val = -E1000_ERR_CONFIG;
+-		goto out;
++		return ret_val;
+ 	}
+ 
+ 	ret_val = e1e_wphy(hw, PHY_AUTONEG_ADV, mii_autoneg_adv_reg);
+ 	if (ret_val)
+-		goto out;
++		return ret_val;
+ 
+ 	hw_dbg(hw, "Auto-Neg Advertising %x\n", mii_autoneg_adv_reg);
+ 
+ 	if (phy->autoneg_mask & ADVERTISE_1000_FULL) {
+ 		ret_val = e1e_wphy(hw, PHY_1000T_CTRL, mii_1000t_ctrl_reg);
+-		if (ret_val)
+-			goto out;
+ 	}
+ 
+-out:
+ 	return ret_val;
+ }
+ 
+@@ -806,7 +778,7 @@ static s32 e1000_copper_link_autoneg(struct e1000_hw *hw)
+ 	ret_val = e1000_phy_setup_autoneg(hw);
+ 	if (ret_val) {
+ 		hw_dbg(hw, "Error Setting up Auto-Negotiation\n");
+-		goto out;
++		return ret_val;
+ 	}
+ 	hw_dbg(hw, "Restarting Auto-Neg\n");
+ 
+@@ -815,12 +787,12 @@ static s32 e1000_copper_link_autoneg(struct e1000_hw *hw)
+ 	 */
+ 	ret_val = e1e_rphy(hw, PHY_CONTROL, &phy_ctrl);
+ 	if (ret_val)
+-		goto out;
++		return ret_val;
+ 
+ 	phy_ctrl |= (MII_CR_AUTO_NEG_EN | MII_CR_RESTART_AUTO_NEG);
+ 	ret_val = e1e_wphy(hw, PHY_CONTROL, phy_ctrl);
+ 	if (ret_val)
+-		goto out;
++		return ret_val;
+ 
+ 	/* Does the user want to wait for Auto-Neg to complete here, or
+ 	 * check at a later time (for example, callback routine).
+@@ -830,13 +802,12 @@ static s32 e1000_copper_link_autoneg(struct e1000_hw *hw)
+ 		if (ret_val) {
+ 			hw_dbg(hw, "Error while waiting for "
+ 				 "autoneg to complete\n");
+-			goto out;
++			return ret_val;
+ 		}
+ 	}
+ 
+ 	hw->mac.get_link_status = 1;
+ 
+-out:
+ 	return ret_val;
+ }
+ 
+@@ -859,7 +830,7 @@ s32 e1000_setup_copper_link(struct e1000_hw *hw)
+ 		 * autonegotiation. */
+ 		ret_val = e1000_copper_link_autoneg(hw);
+ 		if (ret_val)
+-			goto out;
++			return ret_val;
+ 	} else {
+ 		/* PHY will be set to 10H, 10F, 100H or 100F
+ 		 * depending on user settings. */
+@@ -867,7 +838,7 @@ s32 e1000_setup_copper_link(struct e1000_hw *hw)
+ 		ret_val = e1000_phy_force_speed_duplex(hw);
+ 		if (ret_val) {
+ 			hw_dbg(hw, "Error Forcing Speed and Duplex\n");
+-			goto out;
++			return ret_val;
+ 		}
+ 	}
+ 
+@@ -879,7 +850,7 @@ s32 e1000_setup_copper_link(struct e1000_hw *hw)
+ 					     10,
+ 					     &link);
+ 	if (ret_val)
+-		goto out;
++		return ret_val;
+ 
+ 	if (link) {
+ 		hw_dbg(hw, "Valid link established!!!\n");
+@@ -889,7 +860,6 @@ s32 e1000_setup_copper_link(struct e1000_hw *hw)
+ 		hw_dbg(hw, "Unable to establish link!!!\n");
+ 	}
+ 
+-out:
+ 	return ret_val;
+ }
+ 
+@@ -910,27 +880,27 @@ s32 e1000_phy_force_speed_duplex_igp(struct e1000_hw *hw)
+ 
+ 	ret_val = e1e_rphy(hw, PHY_CONTROL, &phy_data);
+ 	if (ret_val)
+-		goto out;
++		return ret_val;
+ 
+ 	e1000_phy_force_speed_duplex_setup(hw, &phy_data);
+ 
+ 	ret_val = e1e_wphy(hw, PHY_CONTROL, phy_data);
+ 	if (ret_val)
+-		goto out;
++		return ret_val;
+ 
+ 	/* Clear Auto-Crossover to force MDI manually.  IGP requires MDI
+ 	 * forced whenever speed and duplex are forced.
+ 	 */
+ 	ret_val = e1e_rphy(hw, IGP01E1000_PHY_PORT_CTRL, &phy_data);
+ 	if (ret_val)
+-		goto out;
++		return ret_val;
+ 
+ 	phy_data &= ~IGP01E1000_PSCR_AUTO_MDIX;
+ 	phy_data &= ~IGP01E1000_PSCR_FORCE_MDI_MDIX;
+ 
+ 	ret_val = e1e_wphy(hw, IGP01E1000_PHY_PORT_CTRL, phy_data);
+ 	if (ret_val)
+-		goto out;
++		return ret_val;
+ 
+ 	hw_dbg(hw, "IGP PSCR: %X\n", phy_data);
+ 
+@@ -944,7 +914,7 @@ s32 e1000_phy_force_speed_duplex_igp(struct e1000_hw *hw)
+ 						     100000,
+ 						     &link);
+ 		if (ret_val)
+-			goto out;
++			return ret_val;
+ 
+ 		if (!link)
+ 			hw_dbg(hw, "Link taking longer than expected.\n");
+@@ -955,10 +925,9 @@ s32 e1000_phy_force_speed_duplex_igp(struct e1000_hw *hw)
+ 						     100000,
+ 						     &link);
+ 		if (ret_val)
+-			goto out;
++			return ret_val;
+ 	}
+ 
+-out:
+ 	return ret_val;
+ }
+ 
+@@ -984,18 +953,18 @@ s32 e1000_phy_force_speed_duplex_m88(struct e1000_hw *hw)
+ 	 */
+ 	ret_val = e1e_rphy(hw, M88E1000_PHY_SPEC_CTRL, &phy_data);
+ 	if (ret_val)
+-		goto out;
++		return ret_val;
+ 
+ 	phy_data &= ~M88E1000_PSCR_AUTO_X_MODE;
+ 	ret_val = e1e_wphy(hw, M88E1000_PHY_SPEC_CTRL, phy_data);
+ 	if (ret_val)
+-		goto out;
++		return ret_val;
+ 
+ 	hw_dbg(hw, "M88E1000 PSCR: %X\n", phy_data);
+ 
+ 	ret_val = e1e_rphy(hw, PHY_CONTROL, &phy_data);
+ 	if (ret_val)
+-		goto out;
++		return ret_val;
+ 
+ 	e1000_phy_force_speed_duplex_setup(hw, &phy_data);
+ 
+@@ -1004,7 +973,7 @@ s32 e1000_phy_force_speed_duplex_m88(struct e1000_hw *hw)
+ 
+ 	ret_val = e1e_wphy(hw, PHY_CONTROL, phy_data);
+ 	if (ret_val)
+-		goto out;
++		return ret_val;
+ 
+ 	udelay(1);
+ 
+@@ -1014,7 +983,7 @@ s32 e1000_phy_force_speed_duplex_m88(struct e1000_hw *hw)
+ 		ret_val = e1000_phy_has_link_generic(hw, PHY_FORCE_LIMIT,
+ 						     100000, &link);
+ 		if (ret_val)
+-			goto out;
++			return ret_val;
+ 
+ 		if (!link) {
+ 			/* We didn't get link.
+@@ -1022,22 +991,22 @@ s32 e1000_phy_force_speed_duplex_m88(struct e1000_hw *hw)
+ 			 */
+ 			ret_val = e1e_wphy(hw, M88E1000_PHY_PAGE_SELECT, 0x001d);
+ 			if (ret_val)
+-				goto out;
++				return ret_val;
+ 			ret_val = e1000_phy_reset_dsp(hw);
+ 			if (ret_val)
+-				goto out;
++				return ret_val;
+ 		}
+ 
+ 		/* Try once more */
+ 		ret_val = e1000_phy_has_link_generic(hw, PHY_FORCE_LIMIT,
+ 						     100000, &link);
+ 		if (ret_val)
+-			goto out;
++			return ret_val;
+ 	}
+ 
+ 	ret_val = e1e_rphy(hw, M88E1000_EXT_PHY_SPEC_CTRL, &phy_data);
+ 	if (ret_val)
+-		goto out;
++		return ret_val;
+ 
+ 	/* Resetting the phy means we need to re-force TX_CLK in the
+ 	 * Extended PHY Specific Control Register to 25MHz clock from
+@@ -1046,19 +1015,18 @@ s32 e1000_phy_force_speed_duplex_m88(struct e1000_hw *hw)
+ 	phy_data |= M88E1000_EPSCR_TX_CLK_25;
+ 	ret_val = e1e_wphy(hw, M88E1000_EXT_PHY_SPEC_CTRL, phy_data);
+ 	if (ret_val)
+-		goto out;
++		return ret_val;
+ 
+ 	/* In addition, we must re-enable CRS on Tx for both half and full
+ 	 * duplex.
+ 	 */
+ 	ret_val = e1e_rphy(hw, M88E1000_PHY_SPEC_CTRL, &phy_data);
+ 	if (ret_val)
+-		goto out;
++		return ret_val;
+ 
+ 	phy_data |= M88E1000_PSCR_ASSERT_CRS_ON_TX;
+ 	ret_val = e1e_wphy(hw, M88E1000_PHY_SPEC_CTRL, phy_data);
+ 
+-out:
+ 	return ret_val;
+ }
+ 
+@@ -1144,7 +1112,7 @@ s32 e1000_set_d3_lplu_state(struct e1000_hw *hw, bool active)
+ 
+ 	ret_val = e1e_rphy(hw, IGP02E1000_PHY_POWER_MGMT, &data);
+ 	if (ret_val)
+-		goto out;
++		return ret_val;
+ 
+ 	if (!active) {
+ 		data &= ~IGP02E1000_PM_D3_LPLU;
+@@ -1152,7 +1120,7 @@ s32 e1000_set_d3_lplu_state(struct e1000_hw *hw, bool active)
+ 					     IGP02E1000_PHY_POWER_MGMT,
+ 					     data);
+ 		if (ret_val)
+-			goto out;
++			return ret_val;
+ 		/* LPLU and SmartSpeed are mutually exclusive.  LPLU is used
+ 		 * during Dx states where the power conservation is most
+ 		 * important.  During driver activity we should enable
+@@ -1161,24 +1129,24 @@ s32 e1000_set_d3_lplu_state(struct e1000_hw *hw, bool active)
+ 			ret_val = e1e_rphy(hw, IGP01E1000_PHY_PORT_CONFIG,
+ 						    &data);
+ 			if (ret_val)
+-				goto out;
++				return ret_val;
+ 
+ 			data |= IGP01E1000_PSCFR_SMART_SPEED;
+ 			ret_val = e1e_wphy(hw, IGP01E1000_PHY_PORT_CONFIG,
+ 						     data);
+ 			if (ret_val)
+-				goto out;
++				return ret_val;
+ 		} else if (phy->smart_speed == e1000_smart_speed_off) {
+ 			ret_val = e1e_rphy(hw, IGP01E1000_PHY_PORT_CONFIG,
+ 						     &data);
+ 			if (ret_val)
+-				goto out;
++				return ret_val;
+ 
+ 			data &= ~IGP01E1000_PSCFR_SMART_SPEED;
+ 			ret_val = e1e_wphy(hw, IGP01E1000_PHY_PORT_CONFIG,
+ 						     data);
+ 			if (ret_val)
+-				goto out;
++				return ret_val;
+ 		}
+ 	} else if ((phy->autoneg_advertised == E1000_ALL_SPEED_DUPLEX) ||
+ 		   (phy->autoneg_advertised == E1000_ALL_NOT_GIG) ||
+@@ -1186,18 +1154,17 @@ s32 e1000_set_d3_lplu_state(struct e1000_hw *hw, bool active)
+ 		data |= IGP02E1000_PM_D3_LPLU;
+ 		ret_val = e1e_wphy(hw, IGP02E1000_PHY_POWER_MGMT, data);
+ 		if (ret_val)
+-			goto out;
++			return ret_val;
+ 
+ 		/* When LPLU is enabled, we should disable SmartSpeed */
+ 		ret_val = e1e_rphy(hw, IGP01E1000_PHY_PORT_CONFIG, &data);
+ 		if (ret_val)
+-			goto out;
++			return ret_val;
+ 
+ 		data &= ~IGP01E1000_PSCFR_SMART_SPEED;
+ 		ret_val = e1e_wphy(hw, IGP01E1000_PHY_PORT_CONFIG, data);
+ 	}
+ 
+-out:
+ 	return ret_val;
+ }
+ 
+@@ -1229,8 +1196,7 @@ s32 e1000_check_downshift(struct e1000_hw *hw)
+ 	default:
+ 		/* speed downshift not supported */
+ 		phy->speed_downgraded = 0;
+-		ret_val = E1000_SUCCESS;
+-		goto out;
++		return 0;
+ 	}
+ 
+ 	ret_val = e1e_rphy(hw, offset, &phy_data);
+@@ -1238,7 +1204,6 @@ s32 e1000_check_downshift(struct e1000_hw *hw)
+ 	if (!ret_val)
+ 		phy->speed_downgraded = (phy_data & mask);
+ 
+-out:
+ 	return ret_val;
+ }
+ 
+@@ -1275,7 +1240,7 @@ static s32 e1000_check_polarity_m88(struct e1000_hw *hw)
+  *  Polarity is determined based on the PHY port status register, and the
+  *  current speed (since there is no polarity at 100Mbps).
+  **/
+-static  s32 e1000_check_polarity_igp(struct e1000_hw *hw)
++static s32 e1000_check_polarity_igp(struct e1000_hw *hw)
+ {
+ 	struct e1000_phy_info *phy = &hw->phy;
+ 	s32 ret_val;
+@@ -1285,7 +1250,7 @@ static  s32 e1000_check_polarity_igp(struct e1000_hw *hw)
+ 	 * our connection. */
+ 	ret_val = e1e_rphy(hw, IGP01E1000_PHY_PORT_STATUS, &data);
+ 	if (ret_val)
+-		goto out;
++		return ret_val;
+ 
+ 	if ((data & IGP01E1000_PSSR_SPEED_MASK) ==
+ 	    IGP01E1000_PSSR_SPEED_1000MBPS) {
+@@ -1306,7 +1271,6 @@ static  s32 e1000_check_polarity_igp(struct e1000_hw *hw)
+ 				      ? e1000_rev_polarity_reversed
+ 				      : e1000_rev_polarity_normal;
+ 
+-out:
+ 	return ret_val;
+ }
+ 
+@@ -1319,7 +1283,7 @@ out:
+  **/
+ s32 e1000_wait_autoneg(struct e1000_hw *hw)
+ {
+-	s32 ret_val = E1000_SUCCESS;
++	s32 ret_val = 0;
+ 	u16 i, phy_status;
+ 
+ 	/* Break after autoneg completes or PHY_AUTO_NEG_LIMIT expires. */
+@@ -1353,7 +1317,7 @@ s32 e1000_wait_autoneg(struct e1000_hw *hw)
+ s32 e1000_phy_has_link_generic(struct e1000_hw *hw, u32 iterations,
+ 			       u32 usec_interval, bool *success)
+ {
+-	s32 ret_val = E1000_SUCCESS;
++	s32 ret_val;
+ 	u16 i, phy_status;
+ 
+ 	for (i = 0; i < iterations; i++) {
+@@ -1403,7 +1367,7 @@ s32 e1000_get_cable_length_m88(struct e1000_hw *hw)
+ 
+ 	ret_val = e1e_rphy(hw, M88E1000_PHY_SPEC_STATUS, &phy_data);
+ 	if (ret_val)
+-		goto out;
++		return ret_val;
+ 
+ 	index = (phy_data & M88E1000_PSSR_CABLE_LENGTH) >>
+ 		M88E1000_PSSR_CABLE_LENGTH_SHIFT;
+@@ -1412,7 +1376,6 @@ s32 e1000_get_cable_length_m88(struct e1000_hw *hw)
+ 
+ 	phy->cable_length = (phy->min_cable_length + phy->max_cable_length) / 2;
+ 
+-out:
+ 	return ret_val;
+ }
+ 
+@@ -1444,7 +1407,7 @@ s32 e1000_get_cable_length_igp_2(struct e1000_hw *hw)
+ 	for (i = 0; i < IGP02E1000_PHY_CHANNEL_NUM; i++) {
+ 		ret_val = e1e_rphy(hw, agc_reg_array[i], &phy_data);
+ 		if (ret_val)
+-			goto out;
++			return ret_val;
+ 
+ 		/* Getting bits 15:9, which represent the combination of
+ 		 * course and fine gain values.  The result is a number
+@@ -1455,10 +1418,8 @@ s32 e1000_get_cable_length_igp_2(struct e1000_hw *hw)
+ 
+ 		/* Array index bound check. */
+ 		if ((cur_agc_index >= IGP02E1000_CABLE_LENGTH_TABLE_SIZE) ||
+-		    (cur_agc_index == 0)) {
+-			ret_val = -E1000_ERR_PHY;
+-			goto out;
+-		}
++		    (cur_agc_index == 0))
++			return -E1000_ERR_PHY;
+ 
+ 		/* Remove min & max AGC values from calculation. */
+ 		if (e1000_igp_2_cable_length_table[min_agc_index] >
+@@ -1482,7 +1443,6 @@ s32 e1000_get_cable_length_igp_2(struct e1000_hw *hw)
+ 
+ 	phy->cable_length = (phy->min_cable_length + phy->max_cable_length) / 2;
+ 
+-out:
+ 	return ret_val;
+ }
+ 
+@@ -1505,45 +1465,43 @@ s32 e1000_get_phy_info_m88(struct e1000_hw *hw)
+ 
+ 	if (hw->media_type != e1000_media_type_copper) {
+ 		hw_dbg(hw, "Phy info is only valid for copper media\n");
+-		ret_val = -E1000_ERR_CONFIG;
+-		goto out;
++		return -E1000_ERR_CONFIG;
+ 	}
+ 
+ 	ret_val = e1000_phy_has_link_generic(hw, 1, 0, &link);
+ 	if (ret_val)
+-		goto out;
++		return ret_val;
+ 
+ 	if (!link) {
+ 		hw_dbg(hw, "Phy info is only valid if link is up\n");
+-		ret_val = -E1000_ERR_CONFIG;
+-		goto out;
++		return -E1000_ERR_CONFIG;
+ 	}
+ 
+ 	ret_val = e1e_rphy(hw, M88E1000_PHY_SPEC_CTRL, &phy_data);
+ 	if (ret_val)
+-		goto out;
++		return ret_val;
+ 
+ 	phy->polarity_correction = (phy_data &
+ 				    M88E1000_PSCR_POLARITY_REVERSAL);
+ 
+ 	ret_val = e1000_check_polarity_m88(hw);
+ 	if (ret_val)
+-		goto out;
++		return ret_val;
+ 
+ 	ret_val = e1e_rphy(hw, M88E1000_PHY_SPEC_STATUS, &phy_data);
+ 	if (ret_val)
+-		goto out;
++		return ret_val;
+ 
+ 	phy->is_mdix = (phy_data & M88E1000_PSSR_MDIX);
+ 
+ 	if ((phy_data & M88E1000_PSSR_SPEED) == M88E1000_PSSR_1000MBS) {
+ 		ret_val = e1000_get_cable_length(hw);
+ 		if (ret_val)
+-			goto out;
++			return ret_val;
+ 
+ 		ret_val = e1e_rphy(hw, PHY_1000T_STATUS, &phy_data);
+ 		if (ret_val)
+-			goto out;
++			return ret_val;
+ 
+ 		phy->local_rx = (phy_data & SR_1000T_LOCAL_RX_STATUS)
+ 				? e1000_1000t_rx_status_ok
+@@ -1559,7 +1517,6 @@ s32 e1000_get_phy_info_m88(struct e1000_hw *hw)
+ 		phy->remote_rx = e1000_1000t_rx_status_undefined;
+ 	}
+ 
+-out:
+ 	return ret_val;
+ }
+ 
+@@ -1581,23 +1538,22 @@ s32 e1000_get_phy_info_igp(struct e1000_hw *hw)
+ 
+ 	ret_val = e1000_phy_has_link_generic(hw, 1, 0, &link);
+ 	if (ret_val)
+-		goto out;
++		return ret_val;
+ 
+ 	if (!link) {
+ 		hw_dbg(hw, "Phy info is only valid if link is up\n");
+-		ret_val = -E1000_ERR_CONFIG;
+-		goto out;
++		return -E1000_ERR_CONFIG;
+ 	}
+ 
+ 	phy->polarity_correction = 1;
+ 
+ 	ret_val = e1000_check_polarity_igp(hw);
+ 	if (ret_val)
+-		goto out;
++		return ret_val;
+ 
+ 	ret_val = e1e_rphy(hw, IGP01E1000_PHY_PORT_STATUS, &data);
+ 	if (ret_val)
+-		goto out;
++		return ret_val;
+ 
+ 	phy->is_mdix = (data & IGP01E1000_PSSR_MDIX);
+ 
+@@ -1605,11 +1561,11 @@ s32 e1000_get_phy_info_igp(struct e1000_hw *hw)
+ 	    IGP01E1000_PSSR_SPEED_1000MBPS) {
+ 		ret_val = e1000_get_cable_length(hw);
+ 		if (ret_val)
+-			goto out;
++			return ret_val;
+ 
+ 		ret_val = e1e_rphy(hw, PHY_1000T_STATUS, &data);
+ 		if (ret_val)
+-			goto out;
++			return ret_val;
+ 
+ 		phy->local_rx = (data & SR_1000T_LOCAL_RX_STATUS)
+ 				? e1000_1000t_rx_status_ok
+@@ -1624,7 +1580,6 @@ s32 e1000_get_phy_info_igp(struct e1000_hw *hw)
+ 		phy->remote_rx = e1000_1000t_rx_status_undefined;
+ 	}
+ 
+-out:
+ 	return ret_val;
+ }
+ 
+@@ -1642,16 +1597,15 @@ s32 e1000_phy_sw_reset(struct e1000_hw *hw)
+ 
+ 	ret_val = e1e_rphy(hw, PHY_CONTROL, &phy_ctrl);
+ 	if (ret_val)
+-		goto out;
++		return ret_val;
+ 
+ 	phy_ctrl |= MII_CR_RESET;
+ 	ret_val = e1e_wphy(hw, PHY_CONTROL, phy_ctrl);
+ 	if (ret_val)
+-		goto out;
++		return ret_val;
+ 
+ 	udelay(1);
+ 
+-out:
+ 	return ret_val;
+ }
+ 
+@@ -1667,18 +1621,16 @@ out:
+ s32 e1000_phy_hw_reset_generic(struct e1000_hw *hw)
+ {
+ 	struct e1000_phy_info *phy = &hw->phy;
+-	s32  ret_val;
++	s32 ret_val;
+ 	u32 ctrl;
+ 
+ 	ret_val = e1000_check_reset_block(hw);
+-	if (ret_val) {
+-		ret_val = E1000_SUCCESS;
+-		goto out;
+-	}
++	if (ret_val)
++		return 0;
+ 
+ 	ret_val = phy->ops.acquire_phy(hw);
+ 	if (ret_val)
+-		goto out;
++		return ret_val;
+ 
+ 	ctrl = er32(CTRL);
+ 	ew32(CTRL, ctrl | E1000_CTRL_PHY_RST);
+@@ -1693,10 +1645,7 @@ s32 e1000_phy_hw_reset_generic(struct e1000_hw *hw)
+ 
+ 	phy->ops.release_phy(hw);
+ 
+-	ret_val = e1000_get_phy_cfg_done(hw);
+-
+-out:
+-	return ret_val;
++	return e1000_get_phy_cfg_done(hw);
+ }
+ 
+ /**
+@@ -1709,8 +1658,7 @@ out:
+ s32 e1000_get_cfg_done(struct e1000_hw *hw)
+ {
+ 	mdelay(10);
+-
+-	return E1000_SUCCESS;
++	return 0;
+ }
+ 
+ /* Internal function pointers */
+@@ -1726,8 +1674,8 @@ static s32 e1000_get_phy_cfg_done(struct e1000_hw *hw)
+ {
+ 	if (hw->phy.ops.get_cfg_done)
+ 		return hw->phy.ops.get_cfg_done(hw);
+-	else
+-		return E1000_SUCCESS;
++
++	return 0;
+ }
+ 
+ /**
+@@ -1735,14 +1683,14 @@ static s32 e1000_get_phy_cfg_done(struct e1000_hw *hw)
+  *  @hw: pointer to the HW structure
+  *
+  *  When the silicon family has not implemented a forced speed/duplex
+- *  function for the PHY, simply return E1000_SUCCESS.
++ *  function for the PHY, simply return 0.
+  **/
+ static s32 e1000_phy_force_speed_duplex(struct e1000_hw *hw)
+ {
+ 	if (hw->phy.ops.force_speed_duplex)
+ 		return hw->phy.ops.force_speed_duplex(hw);
+-	else
+-		return E1000_SUCCESS;
++
++	return 0;
+ }
+ 
+ /**
+@@ -1794,8 +1742,8 @@ s32 e1000_commit_phy(struct e1000_hw *hw)
+ {
+ 	if (hw->phy.ops.commit_phy)
+ 		return hw->phy.ops.commit_phy(hw);
+-	else
+-		return E1000_SUCCESS;
++
++	return 0;
+ }
+ 
+ /**
+@@ -1816,6 +1764,6 @@ s32 e1000_set_d0_lplu_state(struct e1000_hw *hw, bool active)
+ {
+ 	if (hw->phy.ops.set_d0_lplu_state)
+ 		return hw->phy.ops.set_d0_lplu_state(hw, active);
+-	else
+-		return E1000_SUCCESS;
++
++	return 0;
+ }
+-
+To unsubscribe from this list: send the line "unsubscribe netdev" in
+the body of a message to majordomo at vger.kernel.org
+More majordomo info at  http://vger.kernel.org/majordomo-info.html
+
+Return-Path: <netdev-owner at vger.kernel.org>
+From: Auke Kok <auke-jan.h.kok at intel.com>
+Subject: [PATCH] e1000e: Make a few functions static
+To: jeff at garzik.org
+Cc: netdev at vger.kernel.org, john.ronciak at intel.com
+Date:	Wed, 08 Aug 2007 10:22:11 -0700
+Message-ID: <20070808172211.12242.44053.stgit at localhost.localdomain>
+User-Agent: StGIT/0.12.1
+
+After moving code around we can reduce namespace usage
+by making a few functions static.
+
+Signed-off-by: Auke Kok <auke-jan.h.kok at intel.com>
+---
+
+ drivers/net/e1000e/e1000.h  |    2 --
+ drivers/net/e1000e/lib.c    |    2 +-
+ drivers/net/e1000e/netdev.c |    2 +-
+ drivers/net/e1000e/phy.c    |   10 ++++++----
+ 4 files changed, 8 insertions(+), 8 deletions(-)
+
+diff --git a/drivers/net/e1000e/e1000.h b/drivers/net/e1000e/e1000.h
+index 65c31d3..a1394d6 100644
+--- a/drivers/net/e1000e/e1000.h
++++ b/drivers/net/e1000e/e1000.h
+@@ -365,7 +365,6 @@ extern struct e1000_info e1000_ich9_info;
+ extern struct e1000_info e1000_es2_info;
+ 
+ extern s32  e1000_commit_phy(struct e1000_hw *hw);
+-extern s32  e1000_set_d0_lplu_state(struct e1000_hw *hw, bool active);
+ 
+ extern bool e1000_enable_mng_pass_thru(struct e1000_hw *hw);
+ 
+@@ -438,7 +437,6 @@ extern s32 e1000_phy_has_link_generic(struct e1000_hw *hw, u32 iterations,
+ 			       u32 usec_interval, bool *success);
+ extern s32 e1000_phy_reset_dsp(struct e1000_hw *hw);
+ extern s32 e1000_check_downshift(struct e1000_hw *hw);
+-extern s32 e1000_wait_autoneg(struct e1000_hw *hw);
+ 
+ static inline s32 e1000_phy_hw_reset(struct e1000_hw *hw)
+ {
+diff --git a/drivers/net/e1000e/lib.c b/drivers/net/e1000e/lib.c
+index d11b518..3bbe63e 100644
+--- a/drivers/net/e1000e/lib.c
++++ b/drivers/net/e1000e/lib.c
+@@ -2289,7 +2289,7 @@ bool e1000_enable_tx_pkt_filtering(struct e1000_hw *hw)
+  *
+  *  Writes the command header after does the checksum calculation.
+  **/
+-s32 e1000_mng_write_cmd_header(struct e1000_hw *hw,
++static s32 e1000_mng_write_cmd_header(struct e1000_hw *hw,
+ 				  struct e1000_host_mng_command_header *hdr)
+ {
+ 	u16 i, length = sizeof(struct e1000_host_mng_command_header);
+diff --git a/drivers/net/e1000e/netdev.c b/drivers/net/e1000e/netdev.c
+index c8d50cc..dd4eca6 100644
+--- a/drivers/net/e1000e/netdev.c
++++ b/drivers/net/e1000e/netdev.c
+@@ -48,7 +48,7 @@
+ char e1000_driver_name[] = "e1000e";
+ const char e1000_driver_version[] = DRV_VERSION;
+ 
+-const struct e1000_info * e1000_info_tbl[] = {
++static const struct e1000_info *e1000_info_tbl[] = {
+ 	[board_82571]		= &e1000_82571_info,
+ 	[board_82572]		= &e1000_82572_info,
+ 	[board_82573]		= &e1000_82573_info,
+diff --git a/drivers/net/e1000e/phy.c b/drivers/net/e1000e/phy.c
+index d7947b0..1ccbad7 100644
+--- a/drivers/net/e1000e/phy.c
++++ b/drivers/net/e1000e/phy.c
+@@ -28,8 +28,10 @@
+ 
+ #include "e1000.h"
+ 
+-static s32  e1000_get_phy_cfg_done(struct e1000_hw *hw);
+-static s32  e1000_phy_force_speed_duplex(struct e1000_hw *hw);
++static s32 e1000_get_phy_cfg_done(struct e1000_hw *hw);
++static s32 e1000_phy_force_speed_duplex(struct e1000_hw *hw);
++static s32 e1000_set_d0_lplu_state(struct e1000_hw *hw, bool active);
++static s32 e1000_wait_autoneg(struct e1000_hw *hw);
+ 
+ /* Cable length tables */
+ static const u16 e1000_m88_cable_length_table[] =
+@@ -1281,7 +1283,7 @@ static s32 e1000_check_polarity_igp(struct e1000_hw *hw)
+  *  Waits for auto-negotiation to complete or for the auto-negotiation time
+  *  limit to expire, which ever happens first.
+  **/
+-s32 e1000_wait_autoneg(struct e1000_hw *hw)
++static s32 e1000_wait_autoneg(struct e1000_hw *hw)
+ {
+ 	s32 ret_val = 0;
+ 	u16 i, phy_status;
+@@ -1760,7 +1762,7 @@ s32 e1000_commit_phy(struct e1000_hw *hw)
+  *  During driver activity, SmartSpeed should be enabled so performance is
+  *  maintained.  This is a function pointer entry point called by drivers.
+  **/
+-s32 e1000_set_d0_lplu_state(struct e1000_hw *hw, bool active)
++static s32 e1000_set_d0_lplu_state(struct e1000_hw *hw, bool active)
+ {
+ 	if (hw->phy.ops.set_d0_lplu_state)
+ 		return hw->phy.ops.set_d0_lplu_state(hw, active);
+-
+To unsubscribe from this list: send the line "unsubscribe netdev" in
+the body of a message to majordomo at vger.kernel.org
+More majordomo info at  http://vger.kernel.org/majordomo-info.html
+
+Return-Path: <netdev-owner at vger.kernel.org>
+From: Auke Kok <auke-jan.h.kok at intel.com>
+Subject: [PATCH] e1000e: remove duplicate shadowing reference to adapter->hw
+To: jeff at garzik.org
+Cc: netdev at vger.kernel.org, john.ronciak at intel.com
+Date:	Wed, 08 Aug 2007 10:22:21 -0700
+Message-ID: <20070808172221.12261.52785.stgit at localhost.localdomain>
+User-Agent: StGIT/0.12.1
+
+Signed-off-by: Auke Kok <auke-jan.h.kok at intel.com>
+---
+
+ drivers/net/e1000e/netdev.c |    1 -
+ 1 files changed, 0 insertions(+), 1 deletions(-)
+
+diff --git a/drivers/net/e1000e/netdev.c b/drivers/net/e1000e/netdev.c
+index dd4eca6..741965d 100644
+--- a/drivers/net/e1000e/netdev.c
++++ b/drivers/net/e1000e/netdev.c
+@@ -2981,7 +2981,6 @@ static void e1000_watchdog_task(struct work_struct *work)
+ 		} else {
+ 			/* make sure the receive unit is started */
+ 			if (adapter->flags & FLAG_RX_NEEDS_RESTART) {
+-				struct e1000_hw *hw = &adapter->hw;
+ 				u32 rctl = er32(RCTL);
+ 				ew32(RCTL, rctl |
+ 						E1000_RCTL_EN);
+-
+To unsubscribe from this list: send the line "unsubscribe netdev" in
+the body of a message to majordomo at vger.kernel.org
+More majordomo info at  http://vger.kernel.org/majordomo-info.html
+
+Return-Path: <netdev-owner at vger.kernel.org>
+From: Auke Kok <auke-jan.h.kok at intel.com>
+Subject: [PATCH 1/6] e1000e: Fix header includes [v2]
+To: jeff at garzik.org
+Cc: netdev at vger.kernel.org, akpm at linux-foundation.org,
+	andi at firstfloor.org
+Date:	Fri, 10 Aug 2007 13:00:38 -0700
+Message-ID: <20070810200038.21509.77815.stgit at localhost.localdomain>
+User-Agent: StGIT/0.12.1
+
+Signed-off-by: Auke Kok <auke-jan.h.kok at intel.com>
+---
+
+ drivers/net/e1000e/82571.c   |    4 ++++
+ drivers/net/e1000e/e1000.h   |    7 ++++---
+ drivers/net/e1000e/es2lan.c  |    5 +++++
+ drivers/net/e1000e/ethtool.c |    3 ++-
+ drivers/net/e1000e/hw.h      |    2 ++
+ drivers/net/e1000e/ich8lan.c |    5 +++++
+ drivers/net/e1000e/lib.c     |    2 ++
+ drivers/net/e1000e/netdev.c  |    2 ++
+ drivers/net/e1000e/phy.c     |    2 ++
+ 9 files changed, 28 insertions(+), 4 deletions(-)
+
+diff --git a/drivers/net/e1000e/82571.c b/drivers/net/e1000e/82571.c
+index ddf2303..0f8f0ac 100644
+--- a/drivers/net/e1000e/82571.c
++++ b/drivers/net/e1000e/82571.c
+@@ -37,6 +37,10 @@
+  * 82573L Gigabit Ethernet Controller
+  */
+ 
++#include <linux/netdevice.h>
++#include <linux/delay.h>
++#include <linux/pci.h>
++
+ #include "e1000.h"
+ 
+ #define ID_LED_RESERVED_F746 0xF746
+diff --git a/drivers/net/e1000e/e1000.h b/drivers/net/e1000e/e1000.h
+index a1394d6..de17537 100644
+--- a/drivers/net/e1000e/e1000.h
++++ b/drivers/net/e1000e/e1000.h
+@@ -31,10 +31,11 @@
+ #ifndef _E1000_H_
+ #define _E1000_H_
+ 
++#include <linux/types.h>
++#include <linux/timer.h>
++#include <linux/workqueue.h>
++#include <linux/io.h>
+ #include <linux/netdevice.h>
+-#include <linux/ethtool.h>
+-#include <linux/pci.h>
+-#include <asm/io.h>
+ 
+ #include "hw.h"
+ 
+diff --git a/drivers/net/e1000e/es2lan.c b/drivers/net/e1000e/es2lan.c
+index 5604c50..8100d03 100644
+--- a/drivers/net/e1000e/es2lan.c
++++ b/drivers/net/e1000e/es2lan.c
+@@ -31,6 +31,11 @@
+  * 80003ES2LAN Gigabit Ethernet Controller (Serdes)
+  */
+ 
++#include <linux/netdevice.h>
++#include <linux/ethtool.h>
++#include <linux/delay.h>
++#include <linux/pci.h>
++
+ #include "e1000.h"
+ 
+ #define E1000_KMRNCTRLSTA_OFFSET_FIFO_CTRL	 0x00
+diff --git a/drivers/net/e1000e/ethtool.c b/drivers/net/e1000e/ethtool.c
+index 6c417ea..a8fa1db 100644
+--- a/drivers/net/e1000e/ethtool.c
++++ b/drivers/net/e1000e/ethtool.c
+@@ -29,8 +29,9 @@
+ /* ethtool support for e1000 */
+ 
+ #include <linux/netdevice.h>
+-
+ #include <linux/ethtool.h>
++#include <linux/pci.h>
++#include <linux/delay.h>
+ 
+ #include "e1000.h"
+ 
+diff --git a/drivers/net/e1000e/hw.h b/drivers/net/e1000e/hw.h
+index 4d562c4..848217a 100644
+--- a/drivers/net/e1000e/hw.h
++++ b/drivers/net/e1000e/hw.h
+@@ -29,6 +29,8 @@
+ #ifndef _E1000_HW_H_
+ #define _E1000_HW_H_
+ 
++#include <linux/types.h>
++
+ struct e1000_hw;
+ struct e1000_adapter;
+ 
+diff --git a/drivers/net/e1000e/ich8lan.c b/drivers/net/e1000e/ich8lan.c
+index 042abd4..85095af 100644
+--- a/drivers/net/e1000e/ich8lan.c
++++ b/drivers/net/e1000e/ich8lan.c
+@@ -40,6 +40,11 @@
+  * 82566MM Gigabit Network Connection
+  */
+ 
++#include <linux/netdevice.h>
++#include <linux/ethtool.h>
++#include <linux/delay.h>
++#include <linux/pci.h>
++
+ #include "e1000.h"
+ 
+ #define ICH_FLASH_GFPREG		0x0000
+diff --git a/drivers/net/e1000e/lib.c b/drivers/net/e1000e/lib.c
+index 3bbe63e..c92ea77 100644
+--- a/drivers/net/e1000e/lib.c
++++ b/drivers/net/e1000e/lib.c
+@@ -27,6 +27,8 @@
+ *******************************************************************************/
+ 
+ #include <linux/netdevice.h>
++#include <linux/ethtool.h>
++#include <linux/delay.h>
+ #include <linux/pci.h>
+ 
+ #include "e1000.h"
+diff --git a/drivers/net/e1000e/netdev.c b/drivers/net/e1000e/netdev.c
+index 741965d..01a9a4f 100644
+--- a/drivers/net/e1000e/netdev.c
++++ b/drivers/net/e1000e/netdev.c
+@@ -29,8 +29,10 @@
+ #include <linux/module.h>
+ #include <linux/types.h>
+ #include <linux/init.h>
++#include <linux/pci.h>
+ #include <linux/vmalloc.h>
+ #include <linux/pagemap.h>
++#include <linux/delay.h>
+ #include <linux/netdevice.h>
+ #include <linux/tcp.h>
+ #include <linux/ipv6.h>
+diff --git a/drivers/net/e1000e/phy.c b/drivers/net/e1000e/phy.c
+index 1ccbad7..c9304d8 100644
+--- a/drivers/net/e1000e/phy.c
++++ b/drivers/net/e1000e/phy.c
+@@ -26,6 +26,8 @@
+ 
+ *******************************************************************************/
+ 
++#include <linux/delay.h>
++
+ #include "e1000.h"
+ 
+ static s32 e1000_get_phy_cfg_done(struct e1000_hw *hw);
+-
+To unsubscribe from this list: send the line "unsubscribe netdev" in
+the body of a message to majordomo at vger.kernel.org
+More majordomo info at  http://vger.kernel.org/majordomo-info.html
+
+Return-Path: <netdev-owner at vger.kernel.org>
+From: Auke Kok <auke-jan.h.kok at intel.com>
+Subject: [PATCH 2/6] e1000e: remove namespace collisions with e1000
+To: jeff at garzik.org
+Cc: netdev at vger.kernel.org, akpm at linux-foundation.org,
+	andi at firstfloor.org
+Date:	Fri, 10 Aug 2007 13:00:47 -0700
+Message-ID: <20070810200047.21509.46779.stgit at localhost.localdomain>
+In-Reply-To: <20070810200038.21509.77815.stgit at localhost.localdomain>
+References: <20070810200038.21509.77815.stgit at localhost.localdomain>
+User-Agent: StGIT/0.12.1
+
+To prevent future collisions we rename all extern's from e1000_
+to e1000e_*. The list of changed symbols was taken from e1000.h
+Compile tested with CONFIG_E1000=y and CONFIG_E1000E=y.
+
+Signed-off-by: Auke Kok <auke-jan.h.kok at intel.com>
+---
+
+ drivers/net/e1000e/82571.c   |  129 +++++++++++++-------------
+ drivers/net/e1000e/e1000.h   |  194 +++++++++++++++++++--------------------
+ drivers/net/e1000e/es2lan.c  |  118 ++++++++++++------------
+ drivers/net/e1000e/ethtool.c |   62 ++++++------
+ drivers/net/e1000e/ich8lan.c |   92 +++++++++---------
+ drivers/net/e1000e/lib.c     |  210 +++++++++++++++++++++---------------------
+ drivers/net/e1000e/netdev.c  |  168 +++++++++++++++++-----------------
+ drivers/net/e1000e/param.c   |    8 +-
+ drivers/net/e1000e/phy.c     |  138 ++++++++++++++--------------
+ 9 files changed, 559 insertions(+), 560 deletions(-)
+
+diff --git a/drivers/net/e1000e/82571.c b/drivers/net/e1000e/82571.c
+index 0f8f0ac..cf70522 100644
+--- a/drivers/net/e1000e/82571.c
++++ b/drivers/net/e1000e/82571.c
+@@ -54,7 +54,6 @@
+ static s32 e1000_get_phy_id_82571(struct e1000_hw *hw);
+ static s32 e1000_setup_copper_link_82571(struct e1000_hw *hw);
+ static s32 e1000_setup_fiber_serdes_link_82571(struct e1000_hw *hw);
+-static s32 e1000_get_phy_id_82571(struct e1000_hw *hw);
+ static s32 e1000_write_nvm_eewr_82571(struct e1000_hw *hw, u16 offset,
+ 				      u16 words, u16 *data);
+ static s32 e1000_fix_nvm_checksum_82571(struct e1000_hw *hw);
+@@ -214,18 +213,18 @@ static s32 e1000_init_mac_params_82571(struct e1000_adapter *adapter)
+ 	switch (hw->media_type) {
+ 	case e1000_media_type_copper:
+ 		func->setup_physical_interface = e1000_setup_copper_link_82571;
+-		func->check_for_link = e1000_check_for_copper_link;
+-		func->get_link_up_info = e1000_get_speed_and_duplex_copper;
++		func->check_for_link = e1000e_check_for_copper_link;
++		func->get_link_up_info = e1000e_get_speed_and_duplex_copper;
+ 		break;
+ 	case e1000_media_type_fiber:
+ 		func->setup_physical_interface = e1000_setup_fiber_serdes_link_82571;
+-		func->check_for_link = e1000_check_for_fiber_link;
+-		func->get_link_up_info = e1000_get_speed_and_duplex_fiber_serdes;
++		func->check_for_link = e1000e_check_for_fiber_link;
++		func->get_link_up_info = e1000e_get_speed_and_duplex_fiber_serdes;
+ 		break;
+ 	case e1000_media_type_internal_serdes:
+ 		func->setup_physical_interface = e1000_setup_fiber_serdes_link_82571;
+-		func->check_for_link = e1000_check_for_serdes_link;
+-		func->get_link_up_info = e1000_get_speed_and_duplex_fiber_serdes;
++		func->check_for_link = e1000e_check_for_serdes_link;
++		func->get_link_up_info = e1000e_get_speed_and_duplex_fiber_serdes;
+ 		break;
+ 	default:
+ 		return -E1000_ERR_CONFIG;
+@@ -324,7 +323,7 @@ static s32 e1000_get_phy_id_82571(struct e1000_hw *hw)
+ 		phy->id = IGP01E1000_I_PHY_ID;
+ 		break;
+ 	case e1000_82573:
+-		return e1000_get_phy_id(hw);
++		return e1000e_get_phy_id(hw);
+ 		break;
+ 	default:
+ 		return -E1000_ERR_PHY;
+@@ -360,7 +359,7 @@ static s32 e1000_get_hw_semaphore_82571(struct e1000_hw *hw)
+ 
+ 	if (i == timeout) {
+ 		/* Release semaphores */
+-		e1000_put_hw_semaphore(hw);
++		e1000e_put_hw_semaphore(hw);
+ 		hw_dbg(hw, "Driver can't access the NVM\n");
+ 		return -E1000_ERR_NVM;
+ 	}
+@@ -403,7 +402,7 @@ static s32 e1000_acquire_nvm_82571(struct e1000_hw *hw)
+ 		return ret_val;
+ 
+ 	if (hw->mac.type != e1000_82573)
+-		ret_val = e1000_acquire_nvm(hw);
++		ret_val = e1000e_acquire_nvm(hw);
+ 
+ 	if (ret_val)
+ 		e1000_put_hw_semaphore_82571(hw);
+@@ -419,7 +418,7 @@ static s32 e1000_acquire_nvm_82571(struct e1000_hw *hw)
+  **/
+ static void e1000_release_nvm_82571(struct e1000_hw *hw)
+ {
+-	e1000_release_nvm(hw);
++	e1000e_release_nvm(hw);
+ 	e1000_put_hw_semaphore_82571(hw);
+ }
+ 
+@@ -432,7 +431,7 @@ static void e1000_release_nvm_82571(struct e1000_hw *hw)
+  *
+  *  For non-82573 silicon, write data to EEPROM at offset using SPI interface.
+  *
+- *  If e1000_update_nvm_checksum is not called after this function, the
++ *  If e1000e_update_nvm_checksum is not called after this function, the
+  *  EEPROM will most likley contain an invalid checksum.
+  **/
+ static s32 e1000_write_nvm_82571(struct e1000_hw *hw, u16 offset, u16 words,
+@@ -446,7 +445,7 @@ static s32 e1000_write_nvm_82571(struct e1000_hw *hw, u16 offset, u16 words,
+ 		break;
+ 	case e1000_82571:
+ 	case e1000_82572:
+-		ret_val = e1000_write_nvm_spi(hw, offset, words, data);
++		ret_val = e1000e_write_nvm_spi(hw, offset, words, data);
+ 		break;
+ 	default:
+ 		ret_val = -E1000_ERR_NVM;
+@@ -470,7 +469,7 @@ static s32 e1000_update_nvm_checksum_82571(struct e1000_hw *hw)
+ 	s32 ret_val;
+ 	u16 i;
+ 
+-	ret_val = e1000_update_nvm_checksum_generic(hw);
++	ret_val = e1000e_update_nvm_checksum_generic(hw);
+ 	if (ret_val)
+ 		return ret_val;
+ 
+@@ -527,7 +526,7 @@ static s32 e1000_validate_nvm_checksum_82571(struct e1000_hw *hw)
+ 	if (hw->nvm.type == e1000_nvm_flash_hw)
+ 		e1000_fix_nvm_checksum_82571(hw);
+ 
+-	return e1000_validate_nvm_checksum_generic(hw);
++	return e1000e_validate_nvm_checksum_generic(hw);
+ }
+ 
+ /**
+@@ -541,7 +540,7 @@ static s32 e1000_validate_nvm_checksum_82571(struct e1000_hw *hw)
+  *  command has completed before trying to write the next word.  After write
+  *  poll for completion.
+  *
+- *  If e1000_update_nvm_checksum is not called after this function, the
++ *  If e1000e_update_nvm_checksum is not called after this function, the
+  *  EEPROM will most likley contain an invalid checksum.
+  **/
+ static s32 e1000_write_nvm_eewr_82571(struct e1000_hw *hw, u16 offset,
+@@ -565,13 +564,13 @@ static s32 e1000_write_nvm_eewr_82571(struct e1000_hw *hw, u16 offset,
+ 		       ((offset+i) << E1000_NVM_RW_ADDR_SHIFT) |
+ 		       E1000_NVM_RW_REG_START;
+ 
+-		ret_val = e1000_poll_eerd_eewr_done(hw, E1000_NVM_POLL_WRITE);
++		ret_val = e1000e_poll_eerd_eewr_done(hw, E1000_NVM_POLL_WRITE);
+ 		if (ret_val)
+ 			break;
+ 
+ 		ew32(EEWR, eewr);
+ 
+-		ret_val = e1000_poll_eerd_eewr_done(hw, E1000_NVM_POLL_WRITE);
++		ret_val = e1000e_poll_eerd_eewr_done(hw, E1000_NVM_POLL_WRITE);
+ 		if (ret_val)
+ 			break;
+ 	}
+@@ -691,7 +690,7 @@ static s32 e1000_reset_hw_82571(struct e1000_hw *hw)
+ 	/* Prevent the PCI-E bus from sticking if there is no TLP connection
+ 	 * on the last TLP read/write transaction when MAC is reset.
+ 	 */
+-	ret_val = e1000_disable_pcie_master(hw);
++	ret_val = e1000e_disable_pcie_master(hw);
+ 	if (ret_val)
+ 		hw_dbg(hw, "PCI-E Master disable polling has failed.\n");
+ 
+@@ -737,7 +736,7 @@ static s32 e1000_reset_hw_82571(struct e1000_hw *hw)
+ 		e1e_flush();
+ 	}
+ 
+-	ret_val = e1000_get_auto_rd_done(hw);
++	ret_val = e1000e_get_auto_rd_done(hw);
+ 	if (ret_val)
+ 		/* We don't want to continue accessing MAC registers. */
+ 		return ret_val;
+@@ -773,7 +772,7 @@ static s32 e1000_init_hw_82571(struct e1000_hw *hw)
+ 	e1000_initialize_hw_bits_82571(hw);
+ 
+ 	/* Initialize identification LED */
+-	ret_val = e1000_id_led_init(hw);
++	ret_val = e1000e_id_led_init(hw);
+ 	if (ret_val) {
+ 		hw_dbg(hw, "Error initializing identification LED\n");
+ 		return ret_val;
+@@ -781,16 +780,16 @@ static s32 e1000_init_hw_82571(struct e1000_hw *hw)
+ 
+ 	/* Disabling VLAN filtering */
+ 	hw_dbg(hw, "Initializing the IEEE VLAN\n");
+-	e1000_clear_vfta(hw);
++	e1000e_clear_vfta(hw);
+ 
+ 	/* Setup the receive address. */
+ 	/* If, however, a locally administered address was assigned to the
+ 	 * 82571, we must reserve a RAR for it to work around an issue where
+ 	 * resetting one port will reload the MAC on the other port.
+ 	 */
+-	if (e1000_get_laa_state_82571(hw))
++	if (e1000e_get_laa_state_82571(hw))
+ 		rar_count--;
+-	e1000_init_rx_addrs(hw, rar_count);
++	e1000e_init_rx_addrs(hw, rar_count);
+ 
+ 	/* Zero out the Multicast HASH table */
+ 	hw_dbg(hw, "Zeroing the MTA\n");
+@@ -815,7 +814,7 @@ static s32 e1000_init_hw_82571(struct e1000_hw *hw)
+ 			   E1000_TXDCTL_COUNT_DESC;
+ 		ew32(TXDCTL1, reg_data);
+ 	} else {
+-		e1000_enable_tx_pkt_filtering(hw);
++		e1000e_enable_tx_pkt_filtering(hw);
+ 		reg_data = er32(GCR);
+ 		reg_data |= E1000_GCR_L1_ACT_WITHOUT_L0S_RX;
+ 		ew32(GCR, reg_data);
+@@ -898,13 +897,13 @@ static void e1000_initialize_hw_bits_82571(struct e1000_hw *hw)
+ }
+ 
+ /**
+- *  e1000_clear_vfta - Clear VLAN filter table
++ *  e1000e_clear_vfta - Clear VLAN filter table
+  *  @hw: pointer to the HW structure
+  *
+  *  Clears the register array which contains the VLAN filter table by
+  *  setting all the values to 0.
+  **/
+-void e1000_clear_vfta(struct e1000_hw *hw)
++void e1000e_clear_vfta(struct e1000_hw *hw)
+ {
+ 	u32 offset;
+ 	u32 vfta_value = 0;
+@@ -956,10 +955,10 @@ static void e1000_mc_addr_list_update_82571(struct e1000_hw *hw,
+ 					    u32 rar_used_count,
+ 					    u32 rar_count)
+ {
+-	if (e1000_get_laa_state_82571(hw))
++	if (e1000e_get_laa_state_82571(hw))
+ 		rar_count--;
+ 
+-	e1000_mc_addr_list_update_generic(hw, mc_addr_list, mc_addr_count,
++	e1000e_mc_addr_list_update_generic(hw, mc_addr_list, mc_addr_count,
+ 					  rar_used_count, rar_count);
+ }
+ 
+@@ -982,7 +981,7 @@ static s32 e1000_setup_link_82571(struct e1000_hw *hw)
+ 	if (hw->mac.type == e1000_82573)
+ 		hw->mac.fc = e1000_fc_full;
+ 
+-	return e1000_setup_link(hw);
++	return e1000e_setup_link(hw);
+ }
+ 
+ /**
+@@ -1006,10 +1005,10 @@ static s32 e1000_setup_copper_link_82571(struct e1000_hw *hw)
+ 
+ 	switch (hw->phy.type) {
+ 	case e1000_phy_m88:
+-		ret_val = e1000_copper_link_setup_m88(hw);
++		ret_val = e1000e_copper_link_setup_m88(hw);
+ 		break;
+ 	case e1000_phy_igp_2:
+-		ret_val = e1000_copper_link_setup_igp(hw);
++		ret_val = e1000e_copper_link_setup_igp(hw);
+ 		/* Setup activity LED */
+ 		led_ctrl = er32(LEDCTL);
+ 		led_ctrl &= IGP_ACTIVITY_LED_MASK;
+@@ -1024,7 +1023,7 @@ static s32 e1000_setup_copper_link_82571(struct e1000_hw *hw)
+ 	if (ret_val)
+ 		return ret_val;
+ 
+-	ret_val = e1000_setup_copper_link(hw);
++	ret_val = e1000e_setup_copper_link(hw);
+ 
+ 	return ret_val;
+ }
+@@ -1054,7 +1053,7 @@ static s32 e1000_setup_fiber_serdes_link_82571(struct e1000_hw *hw)
+ 		break;
+ 	}
+ 
+-	return e1000_setup_fiber_serdes_link(hw);
++	return e1000e_setup_fiber_serdes_link(hw);
+ }
+ 
+ /**
+@@ -1086,12 +1085,12 @@ static s32 e1000_valid_led_default_82571(struct e1000_hw *hw, u16 *data)
+ }
+ 
+ /**
+- *  e1000_get_laa_state_82571 - Get locally administered address state
++ *  e1000e_get_laa_state_82571 - Get locally administered address state
+  *  @hw: pointer to the HW structure
+  *
+  *  Retrieve and return the current locally administed address state.
+  **/
+-bool e1000_get_laa_state_82571(struct e1000_hw *hw)
++bool e1000e_get_laa_state_82571(struct e1000_hw *hw)
+ {
+ 	if (hw->mac.type != e1000_82571)
+ 		return 0;
+@@ -1100,13 +1099,13 @@ bool e1000_get_laa_state_82571(struct e1000_hw *hw)
+ }
+ 
+ /**
+- *  e1000_set_laa_state_82571 - Set locally administered address state
++ *  e1000e_set_laa_state_82571 - Set locally administered address state
+  *  @hw: pointer to the HW structure
+  *  @state: enable/disable locally administered address
+  *
+  *  Enable/Disable the current locally administed address state.
+  **/
+-void e1000_set_laa_state_82571(struct e1000_hw *hw, bool state)
++void e1000e_set_laa_state_82571(struct e1000_hw *hw, bool state)
+ {
+ 	if (hw->mac.type != e1000_82571)
+ 		return;
+@@ -1121,7 +1120,7 @@ void e1000_set_laa_state_82571(struct e1000_hw *hw, bool state)
+ 		 * incoming packets directed to this port are dropped.
+ 		 * Eventually the LAA will be in RAR[0] and RAR[14].
+ 		 */
+-		e1000_rar_set(hw, hw->mac.addr, hw->mac.rar_entry_count - 1);
++		e1000e_rar_set(hw, hw->mac.addr, hw->mac.rar_entry_count - 1);
+ }
+ 
+ /**
+@@ -1167,7 +1166,7 @@ static s32 e1000_fix_nvm_checksum_82571(struct e1000_hw *hw)
+ 			ret_val = e1000_write_nvm(hw, 0x23, 1, &data);
+ 			if (ret_val)
+ 				return ret_val;
+-			ret_val = e1000_update_nvm_checksum(hw);
++			ret_val = e1000e_update_nvm_checksum(hw);
+ 		}
+ 	}
+ 
+@@ -1184,7 +1183,7 @@ static void e1000_clear_hw_cntrs_82571(struct e1000_hw *hw)
+ {
+ 	u32 temp;
+ 
+-	e1000_clear_hw_cntrs_base(hw);
++	e1000e_clear_hw_cntrs_base(hw);
+ 
+ 	temp = er32(PRC64);
+ 	temp = er32(PRC127);
+@@ -1225,12 +1224,12 @@ static void e1000_clear_hw_cntrs_82571(struct e1000_hw *hw)
+ static struct e1000_mac_operations e82571_mac_ops = {
+ 	.mng_mode_enab		= E1000_MNG_IAMT_MODE << E1000_FWSM_MODE_SHIFT,
+ 	/* .check_for_link: media type dependent */
+-	.cleanup_led		= e1000_cleanup_led_generic,
++	.cleanup_led		= e1000e_cleanup_led_generic,
+ 	.clear_hw_cntrs		= e1000_clear_hw_cntrs_82571,
+-	.get_bus_info		= e1000_get_bus_info_pcie,
++	.get_bus_info		= e1000e_get_bus_info_pcie,
+ 	/* .get_link_up_info: media type dependent */
+-	.led_on			= e1000_led_on_generic,
+-	.led_off		= e1000_led_off_generic,
++	.led_on			= e1000e_led_on_generic,
++	.led_off		= e1000e_led_off_generic,
+ 	.mc_addr_list_update	= e1000_mc_addr_list_update_82571,
+ 	.reset_hw		= e1000_reset_hw_82571,
+ 	.init_hw		= e1000_init_hw_82571,
+@@ -1240,39 +1239,39 @@ static struct e1000_mac_operations e82571_mac_ops = {
+ 
+ static struct e1000_phy_operations e82_phy_ops_igp = {
+ 	.acquire_phy		= e1000_get_hw_semaphore_82571,
+-	.check_reset_block	= e1000_check_reset_block_generic,
++	.check_reset_block	= e1000e_check_reset_block_generic,
+ 	.commit_phy		= NULL,
+-	.force_speed_duplex	= e1000_phy_force_speed_duplex_igp,
++	.force_speed_duplex	= e1000e_phy_force_speed_duplex_igp,
+ 	.get_cfg_done		= e1000_get_cfg_done_82571,
+-	.get_cable_length	= e1000_get_cable_length_igp_2,
+-	.get_phy_info		= e1000_get_phy_info_igp,
+-	.read_phy_reg		= e1000_read_phy_reg_igp,
++	.get_cable_length	= e1000e_get_cable_length_igp_2,
++	.get_phy_info		= e1000e_get_phy_info_igp,
++	.read_phy_reg		= e1000e_read_phy_reg_igp,
+ 	.release_phy		= e1000_put_hw_semaphore_82571,
+-	.reset_phy		= e1000_phy_hw_reset_generic,
++	.reset_phy		= e1000e_phy_hw_reset_generic,
+ 	.set_d0_lplu_state	= e1000_set_d0_lplu_state_82571,
+-	.set_d3_lplu_state	= e1000_set_d3_lplu_state,
+-	.write_phy_reg		= e1000_write_phy_reg_igp,
++	.set_d3_lplu_state	= e1000e_set_d3_lplu_state,
++	.write_phy_reg		= e1000e_write_phy_reg_igp,
+ };
+ 
+ static struct e1000_phy_operations e82_phy_ops_m88 = {
+ 	.acquire_phy		= e1000_get_hw_semaphore_82571,
+-	.check_reset_block	= e1000_check_reset_block_generic,
+-	.commit_phy		= e1000_phy_sw_reset,
+-	.force_speed_duplex	= e1000_phy_force_speed_duplex_m88,
+-	.get_cfg_done		= e1000_get_cfg_done,
+-	.get_cable_length	= e1000_get_cable_length_m88,
+-	.get_phy_info		= e1000_get_phy_info_m88,
+-	.read_phy_reg		= e1000_read_phy_reg_m88,
++	.check_reset_block	= e1000e_check_reset_block_generic,
++	.commit_phy		= e1000e_phy_sw_reset,
++	.force_speed_duplex	= e1000e_phy_force_speed_duplex_m88,
++	.get_cfg_done		= e1000e_get_cfg_done,
++	.get_cable_length	= e1000e_get_cable_length_m88,
++	.get_phy_info		= e1000e_get_phy_info_m88,
++	.read_phy_reg		= e1000e_read_phy_reg_m88,
+ 	.release_phy		= e1000_put_hw_semaphore_82571,
+-	.reset_phy		= e1000_phy_hw_reset_generic,
++	.reset_phy		= e1000e_phy_hw_reset_generic,
+ 	.set_d0_lplu_state	= e1000_set_d0_lplu_state_82571,
+-	.set_d3_lplu_state	= e1000_set_d3_lplu_state,
+-	.write_phy_reg		= e1000_write_phy_reg_m88,
++	.set_d3_lplu_state	= e1000e_set_d3_lplu_state,
++	.write_phy_reg		= e1000e_write_phy_reg_m88,
+ };
+ 
+ static struct e1000_nvm_operations e82571_nvm_ops = {
+ 	.acquire_nvm		= e1000_acquire_nvm_82571,
+-	.read_nvm		= e1000_read_nvm_spi,
++	.read_nvm		= e1000e_read_nvm_spi,
+ 	.release_nvm		= e1000_release_nvm_82571,
+ 	.update_nvm		= e1000_update_nvm_checksum_82571,
+ 	.valid_led_default	= e1000_valid_led_default_82571,
+@@ -1282,7 +1281,7 @@ static struct e1000_nvm_operations e82571_nvm_ops = {
+ 
+ static struct e1000_nvm_operations e82573_nvm_ops = {
+ 	.acquire_nvm		= e1000_acquire_nvm_82571,
+-	.read_nvm		= e1000_read_nvm_eerd,
++	.read_nvm		= e1000e_read_nvm_eerd,
+ 	.release_nvm		= e1000_release_nvm_82571,
+ 	.update_nvm		= e1000_update_nvm_checksum_82571,
+ 	.valid_led_default	= e1000_valid_led_default_82571,
+diff --git a/drivers/net/e1000e/e1000.h b/drivers/net/e1000e/e1000.h
+index de17537..3475e48 100644
+--- a/drivers/net/e1000e/e1000.h
++++ b/drivers/net/e1000e/e1000.h
+@@ -337,26 +337,26 @@ enum latency_range {
+ 	latency_invalid = 255
+ };
+ 
+-extern char e1000_driver_name[];
+-extern const char e1000_driver_version[];
+-
+-extern void e1000_check_options(struct e1000_adapter *adapter);
+-extern void e1000_set_ethtool_ops(struct net_device *netdev);
+-
+-extern int e1000_up(struct e1000_adapter *adapter);
+-extern void e1000_down(struct e1000_adapter *adapter);
+-extern void e1000_reinit_locked(struct e1000_adapter *adapter);
+-extern void e1000_reset(struct e1000_adapter *adapter);
+-extern void e1000_power_up_phy(struct e1000_adapter *adapter);
+-extern int e1000_setup_rx_resources(struct e1000_adapter *adapter);
+-extern int e1000_setup_tx_resources(struct e1000_adapter *adapter);
+-extern void e1000_free_rx_resources(struct e1000_adapter *adapter);
+-extern void e1000_free_tx_resources(struct e1000_adapter *adapter);
+-extern void e1000_update_stats(struct e1000_adapter *adapter);
++extern char e1000e_driver_name[];
++extern const char e1000e_driver_version[];
++
++extern void e1000e_check_options(struct e1000_adapter *adapter);
++extern void e1000e_set_ethtool_ops(struct net_device *netdev);
++
++extern int e1000e_up(struct e1000_adapter *adapter);
++extern void e1000e_down(struct e1000_adapter *adapter);
++extern void e1000e_reinit_locked(struct e1000_adapter *adapter);
++extern void e1000e_reset(struct e1000_adapter *adapter);
++extern void e1000e_power_up_phy(struct e1000_adapter *adapter);
++extern int e1000e_setup_rx_resources(struct e1000_adapter *adapter);
++extern int e1000e_setup_tx_resources(struct e1000_adapter *adapter);
++extern void e1000e_free_rx_resources(struct e1000_adapter *adapter);
++extern void e1000e_free_tx_resources(struct e1000_adapter *adapter);
++extern void e1000e_update_stats(struct e1000_adapter *adapter);
+ 
+ extern unsigned int copybreak;
+ 
+-extern char *e1000_get_hw_dev_name(struct e1000_hw *hw);
++extern char *e1000e_get_hw_dev_name(struct e1000_hw *hw);
+ 
+ extern struct e1000_info e1000_82571_info;
+ extern struct e1000_info e1000_82572_info;
+@@ -365,79 +365,79 @@ extern struct e1000_info e1000_ich8_info;
+ extern struct e1000_info e1000_ich9_info;
+ extern struct e1000_info e1000_es2_info;
+ 
+-extern s32  e1000_commit_phy(struct e1000_hw *hw);
++extern s32  e1000e_commit_phy(struct e1000_hw *hw);
+ 
+-extern bool e1000_enable_mng_pass_thru(struct e1000_hw *hw);
++extern bool e1000e_enable_mng_pass_thru(struct e1000_hw *hw);
+ 
+-extern bool e1000_get_laa_state_82571(struct e1000_hw *hw);
+-extern void e1000_set_laa_state_82571(struct e1000_hw *hw, bool state);
++extern bool e1000e_get_laa_state_82571(struct e1000_hw *hw);
++extern void e1000e_set_laa_state_82571(struct e1000_hw *hw, bool state);
+ 
+-extern void e1000_set_kmrn_lock_loss_workaround_ich8lan(struct e1000_hw *hw,
++extern void e1000e_set_kmrn_lock_loss_workaround_ich8lan(struct e1000_hw *hw,
+ 						 bool state);
+-extern void e1000_igp3_phy_powerdown_workaround_ich8lan(struct e1000_hw *hw);
+-extern void e1000_gig_downshift_workaround_ich8lan(struct e1000_hw *hw);
+-
+-extern s32 e1000_check_for_copper_link(struct e1000_hw *hw);
+-extern s32 e1000_check_for_fiber_link(struct e1000_hw *hw);
+-extern s32 e1000_check_for_serdes_link(struct e1000_hw *hw);
+-extern s32 e1000_cleanup_led_generic(struct e1000_hw *hw);
+-extern s32 e1000_led_on_generic(struct e1000_hw *hw);
+-extern s32 e1000_led_off_generic(struct e1000_hw *hw);
+-extern s32 e1000_get_bus_info_pcie(struct e1000_hw *hw);
+-extern s32 e1000_get_speed_and_duplex_copper(struct e1000_hw *hw, u16 *speed, u16 *duplex);
+-extern s32 e1000_get_speed_and_duplex_fiber_serdes(struct e1000_hw *hw, u16 *speed, u16 *duplex);
+-extern s32 e1000_disable_pcie_master(struct e1000_hw *hw);
+-extern s32 e1000_get_auto_rd_done(struct e1000_hw *hw);
+-extern s32 e1000_id_led_init(struct e1000_hw *hw);
+-extern void e1000_clear_hw_cntrs_base(struct e1000_hw *hw);
+-extern s32 e1000_setup_fiber_serdes_link(struct e1000_hw *hw);
+-extern s32 e1000_copper_link_setup_m88(struct e1000_hw *hw);
+-extern s32 e1000_copper_link_setup_igp(struct e1000_hw *hw);
+-extern s32 e1000_setup_link(struct e1000_hw *hw);
+-extern void e1000_clear_vfta(struct e1000_hw *hw);
+-extern void e1000_init_rx_addrs(struct e1000_hw *hw, u16 rar_count);
+-extern void e1000_mc_addr_list_update_generic(struct e1000_hw *hw,
++extern void e1000e_igp3_phy_powerdown_workaround_ich8lan(struct e1000_hw *hw);
++extern void e1000e_gig_downshift_workaround_ich8lan(struct e1000_hw *hw);
++
++extern s32 e1000e_check_for_copper_link(struct e1000_hw *hw);
++extern s32 e1000e_check_for_fiber_link(struct e1000_hw *hw);
++extern s32 e1000e_check_for_serdes_link(struct e1000_hw *hw);
++extern s32 e1000e_cleanup_led_generic(struct e1000_hw *hw);
++extern s32 e1000e_led_on_generic(struct e1000_hw *hw);
++extern s32 e1000e_led_off_generic(struct e1000_hw *hw);
++extern s32 e1000e_get_bus_info_pcie(struct e1000_hw *hw);
++extern s32 e1000e_get_speed_and_duplex_copper(struct e1000_hw *hw, u16 *speed, u16 *duplex);
++extern s32 e1000e_get_speed_and_duplex_fiber_serdes(struct e1000_hw *hw, u16 *speed, u16 *duplex);
++extern s32 e1000e_disable_pcie_master(struct e1000_hw *hw);
++extern s32 e1000e_get_auto_rd_done(struct e1000_hw *hw);
++extern s32 e1000e_id_led_init(struct e1000_hw *hw);
++extern void e1000e_clear_hw_cntrs_base(struct e1000_hw *hw);
++extern s32 e1000e_setup_fiber_serdes_link(struct e1000_hw *hw);
++extern s32 e1000e_copper_link_setup_m88(struct e1000_hw *hw);
++extern s32 e1000e_copper_link_setup_igp(struct e1000_hw *hw);
++extern s32 e1000e_setup_link(struct e1000_hw *hw);
++extern void e1000e_clear_vfta(struct e1000_hw *hw);
++extern void e1000e_init_rx_addrs(struct e1000_hw *hw, u16 rar_count);
++extern void e1000e_mc_addr_list_update_generic(struct e1000_hw *hw,
+ 				       u8 *mc_addr_list, u32 mc_addr_count,
+ 				       u32 rar_used_count, u32 rar_count);
+-extern void e1000_rar_set(struct e1000_hw *hw, u8 *addr, u32 index);
+-extern s32 e1000_set_fc_watermarks(struct e1000_hw *hw);
+-extern void e1000_set_pcie_no_snoop(struct e1000_hw *hw, u32 no_snoop);
+-extern s32 e1000_get_hw_semaphore(struct e1000_hw *hw);
+-extern s32 e1000_valid_led_default(struct e1000_hw *hw, u16 *data);
+-extern void e1000_config_collision_dist(struct e1000_hw *hw);
+-extern s32 e1000_config_fc_after_link_up(struct e1000_hw *hw);
+-extern s32 e1000_force_mac_fc(struct e1000_hw *hw);
+-extern s32 e1000_blink_led(struct e1000_hw *hw);
+-extern void e1000_write_vfta(struct e1000_hw *hw, u32 offset, u32 value);
+-extern void e1000_reset_adaptive(struct e1000_hw *hw);
+-extern void e1000_update_adaptive(struct e1000_hw *hw);
+-
+-extern s32 e1000_setup_copper_link(struct e1000_hw *hw);
+-extern s32 e1000_get_phy_id(struct e1000_hw *hw);
+-extern void e1000_put_hw_semaphore(struct e1000_hw *hw);
+-extern s32 e1000_check_reset_block_generic(struct e1000_hw *hw);
+-extern s32 e1000_phy_force_speed_duplex_igp(struct e1000_hw *hw);
+-extern s32 e1000_get_cable_length_igp_2(struct e1000_hw *hw);
+-extern s32 e1000_get_phy_info_igp(struct e1000_hw *hw);
+-extern s32 e1000_read_phy_reg_igp(struct e1000_hw *hw, u32 offset, u16 *data);
+-extern s32 e1000_phy_hw_reset_generic(struct e1000_hw *hw);
+-extern s32 e1000_set_d3_lplu_state(struct e1000_hw *hw, bool active);
+-extern s32 e1000_write_phy_reg_igp(struct e1000_hw *hw, u32 offset, u16 data);
+-extern s32 e1000_phy_sw_reset(struct e1000_hw *hw);
+-extern s32 e1000_phy_force_speed_duplex_m88(struct e1000_hw *hw);
+-extern s32 e1000_get_cfg_done(struct e1000_hw *hw);
+-extern s32 e1000_get_cable_length_m88(struct e1000_hw *hw);
+-extern s32 e1000_get_phy_info_m88(struct e1000_hw *hw);
+-extern s32 e1000_read_phy_reg_m88(struct e1000_hw *hw, u32 offset, u16 *data);
+-extern s32 e1000_write_phy_reg_m88(struct e1000_hw *hw, u32 offset, u16 data);
+-extern enum e1000_phy_type e1000_get_phy_type_from_id(u32 phy_id);
+-extern void e1000_phy_force_speed_duplex_setup(struct e1000_hw *hw, u16 *phy_ctrl);
+-extern s32 e1000_write_kmrn_reg(struct e1000_hw *hw, u32 offset, u16 data);
+-extern s32 e1000_read_kmrn_reg(struct e1000_hw *hw, u32 offset, u16 *data);
+-extern s32 e1000_phy_has_link_generic(struct e1000_hw *hw, u32 iterations,
++extern void e1000e_rar_set(struct e1000_hw *hw, u8 *addr, u32 index);
++extern s32 e1000e_set_fc_watermarks(struct e1000_hw *hw);
++extern void e1000e_set_pcie_no_snoop(struct e1000_hw *hw, u32 no_snoop);
++extern s32 e1000e_get_hw_semaphore(struct e1000_hw *hw);
++extern s32 e1000e_valid_led_default(struct e1000_hw *hw, u16 *data);
++extern void e1000e_config_collision_dist(struct e1000_hw *hw);
++extern s32 e1000e_config_fc_after_link_up(struct e1000_hw *hw);
++extern s32 e1000e_force_mac_fc(struct e1000_hw *hw);
++extern s32 e1000e_blink_led(struct e1000_hw *hw);
++extern void e1000e_write_vfta(struct e1000_hw *hw, u32 offset, u32 value);
++extern void e1000e_reset_adaptive(struct e1000_hw *hw);
++extern void e1000e_update_adaptive(struct e1000_hw *hw);
++
++extern s32 e1000e_setup_copper_link(struct e1000_hw *hw);
++extern s32 e1000e_get_phy_id(struct e1000_hw *hw);
++extern void e1000e_put_hw_semaphore(struct e1000_hw *hw);
++extern s32 e1000e_check_reset_block_generic(struct e1000_hw *hw);
++extern s32 e1000e_phy_force_speed_duplex_igp(struct e1000_hw *hw);
++extern s32 e1000e_get_cable_length_igp_2(struct e1000_hw *hw);
++extern s32 e1000e_get_phy_info_igp(struct e1000_hw *hw);
++extern s32 e1000e_read_phy_reg_igp(struct e1000_hw *hw, u32 offset, u16 *data);
++extern s32 e1000e_phy_hw_reset_generic(struct e1000_hw *hw);
++extern s32 e1000e_set_d3_lplu_state(struct e1000_hw *hw, bool active);
++extern s32 e1000e_write_phy_reg_igp(struct e1000_hw *hw, u32 offset, u16 data);
++extern s32 e1000e_phy_sw_reset(struct e1000_hw *hw);
++extern s32 e1000e_phy_force_speed_duplex_m88(struct e1000_hw *hw);
++extern s32 e1000e_get_cfg_done(struct e1000_hw *hw);
++extern s32 e1000e_get_cable_length_m88(struct e1000_hw *hw);
++extern s32 e1000e_get_phy_info_m88(struct e1000_hw *hw);
++extern s32 e1000e_read_phy_reg_m88(struct e1000_hw *hw, u32 offset, u16 *data);
++extern s32 e1000e_write_phy_reg_m88(struct e1000_hw *hw, u32 offset, u16 data);
++extern enum e1000_phy_type e1000e_get_phy_type_from_id(u32 phy_id);
++extern void e1000e_phy_force_speed_duplex_setup(struct e1000_hw *hw, u16 *phy_ctrl);
++extern s32 e1000e_write_kmrn_reg(struct e1000_hw *hw, u32 offset, u16 data);
++extern s32 e1000e_read_kmrn_reg(struct e1000_hw *hw, u32 offset, u16 *data);
++extern s32 e1000e_phy_has_link_generic(struct e1000_hw *hw, u32 iterations,
+ 			       u32 usec_interval, bool *success);
+-extern s32 e1000_phy_reset_dsp(struct e1000_hw *hw);
+-extern s32 e1000_check_downshift(struct e1000_hw *hw);
++extern s32 e1000e_phy_reset_dsp(struct e1000_hw *hw);
++extern s32 e1000e_check_downshift(struct e1000_hw *hw);
+ 
+ static inline s32 e1000_phy_hw_reset(struct e1000_hw *hw)
+ {
+@@ -464,23 +464,23 @@ static inline s32 e1000_get_cable_length(struct e1000_hw *hw)
+ 	return hw->phy.ops.get_cable_length(hw);
+ }
+ 
+-extern s32 e1000_acquire_nvm(struct e1000_hw *hw);
+-extern s32 e1000_write_nvm_spi(struct e1000_hw *hw, u16 offset, u16 words, u16 *data);
+-extern s32 e1000_update_nvm_checksum_generic(struct e1000_hw *hw);
+-extern s32 e1000_poll_eerd_eewr_done(struct e1000_hw *hw, int ee_reg);
+-extern s32 e1000_read_nvm_spi(struct e1000_hw *hw, u16 offset, u16 words, u16 *data);
+-extern s32 e1000_read_nvm_eerd(struct e1000_hw *hw, u16 offset, u16 words, u16 *data);
+-extern s32 e1000_validate_nvm_checksum_generic(struct e1000_hw *hw);
+-extern void e1000_release_nvm(struct e1000_hw *hw);
+-extern void e1000_reload_nvm(struct e1000_hw *hw);
+-extern s32 e1000_read_mac_addr(struct e1000_hw *hw);
++extern s32 e1000e_acquire_nvm(struct e1000_hw *hw);
++extern s32 e1000e_write_nvm_spi(struct e1000_hw *hw, u16 offset, u16 words, u16 *data);
++extern s32 e1000e_update_nvm_checksum_generic(struct e1000_hw *hw);
++extern s32 e1000e_poll_eerd_eewr_done(struct e1000_hw *hw, int ee_reg);
++extern s32 e1000e_read_nvm_spi(struct e1000_hw *hw, u16 offset, u16 words, u16 *data);
++extern s32 e1000e_read_nvm_eerd(struct e1000_hw *hw, u16 offset, u16 words, u16 *data);
++extern s32 e1000e_validate_nvm_checksum_generic(struct e1000_hw *hw);
++extern void e1000e_release_nvm(struct e1000_hw *hw);
++extern void e1000e_reload_nvm(struct e1000_hw *hw);
++extern s32 e1000e_read_mac_addr(struct e1000_hw *hw);
+ 
+ static inline s32 e1000_validate_nvm_checksum(struct e1000_hw *hw)
+ {
+ 	return hw->nvm.ops.validate_nvm(hw);
+ }
+ 
+-static inline s32 e1000_update_nvm_checksum(struct e1000_hw *hw)
++static inline s32 e1000e_update_nvm_checksum(struct e1000_hw *hw)
+ {
+ 	return hw->nvm.ops.update_nvm(hw);
+ }
+@@ -500,9 +500,9 @@ static inline s32 e1000_get_phy_info(struct e1000_hw *hw)
+ 	return hw->phy.ops.get_phy_info(hw);
+ }
+ 
+-extern bool e1000_check_mng_mode(struct e1000_hw *hw);
+-extern bool e1000_enable_tx_pkt_filtering(struct e1000_hw *hw);
+-extern s32 e1000_mng_write_dhcp_info(struct e1000_hw *hw, u8 *buffer, u16 length);
++extern bool e1000e_check_mng_mode(struct e1000_hw *hw);
++extern bool e1000e_enable_tx_pkt_filtering(struct e1000_hw *hw);
++extern s32 e1000e_mng_write_dhcp_info(struct e1000_hw *hw, u8 *buffer, u16 length);
+ 
+ static inline u32 __er32(struct e1000_hw *hw, unsigned long reg)
+ {
+diff --git a/drivers/net/e1000e/es2lan.c b/drivers/net/e1000e/es2lan.c
+index 8100d03..88657ad 100644
+--- a/drivers/net/e1000e/es2lan.c
++++ b/drivers/net/e1000e/es2lan.c
+@@ -129,7 +129,7 @@ static s32 e1000_init_phy_params_80003es2lan(struct e1000_hw *hw)
+ 	phy->type		= e1000_phy_gg82563;
+ 
+ 	/* This can only be done after all function pointers are setup. */
+-	ret_val = e1000_get_phy_id(hw);
++	ret_val = e1000e_get_phy_id(hw);
+ 
+ 	/* Verify phy id */
+ 	if (phy->id != GG82563_E_PHY_ID)
+@@ -215,15 +215,15 @@ static s32 e1000_init_mac_params_80003es2lan(struct e1000_adapter *adapter)
+ 	switch (hw->media_type) {
+ 	case e1000_media_type_copper:
+ 		func->setup_physical_interface = e1000_setup_copper_link_80003es2lan;
+-		func->check_for_link = e1000_check_for_copper_link;
++		func->check_for_link = e1000e_check_for_copper_link;
+ 		break;
+ 	case e1000_media_type_fiber:
+-		func->setup_physical_interface = e1000_setup_fiber_serdes_link;
+-		func->check_for_link = e1000_check_for_fiber_link;
++		func->setup_physical_interface = e1000e_setup_fiber_serdes_link;
++		func->check_for_link = e1000e_check_for_fiber_link;
+ 		break;
+ 	case e1000_media_type_internal_serdes:
+-		func->setup_physical_interface = e1000_setup_fiber_serdes_link;
+-		func->check_for_link = e1000_check_for_serdes_link;
++		func->setup_physical_interface = e1000e_setup_fiber_serdes_link;
++		func->check_for_link = e1000e_check_for_serdes_link;
+ 		break;
+ 	default:
+ 		return -E1000_ERR_CONFIG;
+@@ -299,7 +299,7 @@ static s32 e1000_acquire_nvm_80003es2lan(struct e1000_hw *hw)
+ 	if (ret_val)
+ 		return ret_val;
+ 
+-	ret_val = e1000_acquire_nvm(hw);
++	ret_val = e1000e_acquire_nvm(hw);
+ 
+ 	if (ret_val)
+ 		e1000_release_swfw_sync_80003es2lan(hw, E1000_SWFW_EEP_SM);
+@@ -316,7 +316,7 @@ static s32 e1000_acquire_nvm_80003es2lan(struct e1000_hw *hw)
+  **/
+ static void e1000_release_nvm_80003es2lan(struct e1000_hw *hw)
+ {
+-	e1000_release_nvm(hw);
++	e1000e_release_nvm(hw);
+ 	e1000_release_swfw_sync_80003es2lan(hw, E1000_SWFW_EEP_SM);
+ }
+ 
+@@ -337,7 +337,7 @@ static s32 e1000_acquire_swfw_sync_80003es2lan(struct e1000_hw *hw, u16 mask)
+ 	s32 timeout = 200;
+ 
+ 	while (i < timeout) {
+-		if (e1000_get_hw_semaphore(hw))
++		if (e1000e_get_hw_semaphore(hw))
+ 			return -E1000_ERR_SWFW_SYNC;
+ 
+ 		swfw_sync = er32(SW_FW_SYNC);
+@@ -346,7 +346,7 @@ static s32 e1000_acquire_swfw_sync_80003es2lan(struct e1000_hw *hw, u16 mask)
+ 
+ 		/* Firmware currently using resource (fwmask)
+ 		 * or other software thread using resource (swmask) */
+-		e1000_put_hw_semaphore(hw);
++		e1000e_put_hw_semaphore(hw);
+ 		mdelay(5);
+ 		i++;
+ 	}
+@@ -360,7 +360,7 @@ static s32 e1000_acquire_swfw_sync_80003es2lan(struct e1000_hw *hw, u16 mask)
+ 	swfw_sync |= swmask;
+ 	ew32(SW_FW_SYNC, swfw_sync);
+ 
+-	e1000_put_hw_semaphore(hw);
++	e1000e_put_hw_semaphore(hw);
+ 
+ 	return 0;
+ }
+@@ -377,14 +377,14 @@ static void e1000_release_swfw_sync_80003es2lan(struct e1000_hw *hw, u16 mask)
+ {
+ 	u32 swfw_sync;
+ 
+-	while (e1000_get_hw_semaphore(hw) != 0);
++	while (e1000e_get_hw_semaphore(hw) != 0);
+ 	/* Empty */
+ 
+ 	swfw_sync = er32(SW_FW_SYNC);
+ 	swfw_sync &= ~mask;
+ 	ew32(SW_FW_SYNC, swfw_sync);
+ 
+-	e1000_put_hw_semaphore(hw);
++	e1000e_put_hw_semaphore(hw);
+ }
+ 
+ /**
+@@ -413,7 +413,7 @@ static s32 e1000_read_phy_reg_gg82563_80003es2lan(struct e1000_hw *hw,
+ 		page_select = GG82563_PHY_PAGE_SELECT_ALT;
+ 
+ 	temp = (u16)((u16)offset >> GG82563_PAGE_SHIFT);
+-	ret_val = e1000_write_phy_reg_m88(hw, page_select, temp);
++	ret_val = e1000e_write_phy_reg_m88(hw, page_select, temp);
+ 	if (ret_val)
+ 		return ret_val;
+ 
+@@ -424,7 +424,7 @@ static s32 e1000_read_phy_reg_gg82563_80003es2lan(struct e1000_hw *hw,
+ 	udelay(200);
+ 
+ 	/* ...and verify the command was successful. */
+-	ret_val = e1000_read_phy_reg_m88(hw, page_select, &temp);
++	ret_val = e1000e_read_phy_reg_m88(hw, page_select, &temp);
+ 
+ 	if (((u16)offset >> GG82563_PAGE_SHIFT) != temp) {
+ 		ret_val = -E1000_ERR_PHY;
+@@ -433,7 +433,7 @@ static s32 e1000_read_phy_reg_gg82563_80003es2lan(struct e1000_hw *hw,
+ 
+ 	udelay(200);
+ 
+-	ret_val = e1000_read_phy_reg_m88(hw,
++	ret_val = e1000e_read_phy_reg_m88(hw,
+ 					 MAX_PHY_REG_ADDRESS & offset,
+ 					 data);
+ 
+@@ -468,7 +468,7 @@ static s32 e1000_write_phy_reg_gg82563_80003es2lan(struct e1000_hw *hw,
+ 		page_select = GG82563_PHY_PAGE_SELECT_ALT;
+ 
+ 	temp = (u16)((u16)offset >> GG82563_PAGE_SHIFT);
+-	ret_val = e1000_write_phy_reg_m88(hw, page_select, temp);
++	ret_val = e1000e_write_phy_reg_m88(hw, page_select, temp);
+ 	if (ret_val)
+ 		return ret_val;
+ 
+@@ -480,14 +480,14 @@ static s32 e1000_write_phy_reg_gg82563_80003es2lan(struct e1000_hw *hw,
+ 	udelay(200);
+ 
+ 	/* ...and verify the command was successful. */
+-	ret_val = e1000_read_phy_reg_m88(hw, page_select, &temp);
++	ret_val = e1000e_read_phy_reg_m88(hw, page_select, &temp);
+ 
+ 	if (((u16)offset >> GG82563_PAGE_SHIFT) != temp)
+ 		return -E1000_ERR_PHY;
+ 
+ 	udelay(200);
+ 
+-	ret_val = e1000_write_phy_reg_m88(hw,
++	ret_val = e1000e_write_phy_reg_m88(hw,
+ 					  MAX_PHY_REG_ADDRESS & offset,
+ 					  data);
+ 
+@@ -509,7 +509,7 @@ static s32 e1000_write_phy_reg_gg82563_80003es2lan(struct e1000_hw *hw,
+ static s32 e1000_write_nvm_80003es2lan(struct e1000_hw *hw, u16 offset,
+ 				       u16 words, u16 *data)
+ {
+-	return e1000_write_nvm_spi(hw, offset, words, data);
++	return e1000e_write_nvm_spi(hw, offset, words, data);
+ }
+ 
+ /**
+@@ -572,7 +572,7 @@ static s32 e1000_phy_force_speed_duplex_80003es2lan(struct e1000_hw *hw)
+ 	if (ret_val)
+ 		return ret_val;
+ 
+-	e1000_phy_force_speed_duplex_setup(hw, &phy_data);
++	e1000e_phy_force_speed_duplex_setup(hw, &phy_data);
+ 
+ 	/* Reset the phy to commit changes. */
+ 	phy_data |= MII_CR_RESET;
+@@ -587,7 +587,7 @@ static s32 e1000_phy_force_speed_duplex_80003es2lan(struct e1000_hw *hw)
+ 		hw_dbg(hw, "Waiting for forced speed/duplex link "
+ 			 "on GG82563 phy.\n");
+ 
+-		ret_val = e1000_phy_has_link_generic(hw, PHY_FORCE_LIMIT,
++		ret_val = e1000e_phy_has_link_generic(hw, PHY_FORCE_LIMIT,
+ 						     100000, &link);
+ 		if (ret_val)
+ 			return ret_val;
+@@ -596,13 +596,13 @@ static s32 e1000_phy_force_speed_duplex_80003es2lan(struct e1000_hw *hw)
+ 			/* We didn't get link.
+ 			 * Reset the DSP and cross our fingers.
+ 			 */
+-			ret_val = e1000_phy_reset_dsp(hw);
++			ret_val = e1000e_phy_reset_dsp(hw);
+ 			if (ret_val)
+ 				return ret_val;
+ 		}
+ 
+ 		/* Try once more */
+-		ret_val = e1000_phy_has_link_generic(hw, PHY_FORCE_LIMIT,
++		ret_val = e1000e_phy_has_link_generic(hw, PHY_FORCE_LIMIT,
+ 						     100000, &link);
+ 		if (ret_val)
+ 			return ret_val;
+@@ -672,7 +672,7 @@ static s32 e1000_get_link_up_info_80003es2lan(struct e1000_hw *hw, u16 *speed,
+ 	s32 ret_val;
+ 
+ 	if (hw->media_type == e1000_media_type_copper) {
+-		ret_val = e1000_get_speed_and_duplex_copper(hw,
++		ret_val = e1000e_get_speed_and_duplex_copper(hw,
+ 								    speed,
+ 								    duplex);
+ 		if (ret_val)
+@@ -683,7 +683,7 @@ static s32 e1000_get_link_up_info_80003es2lan(struct e1000_hw *hw, u16 *speed,
+ 			ret_val = e1000_cfg_kmrn_10_100_80003es2lan(hw,
+ 							      *duplex);
+ 	} else {
+-		ret_val = e1000_get_speed_and_duplex_fiber_serdes(hw,
++		ret_val = e1000e_get_speed_and_duplex_fiber_serdes(hw,
+ 								  speed,
+ 								  duplex);
+ 	}
+@@ -707,7 +707,7 @@ static s32 e1000_reset_hw_80003es2lan(struct e1000_hw *hw)
+ 	/* Prevent the PCI-E bus from sticking if there is no TLP connection
+ 	 * on the last TLP read/write transaction when MAC is reset.
+ 	 */
+-	ret_val = e1000_disable_pcie_master(hw);
++	ret_val = e1000e_disable_pcie_master(hw);
+ 	if (ret_val)
+ 		hw_dbg(hw, "PCI-E Master disable polling has failed.\n");
+ 
+@@ -725,7 +725,7 @@ static s32 e1000_reset_hw_80003es2lan(struct e1000_hw *hw)
+ 	hw_dbg(hw, "Issuing a global reset to MAC\n");
+ 	ew32(CTRL, ctrl | E1000_CTRL_RST);
+ 
+-	ret_val = e1000_get_auto_rd_done(hw);
++	ret_val = e1000e_get_auto_rd_done(hw);
+ 	if (ret_val)
+ 		/* We don't want to continue accessing MAC registers. */
+ 		return ret_val;
+@@ -754,7 +754,7 @@ static s32 e1000_init_hw_80003es2lan(struct e1000_hw *hw)
+ 	e1000_initialize_hw_bits_80003es2lan(hw);
+ 
+ 	/* Initialize identification LED */
+-	ret_val = e1000_id_led_init(hw);
++	ret_val = e1000e_id_led_init(hw);
+ 	if (ret_val) {
+ 		hw_dbg(hw, "Error initializing identification LED\n");
+ 		return ret_val;
+@@ -762,10 +762,10 @@ static s32 e1000_init_hw_80003es2lan(struct e1000_hw *hw)
+ 
+ 	/* Disabling VLAN filtering */
+ 	hw_dbg(hw, "Initializing the IEEE VLAN\n");
+-	e1000_clear_vfta(hw);
++	e1000e_clear_vfta(hw);
+ 
+ 	/* Setup the receive address. */
+-	e1000_init_rx_addrs(hw, mac->rar_entry_count);
++	e1000e_init_rx_addrs(hw, mac->rar_entry_count);
+ 
+ 	/* Zero out the Multicast HASH table */
+ 	hw_dbg(hw, "Zeroing the MTA\n");
+@@ -773,7 +773,7 @@ static s32 e1000_init_hw_80003es2lan(struct e1000_hw *hw)
+ 		E1000_WRITE_REG_ARRAY(hw, E1000_MTA, i, 0);
+ 
+ 	/* Setup link and flow control */
+-	ret_val = e1000_setup_link(hw);
++	ret_val = e1000e_setup_link(hw);
+ 
+ 	/* Set the transmit descriptor write-back policy */
+ 	reg_data = er32(TXDCTL);
+@@ -922,14 +922,14 @@ static s32 e1000_copper_link_setup_gg82563_80003es2lan(struct e1000_hw *hw)
+ 		return ret_val;
+ 
+ 	/* SW Reset the PHY so all changes take effect */
+-	ret_val = e1000_commit_phy(hw);
++	ret_val = e1000e_commit_phy(hw);
+ 	if (ret_val) {
+ 		hw_dbg(hw, "Error Resetting the PHY\n");
+ 		return ret_val;
+ 	}
+ 
+ 	/* Bypass RX and TX FIFO's */
+-	ret_val = e1000_write_kmrn_reg(hw,
++	ret_val = e1000e_write_kmrn_reg(hw,
+ 				E1000_KMRNCTRLSTA_OFFSET_FIFO_CTRL,
+ 				E1000_KMRNCTRLSTA_FIFO_CTRL_RX_BYPASS |
+ 					E1000_KMRNCTRLSTA_FIFO_CTRL_TX_BYPASS);
+@@ -957,7 +957,7 @@ static s32 e1000_copper_link_setup_gg82563_80003es2lan(struct e1000_hw *hw)
+ 	 * firmware will have already initialized them.  We only initialize
+ 	 * them if the HW is not in IAMT mode.
+ 	 */
+-	if (!e1000_check_mng_mode(hw)) {
++	if (!e1000e_check_mng_mode(hw)) {
+ 		/* Enable Electrical Idle on the PHY */
+ 		data |= GG82563_PMCR_ENABLE_ELECTRICAL_IDLE;
+ 		ret_val = e1e_wphy(hw, GG82563_PHY_PWR_MGMT_CTRL, data);
+@@ -1010,23 +1010,23 @@ static s32 e1000_setup_copper_link_80003es2lan(struct e1000_hw *hw)
+ 	/* Set the mac to wait the maximum time between each
+ 	 * iteration and increase the max iterations when
+ 	 * polling the phy; this fixes erroneous timeouts at 10Mbps. */
+-	ret_val = e1000_write_kmrn_reg(hw, GG82563_REG(0x34, 4), 0xFFFF);
++	ret_val = e1000e_write_kmrn_reg(hw, GG82563_REG(0x34, 4), 0xFFFF);
+ 	if (ret_val)
+ 		return ret_val;
+-	ret_val = e1000_read_kmrn_reg(hw, GG82563_REG(0x34, 9), &reg_data);
++	ret_val = e1000e_read_kmrn_reg(hw, GG82563_REG(0x34, 9), &reg_data);
+ 	if (ret_val)
+ 		return ret_val;
+ 	reg_data |= 0x3F;
+-	ret_val = e1000_write_kmrn_reg(hw, GG82563_REG(0x34, 9), reg_data);
++	ret_val = e1000e_write_kmrn_reg(hw, GG82563_REG(0x34, 9), reg_data);
+ 	if (ret_val)
+ 		return ret_val;
+-	ret_val = e1000_read_kmrn_reg(hw,
++	ret_val = e1000e_read_kmrn_reg(hw,
+ 				      E1000_KMRNCTRLSTA_OFFSET_INB_CTRL,
+ 				      &reg_data);
+ 	if (ret_val)
+ 		return ret_val;
+ 	reg_data |= E1000_KMRNCTRLSTA_INB_CTRL_DIS_PADDING;
+-	ret_val = e1000_write_kmrn_reg(hw,
++	ret_val = e1000e_write_kmrn_reg(hw,
+ 				       E1000_KMRNCTRLSTA_OFFSET_INB_CTRL,
+ 				       reg_data);
+ 	if (ret_val)
+@@ -1036,7 +1036,7 @@ static s32 e1000_setup_copper_link_80003es2lan(struct e1000_hw *hw)
+ 	if (ret_val)
+ 		return ret_val;
+ 
+-	ret_val = e1000_setup_copper_link(hw);
++	ret_val = e1000e_setup_copper_link(hw);
+ 
+ 	return 0;
+ }
+@@ -1056,7 +1056,7 @@ static s32 e1000_cfg_kmrn_10_100_80003es2lan(struct e1000_hw *hw, u16 duplex)
+ 	u16 reg_data;
+ 
+ 	reg_data = E1000_KMRNCTRLSTA_HD_CTRL_10_100_DEFAULT;
+-	ret_val = e1000_write_kmrn_reg(hw,
++	ret_val = e1000e_write_kmrn_reg(hw,
+ 				       E1000_KMRNCTRLSTA_OFFSET_HD_CTRL,
+ 				       reg_data);
+ 	if (ret_val)
+@@ -1096,7 +1096,7 @@ static s32 e1000_cfg_kmrn_1000_80003es2lan(struct e1000_hw *hw)
+ 	u32 tipg;
+ 
+ 	reg_data = E1000_KMRNCTRLSTA_HD_CTRL_1000_DEFAULT;
+-	ret_val = e1000_write_kmrn_reg(hw,
++	ret_val = e1000e_write_kmrn_reg(hw,
+ 				       E1000_KMRNCTRLSTA_OFFSET_HD_CTRL,
+ 				       reg_data);
+ 	if (ret_val)
+@@ -1128,7 +1128,7 @@ static void e1000_clear_hw_cntrs_80003es2lan(struct e1000_hw *hw)
+ {
+ 	u32 temp;
+ 
+-	e1000_clear_hw_cntrs_base(hw);
++	e1000e_clear_hw_cntrs_base(hw);
+ 
+ 	temp = er32(PRC64);
+ 	temp = er32(PRC127);
+@@ -1169,42 +1169,42 @@ static void e1000_clear_hw_cntrs_80003es2lan(struct e1000_hw *hw)
+ static struct e1000_mac_operations es2_mac_ops = {
+ 	.mng_mode_enab		= E1000_MNG_IAMT_MODE << E1000_FWSM_MODE_SHIFT,
+ 	/* check_for_link dependent on media type */
+-	.cleanup_led		= e1000_cleanup_led_generic,
++	.cleanup_led		= e1000e_cleanup_led_generic,
+ 	.clear_hw_cntrs		= e1000_clear_hw_cntrs_80003es2lan,
+-	.get_bus_info		= e1000_get_bus_info_pcie,
++	.get_bus_info		= e1000e_get_bus_info_pcie,
+ 	.get_link_up_info	= e1000_get_link_up_info_80003es2lan,
+-	.led_on			= e1000_led_on_generic,
+-	.led_off		= e1000_led_off_generic,
+-	.mc_addr_list_update	= e1000_mc_addr_list_update_generic,
++	.led_on			= e1000e_led_on_generic,
++	.led_off		= e1000e_led_off_generic,
++	.mc_addr_list_update	= e1000e_mc_addr_list_update_generic,
+ 	.reset_hw		= e1000_reset_hw_80003es2lan,
+ 	.init_hw		= e1000_init_hw_80003es2lan,
+-	.setup_link		= e1000_setup_link,
++	.setup_link		= e1000e_setup_link,
+ 	/* setup_physical_interface dependent on media type */
+ };
+ 
+ static struct e1000_phy_operations es2_phy_ops = {
+ 	.acquire_phy		= e1000_acquire_phy_80003es2lan,
+-	.check_reset_block	= e1000_check_reset_block_generic,
+-	.commit_phy	 	= e1000_phy_sw_reset,
++	.check_reset_block	= e1000e_check_reset_block_generic,
++	.commit_phy	 	= e1000e_phy_sw_reset,
+ 	.force_speed_duplex 	= e1000_phy_force_speed_duplex_80003es2lan,
+ 	.get_cfg_done       	= e1000_get_cfg_done_80003es2lan,
+ 	.get_cable_length   	= e1000_get_cable_length_80003es2lan,
+-	.get_phy_info       	= e1000_get_phy_info_m88,
++	.get_phy_info       	= e1000e_get_phy_info_m88,
+ 	.read_phy_reg       	= e1000_read_phy_reg_gg82563_80003es2lan,
+ 	.release_phy		= e1000_release_phy_80003es2lan,
+-	.reset_phy	  	= e1000_phy_hw_reset_generic,
++	.reset_phy	  	= e1000e_phy_hw_reset_generic,
+ 	.set_d0_lplu_state  	= NULL,
+-	.set_d3_lplu_state  	= e1000_set_d3_lplu_state,
++	.set_d3_lplu_state  	= e1000e_set_d3_lplu_state,
+ 	.write_phy_reg      	= e1000_write_phy_reg_gg82563_80003es2lan,
+ };
+ 
+ static struct e1000_nvm_operations es2_nvm_ops = {
+ 	.acquire_nvm		= e1000_acquire_nvm_80003es2lan,
+-	.read_nvm		= e1000_read_nvm_eerd,
++	.read_nvm		= e1000e_read_nvm_eerd,
+ 	.release_nvm		= e1000_release_nvm_80003es2lan,
+-	.update_nvm		= e1000_update_nvm_checksum_generic,
+-	.valid_led_default	= e1000_valid_led_default,
+-	.validate_nvm		= e1000_validate_nvm_checksum_generic,
++	.update_nvm		= e1000e_update_nvm_checksum_generic,
++	.valid_led_default	= e1000e_valid_led_default,
++	.validate_nvm		= e1000e_validate_nvm_checksum_generic,
+ 	.write_nvm		= e1000_write_nvm_80003es2lan,
+ };
+ 
+diff --git a/drivers/net/e1000e/ethtool.c b/drivers/net/e1000e/ethtool.c
+index a8fa1db..c9d74a8 100644
+--- a/drivers/net/e1000e/ethtool.c
++++ b/drivers/net/e1000e/ethtool.c
+@@ -246,10 +246,10 @@ static int e1000_set_settings(struct net_device *netdev,
+ 	/* reset the link */
+ 
+ 	if (netif_running(adapter->netdev)) {
+-		e1000_down(adapter);
+-		e1000_up(adapter);
++		e1000e_down(adapter);
++		e1000e_up(adapter);
+ 	} else {
+-		e1000_reset(adapter);
++		e1000e_reset(adapter);
+ 	}
+ 
+ 	clear_bit(__E1000_RESETTING, &adapter->state);
+@@ -300,14 +300,14 @@ static int e1000_set_pauseparam(struct net_device *netdev,
+ 
+ 	if (adapter->fc_autoneg == AUTONEG_ENABLE) {
+ 		if (netif_running(adapter->netdev)) {
+-			e1000_down(adapter);
+-			e1000_up(adapter);
++			e1000e_down(adapter);
++			e1000e_up(adapter);
+ 		} else {
+-			e1000_reset(adapter);
++			e1000e_reset(adapter);
+ 		}
+ 	} else {
+ 		retval = ((hw->media_type == e1000_media_type_fiber) ?
+-			  hw->mac.ops.setup_link(hw) : e1000_force_mac_fc(hw));
++			  hw->mac.ops.setup_link(hw) : e1000e_force_mac_fc(hw));
+ 	}
+ 
+ 	clear_bit(__E1000_RESETTING, &adapter->state);
+@@ -330,9 +330,9 @@ static int e1000_set_rx_csum(struct net_device *netdev, u32 data)
+ 		adapter->flags &= ~FLAG_RX_CSUM_ENABLED;
+ 
+ 	if (netif_running(netdev))
+-		e1000_reinit_locked(adapter);
++		e1000e_reinit_locked(adapter);
+ 	else
+-		e1000_reset(adapter);
++		e1000e_reset(adapter);
+ 	return 0;
+ }
+ 
+@@ -549,7 +549,7 @@ static int e1000_set_eeprom(struct net_device *netdev,
+ 	 * and flush shadow RAM for 82573 controllers */
+ 	if ((ret_val == 0) && ((first_word <= NVM_CHECKSUM_REG) ||
+ 			       (hw->mac.type == e1000_82573)))
+-		e1000_update_nvm_checksum(hw);
++		e1000e_update_nvm_checksum(hw);
+ 
+ 	kfree(eeprom_buff);
+ 	return ret_val;
+@@ -562,8 +562,8 @@ static void e1000_get_drvinfo(struct net_device *netdev,
+ 	char firmware_version[32];
+ 	u16 eeprom_data;
+ 
+-	strncpy(drvinfo->driver,  e1000_driver_name, 32);
+-	strncpy(drvinfo->version, e1000_driver_version, 32);
++	strncpy(drvinfo->driver,  e1000e_driver_name, 32);
++	strncpy(drvinfo->version, e1000e_driver_version, 32);
+ 
+ 	/* EEPROM image version # is reported as firmware version # for
+ 	 * PCI-E controllers */
+@@ -613,7 +613,7 @@ static int e1000_set_ringparam(struct net_device *netdev,
+ 		msleep(1);
+ 
+ 	if (netif_running(adapter->netdev))
+-		e1000_down(adapter);
++		e1000e_down(adapter);
+ 
+ 	tx_old = adapter->tx_ring;
+ 	rx_old = adapter->rx_ring;
+@@ -640,10 +640,10 @@ static int e1000_set_ringparam(struct net_device *netdev,
+ 
+ 	if (netif_running(adapter->netdev)) {
+ 		/* Try to get new resources before deleting old */
+-		err = e1000_setup_rx_resources(adapter);
++		err = e1000e_setup_rx_resources(adapter);
+ 		if (err)
+ 			goto err_setup_rx;
+-		err = e1000_setup_tx_resources(adapter);
++		err = e1000e_setup_tx_resources(adapter);
+ 		if (err)
+ 			goto err_setup_tx;
+ 
+@@ -651,13 +651,13 @@ static int e1000_set_ringparam(struct net_device *netdev,
+ 		 * then restore the new back again */
+ 		adapter->rx_ring = rx_old;
+ 		adapter->tx_ring = tx_old;
+-		e1000_free_rx_resources(adapter);
+-		e1000_free_tx_resources(adapter);
++		e1000e_free_rx_resources(adapter);
++		e1000e_free_tx_resources(adapter);
+ 		kfree(tx_old);
+ 		kfree(rx_old);
+ 		adapter->rx_ring = rx_ring;
+ 		adapter->tx_ring = tx_ring;
+-		err = e1000_up(adapter);
++		err = e1000e_up(adapter);
+ 		if (err)
+ 			goto err_setup;
+ 	}
+@@ -665,7 +665,7 @@ static int e1000_set_ringparam(struct net_device *netdev,
+ 	clear_bit(__E1000_RESETTING, &adapter->state);
+ 	return 0;
+ err_setup_tx:
+-	e1000_free_rx_resources(adapter);
++	e1000e_free_rx_resources(adapter);
+ err_setup_rx:
+ 	adapter->rx_ring = rx_old;
+ 	adapter->tx_ring = tx_old;
+@@ -673,7 +673,7 @@ err_setup_rx:
+ err_alloc_rx:
+ 	kfree(tx_ring);
+ err_alloc_tx:
+-	e1000_up(adapter);
++	e1000e_up(adapter);
+ err_setup:
+ 	clear_bit(__E1000_RESETTING, &adapter->state);
+ 	return err;
+@@ -1326,7 +1326,7 @@ static void e1000_loopback_cleanup(struct e1000_adapter *adapter)
+ 		if (phy_reg & MII_CR_LOOPBACK) {
+ 			phy_reg &= ~MII_CR_LOOPBACK;
+ 			e1e_wphy(hw, PHY_CONTROL, phy_reg);
+-			e1000_commit_phy(hw);
++			e1000e_commit_phy(hw);
+ 		}
+ 		break;
+ 	}
+@@ -1517,22 +1517,22 @@ static void e1000_diag_test(struct net_device *netdev,
+ 			/* indicate we're in test mode */
+ 			dev_close(netdev);
+ 		else
+-			e1000_reset(adapter);
++			e1000e_reset(adapter);
+ 
+ 		if (e1000_reg_test(adapter, &data[0]))
+ 			eth_test->flags |= ETH_TEST_FL_FAILED;
+ 
+-		e1000_reset(adapter);
++		e1000e_reset(adapter);
+ 		if (e1000_eeprom_test(adapter, &data[1]))
+ 			eth_test->flags |= ETH_TEST_FL_FAILED;
+ 
+-		e1000_reset(adapter);
++		e1000e_reset(adapter);
+ 		if (e1000_intr_test(adapter, &data[2]))
+ 			eth_test->flags |= ETH_TEST_FL_FAILED;
+ 
+-		e1000_reset(adapter);
++		e1000e_reset(adapter);
+ 		/* make sure the phy is powered up */
+-		e1000_power_up_phy(adapter);
++		e1000e_power_up_phy(adapter);
+ 		if (e1000_loopback_test(adapter, &data[3]))
+ 			eth_test->flags |= ETH_TEST_FL_FAILED;
+ 
+@@ -1543,7 +1543,7 @@ static void e1000_diag_test(struct net_device *netdev,
+ 
+ 		/* force this routine to wait until autoneg complete/timeout */
+ 		adapter->hw.phy.wait_for_link = 1;
+-		e1000_reset(adapter);
++		e1000e_reset(adapter);
+ 		adapter->hw.phy.wait_for_link = 0;
+ 
+ 		clear_bit(__E1000_TESTING, &adapter->state);
+@@ -1663,7 +1663,7 @@ static int e1000_phys_id(struct net_device *netdev, u32 data)
+ 		e1e_wphy(&adapter->hw,
+ 				    IFE_PHY_SPECIAL_CONTROL_LED, 0);
+ 	} else {
+-		e1000_blink_led(&adapter->hw);
++		e1000e_blink_led(&adapter->hw);
+ 		msleep_interruptible(data * 1000);
+ 	}
+ 
+@@ -1678,7 +1678,7 @@ static int e1000_nway_reset(struct net_device *netdev)
+ {
+ 	struct e1000_adapter *adapter = netdev_priv(netdev);
+ 	if (netif_running(netdev))
+-		e1000_reinit_locked(adapter);
++		e1000e_reinit_locked(adapter);
+ 	return 0;
+ }
+ 
+@@ -1694,7 +1694,7 @@ static void e1000_get_ethtool_stats(struct net_device *netdev,
+ 	struct e1000_adapter *adapter = netdev_priv(netdev);
+ 	int i;
+ 
+-	e1000_update_stats(adapter);
++	e1000e_update_stats(adapter);
+ 	for (i = 0; i < E1000_GLOBAL_STATS_LEN; i++) {
+ 		char *p = (char *)adapter+e1000_gstrings_stats[i].stat_offset;
+ 		data[i] = (e1000_gstrings_stats[i].sizeof_stat ==
+@@ -1758,7 +1758,7 @@ static const struct ethtool_ops e1000_ethtool_ops = {
+ 	.get_ethtool_stats	= e1000_get_ethtool_stats,
+ };
+ 
+-void e1000_set_ethtool_ops(struct net_device *netdev)
++void e1000e_set_ethtool_ops(struct net_device *netdev)
+ {
+ 	SET_ETHTOOL_OPS(netdev, &e1000_ethtool_ops);
+ }
+diff --git a/drivers/net/e1000e/ich8lan.c b/drivers/net/e1000e/ich8lan.c
+index 85095af..8f8139d 100644
+--- a/drivers/net/e1000e/ich8lan.c
++++ b/drivers/net/e1000e/ich8lan.c
+@@ -199,10 +199,10 @@ static s32 e1000_init_phy_params_ich8lan(struct e1000_hw *hw)
+ 	phy->reset_delay_us		= 100;
+ 
+ 	phy->id = 0;
+-	while ((e1000_phy_unknown == e1000_get_phy_type_from_id(phy->id)) &&
++	while ((e1000_phy_unknown == e1000e_get_phy_type_from_id(phy->id)) &&
+ 	       (i++ < 100)) {
+ 		msleep(1);
+-		ret_val = e1000_get_phy_id(hw);
++		ret_val = e1000e_get_phy_id(hw);
+ 		if (ret_val)
+ 			return ret_val;
+ 	}
+@@ -308,7 +308,7 @@ static s32 e1000_init_mac_params_ich8lan(struct e1000_adapter *adapter)
+ 
+ 	/* Enable PCS Lock-loss workaround for ICH8 */
+ 	if (mac->type == e1000_ich8lan)
+-		e1000_set_kmrn_lock_loss_workaround_ich8lan(hw, 1);
++		e1000e_set_kmrn_lock_loss_workaround_ich8lan(hw, 1);
+ 
+ 	return 0;
+ }
+@@ -420,7 +420,7 @@ static s32 e1000_phy_force_speed_duplex_ich8lan(struct e1000_hw *hw)
+ 	bool link;
+ 
+ 	if (phy->type != e1000_phy_ife) {
+-		ret_val = e1000_phy_force_speed_duplex_igp(hw);
++		ret_val = e1000e_phy_force_speed_duplex_igp(hw);
+ 		return ret_val;
+ 	}
+ 
+@@ -428,7 +428,7 @@ static s32 e1000_phy_force_speed_duplex_ich8lan(struct e1000_hw *hw)
+ 	if (ret_val)
+ 		return ret_val;
+ 
+-	e1000_phy_force_speed_duplex_setup(hw, &data);
++	e1000e_phy_force_speed_duplex_setup(hw, &data);
+ 
+ 	ret_val = e1e_wphy(hw, PHY_CONTROL, data);
+ 	if (ret_val)
+@@ -453,7 +453,7 @@ static s32 e1000_phy_force_speed_duplex_ich8lan(struct e1000_hw *hw)
+ 	if (phy->wait_for_link) {
+ 		hw_dbg(hw, "Waiting for forced speed/duplex link on IFE phy.\n");
+ 
+-		ret_val = e1000_phy_has_link_generic(hw,
++		ret_val = e1000e_phy_has_link_generic(hw,
+ 						     PHY_FORCE_LIMIT,
+ 						     100000,
+ 						     &link);
+@@ -464,7 +464,7 @@ static s32 e1000_phy_force_speed_duplex_ich8lan(struct e1000_hw *hw)
+ 			hw_dbg(hw, "Link taking longer than expected.\n");
+ 
+ 		/* Try once more */
+-		ret_val = e1000_phy_has_link_generic(hw,
++		ret_val = e1000e_phy_has_link_generic(hw,
+ 						     PHY_FORCE_LIMIT,
+ 						     100000,
+ 						     &link);
+@@ -492,7 +492,7 @@ static s32 e1000_phy_hw_reset_ich8lan(struct e1000_hw *hw)
+ 	u16 loop = E1000_ICH8_LAN_INIT_TIMEOUT;
+ 	u16 word_addr, reg_data, reg_addr, phy_page = 0;
+ 
+-	ret_val = e1000_phy_hw_reset_generic(hw);
++	ret_val = e1000e_phy_hw_reset_generic(hw);
+ 	if (ret_val)
+ 		return ret_val;
+ 
+@@ -604,7 +604,7 @@ static s32 e1000_get_phy_info_ife_ich8lan(struct e1000_hw *hw)
+ 	u16 data;
+ 	bool link;
+ 
+-	ret_val = e1000_phy_has_link_generic(hw, 1, 0, &link);
++	ret_val = e1000e_phy_has_link_generic(hw, 1, 0, &link);
+ 	if (ret_val)
+ 		return ret_val;
+ 
+@@ -658,7 +658,7 @@ static s32 e1000_get_phy_info_ich8lan(struct e1000_hw *hw)
+ 		return e1000_get_phy_info_ife_ich8lan(hw);
+ 		break;
+ 	case e1000_phy_igp_3:
+-		return e1000_get_phy_info_igp(hw);
++		return e1000e_get_phy_info_igp(hw);
+ 		break;
+ 	default:
+ 		break;
+@@ -735,7 +735,7 @@ static s32 e1000_set_d0_lplu_state_ich8lan(struct e1000_hw *hw, bool active)
+ 		 * any PHY registers */
+ 		if ((hw->mac.type == e1000_ich8lan) &&
+ 		    (hw->phy.type == e1000_phy_igp_3))
+-			e1000_gig_downshift_workaround_ich8lan(hw);
++			e1000e_gig_downshift_workaround_ich8lan(hw);
+ 
+ 		/* When LPLU is enabled, we should disable SmartSpeed */
+ 		ret_val = e1e_rphy(hw, IGP01E1000_PHY_PORT_CONFIG, &data);
+@@ -845,7 +845,7 @@ static s32 e1000_set_d3_lplu_state_ich8lan(struct e1000_hw *hw, bool active)
+ 		 * any PHY registers */
+ 		if ((hw->mac.type == e1000_ich8lan) &&
+ 		    (hw->phy.type == e1000_phy_igp_3))
+-			e1000_gig_downshift_workaround_ich8lan(hw);
++			e1000e_gig_downshift_workaround_ich8lan(hw);
+ 
+ 		/* When LPLU is enabled, we should disable SmartSpeed */
+ 		ret_val = e1e_rphy(hw,
+@@ -1166,7 +1166,7 @@ static s32 e1000_update_nvm_checksum_ich8lan(struct e1000_hw *hw)
+ 	s32 ret_val;
+ 	u16 data;
+ 
+-	ret_val = e1000_update_nvm_checksum_generic(hw);
++	ret_val = e1000e_update_nvm_checksum_generic(hw);
+ 	if (ret_val)
+ 		return ret_val;;
+ 
+@@ -1275,7 +1275,7 @@ static s32 e1000_update_nvm_checksum_ich8lan(struct e1000_hw *hw)
+ 	/* Reload the EEPROM, or else modifications will not appear
+ 	 * until after the next adapter reset.
+ 	 */
+-	e1000_reload_nvm(hw);
++	e1000e_reload_nvm(hw);
+ 	msleep(10);
+ 
+ 	return ret_val;
+@@ -1308,12 +1308,12 @@ static s32 e1000_validate_nvm_checksum_ich8lan(struct e1000_hw *hw)
+ 		ret_val = e1000_write_nvm(hw, 0x19, 1, &data);
+ 		if (ret_val)
+ 			return ret_val;
+-		ret_val = e1000_update_nvm_checksum(hw);
++		ret_val = e1000e_update_nvm_checksum(hw);
+ 		if (ret_val)
+ 			return ret_val;
+ 	}
+ 
+-	return e1000_validate_nvm_checksum_generic(hw);
++	return e1000e_validate_nvm_checksum_generic(hw);
+ }
+ 
+ /**
+@@ -1583,7 +1583,7 @@ static s32 e1000_get_bus_info_ich8lan(struct e1000_hw *hw)
+ 	struct e1000_bus_info *bus = &hw->bus;
+ 	s32 ret_val;
+ 
+-	ret_val = e1000_get_bus_info_pcie(hw);
++	ret_val = e1000e_get_bus_info_pcie(hw);
+ 
+ 	/* ICH devices are "PCI Express"-ish.  They have
+ 	 * a configuration space, but do not contain
+@@ -1611,7 +1611,7 @@ static s32 e1000_reset_hw_ich8lan(struct e1000_hw *hw)
+ 	/* Prevent the PCI-E bus from sticking if there is no TLP connection
+ 	 * on the last TLP read/write transaction when MAC is reset.
+ 	 */
+-	ret_val = e1000_disable_pcie_master(hw);
++	ret_val = e1000e_disable_pcie_master(hw);
+ 	if (ret_val) {
+ 		hw_dbg(hw, "PCI-E Master disable polling has failed.\n");
+ 	}
+@@ -1651,7 +1651,7 @@ static s32 e1000_reset_hw_ich8lan(struct e1000_hw *hw)
+ 	ew32(CTRL, (ctrl | E1000_CTRL_RST));
+ 	msleep(20);
+ 
+-	ret_val = e1000_get_auto_rd_done(hw);
++	ret_val = e1000e_get_auto_rd_done(hw);
+ 	if (ret_val) {
+ 		/*
+ 		 * When auto config read does not complete, do not
+@@ -1693,14 +1693,14 @@ static s32 e1000_init_hw_ich8lan(struct e1000_hw *hw)
+ 	e1000_initialize_hw_bits_ich8lan(hw);
+ 
+ 	/* Initialize identification LED */
+-	ret_val = e1000_id_led_init(hw);
++	ret_val = e1000e_id_led_init(hw);
+ 	if (ret_val) {
+ 		hw_dbg(hw, "Error initializing identification LED\n");
+ 		return ret_val;
+ 	}
+ 
+ 	/* Setup the receive address. */
+-	e1000_init_rx_addrs(hw, mac->rar_entry_count);
++	e1000e_init_rx_addrs(hw, mac->rar_entry_count);
+ 
+ 	/* Zero out the Multicast HASH table */
+ 	hw_dbg(hw, "Zeroing the MTA\n");
+@@ -1730,7 +1730,7 @@ static s32 e1000_init_hw_ich8lan(struct e1000_hw *hw)
+ 		snoop = PCIE_ICH8_SNOOP_ALL;
+ 	else
+ 		snoop = (u32) ~(PCIE_NO_SNOOP_ALL);
+-	e1000_set_pcie_no_snoop(hw, snoop);
++	e1000e_set_pcie_no_snoop(hw, snoop);
+ 
+ 	ctrl_ext = er32(CTRL_EXT);
+ 	ctrl_ext |= E1000_CTRL_EXT_RO_DIS;
+@@ -1831,7 +1831,7 @@ static s32 e1000_setup_link_ich8lan(struct e1000_hw *hw)
+ 
+ 	ew32(FCTTV, mac->fc_pause_time);
+ 
+-	return e1000_set_fc_watermarks(hw);
++	return e1000e_set_fc_watermarks(hw);
+ }
+ 
+ /**
+@@ -1856,24 +1856,24 @@ static s32 e1000_setup_copper_link_ich8lan(struct e1000_hw *hw)
+ 	/* Set the mac to wait the maximum time between each iteration
+ 	 * and increase the max iterations when polling the phy;
+ 	 * this fixes erroneous timeouts at 10Mbps. */
+-	ret_val = e1000_write_kmrn_reg(hw, GG82563_REG(0x34, 4), 0xFFFF);
++	ret_val = e1000e_write_kmrn_reg(hw, GG82563_REG(0x34, 4), 0xFFFF);
+ 	if (ret_val)
+ 		return ret_val;
+-	ret_val = e1000_read_kmrn_reg(hw, GG82563_REG(0x34, 9), &reg_data);
++	ret_val = e1000e_read_kmrn_reg(hw, GG82563_REG(0x34, 9), &reg_data);
+ 	if (ret_val)
+ 		return ret_val;
+ 	reg_data |= 0x3F;
+-	ret_val = e1000_write_kmrn_reg(hw, GG82563_REG(0x34, 9), reg_data);
++	ret_val = e1000e_write_kmrn_reg(hw, GG82563_REG(0x34, 9), reg_data);
+ 	if (ret_val)
+ 		return ret_val;
+ 
+ 	if (hw->phy.type == e1000_phy_igp_3) {
+-		ret_val = e1000_copper_link_setup_igp(hw);
++		ret_val = e1000e_copper_link_setup_igp(hw);
+ 		if (ret_val)
+ 			return ret_val;
+ 	}
+ 
+-	return e1000_setup_copper_link(hw);
++	return e1000e_setup_copper_link(hw);
+ }
+ 
+ /**
+@@ -1891,7 +1891,7 @@ static s32 e1000_get_link_up_info_ich8lan(struct e1000_hw *hw, u16 *speed,
+ {
+ 	s32 ret_val;
+ 
+-	ret_val = e1000_get_speed_and_duplex_copper(hw, speed, duplex);
++	ret_val = e1000e_get_speed_and_duplex_copper(hw, speed, duplex);
+ 	if (ret_val)
+ 		return ret_val;
+ 
+@@ -1933,7 +1933,7 @@ static s32 e1000_kmrn_lock_loss_workaround_ich8lan(struct e1000_hw *hw)
+ 	/* Make sure link is up before proceeding.  If not just return.
+ 	 * Attempting this while link is negotiating fouled up link
+ 	 * stability */
+-	ret_val = e1000_phy_has_link_generic(hw, 1, 0, &link);
++	ret_val = e1000e_phy_has_link_generic(hw, 1, 0, &link);
+ 	if (!link)
+ 		return 0;
+ 
+@@ -1963,7 +1963,7 @@ static s32 e1000_kmrn_lock_loss_workaround_ich8lan(struct e1000_hw *hw)
+ 
+ 	/* Call gig speed drop workaround on Giga disable before accessing
+ 	 * any PHY registers */
+-	e1000_gig_downshift_workaround_ich8lan(hw);
++	e1000e_gig_downshift_workaround_ich8lan(hw);
+ 
+ 	/* unable to acquire PCS lock */
+ 	return -E1000_ERR_PHY;
+@@ -1977,7 +1977,7 @@ static s32 e1000_kmrn_lock_loss_workaround_ich8lan(struct e1000_hw *hw)
+  *  If ICH8, set the current Kumeran workaround state (enabled - TRUE
+  *  /disabled - FALSE).
+  **/
+-void e1000_set_kmrn_lock_loss_workaround_ich8lan(struct e1000_hw *hw,
++void e1000e_set_kmrn_lock_loss_workaround_ich8lan(struct e1000_hw *hw,
+ 						 bool state)
+ {
+ 	struct e1000_dev_spec_ich8lan *dev_spec = &hw->dev_spec.ich8lan;
+@@ -2000,7 +2000,7 @@ void e1000_set_kmrn_lock_loss_workaround_ich8lan(struct e1000_hw *hw,
+  *    3) read it back
+  *  Continue if successful, else issue LCD reset and repeat
+  **/
+-void e1000_igp3_phy_powerdown_workaround_ich8lan(struct e1000_hw *hw)
++void e1000e_igp3_phy_powerdown_workaround_ich8lan(struct e1000_hw *hw)
+ {
+ 	u32 reg;
+ 	u16 data;
+@@ -2020,7 +2020,7 @@ void e1000_igp3_phy_powerdown_workaround_ich8lan(struct e1000_hw *hw)
+ 		/* Call gig speed drop workaround on Giga disable before
+ 		 * accessing any PHY registers */
+ 		if (hw->mac.type == e1000_ich8lan)
+-			e1000_gig_downshift_workaround_ich8lan(hw);
++			e1000e_gig_downshift_workaround_ich8lan(hw);
+ 
+ 		/* Write VR power-down enable */
+ 		e1e_rphy(hw, IGP3_VR_CTRL, &data);
+@@ -2041,7 +2041,7 @@ void e1000_igp3_phy_powerdown_workaround_ich8lan(struct e1000_hw *hw)
+ }
+ 
+ /**
+- *  e1000_gig_downshift_workaround_ich8lan - WoL from S5 stops working
++ *  e1000e_gig_downshift_workaround_ich8lan - WoL from S5 stops working
+  *  @hw: pointer to the HW structure
+  *
+  *  Steps to take when dropping from 1Gb/s (eg. link cable removal (LSC),
+@@ -2050,7 +2050,7 @@ void e1000_igp3_phy_powerdown_workaround_ich8lan(struct e1000_hw *hw)
+  *    2) Clear Kumeran Near-end loopback
+  *  Should only be called for ICH8[m] devices with IGP_3 Phy.
+  **/
+-void e1000_gig_downshift_workaround_ich8lan(struct e1000_hw *hw)
++void e1000e_gig_downshift_workaround_ich8lan(struct e1000_hw *hw)
+ {
+ 	s32 ret_val;
+ 	u16 reg_data;
+@@ -2059,17 +2059,17 @@ void e1000_gig_downshift_workaround_ich8lan(struct e1000_hw *hw)
+ 	    (hw->phy.type != e1000_phy_igp_3))
+ 		return;
+ 
+-	ret_val = e1000_read_kmrn_reg(hw, E1000_KMRNCTRLSTA_DIAG_OFFSET,
++	ret_val = e1000e_read_kmrn_reg(hw, E1000_KMRNCTRLSTA_DIAG_OFFSET,
+ 				      &reg_data);
+ 	if (ret_val)
+ 		return;
+ 	reg_data |= E1000_KMRNCTRLSTA_DIAG_NELPBK;
+-	ret_val = e1000_write_kmrn_reg(hw, E1000_KMRNCTRLSTA_DIAG_OFFSET,
++	ret_val = e1000e_write_kmrn_reg(hw, E1000_KMRNCTRLSTA_DIAG_OFFSET,
+ 				       reg_data);
+ 	if (ret_val)
+ 		return;
+ 	reg_data &= ~E1000_KMRNCTRLSTA_DIAG_NELPBK;
+-	ret_val = e1000_write_kmrn_reg(hw, E1000_KMRNCTRLSTA_DIAG_OFFSET,
++	ret_val = e1000e_write_kmrn_reg(hw, E1000_KMRNCTRLSTA_DIAG_OFFSET,
+ 				       reg_data);
+ }
+ 
+@@ -2131,7 +2131,7 @@ static void e1000_clear_hw_cntrs_ich8lan(struct e1000_hw *hw)
+ {
+ 	u32 temp;
+ 
+-	e1000_clear_hw_cntrs_base(hw);
++	e1000e_clear_hw_cntrs_base(hw);
+ 
+ 	temp = er32(ALGNERRC);
+ 	temp = er32(RXERRC);
+@@ -2151,14 +2151,14 @@ static void e1000_clear_hw_cntrs_ich8lan(struct e1000_hw *hw)
+ 
+ static struct e1000_mac_operations ich8_mac_ops = {
+ 	.mng_mode_enab		= E1000_ICH_MNG_IAMT_MODE << E1000_FWSM_MODE_SHIFT,
+-	.check_for_link		= e1000_check_for_copper_link,
++	.check_for_link		= e1000e_check_for_copper_link,
+ 	.cleanup_led		= e1000_cleanup_led_ich8lan,
+ 	.clear_hw_cntrs		= e1000_clear_hw_cntrs_ich8lan,
+ 	.get_bus_info		= e1000_get_bus_info_ich8lan,
+ 	.get_link_up_info	= e1000_get_link_up_info_ich8lan,
+ 	.led_on			= e1000_led_on_ich8lan,
+ 	.led_off		= e1000_led_off_ich8lan,
+-	.mc_addr_list_update	= e1000_mc_addr_list_update_generic,
++	.mc_addr_list_update	= e1000e_mc_addr_list_update_generic,
+ 	.reset_hw		= e1000_reset_hw_ich8lan,
+ 	.init_hw		= e1000_init_hw_ich8lan,
+ 	.setup_link		= e1000_setup_link_ich8lan,
+@@ -2170,15 +2170,15 @@ static struct e1000_phy_operations ich8_phy_ops = {
+ 	.check_reset_block	= e1000_check_reset_block_ich8lan,
+ 	.commit_phy		= NULL,
+ 	.force_speed_duplex	= e1000_phy_force_speed_duplex_ich8lan,
+-	.get_cfg_done		= e1000_get_cfg_done,
+-	.get_cable_length	= e1000_get_cable_length_igp_2,
++	.get_cfg_done		= e1000e_get_cfg_done,
++	.get_cable_length	= e1000e_get_cable_length_igp_2,
+ 	.get_phy_info		= e1000_get_phy_info_ich8lan,
+-	.read_phy_reg		= e1000_read_phy_reg_igp,
++	.read_phy_reg		= e1000e_read_phy_reg_igp,
+ 	.release_phy		= e1000_release_swflag_ich8lan,
+ 	.reset_phy		= e1000_phy_hw_reset_ich8lan,
+ 	.set_d0_lplu_state	= e1000_set_d0_lplu_state_ich8lan,
+ 	.set_d3_lplu_state	= e1000_set_d3_lplu_state_ich8lan,
+-	.write_phy_reg		= e1000_write_phy_reg_igp,
++	.write_phy_reg		= e1000e_write_phy_reg_igp,
+ };
+ 
+ static struct e1000_nvm_operations ich8_nvm_ops = {
+diff --git a/drivers/net/e1000e/lib.c b/drivers/net/e1000e/lib.c
+index c92ea77..a04c1e4 100644
+--- a/drivers/net/e1000e/lib.c
++++ b/drivers/net/e1000e/lib.c
+@@ -47,14 +47,14 @@ enum e1000_mng_mode {
+ 						    * Technology signature */
+ 
+ /**
+- *  e1000_get_bus_info_pcie - Get PCIe bus information
++ *  e1000e_get_bus_info_pcie - Get PCIe bus information
+  *  @hw: pointer to the HW structure
+  *
+  *  Determines and stores the system bus information for a particular
+  *  network interface.  The following bus information is determined and stored:
+  *  bus speed, bus width, type (PCIe), and PCIe function.
+  **/
+-s32 e1000_get_bus_info_pcie(struct e1000_hw *hw)
++s32 e1000e_get_bus_info_pcie(struct e1000_hw *hw)
+ {
+ 	struct e1000_bus_info *bus = &hw->bus;
+ 	struct e1000_adapter *adapter = hw->adapter;
+@@ -87,7 +87,7 @@ s32 e1000_get_bus_info_pcie(struct e1000_hw *hw)
+ }
+ 
+ /**
+- *  e1000_write_vfta - Write value to VLAN filter table
++ *  e1000e_write_vfta - Write value to VLAN filter table
+  *  @hw: pointer to the HW structure
+  *  @offset: register offset in VLAN filter table
+  *  @value: register value written to VLAN filter table
+@@ -95,14 +95,14 @@ s32 e1000_get_bus_info_pcie(struct e1000_hw *hw)
+  *  Writes value at the given offset in the register array which stores
+  *  the VLAN filter table.
+  **/
+-void e1000_write_vfta(struct e1000_hw *hw, u32 offset, u32 value)
++void e1000e_write_vfta(struct e1000_hw *hw, u32 offset, u32 value)
+ {
+ 	E1000_WRITE_REG_ARRAY(hw, E1000_VFTA, offset, value);
+ 	e1e_flush();
+ }
+ 
+ /**
+- *  e1000_init_rx_addrs - Initialize receive address's
++ *  e1000e_init_rx_addrs - Initialize receive address's
+  *  @hw: pointer to the HW structure
+  *  @rar_count: receive address registers
+  *
+@@ -110,14 +110,14 @@ void e1000_write_vfta(struct e1000_hw *hw, u32 offset, u32 value)
+  *  register to the devices MAC address and clearing all the other receive
+  *  address registers to 0.
+  **/
+-void e1000_init_rx_addrs(struct e1000_hw *hw, u16 rar_count)
++void e1000e_init_rx_addrs(struct e1000_hw *hw, u16 rar_count)
+ {
+ 	u32 i;
+ 
+ 	/* Setup the receive address */
+ 	hw_dbg(hw, "Programming MAC Address into RAR[0]\n");
+ 
+-	e1000_rar_set(hw, hw->mac.addr, 0);
++	e1000e_rar_set(hw, hw->mac.addr, 0);
+ 
+ 	/* Zero out the other (rar_entry_count - 1) receive addresses */
+ 	hw_dbg(hw, "Clearing RAR[1-%u]\n", rar_count-1);
+@@ -130,7 +130,7 @@ void e1000_init_rx_addrs(struct e1000_hw *hw, u16 rar_count)
+ }
+ 
+ /**
+- *  e1000_rar_set - Set receive address register
++ *  e1000e_rar_set - Set receive address register
+  *  @hw: pointer to the HW structure
+  *  @addr: pointer to the receive address
+  *  @index: receive address array register
+@@ -138,7 +138,7 @@ void e1000_init_rx_addrs(struct e1000_hw *hw, u16 rar_count)
+  *  Sets the receive address array register at index to the address passed
+  *  in by addr.
+  **/
+-void e1000_rar_set(struct e1000_hw *hw, u8 *addr, u32 index)
++void e1000e_rar_set(struct e1000_hw *hw, u8 *addr, u32 index)
+ {
+ 	u32 rar_low, rar_high;
+ 
+@@ -260,7 +260,7 @@ static u32 e1000_hash_mc_addr(struct e1000_hw *hw, u8 *mc_addr)
+ }
+ 
+ /**
+- *  e1000_mc_addr_list_update_generic - Update Multicast addresses
++ *  e1000e_mc_addr_list_update_generic - Update Multicast addresses
+  *  @hw: pointer to the HW structure
+  *  @mc_addr_list: array of multicast addresses to program
+  *  @mc_addr_count: number of multicast addresses to program
+@@ -272,7 +272,7 @@ static u32 e1000_hash_mc_addr(struct e1000_hw *hw, u8 *mc_addr)
+  *  The parameter rar_count will usually be hw->mac.rar_entry_count
+  *  unless there are workarounds that change this.
+  **/
+-void e1000_mc_addr_list_update_generic(struct e1000_hw *hw,
++void e1000e_mc_addr_list_update_generic(struct e1000_hw *hw,
+ 				       u8 *mc_addr_list, u32 mc_addr_count,
+ 				       u32 rar_used_count, u32 rar_count)
+ {
+@@ -285,7 +285,7 @@ void e1000_mc_addr_list_update_generic(struct e1000_hw *hw,
+ 	 */
+ 	for (i = rar_used_count; i < rar_count; i++) {
+ 		if (mc_addr_count) {
+-			e1000_rar_set(hw, mc_addr_list, i);
++			e1000e_rar_set(hw, mc_addr_list, i);
+ 			mc_addr_count--;
+ 			mc_addr_list += ETH_ALEN;
+ 		} else {
+@@ -313,12 +313,12 @@ void e1000_mc_addr_list_update_generic(struct e1000_hw *hw,
+ }
+ 
+ /**
+- *  e1000_clear_hw_cntrs_base - Clear base hardware counters
++ *  e1000e_clear_hw_cntrs_base - Clear base hardware counters
+  *  @hw: pointer to the HW structure
+  *
+  *  Clears the base hardware counters by reading the counter registers.
+  **/
+-void e1000_clear_hw_cntrs_base(struct e1000_hw *hw)
++void e1000e_clear_hw_cntrs_base(struct e1000_hw *hw)
+ {
+ 	u32 temp;
+ 
+@@ -362,14 +362,14 @@ void e1000_clear_hw_cntrs_base(struct e1000_hw *hw)
+ }
+ 
+ /**
+- *  e1000_check_for_copper_link - Check for link (Copper)
++ *  e1000e_check_for_copper_link - Check for link (Copper)
+  *  @hw: pointer to the HW structure
+  *
+  *  Checks to see of the link status of the hardware has changed.  If a
+  *  change in link status has been detected, then we read the PHY registers
+  *  to get the current speed/duplex if link exists.
+  **/
+-s32 e1000_check_for_copper_link(struct e1000_hw *hw)
++s32 e1000e_check_for_copper_link(struct e1000_hw *hw)
+ {
+ 	struct e1000_mac_info *mac = &hw->mac;
+ 	s32 ret_val;
+@@ -387,7 +387,7 @@ s32 e1000_check_for_copper_link(struct e1000_hw *hw)
+ 	 * link.  If so, then we want to get the current speed/duplex
+ 	 * of the PHY.
+ 	 */
+-	ret_val = e1000_phy_has_link_generic(hw, 1, 0, &link);
++	ret_val = e1000e_phy_has_link_generic(hw, 1, 0, &link);
+ 	if (ret_val)
+ 		return ret_val;
+ 
+@@ -398,7 +398,7 @@ s32 e1000_check_for_copper_link(struct e1000_hw *hw)
+ 
+ 	/* Check if there was DownShift, must be checked
+ 	 * immediately after link-up */
+-	e1000_check_downshift(hw);
++	e1000e_check_downshift(hw);
+ 
+ 	/* If we are forcing speed/duplex, then we simply return since
+ 	 * we have already determined whether we have link or not.
+@@ -412,14 +412,14 @@ s32 e1000_check_for_copper_link(struct e1000_hw *hw)
+ 	 * of MAC speed/duplex configuration.  So we only need to
+ 	 * configure Collision Distance in the MAC.
+ 	 */
+-	e1000_config_collision_dist(hw);
++	e1000e_config_collision_dist(hw);
+ 
+ 	/* Configure Flow Control now that Auto-Neg has completed.
+ 	 * First, we need to restore the desired flow control
+ 	 * settings because we may have had to re-autoneg with a
+ 	 * different link partner.
+ 	 */
+-	ret_val = e1000_config_fc_after_link_up(hw);
++	ret_val = e1000e_config_fc_after_link_up(hw);
+ 	if (ret_val) {
+ 		hw_dbg(hw, "Error configuring flow control\n");
+ 	}
+@@ -428,13 +428,13 @@ s32 e1000_check_for_copper_link(struct e1000_hw *hw)
+ }
+ 
+ /**
+- *  e1000_check_for_fiber_link - Check for link (Fiber)
++ *  e1000e_check_for_fiber_link - Check for link (Fiber)
+  *  @hw: pointer to the HW structure
+  *
+  *  Checks for link up on the hardware.  If link is not up and we have
+  *  a signal, then we need to force link up.
+  **/
+-s32 e1000_check_for_fiber_link(struct e1000_hw *hw)
++s32 e1000e_check_for_fiber_link(struct e1000_hw *hw)
+ {
+ 	struct e1000_mac_info *mac = &hw->mac;
+ 	u32 rxcw;
+@@ -471,7 +471,7 @@ s32 e1000_check_for_fiber_link(struct e1000_hw *hw)
+ 		ew32(CTRL, ctrl);
+ 
+ 		/* Configure Flow Control after forcing link up. */
+-		ret_val = e1000_config_fc_after_link_up(hw);
++		ret_val = e1000e_config_fc_after_link_up(hw);
+ 		if (ret_val) {
+ 			hw_dbg(hw, "Error configuring flow control\n");
+ 			return ret_val;
+@@ -493,13 +493,13 @@ s32 e1000_check_for_fiber_link(struct e1000_hw *hw)
+ }
+ 
+ /**
+- *  e1000_check_for_serdes_link - Check for link (Serdes)
++ *  e1000e_check_for_serdes_link - Check for link (Serdes)
+  *  @hw: pointer to the HW structure
+  *
+  *  Checks for link up on the hardware.  If link is not up and we have
+  *  a signal, then we need to force link up.
+  **/
+-s32 e1000_check_for_serdes_link(struct e1000_hw *hw)
++s32 e1000e_check_for_serdes_link(struct e1000_hw *hw)
+ {
+ 	struct e1000_mac_info *mac = &hw->mac;
+ 	u32 rxcw;
+@@ -534,7 +534,7 @@ s32 e1000_check_for_serdes_link(struct e1000_hw *hw)
+ 		ew32(CTRL, ctrl);
+ 
+ 		/* Configure Flow Control after forcing link up. */
+-		ret_val = e1000_config_fc_after_link_up(hw);
++		ret_val = e1000e_config_fc_after_link_up(hw);
+ 		if (ret_val) {
+ 			hw_dbg(hw, "Error configuring flow control\n");
+ 			return ret_val;
+@@ -619,7 +619,7 @@ static s32 e1000_set_default_fc_generic(struct e1000_hw *hw)
+ }
+ 
+ /**
+- *  e1000_setup_link - Setup flow control and link settings
++ *  e1000e_setup_link - Setup flow control and link settings
+  *  @hw: pointer to the HW structure
+  *
+  *  Determines which flow control settings to use, then configures flow
+@@ -628,7 +628,7 @@ static s32 e1000_set_default_fc_generic(struct e1000_hw *hw)
+  *  should be established.  Assumes the hardware has previously been reset
+  *  and the transmitter and receiver are not enabled.
+  **/
+-s32 e1000_setup_link(struct e1000_hw *hw)
++s32 e1000e_setup_link(struct e1000_hw *hw)
+ {
+ 	struct e1000_mac_info *mac = &hw->mac;
+ 	s32 ret_val;
+@@ -668,7 +668,7 @@ s32 e1000_setup_link(struct e1000_hw *hw)
+ 
+ 	ew32(FCTTV, mac->fc_pause_time);
+ 
+-	return e1000_set_fc_watermarks(hw);
++	return e1000e_set_fc_watermarks(hw);
+ }
+ 
+ /**
+@@ -786,13 +786,13 @@ static s32 e1000_poll_fiber_serdes_link_generic(struct e1000_hw *hw)
+ }
+ 
+ /**
+- *  e1000_setup_fiber_serdes_link - Setup link for fiber/serdes
++ *  e1000e_setup_fiber_serdes_link - Setup link for fiber/serdes
+  *  @hw: pointer to the HW structure
+  *
+  *  Configures collision distance and flow control for fiber and serdes
+  *  links.  Upon successful setup, poll for link.
+  **/
+-s32 e1000_setup_fiber_serdes_link(struct e1000_hw *hw)
++s32 e1000e_setup_fiber_serdes_link(struct e1000_hw *hw)
+ {
+ 	u32 ctrl;
+ 	s32 ret_val;
+@@ -802,7 +802,7 @@ s32 e1000_setup_fiber_serdes_link(struct e1000_hw *hw)
+ 	/* Take the link out of reset */
+ 	ctrl &= ~E1000_CTRL_LRST;
+ 
+-	e1000_config_collision_dist(hw);
++	e1000e_config_collision_dist(hw);
+ 
+ 	ret_val = e1000_commit_fc_settings_generic(hw);
+ 	if (ret_val)
+@@ -835,14 +835,14 @@ s32 e1000_setup_fiber_serdes_link(struct e1000_hw *hw)
+ }
+ 
+ /**
+- *  e1000_config_collision_dist - Configure collision distance
++ *  e1000e_config_collision_dist - Configure collision distance
+  *  @hw: pointer to the HW structure
+  *
+  *  Configures the collision distance to the default value and is used
+  *  during link setup. Currently no func pointer exists and all
+  *  implementations are handled in the generic version of this function.
+  **/
+-void e1000_config_collision_dist(struct e1000_hw *hw)
++void e1000e_config_collision_dist(struct e1000_hw *hw)
+ {
+ 	u32 tctl;
+ 
+@@ -856,14 +856,14 @@ void e1000_config_collision_dist(struct e1000_hw *hw)
+ }
+ 
+ /**
+- *  e1000_set_fc_watermarks - Set flow control high/low watermarks
++ *  e1000e_set_fc_watermarks - Set flow control high/low watermarks
+  *  @hw: pointer to the HW structure
+  *
+  *  Sets the flow control high/low threshold (watermark) registers.  If
+  *  flow control XON frame transmission is enabled, then set XON frame
+  *  tansmission as well.
+  **/
+-s32 e1000_set_fc_watermarks(struct e1000_hw *hw)
++s32 e1000e_set_fc_watermarks(struct e1000_hw *hw)
+ {
+ 	struct e1000_mac_info *mac = &hw->mac;
+ 	u32 fcrtl = 0, fcrth = 0;
+@@ -890,7 +890,7 @@ s32 e1000_set_fc_watermarks(struct e1000_hw *hw)
+ }
+ 
+ /**
+- *  e1000_force_mac_fc - Force the MAC's flow control settings
++ *  e1000e_force_mac_fc - Force the MAC's flow control settings
+  *  @hw: pointer to the HW structure
+  *
+  *  Force the MAC's flow control settings.  Sets the TFCE and RFCE bits in the
+@@ -899,7 +899,7 @@ s32 e1000_set_fc_watermarks(struct e1000_hw *hw)
+  *  autonegotiation is managed by the PHY rather than the MAC.  Software must
+  *  also configure these bits when link is forced on a fiber connection.
+  **/
+-s32 e1000_force_mac_fc(struct e1000_hw *hw)
++s32 e1000e_force_mac_fc(struct e1000_hw *hw)
+ {
+ 	struct e1000_mac_info *mac = &hw->mac;
+ 	u32 ctrl;
+@@ -951,7 +951,7 @@ s32 e1000_force_mac_fc(struct e1000_hw *hw)
+ }
+ 
+ /**
+- *  e1000_config_fc_after_link_up - Configures flow control after link
++ *  e1000e_config_fc_after_link_up - Configures flow control after link
+  *  @hw: pointer to the HW structure
+  *
+  *  Checks the status of auto-negotiation after link up to ensure that the
+@@ -960,7 +960,7 @@ s32 e1000_force_mac_fc(struct e1000_hw *hw)
+  *  and did not fail, then we configure flow control based on our link
+  *  partner.
+  **/
+-s32 e1000_config_fc_after_link_up(struct e1000_hw *hw)
++s32 e1000e_config_fc_after_link_up(struct e1000_hw *hw)
+ {
+ 	struct e1000_mac_info *mac = &hw->mac;
+ 	s32 ret_val = 0;
+@@ -974,10 +974,10 @@ s32 e1000_config_fc_after_link_up(struct e1000_hw *hw)
+ 	if (mac->autoneg_failed) {
+ 		if (hw->media_type == e1000_media_type_fiber ||
+ 		    hw->media_type == e1000_media_type_internal_serdes)
+-			ret_val = e1000_force_mac_fc(hw);
++			ret_val = e1000e_force_mac_fc(hw);
+ 	} else {
+ 		if (hw->media_type == e1000_media_type_copper)
+-			ret_val = e1000_force_mac_fc(hw);
++			ret_val = e1000e_force_mac_fc(hw);
+ 	}
+ 
+ 	if (ret_val) {
+@@ -1147,7 +1147,7 @@ s32 e1000_config_fc_after_link_up(struct e1000_hw *hw)
+ 		/* Now we call a subroutine to actually force the MAC
+ 		 * controller to use the correct flow control settings.
+ 		 */
+-		ret_val = e1000_force_mac_fc(hw);
++		ret_val = e1000e_force_mac_fc(hw);
+ 		if (ret_val) {
+ 			hw_dbg(hw, "Error forcing flow control settings\n");
+ 			return ret_val;
+@@ -1158,7 +1158,7 @@ s32 e1000_config_fc_after_link_up(struct e1000_hw *hw)
+ }
+ 
+ /**
+- *  e1000_get_speed_and_duplex_copper - Retreive current speed/duplex
++ *  e1000e_get_speed_and_duplex_copper - Retreive current speed/duplex
+  *  @hw: pointer to the HW structure
+  *  @speed: stores the current speed
+  *  @duplex: stores the current duplex
+@@ -1166,7 +1166,7 @@ s32 e1000_config_fc_after_link_up(struct e1000_hw *hw)
+  *  Read the status register for the current speed/duplex and store the current
+  *  speed and duplex for copper connections.
+  **/
+-s32 e1000_get_speed_and_duplex_copper(struct e1000_hw *hw, u16 *speed, u16 *duplex)
++s32 e1000e_get_speed_and_duplex_copper(struct e1000_hw *hw, u16 *speed, u16 *duplex)
+ {
+ 	u32 status;
+ 
+@@ -1194,7 +1194,7 @@ s32 e1000_get_speed_and_duplex_copper(struct e1000_hw *hw, u16 *speed, u16 *dupl
+ }
+ 
+ /**
+- *  e1000_get_speed_and_duplex_fiber_serdes - Retreive current speed/duplex
++ *  e1000e_get_speed_and_duplex_fiber_serdes - Retreive current speed/duplex
+  *  @hw: pointer to the HW structure
+  *  @speed: stores the current speed
+  *  @duplex: stores the current duplex
+@@ -1202,7 +1202,7 @@ s32 e1000_get_speed_and_duplex_copper(struct e1000_hw *hw, u16 *speed, u16 *dupl
+  *  Sets the speed and duplex to gigabit full duplex (the only possible option)
+  *  for fiber/serdes links.
+  **/
+-s32 e1000_get_speed_and_duplex_fiber_serdes(struct e1000_hw *hw, u16 *speed, u16 *duplex)
++s32 e1000e_get_speed_and_duplex_fiber_serdes(struct e1000_hw *hw, u16 *speed, u16 *duplex)
+ {
+ 	*speed = SPEED_1000;
+ 	*duplex = FULL_DUPLEX;
+@@ -1211,12 +1211,12 @@ s32 e1000_get_speed_and_duplex_fiber_serdes(struct e1000_hw *hw, u16 *speed, u16
+ }
+ 
+ /**
+- *  e1000_get_hw_semaphore - Acquire hardware semaphore
++ *  e1000e_get_hw_semaphore - Acquire hardware semaphore
+  *  @hw: pointer to the HW structure
+  *
+  *  Acquire the HW semaphore to access the PHY or NVM
+  **/
+-s32 e1000_get_hw_semaphore(struct e1000_hw *hw)
++s32 e1000e_get_hw_semaphore(struct e1000_hw *hw)
+ {
+ 	u32 swsm;
+ 	s32 timeout = hw->nvm.word_size + 1;
+@@ -1251,7 +1251,7 @@ s32 e1000_get_hw_semaphore(struct e1000_hw *hw)
+ 
+ 	if (i == timeout) {
+ 		/* Release semaphores */
+-		e1000_put_hw_semaphore(hw);
++		e1000e_put_hw_semaphore(hw);
+ 		hw_dbg(hw, "Driver can't access the NVM\n");
+ 		return -E1000_ERR_NVM;
+ 	}
+@@ -1260,12 +1260,12 @@ s32 e1000_get_hw_semaphore(struct e1000_hw *hw)
+ }
+ 
+ /**
+- *  e1000_put_hw_semaphore - Release hardware semaphore
++ *  e1000e_put_hw_semaphore - Release hardware semaphore
+  *  @hw: pointer to the HW structure
+  *
+  *  Release hardware semaphore used to access the PHY or NVM
+  **/
+-void e1000_put_hw_semaphore(struct e1000_hw *hw)
++void e1000e_put_hw_semaphore(struct e1000_hw *hw)
+ {
+ 	u32 swsm;
+ 
+@@ -1275,12 +1275,12 @@ void e1000_put_hw_semaphore(struct e1000_hw *hw)
+ }
+ 
+ /**
+- *  e1000_get_auto_rd_done - Check for auto read completion
++ *  e1000e_get_auto_rd_done - Check for auto read completion
+  *  @hw: pointer to the HW structure
+  *
+  *  Check EEPROM for Auto Read done bit.
+  **/
+-s32 e1000_get_auto_rd_done(struct e1000_hw *hw)
++s32 e1000e_get_auto_rd_done(struct e1000_hw *hw)
+ {
+ 	s32 i = 0;
+ 
+@@ -1300,14 +1300,14 @@ s32 e1000_get_auto_rd_done(struct e1000_hw *hw)
+ }
+ 
+ /**
+- *  e1000_valid_led_default - Verify a valid default LED config
++ *  e1000e_valid_led_default - Verify a valid default LED config
+  *  @hw: pointer to the HW structure
+  *  @data: pointer to the NVM (EEPROM)
+  *
+  *  Read the EEPROM for the current default LED configuration.  If the
+  *  LED configuration is not valid, set to a valid LED configuration.
+  **/
+-s32 e1000_valid_led_default(struct e1000_hw *hw, u16 *data)
++s32 e1000e_valid_led_default(struct e1000_hw *hw, u16 *data)
+ {
+ 	s32 ret_val;
+ 
+@@ -1324,11 +1324,11 @@ s32 e1000_valid_led_default(struct e1000_hw *hw, u16 *data)
+ }
+ 
+ /**
+- *  e1000_id_led_init -
++ *  e1000e_id_led_init -
+  *  @hw: pointer to the HW structure
+  *
+  **/
+-s32 e1000_id_led_init(struct e1000_hw *hw)
++s32 e1000e_id_led_init(struct e1000_hw *hw)
+ {
+ 	struct e1000_mac_info *mac = &hw->mac;
+ 	s32 ret_val;
+@@ -1388,25 +1388,25 @@ s32 e1000_id_led_init(struct e1000_hw *hw)
+ }
+ 
+ /**
+- *  e1000_cleanup_led_generic - Set LED config to default operation
++ *  e1000e_cleanup_led_generic - Set LED config to default operation
+  *  @hw: pointer to the HW structure
+  *
+  *  Remove the current LED configuration and set the LED configuration
+  *  to the default value, saved from the EEPROM.
+  **/
+-s32 e1000_cleanup_led_generic(struct e1000_hw *hw)
++s32 e1000e_cleanup_led_generic(struct e1000_hw *hw)
+ {
+ 	ew32(LEDCTL, hw->mac.ledctl_default);
+ 	return 0;
+ }
+ 
+ /**
+- *  e1000_blink_led - Blink LED
++ *  e1000e_blink_led - Blink LED
+  *  @hw: pointer to the HW structure
+  *
+  *  Blink the led's which are set to be on.
+  **/
+-s32 e1000_blink_led(struct e1000_hw *hw)
++s32 e1000e_blink_led(struct e1000_hw *hw)
+ {
+ 	u32 ledctl_blink = 0;
+ 	u32 i;
+@@ -1432,12 +1432,12 @@ s32 e1000_blink_led(struct e1000_hw *hw)
+ }
+ 
+ /**
+- *  e1000_led_on_generic - Turn LED on
++ *  e1000e_led_on_generic - Turn LED on
+  *  @hw: pointer to the HW structure
+  *
+  *  Turn LED on.
+  **/
+-s32 e1000_led_on_generic(struct e1000_hw *hw)
++s32 e1000e_led_on_generic(struct e1000_hw *hw)
+ {
+ 	u32 ctrl;
+ 
+@@ -1459,12 +1459,12 @@ s32 e1000_led_on_generic(struct e1000_hw *hw)
+ }
+ 
+ /**
+- *  e1000_led_off_generic - Turn LED off
++ *  e1000e_led_off_generic - Turn LED off
+  *  @hw: pointer to the HW structure
+  *
+  *  Turn LED off.
+  **/
+-s32 e1000_led_off_generic(struct e1000_hw *hw)
++s32 e1000e_led_off_generic(struct e1000_hw *hw)
+ {
+ 	u32 ctrl;
+ 
+@@ -1486,13 +1486,13 @@ s32 e1000_led_off_generic(struct e1000_hw *hw)
+ }
+ 
+ /**
+- *  e1000_set_pcie_no_snoop - Set PCI-express capabilities
++ *  e1000e_set_pcie_no_snoop - Set PCI-express capabilities
+  *  @hw: pointer to the HW structure
+  *  @no_snoop: bitmap of snoop events
+  *
+  *  Set the PCI-express register to snoop for events enabled in 'no_snoop'.
+  **/
+-void e1000_set_pcie_no_snoop(struct e1000_hw *hw, u32 no_snoop)
++void e1000e_set_pcie_no_snoop(struct e1000_hw *hw, u32 no_snoop)
+ {
+ 	u32 gcr;
+ 
+@@ -1505,7 +1505,7 @@ void e1000_set_pcie_no_snoop(struct e1000_hw *hw, u32 no_snoop)
+ }
+ 
+ /**
+- *  e1000_disable_pcie_master - Disables PCI-express master access
++ *  e1000e_disable_pcie_master - Disables PCI-express master access
+  *  @hw: pointer to the HW structure
+  *
+  *  Returns 0 if successful, else returns -10
+@@ -1515,7 +1515,7 @@ void e1000_set_pcie_no_snoop(struct e1000_hw *hw, u32 no_snoop)
+  *  Disables PCI-Express master access and verifies there are no pending
+  *  requests.
+  **/
+-s32 e1000_disable_pcie_master(struct e1000_hw *hw)
++s32 e1000e_disable_pcie_master(struct e1000_hw *hw)
+ {
+ 	u32 ctrl;
+ 	s32 timeout = MASTER_DISABLE_TIMEOUT;
+@@ -1541,12 +1541,12 @@ s32 e1000_disable_pcie_master(struct e1000_hw *hw)
+ }
+ 
+ /**
+- *  e1000_reset_adaptive - Reset Adaptive Interframe Spacing
++ *  e1000e_reset_adaptive - Reset Adaptive Interframe Spacing
+  *  @hw: pointer to the HW structure
+  *
+  *  Reset the Adaptive Interframe Spacing throttle to default values.
+  **/
+-void e1000_reset_adaptive(struct e1000_hw *hw)
++void e1000e_reset_adaptive(struct e1000_hw *hw)
+ {
+ 	struct e1000_mac_info *mac = &hw->mac;
+ 
+@@ -1561,13 +1561,13 @@ void e1000_reset_adaptive(struct e1000_hw *hw)
+ }
+ 
+ /**
+- *  e1000_update_adaptive - Update Adaptive Interframe Spacing
++ *  e1000e_update_adaptive - Update Adaptive Interframe Spacing
+  *  @hw: pointer to the HW structure
+  *
+  *  Update the Adaptive Interframe Spacing Throttle value based on the
+  *  time between transmitted packets and time between collisions.
+  **/
+-void e1000_update_adaptive(struct e1000_hw *hw)
++void e1000e_update_adaptive(struct e1000_hw *hw)
+ {
+ 	struct e1000_mac_info *mac = &hw->mac;
+ 
+@@ -1704,14 +1704,14 @@ static u16 e1000_shift_in_eec_bits(struct e1000_hw *hw, u16 count)
+ }
+ 
+ /**
+- *  e1000_poll_eerd_eewr_done - Poll for EEPROM read/write completion
++ *  e1000e_poll_eerd_eewr_done - Poll for EEPROM read/write completion
+  *  @hw: pointer to the HW structure
+  *  @ee_reg: EEPROM flag for polling
+  *
+  *  Polls the EEPROM status bit for either read or write completion based
+  *  upon the value of 'ee_reg'.
+  **/
+-s32 e1000_poll_eerd_eewr_done(struct e1000_hw *hw, int ee_reg)
++s32 e1000e_poll_eerd_eewr_done(struct e1000_hw *hw, int ee_reg)
+ {
+ 	u32 attempts = 100000;
+ 	u32 i, reg = 0;
+@@ -1732,14 +1732,14 @@ s32 e1000_poll_eerd_eewr_done(struct e1000_hw *hw, int ee_reg)
+ }
+ 
+ /**
+- *  e1000_acquire_nvm - Generic request for access to EEPROM
++ *  e1000e_acquire_nvm - Generic request for access to EEPROM
+  *  @hw: pointer to the HW structure
+  *
+  *  Set the EEPROM access request bit and wait for EEPROM access grant bit.
+  *  Return successful if access grant bit set, else clear the request for
+  *  EEPROM access and return -E1000_ERR_NVM (-1).
+  **/
+-s32 e1000_acquire_nvm(struct e1000_hw *hw)
++s32 e1000e_acquire_nvm(struct e1000_hw *hw)
+ {
+ 	u32 eecd = er32(EECD);
+ 	s32 timeout = E1000_NVM_GRANT_ATTEMPTS;
+@@ -1808,12 +1808,12 @@ static void e1000_stop_nvm(struct e1000_hw *hw)
+ }
+ 
+ /**
+- *  e1000_release_nvm - Release exclusive access to EEPROM
++ *  e1000e_release_nvm - Release exclusive access to EEPROM
+  *  @hw: pointer to the HW structure
+  *
+  *  Stop any current commands to the EEPROM and clear the EEPROM request bit.
+  **/
+-void e1000_release_nvm(struct e1000_hw *hw)
++void e1000e_release_nvm(struct e1000_hw *hw)
+ {
+ 	u32 eecd;
+ 
+@@ -1870,7 +1870,7 @@ static s32 e1000_ready_nvm_eeprom(struct e1000_hw *hw)
+ }
+ 
+ /**
+- *  e1000_read_nvm_spi - Read EEPROM's using SPI
++ *  e1000e_read_nvm_spi - Read EEPROM's using SPI
+  *  @hw: pointer to the HW structure
+  *  @offset: offset of word in the EEPROM to read
+  *  @words: number of words to read
+@@ -1878,7 +1878,7 @@ static s32 e1000_ready_nvm_eeprom(struct e1000_hw *hw)
+  *
+  *  Reads a 16 bit word from the EEPROM.
+  **/
+-s32 e1000_read_nvm_spi(struct e1000_hw *hw, u16 offset, u16 words, u16 *data)
++s32 e1000e_read_nvm_spi(struct e1000_hw *hw, u16 offset, u16 words, u16 *data)
+ {
+ 	struct e1000_nvm_info *nvm = &hw->nvm;
+ 	u32 i = 0;
+@@ -1926,7 +1926,7 @@ s32 e1000_read_nvm_spi(struct e1000_hw *hw, u16 offset, u16 words, u16 *data)
+ }
+ 
+ /**
+- *  e1000_read_nvm_eerd - Reads EEPROM using EERD register
++ *  e1000e_read_nvm_eerd - Reads EEPROM using EERD register
+  *  @hw: pointer to the HW structure
+  *  @offset: offset of word in the EEPROM to read
+  *  @words: number of words to read
+@@ -1934,7 +1934,7 @@ s32 e1000_read_nvm_spi(struct e1000_hw *hw, u16 offset, u16 words, u16 *data)
+  *
+  *  Reads a 16 bit word from the EEPROM using the EERD register.
+  **/
+-s32 e1000_read_nvm_eerd(struct e1000_hw *hw, u16 offset, u16 words, u16 *data)
++s32 e1000e_read_nvm_eerd(struct e1000_hw *hw, u16 offset, u16 words, u16 *data)
+ {
+ 	struct e1000_nvm_info *nvm = &hw->nvm;
+ 	u32 i, eerd = 0;
+@@ -1953,7 +1953,7 @@ s32 e1000_read_nvm_eerd(struct e1000_hw *hw, u16 offset, u16 words, u16 *data)
+ 		       E1000_NVM_RW_REG_START;
+ 
+ 		ew32(EERD, eerd);
+-		ret_val = e1000_poll_eerd_eewr_done(hw, E1000_NVM_POLL_READ);
++		ret_val = e1000e_poll_eerd_eewr_done(hw, E1000_NVM_POLL_READ);
+ 		if (ret_val)
+ 			break;
+ 
+@@ -1965,7 +1965,7 @@ s32 e1000_read_nvm_eerd(struct e1000_hw *hw, u16 offset, u16 words, u16 *data)
+ }
+ 
+ /**
+- *  e1000_write_nvm_spi - Write to EEPROM using SPI
++ *  e1000e_write_nvm_spi - Write to EEPROM using SPI
+  *  @hw: pointer to the HW structure
+  *  @offset: offset within the EEPROM to be written to
+  *  @words: number of words to write
+@@ -1973,10 +1973,10 @@ s32 e1000_read_nvm_eerd(struct e1000_hw *hw, u16 offset, u16 words, u16 *data)
+  *
+  *  Writes data to EEPROM at offset using SPI interface.
+  *
+- *  If e1000_update_nvm_checksum is not called after this function , the
++ *  If e1000e_update_nvm_checksum is not called after this function , the
+  *  EEPROM will most likley contain an invalid checksum.
+  **/
+-s32 e1000_write_nvm_spi(struct e1000_hw *hw, u16 offset, u16 words, u16 *data)
++s32 e1000e_write_nvm_spi(struct e1000_hw *hw, u16 offset, u16 words, u16 *data)
+ {
+ 	struct e1000_nvm_info *nvm = &hw->nvm;
+ 	s32 ret_val;
+@@ -2042,14 +2042,14 @@ s32 e1000_write_nvm_spi(struct e1000_hw *hw, u16 offset, u16 words, u16 *data)
+ }
+ 
+ /**
+- *  e1000_read_mac_addr - Read device MAC address
++ *  e1000e_read_mac_addr - Read device MAC address
+  *  @hw: pointer to the HW structure
+  *
+  *  Reads the device MAC address from the EEPROM and stores the value.
+  *  Since devices with two ports use the same EEPROM, we increment the
+  *  last bit in the MAC address for the second port.
+  **/
+-s32 e1000_read_mac_addr(struct e1000_hw *hw)
++s32 e1000e_read_mac_addr(struct e1000_hw *hw)
+ {
+ 	s32 ret_val;
+ 	u16 offset, nvm_data, i;
+@@ -2076,13 +2076,13 @@ s32 e1000_read_mac_addr(struct e1000_hw *hw)
+ }
+ 
+ /**
+- *  e1000_validate_nvm_checksum_generic - Validate EEPROM checksum
++ *  e1000e_validate_nvm_checksum_generic - Validate EEPROM checksum
+  *  @hw: pointer to the HW structure
+  *
+  *  Calculates the EEPROM checksum by reading/adding each word of the EEPROM
+  *  and then verifies that the sum of the EEPROM is equal to 0xBABA.
+  **/
+-s32 e1000_validate_nvm_checksum_generic(struct e1000_hw *hw)
++s32 e1000e_validate_nvm_checksum_generic(struct e1000_hw *hw)
+ {
+ 	s32 ret_val;
+ 	u16 checksum = 0;
+@@ -2106,14 +2106,14 @@ s32 e1000_validate_nvm_checksum_generic(struct e1000_hw *hw)
+ }
+ 
+ /**
+- *  e1000_update_nvm_checksum_generic - Update EEPROM checksum
++ *  e1000e_update_nvm_checksum_generic - Update EEPROM checksum
+  *  @hw: pointer to the HW structure
+  *
+  *  Updates the EEPROM checksum by reading/adding each word of the EEPROM
+  *  up to the checksum.  Then calculates the EEPROM checksum and writes the
+  *  value to the EEPROM.
+  **/
+-s32 e1000_update_nvm_checksum_generic(struct e1000_hw *hw)
++s32 e1000e_update_nvm_checksum_generic(struct e1000_hw *hw)
+ {
+ 	s32 ret_val;
+ 	u16 checksum = 0;
+@@ -2136,13 +2136,13 @@ s32 e1000_update_nvm_checksum_generic(struct e1000_hw *hw)
+ }
+ 
+ /**
+- *  e1000_reload_nvm - Reloads EEPROM
++ *  e1000e_reload_nvm - Reloads EEPROM
+  *  @hw: pointer to the HW structure
+  *
+  *  Reloads the EEPROM by setting the "Reinitialize from EEPROM" bit in the
+  *  extended control register.
+  **/
+-void e1000_reload_nvm(struct e1000_hw *hw)
++void e1000e_reload_nvm(struct e1000_hw *hw)
+ {
+ 	u32 ctrl_ext;
+ 
+@@ -2213,13 +2213,13 @@ static s32 e1000_mng_enable_host_if(struct e1000_hw *hw)
+ }
+ 
+ /**
+- *  e1000_check_mng_mode - check managament mode
++ *  e1000e_check_mng_mode - check managament mode
+  *  @hw: pointer to the HW structure
+  *
+  *  Reads the firmware semaphore register and returns true (>0) if
+  *  manageability is enabled, else false (0).
+  **/
+-bool e1000_check_mng_mode(struct e1000_hw *hw)
++bool e1000e_check_mng_mode(struct e1000_hw *hw)
+ {
+ 	u32 fwsm = er32(FWSM);
+ 
+@@ -2227,13 +2227,13 @@ bool e1000_check_mng_mode(struct e1000_hw *hw)
+ }
+ 
+ /**
+- *  e1000_enable_tx_pkt_filtering - Enable packet filtering on TX
++ *  e1000e_enable_tx_pkt_filtering - Enable packet filtering on TX
+  *  @hw: pointer to the HW structure
+  *
+  *  Enables packet filtering on transmit packets if manageability is enabled
+  *  and host interface is enabled.
+  **/
+-bool e1000_enable_tx_pkt_filtering(struct e1000_hw *hw)
++bool e1000e_enable_tx_pkt_filtering(struct e1000_hw *hw)
+ {
+ 	struct e1000_host_mng_dhcp_cookie *hdr = &hw->mng_cookie;
+ 	u32 *buffer = (u32 *)&hw->mng_cookie;
+@@ -2242,7 +2242,7 @@ bool e1000_enable_tx_pkt_filtering(struct e1000_hw *hw)
+ 	u8 i, len;
+ 
+ 	/* No manageability, no filtering */
+-	if (!e1000_check_mng_mode(hw)) {
++	if (!e1000e_check_mng_mode(hw)) {
+ 		hw->mac.tx_pkt_filtering = 0;
+ 		return 0;
+ 	}
+@@ -2383,14 +2383,14 @@ static s32 e1000_mng_host_if_write(struct e1000_hw *hw, u8 *buffer,
+ }
+ 
+ /**
+- *  e1000_mng_write_dhcp_info - Writes DHCP info to host interface
++ *  e1000e_mng_write_dhcp_info - Writes DHCP info to host interface
+  *  @hw: pointer to the HW structure
+  *  @buffer: pointer to the host interface
+  *  @length: size of the buffer
+  *
+  *  Writes the DHCP information to the host interface.
+  **/
+-s32 e1000_mng_write_dhcp_info(struct e1000_hw *hw, u8 *buffer, u16 length)
++s32 e1000e_mng_write_dhcp_info(struct e1000_hw *hw, u8 *buffer, u16 length)
+ {
+ 	struct e1000_host_mng_command_header hdr;
+ 	s32 ret_val;
+@@ -2426,12 +2426,12 @@ s32 e1000_mng_write_dhcp_info(struct e1000_hw *hw, u8 *buffer, u16 length)
+ }
+ 
+ /**
+- *  e1000_enable_mng_pass_thru - Enable processing of ARP's
++ *  e1000e_enable_mng_pass_thru - Enable processing of ARP's
+  *  @hw: pointer to the HW structure
+  *
+  *  Verifies the hardware needs to allow ARPs to be processed by the host.
+  **/
+-bool e1000_enable_mng_pass_thru(struct e1000_hw *hw)
++bool e1000e_enable_mng_pass_thru(struct e1000_hw *hw)
+ {
+ 	u32 manc;
+ 	u32 fwsm, factps;
+diff --git a/drivers/net/e1000e/netdev.c b/drivers/net/e1000e/netdev.c
+index 01a9a4f..d711e14 100644
+--- a/drivers/net/e1000e/netdev.c
++++ b/drivers/net/e1000e/netdev.c
+@@ -47,8 +47,8 @@
+ #include "e1000.h"
+ 
+ #define DRV_VERSION "0.2.0"
+-char e1000_driver_name[] = "e1000e";
+-const char e1000_driver_version[] = DRV_VERSION;
++char e1000e_driver_name[] = "e1000e";
++const char e1000e_driver_version[] = DRV_VERSION;
+ 
+ static const struct e1000_info *e1000_info_tbl[] = {
+ 	[board_82571]		= &e1000_82571_info,
+@@ -64,7 +64,7 @@ static const struct e1000_info *e1000_info_tbl[] = {
+  * e1000_get_hw_dev_name - return device name string
+  * used by hardware layer to print debugging information
+  **/
+-char *e1000_get_hw_dev_name(struct e1000_hw *hw)
++char *e1000e_get_hw_dev_name(struct e1000_hw *hw)
+ {
+ 	struct e1000_adapter *adapter = hw->back;
+ 	struct net_device *netdev = adapter->netdev;
+@@ -1108,7 +1108,7 @@ static irqreturn_t e1000_intr_msi(int irq, void *data)
+ 		 * disconnect (LSC) before accessing any PHY registers */
+ 		if ((adapter->flags & FLAG_LSC_GIG_SPEED_DROP) &&
+ 		    (!(er32(STATUS) & E1000_STATUS_LU)))
+-			e1000_gig_downshift_workaround_ich8lan(hw);
++			e1000e_gig_downshift_workaround_ich8lan(hw);
+ 
+ 		/* 80003ES2LAN workaround-- For packet buffer work-around on
+ 		 * link down event; disable receives here in the ISR and reset
+@@ -1169,7 +1169,7 @@ static irqreturn_t e1000_intr(int irq, void *data)
+ 		 * disconnect (LSC) before accessing any PHY registers */
+ 		if ((adapter->flags & FLAG_LSC_GIG_SPEED_DROP) &&
+ 		    (!(er32(STATUS) & E1000_STATUS_LU)))
+-			e1000_gig_downshift_workaround_ich8lan(hw);
++			e1000e_gig_downshift_workaround_ich8lan(hw);
+ 
+ 		/* 80003ES2LAN workaround--
+ 		 * For packet buffer work-around on link down event;
+@@ -1352,12 +1352,12 @@ static int e1000_alloc_ring_dma(struct e1000_adapter *adapter,
+ }
+ 
+ /**
+- * e1000_setup_tx_resources - allocate Tx resources (Descriptors)
++ * e1000e_setup_tx_resources - allocate Tx resources (Descriptors)
+  * @adapter: board private structure
+  *
+  * Return 0 on success, negative on failure
+  **/
+-int e1000_setup_tx_resources(struct e1000_adapter *adapter)
++int e1000e_setup_tx_resources(struct e1000_adapter *adapter)
+ {
+ 	struct e1000_ring *tx_ring = adapter->tx_ring;
+ 	int err = -ENOMEM, size;
+@@ -1389,12 +1389,12 @@ err:
+ }
+ 
+ /**
+- * e1000_setup_rx_resources - allocate Rx resources (Descriptors)
++ * e1000e_setup_rx_resources - allocate Rx resources (Descriptors)
+  * @adapter: board private structure
+  *
+  * Returns 0 on success, negative on failure
+  **/
+-int e1000_setup_rx_resources(struct e1000_adapter *adapter)
++int e1000e_setup_rx_resources(struct e1000_adapter *adapter)
+ {
+ 	struct e1000_ring *rx_ring = adapter->rx_ring;
+ 	int size, desc_len, err = -ENOMEM;
+@@ -1464,12 +1464,12 @@ static void e1000_clean_tx_ring(struct e1000_adapter *adapter)
+ }
+ 
+ /**
+- * e1000_free_tx_resources - Free Tx Resources per Queue
++ * e1000e_free_tx_resources - Free Tx Resources per Queue
+  * @adapter: board private structure
+  *
+  * Free all transmit software resources
+  **/
+-void e1000_free_tx_resources(struct e1000_adapter *adapter)
++void e1000e_free_tx_resources(struct e1000_adapter *adapter)
+ {
+ 	struct pci_dev *pdev = adapter->pdev;
+ 	struct e1000_ring *tx_ring = adapter->tx_ring;
+@@ -1484,13 +1484,13 @@ void e1000_free_tx_resources(struct e1000_adapter *adapter)
+ }
+ 
+ /**
+- * e1000_free_rx_resources - Free Rx Resources
++ * e1000e_free_rx_resources - Free Rx Resources
+  * @adapter: board private structure
+  *
+  * Free all receive software resources
+  **/
+ 
+-void e1000_free_rx_resources(struct e1000_adapter *adapter)
++void e1000e_free_rx_resources(struct e1000_adapter *adapter)
+ {
+ 	struct pci_dev *pdev = adapter->pdev;
+ 	struct e1000_ring *rx_ring = adapter->rx_ring;
+@@ -1693,7 +1693,7 @@ static void e1000_vlan_rx_add_vid(struct net_device *netdev, u16 vid)
+ 	index = (vid >> 5) & 0x7F;
+ 	vfta = E1000_READ_REG_ARRAY(hw, E1000_VFTA, index);
+ 	vfta |= (1 << (vid & 0x1F));
+-	e1000_write_vfta(hw, index, vfta);
++	e1000e_write_vfta(hw, index, vfta);
+ }
+ 
+ static void e1000_vlan_rx_kill_vid(struct net_device *netdev, u16 vid)
+@@ -1718,7 +1718,7 @@ static void e1000_vlan_rx_kill_vid(struct net_device *netdev, u16 vid)
+ 	index = (vid >> 5) & 0x7F;
+ 	vfta = E1000_READ_REG_ARRAY(hw, E1000_VFTA, index);
+ 	vfta &= ~(1 << (vid & 0x1F));
+-	e1000_write_vfta(hw, index, vfta);
++	e1000e_write_vfta(hw, index, vfta);
+ }
+ 
+ static void e1000_update_mng_vlan(struct e1000_adapter *adapter)
+@@ -1904,7 +1904,7 @@ static void e1000_configure_tx(struct e1000_adapter *adapter)
+ 		ew32(TARC1, tarc);
+ 	}
+ 
+-	e1000_config_collision_dist(hw);
++	e1000e_config_collision_dist(hw);
+ 
+ 	/* Setup Transmit Descriptor Settings for eop descriptor */
+ 	adapter->txd_cmd = E1000_TXD_CMD_EOP | E1000_TXD_CMD_IFCS;
+@@ -2237,14 +2237,14 @@ static void e1000_configure(struct e1000_adapter *adapter)
+ }
+ 
+ /**
+- * e1000_power_up_phy - restore link in case the phy was powered down
++ * e1000e_power_up_phy - restore link in case the phy was powered down
+  * @adapter: address of board private structure
+  *
+  * The phy may be powered down to save power and turn off link when the
+  * driver is unloaded and wake on lan is not enabled (among others)
+- * *** this routine MUST be followed by a call to e1000_reset ***
++ * *** this routine MUST be followed by a call to e1000e_reset ***
+  **/
+-void e1000_power_up_phy(struct e1000_adapter *adapter)
++void e1000e_power_up_phy(struct e1000_adapter *adapter)
+ {
+ 	u16 mii_reg = 0;
+ 
+@@ -2280,7 +2280,7 @@ static void e1000_power_down_phy(struct e1000_adapter *adapter)
+ 		return;
+ 
+ 	/* reset is blocked because of a SoL/IDER session */
+-	if (e1000_check_mng_mode(hw) ||
++	if (e1000e_check_mng_mode(hw) ||
+ 	    e1000_check_reset_block(hw))
+ 		return;
+ 
+@@ -2296,14 +2296,14 @@ static void e1000_power_down_phy(struct e1000_adapter *adapter)
+ }
+ 
+ /**
+- * e1000_reset - bring the hardware into a known good state
++ * e1000e_reset - bring the hardware into a known good state
+  *
+  * This function boots the hardware and enables some settings that
+  * require a configuration cycle of the hardware - those cannot be
+  * set/changed during runtime. After reset the device needs to be
+  * properly configured for rx, tx etc.
+  */
+-void e1000_reset(struct e1000_adapter *adapter)
++void e1000e_reset(struct e1000_adapter *adapter)
+ {
+ 	struct e1000_mac_info *mac = &adapter->hw.mac;
+ 	struct e1000_hw *hw = &adapter->hw;
+@@ -2388,7 +2388,7 @@ void e1000_reset(struct e1000_adapter *adapter)
+ 	/* Enable h/w to recognize an 802.1Q VLAN Ethernet packet */
+ 	ew32(VET, ETH_P_8021Q);
+ 
+-	e1000_reset_adaptive(hw);
++	e1000e_reset_adaptive(hw);
+ 	e1000_get_phy_info(hw);
+ 
+ 	if (!(adapter->flags & FLAG_SMART_POWER_DOWN)) {
+@@ -2404,7 +2404,7 @@ void e1000_reset(struct e1000_adapter *adapter)
+ 	e1000_release_manageability(adapter);
+ }
+ 
+-int e1000_up(struct e1000_adapter *adapter)
++int e1000e_up(struct e1000_adapter *adapter)
+ {
+ 	struct e1000_hw *hw = &adapter->hw;
+ 
+@@ -2421,7 +2421,7 @@ int e1000_up(struct e1000_adapter *adapter)
+ 	return 0;
+ }
+ 
+-void e1000_down(struct e1000_adapter *adapter)
++void e1000e_down(struct e1000_adapter *adapter)
+ {
+ 	struct net_device *netdev = adapter->netdev;
+ 	struct e1000_hw *hw = &adapter->hw;
+@@ -2457,7 +2457,7 @@ void e1000_down(struct e1000_adapter *adapter)
+ 	adapter->link_speed = 0;
+ 	adapter->link_duplex = 0;
+ 
+-	e1000_reset(adapter);
++	e1000e_reset(adapter);
+ 	e1000_clean_tx_ring(adapter);
+ 	e1000_clean_rx_ring(adapter);
+ 
+@@ -2467,13 +2467,13 @@ void e1000_down(struct e1000_adapter *adapter)
+ 	 */
+ }
+ 
+-void e1000_reinit_locked(struct e1000_adapter *adapter)
++void e1000e_reinit_locked(struct e1000_adapter *adapter)
+ {
+ 	might_sleep();
+ 	while (test_and_set_bit(__E1000_RESETTING, &adapter->state))
+ 		msleep(1);
+-	e1000_down(adapter);
+-	e1000_up(adapter);
++	e1000e_down(adapter);
++	e1000e_up(adapter);
+ 	clear_bit(__E1000_RESETTING, &adapter->state);
+ }
+ 
+@@ -2544,16 +2544,16 @@ static int e1000_open(struct net_device *netdev)
+ 		return -EBUSY;
+ 
+ 	/* allocate transmit descriptors */
+-	err = e1000_setup_tx_resources(adapter);
++	err = e1000e_setup_tx_resources(adapter);
+ 	if (err)
+ 		goto err_setup_tx;
+ 
+ 	/* allocate receive descriptors */
+-	err = e1000_setup_rx_resources(adapter);
++	err = e1000e_setup_rx_resources(adapter);
+ 	if (err)
+ 		goto err_setup_rx;
+ 
+-	e1000_power_up_phy(adapter);
++	e1000e_power_up_phy(adapter);
+ 
+ 	adapter->mng_vlan_id = E1000_MNG_VLAN_NONE;
+ 	if ((adapter->hw.mng_cookie.status &
+@@ -2563,7 +2563,7 @@ static int e1000_open(struct net_device *netdev)
+ 	/* If AMT is enabled, let the firmware know that the network
+ 	 * interface is now open */
+ 	if ((adapter->flags & FLAG_HAS_AMT) &&
+-	    e1000_check_mng_mode(&adapter->hw))
++	    e1000e_check_mng_mode(&adapter->hw))
+ 		e1000_get_hw_control(adapter);
+ 
+ 	/* before we allocate an interrupt, we must be ready to handle it.
+@@ -2576,7 +2576,7 @@ static int e1000_open(struct net_device *netdev)
+ 	if (err)
+ 		goto err_req_irq;
+ 
+-	/* From here on the code is the same as e1000_up() */
++	/* From here on the code is the same as e1000e_up() */
+ 	clear_bit(__E1000_DOWN, &adapter->state);
+ 
+ 	netif_poll_enable(netdev);
+@@ -2591,11 +2591,11 @@ static int e1000_open(struct net_device *netdev)
+ err_req_irq:
+ 	e1000_release_hw_control(adapter);
+ 	e1000_power_down_phy(adapter);
+-	e1000_free_rx_resources(adapter);
++	e1000e_free_rx_resources(adapter);
+ err_setup_rx:
+-	e1000_free_tx_resources(adapter);
++	e1000e_free_tx_resources(adapter);
+ err_setup_tx:
+-	e1000_reset(adapter);
++	e1000e_reset(adapter);
+ 
+ 	return err;
+ }
+@@ -2616,12 +2616,12 @@ static int e1000_close(struct net_device *netdev)
+ 	struct e1000_adapter *adapter = netdev_priv(netdev);
+ 
+ 	WARN_ON(test_bit(__E1000_RESETTING, &adapter->state));
+-	e1000_down(adapter);
++	e1000e_down(adapter);
+ 	e1000_power_down_phy(adapter);
+ 	e1000_free_irq(adapter);
+ 
+-	e1000_free_tx_resources(adapter);
+-	e1000_free_rx_resources(adapter);
++	e1000e_free_tx_resources(adapter);
++	e1000e_free_rx_resources(adapter);
+ 
+ 	/* kill manageability vlan ID if supported, but not if a vlan with
+ 	 * the same ID is registered on the host OS (let 8021q kill it) */
+@@ -2634,7 +2634,7 @@ static int e1000_close(struct net_device *netdev)
+ 	/* If AMT is enabled, let the firmware know that the network
+ 	 * interface is now closed */
+ 	if ((adapter->flags & FLAG_HAS_AMT) &&
+-	    e1000_check_mng_mode(&adapter->hw))
++	    e1000e_check_mng_mode(&adapter->hw))
+ 		e1000_release_hw_control(adapter);
+ 
+ 	return 0;
+@@ -2657,11 +2657,11 @@ static int e1000_set_mac(struct net_device *netdev, void *p)
+ 	memcpy(netdev->dev_addr, addr->sa_data, netdev->addr_len);
+ 	memcpy(adapter->hw.mac.addr, addr->sa_data, netdev->addr_len);
+ 
+-	e1000_rar_set(&adapter->hw, adapter->hw.mac.addr, 0);
++	e1000e_rar_set(&adapter->hw, adapter->hw.mac.addr, 0);
+ 
+ 	if (adapter->flags & FLAG_RESET_OVERWRITES_LAA) {
+ 		/* activate the work around */
+-		e1000_set_laa_state_82571(&adapter->hw, 1);
++		e1000e_set_laa_state_82571(&adapter->hw, 1);
+ 
+ 		/* Hold a copy of the LAA in RAR[14] This is done so that
+ 		 * between the time RAR[0] gets clobbered  and the time it
+@@ -2669,7 +2669,7 @@ static int e1000_set_mac(struct net_device *netdev, void *p)
+ 		 * of the RARs and no incoming packets directed to this port
+ 		 * are dropped. Eventually the LAA will be in RAR[0] and
+ 		 * RAR[14] */
+-		e1000_rar_set(&adapter->hw,
++		e1000e_rar_set(&adapter->hw,
+ 			      adapter->hw.mac.addr,
+ 			      adapter->hw.mac.rar_entry_count - 1);
+ 	}
+@@ -2686,10 +2686,10 @@ static void e1000_update_phy_info(unsigned long data)
+ }
+ 
+ /**
+- * e1000_update_stats - Update the board statistics counters
++ * e1000e_update_stats - Update the board statistics counters
+  * @adapter: board private structure
+  **/
+-void e1000_update_stats(struct e1000_adapter *adapter)
++void e1000e_update_stats(struct e1000_adapter *adapter)
+ {
+ 	struct e1000_hw *hw = &adapter->hw;
+ 	struct pci_dev *pdev = adapter->pdev;
+@@ -2903,7 +2903,7 @@ static void e1000_watchdog_task(struct work_struct *work)
+ 			"Gigabit has been disabled, downgrading speed\n");
+ 	}
+ 
+-	if ((e1000_enable_tx_pkt_filtering(hw)) &&
++	if ((e1000e_enable_tx_pkt_filtering(hw)) &&
+ 	    (adapter->mng_vlan_id != adapter->hw.mng_cookie.vlan_id))
+ 		e1000_update_mng_vlan(adapter);
+ 
+@@ -3005,7 +3005,7 @@ static void e1000_watchdog_task(struct work_struct *work)
+ 	}
+ 
+ link_up:
+-	e1000_update_stats(adapter);
++	e1000e_update_stats(adapter);
+ 
+ 	mac->tx_packet_delta = adapter->stats.tpt - adapter->tpt_old;
+ 	adapter->tpt_old = adapter->stats.tpt;
+@@ -3017,7 +3017,7 @@ link_up:
+ 	adapter->gotcl = adapter->stats.gotcl - adapter->gotcl_old;
+ 	adapter->gotcl_old = adapter->stats.gotcl;
+ 
+-	e1000_update_adaptive(&adapter->hw);
++	e1000e_update_adaptive(&adapter->hw);
+ 
+ 	if (!netif_carrier_ok(netdev)) {
+ 		tx_pending = (e1000_desc_unused(tx_ring) + 1 <
+@@ -3040,8 +3040,8 @@ link_up:
+ 
+ 	/* With 82571 controllers, LAA may be overwritten due to controller
+ 	 * reset from the other port. Set the appropriate LAA in RAR[0] */
+-	if (e1000_get_laa_state_82571(hw))
+-		e1000_rar_set(hw, adapter->hw.mac.addr, 0);
++	if (e1000e_get_laa_state_82571(hw))
++		e1000e_rar_set(hw, adapter->hw.mac.addr, 0);
+ 
+ 	/* Reset the timer */
+ 	if (!test_bit(__E1000_DOWN, &adapter->state))
+@@ -3358,7 +3358,7 @@ static int e1000_transfer_dhcp_info(struct e1000_adapter *adapter,
+ 
+ 		offset = (u8 *)udp + 8 - skb->data;
+ 		length = skb->len - offset;
+-		return e1000_mng_write_dhcp_info(hw, (u8 *)udp + 8, length);
++		return e1000e_mng_write_dhcp_info(hw, (u8 *)udp + 8, length);
+ 	}
+ 
+ 	return 0;
+@@ -3540,7 +3540,7 @@ static void e1000_reset_task(struct work_struct *work)
+ 	struct e1000_adapter *adapter;
+ 	adapter = container_of(work, struct e1000_adapter, reset_task);
+ 
+-	e1000_reinit_locked(adapter);
++	e1000e_reinit_locked(adapter);
+ }
+ 
+ /**
+@@ -3596,10 +3596,10 @@ static int e1000_change_mtu(struct net_device *netdev, int new_mtu)
+ 
+ 	while (test_and_set_bit(__E1000_RESETTING, &adapter->state))
+ 		msleep(1);
+-	/* e1000_down has a dependency on max_frame_size */
++	/* e1000e_down has a dependency on max_frame_size */
+ 	adapter->hw.mac.max_frame_size = max_frame;
+ 	if (netif_running(netdev))
+-		e1000_down(adapter);
++		e1000e_down(adapter);
+ 
+ 	/* NOTE: netdev_alloc_skb reserves 16 bytes, and typically NET_IP_ALIGN
+ 	 * means we reserve 2 more, this pushes us to allocate from the next
+@@ -3630,9 +3630,9 @@ static int e1000_change_mtu(struct net_device *netdev, int new_mtu)
+ 	netdev->mtu = new_mtu;
+ 
+ 	if (netif_running(netdev))
+-		e1000_up(adapter);
++		e1000e_up(adapter);
+ 	else
+-		e1000_reset(adapter);
++		e1000e_reset(adapter);
+ 
+ 	clear_bit(__E1000_RESETTING, &adapter->state);
+ 
+@@ -3696,7 +3696,7 @@ static int e1000_suspend(struct pci_dev *pdev, pm_message_t state)
+ 
+ 	if (netif_running(netdev)) {
+ 		WARN_ON(test_bit(__E1000_RESETTING, &adapter->state));
+-		e1000_down(adapter);
++		e1000e_down(adapter);
+ 		e1000_free_irq(adapter);
+ 	}
+ 
+@@ -3737,7 +3737,7 @@ static int e1000_suspend(struct pci_dev *pdev, pm_message_t state)
+ 		}
+ 
+ 		/* Allow time for pending master requests to run */
+-		e1000_disable_pcie_master(&adapter->hw);
++		e1000e_disable_pcie_master(&adapter->hw);
+ 
+ 		ew32(WUC, E1000_WUC_PME_EN);
+ 		ew32(WUFC, wufc);
+@@ -3759,7 +3759,7 @@ static int e1000_suspend(struct pci_dev *pdev, pm_message_t state)
+ 	}
+ 
+ 	if (adapter->hw.phy.type == e1000_phy_igp_3)
+-		e1000_igp3_phy_powerdown_workaround_ich8lan(&adapter->hw);
++		e1000e_igp3_phy_powerdown_workaround_ich8lan(&adapter->hw);
+ 
+ 	/* Release control of h/w to f/w.  If f/w is AMT enabled, this
+ 	 * would have already happened in close and is redundant. */
+@@ -3800,21 +3800,21 @@ static int e1000_resume(struct pci_dev *pdev)
+ 			return err;
+ 	}
+ 
+-	e1000_power_up_phy(adapter);
+-	e1000_reset(adapter);
++	e1000e_power_up_phy(adapter);
++	e1000e_reset(adapter);
+ 	ew32(WUS, ~0);
+ 
+ 	e1000_init_manageability(adapter);
+ 
+ 	if (netif_running(netdev))
+-		e1000_up(adapter);
++		e1000e_up(adapter);
+ 
+ 	netif_device_attach(netdev);
+ 
+ 	/* If the controller has AMT, do not set DRV_LOAD until the interface
+ 	 * is up.  For all other cases, let the f/w know that the h/w is now
+ 	 * under the control of the driver. */
+-	if (!(adapter->flags & FLAG_HAS_AMT) || !e1000_check_mng_mode(&adapter->hw))
++	if (!(adapter->flags & FLAG_HAS_AMT) || !e1000e_check_mng_mode(&adapter->hw))
+ 		e1000_get_hw_control(adapter);
+ 
+ 	return 0;
+@@ -3862,7 +3862,7 @@ static pci_ers_result_t e1000_io_error_detected(struct pci_dev *pdev,
+ 	netif_device_detach(netdev);
+ 
+ 	if (netif_running(netdev))
+-		e1000_down(adapter);
++		e1000e_down(adapter);
+ 	pci_disable_device(pdev);
+ 
+ 	/* Request a slot slot reset. */
+@@ -3892,7 +3892,7 @@ static pci_ers_result_t e1000_io_slot_reset(struct pci_dev *pdev)
+ 	pci_enable_wake(pdev, PCI_D3hot, 0);
+ 	pci_enable_wake(pdev, PCI_D3cold, 0);
+ 
+-	e1000_reset(adapter);
++	e1000e_reset(adapter);
+ 	ew32(WUS, ~0);
+ 
+ 	return PCI_ERS_RESULT_RECOVERED;
+@@ -3914,7 +3914,7 @@ static void e1000_io_resume(struct pci_dev *pdev)
+ 	e1000_init_manageability(adapter);
+ 
+ 	if (netif_running(netdev)) {
+-		if (e1000_up(adapter)) {
++		if (e1000e_up(adapter)) {
+ 			dev_err(&pdev->dev,
+ 				"can't bring device back up after reset\n");
+ 			return;
+@@ -3927,7 +3927,7 @@ static void e1000_io_resume(struct pci_dev *pdev)
+ 	 * is up.  For all other cases, let the f/w know that the h/w is now
+ 	 * under the control of the driver. */
+ 	if (!(adapter->flags & FLAG_HAS_AMT) ||
+-	    !e1000_check_mng_mode(&adapter->hw))
++	    !e1000e_check_mng_mode(&adapter->hw))
+ 		e1000_get_hw_control(adapter);
+ 
+ }
+@@ -4001,7 +4001,7 @@ static int __devinit e1000_probe(struct pci_dev *pdev,
+ 		}
+ 	}
+ 
+-	err = pci_request_regions(pdev, e1000_driver_name);
++	err = pci_request_regions(pdev, e1000e_driver_name);
+ 	if (err)
+ 		goto err_pci_reg;
+ 
+@@ -4053,7 +4053,7 @@ static int __devinit e1000_probe(struct pci_dev *pdev,
+ 	netdev->set_mac_address		= &e1000_set_mac;
+ 	netdev->change_mtu		= &e1000_change_mtu;
+ 	netdev->do_ioctl		= &e1000_ioctl;
+-	e1000_set_ethtool_ops(netdev);
++	e1000e_set_ethtool_ops(netdev);
+ 	netdev->tx_timeout		= &e1000_tx_timeout;
+ 	netdev->watchdog_timeo		= 5 * HZ;
+ 	netdev->poll			= &e1000_clean;
+@@ -4119,7 +4119,7 @@ static int __devinit e1000_probe(struct pci_dev *pdev,
+ 	 * it. */
+ 	netdev->features |= NETIF_F_LLTX;
+ 
+-	if (e1000_enable_mng_pass_thru(&adapter->hw))
++	if (e1000e_enable_mng_pass_thru(&adapter->hw))
+ 		adapter->flags |= FLAG_MNG_PT_ENABLED;
+ 
+ 	/* before reading the NVM, reset the controller to
+@@ -4141,7 +4141,7 @@ static int __devinit e1000_probe(struct pci_dev *pdev,
+ 	}
+ 
+ 	/* copy the MAC address out of the NVM */
+-	if (e1000_read_mac_addr(&adapter->hw))
++	if (e1000e_read_mac_addr(&adapter->hw))
+ 		ndev_err(netdev, "NVM Read Error while reading MAC address\n");
+ 
+ 	memcpy(netdev->dev_addr, adapter->hw.mac.addr, netdev->addr_len);
+@@ -4168,7 +4168,7 @@ static int __devinit e1000_probe(struct pci_dev *pdev,
+ 	INIT_WORK(&adapter->reset_task, e1000_reset_task);
+ 	INIT_WORK(&adapter->watchdog_task, e1000_watchdog_task);
+ 
+-	e1000_check_options(adapter);
++	e1000e_check_options(adapter);
+ 
+ 	/* Initialize link parameters. User can change them with ethtool */
+ 	adapter->hw.mac.autoneg = 1;
+@@ -4214,13 +4214,13 @@ static int __devinit e1000_probe(struct pci_dev *pdev,
+ 	adapter->wol = adapter->eeprom_wol;
+ 
+ 	/* reset the hardware with the new settings */
+-	e1000_reset(adapter);
++	e1000e_reset(adapter);
+ 
+ 	/* If the controller has AMT, do not set DRV_LOAD until the interface
+ 	 * is up.  For all other cases, let the f/w know that the h/w is now
+ 	 * under the control of the driver. */
+ 	if (!(adapter->flags & FLAG_HAS_AMT) ||
+-	    !e1000_check_mng_mode(&adapter->hw))
++	    !e1000e_check_mng_mode(&adapter->hw))
+ 		e1000_get_hw_control(adapter);
+ 
+ 	/* tell the stack to leave us alone until e1000_open() is called */
+@@ -4315,7 +4315,7 @@ static struct pci_error_handlers e1000_err_handler = {
+ 	.resume = e1000_io_resume,
+ };
+ 
+-static struct pci_device_id e1000e_pci_tbl[] = {
++static struct pci_device_id e1000_pci_tbl[] = {
+ 	/*
+ 	 * Support for 82571/2/3, es2lan and ich8 will be phased in
+ 	 * stepwise.
+@@ -4358,12 +4358,12 @@ static struct pci_device_id e1000e_pci_tbl[] = {
+ 
+ 	{ }	/* terminate list */
+ };
+-MODULE_DEVICE_TABLE(pci, e1000e_pci_tbl);
++MODULE_DEVICE_TABLE(pci, e1000_pci_tbl);
+ 
+ /* PCI Device API Driver */
+ static struct pci_driver e1000_driver = {
+-	.name     = e1000_driver_name,
+-	.id_table = e1000e_pci_tbl,
++	.name     = e1000e_driver_name,
++	.id_table = e1000_pci_tbl,
+ 	.probe    = e1000_probe,
+ 	.remove   = __devexit_p(e1000_remove),
+ #ifdef CONFIG_PM
+@@ -4381,17 +4381,17 @@ static struct pci_driver e1000_driver = {
+  * e1000_init_module is the first routine called when the driver is
+  * loaded. All it does is register with the PCI subsystem.
+  **/
+-static int __init e1000e_init_module(void)
++static int __init e1000_init_module(void)
+ {
+ 	int ret;
+ 	printk(KERN_INFO "Intel(R) PRO/1000 Network Driver - %s\n",
+-	       e1000_driver_version);
++	       e1000e_driver_version);
+ 	printk(KERN_INFO "Copyright (c) 1999-2007 Intel Corporation.\n");
+ 	ret = pci_register_driver(&e1000_driver);
+ 
+ 	return ret;
+ }
+-module_init(e1000e_init_module);
++module_init(e1000_init_module);
+ 
+ /**
+  * e1000_exit_module - Driver Exit Cleanup Routine
+@@ -4399,11 +4399,11 @@ module_init(e1000e_init_module);
+  * e1000_exit_module is called just before the driver is removed
+  * from memory.
+  **/
+-static void __exit e1000e_exit_module(void)
++static void __exit e1000_exit_module(void)
+ {
+ 	pci_unregister_driver(&e1000_driver);
+ }
+-module_exit(e1000e_exit_module);
++module_exit(e1000_exit_module);
+ 
+ 
+ MODULE_AUTHOR("Intel Corporation, <linux.nics at intel.com>");
+diff --git a/drivers/net/e1000e/param.c b/drivers/net/e1000e/param.c
+index 9a70d22..e4e655e 100644
+--- a/drivers/net/e1000e/param.c
++++ b/drivers/net/e1000e/param.c
+@@ -192,7 +192,7 @@ static int __devinit e1000_validate_option(int *value,
+ }
+ 
+ /**
+- * e1000_check_options - Range Checking for Command Line Parameters
++ * e1000e_check_options - Range Checking for Command Line Parameters
+  * @adapter: board private structure
+  *
+  * This routine checks all command line parameters for valid user
+@@ -200,7 +200,7 @@ static int __devinit e1000_validate_option(int *value,
+  * value exists, a default value is used.  The final value is stored
+  * in a variable in the adapter structure.
+  **/
+-void __devinit e1000_check_options(struct e1000_adapter *adapter)
++void __devinit e1000e_check_options(struct e1000_adapter *adapter)
+ {
+ 	struct e1000_hw *hw = &adapter->hw;
+ 	struct net_device *netdev = adapter->netdev;
+@@ -371,11 +371,11 @@ void __devinit e1000_check_options(struct e1000_adapter *adapter)
+ 			int kmrn_lock_loss = KumeranLockLoss[bd];
+ 			e1000_validate_option(&kmrn_lock_loss, &opt, adapter);
+ 			if (hw->mac.type == e1000_ich8lan)
+-				e1000_set_kmrn_lock_loss_workaround_ich8lan(hw,
++				e1000e_set_kmrn_lock_loss_workaround_ich8lan(hw,
+ 								kmrn_lock_loss);
+ 		} else {
+ 			if (hw->mac.type == e1000_ich8lan)
+-				e1000_set_kmrn_lock_loss_workaround_ich8lan(hw,
++				e1000e_set_kmrn_lock_loss_workaround_ich8lan(hw,
+ 								       opt.def);
+ 		}
+ 	}
+diff --git a/drivers/net/e1000e/phy.c b/drivers/net/e1000e/phy.c
+index c9304d8..1efb47a 100644
+--- a/drivers/net/e1000e/phy.c
++++ b/drivers/net/e1000e/phy.c
+@@ -53,14 +53,14 @@ static const u16 e1000_igp_2_cable_length_table[] =
+ 		 sizeof(e1000_igp_2_cable_length_table[0]))
+ 
+ /**
+- *  e1000_check_reset_block_generic - Check if PHY reset is blocked
++ *  e1000e_check_reset_block_generic - Check if PHY reset is blocked
+  *  @hw: pointer to the HW structure
+  *
+  *  Read the PHY management control register and check whether a PHY reset
+  *  is blocked.  If a reset is not blocked return 0, otherwise
+  *  return E1000_BLK_PHY_RESET (12).
+  **/
+-s32 e1000_check_reset_block_generic(struct e1000_hw *hw)
++s32 e1000e_check_reset_block_generic(struct e1000_hw *hw)
+ {
+ 	u32 manc;
+ 
+@@ -71,13 +71,13 @@ s32 e1000_check_reset_block_generic(struct e1000_hw *hw)
+ }
+ 
+ /**
+- *  e1000_get_phy_id - Retrieve the PHY ID and revision
++ *  e1000e_get_phy_id - Retrieve the PHY ID and revision
+  *  @hw: pointer to the HW structure
+  *
+  *  Reads the PHY registers and stores the PHY ID and possibly the PHY
+  *  revision in the hardware structure.
+  **/
+-s32 e1000_get_phy_id(struct e1000_hw *hw)
++s32 e1000e_get_phy_id(struct e1000_hw *hw)
+ {
+ 	struct e1000_phy_info *phy = &hw->phy;
+ 	s32 ret_val;
+@@ -100,12 +100,12 @@ s32 e1000_get_phy_id(struct e1000_hw *hw)
+ }
+ 
+ /**
+- *  e1000_phy_reset_dsp - Reset PHY DSP
++ *  e1000e_phy_reset_dsp - Reset PHY DSP
+  *  @hw: pointer to the HW structure
+  *
+  *  Reset the digital signal processor.
+  **/
+-s32 e1000_phy_reset_dsp(struct e1000_hw *hw)
++s32 e1000e_phy_reset_dsp(struct e1000_hw *hw)
+ {
+ 	s32 ret_val;
+ 
+@@ -210,7 +210,7 @@ static s32 e1000_write_phy_reg_mdic(struct e1000_hw *hw, u32 offset, u16 data)
+ }
+ 
+ /**
+- *  e1000_read_phy_reg_m88 - Read m88 PHY register
++ *  e1000e_read_phy_reg_m88 - Read m88 PHY register
+  *  @hw: pointer to the HW structure
+  *  @offset: register offset to be read
+  *  @data: pointer to the read data
+@@ -219,7 +219,7 @@ static s32 e1000_write_phy_reg_mdic(struct e1000_hw *hw, u32 offset, u16 data)
+  *  and storing the retrieved information in data.  Release any acquired
+  *  semaphores before exiting.
+  **/
+-s32 e1000_read_phy_reg_m88(struct e1000_hw *hw, u32 offset, u16 *data)
++s32 e1000e_read_phy_reg_m88(struct e1000_hw *hw, u32 offset, u16 *data)
+ {
+ 	s32 ret_val;
+ 
+@@ -237,7 +237,7 @@ s32 e1000_read_phy_reg_m88(struct e1000_hw *hw, u32 offset, u16 *data)
+ }
+ 
+ /**
+- *  e1000_write_phy_reg_m88 - Write m88 PHY register
++ *  e1000e_write_phy_reg_m88 - Write m88 PHY register
+  *  @hw: pointer to the HW structure
+  *  @offset: register offset to write to
+  *  @data: data to write at register offset
+@@ -245,7 +245,7 @@ s32 e1000_read_phy_reg_m88(struct e1000_hw *hw, u32 offset, u16 *data)
+  *  Acquires semaphore, if necessary, then writes the data to PHY register
+  *  at the offset.  Release any acquired semaphores before exiting.
+  **/
+-s32 e1000_write_phy_reg_m88(struct e1000_hw *hw, u32 offset, u16 data)
++s32 e1000e_write_phy_reg_m88(struct e1000_hw *hw, u32 offset, u16 data)
+ {
+ 	s32 ret_val;
+ 
+@@ -263,7 +263,7 @@ s32 e1000_write_phy_reg_m88(struct e1000_hw *hw, u32 offset, u16 data)
+ }
+ 
+ /**
+- *  e1000_read_phy_reg_igp - Read igp PHY register
++ *  e1000e_read_phy_reg_igp - Read igp PHY register
+  *  @hw: pointer to the HW structure
+  *  @offset: register offset to be read
+  *  @data: pointer to the read data
+@@ -272,7 +272,7 @@ s32 e1000_write_phy_reg_m88(struct e1000_hw *hw, u32 offset, u16 data)
+  *  and storing the retrieved information in data.  Release any acquired
+  *  semaphores before exiting.
+  **/
+-s32 e1000_read_phy_reg_igp(struct e1000_hw *hw, u32 offset, u16 *data)
++s32 e1000e_read_phy_reg_igp(struct e1000_hw *hw, u32 offset, u16 *data)
+ {
+ 	s32 ret_val;
+ 
+@@ -300,7 +300,7 @@ s32 e1000_read_phy_reg_igp(struct e1000_hw *hw, u32 offset, u16 *data)
+ }
+ 
+ /**
+- *  e1000_write_phy_reg_igp - Write igp PHY register
++ *  e1000e_write_phy_reg_igp - Write igp PHY register
+  *  @hw: pointer to the HW structure
+  *  @offset: register offset to write to
+  *  @data: data to write at register offset
+@@ -308,7 +308,7 @@ s32 e1000_read_phy_reg_igp(struct e1000_hw *hw, u32 offset, u16 *data)
+  *  Acquires semaphore, if necessary, then writes the data to PHY register
+  *  at the offset.  Release any acquired semaphores before exiting.
+  **/
+-s32 e1000_write_phy_reg_igp(struct e1000_hw *hw, u32 offset, u16 data)
++s32 e1000e_write_phy_reg_igp(struct e1000_hw *hw, u32 offset, u16 data)
+ {
+ 	s32 ret_val;
+ 
+@@ -336,7 +336,7 @@ s32 e1000_write_phy_reg_igp(struct e1000_hw *hw, u32 offset, u16 data)
+ }
+ 
+ /**
+- *  e1000_read_kmrn_reg - Read kumeran register
++ *  e1000e_read_kmrn_reg - Read kumeran register
+  *  @hw: pointer to the HW structure
+  *  @offset: register offset to be read
+  *  @data: pointer to the read data
+@@ -345,7 +345,7 @@ s32 e1000_write_phy_reg_igp(struct e1000_hw *hw, u32 offset, u16 data)
+  *  using the kumeran interface.  The information retrieved is stored in data.
+  *  Release any acquired semaphores before exiting.
+  **/
+-s32 e1000_read_kmrn_reg(struct e1000_hw *hw, u32 offset, u16 *data)
++s32 e1000e_read_kmrn_reg(struct e1000_hw *hw, u32 offset, u16 *data)
+ {
+ 	u32 kmrnctrlsta;
+ 	s32 ret_val;
+@@ -369,7 +369,7 @@ s32 e1000_read_kmrn_reg(struct e1000_hw *hw, u32 offset, u16 *data)
+ }
+ 
+ /**
+- *  e1000_write_kmrn_reg - Write kumeran register
++ *  e1000e_write_kmrn_reg - Write kumeran register
+  *  @hw: pointer to the HW structure
+  *  @offset: register offset to write to
+  *  @data: data to write at register offset
+@@ -378,7 +378,7 @@ s32 e1000_read_kmrn_reg(struct e1000_hw *hw, u32 offset, u16 *data)
+  *  at the offset using the kumeran interface.  Release any acquired semaphores
+  *  before exiting.
+  **/
+-s32 e1000_write_kmrn_reg(struct e1000_hw *hw, u32 offset, u16 data)
++s32 e1000e_write_kmrn_reg(struct e1000_hw *hw, u32 offset, u16 data)
+ {
+ 	u32 kmrnctrlsta;
+ 	s32 ret_val;
+@@ -398,13 +398,13 @@ s32 e1000_write_kmrn_reg(struct e1000_hw *hw, u32 offset, u16 data)
+ }
+ 
+ /**
+- *  e1000_copper_link_setup_m88 - Setup m88 PHY's for copper link
++ *  e1000e_copper_link_setup_m88 - Setup m88 PHY's for copper link
+  *  @hw: pointer to the HW structure
+  *
+  *  Sets up MDI/MDI-X and polarity for m88 PHY's.  If necessary, transmit clock
+  *  and downshift values are set also.
+  **/
+-s32 e1000_copper_link_setup_m88(struct e1000_hw *hw)
++s32 e1000e_copper_link_setup_m88(struct e1000_hw *hw)
+ {
+ 	struct e1000_phy_info *phy = &hw->phy;
+ 	s32 ret_val;
+@@ -484,7 +484,7 @@ s32 e1000_copper_link_setup_m88(struct e1000_hw *hw)
+ 	}
+ 
+ 	/* Commit the changes. */
+-	ret_val = e1000_commit_phy(hw);
++	ret_val = e1000e_commit_phy(hw);
+ 	if (ret_val)
+ 		hw_dbg(hw, "Error committing the PHY changes\n");
+ 
+@@ -492,13 +492,13 @@ s32 e1000_copper_link_setup_m88(struct e1000_hw *hw)
+ }
+ 
+ /**
+- *  e1000_copper_link_setup_igp - Setup igp PHY's for copper link
++ *  e1000e_copper_link_setup_igp - Setup igp PHY's for copper link
+  *  @hw: pointer to the HW structure
+  *
+  *  Sets up LPLU, MDI/MDI-X, polarity, Smartspeed and Master/Slave config for
+  *  igp PHY's.
+  **/
+-s32 e1000_copper_link_setup_igp(struct e1000_hw *hw)
++s32 e1000e_copper_link_setup_igp(struct e1000_hw *hw)
+ {
+ 	struct e1000_phy_info *phy = &hw->phy;
+ 	s32 ret_val;
+@@ -715,7 +715,7 @@ static s32 e1000_phy_setup_autoneg(struct e1000_hw *hw)
+ 		/* Since there really isn't a way to advertise that we are
+ 		 * capable of RX Pause ONLY, we will advertise that we
+ 		 * support both symmetric and asymmetric RX PAUSE.  Later
+-		 * (in e1000_config_fc_after_link_up) we will disable the
++		 * (in e1000e_config_fc_after_link_up) we will disable the
+ 		 * hw's ability to send PAUSE frames.
+ 		 */
+ 		mii_autoneg_adv_reg |= (NWAY_AR_ASM_DIR | NWAY_AR_PAUSE);
+@@ -816,7 +816,7 @@ static s32 e1000_copper_link_autoneg(struct e1000_hw *hw)
+ }
+ 
+ /**
+- *  e1000_setup_copper_link - Configure copper link settings
++ *  e1000e_setup_copper_link - Configure copper link settings
+  *  @hw: pointer to the HW structure
+  *
+  *  Calls the appropriate function to configure the link for auto-neg or forced
+@@ -824,7 +824,7 @@ static s32 e1000_copper_link_autoneg(struct e1000_hw *hw)
+  *  to configure collision distance and flow control are called.  If link is
+  *  not established, we return -E1000_ERR_PHY (-2).
+  **/
+-s32 e1000_setup_copper_link(struct e1000_hw *hw)
++s32 e1000e_setup_copper_link(struct e1000_hw *hw)
+ {
+ 	s32 ret_val;
+ 	bool link;
+@@ -849,7 +849,7 @@ s32 e1000_setup_copper_link(struct e1000_hw *hw)
+ 	/* Check link status. Wait up to 100 microseconds for link to become
+ 	 * valid.
+ 	 */
+-	ret_val = e1000_phy_has_link_generic(hw,
++	ret_val = e1000e_phy_has_link_generic(hw,
+ 					     COPPER_LINK_UP_LIMIT,
+ 					     10,
+ 					     &link);
+@@ -858,8 +858,8 @@ s32 e1000_setup_copper_link(struct e1000_hw *hw)
+ 
+ 	if (link) {
+ 		hw_dbg(hw, "Valid link established!!!\n");
+-		e1000_config_collision_dist(hw);
+-		ret_val = e1000_config_fc_after_link_up(hw);
++		e1000e_config_collision_dist(hw);
++		ret_val = e1000e_config_fc_after_link_up(hw);
+ 	} else {
+ 		hw_dbg(hw, "Unable to establish link!!!\n");
+ 	}
+@@ -868,14 +868,14 @@ s32 e1000_setup_copper_link(struct e1000_hw *hw)
+ }
+ 
+ /**
+- *  e1000_phy_force_speed_duplex_igp - Force speed/duplex for igp PHY
++ *  e1000e_phy_force_speed_duplex_igp - Force speed/duplex for igp PHY
+  *  @hw: pointer to the HW structure
+  *
+  *  Calls the PHY setup function to force speed and duplex.  Clears the
+  *  auto-crossover to force MDI manually.  Waits for link and returns
+  *  successful if link up is successful, else -E1000_ERR_PHY (-2).
+  **/
+-s32 e1000_phy_force_speed_duplex_igp(struct e1000_hw *hw)
++s32 e1000e_phy_force_speed_duplex_igp(struct e1000_hw *hw)
+ {
+ 	struct e1000_phy_info *phy = &hw->phy;
+ 	s32 ret_val;
+@@ -886,7 +886,7 @@ s32 e1000_phy_force_speed_duplex_igp(struct e1000_hw *hw)
+ 	if (ret_val)
+ 		return ret_val;
+ 
+-	e1000_phy_force_speed_duplex_setup(hw, &phy_data);
++	e1000e_phy_force_speed_duplex_setup(hw, &phy_data);
+ 
+ 	ret_val = e1e_wphy(hw, PHY_CONTROL, phy_data);
+ 	if (ret_val)
+@@ -913,7 +913,7 @@ s32 e1000_phy_force_speed_duplex_igp(struct e1000_hw *hw)
+ 	if (phy->wait_for_link) {
+ 		hw_dbg(hw, "Waiting for forced speed/duplex link on IGP phy.\n");
+ 
+-		ret_val = e1000_phy_has_link_generic(hw,
++		ret_val = e1000e_phy_has_link_generic(hw,
+ 						     PHY_FORCE_LIMIT,
+ 						     100000,
+ 						     &link);
+@@ -924,7 +924,7 @@ s32 e1000_phy_force_speed_duplex_igp(struct e1000_hw *hw)
+ 			hw_dbg(hw, "Link taking longer than expected.\n");
+ 
+ 		/* Try once more */
+-		ret_val = e1000_phy_has_link_generic(hw,
++		ret_val = e1000e_phy_has_link_generic(hw,
+ 						     PHY_FORCE_LIMIT,
+ 						     100000,
+ 						     &link);
+@@ -936,7 +936,7 @@ s32 e1000_phy_force_speed_duplex_igp(struct e1000_hw *hw)
+ }
+ 
+ /**
+- *  e1000_phy_force_speed_duplex_m88 - Force speed/duplex for m88 PHY
++ *  e1000e_phy_force_speed_duplex_m88 - Force speed/duplex for m88 PHY
+  *  @hw: pointer to the HW structure
+  *
+  *  Calls the PHY setup function to force speed and duplex.  Clears the
+@@ -945,7 +945,7 @@ s32 e1000_phy_force_speed_duplex_igp(struct e1000_hw *hw)
+  *  After reset, TX_CLK and CRS on TX must be set.  Return successful upon
+  *  successful completion, else return corresponding error code.
+  **/
+-s32 e1000_phy_force_speed_duplex_m88(struct e1000_hw *hw)
++s32 e1000e_phy_force_speed_duplex_m88(struct e1000_hw *hw)
+ {
+ 	struct e1000_phy_info *phy = &hw->phy;
+ 	s32 ret_val;
+@@ -970,7 +970,7 @@ s32 e1000_phy_force_speed_duplex_m88(struct e1000_hw *hw)
+ 	if (ret_val)
+ 		return ret_val;
+ 
+-	e1000_phy_force_speed_duplex_setup(hw, &phy_data);
++	e1000e_phy_force_speed_duplex_setup(hw, &phy_data);
+ 
+ 	/* Reset the phy to commit changes. */
+ 	phy_data |= MII_CR_RESET;
+@@ -984,7 +984,7 @@ s32 e1000_phy_force_speed_duplex_m88(struct e1000_hw *hw)
+ 	if (phy->wait_for_link) {
+ 		hw_dbg(hw, "Waiting for forced speed/duplex link on M88 phy.\n");
+ 
+-		ret_val = e1000_phy_has_link_generic(hw, PHY_FORCE_LIMIT,
++		ret_val = e1000e_phy_has_link_generic(hw, PHY_FORCE_LIMIT,
+ 						     100000, &link);
+ 		if (ret_val)
+ 			return ret_val;
+@@ -996,13 +996,13 @@ s32 e1000_phy_force_speed_duplex_m88(struct e1000_hw *hw)
+ 			ret_val = e1e_wphy(hw, M88E1000_PHY_PAGE_SELECT, 0x001d);
+ 			if (ret_val)
+ 				return ret_val;
+-			ret_val = e1000_phy_reset_dsp(hw);
++			ret_val = e1000e_phy_reset_dsp(hw);
+ 			if (ret_val)
+ 				return ret_val;
+ 		}
+ 
+ 		/* Try once more */
+-		ret_val = e1000_phy_has_link_generic(hw, PHY_FORCE_LIMIT,
++		ret_val = e1000e_phy_has_link_generic(hw, PHY_FORCE_LIMIT,
+ 						     100000, &link);
+ 		if (ret_val)
+ 			return ret_val;
+@@ -1035,7 +1035,7 @@ s32 e1000_phy_force_speed_duplex_m88(struct e1000_hw *hw)
+ }
+ 
+ /**
+- *  e1000_phy_force_speed_duplex_setup - Configure forced PHY speed/duplex
++ *  e1000e_phy_force_speed_duplex_setup - Configure forced PHY speed/duplex
+  *  @hw: pointer to the HW structure
+  *  @phy_ctrl: pointer to current value of PHY_CONTROL
+  *
+@@ -1046,7 +1046,7 @@ s32 e1000_phy_force_speed_duplex_m88(struct e1000_hw *hw)
+  *  caller must write to the PHY_CONTROL register for these settings to
+  *  take affect.
+  **/
+-void e1000_phy_force_speed_duplex_setup(struct e1000_hw *hw, u16 *phy_ctrl)
++void e1000e_phy_force_speed_duplex_setup(struct e1000_hw *hw, u16 *phy_ctrl)
+ {
+ 	struct e1000_mac_info *mac = &hw->mac;
+ 	u32 ctrl;
+@@ -1089,13 +1089,13 @@ void e1000_phy_force_speed_duplex_setup(struct e1000_hw *hw, u16 *phy_ctrl)
+ 		hw_dbg(hw, "Forcing 10mb\n");
+ 	}
+ 
+-	e1000_config_collision_dist(hw);
++	e1000e_config_collision_dist(hw);
+ 
+ 	ew32(CTRL, ctrl);
+ }
+ 
+ /**
+- *  e1000_set_d3_lplu_state - Sets low power link up state for D3
++ *  e1000e_set_d3_lplu_state - Sets low power link up state for D3
+  *  @hw: pointer to the HW structure
+  *  @active: boolean used to enable/disable lplu
+  *
+@@ -1108,7 +1108,7 @@ void e1000_phy_force_speed_duplex_setup(struct e1000_hw *hw, u16 *phy_ctrl)
+  *  During driver activity, SmartSpeed should be enabled so performance is
+  *  maintained.
+  **/
+-s32 e1000_set_d3_lplu_state(struct e1000_hw *hw, bool active)
++s32 e1000e_set_d3_lplu_state(struct e1000_hw *hw, bool active)
+ {
+ 	struct e1000_phy_info *phy = &hw->phy;
+ 	s32 ret_val;
+@@ -1173,14 +1173,14 @@ s32 e1000_set_d3_lplu_state(struct e1000_hw *hw, bool active)
+ }
+ 
+ /**
+- *  e1000_check_downshift - Checks whether a downshift in speed occured
++ *  e1000e_check_downshift - Checks whether a downshift in speed occured
+  *  @hw: pointer to the HW structure
+  *
+  *  Success returns 0, Failure returns 1
+  *
+  *  A downshift is detected by querying the PHY link health.
+  **/
+-s32 e1000_check_downshift(struct e1000_hw *hw)
++s32 e1000e_check_downshift(struct e1000_hw *hw)
+ {
+ 	struct e1000_phy_info *phy = &hw->phy;
+ 	s32 ret_val;
+@@ -1310,7 +1310,7 @@ static s32 e1000_wait_autoneg(struct e1000_hw *hw)
+ }
+ 
+ /**
+- *  e1000_phy_has_link_generic - Polls PHY for link
++ *  e1000e_phy_has_link_generic - Polls PHY for link
+  *  @hw: pointer to the HW structure
+  *  @iterations: number of times to poll for link
+  *  @usec_interval: delay between polling attempts
+@@ -1318,7 +1318,7 @@ static s32 e1000_wait_autoneg(struct e1000_hw *hw)
+  *
+  *  Polls the PHY status register for link, 'iterations' number of times.
+  **/
+-s32 e1000_phy_has_link_generic(struct e1000_hw *hw, u32 iterations,
++s32 e1000e_phy_has_link_generic(struct e1000_hw *hw, u32 iterations,
+ 			       u32 usec_interval, bool *success)
+ {
+ 	s32 ret_val;
+@@ -1349,7 +1349,7 @@ s32 e1000_phy_has_link_generic(struct e1000_hw *hw, u32 iterations,
+ }
+ 
+ /**
+- *  e1000_get_cable_length_m88 - Determine cable length for m88 PHY
++ *  e1000e_get_cable_length_m88 - Determine cable length for m88 PHY
+  *  @hw: pointer to the HW structure
+  *
+  *  Reads the PHY specific status register to retrieve the cable length
+@@ -1363,7 +1363,7 @@ s32 e1000_phy_has_link_generic(struct e1000_hw *hw, u32 iterations,
+  *	3			110 - 140 meters
+  *	4			> 140 meters
+  **/
+-s32 e1000_get_cable_length_m88(struct e1000_hw *hw)
++s32 e1000e_get_cable_length_m88(struct e1000_hw *hw)
+ {
+ 	struct e1000_phy_info *phy = &hw->phy;
+ 	s32 ret_val;
+@@ -1384,7 +1384,7 @@ s32 e1000_get_cable_length_m88(struct e1000_hw *hw)
+ }
+ 
+ /**
+- *  e1000_get_cable_length_igp_2 - Determine cable length for igp2 PHY
++ *  e1000e_get_cable_length_igp_2 - Determine cable length for igp2 PHY
+  *  @hw: pointer to the HW structure
+  *
+  *  The automatic gain control (agc) normalizes the amplitude of the
+@@ -1394,7 +1394,7 @@ s32 e1000_get_cable_length_m88(struct e1000_hw *hw)
+  *  into a lookup table to obtain the approximate cable length
+  *  for each channel.
+  **/
+-s32 e1000_get_cable_length_igp_2(struct e1000_hw *hw)
++s32 e1000e_get_cable_length_igp_2(struct e1000_hw *hw)
+ {
+ 	struct e1000_phy_info *phy = &hw->phy;
+ 	s32 ret_val;
+@@ -1451,7 +1451,7 @@ s32 e1000_get_cable_length_igp_2(struct e1000_hw *hw)
+ }
+ 
+ /**
+- *  e1000_get_phy_info_m88 - Retrieve PHY information
++ *  e1000e_get_phy_info_m88 - Retrieve PHY information
+  *  @hw: pointer to the HW structure
+  *
+  *  Valid for only copper links.  Read the PHY status register (sticky read)
+@@ -1460,7 +1460,7 @@ s32 e1000_get_cable_length_igp_2(struct e1000_hw *hw)
+  *  special status register to determine MDI/MDIx and current speed.  If
+  *  speed is 1000, then determine cable length, local and remote receiver.
+  **/
+-s32 e1000_get_phy_info_m88(struct e1000_hw *hw)
++s32 e1000e_get_phy_info_m88(struct e1000_hw *hw)
+ {
+ 	struct e1000_phy_info *phy = &hw->phy;
+ 	s32  ret_val;
+@@ -1472,7 +1472,7 @@ s32 e1000_get_phy_info_m88(struct e1000_hw *hw)
+ 		return -E1000_ERR_CONFIG;
+ 	}
+ 
+-	ret_val = e1000_phy_has_link_generic(hw, 1, 0, &link);
++	ret_val = e1000e_phy_has_link_generic(hw, 1, 0, &link);
+ 	if (ret_val)
+ 		return ret_val;
+ 
+@@ -1525,7 +1525,7 @@ s32 e1000_get_phy_info_m88(struct e1000_hw *hw)
+ }
+ 
+ /**
+- *  e1000_get_phy_info_igp - Retrieve igp PHY information
++ *  e1000e_get_phy_info_igp - Retrieve igp PHY information
+  *  @hw: pointer to the HW structure
+  *
+  *  Read PHY status to determine if link is up.  If link is up, then
+@@ -1533,14 +1533,14 @@ s32 e1000_get_phy_info_m88(struct e1000_hw *hw)
+  *  PHY port status to determine MDI/MDIx and speed.  Based on the speed,
+  *  determine on the cable length, local and remote receiver.
+  **/
+-s32 e1000_get_phy_info_igp(struct e1000_hw *hw)
++s32 e1000e_get_phy_info_igp(struct e1000_hw *hw)
+ {
+ 	struct e1000_phy_info *phy = &hw->phy;
+ 	s32 ret_val;
+ 	u16 data;
+ 	bool link;
+ 
+-	ret_val = e1000_phy_has_link_generic(hw, 1, 0, &link);
++	ret_val = e1000e_phy_has_link_generic(hw, 1, 0, &link);
+ 	if (ret_val)
+ 		return ret_val;
+ 
+@@ -1588,13 +1588,13 @@ s32 e1000_get_phy_info_igp(struct e1000_hw *hw)
+ }
+ 
+ /**
+- *  e1000_phy_sw_reset - PHY software reset
++ *  e1000e_phy_sw_reset - PHY software reset
+  *  @hw: pointer to the HW structure
+  *
+  *  Does a software reset of the PHY by reading the PHY control register and
+  *  setting/write the control register reset bit to the PHY.
+  **/
+-s32 e1000_phy_sw_reset(struct e1000_hw *hw)
++s32 e1000e_phy_sw_reset(struct e1000_hw *hw)
+ {
+ 	s32 ret_val;
+ 	u16 phy_ctrl;
+@@ -1614,7 +1614,7 @@ s32 e1000_phy_sw_reset(struct e1000_hw *hw)
+ }
+ 
+ /**
+- *  e1000_phy_hw_reset_generic - PHY hardware reset
++ *  e1000e_phy_hw_reset_generic - PHY hardware reset
+  *  @hw: pointer to the HW structure
+  *
+  *  Verify the reset block is not blocking us from resetting.  Acquire
+@@ -1622,7 +1622,7 @@ s32 e1000_phy_sw_reset(struct e1000_hw *hw)
+  *  bit in the PHY.  Wait the appropriate delay time for the device to
+  *  reset and relase the semaphore (if necessary).
+  **/
+-s32 e1000_phy_hw_reset_generic(struct e1000_hw *hw)
++s32 e1000e_phy_hw_reset_generic(struct e1000_hw *hw)
+ {
+ 	struct e1000_phy_info *phy = &hw->phy;
+ 	s32 ret_val;
+@@ -1653,13 +1653,13 @@ s32 e1000_phy_hw_reset_generic(struct e1000_hw *hw)
+ }
+ 
+ /**
+- *  e1000_get_cfg_done - Generic configuration done
++ *  e1000e_get_cfg_done - Generic configuration done
+  *  @hw: pointer to the HW structure
+  *
+  *  Generic function to wait 10 milli-seconds for configuration to complete
+  *  and return success.
+  **/
+-s32 e1000_get_cfg_done(struct e1000_hw *hw)
++s32 e1000e_get_cfg_done(struct e1000_hw *hw)
+ {
+ 	mdelay(10);
+ 	return 0;
+@@ -1698,12 +1698,12 @@ static s32 e1000_phy_force_speed_duplex(struct e1000_hw *hw)
+ }
+ 
+ /**
+- *  e1000_get_phy_type_from_id - Get PHY type from id
++ *  e1000e_get_phy_type_from_id - Get PHY type from id
+  *  @phy_id: phy_id read from the phy
+  *
+  *  Returns the phy type from the id.
+  **/
+-enum e1000_phy_type e1000_get_phy_type_from_id(u32 phy_id)
++enum e1000_phy_type e1000e_get_phy_type_from_id(u32 phy_id)
+ {
+ 	enum e1000_phy_type phy_type = e1000_phy_unknown;
+ 
+@@ -1736,13 +1736,13 @@ enum e1000_phy_type e1000_get_phy_type_from_id(u32 phy_id)
+ }
+ 
+ /**
+- *  e1000_commit_phy - Soft PHY reset
++ *  e1000e_commit_phy - Soft PHY reset
+  *  @hw: pointer to the HW structure
+  *
+  *  Performs a soft PHY reset on those that apply. This is a function pointer
+  *  entry point called by drivers.
+  **/
+-s32 e1000_commit_phy(struct e1000_hw *hw)
++s32 e1000e_commit_phy(struct e1000_hw *hw)
+ {
+ 	if (hw->phy.ops.commit_phy)
+ 		return hw->phy.ops.commit_phy(hw);
+-
+To unsubscribe from this list: send the line "unsubscribe netdev" in
+the body of a message to majordomo at vger.kernel.org
+More majordomo info at  http://vger.kernel.org/majordomo-info.html
+
+Return-Path: <netdev-owner at vger.kernel.org>
+From: Auke Kok <auke-jan.h.kok at intel.com>
+Subject: [PATCH 3/6] e1000e: Use dma_alloc_coherent where possible
+To: jeff at garzik.org
+Cc: netdev at vger.kernel.org, akpm at linux-foundation.org,
+	andi at firstfloor.org
+Date:	Fri, 10 Aug 2007 13:00:52 -0700
+Message-ID: <20070810200052.21509.19321.stgit at localhost.localdomain>
+In-Reply-To: <20070810200038.21509.77815.stgit at localhost.localdomain>
+References: <20070810200038.21509.77815.stgit at localhost.localdomain>
+User-Agent: StGIT/0.12.1
+
+Instead of using pci_alloc_consistent at GFP_ATOMIC we can be
+more reliable at startup and use dma_alloc_coherent instead with
+GFP_KERNEL.
+
+Signed-off-by: Auke Kok <auke-jan.h.kok at intel.com>
+---
+
+ drivers/net/e1000e/ethtool.c |   16 ++++++++--------
+ drivers/net/e1000e/netdev.c  |    9 ++++++---
+ 2 files changed, 14 insertions(+), 11 deletions(-)
+
+diff --git a/drivers/net/e1000e/ethtool.c b/drivers/net/e1000e/ethtool.c
+index c9d74a8..d184116 100644
+--- a/drivers/net/e1000e/ethtool.c
++++ b/drivers/net/e1000e/ethtool.c
+@@ -962,13 +962,13 @@ static void e1000_free_desc_rings(struct e1000_adapter *adapter)
+ 	}
+ 
+ 	if (tx_ring->desc) {
+-		pci_free_consistent(pdev, tx_ring->size, tx_ring->desc,
+-				    tx_ring->dma);
++		dma_free_coherent(&pdev->dev, tx_ring->size, tx_ring->desc,
++				  tx_ring->dma);
+ 		tx_ring->desc = NULL;
+ 	}
+ 	if (rx_ring->desc) {
+-		pci_free_consistent(pdev, rx_ring->size, rx_ring->desc,
+-				    rx_ring->dma);
++		dma_free_coherent(&pdev->dev, rx_ring->size, rx_ring->desc,
++				  rx_ring->dma);
+ 		rx_ring->desc = NULL;
+ 	}
+ 
+@@ -1004,8 +1004,8 @@ static int e1000_setup_desc_rings(struct e1000_adapter *adapter)
+ 
+ 	tx_ring->size = tx_ring->count * sizeof(struct e1000_tx_desc);
+ 	tx_ring->size = ALIGN(tx_ring->size, 4096);
+-	tx_ring->desc = pci_alloc_consistent(pdev, tx_ring->size,
+-			&tx_ring->dma);
++	tx_ring->desc = dma_alloc_coherent(&pdev->dev, tx_ring->size,
++					   &tx_ring->dma, GFP_KERNEL);
+ 	if (!tx_ring->desc) {
+ 		ret_val = 2;
+ 		goto err_nomem;
+@@ -1065,8 +1065,8 @@ static int e1000_setup_desc_rings(struct e1000_adapter *adapter)
+ 	memset(rx_ring->buffer_info, 0, size);
+ 
+ 	rx_ring->size = rx_ring->count * sizeof(struct e1000_rx_desc);
+-	rx_ring->desc = pci_alloc_consistent(pdev, rx_ring->size,
+-					     &rx_ring->dma);
++	rx_ring->desc = dma_alloc_coherent(&pdev->dev, rx_ring->size,
++					   &rx_ring->dma, GFP_KERNEL);
+ 	if (!rx_ring->desc) {
+ 		ret_val = 5;
+ 		goto err_nomem;
+diff --git a/drivers/net/e1000e/netdev.c b/drivers/net/e1000e/netdev.c
+index d711e14..51c9024 100644
+--- a/drivers/net/e1000e/netdev.c
++++ b/drivers/net/e1000e/netdev.c
+@@ -1344,7 +1344,8 @@ static int e1000_alloc_ring_dma(struct e1000_adapter *adapter,
+ {
+ 	struct pci_dev *pdev = adapter->pdev;
+ 
+-	ring->desc = pci_alloc_consistent(pdev, ring->size, &ring->dma);
++	ring->desc = dma_alloc_coherent(&pdev->dev, ring->size, &ring->dma,
++					GFP_KERNEL);
+ 	if (!ring->desc)
+ 		return -ENOMEM;
+ 
+@@ -1479,7 +1480,8 @@ void e1000e_free_tx_resources(struct e1000_adapter *adapter)
+ 	vfree(tx_ring->buffer_info);
+ 	tx_ring->buffer_info = NULL;
+ 
+-	pci_free_consistent(pdev, tx_ring->size, tx_ring->desc, tx_ring->dma);
++	dma_free_coherent(&pdev->dev, tx_ring->size, tx_ring->desc,
++			  tx_ring->dma);
+ 	tx_ring->desc = NULL;
+ }
+ 
+@@ -1503,7 +1505,8 @@ void e1000e_free_rx_resources(struct e1000_adapter *adapter)
+ 	kfree(rx_ring->ps_pages);
+ 	rx_ring->ps_pages = NULL;
+ 
+-	pci_free_consistent(pdev, rx_ring->size, rx_ring->desc, rx_ring->dma);
++	dma_free_coherent(&pdev->dev, rx_ring->size, rx_ring->desc,
++			  rx_ring->dma);
+ 	rx_ring->desc = NULL;
+ }
+ 
+-
+To unsubscribe from this list: send the line "unsubscribe netdev" in
+the body of a message to majordomo at vger.kernel.org
+More majordomo info at  http://vger.kernel.org/majordomo-info.html
+
+Return-Path: <netdev-owner at vger.kernel.org>
+From: Auke Kok <auke-jan.h.kok at intel.com>
+Subject: [PATCH 4/6] e1000e: Use time_after to account for jiffies wrapping
+To: jeff at garzik.org
+Cc: netdev at vger.kernel.org, akpm at linux-foundation.org,
+	andi at firstfloor.org
+Date:	Fri, 10 Aug 2007 13:00:57 -0700
+Message-ID: <20070810200057.21509.18676.stgit at localhost.localdomain>
+In-Reply-To: <20070810200038.21509.77815.stgit at localhost.localdomain>
+References: <20070810200038.21509.77815.stgit at localhost.localdomain>
+User-Agent: StGIT/0.12.1
+
+Signed-off-by: Auke Kok <auke-jan.h.kok at intel.com>
+---
+
+ drivers/net/e1000e/ethtool.c |    2 +-
+ 1 files changed, 1 insertions(+), 1 deletions(-)
+
+diff --git a/drivers/net/e1000e/ethtool.c b/drivers/net/e1000e/ethtool.c
+index d184116..d14cc4b 100644
+--- a/drivers/net/e1000e/ethtool.c
++++ b/drivers/net/e1000e/ethtool.c
+@@ -1411,7 +1411,7 @@ static int e1000_run_loopback_test(struct e1000_adapter *adapter)
+ 			 * enough time to complete the receives, if it's
+ 			 * exceeded, break and error off
+ 			 */
+-		} while (good_cnt < 64 && jiffies < (time + 20));
++		} while ((good_cnt < 64) && !time_after(jiffies, time + 20));
+ 		if (good_cnt != 64) {
+ 			ret_val = 13; /* ret_val is the same as mis-compare */
+ 			break;
+-
+To unsubscribe from this list: send the line "unsubscribe netdev" in
+the body of a message to majordomo at vger.kernel.org
+More majordomo info at  http://vger.kernel.org/majordomo-info.html
+
+Return-Path: <netdev-owner at vger.kernel.org>
+From: Auke Kok <auke-jan.h.kok at intel.com>
+Subject: [PATCH 5/6] e1000e: error handling for pci_map_single calls.
+To: jeff at garzik.org
+Cc: netdev at vger.kernel.org, akpm at linux-foundation.org,
+	andi at firstfloor.org
+Date:	Fri, 10 Aug 2007 13:01:02 -0700
+Message-ID: <20070810200102.21509.97953.stgit at localhost.localdomain>
+In-Reply-To: <20070810200038.21509.77815.stgit at localhost.localdomain>
+References: <20070810200038.21509.77815.stgit at localhost.localdomain>
+User-Agent: StGIT/0.12.1
+
+Add proper error handling for various callers of pci_map_single.
+
+Signed-off-by: Auke Kok <auke-jan.h.kok at intel.com>
+---
+
+ drivers/net/e1000e/e1000.h   |    2 ++
+ drivers/net/e1000e/ethtool.c |   16 +++++++++++---
+ drivers/net/e1000e/netdev.c  |   49 +++++++++++++++++++++++++++++++++++++++---
+ 3 files changed, 61 insertions(+), 6 deletions(-)
+
+diff --git a/drivers/net/e1000e/e1000.h b/drivers/net/e1000e/e1000.h
+index 3475e48..e3cd877 100644
+--- a/drivers/net/e1000e/e1000.h
++++ b/drivers/net/e1000e/e1000.h
+@@ -220,6 +220,7 @@ struct e1000_adapter {
+ 	u32 tx_fifo_head;
+ 	u32 tx_head_addr;
+ 	u32 tx_fifo_size;
++	u32 tx_dma_failed;
+ 
+ 	/*
+ 	 * RX
+@@ -241,6 +242,7 @@ struct e1000_adapter {
+ 	u64 gorcl_old;
+ 	u32 gorcl;
+ 	u32 alloc_rx_buff_failed;
++	u32 rx_dma_failed;
+ 
+ 	unsigned int rx_ps_pages;
+ 	u16 rx_ps_bsize0;
+diff --git a/drivers/net/e1000e/ethtool.c b/drivers/net/e1000e/ethtool.c
+index d14cc4b..0e80406 100644
+--- a/drivers/net/e1000e/ethtool.c
++++ b/drivers/net/e1000e/ethtool.c
+@@ -91,6 +91,8 @@ static const struct e1000_stats e1000_gstrings_stats[] = {
+ 	{ "tx_smbus", E1000_STAT(stats.mgptc) },
+ 	{ "rx_smbus", E1000_STAT(stats.mgprc) },
+ 	{ "dropped_smbus", E1000_STAT(stats.mgpdc) },
++	{ "rx_dma_failed", E1000_STAT(rx_dma_failed) },
++	{ "tx_dma_failed", E1000_STAT(tx_dma_failed) },
+ };
+ 
+ #define E1000_GLOBAL_STATS_LEN	\
+@@ -1042,6 +1044,10 @@ static int e1000_setup_desc_rings(struct e1000_adapter *adapter)
+ 		tx_ring->buffer_info[i].dma =
+ 			pci_map_single(pdev, skb->data, skb->len,
+ 				       PCI_DMA_TODEVICE);
++		if (pci_dma_mapping_error(tx_ring->buffer_info[i].dma)) {
++			ret_val = 4;
++			goto err_nomem;
++		}
+ 		tx_desc->buffer_addr = cpu_to_le64(
+ 					 tx_ring->buffer_info[i].dma);
+ 		tx_desc->lower.data = cpu_to_le32(skb->len);
+@@ -1059,7 +1065,7 @@ static int e1000_setup_desc_rings(struct e1000_adapter *adapter)
+ 	size = rx_ring->count * sizeof(struct e1000_buffer);
+ 	rx_ring->buffer_info = kmalloc(size, GFP_KERNEL);
+ 	if (!rx_ring->buffer_info) {
+-		ret_val = 4;
++		ret_val = 5;
+ 		goto err_nomem;
+ 	}
+ 	memset(rx_ring->buffer_info, 0, size);
+@@ -1068,7 +1074,7 @@ static int e1000_setup_desc_rings(struct e1000_adapter *adapter)
+ 	rx_ring->desc = dma_alloc_coherent(&pdev->dev, rx_ring->size,
+ 					   &rx_ring->dma, GFP_KERNEL);
+ 	if (!rx_ring->desc) {
+-		ret_val = 5;
++		ret_val = 6;
+ 		goto err_nomem;
+ 	}
+ 	memset(rx_ring->desc, 0, rx_ring->size);
+@@ -1093,7 +1099,7 @@ static int e1000_setup_desc_rings(struct e1000_adapter *adapter)
+ 
+ 		skb = alloc_skb(2048 + NET_IP_ALIGN, GFP_KERNEL);
+ 		if (!skb) {
+-			ret_val = 6;
++			ret_val = 7;
+ 			goto err_nomem;
+ 		}
+ 		skb_reserve(skb, NET_IP_ALIGN);
+@@ -1101,6 +1107,10 @@ static int e1000_setup_desc_rings(struct e1000_adapter *adapter)
+ 		rx_ring->buffer_info[i].dma =
+ 			pci_map_single(pdev, skb->data, 2048,
+ 				       PCI_DMA_FROMDEVICE);
++		if (pci_dma_mapping_error(rx_ring->buffer_info[i].dma)) {
++			ret_val = 8;
++			goto err_nomem;
++		}
+ 		rx_desc->buffer_addr =
+ 			cpu_to_le64(rx_ring->buffer_info[i].dma);
+ 		memset(skb->data, 0x00, skb->len);
+diff --git a/drivers/net/e1000e/netdev.c b/drivers/net/e1000e/netdev.c
+index 51c9024..8ebe238 100644
+--- a/drivers/net/e1000e/netdev.c
++++ b/drivers/net/e1000e/netdev.c
+@@ -195,6 +195,11 @@ map_skb:
+ 		buffer_info->dma = pci_map_single(pdev, skb->data,
+ 						  adapter->rx_buffer_len,
+ 						  PCI_DMA_FROMDEVICE);
++		if (pci_dma_mapping_error(buffer_info->dma)) {
++			dev_err(&pdev->dev, "RX DMA map failed\n");
++			adapter->rx_dma_failed++;
++			break;
++		}
+ 
+ 		rx_desc = E1000_RX_DESC(*rx_ring, i);
+ 		rx_desc->buffer_addr = cpu_to_le64(buffer_info->dma);
+@@ -255,6 +260,13 @@ static void e1000_alloc_rx_buffers_ps(struct e1000_adapter *adapter,
+ 							   ps_page->page,
+ 							   0, PAGE_SIZE,
+ 							   PCI_DMA_FROMDEVICE);
++					if (pci_dma_mapping_error(
++							ps_page->dma)) {
++						dev_err(&adapter->pdev->dev,
++						  "RX DMA page map failed\n");
++						adapter->rx_dma_failed++;
++						goto no_buffers;
++					}
+ 				}
+ 				/*
+ 				 * Refresh the desc even if buffer_addrs
+@@ -286,6 +298,14 @@ static void e1000_alloc_rx_buffers_ps(struct e1000_adapter *adapter,
+ 		buffer_info->dma = pci_map_single(pdev, skb->data,
+ 						  adapter->rx_ps_bsize0,
+ 						  PCI_DMA_FROMDEVICE);
++		if (pci_dma_mapping_error(buffer_info->dma)) {
++			dev_err(&pdev->dev, "RX DMA map failed\n");
++			adapter->rx_dma_failed++;
++			/* cleanup skb */
++			dev_kfree_skb_any(skb);
++			buffer_info->skb = NULL;
++			break;
++		}
+ 
+ 		rx_desc->read.buffer_addr[0] = cpu_to_le64(buffer_info->dma);
+ 
+@@ -374,6 +394,11 @@ check_page:
+ 							buffer_info->page, 0,
+ 							PAGE_SIZE,
+ 							PCI_DMA_FROMDEVICE);
++		if (pci_dma_mapping_error(buffer_info->dma)) {
++			dev_err(&adapter->pdev->dev, "RX DMA page map failed\n");
++			adapter->rx_dma_failed++;
++			break;
++		}
+ 
+ 		rx_desc = E1000_RX_DESC(*rx_ring, i);
+ 		rx_desc->buffer_addr = cpu_to_le64(buffer_info->dma);
+@@ -3214,6 +3239,11 @@ static int e1000_tx_map(struct e1000_adapter *adapter,
+ 				skb->data + offset,
+ 				size,
+ 				PCI_DMA_TODEVICE);
++		if (pci_dma_mapping_error(buffer_info->dma)) {
++			dev_err(&adapter->pdev->dev, "TX DMA map failed\n");
++			adapter->tx_dma_failed++;
++			return -1;
++		}
+ 		buffer_info->next_to_watch = i;
+ 
+ 		len -= size;
+@@ -3247,6 +3277,13 @@ static int e1000_tx_map(struct e1000_adapter *adapter,
+ 					offset,
+ 					size,
+ 					PCI_DMA_TODEVICE);
++			if (pci_dma_mapping_error(buffer_info->dma)) {
++				dev_err(&adapter->pdev->dev,
++					"TX DMA page map failed\n");
++				adapter->tx_dma_failed++;
++				return -1;
++			}
++
+ 			buffer_info->next_to_watch = i;
+ 
+ 			len -= size;
+@@ -3512,9 +3549,15 @@ static int e1000_xmit_frame(struct sk_buff *skb, struct net_device *netdev)
+ 	if (skb->protocol == htons(ETH_P_IP))
+ 		tx_flags |= E1000_TX_FLAGS_IPV4;
+ 
+-	e1000_tx_queue(adapter, tx_flags,
+-		       e1000_tx_map(adapter, skb, first,
+-				    max_per_txd, nr_frags, mss));
++	count = e1000_tx_map(adapter, skb, first, max_per_txd, nr_frags, mss);
++	if (count < 0) {
++		/* handle pci_map_single() error in e1000_tx_map */
++		dev_kfree_skb_any(skb);
++		spin_unlock_irqrestore(&adapter->tx_queue_lock, irq_flags);
++		return NETDEV_TX_BUSY;
++	}
++
++	e1000_tx_queue(adapter, tx_flags, count);
+ 
+ 	netdev->trans_start = jiffies;
+ 
+-
+To unsubscribe from this list: send the line "unsubscribe netdev" in
+the body of a message to majordomo at vger.kernel.org
+More majordomo info at  http://vger.kernel.org/majordomo-info.html
+
+Return-Path: <netdev-owner at vger.kernel.org>
+From: Auke Kok <auke-jan.h.kok at intel.com>
+Subject: [PATCH 6/6] e1000e: Remove two compile warnings
+To: jeff at garzik.org
+Cc: netdev at vger.kernel.org, akpm at linux-foundation.org,
+	andi at firstfloor.org
+Date:	Fri, 10 Aug 2007 13:01:07 -0700
+Message-ID: <20070810200107.21509.74125.stgit at localhost.localdomain>
+In-Reply-To: <20070810200038.21509.77815.stgit at localhost.localdomain>
+References: <20070810200038.21509.77815.stgit at localhost.localdomain>
+User-Agent: StGIT/0.12.1
+MIME-Version: 1.0
+
+CC [M]  drivers/net/e1000e/lib.o
+drivers/net/e1000e/lib.c: In function 'e1000e_read_nvm_eerd':
+drivers/net/e1000e/lib.c:1941: warning: 'ret_val' may be used uninitialized
+in this function
+  CC [M]  drivers/net/e1000e/phy.o
+drivers/net/e1000e/phy.c: In function 'e1000e_phy_has_link_generic':
+drivers/net/e1000e/phy.c:1324: warning: 'ret_val' may be used
+uninitialized in this function
+
+Signed-off-by: Auke Kok <auke-jan.h.kok at intel.com>
+---
+
+ drivers/net/e1000e/lib.c |    2 +-
+ drivers/net/e1000e/phy.c |    2 +-
+ 2 files changed, 2 insertions(+), 2 deletions(-)
+
+diff --git a/drivers/net/e1000e/lib.c b/drivers/net/e1000e/lib.c
+index a04c1e4..6645c21 100644
+--- a/drivers/net/e1000e/lib.c
++++ b/drivers/net/e1000e/lib.c
+@@ -1938,7 +1938,7 @@ s32 e1000e_read_nvm_eerd(struct e1000_hw *hw, u16 offset, u16 words, u16 *data)
+ {
+ 	struct e1000_nvm_info *nvm = &hw->nvm;
+ 	u32 i, eerd = 0;
+-	s32 ret_val;
++	s32 ret_val = 0;
+ 
+ 	/* A check for invalid values:  offset too large, too many words,
+ 	 * and not enough words. */
+diff --git a/drivers/net/e1000e/phy.c b/drivers/net/e1000e/phy.c
+index 1efb47a..7932318 100644
+--- a/drivers/net/e1000e/phy.c
++++ b/drivers/net/e1000e/phy.c
+@@ -1321,7 +1321,7 @@ static s32 e1000_wait_autoneg(struct e1000_hw *hw)
+ s32 e1000e_phy_has_link_generic(struct e1000_hw *hw, u32 iterations,
+ 			       u32 usec_interval, bool *success)
+ {
+-	s32 ret_val;
++	s32 ret_val = 0;
+ 	u16 i, phy_status;
+ 
+ 	for (i = 0; i < iterations; i++) {
+-
+To unsubscribe from this list: send the line "unsubscribe netdev" in
+the body of a message to majordomo at vger.kernel.org
+More majordomo info at  http://vger.kernel.org/majordomo-info.html
+

Added: dists/sid/linux-2.6/debian/patches/features/all/fs-asfs.patch
==============================================================================
--- (empty file)
+++ dists/sid/linux-2.6/debian/patches/features/all/fs-asfs.patch	Mon Nov 26 20:06:56 2007
@@ -0,0 +1,5271 @@
+## 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.0beta11
+## DP: Patch author: Marek Szyprowski <marek at amiga.pl>
+## DP: Upstream status: submitted but no reply. Submitted again on 2005.03.22.
+## DP: Reference: http://home.elka.pw.edu.pl/~mszyprow/programy/asfs/
+
+diff -Nur linux-2.6.19-rc6/Documentation/filesystems/00-INDEX linux-2.6.19-rc6/Documentation/filesystems/00-INDEX
+--- linux-2.6.19-rc6/Documentation/filesystems/00-INDEX	2006-11-16 05:03:40.000000000 +0100
++++ linux-2.6.19-rc6/Documentation/filesystems/00-INDEX	2006-11-24 18:19:03.000000000 +0100
+@@ -10,6 +10,8 @@
+ 	- info and examples for the distributed AFS (Andrew File System) fs.
+ affs.txt
+ 	- info and mount options for the Amiga Fast File System.
++asfs.txt
++	- info and mount options for the Amiga Smart File System.
+ automount-support.txt
+ 	- information about filesystem automount support.
+ befs.txt
+diff -Nur linux-2.6.19-rc6/Documentation/filesystems/asfs.txt linux-2.6.19-rc6/Documentation/filesystems/asfs.txt
+--- linux-2.6.19-rc6/Documentation/filesystems/asfs.txt	1970-01-01 01:00:00.000000000 +0100
++++ linux-2.6.19-rc6/Documentation/filesystems/asfs.txt	2006-11-24 18:19:03.000000000 +0100
+@@ -0,0 +1,161 @@
++
++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.)
++
++iocharset=name
++		Character set to use for converting file names. Specifies 
++		character set used by your Linux system. 
++codepage=name
++		Set the codepage number for converting file names. Specifies
++		character set used by your Amiga. Use full name (for example
++		'cp1251' instead of '1251') here, this allows to specify any
++		character set, not only numbered one (like 'iso8859-2').
++		Use special name 'none' to disable the NLS file name 
++		translation.
++
++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,2005  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 -Nur linux-2.6.19-rc6/fs/Kconfig linux-2.6.19-rc6/fs/Kconfig
+--- linux-2.6.19-rc6/fs/Kconfig	2006-11-16 05:03:40.000000000 +0100
++++ linux-2.6.19-rc6/fs/Kconfig	2006-11-24 18:19:03.000000000 +0100
+@@ -1111,6 +1111,53 @@
+ 	  To compile this file system support as a module, choose M here: the
+ 	  module will be called ecryptfs.
+ 
++config ASFS_FS
++	tristate "Amiga SFS file system support (EXPERIMENTAL)"
++	select NLS
++	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_DEFAULT_CODEPAGE
++	string "Default codepage for SFS"
++	depends on ASFS_FS
++	default ""
++	help
++	  This option should be set to the codepage of your SFS filesystems.
++	  It can be overridden with the 'codepage' mount option. Leave it blank 
++	  or enter 'none' to disable filename converting.
++
++	  Use full codepage name (for example 'cp1251' instead of '1251') here, 
++	  this allows to specify any character set, not only numbered one (like 
++	  'iso8859-2').
++
++	  If unsure, leave it blank.
++
++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 BLOCK && EXPERIMENTAL
+diff -Nur linux-2.6.19-rc6/fs/Makefile linux-2.6.19-rc6/fs/Makefile
+--- linux-2.6.19-rc6/fs/Makefile	2006-11-16 05:03:40.000000000 +0100
++++ linux-2.6.19-rc6/fs/Makefile	2006-11-24 18:19:03.000000000 +0100
+@@ -96,6 +96,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 -Nur linux-2.6.19-rc6/fs/asfs/Changes linux-2.6.19-rc6/fs/asfs/Changes
+--- linux-2.6.19-rc6/fs/asfs/Changes	1970-01-01 01:00:00.000000000 +0100
++++ linux-2.6.19-rc6/fs/asfs/Changes	2006-11-24 18:19:03.000000000 +0100
+@@ -0,0 +1,116 @@
++
++Amiga Smart File System, Linux implementation
++
++Please direct bug reports to: marek at amiga.pl
++
++History:
++
++v1.0beta11 (22.09.2006)
++- adapted to 2.6.18 kernel VFS changes
++- made some functions static to reduce overhead in kernel namespace
++
++v1.0beta10 (13.06.2005)
++- fixed ugly bug introduced in beta9 that caused kernel crash on x86
++  (thanks to Emiliano for reporting it!)
++
++v1.0beta9 (17.03.2005)
++- added NLS support (thanks to Pavel Fedin!)
++
++v1.0beta8 (07.01.2005)
++- adapted to 2.6.10 kernel VFS changes
++- added workaround for buggy Mandrake kernel headers
++
++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 -Nur linux-2.6.19-rc6/fs/asfs/Makefile linux-2.6.19-rc6/fs/asfs/Makefile
+--- linux-2.6.19-rc6/fs/asfs/Makefile	1970-01-01 01:00:00.000000000 +0100
++++ linux-2.6.19-rc6/fs/asfs/Makefile	2006-11-24 18:19:03.000000000 +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 -Nur linux-2.6.19-rc6/fs/asfs/adminspace.c linux-2.6.19-rc6/fs/asfs/adminspace.c
+--- linux-2.6.19-rc6/fs/asfs/adminspace.c	1970-01-01 01:00:00.000000000 +0100
++++ linux-2.6.19-rc6/fs/asfs/adminspace.c	2006-11-24 18:19:03.000000000 +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 -Nur linux-2.6.19-rc6/fs/asfs/asfs_fs.h linux-2.6.19-rc6/fs/asfs/asfs_fs.h
+--- linux-2.6.19-rc6/fs/asfs/asfs_fs.h	1970-01-01 01:00:00.000000000 +0100
++++ linux-2.6.19-rc6/fs/asfs/asfs_fs.h	2006-11-24 18:19:03.000000000 +0100
+@@ -0,0 +1,217 @@
++#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_MAXFN_BUF (ASFS_MAXFN + 4)
++#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. */
++	char *iocharset;
++	char *codepage;
++	struct nls_table *nls_io;
++	struct nls_table *nls_disk;
++};
++
++/* 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);
++
++/* namei */
++u8 asfs_lowerchar(u8 c);
++int asfs_check_name(const u8 *name, int len);
++int asfs_namecmp(u8 *s, u8 *ct, int casesensitive, struct nls_table *t);
++u16 asfs_hash(u8 *name, int casesensitive);
++void asfs_translate(u8 *to, u8 *from, struct nls_table *nls_to, struct nls_table *nls_from, int limit);
++
++/* 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);
++
++/* symlink.c */
++int asfs_symlink_readpage(struct file *file, struct page *page);
++int asfs_write_symlink(struct inode *symfile, const char *symname);
++
++#endif
+diff -Nur linux-2.6.19-rc6/fs/asfs/bitfuncs.c linux-2.6.19-rc6/fs/asfs/bitfuncs.c
+--- linux-2.6.19-rc6/fs/asfs/bitfuncs.c	1970-01-01 01:00:00.000000000 +0100
++++ linux-2.6.19-rc6/fs/asfs/bitfuncs.c	2006-11-24 18:19:03.000000000 +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 -Nur linux-2.6.19-rc6/fs/asfs/bitfuncs.h linux-2.6.19-rc6/fs/asfs/bitfuncs.h
+--- linux-2.6.19-rc6/fs/asfs/bitfuncs.h	1970-01-01 01:00:00.000000000 +0100
++++ linux-2.6.19-rc6/fs/asfs/bitfuncs.h	2006-11-24 18:19:03.000000000 +0100
+@@ -0,0 +1,59 @@
++/*
++ *
++ * 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>
++#include <linux/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 -Nur linux-2.6.19-rc6/fs/asfs/dir.c linux-2.6.19-rc6/fs/asfs/dir.c
+--- linux-2.6.19-rc6/fs/asfs/dir.c	1970-01-01 01:00:00.000000000 +0100
++++ linux-2.6.19-rc6/fs/asfs/dir.c	2006-11-24 18:19:03.000000000 +0100
+@@ -0,0 +1,240 @@
++/*
++ *
++ * 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;
++	struct nls_table *nls_io = ASFS_SB(sb)->nls_io;
++	struct nls_table *nls_disk = ASFS_SB(sb)->nls_disk;
++	u8 buf[512];
++	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_translate(buf, obj->name, nls_io, nls_disk, 512);
++				asfs_debug("ASFS: DirFilling: entry #%d \"%s\" (node %u offset %u), type %x\n", \
++				           stored, buf, 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, buf, strlen(buf), 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;
++}
++
++static struct fsObject *asfs_find_obj_by_name_nls(struct super_block *sb, struct fsObjectContainer *objcont, u8 * name)
++{
++	struct fsObject *obj;
++	u8 buf[512];
++
++	obj = &(objcont->object[0]);
++	while (be32_to_cpu(obj->objectnode) > 0 && ((char *) obj - (char *) objcont) + sizeof(struct fsObject) + 2 < sb->s_blocksize) {
++		asfs_translate(buf, obj->name, ASFS_SB(sb)->nls_io, ASFS_SB(sb)->nls_disk, 512);
++		if (asfs_namecmp(buf, name, ASFS_SB(sb)->flags & ASFS_ROOTBITS_CASESENSITIVE, ASFS_SB(sb)->nls_io) == 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;
++}
++
++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;
++	u8 bufname[ASFS_MAXFN_BUF];
++
++	asfs_translate(bufname, name, ASFS_SB(sb)->nls_disk, ASFS_SB(sb)->nls_io, ASFS_MAXFN_BUF);
++
++	asfs_debug("asfs_lookup: (searching \"%s\"...) ", name);
++
++	lock_super(sb);
++
++	if ((!strchr(name, '?')) && (ASFS_I(dir)->hashtable != 0)) {	/* hashtable block is available and name can be reverse translated, 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(bufname, 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, bufname)) != 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 or name can't be reverse-translated, 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_nls(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 -Nur linux-2.6.19-rc6/fs/asfs/extents.c linux-2.6.19-rc6/fs/asfs/extents.c
+--- linux-2.6.19-rc6/fs/asfs/extents.c	1970-01-01 01:00:00.000000000 +0100
++++ linux-2.6.19-rc6/fs/asfs/extents.c	2006-11-24 18:19:03.000000000 +0100
+@@ -0,0 +1,586 @@
++/*
++ *
++ * Amiga Smart File System, Linux implementation
++ * version: 1.0beta11
++ *
++ * 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! */
++
++static 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 -Nur linux-2.6.19-rc6/fs/asfs/file.c linux-2.6.19-rc6/fs/asfs/file.c
+--- linux-2.6.19-rc6/fs/asfs/file.c	1970-01-01 01:00:00.000000000 +0100
++++ linux-2.6.19-rc6/fs/asfs/file.c	2006-11-24 18:19:03.000000000 +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 -Nur linux-2.6.19-rc6/fs/asfs/inode.c linux-2.6.19-rc6/fs/asfs/inode.c
+--- linux-2.6.19-rc6/fs/asfs/inode.c	1970-01-01 01:00:00.000000000 +0100
++++ linux-2.6.19-rc6/fs/asfs/inode.c	2006-11-24 18:19:03.000000000 +0100
+@@ -0,0 +1,436 @@
++/*
++ *
++ * Amiga Smart File System, Linux implementation
++ * version: 1.0beta11
++ *  
++ * Copyright (C) 2003,2004,2005  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>
++
++static int asfs_create(struct inode *dir, struct dentry *dentry, int mode, struct nameidata *nd);
++static int asfs_mkdir(struct inode *dir, struct dentry *dentry, int mode);
++static int asfs_symlink(struct inode *dir, struct dentry *dentry, const char *symname);
++static int asfs_rmdir(struct inode *dir, struct dentry *dentry);
++static int asfs_unlink(struct inode *dir, struct dentry *dentry);
++static int asfs_rename(struct inode *old_dir, struct dentry *old_dentry,
++		struct inode *new_dir, struct dentry *new_dentry);
++/*static int asfs_notify_change(struct dentry *dentry, struct iattr *attr);*/
++
++
++/* 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,
++	.put_link	= page_put_link,
++#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;
++	u8 bufname[ASFS_MAXFN_BUF];
++
++	asfs_debug("asfs_create_obj %s in dir node %d\n", name, (int)dir->i_ino);
++
++	asfs_translate(bufname, name, ASFS_SB(sb)->nls_disk, ASFS_SB(sb)->nls_io, ASFS_MAXFN_BUF);
++	if ((error = asfs_check_name(bufname, strlen(bufname))) != 0)
++		return error;
++
++	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, bufname, 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;
++}
++
++static int asfs_create(struct inode *dir, struct dentry *dentry, int mode, struct nameidata *nd)
++{
++	return asfs_create_object(dir, dentry, mode, it_file, NULL);
++}
++
++static int asfs_mkdir(struct inode *dir, struct dentry *dentry, int mode)
++{
++	return asfs_create_object(dir, dentry, mode, it_dir, NULL);
++}
++
++static int asfs_symlink(struct inode *dir, struct dentry *dentry, const char *symname)
++{
++	return asfs_create_object(dir, dentry, 0, it_link, symname);
++}
++
++static 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);
++}
++
++static 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;
++}
++
++static 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;
++	u8 bufname[ASFS_MAXFN_BUF];
++
++	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);
++
++	asfs_translate(bufname, (u8 *) new_dentry->d_name.name, ASFS_SB(sb)->nls_disk, ASFS_SB(sb)->nls_io, ASFS_MAXFN_BUF);
++	if ((error = asfs_check_name(bufname, strlen(bufname))) != 0)
++		return error;
++
++
++	/* 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, bufname)) != 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 -Nur linux-2.6.19-rc6/fs/asfs/namei.c linux-2.6.19-rc6/fs/asfs/namei.c
+--- linux-2.6.19-rc6/fs/asfs/namei.c	1970-01-01 01:00:00.000000000 +0100
++++ linux-2.6.19-rc6/fs/asfs/namei.c	2006-11-24 18:19:03.000000000 +0100
+@@ -0,0 +1,197 @@
++/*
++ *
++ * Amiga Smart File System, Linux implementation
++ * version: 1.0beta10
++ *
++ * Copyright (C) 2003,2004,2005  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 <linux/nls.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);
++}
++
++static inline u8 asfs_nls_upperchar(u8 c, struct nls_table *t)
++{
++	if (t) {
++		u8 nc = t->charset2upper[c];
++		return nc ? nc : c;
++	} else
++		return asfs_upperchar(c);
++}
++
++/* Check if the name is valid for a asfs object. */
++
++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;
++	struct nls_table *nls_io = ASFS_SB(sb)->nls_io;
++
++	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_nls_upperchar(*name, nls_io), 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;
++	struct nls_table *nls_io = ASFS_SB(sb)->nls_io;
++
++	/* '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_nls_upperchar(*aname++, nls_io) != asfs_nls_upperchar(*bname++, nls_io))
++				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, struct nls_table *t)
++{
++	if (casesensitive) {
++		while (*s == *ct && *ct != '\0' && *ct != '/') {
++			s++;
++			ct++;
++		}
++	} else {
++		while (asfs_nls_upperchar(*s, t) == asfs_nls_upperchar(*ct, t) && *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;
++}
++
++void asfs_translate(u8 *to, u8 *from, struct nls_table *nls_to, struct nls_table *nls_from, int limit)
++{
++	wchar_t uni;
++	int i, len;
++	int from_len, to_len = limit;
++
++	if (nls_to) {
++		from_len = strlen(from);
++		for (i=0; i < from_len && to_len > 1; ) {
++			len = nls_from->char2uni(&from[i], from_len-i, &uni);
++			if (len > 0) {
++				i += len;
++				len = nls_to->uni2char(uni, to, to_len);
++				if (len > 0) {
++					to += len;
++					to_len -= len;
++				}
++			} else
++				i++;
++			if (len < 0) {
++				*to++ = '?';
++				to_len--;
++			}
++		}
++		*to = '\0';
++	} else {
++		strncpy (to, from, limit);
++		to[limit-1] = '\0';
++	}
++}
+diff -Nur linux-2.6.19-rc6/fs/asfs/nodes.c linux-2.6.19-rc6/fs/asfs/nodes.c
+--- linux-2.6.19-rc6/fs/asfs/nodes.c	1970-01-01 01:00:00.000000000 +0100
++++ linux-2.6.19-rc6/fs/asfs/nodes.c	2006-11-24 18:19:03.000000000 +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 -Nur linux-2.6.19-rc6/fs/asfs/objects.c linux-2.6.19-rc6/fs/asfs/objects.c
+--- linux-2.6.19-rc6/fs/asfs/objects.c	1970-01-01 01:00:00.000000000 +0100
++++ linux-2.6.19-rc6/fs/asfs/objects.c	2006-11-24 18:19:03.000000000 +0100
+@@ -0,0 +1,765 @@
++/*
++ *
++ * Amiga Smart File System, Linux implementation
++ * version: 1.0beta11
++ *
++ * 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, NULL) == 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
++
++static 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 = 0;
++	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 -Nur linux-2.6.19-rc6/fs/asfs/super.c linux-2.6.19-rc6/fs/asfs/super.c
+--- linux-2.6.19-rc6/fs/asfs/super.c	1970-01-01 01:00:00.000000000 +0100
++++ linux-2.6.19-rc6/fs/asfs/super.c	2006-11-24 18:19:03.000000000 +0100
+@@ -0,0 +1,497 @@
++/*
++ *
++ * Amiga Smart File System, Linux implementation
++ *
++ * version: 1.0beta11 for 2.6.xx kernel
++ *  
++ * Copyright (C) 2003,2004,2005,2006  Marek 'March' Szyprowski <marek at amiga.pl>
++ *
++ * NLS support by Pavel Fedin (C) 2005
++ *
++ *
++ * 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.0beta11 (22.09.2006)"
++
++#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 <linux/nls.h>
++#include "asfs_fs.h"
++
++#include <asm/byteorder.h>
++#include <asm/uaccess.h>
++
++static void asfs_put_super(struct super_block *sb);
++static int asfs_statfs(struct dentry *dentry, struct kstatfs *buf);
++static int asfs_remount(struct super_block *sb, int *flags, char *data);
++static struct inode *asfs_alloc_inode(struct super_block *sb);
++static void asfs_destroy_inode(struct inode *inode);
++
++static char asfs_default_codepage[] = CONFIG_ASFS_DEFAULT_CODEPAGE;
++static char asfs_default_iocharset[] = CONFIG_NLS_DEFAULT;
++
++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_iocharset, Opt_codepage, 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_iocharset, "iocharset=%s"},
++	{Opt_codepage, "codepage=%s"},
++	{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_iocharset:
++			if (ASFS_SB(sb)->iocharset != asfs_default_iocharset)
++				kfree(ASFS_SB(sb)->iocharset);
++			ASFS_SB(sb)->iocharset = match_strdup(&args[0]);
++			if (!ASFS_SB(sb)->iocharset)
++				return 0;
++			break;
++		case Opt_codepage:
++			if (ASFS_SB(sb)->codepage != asfs_default_codepage)
++				kfree(ASFS_SB(sb)->codepage);
++			ASFS_SB(sb)->codepage = match_strdup(&args[0]);
++			if (!ASFS_SB(sb)->codepage)
++				return 0;
++		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;
++	ASFS_SB(sb)->iocharset = asfs_default_iocharset;
++	ASFS_SB(sb)->codepage = asfs_default_codepage;
++
++	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;
++	asfs_debug("Case sensitive: %s\n", (ASFS_SB(sb)->flags & ASFS_ROOTBITS_CASESENSITIVE) ? "yes" : "no");
++
++	if (ASFS_SB(sb)->codepage[0] != '\0' && strcmp(ASFS_SB(sb)->codepage, "none") != 0) {
++		ASFS_SB(sb)->nls_disk = load_nls(ASFS_SB(sb)->codepage);
++		if (!ASFS_SB(sb)->nls_disk) {
++			printk(KERN_ERR "ASFS: codepage %s not found\n", ASFS_SB(sb)->codepage);
++			return -EINVAL;
++		}
++		ASFS_SB(sb)->nls_io = load_nls(ASFS_SB(sb)->iocharset);
++		if (!ASFS_SB(sb)->nls_io) {
++			printk(KERN_ERR "ASFS: IO charset %s not found\n", ASFS_SB(sb)->iocharset);
++			goto out2;
++		}
++	} else {
++		ASFS_SB(sb)->nls_io = NULL;
++		ASFS_SB(sb)->nls_disk = NULL;
++	}
++
++	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);
++	}
++	unload_nls(ASFS_SB(sb)->nls_io);
++out2:
++	unload_nls(ASFS_SB(sb)->nls_disk);
++	return -EINVAL;
++
++out:
++	asfs_brelse(bh);
++	return -EINVAL;
++
++}
++
++#ifdef CONFIG_ASFS_RW
++static 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
++
++static 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);
++	if (ASFS_SB(sb)->nls_disk)
++		unload_nls(ASFS_SB(sb)->nls_disk);
++	if (ASFS_SB(sb)->nls_io)
++		unload_nls(ASFS_SB(sb)->nls_io);
++	if (ASFS_SB(sb)->iocharset != asfs_default_iocharset)
++		kfree(ASFS_SB(sb)->iocharset);
++	if (ASFS_SB(sb)->codepage != asfs_default_codepage)
++		kfree(ASFS_SB(sb)->codepage);
++
++	kfree(sbi);
++	sb->s_fs_info = NULL;
++	return;
++}
++
++/* That's simple too. */
++static int asfs_statfs(struct dentry *dentry, struct kstatfs *buf)
++{
++	struct super_block *sb = dentry->d_sb;
++
++	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;
++
++static 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;
++}
++
++static 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 int asfs_get_sb(struct file_system_type *fs_type,
++	int flags, const char *dev_name, void *data, struct vfsmount *mnt)
++{
++	return get_sb_bdev(fs_type, flags, dev_name, data, asfs_fill_super,
++			   mnt);
++}
++
++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 -Nur linux-2.6.19-rc6/fs/asfs/symlink.c linux-2.6.19-rc6/fs/asfs/symlink.c
+--- linux-2.6.19-rc6/fs/asfs/symlink.c	1970-01-01 01:00:00.000000000 +0100
++++ linux-2.6.19-rc6/fs/asfs/symlink.c	2006-11-24 18:19:03.000000000 +0100
+@@ -0,0 +1,235 @@
++/*
++ *
++ * Amiga Smart File System, Linux implementation
++ * version: 1.0beta9
++ *  
++ * Copyright (C) 2003,2004,2005  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 <linux/nls.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;
++	struct nls_table *nls_io = ASFS_SB(sb)->nls_io;
++	struct nls_table *nls_disk = ASFS_SB(sb)->nls_disk;
++	char *link = kmap(page);
++	int i = 0, j = 0;
++	char c, lc = 0, *prefix, *lf, *p;
++	wchar_t uni;
++	int clen;
++
++	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;
++			while (i < 1023 && lf[j] != ':')
++			{
++				c = lf[j++];
++				if (ASFS_SB(sb)->flags & ASFS_VOL_LOWERCASE)
++					c = asfs_lowerchar(c);
++				if (nls_io)
++				{
++					clen = nls_disk->char2uni(&c, 1, &uni);
++					if (clen>0) {
++						clen = nls_io->uni2char(uni, &link[i], NLS_MAX_CHARSET_SIZE);
++						if (clen>0)
++							i += clen;
++					}
++					if (clen<0)
++						link[i++] = '?';
++				} else
++					link[i++] = c;
++			}
++			if (i < 1023)
++				link[i++] = '/';
++			j++;
++		}
++		lc = '/';
++	}
++
++	while (i < 1023 && (c = lf[j])) {
++		if (c == '/' && lc == '/' && i < 1020) {	/* parent dir */
++			link[i++] = '.';
++			link[i++] = '.';
++		}
++		lc = c;
++		if (nls_io)
++		{
++			clen = nls_disk->char2uni(&c, 1, &uni);
++			if (clen>0) {
++				clen = nls_io->uni2char(uni, &link[i], NLS_MAX_CHARSET_SIZE);
++				if (clen>0)
++					i += clen;
++			}
++			if (clen<0)
++				link[i++] = '?';
++		} else
++			link[i++] = 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;
++	struct nls_table *nls_io = ASFS_SB(sb)->nls_io;
++	struct nls_table *nls_disk = ASFS_SB(sb)->nls_disk;
++	char *p, c, lc;
++	int i, maxlen, pflen;
++	wchar_t uni;
++	int clen, blen;
++
++	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;
++			blen = strlen(symname);
++			while (*symname != '/' && *symname != '\0') {
++				clen = nls_io->char2uni(symname, blen, &uni);
++				if (clen>0) {
++					symname += clen;
++					blen -= clen;
++					clen = nls_disk->uni2char(uni, p, NLS_MAX_CHARSET_SIZE);
++					if (clen>0)
++						p += clen;
++				}
++				else
++				{
++					symname++;
++					blen--;
++				}
++				if (clen<0)
++					*p++ = '?';
++				i++;
++			}
++			symname++;
++			*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++;
++	}
++
++	blen = strlen(symname);
++	while (i < maxlen && (c = *symname)) {
++		if (c == '.' && lc == '/' && symname[1] == '.' && symname[2] == '/') {
++			*p++ = '/';
++			i++;
++			symname += 3;
++			blen -= 3;
++			lc = '/';
++		} else if (c == '.' && lc == '/' && symname[1] == '/') {
++			symname += 2;
++			blen -= 2;
++			lc = '/';
++		} else {
++			clen = nls_io->char2uni(symname, blen, &uni);
++			if (clen>0) {
++				symname += clen;
++				blen -= clen;
++				clen = nls_disk->uni2char(uni, p, NLS_MAX_CHARSET_SIZE);
++				if (clen>0)
++					lc = *p;
++					p += clen;
++			}
++			else
++			{
++				symname++;
++				blen--;
++			}
++			if (clen<0)
++			{
++				*p++ = '?';
++				lc = '?';
++			}
++			i++;
++		}
++		if (lc == '/')
++			while (*symname == '/')
++			{
++				symname++;
++				blen--;
++			}
++	}
++	*p = 0;
++
++	asfs_bstore(sb, bh);
++	asfs_brelse(bh);
++
++	unlock_super(sb);
++	
++	return 0;
++}
++
++#endif
+--- linux-2.6.19-rc6/include/linux/amigasfs.h	1970-01-01 01:00:00.000000000 +0100
++++ linux-2.6.19-rc6/include/linux/amigasfs.h	2006-11-24 18:19:03.000000000 +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

Added: dists/sid/linux-2.6/debian/patches/features/all/v7-iwlwifi-add-iwlwifi-wireless-drivers.patch
==============================================================================
--- (empty file)
+++ dists/sid/linux-2.6/debian/patches/features/all/v7-iwlwifi-add-iwlwifi-wireless-drivers.patch	Mon Nov 26 20:06:56 2007
@@ -0,0 +1,35043 @@
+From a366327d9490e963b695fbdcf3ac1c5994dbeac4 Mon Sep 17 00:00:00 2001
+From: Zhu Yi <yi.zhu at intel.com>
+Date: Wed, 12 Sep 2007 15:34:11 +0800
+Subject: [PATCH] [PATCH V4] iwlwifi: add iwlwifi wireless drivers
+
+This patch adds the mac80211 based wireless drivers for the Intel
+PRO/Wireless 3945ABG/BG Network Connection and Intel Wireless WiFi
+Link AGN (4965) adapters.
+
+Signed-off-by: Zhu Yi <yi.zhu at intel.com>
+---
+ drivers/net/wireless/Kconfig        |  129 +
+ drivers/net/wireless/Makefile       |   12 +
+ drivers/net/wireless/iwl-3945-hw.h  |  118 +
+ drivers/net/wireless/iwl-3945-rs.c  |  979 ++++
+ drivers/net/wireless/iwl-3945-rs.h  |  191 +
+ drivers/net/wireless/iwl-3945.c     | 2290 +++++++++
+ drivers/net/wireless/iwl-3945.h     |   41 +
+ drivers/net/wireless/iwl-4965-hw.h  |  581 +++
+ drivers/net/wireless/iwl-4965-rs.c  | 2118 ++++++++
+ drivers/net/wireless/iwl-4965-rs.h  |  266 +
+ drivers/net/wireless/iwl-4965.c     | 4719 ++++++++++++++++++
+ drivers/net/wireless/iwl-4965.h     |  341 ++
+ drivers/net/wireless/iwl-channel.h  |  161 +
+ drivers/net/wireless/iwl-commands.h | 1734 +++++++
+ drivers/net/wireless/iwl-debug.h    |  149 +
+ drivers/net/wireless/iwl-eeprom.h   |  336 ++
+ drivers/net/wireless/iwl-helpers.h  |  255 +
+ drivers/net/wireless/iwl-hw.h       |  537 ++
+ drivers/net/wireless/iwl-io.h       |  470 ++
+ drivers/net/wireless/iwl-priv.h     |  308 ++
+ drivers/net/wireless/iwl-prph.h     |  229 +
+ drivers/net/wireless/iwl-spectrum.h |   91 +
+ drivers/net/wireless/iwl3945-base.c | 8732 ++++++++++++++++++++++++++++++++
+ drivers/net/wireless/iwl4965-base.c | 9323 +++++++++++++++++++++++++++++++++++
+ drivers/net/wireless/iwlwifi.h      |  713 +++
+ 25 files changed, 34823 insertions(+), 0 deletions(-)
+ create mode 100644 drivers/net/wireless/iwl-3945-hw.h
+ create mode 100644 drivers/net/wireless/iwl-3945-rs.c
+ create mode 100644 drivers/net/wireless/iwl-3945-rs.h
+ create mode 100644 drivers/net/wireless/iwl-3945.c
+ create mode 100644 drivers/net/wireless/iwl-3945.h
+ create mode 100644 drivers/net/wireless/iwl-4965-hw.h
+ create mode 100644 drivers/net/wireless/iwl-4965-rs.c
+ create mode 100644 drivers/net/wireless/iwl-4965-rs.h
+ create mode 100644 drivers/net/wireless/iwl-4965.c
+ create mode 100644 drivers/net/wireless/iwl-4965.h
+ create mode 100644 drivers/net/wireless/iwl-channel.h
+ create mode 100644 drivers/net/wireless/iwl-commands.h
+ create mode 100644 drivers/net/wireless/iwl-debug.h
+ create mode 100644 drivers/net/wireless/iwl-eeprom.h
+ create mode 100644 drivers/net/wireless/iwl-helpers.h
+ create mode 100644 drivers/net/wireless/iwl-hw.h
+ create mode 100644 drivers/net/wireless/iwl-io.h
+ create mode 100644 drivers/net/wireless/iwl-priv.h
+ create mode 100644 drivers/net/wireless/iwl-prph.h
+ create mode 100644 drivers/net/wireless/iwl-spectrum.h
+ create mode 100644 drivers/net/wireless/iwl3945-base.c
+ create mode 100644 drivers/net/wireless/iwl4965-base.c
+ create mode 100644 drivers/net/wireless/iwlwifi.h
+
+diff --git a/drivers/net/wireless/Kconfig b/drivers/net/wireless/Kconfig
+index d3613ef..5438d4f 100644
+--- a/drivers/net/wireless/Kconfig
++++ b/drivers/net/wireless/Kconfig
+@@ -550,6 +550,135 @@ config RTL8187
+ 
+ 	  Thanks to Realtek for their support!
+ 
++config IWLWIFI
++	bool "Intel Wireless WiFi Link Drivers"
++	depends on PCI && MAC80211 && WLAN_80211 && EXPERIMENTAL
++	select FW_LOADER
++	default n
++	---help---
++	  Select to enable drivers based on the iwlwifi project.  This
++	  project provides a common foundation for Intel's wireless
++	  drivers designed to use the mac80211 subsystem.
++
++	  See <file:Documentation/networking/README.iwlwifi> for
++	  information on the capabilities currently enabled in this
++	  driver and for tips for debugging issues and problems.
++
++config IWLWIFI_DEBUG
++	bool "Enable full debugging output in iwlwifi drivers"
++	depends on IWLWIFI
++	default y
++	---help---
++	  This option will enable debug tracing output for the iwlwifi
++	  drivers.
++
++	  This will result in the kernel module being ~100k larger.  You can
++	  control which debug output is sent to the kernel log by setting the
++	  value in
++
++	          /sys/bus/pci/drivers/${DRIVER}/debug_level
++
++	  This entry will only exist if this option is enabled.
++
++	  To set a value, simply echo an 8-byte hex value to the same file:
++
++		  % echo 0x43fff > /sys/bus/pci/drivers/${DRIVER}/debug_level
++
++	  You can find the list of debug mask values in:
++		  drivers/net/wireless/mac80211/iwlwifi/iwl-debug.h
++
++	  If this is your first time using this driver, you should say Y here
++	  as the debug information can assist others in helping you resolve
++	  any problems you may encounter.
++
++config IWLWIFI_SENSITIVITY
++	bool "Enable Sensitivity Calibration in iwlwifi drivers"
++	depends on IWLWIFI
++	default y
++	---help---
++	  This option will enable sensitivity calibration for the iwlwifi
++	  drivers.
++
++config IWLWIFI_SPECTRUM_MEASUREMENT
++	bool "Enable Spectrum Measurement in iwlwifi drivers"
++	depends on IWLWIFI
++	default y
++	---help---
++	  This option will enable spectrum measurement for the iwlwifi drivers.
++
++config IWLWIFI_QOS
++	bool "Enable Wireless QoS in iwlwifi drivers"
++	depends on IWLWIFI
++	default y
++	---help---
++	  This option will enable wireless quality of service (QoS) for the
++	  iwlwifi drivers.
++
++config IWLWIFI_HT
++	bool "Enable 802.11n HT features in iwlwifi drivers"
++	depends on EXPERIMENTAL
++	depends on IWLWIFI && MAC80211_HT
++	default n
++	---help---
++	  This option enables IEEE 802.11n High Throughput features
++	  for the iwlwifi drivers.
++
++config IWL4965
++	tristate "Intel Wireless WiFi 4965AGN"
++	depends on m && IWLWIFI && EXPERIMENTAL
++	default m
++	---help---
++	  Select to build the driver supporting the:
++
++	  Intel Wireless WiFi Link 4965AGN
++
++	  This driver uses the kernel's mac80211 subsystem.
++
++	  See <file:Documentation/networking/README.iwlwifi> for
++	  information on the capabilities currently enabled in this
++	  driver and for tips for debugging any issues or problems.
++
++	  In order to use this driver, you will need a microcode (uCode)
++	  image for it. You can obtain the microcode from:
++
++	          <http://intellinuxwireless.org/>.
++
++	  See the above referenced README.iwlwifi for information on where
++	  to install the microcode images.
++
++	  If you want to compile the driver as a module ( = code which can be
++	  inserted in and remvoed from the running kernel whenever you want),
++	  say M here and read <file:Documentation/modules.txt>.  The module
++	  will be called iwl4965.ko.
++
++config IWL3945
++	tristate "Intel PRO/Wireless 3945ABG/BG Network Connection"
++	depends on m && IWLWIFI && EXPERIMENTAL
++	default m
++	---help---
++	  Select to build the driver supporting the:
++
++	  Intel PRO/Wireless 3945ABG/BG Network Connection
++
++	  This driver uses the kernel's mac80211 subsystem.
++
++	  See <file:Documentation/networking/README.iwlwifi> for
++	  information on the capabilities currently enabled in this
++	  driver and for tips for debugging any issues or problems.
++
++	  In order to use this driver, you will need a microcode (uCode)
++	  image for it. You can obtain the microcode from:
++
++	          <http://intellinuxwireless.org/>.
++
++	  See the above referenced README.iwlwifi for information on where
++	  to install the microcode images.
++
++	  If you want to compile the driver as a module ( = code which can be
++	  inserted in and remvoed from the running kernel whenever you want),
++	  say M here and read <file:Documentation/modules.txt>.  The module
++	  will be called iwl3945.ko.
++
+ source "drivers/net/wireless/hostap/Kconfig"
+ source "drivers/net/wireless/bcm43xx/Kconfig"
+ source "drivers/net/wireless/zd1211rw/Kconfig"
+diff --git a/drivers/net/wireless/Makefile b/drivers/net/wireless/Makefile
+index aa1ba9d..0d884e8 100644
+--- a/drivers/net/wireless/Makefile
++++ b/drivers/net/wireless/Makefile
+@@ -47,3 +47,15 @@ obj-$(CONFIG_LIBERTAS)      += libertas/
+ 
+ rtl8187-objs		:= rtl8187_dev.o rtl8187_rtl8225.o
+ obj-$(CONFIG_RTL8187)	+= rtl8187.o
++
++obj-$(CONFIG_IWL3945)	+= iwl3945.o
++iwl3945-objs		= iwl3945-base.o iwl-3945.o iwl-3945-rs.o
++CFLAGS_iwl3945-base.o	= -DIWL=3945
++CFLAGS_iwl-3945.o	= -DIWL=3945
++CFLAGS_iwl-3945-rs.o	= -DIWL=3945
++
++obj-$(CONFIG_IWL4965)	+= iwl4965.o
++iwl4965-objs		= iwl4965-base.o iwl-4965.o iwl-4965-rs.o
++CFLAGS_iwl4965-base.o	= -DIWL=4965
++CFLAGS_iwl-4965.o	= -DIWL=4965
++CFLAGS_iwl-4965-rs.o	= -DIWL=4965
+diff --git a/drivers/net/wireless/iwl-3945-hw.h b/drivers/net/wireless/iwl-3945-hw.h
+new file mode 100644
+index 0000000..fb5f064
+--- /dev/null
++++ b/drivers/net/wireless/iwl-3945-hw.h
+@@ -0,0 +1,118 @@
++/******************************************************************************
++ *
++ * This file is provided under a dual BSD/GPLv2 license.  When using or
++ * redistributing this file, you may do so under either license.
++ *
++ * GPL LICENSE SUMMARY
++ *
++ * Copyright(c) 2005 - 2007 Intel Corporation. All rights reserved.
++ *
++ * This program is free software; you can redistribute it and/or modify
++ * it under the terms of version 2 of the GNU Geeral Public License as
++ * published by the Free Software Foundation.
++ *
++ * 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., 51 Franklin Street, Fifth Floor, Boston, MA 02110,
++ * USA
++ *
++ * The full GNU General Public License is included in this distribution
++ * in the file called LICENSE.GPL.
++ *
++ * Contact Information:
++ * James P. Ketrenos <ipw2100-admin at linux.intel.com>
++ * Intel Corporation, 5200 N.E. Elam Young Parkway, Hillsboro, OR 97124-6497
++ *
++ * BSD LICENSE
++ *
++ * Copyright(c) 2005 - 2007 Intel Corporation. All rights reserved.
++ * All rights reserved.
++ *
++ * Redistribution and use in source and binary forms, with or without
++ * modification, are permitted provided that the following conditions
++ * are met:
++ *
++ *  * Redistributions of source code must retain the above copyright
++ *    notice, this list of conditions and the following disclaimer.
++ *  * Redistributions in binary form must reproduce the above copyright
++ *    notice, this list of conditions and the following disclaimer in
++ *    the documentation and/or other materials provided with the
++ *    distribution.
++ *  * Neither the name Intel Corporation nor the names of its
++ *    contributors may be used to endorse or promote products derived
++ *    from this software without specific prior written permission.
++ *
++ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
++ * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
++ * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
++ * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
++ * OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
++ * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
++ * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
++ * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
++ * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
++ * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
++ * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
++ *
++ *****************************************************************************/
++
++#ifndef __iwl_3945_hw__
++#define __iwl_3945_hw__
++
++#define IWL_RX_BUF_SIZE 3000
++/* card static random access memory (SRAM) for processor data and instructs */
++#define ALM_RTC_INST_UPPER_BOUND		(0x014000)
++#define ALM_RTC_DATA_UPPER_BOUND		(0x808000)
++
++#define ALM_RTC_INST_SIZE (ALM_RTC_INST_UPPER_BOUND - RTC_INST_LOWER_BOUND)
++#define ALM_RTC_DATA_SIZE (ALM_RTC_DATA_UPPER_BOUND - RTC_DATA_LOWER_BOUND)
++
++#define IWL_MAX_BSM_SIZE ALM_RTC_INST_SIZE
++#define IWL_MAX_INST_SIZE ALM_RTC_INST_SIZE
++#define IWL_MAX_DATA_SIZE ALM_RTC_DATA_SIZE
++#define IWL_MAX_NUM_QUEUES	8
++
++static inline int iwl_hw_valid_rtc_data_addr(u32 addr)
++{
++	return (addr >= RTC_DATA_LOWER_BOUND) &&
++	       (addr < ALM_RTC_DATA_UPPER_BOUND);
++}
++
++/* Base physical address of iwl_shared is provided to FH_TSSR_CBB_BASE
++ * and &iwl_shared.rx_read_ptr[0] is provided to FH_RCSR_RPTR_ADDR(0) */
++struct iwl_shared {
++	__le32 tx_base_ptr[8];
++	__le32 rx_read_ptr[3];
++} __attribute__ ((packed));
++
++struct iwl_tfd_frame_data {
++	__le32 addr;
++	__le32 len;
++} __attribute__ ((packed));
++
++struct iwl_tfd_frame {
++	__le32 control_flags;
++	struct iwl_tfd_frame_data pa[4];
++	u8 reserved[28];
++} __attribute__ ((packed));
++
++static inline u8 iwl_hw_get_rate(__le16 rate_n_flags)
++{
++	return le16_to_cpu(rate_n_flags) & 0xFF;
++}
++
++static inline u16 iwl_hw_get_rate_n_flags(__le16 rate_n_flags)
++{
++	return le16_to_cpu(rate_n_flags);
++}
++
++static inline __le16 iwl_hw_set_rate_n_flags(u8 rate, u16 flags)
++{
++	return cpu_to_le16((u16)rate|flags);
++}
++#endif
+diff --git a/drivers/net/wireless/iwl-3945-rs.c b/drivers/net/wireless/iwl-3945-rs.c
+new file mode 100644
+index 0000000..a4f4c87
+--- /dev/null
++++ b/drivers/net/wireless/iwl-3945-rs.c
+@@ -0,0 +1,979 @@
++/******************************************************************************
++ *
++ * Copyright(c) 2005 - 2007 Intel Corporation. All rights reserved.
++ *
++ * This program is free software; you can redistribute it and/or modify it
++ * under the terms of version 2 of the GNU General Public License as
++ * published by the Free Software Foundation.
++ *
++ * 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.,
++ * 51 Franklin Street, Fifth Floor, Boston, MA 02110, USA
++ *
++ * The full GNU General Public License is included in this distribution in the
++ * file called LICENSE.
++ *
++ * Contact Information:
++ * James P. Ketrenos <ipw2100-admin at linux.intel.com>
++ * Intel Corporation, 5200 N.E. Elam Young Parkway, Hillsboro, OR 97124-6497
++ *
++ *****************************************************************************/
++
++#include <linux/kernel.h>
++#include <linux/init.h>
++#include <linux/skbuff.h>
++#include <linux/wireless.h>
++#include <net/mac80211.h>
++#include <net/ieee80211.h>
++
++#include <linux/netdevice.h>
++#include <linux/etherdevice.h>
++#include <linux/delay.h>
++
++#include <linux/workqueue.h>
++
++#include <net/mac80211.h>
++#include <linux/wireless.h>
++
++#include "../net/mac80211/ieee80211_rate.h"
++
++#include "iwlwifi.h"
++
++#define RS_NAME "iwl-3945-rs"
++
++struct iwl_rate_scale_data {
++	u64 data;
++	s32 success_counter;
++	s32 success_ratio;
++	s32 counter;
++	s32 average_tpt;
++	unsigned long stamp;
++};
++
++struct iwl_rate_scale_priv {
++	spinlock_t lock;
++	s32 *expected_tpt;
++	unsigned long last_partial_flush;
++	unsigned long last_flush;
++	u32 flush_time;
++	u32 last_tx_packets;
++	u32 tx_packets;
++	u8 tgg;
++	u8 flush_pending;
++	u8 start_rate;
++	u8 ibss_sta_added;
++	struct timer_list rate_scale_flush;
++	struct iwl_rate_scale_data win[IWL_RATE_COUNT];
++};
++
++static s32 iwl_expected_tpt_g[IWL_RATE_COUNT] = {
++	0, 0, 76, 104, 130, 168, 191, 202, 7, 13, 35, 58
++};
++
++static s32 iwl_expected_tpt_g_prot[IWL_RATE_COUNT] = {
++	0, 0, 0, 80, 93, 113, 123, 125, 7, 13, 35, 58
++};
++
++static s32 iwl_expected_tpt_a[IWL_RATE_COUNT] = {
++	40, 57, 72, 98, 121, 154, 177, 186, 0, 0, 0, 0
++};
++
++static s32 iwl_expected_tpt_b[IWL_RATE_COUNT] = {
++	0, 0, 0, 0, 0, 0, 0, 0, 7, 13, 35, 58
++};
++
++struct iwl_tpt_entry {
++	s8 min_rssi;
++	u8 index;
++};
++
++static struct iwl_tpt_entry iwl_tpt_table_a[] = {
++	{-60, IWL_RATE_54M_INDEX},
++	{-64, IWL_RATE_48M_INDEX},
++	{-72, IWL_RATE_36M_INDEX},
++	{-80, IWL_RATE_24M_INDEX},
++	{-84, IWL_RATE_18M_INDEX},
++	{-85, IWL_RATE_12M_INDEX},
++	{-87, IWL_RATE_9M_INDEX},
++	{-89, IWL_RATE_6M_INDEX}
++};
++
++static struct iwl_tpt_entry iwl_tpt_table_b[] = {
++	{-86, IWL_RATE_11M_INDEX},
++	{-88, IWL_RATE_5M_INDEX},
++	{-90, IWL_RATE_2M_INDEX},
++	{-92, IWL_RATE_1M_INDEX}
++
++};
++
++static struct iwl_tpt_entry iwl_tpt_table_g[] = {
++	{-60, IWL_RATE_54M_INDEX},
++	{-64, IWL_RATE_48M_INDEX},
++	{-68, IWL_RATE_36M_INDEX},
++	{-80, IWL_RATE_24M_INDEX},
++	{-84, IWL_RATE_18M_INDEX},
++	{-85, IWL_RATE_12M_INDEX},
++	{-86, IWL_RATE_11M_INDEX},
++	{-88, IWL_RATE_5M_INDEX},
++	{-90, IWL_RATE_2M_INDEX},
++	{-92, IWL_RATE_1M_INDEX}
++};
++
++#define IWL_RATE_MAX_WINDOW          62
++#define IWL_RATE_FLUSH        (3*HZ/10)
++#define IWL_RATE_WIN_FLUSH       (HZ/2)
++#define IWL_RATE_HIGH_TH          11520
++#define IWL_RATE_MIN_FAILURE_TH       8
++#define IWL_RATE_MIN_SUCCESS_TH       8
++#define IWL_RATE_DECREASE_TH       1920
++
++static u8 iwl_get_rate_index_by_rssi(s32 rssi, u8 mode)
++{
++	u32 index = 0;
++	u32 table_size = 0;
++	struct iwl_tpt_entry *tpt_table = NULL;
++
++	if ((rssi < IWL_MIN_RSSI_VAL) || (rssi > IWL_MAX_RSSI_VAL))
++		rssi = IWL_MIN_RSSI_VAL;
++
++	switch (mode) {
++	case MODE_IEEE80211G:
++		tpt_table = iwl_tpt_table_g;
++		table_size = ARRAY_SIZE(iwl_tpt_table_g);
++		break;
++
++	case MODE_IEEE80211A:
++		tpt_table = iwl_tpt_table_a;
++		table_size = ARRAY_SIZE(iwl_tpt_table_a);
++		break;
++
++	default:
++	case MODE_IEEE80211B:
++		tpt_table = iwl_tpt_table_b;
++		table_size = ARRAY_SIZE(iwl_tpt_table_b);
++		break;
++	}
++
++	while ((index < table_size) && (rssi < tpt_table[index].min_rssi))
++		index++;
++
++	index = min(index, (table_size - 1));
++
++	return tpt_table[index].index;
++}
++
++static void iwl_clear_window(struct iwl_rate_scale_data *window)
++{
++	window->data = 0;
++	window->success_counter = 0;
++	window->success_ratio = IWL_INVALID_VALUE;
++	window->counter = 0;
++	window->average_tpt = IWL_INVALID_VALUE;
++	window->stamp = 0;
++}
++
++/**
++ * iwl_rate_scale_flush_windows - flush out the rate scale windows
++ *
++ * Returns the number of windows that have gathered data but were
++ * not flushed.  If there were any that were not flushed, then
++ * reschedule the rate flushing routine.
++ */
++static int iwl_rate_scale_flush_windows(struct iwl_rate_scale_priv *rs_priv)
++{
++	int unflushed = 0;
++	int i;
++	unsigned long flags;
++
++	/*
++	 * For each rate, if we have collected data on that rate
++	 * and it has been more than IWL_RATE_WIN_FLUSH
++	 * since we flushed, clear out the gathered statistics
++	 */
++	for (i = 0; i < IWL_RATE_COUNT; i++) {
++		if (!rs_priv->win[i].counter)
++			continue;
++
++		spin_lock_irqsave(&rs_priv->lock, flags);
++		if (time_after(jiffies, rs_priv->win[i].stamp +
++			       IWL_RATE_WIN_FLUSH)) {
++			IWL_DEBUG_RATE("flushing %d samples of rate "
++				       "index %d\n",
++				       rs_priv->win[i].counter, i);
++			iwl_clear_window(&rs_priv->win[i]);
++		} else
++			unflushed++;
++		spin_unlock_irqrestore(&rs_priv->lock, flags);
++	}
++
++	return unflushed;
++}
++
++#define IWL_RATE_FLUSH_MAX              5000	/* msec */
++#define IWL_RATE_FLUSH_MIN              50	/* msec */
++
++static void iwl_bg_rate_scale_flush(unsigned long data)
++{
++	struct iwl_rate_scale_priv *rs_priv = (void *)data;
++	int unflushed = 0;
++	unsigned long flags;
++	u32 packet_count, duration, pps;
++
++	IWL_DEBUG_RATE("enter\n");
++
++	unflushed = iwl_rate_scale_flush_windows(rs_priv);
++
++	spin_lock_irqsave(&rs_priv->lock, flags);
++
++	rs_priv->flush_pending = 0;
++
++	/* Number of packets Rx'd since last time this timer ran */
++	packet_count = (rs_priv->tx_packets - rs_priv->last_tx_packets) + 1;
++
++	rs_priv->last_tx_packets = rs_priv->tx_packets + 1;
++
++	if (unflushed) {
++		duration =
++		    jiffies_to_msecs(jiffies - rs_priv->last_partial_flush);
++/*              duration = jiffies_to_msecs(rs_priv->flush_time); */
++
++		IWL_DEBUG_RATE("Tx'd %d packets in %dms\n",
++			       packet_count, duration);
++
++		/* Determine packets per second */
++		if (duration)
++			pps = (packet_count * 1000) / duration;
++		else
++			pps = 0;
++
++		if (pps) {
++			duration = IWL_RATE_FLUSH_MAX / pps;
++			if (duration < IWL_RATE_FLUSH_MIN)
++				duration = IWL_RATE_FLUSH_MIN;
++		} else
++			duration = IWL_RATE_FLUSH_MAX;
++
++		rs_priv->flush_time = msecs_to_jiffies(duration);
++
++		IWL_DEBUG_RATE("new flush period: %d msec ave %d\n",
++			       duration, packet_count);
++
++		mod_timer(&rs_priv->rate_scale_flush, jiffies +
++			  rs_priv->flush_time);
++
++		rs_priv->last_partial_flush = jiffies;
++	}
++
++	/* If there weren't any unflushed entries, we don't schedule the timer
++	 * to run again */
++
++	rs_priv->last_flush = jiffies;
++
++	spin_unlock_irqrestore(&rs_priv->lock, flags);
++
++	IWL_DEBUG_RATE("leave\n");
++}
++
++/**
++ * iwl_collect_tx_data - Update the success/failure sliding window
++ *
++ * We keep a sliding window of the last 64 packets transmitted
++ * at this rate.  window->data contains the bitmask of successful
++ * packets.
++ */
++static void iwl_collect_tx_data(struct iwl_rate_scale_priv *rs_priv,
++				struct iwl_rate_scale_data *window,
++				int success, int retries)
++{
++	unsigned long flags;
++
++	if (!retries) {
++		IWL_DEBUG_RATE("leave: retries == 0 -- should be at least 1\n");
++		return;
++	}
++
++	while (retries--) {
++		spin_lock_irqsave(&rs_priv->lock, flags);
++
++		/* If we have filled up the window then subtract one from the
++		 * success counter if the high-bit is counting toward
++		 * success */
++		if (window->counter == IWL_RATE_MAX_WINDOW) {
++			if (window->data & (1ULL << (IWL_RATE_MAX_WINDOW - 1)))
++				window->success_counter--;
++		} else
++			window->counter++;
++
++		/* Slide the window to the left one bit */
++		window->data = (window->data << 1);
++
++		/* If this packet was a success then set the low bit high */
++		if (success) {
++			window->success_counter++;
++			window->data |= 1;
++		}
++
++		/* window->counter can't be 0 -- it is either >0 or
++		 * IWL_RATE_MAX_WINDOW */
++		window->success_ratio = 12800 * window->success_counter /
++		    window->counter;
++
++		/* Tag this window as having been updated */
++		window->stamp = jiffies;
++
++		spin_unlock_irqrestore(&rs_priv->lock, flags);
++	}
++}
++
++static void rs_rate_init(void *priv_rate, void *priv_sta,
++			 struct ieee80211_local *local, struct sta_info *sta)
++{
++	int i;
++
++	IWL_DEBUG_RATE("enter\n");
++
++	/* TODO: what is a good starting rate for STA? About middle? Maybe not
++	 * the lowest or the highest rate.. Could consider using RSSI from
++	 * previous packets? Need to have IEEE 802.1X auth succeed immediately
++	 * after assoc.. */
++
++	for (i = IWL_RATE_COUNT - 1; i >= 0; i--) {
++		if (sta->supp_rates & (1 << i)) {
++			sta->txrate = i;
++			break;
++		}
++	}
++
++	sta->last_txrate = sta->txrate;
++
++	IWL_DEBUG_RATE("leave\n");
++}
++
++static void *rs_alloc(struct ieee80211_local *local)
++{
++	return local->hw.priv;
++}
++
++/* rate scale requires free function to be implmented */
++static void rs_free(void *priv)
++{
++	return;
++}
++static void rs_clear(void *priv)
++{
++	return;
++}
++
++
++static void *rs_alloc_sta(void *priv, gfp_t gfp)
++{
++	struct iwl_rate_scale_priv *rs_priv;
++	int i;
++
++	IWL_DEBUG_RATE("enter\n");
++
++	rs_priv = kzalloc(sizeof(struct iwl_rate_scale_priv), gfp);
++	if (!rs_priv) {
++		IWL_DEBUG_RATE("leave: ENOMEM\n");
++		return NULL;
++	}
++
++	spin_lock_init(&rs_priv->lock);
++
++	rs_priv->start_rate = IWL_RATE_INVALID;
++
++	/* default to just 802.11b */
++	rs_priv->expected_tpt = iwl_expected_tpt_b;
++
++	rs_priv->last_partial_flush = jiffies;
++	rs_priv->last_flush = jiffies;
++	rs_priv->flush_time = IWL_RATE_FLUSH;
++	rs_priv->last_tx_packets = 0;
++	rs_priv->ibss_sta_added = 0;
++
++	init_timer(&rs_priv->rate_scale_flush);
++	rs_priv->rate_scale_flush.data = (unsigned long)rs_priv;
++	rs_priv->rate_scale_flush.function = &iwl_bg_rate_scale_flush;
++
++	for (i = 0; i < IWL_RATE_COUNT; i++)
++		iwl_clear_window(&rs_priv->win[i]);
++
++	IWL_DEBUG_RATE("leave\n");
++
++	return rs_priv;
++}
++
++static void rs_free_sta(void *priv, void *priv_sta)
++{
++	struct iwl_rate_scale_priv *rs_priv = priv_sta;
++
++	IWL_DEBUG_RATE("enter\n");
++	del_timer_sync(&rs_priv->rate_scale_flush);
++	kfree(rs_priv);
++	IWL_DEBUG_RATE("leave\n");
++}
++
++/**
++ * rs_tx_status - Update rate control values based on Tx results
++ *
++ * NOTE: Uses iwl_priv->retry_rate for the # of retries attempted by
++ * the hardware for each rate.
++ */
++static void rs_tx_status(void *priv_rate,
++			 struct net_device *dev,
++			 struct sk_buff *skb,
++			 struct ieee80211_tx_status *tx_resp)
++{
++	u8 retries, current_count;
++	int scale_rate_index, first_index, last_index;
++	unsigned long flags;
++	struct sta_info *sta;
++	struct ieee80211_hdr *hdr = (struct ieee80211_hdr *)skb->data;
++	struct iwl_priv *priv = (struct iwl_priv *)priv_rate;
++	struct ieee80211_local *local = wdev_priv(dev->ieee80211_ptr);
++	struct iwl_rate_scale_priv *rs_priv;
++
++	IWL_DEBUG_RATE("enter\n");
++
++	retries = tx_resp->retry_count;
++
++	first_index = tx_resp->control.tx_rate;
++	if ((first_index < 0) || (first_index >= IWL_RATE_COUNT)) {
++		IWL_DEBUG_RATE("leave: Rate out of bounds: %0x for %d\n",
++			       tx_resp->control.tx_rate, first_index);
++		return;
++	}
++
++	sta = sta_info_get(local, hdr->addr1);
++	if (!sta || !sta->rate_ctrl_priv) {
++		if (sta)
++			sta_info_put(sta);
++		IWL_DEBUG_RATE("leave: No STA priv data to update!\n");
++		return;
++	}
++
++	rs_priv = (void *)sta->rate_ctrl_priv;
++
++	rs_priv->tx_packets++;
++
++	scale_rate_index = first_index;
++	last_index = first_index;
++
++	/*
++	 * Update the window for each rate.  We determine which rates
++	 * were Tx'd based on the total number of retries vs. the number
++	 * of retries configured for each rate -- currently set to the
++	 * priv value 'retry_rate' vs. rate specific
++	 *
++	 * On exit from this while loop last_index indicates the rate
++	 * at which the frame was finally transmitted (or failed if no
++	 * ACK)
++	 */
++	while (retries > 0) {
++		if (retries < priv->retry_rate) {
++			current_count = retries;
++			last_index = scale_rate_index;
++		} else {
++			current_count = priv->retry_rate;
++			last_index = iwl_get_prev_ieee_rate(scale_rate_index);
++		}
++
++		/* Update this rate accounting for as many retries
++		 * as was used for it (per current_count) */
++		iwl_collect_tx_data(rs_priv,
++				    &rs_priv->win[scale_rate_index],
++				    0, current_count);
++		IWL_DEBUG_RATE("Update rate %d for %d retries.\n",
++			       scale_rate_index, current_count);
++
++		retries -= current_count;
++
++		if (retries)
++			scale_rate_index =
++			    iwl_get_prev_ieee_rate(scale_rate_index);
++	}
++
++	/* Update the last index window with success/failure based on ACK */
++	IWL_DEBUG_RATE("Update rate %d with %s.\n",
++		       last_index,
++		       (tx_resp->flags & IEEE80211_TX_STATUS_ACK) ?
++		       "success" : "failure");
++	iwl_collect_tx_data(rs_priv,
++			    &rs_priv->win[last_index],
++			    tx_resp->flags & IEEE80211_TX_STATUS_ACK, 1);
++
++	/* We updated the rate scale window -- if its been more than
++	 * flush_time since the last run, schedule the flush
++	 * again */
++	spin_lock_irqsave(&rs_priv->lock, flags);
++
++	if (!rs_priv->flush_pending &&
++	    time_after(jiffies, rs_priv->last_partial_flush +
++		       rs_priv->flush_time)) {
++
++		rs_priv->flush_pending = 1;
++		mod_timer(&rs_priv->rate_scale_flush,
++			  jiffies + rs_priv->flush_time);
++	}
++
++	spin_unlock_irqrestore(&rs_priv->lock, flags);
++
++	sta_info_put(sta);
++
++	IWL_DEBUG_RATE("leave\n");
++
++	return;
++}
++
++static struct ieee80211_rate *iwl_get_lowest_rate(struct ieee80211_local
++						  *local)
++{
++	struct ieee80211_hw_mode *mode = local->oper_hw_mode;
++	int i;
++
++	for (i = 0; i < mode->num_rates; i++) {
++		struct ieee80211_rate *rate = &mode->rates[i];
++
++		if (rate->flags & IEEE80211_RATE_SUPPORTED)
++			return rate;
++	}
++
++	return &mode->rates[0];
++}
++
++static u16 iwl_get_adjacent_rate(struct iwl_rate_scale_priv *rs_priv,
++				 u8 index, u16 rate_mask, int phymode)
++{
++	u8 high = IWL_RATE_INVALID;
++	u8 low = IWL_RATE_INVALID;
++
++	/* 802.11A walks to the next literal adjascent rate in
++	 * the rate table */
++	if (unlikely(phymode == MODE_IEEE80211A)) {
++		int i;
++		u32 mask;
++
++		/* Find the previous rate that is in the rate mask */
++		i = index - 1;
++		for (mask = (1 << i); i >= 0; i--, mask >>= 1) {
++			if (rate_mask & mask) {
++				low = i;
++				break;
++			}
++		}
++
++		/* Find the next rate that is in the rate mask */
++		i = index + 1;
++		for (mask = (1 << i); i < IWL_RATE_COUNT; i++, mask <<= 1) {
++			if (rate_mask & mask) {
++				high = i;
++				break;
++			}
++		}
++
++		return (high << 8) | low;
++	}
++
++	low = index;
++	while (low != IWL_RATE_INVALID) {
++		if (rs_priv->tgg)
++			low = iwl_rates[low].prev_rs_tgg;
++		else
++			low = iwl_rates[low].prev_rs;
++		if (low == IWL_RATE_INVALID)
++			break;
++		if (rate_mask & (1 << low))
++			break;
++		IWL_DEBUG_RATE("Skipping masked lower rate: %d\n", low);
++	}
++
++	high = index;
++	while (high != IWL_RATE_INVALID) {
++		if (rs_priv->tgg)
++			high = iwl_rates[high].next_rs_tgg;
++		else
++			high = iwl_rates[high].next_rs;
++		if (high == IWL_RATE_INVALID)
++			break;
++		if (rate_mask & (1 << high))
++			break;
++		IWL_DEBUG_RATE("Skipping masked higher rate: %d\n", high);
++	}
++
++	return (high << 8) | low;
++}
++
++/**
++ * rs_get_rate - find the rate for the requested packet
++ *
++ * Returns the ieee80211_rate structure allocated by the driver.
++ *
++ * The rate control algorithm has no internal mapping between hw_mode's
++ * rate ordering and the rate ordering used by the rate control algorithm.
++ *
++ * The rate control algorithm uses a single table of rates that goes across
++ * the entire A/B/G spectrum vs. being limited to just one particular
++ * hw_mode.
++ *
++ * As such, we can't convert the index obtained below into the hw_mode's
++ * rate table and must reference the driver allocated rate table
++ *
++ */
++static struct ieee80211_rate *rs_get_rate(void *priv_rate,
++					  struct net_device *dev,
++					  struct sk_buff *skb,
++					  struct rate_control_extra *extra)
++{
++	u8 low = IWL_RATE_INVALID;
++	u8 high = IWL_RATE_INVALID;
++	u16 high_low;
++	int index;
++	struct iwl_rate_scale_priv *rs_priv;
++	struct iwl_rate_scale_data *window = NULL;
++	int current_tpt = IWL_INVALID_VALUE;
++	int low_tpt = IWL_INVALID_VALUE;
++	int high_tpt = IWL_INVALID_VALUE;
++	u32 fail_count;
++	s8 scale_action = 0;
++	unsigned long flags;
++	struct ieee80211_local *local = wdev_priv(dev->ieee80211_ptr);
++	struct ieee80211_hdr *hdr = (struct ieee80211_hdr *)skb->data;
++	struct sta_info *sta;
++	u16 fc, rate_mask;
++	struct iwl_priv *priv = (struct iwl_priv *)priv_rate;
++
++	IWL_DEBUG_RATE("enter\n");
++
++	memset(extra, 0, sizeof(*extra));
++
++	fc = le16_to_cpu(hdr->frame_control);
++	if (((fc & IEEE80211_FCTL_FTYPE) != IEEE80211_FTYPE_DATA) ||
++	    (is_multicast_ether_addr(hdr->addr1))) {
++		/* Send management frames and broadcast/multicast data using
++		 * lowest rate. */
++		/* TODO: this could probably be improved.. */
++		IWL_DEBUG_RATE("leave: lowest rate (not data or is "
++			       "multicast)\n");
++
++		return iwl_get_lowest_rate(local);
++	}
++
++	sta = sta_info_get(local, hdr->addr1);
++	if (!sta || !sta->rate_ctrl_priv) {
++		IWL_DEBUG_RATE("leave: No STA priv data to update!\n");
++		if (sta)
++			sta_info_put(sta);
++		return NULL;
++	}
++
++	rate_mask = sta->supp_rates;
++	index = min(sta->txrate & 0xffff, IWL_RATE_COUNT - 1);
++
++	rs_priv = (void *)sta->rate_ctrl_priv;
++
++	if ((priv->iw_mode == IEEE80211_IF_TYPE_IBSS) &&
++	    !rs_priv->ibss_sta_added) {
++		u8 sta_id = iwl_hw_find_station(priv, hdr->addr1);
++
++		if (sta_id == IWL_INVALID_STATION) {
++			IWL_DEBUG_RATE("LQ: ADD station " MAC_FMT "\n",
++					MAC_ARG(hdr->addr1));
++			sta_id = iwl_add_station(priv,
++				    hdr->addr1, 0, CMD_ASYNC);
++		}
++		if (sta_id != IWL_INVALID_STATION)
++			rs_priv->ibss_sta_added = 1;
++	}
++
++	spin_lock_irqsave(&rs_priv->lock, flags);
++
++	if (rs_priv->start_rate != IWL_RATE_INVALID) {
++		index = rs_priv->start_rate;
++		rs_priv->start_rate = IWL_RATE_INVALID;
++	}
++
++	window = &(rs_priv->win[index]);
++
++	fail_count = window->counter - window->success_counter;
++
++	if (((fail_count <= IWL_RATE_MIN_FAILURE_TH) &&
++	     (window->success_counter < IWL_RATE_MIN_SUCCESS_TH))) {
++		window->average_tpt = IWL_INVALID_VALUE;
++		spin_unlock_irqrestore(&rs_priv->lock, flags);
++
++		IWL_DEBUG_RATE("Invalid average_tpt on rate %d: "
++			       "counter: %d, success_counter: %d, "
++			       "expected_tpt is %sNULL\n",
++			       index,
++			       window->counter,
++			       window->success_counter,
++			       rs_priv->expected_tpt ? "not " : "");
++		goto out;
++
++	}
++
++	window->average_tpt = ((window->success_ratio *
++				rs_priv->expected_tpt[index] + 64) / 128);
++	current_tpt = window->average_tpt;
++
++	high_low = iwl_get_adjacent_rate(rs_priv, index, rate_mask,
++					 local->hw.conf.phymode);
++	low = high_low & 0xff;
++	high = (high_low >> 8) & 0xff;
++
++	if (low != IWL_RATE_INVALID)
++		low_tpt = rs_priv->win[low].average_tpt;
++
++	if (high != IWL_RATE_INVALID)
++		high_tpt = rs_priv->win[high].average_tpt;
++
++	spin_unlock_irqrestore(&rs_priv->lock, flags);
++
++	scale_action = 1;
++
++	if ((window->success_ratio < IWL_RATE_DECREASE_TH) || !current_tpt) {
++		IWL_DEBUG_RATE("decrease rate because of low success_ratio\n");
++		scale_action = -1;
++	} else if ((low_tpt == IWL_INVALID_VALUE) &&
++		   (high_tpt == IWL_INVALID_VALUE))
++		scale_action = 1;
++	else if ((low_tpt != IWL_INVALID_VALUE) &&
++		   (high_tpt != IWL_INVALID_VALUE)
++		   && (low_tpt < current_tpt)
++		   && (high_tpt < current_tpt)) {
++		IWL_DEBUG_RATE("No action -- low [%d] & high [%d] < "
++			       "current_tpt [%d]\n",
++			       low_tpt, high_tpt, current_tpt);
++		scale_action = 0;
++	} else {
++		if (high_tpt != IWL_INVALID_VALUE) {
++			if (high_tpt > current_tpt)
++				scale_action = 1;
++			else {
++				IWL_DEBUG_RATE
++				    ("decrease rate because of high tpt\n");
++				scale_action = -1;
++			}
++		} else if (low_tpt != IWL_INVALID_VALUE) {
++			if (low_tpt > current_tpt) {
++				IWL_DEBUG_RATE
++				    ("decrease rate because of low tpt\n");
++				scale_action = -1;
++			} else
++				scale_action = 1;
++		}
++	}
++
++	if ((window->success_ratio > IWL_RATE_HIGH_TH) ||
++	    (current_tpt > window->average_tpt)) {
++		IWL_DEBUG_RATE("No action -- success_ratio [%d] > HIGH_TH or "
++			       "current_tpt [%d] > average_tpt [%d]\n",
++			       window->success_ratio,
++			       current_tpt, window->average_tpt);
++		scale_action = 0;
++	}
++
++	switch (scale_action) {
++	case -1:
++		if (low != IWL_RATE_INVALID)
++			index = low;
++		break;
++
++	case 1:
++		if (high != IWL_RATE_INVALID)
++			index = high;
++
++		break;
++
++	case 0:
++	default:
++		break;
++	}
++
++	IWL_DEBUG_RATE("Selected %d (action %d) - low %d high %d\n",
++		       index, scale_action, low, high);
++
++ out:
++
++	sta->last_txrate = index;
++	sta->txrate = sta->last_txrate;
++	sta_info_put(sta);
++
++	IWL_DEBUG_RATE("leave: %d\n", index);
++
++	return &priv->ieee_rates[index];
++}
++
++static struct rate_control_ops rs_ops = {
++	.module = NULL,
++	.name = RS_NAME,
++	.tx_status = rs_tx_status,
++	.get_rate = rs_get_rate,
++	.rate_init = rs_rate_init,
++	.clear = rs_clear,
++	.alloc = rs_alloc,
++	.free = rs_free,
++	.alloc_sta = rs_alloc_sta,
++	.free_sta = rs_free_sta,
++};
++
++int iwl_fill_rs_info(struct ieee80211_hw *hw, char *buf, u8 sta_id)
++{
++	struct ieee80211_local *local = hw_to_local(hw);
++	struct iwl_priv *priv = hw->priv;
++	struct iwl_rate_scale_priv *rs_priv;
++	struct sta_info *sta;
++	unsigned long flags;
++	int count = 0, i;
++	u32 samples = 0, success = 0, good = 0;
++	unsigned long now = jiffies;
++	u32 max_time = 0;
++
++	sta = sta_info_get(local, priv->stations[sta_id].sta.sta.addr);
++	if (!sta || !sta->rate_ctrl_priv) {
++		if (sta) {
++			sta_info_put(sta);
++			IWL_DEBUG_RATE("leave - no private rate data!\n");
++		} else
++			IWL_DEBUG_RATE("leave - no station!\n");
++		return sprintf(buf, "station %d not found\n", sta_id);
++	}
++
++	rs_priv = (void *)sta->rate_ctrl_priv;
++	spin_lock_irqsave(&rs_priv->lock, flags);
++	i = IWL_RATE_54M_INDEX;
++	while (1) {
++		u64 mask;
++		int j;
++
++		count +=
++		    sprintf(&buf[count], " %2dMbs: ", iwl_rates[i].ieee / 2);
++
++		mask = (1ULL << (IWL_RATE_MAX_WINDOW - 1));
++		for (j = 0; j < IWL_RATE_MAX_WINDOW; j++, mask >>= 1)
++			buf[count++] =
++			    (rs_priv->win[i].data & mask) ? '1' : '0';
++
++		samples += rs_priv->win[i].counter;
++		good += rs_priv->win[i].success_counter;
++		success += rs_priv->win[i].success_counter * iwl_rates[i].ieee;
++
++		if (rs_priv->win[i].stamp) {
++			int delta =
++			    jiffies_to_msecs(now - rs_priv->win[i].stamp);
++
++			if (delta > max_time)
++				max_time = delta;
++
++			count += sprintf(&buf[count], "%5dms\n", delta);
++		} else
++			buf[count++] = '\n';
++
++		j = iwl_get_prev_ieee_rate(i);
++		if (j == i)
++			break;
++		i = j;
++	}
++	spin_unlock_irqrestore(&rs_priv->lock, flags);
++	sta_info_put(sta);
++
++	/* Display the average rate of all samples taken.
++	 *
++	 * NOTE:  We multiple # of samples by 2 since the IEEE measurement
++	 * added from iwl_rates is actually 2X the rate */
++	if (samples)
++		count += sprintf(
++			&buf[count],
++			"\nAverage rate is %3d.%02dMbs over last %4dms\n"
++			"%3d%% success (%d good packets over %d tries)\n",
++			success / (2 * samples), (success * 5 / samples) % 10,
++			max_time, good * 100 / samples, good, samples);
++	else
++		count += sprintf(&buf[count], "\nAverage rate: 0Mbs\n");
++
++	return count;
++}
++
++void iwl_rate_scale_init(struct ieee80211_hw *hw, s32 sta_id)
++{
++	struct iwl_priv *priv = hw->priv;
++	s32 rssi = 0;
++	unsigned long flags;
++	struct ieee80211_local *local = hw_to_local(hw);
++	struct iwl_rate_scale_priv *rs_priv;
++	struct sta_info *sta;
++
++	IWL_DEBUG_RATE("enter\n");
++
++	if (!local->rate_ctrl->ops->name ||
++	    strcmp(local->rate_ctrl->ops->name, RS_NAME)) {
++		IWL_WARNING("iwl-3945-rs not selected as rate control algo!\n");
++		IWL_DEBUG_RATE("leave - mac80211 picked the wrong RC algo.\n");
++		return;
++	}
++
++	sta = sta_info_get(local, priv->stations[sta_id].sta.sta.addr);
++	if (!sta || !sta->rate_ctrl_priv) {
++		if (sta)
++			sta_info_put(sta);
++		IWL_DEBUG_RATE("leave - no private rate data!\n");
++		return;
++	}
++
++	rs_priv = (void *)sta->rate_ctrl_priv;
++
++	spin_lock_irqsave(&rs_priv->lock, flags);
++
++	rs_priv->tgg = 0;
++	switch (priv->phymode) {
++	case MODE_IEEE80211G:
++		if (priv->active_rxon.flags & RXON_FLG_TGG_PROTECT_MSK) {
++			rs_priv->tgg = 1;
++			rs_priv->expected_tpt = iwl_expected_tpt_g_prot;
++		} else
++			rs_priv->expected_tpt = iwl_expected_tpt_g;
++		break;
++
++	case MODE_IEEE80211A:
++		rs_priv->expected_tpt = iwl_expected_tpt_a;
++		break;
++
++	default:
++		IWL_WARNING("Invalid phymode.  Defaulting to 802.11b\n");
++	case MODE_IEEE80211B:
++		rs_priv->expected_tpt = iwl_expected_tpt_b;
++		break;
++	}
++
++	sta_info_put(sta);
++	spin_unlock_irqrestore(&rs_priv->lock, flags);
++
++	rssi = priv->last_rx_rssi;
++	if (rssi == 0)
++		rssi = IWL_MIN_RSSI_VAL;
++
++	IWL_DEBUG(IWL_DL_INFO | IWL_DL_RATE, "Network RSSI: %d\n", rssi);
++
++	rs_priv->start_rate = iwl_get_rate_index_by_rssi(rssi, priv->phymode);
++
++	IWL_DEBUG_RATE("leave: rssi %d assign rate index: "
++		       "%d (plcp 0x%x)\n", rssi, rs_priv->start_rate,
++		       iwl_rates[rs_priv->start_rate].plcp);
++}
++
++void iwl_rate_control_register(struct ieee80211_hw *hw)
++{
++	ieee80211_rate_control_register(&rs_ops);
++}
++
++void iwl_rate_control_unregister(struct ieee80211_hw *hw)
++{
++	ieee80211_rate_control_unregister(&rs_ops);
++}
++
++
+diff --git a/drivers/net/wireless/iwl-3945-rs.h b/drivers/net/wireless/iwl-3945-rs.h
+new file mode 100644
+index 0000000..b926738
+--- /dev/null
++++ b/drivers/net/wireless/iwl-3945-rs.h
+@@ -0,0 +1,191 @@
++/******************************************************************************
++ *
++ * Copyright(c) 2005 - 2007 Intel Corporation. All rights reserved.
++ *
++ * This program is free software; you can redistribute it and/or modify it
++ * under the terms of version 2 of the GNU General Public License as
++ * published by the Free Software Foundation.
++ *
++ * 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.,
++ * 51 Franklin Street, Fifth Floor, Boston, MA 02110, USA
++ *
++ * The full GNU General Public License is included in this distribution in the
++ * file called LICENSE.
++ *
++ * Contact Information:
++ * James P. Ketrenos <ipw2100-admin at linux.intel.com>
++ * Intel Corporation, 5200 N.E. Elam Young Parkway, Hillsboro, OR 97124-6497
++ *
++ *****************************************************************************/
++
++#ifndef __iwl_3945_rs_h__
++#define __iwl_3945_rs_h__
++
++struct iwl_rate_info {
++	u8 plcp;
++	u8 ieee;
++	u8 prev_ieee;		/* previous rate in IEEE speeds */
++	u8 next_ieee;		/* next rate in IEEE speeds */
++	u8 prev_rs;		/* previous rate used in rs algo */
++	u8 next_rs;		/* next rate used in rs algo */
++	u8 prev_rs_tgg;		/* previous rate used in TGG rs algo */
++	u8 next_rs_tgg;		/* next rate used in TGG rs algo */
++};
++
++enum {
++	IWL_RATE_6M_INDEX = 0,
++	IWL_RATE_9M_INDEX,
++	IWL_RATE_12M_INDEX,
++	IWL_RATE_18M_INDEX,
++	IWL_RATE_24M_INDEX,
++	IWL_RATE_36M_INDEX,
++	IWL_RATE_48M_INDEX,
++	IWL_RATE_54M_INDEX,
++	IWL_RATE_1M_INDEX,
++	IWL_RATE_2M_INDEX,
++	IWL_RATE_5M_INDEX,
++	IWL_RATE_11M_INDEX,
++	IWL_RATE_COUNT,
++	IWL_RATE_INVM_INDEX,
++	IWL_RATE_INVALID = IWL_RATE_INVM_INDEX
++};
++
++enum {
++	IWL_FIRST_OFDM_RATE = IWL_RATE_6M_INDEX,
++	IWL_LAST_OFDM_RATE = IWL_RATE_54M_INDEX,
++	IWL_FIRST_CCK_RATE = IWL_RATE_1M_INDEX,
++	IWL_LAST_CCK_RATE = IWL_RATE_11M_INDEX,
++};
++
++/* #define vs. enum to keep from defaulting to 'large integer' */
++#define	IWL_RATE_6M_MASK   (1<<IWL_RATE_6M_INDEX)
++#define	IWL_RATE_9M_MASK   (1<<IWL_RATE_9M_INDEX)
++#define	IWL_RATE_12M_MASK  (1<<IWL_RATE_12M_INDEX)
++#define	IWL_RATE_18M_MASK  (1<<IWL_RATE_18M_INDEX)
++#define	IWL_RATE_24M_MASK  (1<<IWL_RATE_24M_INDEX)
++#define	IWL_RATE_36M_MASK  (1<<IWL_RATE_36M_INDEX)
++#define	IWL_RATE_48M_MASK  (1<<IWL_RATE_48M_INDEX)
++#define	IWL_RATE_54M_MASK  (1<<IWL_RATE_54M_INDEX)
++#define	IWL_RATE_1M_MASK   (1<<IWL_RATE_1M_INDEX)
++#define	IWL_RATE_2M_MASK   (1<<IWL_RATE_2M_INDEX)
++#define	IWL_RATE_5M_MASK   (1<<IWL_RATE_5M_INDEX)
++#define	IWL_RATE_11M_MASK  (1<<IWL_RATE_11M_INDEX)
++
++enum {
++	IWL_RATE_6M_PLCP = 13,
++	IWL_RATE_9M_PLCP = 15,
++	IWL_RATE_12M_PLCP = 5,
++	IWL_RATE_18M_PLCP = 7,
++	IWL_RATE_24M_PLCP = 9,
++	IWL_RATE_36M_PLCP = 11,
++	IWL_RATE_48M_PLCP = 1,
++	IWL_RATE_54M_PLCP = 3,
++	IWL_RATE_1M_PLCP = 10,
++	IWL_RATE_2M_PLCP = 20,
++	IWL_RATE_5M_PLCP = 55,
++	IWL_RATE_11M_PLCP = 110,
++};
++
++enum {
++	IWL_RATE_6M_IEEE = 12,
++	IWL_RATE_9M_IEEE = 18,
++	IWL_RATE_12M_IEEE = 24,
++	IWL_RATE_18M_IEEE = 36,
++	IWL_RATE_24M_IEEE = 48,
++	IWL_RATE_36M_IEEE = 72,
++	IWL_RATE_48M_IEEE = 96,
++	IWL_RATE_54M_IEEE = 108,
++	IWL_RATE_1M_IEEE = 2,
++	IWL_RATE_2M_IEEE = 4,
++	IWL_RATE_5M_IEEE = 11,
++	IWL_RATE_11M_IEEE = 22,
++};
++
++#define IWL_CCK_BASIC_RATES_MASK    \
++       (IWL_RATE_1M_MASK          | \
++	IWL_RATE_2M_MASK)
++
++#define IWL_CCK_RATES_MASK          \
++       (IWL_BASIC_RATES_MASK      | \
++	IWL_RATE_5M_MASK          | \
++	IWL_RATE_11M_MASK)
++
++#define IWL_OFDM_BASIC_RATES_MASK   \
++	(IWL_RATE_6M_MASK         | \
++	IWL_RATE_12M_MASK         | \
++	IWL_RATE_24M_MASK)
++
++#define IWL_OFDM_RATES_MASK         \
++       (IWL_OFDM_BASIC_RATES_MASK | \
++	IWL_RATE_9M_MASK          | \
++	IWL_RATE_18M_MASK         | \
++	IWL_RATE_36M_MASK         | \
++	IWL_RATE_48M_MASK         | \
++	IWL_RATE_54M_MASK)
++
++#define IWL_BASIC_RATES_MASK         \
++	(IWL_OFDM_BASIC_RATES_MASK | \
++	 IWL_CCK_BASIC_RATES_MASK)
++
++#define IWL_RATES_MASK ((1<<IWL_RATE_COUNT)-1)
++
++#define IWL_INVALID_VALUE    -1
++
++#define IWL_MIN_RSSI_VAL                 -100
++#define IWL_MAX_RSSI_VAL                    0
++
++extern const struct iwl_rate_info iwl_rates[IWL_RATE_COUNT];
++
++static inline u8 iwl_get_prev_ieee_rate(u8 rate_index)
++{
++	u8 rate = iwl_rates[rate_index].prev_ieee;
++
++	if (rate == IWL_RATE_INVALID)
++		rate = rate_index;
++	return rate;
++}
++
++/**
++ * iwl_fill_rs_info - Fill an output text buffer with the rate representation
++ *
++ * NOTE:  This is provided as a quick mechanism for a user to visualize
++ * the performance of the rate control alogirthm and is not meant to be
++ * parsed software.
++ */
++extern int iwl_fill_rs_info(struct ieee80211_hw *, char *buf, u8 sta_id);
++
++/**
++ * iwl_rate_scale_init - Initialize the rate scale table based on assoc info
++ *
++ * The specific througput table used is based on the type of network
++ * the associated with, including A, B, G, and G w/ TGG protection
++ */
++extern void iwl_rate_scale_init(struct ieee80211_hw *hw, s32 sta_id);
++
++/**
++ * iwl_rate_control_register - Register the rate control algorithm callbacks
++ *
++ * Since the rate control algorithm is hardware specific, there is no need
++ * or reason to place it as a stand alone module.  The driver can call
++ * iwl_rate_control_register in order to register the rate control callbacks
++ * with the mac80211 subsystem.  This should be performed prior to calling
++ * ieee80211_register_hw
++ *
++ */
++extern void iwl_rate_control_register(struct ieee80211_hw *hw);
++
++/**
++ * iwl_rate_control_unregister - Unregister the rate control callbacks
++ *
++ * This should be called after calling ieee80211_unregister_hw, but before
++ * the driver is unloaded.
++ */
++extern void iwl_rate_control_unregister(struct ieee80211_hw *hw);
++
++#endif
+diff --git a/drivers/net/wireless/iwl-3945.c b/drivers/net/wireless/iwl-3945.c
+new file mode 100644
+index 0000000..26f03a0
+--- /dev/null
++++ b/drivers/net/wireless/iwl-3945.c
+@@ -0,0 +1,2290 @@
++/******************************************************************************
++ *
++ * Copyright(c) 2003 - 2007 Intel Corporation. All rights reserved.
++ *
++ * This program is free software; you can redistribute it and/or modify it
++ * under the terms of version 2 of the GNU General Public License as
++ * published by the Free Software Foundation.
++ *
++ * 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.,
++ * 51 Franklin Street, Fifth Floor, Boston, MA 02110, USA
++ *
++ * The full GNU General Public License is included in this distribution in the
++ * file called LICENSE.
++ *
++ * Contact Information:
++ * James P. Ketrenos <ipw2100-admin at linux.intel.com>
++ * Intel Corporation, 5200 N.E. Elam Young Parkway, Hillsboro, OR 97124-6497
++ *
++ *****************************************************************************/
++
++#include <linux/kernel.h>
++#include <linux/module.h>
++#include <linux/version.h>
++#include <linux/init.h>
++#include <linux/pci.h>
++#include <linux/dma-mapping.h>
++#include <linux/delay.h>
++#include <linux/skbuff.h>
++#include <linux/netdevice.h>
++#include <linux/wireless.h>
++#include <linux/firmware.h>
++#include <net/mac80211.h>
++
++#include <linux/etherdevice.h>
++#include <linux/delay.h>
++
++#include "iwlwifi.h"
++#include "iwl-helpers.h"
++#include "iwl-3945.h"
++#include "iwl-3945-rs.h"
++
++#define IWL_DECLARE_RATE_INFO(r, ip, in, rp, rn, pp, np)    \
++	[IWL_RATE_##r##M_INDEX] = { IWL_RATE_##r##M_PLCP,   \
++				    IWL_RATE_##r##M_IEEE,   \
++				    IWL_RATE_##ip##M_INDEX, \
++				    IWL_RATE_##in##M_INDEX, \
++				    IWL_RATE_##rp##M_INDEX, \
++				    IWL_RATE_##rn##M_INDEX, \
++				    IWL_RATE_##pp##M_INDEX, \
++				    IWL_RATE_##np##M_INDEX }
++
++/*
++ * Parameter order:
++ *   rate, prev rate, next rate, prev tgg rate, next tgg rate
++ *
++ * If there isn't a valid next or previous rate then INV is used which
++ * maps to IWL_RATE_INVALID
++ *
++ */
++const struct iwl_rate_info iwl_rates[IWL_RATE_COUNT] = {
++	IWL_DECLARE_RATE_INFO(6, 5, 9, 5, 11, 5, 11),        /*  6mbps */
++	IWL_DECLARE_RATE_INFO(9, 6, 11, 5, 11, 5, 11),       /*  9mbps */
++	IWL_DECLARE_RATE_INFO(12, 11, 18, 11, 18, 11, 18),   /* 12mbps */
++	IWL_DECLARE_RATE_INFO(18, 12, 24, 12, 24, 11, 24),   /* 18mbps */
++	IWL_DECLARE_RATE_INFO(24, 18, 36, 18, 36, 18, 36),   /* 24mbps */
++	IWL_DECLARE_RATE_INFO(36, 24, 48, 24, 48, 24, 48),   /* 36mbps */
++	IWL_DECLARE_RATE_INFO(48, 36, 54, 36, 54, 36, 54),   /* 48mbps */
++	IWL_DECLARE_RATE_INFO(54, 48, INV, 48, INV, 48, INV),/* 54mbps */
++	IWL_DECLARE_RATE_INFO(1, INV, 2, INV, 2, INV, 2),    /*  1mbps */
++	IWL_DECLARE_RATE_INFO(2, 1, 5, 1, 5, 1, 5),          /*  2mbps */
++	IWL_DECLARE_RATE_INFO(5, 2, 6, 2, 11, 2, 11),        /*5.5mbps */
++	IWL_DECLARE_RATE_INFO(11, 9, 12, 5, 12, 5, 18),      /* 11mbps */
++};
++
++/* 1 = enable the iwl_disable_events() function */
++#define IWL_EVT_DISABLE (0)
++#define IWL_EVT_DISABLE_SIZE (1532/32)
++
++/**
++ * iwl_disable_events - Disable selected events in uCode event log
++ *
++ * Disable an event by writing "1"s into "disable"
++ *   bitmap in SRAM.  Bit position corresponds to Event # (id/type).
++ *   Default values of 0 enable uCode events to be logged.
++ * Use for only special debugging.  This function is just a placeholder as-is,
++ *   you'll need to provide the special bits! ...
++ *   ... and set IWL_EVT_DISABLE to 1. */
++void iwl_disable_events(struct iwl_priv *priv)
++{
++	int rc;
++	int i;
++	u32 base;		/* SRAM address of event log header */
++	u32 disable_ptr;	/* SRAM address of event-disable bitmap array */
++	u32 array_size;		/* # of u32 entries in array */
++	u32 evt_disable[IWL_EVT_DISABLE_SIZE] = {
++		0x00000000,	/*   31 -    0  Event id numbers */
++		0x00000000,	/*   63 -   32 */
++		0x00000000,	/*   95 -   64 */
++		0x00000000,	/*  127 -   96 */
++		0x00000000,	/*  159 -  128 */
++		0x00000000,	/*  191 -  160 */
++		0x00000000,	/*  223 -  192 */
++		0x00000000,	/*  255 -  224 */
++		0x00000000,	/*  287 -  256 */
++		0x00000000,	/*  319 -  288 */
++		0x00000000,	/*  351 -  320 */
++		0x00000000,	/*  383 -  352 */
++		0x00000000,	/*  415 -  384 */
++		0x00000000,	/*  447 -  416 */
++		0x00000000,	/*  479 -  448 */
++		0x00000000,	/*  511 -  480 */
++		0x00000000,	/*  543 -  512 */
++		0x00000000,	/*  575 -  544 */
++		0x00000000,	/*  607 -  576 */
++		0x00000000,	/*  639 -  608 */
++		0x00000000,	/*  671 -  640 */
++		0x00000000,	/*  703 -  672 */
++		0x00000000,	/*  735 -  704 */
++		0x00000000,	/*  767 -  736 */
++		0x00000000,	/*  799 -  768 */
++		0x00000000,	/*  831 -  800 */
++		0x00000000,	/*  863 -  832 */
++		0x00000000,	/*  895 -  864 */
++		0x00000000,	/*  927 -  896 */
++		0x00000000,	/*  959 -  928 */
++		0x00000000,	/*  991 -  960 */
++		0x00000000,	/* 1023 -  992 */
++		0x00000000,	/* 1055 - 1024 */
++		0x00000000,	/* 1087 - 1056 */
++		0x00000000,	/* 1119 - 1088 */
++		0x00000000,	/* 1151 - 1120 */
++		0x00000000,	/* 1183 - 1152 */
++		0x00000000,	/* 1215 - 1184 */
++		0x00000000,	/* 1247 - 1216 */
++		0x00000000,	/* 1279 - 1248 */
++		0x00000000,	/* 1311 - 1280 */
++		0x00000000,	/* 1343 - 1312 */
++		0x00000000,	/* 1375 - 1344 */
++		0x00000000,	/* 1407 - 1376 */
++		0x00000000,	/* 1439 - 1408 */
++		0x00000000,	/* 1471 - 1440 */
++		0x00000000,	/* 1503 - 1472 */
++	};
++
++	base = le32_to_cpu(priv->card_alive.log_event_table_ptr);
++	if (!iwl_hw_valid_rtc_data_addr(base)) {
++		IWL_ERROR("Invalid event log pointer 0x%08X\n", base);
++		return;
++	}
++
++	rc = iwl_grab_restricted_access(priv);
++	if (rc) {
++		IWL_WARNING("Can not read from adapter at this time.\n");
++		return;
++	}
++
++	disable_ptr = iwl_read_restricted_mem(priv, base + (4 * sizeof(u32)));
++	array_size = iwl_read_restricted_mem(priv, base + (5 * sizeof(u32)));
++	iwl_release_restricted_access(priv);
++
++	if (IWL_EVT_DISABLE && (array_size == IWL_EVT_DISABLE_SIZE)) {
++		IWL_DEBUG_INFO("Disabling selected uCode log events at 0x%x\n",
++			       disable_ptr);
++		rc = iwl_grab_restricted_access(priv);
++		for (i = 0; i < IWL_EVT_DISABLE_SIZE; i++)
++			iwl_write_restricted_mem(priv,
++						 disable_ptr +
++						 (i * sizeof(u32)),
++						 evt_disable[i]);
++
++		iwl_release_restricted_access(priv);
++	} else {
++		IWL_DEBUG_INFO("Selected uCode log events may be disabled\n");
++		IWL_DEBUG_INFO("  by writing \"1\"s into disable bitmap\n");
++		IWL_DEBUG_INFO("  in SRAM at 0x%x, size %d u32s\n",
++			       disable_ptr, array_size);
++	}
++
++}
++
++/**
++ * iwl3945_get_antenna_flags - Get antenna flags for RXON command
++ * @priv: eeprom and antenna fields are used to determine antenna flags
++ *
++ * priv->eeprom  is used to determine if antenna AUX/MAIN are reversed
++ * priv->antenna specifies the antenna diversity mode:
++ *
++ * IWL_ANTENNA_DIVERISTY - NIC selects best antenna by itself
++ * IWL_ANTENNA_MAIN      - Force MAIN antenna
++ * IWL_ANTENNA_AUX       - Force AUX antenna
++ */
++__le32 iwl3945_get_antenna_flags(const struct iwl_priv *priv)
++{
++	switch (priv->antenna) {
++	case IWL_ANTENNA_DIVERSITY:
++		return 0;
++
++	case IWL_ANTENNA_MAIN:
++		if (priv->eeprom.antenna_switch_type)
++			return RXON_FLG_DIS_DIV_MSK | RXON_FLG_ANT_B_MSK;
++		return RXON_FLG_DIS_DIV_MSK | RXON_FLG_ANT_A_MSK;
++
++	case IWL_ANTENNA_AUX:
++		if (priv->eeprom.antenna_switch_type)
++			return RXON_FLG_DIS_DIV_MSK | RXON_FLG_ANT_A_MSK;
++		return RXON_FLG_DIS_DIV_MSK | RXON_FLG_ANT_B_MSK;
++	}
++
++	/* bad antenna selector value */
++	IWL_ERROR("Bad antenna selector value (0x%x)\n", priv->antenna);
++	return 0;		/* "diversity" is default if error */
++}
++
++/*****************************************************************************
++ *
++ * Intel PRO/Wireless 3945ABG/BG Network Connection
++ *
++ *  RX handler implementations
++ *
++ *  Used by iwl-base.c
++ *
++ *****************************************************************************/
++
++void iwl_hw_rx_statistics(struct iwl_priv *priv, struct iwl_rx_mem_buffer *rxb)
++{
++	struct iwl_rx_packet *pkt = (void *)rxb->skb->data;
++	IWL_DEBUG_RX("Statistics notification received (%d vs %d).\n",
++		     (int)sizeof(struct iwl_notif_statistics),
++		     le32_to_cpu(pkt->len));
++
++	memcpy(&priv->statistics, pkt->u.raw, sizeof(priv->statistics));
++
++	priv->last_statistics_time = jiffies;
++}
++
++static void iwl3945_handle_data_packet(struct iwl_priv *priv, int is_data,
++				   struct iwl_rx_mem_buffer *rxb,
++				   struct ieee80211_rx_status *stats,
++				   u16 phy_flags)
++{
++	struct ieee80211_hdr *hdr;
++	struct iwl_rx_packet *pkt = (struct iwl_rx_packet *)rxb->skb->data;
++	struct iwl_rx_frame_hdr *rx_hdr = IWL_RX_HDR(pkt);
++	struct iwl_rx_frame_end *rx_end = IWL_RX_END(pkt);
++	short len = le16_to_cpu(rx_hdr->len);
++
++	/* We received data from the HW, so stop the watchdog */
++	if (unlikely((len + IWL_RX_FRAME_SIZE) > skb_tailroom(rxb->skb))) {
++		IWL_DEBUG_DROP("Corruption detected!\n");
++		return;
++	}
++
++	/* We only process data packets if the interface is open */
++	if (unlikely(!priv->is_open)) {
++		IWL_DEBUG_DROP_LIMIT
++		    ("Dropping packet while interface is not open.\n");
++		return;
++	}
++	if (priv->iw_mode == IEEE80211_IF_TYPE_MNTR) {
++		if (iwl_param_hwcrypto)
++			iwl_set_decrypted_flag(priv, rxb->skb,
++					       le32_to_cpu(rx_end->status),
++					       stats);
++		iwl_handle_data_packet_monitor(priv, rxb, IWL_RX_DATA(pkt),
++					       len, stats, phy_flags);
++		return;
++	}
++
++	skb_reserve(rxb->skb, (void *)rx_hdr->payload - (void *)pkt);
++	/* Set the size of the skb to the size of the frame */
++	skb_put(rxb->skb, le16_to_cpu(rx_hdr->len));
++
++	hdr = (void *)rxb->skb->data;
++
++	if (iwl_param_hwcrypto)
++		iwl_set_decrypted_flag(priv, rxb->skb,
++				       le32_to_cpu(rx_end->status), stats);
++
++	ieee80211_rx_irqsafe(priv->hw, rxb->skb, stats);
++	rxb->skb = NULL;
++}
++
++static void iwl3945_rx_reply_rx(struct iwl_priv *priv,
++				struct iwl_rx_mem_buffer *rxb)
++{
++	struct iwl_rx_packet *pkt = (void *)rxb->skb->data;
++	struct iwl_rx_frame_stats *rx_stats = IWL_RX_STATS(pkt);
++	struct iwl_rx_frame_hdr *rx_hdr = IWL_RX_HDR(pkt);
++	struct iwl_rx_frame_end *rx_end = IWL_RX_END(pkt);
++	struct ieee80211_hdr *header;
++	u16 phy_flags = le16_to_cpu(rx_hdr->phy_flags);
++	u16 rx_stats_sig_avg = le16_to_cpu(rx_stats->sig_avg);
++	u16 rx_stats_noise_diff = le16_to_cpu(rx_stats->noise_diff);
++	struct ieee80211_rx_status stats = {
++		.mactime = le64_to_cpu(rx_end->timestamp),
++		.freq = ieee80211chan2mhz(le16_to_cpu(rx_hdr->channel)),
++		.channel = le16_to_cpu(rx_hdr->channel),
++		.phymode = (rx_hdr->phy_flags & RX_RES_PHY_FLAGS_BAND_24_MSK) ?
++		MODE_IEEE80211G : MODE_IEEE80211A,
++		.antenna = 0,
++		.rate = rx_hdr->rate,
++		.flag = 0,
++	};
++	u8 network_packet;
++	int snr;
++
++	if ((unlikely(rx_stats->phy_count > 20))) {
++		IWL_DEBUG_DROP
++		    ("dsp size out of range [0,20]: "
++		     "%d/n", rx_stats->phy_count);
++		return;
++	}
++
++	if (!(rx_end->status & RX_RES_STATUS_NO_CRC32_ERROR)
++	    || !(rx_end->status & RX_RES_STATUS_NO_RXE_OVERFLOW)) {
++		IWL_DEBUG_RX("Bad CRC or FIFO: 0x%08X.\n", rx_end->status);
++		return;
++	}
++
++	if (priv->iw_mode == IEEE80211_IF_TYPE_MNTR) {
++		iwl3945_handle_data_packet(priv, 1, rxb, &stats, phy_flags);
++		return;
++	}
++
++	/* Convert 3945's rssi indicator to dBm */
++	stats.ssi = rx_stats->rssi - IWL_RSSI_OFFSET;
++
++	/* Set default noise value to -127 */
++	if (priv->last_rx_noise == 0)
++		priv->last_rx_noise = IWL_NOISE_MEAS_NOT_AVAILABLE;
++
++	/* 3945 provides noise info for OFDM frames only.
++	 * sig_avg and noise_diff are measured by the 3945's digital signal
++	 *   processor (DSP), and indicate linear levels of signal level and
++	 *   distortion/noise within the packet preamble after
++	 *   automatic gain control (AGC).  sig_avg should stay fairly
++	 *   constant if the radio's AGC is working well.
++	 * Since these values are linear (not dB or dBm), linear
++	 *   signal-to-noise ratio (SNR) is (sig_avg / noise_diff).
++	 * Convert linear SNR to dB SNR, then subtract that from rssi dBm
++	 *   to obtain noise level in dBm.
++	 * Calculate stats.signal (quality indicator in %) based on SNR. */
++	if (rx_stats_noise_diff) {
++		snr = rx_stats_sig_avg / rx_stats_noise_diff;
++		stats.noise = stats.ssi - iwl_calc_db_from_ratio(snr);
++		stats.signal = iwl_calc_sig_qual(stats.ssi, stats.noise);
++
++	/* If noise info not available, calculate signal quality indicator (%)
++	 *   using just the dBm signal level. */
++	} else {
++		stats.noise = priv->last_rx_noise;
++		stats.signal = iwl_calc_sig_qual(stats.ssi, 0);
++	}
++
++
++	IWL_DEBUG_STATS("Rssi %d noise %d qual %d sig_avg %d noise_diff %d\n",
++			stats.ssi, stats.noise, stats.signal,
++			rx_stats_sig_avg, rx_stats_noise_diff);
++
++	stats.freq = ieee80211chan2mhz(stats.channel);
++
++	/* can be covered by iwl_report_frame() in most cases */
++/*      IWL_DEBUG_RX("RX status: 0x%08X\n", rx_end->status); */
++
++	header = (struct ieee80211_hdr *)IWL_RX_DATA(pkt);
++
++	network_packet = iwl_is_network_packet(priv, header);
++
++#ifdef CONFIG_IWLWIFI_DEBUG
++	if (iwl_debug_level & IWL_DL_STATS && net_ratelimit())
++		IWL_DEBUG_STATS
++		    ("[%c] %d RSSI: %d Signal: %u, Noise: %u, Rate: %u\n",
++		     network_packet ? '*' : ' ',
++		     stats.channel, stats.ssi, stats.ssi,
++		     stats.ssi, stats.rate);
++
++	if (iwl_debug_level & (IWL_DL_RX))
++		/* Set "1" to report good data frames in groups of 100 */
++		iwl_report_frame(priv, pkt, header, 1);
++#endif
++
++	if (network_packet) {
++		priv->last_beacon_time = le32_to_cpu(rx_end->beacon_timestamp);
++		priv->last_tsf = le64_to_cpu(rx_end->timestamp);
++		priv->last_rx_rssi = stats.ssi;
++		priv->last_rx_noise = stats.noise;
++	}
++
++	switch (le16_to_cpu(header->frame_control) & IEEE80211_FCTL_FTYPE) {
++	case IEEE80211_FTYPE_MGMT:
++		switch (le16_to_cpu(header->frame_control) &
++			IEEE80211_FCTL_STYPE) {
++		case IEEE80211_STYPE_PROBE_RESP:
++		case IEEE80211_STYPE_BEACON:{
++				/* If this is a beacon or probe response for
++				 * our network then cache the beacon
++				 * timestamp */
++				if ((((priv->iw_mode == IEEE80211_IF_TYPE_STA)
++				      && !compare_ether_addr(header->addr2,
++							     priv->bssid)) ||
++				     ((priv->iw_mode == IEEE80211_IF_TYPE_IBSS)
++				      && !compare_ether_addr(header->addr3,
++							     priv->bssid)))) {
++					struct ieee80211_mgmt *mgmt =
++					    (struct ieee80211_mgmt *)header;
++					__le32 *pos;
++					pos =
++					    (__le32 *) & mgmt->u.beacon.
++					    timestamp;
++					priv->timestamp0 = le32_to_cpu(pos[0]);
++					priv->timestamp1 = le32_to_cpu(pos[1]);
++					priv->beacon_int = le16_to_cpu(
++					    mgmt->u.beacon.beacon_int);
++					if (priv->call_post_assoc_from_beacon &&
++					    (priv->iw_mode ==
++						IEEE80211_IF_TYPE_STA))
++						queue_work(priv->workqueue,
++						    &priv->post_associate.work);
++
++					priv->call_post_assoc_from_beacon = 0;
++				}
++
++				break;
++			}
++
++		case IEEE80211_STYPE_ACTION:
++			/* TODO: Parse 802.11h frames for CSA... */
++			break;
++
++			/*
++			 * TODO: There is no callback function from upper
++			 * stack to inform us when associated status. this
++			 * work around to sniff assoc_resp management frame
++			 * and finish the association process.
++			 */
++		case IEEE80211_STYPE_ASSOC_RESP:
++		case IEEE80211_STYPE_REASSOC_RESP:{
++				struct ieee80211_mgmt *mgnt =
++				    (struct ieee80211_mgmt *)header;
++				priv->assoc_id = (~((1 << 15) | (1 << 14)) &
++						  le16_to_cpu(mgnt->u.
++							      assoc_resp.aid));
++				priv->assoc_capability =
++				    le16_to_cpu(mgnt->u.assoc_resp.capab_info);
++				if (priv->beacon_int)
++					queue_work(priv->workqueue,
++					    &priv->post_associate.work);
++				else
++					priv->call_post_assoc_from_beacon = 1;
++				break;
++			}
++
++		case IEEE80211_STYPE_PROBE_REQ:{
++				if (priv->iw_mode == IEEE80211_IF_TYPE_IBSS)
++					IWL_DEBUG_DROP
++					    ("Dropping (non network): " MAC_FMT
++					     ", " MAC_FMT ", " MAC_FMT "\n",
++					     MAC_ARG(header->addr1),
++					     MAC_ARG(header->addr2),
++					     MAC_ARG(header->addr3));
++				return;
++			}
++		}
++
++		iwl3945_handle_data_packet(priv, 0, rxb, &stats, phy_flags);
++		break;
++
++	case IEEE80211_FTYPE_CTL:
++		break;
++
++	case IEEE80211_FTYPE_DATA:
++		if (unlikely(is_duplicate_packet(priv, header)))
++			IWL_DEBUG_DROP("Dropping (dup): " MAC_FMT ", "
++				       MAC_FMT ", " MAC_FMT "\n",
++				       MAC_ARG(header->addr1),
++				       MAC_ARG(header->addr2),
++				       MAC_ARG(header->addr3));
++		else
++			iwl3945_handle_data_packet(priv, 1, rxb, &stats,
++						   phy_flags);
++		break;
++	}
++}
++
++int iwl_hw_txq_attach_buf_to_tfd(struct iwl_priv *priv, void *ptr,
++				 dma_addr_t addr, u16 len)
++{
++	int count;
++	u32 pad;
++	struct iwl_tfd_frame *tfd = (struct iwl_tfd_frame *)ptr;
++
++	count = TFD_CTL_COUNT_GET(le32_to_cpu(tfd->control_flags));
++	pad = TFD_CTL_PAD_GET(le32_to_cpu(tfd->control_flags));
++
++	if ((count >= NUM_TFD_CHUNKS) || (count < 0)) {
++		IWL_ERROR("Error can not send more than %d chunks\n",
++			  NUM_TFD_CHUNKS);
++		return -EINVAL;
++	}
++
++	tfd->pa[count].addr = cpu_to_le32(addr);
++	tfd->pa[count].len = cpu_to_le32(len);
++
++	count++;
++
++	tfd->control_flags = cpu_to_le32(TFD_CTL_COUNT_SET(count) |
++					 TFD_CTL_PAD_SET(pad));
++
++	return 0;
++}
++
++/**
++ * iwl_hw_txq_free_tfd - Free one TFD, those at index [txq->q.last_used]
++ *
++ * Does NOT advance any indexes
++ */
++int iwl_hw_txq_free_tfd(struct iwl_priv *priv, struct iwl_tx_queue *txq)
++{
++	struct iwl_tfd_frame *bd_tmp = (struct iwl_tfd_frame *)&txq->bd[0];
++	struct iwl_tfd_frame *bd = &bd_tmp[txq->q.last_used];
++	struct pci_dev *dev = priv->pci_dev;
++	int i;
++	int counter;
++
++	/* classify bd */
++	if (txq->q.id == IWL_CMD_QUEUE_NUM)
++		/* nothing to cleanup after for host commands */
++		return 0;
++
++	/* sanity check */
++	counter = TFD_CTL_COUNT_GET(le32_to_cpu(bd->control_flags));
++	if (counter > NUM_TFD_CHUNKS) {
++		IWL_ERROR("Too many chunks: %i\n", counter);
++		/* @todo issue fatal error, it is quite serious situation */
++		return 0;
++	}
++
++	/* unmap chunks if any */
++
++	for (i = 1; i < counter; i++) {
++		pci_unmap_single(dev, le32_to_cpu(bd->pa[i].addr),
++				 le32_to_cpu(bd->pa[i].len), PCI_DMA_TODEVICE);
++		if (txq->txb[txq->q.last_used].skb[0]) {
++			struct sk_buff *skb = txq->txb[txq->q.last_used].skb[0];
++			if (txq->txb[txq->q.last_used].skb[0]) {
++				/* Can be called from interrupt context */
++				dev_kfree_skb_any(skb);
++				txq->txb[txq->q.last_used].skb[0] = NULL;
++			}
++		}
++	}
++	return 0;
++}
++
++u8 iwl_hw_find_station(struct iwl_priv *priv, const u8 *addr)
++{
++	int i;
++	int ret = IWL_INVALID_STATION;
++	unsigned long flags;
++
++	spin_lock_irqsave(&priv->sta_lock, flags);
++	for (i = IWL_STA_ID; i < priv->hw_setting.max_stations; i++)
++		if ((priv->stations[i].used) &&
++		    (!compare_ether_addr
++		     (priv->stations[i].sta.sta.addr, addr))) {
++			ret = i;
++			goto out;
++		}
++
++	IWL_DEBUG_INFO("can not find STA " MAC_FMT " (total %d)\n",
++		       MAC_ARG(addr), priv->num_stations);
++ out:
++	spin_unlock_irqrestore(&priv->sta_lock, flags);
++	return ret;
++}
++
++/**
++ * iwl_hw_build_tx_cmd_rate - Add rate portion to TX_CMD:
++ *
++*/
++void iwl_hw_build_tx_cmd_rate(struct iwl_priv *priv,
++			      struct iwl_cmd *cmd,
++			      struct ieee80211_tx_control *ctrl,
++			      struct ieee80211_hdr *hdr, int sta_id, int tx_id)
++{
++	unsigned long flags;
++	u16 rate_index = min(ctrl->tx_rate & 0xffff, IWL_RATE_COUNT - 1);
++	u16 rate_mask;
++	int rate;
++	u8 rts_retry_limit;
++	u8 data_retry_limit;
++	__le32 tx_flags;
++	u16 fc = le16_to_cpu(hdr->frame_control);
++
++	rate = iwl_rates[rate_index].plcp;
++	tx_flags = cmd->cmd.tx.tx_flags;
++
++	/* We need to figure out how to get the sta->supp_rates while
++	 * in this running context; perhaps encoding into ctrl->tx_rate? */
++	rate_mask = IWL_RATES_MASK;
++
++	spin_lock_irqsave(&priv->sta_lock, flags);
++
++	priv->stations[sta_id].current_rate.rate_n_flags = rate;
++
++	if ((priv->iw_mode == IEEE80211_IF_TYPE_IBSS) &&
++	    (sta_id != IWL3945_BROADCAST_ID) &&
++		(sta_id != IWL_MULTICAST_ID))
++		priv->stations[IWL_STA_ID].current_rate.rate_n_flags = rate;
++
++	spin_unlock_irqrestore(&priv->sta_lock, flags);
++
++	if (tx_id >= IWL_CMD_QUEUE_NUM)
++		rts_retry_limit = 3;
++	else
++		rts_retry_limit = 7;
++
++	if (ieee80211_is_probe_response(fc)) {
++		data_retry_limit = 3;
++		if (data_retry_limit < rts_retry_limit)
++			rts_retry_limit = data_retry_limit;
++	} else
++		data_retry_limit = IWL_DEFAULT_TX_RETRY;
++
++	if (priv->data_retry_limit != -1)
++		data_retry_limit = priv->data_retry_limit;
++
++	if ((fc & IEEE80211_FCTL_FTYPE) == IEEE80211_FTYPE_MGMT) {
++		switch (fc & IEEE80211_FCTL_STYPE) {
++		case IEEE80211_STYPE_AUTH:
++		case IEEE80211_STYPE_DEAUTH:
++		case IEEE80211_STYPE_ASSOC_REQ:
++		case IEEE80211_STYPE_REASSOC_REQ:
++			if (tx_flags & TX_CMD_FLG_RTS_MSK) {
++				tx_flags &= ~TX_CMD_FLG_RTS_MSK;
++				tx_flags |= TX_CMD_FLG_CTS_MSK;
++			}
++			break;
++		default:
++			break;
++		}
++	}
++
++	cmd->cmd.tx.rts_retry_limit = rts_retry_limit;
++	cmd->cmd.tx.data_retry_limit = data_retry_limit;
++	cmd->cmd.tx.rate = rate;
++	cmd->cmd.tx.tx_flags = tx_flags;
++
++	/* OFDM */
++	cmd->cmd.tx.supp_rates[0] = rate_mask & IWL_OFDM_RATES_MASK;
++
++	/* CCK */
++	cmd->cmd.tx.supp_rates[1] = (rate_mask >> 8) & 0xF;
++
++	IWL_DEBUG_RATE("Tx sta id: %d, rate: %d (plcp), flags: 0x%4X "
++		       "cck/ofdm mask: 0x%x/0x%x\n", sta_id,
++		       cmd->cmd.tx.rate, le32_to_cpu(cmd->cmd.tx.tx_flags),
++		       cmd->cmd.tx.supp_rates[1], cmd->cmd.tx.supp_rates[0]);
++}
++
++u8 iwl3945_sync_sta(struct iwl_priv *priv, int sta_id, u16 tx_rate, u8 flags)
++{
++	unsigned long flags_spin;
++	struct iwl_station_entry *station;
++
++	if (sta_id == IWL_INVALID_STATION)
++		return IWL_INVALID_STATION;
++
++	spin_lock_irqsave(&priv->sta_lock, flags_spin);
++	station = &priv->stations[sta_id];
++
++	station->sta.sta.modify_mask = STA_MODIFY_TX_RATE_MSK;
++	station->sta.rate_n_flags = cpu_to_le16(tx_rate);
++	station->current_rate.rate_n_flags = tx_rate;
++	station->sta.mode = STA_CONTROL_MODIFY_MSK;
++
++	spin_unlock_irqrestore(&priv->sta_lock, flags_spin);
++
++	iwl_send_add_station(priv, &station->sta, flags);
++	IWL_DEBUG_RATE("SCALE sync station %d to rate %d\n",
++			sta_id, tx_rate);
++	return sta_id;
++}
++
++void iwl_hw_card_show_info(struct iwl_priv *priv)
++{
++	IWL_DEBUG_INFO("3945ABG HW Version %u.%u.%u\n",
++		       ((priv->eeprom.board_revision >> 8) & 0x0F),
++		       ((priv->eeprom.board_revision >> 8) >> 4),
++		       (priv->eeprom.board_revision & 0x00FF));
++
++	IWL_DEBUG_INFO("3945ABG PBA Number %.*s\n",
++		       (int)sizeof(priv->eeprom.board_pba_number),
++		       priv->eeprom.board_pba_number);
++
++	IWL_DEBUG_INFO("EEPROM_ANTENNA_SWITCH_TYPE is 0x%02X\n",
++		       priv->eeprom.antenna_switch_type);
++}
++
++static int iwl3945_nic_set_pwr_src(struct iwl_priv *priv, int pwr_max)
++{
++	int rc;
++	unsigned long flags;
++
++	spin_lock_irqsave(&priv->lock, flags);
++	rc = iwl_grab_restricted_access(priv);
++	if (rc) {
++		spin_unlock_irqrestore(&priv->lock, flags);
++		return rc;
++	}
++
++	if (!pwr_max) {
++		u32 val;
++
++		rc = pci_read_config_dword(priv->pci_dev,
++				PCI_POWER_SOURCE, &val);
++		if (val & PCI_CFG_PMC_PME_FROM_D3COLD_SUPPORT) {
++			iwl_set_bits_mask_restricted_reg(priv, APMG_PS_CTRL_REG,
++					APMG_PS_CTRL_VAL_PWR_SRC_VAUX,
++					~APMG_PS_CTRL_MSK_PWR_SRC);
++			iwl_release_restricted_access(priv);
++
++			iwl_poll_bit(priv, CSR_GPIO_IN,
++				     CSR_GPIO_IN_VAL_VAUX_PWR_SRC,
++				     CSR_GPIO_IN_BIT_AUX_POWER, 5000);
++		} else
++			iwl_release_restricted_access(priv);
++	} else {
++		iwl_set_bits_mask_restricted_reg(priv, APMG_PS_CTRL_REG,
++				APMG_PS_CTRL_VAL_PWR_SRC_VMAIN,
++				~APMG_PS_CTRL_MSK_PWR_SRC);
++
++		iwl_release_restricted_access(priv);
++		iwl_poll_bit(priv, CSR_GPIO_IN, CSR_GPIO_IN_VAL_VMAIN_PWR_SRC,
++			     CSR_GPIO_IN_BIT_AUX_POWER, 5000);	/* uS */
++	}
++	spin_unlock_irqrestore(&priv->lock, flags);
++
++	return rc;
++}
++
++static int iwl3945_rx_init(struct iwl_priv *priv, struct iwl_rx_queue *rxq)
++{
++	int rc;
++	unsigned long flags;
++
++	spin_lock_irqsave(&priv->lock, flags);
++	rc = iwl_grab_restricted_access(priv);
++	if (rc) {
++		spin_unlock_irqrestore(&priv->lock, flags);
++		return rc;
++	}
++
++	iwl_write_restricted(priv, FH_RCSR_RBD_BASE(0), rxq->dma_addr);
++	iwl_write_restricted(priv, FH_RCSR_RPTR_ADDR(0),
++			     priv->hw_setting.shared_phys +
++			     offsetof(struct iwl_shared, rx_read_ptr[0]));
++	iwl_write_restricted(priv, FH_RCSR_WPTR(0), 0);
++	iwl_write_restricted(priv, FH_RCSR_CONFIG(0),
++		ALM_FH_RCSR_RX_CONFIG_REG_VAL_DMA_CHNL_EN_ENABLE |
++		ALM_FH_RCSR_RX_CONFIG_REG_VAL_RDRBD_EN_ENABLE |
++		ALM_FH_RCSR_RX_CONFIG_REG_BIT_WR_STTS_EN |
++		ALM_FH_RCSR_RX_CONFIG_REG_VAL_MAX_FRAG_SIZE_128 |
++		(RX_QUEUE_SIZE_LOG << ALM_FH_RCSR_RX_CONFIG_REG_POS_RBDC_SIZE) |
++		ALM_FH_RCSR_RX_CONFIG_REG_VAL_IRQ_DEST_INT_HOST |
++		(1 << ALM_FH_RCSR_RX_CONFIG_REG_POS_IRQ_RBTH) |
++		ALM_FH_RCSR_RX_CONFIG_REG_VAL_MSG_MODE_FH);
++
++	/* fake read to flush all prev I/O */
++	iwl_read_restricted(priv, FH_RSSR_CTRL);
++
++	iwl_release_restricted_access(priv);
++	spin_unlock_irqrestore(&priv->lock, flags);
++
++	return 0;
++}
++
++static int iwl3945_tx_reset(struct iwl_priv *priv)
++{
++	int rc;
++	unsigned long flags;
++
++	spin_lock_irqsave(&priv->lock, flags);
++	rc = iwl_grab_restricted_access(priv);
++	if (rc) {
++		spin_unlock_irqrestore(&priv->lock, flags);
++		return rc;
++	}
++
++	/* bypass mode */
++	iwl_write_restricted_reg(priv, SCD_MODE_REG, 0x2);
++
++	/* RA 0 is active */
++	iwl_write_restricted_reg(priv, SCD_ARASTAT_REG, 0x01);
++
++	/* all 6 fifo are active */
++	iwl_write_restricted_reg(priv, SCD_TXFACT_REG, 0x3f);
++
++	iwl_write_restricted_reg(priv, SCD_SBYP_MODE_1_REG, 0x010000);
++	iwl_write_restricted_reg(priv, SCD_SBYP_MODE_2_REG, 0x030002);
++	iwl_write_restricted_reg(priv, SCD_TXF4MF_REG, 0x000004);
++	iwl_write_restricted_reg(priv, SCD_TXF5MF_REG, 0x000005);
++
++	iwl_write_restricted(priv, FH_TSSR_CBB_BASE,
++			     priv->hw_setting.shared_phys);
++
++	iwl_write_restricted(priv, FH_TSSR_MSG_CONFIG,
++		ALM_FH_TSSR_TX_MSG_CONFIG_REG_VAL_SNOOP_RD_TXPD_ON |
++		ALM_FH_TSSR_TX_MSG_CONFIG_REG_VAL_ORDER_RD_TXPD_ON |
++		ALM_FH_TSSR_TX_MSG_CONFIG_REG_VAL_MAX_FRAG_SIZE_128B |
++		ALM_FH_TSSR_TX_MSG_CONFIG_REG_VAL_SNOOP_RD_TFD_ON |
++		ALM_FH_TSSR_TX_MSG_CONFIG_REG_VAL_ORDER_RD_CBB_ON |
++		ALM_FH_TSSR_TX_MSG_CONFIG_REG_VAL_ORDER_RSP_WAIT_TH |
++		ALM_FH_TSSR_TX_MSG_CONFIG_REG_VAL_RSP_WAIT_TH);
++
++	iwl_release_restricted_access(priv);
++	spin_unlock_irqrestore(&priv->lock, flags);
++
++	return 0;
++}
++
++/**
++ * iwl3945_txq_ctx_reset - Reset TX queue context
++ *
++ * Destroys all DMA structures and initialize them again
++ */
++static int iwl3945_txq_ctx_reset(struct iwl_priv *priv)
++{
++	int rc;
++	int txq_id, slots_num;
++
++	iwl_hw_txq_ctx_free(priv);
++
++	/* Tx CMD queue */
++	rc = iwl3945_tx_reset(priv);
++	if (rc)
++		goto error;
++
++	/* Tx queue(s) */
++	for (txq_id = 0; txq_id < TFD_QUEUE_MAX; txq_id++) {
++		slots_num = (txq_id == IWL_CMD_QUEUE_NUM) ?
++				TFD_CMD_SLOTS : TFD_TX_CMD_SLOTS;
++		rc = iwl_tx_queue_init(priv, &priv->txq[txq_id], slots_num,
++				txq_id);
++		if (rc) {
++			IWL_ERROR("Tx %d queue init failed\n", txq_id);
++			goto error;
++		}
++	}
++
++	return rc;
++
++ error:
++	iwl_hw_txq_ctx_free(priv);
++	return rc;
++}
++
++int iwl_hw_nic_init(struct iwl_priv *priv)
++{
++	u8 rev_id;
++	int rc;
++	unsigned long flags;
++	struct iwl_rx_queue *rxq = &priv->rxq;
++
++	iwl_power_init_handle(priv);
++
++	spin_lock_irqsave(&priv->lock, flags);
++	iwl_set_bit(priv, CSR_ANA_PLL_CFG, (1 << 24));
++	iwl_set_bit(priv, CSR_GIO_CHICKEN_BITS,
++		    CSR_GIO_CHICKEN_BITS_REG_BIT_L1A_NO_L0S_RX);
++
++	iwl_set_bit(priv, CSR_GP_CNTRL, CSR_GP_CNTRL_REG_FLAG_INIT_DONE);
++	rc = iwl_poll_bit(priv, CSR_GP_CNTRL,
++			  CSR_GP_CNTRL_REG_FLAG_MAC_CLOCK_READY,
++			  CSR_GP_CNTRL_REG_FLAG_MAC_CLOCK_READY, 25000);
++	if (rc < 0) {
++		spin_unlock_irqrestore(&priv->lock, flags);
++		IWL_DEBUG_INFO("Failed to init the card\n");
++		return rc;
++	}
++
++	rc = iwl_grab_restricted_access(priv);
++	if (rc) {
++		spin_unlock_irqrestore(&priv->lock, flags);
++		return rc;
++	}
++	iwl_write_restricted_reg(priv, APMG_CLK_EN_REG,
++				 APMG_CLK_VAL_DMA_CLK_RQT |
++				 APMG_CLK_VAL_BSM_CLK_RQT);
++	udelay(20);
++	iwl_set_bits_restricted_reg(priv, APMG_PCIDEV_STT_REG,
++				    APMG_PCIDEV_STT_VAL_L1_ACT_DIS);
++	iwl_release_restricted_access(priv);
++	spin_unlock_irqrestore(&priv->lock, flags);
++
++	/* Determine HW type */
++	rc = pci_read_config_byte(priv->pci_dev, PCI_REVISION_ID, &rev_id);
++	if (rc)
++		return rc;
++	IWL_DEBUG_INFO("HW Revision ID = 0x%X\n", rev_id);
++
++	iwl3945_nic_set_pwr_src(priv, 1);
++	spin_lock_irqsave(&priv->lock, flags);
++
++	if (rev_id & PCI_CFG_REV_ID_BIT_RTP)
++		IWL_DEBUG_INFO("RTP type \n");
++	else if (rev_id & PCI_CFG_REV_ID_BIT_BASIC_SKU) {
++		IWL_DEBUG_INFO("ALM-MB type\n");
++		iwl_set_bit(priv, CSR_HW_IF_CONFIG_REG,
++			    CSR_HW_IF_CONFIG_REG_BIT_ALMAGOR_MB);
++	} else {
++		IWL_DEBUG_INFO("ALM-MM type\n");
++		iwl_set_bit(priv, CSR_HW_IF_CONFIG_REG,
++			    CSR_HW_IF_CONFIG_REG_BIT_ALMAGOR_MM);
++	}
++
++	spin_unlock_irqrestore(&priv->lock, flags);
++
++	/* Initialize the EEPROM */
++	rc = iwl_eeprom_init(priv);
++	if (rc)
++		return rc;
++
++	spin_lock_irqsave(&priv->lock, flags);
++	if (EEPROM_SKU_CAP_OP_MODE_MRC == priv->eeprom.sku_cap) {
++		IWL_DEBUG_INFO("SKU OP mode is mrc\n");
++		iwl_set_bit(priv, CSR_HW_IF_CONFIG_REG,
++			    CSR_HW_IF_CONFIG_REG_BIT_SKU_MRC);
++	} else
++		IWL_DEBUG_INFO("SKU OP mode is basic\n");
++
++	if ((priv->eeprom.board_revision & 0xF0) == 0xD0) {
++		IWL_DEBUG_INFO("3945ABG revision is 0x%X\n",
++			       priv->eeprom.board_revision);
++		iwl_set_bit(priv, CSR_HW_IF_CONFIG_REG,
++			    CSR_HW_IF_CONFIG_REG_BIT_BOARD_TYPE);
++	} else {
++		IWL_DEBUG_INFO("3945ABG revision is 0x%X\n",
++			       priv->eeprom.board_revision);
++		iwl_clear_bit(priv, CSR_HW_IF_CONFIG_REG,
++			      CSR_HW_IF_CONFIG_REG_BIT_BOARD_TYPE);
++	}
++
++	if (priv->eeprom.almgor_m_version <= 1) {
++		iwl_set_bit(priv, CSR_HW_IF_CONFIG_REG,
++			    CSR_HW_IF_CONFIG_REG_BITS_SILICON_TYPE_A);
++		IWL_DEBUG_INFO("Card M type A version is 0x%X\n",
++			       priv->eeprom.almgor_m_version);
++	} else {
++		IWL_DEBUG_INFO("Card M type B version is 0x%X\n",
++			       priv->eeprom.almgor_m_version);
++		iwl_set_bit(priv, CSR_HW_IF_CONFIG_REG,
++			    CSR_HW_IF_CONFIG_REG_BITS_SILICON_TYPE_B);
++	}
++	spin_unlock_irqrestore(&priv->lock, flags);
++
++	if (priv->eeprom.sku_cap & EEPROM_SKU_CAP_SW_RF_KILL_ENABLE)
++		IWL_DEBUG_RF_KILL("SW RF KILL supported in EEPROM.\n");
++
++	if (priv->eeprom.sku_cap & EEPROM_SKU_CAP_HW_RF_KILL_ENABLE)
++		IWL_DEBUG_RF_KILL("HW RF KILL supported in EEPROM.\n");
++
++	/* Allocate the RX queue, or reset if it is already allocated */
++	if (!rxq->bd) {
++		rc = iwl_rx_queue_alloc(priv);
++		if (rc) {
++			IWL_ERROR("Unable to initialize Rx queue\n");
++			return -ENOMEM;
++		}
++	} else
++		iwl_rx_queue_reset(priv, rxq);
++
++	iwl_rx_replenish(priv);
++
++	iwl3945_rx_init(priv, rxq);
++
++	spin_lock_irqsave(&priv->lock, flags);
++
++	/* Look at using this instead:
++	rxq->need_update = 1;
++	iwl_rx_queue_update_write_ptr(priv, rxq);
++	*/
++
++	rc = iwl_grab_restricted_access(priv);
++	if (rc) {
++		spin_unlock_irqrestore(&priv->lock, flags);
++		return rc;
++	}
++	iwl_write_restricted(priv, FH_RCSR_WPTR(0), rxq->write & ~7);
++	iwl_release_restricted_access(priv);
++
++	spin_unlock_irqrestore(&priv->lock, flags);
++
++	rc = iwl3945_txq_ctx_reset(priv);
++	if (rc)
++		return rc;
++
++	set_bit(STATUS_INIT, &priv->status);
++
++	return 0;
++}
++
++/**
++ * iwl_hw_txq_ctx_free - Free TXQ Context
++ *
++ * Destroy all TX DMA queues and structures
++ */
++void iwl_hw_txq_ctx_free(struct iwl_priv *priv)
++{
++	int txq_id;
++
++	/* Tx queues */
++	for (txq_id = 0; txq_id < TFD_QUEUE_MAX; txq_id++)
++		iwl_tx_queue_free(priv, &priv->txq[txq_id]);
++}
++
++void iwl_hw_txq_ctx_stop(struct iwl_priv *priv)
++{
++	int queue;
++	unsigned long flags;
++
++	spin_lock_irqsave(&priv->lock, flags);
++	if (iwl_grab_restricted_access(priv)) {
++		spin_unlock_irqrestore(&priv->lock, flags);
++		iwl_hw_txq_ctx_free(priv);
++		return;
++	}
++
++	/* stop SCD */
++	iwl_write_restricted_reg(priv, SCD_MODE_REG, 0);
++
++	/* reset TFD queues */
++	for (queue = TFD_QUEUE_MIN; queue < TFD_QUEUE_MAX; queue++) {
++		iwl_write_restricted(priv, FH_TCSR_CONFIG(queue), 0x0);
++		iwl_poll_restricted_bit(priv, FH_TSSR_TX_STATUS,
++				ALM_FH_TSSR_TX_STATUS_REG_MSK_CHNL_IDLE(queue),
++				1000);
++	}
++
++	iwl_release_restricted_access(priv);
++	spin_unlock_irqrestore(&priv->lock, flags);
++
++	iwl_hw_txq_ctx_free(priv);
++}
++
++int iwl_hw_nic_stop_master(struct iwl_priv *priv)
++{
++	int rc = 0;
++	u32 reg_val;
++	unsigned long flags;
++
++	spin_lock_irqsave(&priv->lock, flags);
++
++	/* set stop master bit */
++	iwl_set_bit(priv, CSR_RESET, CSR_RESET_REG_FLAG_STOP_MASTER);
++
++	reg_val = iwl_read32(priv, CSR_GP_CNTRL);
++
++	if (CSR_GP_CNTRL_REG_FLAG_MAC_POWER_SAVE ==
++	    (reg_val & CSR_GP_CNTRL_REG_MSK_POWER_SAVE_TYPE))
++		IWL_DEBUG_INFO("Card in power save, master is already "
++			       "stopped\n");
++	else {
++		rc = iwl_poll_bit(priv, CSR_RESET,
++				  CSR_RESET_REG_FLAG_MASTER_DISABLED,
++				  CSR_RESET_REG_FLAG_MASTER_DISABLED, 100);
++		if (rc < 0) {
++			spin_unlock_irqrestore(&priv->lock, flags);
++			return rc;
++		}
++	}
++
++	spin_unlock_irqrestore(&priv->lock, flags);
++	IWL_DEBUG_INFO("stop master\n");
++
++	return rc;
++}
++
++int iwl_hw_nic_reset(struct iwl_priv *priv)
++{
++	int rc;
++	unsigned long flags;
++
++	iwl_hw_nic_stop_master(priv);
++
++	spin_lock_irqsave(&priv->lock, flags);
++
++	iwl_set_bit(priv, CSR_RESET, CSR_RESET_REG_FLAG_SW_RESET);
++
++	rc = iwl_poll_bit(priv, CSR_GP_CNTRL,
++			  CSR_GP_CNTRL_REG_FLAG_MAC_CLOCK_READY,
++			  CSR_GP_CNTRL_REG_FLAG_MAC_CLOCK_READY, 25000);
++
++	rc = iwl_grab_restricted_access(priv);
++	if (!rc) {
++		iwl_write_restricted_reg(priv, APMG_CLK_CTRL_REG,
++					 APMG_CLK_VAL_BSM_CLK_RQT);
++
++		udelay(10);
++
++		iwl_set_bit(priv, CSR_GP_CNTRL,
++			    CSR_GP_CNTRL_REG_FLAG_INIT_DONE);
++
++		iwl_write_restricted_reg(priv, APMG_RTC_INT_MSK_REG, 0x0);
++		iwl_write_restricted_reg(priv, APMG_RTC_INT_STT_REG,
++					0xFFFFFFFF);
++
++		/* enable DMA */
++		iwl_write_restricted_reg(priv, APMG_CLK_EN_REG,
++					 APMG_CLK_VAL_DMA_CLK_RQT |
++					 APMG_CLK_VAL_BSM_CLK_RQT);
++		udelay(10);
++
++		iwl_set_bits_restricted_reg(priv, APMG_PS_CTRL_REG,
++				APMG_PS_CTRL_VAL_RESET_REQ);
++		udelay(5);
++		iwl_clear_bits_restricted_reg(priv, APMG_PS_CTRL_REG,
++				APMG_PS_CTRL_VAL_RESET_REQ);
++		iwl_release_restricted_access(priv);
++	}
++
++	/* Clear the 'host command active' bit... */
++	clear_bit(STATUS_HCMD_ACTIVE, &priv->status);
++
++	wake_up_interruptible(&priv->wait_command_queue);
++	spin_unlock_irqrestore(&priv->lock, flags);
++
++	return rc;
++}
++
++/**
++ * iwl_hw_reg_adjust_power_by_temp - return index delta into power gain settings table
++ */
++static int iwl_hw_reg_adjust_power_by_temp(int new_reading, int old_reading)
++{
++	return (new_reading - old_reading) * (-11) / 100;
++}
++
++/**
++ * iwl_hw_reg_temp_out_of_range - Keep temperature in sane range
++ */
++static inline int iwl_hw_reg_temp_out_of_range(int temperature)
++{
++	return (((temperature < -260) || (temperature > 25)) ? 1 : 0);
++}
++
++int iwl_hw_get_temperature(struct iwl_priv *priv)
++{
++	return iwl_read32(priv, CSR_UCODE_DRV_GP2);
++}
++
++/**
++ * iwl_hw_reg_txpower_get_temperature - get current temperature by reading from NIC
++ */
++static int iwl_hw_reg_txpower_get_temperature(struct iwl_priv *priv)
++{
++	int temperature;
++
++	temperature = iwl_hw_get_temperature(priv);
++
++	/* driver's okay range is -260 to +25.
++	 *   human readable okay range is 0 to +285 */
++	IWL_DEBUG_INFO("Temperature: %d\n", temperature + IWL_TEMP_CONVERT);
++
++	/* handle insane temp reading */
++	if (iwl_hw_reg_temp_out_of_range(temperature)) {
++		IWL_ERROR("Error bad temperature value  %d\n", temperature);
++
++		/* if really really hot(?),
++		 *   substitute the 3rd band/group's temp measured at factory */
++		if (priv->last_temperature > 100)
++			temperature = priv->eeprom.groups[2].temperature;
++		else /* else use most recent "sane" value from driver */
++			temperature = priv->last_temperature;
++	}
++
++	return temperature;	/* raw, not "human readable" */
++}
++
++/* Adjust Txpower only if temperature variance is greater than threshold.
++ *
++ * Both are lower than older versions' 9 degrees */
++#define IWL_TEMPERATURE_LIMIT_TIMER   6
++
++/**
++ * is_temp_calib_needed - determines if new calibration is needed
++ *
++ * records new temperature in tx_mgr->temperature.
++ * replaces tx_mgr->last_temperature *only* if calib needed
++ *    (assumes caller will actually do the calibration!). */
++static int is_temp_calib_needed(struct iwl_priv *priv)
++{
++	int temp_diff;
++
++	priv->temperature = iwl_hw_reg_txpower_get_temperature(priv);
++	temp_diff = priv->temperature - priv->last_temperature;
++
++	/* get absolute value */
++	if (temp_diff < 0) {
++		IWL_DEBUG_POWER("Getting cooler, delta %d,\n", temp_diff);
++		temp_diff = -temp_diff;
++	} else if (temp_diff == 0)
++		IWL_DEBUG_POWER("Same temp,\n");
++	else
++		IWL_DEBUG_POWER("Getting warmer, delta %d,\n", temp_diff);
++
++	/* if we don't need calibration, *don't* update last_temperature */
++	if (temp_diff < IWL_TEMPERATURE_LIMIT_TIMER) {
++		IWL_DEBUG_POWER("Timed thermal calib not needed\n");
++		return 0;
++	}
++
++	IWL_DEBUG_POWER("Timed thermal calib needed\n");
++
++	/* assume that caller will actually do calib ...
++	 *   update the "last temperature" value */
++	priv->last_temperature = priv->temperature;
++	return 1;
++}
++
++#define IWL_MAX_GAIN_ENTRIES 78
++#define IWL_CCK_FROM_OFDM_POWER_DIFF  -5
++#define IWL_CCK_FROM_OFDM_INDEX_DIFF (10)
++
++/* radio and DSP power table, each step is 1/2 dB.
++ * 1st number is for RF analog gain, 2nd number is for DSP pre-DAC gain. */
++static struct iwl_tx_power power_gain_table[2][IWL_MAX_GAIN_ENTRIES] = {
++	{
++	 {251, 127},		/* 2.4 GHz, highest power */
++	 {251, 127},
++	 {251, 127},
++	 {251, 127},
++	 {251, 125},
++	 {251, 110},
++	 {251, 105},
++	 {251, 98},
++	 {187, 125},
++	 {187, 115},
++	 {187, 108},
++	 {187, 99},
++	 {243, 119},
++	 {243, 111},
++	 {243, 105},
++	 {243, 97},
++	 {243, 92},
++	 {211, 106},
++	 {211, 100},
++	 {179, 120},
++	 {179, 113},
++	 {179, 107},
++	 {147, 125},
++	 {147, 119},
++	 {147, 112},
++	 {147, 106},
++	 {147, 101},
++	 {147, 97},
++	 {147, 91},
++	 {115, 107},
++	 {235, 121},
++	 {235, 115},
++	 {235, 109},
++	 {203, 127},
++	 {203, 121},
++	 {203, 115},
++	 {203, 108},
++	 {203, 102},
++	 {203, 96},
++	 {203, 92},
++	 {171, 110},
++	 {171, 104},
++	 {171, 98},
++	 {139, 116},
++	 {227, 125},
++	 {227, 119},
++	 {227, 113},
++	 {227, 107},
++	 {227, 101},
++	 {227, 96},
++	 {195, 113},
++	 {195, 106},
++	 {195, 102},
++	 {195, 95},
++	 {163, 113},
++	 {163, 106},
++	 {163, 102},
++	 {163, 95},
++	 {131, 113},
++	 {131, 106},
++	 {131, 102},
++	 {131, 95},
++	 {99, 113},
++	 {99, 106},
++	 {99, 102},
++	 {99, 95},
++	 {67, 113},
++	 {67, 106},
++	 {67, 102},
++	 {67, 95},
++	 {35, 113},
++	 {35, 106},
++	 {35, 102},
++	 {35, 95},
++	 {3, 113},
++	 {3, 106},
++	 {3, 102},
++	 {3, 95} },		/* 2.4 GHz, lowest power */
++	{
++	 {251, 127},		/* 5.x GHz, highest power */
++	 {251, 120},
++	 {251, 114},
++	 {219, 119},
++	 {219, 101},
++	 {187, 113},
++	 {187, 102},
++	 {155, 114},
++	 {155, 103},
++	 {123, 117},
++	 {123, 107},
++	 {123, 99},
++	 {123, 92},
++	 {91, 108},
++	 {59, 125},
++	 {59, 118},
++	 {59, 109},
++	 {59, 102},
++	 {59, 96},
++	 {59, 90},
++	 {27, 104},
++	 {27, 98},
++	 {27, 92},
++	 {115, 118},
++	 {115, 111},
++	 {115, 104},
++	 {83, 126},
++	 {83, 121},
++	 {83, 113},
++	 {83, 105},
++	 {83, 99},
++	 {51, 118},
++	 {51, 111},
++	 {51, 104},
++	 {51, 98},
++	 {19, 116},
++	 {19, 109},
++	 {19, 102},
++	 {19, 98},
++	 {19, 93},
++	 {171, 113},
++	 {171, 107},
++	 {171, 99},
++	 {139, 120},
++	 {139, 113},
++	 {139, 107},
++	 {139, 99},
++	 {107, 120},
++	 {107, 113},
++	 {107, 107},
++	 {107, 99},
++	 {75, 120},
++	 {75, 113},
++	 {75, 107},
++	 {75, 99},
++	 {43, 120},
++	 {43, 113},
++	 {43, 107},
++	 {43, 99},
++	 {11, 120},
++	 {11, 113},
++	 {11, 107},
++	 {11, 99},
++	 {131, 107},
++	 {131, 99},
++	 {99, 120},
++	 {99, 113},
++	 {99, 107},
++	 {99, 99},
++	 {67, 120},
++	 {67, 113},
++	 {67, 107},
++	 {67, 99},
++	 {35, 120},
++	 {35, 113},
++	 {35, 107},
++	 {35, 99},
++	 {3, 120} }		/* 5.x GHz, lowest power */
++};
++
++static inline u8 iwl_hw_reg_fix_power_index(int index)
++{
++	if (index < 0)
++		return 0;
++	if (index >= IWL_MAX_GAIN_ENTRIES)
++		return IWL_MAX_GAIN_ENTRIES - 1;
++	return (u8) index;
++}
++
++/* Kick off thermal recalibration check every 60 seconds */
++#define REG_RECALIB_PERIOD (60)
++
++/**
++ * iwl_hw_reg_set_scan_power - Set Tx power for scan probe requests
++ *
++ * Set (in our channel info database) the direct scan Tx power for 1 Mbit (CCK)
++ * or 6 Mbit (OFDM) rates.
++ */
++static void iwl_hw_reg_set_scan_power(struct iwl_priv *priv, u32 scan_tbl_index,
++			       s32 rate_index, const s8 *clip_pwrs,
++			       struct iwl_channel_info *ch_info,
++			       int band_index)
++{
++	struct iwl_scan_power_info *scan_power_info;
++	s8 power;
++	u8 power_index;
++
++	scan_power_info = &ch_info->scan_pwr_info[scan_tbl_index];
++
++	/* use this channel group's 6Mbit clipping/saturation pwr,
++	 *   but cap at regulatory scan power restriction (set during init
++	 *   based on eeprom channel data) for this channel.  */
++	power = min(ch_info->scan_power, clip_pwrs[IWL_RATE_6M_INDEX]);
++
++	/* further limit to user's max power preference.
++	 * FIXME:  Other spectrum management power limitations do not
++	 *   seem to apply?? */
++	power = min(power, priv->user_txpower_limit);
++	scan_power_info->requested_power = power;
++
++	/* find difference between new scan *power* and current "normal"
++	 *   Tx *power* for 6Mb.  Use this difference (x2) to adjust the
++	 *   current "normal" temperature-compensated Tx power *index* for
++	 *   this rate (1Mb or 6Mb) to yield new temp-compensated scan power
++	 *   *index*. */
++	power_index = ch_info->power_info[rate_index].power_table_index
++	    - (power - ch_info->power_info
++	       [IWL_RATE_6M_INDEX].requested_power) * 2;
++
++	/* store reference index that we use when adjusting *all* scan
++	 *   powers.  So we can accommodate user (all channel) or spectrum
++	 *   management (single channel) power changes "between" temperature
++	 *   feedback compensation procedures.
++	 * don't force fit this reference index into gain table; it may be a
++	 *   negative number.  This will help avoid errors when we're at
++	 *   the lower bounds (highest gains, for warmest temperatures)
++	 *   of the table. */
++
++	/* don't exceed table bounds for "real" setting */
++	power_index = iwl_hw_reg_fix_power_index(power_index);
++
++	scan_power_info->power_table_index = power_index;
++	scan_power_info->tpc.tx_gain =
++	    power_gain_table[band_index][power_index].tx_gain;
++	scan_power_info->tpc.dsp_atten =
++	    power_gain_table[band_index][power_index].dsp_atten;
++}
++
++/**
++ * iwl_hw_reg_send_txpower - fill in Tx Power command with gain settings
++ *
++ * Configures power settings for all rates for the current channel,
++ * using values from channel info struct, and send to NIC
++ */
++int iwl_hw_reg_send_txpower(struct iwl_priv *priv)
++{
++	int rate_idx;
++	const struct iwl_channel_info *ch_info = NULL;
++	struct iwl_txpowertable_cmd txpower = {
++		.channel = priv->active_rxon.channel,
++	};
++
++	txpower.band = (priv->phymode == MODE_IEEE80211A) ? 0 : 1;
++	ch_info = iwl_get_channel_info(priv,
++				       priv->phymode,
++				       le16_to_cpu(priv->active_rxon.channel));
++	if (!ch_info) {
++		IWL_ERROR
++		    ("Failed to get channel info for channel %d [%d]\n",
++		     le16_to_cpu(priv->active_rxon.channel), priv->phymode);
++		return -EINVAL;
++	}
++
++	if (!is_channel_valid(ch_info)) {
++		IWL_DEBUG_POWER("Not calling TX_PWR_TABLE_CMD on "
++				"non-Tx channel.\n");
++		return 0;
++	}
++
++	/* fill cmd with power settings for all rates for current channel */
++	for (rate_idx = 0; rate_idx < IWL_RATE_COUNT; rate_idx++) {
++		txpower.power[rate_idx].tpc = ch_info->power_info[rate_idx].tpc;
++		txpower.power[rate_idx].rate = iwl_rates[rate_idx].plcp;
++
++		IWL_DEBUG_POWER("ch %d:%d rf %d dsp %3d rate code 0x%02x\n",
++				le16_to_cpu(txpower.channel),
++				txpower.band,
++				txpower.power[rate_idx].tpc.tx_gain,
++				txpower.power[rate_idx].tpc.dsp_atten,
++				txpower.power[rate_idx].rate);
++	}
++
++	return iwl_send_cmd_pdu(priv, REPLY_TX_PWR_TABLE_CMD,
++				sizeof(struct iwl_txpowertable_cmd), &txpower);
++
++}
++
++/**
++ * iwl_hw_reg_set_new_power - Configures power tables at new levels
++ * @ch_info: Channel to update.  Uses power_info.requested_power.
++ *
++ * Replace requested_power and base_power_index ch_info fields for
++ * one channel.
++ *
++ * Called if user or spectrum management changes power preferences.
++ * Takes into account h/w and modulation limitations (clip power).
++ *
++ * This does *not* send anything to NIC, just sets up ch_info for one channel.
++ *
++ * NOTE: reg_compensate_for_temperature_dif() *must* be run after this to
++ *	 properly fill out the scan powers, and actual h/w gain settings,
++ *	 and send changes to NIC
++ */
++static int iwl_hw_reg_set_new_power(struct iwl_priv *priv,
++			     struct iwl_channel_info *ch_info)
++{
++	struct iwl_channel_power_info *power_info;
++	int power_changed = 0;
++	int i;
++	const s8 *clip_pwrs;
++	int power;
++
++	/* Get this chnlgrp's rate-to-max/clip-powers table */
++	clip_pwrs = priv->clip_groups[ch_info->group_index].clip_powers;
++
++	/* Get this channel's rate-to-current-power settings table */
++	power_info = ch_info->power_info;
++
++	/* update OFDM Txpower settings */
++	for (i = IWL_FIRST_OFDM_RATE; i <= IWL_LAST_OFDM_RATE;
++	     i++, ++power_info) {
++		int delta_idx;
++
++		/* limit new power to be no more than h/w capability */
++		power = min(ch_info->curr_txpow, clip_pwrs[i]);
++		if (power == power_info->requested_power)
++			continue;
++
++		/* find difference between old and new requested powers,
++		 *    update base (non-temp-compensated) power index */
++		delta_idx = (power - power_info->requested_power) * 2;
++		power_info->base_power_index -= delta_idx;
++
++		/* save new requested power value */
++		power_info->requested_power = power;
++
++		power_changed = 1;
++	}
++
++	/* update CCK Txpower settings, based on OFDM 12M setting ...
++	 *    ... all CCK power settings for a given channel are the *same*. */
++	if (power_changed) {
++		power =
++		    ch_info->power_info[IWL_RATE_12M_INDEX].
++		    requested_power + IWL_CCK_FROM_OFDM_POWER_DIFF;
++
++		/* do all CCK rates' iwl_channel_power_info structures */
++		for (i = IWL_FIRST_CCK_RATE; i <= IWL_LAST_CCK_RATE; i++) {
++			power_info->requested_power = power;
++			power_info->base_power_index =
++			    ch_info->power_info[IWL_RATE_12M_INDEX].
++			    base_power_index + IWL_CCK_FROM_OFDM_INDEX_DIFF;
++			++power_info;
++		}
++	}
++
++	return 0;
++}
++
++/**
++ * iwl_hw_reg_get_ch_txpower_limit - returns new power limit for channel
++ *
++ * NOTE: Returned power limit may be less (but not more) than requested,
++ *	 based strictly on regulatory (eeprom and spectrum mgt) limitations
++ *	 (no consideration for h/w clipping limitations).
++ */
++static int iwl_hw_reg_get_ch_txpower_limit(struct iwl_channel_info *ch_info)
++{
++	s8 max_power;
++
++#if 0
++	/* if we're using TGd limits, use lower of TGd or EEPROM */
++	if (ch_info->tgd_data.max_power != 0)
++		max_power = min(ch_info->tgd_data.max_power,
++				ch_info->eeprom.max_power_avg);
++
++	/* else just use EEPROM limits */
++	else
++#endif
++		max_power = ch_info->eeprom.max_power_avg;
++
++	return min(max_power, ch_info->max_power_avg);
++}
++
++/**
++ * iwl_hw_reg_comp_txpower_temp - Compensate for temperature
++ *
++ * Compensate txpower settings of *all* channels for temperature.
++ * This only accounts for the difference between current temperature
++ *   and the factory calibration temperatures, and bases the new settings
++ *   on the channel's base_power_index.
++ *
++ * If RxOn is "associated", this sends the new Txpower to NIC!
++ */
++static int iwl_hw_reg_comp_txpower_temp(struct iwl_priv *priv)
++{
++	struct iwl_channel_info *ch_info = NULL;
++	int delta_index;
++	const s8 *clip_pwrs; /* array of h/w max power levels for each rate */
++	u8 a_band;
++	u8 rate_index;
++	u8 scan_tbl_index;
++	u8 i;
++	int ref_temp;
++	int temperature = priv->temperature;
++
++	/* set up new Tx power info for each and every channel, 2.4 and 5.x */
++	for (i = 0; i < priv->channel_count; i++) {
++		ch_info = &priv->channel_info[i];
++		a_band = is_channel_a_band(ch_info);
++
++		/* Get this chnlgrp's factory calibration temperature */
++		ref_temp = (s16)priv->eeprom.groups[ch_info->group_index].
++		    temperature;
++
++		/* get power index adjustment based on curr and factory
++		 * temps */
++		delta_index = iwl_hw_reg_adjust_power_by_temp(temperature,
++							      ref_temp);
++
++		/* set tx power value for all rates, OFDM and CCK */
++		for (rate_index = 0; rate_index < IWL_RATE_COUNT;
++		     rate_index++) {
++			int power_idx =
++			    ch_info->power_info[rate_index].base_power_index;
++
++			/* temperature compensate */
++			power_idx += delta_index;
++
++			/* stay within table range */
++			power_idx = iwl_hw_reg_fix_power_index(power_idx);
++			ch_info->power_info[rate_index].
++			    power_table_index = (u8) power_idx;
++			ch_info->power_info[rate_index].tpc =
++			    power_gain_table[a_band][power_idx];
++		}
++
++		/* Get this chnlgrp's rate-to-max/clip-powers table */
++		clip_pwrs = priv->clip_groups[ch_info->group_index].clip_powers;
++
++		/* set scan tx power, 1Mbit for CCK, 6Mbit for OFDM */
++		for (scan_tbl_index = 0;
++		     scan_tbl_index < IWL_NUM_SCAN_RATES; scan_tbl_index++) {
++			s32 actual_index = (scan_tbl_index == 0) ?
++			    IWL_RATE_1M_INDEX : IWL_RATE_6M_INDEX;
++			iwl_hw_reg_set_scan_power(priv, scan_tbl_index,
++					   actual_index, clip_pwrs,
++					   ch_info, a_band);
++		}
++	}
++
++	/* send Txpower command for current channel to ucode */
++	return iwl_hw_reg_send_txpower(priv);
++}
++
++int iwl_hw_reg_set_txpower(struct iwl_priv *priv, s8 power)
++{
++	struct iwl_channel_info *ch_info;
++	s8 max_power;
++	u8 a_band;
++	u8 i;
++
++	if (priv->user_txpower_limit == power) {
++		IWL_DEBUG_POWER("Requested Tx power same as current "
++				"limit: %ddBm.\n", power);
++		return 0;
++	}
++
++	IWL_DEBUG_POWER("Setting upper limit clamp to %ddBm.\n", power);
++	priv->user_txpower_limit = power;
++
++	/* set up new Tx powers for each and every channel, 2.4 and 5.x */
++
++	for (i = 0; i < priv->channel_count; i++) {
++		ch_info = &priv->channel_info[i];
++		a_band = is_channel_a_band(ch_info);
++
++		/* find minimum power of all user and regulatory constraints
++		 *    (does not consider h/w clipping limitations) */
++		max_power = iwl_hw_reg_get_ch_txpower_limit(ch_info);
++		max_power = min(power, max_power);
++		if (max_power != ch_info->curr_txpow) {
++			ch_info->curr_txpow = max_power;
++
++			/* this considers the h/w clipping limitations */
++			iwl_hw_reg_set_new_power(priv, ch_info);
++		}
++	}
++
++	/* update txpower settings for all channels,
++	 *   send to NIC if associated. */
++	is_temp_calib_needed(priv);
++	iwl_hw_reg_comp_txpower_temp(priv);
++
++	return 0;
++}
++
++/* will add 3945 channel switch cmd handling later */
++int iwl_hw_channel_switch(struct iwl_priv *priv, u16 channel)
++{
++	return 0;
++}
++
++/**
++ * iwl3945_reg_txpower_periodic -  called when time to check our temperature.
++ *
++ * -- reset periodic timer
++ * -- see if temp has changed enough to warrant re-calibration ... if so:
++ *     -- correct coeffs for temp (can reset temp timer)
++ *     -- save this temp as "last",
++ *     -- send new set of gain settings to NIC
++ * NOTE:  This should continue working, even when we're not associated,
++ *   so we can keep our internal table of scan powers current. */
++void iwl3945_reg_txpower_periodic(struct iwl_priv *priv)
++{
++	/* This will kick in the "brute force"
++	 * iwl_hw_reg_comp_txpower_temp() below */
++	if (!is_temp_calib_needed(priv))
++		goto reschedule;
++
++	/* Set up a new set of temp-adjusted TxPowers, send to NIC.
++	 * This is based *only* on current temperature,
++	 * ignoring any previous power measurements */
++	iwl_hw_reg_comp_txpower_temp(priv);
++
++ reschedule:
++	queue_delayed_work(priv->workqueue,
++			   &priv->thermal_periodic, REG_RECALIB_PERIOD * HZ);
++}
++
++void iwl3945_bg_reg_txpower_periodic(struct work_struct *work)
++{
++	struct iwl_priv *priv = container_of(work, struct iwl_priv,
++					     thermal_periodic.work);
++
++	if (test_bit(STATUS_EXIT_PENDING, &priv->status))
++		return;
++
++	mutex_lock(&priv->mutex);
++	iwl3945_reg_txpower_periodic(priv);
++	mutex_unlock(&priv->mutex);
++}
++
++/**
++ * iwl_hw_reg_get_ch_grp_index - find the channel-group index (0-4)
++ * 				   for the channel.
++ *
++ * This function is used when initializing channel-info structs.
++ *
++ * NOTE: These channel groups do *NOT* match the bands above!
++ *	 These channel groups are based on factory-tested channels;
++ *	 on A-band, EEPROM's "group frequency" entries represent the top
++ *	 channel in each group 1-4.  Group 5 All B/G channels are in group 0.
++ */
++static u16 iwl_hw_reg_get_ch_grp_index(struct iwl_priv *priv,
++				       const struct iwl_channel_info *ch_info)
++{
++	struct iwl_eeprom_txpower_group *ch_grp = &priv->eeprom.groups[0];
++	u8 group;
++	u16 group_index = 0;	/* based on factory calib frequencies */
++	u8 grp_channel;
++
++	/* Find the group index for the channel ... don't use index 1(?) */
++	if (is_channel_a_band(ch_info)) {
++		for (group = 1; group < 5; group++) {
++			grp_channel = ch_grp[group].group_channel;
++			if (ch_info->channel <= grp_channel) {
++				group_index = group;
++				break;
++			}
++		}
++		/* group 4 has a few channels *above* its factory cal freq */
++		if (group == 5)
++			group_index = 4;
++	} else
++		group_index = 0;	/* 2.4 GHz, group 0 */
++
++	IWL_DEBUG_POWER("Chnl %d mapped to grp %d\n", ch_info->channel,
++			group_index);
++	return group_index;
++}
++
++/**
++ * iwl_hw_reg_get_matched_power_index - Interpolate to get nominal index
++ *
++ * Interpolate to get nominal (i.e. at factory calibration temperature) index
++ *   into radio/DSP gain settings table for requested power.
++ */
++static int iwl_hw_reg_get_matched_power_index(struct iwl_priv *priv,
++				       s8 requested_power,
++				       s32 setting_index, s32 *new_index)
++{
++	const struct iwl_eeprom_txpower_group *chnl_grp = NULL;
++	s32 index0, index1;
++	s32 power = 2 * requested_power;
++	s32 i;
++	const struct iwl_eeprom_txpower_sample *samples;
++	s32 gains0, gains1;
++	s32 res;
++	s32 denominator;
++
++	chnl_grp = &priv->eeprom.groups[setting_index];
++	samples = chnl_grp->samples;
++	for (i = 0; i < 5; i++) {
++		if (power == samples[i].power) {
++			*new_index = samples[i].gain_index;
++			return 0;
++		}
++	}
++
++	if (power > samples[1].power) {
++		index0 = 0;
++		index1 = 1;
++	} else if (power > samples[2].power) {
++		index0 = 1;
++		index1 = 2;
++	} else if (power > samples[3].power) {
++		index0 = 2;
++		index1 = 3;
++	} else {
++		index0 = 3;
++		index1 = 4;
++	}
++
++	denominator = (s32) samples[index1].power - (s32) samples[index0].power;
++	if (denominator == 0)
++		return -EINVAL;
++	gains0 = (s32) samples[index0].gain_index * (1 << 19);
++	gains1 = (s32) samples[index1].gain_index * (1 << 19);
++	res = gains0 + (gains1 - gains0) *
++	    ((s32) power - (s32) samples[index0].power) / denominator +
++	    (1 << 18);
++	*new_index = res >> 19;
++	return 0;
++}
++
++static void iwl_hw_reg_init_channel_groups(struct iwl_priv *priv)
++{
++	u32 i;
++	s32 rate_index;
++	const struct iwl_eeprom_txpower_group *group;
++
++	IWL_DEBUG_POWER("Initializing factory calib info from EEPROM\n");
++
++	for (i = 0; i < IWL_NUM_TX_CALIB_GROUPS; i++) {
++		s8 *clip_pwrs;	/* table of power levels for each rate */
++		s8 satur_pwr;	/* saturation power for each chnl group */
++		group = &priv->eeprom.groups[i];
++
++		/* sanity check on factory saturation power value */
++		if (group->saturation_power < 40) {
++			IWL_WARNING("Error: saturation power is %d, "
++				    "less than minimum expected 40\n",
++				    group->saturation_power);
++			return;
++		}
++
++		/*
++		 * Derive requested power levels for each rate, based on
++		 *   hardware capabilities (saturation power for band).
++		 * Basic value is 3dB down from saturation, with further
++		 *   power reductions for highest 3 data rates.  These
++		 *   backoffs provide headroom for high rate modulation
++		 *   power peaks, without too much distortion (clipping).
++		 */
++		/* we'll fill in this array with h/w max power levels */
++		clip_pwrs = (s8 *) priv->clip_groups[i].clip_powers;
++
++		/* divide factory saturation power by 2 to find -3dB level */
++		satur_pwr = (s8) (group->saturation_power >> 1);
++
++		/* fill in channel group's nominal powers for each rate */
++		for (rate_index = 0;
++		     rate_index < IWL_RATE_COUNT; rate_index++, clip_pwrs++) {
++			switch (rate_index) {
++			case IWL_RATE_36M_INDEX:
++				if (i == 0)	/* B/G */
++					*clip_pwrs = satur_pwr;
++				else	/* A */
++					*clip_pwrs = satur_pwr - 5;
++				break;
++			case IWL_RATE_48M_INDEX:
++				if (i == 0)
++					*clip_pwrs = satur_pwr - 7;
++				else
++					*clip_pwrs = satur_pwr - 10;
++				break;
++			case IWL_RATE_54M_INDEX:
++				if (i == 0)
++					*clip_pwrs = satur_pwr - 9;
++				else
++					*clip_pwrs = satur_pwr - 12;
++				break;
++			default:
++				*clip_pwrs = satur_pwr;
++				break;
++			}
++		}
++	}
++}
++
++/**
++ * iwl3945_txpower_set_from_eeprom - Set channel power info based on EEPROM
++ *
++ * Second pass (during init) to set up priv->channel_info
++ *
++ * Set up Tx-power settings in our channel info database for each VALID
++ * (for this geo/SKU) channel, at all Tx data rates, based on eeprom values
++ * and current temperature.
++ *
++ * Since this is based on current temperature (at init time), these values may
++ * not be valid for very long, but it gives us a starting/default point,
++ * and allows us to active (i.e. using Tx) scan.
++ *
++ * This does *not* write values to NIC, just sets up our internal table.
++ */
++int iwl3945_txpower_set_from_eeprom(struct iwl_priv *priv)
++{
++	struct iwl_channel_info *ch_info = NULL;
++	struct iwl_channel_power_info *pwr_info;
++	int delta_index;
++	u8 rate_index;
++	u8 scan_tbl_index;
++	const s8 *clip_pwrs;	/* array of power levels for each rate */
++	u8 gain, dsp_atten;
++	s8 power;
++	u8 pwr_index, base_pwr_index, a_band;
++	u8 i;
++	int temperature;
++
++	/* save temperature reference,
++	 *   so we can determine next time to calibrate */
++	temperature = iwl_hw_reg_txpower_get_temperature(priv);
++	priv->last_temperature = temperature;
++
++	iwl_hw_reg_init_channel_groups(priv);
++
++	/* initialize Tx power info for each and every channel, 2.4 and 5.x */
++	for (i = 0, ch_info = priv->channel_info; i < priv->channel_count;
++	     i++, ch_info++) {
++		a_band = is_channel_a_band(ch_info);
++		if (!is_channel_valid(ch_info))
++			continue;
++
++		/* find this channel's channel group (*not* "band") index */
++		ch_info->group_index =
++			iwl_hw_reg_get_ch_grp_index(priv, ch_info);
++
++		/* Get this chnlgrp's rate->max/clip-powers table */
++		clip_pwrs = priv->clip_groups[ch_info->group_index].clip_powers;
++
++		/* calculate power index *adjustment* value according to
++		 *  diff between current temperature and factory temperature */
++		delta_index = iwl_hw_reg_adjust_power_by_temp(temperature,
++				priv->eeprom.groups[ch_info->group_index].
++				temperature);
++
++		IWL_DEBUG_POWER("Delta index for channel %d: %d [%d]\n",
++				ch_info->channel, delta_index, temperature +
++				IWL_TEMP_CONVERT);
++
++		/* set tx power value for all OFDM rates */
++		for (rate_index = 0; rate_index < IWL_OFDM_RATES;
++		     rate_index++) {
++			s32 power_idx;
++			int rc;
++
++			/* use channel group's clip-power table,
++			 *   but don't exceed channel's max power */
++			s8 pwr = min(ch_info->max_power_avg,
++				     clip_pwrs[rate_index]);
++
++			pwr_info = &ch_info->power_info[rate_index];
++
++			/* get base (i.e. at factory-measured temperature)
++			 *    power table index for this rate's power */
++			rc = iwl_hw_reg_get_matched_power_index(priv, pwr,
++							 ch_info->group_index,
++							 &power_idx);
++			if (rc) {
++				IWL_ERROR("Invalid power index\n");
++				return rc;
++			}
++			pwr_info->base_power_index = (u8) power_idx;
++
++			/* temperature compensate */
++			power_idx += delta_index;
++
++			/* stay within range of gain table */
++			power_idx = iwl_hw_reg_fix_power_index(power_idx);
++
++			/* fill 1 OFDM rate's iwl_channel_power_info struct */
++			pwr_info->requested_power = pwr;
++			pwr_info->power_table_index = (u8) power_idx;
++			pwr_info->tpc.tx_gain =
++			    power_gain_table[a_band][power_idx].tx_gain;
++			pwr_info->tpc.dsp_atten =
++			    power_gain_table[a_band][power_idx].dsp_atten;
++		}
++
++		/* set tx power for CCK rates, based on OFDM 12 Mbit settings*/
++		pwr_info = &ch_info->power_info[IWL_RATE_12M_INDEX];
++		power = pwr_info->requested_power +
++			IWL_CCK_FROM_OFDM_POWER_DIFF;
++		pwr_index = pwr_info->power_table_index +
++			IWL_CCK_FROM_OFDM_INDEX_DIFF;
++		base_pwr_index = pwr_info->base_power_index +
++			IWL_CCK_FROM_OFDM_INDEX_DIFF;
++
++		/* stay within table range */
++		pwr_index = iwl_hw_reg_fix_power_index(pwr_index);
++		gain = power_gain_table[a_band][pwr_index].tx_gain;
++		dsp_atten = power_gain_table[a_band][pwr_index].dsp_atten;
++
++		/* fill each CCK rate's iwl_channel_power_info structure
++		 * NOTE:  All CCK-rate Txpwrs are the same for a given chnl!
++		 * NOTE:  CCK rates start at end of OFDM rates! */
++		for (rate_index = IWL_OFDM_RATES;
++		     rate_index < IWL_RATE_COUNT; rate_index++) {
++			pwr_info = &ch_info->power_info[rate_index];
++			pwr_info->requested_power = power;
++			pwr_info->power_table_index = pwr_index;
++			pwr_info->base_power_index = base_pwr_index;
++			pwr_info->tpc.tx_gain = gain;
++			pwr_info->tpc.dsp_atten = dsp_atten;
++		}
++
++		/* set scan tx power, 1Mbit for CCK, 6Mbit for OFDM */
++		for (scan_tbl_index = 0;
++		     scan_tbl_index < IWL_NUM_SCAN_RATES; scan_tbl_index++) {
++			s32 actual_index = (scan_tbl_index == 0) ?
++				IWL_RATE_1M_INDEX : IWL_RATE_6M_INDEX;
++			iwl_hw_reg_set_scan_power(priv, scan_tbl_index,
++				actual_index, clip_pwrs, ch_info, a_band);
++		}
++	}
++
++	return 0;
++}
++
++int iwl_hw_rxq_stop(struct iwl_priv *priv)
++{
++	int rc;
++	unsigned long flags;
++
++	spin_lock_irqsave(&priv->lock, flags);
++	rc = iwl_grab_restricted_access(priv);
++	if (rc) {
++		spin_unlock_irqrestore(&priv->lock, flags);
++		return rc;
++	}
++
++	iwl_write_restricted(priv, FH_RCSR_CONFIG(0), 0);
++	rc = iwl_poll_restricted_bit(priv, FH_RSSR_STATUS, (1 << 24), 1000);
++	if (rc < 0)
++		IWL_ERROR("Can't stop Rx DMA.\n");
++
++	iwl_release_restricted_access(priv);
++	spin_unlock_irqrestore(&priv->lock, flags);
++
++	return 0;
++}
++
++int iwl_hw_tx_queue_init(struct iwl_priv *priv, struct iwl_tx_queue *txq)
++{
++	int rc;
++	unsigned long flags;
++	int txq_id = txq->q.id;
++
++	struct iwl_shared *shared_data = priv->hw_setting.shared_virt;
++
++	shared_data->tx_base_ptr[txq_id] = cpu_to_le32((u32)txq->q.dma_addr);
++
++	spin_lock_irqsave(&priv->lock, flags);
++	rc = iwl_grab_restricted_access(priv);
++	if (rc) {
++		spin_unlock_irqrestore(&priv->lock, flags);
++		return rc;
++	}
++	iwl_write_restricted(priv, FH_CBCC_CTRL(txq_id), 0);
++	iwl_write_restricted(priv, FH_CBCC_BASE(txq_id), 0);
++
++	iwl_write_restricted(priv, FH_TCSR_CONFIG(txq_id),
++		ALM_FH_TCSR_TX_CONFIG_REG_VAL_CIRQ_RTC_NOINT |
++		ALM_FH_TCSR_TX_CONFIG_REG_VAL_MSG_MODE_TXF |
++		ALM_FH_TCSR_TX_CONFIG_REG_VAL_CIRQ_HOST_IFTFD |
++		ALM_FH_TCSR_TX_CONFIG_REG_VAL_DMA_CREDIT_ENABLE_VAL |
++		ALM_FH_TCSR_TX_CONFIG_REG_VAL_DMA_CHNL_ENABLE);
++	iwl_release_restricted_access(priv);
++
++	/* fake read to flush all prev. writes */
++	iwl_read32(priv, FH_TSSR_CBB_BASE);
++	spin_unlock_irqrestore(&priv->lock, flags);
++
++	return 0;
++}
++
++int iwl_hw_get_rx_read(struct iwl_priv *priv)
++{
++	struct iwl_shared *shared_data = priv->hw_setting.shared_virt;
++
++	return le32_to_cpu(shared_data->rx_read_ptr[0]);
++}
++
++/**
++ * iwl3945_init_hw_rate_table - Initialize the hardware rate fallback table
++ */
++int iwl3945_init_hw_rate_table(struct iwl_priv *priv)
++{
++	int rc, i;
++	struct iwl_rate_scaling_cmd rate_cmd = {
++		.reserved = {0, 0, 0},
++	};
++	struct iwl_rate_scaling_info *table = rate_cmd.table;
++
++	for (i = 0; i < ARRAY_SIZE(iwl_rates); i++) {
++		table[i].rate_n_flags =
++			iwl_hw_set_rate_n_flags(iwl_rates[i].plcp, 0);
++		table[i].try_cnt = priv->retry_rate;
++		table[i].next_rate_index = iwl_get_prev_ieee_rate(i);
++	}
++
++	switch (priv->phymode) {
++	case MODE_IEEE80211A:
++		IWL_DEBUG_RATE("Select A mode rate scale\n");
++		/* If one of the following CCK rates is used,
++		 * have it fall back to the 6M OFDM rate */
++		for (i = IWL_FIRST_CCK_RATE; i <= IWL_LAST_CCK_RATE; i++)
++			table[i].next_rate_index = IWL_FIRST_OFDM_RATE;
++
++		/* Don't fall back to CCK rates */
++		table[IWL_RATE_12M_INDEX].next_rate_index = IWL_RATE_9M_INDEX;
++
++		/* Don't drop out of OFDM rates */
++		table[IWL_FIRST_OFDM_RATE].next_rate_index =
++		    IWL_FIRST_OFDM_RATE;
++		break;
++
++	case MODE_IEEE80211B:
++		IWL_DEBUG_RATE("Select B mode rate scale\n");
++		/* If an OFDM rate is used, have it fall back to the
++		 * 1M CCK rates */
++		for (i = IWL_FIRST_OFDM_RATE; i <= IWL_LAST_OFDM_RATE; i++)
++			table[i].next_rate_index = IWL_FIRST_CCK_RATE;
++
++		/* CCK shouldn't fall back to OFDM... */
++		table[IWL_RATE_11M_INDEX].next_rate_index = IWL_RATE_5M_INDEX;
++		break;
++
++	default:
++		IWL_DEBUG_RATE("Select G mode rate scale\n");
++		break;
++	}
++
++	/* Update the rate scaling for control frame Tx */
++	rate_cmd.table_id = 0;
++	rc = iwl_send_cmd_pdu(priv, REPLY_RATE_SCALE, sizeof(rate_cmd),
++			      &rate_cmd);
++	if (rc)
++		return rc;
++
++	/* Update the rate scaling for data frame Tx */
++	rate_cmd.table_id = 1;
++	return iwl_send_cmd_pdu(priv, REPLY_RATE_SCALE, sizeof(rate_cmd),
++				&rate_cmd);
++}
++
++int iwl_hw_set_hw_setting(struct iwl_priv *priv)
++{
++	memset((void *)&priv->hw_setting, 0,
++	       sizeof(struct iwl_driver_hw_info));
++
++	priv->hw_setting.shared_virt =
++	    pci_alloc_consistent(priv->pci_dev,
++				 sizeof(struct iwl_shared),
++				 &priv->hw_setting.shared_phys);
++
++	if (!priv->hw_setting.shared_virt) {
++		IWL_ERROR("failed to allocate pci memory\n");
++		mutex_unlock(&priv->mutex);
++		return -ENOMEM;
++	}
++
++	priv->hw_setting.ac_queue_count = AC_NUM;
++	priv->hw_setting.rx_buffer_size = IWL_RX_BUF_SIZE;
++	priv->hw_setting.tx_cmd_len = sizeof(struct iwl_tx_cmd);
++	priv->hw_setting.max_rxq_size = RX_QUEUE_SIZE;
++	priv->hw_setting.max_rxq_log = RX_QUEUE_SIZE_LOG;
++	priv->hw_setting.cck_flag = 0;
++	priv->hw_setting.max_stations = IWL3945_STATION_COUNT;
++	priv->hw_setting.bcast_sta_id = IWL3945_BROADCAST_ID;
++	return 0;
++}
++
++unsigned int iwl_hw_get_beacon_cmd(struct iwl_priv *priv,
++			  struct iwl_frame *frame, u8 rate)
++{
++	struct iwl_tx_beacon_cmd *tx_beacon_cmd;
++	unsigned int frame_size;
++
++	tx_beacon_cmd = (struct iwl_tx_beacon_cmd *)&frame->u;
++	memset(tx_beacon_cmd, 0, sizeof(*tx_beacon_cmd));
++
++	tx_beacon_cmd->tx.sta_id = IWL3945_BROADCAST_ID;
++	tx_beacon_cmd->tx.stop_time.life_time = TX_CMD_LIFE_TIME_INFINITE;
++
++	frame_size = iwl_fill_beacon_frame(priv,
++				tx_beacon_cmd->frame,
++				BROADCAST_ADDR,
++				sizeof(frame->u) - sizeof(*tx_beacon_cmd));
++
++	BUG_ON(frame_size > MAX_MPDU_SIZE);
++	tx_beacon_cmd->tx.len = cpu_to_le16((u16)frame_size);
++
++	tx_beacon_cmd->tx.rate = rate;
++	tx_beacon_cmd->tx.tx_flags = (TX_CMD_FLG_SEQ_CTL_MSK |
++				      TX_CMD_FLG_TSF_MSK);
++
++	/* supp_rates[0] == OFDM  */
++	tx_beacon_cmd->tx.supp_rates[0] = IWL_OFDM_BASIC_RATES_MASK;
++
++	/* supp_rates[1] == CCK
++	 *
++	 * NOTE:  IWL_*_RATES_MASK are not in the order that supp_rates
++	 * expects so we have to shift them around.
++	 *
++	 * supp_rates expects:
++	 * CCK rates are bit0..3
++	 *
++	 * However IWL_*_RATES_MASK has:
++	 * CCK rates are bit8..11
++	 */
++	tx_beacon_cmd->tx.supp_rates[1] =
++		(IWL_CCK_BASIC_RATES_MASK >> 8) & 0xF;
++
++	return (sizeof(struct iwl_tx_beacon_cmd) + frame_size);
++}
++
++void iwl_hw_rx_handler_setup(struct iwl_priv *priv)
++{
++	priv->rx_handlers[REPLY_3945_RX] = iwl3945_rx_reply_rx;
++}
++
++void iwl_hw_setup_deferred_work(struct iwl_priv *priv)
++{
++	INIT_DELAYED_WORK(&priv->thermal_periodic,
++			  iwl3945_bg_reg_txpower_periodic);
++}
++
++void iwl_hw_cancel_deferred_work(struct iwl_priv *priv)
++{
++	cancel_delayed_work(&priv->thermal_periodic);
++}
++
++struct pci_device_id iwl_hw_card_ids[] = {
++	{0x8086, 0x4222, PCI_ANY_ID, PCI_ANY_ID, 0, 0, 0},
++	{0x8086, 0x4227, PCI_ANY_ID, PCI_ANY_ID, 0, 0, 0},
++	{0}
++};
++
++inline int iwl_eeprom_aqcuire_semaphore(struct iwl_priv *priv)
++{
++	_iwl_clear_bit(priv, CSR_EEPROM_GP, CSR_EEPROM_GP_IF_OWNER_MSK);
++	return 0;
++}
++
++MODULE_DEVICE_TABLE(pci, iwl_hw_card_ids);
+diff --git a/drivers/net/wireless/iwl-3945.h b/drivers/net/wireless/iwl-3945.h
+new file mode 100644
+index 0000000..813902e
+--- /dev/null
++++ b/drivers/net/wireless/iwl-3945.h
+@@ -0,0 +1,41 @@
++/******************************************************************************
++ *
++ * Copyright(c) 2003 - 2007 Intel Corporation. All rights reserved.
++ *
++ * This program is free software; you can redistribute it and/or modify it
++ * under the terms of version 2 of the GNU General Public License as
++ * published by the Free Software Foundation.
++ *
++ * 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.,
++ * 51 Franklin Street, Fifth Floor, Boston, MA 02110, USA
++ *
++ * The full GNU General Public License is included in this distribution in the
++ * file called LICENSE.
++ *
++ * Contact Information:
++ * James P. Ketrenos <ipw2100-admin at linux.intel.com>
++ * Intel Corporation, 5200 N.E. Elam Young Parkway, Hillsboro, OR 97124-6497
++ *
++ *****************************************************************************/
++
++#ifndef __iwl_3945_h__
++#define __iwl_3945_h__
++
++/*
++ * Forward declare iwl-3945.c functions for iwl-base.c
++ */
++extern int iwl_eeprom_aqcuire_semaphore(struct iwl_priv *priv);
++extern __le32 iwl3945_get_antenna_flags(const struct iwl_priv *priv);
++extern int iwl3945_init_hw_rate_table(struct iwl_priv *priv);
++extern void iwl3945_reg_txpower_periodic(struct iwl_priv *priv);
++extern void iwl3945_bg_reg_txpower_periodic(struct work_struct *work);
++extern int iwl3945_txpower_set_from_eeprom(struct iwl_priv *priv);
++extern u8 iwl3945_sync_sta(struct iwl_priv *priv, int sta_id,
++		 u16 tx_rate, u8 flags);
++#endif
+diff --git a/drivers/net/wireless/iwl-4965-hw.h b/drivers/net/wireless/iwl-4965-hw.h
+new file mode 100644
+index 0000000..99a19ef
+--- /dev/null
++++ b/drivers/net/wireless/iwl-4965-hw.h
+@@ -0,0 +1,581 @@
++/******************************************************************************
++ *
++ * This file is provided under a dual BSD/GPLv2 license.  When using or
++ * redistributing this file, you may do so under either license.
++ *
++ * GPL LICENSE SUMMARY
++ *
++ * Copyright(c) 2005 - 2007 Intel Corporation. All rights reserved.
++ *
++ * This program is free software; you can redistribute it and/or modify
++ * it under the terms of version 2 of the GNU Geeral Public License as
++ * published by the Free Software Foundation.
++ *
++ * 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., 51 Franklin Street, Fifth Floor, Boston, MA 02110,
++ * USA
++ *
++ * The full GNU General Public License is included in this distribution
++ * in the file called LICENSE.GPL.
++ *
++ * Contact Information:
++ * James P. Ketrenos <ipw2100-admin at linux.intel.com>
++ * Intel Corporation, 5200 N.E. Elam Young Parkway, Hillsboro, OR 97124-6497
++ *
++ * BSD LICENSE
++ *
++ * Copyright(c) 2005 - 2007 Intel Corporation. All rights reserved.
++ * All rights reserved.
++ *
++ * Redistribution and use in source and binary forms, with or without
++ * modification, are permitted provided that the following conditions
++ * are met:
++ *
++ *  * Redistributions of source code must retain the above copyright
++ *    notice, this list of conditions and the following disclaimer.
++ *  * Redistributions in binary form must reproduce the above copyright
++ *    notice, this list of conditions and the following disclaimer in
++ *    the documentation and/or other materials provided with the
++ *    distribution.
++ *  * Neither the name Intel Corporation nor the names of its
++ *    contributors may be used to endorse or promote products derived
++ *    from this software without specific prior written permission.
++ *
++ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
++ * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
++ * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
++ * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
++ * OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
++ * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
++ * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
++ * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
++ * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
++ * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
++ * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
++ *
++ *****************************************************************************/
++
++#ifndef __iwl_4965_hw_h__
++#define __iwl_4965_hw_h__
++
++#define IWL_RX_BUF_SIZE (4 * 1024)
++#define IWL_MAX_BSM_SIZE BSM_SRAM_SIZE
++#define KDR_RTC_INST_UPPER_BOUND		(0x018000)
++#define KDR_RTC_DATA_UPPER_BOUND		(0x80A000)
++#define KDR_RTC_INST_SIZE    (KDR_RTC_INST_UPPER_BOUND - RTC_INST_LOWER_BOUND)
++#define KDR_RTC_DATA_SIZE    (KDR_RTC_DATA_UPPER_BOUND - RTC_DATA_LOWER_BOUND)
++
++#define IWL_MAX_INST_SIZE KDR_RTC_INST_SIZE
++#define IWL_MAX_DATA_SIZE KDR_RTC_DATA_SIZE
++
++static inline int iwl_hw_valid_rtc_data_addr(u32 addr)
++{
++	return (addr >= RTC_DATA_LOWER_BOUND) &&
++	       (addr < KDR_RTC_DATA_UPPER_BOUND);
++}
++
++/********************* START TXPOWER *****************************************/
++enum {
++	HT_IE_EXT_CHANNEL_NONE = 0,
++	HT_IE_EXT_CHANNEL_ABOVE,
++	HT_IE_EXT_CHANNEL_INVALID,
++	HT_IE_EXT_CHANNEL_BELOW,
++	HT_IE_EXT_CHANNEL_MAX
++};
++
++enum {
++	CALIB_CH_GROUP_1 = 0,
++	CALIB_CH_GROUP_2 = 1,
++	CALIB_CH_GROUP_3 = 2,
++	CALIB_CH_GROUP_4 = 3,
++	CALIB_CH_GROUP_5 = 4,
++	CALIB_CH_GROUP_MAX
++};
++
++/* Temperature calibration offset is 3% 0C in Kelvin */
++#define TEMPERATURE_CALIB_KELVIN_OFFSET 8
++#define TEMPERATURE_CALIB_A_VAL 259
++
++#define IWL_TX_POWER_TEMPERATURE_MIN  (263)
++#define IWL_TX_POWER_TEMPERATURE_MAX  (410)
++
++#define IWL_TX_POWER_TEMPERATURE_OUT_OF_RANGE(t) \
++	(((t) < IWL_TX_POWER_TEMPERATURE_MIN) || \
++	 ((t) > IWL_TX_POWER_TEMPERATURE_MAX))
++
++#define IWL_TX_POWER_ILLEGAL_TEMPERATURE (300)
++
++#define IWL_TX_POWER_TEMPERATURE_DIFFERENCE (2)
++
++#define IWL_TX_POWER_MIMO_REGULATORY_COMPENSATION (6)
++
++#define IWL_TX_POWER_TARGET_POWER_MIN       (0)	/* 0 dBm = 1 milliwatt */
++#define IWL_TX_POWER_TARGET_POWER_MAX      (16)	/* 16 dBm */
++
++/* timeout equivalent to 3 minutes */
++#define IWL_TX_POWER_TIMELIMIT_NOCALIB 1800000000
++
++#define IWL_TX_POWER_CCK_COMPENSATION (9)
++
++#define MIN_TX_GAIN_INDEX		(0)
++#define MIN_TX_GAIN_INDEX_52GHZ_EXT	(-9)
++#define MAX_TX_GAIN_INDEX_52GHZ		(98)
++#define MIN_TX_GAIN_52GHZ		(98)
++#define MAX_TX_GAIN_INDEX_24GHZ		(98)
++#define MIN_TX_GAIN_24GHZ		(98)
++#define MAX_TX_GAIN			(0)
++#define MAX_TX_GAIN_52GHZ_EXT		(-9)
++
++#define IWL_TX_POWER_DEFAULT_REGULATORY_24   (34)
++#define IWL_TX_POWER_DEFAULT_REGULATORY_52   (34)
++#define IWL_TX_POWER_REGULATORY_MIN          (0)
++#define IWL_TX_POWER_REGULATORY_MAX          (34)
++#define IWL_TX_POWER_DEFAULT_SATURATION_24   (38)
++#define IWL_TX_POWER_DEFAULT_SATURATION_52   (38)
++#define IWL_TX_POWER_SATURATION_MIN          (20)
++#define IWL_TX_POWER_SATURATION_MAX          (50)
++
++/* dv *0.4 = dt; so that 5 degrees temperature diff equals
++ * 12.5 in voltage diff */
++#define IWL_TX_TEMPERATURE_UPDATE_LIMIT 9
++
++#define IWL_INVALID_CHANNEL                 (0xffffffff)
++#define IWL_TX_POWER_REGITRY_BIT            (2)
++
++#define MIN_IWL_TX_POWER_CALIB_DUR          (100)
++#define IWL_CCK_FROM_OFDM_POWER_DIFF        (-5)
++#define IWL_CCK_FROM_OFDM_INDEX_DIFF (9)
++
++/* Number of entries in the gain table */
++#define POWER_GAIN_NUM_ENTRIES 78
++#define TX_POW_MAX_SESSION_NUM 5
++/*  timeout equivalent to 3 minutes */
++#define TX_IWL_TIMELIMIT_NOCALIB 1800000000
++
++/* Kedron TX_CALIB_STATES */
++#define IWL_TX_CALIB_STATE_SEND_TX        0x00000001
++#define IWL_TX_CALIB_WAIT_TX_RESPONSE     0x00000002
++#define IWL_TX_CALIB_ENABLED              0x00000004
++#define IWL_TX_CALIB_XVT_ON               0x00000008
++#define IWL_TX_CALIB_TEMPERATURE_CORRECT  0x00000010
++#define IWL_TX_CALIB_WORKING_WITH_XVT     0x00000020
++#define IWL_TX_CALIB_XVT_PERIODICAL       0x00000040
++
++#define NUM_IWL_TX_CALIB_SETTINS 5	/* Number of tx correction groups */
++
++#define IWL_MIN_POWER_IN_VP_TABLE 1	/* 0.5dBm multiplied by 2 */
++#define IWL_MAX_POWER_IN_VP_TABLE 40	/* 20dBm - multiplied by 2 (because
++					 * entries are for each 0.5dBm) */
++#define IWL_STEP_IN_VP_TABLE 1	/* 0.5dB - multiplied by 2 */
++#define IWL_NUM_POINTS_IN_VPTABLE \
++	(1 + IWL_MAX_POWER_IN_VP_TABLE - IWL_MIN_POWER_IN_VP_TABLE)
++
++#define MIN_TX_GAIN_INDEX         (0)
++#define MAX_TX_GAIN_INDEX_52GHZ   (98)
++#define MIN_TX_GAIN_52GHZ         (98)
++#define MAX_TX_GAIN_INDEX_24GHZ   (98)
++#define MIN_TX_GAIN_24GHZ         (98)
++#define MAX_TX_GAIN               (0)
++
++/* First and last channels of all groups */
++#define CALIB_IWL_TX_ATTEN_GR1_FCH 34
++#define CALIB_IWL_TX_ATTEN_GR1_LCH 43
++#define CALIB_IWL_TX_ATTEN_GR2_FCH 44
++#define CALIB_IWL_TX_ATTEN_GR2_LCH 70
++#define CALIB_IWL_TX_ATTEN_GR3_FCH 71
++#define CALIB_IWL_TX_ATTEN_GR3_LCH 124
++#define CALIB_IWL_TX_ATTEN_GR4_FCH 125
++#define CALIB_IWL_TX_ATTEN_GR4_LCH 200
++#define CALIB_IWL_TX_ATTEN_GR5_FCH 1
++#define CALIB_IWL_TX_ATTEN_GR5_LCH 20
++
++
++union iwl_tx_power_dual_stream {
++	struct {
++		u8 radio_tx_gain[2];
++		u8 dsp_predis_atten[2];
++	} s;
++	u32 dw;
++};
++
++/********************* END TXPOWER *****************************************/
++
++/* HT flags */
++#define RXON_FLG_CTRL_CHANNEL_LOC_POS		(22)
++#define RXON_FLG_CTRL_CHANNEL_LOC_HI_MSK	__constant_cpu_to_le32(0x1<<22)
++
++#define RXON_FLG_HT_OPERATING_MODE_POS		(23)
++
++#define RXON_FLG_HT_PROT_MSK			__constant_cpu_to_le32(0x1<<23)
++#define RXON_FLG_FAT_PROT_MSK			__constant_cpu_to_le32(0x2<<23)
++
++#define RXON_FLG_CHANNEL_MODE_POS		(25)
++#define RXON_FLG_CHANNEL_MODE_MSK		__constant_cpu_to_le32(0x3<<25)
++#define RXON_FLG_CHANNEL_MODE_PURE_40_MSK	__constant_cpu_to_le32(0x1<<25)
++#define RXON_FLG_CHANNEL_MODE_MIXED_MSK		__constant_cpu_to_le32(0x2<<25)
++
++#define RXON_RX_CHAIN_DRIVER_FORCE_MSK		__constant_cpu_to_le16(0x1<<0)
++#define RXON_RX_CHAIN_VALID_MSK			__constant_cpu_to_le16(0x7<<1)
++#define RXON_RX_CHAIN_VALID_POS			(1)
++#define RXON_RX_CHAIN_FORCE_SEL_MSK		__constant_cpu_to_le16(0x7<<4)
++#define RXON_RX_CHAIN_FORCE_SEL_POS		(4)
++#define RXON_RX_CHAIN_FORCE_MIMO_SEL_MSK	__constant_cpu_to_le16(0x7<<7)
++#define RXON_RX_CHAIN_FORCE_MIMO_SEL_POS	(7)
++#define RXON_RX_CHAIN_CNT_MSK			__constant_cpu_to_le16(0x3<<10)
++#define RXON_RX_CHAIN_CNT_POS			(10)
++#define RXON_RX_CHAIN_MIMO_CNT_MSK		__constant_cpu_to_le16(0x3<<12)
++#define RXON_RX_CHAIN_MIMO_CNT_POS		(12)
++#define RXON_RX_CHAIN_MIMO_FORCE_MSK		__constant_cpu_to_le16(0x1<<14)
++#define RXON_RX_CHAIN_MIMO_FORCE_POS		(14)
++
++
++#define MCS_DUP_6M_PLCP 0x20
++
++/* OFDM HT rate masks */
++/* ***************************************** */
++#define R_MCS_6M_MSK 0x1
++#define R_MCS_12M_MSK 0x2
++#define R_MCS_18M_MSK 0x4
++#define R_MCS_24M_MSK 0x8
++#define R_MCS_36M_MSK 0x10
++#define R_MCS_48M_MSK 0x20
++#define R_MCS_54M_MSK 0x40
++#define R_MCS_60M_MSK 0x80
++#define R_MCS_12M_DUAL_MSK 0x100
++#define R_MCS_24M_DUAL_MSK 0x200
++#define R_MCS_36M_DUAL_MSK 0x400
++#define R_MCS_48M_DUAL_MSK 0x800
++
++#define is_legacy(tbl) (((tbl) == LQ_G) || ((tbl) == LQ_A))
++#define is_siso(tbl) (((tbl) == LQ_SISO))
++#define is_mimo(tbl) (((tbl) == LQ_MIMO))
++#define is_Ht(tbl) (is_siso(tbl) || is_mimo(tbl))
++#define is_a_band(tbl) (((tbl) == LQ_A))
++#define is_g_and(tbl) (((tbl) == LQ_G))
++
++/* Flow Handler Definitions */
++
++/**********************/
++/*     Addresses      */
++/**********************/
++
++#define FH_MEM_LOWER_BOUND                   (0x1000)
++#define FH_MEM_UPPER_BOUND                   (0x1EF0)
++
++#define IWL_FH_REGS_LOWER_BOUND		     (0x1000)
++#define IWL_FH_REGS_UPPER_BOUND		     (0x2000)
++
++#define IWL_FH_KW_MEM_ADDR_REG		     (FH_MEM_LOWER_BOUND + 0x97C)
++
++/* CBBC Area - Circular buffers base address cache pointers table */
++#define FH_MEM_CBBC_LOWER_BOUND              (FH_MEM_LOWER_BOUND + 0x9D0)
++#define FH_MEM_CBBC_UPPER_BOUND              (FH_MEM_LOWER_BOUND + 0xA10)
++/* queues 0 - 15 */
++#define FH_MEM_CBBC_QUEUE(x)  (FH_MEM_CBBC_LOWER_BOUND + (x) * 0x4)
++
++/* RSCSR Area */
++#define FH_MEM_RSCSR_LOWER_BOUND	(FH_MEM_LOWER_BOUND + 0xBC0)
++#define FH_MEM_RSCSR_UPPER_BOUND	(FH_MEM_LOWER_BOUND + 0xC00)
++#define FH_MEM_RSCSR_CHNL0		(FH_MEM_RSCSR_LOWER_BOUND)
++
++#define FH_RSCSR_CHNL0_STTS_WPTR_REG		(FH_MEM_RSCSR_CHNL0)
++#define FH_RSCSR_CHNL0_RBDCB_BASE_REG		(FH_MEM_RSCSR_CHNL0 + 0x004)
++#define FH_RSCSR_CHNL0_RBDCB_WPTR_REG		(FH_MEM_RSCSR_CHNL0 + 0x008)
++
++/* RCSR Area - Registers address map */
++#define FH_MEM_RCSR_LOWER_BOUND      (FH_MEM_LOWER_BOUND + 0xC00)
++#define FH_MEM_RCSR_UPPER_BOUND      (FH_MEM_LOWER_BOUND + 0xCC0)
++#define FH_MEM_RCSR_CHNL0            (FH_MEM_RCSR_LOWER_BOUND)
++
++#define FH_MEM_RCSR_CHNL0_CONFIG_REG	(FH_MEM_RCSR_CHNL0)
++
++/* RSSR Area - Rx shared ctrl & status registers */
++#define FH_MEM_RSSR_LOWER_BOUND                	(FH_MEM_LOWER_BOUND + 0xC40)
++#define FH_MEM_RSSR_UPPER_BOUND               	(FH_MEM_LOWER_BOUND + 0xD00)
++#define FH_MEM_RSSR_SHARED_CTRL_REG           	(FH_MEM_RSSR_LOWER_BOUND)
++#define FH_MEM_RSSR_RX_STATUS_REG	(FH_MEM_RSSR_LOWER_BOUND + 0x004)
++#define FH_MEM_RSSR_RX_ENABLE_ERR_IRQ2DRV  (FH_MEM_RSSR_LOWER_BOUND + 0x008)
++
++/* TCSR */
++#define IWL_FH_TCSR_LOWER_BOUND  (IWL_FH_REGS_LOWER_BOUND + 0xD00)
++#define IWL_FH_TCSR_UPPER_BOUND  (IWL_FH_REGS_LOWER_BOUND + 0xE60)
++
++#define IWL_FH_TCSR_CHNL_NUM                            (7)
++#define IWL_FH_TCSR_CHNL_TX_CONFIG_REG(_chnl) \
++	(IWL_FH_TCSR_LOWER_BOUND + 0x20 * _chnl)
++
++/* TSSR Area - Tx shared status registers */
++/* TSSR */
++#define IWL_FH_TSSR_LOWER_BOUND		(IWL_FH_REGS_LOWER_BOUND + 0xEA0)
++#define IWL_FH_TSSR_UPPER_BOUND		(IWL_FH_REGS_LOWER_BOUND + 0xEC0)
++
++#define IWL_FH_TSSR_TX_MSG_CONFIG_REG	(IWL_FH_TSSR_LOWER_BOUND + 0x008)
++#define IWL_FH_TSSR_TX_STATUS_REG	(IWL_FH_TSSR_LOWER_BOUND + 0x010)
++
++#define IWL_FH_TSSR_TX_MSG_CONFIG_REG_VAL_SNOOP_RD_TXPD_ON	(0xFF000000)
++#define IWL_FH_TSSR_TX_MSG_CONFIG_REG_VAL_ORDER_RD_TXPD_ON	(0x00FF0000)
++
++#define IWL_FH_TSSR_TX_MSG_CONFIG_REG_VAL_MAX_FRAG_SIZE_64B	(0x00000000)
++#define IWL_FH_TSSR_TX_MSG_CONFIG_REG_VAL_MAX_FRAG_SIZE_128B	(0x00000400)
++#define IWL_FH_TSSR_TX_MSG_CONFIG_REG_VAL_MAX_FRAG_SIZE_256B	(0x00000800)
++#define IWL_FH_TSSR_TX_MSG_CONFIG_REG_VAL_MAX_FRAG_SIZE_512B	(0x00000C00)
++
++#define IWL_FH_TSSR_TX_MSG_CONFIG_REG_VAL_SNOOP_RD_TFD_ON	(0x00000100)
++#define IWL_FH_TSSR_TX_MSG_CONFIG_REG_VAL_ORDER_RD_CBB_ON	(0x00000080)
++
++#define IWL_FH_TSSR_TX_MSG_CONFIG_REG_VAL_ORDER_RSP_WAIT_TH	(0x00000020)
++#define IWL_FH_TSSR_TX_MSG_CONFIG_REG_VAL_RSP_WAIT_TH		(0x00000005)
++
++#define IWL_FH_TSSR_TX_STATUS_REG_BIT_BUFS_EMPTY(_chnl)	\
++	((1 << (_chnl)) << 24)
++#define IWL_FH_TSSR_TX_STATUS_REG_BIT_NO_PEND_REQ(_chnl) \
++	((1 << (_chnl)) << 16)
++
++#define IWL_FH_TSSR_TX_STATUS_REG_MSK_CHNL_IDLE(_chnl) \
++	(IWL_FH_TSSR_TX_STATUS_REG_BIT_BUFS_EMPTY(_chnl) | \
++	IWL_FH_TSSR_TX_STATUS_REG_BIT_NO_PEND_REQ(_chnl))
++
++/* TCSR: tx_config register values */
++#define IWL_FH_TCSR_TX_CONFIG_REG_VAL_MSG_MODE_TXF              (0x00000000)
++#define IWL_FH_TCSR_TX_CONFIG_REG_VAL_MSG_MODE_DRIVER           (0x00000001)
++#define IWL_FH_TCSR_TX_CONFIG_REG_VAL_MSG_MODE_ARC              (0x00000002)
++
++#define IWL_FH_TCSR_TX_CONFIG_REG_VAL_DMA_CREDIT_DISABLE_VAL    (0x00000000)
++#define IWL_FH_TCSR_TX_CONFIG_REG_VAL_DMA_CREDIT_ENABLE_VAL     (0x00000008)
++
++#define IWL_FH_TCSR_TX_CONFIG_REG_VAL_CIRQ_HOST_NOINT           (0x00000000)
++#define IWL_FH_TCSR_TX_CONFIG_REG_VAL_CIRQ_HOST_ENDTFD          (0x00100000)
++#define IWL_FH_TCSR_TX_CONFIG_REG_VAL_CIRQ_HOST_IFTFD           (0x00200000)
++
++#define IWL_FH_TCSR_TX_CONFIG_REG_VAL_CIRQ_RTC_NOINT            (0x00000000)
++#define IWL_FH_TCSR_TX_CONFIG_REG_VAL_CIRQ_RTC_ENDTFD           (0x00400000)
++#define IWL_FH_TCSR_TX_CONFIG_REG_VAL_CIRQ_RTC_IFTFD            (0x00800000)
++
++#define IWL_FH_TCSR_TX_CONFIG_REG_VAL_DMA_CHNL_PAUSE            (0x00000000)
++#define IWL_FH_TCSR_TX_CONFIG_REG_VAL_DMA_CHNL_PAUSE_EOF        (0x40000000)
++#define IWL_FH_TCSR_TX_CONFIG_REG_VAL_DMA_CHNL_ENABLE           (0x80000000)
++
++#define IWL_FH_TCSR_CHNL_TX_BUF_STS_REG_VAL_TFDB_EMPTY          (0x00000000)
++#define IWL_FH_TCSR_CHNL_TX_BUF_STS_REG_VAL_TFDB_WAIT           (0x00002000)
++#define IWL_FH_TCSR_CHNL_TX_BUF_STS_REG_VAL_TFDB_VALID          (0x00000003)
++
++#define IWL_FH_TCSR_CHNL_TX_BUF_STS_REG_BIT_TFDB_WPTR           (0x00000001)
++
++#define IWL_FH_TCSR_CHNL_TX_BUF_STS_REG_POS_TB_NUM              (20)
++#define IWL_FH_TCSR_CHNL_TX_BUF_STS_REG_POS_TB_IDX              (12)
++
++/* RCSR:  channel 0 rx_config register defines */
++#define FH_RCSR_CHNL0_RX_CONFIG_DMA_CHNL_EN_MASK  (0xC0000000) /* bits 30-31 */
++#define FH_RCSR_CHNL0_RX_CONFIG_RBDBC_SIZE_MASK   (0x00F00000) /* bits 20-23 */
++#define FH_RCSR_CHNL0_RX_CONFIG_RB_SIZE_MASK	  (0x00030000) /* bits 16-17 */
++#define FH_RCSR_CHNL0_RX_CONFIG_SINGLE_FRAME_MASK (0x00008000) /* bit 15 */
++#define FH_RCSR_CHNL0_RX_CONFIG_IRQ_DEST_MASK     (0x00001000) /* bit 12 */
++#define FH_RCSR_CHNL0_RX_CONFIG_RB_TIMEOUT_MASK   (0x00000FF0) /* bit 4-11 */
++
++#define FH_RCSR_RX_CONFIG_RBDCB_SIZE_BITSHIFT       (20)
++#define FH_RCSR_RX_CONFIG_RB_SIZE_BITSHIFT			(16)
++
++/* RCSR: rx_config register values */
++#define FH_RCSR_RX_CONFIG_CHNL_EN_PAUSE_VAL         (0x00000000)
++#define FH_RCSR_RX_CONFIG_CHNL_EN_PAUSE_EOF_VAL     (0x40000000)
++#define FH_RCSR_RX_CONFIG_CHNL_EN_ENABLE_VAL        (0x80000000)
++
++#define IWL_FH_RCSR_RX_CONFIG_REG_VAL_RB_SIZE_4K    (0x00000000)
++
++/* RCSR channel 0 config register values */
++#define FH_RCSR_CHNL0_RX_CONFIG_IRQ_DEST_NO_INT_VAL       (0x00000000)
++#define FH_RCSR_CHNL0_RX_CONFIG_IRQ_DEST_INT_HOST_VAL     (0x00001000)
++
++/* RSCSR: defs used in normal mode */
++#define FH_RSCSR_CHNL0_RBDCB_WPTR_MASK		(0x00000FFF)	/* bits 0-11 */
++
++#define SCD_WIN_SIZE				64
++#define SCD_FRAME_LIMIT				64
++
++/* memory mapped registers */
++#define SCD_START_OFFSET		0xa02c00
++
++#define SCD_SRAM_BASE_ADDR           (SCD_START_OFFSET + 0x0)
++#define SCD_EMPTY_BITS               (SCD_START_OFFSET + 0x4)
++#define SCD_DRAM_BASE_ADDR           (SCD_START_OFFSET + 0x10)
++#define SCD_AIT                      (SCD_START_OFFSET + 0x18)
++#define SCD_TXFACT                   (SCD_START_OFFSET + 0x1c)
++#define SCD_QUEUE_WRPTR(x)           (SCD_START_OFFSET + 0x24 + (x) * 4)
++#define SCD_QUEUE_RDPTR(x)           (SCD_START_OFFSET + 0x64 + (x) * 4)
++#define SCD_SETQUEUENUM              (SCD_START_OFFSET + 0xa4)
++#define SCD_SET_TXSTAT_TXED          (SCD_START_OFFSET + 0xa8)
++#define SCD_SET_TXSTAT_DONE          (SCD_START_OFFSET + 0xac)
++#define SCD_SET_TXSTAT_NOT_SCHD      (SCD_START_OFFSET + 0xb0)
++#define SCD_DECREASE_CREDIT          (SCD_START_OFFSET + 0xb4)
++#define SCD_DECREASE_SCREDIT         (SCD_START_OFFSET + 0xb8)
++#define SCD_LOAD_CREDIT              (SCD_START_OFFSET + 0xbc)
++#define SCD_LOAD_SCREDIT             (SCD_START_OFFSET + 0xc0)
++#define SCD_BAR                      (SCD_START_OFFSET + 0xc4)
++#define SCD_BAR_DW0                  (SCD_START_OFFSET + 0xc8)
++#define SCD_BAR_DW1                  (SCD_START_OFFSET + 0xcc)
++#define SCD_QUEUECHAIN_SEL           (SCD_START_OFFSET + 0xd0)
++#define SCD_QUERY_REQ                (SCD_START_OFFSET + 0xd8)
++#define SCD_QUERY_RES                (SCD_START_OFFSET + 0xdc)
++#define SCD_PENDING_FRAMES           (SCD_START_OFFSET + 0xe0)
++#define SCD_INTERRUPT_MASK           (SCD_START_OFFSET + 0xe4)
++#define SCD_INTERRUPT_THRESHOLD      (SCD_START_OFFSET + 0xe8)
++#define SCD_QUERY_MIN_FRAME_SIZE     (SCD_START_OFFSET + 0x100)
++#define SCD_QUEUE_STATUS_BITS(x)     (SCD_START_OFFSET + 0x104 + (x) * 4)
++
++/* SRAM structures */
++#define SCD_CONTEXT_DATA_OFFSET			0x380
++#define SCD_TX_STTS_BITMAP_OFFSET		0x400
++#define SCD_TRANSLATE_TBL_OFFSET		0x500
++#define SCD_CONTEXT_QUEUE_OFFSET(x)	(SCD_CONTEXT_DATA_OFFSET + ((x) * 8))
++#define SCD_TRANSLATE_TBL_OFFSET_QUEUE(x) \
++	((SCD_TRANSLATE_TBL_OFFSET + ((x) * 2)) & 0xfffffffc)
++
++#define SCD_TXFACT_REG_TXFIFO_MASK(lo, hi) \
++       ((1<<(hi))|((1<<(hi))-(1<<(lo))))
++
++
++#define SCD_MODE_REG_BIT_SEARCH_MODE		(1<<0)
++#define SCD_MODE_REG_BIT_SBYP_MODE		(1<<1)
++
++#define SCD_TXFIFO_POS_TID			(0)
++#define SCD_TXFIFO_POS_RA			(4)
++#define SCD_QUEUE_STTS_REG_POS_ACTIVE		(0)
++#define SCD_QUEUE_STTS_REG_POS_TXF		(1)
++#define SCD_QUEUE_STTS_REG_POS_WSL		(5)
++#define SCD_QUEUE_STTS_REG_POS_SCD_ACK		(8)
++#define SCD_QUEUE_STTS_REG_POS_SCD_ACT_EN	(10)
++#define SCD_QUEUE_STTS_REG_MSK			(0x0007FC00)
++
++#define SCD_QUEUE_RA_TID_MAP_RATID_MSK		(0x01FF)
++
++#define SCD_QUEUE_CTX_REG1_WIN_SIZE_POS		(0)
++#define SCD_QUEUE_CTX_REG1_WIN_SIZE_MSK		(0x0000007F)
++#define SCD_QUEUE_CTX_REG1_CREDIT_POS		(8)
++#define SCD_QUEUE_CTX_REG1_CREDIT_MSK		(0x00FFFF00)
++#define SCD_QUEUE_CTX_REG1_SUPER_CREDIT_POS	(24)
++#define SCD_QUEUE_CTX_REG1_SUPER_CREDIT_MSK	(0xFF000000)
++#define SCD_QUEUE_CTX_REG2_FRAME_LIMIT_POS	(16)
++#define SCD_QUEUE_CTX_REG2_FRAME_LIMIT_MSK	(0x007F0000)
++
++#define CSR_HW_IF_CONFIG_REG_BIT_KEDRON_R	(0x00000010)
++#define CSR_HW_IF_CONFIG_REG_MSK_BOARD_VER	(0x00000C00)
++#define CSR_HW_IF_CONFIG_REG_BIT_MAC_SI		(0x00000100)
++#define CSR_HW_IF_CONFIG_REG_BIT_RADIO_SI	(0x00000200)
++
++static inline u8 iwl_hw_get_rate(__le32 rate_n_flags)
++{
++	return le32_to_cpu(rate_n_flags) & 0xFF;
++}
++static inline u16 iwl_hw_get_rate_n_flags(__le32 rate_n_flags)
++{
++	return le32_to_cpu(rate_n_flags) & 0xFFFF;
++}
++static inline __le32 iwl_hw_set_rate_n_flags(u8 rate, u16 flags)
++{
++	return cpu_to_le32(flags|(u16)rate);
++}
++
++struct iwl_tfd_frame_data {
++	__le32 tb1_addr;
++
++	__le32 val1;
++	/* __le32 ptb1_32_35:4; */
++#define IWL_tb1_addr_hi_POS 0
++#define IWL_tb1_addr_hi_LEN 4
++#define IWL_tb1_addr_hi_SYM val1
++	/* __le32 tb_len1:12; */
++#define IWL_tb1_len_POS 4
++#define IWL_tb1_len_LEN 12
++#define IWL_tb1_len_SYM val1
++	/* __le32 ptb2_0_15:16; */
++#define IWL_tb2_addr_lo16_POS 16
++#define IWL_tb2_addr_lo16_LEN 16
++#define IWL_tb2_addr_lo16_SYM val1
++
++	__le32 val2;
++	/* __le32 ptb2_16_35:20; */
++#define IWL_tb2_addr_hi20_POS 0
++#define IWL_tb2_addr_hi20_LEN 20
++#define IWL_tb2_addr_hi20_SYM val2
++	/* __le32 tb_len2:12; */
++#define IWL_tb2_len_POS 20
++#define IWL_tb2_len_LEN 12
++#define IWL_tb2_len_SYM val2
++} __attribute__ ((packed));
++
++struct iwl_tfd_frame {
++	__le32 val0;
++	/* __le32 rsvd1:24; */
++	/* __le32 num_tbs:5; */
++#define IWL_num_tbs_POS 24
++#define IWL_num_tbs_LEN 5
++#define IWL_num_tbs_SYM val0
++	/* __le32 rsvd2:1; */
++	/* __le32 padding:2; */
++	struct iwl_tfd_frame_data pa[10];
++	__le32 reserved;
++} __attribute__ ((packed));
++
++#define IWL4965_MAX_WIN_SIZE              64
++#define IWL4965_QUEUE_SIZE               256
++#define IWL4965_NUM_FIFOS                  7
++#define IWL_MAX_NUM_QUEUES                16
++
++struct iwl4965_queue_byte_cnt_entry {
++	__le16 val;
++	/* __le16 byte_cnt:12; */
++#define IWL_byte_cnt_POS 0
++#define IWL_byte_cnt_LEN 12
++#define IWL_byte_cnt_SYM val
++	/* __le16 rsvd:4; */
++} __attribute__ ((packed));
++
++struct iwl4965_sched_queue_byte_cnt_tbl {
++	struct iwl4965_queue_byte_cnt_entry tfd_offset[IWL4965_QUEUE_SIZE +
++						       IWL4965_MAX_WIN_SIZE];
++	u8 dont_care[1024 -
++		     (IWL4965_QUEUE_SIZE + IWL4965_MAX_WIN_SIZE) *
++		     sizeof(__le16)];
++} __attribute__ ((packed));
++
++/* Base physical address of iwl_shared is provided to SCD_DRAM_BASE_ADDR
++ * and &iwl_shared.val0 is provided to FH_RSCSR_CHNL0_STTS_WPTR_REG */
++struct iwl_shared {
++	struct iwl4965_sched_queue_byte_cnt_tbl
++	 queues_byte_cnt_tbls[IWL_MAX_NUM_QUEUES];
++	__le32 val0;
++
++	/* __le32 rb_closed_stts_rb_num:12; */
++#define IWL_rb_closed_stts_rb_num_POS 0
++#define IWL_rb_closed_stts_rb_num_LEN 12
++#define IWL_rb_closed_stts_rb_num_SYM val0
++	/* __le32 rsrv1:4; */
++	/* __le32 rb_closed_stts_rx_frame_num:12; */
++#define IWL_rb_closed_stts_rx_frame_num_POS 16
++#define IWL_rb_closed_stts_rx_frame_num_LEN 12
++#define IWL_rb_closed_stts_rx_frame_num_SYM val0
++	/* __le32 rsrv2:4; */
++
++	__le32 val1;
++	/* __le32 frame_finished_stts_rb_num:12; */
++#define IWL_frame_finished_stts_rb_num_POS 0
++#define IWL_frame_finished_stts_rb_num_LEN 12
++#define IWL_frame_finished_stts_rb_num_SYM val1
++	/* __le32 rsrv3:4; */
++	/* __le32 frame_finished_stts_rx_frame_num:12; */
++#define IWL_frame_finished_stts_rx_frame_num_POS 16
++#define IWL_frame_finished_stts_rx_frame_num_LEN 12
++#define IWL_frame_finished_stts_rx_frame_num_SYM val1
++	/* __le32 rsrv4:4; */
++
++	__le32 padding1;  /* so that allocation will be aligned to 16B */
++	__le32 padding2;
++} __attribute__ ((packed));
++
++#endif /* __iwl_4965_hw_h__ */
+diff --git a/drivers/net/wireless/iwl-4965-rs.c b/drivers/net/wireless/iwl-4965-rs.c
+new file mode 100644
+index 0000000..f363860
+--- /dev/null
++++ b/drivers/net/wireless/iwl-4965-rs.c
+@@ -0,0 +1,2118 @@
++/******************************************************************************
++ *
++ * Copyright(c) 2005 - 2007 Intel Corporation. All rights reserved.
++ *
++ * This program is free software; you can redistribute it and/or modify it
++ * under the terms of version 2 of the GNU General Public License as
++ * published by the Free Software Foundation.
++ *
++ * 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.,
++ * 51 Franklin Street, Fifth Floor, Boston, MA 02110, USA
++ *
++ * The full GNU General Public License is included in this distribution in the
++ * file called LICENSE.
++ *
++ * Contact Information:
++ * James P. Ketrenos <ipw2100-admin at linux.intel.com>
++ * Intel Corporation, 5200 N.E. Elam Young Parkway, Hillsboro, OR 97124-6497
++ *
++ *****************************************************************************/
++#include <linux/kernel.h>
++#include <linux/init.h>
++#include <linux/skbuff.h>
++#include <linux/wireless.h>
++#include <net/mac80211.h>
++#include <net/ieee80211.h>
++
++#include <linux/netdevice.h>
++#include <linux/etherdevice.h>
++#include <linux/delay.h>
++
++#include <linux/workqueue.h>
++
++#include <net/mac80211.h>
++#include <linux/wireless.h>
++
++#include "../net/mac80211/ieee80211_rate.h"
++
++#include "iwlwifi.h"
++#include "iwl-helpers.h"
++
++#define RS_NAME "iwl-4965-rs"
++
++#define NUM_TRY_BEFORE_ANTENNA_TOGGLE 1
++#define IWL_NUMBER_TRY      1
++#define IWL_HT_NUMBER_TRY   3
++
++#define IWL_RATE_MAX_WINDOW		62
++#define IWL_RATE_HIGH_TH		10880
++#define IWL_RATE_MIN_FAILURE_TH		6
++#define IWL_RATE_MIN_SUCCESS_TH		8
++#define IWL_RATE_DECREASE_TH		1920
++#define IWL_RATE_INCREASE_TH            8960
++#define IWL_RATE_SCALE_FLUSH_INTVL   (2*HZ)        /*2 seconds */
++
++static u8 rs_ht_to_legacy[] = {
++	IWL_RATE_6M_INDEX, IWL_RATE_6M_INDEX,
++	IWL_RATE_6M_INDEX, IWL_RATE_6M_INDEX,
++	IWL_RATE_6M_INDEX,
++	IWL_RATE_6M_INDEX, IWL_RATE_9M_INDEX,
++	IWL_RATE_12M_INDEX, IWL_RATE_18M_INDEX,
++	IWL_RATE_24M_INDEX, IWL_RATE_36M_INDEX,
++	IWL_RATE_48M_INDEX, IWL_RATE_54M_INDEX
++};
++
++struct iwl_rate {
++	u32 rate_n_flags;
++} __attribute__ ((packed));
++
++struct iwl_rate_scale_data {
++	u64 data;
++	s32 success_counter;
++	s32 success_ratio;
++	s32 counter;
++	s32 average_tpt;
++	unsigned long stamp;
++};
++
++struct iwl_scale_tbl_info {
++	enum iwl_table_type lq_type;
++	enum iwl_antenna_type antenna_type;
++	u8 is_SGI;
++	u8 is_fat;
++	u8 is_dup;
++	u8 action;
++	s32 *expected_tpt;
++	struct iwl_rate current_rate;
++	struct iwl_rate_scale_data win[IWL_RATE_COUNT];
++};
++
++struct iwl_rate_scale_priv {
++	u8 active_tbl;
++	u8 enable_counter;
++	u8 stay_in_tbl;
++	u8 search_better_tbl;
++	s32 last_tpt;
++	u32 table_count_limit;
++	u32 max_failure_limit;
++	u32 max_success_limit;
++	u32 table_count;
++	u32 total_failed;
++	u32 total_success;
++	u32 flush_timer;
++	u8 action_counter;
++	u8 antenna;
++	u8 valid_antenna;
++	u8 is_green;
++	u8 is_dup;
++	u8 phymode;
++	u8 ibss_sta_added;
++	u16 active_rate;
++	u16 active_siso_rate;
++	u16 active_mimo_rate;
++	u16 active_rate_basic;
++	struct iwl_link_quality_cmd lq;
++	struct iwl_scale_tbl_info lq_info[LQ_SIZE];
++};
++
++static void rs_rate_scale_perform(struct iwl_priv *priv,
++				   struct net_device *dev,
++				   struct ieee80211_hdr *hdr,
++				   struct sta_info *sta);
++static int rs_fill_link_cmd(struct iwl_rate_scale_priv *lq_data,
++			     struct iwl_rate *tx_mcs,
++			     struct iwl_link_quality_cmd *tbl,
++			     struct sta_info *sta);
++
++
++static s32 expected_tpt_A[IWL_RATE_COUNT] = {
++	0, 0, 0, 0, 40, 57, 72, 98, 121, 154, 177, 186, 186
++};
++
++static s32 expected_tpt_G[IWL_RATE_COUNT] = {
++	7, 13, 35, 58, 40, 57, 72, 98, 121, 154, 177, 186, 186
++};
++
++static s32 expected_tpt_siso20MHz[IWL_RATE_COUNT] = {
++	0, 0, 0, 0, 42, 42, 76, 102, 124, 159, 183, 193, 202
++};
++
++static s32 expected_tpt_siso20MHzSGI[IWL_RATE_COUNT] = {
++	0, 0, 0, 0, 46, 46, 82, 110, 132, 168, 192, 202, 211
++};
++
++static s32 expected_tpt_mimo20MHz[IWL_RATE_COUNT] = {
++	0, 0, 0, 0, 74, 74, 123, 155, 179, 214, 236, 244, 251
++};
++
++static s32 expected_tpt_mimo20MHzSGI[IWL_RATE_COUNT] = {
++	0, 0, 0, 0, 81, 81, 131, 164, 188, 222, 243, 251, 257
++};
++
++static s32 expected_tpt_siso40MHz[IWL_RATE_COUNT] = {
++	0, 0, 0, 0, 77, 77, 127, 160, 184, 220, 242, 250, 257
++};
++
++static s32 expected_tpt_siso40MHzSGI[IWL_RATE_COUNT] = {
++	0, 0, 0, 0, 83, 83, 135, 169, 193, 229, 250, 257, 264
++};
++
++static s32 expected_tpt_mimo40MHz[IWL_RATE_COUNT] = {
++	0, 0, 0, 0, 123, 123, 182, 214, 235, 264, 279, 285, 289
++};
++
++static s32 expected_tpt_mimo40MHzSGI[IWL_RATE_COUNT] = {
++	0, 0, 0, 0, 131, 131, 191, 222, 242, 270, 284, 289, 293
++};
++
++static int iwl_lq_sync_callback(struct iwl_priv *priv,
++				struct iwl_cmd *cmd, struct sk_buff *skb)
++{
++	/*We didn't cache the SKB; let the caller free it */
++	return 1;
++}
++
++static inline u8 iwl_rate_get_rate(u32 rate_n_flags)
++{
++	return (u8)(rate_n_flags & 0xFF);
++}
++
++static int rs_send_lq_cmd(struct iwl_priv *priv,
++			  struct iwl_link_quality_cmd *lq, u8 flags)
++{
++#ifdef CONFIG_IWLWIFI_DEBUG
++	int i;
++#endif
++	int rc = -1;
++
++	struct iwl_host_cmd cmd = {
++		.id = REPLY_TX_LINK_QUALITY_CMD,
++		.len = sizeof(struct iwl_link_quality_cmd),
++		.meta.flags = flags,
++		.data = lq,
++	};
++
++	if ((lq->sta_id == 0xFF) &&
++	    (priv->iw_mode == IEEE80211_IF_TYPE_IBSS))
++		return rc;
++
++	if (lq->sta_id == 0xFF)
++		lq->sta_id = IWL_AP_ID;
++
++	IWL_DEBUG_RATE("lq station id 0x%x\n", lq->sta_id);
++	IWL_DEBUG_RATE("lq dta 0x%X 0x%X\n",
++		       lq->general_params.single_stream_ant_msk,
++		       lq->general_params.dual_stream_ant_msk);
++#ifdef CONFIG_IWLWIFI_DEBUG
++	for (i = 0; i < LINK_QUAL_MAX_RETRY_NUM; i++)
++		IWL_DEBUG_RATE("lq index %d 0x%X\n",
++				i, lq->rs_table[i].rate_n_flags);
++#endif
++
++	if (flags & CMD_ASYNC)
++		cmd.meta.u.callback = iwl_lq_sync_callback;
++
++	if (iwl_is_associated(priv) && priv->assoc_station_added &&
++	    priv->lq_mngr.lq_ready)
++		rc = iwl_send_cmd(priv, &cmd);
++
++	return rc;
++}
++
++static int rs_rate_scale_clear_window(struct iwl_rate_scale_data *window)
++{
++	window->data = 0;
++	window->success_counter = 0;
++	window->success_ratio = IWL_INVALID_VALUE;
++	window->counter = 0;
++	window->average_tpt = IWL_INVALID_VALUE;
++	window->stamp = 0;
++
++	return 0;
++}
++
++static int rs_collect_tx_data(struct iwl_rate_scale_data *windows,
++			      int scale_index, s32 tpt, u32 status)
++{
++	int rc = 0;
++	struct iwl_rate_scale_data *window = NULL;
++	u64 mask;
++	u8 win_size = IWL_RATE_MAX_WINDOW;
++	s32 fail_count;
++
++	if (scale_index < 0)
++		return -1;
++
++	if (scale_index >= IWL_RATE_COUNT)
++		return -1;
++
++	window = &(windows[scale_index]);
++
++	if (window->counter >= win_size) {
++
++		window->counter = win_size - 1;
++		mask = 1;
++		mask = (mask << (win_size - 1));
++		if ((window->data & mask)) {
++			window->data &= ~mask;
++			window->success_counter = window->success_counter - 1;
++		}
++	}
++
++	window->counter = window->counter + 1;
++	mask = window->data;
++	window->data = (mask << 1);
++	if (status != 0) {
++		window->success_counter = window->success_counter + 1;
++		window->data |= 0x1;
++	}
++
++	if (window->counter > 0)
++		window->success_ratio = 128 * (100 * window->success_counter)
++					/ window->counter;
++	else
++		window->success_ratio = IWL_INVALID_VALUE;
++
++	fail_count = window->counter - window->success_counter;
++
++	if ((fail_count >= IWL_RATE_MIN_FAILURE_TH) ||
++	    (window->success_counter >= IWL_RATE_MIN_SUCCESS_TH))
++		window->average_tpt = (window->success_ratio * tpt + 64) / 128;
++	else
++		window->average_tpt = IWL_INVALID_VALUE;
++
++	window->stamp = jiffies;
++
++	return rc;
++}
++
++int static rs_mcs_from_tbl(struct iwl_rate *mcs_rate,
++			   struct iwl_scale_tbl_info *tbl,
++			   int index, u8 use_green)
++{
++	int rc = 0;
++
++	if (is_legacy(tbl->lq_type)) {
++		mcs_rate->rate_n_flags = iwl_rates[index].plcp;
++		if (index >= IWL_FIRST_CCK_RATE && index <= IWL_LAST_CCK_RATE)
++			mcs_rate->rate_n_flags |= RATE_MCS_CCK_MSK;
++
++	} else if (is_siso(tbl->lq_type)) {
++		if (index > IWL_LAST_OFDM_RATE)
++			index = IWL_LAST_OFDM_RATE;
++		 mcs_rate->rate_n_flags = iwl_rates[index].plcp_siso |
++					  RATE_MCS_HT_MSK;
++	} else {
++		if (index > IWL_LAST_OFDM_RATE)
++			index = IWL_LAST_OFDM_RATE;
++		mcs_rate->rate_n_flags = iwl_rates[index].plcp_mimo |
++					 RATE_MCS_HT_MSK;
++	}
++
++	switch (tbl->antenna_type) {
++	case ANT_BOTH:
++		mcs_rate->rate_n_flags |= RATE_MCS_ANT_AB_MSK;
++		break;
++	case ANT_MAIN:
++		mcs_rate->rate_n_flags |= RATE_MCS_ANT_A_MSK;
++		break;
++	case ANT_AUX:
++		mcs_rate->rate_n_flags |= RATE_MCS_ANT_B_MSK;
++		break;
++	case ANT_NONE:
++		break;
++	}
++
++	if (is_legacy(tbl->lq_type))
++		return rc;
++
++	if (tbl->is_fat) {
++		if (tbl->is_dup)
++			mcs_rate->rate_n_flags |= RATE_MCS_DUP_MSK;
++		else
++			mcs_rate->rate_n_flags |= RATE_MCS_FAT_MSK;
++	}
++	if (tbl->is_SGI)
++		mcs_rate->rate_n_flags |= RATE_MCS_SGI_MSK;
++
++	if (use_green) {
++		mcs_rate->rate_n_flags |= RATE_MCS_GF_MSK;
++		if (is_siso(tbl->lq_type))
++			mcs_rate->rate_n_flags &= ~RATE_MCS_SGI_MSK;
++	}
++	return rc;
++}
++
++static int rs_get_tbl_info_from_mcs(const struct iwl_rate *mcs_rate,
++				    int phymode, struct iwl_scale_tbl_info *tbl,
++				    int *rate_idx)
++{
++	int index;
++	u32 ant_msk;
++
++	index = iwl_rate_index_from_plcp(mcs_rate->rate_n_flags);
++
++	if (index  == IWL_RATE_INVALID) {
++		*rate_idx = -1;
++		return -1;
++	}
++	tbl->is_SGI = 0;
++	tbl->is_fat = 0;
++	tbl->is_dup = 0;
++	tbl->antenna_type = ANT_BOTH;
++
++	if (!(mcs_rate->rate_n_flags & RATE_MCS_HT_MSK)) {
++		ant_msk = (mcs_rate->rate_n_flags & RATE_MCS_ANT_AB_MSK);
++
++		if (ant_msk == RATE_MCS_ANT_AB_MSK)
++			tbl->lq_type = LQ_NONE;
++		else {
++
++			if (phymode == MODE_IEEE80211A)
++				tbl->lq_type = LQ_A;
++			else
++				tbl->lq_type = LQ_G;
++
++			if (mcs_rate->rate_n_flags & RATE_MCS_ANT_A_MSK)
++				tbl->antenna_type = ANT_MAIN;
++			else
++				tbl->antenna_type = ANT_AUX;
++		}
++		*rate_idx = index;
++
++	} else if (iwl_rate_get_rate(mcs_rate->rate_n_flags)
++					<= IWL_RATE_SISO_60M_PLCP) {
++		tbl->lq_type = LQ_SISO;
++
++		ant_msk = (mcs_rate->rate_n_flags & RATE_MCS_ANT_AB_MSK);
++		if (ant_msk == RATE_MCS_ANT_AB_MSK)
++			tbl->lq_type = LQ_NONE;
++		else {
++			if (mcs_rate->rate_n_flags & RATE_MCS_ANT_A_MSK)
++				tbl->antenna_type = ANT_MAIN;
++			else
++				tbl->antenna_type = ANT_AUX;
++		}
++		if (mcs_rate->rate_n_flags & RATE_MCS_SGI_MSK)
++			tbl->is_SGI = 1;
++
++		if ((mcs_rate->rate_n_flags & RATE_MCS_FAT_MSK) ||
++		    (mcs_rate->rate_n_flags & RATE_MCS_DUP_MSK))
++			tbl->is_fat = 1;
++
++		if (mcs_rate->rate_n_flags & RATE_MCS_DUP_MSK)
++			tbl->is_dup = 1;
++
++		*rate_idx = index;
++	} else {
++		tbl->lq_type = LQ_MIMO;
++		if (mcs_rate->rate_n_flags & RATE_MCS_SGI_MSK)
++			tbl->is_SGI = 1;
++
++		if ((mcs_rate->rate_n_flags & RATE_MCS_FAT_MSK) ||
++		    (mcs_rate->rate_n_flags & RATE_MCS_DUP_MSK))
++			tbl->is_fat = 1;
++
++		if (mcs_rate->rate_n_flags & RATE_MCS_DUP_MSK)
++			tbl->is_dup = 1;
++		*rate_idx = index;
++	}
++	return 0;
++}
++
++static inline void rs_toggle_antenna(struct iwl_rate *new_rate,
++				     struct iwl_scale_tbl_info *tbl)
++{
++	if (tbl->antenna_type == ANT_AUX) {
++		tbl->antenna_type = ANT_MAIN;
++		new_rate->rate_n_flags &= ~RATE_MCS_ANT_B_MSK;
++		new_rate->rate_n_flags |= RATE_MCS_ANT_A_MSK;
++	} else {
++		tbl->antenna_type = ANT_AUX;
++		new_rate->rate_n_flags &= ~RATE_MCS_ANT_A_MSK;
++		new_rate->rate_n_flags |= RATE_MCS_ANT_B_MSK;
++	}
++}
++
++static inline s8 rs_use_green(struct iwl_priv *priv)
++{
++	s8 rc = 0;
++#ifdef CONFIG_IWLWIFI_HT
++	if (!priv->is_ht_enabled || !priv->current_assoc_ht.is_ht)
++		return 0;
++
++	if ((priv->current_assoc_ht.is_green_field) &&
++	    !(priv->current_assoc_ht.operating_mode & 0x4))
++		rc = 1;
++#endif	/*CONFIG_IWLWIFI_HT */
++	return rc;
++}
++
++/**
++ * rs_get_supported_rates - get the available rates
++ *
++ * if management frame or broadcast frame only return
++ * basic available rates.
++ *
++ */
++static void rs_get_supported_rates(struct iwl_rate_scale_priv *lq_data,
++				   struct ieee80211_hdr *hdr,
++				   enum iwl_table_type rate_type,
++				   u16 *data_rate)
++{
++	if (is_legacy(rate_type))
++		*data_rate = lq_data->active_rate;
++	else {
++		if (is_siso(rate_type))
++			*data_rate = lq_data->active_siso_rate;
++		else
++			*data_rate = lq_data->active_mimo_rate;
++	}
++
++	if (hdr && is_multicast_ether_addr(hdr->addr1) &&
++	    lq_data->active_rate_basic)
++		*data_rate = lq_data->active_rate_basic;
++}
++
++static u16 rs_get_adjacent_rate(u8 index, u16 rate_mask, int rate_type)
++{
++	u8 high = IWL_RATE_INVALID;
++	u8 low = IWL_RATE_INVALID;
++
++	/* 802.11A or ht walks to the next literal adjascent rate in
++	 * the rate table */
++	if (is_a_band(rate_type) || !is_legacy(rate_type)) {
++		int i;
++		u32 mask;
++
++		/* Find the previous rate that is in the rate mask */
++		i = index - 1;
++		for (mask = (1 << i); i >= 0; i--, mask >>= 1) {
++			if (rate_mask & mask) {
++				low = i;
++				break;
++			}
++		}
++
++		/* Find the next rate that is in the rate mask */
++		i = index + 1;
++		for (mask = (1 << i); i < IWL_RATE_COUNT; i++, mask <<= 1) {
++			if (rate_mask & mask) {
++				high = i;
++				break;
++			}
++		}
++
++		return (high << 8) | low;
++	}
++
++	low = index;
++	while (low != IWL_RATE_INVALID) {
++		low = iwl_rates[low].prev_rs;
++		if (low == IWL_RATE_INVALID)
++			break;
++		if (rate_mask & (1 << low))
++			break;
++		IWL_DEBUG_RATE("Skipping masked lower rate: %d\n", low);
++	}
++
++	high = index;
++	while (high != IWL_RATE_INVALID) {
++		high = iwl_rates[high].next_rs;
++		if (high == IWL_RATE_INVALID)
++			break;
++		if (rate_mask & (1 << high))
++			break;
++		IWL_DEBUG_RATE("Skipping masked higher rate: %d\n", high);
++	}
++
++	return (high << 8) | low;
++}
++
++static int rs_get_lower_rate(struct iwl_rate_scale_priv *lq_data,
++			     struct iwl_scale_tbl_info *tbl, u8 scale_index,
++			     u8 ht_possible, struct iwl_rate *mcs_rate,
++			     struct sta_info *sta)
++{
++	u8 is_green = lq_data->is_green;
++	s32 low;
++	u16 rate_mask;
++	u16 high_low;
++	u8 switch_to_legacy = 0;
++
++	/* check if we need to switch from HT to legacy rates.
++	 * assumption is that mandatory rates (1Mbps or 6Mbps)
++	 * are always supported (spec demand) */
++	if (!is_legacy(tbl->lq_type) && (!ht_possible || !scale_index)) {
++		switch_to_legacy = 1;
++		scale_index = rs_ht_to_legacy[scale_index];
++		if (lq_data->phymode == MODE_IEEE80211A)
++			tbl->lq_type = LQ_A;
++		else
++			tbl->lq_type = LQ_G;
++
++		if ((tbl->antenna_type == ANT_BOTH) ||
++		    (tbl->antenna_type == ANT_NONE))
++			tbl->antenna_type = ANT_MAIN;
++
++		tbl->is_fat = 0;
++		tbl->is_SGI = 0;
++	}
++
++	rs_get_supported_rates(lq_data, NULL, tbl->lq_type, &rate_mask);
++
++	/* mask with station rate restriction */
++	if (is_legacy(tbl->lq_type)) {
++		if (lq_data->phymode == (u8) MODE_IEEE80211A)
++			rate_mask  = (u16)(rate_mask &
++			   (sta->supp_rates << IWL_FIRST_OFDM_RATE));
++		else
++			rate_mask = (u16)(rate_mask & sta->supp_rates);
++	}
++
++	/* if we did switched from HT to legacy check current rate */
++	if ((switch_to_legacy) &&
++	    (rate_mask & (1 << scale_index))) {
++		rs_mcs_from_tbl(mcs_rate, tbl, scale_index, is_green);
++		return 0;
++	}
++
++	high_low = rs_get_adjacent_rate(scale_index, rate_mask, tbl->lq_type);
++	low = high_low & 0xff;
++
++	if (low != IWL_RATE_INVALID)
++		rs_mcs_from_tbl(mcs_rate, tbl, low, is_green);
++	else
++		rs_mcs_from_tbl(mcs_rate, tbl, scale_index, is_green);
++
++	return 0;
++}
++
++static void rs_tx_status(void *priv_rate,
++			 struct net_device *dev,
++			 struct sk_buff *skb,
++			 struct ieee80211_tx_status *tx_resp)
++{
++	int status;
++	u8 retries;
++	int rs_index, index = 0;
++	struct iwl_rate_scale_priv *lq;
++	struct iwl_link_quality_cmd *table;
++	struct sta_info *sta;
++	struct ieee80211_hdr *hdr = (struct ieee80211_hdr *)skb->data;
++	struct iwl_priv *priv = (struct iwl_priv *)priv_rate;
++	struct ieee80211_local *local = wdev_priv(dev->ieee80211_ptr);
++	struct iwl_rate_scale_data *window = NULL;
++	struct iwl_rate_scale_data *search_win = NULL;
++	struct iwl_rate tx_mcs;
++	struct iwl_scale_tbl_info tbl_type;
++	struct iwl_scale_tbl_info *curr_tbl, *search_tbl;
++	u8 active_index = 0;
++	u16 fc = le16_to_cpu(hdr->frame_control);
++	s32 tpt = 0;
++
++	IWL_DEBUG_RATE("get frame ack response, update rate scale window\n");
++
++	if (!ieee80211_is_data(fc) || is_multicast_ether_addr(hdr->addr1))
++		return;
++
++	retries = tx_resp->retry_count;
++
++	if (retries > 15)
++		retries = 15;
++
++
++	sta = sta_info_get(local, hdr->addr1);
++
++	if (!sta || !sta->rate_ctrl_priv) {
++		if (sta)
++			sta_info_put(sta);
++		return;
++	}
++
++	lq = (struct iwl_rate_scale_priv *)sta->rate_ctrl_priv;
++
++	if (!priv->lq_mngr.lq_ready)
++		return;
++
++	if ((priv->iw_mode == IEEE80211_IF_TYPE_IBSS) && !lq->ibss_sta_added)
++		return;
++
++	table = &lq->lq;
++	active_index = lq->active_tbl;
++
++	lq->antenna = (lq->valid_antenna & local->hw.conf.antenna_sel_tx);
++	if (!lq->antenna)
++		lq->antenna = lq->valid_antenna;
++
++	lq->antenna = lq->valid_antenna;
++	curr_tbl = &(lq->lq_info[active_index]);
++	search_tbl = &(lq->lq_info[(1 - active_index)]);
++	window = (struct iwl_rate_scale_data *)
++	    &(curr_tbl->win[0]);
++	search_win = (struct iwl_rate_scale_data *)
++	    &(search_tbl->win[0]);
++
++	tx_mcs.rate_n_flags = tx_resp->control.tx_rate;
++
++	rs_get_tbl_info_from_mcs(&tx_mcs, priv->phymode,
++				  &tbl_type, &rs_index);
++	if ((rs_index < 0) || (rs_index >= IWL_RATE_COUNT)) {
++		IWL_DEBUG_RATE("bad rate index at: %d rate 0x%X\n",
++			     rs_index, tx_mcs.rate_n_flags);
++		sta_info_put(sta);
++		return;
++	}
++
++	if (retries &&
++	    (tx_mcs.rate_n_flags !=
++				le32_to_cpu(table->rs_table[0].rate_n_flags))) {
++		IWL_DEBUG_RATE("initial rate does not match 0x%x 0x%x\n",
++				tx_mcs.rate_n_flags,
++				le32_to_cpu(table->rs_table[0].rate_n_flags));
++		sta_info_put(sta);
++		return;
++	}
++
++	while (retries) {
++		tx_mcs.rate_n_flags =
++		    le32_to_cpu(table->rs_table[index].rate_n_flags);
++		rs_get_tbl_info_from_mcs(&tx_mcs, priv->phymode,
++					  &tbl_type, &rs_index);
++
++		if ((tbl_type.lq_type == search_tbl->lq_type) &&
++		    (tbl_type.antenna_type == search_tbl->antenna_type) &&
++		    (tbl_type.is_SGI == search_tbl->is_SGI)) {
++			if (search_tbl->expected_tpt)
++				tpt = search_tbl->expected_tpt[rs_index];
++			else
++				tpt = 0;
++			rs_collect_tx_data(search_win,
++					    rs_index, tpt, 0);
++		} else if ((tbl_type.lq_type == curr_tbl->lq_type) &&
++			   (tbl_type.antenna_type == curr_tbl->antenna_type) &&
++			   (tbl_type.is_SGI == curr_tbl->is_SGI)) {
++			if (curr_tbl->expected_tpt)
++				tpt = curr_tbl->expected_tpt[rs_index];
++			else
++				tpt = 0;
++			rs_collect_tx_data(window, rs_index, tpt, 0);
++		}
++		if (lq->stay_in_tbl)
++			lq->total_failed++;
++		--retries;
++		index++;
++
++	}
++
++	if (!tx_resp->retry_count)
++		tx_mcs.rate_n_flags = tx_resp->control.tx_rate;
++	else
++		tx_mcs.rate_n_flags =
++			le32_to_cpu(table->rs_table[index].rate_n_flags);
++
++	rs_get_tbl_info_from_mcs(&tx_mcs, priv->phymode,
++				  &tbl_type, &rs_index);
++
++	if (tx_resp->flags & IEEE80211_TX_STATUS_ACK)
++		status = 1;
++	else
++		status = 0;
++
++	if ((tbl_type.lq_type == search_tbl->lq_type) &&
++	    (tbl_type.antenna_type == search_tbl->antenna_type) &&
++	    (tbl_type.is_SGI == search_tbl->is_SGI)) {
++		if (search_tbl->expected_tpt)
++			tpt = search_tbl->expected_tpt[rs_index];
++		else
++			tpt = 0;
++		rs_collect_tx_data(search_win,
++				    rs_index, tpt, status);
++	} else if ((tbl_type.lq_type == curr_tbl->lq_type) &&
++		   (tbl_type.antenna_type == curr_tbl->antenna_type) &&
++		   (tbl_type.is_SGI == curr_tbl->is_SGI)) {
++		if (curr_tbl->expected_tpt)
++			tpt = curr_tbl->expected_tpt[rs_index];
++		else
++			tpt = 0;
++		rs_collect_tx_data(window, rs_index, tpt, status);
++	}
++
++	if (lq->stay_in_tbl) {
++		if (status)
++			lq->total_success++;
++		else
++			lq->total_failed++;
++	}
++
++	rs_rate_scale_perform(priv, dev, hdr, sta);
++	sta_info_put(sta);
++	return;
++}
++
++static u8 rs_is_ant_connected(u8 valid_antenna,
++			      enum iwl_antenna_type antenna_type)
++{
++	if (antenna_type == ANT_AUX)
++		return ((valid_antenna & 0x2) ? 1:0);
++	else if (antenna_type == ANT_MAIN)
++		return ((valid_antenna & 0x1) ? 1:0);
++	else if (antenna_type == ANT_BOTH) {
++		if ((valid_antenna & 0x3) == 0x3)
++			return 1;
++		else
++			return 0;
++	}
++
++	return 1;
++}
++
++static u8 rs_is_other_ant_connected(u8 valid_antenna,
++				    enum iwl_antenna_type antenna_type)
++{
++	if (antenna_type == ANT_AUX)
++		return (rs_is_ant_connected(valid_antenna, ANT_MAIN));
++	else
++		return (rs_is_ant_connected(valid_antenna, ANT_AUX));
++
++	return 0;
++}
++
++static void rs_set_stay_in_table(u8 is_legacy,
++				 struct iwl_rate_scale_priv *lq_data)
++{
++	IWL_DEBUG_HT("we are staying in the same table\n");
++	lq_data->stay_in_tbl = 1;
++	if (is_legacy) {
++		lq_data->table_count_limit = IWL_LEGACY_TABLE_COUNT;
++		lq_data->max_failure_limit = IWL_LEGACY_FAILURE_LIMIT;
++		lq_data->max_success_limit = IWL_LEGACY_TABLE_COUNT;
++	} else {
++		lq_data->table_count_limit = IWL_NONE_LEGACY_TABLE_COUNT;
++		lq_data->max_failure_limit = IWL_NONE_LEGACY_FAILURE_LIMIT;
++		lq_data->max_success_limit = IWL_NONE_LEGACY_SUCCESS_LIMIT;
++	}
++	lq_data->table_count = 0;
++	lq_data->total_failed = 0;
++	lq_data->total_success = 0;
++}
++
++static void rs_get_expected_tpt_table(struct iwl_rate_scale_priv *lq_data,
++				      struct iwl_scale_tbl_info *tbl)
++{
++	if (is_legacy(tbl->lq_type)) {
++		if (!is_a_band(tbl->lq_type))
++			tbl->expected_tpt = expected_tpt_G;
++		else
++			tbl->expected_tpt = expected_tpt_A;
++	} else if (is_siso(tbl->lq_type)) {
++		if (tbl->is_fat && !lq_data->is_dup)
++			if (tbl->is_SGI)
++				tbl->expected_tpt = expected_tpt_siso40MHzSGI;
++			else
++				tbl->expected_tpt = expected_tpt_siso40MHz;
++		else if (tbl->is_SGI)
++			tbl->expected_tpt = expected_tpt_siso20MHzSGI;
++		else
++			tbl->expected_tpt = expected_tpt_siso20MHz;
++
++	} else if (is_mimo(tbl->lq_type)) {
++		if (tbl->is_fat && !lq_data->is_dup)
++			if (tbl->is_SGI)
++				tbl->expected_tpt = expected_tpt_mimo40MHzSGI;
++			else
++				tbl->expected_tpt = expected_tpt_mimo40MHz;
++		else if (tbl->is_SGI)
++			tbl->expected_tpt = expected_tpt_mimo20MHzSGI;
++		else
++			tbl->expected_tpt = expected_tpt_mimo20MHz;
++	} else
++		tbl->expected_tpt = expected_tpt_G;
++}
++
++#ifdef CONFIG_IWLWIFI_HT
++static s32 rs_get_best_rate(struct iwl_priv *priv,
++			    struct iwl_rate_scale_priv *lq_data,
++			    struct iwl_scale_tbl_info *tbl,
++			    u16 rate_mask, s8 index, s8 rate)
++{
++	struct iwl_scale_tbl_info *active_tbl =
++	    &(lq_data->lq_info[lq_data->active_tbl]);
++	s32 new_rate, high, low, start_hi;
++	s32 active_sr = active_tbl->win[index].success_ratio;
++	s32 *tpt_tbl = tbl->expected_tpt;
++	s32 active_tpt = active_tbl->expected_tpt[index];
++	u16 high_low;
++
++	new_rate = high = low = start_hi = IWL_RATE_INVALID;
++
++	for (; ;) {
++		high_low = rs_get_adjacent_rate(rate, rate_mask, tbl->lq_type);
++
++		low = high_low & 0xff;
++		high = (high_low >> 8) & 0xff;
++
++		if ((((100 * tpt_tbl[rate]) > lq_data->last_tpt) &&
++		     ((active_sr > IWL_RATE_DECREASE_TH) &&
++		      (active_sr <= IWL_RATE_HIGH_TH) &&
++		      (tpt_tbl[rate] <= active_tpt))) ||
++		    ((active_sr >= IWL_RATE_SCALE_SWITCH) &&
++		     (tpt_tbl[rate] > active_tpt))) {
++
++			if (start_hi != IWL_RATE_INVALID) {
++				new_rate = start_hi;
++				break;
++			}
++			new_rate = rate;
++			if (low != IWL_RATE_INVALID)
++				rate = low;
++			else
++				break;
++		} else {
++			if (new_rate != IWL_RATE_INVALID)
++				break;
++			else if (high != IWL_RATE_INVALID) {
++				start_hi = high;
++				rate = high;
++			} else {
++				new_rate = rate;
++				break;
++			}
++		}
++	}
++
++	return new_rate;
++}
++#endif				/* CONFIG_IWLWIFI_HT */
++
++static inline u8 rs_is_both_ant_supp(u8 valid_antenna)
++{
++	return (rs_is_ant_connected(valid_antenna, ANT_BOTH));
++}
++
++static int rs_switch_to_mimo(struct iwl_priv *priv,
++			     struct iwl_rate_scale_priv *lq_data,
++			     struct iwl_scale_tbl_info *tbl, int index)
++{
++	int rc = -1;
++#ifdef CONFIG_IWLWIFI_HT
++	u16 rate_mask;
++	s32 rate;
++	s8 is_green = lq_data->is_green;
++
++	if (!priv->is_ht_enabled || !priv->current_assoc_ht.is_ht)
++		return -1;
++
++	IWL_DEBUG_HT("LQ: try to switch to MIMO\n");
++	tbl->lq_type = LQ_MIMO;
++	rs_get_supported_rates(lq_data, NULL, tbl->lq_type,
++				&rate_mask);
++
++	if (priv->current_assoc_ht.tx_mimo_ps_mode == IWL_MIMO_PS_STATIC)
++		return -1;
++
++	if (!rs_is_both_ant_supp(lq_data->antenna))
++		return -1;
++
++	rc = 0;
++	tbl->is_dup = lq_data->is_dup;
++	tbl->action = 0;
++	if (priv->current_channel_width == IWL_CHANNEL_WIDTH_40MHZ)
++		tbl->is_fat = 1;
++	else
++		tbl->is_fat = 0;
++
++	if (tbl->is_fat) {
++		if (priv->current_assoc_ht.sgf & HT_SHORT_GI_40MHZ_ONLY)
++			tbl->is_SGI = 1;
++		else
++			tbl->is_SGI = 0;
++	} else if (priv->current_assoc_ht.sgf & HT_SHORT_GI_20MHZ_ONLY)
++		tbl->is_SGI = 1;
++	else
++		tbl->is_SGI = 0;
++
++	rs_get_expected_tpt_table(lq_data, tbl);
++
++	rate = rs_get_best_rate(priv, lq_data, tbl, rate_mask, index, index);
++
++	IWL_DEBUG_HT("LQ: MIMO best rate %d mask %X\n", rate, rate_mask);
++	if ((rate == IWL_RATE_INVALID) || !((1 << rate) & rate_mask))
++		return -1;
++	rs_mcs_from_tbl(&tbl->current_rate, tbl, rate, is_green);
++
++	IWL_DEBUG_HT("LQ: Switch to new mcs %X index is green %X\n",
++		     tbl->current_rate.rate_n_flags, is_green);
++
++#endif				/*CONFIG_IWLWIFI_HT */
++	return rc;
++}
++
++static int rs_switch_to_siso(struct iwl_priv *priv,
++			     struct iwl_rate_scale_priv *lq_data,
++			     struct iwl_scale_tbl_info *tbl, int index)
++{
++	int rc = -1;
++#ifdef CONFIG_IWLWIFI_HT
++	u16 rate_mask;
++	u8 is_green = lq_data->is_green;
++	s32 rate;
++
++	IWL_DEBUG_HT("LQ: try to switch to SISO\n");
++	if (!priv->is_ht_enabled || !priv->current_assoc_ht.is_ht)
++		return -1;
++
++	rc = 0;
++	tbl->is_dup = lq_data->is_dup;
++	tbl->lq_type = LQ_SISO;
++	tbl->action = 0;
++	rs_get_supported_rates(lq_data, NULL, tbl->lq_type,
++				&rate_mask);
++
++	if (priv->current_channel_width == IWL_CHANNEL_WIDTH_40MHZ)
++		tbl->is_fat = 1;
++	else
++		tbl->is_fat = 0;
++
++	if (tbl->is_fat) {
++		if (priv->current_assoc_ht.sgf & HT_SHORT_GI_40MHZ_ONLY)
++			tbl->is_SGI = 1;
++		else
++			tbl->is_SGI = 0;
++	} else if (priv->current_assoc_ht.sgf & HT_SHORT_GI_20MHZ_ONLY)
++		tbl->is_SGI = 1;
++	else
++		tbl->is_SGI = 0;
++
++	if (is_green)
++		tbl->is_SGI = 0;
++
++	rs_get_expected_tpt_table(lq_data, tbl);
++	rate = rs_get_best_rate(priv, lq_data, tbl, rate_mask, index, index);
++
++	IWL_DEBUG_HT("LQ: get best rate %d mask %X\n", rate, rate_mask);
++	if ((rate == IWL_RATE_INVALID) || !((1 << rate) & rate_mask)) {
++		IWL_DEBUG_HT("can not switch with index %d rate mask %x\n",
++			     rate, rate_mask);
++		return -1;
++	}
++	rs_mcs_from_tbl(&tbl->current_rate, tbl, rate, is_green);
++	IWL_DEBUG_HT("LQ: Switch to new mcs %X index is green %X\n",
++		     tbl->current_rate.rate_n_flags, is_green);
++
++#endif				/*CONFIG_IWLWIFI_HT */
++	return rc;
++}
++
++static int rs_move_legacy_other(struct iwl_priv *priv,
++				struct iwl_rate_scale_priv *lq_data,
++				int index)
++{
++	int rc = 0;
++	struct iwl_scale_tbl_info *tbl =
++	    &(lq_data->lq_info[lq_data->active_tbl]);
++	struct iwl_scale_tbl_info *search_tbl =
++	    &(lq_data->lq_info[(1 - lq_data->active_tbl)]);
++	struct iwl_rate_scale_data *window = &(tbl->win[index]);
++	u32 sz = (sizeof(struct iwl_scale_tbl_info) -
++		  (sizeof(struct iwl_rate_scale_data) * IWL_RATE_COUNT));
++	u8 start_action = tbl->action;
++
++	for (; ;) {
++		switch (tbl->action) {
++		case IWL_LEGACY_SWITCH_ANTENNA:
++			IWL_DEBUG_HT("LQ Legacy switch Antenna\n");
++
++			search_tbl->lq_type = LQ_NONE;
++			lq_data->action_counter++;
++			if (window->success_ratio >= IWL_RS_GOOD_RATIO)
++				break;
++			if (!rs_is_other_ant_connected(lq_data->antenna,
++							tbl->antenna_type))
++				break;
++
++			memcpy(search_tbl, tbl, sz);
++
++			rs_toggle_antenna(&(search_tbl->current_rate),
++					   search_tbl);
++			rs_get_expected_tpt_table(lq_data, search_tbl);
++			lq_data->search_better_tbl = 1;
++			goto out;
++
++		case IWL_LEGACY_SWITCH_SISO:
++			IWL_DEBUG_HT("LQ: Legacy switch to SISO\n");
++			memcpy(search_tbl, tbl, sz);
++			search_tbl->lq_type = LQ_SISO;
++			search_tbl->is_SGI = 0;
++			search_tbl->is_fat = 0;
++			rc = rs_switch_to_siso(priv, lq_data, search_tbl,
++					       index);
++			if (!rc) {
++				lq_data->search_better_tbl = 1;
++				lq_data->action_counter = 0;
++			}
++			if (!rc)
++				goto out;
++
++			break;
++		case IWL_LEGACY_SWITCH_MIMO:
++			IWL_DEBUG_HT("LQ: Legacy switch MIMO\n");
++			memcpy(search_tbl, tbl, sz);
++			search_tbl->lq_type = LQ_MIMO;
++			search_tbl->is_SGI = 0;
++			search_tbl->is_fat = 0;
++			search_tbl->antenna_type = ANT_BOTH;
++			rc = rs_switch_to_mimo(priv, lq_data, search_tbl,
++					       index);
++			if (!rc) {
++				lq_data->search_better_tbl = 1;
++				lq_data->action_counter = 0;
++			}
++			if (!rc)
++				goto out;
++			break;
++		}
++		tbl->action++;
++		if (tbl->action > IWL_LEGACY_SWITCH_MIMO)
++			tbl->action = IWL_LEGACY_SWITCH_ANTENNA;
++
++		if (tbl->action == start_action)
++			break;
++
++	}
++	return 0;
++
++ out:
++	tbl->action++;
++	if (tbl->action > IWL_LEGACY_SWITCH_MIMO)
++		tbl->action = IWL_LEGACY_SWITCH_ANTENNA;
++	return 0;
++
++}
++
++static int rs_move_siso_to_other(struct iwl_priv *priv,
++				 struct iwl_rate_scale_priv *lq_data,
++				 int index)
++{
++	int rc = -1;
++	u8 is_green = lq_data->is_green;
++	struct iwl_scale_tbl_info *tbl =
++	    &(lq_data->lq_info[lq_data->active_tbl]);
++	struct iwl_scale_tbl_info *search_tbl =
++	    &(lq_data->lq_info[(1 - lq_data->active_tbl)]);
++	struct iwl_rate_scale_data *window = &(tbl->win[index]);
++	u32 sz = (sizeof(struct iwl_scale_tbl_info) -
++		  (sizeof(struct iwl_rate_scale_data) * IWL_RATE_COUNT));
++	u8 start_action = tbl->action;
++
++	for (;;) {
++		lq_data->action_counter++;
++		switch (tbl->action) {
++		case IWL_SISO_SWITCH_ANTENNA:
++			IWL_DEBUG_HT("LQ: SISO SWITCH ANTENNA SISO\n");
++			search_tbl->lq_type = LQ_NONE;
++			if (window->success_ratio >= IWL_RS_GOOD_RATIO)
++				break;
++			if (!rs_is_other_ant_connected(lq_data->antenna,
++						       tbl->antenna_type))
++				break;
++
++			memcpy(search_tbl, tbl, sz);
++			search_tbl->action = IWL_SISO_SWITCH_MIMO;
++			rs_toggle_antenna(&(search_tbl->current_rate),
++					   search_tbl);
++			lq_data->search_better_tbl = 1;
++
++			goto out;
++
++		case IWL_SISO_SWITCH_MIMO:
++			IWL_DEBUG_HT("LQ: SISO SWITCH TO MIMO FROM SISO\n");
++			memcpy(search_tbl, tbl, sz);
++			search_tbl->lq_type = LQ_MIMO;
++			search_tbl->is_SGI = 0;
++			search_tbl->is_fat = 0;
++			search_tbl->antenna_type = ANT_BOTH;
++			rc = rs_switch_to_mimo(priv, lq_data, search_tbl,
++					       index);
++			if (!rc)
++				lq_data->search_better_tbl = 1;
++
++			if (!rc)
++				goto out;
++			break;
++		case IWL_SISO_SWITCH_GI:
++			IWL_DEBUG_HT("LQ: SISO SWITCH TO GI\n");
++			memcpy(search_tbl, tbl, sz);
++			search_tbl->action = 0;
++			if (search_tbl->is_SGI)
++				search_tbl->is_SGI = 0;
++			else if (!is_green)
++				search_tbl->is_SGI = 1;
++			else
++				break;
++			lq_data->search_better_tbl = 1;
++			if ((tbl->lq_type == LQ_SISO) &&
++			    (tbl->is_SGI)) {
++				s32 tpt = lq_data->last_tpt / 100;
++				if (((!tbl->is_fat) &&
++				     (tpt >= expected_tpt_siso20MHz[index])) ||
++				    ((tbl->is_fat) &&
++				     (tpt >= expected_tpt_siso40MHz[index])))
++					lq_data->search_better_tbl = 0;
++			}
++			rs_get_expected_tpt_table(lq_data, search_tbl);
++			rs_mcs_from_tbl(&search_tbl->current_rate,
++					     search_tbl, index, is_green);
++			goto out;
++		}
++		tbl->action++;
++		if (tbl->action > IWL_SISO_SWITCH_GI)
++			tbl->action = IWL_SISO_SWITCH_ANTENNA;
++
++		if (tbl->action == start_action)
++			break;
++	}
++	return 0;
++
++ out:
++	tbl->action++;
++	if (tbl->action > IWL_SISO_SWITCH_GI)
++		tbl->action = IWL_SISO_SWITCH_ANTENNA;
++	return 0;
++}
++
++static int rs_move_mimo_to_other(struct iwl_priv *priv,
++				 struct iwl_rate_scale_priv *lq_data,
++				 int index)
++{
++	int rc = -1;
++	s8 is_green = lq_data->is_green;
++	struct iwl_scale_tbl_info *tbl =
++	    &(lq_data->lq_info[lq_data->active_tbl]);
++	struct iwl_scale_tbl_info *search_tbl =
++	    &(lq_data->lq_info[(1 - lq_data->active_tbl)]);
++	u32 sz = (sizeof(struct iwl_scale_tbl_info) -
++		  (sizeof(struct iwl_rate_scale_data) * IWL_RATE_COUNT));
++	u8 start_action = tbl->action;
++
++	for (;;) {
++		lq_data->action_counter++;
++		switch (tbl->action) {
++		case IWL_MIMO_SWITCH_ANTENNA_A:
++		case IWL_MIMO_SWITCH_ANTENNA_B:
++			IWL_DEBUG_HT("LQ: MIMO SWITCH TO SISO\n");
++			memcpy(search_tbl, tbl, sz);
++			search_tbl->lq_type = LQ_SISO;
++			search_tbl->is_SGI = 0;
++			search_tbl->is_fat = 0;
++			if (tbl->action == IWL_MIMO_SWITCH_ANTENNA_A)
++				search_tbl->antenna_type = ANT_MAIN;
++			else
++				search_tbl->antenna_type = ANT_AUX;
++
++			rc = rs_switch_to_siso(priv, lq_data, search_tbl,
++					       index);
++			if (!rc) {
++				lq_data->search_better_tbl = 1;
++				goto out;
++			}
++			break;
++
++		case IWL_MIMO_SWITCH_GI:
++			IWL_DEBUG_HT("LQ: MIMO SWITCH TO GI\n");
++			memcpy(search_tbl, tbl, sz);
++			search_tbl->lq_type = LQ_MIMO;
++			search_tbl->antenna_type = ANT_BOTH;
++			search_tbl->action = 0;
++			if (search_tbl->is_SGI)
++				search_tbl->is_SGI = 0;
++			else
++				search_tbl->is_SGI = 1;
++			lq_data->search_better_tbl = 1;
++			if ((tbl->lq_type == LQ_MIMO) &&
++			    (tbl->is_SGI)) {
++				s32 tpt = lq_data->last_tpt / 100;
++				if (((!tbl->is_fat) &&
++				     (tpt >= expected_tpt_mimo20MHz[index])) ||
++				    ((tbl->is_fat) &&
++				     (tpt >= expected_tpt_mimo40MHz[index])))
++					lq_data->search_better_tbl = 0;
++			}
++			rs_get_expected_tpt_table(lq_data, search_tbl);
++			rs_mcs_from_tbl(&search_tbl->current_rate,
++					     search_tbl, index, is_green);
++			goto out;
++
++		}
++		tbl->action++;
++		if (tbl->action > IWL_MIMO_SWITCH_GI)
++			tbl->action = IWL_MIMO_SWITCH_ANTENNA_A;
++
++		if (tbl->action == start_action)
++			break;
++	}
++
++	return 0;
++ out:
++	tbl->action++;
++	if (tbl->action > IWL_MIMO_SWITCH_GI)
++		tbl->action = IWL_MIMO_SWITCH_ANTENNA_A;
++	return 0;
++
++}
++
++static void rs_stay_in_table(struct iwl_rate_scale_priv *lq_data)
++{
++	struct iwl_scale_tbl_info *tbl;
++	int i;
++	int active_tbl;
++	int flush_interval_passed = 0;
++
++	active_tbl = lq_data->active_tbl;
++
++	tbl = &(lq_data->lq_info[active_tbl]);
++
++	if (lq_data->stay_in_tbl) {
++
++		if (lq_data->flush_timer)
++			flush_interval_passed =
++			    time_after(jiffies,
++				       (unsigned long)(lq_data->flush_timer +
++					IWL_RATE_SCALE_FLUSH_INTVL));
++
++		flush_interval_passed = 0;
++		if ((lq_data->total_failed > lq_data->max_failure_limit) ||
++		    (lq_data->total_success > lq_data->max_success_limit) ||
++		    ((!lq_data->search_better_tbl) && (lq_data->flush_timer)
++		     && (flush_interval_passed))) {
++			IWL_DEBUG_HT("LQ: stay is expired %d %d %d\n:",
++				     lq_data->total_failed,
++				     lq_data->total_success,
++				     flush_interval_passed);
++			lq_data->stay_in_tbl = 0;
++			lq_data->total_failed = 0;
++			lq_data->total_success = 0;
++			lq_data->flush_timer = 0;
++		} else if (lq_data->table_count > 0) {
++			lq_data->table_count++;
++			if (lq_data->table_count >=
++			    lq_data->table_count_limit) {
++				lq_data->table_count = 0;
++
++				IWL_DEBUG_HT("LQ: stay in table clear win\n");
++				for (i = 0; i < IWL_RATE_COUNT; i++)
++					rs_rate_scale_clear_window(
++						&(tbl->win[i]));
++			}
++		}
++
++		if (!lq_data->stay_in_tbl) {
++			for (i = 0; i < IWL_RATE_COUNT; i++)
++				rs_rate_scale_clear_window(&(tbl->win[i]));
++		}
++	}
++}
++
++static void rs_rate_scale_perform(struct iwl_priv *priv,
++				  struct net_device *dev,
++				  struct ieee80211_hdr *hdr,
++				  struct sta_info *sta)
++{
++	int low = IWL_RATE_INVALID;
++	int high = IWL_RATE_INVALID;
++	int index;
++	int i;
++	struct iwl_rate_scale_data *window = NULL;
++	int current_tpt = IWL_INVALID_VALUE;
++	int low_tpt = IWL_INVALID_VALUE;
++	int high_tpt = IWL_INVALID_VALUE;
++	u32 fail_count;
++	s8 scale_action = 0;
++	u16 fc, rate_mask;
++	u8 update_lq = 0;
++	struct iwl_rate_scale_priv *lq_data;
++	struct iwl_scale_tbl_info *tbl, *tbl1;
++	u16 rate_scale_index_msk = 0;
++	struct iwl_rate mcs_rate;
++	u8 is_green = 0;
++	u8 active_tbl = 0;
++	u8 done_search = 0;
++	u16 high_low;
++
++	IWL_DEBUG_RATE("rate scale calculate new rate for skb\n");
++
++	fc = le16_to_cpu(hdr->frame_control);
++	if (!ieee80211_is_data(fc) || is_multicast_ether_addr(hdr->addr1)) {
++		/* Send management frames and broadcast/multicast data using
++		 * lowest rate. */
++		/* TODO: this could probably be improved.. */
++		return;
++	}
++
++	if (!sta || !sta->rate_ctrl_priv)
++		return;
++
++	if (!priv->lq_mngr.lq_ready) {
++		IWL_DEBUG_RATE("still rate scaling not ready\n");
++		return;
++	}
++	lq_data = (struct iwl_rate_scale_priv *)sta->rate_ctrl_priv;
++
++	if (!lq_data->search_better_tbl)
++		active_tbl = lq_data->active_tbl;
++	else
++		active_tbl = 1 - lq_data->active_tbl;
++
++	tbl = &(lq_data->lq_info[active_tbl]);
++	is_green = lq_data->is_green;
++
++	index = sta->last_txrate;
++
++	IWL_DEBUG_RATE("Rate scale index %d for type %d\n", index,
++		       tbl->lq_type);
++
++	rs_get_supported_rates(lq_data, hdr, tbl->lq_type,
++				&rate_mask);
++
++	IWL_DEBUG_RATE("mask 0x%04X \n", rate_mask);
++
++	/* mask with station rate restriction */
++	if (is_legacy(tbl->lq_type)) {
++		if (lq_data->phymode == (u8) MODE_IEEE80211A)
++			rate_scale_index_msk = (u16) (rate_mask &
++				(sta->supp_rates << IWL_FIRST_OFDM_RATE));
++		else
++			rate_scale_index_msk = (u16) (rate_mask &
++						      sta->supp_rates);
++
++	} else
++		rate_scale_index_msk = rate_mask;
++
++	if (!rate_scale_index_msk)
++		rate_scale_index_msk = rate_mask;
++
++	if (index < 0 || !((1 << index) & rate_scale_index_msk)) {
++		index = IWL_INVALID_VALUE;
++		update_lq = 1;
++
++		/* get the lowest availabe rate */
++		for (i = 0; i <= IWL_RATE_COUNT; i++) {
++			if ((1 << i) & rate_scale_index_msk)
++				index = i;
++		}
++
++		if (index == IWL_INVALID_VALUE) {
++			IWL_WARNING("Can not find a suitable rate\n");
++			return;
++		}
++	}
++
++	if (!tbl->expected_tpt)
++		rs_get_expected_tpt_table(lq_data, tbl);
++
++	window = &(tbl->win[index]);
++
++	fail_count = window->counter - window->success_counter;
++	if (((fail_count < IWL_RATE_MIN_FAILURE_TH) &&
++	     (window->success_counter < IWL_RATE_MIN_SUCCESS_TH))
++	    || (tbl->expected_tpt == NULL)) {
++		IWL_DEBUG_RATE("LQ: still below TH succ %d total %d "
++			       "for index %d\n",
++			       window->success_counter, window->counter, index);
++		window->average_tpt = IWL_INVALID_VALUE;
++		rs_stay_in_table(lq_data);
++		if (update_lq) {
++			rs_mcs_from_tbl(&mcs_rate, tbl, index, is_green);
++			rs_fill_link_cmd(lq_data, &mcs_rate, &lq_data->lq, sta);
++			rs_send_lq_cmd(priv, &lq_data->lq, CMD_ASYNC);
++		}
++		goto out;
++
++	} else
++		window->average_tpt = ((window->success_ratio *
++					tbl->expected_tpt[index] + 64) / 128);
++
++	if (lq_data->search_better_tbl) {
++		int success_limit = IWL_RATE_SCALE_SWITCH;
++
++		if ((window->success_ratio > success_limit) ||
++		    (window->average_tpt > lq_data->last_tpt)) {
++			if (!is_legacy(tbl->lq_type)) {
++				IWL_DEBUG_HT("LQ: we are switching to HT"
++					     " rate suc %d current tpt %d"
++					     " old tpt %d\n",
++					     window->success_ratio,
++					     window->average_tpt,
++					     lq_data->last_tpt);
++				lq_data->enable_counter = 1;
++			}
++			lq_data->active_tbl = active_tbl;
++			current_tpt = window->average_tpt;
++		} else {
++			tbl->lq_type = LQ_NONE;
++			active_tbl = lq_data->active_tbl;
++			tbl = &(lq_data->lq_info[active_tbl]);
++
++			index = iwl_rate_index_from_plcp(
++				tbl->current_rate.rate_n_flags);
++
++			update_lq = 1;
++			current_tpt = lq_data->last_tpt;
++			IWL_DEBUG_HT("XXY GO BACK TO OLD TABLE\n");
++		}
++		lq_data->search_better_tbl = 0;
++		done_search = 1;
++		goto lq_update;
++	}
++
++	high_low = rs_get_adjacent_rate(index, rate_scale_index_msk,
++					tbl->lq_type);
++	low = high_low & 0xff;
++	high = (high_low >> 8) & 0xff;
++
++	current_tpt = window->average_tpt;
++
++	if (low != IWL_RATE_INVALID)
++		low_tpt = tbl->win[low].average_tpt;
++
++	if (high != IWL_RATE_INVALID)
++		high_tpt = tbl->win[high].average_tpt;
++
++
++	scale_action = 1;
++
++	if ((window->success_ratio <= IWL_RATE_DECREASE_TH) ||
++	    (current_tpt == 0)) {
++		IWL_DEBUG_RATE("decrease rate because of low success_ratio\n");
++		scale_action = -1;
++	} else if ((low_tpt == IWL_INVALID_VALUE) &&
++		   (high_tpt == IWL_INVALID_VALUE))
++		scale_action = 1;
++	else if ((low_tpt != IWL_INVALID_VALUE) &&
++		 (high_tpt != IWL_INVALID_VALUE) &&
++		 (low_tpt < current_tpt) &&
++		 (high_tpt < current_tpt))
++		scale_action = 0;
++	else {
++		if (high_tpt != IWL_INVALID_VALUE) {
++			if (high_tpt > current_tpt)
++				scale_action = 1;
++			else {
++				IWL_DEBUG_RATE
++				    ("decrease rate because of high tpt\n");
++				scale_action = -1;
++			}
++		} else if (low_tpt != IWL_INVALID_VALUE) {
++			if (low_tpt > current_tpt) {
++				IWL_DEBUG_RATE
++				    ("decrease rate because of low tpt\n");
++				scale_action = -1;
++			} else
++				scale_action = 1;
++		}
++	}
++
++	if (scale_action == -1) {
++		if ((low != IWL_RATE_INVALID) &&
++		    ((window->success_ratio > IWL_RATE_HIGH_TH) ||
++		     (current_tpt > (100 * tbl->expected_tpt[low]))))
++			scale_action = 0;
++	} else if ((scale_action == 1) &&
++		   (window->success_ratio < IWL_RATE_INCREASE_TH))
++		scale_action = 0;
++
++	switch (scale_action) {
++	case -1:
++		if (low != IWL_RATE_INVALID) {
++			update_lq = 1;
++			index = low;
++		}
++		break;
++	case 1:
++		if (high != IWL_RATE_INVALID) {
++			update_lq = 1;
++			index = high;
++		}
++
++		break;
++	case 0:
++	default:
++		break;
++	}
++
++	IWL_DEBUG_HT("choose rate scale index %d action %d low %d "
++		    "high %d type %d\n",
++		     index, scale_action, low, high, tbl->lq_type);
++
++ lq_update:
++	if (update_lq) {
++		rs_mcs_from_tbl(&mcs_rate, tbl, index, is_green);
++		rs_fill_link_cmd(lq_data, &mcs_rate, &lq_data->lq, sta);
++		rs_send_lq_cmd(priv, &lq_data->lq, CMD_ASYNC);
++	}
++	rs_stay_in_table(lq_data);
++
++	if (!update_lq && !done_search && !lq_data->stay_in_tbl) {
++		lq_data->last_tpt = current_tpt;
++
++		if (is_legacy(tbl->lq_type))
++			rs_move_legacy_other(priv, lq_data, index);
++		else if (is_siso(tbl->lq_type))
++			rs_move_siso_to_other(priv, lq_data, index);
++		else
++			rs_move_mimo_to_other(priv, lq_data, index);
++
++		if (lq_data->search_better_tbl) {
++			tbl = &(lq_data->lq_info[(1 - lq_data->active_tbl)]);
++			for (i = 0; i < IWL_RATE_COUNT; i++)
++				rs_rate_scale_clear_window(&(tbl->win[i]));
++
++			index = iwl_rate_index_from_plcp(
++					tbl->current_rate.rate_n_flags);
++
++			IWL_DEBUG_HT("Switch current  mcs: %X index: %d\n",
++				     tbl->current_rate.rate_n_flags, index);
++			rs_fill_link_cmd(lq_data, &tbl->current_rate,
++					 &(lq_data->lq), sta);
++			rs_send_lq_cmd(priv, &lq_data->lq, CMD_ASYNC);
++		}
++		tbl1 = &(lq_data->lq_info[lq_data->active_tbl]);
++
++		if (is_legacy(tbl1->lq_type) &&
++#ifdef CONFIG_IWLWIFI_HT
++		    !priv->current_assoc_ht.is_ht &&
++#endif
++		    (lq_data->action_counter >= 1)) {
++			lq_data->action_counter = 0;
++			IWL_DEBUG_HT("LQ: STAY in legacy table\n");
++			rs_set_stay_in_table(1, lq_data);
++		}
++
++		if (lq_data->enable_counter &&
++		    (lq_data->action_counter >= IWL_ACTION_LIMIT)) {
++#ifdef CONFIG_IWLWIFI_HT_AGG
++			if ((lq_data->last_tpt > TID_AGG_TPT_THREHOLD) &&
++			    (priv->lq_mngr.agg_ctrl.auto_agg)) {
++				priv->lq_mngr.agg_ctrl.tid_retry =
++				    TID_ALL_SPECIFIED;
++				schedule_work(&priv->agg_work);
++			}
++#endif /*CONFIG_IWLWIFI_HT_AGG */
++			lq_data->action_counter = 0;
++			rs_set_stay_in_table(0, lq_data);
++		}
++	} else {
++		if ((!update_lq) && (!done_search) && (!lq_data->flush_timer))
++			lq_data->flush_timer = jiffies;
++	}
++
++out:
++	rs_mcs_from_tbl(&tbl->current_rate, tbl, index, is_green);
++	i = index;
++	sta->last_txrate = i;
++
++	/* sta->txrate is an index to A mode rates which start
++	 * at IWL_FIRST_OFDM_RATE
++	 */
++	if (lq_data->phymode == (u8) MODE_IEEE80211A)
++		sta->txrate = i - IWL_FIRST_OFDM_RATE;
++	else
++		sta->txrate = i;
++
++	return;
++}
++
++
++static void rs_initialize_lq(struct iwl_priv *priv,
++			     struct sta_info *sta)
++{
++	int i;
++	struct iwl_rate_scale_priv *lq;
++	struct iwl_scale_tbl_info *tbl;
++	u8 active_tbl = 0;
++	int rate_idx;
++	u8 use_green = rs_use_green(priv);
++	struct iwl_rate mcs_rate;
++
++	if (!sta || !sta->rate_ctrl_priv)
++		goto out;
++
++	lq = (struct iwl_rate_scale_priv *)sta->rate_ctrl_priv;
++	i = sta->last_txrate;
++
++	if ((lq->lq.sta_id == 0xff) &&
++	    (priv->iw_mode == IEEE80211_IF_TYPE_IBSS))
++		goto out;
++
++	if (!lq->search_better_tbl)
++		active_tbl = lq->active_tbl;
++	else
++		active_tbl = 1 - lq->active_tbl;
++
++	tbl = &(lq->lq_info[active_tbl]);
++
++	if ((i < 0) || (i >= IWL_RATE_COUNT))
++		i = 0;
++
++	mcs_rate.rate_n_flags = iwl_rates[i].plcp ;
++	mcs_rate.rate_n_flags |= RATE_MCS_ANT_B_MSK;
++	mcs_rate.rate_n_flags &= ~RATE_MCS_ANT_A_MSK;
++
++	if (i >= IWL_FIRST_CCK_RATE && i <= IWL_LAST_CCK_RATE)
++		mcs_rate.rate_n_flags |= RATE_MCS_CCK_MSK;
++
++	tbl->antenna_type = ANT_AUX;
++	rs_get_tbl_info_from_mcs(&mcs_rate, priv->phymode, tbl, &rate_idx);
++	if (!rs_is_ant_connected(priv->valid_antenna, tbl->antenna_type))
++	    rs_toggle_antenna(&mcs_rate, tbl),
++
++	rs_mcs_from_tbl(&mcs_rate, tbl, rate_idx, use_green);
++	tbl->current_rate.rate_n_flags = mcs_rate.rate_n_flags;
++	rs_get_expected_tpt_table(lq, tbl);
++	rs_fill_link_cmd(lq, &mcs_rate, &(lq->lq), sta);
++	rs_send_lq_cmd(priv, &lq->lq, CMD_ASYNC);
++ out:
++	return;
++}
++
++static struct ieee80211_rate *rs_get_lowest_rate(struct ieee80211_local
++						 *local)
++{
++	struct ieee80211_hw_mode *mode = local->oper_hw_mode;
++	int i;
++
++	for (i = 0; i < mode->num_rates; i++) {
++		struct ieee80211_rate *rate = &mode->rates[i];
++
++		if (rate->flags & IEEE80211_RATE_SUPPORTED)
++			return rate;
++	}
++
++	return &mode->rates[0];
++}
++
++static struct ieee80211_rate *rs_get_rate(void *priv_rate,
++					       struct net_device *dev,
++					       struct sk_buff *skb,
++					       struct rate_control_extra
++					       *extra)
++{
++
++	int i;
++	struct ieee80211_local *local = wdev_priv(dev->ieee80211_ptr);
++	struct ieee80211_hdr *hdr = (struct ieee80211_hdr *)skb->data;
++	struct sta_info *sta;
++	u16 fc;
++	struct iwl_priv *priv = (struct iwl_priv *)priv_rate;
++	struct iwl_rate_scale_priv *lq;
++
++	IWL_DEBUG_RATE("rate scale calculate new rate for skb\n");
++
++	memset(extra, 0, sizeof(*extra));
++
++	fc = le16_to_cpu(hdr->frame_control);
++	if (!ieee80211_is_data(fc) || is_multicast_ether_addr(hdr->addr1)) {
++		/* Send management frames and broadcast/multicast data using
++		 * lowest rate. */
++		/* TODO: this could probably be improved.. */
++		return rs_get_lowest_rate(local);
++	}
++
++	sta = sta_info_get(local, hdr->addr1);
++
++	if (!sta || !sta->rate_ctrl_priv) {
++		if (sta)
++			sta_info_put(sta);
++		return rs_get_lowest_rate(local);
++	}
++
++	lq = (struct iwl_rate_scale_priv *)sta->rate_ctrl_priv;
++	i = sta->last_txrate;
++
++	if ((priv->iw_mode == IEEE80211_IF_TYPE_IBSS) && !lq->ibss_sta_added) {
++		u8 sta_id = iwl_hw_find_station(priv, hdr->addr1);
++
++		if (sta_id == IWL_INVALID_STATION) {
++			IWL_DEBUG_RATE("LQ: ADD station " MAC_FMT "\n",
++					MAC_ARG(hdr->addr1));
++			sta_id = iwl_add_station(priv,
++						 hdr->addr1, 0, CMD_ASYNC);
++		}
++		if ((sta_id != IWL_INVALID_STATION)) {
++			lq->lq.sta_id = sta_id;
++			lq->lq.rs_table[0].rate_n_flags = 0;
++			lq->ibss_sta_added = 1;
++			rs_initialize_lq(priv, sta);
++		}
++		if (!lq->ibss_sta_added)
++			goto done;
++	}
++
++ done:
++	sta_info_put(sta);
++	if ((i < 0) || (i > IWL_RATE_COUNT))
++		return rs_get_lowest_rate(local);
++
++	return &priv->ieee_rates[i];
++}
++
++static void *rs_alloc_sta(void *priv, gfp_t gfp)
++{
++	struct iwl_rate_scale_priv *crl;
++	int i, j;
++
++	IWL_DEBUG_RATE("create station rate scale window\n");
++
++	crl = kzalloc(sizeof(struct iwl_rate_scale_priv), gfp);
++
++	if (crl == NULL)
++		return NULL;
++
++	memset(crl, 0, sizeof(struct iwl_rate_scale_priv));
++	crl->lq.sta_id = 0xff;
++
++	for (j = 0; j < LQ_SIZE; j++)
++		for (i = 0; i < IWL_RATE_COUNT; i++)
++			rs_rate_scale_clear_window(&(crl->lq_info[j].win[i]));
++
++	return crl;
++}
++
++static void rs_rate_init(void *priv_rate, void *priv_sta,
++			 struct ieee80211_local *local,
++			 struct sta_info *sta)
++{
++	int i, j;
++	struct ieee80211_hw_mode *mode = local->oper_hw_mode;
++	struct iwl_priv *priv = (struct iwl_priv *)priv_rate;
++	struct iwl_rate_scale_priv *crl = priv_sta;
++
++	memset(crl, 0, sizeof(struct iwl_rate_scale_priv));
++
++	crl->lq.sta_id = 0xff;
++	crl->flush_timer = 0;
++	sta->txrate = 3;
++	for (j = 0; j < LQ_SIZE; j++)
++		for (i = 0; i < IWL_RATE_COUNT; i++)
++			rs_rate_scale_clear_window(&(crl->lq_info[j].win[i]));
++
++	IWL_DEBUG_RATE("rate scale global init\n");
++	/* TODO: what is a good starting rate for STA? About middle? Maybe not
++	 * the lowest or the highest rate.. Could consider using RSSI from
++	 * previous packets? Need to have IEEE 802.1X auth succeed immediately
++	 * after assoc.. */
++
++	crl->ibss_sta_added = 0;
++	if (priv->iw_mode == IEEE80211_IF_TYPE_AP) {
++		u8 sta_id = iwl_hw_find_station(priv, sta->addr);
++		/* for IBSS the call are from tasklet */
++		IWL_DEBUG_HT("LQ: ADD station " MAC_FMT " \n",
++			     MAC_ARG(sta->addr));
++
++		if (sta_id == IWL_INVALID_STATION) {
++			IWL_DEBUG_RATE("LQ: ADD station " MAC_FMT "\n",
++					MAC_ARG(sta->addr));
++					sta_id = iwl_add_station(priv,
++						 sta->addr, 0, CMD_ASYNC);
++		}
++		if ((sta_id != IWL_INVALID_STATION)) {
++			crl->lq.sta_id = sta_id;
++			crl->lq.rs_table[0].rate_n_flags = 0;
++		}
++		/* FIXME: this is w/a remove it later */
++		priv->assoc_station_added = 1;
++	}
++
++	for (i = 0; i < mode->num_rates; i++) {
++		if ((sta->supp_rates & BIT(i)) &&
++		    (mode->rates[i].flags & IEEE80211_RATE_SUPPORTED))
++			sta->txrate = i;
++	}
++	sta->last_txrate = sta->txrate;
++	/* For MODE_IEEE80211A mode cck rate are at end
++	 * rate table
++	 */
++	if (local->hw.conf.phymode == MODE_IEEE80211A)
++		sta->last_txrate += IWL_FIRST_OFDM_RATE;
++
++	crl->is_dup = priv->is_dup;
++	crl->valid_antenna = priv->valid_antenna;
++	crl->antenna = priv->antenna;
++	crl->is_green = rs_use_green(priv);
++	crl->active_rate = priv->active_rate;
++	crl->active_rate &= ~(0x1000);
++	crl->active_rate_basic = priv->active_rate_basic;
++	crl->phymode = priv->phymode;
++#ifdef CONFIG_IWLWIFI_HT
++	crl->active_siso_rate = (priv->current_assoc_ht.supp_rates[0] << 1);
++	crl->active_siso_rate |= (priv->current_assoc_ht.supp_rates[0] & 0x1);
++	crl->active_siso_rate &= ~((u16)0x2);
++	crl->active_siso_rate = crl->active_siso_rate << IWL_FIRST_OFDM_RATE;
++
++	crl->active_mimo_rate = (priv->current_assoc_ht.supp_rates[1] << 1);
++	crl->active_mimo_rate |= (priv->current_assoc_ht.supp_rates[1] & 0x1);
++	crl->active_mimo_rate &= ~((u16)0x2);
++	crl->active_mimo_rate = crl->active_mimo_rate << IWL_FIRST_OFDM_RATE;
++	IWL_DEBUG_HT("MIMO RATE 0x%X SISO MASK 0x%X\n", crl->active_siso_rate,
++		     crl->active_mimo_rate);
++#endif /*CONFIG_IWLWIFI_HT*/
++
++	if (priv->assoc_station_added)
++		priv->lq_mngr.lq_ready = 1;
++
++	rs_initialize_lq(priv, sta);
++}
++
++static int rs_fill_link_cmd(struct iwl_rate_scale_priv *lq_data,
++			    struct iwl_rate *tx_mcs,
++			    struct iwl_link_quality_cmd *lq_cmd,
++			    struct sta_info *sta)
++{
++	int index = 0;
++	int rc = 0;
++	int rate_idx;
++	u8 ant_toggle_count = 0;
++	u8 use_ht_possible = 1;
++	u8 repeat_cur_rate = 0;
++	struct iwl_rate new_rate;
++	struct iwl_scale_tbl_info tbl_type = { 0 };
++
++	rs_get_tbl_info_from_mcs(tx_mcs, lq_data->phymode,
++				  &tbl_type, &rate_idx);
++
++	if (is_legacy(tbl_type.lq_type)) {
++		ant_toggle_count = 1;
++		repeat_cur_rate = IWL_NUMBER_TRY;
++	} else
++		repeat_cur_rate = IWL_HT_NUMBER_TRY;
++
++	lq_cmd->general_params.mimo_delimiter =
++			is_mimo(tbl_type.lq_type) ? 1 : 0;
++	lq_cmd->rs_table[index].rate_n_flags =
++			cpu_to_le32(tx_mcs->rate_n_flags);
++	new_rate.rate_n_flags = tx_mcs->rate_n_flags;
++
++	if (is_mimo(tbl_type.lq_type) || (tbl_type.antenna_type == ANT_MAIN))
++		lq_cmd->general_params.single_stream_ant_msk = 1;
++	else
++		lq_cmd->general_params.single_stream_ant_msk = 2;
++
++	index++;
++	repeat_cur_rate--;
++
++	while (index < LINK_QUAL_MAX_RETRY_NUM) {
++		while (repeat_cur_rate && (index < LINK_QUAL_MAX_RETRY_NUM)) {
++			if (is_legacy(tbl_type.lq_type)) {
++				if (ant_toggle_count <
++				    NUM_TRY_BEFORE_ANTENNA_TOGGLE)
++					ant_toggle_count++;
++				else {
++					rs_toggle_antenna(&new_rate, &tbl_type);
++					ant_toggle_count = 1;
++				}
++			}
++			lq_cmd->rs_table[index].rate_n_flags =
++					cpu_to_le32(new_rate.rate_n_flags);
++			repeat_cur_rate--;
++			index++;
++		}
++
++		rs_get_tbl_info_from_mcs(&new_rate, lq_data->phymode, &tbl_type,
++						&rate_idx);
++
++		if (is_mimo(tbl_type.lq_type))
++			lq_cmd->general_params.mimo_delimiter = index;
++
++		rs_get_lower_rate(lq_data, &tbl_type, rate_idx,
++				  use_ht_possible, &new_rate, sta);
++
++		if (is_legacy(tbl_type.lq_type)) {
++			if (ant_toggle_count < NUM_TRY_BEFORE_ANTENNA_TOGGLE)
++				ant_toggle_count++;
++			else {
++				rs_toggle_antenna(&new_rate, &tbl_type);
++				ant_toggle_count = 1;
++			}
++			repeat_cur_rate = IWL_NUMBER_TRY;
++		} else
++			repeat_cur_rate = IWL_HT_NUMBER_TRY;
++
++		use_ht_possible = 0;
++
++		lq_cmd->rs_table[index].rate_n_flags =
++				cpu_to_le32(new_rate.rate_n_flags);
++		/* lq_cmd->rs_table[index].rate_n_flags = 0x800d; */
++
++		index++;
++		repeat_cur_rate--;
++	}
++
++	/* lq_cmd->rs_table[0].rate_n_flags = 0x800d; */
++
++	lq_cmd->general_params.dual_stream_ant_msk = 3;
++	lq_cmd->agg_params.agg_dis_start_th = 3;
++	lq_cmd->agg_params.agg_time_limit = cpu_to_le16(4000);
++	return rc;
++}
++
++static void *rs_alloc(struct ieee80211_local *local)
++{
++	return local->hw.priv;
++}
++/* rate scale requires free function to be implemented */
++static void rs_free(void *priv_rate)
++{
++	return;
++}
++
++static void rs_clear(void *priv_rate)
++{
++	struct iwl_priv *priv = (struct iwl_priv *) priv_rate;
++
++	IWL_DEBUG_RATE("enter\n");
++
++	priv->lq_mngr.lq_ready = 0;
++#ifdef CONFIG_IWLWIFI_HT
++#ifdef CONFIG_IWLWIFI_HT_AGG
++	if (priv->lq_mngr.agg_ctrl.granted_ba)
++		iwl4965_turn_off_agg(priv, TID_ALL_SPECIFIED);
++#endif /*CONFIG_IWLWIFI_HT_AGG */
++#endif /* CONFIG_IWLWIFI_HT */
++
++	IWL_DEBUG_RATE("leave\n");
++}
++
++static void rs_free_sta(void *priv, void *priv_sta)
++{
++	struct iwl_rate_scale_priv *rs_priv = priv_sta;
++
++	IWL_DEBUG_RATE("enter\n");
++	kfree(rs_priv);
++	IWL_DEBUG_RATE("leave\n");
++}
++
++
++static struct rate_control_ops rs_ops = {
++	.module = NULL,
++	.name = RS_NAME,
++	.tx_status = rs_tx_status,
++	.get_rate = rs_get_rate,
++	.rate_init = rs_rate_init,
++	.clear = rs_clear,
++	.alloc = rs_alloc,
++	.free = rs_free,
++	.alloc_sta = rs_alloc_sta,
++	.free_sta = rs_free_sta,
++};
++
++int iwl_fill_rs_info(struct ieee80211_hw *hw, char *buf, u8 sta_id)
++{
++	struct ieee80211_local *local = hw_to_local(hw);
++	struct iwl_priv *priv = hw->priv;
++	struct iwl_rate_scale_priv *rs_priv;
++	struct sta_info *sta;
++	int count = 0, i;
++	u32 samples = 0, success = 0, good = 0;
++	unsigned long now = jiffies;
++	u32 max_time = 0;
++	u8 lq_type, antenna;
++
++	sta = sta_info_get(local, priv->stations[sta_id].sta.sta.addr);
++	if (!sta || !sta->rate_ctrl_priv) {
++		if (sta) {
++			sta_info_put(sta);
++			IWL_DEBUG_RATE("leave - no private rate data!\n");
++		} else
++			IWL_DEBUG_RATE("leave - no station!\n");
++		return sprintf(buf, "station %d not found\n", sta_id);
++	}
++
++	rs_priv = (void *)sta->rate_ctrl_priv;
++
++	lq_type = rs_priv->lq_info[rs_priv->active_tbl].lq_type;
++	antenna = rs_priv->lq_info[rs_priv->active_tbl].antenna_type;
++
++	if (is_legacy(lq_type))
++		i = IWL_RATE_54M_INDEX;
++	else
++		i = IWL_RATE_60M_INDEX;
++	while (1) {
++		u64 mask;
++		int j;
++		int active = rs_priv->active_tbl;
++
++		count +=
++		    sprintf(&buf[count], " %2dMbs: ", iwl_rates[i].ieee / 2);
++
++		mask = (1ULL << (IWL_RATE_MAX_WINDOW - 1));
++		for (j = 0; j < IWL_RATE_MAX_WINDOW; j++, mask >>= 1)
++			buf[count++] =
++				(rs_priv->lq_info[active].win[i].data & mask)
++				? '1' : '0';
++
++		samples += rs_priv->lq_info[active].win[i].counter;
++		good += rs_priv->lq_info[active].win[i].success_counter;
++		success += rs_priv->lq_info[active].win[i].success_counter *
++			   iwl_rates[i].ieee;
++
++		if (rs_priv->lq_info[active].win[i].stamp) {
++			int delta =
++				   jiffies_to_msecs(now -
++				   rs_priv->lq_info[active].win[i].stamp);
++
++			if (delta > max_time)
++				max_time = delta;
++
++			count += sprintf(&buf[count], "%5dms\n", delta);
++		} else
++			buf[count++] = '\n';
++
++		j = iwl_get_prev_ieee_rate(i);
++		if (j == i)
++			break;
++		i = j;
++	}
++
++	/* Display the average rate of all samples taken.
++	 *
++	 * NOTE:  We multiple # of samples by 2 since the IEEE measurement
++	 * added from iwl_rates is actually 2X the rate */
++	if (samples)
++		count += sprintf(&buf[count],
++			 "\nAverage rate is %3d.%02dMbs over last %4dms\n"
++			 "%3d%% success (%d good packets over %d tries)\n",
++			 success / (2 * samples), (success * 5 / samples) % 10,
++			 max_time, good * 100 / samples, good, samples);
++	else
++		count += sprintf(&buf[count], "\nAverage rate: 0Mbs\n");
++	count += sprintf(&buf[count], "\nrate scale type %d anntena %d "
++			 "active_search %d rate index %d\n", lq_type, antenna,
++			 rs_priv->search_better_tbl, sta->last_txrate);
++
++	sta_info_put(sta);
++	return count;
++}
++
++void iwl_rate_scale_init(struct ieee80211_hw *hw, s32 sta_id)
++{
++	struct iwl_priv *priv = hw->priv;
++
++	priv->lq_mngr.lq_ready = 1;
++}
++
++void iwl_rate_control_register(struct ieee80211_hw *hw)
++{
++	ieee80211_rate_control_register(&rs_ops);
++}
++
++void iwl_rate_control_unregister(struct ieee80211_hw *hw)
++{
++	ieee80211_rate_control_unregister(&rs_ops);
++}
++
+diff --git a/drivers/net/wireless/iwl-4965-rs.h b/drivers/net/wireless/iwl-4965-rs.h
+new file mode 100644
+index 0000000..c6325f7
+--- /dev/null
++++ b/drivers/net/wireless/iwl-4965-rs.h
+@@ -0,0 +1,266 @@
++/******************************************************************************
++ *
++ * Copyright(c) 2003 - 2007 Intel Corporation. All rights reserved.
++ *
++ * This program is free software; you can redistribute it and/or modify it
++ * under the terms of version 2 of the GNU General Public License as
++ * published by the Free Software Foundation.
++ *
++ * 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.,
++ * 51 Franklin Street, Fifth Floor, Boston, MA 02110, USA
++ *
++ * The full GNU General Public License is included in this distribution in the
++ * file called LICENSE.
++ *
++ * Contact Information:
++ * James P. Ketrenos <ipw2100-admin at linux.intel.com>
++ * Intel Corporation, 5200 N.E. Elam Young Parkway, Hillsboro, OR 97124-6497
++ *
++ *****************************************************************************/
++
++#ifndef __iwl_4965_rs_h__
++#define __iwl_4965_rs_h__
++
++#include "iwl-4965.h"
++
++struct iwl_rate_info {
++	u8 plcp;
++	u8 plcp_siso;
++	u8 plcp_mimo;
++	u8 ieee;
++	u8 prev_ieee;    /* previous rate in IEEE speeds */
++	u8 next_ieee;    /* next rate in IEEE speeds */
++	u8 prev_rs;      /* previous rate used in rs algo */
++	u8 next_rs;      /* next rate used in rs algo */
++	u8 prev_rs_tgg;  /* previous rate used in TGG rs algo */
++	u8 next_rs_tgg;  /* next rate used in TGG rs algo */
++};
++
++enum {
++	IWL_RATE_1M_INDEX = 0,
++	IWL_RATE_2M_INDEX,
++	IWL_RATE_5M_INDEX,
++	IWL_RATE_11M_INDEX,
++	IWL_RATE_6M_INDEX,
++	IWL_RATE_9M_INDEX,
++	IWL_RATE_12M_INDEX,
++	IWL_RATE_18M_INDEX,
++	IWL_RATE_24M_INDEX,
++	IWL_RATE_36M_INDEX,
++	IWL_RATE_48M_INDEX,
++	IWL_RATE_54M_INDEX,
++	IWL_RATE_60M_INDEX,
++	IWL_RATE_COUNT,
++	IWL_RATE_INVM_INDEX = IWL_RATE_COUNT,
++	IWL_RATE_INVALID = IWL_RATE_INVM_INDEX
++};
++
++enum {
++	IWL_FIRST_OFDM_RATE = IWL_RATE_6M_INDEX,
++	IWL_LAST_OFDM_RATE = IWL_RATE_60M_INDEX,
++	IWL_FIRST_CCK_RATE = IWL_RATE_1M_INDEX,
++	IWL_LAST_CCK_RATE = IWL_RATE_11M_INDEX,
++};
++
++/* #define vs. enum to keep from defaulting to 'large integer' */
++#define	IWL_RATE_6M_MASK   (1<<IWL_RATE_6M_INDEX)
++#define	IWL_RATE_9M_MASK   (1<<IWL_RATE_9M_INDEX)
++#define	IWL_RATE_12M_MASK  (1<<IWL_RATE_12M_INDEX)
++#define	IWL_RATE_18M_MASK  (1<<IWL_RATE_18M_INDEX)
++#define	IWL_RATE_24M_MASK  (1<<IWL_RATE_24M_INDEX)
++#define	IWL_RATE_36M_MASK  (1<<IWL_RATE_36M_INDEX)
++#define	IWL_RATE_48M_MASK  (1<<IWL_RATE_48M_INDEX)
++#define	IWL_RATE_54M_MASK  (1<<IWL_RATE_54M_INDEX)
++#define IWL_RATE_60M_MASK  (1<<IWL_RATE_60M_INDEX)
++#define	IWL_RATE_1M_MASK   (1<<IWL_RATE_1M_INDEX)
++#define	IWL_RATE_2M_MASK   (1<<IWL_RATE_2M_INDEX)
++#define	IWL_RATE_5M_MASK   (1<<IWL_RATE_5M_INDEX)
++#define	IWL_RATE_11M_MASK  (1<<IWL_RATE_11M_INDEX)
++
++enum {
++	IWL_RATE_6M_PLCP  = 13,
++	IWL_RATE_9M_PLCP  = 15,
++	IWL_RATE_12M_PLCP = 5,
++	IWL_RATE_18M_PLCP = 7,
++	IWL_RATE_24M_PLCP = 9,
++	IWL_RATE_36M_PLCP = 11,
++	IWL_RATE_48M_PLCP = 1,
++	IWL_RATE_54M_PLCP = 3,
++	IWL_RATE_60M_PLCP = 3,
++	IWL_RATE_1M_PLCP  = 10,
++	IWL_RATE_2M_PLCP  = 20,
++	IWL_RATE_5M_PLCP  = 55,
++	IWL_RATE_11M_PLCP = 110,
++};
++
++/* OFDM HT rate plcp */
++enum {
++	IWL_RATE_SISO_6M_PLCP = 0,
++	IWL_RATE_SISO_12M_PLCP = 1,
++	IWL_RATE_SISO_18M_PLCP = 2,
++	IWL_RATE_SISO_24M_PLCP = 3,
++	IWL_RATE_SISO_36M_PLCP = 4,
++	IWL_RATE_SISO_48M_PLCP = 5,
++	IWL_RATE_SISO_54M_PLCP = 6,
++	IWL_RATE_SISO_60M_PLCP = 7,
++	IWL_RATE_MIMO_6M_PLCP  = 0x8,
++	IWL_RATE_MIMO_12M_PLCP = 0x9,
++	IWL_RATE_MIMO_18M_PLCP = 0xa,
++	IWL_RATE_MIMO_24M_PLCP = 0xb,
++	IWL_RATE_MIMO_36M_PLCP = 0xc,
++	IWL_RATE_MIMO_48M_PLCP = 0xd,
++	IWL_RATE_MIMO_54M_PLCP = 0xe,
++	IWL_RATE_MIMO_60M_PLCP = 0xf,
++	IWL_RATE_SISO_INVM_PLCP,
++	IWL_RATE_MIMO_INVM_PLCP = IWL_RATE_SISO_INVM_PLCP,
++};
++
++enum {
++	IWL_RATE_6M_IEEE  = 12,
++	IWL_RATE_9M_IEEE  = 18,
++	IWL_RATE_12M_IEEE = 24,
++	IWL_RATE_18M_IEEE = 36,
++	IWL_RATE_24M_IEEE = 48,
++	IWL_RATE_36M_IEEE = 72,
++	IWL_RATE_48M_IEEE = 96,
++	IWL_RATE_54M_IEEE = 108,
++	IWL_RATE_60M_IEEE = 120,
++	IWL_RATE_1M_IEEE  = 2,
++	IWL_RATE_2M_IEEE  = 4,
++	IWL_RATE_5M_IEEE  = 11,
++	IWL_RATE_11M_IEEE = 22,
++};
++
++#define IWL_CCK_BASIC_RATES_MASK    \
++       (IWL_RATE_1M_MASK          | \
++	IWL_RATE_2M_MASK)
++
++#define IWL_CCK_RATES_MASK          \
++       (IWL_BASIC_RATES_MASK      | \
++	IWL_RATE_5M_MASK          | \
++	IWL_RATE_11M_MASK)
++
++#define IWL_OFDM_BASIC_RATES_MASK   \
++	(IWL_RATE_6M_MASK         | \
++	IWL_RATE_12M_MASK         | \
++	IWL_RATE_24M_MASK)
++
++#define IWL_OFDM_RATES_MASK         \
++       (IWL_OFDM_BASIC_RATES_MASK | \
++	IWL_RATE_9M_MASK          | \
++	IWL_RATE_18M_MASK         | \
++	IWL_RATE_36M_MASK         | \
++	IWL_RATE_48M_MASK         | \
++	IWL_RATE_54M_MASK)
++
++#define IWL_BASIC_RATES_MASK         \
++	(IWL_OFDM_BASIC_RATES_MASK | \
++	 IWL_CCK_BASIC_RATES_MASK)
++
++#define IWL_RATES_MASK ((1<<IWL_RATE_COUNT)-1)
++
++#define IWL_INVALID_VALUE    -1
++
++#define IWL_MIN_RSSI_VAL                 -100
++#define IWL_MAX_RSSI_VAL                    0
++
++#define IWL_LEGACY_SWITCH_ANTENNA	0
++#define IWL_LEGACY_SWITCH_SISO		1
++#define IWL_LEGACY_SWITCH_MIMO	        2
++
++#define IWL_RS_GOOD_RATIO		12800
++
++#define IWL_ACTION_LIMIT		3
++#define IWL_LEGACY_FAILURE_LIMIT	160
++#define IWL_LEGACY_SUCCESS_LIMIT	480
++#define IWL_LEGACY_TABLE_COUNT		160
++
++#define IWL_NONE_LEGACY_FAILURE_LIMIT	400
++#define IWL_NONE_LEGACY_SUCCESS_LIMIT	4500
++#define IWL_NONE_LEGACY_TABLE_COUNT	1500
++
++#define IWL_RATE_SCALE_SWITCH		(10880)
++
++#define IWL_SISO_SWITCH_ANTENNA		0
++#define IWL_SISO_SWITCH_MIMO		1
++#define IWL_SISO_SWITCH_GI		2
++
++#define IWL_MIMO_SWITCH_ANTENNA_A	0
++#define IWL_MIMO_SWITCH_ANTENNA_B	1
++#define IWL_MIMO_SWITCH_GI		2
++
++#define LQ_SIZE		2
++
++extern const struct iwl_rate_info iwl_rates[IWL_RATE_COUNT];
++
++enum iwl_table_type {
++	LQ_NONE,
++	LQ_G,
++	LQ_A,
++	LQ_SISO,
++	LQ_MIMO,
++	LQ_MAX,
++};
++
++enum iwl_antenna_type {
++	ANT_NONE,
++	ANT_MAIN,
++	ANT_AUX,
++	ANT_BOTH,
++};
++
++static inline u8 iwl_get_prev_ieee_rate(u8 rate_index)
++{
++	u8 rate = iwl_rates[rate_index].prev_ieee;
++
++	if (rate == IWL_RATE_INVALID)
++		rate = rate_index;
++	return rate;
++}
++
++extern int iwl_rate_index_from_plcp(int plcp);
++
++/**
++ * iwl_fill_rs_info - Fill an output text buffer with the rate representation
++ *
++ * NOTE:  This is provided as a quick mechanism for a user to visualize
++ * the performance of the rate control alogirthm and is not meant to be
++ * parsed software.
++ */
++extern int iwl_fill_rs_info(struct ieee80211_hw *, char *buf, u8 sta_id);
++
++/**
++ * iwl_rate_scale_init - Initialize the rate scale table based on assoc info
++ *
++ * The specific througput table used is based on the type of network
++ * the associated with, including A, B, G, and G w/ TGG protection
++ */
++extern void iwl_rate_scale_init(struct ieee80211_hw *hw, s32 sta_id);
++
++/**
++ * iwl_rate_control_register - Register the rate control algorithm callbacks
++ *
++ * Since the rate control algorithm is hardware specific, there is no need
++ * or reason to place it as a stand alone module.  The driver can call
++ * iwl_rate_control_register in order to register the rate control callbacks
++ * with the mac80211 subsystem.  This should be performed prior to calling
++ * ieee80211_register_hw
++ *
++ */
++extern void iwl_rate_control_register(struct ieee80211_hw *hw);
++
++/**
++ * iwl_rate_control_unregister - Unregister the rate control callbacks
++ *
++ * This should be called after calling ieee80211_unregister_hw, but before
++ * the driver is unloaded.
++ */
++extern void iwl_rate_control_unregister(struct ieee80211_hw *hw);
++
++#endif
+diff --git a/drivers/net/wireless/iwl-4965.c b/drivers/net/wireless/iwl-4965.c
+new file mode 100644
+index 0000000..ba35b3a
+--- /dev/null
++++ b/drivers/net/wireless/iwl-4965.c
+@@ -0,0 +1,4719 @@
++/******************************************************************************
++ *
++ * Copyright(c) 2003 - 2007 Intel Corporation. All rights reserved.
++ *
++ * This program is free software; you can redistribute it and/or modify it
++ * under the terms of version 2 of the GNU General Public License as
++ * published by the Free Software Foundation.
++ *
++ * 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.,
++ * 51 Franklin Street, Fifth Floor, Boston, MA 02110, USA
++ *
++ * The full GNU General Public License is included in this distribution in the
++ * file called LICENSE.
++ *
++ * Contact Information:
++ * James P. Ketrenos <ipw2100-admin at linux.intel.com>
++ * Intel Corporation, 5200 N.E. Elam Young Parkway, Hillsboro, OR 97124-6497
++ *
++ *****************************************************************************/
++
++#include <linux/kernel.h>
++#include <linux/module.h>
++#include <linux/version.h>
++#include <linux/init.h>
++#include <linux/pci.h>
++#include <linux/dma-mapping.h>
++#include <linux/delay.h>
++#include <linux/skbuff.h>
++#include <linux/netdevice.h>
++#include <linux/wireless.h>
++#include <net/mac80211.h>
++#include <linux/netdevice.h>
++#include <linux/etherdevice.h>
++#include <linux/delay.h>
++
++#include "iwlwifi.h"
++#include "iwl-4965.h"
++#include "iwl-helpers.h"
++
++#define IWL_DECLARE_RATE_INFO(r, s, ip, in, rp, rn, pp, np)    \
++	[IWL_RATE_##r##M_INDEX] = { IWL_RATE_##r##M_PLCP,      \
++				    IWL_RATE_SISO_##s##M_PLCP, \
++				    IWL_RATE_MIMO_##s##M_PLCP, \
++				    IWL_RATE_##r##M_IEEE,      \
++				    IWL_RATE_##ip##M_INDEX,    \
++				    IWL_RATE_##in##M_INDEX,    \
++				    IWL_RATE_##rp##M_INDEX,    \
++				    IWL_RATE_##rn##M_INDEX,    \
++				    IWL_RATE_##pp##M_INDEX,    \
++				    IWL_RATE_##np##M_INDEX }
++
++/*
++ * Parameter order:
++ *   rate, ht rate, prev rate, next rate, prev tgg rate, next tgg rate
++ *
++ * If there isn't a valid next or previous rate then INV is used which
++ * maps to IWL_RATE_INVALID
++ *
++ */
++const struct iwl_rate_info iwl_rates[IWL_RATE_COUNT] = {
++	IWL_DECLARE_RATE_INFO(1, INV, INV, 2, INV, 2, INV, 2),    /*  1mbps */
++	IWL_DECLARE_RATE_INFO(2, INV, 1, 5, 1, 5, 1, 5),          /*  2mbps */
++	IWL_DECLARE_RATE_INFO(5, INV, 2, 6, 2, 11, 2, 11),        /*5.5mbps */
++	IWL_DECLARE_RATE_INFO(11, INV, 9, 12, 9, 12, 5, 18),      /* 11mbps */
++	IWL_DECLARE_RATE_INFO(6, 6, 5, 9, 5, 11, 5, 11),        /*  6mbps */
++	IWL_DECLARE_RATE_INFO(9, 6, 6, 11, 6, 11, 5, 11),       /*  9mbps */
++	IWL_DECLARE_RATE_INFO(12, 12, 11, 18, 11, 18, 11, 18),   /* 12mbps */
++	IWL_DECLARE_RATE_INFO(18, 18, 12, 24, 12, 24, 11, 24),   /* 18mbps */
++	IWL_DECLARE_RATE_INFO(24, 24, 18, 36, 18, 36, 18, 36),   /* 24mbps */
++	IWL_DECLARE_RATE_INFO(36, 36, 24, 48, 24, 48, 24, 48),   /* 36mbps */
++	IWL_DECLARE_RATE_INFO(48, 48, 36, 54, 36, 54, 36, 54),   /* 48mbps */
++	IWL_DECLARE_RATE_INFO(54, 54, 48, INV, 48, INV, 48, INV),/* 54mbps */
++	IWL_DECLARE_RATE_INFO(60, 60, 48, INV, 48, INV, 48, INV),/* 60mbps */
++};
++
++static int is_fat_channel(__le32 rxon_flags)
++{
++	return (rxon_flags & RXON_FLG_CHANNEL_MODE_PURE_40_MSK) ||
++		(rxon_flags & RXON_FLG_CHANNEL_MODE_MIXED_MSK);
++}
++
++static u8 is_single_stream(struct iwl_priv *priv)
++{
++#ifdef CONFIG_IWLWIFI_HT
++	if (!priv->is_ht_enabled || !priv->current_assoc_ht.is_ht ||
++	    (priv->active_rate_ht[1] == 0) ||
++	    (priv->ps_mode == IWL_MIMO_PS_STATIC))
++		return 1;
++#else
++	return 1;
++#endif	/*CONFIG_IWLWIFI_HT */
++	return 0;
++}
++
++/*
++ * Determine how many receiver/antenna chains to use.
++ * More provides better reception via diversity.  Fewer saves power.
++ * MIMO (dual stream) requires at least 2, but works better with 3.
++ * This does not determine *which* chains to use, just how many.
++ */
++static int iwl4965_get_rx_chain_counter(struct iwl_priv *priv,
++					u8 *idle_state, u8 *rx_state)
++{
++	u8 is_single = is_single_stream(priv);
++	u8 is_cam = test_bit(STATUS_POWER_PMI, &priv->status) ? 0 : 1;
++
++	/* # of Rx chains to use when expecting MIMO. */
++	if (is_single || (!is_cam && (priv->ps_mode == IWL_MIMO_PS_STATIC)))
++		*rx_state = 2;
++	else
++		*rx_state = 3;
++
++	/* # Rx chains when idling and maybe trying to save power */
++	switch (priv->ps_mode) {
++	case IWL_MIMO_PS_STATIC:
++	case IWL_MIMO_PS_DYNAMIC:
++		*idle_state = (is_cam) ? 2 : 1;
++		break;
++	case IWL_MIMO_PS_NONE:
++		*idle_state = (is_cam) ? *rx_state : 1;
++		break;
++	default:
++		*idle_state = 1;
++		break;
++	}
++
++	return 0;
++}
++
++int iwl_hw_rxq_stop(struct iwl_priv *priv)
++{
++	int rc;
++	unsigned long flags;
++
++	spin_lock_irqsave(&priv->lock, flags);
++	rc = iwl_grab_restricted_access(priv);
++	if (rc) {
++		spin_unlock_irqrestore(&priv->lock, flags);
++		return rc;
++	}
++
++	/* stop HW */
++	iwl_write_restricted(priv, FH_MEM_RCSR_CHNL0_CONFIG_REG, 0);
++	rc = iwl_poll_restricted_bit(priv, FH_MEM_RSSR_RX_STATUS_REG,
++				     (1 << 24), 1000);
++	if (rc < 0)
++		IWL_ERROR("Can't stop Rx DMA.\n");
++
++	iwl_release_restricted_access(priv);
++	spin_unlock_irqrestore(&priv->lock, flags);
++
++	return 0;
++}
++
++u8 iwl_hw_find_station(struct iwl_priv *priv, const u8 *addr)
++{
++	int i;
++	int start = 0;
++	int ret = IWL_INVALID_STATION;
++	unsigned long flags;
++
++	if ((priv->iw_mode == IEEE80211_IF_TYPE_IBSS) ||
++	    (priv->iw_mode == IEEE80211_IF_TYPE_AP))
++		start = IWL_STA_ID;
++
++	if (is_broadcast_ether_addr(addr))
++		return IWL4965_BROADCAST_ID;
++
++	spin_lock_irqsave(&priv->sta_lock, flags);
++	for (i = start; i < priv->hw_setting.max_stations; i++)
++		if ((priv->stations[i].used) &&
++		    (!compare_ether_addr
++		     (priv->stations[i].sta.sta.addr, addr))) {
++			ret = i;
++			goto out;
++		}
++
++	IWL_DEBUG_ASSOC("can not find STA " MAC_FMT " total %d\n",
++			MAC_ARG(addr), priv->num_stations);
++
++ out:
++	spin_unlock_irqrestore(&priv->sta_lock, flags);
++	return ret;
++}
++
++static int iwl4965_nic_set_pwr_src(struct iwl_priv *priv, int pwr_max)
++{
++	int rc = 0;
++	unsigned long flags;
++
++	spin_lock_irqsave(&priv->lock, flags);
++	rc = iwl_grab_restricted_access(priv);
++	if (rc) {
++		spin_unlock_irqrestore(&priv->lock, flags);
++		return rc;
++	}
++
++	if (!pwr_max) {
++		u32 val;
++
++		rc = pci_read_config_dword(priv->pci_dev, PCI_POWER_SOURCE,
++					   &val);
++
++		if (val & PCI_CFG_PMC_PME_FROM_D3COLD_SUPPORT)
++			iwl_set_bits_mask_restricted_reg(
++				priv, APMG_PS_CTRL_REG,
++				APMG_PS_CTRL_VAL_PWR_SRC_VAUX,
++				~APMG_PS_CTRL_MSK_PWR_SRC);
++	} else
++		iwl_set_bits_mask_restricted_reg(
++			priv, APMG_PS_CTRL_REG,
++			APMG_PS_CTRL_VAL_PWR_SRC_VMAIN,
++			~APMG_PS_CTRL_MSK_PWR_SRC);
++
++	iwl_release_restricted_access(priv);
++	spin_unlock_irqrestore(&priv->lock, flags);
++
++	return rc;
++}
++
++static int iwl4965_rx_init(struct iwl_priv *priv, struct iwl_rx_queue *rxq)
++{
++	int rc;
++	unsigned long flags;
++
++	spin_lock_irqsave(&priv->lock, flags);
++	rc = iwl_grab_restricted_access(priv);
++	if (rc) {
++		spin_unlock_irqrestore(&priv->lock, flags);
++		return rc;
++	}
++
++	/* stop HW */
++	iwl_write_restricted(priv, FH_MEM_RCSR_CHNL0_CONFIG_REG, 0);
++
++	iwl_write_restricted(priv, FH_RSCSR_CHNL0_RBDCB_WPTR_REG, 0);
++	iwl_write_restricted(priv, FH_RSCSR_CHNL0_RBDCB_BASE_REG,
++			     rxq->dma_addr >> 8);
++
++	iwl_write_restricted(priv, FH_RSCSR_CHNL0_STTS_WPTR_REG,
++			     (priv->hw_setting.shared_phys +
++			      offsetof(struct iwl_shared, val0)) >> 4);
++
++	iwl_write_restricted(priv, FH_MEM_RCSR_CHNL0_CONFIG_REG,
++			     FH_RCSR_RX_CONFIG_CHNL_EN_ENABLE_VAL |
++			     FH_RCSR_CHNL0_RX_CONFIG_IRQ_DEST_INT_HOST_VAL |
++			     IWL_FH_RCSR_RX_CONFIG_REG_VAL_RB_SIZE_4K |
++			     /*0x10 << 4 | */
++			     (RX_QUEUE_SIZE_LOG <<
++			      FH_RCSR_RX_CONFIG_RBDCB_SIZE_BITSHIFT));
++
++	/*
++	 * iwl_write32(priv,CSR_INT_COAL_REG,0);
++	 */
++
++	iwl_release_restricted_access(priv);
++	spin_unlock_irqrestore(&priv->lock, flags);
++
++	return 0;
++}
++
++static int iwl4965_kw_init(struct iwl_priv *priv)
++{
++	unsigned long flags;
++	int rc;
++
++	spin_lock_irqsave(&priv->lock, flags);
++	rc = iwl_grab_restricted_access(priv);
++	if (rc)
++		goto out;
++
++	iwl_write_restricted(priv, IWL_FH_KW_MEM_ADDR_REG,
++			     priv->kw.dma_addr >> 4);
++	iwl_release_restricted_access(priv);
++out:
++	spin_unlock_irqrestore(&priv->lock, flags);
++	return rc;
++}
++
++static int iwl4965_kw_alloc(struct iwl_priv *priv)
++{
++	struct pci_dev *dev = priv->pci_dev;
++	struct iwl_kw *kw = &priv->kw;
++
++	kw->size = IWL4965_KW_SIZE;	/* TBW need set somewhere else */
++	kw->v_addr = pci_alloc_consistent(dev, kw->size, &kw->dma_addr);
++	if (!kw->v_addr)
++		return -ENOMEM;
++
++	return 0;
++}
++
++#define CHECK_AND_PRINT(x) ((eeprom_ch->flags & EEPROM_CHANNEL_##x) \
++			    ? # x " " : "")
++
++int iwl4965_set_fat_chan_info(struct iwl_priv *priv, int phymode, u16 channel,
++			      const struct iwl_eeprom_channel *eeprom_ch,
++			      u8 fat_extension_channel)
++{
++	struct iwl_channel_info *ch_info;
++
++	ch_info = (struct iwl_channel_info *)
++			iwl_get_channel_info(priv, phymode, channel);
++
++	if (!is_channel_valid(ch_info))
++		return -1;
++
++	IWL_DEBUG_INFO("FAT Ch. %d [%sGHz] %s%s%s%s%s%s(0x%02x"
++			" %ddBm): Ad-Hoc %ssupported\n",
++			ch_info->channel,
++			is_channel_a_band(ch_info) ?
++			"5.2" : "2.4",
++			CHECK_AND_PRINT(IBSS),
++			CHECK_AND_PRINT(ACTIVE),
++			CHECK_AND_PRINT(RADAR),
++			CHECK_AND_PRINT(WIDE),
++			CHECK_AND_PRINT(NARROW),
++			CHECK_AND_PRINT(DFS),
++			eeprom_ch->flags,
++			eeprom_ch->max_power_avg,
++			((eeprom_ch->flags & EEPROM_CHANNEL_IBSS)
++			 && !(eeprom_ch->flags & EEPROM_CHANNEL_RADAR)) ?
++			"" : "not ");
++
++	ch_info->fat_eeprom = *eeprom_ch;
++	ch_info->fat_max_power_avg = eeprom_ch->max_power_avg;
++	ch_info->fat_curr_txpow = eeprom_ch->max_power_avg;
++	ch_info->fat_min_power = 0;
++	ch_info->fat_scan_power = eeprom_ch->max_power_avg;
++	ch_info->fat_flags = eeprom_ch->flags;
++	ch_info->fat_extension_channel = fat_extension_channel;
++
++	return 0;
++}
++
++static void iwl4965_kw_free(struct iwl_priv *priv)
++{
++	struct pci_dev *dev = priv->pci_dev;
++	struct iwl_kw *kw = &priv->kw;
++
++	if (kw->v_addr) {
++		pci_free_consistent(dev, kw->size, kw->v_addr, kw->dma_addr);
++		memset(kw, 0, sizeof(*kw));
++	}
++}
++
++/**
++ * iwl4965_txq_ctx_reset - Reset TX queue context
++ * Destroys all DMA structures and initialise them again
++ *
++ * @param priv
++ * @return error code
++ */
++static int iwl4965_txq_ctx_reset(struct iwl_priv *priv)
++{
++	int rc = 0;
++	int txq_id, slots_num;
++	unsigned long flags;
++
++	iwl4965_kw_free(priv);
++
++	iwl_hw_txq_ctx_free(priv);
++
++	/* Tx CMD queue */
++	rc = iwl4965_kw_alloc(priv);
++	if (rc) {
++		IWL_ERROR("Keep Warm allocation failed");
++		goto error_kw;
++	}
++
++	spin_lock_irqsave(&priv->lock, flags);
++
++	rc = iwl_grab_restricted_access(priv);
++	if (unlikely(rc)) {
++		IWL_ERROR("TX reset failed");
++		spin_unlock_irqrestore(&priv->lock, flags);
++		goto error_reset;
++	}
++
++	iwl_write_restricted_reg(priv, SCD_TXFACT, 0);
++	iwl_release_restricted_access(priv);
++	spin_unlock_irqrestore(&priv->lock, flags);
++
++	rc = iwl4965_kw_init(priv);
++	if (rc) {
++		IWL_ERROR("kw_init failed\n");
++		goto error_reset;
++	}
++
++	/* Tx queue(s) */
++	for (txq_id = 0; txq_id < priv->hw_setting.max_txq_num; txq_id++) {
++		slots_num = (txq_id == IWL_CMD_QUEUE_NUM) ?
++					TFD_CMD_SLOTS : TFD_TX_CMD_SLOTS;
++		rc = iwl_tx_queue_init(priv, &priv->txq[txq_id], slots_num,
++				       txq_id);
++		if (rc) {
++			IWL_ERROR("Tx %d queue init failed\n", txq_id);
++			goto error;
++		}
++	}
++
++	return rc;
++
++ error:
++	iwl_hw_txq_ctx_free(priv);
++ error_reset:
++	iwl4965_kw_free(priv);
++ error_kw:
++	return rc;
++}
++
++int iwl_hw_nic_init(struct iwl_priv *priv)
++{
++	int rc;
++	unsigned long flags;
++	struct iwl_rx_queue *rxq = &priv->rxq;
++	u8 rev_id;
++	u32 val;
++	u8 val_link;
++
++	iwl_power_init_handle(priv);
++
++	/* nic_init */
++	spin_lock_irqsave(&priv->lock, flags);
++
++	iwl_set_bit(priv, CSR_GIO_CHICKEN_BITS,
++		    CSR_GIO_CHICKEN_BITS_REG_BIT_DIS_L0S_EXIT_TIMER);
++
++	iwl_set_bit(priv, CSR_GP_CNTRL, CSR_GP_CNTRL_REG_FLAG_INIT_DONE);
++	rc = iwl_poll_bit(priv, CSR_GP_CNTRL,
++			  CSR_GP_CNTRL_REG_FLAG_MAC_CLOCK_READY,
++			  CSR_GP_CNTRL_REG_FLAG_MAC_CLOCK_READY, 25000);
++	if (rc < 0) {
++		spin_unlock_irqrestore(&priv->lock, flags);
++		IWL_DEBUG_INFO("Failed to init the card\n");
++		return rc;
++	}
++
++	rc = iwl_grab_restricted_access(priv);
++	if (rc) {
++		spin_unlock_irqrestore(&priv->lock, flags);
++		return rc;
++	}
++
++	iwl_read_restricted_reg(priv, APMG_CLK_CTRL_REG);
++
++	iwl_write_restricted_reg(priv, APMG_CLK_CTRL_REG,
++				 APMG_CLK_VAL_DMA_CLK_RQT |
++				 APMG_CLK_VAL_BSM_CLK_RQT);
++	iwl_read_restricted_reg(priv, APMG_CLK_CTRL_REG);
++
++	udelay(20);
++
++	iwl_set_bits_restricted_reg(priv, APMG_PCIDEV_STT_REG,
++				    APMG_PCIDEV_STT_VAL_L1_ACT_DIS);
++
++	iwl_release_restricted_access(priv);
++	iwl_write32(priv, CSR_INT_COALESCING, 512 / 32);
++	spin_unlock_irqrestore(&priv->lock, flags);
++
++	/* Determine HW type */
++	rc = pci_read_config_byte(priv->pci_dev, PCI_REVISION_ID, &rev_id);
++	if (rc)
++		return rc;
++
++	IWL_DEBUG_INFO("HW Revision ID = 0x%X\n", rev_id);
++
++	iwl4965_nic_set_pwr_src(priv, 1);
++	spin_lock_irqsave(&priv->lock, flags);
++
++	if ((rev_id & 0x80) == 0x80 && (rev_id & 0x7f) < 8) {
++		pci_read_config_dword(priv->pci_dev, PCI_REG_WUM8, &val);
++		/* Enable No Snoop field */
++		pci_write_config_dword(priv->pci_dev, PCI_REG_WUM8,
++				       val & ~(1 << 11));
++	}
++
++	spin_unlock_irqrestore(&priv->lock, flags);
++
++	/* Read the EEPROM */
++	rc = iwl_eeprom_init(priv);
++	if (rc)
++		return rc;
++
++	if (priv->eeprom.calib_version < EEPROM_TX_POWER_VERSION_NEW) {
++		IWL_ERROR("Older EEPROM detected!  Aborting.\n");
++		return -EINVAL;
++	}
++
++	pci_read_config_byte(priv->pci_dev, PCI_LINK_CTRL, &val_link);
++
++	/* disable L1 entry -- workaround for pre-B1 */
++	pci_write_config_byte(priv->pci_dev, PCI_LINK_CTRL, val_link & ~0x02);
++
++	spin_lock_irqsave(&priv->lock, flags);
++
++	/* set CSR_HW_CONFIG_REG for uCode use */
++
++	iwl_set_bit(priv, CSR_SW_VER, CSR_HW_IF_CONFIG_REG_BIT_KEDRON_R |
++		    CSR_HW_IF_CONFIG_REG_BIT_RADIO_SI |
++		    CSR_HW_IF_CONFIG_REG_BIT_MAC_SI);
++
++	rc = iwl_grab_restricted_access(priv);
++	if (rc < 0) {
++		spin_unlock_irqrestore(&priv->lock, flags);
++		IWL_DEBUG_INFO("Failed to init the card\n");
++		return rc;
++	}
++
++	iwl_read_restricted_reg(priv, APMG_PS_CTRL_REG);
++	iwl_set_bits_restricted_reg(priv, APMG_PS_CTRL_REG,
++				    APMG_PS_CTRL_VAL_RESET_REQ);
++	udelay(5);
++	iwl_clear_bits_restricted_reg(priv, APMG_PS_CTRL_REG,
++				      APMG_PS_CTRL_VAL_RESET_REQ);
++
++	iwl_release_restricted_access(priv);
++	spin_unlock_irqrestore(&priv->lock, flags);
++
++	iwl_hw_card_show_info(priv);
++
++	/* end nic_init */
++
++	/* Allocate the RX queue, or reset if it is already allocated */
++	if (!rxq->bd) {
++		rc = iwl_rx_queue_alloc(priv);
++		if (rc) {
++			IWL_ERROR("Unable to initialize Rx queue\n");
++			return -ENOMEM;
++		}
++	} else
++		iwl_rx_queue_reset(priv, rxq);
++
++	iwl_rx_replenish(priv);
++
++	iwl4965_rx_init(priv, rxq);
++
++	spin_lock_irqsave(&priv->lock, flags);
++
++	rxq->need_update = 1;
++	iwl_rx_queue_update_write_ptr(priv, rxq);
++
++	spin_unlock_irqrestore(&priv->lock, flags);
++	rc = iwl4965_txq_ctx_reset(priv);
++	if (rc)
++		return rc;
++
++	if (priv->eeprom.sku_cap & EEPROM_SKU_CAP_SW_RF_KILL_ENABLE)
++		IWL_DEBUG_RF_KILL("SW RF KILL supported in EEPROM.\n");
++
++	if (priv->eeprom.sku_cap & EEPROM_SKU_CAP_HW_RF_KILL_ENABLE)
++		IWL_DEBUG_RF_KILL("HW RF KILL supported in EEPROM.\n");
++
++	set_bit(STATUS_INIT, &priv->status);
++
++	return 0;
++}
++
++int iwl_hw_nic_stop_master(struct iwl_priv *priv)
++{
++	int rc = 0;
++	u32 reg_val;
++	unsigned long flags;
++
++	spin_lock_irqsave(&priv->lock, flags);
++
++	/* set stop master bit */
++	iwl_set_bit(priv, CSR_RESET, CSR_RESET_REG_FLAG_STOP_MASTER);
++
++	reg_val = iwl_read32(priv, CSR_GP_CNTRL);
++
++	if (CSR_GP_CNTRL_REG_FLAG_MAC_POWER_SAVE ==
++	    (reg_val & CSR_GP_CNTRL_REG_MSK_POWER_SAVE_TYPE))
++		IWL_DEBUG_INFO("Card in power save, master is already "
++			       "stopped\n");
++	else {
++		rc = iwl_poll_bit(priv, CSR_RESET,
++				  CSR_RESET_REG_FLAG_MASTER_DISABLED,
++				  CSR_RESET_REG_FLAG_MASTER_DISABLED, 100);
++		if (rc < 0) {
++			spin_unlock_irqrestore(&priv->lock, flags);
++			return rc;
++		}
++	}
++
++	spin_unlock_irqrestore(&priv->lock, flags);
++	IWL_DEBUG_INFO("stop master\n");
++
++	return rc;
++}
++
++void iwl_hw_txq_ctx_stop(struct iwl_priv *priv)
++{
++
++	int txq_id;
++	unsigned long flags;
++
++	/* reset TFD queues */
++	for (txq_id = 0; txq_id < priv->hw_setting.max_txq_num; txq_id++) {
++		spin_lock_irqsave(&priv->lock, flags);
++		if (iwl_grab_restricted_access(priv)) {
++			spin_unlock_irqrestore(&priv->lock, flags);
++			continue;
++		}
++
++		iwl_write_restricted(priv,
++				     IWL_FH_TCSR_CHNL_TX_CONFIG_REG(txq_id),
++				     0x0);
++		iwl_poll_restricted_bit(priv, IWL_FH_TSSR_TX_STATUS_REG,
++					IWL_FH_TSSR_TX_STATUS_REG_MSK_CHNL_IDLE
++					(txq_id), 200);
++		iwl_release_restricted_access(priv);
++		spin_unlock_irqrestore(&priv->lock, flags);
++	}
++
++	iwl_hw_txq_ctx_free(priv);
++}
++
++int iwl_hw_nic_reset(struct iwl_priv *priv)
++{
++	int rc = 0;
++	unsigned long flags;
++
++	iwl_hw_nic_stop_master(priv);
++
++	spin_lock_irqsave(&priv->lock, flags);
++
++	iwl_set_bit(priv, CSR_RESET, CSR_RESET_REG_FLAG_SW_RESET);
++
++	udelay(10);
++
++	iwl_set_bit(priv, CSR_GP_CNTRL, CSR_GP_CNTRL_REG_FLAG_INIT_DONE);
++	rc = iwl_poll_bit(priv, CSR_RESET,
++			  CSR_GP_CNTRL_REG_FLAG_MAC_CLOCK_READY,
++			  CSR_GP_CNTRL_REG_FLAG_MAC_CLOCK_READY, 25);
++
++	udelay(10);
++
++	rc = iwl_grab_restricted_access(priv);
++	if (!rc) {
++		iwl_write_restricted_reg(priv, APMG_CLK_EN_REG,
++					 APMG_CLK_VAL_DMA_CLK_RQT |
++					 APMG_CLK_VAL_BSM_CLK_RQT);
++
++		udelay(10);
++
++		iwl_set_bits_restricted_reg(priv, APMG_PCIDEV_STT_REG,
++				APMG_PCIDEV_STT_VAL_L1_ACT_DIS);
++
++		iwl_release_restricted_access(priv);
++	}
++
++	clear_bit(STATUS_HCMD_ACTIVE, &priv->status);
++	wake_up_interruptible(&priv->wait_command_queue);
++
++	spin_unlock_irqrestore(&priv->lock, flags);
++
++	return rc;
++
++}
++
++#define REG_RECALIB_PERIOD (60)
++
++/**
++ * iwl4965_bg_statistics_periodic - Timer callback to queue statistics
++ *
++ * This callback is provided in order to queue the statistics_work
++ * in work_queue context (v. softirq)
++ *
++ * This timer function is continually reset to execute within
++ * REG_RECALIB_PERIOD seconds since the last STATISTICS_NOTIFICATION
++ * was received.  We need to ensure we receive the statistics in order
++ * to update the temperature used for calibrating the TXPOWER.  However,
++ * we can't send the statistics command from softirq context (which
++ * is the context which timers run at) so we have to queue off the
++ * statistics_work to actually send the command to the hardware.
++ */
++static void iwl4965_bg_statistics_periodic(unsigned long data)
++{
++	struct iwl_priv *priv = (struct iwl_priv *)data;
++
++	queue_work(priv->workqueue, &priv->statistics_work);
++}
++
++/**
++ * iwl4965_bg_statistics_work - Send the statistics request to the hardware.
++ *
++ * This is queued by iwl_bg_statistics_periodic.
++ */
++static void iwl4965_bg_statistics_work(struct work_struct *work)
++{
++	struct iwl_priv *priv = container_of(work, struct iwl_priv,
++					     statistics_work);
++
++	if (test_bit(STATUS_EXIT_PENDING, &priv->status))
++		return;
++
++	mutex_lock(&priv->mutex);
++	iwl_send_statistics_request(priv);
++	mutex_unlock(&priv->mutex);
++}
++
++#define CT_LIMIT_CONST		259
++#define TM_CT_KILL_THRESHOLD	110
++
++void iwl4965_rf_kill_ct_config(struct iwl_priv *priv)
++{
++	struct iwl_ct_kill_config cmd;
++	u32 R1, R2, R3;
++	u32 temp_th;
++	u32 crit_temperature;
++	unsigned long flags;
++	int rc = 0;
++
++	spin_lock_irqsave(&priv->lock, flags);
++	iwl_write32(priv, CSR_UCODE_DRV_GP1_CLR,
++		    CSR_UCODE_DRV_GP1_REG_BIT_CT_KILL_EXIT);
++	spin_unlock_irqrestore(&priv->lock, flags);
++
++	if (priv->statistics.flag & STATISTICS_REPLY_FLG_FAT_MODE_MSK) {
++		R1 = (s32)le32_to_cpu(priv->card_alive_init.therm_r1[1]);
++		R2 = (s32)le32_to_cpu(priv->card_alive_init.therm_r2[1]);
++		R3 = (s32)le32_to_cpu(priv->card_alive_init.therm_r3[1]);
++	} else {
++		R1 = (s32)le32_to_cpu(priv->card_alive_init.therm_r1[0]);
++		R2 = (s32)le32_to_cpu(priv->card_alive_init.therm_r2[0]);
++		R3 = (s32)le32_to_cpu(priv->card_alive_init.therm_r3[0]);
++	}
++
++	temp_th = CELSIUS_TO_KELVIN(TM_CT_KILL_THRESHOLD);
++
++	crit_temperature = ((temp_th * (R3-R1))/CT_LIMIT_CONST) + R2;
++	cmd.critical_temperature_R =  cpu_to_le32(crit_temperature);
++	rc = iwl_send_cmd_pdu(priv,
++			      REPLY_CT_KILL_CONFIG_CMD, sizeof(cmd), &cmd);
++	if (rc)
++		IWL_ERROR("REPLY_CT_KILL_CONFIG_CMD failed\n");
++	else
++		IWL_DEBUG_INFO("REPLY_CT_KILL_CONFIG_CMD succeeded\n");
++}
++
++#ifdef CONFIG_IWLWIFI_SENSITIVITY
++
++/* "false alarms" are signals that our DSP tries to lock onto,
++ *   but then determines that they are either noise, or transmissions
++ *   from a distant wireless network (also "noise", really) that get
++ *   "stepped on" by stronger transmissions within our own network.
++ * This algorithm attempts to set a sensitivity level that is high
++ *   enough to receive all of our own network traffic, but not so
++ *   high that our DSP gets too busy trying to lock onto non-network
++ *   activity/noise. */
++static int iwl4965_sens_energy_cck(struct iwl_priv *priv,
++				   u32 norm_fa,
++				   u32 rx_enable_time,
++				   struct statistics_general_data *rx_info)
++{
++	u32 max_nrg_cck = 0;
++	int i = 0;
++	u8 max_silence_rssi = 0;
++	u32 silence_ref = 0;
++	u8 silence_rssi_a = 0;
++	u8 silence_rssi_b = 0;
++	u8 silence_rssi_c = 0;
++	u32 val;
++
++	/* "false_alarms" values below are cross-multiplications to assess the
++	 *   numbers of false alarms within the measured period of actual Rx
++	 *   (Rx is off when we're txing), vs the min/max expected false alarms
++	 *   (some should be expected if rx is sensitive enough) in a
++	 *   hypothetical listening period of 200 time units (TU), 204.8 msec:
++	 *
++	 * MIN_FA/fixed-time < false_alarms/actual-rx-time < MAX_FA/beacon-time
++	 *
++	 * */
++	u32 false_alarms = norm_fa * 200 * 1024;
++	u32 max_false_alarms = MAX_FA_CCK * rx_enable_time;
++	u32 min_false_alarms = MIN_FA_CCK * rx_enable_time;
++	struct iwl_sensitivity_data *data = NULL;
++
++	data = &(priv->sensitivity_data);
++
++	data->nrg_auto_corr_silence_diff = 0;
++
++	/* Find max silence rssi among all 3 receivers.
++	 * This is background noise, which may include transmissions from other
++	 *    networks, measured during silence before our network's beacon */
++	silence_rssi_a = (u8)((rx_info->beacon_silence_rssi_a &
++			    ALL_BAND_FILTER)>>8);
++	silence_rssi_b = (u8)((rx_info->beacon_silence_rssi_b &
++			    ALL_BAND_FILTER)>>8);
++	silence_rssi_c = (u8)((rx_info->beacon_silence_rssi_c &
++			    ALL_BAND_FILTER)>>8);
++
++	val = max(silence_rssi_b, silence_rssi_c);
++	max_silence_rssi = max(silence_rssi_a, (u8) val);
++
++	/* Store silence rssi in 20-beacon history table */
++	data->nrg_silence_rssi[data->nrg_silence_idx] = max_silence_rssi;
++	data->nrg_silence_idx++;
++	if (data->nrg_silence_idx >= NRG_NUM_PREV_STAT_L)
++		data->nrg_silence_idx = 0;
++
++	/* Find max silence rssi across 20 beacon history */
++	for (i = 0; i < NRG_NUM_PREV_STAT_L; i++) {
++		val = data->nrg_silence_rssi[i];
++		silence_ref = max(silence_ref, val);
++	}
++	IWL_DEBUG_CALIB("silence a %u, b %u, c %u, 20-bcn max %u\n",
++			silence_rssi_a, silence_rssi_b, silence_rssi_c,
++			silence_ref);
++
++	/* Find max rx energy (min value!) among all 3 receivers,
++	 *   measured during beacon frame.
++	 * Save it in 10-beacon history table. */
++	i = data->nrg_energy_idx;
++	val = min(rx_info->beacon_energy_b, rx_info->beacon_energy_c);
++	data->nrg_value[i] = min(rx_info->beacon_energy_a, val);
++
++	data->nrg_energy_idx++;
++	if (data->nrg_energy_idx >= 10)
++		data->nrg_energy_idx = 0;
++
++	/* Find min rx energy (max value) across 10 beacon history.
++	 * This is the minimum signal level that we want to receive well.
++	 * Add backoff (margin so we don't miss slightly lower energy frames).
++	 * This establishes an upper bound (min value) for energy threshold. */
++	max_nrg_cck = data->nrg_value[0];
++	for (i = 1; i < 10; i++)
++		max_nrg_cck = (u32) max(max_nrg_cck, (data->nrg_value[i]));
++	max_nrg_cck += 6;
++
++	IWL_DEBUG_CALIB("rx energy a %u, b %u, c %u, 10-bcn max/min %u\n",
++			rx_info->beacon_energy_a, rx_info->beacon_energy_b,
++			rx_info->beacon_energy_c, max_nrg_cck - 6);
++
++	/* Count number of consecutive beacons with fewer-than-desired
++	 *   false alarms. */
++	if (false_alarms < min_false_alarms)
++		data->num_in_cck_no_fa++;
++	else
++		data->num_in_cck_no_fa = 0;
++	IWL_DEBUG_CALIB("consecutive bcns with few false alarms = %u\n",
++			data->num_in_cck_no_fa);
++
++	/* If we got too many false alarms this time, reduce sensitivity */
++	if (false_alarms > max_false_alarms) {
++		IWL_DEBUG_CALIB("norm FA %u > max FA %u\n",
++			     false_alarms, max_false_alarms);
++		IWL_DEBUG_CALIB("... reducing sensitivity\n");
++		data->nrg_curr_state = IWL_FA_TOO_MANY;
++
++		if (data->auto_corr_cck > AUTO_CORR_MAX_TH_CCK) {
++			/* Store for "fewer than desired" on later beacon */
++			data->nrg_silence_ref = silence_ref;
++
++			/* increase energy threshold (reduce nrg value)
++			 *   to decrease sensitivity */
++			if (data->nrg_th_cck > (NRG_MAX_CCK + NRG_STEP_CCK))
++				data->nrg_th_cck = data->nrg_th_cck
++							 - NRG_STEP_CCK;
++		}
++
++		/* increase auto_corr values to decrease sensitivity */
++		if (data->auto_corr_cck < AUTO_CORR_MAX_TH_CCK)
++			data->auto_corr_cck = AUTO_CORR_MAX_TH_CCK + 1;
++		else {
++			val = data->auto_corr_cck + AUTO_CORR_STEP_CCK;
++			data->auto_corr_cck = min((u32)AUTO_CORR_MAX_CCK, val);
++		}
++		val = data->auto_corr_cck_mrc + AUTO_CORR_STEP_CCK;
++		data->auto_corr_cck_mrc = min((u32)AUTO_CORR_MAX_CCK_MRC, val);
++
++	/* Else if we got fewer than desired, increase sensitivity */
++	} else if (false_alarms < min_false_alarms) {
++		data->nrg_curr_state = IWL_FA_TOO_FEW;
++
++		/* Compare silence level with silence level for most recent
++		 *   healthy number or too many false alarms */
++		data->nrg_auto_corr_silence_diff = (s32)data->nrg_silence_ref -
++						   (s32)silence_ref;
++
++		IWL_DEBUG_CALIB("norm FA %u < min FA %u, silence diff %d\n",
++			 false_alarms, min_false_alarms,
++			 data->nrg_auto_corr_silence_diff);
++
++		/* Increase value to increase sensitivity, but only if:
++		 * 1a) previous beacon did *not* have *too many* false alarms
++		 * 1b) AND there's a significant difference in Rx levels
++		 *      from a previous beacon with too many, or healthy # FAs
++		 * OR 2) We've seen a lot of beacons (100) with too few
++		 *       false alarms */
++		if ((data->nrg_prev_state != IWL_FA_TOO_MANY) &&
++			((data->nrg_auto_corr_silence_diff > NRG_DIFF) ||
++			(data->num_in_cck_no_fa > MAX_NUMBER_CCK_NO_FA))) {
++
++			IWL_DEBUG_CALIB("... increasing sensitivity\n");
++			/* Increase nrg value to increase sensitivity */
++			val = data->nrg_th_cck + NRG_STEP_CCK;
++			data->nrg_th_cck = min((u32)NRG_MIN_CCK, val);
++
++			/* Decrease auto_corr values to increase sensitivity */
++			val = data->auto_corr_cck - AUTO_CORR_STEP_CCK;
++			data->auto_corr_cck = max((u32)AUTO_CORR_MIN_CCK, val);
++
++			val = data->auto_corr_cck_mrc - AUTO_CORR_STEP_CCK;
++			data->auto_corr_cck_mrc =
++					 max((u32)AUTO_CORR_MIN_CCK_MRC, val);
++
++		} else
++			IWL_DEBUG_CALIB("... but not changing sensitivity\n");
++
++	/* Else we got a healthy number of false alarms, keep status quo */
++	} else {
++		IWL_DEBUG_CALIB(" FA in safe zone\n");
++		data->nrg_curr_state = IWL_FA_GOOD_RANGE;
++
++		/* Store for use in "fewer than desired" with later beacon */
++		data->nrg_silence_ref = silence_ref;
++
++		/* If previous beacon had too many false alarms,
++		 *   give it some extra margin by reducing sensitivity again
++		 *   (but don't go below measured energy of desired Rx) */
++		if (IWL_FA_TOO_MANY == data->nrg_prev_state) {
++			IWL_DEBUG_CALIB("... increasing margin\n");
++			data->nrg_th_cck -= NRG_MARGIN;
++		}
++	}
++
++	/* Make sure the energy threshold does not go above the measured
++	 * energy of the desired Rx signals (reduced by backoff margin),
++	 * or else we might start missing Rx frames.
++	 * Lower value is higher energy, so we use max()!
++	 */
++	data->nrg_th_cck = max(max_nrg_cck, data->nrg_th_cck);
++	IWL_DEBUG_CALIB("new nrg_th_cck %u\n", data->nrg_th_cck);
++
++	data->nrg_prev_state = data->nrg_curr_state;
++
++	return 0;
++}
++
++
++static int iwl4965_sens_auto_corr_ofdm(struct iwl_priv *priv,
++				       u32 norm_fa,
++				       u32 rx_enable_time)
++{
++	u32 val;
++	u32 false_alarms = norm_fa * 200 * 1024;
++	u32 max_false_alarms = MAX_FA_OFDM * rx_enable_time;
++	u32 min_false_alarms = MIN_FA_OFDM * rx_enable_time;
++	struct iwl_sensitivity_data *data = NULL;
++
++	data = &(priv->sensitivity_data);
++
++	/* If we got too many false alarms this time, reduce sensitivity */
++	if (false_alarms > max_false_alarms) {
++
++		IWL_DEBUG_CALIB("norm FA %u > max FA %u)\n",
++			     false_alarms, max_false_alarms);
++
++		val = data->auto_corr_ofdm + AUTO_CORR_STEP_OFDM;
++		data->auto_corr_ofdm =
++				min((u32)AUTO_CORR_MAX_OFDM, val);
++
++		val = data->auto_corr_ofdm_mrc + AUTO_CORR_STEP_OFDM;
++		data->auto_corr_ofdm_mrc =
++				min((u32)AUTO_CORR_MAX_OFDM_MRC, val);
++
++		val = data->auto_corr_ofdm_x1 + AUTO_CORR_STEP_OFDM;
++		data->auto_corr_ofdm_x1 =
++				min((u32)AUTO_CORR_MAX_OFDM_X1, val);
++
++		val = data->auto_corr_ofdm_mrc_x1 + AUTO_CORR_STEP_OFDM;
++		data->auto_corr_ofdm_mrc_x1 =
++				min((u32)AUTO_CORR_MAX_OFDM_MRC_X1, val);
++	}
++
++	/* Else if we got fewer than desired, increase sensitivity */
++	else if (false_alarms < min_false_alarms) {
++
++		IWL_DEBUG_CALIB("norm FA %u < min FA %u\n",
++			     false_alarms, min_false_alarms);
++
++		val = data->auto_corr_ofdm - AUTO_CORR_STEP_OFDM;
++		data->auto_corr_ofdm =
++				max((u32)AUTO_CORR_MIN_OFDM, val);
++
++		val = data->auto_corr_ofdm_mrc - AUTO_CORR_STEP_OFDM;
++		data->auto_corr_ofdm_mrc =
++				max((u32)AUTO_CORR_MIN_OFDM_MRC, val);
++
++		val = data->auto_corr_ofdm_x1 - AUTO_CORR_STEP_OFDM;
++		data->auto_corr_ofdm_x1 =
++				max((u32)AUTO_CORR_MIN_OFDM_X1, val);
++
++		val = data->auto_corr_ofdm_mrc_x1 - AUTO_CORR_STEP_OFDM;
++		data->auto_corr_ofdm_mrc_x1 =
++				max((u32)AUTO_CORR_MIN_OFDM_MRC_X1, val);
++	}
++
++	else
++		IWL_DEBUG_CALIB("min FA %u < norm FA %u < max FA %u OK\n",
++			 min_false_alarms, false_alarms, max_false_alarms);
++
++	return 0;
++}
++
++static int iwl_sensitivity_callback(struct iwl_priv *priv,
++				    struct iwl_cmd *cmd, struct sk_buff *skb)
++{
++	/* We didn't cache the SKB; let the caller free it */
++	return 1;
++}
++
++/* Prepare a SENSITIVITY_CMD, send to uCode if values have changed */
++static int iwl4965_sensitivity_write(struct iwl_priv *priv, u8 flags)
++{
++	int rc = 0;
++	struct iwl_sensitivity_cmd cmd ;
++	struct iwl_sensitivity_data *data = NULL;
++	struct iwl_host_cmd cmd_out = {
++		.id = SENSITIVITY_CMD,
++		.len = sizeof(struct iwl_sensitivity_cmd),
++		.meta.flags = flags,
++		.data = &cmd,
++	};
++
++	data = &(priv->sensitivity_data);
++
++	memset(&cmd, 0, sizeof(cmd));
++
++	cmd.table[HD_AUTO_CORR32_X4_TH_ADD_MIN_INDEX] =
++				cpu_to_le16((u16)data->auto_corr_ofdm);
++	cmd.table[HD_AUTO_CORR32_X4_TH_ADD_MIN_MRC_INDEX] =
++				cpu_to_le16((u16)data->auto_corr_ofdm_mrc);
++	cmd.table[HD_AUTO_CORR32_X1_TH_ADD_MIN_INDEX] =
++				cpu_to_le16((u16)data->auto_corr_ofdm_x1);
++	cmd.table[HD_AUTO_CORR32_X1_TH_ADD_MIN_MRC_INDEX] =
++				cpu_to_le16((u16)data->auto_corr_ofdm_mrc_x1);
++
++	cmd.table[HD_AUTO_CORR40_X4_TH_ADD_MIN_INDEX] =
++				cpu_to_le16((u16)data->auto_corr_cck);
++	cmd.table[HD_AUTO_CORR40_X4_TH_ADD_MIN_MRC_INDEX] =
++				cpu_to_le16((u16)data->auto_corr_cck_mrc);
++
++	cmd.table[HD_MIN_ENERGY_CCK_DET_INDEX] =
++				cpu_to_le16((u16)data->nrg_th_cck);
++	cmd.table[HD_MIN_ENERGY_OFDM_DET_INDEX] =
++				cpu_to_le16((u16)data->nrg_th_ofdm);
++
++	cmd.table[HD_BARKER_CORR_TH_ADD_MIN_INDEX] =
++				__constant_cpu_to_le16(190);
++	cmd.table[HD_BARKER_CORR_TH_ADD_MIN_MRC_INDEX] =
++				__constant_cpu_to_le16(390);
++	cmd.table[HD_OFDM_ENERGY_TH_IN_INDEX] =
++				__constant_cpu_to_le16(62);
++
++	IWL_DEBUG_CALIB("ofdm: ac %u mrc %u x1 %u mrc_x1 %u thresh %u\n",
++			data->auto_corr_ofdm, data->auto_corr_ofdm_mrc,
++			data->auto_corr_ofdm_x1, data->auto_corr_ofdm_mrc_x1,
++			data->nrg_th_ofdm);
++
++	IWL_DEBUG_CALIB("cck: ac %u mrc %u thresh %u\n",
++			data->auto_corr_cck, data->auto_corr_cck_mrc,
++			data->nrg_th_cck);
++
++	cmd.control = SENSITIVITY_CMD_CONTROL_WORK_TABLE;
++
++	if (flags & CMD_ASYNC)
++		cmd_out.meta.u.callback = iwl_sensitivity_callback;
++
++	/* Don't send command to uCode if nothing has changed */
++	if (!memcmp(&cmd.table[0], &(priv->sensitivity_tbl[0]),
++		    sizeof(u16)*HD_TABLE_SIZE)) {
++		IWL_DEBUG_CALIB("No change in SENSITIVITY_CMD\n");
++		return 0;
++	}
++
++	/* Copy table for comparison next time */
++	memcpy(&(priv->sensitivity_tbl[0]), &(cmd.table[0]),
++	       sizeof(u16)*HD_TABLE_SIZE);
++
++	rc = iwl_send_cmd(priv, &cmd_out);
++	if (!rc) {
++		IWL_DEBUG_CALIB("SENSITIVITY_CMD succeeded\n");
++		return rc;
++	}
++
++	return 0;
++}
++
++void iwl4965_init_sensitivity(struct iwl_priv *priv, u8 flags, u8 force)
++{
++	int rc = 0;
++	int i;
++	struct iwl_sensitivity_data *data = NULL;
++
++	IWL_DEBUG_CALIB("Start iwl4965_init_sensitivity\n");
++
++	if (force)
++		memset(&(priv->sensitivity_tbl[0]), 0,
++			sizeof(u16)*HD_TABLE_SIZE);
++
++	/* Clear driver's sensitivity algo data */
++	data = &(priv->sensitivity_data);
++	memset(data, 0, sizeof(struct iwl_sensitivity_data));
++
++	data->num_in_cck_no_fa = 0;
++	data->nrg_curr_state = IWL_FA_TOO_MANY;
++	data->nrg_prev_state = IWL_FA_TOO_MANY;
++	data->nrg_silence_ref = 0;
++	data->nrg_silence_idx = 0;
++	data->nrg_energy_idx = 0;
++
++	for (i = 0; i < 10; i++)
++		data->nrg_value[i] = 0;
++
++	for (i = 0; i < NRG_NUM_PREV_STAT_L; i++)
++		data->nrg_silence_rssi[i] = 0;
++
++	data->auto_corr_ofdm = 90;
++	data->auto_corr_ofdm_mrc = 170;
++	data->auto_corr_ofdm_x1  = 105;
++	data->auto_corr_ofdm_mrc_x1 = 220;
++	data->auto_corr_cck = AUTO_CORR_CCK_MIN_VAL_DEF;
++	data->auto_corr_cck_mrc = 200;
++	data->nrg_th_cck = 100;
++	data->nrg_th_ofdm = 100;
++
++	data->last_bad_plcp_cnt_ofdm = 0;
++	data->last_fa_cnt_ofdm = 0;
++	data->last_bad_plcp_cnt_cck = 0;
++	data->last_fa_cnt_cck = 0;
++
++	/* Clear prior Sensitivity command data to force send to uCode */
++	if (force)
++		memset(&(priv->sensitivity_tbl[0]), 0,
++		    sizeof(u16)*HD_TABLE_SIZE);
++
++	rc |= iwl4965_sensitivity_write(priv, flags);
++	IWL_DEBUG_CALIB("<<return 0x%X\n", rc);
++
++	return;
++}
++
++
++/* Reset differential Rx gains in NIC to prepare for chain noise calibration.
++ * Called after every association, but this runs only once!
++ *  ... once chain noise is calibrated the first time, it's good forever.  */
++void iwl4965_chain_noise_reset(struct iwl_priv *priv)
++{
++	struct iwl_chain_noise_data *data = NULL;
++	int rc = 0;
++
++	data = &(priv->chain_noise_data);
++	if ((data->state == IWL_CHAIN_NOISE_ALIVE) && iwl_is_associated(priv)) {
++		struct iwl_calibration_cmd cmd;
++
++		memset(&cmd, 0, sizeof(cmd));
++		cmd.opCode = PHY_CALIBRATE_DIFF_GAIN_CMD;
++		cmd.diff_gain_a = 0;
++		cmd.diff_gain_b = 0;
++		cmd.diff_gain_c = 0;
++		rc = iwl_send_cmd_pdu(priv, REPLY_PHY_CALIBRATION_CMD,
++				 sizeof(cmd), &cmd);
++		msleep(4);
++		data->state = IWL_CHAIN_NOISE_ACCUMULATE;
++		IWL_DEBUG_CALIB("Run chain_noise_calibrate\n");
++	}
++	return;
++}
++
++/*
++ * Accumulate 20 beacons of signal and noise statistics for each of
++ *   3 receivers/antennas/rx-chains, then figure out:
++ * 1)  Which antennas are connected.
++ * 2)  Differential rx gain settings to balance the 3 receivers.
++ */
++static void iwl4965_noise_calibration(struct iwl_priv *priv,
++				      struct iwl_notif_statistics *stat_resp)
++{
++	struct iwl_chain_noise_data *data = NULL;
++	int rc = 0;
++
++	u32 chain_noise_a;
++	u32 chain_noise_b;
++	u32 chain_noise_c;
++	u32 chain_sig_a;
++	u32 chain_sig_b;
++	u32 chain_sig_c;
++	u32 average_sig[NUM_RX_CHAINS] = {INITIALIZATION_VALUE};
++	u32 average_noise[NUM_RX_CHAINS] = {INITIALIZATION_VALUE};
++	u32 max_average_sig;
++	u16 max_average_sig_antenna_i;
++	u32 min_average_noise = MIN_AVERAGE_NOISE_MAX_VALUE;
++	u16 min_average_noise_antenna_i = INITIALIZATION_VALUE;
++	u16 i = 0;
++	u16 chan_num = INITIALIZATION_VALUE;
++	u32 band = INITIALIZATION_VALUE;
++	u32 active_chains = 0;
++	unsigned long flags;
++	struct statistics_rx_non_phy *rx_info = &(stat_resp->rx.general);
++
++	data = &(priv->chain_noise_data);
++
++	/* Accumulate just the first 20 beacons after the first association,
++	 *   then we're done forever. */
++	if (data->state != IWL_CHAIN_NOISE_ACCUMULATE) {
++		if (data->state == IWL_CHAIN_NOISE_ALIVE)
++			IWL_DEBUG_CALIB("Wait for noise calib reset\n");
++		return;
++	}
++
++	spin_lock_irqsave(&priv->lock, flags);
++	if (rx_info->interference_data_flag != INTERFERENCE_DATA_AVAILABLE) {
++		IWL_DEBUG_CALIB(" << Interference data unavailable\n");
++		spin_unlock_irqrestore(&priv->lock, flags);
++		return;
++	}
++
++	band = (priv->staging_rxon.flags & RXON_FLG_BAND_24G_MSK) ? 0 : 1;
++	chan_num = le16_to_cpu(priv->staging_rxon.channel);
++
++	/* Make sure we accumulate data for just the associated channel
++	 *   (even if scanning). */
++	if ((chan_num != (le32_to_cpu(stat_resp->flag) >> 16)) ||
++	    ((STATISTICS_REPLY_FLG_BAND_24G_MSK ==
++	     (stat_resp->flag & STATISTICS_REPLY_FLG_BAND_24G_MSK)) && band)) {
++		IWL_DEBUG_CALIB("Stats not from chan=%d, band=%d\n",
++				chan_num, band);
++		spin_unlock_irqrestore(&priv->lock, flags);
++		return;
++	}
++
++	/* Accumulate beacon statistics values across 20 beacons */
++	chain_noise_a = le32_to_cpu(rx_info->beacon_silence_rssi_a) &
++				IN_BAND_FILTER;
++	chain_noise_b = le32_to_cpu(rx_info->beacon_silence_rssi_b) &
++				IN_BAND_FILTER;
++	chain_noise_c = le32_to_cpu(rx_info->beacon_silence_rssi_c) &
++				IN_BAND_FILTER;
++
++	chain_sig_a = le32_to_cpu(rx_info->beacon_rssi_a) & IN_BAND_FILTER;
++	chain_sig_b = le32_to_cpu(rx_info->beacon_rssi_b) & IN_BAND_FILTER;
++	chain_sig_c = le32_to_cpu(rx_info->beacon_rssi_c) & IN_BAND_FILTER;
++
++	spin_unlock_irqrestore(&priv->lock, flags);
++
++	data->beacon_count++;
++
++	data->chain_noise_a = (chain_noise_a + data->chain_noise_a);
++	data->chain_noise_b = (chain_noise_b + data->chain_noise_b);
++	data->chain_noise_c = (chain_noise_c + data->chain_noise_c);
++
++	data->chain_signal_a = (chain_sig_a + data->chain_signal_a);
++	data->chain_signal_b = (chain_sig_b + data->chain_signal_b);
++	data->chain_signal_c = (chain_sig_c + data->chain_signal_c);
++
++	IWL_DEBUG_CALIB("chan=%d, band=%d, beacon=%d\n", chan_num, band,
++			data->beacon_count);
++	IWL_DEBUG_CALIB("chain_sig: a %d b %d c %d\n",
++			chain_sig_a, chain_sig_b, chain_sig_c);
++	IWL_DEBUG_CALIB("chain_noise: a %d b %d c %d\n",
++			chain_noise_a, chain_noise_b, chain_noise_c);
++
++	/* If this is the 20th beacon, determine:
++	 * 1)  Disconnected antennas (using signal strengths)
++	 * 2)  Differential gain (using silence noise) to balance receivers */
++	if (data->beacon_count == CAL_NUM_OF_BEACONS) {
++
++		/* Analyze signal for disconnected antenna */
++		average_sig[0] = (data->chain_signal_a) / CAL_NUM_OF_BEACONS;
++		average_sig[1] = (data->chain_signal_b) / CAL_NUM_OF_BEACONS;
++		average_sig[2] = (data->chain_signal_c) / CAL_NUM_OF_BEACONS;
++
++		if (average_sig[0] >= average_sig[1]) {
++			max_average_sig = average_sig[0];
++			max_average_sig_antenna_i = 0;
++			active_chains = (1 << max_average_sig_antenna_i);
++		} else {
++			max_average_sig = average_sig[1];
++			max_average_sig_antenna_i = 1;
++			active_chains = (1 << max_average_sig_antenna_i);
++		}
++
++		if (average_sig[2] >= max_average_sig) {
++			max_average_sig = average_sig[2];
++			max_average_sig_antenna_i = 2;
++			active_chains = (1 << max_average_sig_antenna_i);
++		}
++
++		IWL_DEBUG_CALIB("average_sig: a %d b %d c %d\n",
++			     average_sig[0], average_sig[1], average_sig[2]);
++		IWL_DEBUG_CALIB("max_average_sig = %d, antenna %d\n",
++			     max_average_sig, max_average_sig_antenna_i);
++
++		/* Compare signal strengths for all 3 receivers. */
++		for (i = 0; i < NUM_RX_CHAINS; i++) {
++			if (i != max_average_sig_antenna_i) {
++				s32 rssi_delta = (max_average_sig -
++						  average_sig[i]);
++
++				/* If signal is very weak, compared with
++				 * strongest, mark it as disconnected. */
++				if (rssi_delta > MAXIMUM_ALLOWED_PATHLOSS)
++					data->disconn_array[i] = 1;
++				else
++					active_chains |= (1 << i);
++			IWL_DEBUG_CALIB("i = %d  rssiDelta = %d  "
++				     "disconn_array[i] = %d\n",
++				     i, rssi_delta, data->disconn_array[i]);
++			}
++		}
++
++		/*If both chains A & B are disconnected -
++		 * connect B and leave A as is */
++		if (data->disconn_array[CHAIN_A] &&
++		    data->disconn_array[CHAIN_B]) {
++			data->disconn_array[CHAIN_B] = 0;
++			active_chains |= (1 << CHAIN_B);
++			IWL_DEBUG_CALIB("both A & B chains are disconnected! "
++				     "W/A - declare B as connected\n");
++		}
++
++		IWL_DEBUG_CALIB("active_chains (bitwise) = 0x%x\n",
++				active_chains);
++
++		/* Save for use within RXON, TX, SCAN commands, etc. */
++		priv->valid_antenna = active_chains;
++
++		/* Analyze noise for rx balance */
++		average_noise[0] = ((data->chain_noise_a)/CAL_NUM_OF_BEACONS);
++		average_noise[1] = ((data->chain_noise_b)/CAL_NUM_OF_BEACONS);
++		average_noise[2] = ((data->chain_noise_c)/CAL_NUM_OF_BEACONS);
++
++		for (i = 0; i < NUM_RX_CHAINS; i++) {
++			if (!(data->disconn_array[i]) &&
++			   (average_noise[i] <= min_average_noise)) {
++				/* This means that chain i is active and has
++				 * lower noise values so far: */
++				min_average_noise = average_noise[i];
++				min_average_noise_antenna_i = i;
++			}
++		}
++
++		data->delta_gain_code[min_average_noise_antenna_i] = 0;
++
++		IWL_DEBUG_CALIB("average_noise: a %d b %d c %d\n",
++				average_noise[0], average_noise[1],
++				average_noise[2]);
++
++		IWL_DEBUG_CALIB("min_average_noise = %d, antenna %d\n",
++				min_average_noise, min_average_noise_antenna_i);
++
++		for (i = 0; i < NUM_RX_CHAINS; i++) {
++			s32 delta_g = 0;
++
++			if (!(data->disconn_array[i]) &&
++			    (data->delta_gain_code[i] ==
++			     CHAIN_NOISE_DELTA_GAIN_INIT_VAL)) {
++				delta_g = average_noise[i] - min_average_noise;
++				data->delta_gain_code[i] = (u8)((delta_g *
++								    10) / 15);
++				if (CHAIN_NOISE_MAX_DELTA_GAIN_CODE <
++				   data->delta_gain_code[i])
++					data->delta_gain_code[i] =
++					  CHAIN_NOISE_MAX_DELTA_GAIN_CODE;
++
++				data->delta_gain_code[i] =
++					(data->delta_gain_code[i] | (1 << 2));
++			} else
++				data->delta_gain_code[i] = 0;
++		}
++		IWL_DEBUG_CALIB("delta_gain_codes: a %d b %d c %d\n",
++			     data->delta_gain_code[0],
++			     data->delta_gain_code[1],
++			     data->delta_gain_code[2]);
++
++		/* Differential gain gets sent to uCode only once */
++		if (!data->radio_write) {
++			struct iwl_calibration_cmd cmd;
++			data->radio_write = 1;
++
++			memset(&cmd, 0, sizeof(cmd));
++			cmd.opCode = PHY_CALIBRATE_DIFF_GAIN_CMD;
++			cmd.diff_gain_a = data->delta_gain_code[0];
++			cmd.diff_gain_b = data->delta_gain_code[1];
++			cmd.diff_gain_c = data->delta_gain_code[2];
++			rc = iwl_send_cmd_pdu(priv, REPLY_PHY_CALIBRATION_CMD,
++					      sizeof(cmd), &cmd);
++			if (rc)
++				IWL_DEBUG_CALIB("fail sending cmd "
++					     "REPLY_PHY_CALIBRATION_CMD \n");
++
++			/* TODO we might want recalculate
++			 * rx_chain in rxon cmd */
++
++			/* Mark so we run this algo only once! */
++			data->state = IWL_CHAIN_NOISE_CALIBRATED;
++		}
++		data->chain_noise_a = 0;
++		data->chain_noise_b = 0;
++		data->chain_noise_c = 0;
++		data->chain_signal_a = 0;
++		data->chain_signal_b = 0;
++		data->chain_signal_c = 0;
++		data->beacon_count = 0;
++	}
++	return;
++}
++
++static void iwl4965_sensitivity_calibration(struct iwl_priv *priv,
++					    struct iwl_notif_statistics *resp)
++{
++	int rc = 0;
++	u32 rx_enable_time;
++	u32 fa_cck;
++	u32 fa_ofdm;
++	u32 bad_plcp_cck;
++	u32 bad_plcp_ofdm;
++	u32 norm_fa_ofdm;
++	u32 norm_fa_cck;
++	struct iwl_sensitivity_data *data = NULL;
++	struct statistics_rx_non_phy *rx_info = &(resp->rx.general);
++	struct statistics_rx *statistics = &(resp->rx);
++	unsigned long flags;
++	struct statistics_general_data statis;
++
++	data = &(priv->sensitivity_data);
++
++	if (!iwl_is_associated(priv)) {
++		IWL_DEBUG_CALIB("<< - not associated\n");
++		return;
++	}
++
++	spin_lock_irqsave(&priv->lock, flags);
++	if (rx_info->interference_data_flag != INTERFERENCE_DATA_AVAILABLE) {
++		IWL_DEBUG_CALIB("<< invalid data.\n");
++		spin_unlock_irqrestore(&priv->lock, flags);
++		return;
++	}
++
++	/* Extract Statistics: */
++	rx_enable_time = le32_to_cpu(rx_info->channel_load);
++	fa_cck = le32_to_cpu(statistics->cck.false_alarm_cnt);
++	fa_ofdm = le32_to_cpu(statistics->ofdm.false_alarm_cnt);
++	bad_plcp_cck = le32_to_cpu(statistics->cck.plcp_err);
++	bad_plcp_ofdm = le32_to_cpu(statistics->ofdm.plcp_err);
++
++	statis.beacon_silence_rssi_a =
++			le32_to_cpu(statistics->general.beacon_silence_rssi_a);
++	statis.beacon_silence_rssi_b =
++			le32_to_cpu(statistics->general.beacon_silence_rssi_b);
++	statis.beacon_silence_rssi_c =
++			le32_to_cpu(statistics->general.beacon_silence_rssi_c);
++	statis.beacon_energy_a =
++			le32_to_cpu(statistics->general.beacon_energy_a);
++	statis.beacon_energy_b =
++			le32_to_cpu(statistics->general.beacon_energy_b);
++	statis.beacon_energy_c =
++			le32_to_cpu(statistics->general.beacon_energy_c);
++
++	spin_unlock_irqrestore(&priv->lock, flags);
++
++	IWL_DEBUG_CALIB("rx_enable_time = %u usecs\n", rx_enable_time);
++
++	if (!rx_enable_time) {
++		IWL_DEBUG_CALIB("<< RX Enable Time == 0! \n");
++		return;
++	}
++
++	/* These statistics increase monotonically, and do not reset
++	 *   at each beacon.  Calculate difference from last value, or just
++	 *   use the new statistics value if it has reset or wrapped around. */
++	if (data->last_bad_plcp_cnt_cck > bad_plcp_cck)
++		data->last_bad_plcp_cnt_cck = bad_plcp_cck;
++	else {
++		bad_plcp_cck -= data->last_bad_plcp_cnt_cck;
++		data->last_bad_plcp_cnt_cck += bad_plcp_cck;
++	}
++
++	if (data->last_bad_plcp_cnt_ofdm > bad_plcp_ofdm)
++		data->last_bad_plcp_cnt_ofdm = bad_plcp_ofdm;
++	else {
++		bad_plcp_ofdm -= data->last_bad_plcp_cnt_ofdm;
++		data->last_bad_plcp_cnt_ofdm += bad_plcp_ofdm;
++	}
++
++	if (data->last_fa_cnt_ofdm > fa_ofdm)
++		data->last_fa_cnt_ofdm = fa_ofdm;
++	else {
++		fa_ofdm -= data->last_fa_cnt_ofdm;
++		data->last_fa_cnt_ofdm += fa_ofdm;
++	}
++
++	if (data->last_fa_cnt_cck > fa_cck)
++		data->last_fa_cnt_cck = fa_cck;
++	else {
++		fa_cck -= data->last_fa_cnt_cck;
++		data->last_fa_cnt_cck += fa_cck;
++	}
++
++	/* Total aborted signal locks */
++	norm_fa_ofdm = fa_ofdm + bad_plcp_ofdm;
++	norm_fa_cck = fa_cck + bad_plcp_cck;
++
++	IWL_DEBUG_CALIB("cck: fa %u badp %u  ofdm: fa %u badp %u\n", fa_cck,
++			bad_plcp_cck, fa_ofdm, bad_plcp_ofdm);
++
++	iwl4965_sens_auto_corr_ofdm(priv, norm_fa_ofdm, rx_enable_time);
++	iwl4965_sens_energy_cck(priv, norm_fa_cck, rx_enable_time, &statis);
++	rc |= iwl4965_sensitivity_write(priv, CMD_ASYNC);
++
++	return;
++}
++
++static void iwl4965_bg_sensitivity_work(struct work_struct *work)
++{
++	struct iwl_priv *priv = container_of(work, struct iwl_priv,
++			sensitivity_work);
++
++	mutex_lock(&priv->mutex);
++
++	if (test_bit(STATUS_EXIT_PENDING, &priv->status) ||
++	    test_bit(STATUS_SCANNING, &priv->status)) {
++		mutex_unlock(&priv->mutex);
++		return;
++	}
++
++	if (priv->start_calib) {
++		iwl4965_noise_calibration(priv, &priv->statistics);
++
++		if (priv->sensitivity_data.state ==
++					IWL_SENS_CALIB_NEED_REINIT) {
++			iwl4965_init_sensitivity(priv, CMD_ASYNC, 0);
++			priv->sensitivity_data.state = IWL_SENS_CALIB_ALLOWED;
++		} else
++			iwl4965_sensitivity_calibration(priv,
++					&priv->statistics);
++	}
++
++	mutex_unlock(&priv->mutex);
++	return;
++}
++#endif /*CONFIG_IWLWIFI_SENSITIVITY*/
++
++static void iwl4965_bg_txpower_work(struct work_struct *work)
++{
++	struct iwl_priv *priv = container_of(work, struct iwl_priv,
++			txpower_work);
++
++	/* If a scan happened to start before we got here
++	 * then just return; the statistics notification will
++	 * kick off another scheduled work to compensate for
++	 * any temperature delta we missed here. */
++	if (test_bit(STATUS_EXIT_PENDING, &priv->status) ||
++	    test_bit(STATUS_SCANNING, &priv->status))
++		return;
++
++	mutex_lock(&priv->mutex);
++
++	/* Regardless of if we are assocaited, we must reconfigure the
++	 * TX power since frames can be sent on non-radar channels while
++	 * not associated */
++	iwl_hw_reg_send_txpower(priv);
++
++	/* Update last_temperature to keep is_calib_needed from running
++	 * when it isn't needed... */
++	priv->last_temperature = priv->temperature;
++
++	mutex_unlock(&priv->mutex);
++}
++
++/*
++ * Acquire priv->lock before calling this function !
++ */
++static void iwl4965_set_wr_ptrs(struct iwl_priv *priv, int txq_id, u32 index)
++{
++	iwl_write_restricted(priv, HBUS_TARG_WRPTR,
++			     (index & 0xff) | (txq_id << 8));
++	iwl_write_restricted_reg(priv, SCD_QUEUE_RDPTR(txq_id), index);
++}
++
++/*
++ * Acquire priv->lock before calling this function !
++ */
++static void iwl4965_tx_queue_set_status(struct iwl_priv *priv,
++					struct iwl_tx_queue *txq,
++					int tx_fifo_id, int scd_retry)
++{
++	int txq_id = txq->q.id;
++	int active = test_bit(txq_id, &priv->txq_ctx_active_msk)?1:0;
++
++	iwl_write_restricted_reg(priv, SCD_QUEUE_STATUS_BITS(txq_id),
++				 (active << SCD_QUEUE_STTS_REG_POS_ACTIVE) |
++				 (tx_fifo_id << SCD_QUEUE_STTS_REG_POS_TXF) |
++				 (scd_retry << SCD_QUEUE_STTS_REG_POS_WSL) |
++				 (scd_retry << SCD_QUEUE_STTS_REG_POS_SCD_ACK) |
++				 SCD_QUEUE_STTS_REG_MSK);
++
++	txq->sched_retry = scd_retry;
++
++	IWL_DEBUG_INFO("%s %s Queue %d on AC %d\n",
++		       active ? "Activete" : "Deactivate",
++		       scd_retry ? "BA" : "AC", txq_id, tx_fifo_id);
++}
++
++static const u16 default_queue_to_tx_fifo[] = {
++	IWL_TX_FIFO_AC3,
++	IWL_TX_FIFO_AC2,
++	IWL_TX_FIFO_AC1,
++	IWL_TX_FIFO_AC0,
++	IWL_CMD_FIFO_NUM,
++	IWL_TX_FIFO_HCCA_1,
++	IWL_TX_FIFO_HCCA_2
++};
++
++static inline void iwl4965_txq_ctx_activate(struct iwl_priv *priv, int txq_id)
++{
++	set_bit(txq_id, &priv->txq_ctx_active_msk);
++}
++
++static inline void iwl4965_txq_ctx_deactivate(struct iwl_priv *priv, int txq_id)
++{
++	clear_bit(txq_id, &priv->txq_ctx_active_msk);
++}
++
++int iwl4965_alive_notify(struct iwl_priv *priv)
++{
++	u32 a;
++	int i = 0;
++	unsigned long flags;
++	int rc;
++
++	spin_lock_irqsave(&priv->lock, flags);
++
++#ifdef CONFIG_IWLWIFI_SENSITIVITY
++	memset(&(priv->sensitivity_data), 0,
++	       sizeof(struct iwl_sensitivity_data));
++	memset(&(priv->chain_noise_data), 0,
++	       sizeof(struct iwl_chain_noise_data));
++	for (i = 0; i < NUM_RX_CHAINS; i++)
++		priv->chain_noise_data.delta_gain_code[i] =
++				CHAIN_NOISE_DELTA_GAIN_INIT_VAL;
++#endif /* CONFIG_IWLWIFI_SENSITIVITY*/
++	rc = iwl_grab_restricted_access(priv);
++	if (rc) {
++		spin_unlock_irqrestore(&priv->lock, flags);
++		return rc;
++	}
++
++	priv->scd_base_addr = iwl_read_restricted_reg(priv, SCD_SRAM_BASE_ADDR);
++	a = priv->scd_base_addr + SCD_CONTEXT_DATA_OFFSET;
++	for (; a < priv->scd_base_addr + SCD_TX_STTS_BITMAP_OFFSET; a += 4)
++		iwl_write_restricted_mem(priv, a, 0);
++	for (; a < priv->scd_base_addr + SCD_TRANSLATE_TBL_OFFSET; a += 4)
++		iwl_write_restricted_mem(priv, a, 0);
++	for (; a < sizeof(u16) * priv->hw_setting.max_txq_num; a += 4)
++		iwl_write_restricted_mem(priv, a, 0);
++
++	iwl_write_restricted_reg(priv, SCD_DRAM_BASE_ADDR,
++		(priv->hw_setting.shared_phys +
++		 offsetof(struct iwl_shared, queues_byte_cnt_tbls)) >> 10);
++	iwl_write_restricted_reg(priv, SCD_QUEUECHAIN_SEL, 0);
++
++	/* initiate the queues */
++	for (i = 0; i < priv->hw_setting.max_txq_num; i++) {
++		iwl_write_restricted_reg(priv, SCD_QUEUE_RDPTR(i), 0);
++		iwl_write_restricted(priv, HBUS_TARG_WRPTR, 0 | (i << 8));
++		iwl_write_restricted_mem(priv, priv->scd_base_addr +
++					SCD_CONTEXT_QUEUE_OFFSET(i),
++					(SCD_WIN_SIZE <<
++					SCD_QUEUE_CTX_REG1_WIN_SIZE_POS) &
++					SCD_QUEUE_CTX_REG1_WIN_SIZE_MSK);
++		iwl_write_restricted_mem(priv, priv->scd_base_addr +
++					SCD_CONTEXT_QUEUE_OFFSET(i) +
++					sizeof(u32),
++					(SCD_FRAME_LIMIT <<
++					SCD_QUEUE_CTX_REG2_FRAME_LIMIT_POS) &
++					SCD_QUEUE_CTX_REG2_FRAME_LIMIT_MSK);
++
++	}
++	iwl_write_restricted_reg(priv, SCD_INTERRUPT_MASK,
++				 (1 << priv->hw_setting.max_txq_num) - 1);
++
++	iwl_write_restricted_reg(priv, SCD_TXFACT,
++				 SCD_TXFACT_REG_TXFIFO_MASK(0, 7));
++
++	iwl4965_set_wr_ptrs(priv, IWL_CMD_QUEUE_NUM, 0);
++	/* map qos queues to fifos one-to-one */
++	for (i = 0; i < ARRAY_SIZE(default_queue_to_tx_fifo); i++) {
++		int ac = default_queue_to_tx_fifo[i];
++		iwl4965_txq_ctx_activate(priv, i);
++		iwl4965_tx_queue_set_status(priv, &priv->txq[i], ac, 0);
++	}
++
++	iwl_release_restricted_access(priv);
++	spin_unlock_irqrestore(&priv->lock, flags);
++
++	return 0;
++}
++
++int iwl_hw_set_hw_setting(struct iwl_priv *priv)
++{
++	priv->hw_setting.shared_virt =
++	    pci_alloc_consistent(priv->pci_dev,
++				 sizeof(struct iwl_shared),
++				 &priv->hw_setting.shared_phys);
++
++	if (!priv->hw_setting.shared_virt)
++		return -1;
++
++	memset(priv->hw_setting.shared_virt, 0, sizeof(struct iwl_shared));
++
++	priv->hw_setting.max_txq_num = iwl_param_queues_num;
++	priv->hw_setting.ac_queue_count = AC_NUM;
++
++	priv->hw_setting.cck_flag = RATE_MCS_CCK_MSK;
++	priv->hw_setting.tx_cmd_len = sizeof(struct iwl_tx_cmd);
++	priv->hw_setting.max_rxq_size = RX_QUEUE_SIZE;
++	priv->hw_setting.max_rxq_log = RX_QUEUE_SIZE_LOG;
++
++	priv->hw_setting.max_stations = IWL4965_STATION_COUNT;
++	priv->hw_setting.bcast_sta_id = IWL4965_BROADCAST_ID;
++	return 0;
++}
++
++/**
++ * iwl_hw_txq_ctx_free - Free TXQ Context
++ *
++ * Destroy all TX DMA queues and structures
++ */
++void iwl_hw_txq_ctx_free(struct iwl_priv *priv)
++{
++	int txq_id;
++
++	/* Tx queues */
++	for (txq_id = 0; txq_id < priv->hw_setting.max_txq_num; txq_id++)
++		iwl_tx_queue_free(priv, &priv->txq[txq_id]);
++
++	iwl4965_kw_free(priv);
++}
++
++/**
++ * iwl_hw_txq_free_tfd -  Free one TFD, those at index [txq->q.last_used]
++ *
++ * Does NOT advance any indexes
++ */
++int iwl_hw_txq_free_tfd(struct iwl_priv *priv, struct iwl_tx_queue *txq)
++{
++	struct iwl_tfd_frame *bd_tmp = (struct iwl_tfd_frame *)&txq->bd[0];
++	struct iwl_tfd_frame *bd = &bd_tmp[txq->q.last_used];
++	struct pci_dev *dev = priv->pci_dev;
++	int i;
++	int counter = 0;
++	int index, is_odd;
++
++	/* classify bd */
++	if (txq->q.id == IWL_CMD_QUEUE_NUM)
++		/* nothing to cleanup after for host commands */
++		return 0;
++
++	/* sanity check */
++	counter = IWL_GET_BITS(*bd, num_tbs);
++	if (counter > MAX_NUM_OF_TBS) {
++		IWL_ERROR("Too many chunks: %i\n", counter);
++		/* @todo issue fatal error, it is quite serious situation */
++		return 0;
++	}
++
++	/* unmap chunks if any */
++
++	for (i = 0; i < counter; i++) {
++		index = i / 2;
++		is_odd = i & 0x1;
++
++		if (is_odd)
++			pci_unmap_single(
++				dev,
++				IWL_GET_BITS(bd->pa[index], tb2_addr_lo16) |
++				(IWL_GET_BITS(bd->pa[index],
++					      tb2_addr_hi20) << 16),
++				IWL_GET_BITS(bd->pa[index], tb2_len),
++				PCI_DMA_TODEVICE);
++
++		else if (i > 0)
++			pci_unmap_single(dev,
++					 le32_to_cpu(bd->pa[index].tb1_addr),
++					 IWL_GET_BITS(bd->pa[index], tb1_len),
++					 PCI_DMA_TODEVICE);
++
++		if (txq->txb[txq->q.last_used].skb[i]) {
++			struct sk_buff *skb = txq->txb[txq->q.last_used].skb[i];
++
++			dev_kfree_skb(skb);
++			txq->txb[txq->q.last_used].skb[i] = NULL;
++		}
++	}
++	return 0;
++}
++
++int iwl_hw_reg_set_txpower(struct iwl_priv *priv, s8 power)
++{
++	IWL_ERROR("TODO: Implement iwl_hw_reg_set_txpower!\n");
++	return -EINVAL;
++}
++
++static s32 iwl4965_math_div_round(s32 num, s32 denom, s32 *res)
++{
++	s32 sign = 1;
++
++	if (num < 0) {
++		sign = -sign;
++		num = -num;
++	}
++	if (denom < 0) {
++		sign = -sign;
++		denom = -denom;
++	}
++	*res = 1;
++	*res = ((num * 2 + denom) / (denom * 2)) * sign;
++
++	return 1;
++}
++
++static s32 iwl4965_get_voltage_compensation(s32 eeprom_voltage,
++					    s32 current_voltage)
++{
++	s32 comp = 0;
++
++	if ((TX_POWER_IWL_ILLEGAL_VOLTAGE == eeprom_voltage) ||
++	    (TX_POWER_IWL_ILLEGAL_VOLTAGE == current_voltage))
++		return 0;
++
++	iwl4965_math_div_round(current_voltage - eeprom_voltage,
++			       TX_POWER_IWL_VOLTAGE_CODES_PER_03V, &comp);
++
++	if (current_voltage > eeprom_voltage)
++		comp *= 2;
++	if ((comp < -2) || (comp > 2))
++		comp = 0;
++
++	return comp;
++}
++
++static const struct iwl_channel_info *
++iwl4965_get_channel_txpower_info(struct iwl_priv *priv, u8 phymode, u16 channel)
++{
++	const struct iwl_channel_info *ch_info;
++
++	ch_info = iwl_get_channel_info(priv, phymode, channel);
++
++	if (!is_channel_valid(ch_info))
++		return NULL;
++
++	return ch_info;
++}
++
++static s32 iwl4965_get_tx_atten_grp(u16 channel)
++{
++	if (channel >= CALIB_IWL_TX_ATTEN_GR5_FCH &&
++	    channel <= CALIB_IWL_TX_ATTEN_GR5_LCH)
++		return CALIB_CH_GROUP_5;
++
++	if (channel >= CALIB_IWL_TX_ATTEN_GR1_FCH &&
++	    channel <= CALIB_IWL_TX_ATTEN_GR1_LCH)
++		return CALIB_CH_GROUP_1;
++
++	if (channel >= CALIB_IWL_TX_ATTEN_GR2_FCH &&
++	    channel <= CALIB_IWL_TX_ATTEN_GR2_LCH)
++		return CALIB_CH_GROUP_2;
++
++	if (channel >= CALIB_IWL_TX_ATTEN_GR3_FCH &&
++	    channel <= CALIB_IWL_TX_ATTEN_GR3_LCH)
++		return CALIB_CH_GROUP_3;
++
++	if (channel >= CALIB_IWL_TX_ATTEN_GR4_FCH &&
++	    channel <= CALIB_IWL_TX_ATTEN_GR4_LCH)
++		return CALIB_CH_GROUP_4;
++
++	IWL_ERROR("Can't find txatten group for channel %d.\n", channel);
++	return -1;
++}
++
++static u32 iwl4965_get_sub_band(const struct iwl_priv *priv, u32 channel)
++{
++	s32 b = -1;
++
++	for (b = 0; b < EEPROM_TX_POWER_BANDS; b++) {
++		if (priv->eeprom.calib_info.band_info[b].ch_from == 0)
++			continue;
++
++		if ((channel >= priv->eeprom.calib_info.band_info[b].ch_from)
++		    && (channel <= priv->eeprom.calib_info.band_info[b].ch_to))
++			break;
++	}
++
++	return b;
++}
++
++static s32 iwl4965_interpolate_value(s32 x, s32 x1, s32 y1, s32 x2, s32 y2)
++{
++	s32 val;
++
++	if (x2 == x1)
++		return y1;
++	else {
++		iwl4965_math_div_round((x2 - x) * (y1 - y2), (x2 - x1), &val);
++		return val + y2;
++	}
++}
++
++static int iwl4965_interpolate_chan(struct iwl_priv *priv, u32 channel,
++				    struct iwl_eeprom_calib_ch_info *chan_info)
++{
++	s32 s = -1;
++	u32 c;
++	u32 m;
++	const struct iwl_eeprom_calib_measure *m1;
++	const struct iwl_eeprom_calib_measure *m2;
++	struct iwl_eeprom_calib_measure *omeas;
++	u32 ch_i1;
++	u32 ch_i2;
++
++	s = iwl4965_get_sub_band(priv, channel);
++	if (s >= EEPROM_TX_POWER_BANDS) {
++		IWL_ERROR("Tx Power can not find channel %d ", channel);
++		return -1;
++	}
++
++	ch_i1 = priv->eeprom.calib_info.band_info[s].ch1.ch_num;
++	ch_i2 = priv->eeprom.calib_info.band_info[s].ch2.ch_num;
++	chan_info->ch_num = (u8) channel;
++
++	IWL_DEBUG_TXPOWER("channel %d subband %d factory cal ch %d & %d\n",
++			  channel, s, ch_i1, ch_i2);
++
++	for (c = 0; c < EEPROM_TX_POWER_TX_CHAINS; c++) {
++		for (m = 0; m < EEPROM_TX_POWER_MEASUREMENTS; m++) {
++			m1 = &(priv->eeprom.calib_info.band_info[s].ch1.
++			       measurements[c][m]);
++			m2 = &(priv->eeprom.calib_info.band_info[s].ch2.
++			       measurements[c][m]);
++			omeas = &(chan_info->measurements[c][m]);
++
++			omeas->actual_pow =
++			    (u8) iwl4965_interpolate_value(channel, ch_i1,
++							   m1->actual_pow,
++							   ch_i2,
++							   m2->actual_pow);
++			omeas->gain_idx =
++			    (u8) iwl4965_interpolate_value(channel, ch_i1,
++							   m1->gain_idx, ch_i2,
++							   m2->gain_idx);
++			omeas->temperature =
++			    (u8) iwl4965_interpolate_value(channel, ch_i1,
++							   m1->temperature,
++							   ch_i2,
++							   m2->temperature);
++			omeas->pa_det =
++			    (s8) iwl4965_interpolate_value(channel, ch_i1,
++							   m1->pa_det, ch_i2,
++							   m2->pa_det);
++
++			IWL_DEBUG_TXPOWER
++			    ("chain %d meas %d AP1=%d AP2=%d AP=%d\n", c, m,
++			     m1->actual_pow, m2->actual_pow, omeas->actual_pow);
++			IWL_DEBUG_TXPOWER
++			    ("chain %d meas %d NI1=%d NI2=%d NI=%d\n", c, m,
++			     m1->gain_idx, m2->gain_idx, omeas->gain_idx);
++			IWL_DEBUG_TXPOWER
++			    ("chain %d meas %d PA1=%d PA2=%d PA=%d\n", c, m,
++			     m1->pa_det, m2->pa_det, omeas->pa_det);
++			IWL_DEBUG_TXPOWER
++			    ("chain %d meas %d  T1=%d  T2=%d  T=%d\n", c, m,
++			     m1->temperature, m2->temperature,
++			     omeas->temperature);
++		}
++	}
++
++	return 0;
++}
++
++/* bit-rate-dependent table to prevent Tx distortion, in half-dB units,
++ * for OFDM 6, 12, 18, 24, 36, 48, 54, 60 MBit, and CCK all rates. */
++static s32 back_off_table[] = {
++	10, 10, 10, 10, 10, 15, 17, 20,	/* OFDM SISO 20 MHz */
++	10, 10, 10, 10, 10, 15, 17, 20,	/* OFDM MIMO 20 MHz */
++	10, 10, 10, 10, 10, 15, 17, 20,	/* OFDM SISO 40 MHz */
++	10, 10, 10, 10, 10, 15, 17, 20,	/* OFDM MIMO 40 MHz */
++	10			/* CCK */
++};
++
++/* Thermal compensation values for txpower for various frequency ranges ...
++ *   ratios from 3:1 to 4.5:1 of degrees (Celsius) per half-dB gain adjust */
++static struct iwl_txpower_comp_entry {
++	s32 degrees_per_05db_a;
++	s32 degrees_per_05db_a_denom;
++} tx_power_cmp_tble[CALIB_CH_GROUP_MAX] = {
++	{9, 2},			/* group 0 5.2, ch  34-43 */
++	{4, 1},			/* group 1 5.2, ch  44-70 */
++	{4, 1},			/* group 2 5.2, ch  71-124 */
++	{4, 1},			/* group 3 5.2, ch 125-200 */
++	{3, 1}			/* group 4 2.4, ch   all */
++};
++
++static s32 get_min_power_index(s32 rate_power_index, u32 band)
++{
++	if (!band) {
++		if ((rate_power_index & 7) <= 4)
++			return MIN_TX_GAIN_INDEX_52GHZ_EXT;
++	}
++	return MIN_TX_GAIN_INDEX;
++}
++
++struct gain_entry {
++	u8 dsp;
++	u8 radio;
++};
++
++static const struct gain_entry gain_table[2][108] = {
++	/* 5.2GHz power gain index table */
++	{
++	 {123, 0x3F},		/* highest txpower */
++	 {117, 0x3F},
++	 {110, 0x3F},
++	 {104, 0x3F},
++	 {98, 0x3F},
++	 {110, 0x3E},
++	 {104, 0x3E},
++	 {98, 0x3E},
++	 {110, 0x3D},
++	 {104, 0x3D},
++	 {98, 0x3D},
++	 {110, 0x3C},
++	 {104, 0x3C},
++	 {98, 0x3C},
++	 {110, 0x3B},
++	 {104, 0x3B},
++	 {98, 0x3B},
++	 {110, 0x3A},
++	 {104, 0x3A},
++	 {98, 0x3A},
++	 {110, 0x39},
++	 {104, 0x39},
++	 {98, 0x39},
++	 {110, 0x38},
++	 {104, 0x38},
++	 {98, 0x38},
++	 {110, 0x37},
++	 {104, 0x37},
++	 {98, 0x37},
++	 {110, 0x36},
++	 {104, 0x36},
++	 {98, 0x36},
++	 {110, 0x35},
++	 {104, 0x35},
++	 {98, 0x35},
++	 {110, 0x34},
++	 {104, 0x34},
++	 {98, 0x34},
++	 {110, 0x33},
++	 {104, 0x33},
++	 {98, 0x33},
++	 {110, 0x32},
++	 {104, 0x32},
++	 {98, 0x32},
++	 {110, 0x31},
++	 {104, 0x31},
++	 {98, 0x31},
++	 {110, 0x30},
++	 {104, 0x30},
++	 {98, 0x30},
++	 {110, 0x25},
++	 {104, 0x25},
++	 {98, 0x25},
++	 {110, 0x24},
++	 {104, 0x24},
++	 {98, 0x24},
++	 {110, 0x23},
++	 {104, 0x23},
++	 {98, 0x23},
++	 {110, 0x22},
++	 {104, 0x18},
++	 {98, 0x18},
++	 {110, 0x17},
++	 {104, 0x17},
++	 {98, 0x17},
++	 {110, 0x16},
++	 {104, 0x16},
++	 {98, 0x16},
++	 {110, 0x15},
++	 {104, 0x15},
++	 {98, 0x15},
++	 {110, 0x14},
++	 {104, 0x14},
++	 {98, 0x14},
++	 {110, 0x13},
++	 {104, 0x13},
++	 {98, 0x13},
++	 {110, 0x12},
++	 {104, 0x08},
++	 {98, 0x08},
++	 {110, 0x07},
++	 {104, 0x07},
++	 {98, 0x07},
++	 {110, 0x06},
++	 {104, 0x06},
++	 {98, 0x06},
++	 {110, 0x05},
++	 {104, 0x05},
++	 {98, 0x05},
++	 {110, 0x04},
++	 {104, 0x04},
++	 {98, 0x04},
++	 {110, 0x03},
++	 {104, 0x03},
++	 {98, 0x03},
++	 {110, 0x02},
++	 {104, 0x02},
++	 {98, 0x02},
++	 {110, 0x01},
++	 {104, 0x01},
++	 {98, 0x01},
++	 {110, 0x00},
++	 {104, 0x00},
++	 {98, 0x00},
++	 {93, 0x00},
++	 {88, 0x00},
++	 {83, 0x00},
++	 {78, 0x00},
++	 },
++	/* 2.4GHz power gain index table */
++	{
++	 {110, 0x3f},		/* highest txpower */
++	 {104, 0x3f},
++	 {98, 0x3f},
++	 {110, 0x3e},
++	 {104, 0x3e},
++	 {98, 0x3e},
++	 {110, 0x3d},
++	 {104, 0x3d},
++	 {98, 0x3d},
++	 {110, 0x3c},
++	 {104, 0x3c},
++	 {98, 0x3c},
++	 {110, 0x3b},
++	 {104, 0x3b},
++	 {98, 0x3b},
++	 {110, 0x3a},
++	 {104, 0x3a},
++	 {98, 0x3a},
++	 {110, 0x39},
++	 {104, 0x39},
++	 {98, 0x39},
++	 {110, 0x38},
++	 {104, 0x38},
++	 {98, 0x38},
++	 {110, 0x37},
++	 {104, 0x37},
++	 {98, 0x37},
++	 {110, 0x36},
++	 {104, 0x36},
++	 {98, 0x36},
++	 {110, 0x35},
++	 {104, 0x35},
++	 {98, 0x35},
++	 {110, 0x34},
++	 {104, 0x34},
++	 {98, 0x34},
++	 {110, 0x33},
++	 {104, 0x33},
++	 {98, 0x33},
++	 {110, 0x32},
++	 {104, 0x32},
++	 {98, 0x32},
++	 {110, 0x31},
++	 {104, 0x31},
++	 {98, 0x31},
++	 {110, 0x30},
++	 {104, 0x30},
++	 {98, 0x30},
++	 {110, 0x6},
++	 {104, 0x6},
++	 {98, 0x6},
++	 {110, 0x5},
++	 {104, 0x5},
++	 {98, 0x5},
++	 {110, 0x4},
++	 {104, 0x4},
++	 {98, 0x4},
++	 {110, 0x3},
++	 {104, 0x3},
++	 {98, 0x3},
++	 {110, 0x2},
++	 {104, 0x2},
++	 {98, 0x2},
++	 {110, 0x1},
++	 {104, 0x1},
++	 {98, 0x1},
++	 {110, 0x0},
++	 {104, 0x0},
++	 {98, 0x0},
++	 {97, 0},
++	 {96, 0},
++	 {95, 0},
++	 {94, 0},
++	 {93, 0},
++	 {92, 0},
++	 {91, 0},
++	 {90, 0},
++	 {89, 0},
++	 {88, 0},
++	 {87, 0},
++	 {86, 0},
++	 {85, 0},
++	 {84, 0},
++	 {83, 0},
++	 {82, 0},
++	 {81, 0},
++	 {80, 0},
++	 {79, 0},
++	 {78, 0},
++	 {77, 0},
++	 {76, 0},
++	 {75, 0},
++	 {74, 0},
++	 {73, 0},
++	 {72, 0},
++	 {71, 0},
++	 {70, 0},
++	 {69, 0},
++	 {68, 0},
++	 {67, 0},
++	 {66, 0},
++	 {65, 0},
++	 {64, 0},
++	 {63, 0},
++	 {62, 0},
++	 {61, 0},
++	 {60, 0},
++	 {59, 0},
++	 }
++};
++
++static int iwl4965_fill_txpower_tbl(struct iwl_priv *priv, u8 band, u16 channel,
++				    u8 is_fat, u8 ctrl_chan_high,
++				    struct iwl_tx_power_db *tx_power_tbl)
++{
++	u8 saturation_power;
++	s32 target_power;
++	s32 user_target_power;
++	s32 power_limit;
++	s32 current_temp;
++	s32 reg_limit;
++	s32 current_regulatory;
++	s32 txatten_grp = CALIB_CH_GROUP_MAX;
++	int i;
++	int c;
++	const struct iwl_channel_info *ch_info = NULL;
++	struct iwl_eeprom_calib_ch_info ch_eeprom_info;
++	const struct iwl_eeprom_calib_measure *measurement;
++	s16 voltage;
++	s32 init_voltage;
++	s32 voltage_compensation;
++	s32 degrees_per_05db_num;
++	s32 degrees_per_05db_denom;
++	s32 factory_temp;
++	s32 temperature_comp[2];
++	s32 factory_gain_index[2];
++	s32 factory_actual_pwr[2];
++	s32 power_index;
++
++	/* Sanity check requested level (dBm) */
++	if (priv->user_txpower_limit < IWL_TX_POWER_TARGET_POWER_MIN) {
++		IWL_WARNING("Requested user TXPOWER %d below limit.\n",
++			    priv->user_txpower_limit);
++		return -EINVAL;
++	}
++	if (priv->user_txpower_limit > IWL_TX_POWER_TARGET_POWER_MAX) {
++		IWL_WARNING("Requested user TXPOWER %d above limit.\n",
++			    priv->user_txpower_limit);
++		return -EINVAL;
++	}
++
++	/* user_txpower_limit is in dBm, convert to half-dBm (half-dB units
++	 *   are used for indexing into txpower table) */
++	user_target_power = 2 * priv->user_txpower_limit;
++
++	/* Get current (RXON) channel, band, width */
++	ch_info =
++		iwl4965_get_channel_txpower_info(priv, priv->phymode, channel);
++
++	IWL_DEBUG_TXPOWER("chan %d band %d is_fat %d\n", channel, band,
++			  is_fat);
++
++	if (!ch_info)
++		return -EINVAL;
++
++	/* get txatten group, used to select 1) thermal txpower adjustment
++	 *   and 2) mimo txpower balance between Tx chains. */
++	txatten_grp = iwl4965_get_tx_atten_grp(channel);
++	if (txatten_grp < 0)
++		return -EINVAL;
++
++	IWL_DEBUG_TXPOWER("channel %d belongs to txatten group %d\n",
++			  channel, txatten_grp);
++
++	if (is_fat) {
++		if (ctrl_chan_high)
++			channel -= 2;
++		else
++			channel += 2;
++	}
++
++	/* hardware txpower limits ...
++	 * saturation (clipping distortion) txpowers are in half-dBm */
++	if (band)
++		saturation_power = priv->eeprom.calib_info.saturation_power24;
++	else
++		saturation_power = priv->eeprom.calib_info.saturation_power52;
++
++	if (saturation_power < IWL_TX_POWER_SATURATION_MIN ||
++	    saturation_power > IWL_TX_POWER_SATURATION_MAX) {
++		if (band)
++			saturation_power = IWL_TX_POWER_DEFAULT_SATURATION_24;
++		else
++			saturation_power = IWL_TX_POWER_DEFAULT_SATURATION_52;
++	}
++
++	/* regulatory txpower limits ... reg_limit values are in half-dBm,
++	 *   max_power_avg values are in dBm, convert * 2 */
++	if (is_fat)
++		reg_limit = ch_info->fat_max_power_avg * 2;
++	else
++		reg_limit = ch_info->max_power_avg * 2;
++
++	if ((reg_limit < IWL_TX_POWER_REGULATORY_MIN) ||
++	    (reg_limit > IWL_TX_POWER_REGULATORY_MAX)) {
++		if (band)
++			reg_limit = IWL_TX_POWER_DEFAULT_REGULATORY_24;
++		else
++			reg_limit = IWL_TX_POWER_DEFAULT_REGULATORY_52;
++	}
++
++	/* Interpolate txpower calibration values for this channel,
++	 *   based on factory calibration tests on spaced channels. */
++	iwl4965_interpolate_chan(priv, channel, &ch_eeprom_info);
++
++	/* calculate tx gain adjustment based on power supply voltage */
++	voltage = priv->eeprom.calib_info.voltage;
++	init_voltage = (s32)le32_to_cpu(priv->card_alive_init.voltage);
++	voltage_compensation =
++	    iwl4965_get_voltage_compensation(voltage, init_voltage);
++
++	IWL_DEBUG_TXPOWER("curr volt %d eeprom volt %d volt comp %d\n",
++			  init_voltage,
++			  voltage, voltage_compensation);
++
++	/* get current temperature (Celsius) */
++	current_temp = max(priv->temperature, IWL_TX_POWER_TEMPERATURE_MIN);
++	current_temp = min(priv->temperature, IWL_TX_POWER_TEMPERATURE_MAX);
++	current_temp = KELVIN_TO_CELSIUS(current_temp);
++
++	/* select thermal txpower adjustment params, based on channel group
++	 *   (same frequency group used for mimo txatten adjustment) */
++	degrees_per_05db_num =
++	    tx_power_cmp_tble[txatten_grp].degrees_per_05db_a;
++	degrees_per_05db_denom =
++	    tx_power_cmp_tble[txatten_grp].degrees_per_05db_a_denom;
++
++	/* get per-chain txpower values from factory measurements */
++	for (c = 0; c < 2; c++) {
++		measurement = &ch_eeprom_info.measurements[c][1];
++
++		/* txgain adjustment (in half-dB steps) based on difference
++		 *   between factory and current temperature */
++		factory_temp = measurement->temperature;
++		iwl4965_math_div_round((current_temp - factory_temp) *
++				       degrees_per_05db_denom,
++				       degrees_per_05db_num,
++				       &temperature_comp[c]);
++
++		factory_gain_index[c] = measurement->gain_idx;
++		factory_actual_pwr[c] = measurement->actual_pow;
++
++		IWL_DEBUG_TXPOWER("chain = %d\n", c);
++		IWL_DEBUG_TXPOWER("fctry tmp %d, "
++				  "curr tmp %d, comp %d steps\n",
++				  factory_temp, current_temp,
++				  temperature_comp[c]);
++
++		IWL_DEBUG_TXPOWER("fctry idx %d, fctry pwr %d\n",
++				  factory_gain_index[c],
++				  factory_actual_pwr[c]);
++	}
++
++	/* for each of 33 bit-rates (including 1 for CCK) */
++	for (i = 0; i < POWER_TABLE_NUM_ENTRIES; i++) {
++		u8 is_mimo_rate;
++		union iwl_tx_power_dual_stream tx_power;
++
++		/* for mimo, reduce each chain's txpower by half
++		 * (3dB, 6 steps), so total output power is regulatory
++		 * compliant. */
++		if (i & 0x8) {
++			current_regulatory = reg_limit -
++			    IWL_TX_POWER_MIMO_REGULATORY_COMPENSATION;
++			is_mimo_rate = 1;
++		} else {
++			current_regulatory = reg_limit;
++			is_mimo_rate = 0;
++		}
++
++		/* find txpower limit, either hardware or regulatory */
++		power_limit = saturation_power - back_off_table[i];
++		if (power_limit > current_regulatory)
++			power_limit = current_regulatory;
++
++		/* reduce user's txpower request if necessary
++		 * for this rate on this channel */
++		target_power = user_target_power;
++		if (target_power > power_limit)
++			target_power = power_limit;
++
++		IWL_DEBUG_TXPOWER("rate %d sat %d reg %d usr %d tgt %d\n",
++				  i, saturation_power - back_off_table[i],
++				  current_regulatory, user_target_power,
++				  target_power);
++
++		/* for each of 2 Tx chains (radio transmitters) */
++		for (c = 0; c < 2; c++) {
++			s32 atten_value;
++
++			if (is_mimo_rate)
++				atten_value =
++				    (s32)le32_to_cpu(priv->card_alive_init.
++				    tx_atten[txatten_grp][c]);
++			else
++				atten_value = 0;
++
++			/* calculate index; higher index means lower txpower */
++			power_index = (u8) (factory_gain_index[c] -
++					    (target_power -
++					     factory_actual_pwr[c]) -
++					    temperature_comp[c] -
++					    voltage_compensation +
++					    atten_value);
++
++/*			IWL_DEBUG_TXPOWER("calculated txpower index %d\n",
++						power_index); */
++
++			if (power_index < get_min_power_index(i, band))
++				power_index = get_min_power_index(i, band);
++
++			/* adjust 5 GHz index to support negative indexes */
++			if (!band)
++				power_index += 9;
++
++			/* CCK, rate 32, reduce txpower for CCK */
++			if (i == POWER_TABLE_CCK_ENTRY)
++				power_index +=
++				    IWL_TX_POWER_CCK_COMPENSATION_C_STEP;
++
++			/* stay within the table! */
++			if (power_index > 107) {
++				IWL_WARNING("txpower index %d > 107\n",
++					    power_index);
++				power_index = 107;
++			}
++			if (power_index < 0) {
++				IWL_WARNING("txpower index %d < 0\n",
++					    power_index);
++				power_index = 0;
++			}
++
++			/* fill txpower command for this rate/chain */
++			tx_power.s.radio_tx_gain[c] =
++				gain_table[band][power_index].radio;
++			tx_power.s.dsp_predis_atten[c] =
++				gain_table[band][power_index].dsp;
++
++			IWL_DEBUG_TXPOWER("chain %d mimo %d index %d "
++					  "gain 0x%02x dsp %d\n",
++					  c, atten_value, power_index,
++					tx_power.s.radio_tx_gain[c],
++					tx_power.s.dsp_predis_atten[c]);
++		}/* for each chain */
++
++		tx_power_tbl->power_tbl[i].dw = cpu_to_le32(tx_power.dw);
++
++	}/* for each rate */
++
++	return 0;
++}
++
++/**
++ * iwl_hw_reg_send_txpower - Configure the TXPOWER level user limit
++ *
++ * Uses the active RXON for channel, band, and characteristics (fat, high)
++ * The power limit is taken from priv->user_txpower_limit.
++ */
++int iwl_hw_reg_send_txpower(struct iwl_priv *priv)
++{
++	struct iwl_txpowertable_cmd cmd = { 0 };
++	int rc = 0;
++	u8 band = 0;
++	u8 is_fat = 0;
++	u8 ctrl_chan_high = 0;
++
++	if (test_bit(STATUS_SCANNING, &priv->status)) {
++		/* If this gets hit a lot, switch it to a BUG() and catch
++		 * the stack trace to find out who is calling this during
++		 * a scan. */
++		IWL_WARNING("TX Power requested while scanning!\n");
++		return -EAGAIN;
++	}
++
++	band = ((priv->phymode == MODE_IEEE80211B) ||
++		(priv->phymode == MODE_IEEE80211G));
++
++	is_fat =  is_fat_channel(priv->active_rxon.flags);
++
++	if (is_fat &&
++	    (priv->active_rxon.flags & RXON_FLG_CTRL_CHANNEL_LOC_HI_MSK))
++		ctrl_chan_high = 1;
++
++	cmd.band = band;
++	cmd.channel = priv->active_rxon.channel;
++
++	rc = iwl4965_fill_txpower_tbl(priv, band,
++				le16_to_cpu(priv->active_rxon.channel),
++				is_fat, ctrl_chan_high, &cmd.tx_power);
++	if (rc)
++		return rc;
++
++	rc = iwl_send_cmd_pdu(priv, REPLY_TX_PWR_TABLE_CMD, sizeof(cmd), &cmd);
++	return rc;
++}
++
++int iwl_hw_channel_switch(struct iwl_priv *priv, u16 channel)
++{
++	int rc;
++	u8 band = 0;
++	u8 is_fat = 0;
++	u8 ctrl_chan_high = 0;
++	struct iwl_channel_switch_cmd cmd = { 0 };
++	const struct iwl_channel_info *ch_info;
++
++	band = ((priv->phymode == MODE_IEEE80211B) ||
++		(priv->phymode == MODE_IEEE80211G));
++
++	ch_info = iwl_get_channel_info(priv, priv->phymode, channel);
++
++	is_fat = is_fat_channel(priv->staging_rxon.flags);
++
++	if (is_fat &&
++	    (priv->active_rxon.flags & RXON_FLG_CTRL_CHANNEL_LOC_HI_MSK))
++		ctrl_chan_high = 1;
++
++	cmd.band = band;
++	cmd.expect_beacon = 0;
++	cmd.channel = cpu_to_le16(channel);
++	cmd.rxon_flags = priv->active_rxon.flags;
++	cmd.rxon_filter_flags = priv->active_rxon.filter_flags;
++	cmd.switch_time = cpu_to_le32(priv->ucode_beacon_time);
++	if (ch_info)
++		cmd.expect_beacon = is_channel_radar(ch_info);
++	else
++		cmd.expect_beacon = 1;
++
++	rc = iwl4965_fill_txpower_tbl(priv, band, channel, is_fat,
++				      ctrl_chan_high, &cmd.tx_power);
++	if (rc) {
++		IWL_DEBUG_11H("error:%d  fill txpower_tbl\n", rc);
++		return rc;
++	}
++
++	rc = iwl_send_cmd_pdu(priv, REPLY_CHANNEL_SWITCH, sizeof(cmd), &cmd);
++	return rc;
++}
++
++#define RTS_HCCA_RETRY_LIMIT		3
++#define RTS_DFAULT_RETRY_LIMIT		60
++
++void iwl_hw_build_tx_cmd_rate(struct iwl_priv *priv,
++			      struct iwl_cmd *cmd,
++			      struct ieee80211_tx_control *ctrl,
++			      struct ieee80211_hdr *hdr, int sta_id,
++			      int is_hcca)
++{
++	u8 rate;
++	u8 rts_retry_limit = 0;
++	u8 data_retry_limit = 0;
++	__le32 tx_flags;
++	u16 fc = le16_to_cpu(hdr->frame_control);
++
++	tx_flags = cmd->cmd.tx.tx_flags;
++
++	rate = iwl_rates[ctrl->tx_rate].plcp;
++
++	rts_retry_limit = (is_hcca) ?
++	    RTS_HCCA_RETRY_LIMIT : RTS_DFAULT_RETRY_LIMIT;
++
++	if (ieee80211_is_probe_response(fc)) {
++		data_retry_limit = 3;
++		if (data_retry_limit < rts_retry_limit)
++			rts_retry_limit = data_retry_limit;
++	} else
++		data_retry_limit = IWL_DEFAULT_TX_RETRY;
++
++	if (priv->data_retry_limit != -1)
++		data_retry_limit = priv->data_retry_limit;
++
++	if ((fc & IEEE80211_FCTL_FTYPE) == IEEE80211_FTYPE_MGMT) {
++		switch (fc & IEEE80211_FCTL_STYPE) {
++		case IEEE80211_STYPE_AUTH:
++		case IEEE80211_STYPE_DEAUTH:
++		case IEEE80211_STYPE_ASSOC_REQ:
++		case IEEE80211_STYPE_REASSOC_REQ:
++			if (tx_flags & TX_CMD_FLG_RTS_MSK) {
++				tx_flags &= ~TX_CMD_FLG_RTS_MSK;
++				tx_flags |= TX_CMD_FLG_CTS_MSK;
++			}
++			break;
++		default:
++			break;
++		}
++	}
++
++	cmd->cmd.tx.rts_retry_limit = rts_retry_limit;
++	cmd->cmd.tx.data_retry_limit = data_retry_limit;
++	cmd->cmd.tx.rate_n_flags = iwl_hw_set_rate_n_flags(rate, 0);
++	cmd->cmd.tx.tx_flags = tx_flags;
++}
++
++int iwl_hw_get_rx_read(struct iwl_priv *priv)
++{
++	struct iwl_shared *shared_data = priv->hw_setting.shared_virt;
++
++	return IWL_GET_BITS(*shared_data, rb_closed_stts_rb_num);
++}
++
++int iwl_hw_get_temperature(struct iwl_priv *priv)
++{
++	return priv->temperature;
++}
++
++unsigned int iwl_hw_get_beacon_cmd(struct iwl_priv *priv,
++			  struct iwl_frame *frame, u8 rate)
++{
++	struct iwl_tx_beacon_cmd *tx_beacon_cmd;
++	unsigned int frame_size;
++
++	tx_beacon_cmd = &frame->u.beacon;
++	memset(tx_beacon_cmd, 0, sizeof(*tx_beacon_cmd));
++
++	tx_beacon_cmd->tx.sta_id = IWL4965_BROADCAST_ID;
++	tx_beacon_cmd->tx.stop_time.life_time = TX_CMD_LIFE_TIME_INFINITE;
++
++	frame_size = iwl_fill_beacon_frame(priv,
++				tx_beacon_cmd->frame,
++				BROADCAST_ADDR,
++				sizeof(frame->u) - sizeof(*tx_beacon_cmd));
++
++	BUG_ON(frame_size > MAX_MPDU_SIZE);
++	tx_beacon_cmd->tx.len = cpu_to_le16((u16)frame_size);
++
++	if ((rate == IWL_RATE_1M_PLCP) || (rate >= IWL_RATE_2M_PLCP))
++		tx_beacon_cmd->tx.rate_n_flags =
++			iwl_hw_set_rate_n_flags(rate, RATE_MCS_CCK_MSK);
++	else
++		tx_beacon_cmd->tx.rate_n_flags =
++			iwl_hw_set_rate_n_flags(rate, 0);
++
++	tx_beacon_cmd->tx.tx_flags = (TX_CMD_FLG_SEQ_CTL_MSK |
++				TX_CMD_FLG_TSF_MSK | TX_CMD_FLG_STA_RATE_MSK);
++	return (sizeof(*tx_beacon_cmd) + frame_size);
++}
++
++int iwl_hw_tx_queue_init(struct iwl_priv *priv, struct iwl_tx_queue *txq)
++{
++	int rc;
++	unsigned long flags;
++	int txq_id = txq->q.id;
++
++	spin_lock_irqsave(&priv->lock, flags);
++	rc = iwl_grab_restricted_access(priv);
++	if (rc) {
++		spin_unlock_irqrestore(&priv->lock, flags);
++		return rc;
++	}
++
++	iwl_write_restricted(priv, FH_MEM_CBBC_QUEUE(txq_id),
++			     txq->q.dma_addr >> 8);
++	iwl_write_restricted(
++		priv, IWL_FH_TCSR_CHNL_TX_CONFIG_REG(txq_id),
++		IWL_FH_TCSR_TX_CONFIG_REG_VAL_DMA_CHNL_ENABLE |
++		IWL_FH_TCSR_TX_CONFIG_REG_VAL_DMA_CREDIT_ENABLE_VAL);
++	iwl_release_restricted_access(priv);
++	spin_unlock_irqrestore(&priv->lock, flags);
++
++	return 0;
++}
++
++static inline u8 iwl4965_get_dma_hi_address(dma_addr_t addr)
++{
++	return sizeof(addr) > sizeof(u32) ? (addr >> 16) >> 16 : 0;
++}
++
++int iwl_hw_txq_attach_buf_to_tfd(struct iwl_priv *priv, void *ptr,
++				 dma_addr_t addr, u16 len)
++{
++	int index, is_odd;
++	struct iwl_tfd_frame *tfd = ptr;
++	u32 num_tbs = IWL_GET_BITS(*tfd, num_tbs);
++
++	if ((num_tbs >= MAX_NUM_OF_TBS) || (num_tbs < 0)) {
++		IWL_ERROR("Error can not send more than %d chunks\n",
++			  MAX_NUM_OF_TBS);
++		return -EINVAL;
++	}
++
++	index = num_tbs / 2;
++	is_odd = num_tbs & 0x1;
++
++	if (!is_odd) {
++		tfd->pa[index].tb1_addr = cpu_to_le32(addr);
++		IWL_SET_BITS(tfd->pa[index], tb1_addr_hi,
++			     iwl4965_get_dma_hi_address(addr));
++		IWL_SET_BITS(tfd->pa[index], tb1_len, len);
++	} else {
++		IWL_SET_BITS(tfd->pa[index], tb2_addr_lo16,
++			     (u32) (addr & 0xffff));
++		IWL_SET_BITS(tfd->pa[index], tb2_addr_hi20, addr >> 16);
++		IWL_SET_BITS(tfd->pa[index], tb2_len, len);
++	}
++
++	IWL_SET_BITS(*tfd, num_tbs, num_tbs + 1);
++
++	return 0;
++}
++
++void iwl_hw_card_show_info(struct iwl_priv *priv)
++{
++	u16 hw_version = priv->eeprom.board_revision_4965;
++
++	IWL_DEBUG_INFO("4965ABGN HW Version %u.%u.%u\n",
++		       ((hw_version >> 8) & 0x0F),
++		       ((hw_version >> 8) >> 4), (hw_version & 0x00FF));
++
++	IWL_DEBUG_INFO("4965ABGN PBA Number %.16s\n",
++		       priv->eeprom.board_pba_number_4965);
++}
++
++#define IWL_TX_CRC_SIZE		4
++#define IWL_TX_DELIMITER_SIZE	4
++
++int iwl4965_tx_queue_update_wr_ptr(struct iwl_priv *priv,
++				   struct iwl_tx_queue *txq, u16 byte_cnt)
++{
++	int len;
++	int txq_id = txq->q.id;
++	struct iwl_shared *shared_data = priv->hw_setting.shared_virt;
++
++	if (txq->need_update == 0)
++		return 0;
++
++	len = byte_cnt + IWL_TX_CRC_SIZE + IWL_TX_DELIMITER_SIZE;
++
++	IWL_SET_BITS16(shared_data->queues_byte_cnt_tbls[txq_id].
++		       tfd_offset[txq->q.first_empty], byte_cnt, len);
++
++	if (txq->q.first_empty < IWL4965_MAX_WIN_SIZE)
++		IWL_SET_BITS16(shared_data->queues_byte_cnt_tbls[txq_id].
++			tfd_offset[IWL4965_QUEUE_SIZE + txq->q.first_empty],
++			byte_cnt, len);
++
++	return 0;
++}
++
++/* Set up Rx receiver/antenna/chain usage in "staging" RXON image.
++ * This should not be used for scan command ... it puts data in wrong place.  */
++void iwl4965_set_rxon_chain(struct iwl_priv *priv)
++{
++	u8 is_single = is_single_stream(priv);
++	u8 idle_state, rx_state;
++
++	priv->staging_rxon.rx_chain = 0;
++	rx_state = idle_state = 3;
++
++	/* Tell uCode which antennas are actually connected.
++	 * Before first association, we assume all antennas are connected.
++	 * Just after first association, iwl4965_noise_calibration()
++	 *    checks which antennas actually *are* connected. */
++	priv->staging_rxon.rx_chain |=
++	    cpu_to_le16(priv->valid_antenna << RXON_RX_CHAIN_VALID_POS);
++
++	/* How many receivers should we use? */
++	iwl4965_get_rx_chain_counter(priv, &idle_state, &rx_state);
++	priv->staging_rxon.rx_chain |=
++		cpu_to_le16(rx_state << RXON_RX_CHAIN_MIMO_CNT_POS);
++	priv->staging_rxon.rx_chain |=
++		cpu_to_le16(idle_state << RXON_RX_CHAIN_CNT_POS);
++
++	if (!is_single && (rx_state >= 2) &&
++	    !test_bit(STATUS_POWER_PMI, &priv->status))
++		priv->staging_rxon.rx_chain |= RXON_RX_CHAIN_MIMO_FORCE_MSK;
++	else
++		priv->staging_rxon.rx_chain &= ~RXON_RX_CHAIN_MIMO_FORCE_MSK;
++
++	IWL_DEBUG_ASSOC("rx chain %X\n", priv->staging_rxon.rx_chain);
++}
++
++#ifdef CONFIG_IWLWIFI_HT
++#ifdef CONFIG_IWLWIFI_HT_AGG
++/*
++	get the traffic load value for tid
++*/
++static u32 iwl4965_tl_get_load(struct iwl_priv *priv, u8 tid)
++{
++	u32 load = 0;
++	u32 current_time = jiffies_to_msecs(jiffies);
++	u32 time_diff;
++	s32 index;
++	unsigned long flags;
++	struct iwl_traffic_load *tid_ptr = NULL;
++
++	if (tid >= TID_MAX_LOAD_COUNT)
++		return 0;
++
++	tid_ptr = &(priv->lq_mngr.agg_ctrl.traffic_load[tid]);
++
++	current_time -= current_time % TID_ROUND_VALUE;
++
++	spin_lock_irqsave(&priv->lq_mngr.lock, flags);
++	if (!(tid_ptr->queue_count))
++		goto out;
++
++	time_diff = TIME_WRAP_AROUND(tid_ptr->time_stamp, current_time);
++	index = time_diff / TID_QUEUE_CELL_SPACING;
++
++	if (index >= TID_QUEUE_MAX_SIZE) {
++		u32 oldest_time = current_time - TID_MAX_TIME_DIFF;
++
++		while (tid_ptr->queue_count &&
++		       (tid_ptr->time_stamp < oldest_time)) {
++			tid_ptr->total -= tid_ptr->packet_count[tid_ptr->head];
++			tid_ptr->packet_count[tid_ptr->head] = 0;
++			tid_ptr->time_stamp += TID_QUEUE_CELL_SPACING;
++			tid_ptr->queue_count--;
++			tid_ptr->head++;
++			if (tid_ptr->head >= TID_QUEUE_MAX_SIZE)
++				tid_ptr->head = 0;
++		}
++	}
++	load = tid_ptr->total;
++
++ out:
++	spin_unlock_irqrestore(&priv->lq_mngr.lock, flags);
++	return load;
++}
++
++/*
++	increment traffic load value for tid and also remove
++	any old values if passed the certian time period
++*/
++static void iwl4965_tl_add_packet(struct iwl_priv *priv, u8 tid)
++{
++	u32 current_time = jiffies_to_msecs(jiffies);
++	u32 time_diff;
++	s32 index;
++	unsigned long flags;
++	struct iwl_traffic_load *tid_ptr = NULL;
++
++	if (tid >= TID_MAX_LOAD_COUNT)
++		return;
++
++	tid_ptr = &(priv->lq_mngr.agg_ctrl.traffic_load[tid]);
++
++	current_time -= current_time % TID_ROUND_VALUE;
++
++	spin_lock_irqsave(&priv->lq_mngr.lock, flags);
++	if (!(tid_ptr->queue_count)) {
++		tid_ptr->total = 1;
++		tid_ptr->time_stamp = current_time;
++		tid_ptr->queue_count = 1;
++		tid_ptr->head = 0;
++		tid_ptr->packet_count[0] = 1;
++		goto out;
++	}
++
++	time_diff = TIME_WRAP_AROUND(tid_ptr->time_stamp, current_time);
++	index = time_diff / TID_QUEUE_CELL_SPACING;
++
++	if (index >= TID_QUEUE_MAX_SIZE) {
++		u32 oldest_time = current_time - TID_MAX_TIME_DIFF;
++
++		while (tid_ptr->queue_count &&
++		       (tid_ptr->time_stamp < oldest_time)) {
++			tid_ptr->total -= tid_ptr->packet_count[tid_ptr->head];
++			tid_ptr->packet_count[tid_ptr->head] = 0;
++			tid_ptr->time_stamp += TID_QUEUE_CELL_SPACING;
++			tid_ptr->queue_count--;
++			tid_ptr->head++;
++			if (tid_ptr->head >= TID_QUEUE_MAX_SIZE)
++				tid_ptr->head = 0;
++		}
++	}
++
++	index = (tid_ptr->head + index) % TID_QUEUE_MAX_SIZE;
++	tid_ptr->packet_count[index] = tid_ptr->packet_count[index] + 1;
++	tid_ptr->total = tid_ptr->total + 1;
++
++	if ((index + 1) > tid_ptr->queue_count)
++		tid_ptr->queue_count = index + 1;
++ out:
++	spin_unlock_irqrestore(&priv->lq_mngr.lock, flags);
++
++}
++
++#define MMAC_SCHED_MAX_NUMBER_OF_HT_BACK_FLOWS   7
++enum HT_STATUS {
++	BA_STATUS_FAILURE = 0,
++	BA_STATUS_INITIATOR_DELBA,
++	BA_STATUS_RECIPIENT_DELBA,
++	BA_STATUS_RENEW_ADDBA_REQUEST,
++	BA_STATUS_ACTIVE,
++};
++
++static u8 iwl4964_tl_ba_avail(struct iwl_priv *priv)
++{
++	int i;
++	struct iwl_lq_mngr *lq;
++	u8 count = 0;
++	u16 msk;
++
++	lq = (struct iwl_lq_mngr *)&(priv->lq_mngr);
++	for (i = 0; i < TID_MAX_LOAD_COUNT ; i++) {
++		msk = 1 << i;
++		if ((lq->agg_ctrl.granted_ba & msk) ||
++		    (lq->agg_ctrl.wait_for_agg_status & msk))
++			count++;
++	}
++
++	if (count < MMAC_SCHED_MAX_NUMBER_OF_HT_BACK_FLOWS)
++		return 1;
++
++	return 0;
++}
++
++static void iwl4965_ba_status(struct iwl_priv *priv,
++			      u8 tid, enum HT_STATUS status);
++
++static int iwl4965_perform_addba(struct iwl_priv *priv, u8 tid, u32 length,
++				 u32 ba_timeout)
++{
++	int rc;
++
++	rc = ieee80211_start_BA_session(priv->hw, priv->bssid, tid);
++	if (rc)
++		iwl4965_ba_status(priv, tid, BA_STATUS_FAILURE);
++
++	return rc;
++}
++
++static int iwl4965_perform_delba(struct iwl_priv *priv, u8 tid)
++{
++	int rc;
++
++	rc = ieee80211_stop_BA_session(priv->hw, priv->bssid, tid);
++	if (rc)
++		iwl4965_ba_status(priv, tid, BA_STATUS_FAILURE);
++
++	return rc;
++}
++
++static void iwl4965_turn_on_agg_for_tid(struct iwl_priv *priv,
++					struct iwl_lq_mngr *lq,
++					u8 auto_agg, u8 tid)
++{
++	u32 tid_msk = (1 << tid);
++	unsigned long flags;
++
++	spin_lock_irqsave(&priv->lq_mngr.lock, flags);
++/*
++	if ((auto_agg) && (!lq->enable_counter)){
++		lq->agg_ctrl.next_retry = 0;
++		lq->agg_ctrl.tid_retry = 0;
++		spin_unlock_irqrestore(&priv->lq_mngr.lock, flags);
++		return;
++	}
++*/
++	if (!(lq->agg_ctrl.granted_ba & tid_msk) &&
++	    (lq->agg_ctrl.requested_ba & tid_msk)) {
++		u8 available_queues;
++		u32 load;
++
++		spin_unlock_irqrestore(&priv->lq_mngr.lock, flags);
++		available_queues = iwl4964_tl_ba_avail(priv);
++		load = iwl4965_tl_get_load(priv, tid);
++
++		spin_lock_irqsave(&priv->lq_mngr.lock, flags);
++		if (!available_queues) {
++			if (auto_agg)
++				lq->agg_ctrl.tid_retry |= tid_msk;
++			else {
++				lq->agg_ctrl.requested_ba &= ~tid_msk;
++				lq->agg_ctrl.wait_for_agg_status &= ~tid_msk;
++			}
++		} else if ((auto_agg) &&
++			   ((load <= lq->agg_ctrl.tid_traffic_load_threshold) ||
++			    ((lq->agg_ctrl.wait_for_agg_status & tid_msk))))
++			lq->agg_ctrl.tid_retry |= tid_msk;
++		else {
++			lq->agg_ctrl.wait_for_agg_status |= tid_msk;
++			spin_unlock_irqrestore(&priv->lq_mngr.lock, flags);
++			iwl4965_perform_addba(priv, tid, 0x40,
++					      lq->agg_ctrl.ba_timeout);
++			spin_lock_irqsave(&priv->lq_mngr.lock, flags);
++		}
++	}
++	spin_unlock_irqrestore(&priv->lq_mngr.lock, flags);
++}
++
++static void iwl4965_turn_on_agg(struct iwl_priv *priv, u8 tid)
++{
++	struct iwl_lq_mngr *lq;
++	unsigned long flags;
++
++	lq = (struct iwl_lq_mngr *)&(priv->lq_mngr);
++
++	if ((tid < TID_MAX_LOAD_COUNT))
++		iwl4965_turn_on_agg_for_tid(priv, lq, lq->agg_ctrl.auto_agg,
++					    tid);
++	else if (tid == TID_ALL_SPECIFIED) {
++		if (lq->agg_ctrl.requested_ba) {
++			for (tid = 0; tid < TID_MAX_LOAD_COUNT; tid++)
++				iwl4965_turn_on_agg_for_tid(priv, lq,
++					lq->agg_ctrl.auto_agg, tid);
++		} else {
++			spin_lock_irqsave(&priv->lq_mngr.lock, flags);
++			lq->agg_ctrl.tid_retry = 0;
++			lq->agg_ctrl.next_retry = 0;
++			spin_unlock_irqrestore(&priv->lq_mngr.lock, flags);
++		}
++	}
++
++}
++
++void iwl4965_turn_off_agg(struct iwl_priv *priv, u8 tid)
++{
++	u32 tid_msk;
++	struct iwl_lq_mngr *lq;
++	unsigned long flags;
++
++	lq = (struct iwl_lq_mngr *)&(priv->lq_mngr);
++
++	if ((tid < TID_MAX_LOAD_COUNT)) {
++		tid_msk = 1 << tid;
++		spin_lock_irqsave(&priv->lq_mngr.lock, flags);
++		lq->agg_ctrl.wait_for_agg_status |= tid_msk;
++		lq->agg_ctrl.requested_ba &= ~tid_msk;
++		spin_unlock_irqrestore(&priv->lq_mngr.lock, flags);
++		iwl4965_perform_delba(priv, tid);
++	} else if (tid == TID_ALL_SPECIFIED) {
++		spin_lock_irqsave(&priv->lq_mngr.lock, flags);
++		for (tid = 0; tid < TID_MAX_LOAD_COUNT; tid++) {
++			tid_msk = 1 << tid;
++			lq->agg_ctrl.wait_for_agg_status |= tid_msk;
++			spin_unlock_irqrestore(&priv->lq_mngr.lock, flags);
++			iwl4965_perform_delba(priv, tid);
++			spin_lock_irqsave(&priv->lq_mngr.lock, flags);
++		}
++		lq->agg_ctrl.requested_ba = 0;
++		spin_unlock_irqrestore(&priv->lq_mngr.lock, flags);
++	}
++}
++
++static void iwl4965_ba_status(struct iwl_priv *priv,
++				u8 tid, enum HT_STATUS status)
++{
++	struct iwl_lq_mngr *lq;
++	u32 tid_msk = (1 << tid);
++	unsigned long flags;
++
++	lq = (struct iwl_lq_mngr *)&(priv->lq_mngr);
++
++	if ((tid >= TID_MAX_LOAD_COUNT))
++		goto out;
++
++	spin_lock_irqsave(&priv->lq_mngr.lock, flags);
++	switch (status) {
++	case BA_STATUS_ACTIVE:
++		if (!(lq->agg_ctrl.granted_ba & tid_msk))
++			lq->agg_ctrl.granted_ba |= tid_msk;
++		break;
++	default:
++		if ((lq->agg_ctrl.granted_ba & tid_msk))
++			lq->agg_ctrl.granted_ba &= ~tid_msk;
++		break;
++	}
++
++	lq->agg_ctrl.wait_for_agg_status &= ~tid_msk;
++	if (status != BA_STATUS_ACTIVE) {
++		if (lq->agg_ctrl.auto_agg) {
++			lq->agg_ctrl.tid_retry |= tid_msk;
++			lq->agg_ctrl.next_retry =
++			    jiffies + msecs_to_jiffies(500);
++		} else
++			lq->agg_ctrl.requested_ba &= ~tid_msk;
++	}
++	spin_unlock_irqrestore(&priv->lq_mngr.lock, flags);
++ out:
++	return;
++}
++
++static void iwl4965_bg_agg_work(struct work_struct *work)
++{
++	struct iwl_priv *priv = container_of(work, struct iwl_priv,
++					agg_work);
++
++	u32 tid;
++	u32 retry_tid;
++	u32 tid_msk;
++	unsigned long flags;
++	struct iwl_lq_mngr *lq = (struct iwl_lq_mngr *)&(priv->lq_mngr);
++
++	spin_lock_irqsave(&priv->lq_mngr.lock, flags);
++	retry_tid = lq->agg_ctrl.tid_retry;
++	lq->agg_ctrl.tid_retry = 0;
++	spin_unlock_irqrestore(&priv->lq_mngr.lock, flags);
++
++	if (retry_tid == TID_ALL_SPECIFIED)
++		iwl4965_turn_on_agg(priv, TID_ALL_SPECIFIED);
++	else {
++		for (tid = 0; tid < TID_MAX_LOAD_COUNT; tid++) {
++			tid_msk = (1 << tid);
++			if (retry_tid & tid_msk)
++				iwl4965_turn_on_agg(priv, tid);
++		}
++	}
++
++	spin_lock_irqsave(&priv->lq_mngr.lock, flags);
++	if (lq->agg_ctrl.tid_retry)
++		lq->agg_ctrl.next_retry = jiffies + msecs_to_jiffies(500);
++	spin_unlock_irqrestore(&priv->lq_mngr.lock, flags);
++	return;
++}
++#endif /*CONFIG_IWLWIFI_HT_AGG */
++#endif /* CONFIG_IWLWIFI_HT */
++
++int iwl4965_tx_cmd(struct iwl_priv *priv, struct iwl_cmd *out_cmd,
++		   u8 sta_id, dma_addr_t txcmd_phys,
++		   struct ieee80211_hdr *hdr, u8 hdr_len,
++		   struct ieee80211_tx_control *ctrl, void *sta_in)
++{
++	struct iwl_tx_cmd cmd;
++	struct iwl_tx_cmd *tx = (struct iwl_tx_cmd *)&out_cmd->cmd.payload[0];
++	dma_addr_t scratch_phys;
++	u8 unicast = 0;
++	u8 is_data = 1;
++	u16 fc;
++	u16 rate_flags;
++	int rate_index = min(ctrl->tx_rate & 0xffff, IWL_RATE_COUNT - 1);
++#ifdef CONFIG_IWLWIFI_HT
++#ifdef CONFIG_IWLWIFI_HT_AGG
++	__le16 *qc;
++#endif /*CONFIG_IWLWIFI_HT_AGG */
++#endif /* CONFIG_IWLWIFI_HT */
++
++	unicast = !is_multicast_ether_addr(hdr->addr1);
++
++	fc = le16_to_cpu(hdr->frame_control);
++	if ((fc & IEEE80211_FCTL_FTYPE) != IEEE80211_FTYPE_DATA)
++		is_data = 0;
++
++	memcpy(&cmd, &(out_cmd->cmd.tx), sizeof(struct iwl_tx_cmd));
++	memset(tx, 0, sizeof(struct iwl_tx_cmd));
++	memcpy(tx->hdr, hdr, hdr_len);
++
++	tx->len = cmd.len;
++	tx->driver_txop = cmd.driver_txop;
++	tx->stop_time.life_time = cmd.stop_time.life_time;
++	tx->tx_flags = cmd.tx_flags;
++	tx->sta_id = cmd.sta_id;
++	tx->tid_tspec = cmd.tid_tspec;
++	tx->timeout.pm_frame_timeout = cmd.timeout.pm_frame_timeout;
++	tx->next_frame_len = cmd.next_frame_len;
++
++	tx->sec_ctl = cmd.sec_ctl;
++	memcpy(&(tx->key[0]), &(cmd.key[0]), 16);
++	tx->tx_flags = cmd.tx_flags;
++
++	tx->rts_retry_limit = cmd.rts_retry_limit;
++	tx->data_retry_limit = cmd.data_retry_limit;
++
++	scratch_phys = txcmd_phys + sizeof(struct iwl_cmd_header) +
++	    offsetof(struct iwl_tx_cmd, scratch);
++	tx->dram_lsb_ptr = cpu_to_le32(scratch_phys);
++	tx->dram_msb_ptr = iwl4965_get_dma_hi_address(scratch_phys);
++
++	/* Hard coded to start at the highest retry fallback position
++	 * until the 4965 specific rate control algorithm is tied in */
++	tx->initial_rate_index = LINK_QUAL_MAX_RETRY_NUM - 1;
++
++	/* Alternate between antenna A and B for successive frames */
++	if (priv->use_ant_b_for_management_frame) {
++		priv->use_ant_b_for_management_frame = 0;
++		rate_flags = RATE_MCS_ANT_B_MSK;
++	} else {
++		priv->use_ant_b_for_management_frame = 1;
++		rate_flags = RATE_MCS_ANT_A_MSK;
++	}
++
++	if (!unicast || !is_data) {
++		if ((rate_index >= IWL_FIRST_CCK_RATE) &&
++		    (rate_index <= IWL_LAST_CCK_RATE))
++			rate_flags |= RATE_MCS_CCK_MSK;
++	} else {
++		tx->initial_rate_index = 0;
++		tx->tx_flags |= TX_CMD_FLG_STA_RATE_MSK;
++	}
++
++	tx->rate_n_flags = iwl_hw_set_rate_n_flags(iwl_rates[rate_index].plcp,
++						rate_flags);
++
++	if (ieee80211_is_probe_request(fc))
++		tx->tx_flags |= TX_CMD_FLG_TSF_MSK;
++	else if (ieee80211_is_back_request(fc))
++		tx->tx_flags |= TX_CMD_FLG_ACK_MSK |
++			TX_CMD_FLG_IMM_BA_RSP_MASK;
++#ifdef CONFIG_IWLWIFI_HT
++#ifdef CONFIG_IWLWIFI_HT_AGG
++	qc = ieee80211_get_qos_ctrl(hdr);
++	if (qc &&
++	    (priv->iw_mode != IEEE80211_IF_TYPE_IBSS)) {
++		u8 tid = 0;
++		tid = (u8) (le16_to_cpu(*qc) & 0xF);
++		if (tid < TID_MAX_LOAD_COUNT)
++			iwl4965_tl_add_packet(priv, tid);
++	}
++
++	if (priv->lq_mngr.agg_ctrl.next_retry &&
++	    (time_after(priv->lq_mngr.agg_ctrl.next_retry, jiffies))) {
++		unsigned long flags;
++
++		spin_lock_irqsave(&priv->lq_mngr.lock, flags);
++		priv->lq_mngr.agg_ctrl.next_retry = 0;
++		spin_unlock_irqrestore(&priv->lq_mngr.lock, flags);
++		schedule_work(&priv->agg_work);
++	}
++#endif
++#endif
++	return 0;
++}
++
++/**
++ * sign_extend - Sign extend a value using specified bit as sign-bit
++ *
++ * Example: sign_extend(9, 3) would return -7 as bit3 of 1001b is 1
++ * and bit0..2 is 001b which when sign extended to 1111111111111001b is -7.
++ *
++ * @param oper value to sign extend
++ * @param index 0 based bit index (0<=index<32) to sign bit
++ */
++static s32 sign_extend(u32 oper, int index)
++{
++	u8 shift = 31 - index;
++
++	return (s32)(oper << shift) >> shift;
++}
++
++/**
++ * iwl4965_get_temperature - return the calibrated temperature (in Kelvin)
++ * @statistics: Provides the temperature reading from the uCode
++ *
++ * A return of <0 indicates bogus data in the statistics
++ */
++int iwl4965_get_temperature(const struct iwl_priv *priv)
++{
++	s32 temperature;
++	s32 vt;
++	s32 R1, R2, R3;
++	u32 R4;
++
++	if (test_bit(STATUS_TEMPERATURE, &priv->status) &&
++		(priv->statistics.flag & STATISTICS_REPLY_FLG_FAT_MODE_MSK)) {
++		IWL_DEBUG_TEMP("Running FAT temperature calibration\n");
++		R1 = (s32)le32_to_cpu(priv->card_alive_init.therm_r1[1]);
++		R2 = (s32)le32_to_cpu(priv->card_alive_init.therm_r2[1]);
++		R3 = (s32)le32_to_cpu(priv->card_alive_init.therm_r3[1]);
++		R4 = le32_to_cpu(priv->card_alive_init.therm_r4[1]);
++	} else {
++		IWL_DEBUG_TEMP("Running temperature calibration\n");
++		R1 = (s32)le32_to_cpu(priv->card_alive_init.therm_r1[0]);
++		R2 = (s32)le32_to_cpu(priv->card_alive_init.therm_r2[0]);
++		R3 = (s32)le32_to_cpu(priv->card_alive_init.therm_r3[0]);
++		R4 = le32_to_cpu(priv->card_alive_init.therm_r4[0]);
++	}
++
++	/*
++	 * Temperature is only 23 bits so sign extend out to 32
++	 *
++	 * NOTE If we haven't received a statistics notification yet
++	 * with an updated temperature, use R4 provided to us in the
++	 * ALIVE response. */
++	if (!test_bit(STATUS_TEMPERATURE, &priv->status))
++		vt = sign_extend(R4, 23);
++	else
++		vt = sign_extend(
++			le32_to_cpu(priv->statistics.general.temperature), 23);
++
++	IWL_DEBUG_TEMP("Calib values R[1-3]: %d %d %d R4: %d\n",
++		       R1, R2, R3, vt);
++
++	if (R3 == R1) {
++		IWL_ERROR("Calibration conflict R1 == R3\n");
++		return -1;
++	}
++
++	/* Calculate temperature in degrees Kelvin, adjust by 97%.
++	 * Add offset to center the adjustment around 0 degrees Centigrade. */
++	temperature = TEMPERATURE_CALIB_A_VAL * (vt - R2);
++	temperature /= (R3 - R1);
++	temperature = (temperature * 97) / 100 +
++	    TEMPERATURE_CALIB_KELVIN_OFFSET;
++
++	IWL_DEBUG_TEMP("Calibrated temperature: %dK, %dC\n", temperature,
++	    KELVIN_TO_CELSIUS(temperature));
++
++	return temperature;
++}
++
++/* Adjust Txpower only if temperature variance is greater than threshold. */
++#define IWL_TEMPERATURE_THRESHOLD   3
++
++/**
++ * iwl4965_is_temp_calib_needed - determines if new calibration is needed
++ *
++ * If the temperature changed has changed sufficiently, then a recalibration
++ * is needed.
++ *
++ * Assumes caller will replace priv->last_temperature once calibration
++ * executed.
++ */
++static int iwl4965_is_temp_calib_needed(struct iwl_priv *priv)
++{
++	int temp_diff;
++
++	if (!test_bit(STATUS_STATISTICS, &priv->status)) {
++		IWL_DEBUG_TEMP("Temperature not updated -- no statistics.\n");
++		return 0;
++	}
++
++	temp_diff = priv->temperature - priv->last_temperature;
++
++	/* get absolute value */
++	if (temp_diff < 0) {
++		IWL_DEBUG_POWER("Getting cooler, delta %d, \n", temp_diff);
++		temp_diff = -temp_diff;
++	} else if (temp_diff == 0)
++		IWL_DEBUG_POWER("Same temp, \n");
++	else
++		IWL_DEBUG_POWER("Getting warmer, delta %d, \n", temp_diff);
++
++	if (temp_diff < IWL_TEMPERATURE_THRESHOLD) {
++		IWL_DEBUG_POWER("Thermal txpower calib not needed\n");
++		return 0;
++	}
++
++	IWL_DEBUG_POWER("Thermal txpower calib needed\n");
++
++	return 1;
++}
++
++/* Calculate noise level, based on measurements during network silence just
++ *   before arriving beacon.  This measurement can be done only if we know
++ *   exactly when to expect beacons, therefore only when we're associated. */
++static void iwl4965_rx_calc_noise(struct iwl_priv *priv)
++{
++	struct statistics_rx_non_phy *rx_info
++				= &(priv->statistics.rx.general);
++	int num_active_rx = 0;
++	int total_silence = 0;
++	int bcn_silence_a =
++		le32_to_cpu(rx_info->beacon_silence_rssi_a) & IN_BAND_FILTER;
++	int bcn_silence_b =
++		le32_to_cpu(rx_info->beacon_silence_rssi_b) & IN_BAND_FILTER;
++	int bcn_silence_c =
++		le32_to_cpu(rx_info->beacon_silence_rssi_c) & IN_BAND_FILTER;
++
++	if (bcn_silence_a) {
++		total_silence += bcn_silence_a;
++		num_active_rx++;
++	}
++	if (bcn_silence_b) {
++		total_silence += bcn_silence_b;
++		num_active_rx++;
++	}
++	if (bcn_silence_c) {
++		total_silence += bcn_silence_c;
++		num_active_rx++;
++	}
++
++	/* Average among active antennas */
++	if (num_active_rx)
++		priv->last_rx_noise = (total_silence / num_active_rx) - 107;
++	else
++		priv->last_rx_noise = IWL_NOISE_MEAS_NOT_AVAILABLE;
++
++	IWL_DEBUG_CALIB("inband silence a %u, b %u, c %u, dBm %d\n",
++			bcn_silence_a, bcn_silence_b, bcn_silence_c,
++			priv->last_rx_noise);
++}
++
++void iwl_hw_rx_statistics(struct iwl_priv *priv, struct iwl_rx_mem_buffer *rxb)
++{
++	struct iwl_rx_packet *pkt = (void *)rxb->skb->data;
++	int change;
++	s32 temp;
++
++	IWL_DEBUG_RX("Statistics notification received (%d vs %d).\n",
++		     (int)sizeof(priv->statistics), pkt->len);
++
++	change = ((priv->statistics.general.temperature !=
++		   pkt->u.stats.general.temperature) ||
++		  ((priv->statistics.flag &
++		    STATISTICS_REPLY_FLG_FAT_MODE_MSK) !=
++		   (pkt->u.stats.flag & STATISTICS_REPLY_FLG_FAT_MODE_MSK)));
++
++	memcpy(&priv->statistics, &pkt->u.stats, sizeof(priv->statistics));
++
++	set_bit(STATUS_STATISTICS, &priv->status);
++
++	/* Reschedule the statistics timer to occur in
++	 * REG_RECALIB_PERIOD seconds to ensure we get a
++	 * thermal update even if the uCode doesn't give
++	 * us one */
++	mod_timer(&priv->statistics_periodic, jiffies +
++		  msecs_to_jiffies(REG_RECALIB_PERIOD * 1000));
++
++	if (unlikely(!test_bit(STATUS_SCANNING, &priv->status)) &&
++	    (pkt->hdr.cmd == STATISTICS_NOTIFICATION)) {
++		iwl4965_rx_calc_noise(priv);
++#ifdef CONFIG_IWLWIFI_SENSITIVITY
++		queue_work(priv->workqueue, &priv->sensitivity_work);
++#endif
++	}
++
++	/* If the hardware hasn't reported a change in
++	 * temperature then don't bother computing a
++	 * calibrated temperature value */
++	if (!change)
++		return;
++
++	temp = iwl4965_get_temperature(priv);
++	if (temp < 0)
++		return;
++
++	if (priv->temperature != temp) {
++		if (priv->temperature)
++			IWL_DEBUG_TEMP("Temperature changed "
++				       "from %dC to %dC\n",
++				       KELVIN_TO_CELSIUS(priv->temperature),
++				       KELVIN_TO_CELSIUS(temp));
++		else
++			IWL_DEBUG_TEMP("Temperature "
++				       "initialized to %dC\n",
++				       KELVIN_TO_CELSIUS(temp));
++	}
++
++	priv->temperature = temp;
++	set_bit(STATUS_TEMPERATURE, &priv->status);
++
++	if (unlikely(!test_bit(STATUS_SCANNING, &priv->status)) &&
++		     iwl4965_is_temp_calib_needed(priv))
++		queue_work(priv->workqueue, &priv->txpower_work);
++}
++
++static void iwl4965_handle_data_packet(struct iwl_priv *priv, int is_data,
++				       int include_phy,
++				       struct iwl_rx_mem_buffer *rxb,
++				       struct ieee80211_rx_status *stats)
++{
++	struct iwl_rx_packet *pkt = (struct iwl_rx_packet *)rxb->skb->data;
++	struct iwl4965_rx_phy_res *rx_start = (include_phy) ?
++	    (struct iwl4965_rx_phy_res *)&(pkt->u.raw[0]) : NULL;
++	struct ieee80211_hdr *hdr;
++	u16 len;
++	__le32 *rx_end;
++	unsigned int skblen;
++	u32 ampdu_status;
++
++	if (!include_phy && priv->last_phy_res[0])
++		rx_start = (struct iwl4965_rx_phy_res *)&priv->last_phy_res[1];
++
++	if (!rx_start) {
++		IWL_ERROR("MPDU frame without a PHY data\n");
++		return;
++	}
++	if (include_phy) {
++		hdr = (struct ieee80211_hdr *)((u8 *) & rx_start[1] +
++					       rx_start->cfg_phy_cnt);
++
++		len = le16_to_cpu(rx_start->byte_count);
++
++		rx_end = (__le32 *) ((u8 *) & pkt->u.raw[0] +
++				  sizeof(struct iwl4965_rx_phy_res) +
++				  rx_start->cfg_phy_cnt + len);
++
++	} else {
++		struct iwl4965_rx_mpdu_res_start *amsdu =
++		    (struct iwl4965_rx_mpdu_res_start *)pkt->u.raw;
++
++		hdr = (struct ieee80211_hdr *)(pkt->u.raw +
++			       sizeof(struct iwl4965_rx_mpdu_res_start));
++		len =  le16_to_cpu(amsdu->byte_count);
++		rx_start->byte_count = amsdu->byte_count;
++		rx_end = (__le32 *) (((u8 *) hdr) + len);
++	}
++	if (len > 2342 || len < 16) {
++		IWL_DEBUG_DROP("byte count out of range [16,2342]"
++			       " : %d\n", len);
++		return;
++	}
++
++	ampdu_status = le32_to_cpu(*rx_end);
++	skblen = ((u8 *) rx_end - (u8 *) & pkt->u.raw[0]) + sizeof(u32);
++
++	/* start from MAC */
++	skb_reserve(rxb->skb, (void *)hdr - (void *)pkt);
++	skb_put(rxb->skb, len);	/* end where data ends */
++
++	/* We only process data packets if the interface is open */
++	if (unlikely(!priv->is_open)) {
++		IWL_DEBUG_DROP_LIMIT
++		    ("Dropping packet while interface is not open.\n");
++		return;
++	}
++
++	if (priv->iw_mode == IEEE80211_IF_TYPE_MNTR) {
++		if (iwl_param_hwcrypto)
++			iwl_set_decrypted_flag(priv, rxb->skb,
++					       ampdu_status, stats);
++		iwl_handle_data_packet_monitor(priv, rxb, hdr, len, stats, 0);
++		return;
++	}
++
++	stats->flag = 0;
++	hdr = (struct ieee80211_hdr *)rxb->skb->data;
++
++	if (iwl_param_hwcrypto)
++		iwl_set_decrypted_flag(priv, rxb->skb, ampdu_status, stats);
++
++	ieee80211_rx_irqsafe(priv->hw, rxb->skb, stats);
++	priv->alloc_rxb_skb--;
++	rxb->skb = NULL;
++#ifdef LED
++	priv->led_packets += len;
++	iwl_setup_activity_timer(priv);
++#endif
++}
++
++/* Calc max signal level (dBm) among 3 possible receivers */
++static int iwl4965_calc_rssi(struct iwl4965_rx_phy_res *rx_resp)
++{
++	/* data from PHY/DSP regarding signal strength, etc.,
++	 *   contents are always there, not configurable by host.  */
++	struct iwl4965_rx_non_cfg_phy *ncphy =
++	    (struct iwl4965_rx_non_cfg_phy *)rx_resp->non_cfg_phy;
++	u32 agc = (le16_to_cpu(ncphy->agc_info) & IWL_AGC_DB_MASK)
++			>> IWL_AGC_DB_POS;
++
++	u32 valid_antennae =
++	    (le16_to_cpu(rx_resp->phy_flags) & RX_PHY_FLAGS_ANTENNAE_MASK)
++			>> RX_PHY_FLAGS_ANTENNAE_OFFSET;
++	u8 max_rssi = 0;
++	u32 i;
++
++	/* Find max rssi among 3 possible receivers.
++	 * These values are measured by the digital signal processor (DSP).
++	 * They should stay fairly constant even as the signal strength varies,
++	 *   if the radio's automatic gain control (AGC) is working right.
++	 * AGC value (see below) will provide the "interesting" info. */
++	for (i = 0; i < 3; i++)
++		if (valid_antennae & (1 << i))
++			max_rssi = max(ncphy->rssi_info[i << 1], max_rssi);
++
++	IWL_DEBUG_STATS("Rssi In A %d B %d C %d Max %d AGC dB %d\n",
++		ncphy->rssi_info[0], ncphy->rssi_info[2], ncphy->rssi_info[4],
++		max_rssi, agc);
++
++	/* dBm = max_rssi dB - agc dB - constant.
++	 * Higher AGC (higher radio gain) means lower signal. */
++	return (max_rssi - agc - IWL_RSSI_OFFSET);
++}
++
++#ifdef CONFIG_IWLWIFI_HT
++
++/* Parsed Information Elements */
++struct ieee802_11_elems {
++	u8 *ds_params;
++	u8 ds_params_len;
++	u8 *tim;
++	u8 tim_len;
++	u8 *ibss_params;
++	u8 ibss_params_len;
++	u8 *erp_info;
++	u8 erp_info_len;
++	u8 *ht_cap_param;
++	u8 ht_cap_param_len;
++	u8 *ht_extra_param;
++	u8 ht_extra_param_len;
++};
++
++static int parse_elems(u8 *start, size_t len, struct ieee802_11_elems *elems)
++{
++	size_t left = len;
++	u8 *pos = start;
++	int unknown = 0;
++
++	memset(elems, 0, sizeof(*elems));
++
++	while (left >= 2) {
++		u8 id, elen;
++
++		id = *pos++;
++		elen = *pos++;
++		left -= 2;
++
++		if (elen > left)
++			return -1;
++
++		switch (id) {
++		case WLAN_EID_DS_PARAMS:
++			elems->ds_params = pos;
++			elems->ds_params_len = elen;
++			break;
++		case WLAN_EID_TIM:
++			elems->tim = pos;
++			elems->tim_len = elen;
++			break;
++		case WLAN_EID_IBSS_PARAMS:
++			elems->ibss_params = pos;
++			elems->ibss_params_len = elen;
++			break;
++		case WLAN_EID_ERP_INFO:
++			elems->erp_info = pos;
++			elems->erp_info_len = elen;
++			break;
++		case WLAN_EID_HT_CAPABILITY:
++			elems->ht_cap_param = pos;
++			elems->ht_cap_param_len = elen;
++			break;
++		case WLAN_EID_HT_EXTRA_INFO:
++			elems->ht_extra_param = pos;
++			elems->ht_extra_param_len = elen;
++			break;
++		default:
++			unknown++;
++			break;
++		}
++
++		left -= elen;
++		pos += elen;
++	}
++
++	return 0;
++}
++#endif /* CONFIG_IWLWIFI_HT */
++
++static void iwl4965_sta_modify_ps_wake(struct iwl_priv *priv, int sta_id)
++{
++	unsigned long flags;
++
++	spin_lock_irqsave(&priv->sta_lock, flags);
++	priv->stations[sta_id].sta.station_flags &= ~STA_FLG_PWR_SAVE_MSK;
++	priv->stations[sta_id].sta.station_flags_msk = STA_FLG_PWR_SAVE_MSK;
++	priv->stations[sta_id].sta.sta.modify_mask = 0;
++	priv->stations[sta_id].sta.mode = STA_CONTROL_MODIFY_MSK;
++	spin_unlock_irqrestore(&priv->sta_lock, flags);
++
++	iwl_send_add_station(priv, &priv->stations[sta_id].sta, CMD_ASYNC);
++}
++
++static void iwl4965_update_ps_mode(struct iwl_priv *priv, u16 ps_bit, u8 *addr)
++{
++	/* FIXME: need locking over ps_status ??? */
++	u8 sta_id = iwl_hw_find_station(priv, addr);
++
++	if (sta_id != IWL_INVALID_STATION) {
++		u8 sta_awake = priv->stations[sta_id].
++				ps_status == STA_PS_STATUS_WAKE;
++
++		if (sta_awake && ps_bit)
++			priv->stations[sta_id].ps_status = STA_PS_STATUS_SLEEP;
++		else if (!sta_awake && !ps_bit) {
++			iwl4965_sta_modify_ps_wake(priv, sta_id);
++			priv->stations[sta_id].ps_status = STA_PS_STATUS_WAKE;
++		}
++	}
++}
++
++/* Called for REPLY_4965_RX (legacy ABG frames), or
++ * REPLY_RX_MPDU_CMD (HT high-throughput N frames). */
++static void iwl4965_rx_reply_rx(struct iwl_priv *priv,
++				struct iwl_rx_mem_buffer *rxb)
++{
++	struct iwl_rx_packet *pkt = (void *)rxb->skb->data;
++	/* Use phy data (Rx signal strength, etc.) contained within
++	 *   this rx packet for legacy frames,
++	 *   or phy data cached from REPLY_RX_PHY_CMD for HT frames. */
++	int include_phy = (pkt->hdr.cmd == REPLY_4965_RX);
++	struct iwl4965_rx_phy_res *rx_start = (include_phy) ?
++		(struct iwl4965_rx_phy_res *)&(pkt->u.raw[0]) :
++		(struct iwl4965_rx_phy_res *)&priv->last_phy_res[1];
++	__le32 *rx_end;
++	unsigned int len = 0;
++	struct ieee80211_hdr *header;
++	u16 fc;
++	struct ieee80211_rx_status stats = {
++		.mactime = le64_to_cpu(rx_start->timestamp),
++		.channel = le16_to_cpu(rx_start->channel),
++		.phymode =
++			(rx_start->phy_flags & RX_RES_PHY_FLAGS_BAND_24_MSK) ?
++			MODE_IEEE80211G : MODE_IEEE80211A,
++		.antenna = 0,
++		.rate = iwl_hw_get_rate(rx_start->rate_n_flags),
++		.flag = 0,
++#ifdef CONFIG_IWLWIFI_HT_AGG
++		.ordered = 0
++#endif /* CONFIG_IWLWIFI_HT_AGG */
++	};
++	u8 network_packet;
++
++	if ((unlikely(rx_start->cfg_phy_cnt > 20))) {
++		IWL_DEBUG_DROP
++			("dsp size out of range [0,20]: "
++			 "%d/n", rx_start->cfg_phy_cnt);
++		return;
++	}
++	if (!include_phy) {
++		if (priv->last_phy_res[0])
++			rx_start = (struct iwl4965_rx_phy_res *)
++				&priv->last_phy_res[1];
++		else
++			rx_start = NULL;
++	}
++
++	if (!rx_start) {
++		IWL_ERROR("MPDU frame without a PHY data\n");
++		return;
++	}
++
++	if (include_phy) {
++		header = (struct ieee80211_hdr *)((u8 *) & rx_start[1]
++						  + rx_start->cfg_phy_cnt);
++
++		len = le16_to_cpu(rx_start->byte_count);
++		rx_end = (__le32 *) (pkt->u.raw + rx_start->cfg_phy_cnt +
++				  sizeof(struct iwl4965_rx_phy_res) + len);
++	} else {
++		struct iwl4965_rx_mpdu_res_start *amsdu =
++			(struct iwl4965_rx_mpdu_res_start *)pkt->u.raw;
++
++		header = (void *)(pkt->u.raw +
++			sizeof(struct iwl4965_rx_mpdu_res_start));
++		len = le16_to_cpu(amsdu->byte_count);
++		rx_end = (__le32 *) (pkt->u.raw +
++			sizeof(struct iwl4965_rx_mpdu_res_start) + len);
++	}
++
++	if (!(*rx_end & RX_RES_STATUS_NO_CRC32_ERROR) ||
++	    !(*rx_end & RX_RES_STATUS_NO_RXE_OVERFLOW)) {
++		IWL_DEBUG_RX("Bad CRC or FIFO: 0x%08X.\n",
++				le32_to_cpu(*rx_end));
++		return;
++	}
++
++	priv->ucode_beacon_time = le32_to_cpu(rx_start->beacon_time_stamp);
++
++	stats.freq = ieee80211chan2mhz(stats.channel);
++
++	/* Find max signal strength (dBm) among 3 antenna/receiver chains */
++	stats.ssi = iwl4965_calc_rssi(rx_start);
++
++	/* Meaningful noise values are available only from beacon statistics,
++	 *   which are gathered only when associated, and indicate noise
++	 *   only for the associated network channel ...
++	 * Ignore these noise values while scanning (other channels) */
++	if (iwl_is_associated(priv) &&
++	    !test_bit(STATUS_SCANNING, &priv->status)) {
++		stats.noise = priv->last_rx_noise;
++		stats.signal = iwl_calc_sig_qual(stats.ssi, stats.noise);
++	} else {
++		stats.noise = IWL_NOISE_MEAS_NOT_AVAILABLE;
++		stats.signal = iwl_calc_sig_qual(stats.ssi, 0);
++	}
++
++	/* Reset beacon noise level if not associated. */
++	if (!iwl_is_associated(priv))
++		priv->last_rx_noise = IWL_NOISE_MEAS_NOT_AVAILABLE;
++
++#ifdef CONFIG_IWLWIFI_DEBUG
++	/* TODO:  Parts of iwl_report_frame are broken for 4965 */
++	if (iwl_debug_level & (IWL_DL_RX))
++		/* Set "1" to report good data frames in groups of 100 */
++		iwl_report_frame(priv, pkt, header, 1);
++
++	if (iwl_debug_level & (IWL_DL_RX | IWL_DL_STATS))
++	IWL_DEBUG_RX("Rssi %d, noise %d, qual %d, TSF %lu\n",
++		stats.ssi, stats.noise, stats.signal,
++		 (long unsigned int)le64_to_cpu(rx_start->timestamp));
++#endif
++
++	network_packet = iwl_is_network_packet(priv, header);
++	if (network_packet) {
++		priv->last_rx_rssi = stats.ssi;
++		priv->last_beacon_time =  priv->ucode_beacon_time;
++		priv->last_tsf = le64_to_cpu(rx_start->timestamp);
++	}
++
++	fc = le16_to_cpu(header->frame_control);
++	switch (fc & IEEE80211_FCTL_FTYPE) {
++	case IEEE80211_FTYPE_MGMT:
++
++		if (priv->iw_mode == IEEE80211_IF_TYPE_AP)
++			iwl4965_update_ps_mode(priv, fc  & IEEE80211_FCTL_PM,
++						header->addr2);
++		switch (fc & IEEE80211_FCTL_STYPE) {
++		case IEEE80211_STYPE_PROBE_RESP:
++		case IEEE80211_STYPE_BEACON:
++			if ((priv->iw_mode == IEEE80211_IF_TYPE_STA &&
++			     !compare_ether_addr(header->addr2, priv->bssid)) ||
++			    (priv->iw_mode == IEEE80211_IF_TYPE_IBSS &&
++			     !compare_ether_addr(header->addr3, priv->bssid))) {
++				struct ieee80211_mgmt *mgmt =
++					(struct ieee80211_mgmt *)header;
++				u64 timestamp =
++					le64_to_cpu(mgmt->u.beacon.timestamp);
++
++				priv->timestamp0 = timestamp & 0xFFFFFFFF;
++				priv->timestamp1 =
++					(timestamp >> 32) & 0xFFFFFFFF;
++				priv->beacon_int = le16_to_cpu(
++				    mgmt->u.beacon.beacon_int);
++				if (priv->call_post_assoc_from_beacon &&
++				    (priv->iw_mode == IEEE80211_IF_TYPE_STA)) {
++					priv->call_post_assoc_from_beacon = 0;
++					queue_work(priv->workqueue,
++					    &priv->post_associate.work);
++				}
++			}
++			break;
++
++		case IEEE80211_STYPE_ACTION:
++			break;
++
++			/*
++			 * TODO: There is no callback function from upper
++			 * stack to inform us when associated status. this
++			 * work around to sniff assoc_resp management frame
++			 * and finish the association process.
++			 */
++		case IEEE80211_STYPE_ASSOC_RESP:
++		case IEEE80211_STYPE_REASSOC_RESP:
++			if (network_packet && iwl_is_associated(priv)) {
++#ifdef CONFIG_IWLWIFI_HT
++				u8 *pos = NULL;
++				struct ieee802_11_elems elems;
++#endif				/*CONFIG_IWLWIFI_HT */
++				struct ieee80211_mgmt *mgnt =
++					(struct ieee80211_mgmt *)header;
++
++				priv->assoc_id = (~((1 << 15) | (1 << 14))
++					& le16_to_cpu(mgnt->u.assoc_resp.aid));
++				priv->assoc_capability =
++					le16_to_cpu(
++						mgnt->u.assoc_resp.capab_info);
++#ifdef CONFIG_IWLWIFI_HT
++				pos = mgnt->u.assoc_resp.variable;
++				if (!parse_elems(pos,
++						 len - (pos - (u8 *) mgnt),
++						 &elems)) {
++					if (elems.ht_extra_param &&
++					    elems.ht_cap_param)
++						break;
++				}
++#endif				/*CONFIG_IWLWIFI_HT */
++				/* assoc_id is 0 no association */
++				if (!priv->assoc_id)
++					break;
++				if (priv->beacon_int)
++					queue_work(priv->workqueue,
++					    &priv->post_associate.work);
++				else
++					priv->call_post_assoc_from_beacon = 1;
++			}
++
++			break;
++
++		case IEEE80211_STYPE_PROBE_REQ:
++			if ((priv->iw_mode == IEEE80211_IF_TYPE_IBSS) &&
++			    !iwl_is_associated(priv)) {
++				IWL_DEBUG_DROP("Dropping (non network): "
++					       MAC_FMT ", " MAC_FMT ", "
++					       MAC_FMT "\n",
++					       MAC_ARG(header->addr1),
++					       MAC_ARG(header->addr2),
++					       MAC_ARG(header->addr3));
++				return;
++			}
++		}
++		iwl4965_handle_data_packet(priv, 0, include_phy, rxb, &stats);
++		break;
++
++	case IEEE80211_FTYPE_CTL:
++#ifdef CONFIG_IWLWIFI_HT_AGG
++		switch (fc & IEEE80211_FCTL_STYPE) {
++		case IEEE80211_STYPE_BACK_REQ:
++			IWL_DEBUG_HT("IEEE80211_STYPE_BACK_REQ arrived\n");
++			iwl4965_handle_data_packet(priv, 0, include_phy,
++						rxb, &stats);
++			break;
++		default:
++			break;
++		}
++#endif
++
++		break;
++
++	case IEEE80211_FTYPE_DATA:
++		if (priv->iw_mode == IEEE80211_IF_TYPE_AP)
++			iwl4965_update_ps_mode(priv, fc  & IEEE80211_FCTL_PM,
++						header->addr2);
++
++		if (unlikely(!network_packet))
++			IWL_DEBUG_DROP("Dropping (non network): "
++				       MAC_FMT ", " MAC_FMT ", "
++				       MAC_FMT "\n",
++				       MAC_ARG(header->addr1),
++				       MAC_ARG(header->addr2),
++				       MAC_ARG(header->addr3));
++		else if (unlikely(is_duplicate_packet(priv, header)))
++			IWL_DEBUG_DROP("Dropping (dup): " MAC_FMT ", "
++				       MAC_FMT ", " MAC_FMT "\n",
++				       MAC_ARG(header->addr1),
++				       MAC_ARG(header->addr2),
++				       MAC_ARG(header->addr3));
++		else
++			iwl4965_handle_data_packet(priv, 1, include_phy, rxb,
++						   &stats);
++		break;
++	default:
++		break;
++
++	}
++}
++
++/* Cache phy data (Rx signal strength, etc) for HT frame (REPLY_RX_PHY_CMD).
++ * This will be used later in iwl4965_rx_reply_rx() for REPLY_RX_MPDU_CMD. */
++static void iwl4965_rx_reply_rx_phy(struct iwl_priv *priv,
++				    struct iwl_rx_mem_buffer *rxb)
++{
++	struct iwl_rx_packet *pkt = (void *)rxb->skb->data;
++	priv->last_phy_res[0] = 1;
++	memcpy(&priv->last_phy_res[1], &(pkt->u.raw[0]),
++	       sizeof(struct iwl4965_rx_phy_res));
++}
++
++static void iwl4965_rx_missed_beacon_notif(struct iwl_priv *priv,
++					   struct iwl_rx_mem_buffer *rxb)
++
++{
++#ifdef CONFIG_IWLWIFI_SENSITIVITY
++	struct iwl_rx_packet *pkt = (void *)rxb->skb->data;
++	struct iwl_missed_beacon_notif *missed_beacon;
++
++	missed_beacon = &pkt->u.missed_beacon;
++	if (le32_to_cpu(missed_beacon->consequtive_missed_beacons) > 5) {
++		IWL_DEBUG_CALIB("missed bcn cnsq %d totl %d rcd %d expctd %d\n",
++		    le32_to_cpu(missed_beacon->consequtive_missed_beacons),
++		    le32_to_cpu(missed_beacon->total_missed_becons),
++		    le32_to_cpu(missed_beacon->num_recvd_beacons),
++		    le32_to_cpu(missed_beacon->num_expected_beacons));
++		priv->sensitivity_data.state = IWL_SENS_CALIB_NEED_REINIT;
++		if (unlikely(!test_bit(STATUS_SCANNING, &priv->status)))
++			queue_work(priv->workqueue, &priv->sensitivity_work);
++	}
++#endif /*CONFIG_IWLWIFI_SENSITIVITY*/
++}
++
++#ifdef CONFIG_IWLWIFI_HT
++#ifdef CONFIG_IWLWIFI_HT_AGG
++
++static void iwl4965_set_tx_status(struct iwl_priv *priv, int txq_id, int idx,
++				  u32 status, u32 retry_count, u32 rate)
++{
++	struct ieee80211_tx_status *tx_status =
++		&(priv->txq[txq_id].txb[idx].status);
++
++	tx_status->flags = status ? IEEE80211_TX_STATUS_ACK : 0;
++	tx_status->retry_count += retry_count;
++	tx_status->control.tx_rate = rate;
++}
++
++
++static void iwl_sta_modify_enable_tid_tx(struct iwl_priv *priv,
++					 int sta_id, int tid)
++{
++	unsigned long flags;
++
++	spin_lock_irqsave(&priv->sta_lock, flags);
++	priv->stations[sta_id].sta.sta.modify_mask = STA_MODIFY_TID_DISABLE_TX;
++	priv->stations[sta_id].sta.tid_disable_tx &= cpu_to_le16(~(1 << tid));
++	priv->stations[sta_id].sta.mode = STA_CONTROL_MODIFY_MSK;
++	spin_unlock_irqrestore(&priv->sta_lock, flags);
++
++	iwl_send_add_station(priv, &priv->stations[sta_id].sta, CMD_ASYNC);
++}
++
++
++static int iwl4965_tx_status_reply_compressed_ba(struct iwl_priv *priv,
++						 struct iwl_ht_agg *agg,
++						 struct iwl_compressed_ba_resp*
++						 ba_resp)
++
++{
++	int i, sh, ack;
++	u16 ba_seq_ctl = le16_to_cpu(ba_resp->ba_seq_ctl);
++	u32 bitmap0, bitmap1;
++	u32 resp_bitmap0 = le32_to_cpu(ba_resp->ba_bitmap0);
++	u32 resp_bitmap1 = le32_to_cpu(ba_resp->ba_bitmap1);
++
++	if (unlikely(!agg->wait_for_ba))  {
++		IWL_ERROR("Received BA when not expected\n");
++		return -EINVAL;
++	}
++	agg->wait_for_ba = 0;
++	IWL_DEBUG_TX_REPLY("BA %d %d\n", agg->start_idx, ba_resp->ba_seq_ctl);
++	sh = agg->start_idx - SEQ_TO_INDEX(ba_seq_ctl>>4);
++	if (sh < 0) /* tbw something is wrong with indeces */
++		sh += 0x100;
++
++	/* don't use 64 bits for now */
++	bitmap0 = resp_bitmap0 >> sh;
++	bitmap1 = resp_bitmap1 >> sh;
++	bitmap0 |= (resp_bitmap1 & ((1<<sh)|((1<<sh)-1))) << (32 - sh);
++
++	if (agg->frame_count > (64 - sh)) {
++		IWL_DEBUG_TX_REPLY("more frames than bitmap size");
++		return -1;
++	}
++
++	/* check for success or failure according to the
++	 * transmitted bitmap and back bitmap */
++	bitmap0 &= agg->bitmap0;
++	bitmap1 &= agg->bitmap1;
++
++	for (i = 0; i < agg->frame_count ; i++) {
++		int idx = (agg->start_idx + i) & 0xff;
++		ack = bitmap0 & (1 << i);
++		IWL_DEBUG_TX_REPLY("%s ON i=%d idx=%d raw=%d\n",
++			ack? "ACK":"NACK", i, idx, agg->start_idx + i);
++		iwl4965_set_tx_status(priv, agg->txq_id, idx, ack, 0,
++			agg->rate_n_flags);
++
++	}
++
++	IWL_DEBUG_TX_REPLY("Bitmap %x%x\n", bitmap0, bitmap1);
++
++	return 0;
++}
++
++static inline int iwl_queue_dec_wrap(int index, int n_bd)
++{
++	return (index == 0) ? n_bd - 1 : index - 1;
++}
++
++static void iwl4965_rx_reply_compressed_ba(struct iwl_priv *priv,
++					   struct iwl_rx_mem_buffer *rxb)
++{
++	struct iwl_rx_packet *pkt = (void *)rxb->skb->data;
++	struct iwl_compressed_ba_resp *ba_resp = &pkt->u.compressed_ba;
++	int index;
++	struct iwl_tx_queue *txq = NULL;
++	struct iwl_ht_agg *agg;
++	u16 ba_resp_scd_flow = le16_to_cpu(ba_resp->scd_flow);
++	u16 ba_resp_scd_ssn = le16_to_cpu(ba_resp->scd_ssn);
++
++	if (ba_resp_scd_flow >= ARRAY_SIZE(priv->txq)) {
++		IWL_ERROR("BUG_ON scd_flow is bigger than number of queues");
++		return;
++	}
++
++	txq = &priv->txq[ba_resp_scd_flow];
++	agg = &priv->stations[ba_resp->sta_id].tid[ba_resp->tid].agg;
++	index = iwl_queue_dec_wrap(ba_resp_scd_ssn & 0xff, txq->q.n_bd);
++
++	/* TODO: Need to get this copy more sefely - now good for debug */
++/*
++	IWL_DEBUG_TX_REPLY("REPLY_COMPRESSED_BA [%d]Received from " MAC_FMT ",
++			   sta_id = %d\n",
++			   agg->wait_for_ba,
++			   MAC_ARG((u8*) &ba_resp->sta_addr_lo32),
++			   ba_resp->sta_id);
++	IWL_DEBUG_TX_REPLY("TID = %d, SeqCtl = %d, bitmap = 0x%X%X, scd_flow = "
++			   "%d, scd_ssn = %d\n",
++			   ba_resp->tid,
++			   ba_resp->ba_seq_ctl,
++			   ba_resp->ba_bitmap1,
++			   ba_resp->ba_bitmap0,
++			   ba_resp->scd_flow,
++			   ba_resp->scd_ssn);
++	IWL_DEBUG_TX_REPLY("DAT start_idx = %d, bitmap = 0x%X%X \n",
++			   agg->start_idx,
++			   agg->bitmap1,
++			   agg->bitmap0);
++*/
++	iwl4965_tx_status_reply_compressed_ba(priv, agg, ba_resp);
++	/* releases all the TFDs until the SSN */
++	if (txq->q.last_used != (ba_resp_scd_ssn & 0xff))
++		iwl_tx_queue_reclaim(priv, ba_resp_scd_flow, index);
++
++}
++
++
++static void iwl4965_tx_queue_stop_scheduler(struct iwl_priv *priv, u16 txq_id)
++{
++	iwl_write_restricted_reg(priv,
++		SCD_QUEUE_STATUS_BITS(txq_id),
++		(0 << SCD_QUEUE_STTS_REG_POS_ACTIVE)|
++		(1 << SCD_QUEUE_STTS_REG_POS_SCD_ACT_EN));
++}
++
++static int iwl4965_tx_queue_set_q2ratid(struct iwl_priv *priv, u16 ra_tid,
++					u16 txq_id)
++{
++	u32 tbl_dw_addr;
++	u32 tbl_dw;
++	u16 scd_q2ratid;
++
++	scd_q2ratid = ra_tid & SCD_QUEUE_RA_TID_MAP_RATID_MSK;
++
++	tbl_dw_addr = priv->scd_base_addr +
++			SCD_TRANSLATE_TBL_OFFSET_QUEUE(txq_id);
++
++	tbl_dw = iwl_read_restricted_mem(priv, tbl_dw_addr);
++
++	if (txq_id & 0x1)
++		tbl_dw = (scd_q2ratid << 16) | (tbl_dw & 0x0000FFFF);
++	else
++		tbl_dw = scd_q2ratid | (tbl_dw & 0xFFFF0000);
++
++	iwl_write_restricted_mem(priv, tbl_dw_addr, tbl_dw);
++
++	return 0;
++}
++
++/**
++ * txq_id must be greater than IWL_BACK_QUEUE_FIRST_ID
++ */
++static int iwl4965_tx_queue_agg_enable(struct iwl_priv *priv, int txq_id,
++				       int tx_fifo, int sta_id, int tid,
++				       u16 ssn_idx)
++{
++	unsigned long flags;
++	int rc;
++	u16 ra_tid;
++
++	if (IWL_BACK_QUEUE_FIRST_ID > txq_id)
++		IWL_WARNING("queue number too small: %d, must be > %d\n",
++			txq_id, IWL_BACK_QUEUE_FIRST_ID);
++
++	ra_tid = BUILD_RAxTID(sta_id, tid);
++
++	iwl_sta_modify_enable_tid_tx(priv, sta_id, tid);
++
++	spin_lock_irqsave(&priv->lock, flags);
++	rc = iwl_grab_restricted_access(priv);
++	if (rc) {
++		spin_unlock_irqrestore(&priv->lock, flags);
++		return rc;
++	}
++
++	iwl4965_tx_queue_stop_scheduler(priv, txq_id);
++
++	iwl4965_tx_queue_set_q2ratid(priv, ra_tid, txq_id);
++
++
++	iwl_set_bits_restricted_reg(priv, SCD_QUEUECHAIN_SEL, (1<<txq_id));
++
++	priv->txq[txq_id].q.last_used = (ssn_idx & 0xff);
++	priv->txq[txq_id].q.first_empty = (ssn_idx & 0xff);
++
++	/* supposes that ssn_idx is valid (!= 0xFFF) */
++	iwl4965_set_wr_ptrs(priv, txq_id, ssn_idx);
++
++	iwl_write_restricted_mem(priv,
++			priv->scd_base_addr + SCD_CONTEXT_QUEUE_OFFSET(txq_id),
++			(SCD_WIN_SIZE << SCD_QUEUE_CTX_REG1_WIN_SIZE_POS) &
++			SCD_QUEUE_CTX_REG1_WIN_SIZE_MSK);
++
++	iwl_write_restricted_mem(priv, priv->scd_base_addr +
++			SCD_CONTEXT_QUEUE_OFFSET(txq_id) + sizeof(u32),
++			(SCD_FRAME_LIMIT << SCD_QUEUE_CTX_REG2_FRAME_LIMIT_POS)
++			& SCD_QUEUE_CTX_REG2_FRAME_LIMIT_MSK);
++
++	iwl_set_bits_restricted_reg(priv, SCD_INTERRUPT_MASK, (1 << txq_id));
++
++	iwl4965_tx_queue_set_status(priv, &priv->txq[txq_id], tx_fifo, 1);
++
++	iwl_release_restricted_access(priv);
++	spin_unlock_irqrestore(&priv->lock, flags);
++
++	return 0;
++}
++
++/**
++ * txq_id must be greater than IWL_BACK_QUEUE_FIRST_ID
++ */
++static int iwl4965_tx_queue_agg_disable(struct iwl_priv *priv, u16 txq_id,
++					u16 ssn_idx, u8 tx_fifo)
++{
++	unsigned long flags;
++	int rc;
++
++	if (IWL_BACK_QUEUE_FIRST_ID > txq_id) {
++		IWL_WARNING("queue number too small: %d, must be > %d\n",
++				txq_id, IWL_BACK_QUEUE_FIRST_ID);
++		return -EINVAL;
++	}
++
++	spin_lock_irqsave(&priv->lock, flags);
++	rc = iwl_grab_restricted_access(priv);
++	if (rc) {
++		spin_unlock_irqrestore(&priv->lock, flags);
++		return rc;
++	}
++
++	iwl4965_tx_queue_stop_scheduler(priv, txq_id);
++
++	iwl_clear_bits_restricted_reg(priv, SCD_QUEUECHAIN_SEL, (1 << txq_id));
++
++	priv->txq[txq_id].q.last_used = (ssn_idx & 0xff);
++	priv->txq[txq_id].q.first_empty = (ssn_idx & 0xff);
++	/* supposes that ssn_idx is valid (!= 0xFFF) */
++	iwl4965_set_wr_ptrs(priv, txq_id, ssn_idx);
++
++	iwl_clear_bits_restricted_reg(priv, SCD_INTERRUPT_MASK, (1 << txq_id));
++	iwl4965_txq_ctx_deactivate(priv, txq_id);
++	iwl4965_tx_queue_set_status(priv, &priv->txq[txq_id], tx_fifo, 0);
++
++	iwl_release_restricted_access(priv);
++	spin_unlock_irqrestore(&priv->lock, flags);
++
++	return 0;
++}
++
++#endif/* CONFIG_IWLWIFI_HT_AGG */
++#endif /* CONFIG_IWLWIFI_HT */
++/*
++ * RATE SCALE CODE
++ */
++int iwl4965_init_hw_rates(struct iwl_priv *priv, struct ieee80211_rate *rates)
++{
++	return 0;
++}
++
++
++/**
++ * iwl4965_add_station - Initialize a station's hardware rate table
++ *
++ * The uCode contains a table of fallback rates and retries per rate
++ * for automatic fallback during transmission.
++ *
++ * NOTE: This initializes the table for a single retry per data rate
++ * which is not optimal.  Setting up an intelligent retry per rate
++ * requires feedback from transmission, which isn't exposed through
++ * rc80211_simple which is what this driver is currently using.
++ *
++ */
++void iwl4965_add_station(struct iwl_priv *priv, const u8 *addr, int is_ap)
++{
++	int i, r;
++	struct iwl_link_quality_cmd link_cmd = {
++		.reserved1 = 0,
++	};
++	u16 rate_flags;
++
++	/* Set up the rate scaling to start at 54M and fallback
++	 * all the way to 1M in IEEE order and then spin on IEEE */
++	if (is_ap)
++		r = IWL_RATE_54M_INDEX;
++	else if (priv->phymode == MODE_IEEE80211A)
++		r = IWL_RATE_6M_INDEX;
++	else
++		r = IWL_RATE_1M_INDEX;
++
++	for (i = 0; i < LINK_QUAL_MAX_RETRY_NUM; i++) {
++		rate_flags = 0;
++		if (r >= IWL_FIRST_CCK_RATE && r <= IWL_LAST_CCK_RATE)
++			rate_flags |= RATE_MCS_CCK_MSK;
++
++		rate_flags |= RATE_MCS_ANT_B_MSK;
++		rate_flags &= ~RATE_MCS_ANT_A_MSK;
++		link_cmd.rs_table[i].rate_n_flags =
++			iwl_hw_set_rate_n_flags(iwl_rates[r].plcp, rate_flags);
++		r = iwl_get_prev_ieee_rate(r);
++	}
++
++	link_cmd.general_params.single_stream_ant_msk = 2;
++	link_cmd.general_params.dual_stream_ant_msk = 3;
++	link_cmd.agg_params.agg_dis_start_th = 3;
++	link_cmd.agg_params.agg_time_limit = cpu_to_le16(4000);
++
++	/* Update the rate scaling for control frame Tx to AP */
++	link_cmd.sta_id = is_ap ? IWL_AP_ID : IWL4965_BROADCAST_ID;
++
++	iwl_send_cmd_pdu(priv, REPLY_TX_LINK_QUALITY_CMD, sizeof(link_cmd),
++			 &link_cmd);
++}
++
++#ifdef CONFIG_IWLWIFI_HT
++
++static u8 iwl_is_channel_extension(struct iwl_priv *priv, int phymode,
++				   u16 channel, u8 extension_chan_offset)
++{
++	const struct iwl_channel_info *ch_info;
++
++	ch_info = iwl_get_channel_info(priv, phymode, channel);
++	if (!is_channel_valid(ch_info))
++		return 0;
++
++	if (extension_chan_offset == IWL_EXT_CHANNEL_OFFSET_AUTO)
++		return 0;
++
++	if ((ch_info->fat_extension_channel == extension_chan_offset) ||
++	    (ch_info->fat_extension_channel == HT_IE_EXT_CHANNEL_MAX))
++		return 1;
++
++	return 0;
++}
++
++static u8 iwl_is_fat_tx_allowed(struct iwl_priv *priv,
++				const struct sta_ht_info *ht_info)
++{
++
++	if (priv->channel_width != IWL_CHANNEL_WIDTH_40MHZ)
++		return 0;
++
++	if (ht_info->supported_chan_width != IWL_CHANNEL_WIDTH_40MHZ)
++		return 0;
++
++	if (ht_info->extension_chan_offset == IWL_EXT_CHANNEL_OFFSET_AUTO)
++		return 0;
++
++	/* no fat tx allowed on 2.4GHZ */
++	if (priv->phymode != MODE_IEEE80211A)
++		return 0;
++	return (iwl_is_channel_extension(priv, priv->phymode,
++					 ht_info->control_channel,
++					 ht_info->extension_chan_offset));
++}
++
++void iwl4965_set_rxon_ht(struct iwl_priv *priv, struct sta_ht_info *ht_info)
++{
++	struct iwl_rxon_cmd *rxon = &priv->staging_rxon;
++	u32 val;
++
++	if (!ht_info->is_ht)
++		return;
++
++	if (iwl_is_fat_tx_allowed(priv, ht_info))
++		rxon->flags |= RXON_FLG_CHANNEL_MODE_MIXED_MSK;
++	else
++		rxon->flags &= ~(RXON_FLG_CHANNEL_MODE_MIXED_MSK |
++				 RXON_FLG_CHANNEL_MODE_PURE_40_MSK);
++
++	if (le16_to_cpu(rxon->channel) != ht_info->control_channel) {
++		IWL_DEBUG_ASSOC("control diff than current %d %d\n",
++				le16_to_cpu(rxon->channel),
++				ht_info->control_channel);
++		rxon->channel = cpu_to_le16(ht_info->control_channel);
++		return;
++	}
++
++	/* Note: control channel is oposit to extension channel */
++	switch (ht_info->extension_chan_offset) {
++	case IWL_EXT_CHANNEL_OFFSET_ABOVE:
++		rxon->flags &= ~(RXON_FLG_CTRL_CHANNEL_LOC_HI_MSK);
++		break;
++	case IWL_EXT_CHANNEL_OFFSET_BELOW:
++		rxon->flags |= RXON_FLG_CTRL_CHANNEL_LOC_HI_MSK;
++		break;
++	case IWL_EXT_CHANNEL_OFFSET_AUTO:
++		rxon->flags &= ~RXON_FLG_CHANNEL_MODE_MIXED_MSK;
++		break;
++	default:
++		rxon->flags &= ~RXON_FLG_CHANNEL_MODE_MIXED_MSK;
++		break;
++	}
++
++	val = ht_info->operating_mode;
++
++	rxon->flags |= cpu_to_le32(val << RXON_FLG_HT_OPERATING_MODE_POS);
++
++	priv->active_rate_ht[0] = ht_info->supp_rates[0];
++	priv->active_rate_ht[1] = ht_info->supp_rates[1];
++	iwl4965_set_rxon_chain(priv);
++
++	IWL_DEBUG_ASSOC("supported HT rate 0x%X %X "
++			"rxon flags 0x%X operation mode :0x%X "
++			"extension channel offset 0x%x "
++			"control chan %d\n",
++			priv->active_rate_ht[0], priv->active_rate_ht[1],
++			le32_to_cpu(rxon->flags), ht_info->operating_mode,
++			ht_info->extension_chan_offset,
++			ht_info->control_channel);
++	return;
++}
++
++void iwl4965_set_ht_add_station(struct iwl_priv *priv, u8 index)
++{
++	__le32 sta_flags;
++	struct sta_ht_info *ht_info = &priv->current_assoc_ht;
++
++	priv->current_channel_width = IWL_CHANNEL_WIDTH_20MHZ;
++	if (!ht_info->is_ht)
++		goto done;
++
++	sta_flags = priv->stations[index].sta.station_flags;
++
++	if (ht_info->tx_mimo_ps_mode == IWL_MIMO_PS_DYNAMIC)
++		sta_flags |= STA_FLG_RTS_MIMO_PROT_MSK;
++	else
++		sta_flags &= ~STA_FLG_RTS_MIMO_PROT_MSK;
++
++	sta_flags |= cpu_to_le32(
++		(u32)ht_info->ampdu_factor << STA_FLG_MAX_AGG_SIZE_POS);
++
++	sta_flags |= cpu_to_le32(
++		(u32)ht_info->mpdu_density << STA_FLG_AGG_MPDU_DENSITY_POS);
++
++	sta_flags &= (~STA_FLG_FAT_EN_MSK);
++	ht_info->tx_chan_width = IWL_CHANNEL_WIDTH_20MHZ;
++	ht_info->chan_width_cap = IWL_CHANNEL_WIDTH_20MHZ;
++
++	if (iwl_is_fat_tx_allowed(priv, ht_info)) {
++		sta_flags |= STA_FLG_FAT_EN_MSK;
++		ht_info->chan_width_cap = IWL_CHANNEL_WIDTH_40MHZ;
++		if (ht_info->supported_chan_width == IWL_CHANNEL_WIDTH_40MHZ)
++			ht_info->tx_chan_width = IWL_CHANNEL_WIDTH_40MHZ;
++	}
++	priv->current_channel_width = ht_info->tx_chan_width;
++	priv->stations[index].sta.station_flags = sta_flags;
++ done:
++	return;
++}
++
++#ifdef CONFIG_IWLWIFI_HT_AGG
++
++static void iwl4965_sta_modify_add_ba_tid(struct iwl_priv *priv,
++					  int sta_id, int tid, u16 ssn)
++{
++	unsigned long flags;
++
++	spin_lock_irqsave(&priv->sta_lock, flags);
++	priv->stations[sta_id].sta.station_flags_msk = 0;
++	priv->stations[sta_id].sta.sta.modify_mask = STA_MODIFY_ADDBA_TID_MSK;
++	priv->stations[sta_id].sta.add_immediate_ba_tid = (u8)tid;
++	priv->stations[sta_id].sta.add_immediate_ba_ssn = cpu_to_le16(ssn);
++	priv->stations[sta_id].sta.mode = STA_CONTROL_MODIFY_MSK;
++	spin_unlock_irqrestore(&priv->sta_lock, flags);
++
++	iwl_send_add_station(priv, &priv->stations[sta_id].sta, CMD_ASYNC);
++}
++
++static void iwl4965_sta_modify_del_ba_tid(struct iwl_priv *priv,
++					  int sta_id, int tid)
++{
++	unsigned long flags;
++
++	spin_lock_irqsave(&priv->sta_lock, flags);
++	priv->stations[sta_id].sta.station_flags_msk = 0;
++	priv->stations[sta_id].sta.sta.modify_mask = STA_MODIFY_DELBA_TID_MSK;
++	priv->stations[sta_id].sta.remove_immediate_ba_tid = (u8)tid;
++	priv->stations[sta_id].sta.mode = STA_CONTROL_MODIFY_MSK;
++	spin_unlock_irqrestore(&priv->sta_lock, flags);
++
++	iwl_send_add_station(priv, &priv->stations[sta_id].sta, CMD_ASYNC);
++}
++
++static const u16 default_tid_to_tx_fifo[] = {
++	IWL_TX_FIFO_AC1,
++	IWL_TX_FIFO_AC0,
++	IWL_TX_FIFO_AC0,
++	IWL_TX_FIFO_AC1,
++	IWL_TX_FIFO_AC2,
++	IWL_TX_FIFO_AC2,
++	IWL_TX_FIFO_AC3,
++	IWL_TX_FIFO_AC3,
++	IWL_TX_FIFO_NONE,
++	IWL_TX_FIFO_NONE,
++	IWL_TX_FIFO_NONE,
++	IWL_TX_FIFO_NONE,
++	IWL_TX_FIFO_NONE,
++	IWL_TX_FIFO_NONE,
++	IWL_TX_FIFO_NONE,
++	IWL_TX_FIFO_NONE,
++	IWL_TX_FIFO_AC3
++};
++
++static int iwl_txq_ctx_activate_free(struct iwl_priv *priv)
++{
++	int txq_id;
++
++	for (txq_id = 0; txq_id < priv->hw_setting.max_txq_num; txq_id++)
++		if (!test_and_set_bit(txq_id, &priv->txq_ctx_active_msk))
++			return txq_id;
++	return -1;
++}
++
++int iwl_mac_ht_tx_agg_start(struct ieee80211_hw *hw, u8 *da, u16 tid,
++			    u16 *start_seq_num)
++{
++
++	struct iwl_priv *priv = hw->priv;
++	int sta_id;
++	int tx_fifo;
++	int txq_id;
++	int ssn = -1;
++	unsigned long flags;
++	struct iwl_tid_data *tid_data;
++
++	if (likely(tid < ARRAY_SIZE(default_tid_to_tx_fifo)))
++		tx_fifo = default_tid_to_tx_fifo[tid];
++	else
++		return -EINVAL;
++
++	IWL_WARNING("iwl-AGG iwl_mac_ht_tx_agg_start on da=" MAC_FMT
++		    " tid=%d\n", MAC_ARG(da), tid);
++
++	sta_id = iwl_hw_find_station(priv, da);
++	if (sta_id == IWL_INVALID_STATION)
++		return -ENXIO;
++
++	txq_id = iwl_txq_ctx_activate_free(priv);
++	if (txq_id == -1)
++		return -ENXIO;
++
++	spin_lock_irqsave(&priv->sta_lock, flags);
++	tid_data = &priv->stations[sta_id].tid[tid];
++	ssn = SEQ_TO_SN(tid_data->seq_number);
++	tid_data->agg.txq_id = txq_id;
++	spin_unlock_irqrestore(&priv->sta_lock, flags);
++
++	*start_seq_num = ssn;
++	iwl4965_ba_status(priv, tid, BA_STATUS_ACTIVE);
++	return iwl4965_tx_queue_agg_enable(priv, txq_id, tx_fifo,
++					   sta_id, tid, ssn);
++}
++
++
++int iwl_mac_ht_tx_agg_stop(struct ieee80211_hw *hw, u8 *da, u16 tid,
++			   int generator)
++{
++
++	struct iwl_priv *priv = hw->priv;
++	int tx_fifo_id, txq_id, sta_id, ssn = -1;
++	struct iwl_tid_data *tid_data;
++	int rc;
++	if (!da) {
++		IWL_ERROR("%s: da = NULL\n", __func__);
++		return -EINVAL;
++	}
++
++	if (likely(tid < ARRAY_SIZE(default_tid_to_tx_fifo)))
++		tx_fifo_id = default_tid_to_tx_fifo[tid];
++	else
++		return -EINVAL;
++
++	sta_id = iwl_hw_find_station(priv, da);
++
++	if (sta_id == IWL_INVALID_STATION)
++		return -ENXIO;
++
++	tid_data = &priv->stations[sta_id].tid[tid];
++	ssn = (tid_data->seq_number & IEEE80211_SCTL_SEQ) >> 4;
++	txq_id = tid_data->agg.txq_id;
++
++	rc = iwl4965_tx_queue_agg_disable(priv, txq_id, ssn, tx_fifo_id);
++	/* FIXME: need more safe way to handle error condition */
++	if (rc)
++		return rc;
++
++	iwl4965_ba_status(priv, tid, BA_STATUS_INITIATOR_DELBA);
++	IWL_DEBUG_INFO("iwl_mac_ht_tx_agg_stop on da=" MAC_FMT " tid=%d\n",
++		    MAC_ARG(da), tid);
++
++	return 0;
++}
++
++int iwl_mac_ht_rx_agg_start(struct ieee80211_hw *hw, u8 *da,
++			    u16 tid, u16 start_seq_num)
++{
++	struct iwl_priv *priv = hw->priv;
++	int sta_id;
++
++	IWL_WARNING("iwl-AGG iwl_mac_ht_rx_agg_start on da=" MAC_FMT
++		    " tid=%d\n", MAC_ARG(da), tid);
++	sta_id = iwl_hw_find_station(priv, da);
++	iwl4965_sta_modify_add_ba_tid(priv, sta_id, tid, start_seq_num);
++	return 0;
++}
++
++int iwl_mac_ht_rx_agg_stop(struct ieee80211_hw *hw, u8 *da,
++			   u16 tid, int generator)
++{
++	struct iwl_priv *priv = hw->priv;
++	int sta_id;
++
++	IWL_WARNING("iwl-AGG iwl_mac_ht_rx_agg_stop on da=" MAC_FMT " tid=%d\n",
++		     MAC_ARG(da), tid);
++	sta_id = iwl_hw_find_station(priv, da);
++	iwl4965_sta_modify_del_ba_tid(priv, sta_id, tid);
++	return 0;
++}
++
++#endif /* CONFIG_IWLWIFI_HT_AGG */
++#endif /* CONFIG_IWLWIFI_HT */
++
++/* Set up 4965-specific Rx frame reply handlers */
++void iwl_hw_rx_handler_setup(struct iwl_priv *priv)
++{
++	/* Legacy Rx frames */
++	priv->rx_handlers[REPLY_4965_RX] = iwl4965_rx_reply_rx;
++
++	/* High-throughput (HT) Rx frames */
++	priv->rx_handlers[REPLY_RX_PHY_CMD] = iwl4965_rx_reply_rx_phy;
++	priv->rx_handlers[REPLY_RX_MPDU_CMD] = iwl4965_rx_reply_rx;
++
++	priv->rx_handlers[MISSED_BEACONS_NOTIFICATION] =
++	    iwl4965_rx_missed_beacon_notif;
++
++#ifdef CONFIG_IWLWIFI_HT
++#ifdef CONFIG_IWLWIFI_HT_AGG
++	priv->rx_handlers[REPLY_COMPRESSED_BA] = iwl4965_rx_reply_compressed_ba;
++#endif /* CONFIG_IWLWIFI_AGG */
++#endif /* CONFIG_IWLWIFI */
++}
++
++void iwl_hw_setup_deferred_work(struct iwl_priv *priv)
++{
++	INIT_WORK(&priv->txpower_work, iwl4965_bg_txpower_work);
++	INIT_WORK(&priv->statistics_work, iwl4965_bg_statistics_work);
++#ifdef CONFIG_IWLWIFI_SENSITIVITY
++	INIT_WORK(&priv->sensitivity_work, iwl4965_bg_sensitivity_work);
++#endif
++#ifdef CONFIG_IWLWIFI_HT
++#ifdef CONFIG_IWLWIFI_HT_AGG
++	INIT_WORK(&priv->agg_work, iwl4965_bg_agg_work);
++#endif /* CONFIG_IWLWIFI_AGG */
++#endif /* CONFIG_IWLWIFI_HT */
++	init_timer(&priv->statistics_periodic);
++	priv->statistics_periodic.data = (unsigned long)priv;
++	priv->statistics_periodic.function = iwl4965_bg_statistics_periodic;
++}
++
++void iwl_hw_cancel_deferred_work(struct iwl_priv *priv)
++{
++	del_timer_sync(&priv->statistics_periodic);
++
++	cancel_delayed_work(&priv->init_alive_start);
++}
++
++struct pci_device_id iwl_hw_card_ids[] = {
++	{0x8086, 0x4229, PCI_ANY_ID, PCI_ANY_ID, 0, 0, 0},
++	{0x8086, 0x4230, PCI_ANY_ID, PCI_ANY_ID, 0, 0, 0},
++	{0}
++};
++
++int iwl_eeprom_aqcuire_semaphore(struct iwl_priv *priv)
++{
++	u16 count;
++	int rc;
++
++	for (count = 0; count < EEPROM_SEM_RETRY_LIMIT; count++) {
++		iwl_set_bit(priv, CSR_HW_IF_CONFIG_REG,
++			CSR_HW_IF_CONFIG_REG_BIT_EEPROM_OWN_SEM);
++		rc = iwl_poll_bit(priv, CSR_HW_IF_CONFIG_REG,
++					CSR_HW_IF_CONFIG_REG_BIT_EEPROM_OWN_SEM,
++					CSR_HW_IF_CONFIG_REG_BIT_EEPROM_OWN_SEM,
++					EEPROM_SEM_TIMEOUT);
++		if (rc >= 0) {
++			IWL_DEBUG_IO("Aqcuired semaphore after %d tries.\n",
++				count+1);
++			return rc;
++		}
++	}
++
++	return rc;
++}
++
++inline void iwl_eeprom_release_semaphore(struct iwl_priv *priv)
++{
++	iwl_clear_bit(priv, CSR_HW_IF_CONFIG_REG,
++		CSR_HW_IF_CONFIG_REG_BIT_EEPROM_OWN_SEM);
++}
++
++
++MODULE_DEVICE_TABLE(pci, iwl_hw_card_ids);
+diff --git a/drivers/net/wireless/iwl-4965.h b/drivers/net/wireless/iwl-4965.h
+new file mode 100644
+index 0000000..4c70081
+--- /dev/null
++++ b/drivers/net/wireless/iwl-4965.h
+@@ -0,0 +1,341 @@
++/******************************************************************************
++ *
++ * Copyright(c) 2003 - 2007 Intel Corporation. All rights reserved.
++ *
++ * This program is free software; you can redistribute it and/or modify it
++ * under the terms of version 2 of the GNU General Public License as
++ * published by the Free Software Foundation.
++ *
++ * 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.,
++ * 51 Franklin Street, Fifth Floor, Boston, MA 02110, USA
++ *
++ * The full GNU General Public License is included in this distribution in the
++ * file called LICENSE.
++ *
++ * Contact Information:
++ * James P. Ketrenos <ipw2100-admin at linux.intel.com>
++ * Intel Corporation, 5200 N.E. Elam Young Parkway, Hillsboro, OR 97124-6497
++ *
++ *****************************************************************************/
++#ifndef __iwl_4965_h__
++#define __iwl_4965_h__
++
++struct iwl_priv;
++struct sta_ht_info;
++
++/*
++ * Forward declare iwl-4965.c functions for iwl-base.c
++ */
++extern int iwl_eeprom_aqcuire_semaphore(struct iwl_priv *priv);
++extern void iwl_eeprom_release_semaphore(struct iwl_priv *priv);
++
++extern int iwl4965_tx_queue_update_wr_ptr(struct iwl_priv *priv,
++					  struct iwl_tx_queue *txq,
++					  u16 byte_cnt);
++extern void iwl4965_add_station(struct iwl_priv *priv, const u8 *addr,
++				int is_ap);
++extern void iwl4965_set_rxon_ht(struct iwl_priv *priv,
++				struct sta_ht_info *ht_info);
++
++extern void iwl4965_set_rxon_chain(struct iwl_priv *priv);
++extern int iwl4965_tx_cmd(struct iwl_priv *priv, struct iwl_cmd *out_cmd,
++			  u8 sta_id, dma_addr_t txcmd_phys,
++			  struct ieee80211_hdr *hdr, u8 hdr_len,
++			  struct ieee80211_tx_control *ctrl, void *sta_in);
++extern int iwl4965_init_hw_rates(struct iwl_priv *priv,
++				 struct ieee80211_rate *rates);
++extern int iwl4965_alive_notify(struct iwl_priv *priv);
++extern void iwl4965_update_rate_scaling(struct iwl_priv *priv, u8 mode);
++extern void iwl4965_set_ht_add_station(struct iwl_priv *priv, u8 index);
++
++extern void iwl4965_chain_noise_reset(struct iwl_priv *priv);
++extern void iwl4965_init_sensitivity(struct iwl_priv *priv, u8 flags,
++				     u8 force);
++extern int iwl4965_set_fat_chan_info(struct iwl_priv *priv, int phymode,
++				u16 channel,
++				const struct iwl_eeprom_channel *eeprom_ch,
++				u8 fat_extension_channel);
++extern void iwl4965_rf_kill_ct_config(struct iwl_priv *priv);
++
++#ifdef CONFIG_IWLWIFI_HT
++#ifdef CONFIG_IWLWIFI_HT_AGG
++extern int iwl_mac_ht_tx_agg_start(struct ieee80211_hw *hw, u8 *da,
++				   u16 tid, u16 *start_seq_num);
++extern int iwl_mac_ht_rx_agg_start(struct ieee80211_hw *hw, u8 *da,
++				   u16 tid, u16 start_seq_num);
++extern int iwl_mac_ht_rx_agg_stop(struct ieee80211_hw *hw, u8 *da,
++				  u16 tid, int generator);
++extern int iwl_mac_ht_tx_agg_stop(struct ieee80211_hw *hw, u8 *da,
++				  u16 tid, int generator);
++extern void iwl4965_turn_off_agg(struct iwl_priv *priv, u8 tid);
++#endif /* CONFIG_IWLWIFI_HT_AGG */
++#endif /*CONFIG_IWLWIFI_HT */
++/* Structures, enum, and defines specific to the 4965 */
++
++#define IWL4965_KW_SIZE 0x1000	/*4k */
++
++struct iwl_kw {
++	dma_addr_t dma_addr;
++	void *v_addr;
++	size_t size;
++};
++
++#define TID_QUEUE_CELL_SPACING 50	/*mS */
++#define TID_QUEUE_MAX_SIZE     20
++#define TID_ROUND_VALUE        5	/* mS */
++#define TID_MAX_LOAD_COUNT     8
++
++#define TID_MAX_TIME_DIFF ((TID_QUEUE_MAX_SIZE - 1) * TID_QUEUE_CELL_SPACING)
++#define TIME_WRAP_AROUND(x, y) (((y) > (x)) ? (y) - (x) : (0-(x)) + (y))
++
++#define TID_ALL_ENABLED		0x7f
++#define TID_ALL_SPECIFIED       0xff
++#define TID_AGG_TPT_THREHOLD    0x0
++
++#define IWL_CHANNEL_WIDTH_20MHZ   0
++#define IWL_CHANNEL_WIDTH_40MHZ   1
++
++#define IWL_MIMO_PS_STATIC        0
++#define IWL_MIMO_PS_NONE          3
++#define IWL_MIMO_PS_DYNAMIC       1
++#define IWL_MIMO_PS_INVALID       2
++
++#define IWL_OPERATION_MODE_AUTO     0
++#define IWL_OPERATION_MODE_HT_ONLY  1
++#define IWL_OPERATION_MODE_MIXED    2
++#define IWL_OPERATION_MODE_20MHZ    3
++
++#define IWL_EXT_CHANNEL_OFFSET_AUTO   0
++#define IWL_EXT_CHANNEL_OFFSET_ABOVE  1
++#define IWL_EXT_CHANNEL_OFFSET_       2
++#define IWL_EXT_CHANNEL_OFFSET_BELOW  3
++#define IWL_EXT_CHANNEL_OFFSET_MAX    4
++
++#define NRG_NUM_PREV_STAT_L     20
++#define NUM_RX_CHAINS           (3)
++
++#define TX_POWER_IWL_ILLEGAL_VDET    -100000
++#define TX_POWER_IWL_ILLEGAL_VOLTAGE -10000
++#define TX_POWER_IWL_CLOSED_LOOP_MIN_POWER 18
++#define TX_POWER_IWL_CLOSED_LOOP_MAX_POWER 34
++#define TX_POWER_IWL_VDET_SLOPE_BELOW_NOMINAL 17
++#define TX_POWER_IWL_VDET_SLOPE_ABOVE_NOMINAL 20
++#define TX_POWER_IWL_NOMINAL_POWER            26
++#define TX_POWER_IWL_CLOSED_LOOP_ITERATION_LIMIT 1
++#define TX_POWER_IWL_VOLTAGE_CODES_PER_03V       7
++#define TX_POWER_IWL_DEGREES_PER_VDET_CODE       11
++#define IWL_TX_POWER_MAX_NUM_PA_MEASUREMENTS 1
++#define IWL_TX_POWER_CCK_COMPENSATION_B_STEP (9)
++#define IWL_TX_POWER_CCK_COMPENSATION_C_STEP (5)
++
++struct iwl_traffic_load {
++	unsigned long time_stamp;
++	u32 packet_count[TID_QUEUE_MAX_SIZE];
++	u8 queue_count;
++	u8 head;
++	u32 total;
++};
++
++#ifdef CONFIG_IWLWIFI_HT_AGG
++struct iwl_agg_control {
++	unsigned long next_retry;
++	u32 wait_for_agg_status;
++	u32 tid_retry;
++	u32 requested_ba;
++	u32 granted_ba;
++	u8 auto_agg;
++	u32 tid_traffic_load_threshold;
++	u32 ba_timeout;
++	struct iwl_traffic_load traffic_load[TID_MAX_LOAD_COUNT];
++};
++#endif				/*CONFIG_IWLWIFI_HT_AGG */
++
++struct iwl_lq_mngr {
++#ifdef CONFIG_IWLWIFI_HT_AGG
++	struct iwl_agg_control agg_ctrl;
++#endif
++	spinlock_t lock;
++	s32 max_window_size;
++	s32 *expected_tpt;
++	u8 *next_higher_rate;
++	u8 *next_lower_rate;
++	unsigned long stamp;
++	unsigned long stamp_last;
++	u32 flush_time;
++	u32 tx_packets;
++	u8 lq_ready;
++};
++
++
++/* Sensitivity and chain noise calibration */
++#define INTERFERENCE_DATA_AVAILABLE	__constant_cpu_to_le32(1)
++#define INITIALIZATION_VALUE		0xFFFF
++#define CAL_NUM_OF_BEACONS		20
++#define MAXIMUM_ALLOWED_PATHLOSS	15
++
++/* Param table within SENSITIVITY_CMD */
++#define HD_MIN_ENERGY_CCK_DET_INDEX                 (0)
++#define HD_MIN_ENERGY_OFDM_DET_INDEX                (1)
++#define HD_AUTO_CORR32_X1_TH_ADD_MIN_INDEX          (2)
++#define HD_AUTO_CORR32_X1_TH_ADD_MIN_MRC_INDEX      (3)
++#define HD_AUTO_CORR40_X4_TH_ADD_MIN_MRC_INDEX      (4)
++#define HD_AUTO_CORR32_X4_TH_ADD_MIN_INDEX          (5)
++#define HD_AUTO_CORR32_X4_TH_ADD_MIN_MRC_INDEX      (6)
++#define HD_BARKER_CORR_TH_ADD_MIN_INDEX             (7)
++#define HD_BARKER_CORR_TH_ADD_MIN_MRC_INDEX         (8)
++#define HD_AUTO_CORR40_X4_TH_ADD_MIN_INDEX          (9)
++#define HD_OFDM_ENERGY_TH_IN_INDEX                  (10)
++
++#define SENSITIVITY_CMD_CONTROL_DEFAULT_TABLE	__constant_cpu_to_le16(0)
++#define SENSITIVITY_CMD_CONTROL_WORK_TABLE	__constant_cpu_to_le16(1)
++
++#define CHAIN_NOISE_MAX_DELTA_GAIN_CODE 3
++
++#define MAX_FA_OFDM  50
++#define MIN_FA_OFDM  5
++#define MAX_FA_CCK   50
++#define MIN_FA_CCK   5
++
++#define NRG_MIN_CCK  97
++#define NRG_MAX_CCK  0
++
++#define AUTO_CORR_MIN_OFDM        85
++#define AUTO_CORR_MIN_OFDM_MRC    170
++#define AUTO_CORR_MIN_OFDM_X1     105
++#define AUTO_CORR_MIN_OFDM_MRC_X1 220
++#define AUTO_CORR_MAX_OFDM        120
++#define AUTO_CORR_MAX_OFDM_MRC    210
++#define AUTO_CORR_MAX_OFDM_X1     140
++#define AUTO_CORR_MAX_OFDM_MRC_X1 270
++#define AUTO_CORR_STEP_OFDM       1
++
++#define AUTO_CORR_MIN_CCK      (125)
++#define AUTO_CORR_MAX_CCK      (200)
++#define AUTO_CORR_MIN_CCK_MRC  200
++#define AUTO_CORR_MAX_CCK_MRC  400
++#define AUTO_CORR_STEP_CCK     3
++#define AUTO_CORR_MAX_TH_CCK   160
++
++#define NRG_ALG                0
++#define AUTO_CORR_ALG          1
++#define NRG_DIFF               2
++#define NRG_STEP_CCK           2
++#define NRG_MARGIN             8
++#define MAX_NUMBER_CCK_NO_FA 100
++
++#define AUTO_CORR_CCK_MIN_VAL_DEF    (125)
++
++#define CHAIN_A             0
++#define CHAIN_B             1
++#define CHAIN_C             2
++#define CHAIN_NOISE_DELTA_GAIN_INIT_VAL 4
++#define ALL_BAND_FILTER			0xFF00
++#define IN_BAND_FILTER			0xFF
++#define MIN_AVERAGE_NOISE_MAX_VALUE	0xFFFFFFFF
++
++enum iwl_false_alarm_state {
++	IWL_FA_TOO_MANY = 0,
++	IWL_FA_TOO_FEW = 1,
++	IWL_FA_GOOD_RANGE = 2,
++};
++
++enum iwl_chain_noise_state {
++	IWL_CHAIN_NOISE_ALIVE = 0,  /* must be 0 */
++	IWL_CHAIN_NOISE_ACCUMULATE = 1,
++	IWL_CHAIN_NOISE_CALIBRATED = 2,
++};
++
++enum iwl_sensitivity_state {
++	IWL_SENS_CALIB_ALLOWED = 0,
++	IWL_SENS_CALIB_NEED_REINIT = 1,
++};
++
++enum iwl_calib_enabled_state {
++	IWL_CALIB_DISABLED = 0,  /* must be 0 */
++	IWL_CALIB_ENABLED = 1,
++};
++
++struct statistics_general_data {
++	u32 beacon_silence_rssi_a;
++	u32 beacon_silence_rssi_b;
++	u32 beacon_silence_rssi_c;
++	u32 beacon_energy_a;
++	u32 beacon_energy_b;
++	u32 beacon_energy_c;
++};
++
++/* Sensitivity calib data */
++struct iwl_sensitivity_data {
++	u32 auto_corr_ofdm;
++	u32 auto_corr_ofdm_mrc;
++	u32 auto_corr_ofdm_x1;
++	u32 auto_corr_ofdm_mrc_x1;
++	u32 auto_corr_cck;
++	u32 auto_corr_cck_mrc;
++
++	u32 last_bad_plcp_cnt_ofdm;
++	u32 last_fa_cnt_ofdm;
++	u32 last_bad_plcp_cnt_cck;
++	u32 last_fa_cnt_cck;
++
++	u32 nrg_curr_state;
++	u32 nrg_prev_state;
++	u32 nrg_value[10];
++	u8  nrg_silence_rssi[NRG_NUM_PREV_STAT_L];
++	u32 nrg_silence_ref;
++	u32 nrg_energy_idx;
++	u32 nrg_silence_idx;
++	u32 nrg_th_cck;
++	s32 nrg_auto_corr_silence_diff;
++	u32 num_in_cck_no_fa;
++	u32 nrg_th_ofdm;
++
++	u8 state;
++};
++
++/* Chain noise (differential Rx gain) calib data */
++struct iwl_chain_noise_data {
++	u8 state;
++	u16 beacon_count;
++	u32 chain_noise_a;
++	u32 chain_noise_b;
++	u32 chain_noise_c;
++	u32 chain_signal_a;
++	u32 chain_signal_b;
++	u32 chain_signal_c;
++	u8 disconn_array[NUM_RX_CHAINS];
++	u8 delta_gain_code[NUM_RX_CHAINS];
++	u8 radio_write;
++};
++
++/* IWL4965 */
++#define RATE_MCS_CODE_MSK 0x7
++#define RATE_MCS_MIMO_POS 3
++#define RATE_MCS_MIMO_MSK 0x8
++#define RATE_MCS_HT_DUP_POS 5
++#define RATE_MCS_HT_DUP_MSK 0x20
++#define RATE_MCS_FLAGS_POS 8
++#define RATE_MCS_HT_POS 8
++#define RATE_MCS_HT_MSK 0x100
++#define RATE_MCS_CCK_POS 9
++#define RATE_MCS_CCK_MSK 0x200
++#define RATE_MCS_GF_POS 10
++#define RATE_MCS_GF_MSK 0x400
++
++#define RATE_MCS_FAT_POS 11
++#define RATE_MCS_FAT_MSK 0x800
++#define RATE_MCS_DUP_POS 12
++#define RATE_MCS_DUP_MSK 0x1000
++#define RATE_MCS_SGI_POS 13
++#define RATE_MCS_SGI_MSK 0x2000
++
++#define	EEPROM_SEM_TIMEOUT 10
++#define EEPROM_SEM_RETRY_LIMIT 1000
++
++#endif				/* __iwl_4965_h__ */
+diff --git a/drivers/net/wireless/iwl-channel.h b/drivers/net/wireless/iwl-channel.h
+new file mode 100644
+index 0000000..023c3f2
+--- /dev/null
++++ b/drivers/net/wireless/iwl-channel.h
+@@ -0,0 +1,161 @@
++/******************************************************************************
++ *
++ * Copyright(c) 2005 - 2007 Intel Corporation. All rights reserved.
++ *
++ * This program is free software; you can redistribute it and/or modify it
++ * under the terms of version 2 of the GNU General Public License as
++ * published by the Free Software Foundation.
++ *
++ * 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.,
++ * 51 Franklin Street, Fifth Floor, Boston, MA 02110, USA
++ *
++ * The full GNU General Public License is included in this distribution in the
++ * file called LICENSE.
++ *
++ * Contact Information:
++ * James P. Ketrenos <ipw2100-admin at linux.intel.com>
++ * Intel Corporation, 5200 N.E. Elam Young Parkway, Hillsboro, OR 97124-6497
++ *
++ *****************************************************************************/
++#ifndef __iwl_channel_h__
++#define __iwl_channel_h__
++
++#define IWL_NUM_SCAN_RATES         (2)
++
++struct iwl_channel_tgd_info {
++	u8 type;
++	s8 max_power;
++};
++
++struct iwl_channel_tgh_info {
++	s64 last_radar_time;
++};
++
++/* current Tx power values to use, one for each rate for each channel.
++ * requested power is limited by:
++ * -- regulatory EEPROM limits for this channel
++ * -- hardware capabilities (clip-powers)
++ * -- spectrum management
++ * -- user preference (e.g. iwconfig)
++ * when requested power is set, base power index must also be set. */
++struct iwl_channel_power_info {
++	struct iwl_tx_power tpc;	/* actual radio and DSP gain settings */
++	s8 power_table_index;	/* actual (compenst'd) index into gain table */
++	s8 base_power_index;	/* gain index for power at factory temp. */
++	s8 requested_power;	/* power (dBm) requested for this chnl/rate */
++};
++
++/* current scan Tx power values to use, one for each scan rate for each
++ * channel. */
++struct iwl_scan_power_info {
++	struct iwl_tx_power tpc;	/* actual radio and DSP gain settings */
++	s8 power_table_index;	/* actual (compenst'd) index into gain table */
++	s8 requested_power;	/* scan pwr (dBm) requested for chnl/rate */
++};
++
++/* Channel unlock period is 15 seconds. If no beacon or probe response
++ * has been received within 15 seconds on a locked channel then the channel
++ * remains locked. */
++#define TX_UNLOCK_PERIOD 15
++
++/* CSA lock period is 15 seconds.  If a CSA has been received on a channel in
++ * the last 15 seconds, the channel is locked */
++#define CSA_LOCK_PERIOD 15
++/*
++ * One for each channel, holds all channel setup data
++ * Some of the fields (e.g. eeprom and flags/max_power_avg) are redundant
++ *     with one another!
++ */
++#define IWL4965_MAX_RATE (33)
++
++struct iwl_channel_info {
++	struct iwl_channel_tgd_info tgd;
++	struct iwl_channel_tgh_info tgh;
++	struct iwl_eeprom_channel eeprom;	/* EEPROM regulatory limit */
++	struct iwl_eeprom_channel fat_eeprom;	/* EEPROM regulatory limit for
++						 * FAT channel */
++
++	u8 channel;	  /* channel number */
++	u8 flags;	  /* flags copied from EEPROM */
++	s8 max_power_avg; /* (dBm) regul. eeprom, normal Tx, any rate */
++	s8 curr_txpow;	  /* (dBm) regulatory/spectrum/user (not h/w) */
++	s8 min_power;	  /* always 0 */
++	s8 scan_power;	  /* (dBm) regul. eeprom, direct scans, any rate */
++
++	u8 group_index;	  /* 0-4, maps channel to group1/2/3/4/5 */
++	u8 band_index;	  /* 0-4, maps channel to band1/2/3/4/5 */
++	u8 phymode;	  /* MODE_IEEE80211{A,B,G} */
++
++	/* Radio/DSP gain settings for each "normal" data Tx rate.
++	 * These include, in addition to RF and DSP gain, a few fields for
++	 *   remembering/modifying gain settings (indexes). */
++	struct iwl_channel_power_info power_info[IWL4965_MAX_RATE];
++
++#if IWL == 4965
++	/* FAT channel info */
++	s8 fat_max_power_avg;	/* (dBm) regul. eeprom, normal Tx, any rate */
++	s8 fat_curr_txpow;	/* (dBm) regulatory/spectrum/user (not h/w) */
++	s8 fat_min_power;	/* always 0 */
++	s8 fat_scan_power;	/* (dBm) eeprom, direct scans, any rate */
++	u8 fat_flags;		/* flags copied from EEPROM */
++	u8 fat_extension_channel;
++#endif
++
++	/* Radio/DSP gain settings for each scan rate, for directed scans. */
++	struct iwl_scan_power_info scan_pwr_info[IWL_NUM_SCAN_RATES];
++};
++
++struct iwl_clip_group {
++	/* maximum power level to prevent clipping for each rate, derived by
++	 *   us from this band's saturation power in EEPROM */
++	const s8 clip_powers[IWL_MAX_RATES];
++};
++
++static inline int is_channel_valid(const struct iwl_channel_info *ch_info)
++{
++	if (ch_info == NULL)
++		return 0;
++	return (ch_info->flags & EEPROM_CHANNEL_VALID) ? 1 : 0;
++}
++
++static inline int is_channel_narrow(const struct iwl_channel_info *ch_info)
++{
++	return (ch_info->flags & EEPROM_CHANNEL_NARROW) ? 1 : 0;
++}
++
++static inline int is_channel_radar(const struct iwl_channel_info *ch_info)
++{
++	return (ch_info->flags & EEPROM_CHANNEL_RADAR) ? 1 : 0;
++}
++
++static inline u8 is_channel_a_band(const struct iwl_channel_info *ch_info)
++{
++	return ch_info->phymode == MODE_IEEE80211A;
++}
++
++static inline u8 is_channel_bg_band(const struct iwl_channel_info *ch_info)
++{
++	return ((ch_info->phymode == MODE_IEEE80211B) ||
++		(ch_info->phymode == MODE_IEEE80211G));
++}
++
++static inline int is_channel_passive(const struct iwl_channel_info *ch)
++{
++	return (!(ch->flags & EEPROM_CHANNEL_ACTIVE)) ? 1 : 0;
++}
++
++static inline int is_channel_ibss(const struct iwl_channel_info *ch)
++{
++	return ((ch->flags & EEPROM_CHANNEL_IBSS)) ? 1 : 0;
++}
++
++extern const struct iwl_channel_info *iwl_get_channel_info(
++	const struct iwl_priv *priv, int phymode, u16 channel);
++
++#endif
+diff --git a/drivers/net/wireless/iwl-commands.h b/drivers/net/wireless/iwl-commands.h
+new file mode 100644
+index 0000000..9de8d7f
+--- /dev/null
++++ b/drivers/net/wireless/iwl-commands.h
+@@ -0,0 +1,1734 @@
++/******************************************************************************
++ *
++ * This file is provided under a dual BSD/GPLv2 license.  When using or
++ * redistributing this file, you may do so under either license.
++ *
++ * GPL LICENSE SUMMARY
++ *
++ * Copyright(c) 2005 - 2007 Intel Corporation. All rights reserved.
++ *
++ * This program is free software; you can redistribute it and/or modify
++ * it under the terms of version 2 of the GNU Geeral Public License as
++ * published by the Free Software Foundation.
++ *
++ * 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., 51 Franklin Street, Fifth Floor, Boston, MA 02110,
++ * USA
++ *
++ * The full GNU General Public License is included in this distribution
++ * in the file called LICENSE.GPL.
++ *
++ * Contact Information:
++ * James P. Ketrenos <ipw2100-admin at linux.intel.com>
++ * Intel Corporation, 5200 N.E. Elam Young Parkway, Hillsboro, OR 97124-6497
++ *
++ * BSD LICENSE
++ *
++ * Copyright(c) 2005 - 2007 Intel Corporation. All rights reserved.
++ * All rights reserved.
++ *
++ * Redistribution and use in source and binary forms, with or without
++ * modification, are permitted provided that the following conditions
++ * are met:
++ *
++ *  * Redistributions of source code must retain the above copyright
++ *    notice, this list of conditions and the following disclaimer.
++ *  * Redistributions in binary form must reproduce the above copyright
++ *    notice, this list of conditions and the following disclaimer in
++ *    the documentation and/or other materials provided with the
++ *    distribution.
++ *  * Neither the name Intel Corporation nor the names of its
++ *    contributors may be used to endorse or promote products derived
++ *    from this software without specific prior written permission.
++ *
++ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
++ * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
++ * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
++ * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
++ * OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
++ * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
++ * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
++ * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
++ * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
++ * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
++ * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
++ *
++ *****************************************************************************/
++
++#ifndef __iwl_commands_h__
++#define __iwl_commands_h__
++
++enum {
++	REPLY_ALIVE = 0x1,
++	REPLY_ERROR = 0x2,
++
++	/* RXON and QOS commands */
++	REPLY_RXON = 0x10,
++	REPLY_RXON_ASSOC = 0x11,
++	REPLY_QOS_PARAM = 0x13,
++	REPLY_RXON_TIMING = 0x14,
++
++	/* Multi-Station support */
++	REPLY_ADD_STA = 0x18,
++	REPLY_REMOVE_STA = 0x19,	/* not used */
++	REPLY_REMOVE_ALL_STA = 0x1a,	/* not used */
++
++	/* RX, TX, LEDs */
++#if IWL == 3945
++	REPLY_3945_RX = 0x1b,		/* 3945 only */
++#endif
++	REPLY_TX = 0x1c,
++	REPLY_RATE_SCALE = 0x47,	/* 3945 only */
++	REPLY_LEDS_CMD = 0x48,
++	REPLY_TX_LINK_QUALITY_CMD = 0x4e, /* 4965 only */
++
++	/* 802.11h related */
++	RADAR_NOTIFICATION = 0x70,	/* not used */
++	REPLY_QUIET_CMD = 0x71,		/* not used */
++	REPLY_CHANNEL_SWITCH = 0x72,
++	CHANNEL_SWITCH_NOTIFICATION = 0x73,
++	REPLY_SPECTRUM_MEASUREMENT_CMD = 0x74,
++	SPECTRUM_MEASURE_NOTIFICATION = 0x75,
++
++	/* Power Management */
++	POWER_TABLE_CMD = 0x77,
++	PM_SLEEP_NOTIFICATION = 0x7A,
++	PM_DEBUG_STATISTIC_NOTIFIC = 0x7B,
++
++	/* Scan commands and notifications */
++	REPLY_SCAN_CMD = 0x80,
++	REPLY_SCAN_ABORT_CMD = 0x81,
++	SCAN_START_NOTIFICATION = 0x82,
++	SCAN_RESULTS_NOTIFICATION = 0x83,
++	SCAN_COMPLETE_NOTIFICATION = 0x84,
++
++	/* IBSS/AP commands */
++	BEACON_NOTIFICATION = 0x90,
++	REPLY_TX_BEACON = 0x91,
++	WHO_IS_AWAKE_NOTIFICATION = 0x94,	/* not used */
++
++	/* Miscellaneous commands */
++	QUIET_NOTIFICATION = 0x96,		/* not used */
++	REPLY_TX_PWR_TABLE_CMD = 0x97,
++	MEASURE_ABORT_NOTIFICATION = 0x99,	/* not used */
++
++	/* BT config command */
++	REPLY_BT_CONFIG = 0x9b,
++
++	/* 4965 Statistics */
++	REPLY_STATISTICS_CMD = 0x9c,
++	STATISTICS_NOTIFICATION = 0x9d,
++
++	/* RF-KILL commands and notifications */
++	REPLY_CARD_STATE_CMD = 0xa0,
++	CARD_STATE_NOTIFICATION = 0xa1,
++
++	/* Missed beacons notification */
++	MISSED_BEACONS_NOTIFICATION = 0xa2,
++
++#if IWL == 4965
++	REPLY_CT_KILL_CONFIG_CMD = 0xa4,
++	SENSITIVITY_CMD = 0xa8,
++	REPLY_PHY_CALIBRATION_CMD = 0xb0,
++	REPLY_RX_PHY_CMD = 0xc0,
++	REPLY_RX_MPDU_CMD = 0xc1,
++	REPLY_4965_RX = 0xc3,
++	REPLY_COMPRESSED_BA = 0xc5,
++#endif
++	REPLY_MAX = 0xff
++};
++
++/******************************************************************************
++ * (0)
++ * Header
++ *
++ *****************************************************************************/
++
++#define IWL_CMD_FAILED_MSK 0x40
++
++struct iwl_cmd_header {
++	u8 cmd;
++	u8 flags;
++	/* We have 15 LSB to use as we please (MSB indicates
++	 * a frame Rx'd from the HW).  We encode the following
++	 * information into the sequence field:
++	 *
++	 *  0:7    index in fifo
++	 *  8:13   fifo selection
++	 * 14:14   bit indicating if this packet references the 'extra'
++	 *         storage at the end of the memory queue
++	 * 15:15   (Rx indication)
++	 *
++	 */
++	__le16 sequence;
++
++	/* command data follows immediately */
++	u8 data[0];
++} __attribute__ ((packed));
++
++/******************************************************************************
++ * (0a)
++ * Alive and Error Commands & Responses:
++ *
++ *****************************************************************************/
++
++#define UCODE_VALID_OK	__constant_cpu_to_le32(0x1)
++#define INITIALIZE_SUBTYPE    (9)
++
++/*
++ * REPLY_ALIVE = 0x1 (response only, not a command)
++ */
++struct iwl_alive_resp {
++	u8 ucode_minor;
++	u8 ucode_major;
++	__le16 reserved1;
++	u8 sw_rev[8];
++	u8 ver_type;
++	u8 ver_subtype;
++	__le16 reserved2;
++	__le32 log_event_table_ptr;
++	__le32 error_event_table_ptr;
++	__le32 timestamp;
++	__le32 is_valid;
++} __attribute__ ((packed));
++
++struct iwl_init_alive_resp {
++	u8 ucode_minor;
++	u8 ucode_major;
++	__le16 reserved1;
++	u8 sw_rev[8];
++	u8 ver_type;
++	u8 ver_subtype;
++	__le16 reserved2;
++	__le32 log_event_table_ptr;
++	__le32 error_event_table_ptr;
++	__le32 timestamp;
++	__le32 is_valid;
++
++#if IWL == 4965
++	/* calibration values from "initialize" uCode */
++	__le32 voltage;		/* signed */
++	__le32 therm_r1[2];	/* signed 1st for normal, 2nd for FAT channel */
++	__le32 therm_r2[2];	/* signed */
++	__le32 therm_r3[2];	/* signed */
++	__le32 therm_r4[2];	/* signed */
++	__le32 tx_atten[5][2];	/* signed MIMO gain comp, 5 freq groups,
++				 * 2 Tx chains */
++#endif
++} __attribute__ ((packed));
++
++union tsf {
++	u8 byte[8];
++	__le16 word[4];
++	__le32 dw[2];
++};
++
++/*
++ * REPLY_ERROR = 0x2 (response only, not a command)
++ */
++struct iwl_error_resp {
++	__le32 error_type;
++	u8 cmd_id;
++	u8 reserved1;
++	__le16 bad_cmd_seq_num;
++#if IWL == 3945
++	__le16 reserved2;
++#endif
++	__le32 error_info;
++	union tsf timestamp;
++} __attribute__ ((packed));
++
++/******************************************************************************
++ * (1)
++ * RXON Commands & Responses:
++ *
++ *****************************************************************************/
++
++/*
++ * Rx config defines & structure
++ */
++/* rx_config device types  */
++enum {
++	RXON_DEV_TYPE_AP = 1,
++	RXON_DEV_TYPE_ESS = 3,
++	RXON_DEV_TYPE_IBSS = 4,
++	RXON_DEV_TYPE_SNIFFER = 6,
++};
++
++/* rx_config flags */
++/* band & modulation selection */
++#define RXON_FLG_BAND_24G_MSK           __constant_cpu_to_le32(1 << 0)
++#define RXON_FLG_CCK_MSK                __constant_cpu_to_le32(1 << 1)
++/* auto detection enable */
++#define RXON_FLG_AUTO_DETECT_MSK        __constant_cpu_to_le32(1 << 2)
++/* TGg protection when tx */
++#define RXON_FLG_TGG_PROTECT_MSK        __constant_cpu_to_le32(1 << 3)
++/* cck short slot & preamble */
++#define RXON_FLG_SHORT_SLOT_MSK          __constant_cpu_to_le32(1 << 4)
++#define RXON_FLG_SHORT_PREAMBLE_MSK     __constant_cpu_to_le32(1 << 5)
++/* antenna selection */
++#define RXON_FLG_DIS_DIV_MSK            __constant_cpu_to_le32(1 << 7)
++#define RXON_FLG_ANT_SEL_MSK            __constant_cpu_to_le32(0x0f00)
++#define RXON_FLG_ANT_A_MSK              __constant_cpu_to_le32(1 << 8)
++#define RXON_FLG_ANT_B_MSK              __constant_cpu_to_le32(1 << 9)
++/* radar detection enable */
++#define RXON_FLG_RADAR_DETECT_MSK       __constant_cpu_to_le32(1 << 12)
++#define RXON_FLG_TGJ_NARROW_BAND_MSK    __constant_cpu_to_le32(1 << 13)
++/* rx response to host with 8-byte TSF
++* (according to ON_AIR deassertion) */
++#define RXON_FLG_TSF2HOST_MSK           __constant_cpu_to_le32(1 << 15)
++
++/* rx_config filter flags */
++/* accept all data frames */
++#define RXON_FILTER_PROMISC_MSK         __constant_cpu_to_le32(1 << 0)
++/* pass control & management to host */
++#define RXON_FILTER_CTL2HOST_MSK        __constant_cpu_to_le32(1 << 1)
++/* accept multi-cast */
++#define RXON_FILTER_ACCEPT_GRP_MSK      __constant_cpu_to_le32(1 << 2)
++/* don't decrypt uni-cast frames */
++#define RXON_FILTER_DIS_DECRYPT_MSK     __constant_cpu_to_le32(1 << 3)
++/* don't decrypt multi-cast frames */
++#define RXON_FILTER_DIS_GRP_DECRYPT_MSK __constant_cpu_to_le32(1 << 4)
++/* STA is associated */
++#define RXON_FILTER_ASSOC_MSK           __constant_cpu_to_le32(1 << 5)
++/* transfer to host non bssid beacons in associated state */
++#define RXON_FILTER_BCON_AWARE_MSK      __constant_cpu_to_le32(1 << 6)
++
++/*
++ * REPLY_RXON = 0x10 (command, has simple generic response)
++ */
++struct iwl_rxon_cmd {
++	u8 node_addr[6];
++	__le16 reserved1;
++	u8 bssid_addr[6];
++	__le16 reserved2;
++	u8 wlap_bssid_addr[6];
++	__le16 reserved3;
++	u8 dev_type;
++	u8 air_propagation;
++#if IWL == 3945
++	__le16 reserved4;
++#elif IWL == 4965
++	__le16 rx_chain;
++#endif
++	u8 ofdm_basic_rates;
++	u8 cck_basic_rates;
++	__le16 assoc_id;
++	__le32 flags;
++	__le32 filter_flags;
++	__le16 channel;
++#if IWL == 3945
++	__le16 reserved5;
++#elif IWL == 4965
++	u8 ofdm_ht_single_stream_basic_rates;
++	u8 ofdm_ht_dual_stream_basic_rates;
++#endif
++} __attribute__ ((packed));
++
++/*
++ * REPLY_RXON_ASSOC = 0x11 (command, has simple generic response)
++ */
++struct iwl_rxon_assoc_cmd {
++	__le32 flags;
++	__le32 filter_flags;
++	u8 ofdm_basic_rates;
++	u8 cck_basic_rates;
++#if IWL == 4965
++	u8 ofdm_ht_single_stream_basic_rates;
++	u8 ofdm_ht_dual_stream_basic_rates;
++	__le16 rx_chain_select_flags;
++#endif
++	__le16 reserved;
++} __attribute__ ((packed));
++
++/*
++ * REPLY_RXON_TIMING = 0x14 (command, has simple generic response)
++ */
++struct iwl_rxon_time_cmd {
++	union tsf timestamp;
++	__le16 beacon_interval;
++	__le16 atim_window;
++	__le32 beacon_init_val;
++	__le16 listen_interval;
++	__le16 reserved;
++} __attribute__ ((packed));
++
++struct iwl_tx_power {
++	u8 tx_gain;		/* gain for analog radio */
++	u8 dsp_atten;		/* gain for DSP */
++} __attribute__ ((packed));
++
++#if IWL == 3945
++struct iwl_power_per_rate {
++	u8 rate;		/* plcp */
++	struct iwl_tx_power tpc;
++	u8 reserved;
++} __attribute__ ((packed));
++
++#elif IWL == 4965
++#define POWER_TABLE_NUM_ENTRIES			33
++#define POWER_TABLE_NUM_HT_OFDM_ENTRIES		32
++#define POWER_TABLE_CCK_ENTRY			32
++struct tx_power_dual_stream {
++	__le32 dw;
++} __attribute__ ((packed));
++
++struct iwl_tx_power_db {
++	struct tx_power_dual_stream power_tbl[POWER_TABLE_NUM_ENTRIES];
++} __attribute__ ((packed));
++#endif
++
++/*
++ * REPLY_CHANNEL_SWITCH = 0x72 (command, has simple generic response)
++ */
++struct iwl_channel_switch_cmd {
++	u8 band;
++	u8 expect_beacon;
++	__le16 channel;
++	__le32 rxon_flags;
++	__le32 rxon_filter_flags;
++	__le32 switch_time;
++#if IWL == 3945
++	struct iwl_power_per_rate power[IWL_MAX_RATES];
++#elif IWL == 4965
++	struct iwl_tx_power_db tx_power;
++#endif
++} __attribute__ ((packed));
++
++/*
++ * CHANNEL_SWITCH_NOTIFICATION = 0x73 (notification only, not a command)
++ */
++struct iwl_csa_notification {
++	__le16 band;
++	__le16 channel;
++	__le32 status;		/* 0 - OK, 1 - fail */
++} __attribute__ ((packed));
++
++/******************************************************************************
++ * (2)
++ * Quality-of-Service (QOS) Commands & Responses:
++ *
++ *****************************************************************************/
++struct iwl_ac_qos {
++	__le16 cw_min;
++	__le16 cw_max;
++	u8 aifsn;
++	u8 reserved1;
++	__le16 edca_txop;
++} __attribute__ ((packed));
++
++/* QoS flags defines */
++#define QOS_PARAM_FLG_UPDATE_EDCA_MSK	__constant_cpu_to_le32(0x01)
++#define QOS_PARAM_FLG_TGN_MSK		__constant_cpu_to_le32(0x02)
++#define QOS_PARAM_FLG_TXOP_TYPE_MSK	__constant_cpu_to_le32(0x10)
++
++/*
++ *  TXFIFO Queue number defines
++ */
++/* number of Access categories (AC) (EDCA), queues 0..3 */
++#define AC_NUM                4
++
++/*
++ * REPLY_QOS_PARAM = 0x13 (command, has simple generic response)
++ */
++struct iwl_qosparam_cmd {
++	__le32 qos_flags;
++	struct iwl_ac_qos ac[AC_NUM];
++} __attribute__ ((packed));
++
++/******************************************************************************
++ * (3)
++ * Add/Modify Stations Commands & Responses:
++ *
++ *****************************************************************************/
++/*
++ * Multi station support
++ */
++#define	IWL_AP_ID		0
++#define IWL_MULTICAST_ID	1
++#define	IWL_STA_ID		2
++
++#define	IWL3945_BROADCAST_ID	24
++#define IWL3945_STATION_COUNT	25
++
++#define IWL4965_BROADCAST_ID	31
++#define	IWL4965_STATION_COUNT	32
++
++#define	IWL_STATION_COUNT	32 	/* MAX(3945,4965)*/
++#define	IWL_INVALID_STATION 	255
++
++#if IWL == 3945
++#define STA_FLG_TX_RATE_MSK		__constant_cpu_to_le32(1<<2);
++#endif
++#define STA_FLG_PWR_SAVE_MSK		__constant_cpu_to_le32(1<<8);
++
++#define STA_CONTROL_MODIFY_MSK		0x01
++
++/* key flags __le16*/
++#define STA_KEY_FLG_ENCRYPT_MSK	__constant_cpu_to_le16(0x7)
++#define STA_KEY_FLG_NO_ENC	__constant_cpu_to_le16(0x0)
++#define STA_KEY_FLG_WEP		__constant_cpu_to_le16(0x1)
++#define STA_KEY_FLG_CCMP	__constant_cpu_to_le16(0x2)
++#define STA_KEY_FLG_TKIP	__constant_cpu_to_le16(0x3)
++
++#define STA_KEY_FLG_KEYID_POS	8
++#define STA_KEY_FLG_INVALID 	__constant_cpu_to_le16(0x0800)
++
++/* modify flags  */
++#define	STA_MODIFY_KEY_MASK		0x01
++#define	STA_MODIFY_TID_DISABLE_TX	0x02
++#define	STA_MODIFY_TX_RATE_MSK		0x04
++#define STA_MODIFY_ADDBA_TID_MSK	0x08
++#define STA_MODIFY_DELBA_TID_MSK	0x10
++#define BUILD_RAxTID(sta_id, tid)	(((sta_id) << 4) + (tid))
++
++/*
++ * Antenna masks:
++ * bit14:15 01 B inactive, A active
++ *          10 B active, A inactive
++ *          11 Both active
++ */
++#define RATE_MCS_ANT_A_POS	14
++#define RATE_MCS_ANT_B_POS	15
++#define RATE_MCS_ANT_A_MSK	0x4000
++#define RATE_MCS_ANT_B_MSK	0x8000
++#define RATE_MCS_ANT_AB_MSK	0xc000
++
++struct iwl_keyinfo {
++	__le16 key_flags;
++	u8 tkip_rx_tsc_byte2;	/* TSC[2] for key mix ph1 detection */
++	u8 reserved1;
++	__le16 tkip_rx_ttak[5];	/* 10-byte unicast TKIP TTAK */
++	__le16 reserved2;
++	u8 key[16];		/* 16-byte unicast decryption key */
++} __attribute__ ((packed));
++
++struct sta_id_modify {
++	u8 addr[ETH_ALEN];
++	__le16 reserved1;
++	u8 sta_id;
++	u8 modify_mask;
++	__le16 reserved2;
++} __attribute__ ((packed));
++
++/*
++ * REPLY_ADD_STA = 0x18 (command)
++ */
++struct iwl_addsta_cmd {
++	u8 mode;
++	u8 reserved[3];
++	struct sta_id_modify sta;
++	struct iwl_keyinfo key;
++	__le32 station_flags;
++	__le32 station_flags_msk;
++	__le16 tid_disable_tx;
++#if IWL == 3945
++	__le16 rate_n_flags;
++#else
++	__le16	reserved1;
++#endif
++	u8 add_immediate_ba_tid;
++	u8 remove_immediate_ba_tid;
++	__le16 add_immediate_ba_ssn;
++#if IWL == 4965
++	__le32 reserved2;
++#endif
++} __attribute__ ((packed));
++
++/*
++ * REPLY_ADD_STA = 0x18 (response)
++ */
++struct iwl_add_sta_resp {
++	u8 status;
++} __attribute__ ((packed));
++
++#define ADD_STA_SUCCESS_MSK              0x1
++
++/******************************************************************************
++ * (4)
++ * Rx Responses:
++ *
++ *****************************************************************************/
++
++struct iwl_rx_frame_stats {
++	u8 phy_count;
++	u8 id;
++	u8 rssi;
++	u8 agc;
++	__le16 sig_avg;
++	__le16 noise_diff;
++	u8 payload[0];
++} __attribute__ ((packed));
++
++struct iwl_rx_frame_hdr {
++	__le16 channel;
++	__le16 phy_flags;
++	u8 reserved1;
++	u8 rate;
++	__le16 len;
++	u8 payload[0];
++} __attribute__ ((packed));
++
++#define	RX_RES_STATUS_NO_CRC32_ERROR	__constant_cpu_to_le32(1 << 0)
++#define	RX_RES_STATUS_NO_RXE_OVERFLOW	__constant_cpu_to_le32(1 << 1)
++
++#define	RX_RES_PHY_FLAGS_BAND_24_MSK	__constant_cpu_to_le16(1 << 0)
++#define	RX_RES_PHY_FLAGS_MOD_CCK_MSK		__constant_cpu_to_le16(1 << 1)
++#define	RX_RES_PHY_FLAGS_SHORT_PREAMBLE_MSK	__constant_cpu_to_le16(1 << 2)
++#define	RX_RES_PHY_FLAGS_NARROW_BAND_MSK	__constant_cpu_to_le16(1 << 3)
++#define	RX_RES_PHY_FLAGS_ANTENNA_MSK		__constant_cpu_to_le16(0xf0)
++
++#define	RX_RES_STATUS_SEC_TYPE_MSK	(0x7 << 8)
++#define	RX_RES_STATUS_SEC_TYPE_NONE	(0x0 << 8)
++#define	RX_RES_STATUS_SEC_TYPE_WEP	(0x1 << 8)
++#define	RX_RES_STATUS_SEC_TYPE_CCMP	(0x2 << 8)
++#define	RX_RES_STATUS_SEC_TYPE_TKIP	(0x3 << 8)
++
++#define	RX_RES_STATUS_DECRYPT_TYPE_MSK	(0x3 << 11)
++#define	RX_RES_STATUS_NOT_DECRYPT	(0x0 << 11)
++#define	RX_RES_STATUS_DECRYPT_OK	(0x3 << 11)
++#define	RX_RES_STATUS_BAD_ICV_MIC	(0x1 << 11)
++#define	RX_RES_STATUS_BAD_KEY_TTAK	(0x2 << 11)
++
++struct iwl_rx_frame_end {
++	__le32 status;
++	__le64 timestamp;
++	__le32 beacon_timestamp;
++} __attribute__ ((packed));
++
++/*
++ * REPLY_3945_RX = 0x1b (response only, not a command)
++ *
++ * NOTE:  DO NOT dereference from casts to this structure
++ * It is provided only for calculating minimum data set size.
++ * The actual offsets of the hdr and end are dynamic based on
++ * stats.phy_count
++ */
++struct iwl_rx_frame {
++	struct iwl_rx_frame_stats stats;
++	struct iwl_rx_frame_hdr hdr;
++	struct iwl_rx_frame_end end;
++} __attribute__ ((packed));
++
++/* Fixed (non-configurable) rx data from phy */
++#define RX_PHY_FLAGS_ANTENNAE_OFFSET		(4)
++#define RX_PHY_FLAGS_ANTENNAE_MASK		(0x70)
++#define IWL_AGC_DB_MASK 	(0x3f80)	/* MASK(7,13) */
++#define IWL_AGC_DB_POS		(7)
++struct iwl4965_rx_non_cfg_phy {
++	__le16 ant_selection;	/* ant A bit 4, ant B bit 5, ant C bit 6 */
++	__le16 agc_info;	/* agc code 0:6, agc dB 7:13, reserved 14:15 */
++	u8 rssi_info[6];	/* we use even entries, 0/2/4 for A/B/C rssi */
++	u8 pad[0];
++} __attribute__ ((packed));
++
++/*
++ * REPLY_4965_RX = 0xc3 (response only, not a command)
++ * Used only for legacy (non 11n) frames.
++ */
++#define RX_RES_PHY_CNT 14
++struct iwl4965_rx_phy_res {
++	u8 non_cfg_phy_cnt;     /* non configurable DSP phy data byte count */
++	u8 cfg_phy_cnt;		/* configurable DSP phy data byte count */
++	u8 stat_id;		/* configurable DSP phy data set ID */
++	u8 reserved1;
++	__le64 timestamp;	/* TSF at on air rise */
++	__le32 beacon_time_stamp; /* beacon at on-air rise */
++	__le16 phy_flags;	/* general phy flags: band, modulation, ... */
++	__le16 channel;		/* channel number */
++	__le16 non_cfg_phy[RX_RES_PHY_CNT];	/* upto 14 phy entries */
++	__le32 reserved2;
++	__le32 rate_n_flags;
++	__le16 byte_count;		/* frame's byte-count */
++	__le16 reserved3;
++} __attribute__ ((packed));
++
++struct iwl4965_rx_mpdu_res_start {
++	__le16 byte_count;
++	__le16 reserved;
++} __attribute__ ((packed));
++
++
++/******************************************************************************
++ * (5)
++ * Tx Commands & Responses:
++ *
++ *****************************************************************************/
++
++/* Tx flags */
++#define TX_CMD_FLG_RTS_MSK __constant_cpu_to_le32(1 << 1)
++#define TX_CMD_FLG_CTS_MSK __constant_cpu_to_le32(1 << 2)
++#define TX_CMD_FLG_ACK_MSK __constant_cpu_to_le32(1 << 3)
++#define TX_CMD_FLG_STA_RATE_MSK __constant_cpu_to_le32(1 << 4)
++#define TX_CMD_FLG_IMM_BA_RSP_MASK  __constant_cpu_to_le32(1 << 6)
++#define TX_CMD_FLG_FULL_TXOP_PROT_MSK __constant_cpu_to_le32(1 << 7)
++#define TX_CMD_FLG_ANT_SEL_MSK __constant_cpu_to_le32(0xf00)
++#define TX_CMD_FLG_ANT_A_MSK __constant_cpu_to_le32(1 << 8)
++#define TX_CMD_FLG_ANT_B_MSK __constant_cpu_to_le32(1 << 9)
++
++/* ucode ignores BT priority for this frame */
++#define TX_CMD_FLG_BT_DIS_MSK __constant_cpu_to_le32(1 << 12)
++
++/* ucode overrides sequence control */
++#define TX_CMD_FLG_SEQ_CTL_MSK __constant_cpu_to_le32(1 << 13)
++
++/* signal that this frame is non-last MPDU */
++#define TX_CMD_FLG_MORE_FRAG_MSK __constant_cpu_to_le32(1 << 14)
++
++/* calculate TSF in outgoing frame */
++#define TX_CMD_FLG_TSF_MSK __constant_cpu_to_le32(1 << 16)
++
++/* activate TX calibration. */
++#define TX_CMD_FLG_CALIB_MSK __constant_cpu_to_le32(1 << 17)
++
++/* signals that 2 bytes pad was inserted
++   after the MAC header */
++#define TX_CMD_FLG_MH_PAD_MSK __constant_cpu_to_le32(1 << 20)
++
++/* HCCA-AP - disable duration overwriting. */
++#define TX_CMD_FLG_DUR_MSK __constant_cpu_to_le32(1 << 25)
++
++/*
++ * TX command security control
++ */
++#define TX_CMD_SEC_WEP  	0x01
++#define TX_CMD_SEC_CCM  	0x02
++#define TX_CMD_SEC_TKIP		0x03
++#define TX_CMD_SEC_MSK		0x03
++#define TX_CMD_SEC_SHIFT	6
++#define TX_CMD_SEC_KEY128	0x08
++
++/*
++ * TX command Frame life time
++ */
++
++struct iwl_dram_scratch {
++	u8 try_cnt;
++	u8 bt_kill_cnt;
++	__le16 reserved;
++} __attribute__ ((packed));
++
++/*
++ * REPLY_TX = 0x1c (command)
++ */
++struct iwl_tx_cmd {
++	__le16 len;
++	__le16 next_frame_len;
++	__le32 tx_flags;
++#if IWL == 3945
++	u8 rate;
++	u8 sta_id;
++	u8 tid_tspec;
++#elif IWL == 4965
++	struct iwl_dram_scratch scratch;
++	__le32 rate_n_flags;
++	u8 sta_id;
++#endif
++	u8 sec_ctl;
++#if IWL == 4965
++	u8 initial_rate_index;
++	u8 reserved;
++#endif
++	u8 key[16];
++#if IWL == 3945
++	union {
++		u8 byte[8];
++		__le16 word[4];
++		__le32 dw[2];
++	} tkip_mic;
++	__le32 next_frame_info;
++#elif IWL == 4965
++	__le16 next_frame_flags;
++	__le16 reserved2;
++#endif
++	union {
++		__le32 life_time;
++		__le32 attempt;
++	} stop_time;
++#if IWL == 3945
++	u8 supp_rates[2];
++#elif IWL == 4965
++	__le32 dram_lsb_ptr;
++	u8 dram_msb_ptr;
++#endif
++	u8 rts_retry_limit;	/*byte 50 */
++	u8 data_retry_limit;	/*byte 51 */
++#if IWL == 4965
++	u8 tid_tspec;
++#endif
++	union {
++		__le16 pm_frame_timeout;
++		__le16 attempt_duration;
++	} timeout;
++	__le16 driver_txop;
++	u8 payload[0];
++	struct ieee80211_hdr hdr[0];
++} __attribute__ ((packed));
++
++/* TX command response is sent after *all* transmission attempts.
++ *
++ * NOTES:
++ *
++ * TX_STATUS_FAIL_NEXT_FRAG
++ *
++ * If the fragment flag in the MAC header for the frame being transmitted
++ * is set and there is insufficient time to transmit the next frame, the
++ * TX status will be returned with 'TX_STATUS_FAIL_NEXT_FRAG'.
++ *
++ * TX_STATUS_FIFO_UNDERRUN
++ *
++ * Indicates the host did not provide bytes to the FIFO fast enough while
++ * a TX was in progress.
++ *
++ * TX_STATUS_FAIL_MGMNT_ABORT
++ *
++ * This status is only possible if the ABORT ON MGMT RX parameter was
++ * set to true with the TX command.
++ *
++ * If the MSB of the status parameter is set then an abort sequence is
++ * required.  This sequence consists of the host activating the TX Abort
++ * control line, and then waiting for the TX Abort command response.  This
++ * indicates that a the device is no longer in a transmit state, and that the
++ * command FIFO has been cleared.  The host must then deactivate the TX Abort
++ * control line.  Receiving is still allowed in this case.
++ */
++enum {
++	TX_STATUS_SUCCESS = 0x01,
++	TX_STATUS_DIRECT_DONE = 0x02,
++	TX_STATUS_FAIL_SHORT_LIMIT = 0x82,
++	TX_STATUS_FAIL_LONG_LIMIT = 0x83,
++	TX_STATUS_FAIL_FIFO_UNDERRUN = 0x84,
++	TX_STATUS_FAIL_MGMNT_ABORT = 0x85,
++	TX_STATUS_FAIL_NEXT_FRAG = 0x86,
++	TX_STATUS_FAIL_LIFE_EXPIRE = 0x87,
++	TX_STATUS_FAIL_DEST_PS = 0x88,
++	TX_STATUS_FAIL_ABORTED = 0x89,
++	TX_STATUS_FAIL_BT_RETRY = 0x8a,
++	TX_STATUS_FAIL_STA_INVALID = 0x8b,
++	TX_STATUS_FAIL_FRAG_DROPPED = 0x8c,
++	TX_STATUS_FAIL_TID_DISABLE = 0x8d,
++	TX_STATUS_FAIL_FRAME_FLUSHED = 0x8e,
++	TX_STATUS_FAIL_INSUFFICIENT_CF_POLL = 0x8f,
++	TX_STATUS_FAIL_TX_LOCKED = 0x90,
++	TX_STATUS_FAIL_NO_BEACON_ON_RADAR = 0x91,
++};
++
++#define	TX_PACKET_MODE_REGULAR		0x0000
++#define	TX_PACKET_MODE_BURST_SEQ	0x0100
++#define	TX_PACKET_MODE_BURST_FIRST	0x0200
++
++enum {
++	TX_POWER_PA_NOT_ACTIVE = 0x0,
++};
++
++enum {
++	TX_STATUS_MSK = 0x000000ff,	/* bits 0:7 */
++	TX_STATUS_DELAY_MSK = 0x00000040,
++	TX_STATUS_ABORT_MSK = 0x00000080,
++	TX_PACKET_MODE_MSK = 0x0000ff00,	/* bits 8:15 */
++	TX_FIFO_NUMBER_MSK = 0x00070000,	/* bits 16:18 */
++	TX_RESERVED = 0x00780000,	/* bits 19:22 */
++	TX_POWER_PA_DETECT_MSK = 0x7f800000,	/* bits 23:30 */
++	TX_ABORT_REQUIRED_MSK = 0x80000000,	/* bits 31:31 */
++};
++
++/* *******************************
++ * TX aggregation state
++ ******************************* */
++
++enum {
++	AGG_TX_STATE_TRANSMITTED = 0x00,
++	AGG_TX_STATE_UNDERRUN_MSK = 0x01,
++	AGG_TX_STATE_BT_PRIO_MSK = 0x02,
++	AGG_TX_STATE_FEW_BYTES_MSK = 0x04,
++	AGG_TX_STATE_ABORT_MSK = 0x08,
++	AGG_TX_STATE_LAST_SENT_TTL_MSK = 0x10,
++	AGG_TX_STATE_LAST_SENT_TRY_CNT_MSK = 0x20,
++	AGG_TX_STATE_LAST_SENT_BT_KILL_MSK = 0x40,
++	AGG_TX_STATE_SCD_QUERY_MSK = 0x80,
++	AGG_TX_STATE_TEST_BAD_CRC32_MSK = 0x100,
++	AGG_TX_STATE_RESPONSE_MSK = 0x1ff,
++	AGG_TX_STATE_DUMP_TX_MSK = 0x200,
++	AGG_TX_STATE_DELAY_TX_MSK = 0x400
++};
++
++#define AGG_TX_STATE_LAST_SENT_MSK \
++(AGG_TX_STATE_LAST_SENT_TTL_MSK | \
++ AGG_TX_STATE_LAST_SENT_TRY_CNT_MSK | \
++ AGG_TX_STATE_LAST_SENT_BT_KILL_MSK)
++
++#define AGG_TX_STATE_TRY_CNT_POS 12
++#define AGG_TX_STATE_TRY_CNT_MSK 0xf000
++
++#define AGG_TX_STATE_SEQ_NUM_POS 16
++#define AGG_TX_STATE_SEQ_NUM_MSK 0xffff0000
++
++/*
++ * REPLY_TX = 0x1c (response)
++ */
++#if IWL == 4965
++struct iwl_tx_resp {
++	u8 frame_count;		/* 1 no aggregation, >1 aggregation */
++	u8 bt_kill_count;
++	u8 failure_rts;
++	u8 failure_frame;
++	__le32 rate_n_flags;
++	__le16 wireless_media_time;
++	__le16 reserved;
++	__le32 pa_power1;
++	__le32 pa_power2;
++	__le32 status;	/* TX status (for aggregation status of 1st frame) */
++} __attribute__ ((packed));
++
++#elif IWL == 3945
++struct iwl_tx_resp {
++	u8 failure_rts;
++	u8 failure_frame;
++	u8 bt_kill_count;
++	u8 rate;
++	__le32 wireless_media_time;
++	__le32 status;	/* TX status (for aggregation status of 1st frame) */
++} __attribute__ ((packed));
++#endif
++
++/*
++ * REPLY_COMPRESSED_BA = 0xc5 (response only, not a command)
++ */
++struct iwl_compressed_ba_resp {
++	__le32 sta_addr_lo32;
++	__le16 sta_addr_hi16;
++	__le16 reserved;
++	u8 sta_id;
++	u8 tid;
++	__le16 ba_seq_ctl;
++	__le32 ba_bitmap0;
++	__le32 ba_bitmap1;
++	__le16 scd_flow;
++	__le16 scd_ssn;
++} __attribute__ ((packed));
++
++/*
++ * REPLY_TX_PWR_TABLE_CMD = 0x97 (command, has simple generic response)
++ */
++struct iwl_txpowertable_cmd {
++	u8 band;		/* 0: 5 GHz, 1: 2.4 GHz */
++	u8 reserved;
++	__le16 channel;
++#if IWL == 3945
++	struct iwl_power_per_rate power[IWL_MAX_RATES];
++#elif IWL == 4965
++	struct iwl_tx_power_db tx_power;
++#endif
++} __attribute__ ((packed));
++
++#if IWL == 3945
++struct iwl_rate_scaling_info {
++	__le16 rate_n_flags;
++	u8 try_cnt;
++	u8 next_rate_index;
++} __attribute__ ((packed));
++
++/**
++ * struct iwl_rate_scaling_cmd - Rate Scaling Command & Response
++ *
++ * REPLY_RATE_SCALE = 0x47 (command, has simple generic response)
++ *
++ * NOTE: The table of rates passed to the uCode via the
++ * RATE_SCALE command sets up the corresponding order of
++ * rates used for all related commands, including rate
++ * masks, etc.
++ *
++ * For example, if you set 9MB (PLCP 0x0f) as the first
++ * rate in the rate table, the bit mask for that rate
++ * when passed through ofdm_basic_rates on the REPLY_RXON
++ * command would be bit 0 (1<<0)
++ */
++struct iwl_rate_scaling_cmd {
++	u8 table_id;
++	u8 reserved[3];
++	struct iwl_rate_scaling_info table[IWL_MAX_RATES];
++} __attribute__ ((packed));
++
++#elif IWL == 4965
++
++/*RS_NEW_API: only TLC_RTS remains and moved to bit 0 */
++#define  LINK_QUAL_FLAGS_SET_STA_TLC_RTS_MSK	(1<<0)
++
++#define  LINK_QUAL_AC_NUM AC_NUM
++#define  LINK_QUAL_MAX_RETRY_NUM 16
++
++#define  LINK_QUAL_ANT_A_MSK (1<<0)
++#define  LINK_QUAL_ANT_B_MSK (1<<1)
++#define  LINK_QUAL_ANT_MSK   (LINK_QUAL_ANT_A_MSK|LINK_QUAL_ANT_B_MSK)
++
++struct iwl_link_qual_general_params {
++	u8 flags;
++	u8 mimo_delimiter;
++	u8 single_stream_ant_msk;
++	u8 dual_stream_ant_msk;
++	u8 start_rate_index[LINK_QUAL_AC_NUM];
++} __attribute__ ((packed));
++
++struct iwl_link_qual_agg_params {
++	__le16 agg_time_limit;
++	u8 agg_dis_start_th;
++	u8 agg_frame_cnt_limit;
++	__le32 reserved;
++} __attribute__ ((packed));
++
++/*
++ * REPLY_TX_LINK_QUALITY_CMD = 0x4e (command, has simple generic response)
++ */
++struct iwl_link_quality_cmd {
++	u8 sta_id;
++	u8 reserved1;
++	__le16 control;
++	struct iwl_link_qual_general_params general_params;
++	struct iwl_link_qual_agg_params agg_params;
++	struct {
++		__le32 rate_n_flags;
++	} rs_table[LINK_QUAL_MAX_RETRY_NUM];
++	__le32 reserved2;
++} __attribute__ ((packed));
++#endif
++
++/*
++ * REPLY_BT_CONFIG = 0x9b (command, has simple generic response)
++ */
++struct iwl_bt_cmd {
++	u8 flags;
++	u8 lead_time;
++	u8 max_kill;
++	u8 reserved;
++	__le32 kill_ack_mask;
++	__le32 kill_cts_mask;
++} __attribute__ ((packed));
++
++/******************************************************************************
++ * (6)
++ * Spectrum Management (802.11h) Commands, Responses, Notifications:
++ *
++ *****************************************************************************/
++
++/*
++ * Spectrum Management
++ */
++#define MEASUREMENT_FILTER_FLAG (RXON_FILTER_PROMISC_MSK         | \
++				 RXON_FILTER_CTL2HOST_MSK        | \
++				 RXON_FILTER_ACCEPT_GRP_MSK      | \
++				 RXON_FILTER_DIS_DECRYPT_MSK     | \
++				 RXON_FILTER_DIS_GRP_DECRYPT_MSK | \
++				 RXON_FILTER_ASSOC_MSK           | \
++				 RXON_FILTER_BCON_AWARE_MSK)
++
++struct iwl_measure_channel {
++	__le32 duration;	/* measurement duration in extended beacon
++				 * format */
++	u8 channel;		/* channel to measure */
++	u8 type;		/* see enum iwl_measure_type */
++	__le16 reserved;
++} __attribute__ ((packed));
++
++/*
++ * REPLY_SPECTRUM_MEASUREMENT_CMD = 0x74 (command)
++ */
++struct iwl_spectrum_cmd {
++	__le16 len;		/* number of bytes starting from token */
++	u8 token;		/* token id */
++	u8 id;			/* measurement id -- 0 or 1 */
++	u8 origin;		/* 0 = TGh, 1 = other, 2 = TGk */
++	u8 periodic;		/* 1 = periodic */
++	__le16 path_loss_timeout;
++	__le32 start_time;	/* start time in extended beacon format */
++	__le32 reserved2;
++	__le32 flags;		/* rxon flags */
++	__le32 filter_flags;	/* rxon filter flags */
++	__le16 channel_count;	/* minimum 1, maximum 10 */
++	__le16 reserved3;
++	struct iwl_measure_channel channels[10];
++} __attribute__ ((packed));
++
++/*
++ * REPLY_SPECTRUM_MEASUREMENT_CMD = 0x74 (response)
++ */
++struct iwl_spectrum_resp {
++	u8 token;
++	u8 id;			/* id of the prior command replaced, or 0xff */
++	__le16 status;		/* 0 - command will be handled
++				 * 1 - cannot handle (conflicts with another
++				 *     measurement) */
++} __attribute__ ((packed));
++
++enum iwl_measurement_state {
++	IWL_MEASUREMENT_START = 0,
++	IWL_MEASUREMENT_STOP = 1,
++};
++
++enum iwl_measurement_status {
++	IWL_MEASUREMENT_OK = 0,
++	IWL_MEASUREMENT_CONCURRENT = 1,
++	IWL_MEASUREMENT_CSA_CONFLICT = 2,
++	IWL_MEASUREMENT_TGH_CONFLICT = 3,
++	/* 4-5 reserved */
++	IWL_MEASUREMENT_STOPPED = 6,
++	IWL_MEASUREMENT_TIMEOUT = 7,
++	IWL_MEASUREMENT_PERIODIC_FAILED = 8,
++};
++
++#define NUM_ELEMENTS_IN_HISTOGRAM 8
++
++struct iwl_measurement_histogram {
++	__le32 ofdm[NUM_ELEMENTS_IN_HISTOGRAM];	/* in 0.8usec counts */
++	__le32 cck[NUM_ELEMENTS_IN_HISTOGRAM];	/* in 1usec counts */
++} __attribute__ ((packed));
++
++/* clear channel availability counters */
++struct iwl_measurement_cca_counters {
++	__le32 ofdm;
++	__le32 cck;
++} __attribute__ ((packed));
++
++enum iwl_measure_type {
++	IWL_MEASURE_BASIC = (1 << 0),
++	IWL_MEASURE_CHANNEL_LOAD = (1 << 1),
++	IWL_MEASURE_HISTOGRAM_RPI = (1 << 2),
++	IWL_MEASURE_HISTOGRAM_NOISE = (1 << 3),
++	IWL_MEASURE_FRAME = (1 << 4),
++	/* bits 5:6 are reserved */
++	IWL_MEASURE_IDLE = (1 << 7),
++};
++
++/*
++ * SPECTRUM_MEASURE_NOTIFICATION = 0x75 (notification only, not a command)
++ */
++struct iwl_spectrum_notification {
++	u8 id;			/* measurement id -- 0 or 1 */
++	u8 token;
++	u8 channel_index;	/* index in measurement channel list */
++	u8 state;		/* 0 - start, 1 - stop */
++	__le32 start_time;	/* lower 32-bits of TSF */
++	u8 band;		/* 0 - 5.2GHz, 1 - 2.4GHz */
++	u8 channel;
++	u8 type;		/* see enum iwl_measurement_type */
++	u8 reserved1;
++	/* NOTE:  cca_ofdm, cca_cck, basic_type, and histogram are only only
++	 * valid if applicable for measurement type requested. */
++	__le32 cca_ofdm;	/* cca fraction time in 40Mhz clock periods */
++	__le32 cca_cck;		/* cca fraction time in 44Mhz clock periods */
++	__le32 cca_time;	/* channel load time in usecs */
++	u8 basic_type;		/* 0 - bss, 1 - ofdm preamble, 2 -
++				 * unidentified */
++	u8 reserved2[3];
++	struct iwl_measurement_histogram histogram;
++	__le32 stop_time;	/* lower 32-bits of TSF */
++	__le32 status;		/* see iwl_measurement_status */
++} __attribute__ ((packed));
++
++/******************************************************************************
++ * (7)
++ * Power Management Commands, Responses, Notifications:
++ *
++ *****************************************************************************/
++
++/**
++ * struct iwl_powertable_cmd - Power Table Command
++ * @flags: See below:
++ *
++ * POWER_TABLE_CMD = 0x77 (command, has simple generic response)
++ *
++ * PM allow:
++ *   bit 0 - '0' Driver not allow power management
++ *           '1' Driver allow PM (use rest of parameters)
++ * uCode send sleep notifications:
++ *   bit 1 - '0' Don't send sleep notification
++ *           '1' send sleep notification (SEND_PM_NOTIFICATION)
++ * Sleep over DTIM
++ *   bit 2 - '0' PM have to walk up every DTIM
++ *           '1' PM could sleep over DTIM till listen Interval.
++ * PCI power managed
++ *   bit 3 - '0' (PCI_LINK_CTRL & 0x1)
++ *           '1' !(PCI_LINK_CTRL & 0x1)
++ * Force sleep Modes
++ *   bit 31/30- '00' use both mac/xtal sleeps
++ *              '01' force Mac sleep
++ *              '10' force xtal sleep
++ *              '11' Illegal set
++ *
++ * NOTE: if sleep_interval[SLEEP_INTRVL_TABLE_SIZE-1] > DTIM period then
++ * ucode assume sleep over DTIM is allowed and we don't need to wakeup
++ * for every DTIM.
++ */
++#define IWL_POWER_VEC_SIZE 5
++
++
++#if IWL == 3945
++
++#define IWL_POWER_DRIVER_ALLOW_SLEEP_MSK	__constant_cpu_to_le32(1<<0)
++#define IWL_POWER_SLEEP_OVER_DTIM_MSK		__constant_cpu_to_le32(1<<2)
++#define IWL_POWER_PCI_PM_MSK			__constant_cpu_to_le32(1<<3)
++struct iwl_powertable_cmd {
++	__le32 flags;
++	__le32 rx_data_timeout;
++	__le32 tx_data_timeout;
++	__le32 sleep_interval[IWL_POWER_VEC_SIZE];
++} __attribute__((packed));
++
++#elif IWL == 4965
++
++#define IWL_POWER_DRIVER_ALLOW_SLEEP_MSK	__constant_cpu_to_le16(1<<0)
++#define IWL_POWER_SLEEP_OVER_DTIM_MSK		__constant_cpu_to_le16(1<<2)
++#define IWL_POWER_PCI_PM_MSK			__constant_cpu_to_le16(1<<3)
++
++struct iwl_powertable_cmd {
++	__le16 flags;
++	u8 keep_alive_seconds;
++	u8 debug_flags;
++	__le32 rx_data_timeout;
++	__le32 tx_data_timeout;
++	__le32 sleep_interval[IWL_POWER_VEC_SIZE];
++	__le32 keep_alive_beacons;
++} __attribute__ ((packed));
++#endif
++
++/*
++ * PM_SLEEP_NOTIFICATION = 0x7A (notification only, not a command)
++ * 3945 and 4965 identical.
++ */
++struct iwl_sleep_notification {
++	u8 pm_sleep_mode;
++	u8 pm_wakeup_src;
++	__le16 reserved;
++	__le32 sleep_time;
++	__le32 tsf_low;
++	__le32 bcon_timer;
++} __attribute__ ((packed));
++
++/* Sleep states.  3945 and 4965 identical. */
++enum {
++	IWL_PM_NO_SLEEP = 0,
++	IWL_PM_SLP_MAC = 1,
++	IWL_PM_SLP_FULL_MAC_UNASSOCIATE = 2,
++	IWL_PM_SLP_FULL_MAC_CARD_STATE = 3,
++	IWL_PM_SLP_PHY = 4,
++	IWL_PM_SLP_REPENT = 5,
++	IWL_PM_WAKEUP_BY_TIMER = 6,
++	IWL_PM_WAKEUP_BY_DRIVER = 7,
++	IWL_PM_WAKEUP_BY_RFKILL = 8,
++	/* 3 reserved */
++	IWL_PM_NUM_OF_MODES = 12,
++};
++
++/*
++ * REPLY_CARD_STATE_CMD = 0xa0 (command, has simple generic response)
++ */
++#define CARD_STATE_CMD_DISABLE 0x00	/* Put card to sleep */
++#define CARD_STATE_CMD_ENABLE  0x01	/* Wake up card */
++#define CARD_STATE_CMD_HALT    0x02	/* Power down permanently */
++struct iwl_card_state_cmd {
++	__le32 status;		/* CARD_STATE_CMD_* request new power state */
++} __attribute__ ((packed));
++
++/*
++ * CARD_STATE_NOTIFICATION = 0xa1 (notification only, not a command)
++ */
++struct iwl_card_state_notif {
++	__le32 flags;
++} __attribute__ ((packed));
++
++#define HW_CARD_DISABLED   0x01
++#define SW_CARD_DISABLED   0x02
++#define RF_CARD_DISABLED   0x04
++#define RXON_CARD_DISABLED 0x10
++
++struct iwl_ct_kill_config {
++	__le32   reserved;
++	__le32   critical_temperature_M;
++	__le32   critical_temperature_R;
++}  __attribute__ ((packed));
++
++/******************************************************************************
++ * (8)
++ * Scan Commands, Responses, Notifications:
++ *
++ *****************************************************************************/
++
++struct iwl_scan_channel {
++	/* type is defined as:
++	 * 0:0 active (0 - passive)
++	 * 1:4 SSID direct
++	 *     If 1 is set then corresponding SSID IE is transmitted in probe
++	 * 5:7 reserved
++	 */
++	u8 type;
++	u8 channel;
++	struct iwl_tx_power tpc;
++	__le16 active_dwell;
++	__le16 passive_dwell;
++} __attribute__ ((packed));
++
++struct iwl_ssid_ie {
++	u8 id;
++	u8 len;
++	u8 ssid[32];
++} __attribute__ ((packed));
++
++#define PROBE_OPTION_MAX        0x4
++#define TX_CMD_LIFE_TIME_INFINITE	__constant_cpu_to_le32(0xFFFFFFFF)
++#define IWL_GOOD_CRC_TH		__constant_cpu_to_le16(1)
++#define IWL_MAX_SCAN_SIZE 1024
++
++/*
++ * REPLY_SCAN_CMD = 0x80 (command)
++ */
++struct iwl_scan_cmd {
++	__le16 len;
++	u8 reserved0;
++	u8 channel_count;
++	__le16 quiet_time;     /* dwell only this long on quiet chnl
++				* (active scan) */
++	__le16 quiet_plcp_th;  /* quiet chnl is < this # pkts (typ. 1) */
++	__le16 good_CRC_th;    /* passive -> active promotion threshold */
++#if IWL == 3945
++	__le16 reserved1;
++#elif IWL == 4965
++	__le16 rx_chain;
++#endif
++	__le32 max_out_time;   /* max usec to be out of associated (service)
++				* chnl */
++	__le32 suspend_time;   /* pause scan this long when returning to svc
++				* chnl.
++				* 3945 -- 31:24 # beacons, 19:0 additional usec,
++				* 4965 -- 31:22 # beacons, 21:0 additional usec.
++				*/
++	__le32 flags;
++	__le32 filter_flags;
++
++	struct iwl_tx_cmd tx_cmd;
++	struct iwl_ssid_ie direct_scan[PROBE_OPTION_MAX];
++
++	u8 data[0];
++	/*
++	 * The channels start after the probe request payload and are of type:
++	 *
++	 * struct iwl_scan_channel channels[0];
++	 *
++	 * NOTE:  Only one band of channels can be scanned per pass.  You
++	 * can not mix 2.4GHz channels and 5.2GHz channels and must
++	 * request a scan multiple times (not concurrently)
++	 *
++	 */
++} __attribute__ ((packed));
++
++/* Can abort will notify by complete notification with abort status. */
++#define CAN_ABORT_STATUS	__constant_cpu_to_le32(0x1)
++/* complete notification statuses */
++#define ABORT_STATUS            0x2
++
++/*
++ * REPLY_SCAN_CMD = 0x80 (response)
++ */
++struct iwl_scanreq_notification {
++	__le32 status;		/* 1: okay, 2: cannot fulfill request */
++} __attribute__ ((packed));
++
++/*
++ * SCAN_START_NOTIFICATION = 0x82 (notification only, not a command)
++ */
++struct iwl_scanstart_notification {
++	__le32 tsf_low;
++	__le32 tsf_high;
++	__le32 beacon_timer;
++	u8 channel;
++	u8 band;
++	u8 reserved[2];
++	__le32 status;
++} __attribute__ ((packed));
++
++#define  SCAN_OWNER_STATUS 0x1;
++#define  MEASURE_OWNER_STATUS 0x2;
++
++#define NUMBER_OF_STATISTICS 1	/* first __le32 is good CRC */
++/*
++ * SCAN_RESULTS_NOTIFICATION = 0x83 (notification only, not a command)
++ */
++struct iwl_scanresults_notification {
++	u8 channel;
++	u8 band;
++	u8 reserved[2];
++	__le32 tsf_low;
++	__le32 tsf_high;
++	__le32 statistics[NUMBER_OF_STATISTICS];
++} __attribute__ ((packed));
++
++/*
++ * SCAN_COMPLETE_NOTIFICATION = 0x84 (notification only, not a command)
++ */
++struct iwl_scancomplete_notification {
++	u8 scanned_channels;
++	u8 status;
++	u8 reserved;
++	u8 last_channel;
++	__le32 tsf_low;
++	__le32 tsf_high;
++} __attribute__ ((packed));
++
++
++/******************************************************************************
++ * (9)
++ * IBSS/AP Commands and Notifications:
++ *
++ *****************************************************************************/
++
++/*
++ * BEACON_NOTIFICATION = 0x90 (notification only, not a command)
++ */
++struct iwl_beacon_notif {
++	struct iwl_tx_resp beacon_notify_hdr;
++	__le32 low_tsf;
++	__le32 high_tsf;
++	__le32 ibss_mgr_status;
++} __attribute__ ((packed));
++
++/*
++ * REPLY_TX_BEACON = 0x91 (command, has simple generic response)
++ */
++struct iwl_tx_beacon_cmd {
++	struct iwl_tx_cmd tx;
++	__le16 tim_idx;
++	u8 tim_size;
++	u8 reserved1;
++	struct ieee80211_hdr frame[0];	/* beacon frame */
++} __attribute__ ((packed));
++
++/******************************************************************************
++ * (10)
++ * Statistics Commands and Notifications:
++ *
++ *****************************************************************************/
++
++#define IWL_TEMP_CONVERT 260
++
++#define SUP_RATE_11A_MAX_NUM_CHANNELS  8
++#define SUP_RATE_11B_MAX_NUM_CHANNELS  4
++#define SUP_RATE_11G_MAX_NUM_CHANNELS  12
++
++/* Used for passing to driver number of successes and failures per rate */
++struct rate_histogram {
++	union {
++		__le32 a[SUP_RATE_11A_MAX_NUM_CHANNELS];
++		__le32 b[SUP_RATE_11B_MAX_NUM_CHANNELS];
++		__le32 g[SUP_RATE_11G_MAX_NUM_CHANNELS];
++	} success;
++	union {
++		__le32 a[SUP_RATE_11A_MAX_NUM_CHANNELS];
++		__le32 b[SUP_RATE_11B_MAX_NUM_CHANNELS];
++		__le32 g[SUP_RATE_11G_MAX_NUM_CHANNELS];
++	} failed;
++} __attribute__ ((packed));
++
++/* statistics command response */
++
++struct statistics_rx_phy {
++	__le32 ina_cnt;
++	__le32 fina_cnt;
++	__le32 plcp_err;
++	__le32 crc32_err;
++	__le32 overrun_err;
++	__le32 early_overrun_err;
++	__le32 crc32_good;
++	__le32 false_alarm_cnt;
++	__le32 fina_sync_err_cnt;
++	__le32 sfd_timeout;
++	__le32 fina_timeout;
++	__le32 unresponded_rts;
++	__le32 rxe_frame_limit_overrun;
++	__le32 sent_ack_cnt;
++	__le32 sent_cts_cnt;
++#if IWL == 4965
++	__le32 sent_ba_rsp_cnt;
++	__le32 dsp_self_kill;
++	__le32 mh_format_err;
++	__le32 re_acq_main_rssi_sum;
++	__le32 reserved3;
++#endif
++} __attribute__ ((packed));
++
++#if IWL == 4965
++struct statistics_rx_ht_phy {
++	__le32 plcp_err;
++	__le32 overrun_err;
++	__le32 early_overrun_err;
++	__le32 crc32_good;
++	__le32 crc32_err;
++	__le32 mh_format_err;
++	__le32 agg_crc32_good;
++	__le32 agg_mpdu_cnt;
++	__le32 agg_cnt;
++	__le32 reserved2;
++} __attribute__ ((packed));
++#endif
++
++struct statistics_rx_non_phy {
++	__le32 bogus_cts;	/* CTS received when not expecting CTS */
++	__le32 bogus_ack;	/* ACK received when not expecting ACK */
++	__le32 non_bssid_frames;	/* number of frames with BSSID that
++					 * doesn't belong to the STA BSSID */
++	__le32 filtered_frames;	/* count frames that were dumped in the
++				 * filtering process */
++	__le32 non_channel_beacons;	/* beacons with our bss id but not on
++					 * our serving channel */
++#if IWL == 4965
++	__le32 channel_beacons;	/* beacons with our bss id and in our
++				 * serving channel */
++	__le32 num_missed_bcon;	/* number of missed beacons */
++	__le32 adc_rx_saturation_time;	/* count in 0.8us units the time the
++					 * ADC was in saturation */
++	__le32 ina_detection_search_time;/* total time (in 0.8us) searched
++					  * for INA */
++	__le32 beacon_silence_rssi_a;	/* RSSI silence after beacon frame */
++	__le32 beacon_silence_rssi_b;	/* RSSI silence after beacon frame */
++	__le32 beacon_silence_rssi_c;	/* RSSI silence after beacon frame */
++	__le32 interference_data_flag;	/* flag for interference data
++					 * availability. 1 when data is
++					 * available. */
++	__le32 channel_load;	/* counts RX Enable time */
++	__le32 dsp_false_alarms;	/* DSP false alarm (both OFDM
++					 * and CCK) counter */
++	__le32 beacon_rssi_a;
++	__le32 beacon_rssi_b;
++	__le32 beacon_rssi_c;
++	__le32 beacon_energy_a;
++	__le32 beacon_energy_b;
++	__le32 beacon_energy_c;
++#endif
++} __attribute__ ((packed));
++
++struct statistics_rx {
++	struct statistics_rx_phy ofdm;
++	struct statistics_rx_phy cck;
++	struct statistics_rx_non_phy general;
++#if IWL == 4965
++	struct statistics_rx_ht_phy ofdm_ht;
++#endif
++} __attribute__ ((packed));
++
++#if IWL == 4965
++struct statistics_tx_non_phy_agg {
++	__le32 ba_timeout;
++	__le32 ba_reschedule_frames;
++	__le32 scd_query_agg_frame_cnt;
++	__le32 scd_query_no_agg;
++	__le32 scd_query_agg;
++	__le32 scd_query_mismatch;
++	__le32 frame_not_ready;
++	__le32 underrun;
++	__le32 bt_prio_kill;
++	__le32 rx_ba_rsp_cnt;
++	__le32 reserved2;
++	__le32 reserved3;
++} __attribute__ ((packed));
++#endif
++
++struct statistics_tx {
++	__le32 preamble_cnt;
++	__le32 rx_detected_cnt;
++	__le32 bt_prio_defer_cnt;
++	__le32 bt_prio_kill_cnt;
++	__le32 few_bytes_cnt;
++	__le32 cts_timeout;
++	__le32 ack_timeout;
++	__le32 expected_ack_cnt;
++	__le32 actual_ack_cnt;
++#if IWL == 4965
++	__le32 dump_msdu_cnt;
++	__le32 burst_abort_next_frame_mismatch_cnt;
++	__le32 burst_abort_missing_next_frame_cnt;
++	__le32 cts_timeout_collision;
++	__le32 ack_or_ba_timeout_collision;
++	struct statistics_tx_non_phy_agg agg;
++#endif
++} __attribute__ ((packed));
++
++struct statistics_dbg {
++	__le32 burst_check;
++	__le32 burst_count;
++	__le32 reserved[4];
++} __attribute__ ((packed));
++
++struct statistics_div {
++	__le32 tx_on_a;
++	__le32 tx_on_b;
++	__le32 exec_time;
++	__le32 probe_time;
++#if IWL == 4965
++	__le32 reserved1;
++	__le32 reserved2;
++#endif
++} __attribute__ ((packed));
++
++struct statistics_general {
++	__le32 temperature;
++#if IWL == 4965
++	__le32 temperature_m;
++#endif
++	struct statistics_dbg dbg;
++	__le32 sleep_time;
++	__le32 slots_out;
++	__le32 slots_idle;
++	__le32 ttl_timestamp;
++	struct statistics_div div;
++#if IWL == 4965
++	__le32 rx_enable_counter;
++	__le32 reserved1;
++	__le32 reserved2;
++	__le32 reserved3;
++#endif
++} __attribute__ ((packed));
++
++/*
++ * REPLY_STATISTICS_CMD = 0x9c,
++ * 3945 and 4965 identical.
++ *
++ * This command triggers an immediate response containing uCode statistics.
++ * The response is in the same format as STATISTICS_NOTIFICATION 0x9d, below.
++ *
++ * If the CLEAR_STATS configuration flag is set, uCode will clear its
++ * internal copy of the statistics (counters) after issuing the response.
++ * This flag does not affect STATISTICS_NOTIFICATIONs after beacons (see below).
++ *
++ * If the DISABLE_NOTIF configuration flag is set, uCode will not issue
++ * STATISTICS_NOTIFICATIONs after received beacons (see below).  This flag
++ * does not affect the response to the REPLY_STATISTICS_CMD 0x9c itself.
++ */
++#define IWL_STATS_CONF_CLEAR_STATS __constant_cpu_to_le32(0x1)	/* see above */
++#define IWL_STATS_CONF_DISABLE_NOTIF __constant_cpu_to_le32(0x2)/* see above */
++struct iwl_statistics_cmd {
++	__le32 configuration_flags;	/* IWL_STATS_CONF_* */
++} __attribute__ ((packed));
++
++/*
++ * STATISTICS_NOTIFICATION = 0x9d (notification only, not a command)
++ *
++ * By default, uCode issues this notification after receiving a beacon
++ * while associated.  To disable this behavior, set DISABLE_NOTIF flag in the
++ * REPLY_STATISTICS_CMD 0x9c, above.
++ *
++ * Statistics counters continue to increment beacon after beacon, but are
++ * cleared when changing channels or when driver issues REPLY_STATISTICS_CMD
++ * 0x9c with CLEAR_STATS bit set (see above).
++ *
++ * uCode also issues this notification during scans.  uCode clears statistics
++ * appropriately so that each notification contains statistics for only the
++ * one channel that has just been scanned.
++ */
++#define STATISTICS_REPLY_FLG_BAND_24G_MSK         __constant_cpu_to_le32(0x2)
++#define STATISTICS_REPLY_FLG_FAT_MODE_MSK         __constant_cpu_to_le32(0x8)
++struct iwl_notif_statistics {
++	__le32 flag;
++	struct statistics_rx rx;
++	struct statistics_tx tx;
++	struct statistics_general general;
++} __attribute__ ((packed));
++
++
++/*
++ * MISSED_BEACONS_NOTIFICATION = 0xa2 (notification only, not a command)
++ */
++/* if ucode missed CONSECUTIVE_MISSED_BCONS_TH beacons in a row,
++ * then this notification will be sent. */
++#define CONSECUTIVE_MISSED_BCONS_TH 20
++
++struct iwl_missed_beacon_notif {
++	__le32 consequtive_missed_beacons;
++	__le32 total_missed_becons;
++	__le32 num_expected_beacons;
++	__le32 num_recvd_beacons;
++} __attribute__ ((packed));
++
++/******************************************************************************
++ * (11)
++ * Rx Calibration Commands:
++ *
++ *****************************************************************************/
++
++#define PHY_CALIBRATE_DIFF_GAIN_CMD (7)
++#define HD_TABLE_SIZE  (11)
++
++struct iwl_sensitivity_cmd {
++	__le16 control;
++	__le16 table[HD_TABLE_SIZE];
++} __attribute__ ((packed));
++
++struct iwl_calibration_cmd {
++	u8 opCode;
++	u8 flags;
++	__le16 reserved;
++	s8 diff_gain_a;
++	s8 diff_gain_b;
++	s8 diff_gain_c;
++	u8 reserved1;
++} __attribute__ ((packed));
++
++/******************************************************************************
++ * (12)
++ * Miscellaneous Commands:
++ *
++ *****************************************************************************/
++
++/*
++ * LEDs Command & Response
++ * REPLY_LEDS_CMD = 0x48 (command, has simple generic response)
++ *
++ * For each of 3 possible LEDs (Activity/Link/Tech, selected by "id" field),
++ * this command turns it on or off, or sets up a periodic blinking cycle.
++ */
++struct iwl_led_cmd {
++	__le32 interval;	/* "interval" in uSec */
++	u8 id;			/* 1: Activity, 2: Link, 3: Tech */
++	u8 off;			/* # intervals off while blinking;
++				 * "0", with >0 "on" value, turns LED on */
++	u8 on;			/* # intervals on while blinking;
++				 * "0", regardless of "off", turns LED off */
++	u8 reserved;
++} __attribute__ ((packed));
++
++/******************************************************************************
++ * (13)
++ * Union of all expected notifications/responses:
++ *
++ *****************************************************************************/
++
++struct iwl_rx_packet {
++	__le32 len;
++	struct iwl_cmd_header hdr;
++	union {
++		struct iwl_alive_resp alive_frame;
++		struct iwl_rx_frame rx_frame;
++		struct iwl_tx_resp tx_resp;
++		struct iwl_spectrum_notification spectrum_notif;
++		struct iwl_csa_notification csa_notif;
++		struct iwl_error_resp err_resp;
++		struct iwl_card_state_notif card_state_notif;
++		struct iwl_beacon_notif beacon_status;
++		struct iwl_add_sta_resp add_sta;
++		struct iwl_sleep_notification sleep_notif;
++		struct iwl_spectrum_resp spectrum;
++		struct iwl_notif_statistics stats;
++#if IWL == 4965
++		struct iwl_compressed_ba_resp compressed_ba;
++		struct iwl_missed_beacon_notif missed_beacon;
++#endif
++		__le32 status;
++		u8 raw[0];
++	} u;
++} __attribute__ ((packed));
++
++#define IWL_RX_FRAME_SIZE        (4 + sizeof(struct iwl_rx_frame))
++
++#endif				/* __iwl_commands_h__ */
+diff --git a/drivers/net/wireless/iwl-debug.h b/drivers/net/wireless/iwl-debug.h
+new file mode 100644
+index 0000000..abd344c
+--- /dev/null
++++ b/drivers/net/wireless/iwl-debug.h
+@@ -0,0 +1,149 @@
++/******************************************************************************
++ *
++ * Copyright(c) 2003 - 2007 Intel Corporation. All rights reserved.
++ *
++ * Portions of this file are derived from the ipw3945 project.
++ *
++ * This program is free software; you can redistribute it and/or modify it
++ * under the terms of version 2 of the GNU General Public License as
++ * published by the Free Software Foundation.
++ *
++ * 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.,
++ * 51 Franklin Street, Fifth Floor, Boston, MA 02110, USA
++ *
++ * The full GNU General Public License is included in this distribution in the
++ * file called LICENSE.
++ *
++ * Contact Information:
++ * James P. Ketrenos <ipw2100-admin at linux.intel.com>
++ * Intel Corporation, 5200 N.E. Elam Young Parkway, Hillsboro, OR 97124-6497
++ *
++ *****************************************************************************/
++
++#ifndef __iwl_debug_h__
++#define __iwl_debug_h__
++
++#ifdef CONFIG_IWLWIFI_DEBUG
++extern u32 iwl_debug_level;
++#define IWL_DEBUG(level, fmt, args...) \
++do { if (iwl_debug_level & (level)) \
++  printk(KERN_ERR DRV_NAME": %c %s " fmt, \
++	 in_interrupt() ? 'I' : 'U', __FUNCTION__ , ## args); } while (0)
++
++#define IWL_DEBUG_LIMIT(level, fmt, args...) \
++do { if ((iwl_debug_level & (level)) && net_ratelimit()) \
++  printk(KERN_ERR DRV_NAME": %c %s " fmt, \
++	 in_interrupt() ? 'I' : 'U', __FUNCTION__ , ## args); } while (0)
++#else
++static inline void IWL_DEBUG(int level, const char *fmt, ...)
++{
++}
++static inline void IWL_DEBUG_LIMIT(int level, const char *fmt, ...)
++{
++}
++#endif				/* CONFIG_IWLWIFI_DEBUG */
++
++/*
++ * To use the debug system;
++ *
++ * If you are defining a new debug classification, simply add it to the #define
++ * list here in the form of:
++ *
++ * #define IWL_DL_xxxx VALUE
++ *
++ * shifting value to the left one bit from the previous entry.  xxxx should be
++ * the name of the classification (for example, WEP)
++ *
++ * You then need to either add a IWL_xxxx_DEBUG() macro definition for your
++ * classification, or use IWL_DEBUG(IWL_DL_xxxx, ...) whenever you want
++ * to send output to that classification.
++ *
++ * To add your debug level to the list of levels seen when you perform
++ *
++ * % cat /proc/net/iwl/debug_level
++ *
++ * you simply need to add your entry to the iwl_debug_levels array.
++ *
++ * If you do not see debug_level in /proc/net/iwl then you do not have
++ * CONFIG_IWLWIFI_DEBUG defined in your kernel configuration
++ *
++ */
++
++#define IWL_DL_INFO          (1<<0)
++#define IWL_DL_MAC80211      (1<<1)
++#define IWL_DL_HOST_COMMAND  (1<<2)
++#define IWL_DL_STATE         (1<<3)
++
++#define IWL_DL_RADIO         (1<<7)
++#define IWL_DL_POWER         (1<<8)
++#define IWL_DL_TEMP          (1<<9)
++
++#define IWL_DL_NOTIF         (1<<10)
++#define IWL_DL_SCAN          (1<<11)
++#define IWL_DL_ASSOC         (1<<12)
++#define IWL_DL_DROP          (1<<13)
++
++#define IWL_DL_TXPOWER       (1<<14)
++
++#define IWL_DL_AP            (1<<15)
++
++#define IWL_DL_FW            (1<<16)
++#define IWL_DL_RF_KILL       (1<<17)
++#define IWL_DL_FW_ERRORS     (1<<18)
++
++#define IWL_DL_LED           (1<<19)
++
++#define IWL_DL_RATE          (1<<20)
++
++#define IWL_DL_CALIB         (1<<21)
++#define IWL_DL_WEP           (1<<22)
++#define IWL_DL_TX            (1<<23)
++#define IWL_DL_RX            (1<<24)
++#define IWL_DL_ISR           (1<<25)
++#define IWL_DL_HT            (1<<26)
++#define IWL_DL_IO            (1<<27)
++#define IWL_DL_11H           (1<<28)
++
++#define IWL_DL_STATS         (1<<29)
++#define IWL_DL_TX_REPLY      (1<<30)
++#define IWL_DL_QOS           (1<<31)
++
++#define IWL_ERROR(f, a...) printk(KERN_ERR DRV_NAME ": " f, ## a)
++#define IWL_WARNING(f, a...) printk(KERN_WARNING DRV_NAME ": " f, ## a)
++#define IWL_DEBUG_INFO(f, a...)    IWL_DEBUG(IWL_DL_INFO, f, ## a)
++
++#define IWL_DEBUG_MAC80211(f, a...)     IWL_DEBUG(IWL_DL_MAC80211, f, ## a)
++#define IWL_DEBUG_TEMP(f, a...)   IWL_DEBUG(IWL_DL_TEMP, f, ## a)
++#define IWL_DEBUG_SCAN(f, a...)   IWL_DEBUG(IWL_DL_SCAN, f, ## a)
++#define IWL_DEBUG_RX(f, a...)     IWL_DEBUG(IWL_DL_RX, f, ## a)
++#define IWL_DEBUG_TX(f, a...)     IWL_DEBUG(IWL_DL_TX, f, ## a)
++#define IWL_DEBUG_ISR(f, a...)    IWL_DEBUG(IWL_DL_ISR, f, ## a)
++#define IWL_DEBUG_LED(f, a...) IWL_DEBUG(IWL_DL_LED, f, ## a)
++#define IWL_DEBUG_WEP(f, a...)    IWL_DEBUG(IWL_DL_WEP, f, ## a)
++#define IWL_DEBUG_HC(f, a...) IWL_DEBUG(IWL_DL_HOST_COMMAND, f, ## a)
++#define IWL_DEBUG_CALIB(f, a...) IWL_DEBUG(IWL_DL_CALIB, f, ## a)
++#define IWL_DEBUG_FW(f, a...) IWL_DEBUG(IWL_DL_FW, f, ## a)
++#define IWL_DEBUG_RF_KILL(f, a...) IWL_DEBUG(IWL_DL_RF_KILL, f, ## a)
++#define IWL_DEBUG_DROP(f, a...) IWL_DEBUG(IWL_DL_DROP, f, ## a)
++#define IWL_DEBUG_DROP_LIMIT(f, a...) IWL_DEBUG_LIMIT(IWL_DL_DROP, f, ## a)
++#define IWL_DEBUG_AP(f, a...) IWL_DEBUG(IWL_DL_AP, f, ## a)
++#define IWL_DEBUG_TXPOWER(f, a...) IWL_DEBUG(IWL_DL_TXPOWER, f, ## a)
++#define IWL_DEBUG_IO(f, a...) IWL_DEBUG(IWL_DL_IO, f, ## a)
++#define IWL_DEBUG_RATE(f, a...) IWL_DEBUG(IWL_DL_RATE, f, ## a)
++#define IWL_DEBUG_NOTIF(f, a...) IWL_DEBUG(IWL_DL_NOTIF, f, ## a)
++#define IWL_DEBUG_ASSOC(f, a...) IWL_DEBUG(IWL_DL_ASSOC | IWL_DL_INFO, f, ## a)
++#define IWL_DEBUG_HT(f, a...) IWL_DEBUG(IWL_DL_HT, f, ## a)
++#define IWL_DEBUG_STATS(f, a...) IWL_DEBUG(IWL_DL_STATS, f, ## a)
++#define IWL_DEBUG_TX_REPLY(f, a...) IWL_DEBUG(IWL_DL_TX_REPLY, f, ## a)
++#define IWL_DEBUG_QOS(f, a...)   IWL_DEBUG(IWL_DL_QOS, f, ## a)
++#define IWL_DEBUG_RADIO(f, a...)  IWL_DEBUG(IWL_DL_RADIO, f, ## a)
++#define IWL_DEBUG_POWER(f, a...)  IWL_DEBUG(IWL_DL_POWER, f, ## a)
++#define IWL_DEBUG_11H(f, a...)  IWL_DEBUG(IWL_DL_11H, f, ## a)
++
++#endif
+diff --git a/drivers/net/wireless/iwl-eeprom.h b/drivers/net/wireless/iwl-eeprom.h
+new file mode 100644
+index 0000000..e473c97
+--- /dev/null
++++ b/drivers/net/wireless/iwl-eeprom.h
+@@ -0,0 +1,336 @@
++/******************************************************************************
++ *
++ * This file is provided under a dual BSD/GPLv2 license.  When using or
++ * redistributing this file, you may do so under either license.
++ *
++ * GPL LICENSE SUMMARY
++ *
++ * Copyright(c) 2005 - 2007 Intel Corporation. All rights reserved.
++ *
++ * This program is free software; you can redistribute it and/or modify
++ * it under the terms of version 2 of the GNU Geeral Public License as
++ * published by the Free Software Foundation.
++ *
++ * 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., 51 Franklin Street, Fifth Floor, Boston, MA 02110,
++ * USA
++ *
++ * The full GNU General Public License is included in this distribution
++ * in the file called LICENSE.GPL.
++ *
++ * Contact Information:
++ * James P. Ketrenos <ipw2100-admin at linux.intel.com>
++ * Intel Corporation, 5200 N.E. Elam Young Parkway, Hillsboro, OR 97124-6497
++ *
++ * BSD LICENSE
++ *
++ * Copyright(c) 2005 - 2007 Intel Corporation. All rights reserved.
++ * All rights reserved.
++ *
++ * Redistribution and use in source and binary forms, with or without
++ * modification, are permitted provided that the following conditions
++ * are met:
++ *
++ *  * Redistributions of source code must retain the above copyright
++ *    notice, this list of conditions and the following disclaimer.
++ *  * Redistributions in binary form must reproduce the above copyright
++ *    notice, this list of conditions and the following disclaimer in
++ *    the documentation and/or other materials provided with the
++ *    distribution.
++ *  * Neither the name Intel Corporation nor the names of its
++ *    contributors may be used to endorse or promote products derived
++ *    from this software without specific prior written permission.
++ *
++ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
++ * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
++ * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
++ * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
++ * OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
++ * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
++ * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
++ * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
++ * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
++ * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
++ * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
++ *
++ *****************************************************************************/
++
++#ifndef __iwl_eeprom_h__
++#define __iwl_eeprom_h__
++
++/*
++ * This file defines EEPROM related constants, enums, and inline functions.
++ *
++ */
++
++#define IWL_EEPROM_ACCESS_TIMEOUT	5000 /* uSec */
++#define IWL_EEPROM_ACCESS_DELAY		10   /* uSec */
++/* EEPROM field values */
++#define ANTENNA_SWITCH_NORMAL     0
++#define ANTENNA_SWITCH_INVERSE    1
++
++enum {
++	EEPROM_CHANNEL_VALID = (1 << 0),	/* usable for this SKU/geo */
++	EEPROM_CHANNEL_IBSS = (1 << 1),	/* usable as an IBSS channel */
++	/* Bit 2 Reserved */
++	EEPROM_CHANNEL_ACTIVE = (1 << 3),	/* active scanning allowed */
++	EEPROM_CHANNEL_RADAR = (1 << 4),	/* radar detection required */
++	EEPROM_CHANNEL_WIDE = (1 << 5),
++	EEPROM_CHANNEL_NARROW = (1 << 6),
++	EEPROM_CHANNEL_DFS = (1 << 7),	/* dynamic freq selection candidate */
++};
++
++/* EEPROM field lengths */
++#define EEPROM_BOARD_PBA_NUMBER_LENGTH                  11
++
++/* EEPROM field lengths */
++#define EEPROM_BOARD_PBA_NUMBER_LENGTH                  11
++#define EEPROM_REGULATORY_SKU_ID_LENGTH                 4
++#define EEPROM_REGULATORY_BAND1_CHANNELS_LENGTH         14
++#define EEPROM_REGULATORY_BAND2_CHANNELS_LENGTH         13
++#define EEPROM_REGULATORY_BAND3_CHANNELS_LENGTH         12
++#define EEPROM_REGULATORY_BAND4_CHANNELS_LENGTH         11
++#define EEPROM_REGULATORY_BAND5_CHANNELS_LENGTH         6
++
++#if IWL == 3945
++#define EEPROM_REGULATORY_CHANNELS_LENGTH ( \
++	EEPROM_REGULATORY_BAND1_CHANNELS_LENGTH + \
++	EEPROM_REGULATORY_BAND2_CHANNELS_LENGTH + \
++	EEPROM_REGULATORY_BAND3_CHANNELS_LENGTH + \
++	EEPROM_REGULATORY_BAND4_CHANNELS_LENGTH + \
++	EEPROM_REGULATORY_BAND5_CHANNELS_LENGTH)
++#elif IWL == 4965
++#define EEPROM_REGULATORY_BAND_24_FAT_CHANNELS_LENGTH 7
++#define EEPROM_REGULATORY_BAND_52_FAT_CHANNELS_LENGTH 11
++#define EEPROM_REGULATORY_CHANNELS_LENGTH ( \
++	EEPROM_REGULATORY_BAND1_CHANNELS_LENGTH + \
++	EEPROM_REGULATORY_BAND2_CHANNELS_LENGTH + \
++	EEPROM_REGULATORY_BAND3_CHANNELS_LENGTH + \
++	EEPROM_REGULATORY_BAND4_CHANNELS_LENGTH + \
++	EEPROM_REGULATORY_BAND5_CHANNELS_LENGTH + \
++	EEPROM_REGULATORY_BAND_24_FAT_CHANNELS_LENGTH + \
++	EEPROM_REGULATORY_BAND_52_FAT_CHANNELS_LENGTH)
++#endif
++
++#define EEPROM_REGULATORY_NUMBER_OF_BANDS               5
++
++/* SKU Capabilities */
++#define EEPROM_SKU_CAP_SW_RF_KILL_ENABLE                (1 << 0)
++#define EEPROM_SKU_CAP_HW_RF_KILL_ENABLE                (1 << 1)
++#define EEPROM_SKU_CAP_OP_MODE_MRC                      (1 << 7)
++
++/* *regulatory* channel data from eeprom, one for each channel */
++struct iwl_eeprom_channel {
++	u8 flags;		/* flags copied from EEPROM */
++	s8 max_power_avg;	/* max power (dBm) on this chnl, limit 31 */
++} __attribute__ ((packed));
++
++/*
++ * Mapping of a Tx power level, at factory calibration temperature,
++ *   to a radio/DSP gain table index.
++ * One for each of 5 "sample" power levels in each band.
++ * v_det is measured at the factory, using the 3945's built-in power amplifier
++ *   (PA) output voltage detector.  This same detector is used during Tx of
++ *   long packets in normal operation to provide feedback as to proper output
++ *   level.
++ * Data copied from EEPROM.
++ */
++struct iwl_eeprom_txpower_sample {
++	u8 gain_index;		/* index into power (gain) setup table ... */
++	s8 power;		/* ... for this pwr level for this chnl group */
++	u16 v_det;		/* PA output voltage */
++} __attribute__ ((packed));
++
++/*
++ * Mappings of Tx power levels -> nominal radio/DSP gain table indexes.
++ * One for each channel group (a.k.a. "band") (1 for BG, 4 for A).
++ * Tx power setup code interpolates between the 5 "sample" power levels
++ *    to determine the nominal setup for a requested power level.
++ * Data copied from EEPROM.
++ * DO NOT ALTER THIS STRUCTURE!!!
++ */
++struct iwl_eeprom_txpower_group {
++	struct iwl_eeprom_txpower_sample samples[5];	/* 5 power levels */
++	s32 a, b, c, d, e;	/* coefficients for voltage->power
++				 * formula (signed) */
++	s32 Fa, Fb, Fc, Fd, Fe;	/* these modify coeffs based on
++					 * frequency (signed) */
++	s8 saturation_power;	/* highest power possible by h/w in this
++				 * band */
++	u8 group_channel;	/* "representative" channel # in this band */
++	s16 temperature;	/* h/w temperature at factory calib this band
++				 * (signed) */
++} __attribute__ ((packed));
++
++/*
++ * Temperature-based Tx-power compensation data, not band-specific.
++ * These coefficients are use to modify a/b/c/d/e coeffs based on
++ *   difference between current temperature and factory calib temperature.
++ * Data copied from EEPROM.
++ */
++struct iwl_eeprom_temperature_corr {
++	u32 Ta;
++	u32 Tb;
++	u32 Tc;
++	u32 Td;
++	u32 Te;
++} __attribute__ ((packed));
++
++#if IWL == 4965
++#define EEPROM_TX_POWER_TX_CHAINS      (2)
++#define EEPROM_TX_POWER_BANDS          (8)
++#define EEPROM_TX_POWER_MEASUREMENTS   (3)
++#define EEPROM_TX_POWER_VERSION        (2)
++#define EEPROM_TX_POWER_VERSION_NEW    (5)
++
++struct iwl_eeprom_calib_measure {
++	u8 temperature;
++	u8 gain_idx;
++	u8 actual_pow;
++	s8 pa_det;
++} __attribute__ ((packed));
++
++struct iwl_eeprom_calib_ch_info {
++	u8 ch_num;
++	struct iwl_eeprom_calib_measure measurements[EEPROM_TX_POWER_TX_CHAINS]
++		[EEPROM_TX_POWER_MEASUREMENTS];
++} __attribute__ ((packed));
++
++struct iwl_eeprom_calib_subband_info {
++	u8 ch_from;
++	u8 ch_to;
++	struct iwl_eeprom_calib_ch_info ch1;
++	struct iwl_eeprom_calib_ch_info ch2;
++} __attribute__ ((packed));
++
++struct iwl_eeprom_calib_info {
++	u8 saturation_power24;
++	u8 saturation_power52;
++	s16 voltage;		/* signed */
++	struct iwl_eeprom_calib_subband_info band_info[EEPROM_TX_POWER_BANDS];
++} __attribute__ ((packed));
++
++#endif
++
++struct iwl_eeprom {
++	u8 reserved0[16];
++#define EEPROM_DEVICE_ID                    (2*0x08)	/* 2 bytes */
++	u16 device_id;	/* abs.ofs: 16 */
++	u8 reserved1[2];
++#define EEPROM_PMC                          (2*0x0A)	/* 2 bytes */
++	u16 pmc;		/* abs.ofs: 20 */
++	u8 reserved2[20];
++#define EEPROM_MAC_ADDRESS                  (2*0x15)	/* 6  bytes */
++	u8 mac_address[6];	/* abs.ofs: 42 */
++	u8 reserved3[58];
++#define EEPROM_BOARD_REVISION               (2*0x35)	/* 2  bytes */
++	u16 board_revision;	/* abs.ofs: 106 */
++	u8 reserved4[11];
++#define EEPROM_BOARD_PBA_NUMBER             (2*0x3B+1)	/* 9  bytes */
++	u8 board_pba_number[9];	/* abs.ofs: 119 */
++	u8 reserved5[8];
++#define EEPROM_VERSION                      (2*0x44)	/* 2  bytes */
++	u16 version;		/* abs.ofs: 136 */
++#define EEPROM_SKU_CAP                      (2*0x45)	/* 1  bytes */
++	u8 sku_cap;		/* abs.ofs: 138 */
++#define EEPROM_LEDS_MODE                    (2*0x45+1)	/* 1  bytes */
++	u8 leds_mode;		/* abs.ofs: 139 */
++#define EEPROM_OEM_MODE                     (2*0x46)	/* 2  bytes */
++	u16 oem_mode;
++#define EEPROM_WOWLAN_MODE                  (2*0x47)	/* 2  bytes */
++	u16 wowlan_mode;	/* abs.ofs: 142 */
++#define EEPROM_LEDS_TIME_INTERVAL           (2*0x48)	/* 2  bytes */
++	u16 leds_time_interval;	/* abs.ofs: 144 */
++#define EEPROM_LEDS_OFF_TIME                (2*0x49)	/* 1  bytes */
++	u8 leds_off_time;	/* abs.ofs: 146 */
++#define EEPROM_LEDS_ON_TIME                 (2*0x49+1)	/* 1  bytes */
++	u8 leds_on_time;	/* abs.ofs: 147 */
++#define EEPROM_ALMGOR_M_VERSION             (2*0x4A)	/* 1  bytes */
++	u8 almgor_m_version;	/* abs.ofs: 148 */
++#define EEPROM_ANTENNA_SWITCH_TYPE          (2*0x4A+1)	/* 1  bytes */
++	u8 antenna_switch_type;	/* abs.ofs: 149 */
++#if IWL == 3945
++	u8 reserved6[42];
++#else
++	u8 reserved6[8];
++#define EEPROM_4965_BOARD_REVISION          (2*0x4F)	/* 2 bytes */
++	u16 board_revision_4965;	/* abs.ofs: 158 */
++	u8 reserved7[13];
++#define EEPROM_4965_BOARD_PBA               (2*0x56+1)	/* 9 bytes */
++	u8 board_pba_number_4965[9];	/* abs.ofs: 173 */
++	u8 reserved8[10];
++#endif
++#define EEPROM_REGULATORY_SKU_ID            (2*0x60)	/* 4  bytes */
++	u8 sku_id[4];		/* abs.ofs: 192 */
++#define EEPROM_REGULATORY_BAND_1            (2*0x62)	/* 2  bytes */
++	u16 band_1_count;	/* abs.ofs: 196 */
++#define EEPROM_REGULATORY_BAND_1_CHANNELS   (2*0x63)	/* 28 bytes */
++	struct iwl_eeprom_channel band_1_channels[14];	/* abs.ofs: 196 */
++#define EEPROM_REGULATORY_BAND_2            (2*0x71)	/* 2  bytes */
++	u16 band_2_count;	/* abs.ofs: 226 */
++#define EEPROM_REGULATORY_BAND_2_CHANNELS   (2*0x72)	/* 26 bytes */
++	struct iwl_eeprom_channel band_2_channels[13];	/* abs.ofs: 228 */
++#define EEPROM_REGULATORY_BAND_3            (2*0x7F)	/* 2  bytes */
++	u16 band_3_count;	/* abs.ofs: 254 */
++#define EEPROM_REGULATORY_BAND_3_CHANNELS   (2*0x80)	/* 24 bytes */
++	struct iwl_eeprom_channel band_3_channels[12];	/* abs.ofs: 256 */
++#define EEPROM_REGULATORY_BAND_4            (2*0x8C)	/* 2  bytes */
++	u16 band_4_count;	/* abs.ofs: 280 */
++#define EEPROM_REGULATORY_BAND_4_CHANNELS   (2*0x8D)	/* 22 bytes */
++	struct iwl_eeprom_channel band_4_channels[11];	/* abs.ofs: 282 */
++#define EEPROM_REGULATORY_BAND_5            (2*0x98)	/* 2  bytes */
++	u16 band_5_count;	/* abs.ofs: 304 */
++#define EEPROM_REGULATORY_BAND_5_CHANNELS   (2*0x99)	/* 12 bytes */
++	struct iwl_eeprom_channel band_5_channels[6];	/* abs.ofs: 306 */
++
++/* From here on out the EEPROM diverges between the 4965 and the 3945 */
++#if IWL == 3945
++
++	u8 reserved9[194];
++
++#define EEPROM_TXPOWER_CALIB_GROUP0 0x200
++#define EEPROM_TXPOWER_CALIB_GROUP1 0x240
++#define EEPROM_TXPOWER_CALIB_GROUP2 0x280
++#define EEPROM_TXPOWER_CALIB_GROUP3 0x2c0
++#define EEPROM_TXPOWER_CALIB_GROUP4 0x300
++#define IWL_NUM_TX_CALIB_GROUPS 5
++	struct iwl_eeprom_txpower_group groups[IWL_NUM_TX_CALIB_GROUPS];
++/* abs.ofs: 512 */
++#define EEPROM_CALIB_TEMPERATURE_CORRECT 0x340
++	struct iwl_eeprom_temperature_corr corrections;	/* abs.ofs: 832 */
++	u8 reserved16[172];	/* fill out to full 1024 byte block */
++
++/* 4965AGN adds fat channel support */
++#elif IWL == 4965
++
++	u8 reserved10[2];
++#define EEPROM_REGULATORY_BAND_24_FAT_CHANNELS (2*0xA0)	/* 14 bytes */
++	struct iwl_eeprom_channel band_24_channels[7];	/* abs.ofs: 320 */
++	u8 reserved11[2];
++#define EEPROM_REGULATORY_BAND_52_FAT_CHANNELS (2*0xA8)	/* 22 bytes */
++	struct iwl_eeprom_channel band_52_channels[11];	/* abs.ofs: 336 */
++	u8 reserved12[6];
++#define EEPROM_CALIB_VERSION_OFFSET            (2*0xB6)	/* 2 bytes */
++	u16 calib_version;	/* abs.ofs: 364 */
++	u8 reserved13[2];
++#define EEPROM_SATURATION_POWER_OFFSET         (2*0xB8)	/* 2 bytes */
++	u16 satruation_power;	/* abs.ofs: 368 */
++	u8 reserved14[94];
++#define EEPROM_IWL_CALIB_TXPOWER_OFFSET        (2*0xE8)	/* 48  bytes */
++	struct iwl_eeprom_calib_info calib_info;	/* abs.ofs: 464 */
++
++	u8 reserved16[140];	/* fill out to full 1024 byte block */
++
++#endif
++
++} __attribute__ ((packed));
++
++#define IWL_EEPROM_IMAGE_SIZE 1024
++
++#endif
+diff --git a/drivers/net/wireless/iwl-helpers.h b/drivers/net/wireless/iwl-helpers.h
+new file mode 100644
+index 0000000..e2a8d95
+--- /dev/null
++++ b/drivers/net/wireless/iwl-helpers.h
+@@ -0,0 +1,255 @@
++/******************************************************************************
++ *
++ * Copyright(c) 2003 - 2007 Intel Corporation. All rights reserved.
++ *
++ * Portions of this file are derived from the ipw3945 project, as well
++ * as portions of the ieee80211 subsystem header files.
++ *
++ * This program is free software; you can redistribute it and/or modify it
++ * under the terms of version 2 of the GNU General Public License as
++ * published by the Free Software Foundation.
++ *
++ * 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.,
++ * 51 Franklin Street, Fifth Floor, Boston, MA 02110, USA
++ *
++ * The full GNU General Public License is included in this distribution in the
++ * file called LICENSE.
++ *
++ * Contact Information:
++ * James P. Ketrenos <ipw2100-admin at linux.intel.com>
++ * Intel Corporation, 5200 N.E. Elam Young Parkway, Hillsboro, OR 97124-6497
++ *
++ *****************************************************************************/
++
++#ifndef __iwl_helpers_h__
++#define __iwl_helpers_h__
++
++#include <linux/ctype.h>
++
++/*
++ * The structures defined by the hardware/uCode interface
++ * have bit-wise operations.  For each bit-field there is
++ * a data symbol in the structure, the start bit position
++ * and the length of the bit-field.
++ *
++ * iwl_get_bits and iwl_set_bits will return or set the
++ * appropriate bits on a 32-bit value.
++ *
++ * IWL_GET_BITS and IWL_SET_BITS use symbol expansion to
++ * expand out to the appropriate call to iwl_get_bits
++ * and iwl_set_bits without having to reference all of the
++ * numerical constants and defines provided in the hardware
++ * definition
++ */
++
++/**
++ * iwl_get_bits - Extract a hardware bit-field value
++ * @src: source hardware value (__le32)
++ * @pos: bit-position (0-based) of first bit of value
++ * @len: length of bit-field
++ *
++ * iwl_get_bits will return the bit-field in cpu endian ordering.
++ *
++ * NOTE:  If used from IWL_GET_BITS then pos and len are compile-constants and
++ *        will collapse to minimal code by the compiler.
++ */
++static inline u32 iwl_get_bits(__le32 src, u8 pos, u8 len)
++{
++	u32 tmp = le32_to_cpu(src);
++
++	tmp >>= pos;
++	tmp &= (1UL << len) - 1;
++	return tmp;
++}
++
++/**
++ * iwl_set_bits - Set a hardware bit-field value
++ * @dst: Address of __le32 hardware value
++ * @pos: bit-position (0-based) of first bit of value
++ * @len: length of bit-field
++ * @val: cpu endian value to encode into the bit-field
++ *
++ * iwl_set_bits will encode val into dst, masked to be len bits long at bit
++ * position pos.
++ *
++ * NOTE:  If used IWL_SET_BITS pos and len will be compile-constants and
++ *        will collapse to minimal code by the compiler.
++ */
++static inline void iwl_set_bits(__le32 *dst, u8 pos, u8 len, int val)
++{
++	u32 tmp = le32_to_cpu(*dst);
++
++	tmp &= ~(((1UL << len) - 1) << pos);
++	tmp |= (val & ((1UL << len) - 1)) << pos;
++	*dst = cpu_to_le32(tmp);
++}
++
++static inline void iwl_set_bits16(__le16 *dst, u8 pos, u8 len, int val)
++{
++	u16 tmp = le16_to_cpu(*dst);
++
++	tmp &= ~((1UL << (pos + len)) - (1UL << pos));
++	tmp |= (val & ((1UL << len) - 1)) << pos;
++	*dst = cpu_to_le16(tmp);
++}
++
++/*
++ * The bit-field definitions in iwl-xxxx-hw.h are in the form of:
++ *
++ * struct example {
++ *         __le32 val1;
++ * #define IWL_name_POS 8
++ * #define IWL_name_LEN 4
++ * #define IWL_name_SYM val1
++ * };
++ *
++ * The IWL_SET_BITS and IWL_GET_BITS macros are provided to allow the driver
++ * to call:
++ *
++ * struct example bar;
++ * u32 val = IWL_GET_BITS(bar, name);
++ * val = val * 2;
++ * IWL_SET_BITS(bar, name, val);
++ *
++ * All cpu / host ordering, masking, and shifts are performed by the macros
++ * and iwl_{get,set}_bits.
++ *
++ */
++#define IWL_SET_BITS(s, sym, v) \
++	iwl_set_bits(&(s).IWL_ ## sym ## _SYM, IWL_ ## sym ## _POS, \
++		     IWL_ ## sym ## _LEN, (v))
++
++#define IWL_SET_BITS16(s, sym, v) \
++	iwl_set_bits16(&(s).IWL_ ## sym ## _SYM, IWL_ ## sym ## _POS, \
++		       IWL_ ## sym ## _LEN, (v))
++
++#define IWL_GET_BITS(s, sym) \
++	iwl_get_bits((s).IWL_ ## sym ## _SYM, IWL_ ## sym ## _POS, \
++		      IWL_ ## sym ## _LEN)
++
++
++#define KELVIN_TO_CELSIUS(x) ((x)-273)
++#define CELSIUS_TO_KELVIN(x) ((x)+273)
++
++#define IEEE80211_CHAN_W_RADAR_DETECT 0x00000010
++
++static inline struct ieee80211_conf *ieee80211_get_hw_conf(
++	struct ieee80211_hw *hw)
++{
++	return &hw->conf;
++}
++
++#define QOS_CONTROL_LEN 2
++
++#define IEEE80211_STYPE_BACK_REQ	0x0080
++#define IEEE80211_STYPE_BACK		0x0090
++
++
++static inline int ieee80211_is_management(u16 fc)
++{
++	return (fc & IEEE80211_FCTL_FTYPE) == IEEE80211_FTYPE_MGMT;
++}
++
++static inline int ieee80211_is_control(u16 fc)
++{
++	return (fc & IEEE80211_FCTL_FTYPE) == IEEE80211_FTYPE_CTL;
++}
++
++static inline int ieee80211_is_data(u16 fc)
++{
++	return (fc & IEEE80211_FCTL_FTYPE) == IEEE80211_FTYPE_DATA;
++}
++
++static inline int ieee80211_is_back_request(u16 fc)
++{
++	return ((fc & IEEE80211_FCTL_FTYPE) == IEEE80211_FTYPE_CTL) &&
++	       ((fc & IEEE80211_FCTL_STYPE) == IEEE80211_STYPE_BACK_REQ);
++}
++
++static inline int ieee80211_is_probe_response(u16 fc)
++{
++	return ((fc & IEEE80211_FCTL_FTYPE) == IEEE80211_FTYPE_MGMT) &&
++	       ((fc & IEEE80211_FCTL_STYPE) == IEEE80211_STYPE_PROBE_RESP);
++}
++
++static inline int ieee80211_is_probe_request(u16 fc)
++{
++	return ((fc & IEEE80211_FCTL_FTYPE) == IEEE80211_FTYPE_MGMT) &&
++	       ((fc & IEEE80211_FCTL_STYPE) == IEEE80211_STYPE_PROBE_REQ);
++}
++
++static inline int ieee80211_is_beacon(u16 fc)
++{
++	return ((fc & IEEE80211_FCTL_FTYPE) == IEEE80211_FTYPE_MGMT) &&
++	       ((fc & IEEE80211_FCTL_STYPE) == IEEE80211_STYPE_BEACON);
++}
++
++static inline int ieee80211_is_atim(u16 fc)
++{
++	return ((fc & IEEE80211_FCTL_FTYPE) == IEEE80211_FTYPE_MGMT) &&
++	       ((fc & IEEE80211_FCTL_STYPE) == IEEE80211_STYPE_ATIM);
++}
++
++static inline int ieee80211_is_assoc_request(u16 fc)
++{
++	return ((fc & IEEE80211_FCTL_FTYPE) == IEEE80211_FTYPE_MGMT) &&
++	       ((fc & IEEE80211_FCTL_STYPE) == IEEE80211_STYPE_ASSOC_REQ);
++}
++
++static inline int ieee80211_is_assoc_response(u16 fc)
++{
++	return ((fc & IEEE80211_FCTL_FTYPE) == IEEE80211_FTYPE_MGMT) &&
++	       ((fc & IEEE80211_FCTL_STYPE) == IEEE80211_STYPE_ASSOC_RESP);
++}
++
++static inline int ieee80211_is_auth(u16 fc)
++{
++	return ((fc & IEEE80211_FCTL_FTYPE) == IEEE80211_FTYPE_MGMT) &&
++	       ((fc & IEEE80211_FCTL_STYPE) == IEEE80211_STYPE_ASSOC_REQ);
++}
++
++static inline int ieee80211_is_deauth(u16 fc)
++{
++	return ((fc & IEEE80211_FCTL_FTYPE) == IEEE80211_FTYPE_MGMT) &&
++	       ((fc & IEEE80211_FCTL_STYPE) == IEEE80211_STYPE_ASSOC_REQ);
++}
++
++static inline int ieee80211_is_disassoc(u16 fc)
++{
++	return ((fc & IEEE80211_FCTL_FTYPE) == IEEE80211_FTYPE_MGMT) &&
++	       ((fc & IEEE80211_FCTL_STYPE) == IEEE80211_STYPE_ASSOC_REQ);
++}
++
++static inline int ieee80211_is_reassoc_request(u16 fc)
++{
++	return ((fc & IEEE80211_FCTL_FTYPE) == IEEE80211_FTYPE_MGMT) &&
++	       ((fc & IEEE80211_FCTL_STYPE) == IEEE80211_STYPE_REASSOC_REQ);
++}
++
++static inline int ieee80211_is_reassoc_response(u16 fc)
++{
++	return ((fc & IEEE80211_FCTL_FTYPE) == IEEE80211_FTYPE_MGMT) &&
++	       ((fc & IEEE80211_FCTL_STYPE) == IEEE80211_STYPE_REASSOC_RESP);
++}
++
++static inline int iwl_check_bits(unsigned long field, unsigned long mask)
++{
++	return ((field & mask) == mask) ? 1 : 0;
++}
++
++static inline unsigned long elapsed_jiffies(unsigned long start,
++					    unsigned long end)
++{
++	if (end > start)
++		return end - start;
++
++	return end + (MAX_JIFFY_OFFSET - start);
++}
++
++#endif				/* __iwl_helpers_h__ */
+diff --git a/drivers/net/wireless/iwl-hw.h b/drivers/net/wireless/iwl-hw.h
+new file mode 100644
+index 0000000..1aa6fcd
+--- /dev/null
++++ b/drivers/net/wireless/iwl-hw.h
+@@ -0,0 +1,537 @@
++/******************************************************************************
++ *
++ * This file is provided under a dual BSD/GPLv2 license.  When using or
++ * redistributing this file, you may do so under either license.
++ *
++ * GPL LICENSE SUMMARY
++ *
++ * Copyright(c) 2005 - 2007 Intel Corporation. All rights reserved.
++ *
++ * This program is free software; you can redistribute it and/or modify
++ * it under the terms of version 2 of the GNU Geeral Public License as
++ * published by the Free Software Foundation.
++ *
++ * 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., 51 Franklin Street, Fifth Floor, Boston, MA 02110,
++ * USA
++ *
++ * The full GNU General Public License is included in this distribution
++ * in the file called LICENSE.GPL.
++ *
++ * Contact Information:
++ * James P. Ketrenos <ipw2100-admin at linux.intel.com>
++ * Intel Corporation, 5200 N.E. Elam Young Parkway, Hillsboro, OR 97124-6497
++ *
++ * BSD LICENSE
++ *
++ * Copyright(c) 2005 - 2007 Intel Corporation. All rights reserved.
++ * All rights reserved.
++ *
++ * Redistribution and use in source and binary forms, with or without
++ * modification, are permitted provided that the following conditions
++ * are met:
++ *
++ *  * Redistributions of source code must retain the above copyright
++ *    notice, this list of conditions and the following disclaimer.
++ *  * Redistributions in binary form must reproduce the above copyright
++ *    notice, this list of conditions and the following disclaimer in
++ *    the documentation and/or other materials provided with the
++ *    distribution.
++ *  * Neither the name Intel Corporation nor the names of its
++ *    contributors may be used to endorse or promote products derived
++ *    from this software without specific prior written permission.
++ *
++ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
++ * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
++ * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
++ * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
++ * OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
++ * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
++ * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
++ * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
++ * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
++ * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
++ * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
++ *****************************************************************************/
++
++#ifndef	__iwlwifi_hw_h__
++#define __iwlwifi_hw_h__
++
++/*
++ * This file defines hardware constants common to 3945 and 4965.
++ *
++ * Device-specific constants are defined in iwl-3945-hw.h and iwl-4965-hw.h,
++ * although this file contains a few definitions for which the .c
++ * implementation is the same for 3945 and 4965, except for the value of
++ * a constant.
++ *
++ * uCode API constants are defined in iwl-commands.h.
++ *
++ * NOTE:  DO NOT PUT OS IMPLEMENTATION-SPECIFIC DECLARATIONS HERE
++ *
++ * The iwl-*hw.h (and files they include) files should remain OS/driver
++ * implementation independent, declaring only the hardware interface.
++ */
++
++/* uCode queue management definitions */
++#define IWL_CMD_QUEUE_NUM       4
++#define IWL_CMD_FIFO_NUM        4
++#define IWL_BACK_QUEUE_FIRST_ID 7
++
++/* Tx rates */
++#define IWL_CCK_RATES 4
++#define IWL_OFDM_RATES 8
++
++#if IWL == 3945
++#define IWL_HT_RATES 0
++#elif IWL == 4965
++#define IWL_HT_RATES 16
++#endif
++
++#define IWL_MAX_RATES  (IWL_CCK_RATES+IWL_OFDM_RATES+IWL_HT_RATES)
++
++/* Time constants */
++#define SHORT_SLOT_TIME 9
++#define LONG_SLOT_TIME 20
++
++/* RSSI to dBm */
++#if IWL == 3945
++#define IWL_RSSI_OFFSET	95
++#elif IWL == 4965
++#define IWL_RSSI_OFFSET	44
++#endif
++
++#include "iwl-eeprom.h"
++#include "iwl-commands.h"
++
++#define PCI_LINK_CTRL      0x0F0
++#define PCI_POWER_SOURCE   0x0C8
++#define PCI_REG_WUM8       0x0E8
++#define PCI_CFG_PMC_PME_FROM_D3COLD_SUPPORT         (0x80000000)
++
++/*=== CSR (control and status registers) ===*/
++#define CSR_BASE    (0x000)
++
++#define CSR_SW_VER              (CSR_BASE+0x000)
++#define CSR_HW_IF_CONFIG_REG    (CSR_BASE+0x000) /* hardware interface config */
++#define CSR_INT_COALESCING      (CSR_BASE+0x004) /* accum ints, 32-usec units */
++#define CSR_INT                 (CSR_BASE+0x008) /* host interrupt status/ack */
++#define CSR_INT_MASK            (CSR_BASE+0x00c) /* host interrupt enable */
++#define CSR_FH_INT_STATUS       (CSR_BASE+0x010) /* busmaster int status/ack*/
++#define CSR_GPIO_IN             (CSR_BASE+0x018) /* read external chip pins */
++#define CSR_RESET               (CSR_BASE+0x020) /* busmaster enable, NMI, etc*/
++#define CSR_GP_CNTRL            (CSR_BASE+0x024)
++#define CSR_HW_REV              (CSR_BASE+0x028)
++#define CSR_EEPROM_REG          (CSR_BASE+0x02c)
++#define CSR_EEPROM_GP           (CSR_BASE+0x030)
++#define CSR_GP_UCODE		(CSR_BASE+0x044)
++#define CSR_UCODE_DRV_GP1       (CSR_BASE+0x054)
++#define CSR_UCODE_DRV_GP1_SET   (CSR_BASE+0x058)
++#define CSR_UCODE_DRV_GP1_CLR   (CSR_BASE+0x05c)
++#define CSR_UCODE_DRV_GP2       (CSR_BASE+0x060)
++#define CSR_LED_REG		(CSR_BASE+0x094)
++#define CSR_DRAM_INT_TBL_CTL	(CSR_BASE+0x0A0)
++#define CSR_GIO_CHICKEN_BITS    (CSR_BASE+0x100)
++#define CSR_ANA_PLL_CFG         (CSR_BASE+0x20c)
++#define CSR_HW_REV_WA_REG	(CSR_BASE+0x22C)
++
++/* HW I/F configuration */
++#define CSR_HW_IF_CONFIG_REG_BIT_ALMAGOR_MB         (0x00000100)
++#define CSR_HW_IF_CONFIG_REG_BIT_ALMAGOR_MM         (0x00000200)
++#define CSR_HW_IF_CONFIG_REG_BIT_SKU_MRC            (0x00000400)
++#define CSR_HW_IF_CONFIG_REG_BIT_BOARD_TYPE         (0x00000800)
++#define CSR_HW_IF_CONFIG_REG_BITS_SILICON_TYPE_A    (0x00000000)
++#define CSR_HW_IF_CONFIG_REG_BITS_SILICON_TYPE_B    (0x00001000)
++#define CSR_HW_IF_CONFIG_REG_BIT_EEPROM_OWN_SEM     (0x00200000)
++
++/* interrupt flags in INTA, set by uCode or hardware (e.g. dma),
++ * acknowledged (reset) by host writing "1" to flagged bits. */
++#define CSR_INT_BIT_FH_RX        (1<<31) /* Rx DMA, cmd responses, FH_INT[17:16] */
++#define CSR_INT_BIT_HW_ERR       (1<<29) /* DMA hardware error FH_INT[31] */
++#define CSR_INT_BIT_DNLD         (1<<28) /* uCode Download */
++#define CSR_INT_BIT_FH_TX        (1<<27) /* Tx DMA FH_INT[1:0] */
++#define CSR_INT_BIT_MAC_CLK_ACTV (1<<26) /* NIC controller's clock toggled on/off */
++#define CSR_INT_BIT_SW_ERR       (1<<25) /* uCode error */
++#define CSR_INT_BIT_RF_KILL      (1<<7)  /* HW RFKILL switch GP_CNTRL[27] toggled */
++#define CSR_INT_BIT_CT_KILL      (1<<6)  /* Critical temp (chip too hot) rfkill */
++#define CSR_INT_BIT_SW_RX        (1<<3)  /* Rx, command responses, 3945 */
++#define CSR_INT_BIT_WAKEUP       (1<<1)  /* NIC controller waking up (pwr mgmt) */
++#define CSR_INT_BIT_ALIVE        (1<<0)  /* uCode interrupts once it initializes */
++
++#define CSR_INI_SET_MASK	(CSR_INT_BIT_FH_RX   | \
++				 CSR_INT_BIT_HW_ERR  | \
++				 CSR_INT_BIT_FH_TX   | \
++				 CSR_INT_BIT_SW_ERR  | \
++				 CSR_INT_BIT_RF_KILL | \
++				 CSR_INT_BIT_SW_RX   | \
++				 CSR_INT_BIT_WAKEUP  | \
++				 CSR_INT_BIT_ALIVE)
++
++/* interrupt flags in FH (flow handler) (PCI busmaster DMA) */
++#define CSR_FH_INT_BIT_ERR       (1<<31) /* Error */
++#define CSR_FH_INT_BIT_HI_PRIOR  (1<<30) /* High priority Rx, bypass coalescing */
++#define CSR_FH_INT_BIT_RX_CHNL2  (1<<18) /* Rx channel 2 (3945 only) */
++#define CSR_FH_INT_BIT_RX_CHNL1  (1<<17) /* Rx channel 1 */
++#define CSR_FH_INT_BIT_RX_CHNL0  (1<<16) /* Rx channel 0 */
++#define CSR_FH_INT_BIT_TX_CHNL6  (1<<6)  /* Tx channel 6 (3945 only) */
++#define CSR_FH_INT_BIT_TX_CHNL1  (1<<1)  /* Tx channel 1 */
++#define CSR_FH_INT_BIT_TX_CHNL0  (1<<0)  /* Tx channel 0 */
++
++#define CSR_FH_INT_RX_MASK	(CSR_FH_INT_BIT_HI_PRIOR | \
++				 CSR_FH_INT_BIT_RX_CHNL2 | \
++				 CSR_FH_INT_BIT_RX_CHNL1 | \
++				 CSR_FH_INT_BIT_RX_CHNL0)
++
++#define CSR_FH_INT_TX_MASK	(CSR_FH_INT_BIT_TX_CHNL6 | \
++				 CSR_FH_INT_BIT_TX_CHNL1 | \
++				 CSR_FH_INT_BIT_TX_CHNL0 )
++
++
++/* RESET */
++#define CSR_RESET_REG_FLAG_NEVO_RESET                (0x00000001)
++#define CSR_RESET_REG_FLAG_FORCE_NMI                 (0x00000002)
++#define CSR_RESET_REG_FLAG_SW_RESET                  (0x00000080)
++#define CSR_RESET_REG_FLAG_MASTER_DISABLED           (0x00000100)
++#define CSR_RESET_REG_FLAG_STOP_MASTER               (0x00000200)
++
++/* GP (general purpose) CONTROL */
++#define CSR_GP_CNTRL_REG_FLAG_MAC_CLOCK_READY        (0x00000001)
++#define CSR_GP_CNTRL_REG_FLAG_INIT_DONE              (0x00000004)
++#define CSR_GP_CNTRL_REG_FLAG_MAC_ACCESS_REQ         (0x00000008)
++#define CSR_GP_CNTRL_REG_FLAG_GOING_TO_SLEEP         (0x00000010)
++
++#define CSR_GP_CNTRL_REG_VAL_MAC_ACCESS_EN           (0x00000001)
++
++#define CSR_GP_CNTRL_REG_MSK_POWER_SAVE_TYPE         (0x07000000)
++#define CSR_GP_CNTRL_REG_FLAG_MAC_POWER_SAVE         (0x04000000)
++#define CSR_GP_CNTRL_REG_FLAG_HW_RF_KILL_SW          (0x08000000)
++
++
++/* EEPROM REG */
++#define CSR_EEPROM_REG_READ_VALID_MSK	(0x00000001)
++#define CSR_EEPROM_REG_BIT_CMD		(0x00000002)
++
++/* EEPROM GP */
++#define CSR_EEPROM_GP_VALID_MSK		(0x00000006)
++#define CSR_EEPROM_GP_BAD_SIGNATURE	(0x00000000)
++#define CSR_EEPROM_GP_IF_OWNER_MSK	(0x00000180)
++
++/* UCODE DRV GP */
++#define CSR_UCODE_DRV_GP1_BIT_MAC_SLEEP             (0x00000001)
++#define CSR_UCODE_SW_BIT_RFKILL                     (0x00000002)
++#define CSR_UCODE_DRV_GP1_BIT_CMD_BLOCKED           (0x00000004)
++#define CSR_UCODE_DRV_GP1_REG_BIT_CT_KILL_EXIT      (0x00000008)
++
++/* GPIO */
++#define CSR_GPIO_IN_BIT_AUX_POWER                   (0x00000200)
++#define CSR_GPIO_IN_VAL_VAUX_PWR_SRC                (0x00000000)
++#define CSR_GPIO_IN_VAL_VMAIN_PWR_SRC		CSR_GPIO_IN_BIT_AUX_POWER
++
++/* GI Chicken Bits */
++#define CSR_GIO_CHICKEN_BITS_REG_BIT_L1A_NO_L0S_RX  (0x00800000)
++#define CSR_GIO_CHICKEN_BITS_REG_BIT_DIS_L0S_EXIT_TIMER  (0x20000000)
++
++/* CSR_ANA_PLL_CFG */
++#define CSR_ANA_PLL_CFG_SH		(0x00880300)
++
++#define CSR_LED_REG_TRUN_ON		(0x00000078)
++#define CSR_LED_REG_TRUN_OFF		(0x00000038)
++#define CSR_LED_BSM_CTRL_MSK		(0xFFFFFFDF)
++
++/* DRAM_INT_TBL_CTRL */
++#define CSR_DRAM_INT_TBL_CTRL_EN	(1<<31)
++#define CSR_DRAM_INT_TBL_CTRL_WRAP_CHK	(1<<27)
++
++/*=== HBUS (Host-side Bus) ===*/
++#define HBUS_BASE	(0x400)
++
++#define HBUS_TARG_MEM_RADDR     (HBUS_BASE+0x00c)
++#define HBUS_TARG_MEM_WADDR     (HBUS_BASE+0x010)
++#define HBUS_TARG_MEM_WDAT      (HBUS_BASE+0x018)
++#define HBUS_TARG_MEM_RDAT      (HBUS_BASE+0x01c)
++#define HBUS_TARG_PRPH_WADDR    (HBUS_BASE+0x044)
++#define HBUS_TARG_PRPH_RADDR    (HBUS_BASE+0x048)
++#define HBUS_TARG_PRPH_WDAT     (HBUS_BASE+0x04c)
++#define HBUS_TARG_PRPH_RDAT     (HBUS_BASE+0x050)
++#define HBUS_TARG_WRPTR         (HBUS_BASE+0x060)
++
++#define HBUS_TARG_MBX_C         (HBUS_BASE+0x030)
++
++
++/* SCD (Scheduler) */
++#define SCD_BASE                        (CSR_BASE + 0x2E00)
++
++#define SCD_MODE_REG                    (SCD_BASE + 0x000)
++#define SCD_ARASTAT_REG                 (SCD_BASE + 0x004)
++#define SCD_TXFACT_REG                  (SCD_BASE + 0x010)
++#define SCD_TXF4MF_REG                  (SCD_BASE + 0x014)
++#define SCD_TXF5MF_REG                  (SCD_BASE + 0x020)
++#define SCD_SBYP_MODE_1_REG             (SCD_BASE + 0x02C)
++#define SCD_SBYP_MODE_2_REG             (SCD_BASE + 0x030)
++
++/*=== FH (data Flow Handler) ===*/
++#define FH_BASE     (0x800)
++
++#define FH_CBCC_TABLE           (FH_BASE+0x140)
++#define FH_TFDB_TABLE           (FH_BASE+0x180)
++#define FH_RCSR_TABLE           (FH_BASE+0x400)
++#define FH_RSSR_TABLE           (FH_BASE+0x4c0)
++#define FH_TCSR_TABLE           (FH_BASE+0x500)
++#define FH_TSSR_TABLE           (FH_BASE+0x680)
++
++/* TFDB (Transmit Frame Buffer Descriptor) */
++#define FH_TFDB(_channel, buf) \
++	(FH_TFDB_TABLE+((_channel)*2+(buf))*0x28)
++#define ALM_FH_TFDB_CHNL_BUF_CTRL_REG(_channel) \
++	(FH_TFDB_TABLE + 0x50 * _channel)
++/* CBCC _channel is [0,2] */
++#define FH_CBCC(_channel)           (FH_CBCC_TABLE+(_channel)*0x8)
++#define FH_CBCC_CTRL(_channel)      (FH_CBCC(_channel)+0x00)
++#define FH_CBCC_BASE(_channel)      (FH_CBCC(_channel)+0x04)
++
++/* RCSR _channel is [0,2] */
++#define FH_RCSR(_channel)           (FH_RCSR_TABLE+(_channel)*0x40)
++#define FH_RCSR_CONFIG(_channel)    (FH_RCSR(_channel)+0x00)
++#define FH_RCSR_RBD_BASE(_channel)  (FH_RCSR(_channel)+0x04)
++#define FH_RCSR_WPTR(_channel)      (FH_RCSR(_channel)+0x20)
++#define FH_RCSR_RPTR_ADDR(_channel) (FH_RCSR(_channel)+0x24)
++
++#if IWL == 3945
++#define FH_RSCSR_CHNL0_WPTR        (FH_RCSR_WPTR(0))
++#elif IWL == 4965
++#define FH_RSCSR_CHNL0_WPTR        (FH_RSCSR_CHNL0_RBDCB_WPTR_REG)
++#endif
++
++/* RSSR */
++#define FH_RSSR_CTRL            (FH_RSSR_TABLE+0x000)
++#define FH_RSSR_STATUS          (FH_RSSR_TABLE+0x004)
++/* TCSR */
++#define FH_TCSR(_channel)           (FH_TCSR_TABLE+(_channel)*0x20)
++#define FH_TCSR_CONFIG(_channel)    (FH_TCSR(_channel)+0x00)
++#define FH_TCSR_CREDIT(_channel)    (FH_TCSR(_channel)+0x04)
++#define FH_TCSR_BUFF_STTS(_channel) (FH_TCSR(_channel)+0x08)
++/* TSSR */
++#define FH_TSSR_CBB_BASE        (FH_TSSR_TABLE+0x000)
++#define FH_TSSR_MSG_CONFIG      (FH_TSSR_TABLE+0x008)
++#define FH_TSSR_TX_STATUS       (FH_TSSR_TABLE+0x010)
++/* 18 - reserved */
++
++/* card static random access memory (SRAM) for processor data and instructs */
++#define RTC_INST_LOWER_BOUND			(0x000000)
++#define RTC_DATA_LOWER_BOUND			(0x800000)
++
++
++/* DBM */
++
++#define ALM_FH_SRVC_CHNL                            (6)
++
++#define ALM_FH_RCSR_RX_CONFIG_REG_POS_RBDC_SIZE     (20)
++#define ALM_FH_RCSR_RX_CONFIG_REG_POS_IRQ_RBTH      (4)
++
++#define ALM_FH_RCSR_RX_CONFIG_REG_BIT_WR_STTS_EN    (0x08000000)
++
++#define ALM_FH_RCSR_RX_CONFIG_REG_VAL_DMA_CHNL_EN_ENABLE        (0x80000000)
++
++#define ALM_FH_RCSR_RX_CONFIG_REG_VAL_RDRBD_EN_ENABLE           (0x20000000)
++
++#define ALM_FH_RCSR_RX_CONFIG_REG_VAL_MAX_FRAG_SIZE_128         (0x01000000)
++
++#define ALM_FH_RCSR_RX_CONFIG_REG_VAL_IRQ_DEST_INT_HOST         (0x00001000)
++
++#define ALM_FH_RCSR_RX_CONFIG_REG_VAL_MSG_MODE_FH               (0x00000000)
++
++#define ALM_FH_TCSR_TX_CONFIG_REG_VAL_MSG_MODE_TXF              (0x00000000)
++#define ALM_FH_TCSR_TX_CONFIG_REG_VAL_MSG_MODE_DRIVER           (0x00000001)
++
++#define ALM_FH_TCSR_TX_CONFIG_REG_VAL_DMA_CREDIT_DISABLE_VAL    (0x00000000)
++#define ALM_FH_TCSR_TX_CONFIG_REG_VAL_DMA_CREDIT_ENABLE_VAL     (0x00000008)
++
++#define ALM_FH_TCSR_TX_CONFIG_REG_VAL_CIRQ_HOST_IFTFD           (0x00200000)
++
++#define ALM_FH_TCSR_TX_CONFIG_REG_VAL_CIRQ_RTC_NOINT            (0x00000000)
++
++#define ALM_FH_TCSR_TX_CONFIG_REG_VAL_DMA_CHNL_PAUSE            (0x00000000)
++#define ALM_FH_TCSR_TX_CONFIG_REG_VAL_DMA_CHNL_ENABLE           (0x80000000)
++
++#define ALM_FH_TCSR_CHNL_TX_BUF_STS_REG_VAL_TFDB_VALID          (0x00004000)
++
++#define ALM_FH_TCSR_CHNL_TX_BUF_STS_REG_BIT_TFDB_WPTR           (0x00000001)
++
++#define ALM_FH_TSSR_TX_MSG_CONFIG_REG_VAL_SNOOP_RD_TXPD_ON      (0xFF000000)
++#define ALM_FH_TSSR_TX_MSG_CONFIG_REG_VAL_ORDER_RD_TXPD_ON      (0x00FF0000)
++
++#define ALM_FH_TSSR_TX_MSG_CONFIG_REG_VAL_MAX_FRAG_SIZE_128B    (0x00000400)
++
++#define ALM_FH_TSSR_TX_MSG_CONFIG_REG_VAL_SNOOP_RD_TFD_ON       (0x00000100)
++#define ALM_FH_TSSR_TX_MSG_CONFIG_REG_VAL_ORDER_RD_CBB_ON       (0x00000080)
++
++#define ALM_FH_TSSR_TX_MSG_CONFIG_REG_VAL_ORDER_RSP_WAIT_TH     (0x00000020)
++#define ALM_FH_TSSR_TX_MSG_CONFIG_REG_VAL_RSP_WAIT_TH           (0x00000005)
++
++#define ALM_TB_MAX_BYTES_COUNT      (0xFFF0)
++
++#define ALM_FH_TSSR_TX_STATUS_REG_BIT_BUFS_EMPTY(_channel) \
++	((1LU << _channel) << 24)
++#define ALM_FH_TSSR_TX_STATUS_REG_BIT_NO_PEND_REQ(_channel) \
++	((1LU << _channel) << 16)
++
++#define ALM_FH_TSSR_TX_STATUS_REG_MSK_CHNL_IDLE(_channel) \
++	(ALM_FH_TSSR_TX_STATUS_REG_BIT_BUFS_EMPTY(_channel) | \
++	 ALM_FH_TSSR_TX_STATUS_REG_BIT_NO_PEND_REQ(_channel))
++#define PCI_CFG_REV_ID_BIT_BASIC_SKU                (0x40)	/* bit 6    */
++#define PCI_CFG_REV_ID_BIT_RTP                      (0x80)	/* bit 7    */
++
++#define HBUS_TARG_MBX_C_REG_BIT_CMD_BLOCKED         (0x00000004)
++
++#define TFD_QUEUE_MIN           0
++#define TFD_QUEUE_MAX           6
++#define TFD_QUEUE_SIZE_MAX      (256)
++
++/* spectrum and channel data structures */
++#define IWL_NUM_SCAN_RATES         (2)
++
++#define IWL_SCAN_FLAG_24GHZ  (1<<0)
++#define IWL_SCAN_FLAG_52GHZ  (1<<1)
++#define IWL_SCAN_FLAG_ACTIVE (1<<2)
++#define IWL_SCAN_FLAG_DIRECT (1<<3)
++
++#define IWL_MAX_CMD_SIZE 1024
++
++#define IWL_DEFAULT_TX_RETRY  15
++#define IWL_MAX_TX_RETRY      16
++
++/*********************************************/
++
++#define RFD_SIZE                              4
++#define NUM_TFD_CHUNKS                        4
++
++#define RX_QUEUE_SIZE                         256
++#define RX_QUEUE_MASK                         255
++#define RX_QUEUE_SIZE_LOG                     8
++
++/* QoS  definitions */
++
++#define CW_MIN_OFDM          15
++#define CW_MAX_OFDM          1023
++#define CW_MIN_CCK           31
++#define CW_MAX_CCK           1023
++
++#define QOS_TX0_CW_MIN_OFDM      CW_MIN_OFDM
++#define QOS_TX1_CW_MIN_OFDM      CW_MIN_OFDM
++#define QOS_TX2_CW_MIN_OFDM      ((CW_MIN_OFDM + 1) / 2 - 1)
++#define QOS_TX3_CW_MIN_OFDM      ((CW_MIN_OFDM + 1) / 4 - 1)
++
++#define QOS_TX0_CW_MIN_CCK       CW_MIN_CCK
++#define QOS_TX1_CW_MIN_CCK       CW_MIN_CCK
++#define QOS_TX2_CW_MIN_CCK       ((CW_MIN_CCK + 1) / 2 - 1)
++#define QOS_TX3_CW_MIN_CCK       ((CW_MIN_CCK + 1) / 4 - 1)
++
++#define QOS_TX0_CW_MAX_OFDM      CW_MAX_OFDM
++#define QOS_TX1_CW_MAX_OFDM      CW_MAX_OFDM
++#define QOS_TX2_CW_MAX_OFDM      CW_MIN_OFDM
++#define QOS_TX3_CW_MAX_OFDM      ((CW_MIN_OFDM + 1) / 2 - 1)
++
++#define QOS_TX0_CW_MAX_CCK       CW_MAX_CCK
++#define QOS_TX1_CW_MAX_CCK       CW_MAX_CCK
++#define QOS_TX2_CW_MAX_CCK       CW_MIN_CCK
++#define QOS_TX3_CW_MAX_CCK       ((CW_MIN_CCK + 1) / 2 - 1)
++
++#define QOS_TX0_AIFS            3
++#define QOS_TX1_AIFS            7
++#define QOS_TX2_AIFS            2
++#define QOS_TX3_AIFS            2
++
++#define QOS_TX0_ACM             0
++#define QOS_TX1_ACM             0
++#define QOS_TX2_ACM             0
++#define QOS_TX3_ACM             0
++
++#define QOS_TX0_TXOP_LIMIT_CCK          0
++#define QOS_TX1_TXOP_LIMIT_CCK          0
++#define QOS_TX2_TXOP_LIMIT_CCK          6016
++#define QOS_TX3_TXOP_LIMIT_CCK          3264
++
++#define QOS_TX0_TXOP_LIMIT_OFDM      0
++#define QOS_TX1_TXOP_LIMIT_OFDM      0
++#define QOS_TX2_TXOP_LIMIT_OFDM      3008
++#define QOS_TX3_TXOP_LIMIT_OFDM      1504
++
++#define DEF_TX0_CW_MIN_OFDM      CW_MIN_OFDM
++#define DEF_TX1_CW_MIN_OFDM      CW_MIN_OFDM
++#define DEF_TX2_CW_MIN_OFDM      CW_MIN_OFDM
++#define DEF_TX3_CW_MIN_OFDM      CW_MIN_OFDM
++
++#define DEF_TX0_CW_MIN_CCK       CW_MIN_CCK
++#define DEF_TX1_CW_MIN_CCK       CW_MIN_CCK
++#define DEF_TX2_CW_MIN_CCK       CW_MIN_CCK
++#define DEF_TX3_CW_MIN_CCK       CW_MIN_CCK
++
++#define DEF_TX0_CW_MAX_OFDM      CW_MAX_OFDM
++#define DEF_TX1_CW_MAX_OFDM      CW_MAX_OFDM
++#define DEF_TX2_CW_MAX_OFDM      CW_MAX_OFDM
++#define DEF_TX3_CW_MAX_OFDM      CW_MAX_OFDM
++
++#define DEF_TX0_CW_MAX_CCK       CW_MAX_CCK
++#define DEF_TX1_CW_MAX_CCK       CW_MAX_CCK
++#define DEF_TX2_CW_MAX_CCK       CW_MAX_CCK
++#define DEF_TX3_CW_MAX_CCK       CW_MAX_CCK
++
++#define DEF_TX0_AIFS            (2)
++#define DEF_TX1_AIFS            (2)
++#define DEF_TX2_AIFS            (2)
++#define DEF_TX3_AIFS            (2)
++
++#define DEF_TX0_ACM             0
++#define DEF_TX1_ACM             0
++#define DEF_TX2_ACM             0
++#define DEF_TX3_ACM             0
++
++#define DEF_TX0_TXOP_LIMIT_CCK        0
++#define DEF_TX1_TXOP_LIMIT_CCK        0
++#define DEF_TX2_TXOP_LIMIT_CCK        0
++#define DEF_TX3_TXOP_LIMIT_CCK        0
++
++#define DEF_TX0_TXOP_LIMIT_OFDM       0
++#define DEF_TX1_TXOP_LIMIT_OFDM       0
++#define DEF_TX2_TXOP_LIMIT_OFDM       0
++#define DEF_TX3_TXOP_LIMIT_OFDM       0
++
++#define QOS_QOS_SETS                  3
++#define QOS_PARAM_SET_ACTIVE          0
++#define QOS_PARAM_SET_DEF_CCK         1
++#define QOS_PARAM_SET_DEF_OFDM        2
++
++#define CTRL_QOS_NO_ACK               (0x0020)
++#define DCT_FLAG_EXT_QOS_ENABLED      (0x10)
++
++#define U32_PAD(n)		((4-(n))&0x3)
++
++/*
++ * Generic queue structure
++ *
++ * Contains common data for Rx and Tx queues
++ */
++#define TFD_CTL_COUNT_SET(n)       (n<<24)
++#define TFD_CTL_COUNT_GET(ctl)     ((ctl>>24) & 7)
++#define TFD_CTL_PAD_SET(n)         (n<<28)
++#define TFD_CTL_PAD_GET(ctl)       (ctl>>28)
++
++#define TFD_TX_CMD_SLOTS 256
++#define TFD_CMD_SLOTS 32
++
++#define TFD_MAX_PAYLOAD_SIZE (sizeof(struct iwl_cmd) - \
++			      sizeof(struct iwl_cmd_meta))
++
++/*
++ * RX related structures and functions
++ */
++#define RX_FREE_BUFFERS 64
++#define RX_LOW_WATERMARK 8
++
++#endif				/* __iwlwifi_hw_h__ */
+diff --git a/drivers/net/wireless/iwl-io.h b/drivers/net/wireless/iwl-io.h
+new file mode 100644
+index 0000000..8a8b96f
+--- /dev/null
++++ b/drivers/net/wireless/iwl-io.h
+@@ -0,0 +1,470 @@
++/******************************************************************************
++ *
++ * Copyright(c) 2003 - 2007 Intel Corporation. All rights reserved.
++ *
++ * Portions of this file are derived from the ipw3945 project.
++ *
++ * This program is free software; you can redistribute it and/or modify it
++ * under the terms of version 2 of the GNU General Public License as
++ * published by the Free Software Foundation.
++ *
++ * 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.,
++ * 51 Franklin Street, Fifth Floor, Boston, MA 02110, USA
++ *
++ * The full GNU General Public License is included in this distribution in the
++ * file called LICENSE.
++ *
++ * Contact Information:
++ * James P. Ketrenos <ipw2100-admin at linux.intel.com>
++ * Intel Corporation, 5200 N.E. Elam Young Parkway, Hillsboro, OR 97124-6497
++ *
++ *****************************************************************************/
++
++#ifndef __iwl_io_h__
++#define __iwl_io_h__
++
++#include <linux/io.h>
++
++#include "iwl-debug.h"
++
++/*
++ * IO, register, and NIC memory access functions
++ *
++ * NOTE on naming convention and macro usage for these
++ *
++ * A single _ prefix before a an access function means that no state
++ * check or debug information is printed when that function is called.
++ *
++ * A double __ prefix before an access function means that state is checked
++ * (in the case of *restricted calls) and the current line number is printed
++ * in addition to any other debug output.
++ *
++ * The non-prefixed name is the #define that maps the caller into a
++ * #define that provides the caller's __LINE__ to the double prefix version.
++ *
++ * If you wish to call the function without any debug or state checking,
++ * you should use the single _ prefix version (as is used by dependent IO
++ * routines, for example _iwl_read_restricted calls the non-check version of
++ * _iwl_read32.)
++ *
++ * These declarations are *extremely* useful in quickly isolating code deltas
++ * which result in misconfiguring of the hardware I/O.  In combination with
++ * git-bisect and the IO debug level you can quickly determine the specific
++ * commit which breaks the IO sequence to the hardware.
++ *
++ */
++
++#define _iwl_write32(iwl, ofs, val) writel((val), (iwl)->hw_base + (ofs))
++#ifdef CONFIG_IWLWIFI_DEBUG
++static inline void __iwl_write32(const char *f, u32 l, struct iwl_priv *iwl,
++				 u32 ofs, u32 val)
++{
++	IWL_DEBUG_IO("write_direct32(0x%08X, 0x%08X) - %s %d\n",
++		     (u32) (ofs), (u32) (val), f, l);
++	_iwl_write32(iwl, ofs, val);
++}
++#define iwl_write32(iwl, ofs, val) \
++	__iwl_write32(__FILE__, __LINE__, iwl, ofs, val)
++#else
++#define iwl_write32(iwl, ofs, val) _iwl_write32(iwl, ofs, val)
++#endif
++
++#define _iwl_read32(iwl, ofs) readl((iwl)->hw_base + (ofs))
++#ifdef CONFIG_IWLWIFI_DEBUG
++static inline u32 __iwl_read32(char *f, u32 l, struct iwl_priv *iwl, u32 ofs)
++{
++	IWL_DEBUG_IO("read_direct32(0x%08X) - %s %d\n", ofs, f, l);
++	return _iwl_read32(iwl, ofs);
++}
++#define iwl_read32(iwl, ofs) __iwl_read32(__FILE__, __LINE__, iwl, ofs)
++#else
++#define iwl_read32(p, o) _iwl_read32(p, o)
++#endif
++
++static inline int _iwl_poll_bit(struct iwl_priv *priv, u32 addr,
++				u32 bits, u32 mask, int timeout)
++{
++	int i = 0;
++
++	do {
++		if ((_iwl_read32(priv, addr) & mask) == (bits & mask))
++			return i;
++		mdelay(10);
++		i += 10;
++	} while (i < timeout);
++
++	return -ETIMEDOUT;
++}
++#ifdef CONFIG_IWLWIFI_DEBUG
++static inline int __iwl_poll_bit(const char *f, u32 l,
++				 struct iwl_priv *priv, u32 addr,
++				 u32 bits, u32 mask, int timeout)
++{
++	int rc = _iwl_poll_bit(priv, addr, bits, mask, timeout);
++	if (unlikely(rc == -ETIMEDOUT))
++		IWL_DEBUG_IO
++		    ("poll_bit(0x%08X, 0x%08X, 0x%08X) - timedout - %s %d\n",
++		     addr, bits, mask, f, l);
++	else
++		IWL_DEBUG_IO
++		    ("poll_bit(0x%08X, 0x%08X, 0x%08X) = 0x%08X - %s %d\n",
++		     addr, bits, mask, rc, f, l);
++	return rc;
++}
++#define iwl_poll_bit(iwl, addr, bits, mask, timeout) \
++	__iwl_poll_bit(__FILE__, __LINE__, iwl, addr, bits, mask, timeout)
++#else
++#define iwl_poll_bit(p, a, b, m, t) _iwl_poll_bit(p, a, b, m, t)
++#endif
++
++static inline void _iwl_set_bit(struct iwl_priv *priv, u32 reg, u32 mask)
++{
++	_iwl_write32(priv, reg, _iwl_read32(priv, reg) | mask);
++}
++#ifdef CONFIG_IWLWIFI_DEBUG
++static inline void __iwl_set_bit(const char *f, u32 l,
++				 struct iwl_priv *priv, u32 reg, u32 mask)
++{
++	u32 val = _iwl_read32(priv, reg) | mask;
++	IWL_DEBUG_IO("set_bit(0x%08X, 0x%08X) = 0x%08X\n", reg, mask, val);
++	_iwl_write32(priv, reg, val);
++}
++#define iwl_set_bit(p, r, m) __iwl_set_bit(__FILE__, __LINE__, p, r, m)
++#else
++#define iwl_set_bit(p, r, m) _iwl_set_bit(p, r, m)
++#endif
++
++static inline void _iwl_clear_bit(struct iwl_priv *priv, u32 reg, u32 mask)
++{
++	_iwl_write32(priv, reg, _iwl_read32(priv, reg) & ~mask);
++}
++#ifdef CONFIG_IWLWIFI_DEBUG
++static inline void __iwl_clear_bit(const char *f, u32 l,
++				   struct iwl_priv *priv, u32 reg, u32 mask)
++{
++	u32 val = _iwl_read32(priv, reg) & ~mask;
++	IWL_DEBUG_IO("clear_bit(0x%08X, 0x%08X) = 0x%08X\n", reg, mask, val);
++	_iwl_write32(priv, reg, val);
++}
++#define iwl_clear_bit(p, r, m) __iwl_clear_bit(__FILE__, __LINE__, p, r, m)
++#else
++#define iwl_clear_bit(p, r, m) _iwl_clear_bit(p, r, m)
++#endif
++
++static inline int _iwl_grab_restricted_access(struct iwl_priv *priv)
++{
++	int rc;
++	u32 gp_ctl;
++
++#ifdef CONFIG_IWLWIFI_DEBUG
++	if (atomic_read(&priv->restrict_refcnt))
++		return 0;
++#endif
++	if (test_bit(STATUS_RF_KILL_HW, &priv->status) ||
++	    test_bit(STATUS_RF_KILL_SW, &priv->status)) {
++		IWL_WARNING("WARNING: Requesting MAC access during RFKILL "
++			"wakes up NIC\n");
++
++		/* 10 msec allows time for NIC to complete its data save */
++		gp_ctl = _iwl_read32(priv, CSR_GP_CNTRL);
++		if (gp_ctl & CSR_GP_CNTRL_REG_FLAG_MAC_CLOCK_READY) {
++			IWL_DEBUG_RF_KILL("Wait for complete power-down, "
++				"gpctl = 0x%08x\n", gp_ctl);
++			mdelay(10);
++		} else
++			IWL_DEBUG_RF_KILL("power-down complete, "
++					  "gpctl = 0x%08x\n", gp_ctl);
++	}
++
++	/* this bit wakes up the NIC */
++	_iwl_set_bit(priv, CSR_GP_CNTRL, CSR_GP_CNTRL_REG_FLAG_MAC_ACCESS_REQ);
++	rc = _iwl_poll_bit(priv, CSR_GP_CNTRL,
++			   CSR_GP_CNTRL_REG_VAL_MAC_ACCESS_EN,
++			   (CSR_GP_CNTRL_REG_FLAG_MAC_CLOCK_READY |
++			    CSR_GP_CNTRL_REG_FLAG_GOING_TO_SLEEP), 50);
++	if (rc < 0) {
++		IWL_ERROR("MAC is in deep sleep!\n");
++		return -EIO;
++	}
++
++#ifdef CONFIG_IWLWIFI_DEBUG
++	atomic_inc(&priv->restrict_refcnt);
++#endif
++	return 0;
++}
++
++#ifdef CONFIG_IWLWIFI_DEBUG
++static inline int __iwl_grab_restricted_access(const char *f, u32 l,
++					       struct iwl_priv *priv)
++{
++	if (atomic_read(&priv->restrict_refcnt))
++		IWL_DEBUG_INFO("Grabbing access while already held at "
++			       "line %d.\n", l);
++
++	IWL_DEBUG_IO("grabbing restricted access - %s %d\n", f, l);
++
++	return _iwl_grab_restricted_access(priv);
++}
++#define iwl_grab_restricted_access(priv) \
++	__iwl_grab_restricted_access(__FILE__, __LINE__, priv)
++#else
++#define iwl_grab_restricted_access(priv) \
++	_iwl_grab_restricted_access(priv)
++#endif
++
++static inline void _iwl_release_restricted_access(struct iwl_priv *priv)
++{
++#ifdef CONFIG_IWLWIFI_DEBUG
++	if (atomic_dec_and_test(&priv->restrict_refcnt))
++#endif
++		_iwl_clear_bit(priv, CSR_GP_CNTRL,
++			       CSR_GP_CNTRL_REG_FLAG_MAC_ACCESS_REQ);
++}
++#ifdef CONFIG_IWLWIFI_DEBUG
++static inline void __iwl_release_restricted_access(const char *f, u32 l,
++						   struct iwl_priv *priv)
++{
++	if (atomic_read(&priv->restrict_refcnt) <= 0)
++		IWL_ERROR("Release unheld restricted access at line %d.\n", l);
++
++	IWL_DEBUG_IO("releasing restricted access - %s %d\n", f, l);
++	_iwl_release_restricted_access(priv);
++}
++#define iwl_release_restricted_access(priv) \
++	__iwl_release_restricted_access(__FILE__, __LINE__, priv)
++#else
++#define iwl_release_restricted_access(priv) \
++	_iwl_release_restricted_access(priv)
++#endif
++
++static inline u32 _iwl_read_restricted(struct iwl_priv *priv, u32 reg)
++{
++	return _iwl_read32(priv, reg);
++}
++#ifdef CONFIG_IWLWIFI_DEBUG
++static inline u32 __iwl_read_restricted(const char *f, u32 l,
++					struct iwl_priv *priv, u32 reg)
++{
++	u32 value = _iwl_read_restricted(priv, reg);
++	if (!atomic_read(&priv->restrict_refcnt))
++		IWL_ERROR("Unrestricted access from %s %d\n", f, l);
++	IWL_DEBUG_IO("read_restricted(0x%4X) = 0x%08x - %s %d \n", reg, value,
++		     f, l);
++	return value;
++}
++#define iwl_read_restricted(priv, reg) \
++	__iwl_read_restricted(__FILE__, __LINE__, priv, reg)
++#else
++#define iwl_read_restricted _iwl_read_restricted
++#endif
++
++static inline void _iwl_write_restricted(struct iwl_priv *priv,
++					 u32 reg, u32 value)
++{
++	_iwl_write32(priv, reg, value);
++}
++#ifdef CONFIG_IWLWIFI_DEBUG
++static void __iwl_write_restricted(u32 line,
++				   struct iwl_priv *priv, u32 reg, u32 value)
++{
++	if (!atomic_read(&priv->restrict_refcnt))
++		IWL_ERROR("Unrestricted access from line %d\n", line);
++	_iwl_write_restricted(priv, reg, value);
++}
++#define iwl_write_restricted(priv, reg, value) \
++	__iwl_write_restricted(__LINE__, priv, reg, value)
++#else
++#define iwl_write_restricted _iwl_write_restricted
++#endif
++
++static inline void iwl_write_buffer_restricted(struct iwl_priv *priv,
++					       u32 reg, u32 len, u32 *values)
++{
++	u32 count = sizeof(u32);
++
++	if ((priv != NULL) && (values != NULL)) {
++		for (; 0 < len; len -= count, reg += count, values++)
++			_iwl_write_restricted(priv, reg, *values);
++	}
++}
++
++static inline int _iwl_poll_restricted_bit(struct iwl_priv *priv,
++					   u32 addr, u32 mask, int timeout)
++{
++	int i = 0;
++
++	do {
++		if ((_iwl_read_restricted(priv, addr) & mask) == mask)
++			return i;
++		mdelay(10);
++		i += 10;
++	} while (i < timeout);
++
++	return -ETIMEDOUT;
++}
++
++#ifdef CONFIG_IWLWIFI_DEBUG
++static inline int __iwl_poll_restricted_bit(const char *f, u32 l,
++					    struct iwl_priv *priv,
++					    u32 addr, u32 mask, int timeout)
++{
++	int rc = _iwl_poll_restricted_bit(priv, addr, mask, timeout);
++
++	if (unlikely(rc == -ETIMEDOUT))
++		IWL_DEBUG_IO("poll_restricted_bit(0x%08X, 0x%08X) - "
++			     "timedout - %s %d\n", addr, mask, f, l);
++	else
++		IWL_DEBUG_IO("poll_restricted_bit(0x%08X, 0x%08X) = 0x%08X "
++			     "- %s %d\n", addr, mask, rc, f, l);
++	return rc;
++}
++#define iwl_poll_restricted_bit(iwl, addr, mask, timeout) \
++	__iwl_poll_restricted_bit(__FILE__, __LINE__, iwl, addr, mask, timeout)
++#else
++#define iwl_poll_restricted_bit _iwl_poll_restricted_bit
++#endif
++
++static inline u32 _iwl_read_restricted_reg(struct iwl_priv *priv, u32 reg)
++{
++	_iwl_write_restricted(priv, HBUS_TARG_PRPH_RADDR, reg | (3 << 24));
++	return _iwl_read_restricted(priv, HBUS_TARG_PRPH_RDAT);
++}
++#ifdef CONFIG_IWLWIFI_DEBUG
++static inline u32 __iwl_read_restricted_reg(u32 line,
++					    struct iwl_priv *priv, u32 reg)
++{
++	if (!atomic_read(&priv->restrict_refcnt))
++		IWL_ERROR("Unrestricted access from line %d\n", line);
++	return _iwl_read_restricted_reg(priv, reg);
++}
++
++#define iwl_read_restricted_reg(priv, reg) \
++	__iwl_read_restricted_reg(__LINE__, priv, reg)
++#else
++#define iwl_read_restricted_reg _iwl_read_restricted_reg
++#endif
++
++static inline void _iwl_write_restricted_reg(struct iwl_priv *priv,
++					     u32 addr, u32 val)
++{
++	_iwl_write_restricted(priv, HBUS_TARG_PRPH_WADDR,
++			      ((addr & 0x0000FFFF) | (3 << 24)));
++	_iwl_write_restricted(priv, HBUS_TARG_PRPH_WDAT, val);
++}
++#ifdef CONFIG_IWLWIFI_DEBUG
++static inline void __iwl_write_restricted_reg(u32 line,
++					      struct iwl_priv *priv,
++					      u32 addr, u32 val)
++{
++	if (!atomic_read(&priv->restrict_refcnt))
++		IWL_ERROR("Unrestricted access from line %d\n", line);
++	_iwl_write_restricted_reg(priv, addr, val);
++}
++
++#define iwl_write_restricted_reg(priv, addr, val) \
++	__iwl_write_restricted_reg(__LINE__, priv, addr, val);
++#else
++#define iwl_write_restricted_reg _iwl_write_restricted_reg
++#endif
++
++#define _iwl_set_bits_restricted_reg(priv, reg, mask) \
++	_iwl_write_restricted_reg(priv, reg, \
++				  (_iwl_read_restricted_reg(priv, reg) | mask))
++#ifdef CONFIG_IWLWIFI_DEBUG
++static inline void __iwl_set_bits_restricted_reg(u32 line, struct iwl_priv
++						 *priv, u32 reg, u32 mask)
++{
++	if (!atomic_read(&priv->restrict_refcnt))
++		IWL_ERROR("Unrestricted access from line %d\n", line);
++	_iwl_set_bits_restricted_reg(priv, reg, mask);
++}
++#define iwl_set_bits_restricted_reg(priv, reg, mask) \
++	__iwl_set_bits_restricted_reg(__LINE__, priv, reg, mask)
++#else
++#define iwl_set_bits_restricted_reg _iwl_set_bits_restricted_reg
++#endif
++
++#define _iwl_set_bits_mask_restricted_reg(priv, reg, bits, mask) \
++	_iwl_write_restricted_reg( \
++	    priv, reg, ((_iwl_read_restricted_reg(priv, reg) & mask) | bits))
++#ifdef CONFIG_IWLWIFI_DEBUG
++static inline void __iwl_set_bits_mask_restricted_reg(u32 line,
++		struct iwl_priv *priv, u32 reg, u32 bits, u32 mask)
++{
++	if (!atomic_read(&priv->restrict_refcnt))
++		IWL_ERROR("Unrestricted access from line %d\n", line);
++	_iwl_set_bits_mask_restricted_reg(priv, reg, bits, mask);
++}
++
++#define iwl_set_bits_mask_restricted_reg(priv, reg, bits, mask) \
++	__iwl_set_bits_mask_restricted_reg(__LINE__, priv, reg, bits, mask)
++#else
++#define iwl_set_bits_mask_restricted_reg _iwl_set_bits_mask_restricted_reg
++#endif
++
++static inline void iwl_clear_bits_restricted_reg(struct iwl_priv
++						 *priv, u32 reg, u32 mask)
++{
++	u32 val = _iwl_read_restricted_reg(priv, reg);
++	_iwl_write_restricted_reg(priv, reg, (val & ~mask));
++}
++
++static inline u32 iwl_read_restricted_mem(struct iwl_priv *priv, u32 addr)
++{
++	iwl_write_restricted(priv, HBUS_TARG_MEM_RADDR, addr);
++	return iwl_read_restricted(priv, HBUS_TARG_MEM_RDAT);
++}
++
++static inline void iwl_write_restricted_mem(struct iwl_priv *priv, u32 addr,
++					    u32 val)
++{
++	iwl_write_restricted(priv, HBUS_TARG_MEM_WADDR, addr);
++	iwl_write_restricted(priv, HBUS_TARG_MEM_WDAT, val);
++}
++
++static inline void iwl_write_restricted_mems(struct iwl_priv *priv, u32 addr,
++					     u32 len, u32 *values)
++{
++	iwl_write_restricted(priv, HBUS_TARG_MEM_WADDR, addr);
++	for (; 0 < len; len -= sizeof(u32), values++)
++		iwl_write_restricted(priv, HBUS_TARG_MEM_WDAT, *values);
++}
++
++static inline void iwl_write_restricted_regs(struct iwl_priv *priv, u32 reg,
++					     u32 len, u8 *values)
++{
++	u32 reg_offset = reg;
++	u32 aligment = reg & 0x3;
++
++	/* write any non-dword-aligned stuff at the beginning */
++	if (len < sizeof(u32)) {
++		if ((aligment + len) <= sizeof(u32)) {
++			u8 size;
++			u32 value = 0;
++			size = len - 1;
++			memcpy(&value, values, len);
++			reg_offset = (reg_offset & 0x0000FFFF);
++
++			_iwl_write_restricted(priv,
++					      HBUS_TARG_PRPH_WADDR,
++					      (reg_offset | (size << 24)));
++			_iwl_write_restricted(priv, HBUS_TARG_PRPH_WDAT,
++					      value);
++		}
++
++		return;
++	}
++
++	/* now write all the dword-aligned stuff */
++	for (; reg_offset < (reg + len);
++	     reg_offset += sizeof(u32), values += sizeof(u32))
++		_iwl_write_restricted_reg(priv, reg_offset, *((u32 *) values));
++}
++
++#endif
+diff --git a/drivers/net/wireless/iwl-priv.h b/drivers/net/wireless/iwl-priv.h
+new file mode 100644
+index 0000000..6b490d0
+--- /dev/null
++++ b/drivers/net/wireless/iwl-priv.h
+@@ -0,0 +1,308 @@
++/******************************************************************************
++ *
++ * Copyright(c) 2003 - 2007 Intel Corporation. All rights reserved.
++ *
++ * This program is free software; you can redistribute it and/or modify it
++ * under the terms of version 2 of the GNU General Public License as
++ * published by the Free Software Foundation.
++ *
++ * 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.,
++ * 51 Franklin Street, Fifth Floor, Boston, MA 02110, USA
++ *
++ * The full GNU General Public License is included in this distribution in the
++ * file called LICENSE.
++ *
++ * Contact Information:
++ * James P. Ketrenos <ipw2100-admin at linux.intel.com>
++ * Intel Corporation, 5200 N.E. Elam Young Parkway, Hillsboro, OR 97124-6497
++ *
++ *****************************************************************************/
++
++#ifndef __iwl_priv_h__
++#define __iwl_priv_h__
++
++#include <linux/workqueue.h>
++
++#ifdef CONFIG_IWLWIFI_SPECTRUM_MEASUREMENT
++
++enum {
++	MEASUREMENT_READY = (1 << 0),
++	MEASUREMENT_ACTIVE = (1 << 1),
++};
++
++#endif
++
++struct iwl_priv {
++
++	/* ieee device used by generic ieee processing code */
++	struct ieee80211_hw *hw;
++	struct ieee80211_channel *ieee_channels;
++	struct ieee80211_rate *ieee_rates;
++
++	/* temporary frame storage list */
++	struct list_head free_frames;
++	int frames_count;
++
++	u8 phymode;
++	int alloc_rxb_skb;
++
++	void (*rx_handlers[REPLY_MAX])(struct iwl_priv *priv,
++				       struct iwl_rx_mem_buffer *rxb);
++
++	const struct ieee80211_hw_mode *modes;
++
++#ifdef CONFIG_IWLWIFI_SPECTRUM_MEASUREMENT
++	/* spectrum measurement report caching */
++	struct iwl_spectrum_notification measure_report;
++	u8 measurement_status;
++#endif
++	/* ucode beacon time */
++	u32 ucode_beacon_time;
++
++	/* we allocate array of iwl_channel_info for NIC's valid channels.
++	 *    Access via channel # using indirect index array */
++	struct iwl_channel_info *channel_info;	/* channel info array */
++	u8 channel_count;	/* # of channels */
++
++	/* each calibration channel group in the EEPROM has a derived
++	 * clip setting for each rate. */
++	const struct iwl_clip_group clip_groups[5];
++
++	/* thermal calibration */
++	s32 temperature;	/* degrees Kelvin */
++	s32 last_temperature;
++
++	/* Scan related variables */
++	unsigned long last_scan_jiffies;
++	unsigned long scan_start;
++	unsigned long scan_pass_start;
++	unsigned long scan_start_tsf;
++	int scan_bands;
++	int one_direct_scan;
++	u8 direct_ssid_len;
++	u8 direct_ssid[IW_ESSID_MAX_SIZE];
++	struct iwl_scan_cmd *scan;
++	u8 only_active_channel;
++
++	/* spinlock */
++	spinlock_t lock;	/* protect general shared data */
++	spinlock_t hcmd_lock;	/* protect hcmd */
++	struct mutex mutex;
++
++	/* basic pci-network driver stuff */
++	struct pci_dev *pci_dev;
++
++	/* pci hardware address support */
++	void __iomem *hw_base;
++
++	/* uCode images, save to reload in case of failure */
++	struct fw_image_desc ucode_code;	/* runtime inst */
++	struct fw_image_desc ucode_data;	/* runtime data original */
++	struct fw_image_desc ucode_data_backup;	/* runtime data save/restore */
++	struct fw_image_desc ucode_init;	/* initialization inst */
++	struct fw_image_desc ucode_init_data;	/* initialization data */
++	struct fw_image_desc ucode_boot;	/* bootstrap inst */
++
++
++	struct iwl_rxon_time_cmd rxon_timing;
++
++	/* We declare this const so it can only be
++	 * changed via explicit cast within the
++	 * routines that actually update the physical
++	 * hardware */
++	const struct iwl_rxon_cmd active_rxon;
++	struct iwl_rxon_cmd staging_rxon;
++
++	int error_recovering;
++	struct iwl_rxon_cmd recovery_rxon;
++
++	/* 1st responses from initialize and runtime uCode images.
++	 * 4965's initialize alive response contains some calibration data. */
++	struct iwl_init_alive_resp card_alive_init;
++	struct iwl_alive_resp card_alive;
++
++#ifdef LED
++	/* LED related variables */
++	struct iwl_activity_blink activity;
++	unsigned long led_packets;
++	int led_state;
++#endif
++
++	u16 active_rate;
++	u16 active_rate_basic;
++
++	u8 call_post_assoc_from_beacon;
++	u8 assoc_station_added;
++#if IWL == 4965
++	u8 use_ant_b_for_management_frame;	/* Tx antenna selection */
++	/* HT variables */
++	u8 is_dup;
++	u8 is_ht_enabled;
++	u8 channel_width;	/* 0=20MHZ, 1=40MHZ */
++	u8 current_channel_width;
++	u8 valid_antenna;	/* Bit mask of antennas actually connected */
++#ifdef CONFIG_IWLWIFI_SENSITIVITY
++	struct iwl_sensitivity_data sensitivity_data;
++	struct iwl_chain_noise_data chain_noise_data;
++	u8 start_calib;
++	__le16 sensitivity_tbl[HD_TABLE_SIZE];
++#endif /*CONFIG_IWLWIFI_SENSITIVITY*/
++
++#ifdef CONFIG_IWLWIFI_HT
++	struct sta_ht_info current_assoc_ht;
++#endif
++	u8 active_rate_ht[2];
++	u8 last_phy_res[100];
++
++	/* Rate scaling data */
++	struct iwl_lq_mngr lq_mngr;
++#endif
++
++	/* Rate scaling data */
++	s8 data_retry_limit;
++	u8 retry_rate;
++
++	wait_queue_head_t wait_command_queue;
++
++	int activity_timer_active;
++
++	/* Rx and Tx DMA processing queues */
++	struct iwl_rx_queue rxq;
++	struct iwl_tx_queue txq[IWL_MAX_NUM_QUEUES];
++#if IWL == 4965
++	unsigned long txq_ctx_active_msk;
++	struct iwl_kw kw;	/* keep warm address */
++	u32 scd_base_addr;	/* scheduler sram base address */
++#endif
++
++	unsigned long status;
++	u32 config;
++
++	int last_rx_rssi;	/* From Rx packet statisitics */
++	int last_rx_noise;	/* From beacon statistics */
++
++	struct iwl_power_mgr power_data;
++
++	struct iwl_notif_statistics statistics;
++	unsigned long last_statistics_time;
++
++	/* context information */
++	u8 essid[IW_ESSID_MAX_SIZE];
++	u8 essid_len;
++	u16 rates_mask;
++
++	u32 power_mode;
++	u32 antenna;
++	u8 bssid[ETH_ALEN];
++	u16 rts_threshold;
++	u8 mac_addr[ETH_ALEN];
++
++	/*station table variables */
++	spinlock_t sta_lock;
++	int num_stations;
++	struct iwl_station_entry stations[IWL_STATION_COUNT];
++
++	/* Indication if ieee80211_ops->open has been called */
++	int is_open;
++
++	u8 mac80211_registered;
++	int is_abg;
++
++	u32 notif_missed_beacons;
++
++	/* Rx'd packet timing information */
++	u32 last_beacon_time;
++	u64 last_tsf;
++
++	/* Duplicate packet detection */
++	u16 last_seq_num;
++	u16 last_frag_num;
++	unsigned long last_packet_time;
++	struct list_head ibss_mac_hash[IWL_IBSS_MAC_HASH_SIZE];
++
++	/* eeprom */
++	struct iwl_eeprom eeprom;
++
++	int iw_mode;
++
++	struct sk_buff *ibss_beacon;
++
++	/* Last Rx'd beacon timestamp */
++	u32 timestamp0;
++	u32 timestamp1;
++	u16 beacon_int;
++	struct iwl_driver_hw_info hw_setting;
++	int interface_id;
++
++	/* Current association information needed to configure the
++	 * hardware */
++	u16 assoc_id;
++	u16 assoc_capability;
++	u8 ps_mode;
++
++#ifdef CONFIG_IWLWIFI_QOS
++	struct iwl_qos_info qos_data;
++#endif /*CONFIG_IWLWIFI_QOS */
++
++	struct workqueue_struct *workqueue;
++
++	struct work_struct up;
++	struct work_struct restart;
++	struct work_struct calibrated_work;
++	struct work_struct scan_completed;
++	struct work_struct rx_replenish;
++	struct work_struct rf_kill;
++	struct work_struct abort_scan;
++	struct work_struct update_link_led;
++	struct work_struct auth_work;
++	struct work_struct report_work;
++	struct work_struct request_scan;
++	struct work_struct beacon_update;
++
++	struct tasklet_struct irq_tasklet;
++
++	struct delayed_work init_alive_start;
++	struct delayed_work alive_start;
++	struct delayed_work activity_timer;
++	struct delayed_work thermal_periodic;
++	struct delayed_work gather_stats;
++	struct delayed_work scan_check;
++	struct delayed_work post_associate;
++
++#define IWL_DEFAULT_TX_POWER 0x0F
++	s8 user_txpower_limit;
++	s8 max_channel_txpower_limit;
++	u32 cck_power_index_compensation;
++
++#ifdef CONFIG_PM
++	u32 pm_state[16];
++#endif
++
++#ifdef CONFIG_IWLWIFI_DEBUG
++	/* debugging info */
++	u32 framecnt_to_us;
++	atomic_t restrict_refcnt;
++#endif
++
++#if IWL == 4965
++	struct work_struct txpower_work;
++#ifdef CONFIG_IWLWIFI_SENSITIVITY
++	struct work_struct sensitivity_work;
++#endif
++	struct work_struct statistics_work;
++	struct timer_list statistics_periodic;
++
++#ifdef CONFIG_IWLWIFI_HT_AGG
++	struct work_struct agg_work;
++#endif
++
++#endif /* 4965 */
++};				/*iwl_priv */
++
++#endif /* __iwl_priv_h__ */
+diff --git a/drivers/net/wireless/iwl-prph.h b/drivers/net/wireless/iwl-prph.h
+new file mode 100644
+index 0000000..0df4114
+--- /dev/null
++++ b/drivers/net/wireless/iwl-prph.h
+@@ -0,0 +1,229 @@
++/******************************************************************************
++ *
++ * This file is provided under a dual BSD/GPLv2 license.  When using or
++ * redistributing this file, you may do so under either license.
++ *
++ * GPL LICENSE SUMMARY
++ *
++ * Copyright(c) 2005 - 2007 Intel Corporation. All rights reserved.
++ *
++ * This program is free software; you can redistribute it and/or modify
++ * it under the terms of version 2 of the GNU Geeral Public License as
++ * published by the Free Software Foundation.
++ *
++ * 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., 51 Franklin Street, Fifth Floor, Boston, MA 02110,
++ * USA
++ *
++ * The full GNU General Public License is included in this distribution
++ * in the file called LICENSE.GPL.
++ *
++ * Contact Information:
++ * James P. Ketrenos <ipw2100-admin at linux.intel.com>
++ * Intel Corporation, 5200 N.E. Elam Young Parkway, Hillsboro, OR 97124-6497
++ *
++ * BSD LICENSE
++ *
++ * Copyright(c) 2005 - 2007 Intel Corporation. All rights reserved.
++ * All rights reserved.
++ *
++ * Redistribution and use in source and binary forms, with or without
++ * modification, are permitted provided that the following conditions
++ * are met:
++ *
++ *  * Redistributions of source code must retain the above copyright
++ *    notice, this list of conditions and the following disclaimer.
++ *  * Redistributions in binary form must reproduce the above copyright
++ *    notice, this list of conditions and the following disclaimer in
++ *    the documentation and/or other materials provided with the
++ *    distribution.
++ *  * Neither the name Intel Corporation nor the names of its
++ *    contributors may be used to endorse or promote products derived
++ *    from this software without specific prior written permission.
++ *
++ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
++ * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
++ * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
++ * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
++ * OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
++ * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
++ * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
++ * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
++ * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
++ * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
++ * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
++ *****************************************************************************/
++
++#ifndef	__iwl_prph_h__
++#define __iwl_prph_h__
++
++
++#define PRPH_BASE	(0x00000)
++#define PRPH_END	(0xFFFFF)
++
++/* APMG (power management) constants */
++#define APMG_BASE			(PRPH_BASE + 0x3000)
++#define APMG_CLK_CTRL_REG		(APMG_BASE + 0x0000)
++#define APMG_CLK_EN_REG			(APMG_BASE + 0x0004)
++#define APMG_CLK_DIS_REG		(APMG_BASE + 0x0008)
++#define APMG_PS_CTRL_REG		(APMG_BASE + 0x000c)
++#define APMG_PCIDEV_STT_REG		(APMG_BASE + 0x0010)
++#define APMG_RFKILL_REG			(APMG_BASE + 0x0014)
++#define APMG_RTC_INT_STT_REG		(APMG_BASE + 0x001c)
++#define APMG_RTC_INT_MSK_REG		(APMG_BASE + 0x0020)
++
++#define APMG_CLK_VAL_DMA_CLK_RQT	(0x00000200)
++#define APMG_CLK_VAL_BSM_CLK_RQT	(0x00000800)
++
++#define APMG_PS_CTRL_VAL_RESET_REQ	(0x04000000)
++
++#define APMG_PCIDEV_STT_VAL_L1_ACT_DIS	(0x00000800)
++
++#define APMG_PS_CTRL_MSK_PWR_SRC              (0x03000000)
++#define APMG_PS_CTRL_VAL_PWR_SRC_VMAIN        (0x00000000)
++#define APMG_PS_CTRL_VAL_PWR_SRC_VAUX         (0x01000000)
++
++
++/**
++ * BSM (Bootstrap State Machine)
++ *
++ * The Bootstrap State Machine (BSM) stores a short bootstrap uCode program
++ * in special SRAM that does not power down when the embedded control
++ * processor is sleeping (e.g. for periodic power-saving shutdowns of radio).
++ *
++ * When powering back up after sleeps (or during initial uCode load), the BSM
++ * internally loads the short bootstrap program from the special SRAM into the
++ * embedded processor's instruction SRAM, and starts the processor so it runs
++ * the bootstrap program.
++ *
++ * This bootstrap program loads (via PCI busmaster DMA) instructions and data
++ * images for a uCode program from host DRAM locations.  The host driver
++ * indicates DRAM locations and sizes for instruction and data images via the
++ * four BSM_DRAM_* registers.  Once the bootstrap program loads the new program,
++ * the new program starts automatically.
++ *
++ * The uCode used for open-source drivers includes two programs:
++ *
++ * 1)  Initialization -- performs hardware calibration and sets up some
++ *     internal data, then notifies host via "initialize alive" notification
++ *     (struct iwl_init_alive_resp) that it has completed all of its work.
++ *     After signal from host, it then loads and starts the runtime program.
++ *     The initialization program must be used when initially setting up the
++ *     NIC after loading the driver.
++ *
++ * 2)  Runtime/Protocol -- performs all normal runtime operations.  This
++ *     notifies host via "alive" notification (struct iwl_alive_resp) that it
++ *     is ready to be used.
++ *
++ * When initializing the NIC, the host driver does the following procedure:
++ *
++ * 1)  Load bootstrap program (instructions only, no data image for bootstrap)
++ *     into bootstrap memory.  Use dword writes starting at BSM_SRAM_LOWER_BOUND
++ *
++ * 2)  Point (via BSM_DRAM_*) to the "initialize" uCode data and instruction
++ *     images in host DRAM.
++ *
++ * 3)  Set up BSM to copy from BSM SRAM into uCode instruction SRAM when asked:
++ *     BSM_WR_MEM_SRC_REG = 0
++ *     BSM_WR_MEM_DST_REG = RTC_INST_LOWER_BOUND
++ *     BSM_WR_MEM_DWCOUNT_REG = # dwords in bootstrap instruction image
++ *
++ * 4)  Load bootstrap into instruction SRAM:
++ *     BSM_WR_CTRL_REG = BSM_WR_CTRL_REG_BIT_START
++ *
++ * 5)  Wait for load completion:
++ *     Poll BSM_WR_CTRL_REG for BSM_WR_CTRL_REG_BIT_START = 0
++ *
++ * 6)  Enable future boot loads whenever NIC's power management triggers it:
++ *     BSM_WR_CTRL_REG = BSM_WR_CTRL_REG_BIT_START_EN
++ *
++ * 7)  Start the NIC by removing all reset bits:
++ *     CSR_RESET = 0
++ *
++ *     The bootstrap uCode (already in instruction SRAM) loads initialization
++ *     uCode.  Initialization uCode performs data initialization, sends
++ *     "initialize alive" notification to host, and waits for a signal from
++ *     host to load runtime code.
++ *
++ * 4)  Point (via BSM_DRAM_*) to the "runtime" uCode data and instruction
++ *     images in host DRAM.  The last register loaded must be the instruction
++ *     bytecount register ("1" in MSbit tells initialization uCode to load
++ *     the runtime uCode):
++ *     BSM_DRAM_INST_BYTECOUNT_REG = bytecount | BSM_DRAM_INST_LOAD
++ *
++ * 5)  Wait for "alive" notification, then issue normal runtime commands.
++ *
++ * Data caching during power-downs:
++ *
++ * Just before the embedded controller powers down (e.g for automatic
++ * power-saving modes, or for RFKILL), uCode stores (via PCI busmaster DMA)
++ * a current snapshot of the embedded processor's data SRAM into host DRAM.
++ * This caches the data while the embedded processor's memory is powered down.
++ * Location and size are controlled by BSM_DRAM_DATA_* registers.
++ *
++ * NOTE:  Instruction SRAM does not need to be saved, since that doesn't
++ *        change during operation; the original image (from uCode distribution
++ *        file) can be used for reload.
++ *
++ * When powering back up, the BSM loads the bootstrap program.  Bootstrap looks
++ * at the BSM_DRAM_* registers, which now point to the runtime instruction
++ * image and the cached (modified) runtime data (*not* the initialization
++ * uCode).  Bootstrap reloads these runtime images into SRAM, and restarts the
++ * uCode from where it left off before the power-down.
++ *
++ * NOTE:  Initialization uCode does *not* run as part of the save/restore
++ *        procedure.
++ *
++ * This save/restore method is mostly for autonomous power management during
++ * normal operation (result of POWER_TABLE_CMD).  Platform suspend/resume and
++ * RFKILL should use complete restarts (with total re-initialization) of uCode,
++ * allowing total shutdown (including BSM memory).
++ *
++ * Note that, during normal operation, the host DRAM that held the initial
++ * startup data for the runtime code is now being used as a backup data cache
++ * for modified data!  If you need to completely re-initialize the NIC, make
++ * sure that you use the runtime data image from the uCode distribution file,
++ * not the modified/saved runtime data.  You may want to store a separate
++ * "clean" runtime data image in DRAM to avoid disk reads of distribution file.
++ */
++
++/* BSM bit fields */
++#define BSM_WR_CTRL_REG_BIT_START     (0x80000000) /* start boot load now */
++#define BSM_WR_CTRL_REG_BIT_START_EN  (0x40000000) /* enable boot after pwrup*/
++#define BSM_DRAM_INST_LOAD            (0x80000000) /* start program load now */
++
++/* BSM addresses */
++#define BSM_BASE                     (PRPH_BASE + 0x3400)
++#define BSM_END                      (PRPH_BASE + 0x3800)
++
++#define BSM_WR_CTRL_REG              (BSM_BASE + 0x000) /* ctl and status */
++#define BSM_WR_MEM_SRC_REG           (BSM_BASE + 0x004) /* source in BSM mem */
++#define BSM_WR_MEM_DST_REG           (BSM_BASE + 0x008) /* dest in SRAM mem */
++#define BSM_WR_DWCOUNT_REG           (BSM_BASE + 0x00C) /* bytes */
++#define BSM_WR_STATUS_REG            (BSM_BASE + 0x010) /* bit 0:  1 == done */
++
++/*
++ * Pointers and size regs for bootstrap load and data SRAM save/restore.
++ * NOTE:  3945 pointers use bits 31:0 of DRAM address.
++ *        4965 pointers use bits 35:4 of DRAM address.
++ */
++#define BSM_DRAM_INST_PTR_REG        (BSM_BASE + 0x090)
++#define BSM_DRAM_INST_BYTECOUNT_REG  (BSM_BASE + 0x094)
++#define BSM_DRAM_DATA_PTR_REG        (BSM_BASE + 0x098)
++#define BSM_DRAM_DATA_BYTECOUNT_REG  (BSM_BASE + 0x09C)
++
++/*
++ * BSM special memory, stays powered on during power-save sleeps.
++ * Read/write, address range from LOWER_BOUND to (LOWER_BOUND + SIZE -1)
++ */
++#define BSM_SRAM_LOWER_BOUND         (PRPH_BASE + 0x3800)
++#define BSM_SRAM_SIZE			(1024) /* bytes */
++
++
++#endif				/* __iwl_prph_h__ */
+diff --git a/drivers/net/wireless/iwl-spectrum.h b/drivers/net/wireless/iwl-spectrum.h
+new file mode 100644
+index 0000000..b576ff2
+--- /dev/null
++++ b/drivers/net/wireless/iwl-spectrum.h
+@@ -0,0 +1,91 @@
++/******************************************************************************
++ *
++ * Copyright(c) 2003 - 2007 Intel Corporation. All rights reserved.
++ *
++ * Portions of this file are derived from the ieee80211 subsystem header files.
++ *
++ * This program is free software; you can redistribute it and/or modify it
++ * under the terms of version 2 of the GNU General Public License as
++ * published by the Free Software Foundation.
++ *
++ * 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.,
++ * 51 Franklin Street, Fifth Floor, Boston, MA 02110, USA
++ *
++ * The full GNU General Public License is included in this distribution in the
++ * file called LICENSE.
++ *
++ * Contact Information:
++ * James P. Ketrenos <ipw2100-admin at linux.intel.com>
++ * Intel Corporation, 5200 N.E. Elam Young Parkway, Hillsboro, OR 97124-6497
++ *
++ *****************************************************************************/
++
++#ifndef __iwl_spectrum_h__
++#define __iwl_spectrum_h__
++enum {				/* ieee80211_basic_report.map */
++	IEEE80211_BASIC_MAP_BSS = (1 << 0),
++	IEEE80211_BASIC_MAP_OFDM = (1 << 1),
++	IEEE80211_BASIC_MAP_UNIDENTIFIED = (1 << 2),
++	IEEE80211_BASIC_MAP_RADAR = (1 << 3),
++	IEEE80211_BASIC_MAP_UNMEASURED = (1 << 4),
++	/* Bits 5-7 are reserved */
++
++};
++struct ieee80211_basic_report {
++	u8 channel;
++	__le64 start_time;
++	__le16 duration;
++	u8 map;
++} __attribute__ ((packed));
++
++enum {				/* ieee80211_measurement_request.mode */
++	/* Bit 0 is reserved */
++	IEEE80211_MEASUREMENT_ENABLE = (1 << 1),
++	IEEE80211_MEASUREMENT_REQUEST = (1 << 2),
++	IEEE80211_MEASUREMENT_REPORT = (1 << 3),
++	/* Bits 4-7 are reserved */
++};
++
++enum {
++	IEEE80211_REPORT_BASIC = 0,	/* required */
++	IEEE80211_REPORT_CCA = 1,	/* optional */
++	IEEE80211_REPORT_RPI = 2,	/* optional */
++	/* 3-255 reserved */
++};
++
++struct ieee80211_measurement_params {
++	u8 channel;
++	__le64 start_time;
++	__le16 duration;
++} __attribute__ ((packed));
++
++struct ieee80211_info_element {
++	u8 id;
++	u8 len;
++	u8 data[0];
++} __attribute__ ((packed));
++
++struct ieee80211_measurement_request {
++	struct ieee80211_info_element ie;
++	u8 token;
++	u8 mode;
++	u8 type;
++	struct ieee80211_measurement_params params[0];
++} __attribute__ ((packed));
++
++struct ieee80211_measurement_report {
++	struct ieee80211_info_element ie;
++	u8 token;
++	u8 mode;
++	u8 type;
++	union {
++		struct ieee80211_basic_report basic[0];
++	} u;
++} __attribute__ ((packed));
++#endif
+diff --git a/drivers/net/wireless/iwl3945-base.c b/drivers/net/wireless/iwl3945-base.c
+new file mode 100644
+index 0000000..6a064a6
+--- /dev/null
++++ b/drivers/net/wireless/iwl3945-base.c
+@@ -0,0 +1,8732 @@
++/******************************************************************************
++ *
++ * Copyright(c) 2003 - 2007 Intel Corporation. All rights reserved.
++ *
++ * Portions of this file are derived from the ipw3945 project, as well
++ * as portions of the ieee80211 subsystem header files.
++ *
++ * This program is free software; you can redistribute it and/or modify it
++ * under the terms of version 2 of the GNU General Public License as
++ * published by the Free Software Foundation.
++ *
++ * 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.,
++ * 51 Franklin Street, Fifth Floor, Boston, MA 02110, USA
++ *
++ * The full GNU General Public License is included in this distribution in the
++ * file called LICENSE.
++ *
++ * Contact Information:
++ * James P. Ketrenos <ipw2100-admin at linux.intel.com>
++ * Intel Corporation, 5200 N.E. Elam Young Parkway, Hillsboro, OR 97124-6497
++ *
++ *****************************************************************************/
++
++/*
++ * NOTE:  This file (iwl-base.c) is used to build to multiple hardware targets
++ * by defining IWL to either 3945 or 4965.  The Makefile used when building
++ * the base targets will create base-3945.o and base-4965.o
++ *
++ * The eventual goal is to move as many of the #if IWL / #endif blocks out of
++ * this file and into the hardware specific implementation files (iwl-XXXX.c)
++ * and leave only the common (non #ifdef sprinkled) code in this file
++ */
++
++#include <linux/kernel.h>
++#include <linux/module.h>
++#include <linux/version.h>
++#include <linux/init.h>
++#include <linux/pci.h>
++#include <linux/dma-mapping.h>
++#include <linux/delay.h>
++#include <linux/skbuff.h>
++#include <linux/netdevice.h>
++#include <linux/wireless.h>
++#include <linux/firmware.h>
++#include <linux/skbuff.h>
++#include <linux/netdevice.h>
++#include <linux/etherdevice.h>
++#include <linux/if_arp.h>
++
++#include <net/ieee80211_radiotap.h>
++#include <net/mac80211.h>
++
++#include <asm/div64.h>
++
++#include "iwlwifi.h"
++#include "iwl-3945.h"
++#include "iwl-helpers.h"
++
++#ifdef CONFIG_IWLWIFI_DEBUG
++u32 iwl_debug_level;
++#endif
++
++/******************************************************************************
++ *
++ * module boiler plate
++ *
++ ******************************************************************************/
++
++/* module parameters */
++int iwl_param_disable_hw_scan;
++int iwl_param_debug;
++int iwl_param_disable;      /* def: enable radio */
++int iwl_param_antenna;      /* def: 0 = both antennas (use diversity) */
++int iwl_param_hwcrypto;     /* def: using software encryption */
++int iwl_param_qos_enable = 1;
++int iwl_param_queues_num = IWL_MAX_NUM_QUEUES;
++
++/*
++ * module name, copyright, version, etc.
++ * NOTE: DRV_NAME is defined in iwlwifi.h for use by iwl-debug.h and printk
++ */
++
++#define DRV_DESCRIPTION	\
++"Intel(R) PRO/Wireless 3945ABG/BG Network Connection driver for Linux"
++
++#ifdef CONFIG_IWLWIFI_DEBUG
++#define VD "d"
++#else
++#define VD
++#endif
++
++#ifdef CONFIG_IWLWIFI_SPECTRUM_MEASUREMENT
++#define VS "s"
++#else
++#define VS
++#endif
++
++#define IWLWIFI_VERSION "0.1.15k" VD VS
++#define DRV_COPYRIGHT	"Copyright(c) 2003-2007 Intel Corporation"
++#define DRV_VERSION     IWLWIFI_VERSION
++
++/* Change firmware file name, using "-" and incrementing number,
++ *   *only* when uCode interface or architecture changes so that it
++ *   is not compatible with earlier drivers.
++ * This number will also appear in << 8 position of 1st dword of uCode file */
++#define IWL3945_UCODE_API "-1"
++
++MODULE_DESCRIPTION(DRV_DESCRIPTION);
++MODULE_VERSION(DRV_VERSION);
++MODULE_AUTHOR(DRV_COPYRIGHT);
++MODULE_LICENSE("GPL");
++
++__le16 *ieee80211_get_qos_ctrl(struct ieee80211_hdr *hdr)
++{
++	u16 fc = le16_to_cpu(hdr->frame_control);
++	int hdr_len = ieee80211_get_hdrlen(fc);
++
++	if ((fc & 0x00cc) == (IEEE80211_STYPE_QOS_DATA | IEEE80211_FTYPE_DATA))
++		return (__le16 *) ((u8 *) hdr + hdr_len - QOS_CONTROL_LEN);
++	return NULL;
++}
++
++static const struct ieee80211_hw_mode *iwl_get_hw_mode(
++		struct iwl_priv *priv, int mode)
++{
++	int i;
++
++	for (i = 0; i < 3; i++)
++		if (priv->modes[i].mode == mode)
++			return &priv->modes[i];
++
++	return NULL;
++}
++
++static int iwl_is_empty_essid(const char *essid, int essid_len)
++{
++	/* Single white space is for Linksys APs */
++	if (essid_len == 1 && essid[0] == ' ')
++		return 1;
++
++	/* Otherwise, if the entire essid is 0, we assume it is hidden */
++	while (essid_len) {
++		essid_len--;
++		if (essid[essid_len] != '\0')
++			return 0;
++	}
++
++	return 1;
++}
++
++static const char *iwl_escape_essid(const char *essid, u8 essid_len)
++{
++	static char escaped[IW_ESSID_MAX_SIZE * 2 + 1];
++	const char *s = essid;
++	char *d = escaped;
++
++	if (iwl_is_empty_essid(essid, essid_len)) {
++		memcpy(escaped, "<hidden>", sizeof("<hidden>"));
++		return escaped;
++	}
++
++	essid_len = min(essid_len, (u8) IW_ESSID_MAX_SIZE);
++	while (essid_len--) {
++		if (*s == '\0') {
++			*d++ = '\\';
++			*d++ = '0';
++			s++;
++		} else
++			*d++ = *s++;
++	}
++	*d = '\0';
++	return escaped;
++}
++
++static void iwl_print_hex_dump(int level, void *p, u32 len)
++{
++#ifdef CONFIG_IWLWIFI_DEBUG
++	if (!(iwl_debug_level & level))
++		return;
++
++	print_hex_dump(KERN_DEBUG, "iwl data: ", DUMP_PREFIX_OFFSET, 16, 1,
++			p, len, 1);
++#endif
++}
++
++/*************** DMA-QUEUE-GENERAL-FUNCTIONS  *****
++ * DMA services
++ *
++ * Theory of operation
++ *
++ * A queue is a circular buffers with 'Read' and 'Write' pointers.
++ * 2 empty entries always kept in the buffer to protect from overflow.
++ *
++ * For Tx queue, there are low mark and high mark limits. If, after queuing
++ * the packet for Tx, free space become < low mark, Tx queue stopped. When
++ * reclaiming packets (on 'tx done IRQ), if free space become > high mark,
++ * Tx queue resumed.
++ *
++ * The IPW operates with six queues, one receive queue in the device's
++ * sram, one transmit queue for sending commands to the device firmware,
++ * and four transmit queues for data.
++ ***************************************************/
++
++static int iwl_queue_space(const struct iwl_queue *q)
++{
++	int s = q->last_used - q->first_empty;
++
++	if (q->last_used > q->first_empty)
++		s -= q->n_bd;
++
++	if (s <= 0)
++		s += q->n_window;
++	/* keep some reserve to not confuse empty and full situations */
++	s -= 2;
++	if (s < 0)
++		s = 0;
++	return s;
++}
++
++/* XXX: n_bd must be power-of-two size */
++static inline int iwl_queue_inc_wrap(int index, int n_bd)
++{
++	return ++index & (n_bd - 1);
++}
++
++/* XXX: n_bd must be power-of-two size */
++static inline int iwl_queue_dec_wrap(int index, int n_bd)
++{
++	return --index & (n_bd - 1);
++}
++
++static inline int x2_queue_used(const struct iwl_queue *q, int i)
++{
++	return q->first_empty > q->last_used ?
++		(i >= q->last_used && i < q->first_empty) :
++		!(i < q->last_used && i >= q->first_empty);
++}
++
++static inline u8 get_cmd_index(struct iwl_queue *q, u32 index, int is_huge)
++{
++	if (is_huge)
++		return q->n_window;
++
++	return index & (q->n_window - 1);
++}
++
++static int iwl_queue_init(struct iwl_priv *priv, struct iwl_queue *q,
++			  int count, int slots_num, u32 id)
++{
++	q->n_bd = count;
++	q->n_window = slots_num;
++	q->id = id;
++
++	/* count must be power-of-two size, otherwise iwl_queue_inc_wrap
++	 * and iwl_queue_dec_wrap are broken. */
++	BUG_ON(!is_power_of_2(count));
++
++	/* slots_num must be power-of-two size, otherwise
++	 * get_cmd_index is broken. */
++	BUG_ON(!is_power_of_2(slots_num));
++
++	q->low_mark = q->n_window / 4;
++	if (q->low_mark < 4)
++		q->low_mark = 4;
++
++	q->high_mark = q->n_window / 8;
++	if (q->high_mark < 2)
++		q->high_mark = 2;
++
++	q->first_empty = q->last_used = 0;
++
++	return 0;
++}
++
++static int iwl_tx_queue_alloc(struct iwl_priv *priv,
++			      struct iwl_tx_queue *txq, u32 id)
++{
++	struct pci_dev *dev = priv->pci_dev;
++
++	if (id != IWL_CMD_QUEUE_NUM) {
++		txq->txb = kmalloc(sizeof(txq->txb[0]) *
++				   TFD_QUEUE_SIZE_MAX, GFP_KERNEL);
++		if (!txq->txb) {
++			IWL_ERROR("kmalloc for auxilary BD "
++				  "structures failed\n");
++			goto error;
++		}
++	} else
++		txq->txb = NULL;
++
++	txq->bd = pci_alloc_consistent(dev,
++			sizeof(txq->bd[0]) * TFD_QUEUE_SIZE_MAX,
++			&txq->q.dma_addr);
++
++	if (!txq->bd) {
++		IWL_ERROR("pci_alloc_consistent(%zd) failed\n",
++			  sizeof(txq->bd[0]) * TFD_QUEUE_SIZE_MAX);
++		goto error;
++	}
++	txq->q.id = id;
++
++	return 0;
++
++ error:
++	if (txq->txb) {
++		kfree(txq->txb);
++		txq->txb = NULL;
++	}
++
++	return -ENOMEM;
++}
++
++int iwl_tx_queue_init(struct iwl_priv *priv,
++		      struct iwl_tx_queue *txq, int slots_num, u32 txq_id)
++{
++	struct pci_dev *dev = priv->pci_dev;
++	int len;
++	int rc = 0;
++
++	/* alocate command space + one big command for scan since scan
++	 * command is very huge the system will not have two scan at the
++	 * same time */
++	len = sizeof(struct iwl_cmd) * slots_num;
++	if (txq_id == IWL_CMD_QUEUE_NUM)
++		len +=  IWL_MAX_SCAN_SIZE;
++	txq->cmd = pci_alloc_consistent(dev, len, &txq->dma_addr_cmd);
++	if (!txq->cmd)
++		return -ENOMEM;
++
++	rc = iwl_tx_queue_alloc(priv, txq, txq_id);
++	if (rc) {
++		pci_free_consistent(dev, len, txq->cmd, txq->dma_addr_cmd);
++
++		return -ENOMEM;
++	}
++	txq->need_update = 0;
++
++	/* TFD_QUEUE_SIZE_MAX must be power-of-two size, otherwise
++	 * iwl_queue_inc_wrap and iwl_queue_dec_wrap are broken. */
++	BUILD_BUG_ON(TFD_QUEUE_SIZE_MAX & (TFD_QUEUE_SIZE_MAX - 1));
++	iwl_queue_init(priv, &txq->q, TFD_QUEUE_SIZE_MAX, slots_num, txq_id);
++
++	iwl_hw_tx_queue_init(priv, txq);
++
++	return 0;
++}
++
++/**
++ * iwl_tx_queue_free - Deallocate DMA queue.
++ * @txq: Transmit queue to deallocate.
++ *
++ * Empty queue by removing and destroying all BD's.
++ * Free all buffers.  txq itself is not freed.
++ *
++ */
++void iwl_tx_queue_free(struct iwl_priv *priv, struct iwl_tx_queue *txq)
++{
++	struct iwl_queue *q = &txq->q;
++	struct pci_dev *dev = priv->pci_dev;
++	int len;
++
++	if (q->n_bd == 0)
++		return;
++
++	/* first, empty all BD's */
++	for (; q->first_empty != q->last_used;
++	     q->last_used = iwl_queue_inc_wrap(q->last_used, q->n_bd))
++		iwl_hw_txq_free_tfd(priv, txq);
++
++	len = sizeof(struct iwl_cmd) * q->n_window;
++	if (q->id == IWL_CMD_QUEUE_NUM)
++		len += IWL_MAX_SCAN_SIZE;
++
++	pci_free_consistent(dev, len, txq->cmd, txq->dma_addr_cmd);
++
++	/* free buffers belonging to queue itself */
++	if (txq->q.n_bd)
++		pci_free_consistent(dev, sizeof(struct iwl_tfd_frame) *
++				    txq->q.n_bd, txq->bd, txq->q.dma_addr);
++
++	if (txq->txb) {
++		kfree(txq->txb);
++		txq->txb = NULL;
++	}
++
++	/* 0 fill whole structure */
++	memset(txq, 0, sizeof(*txq));
++}
++
++const u8 BROADCAST_ADDR[ETH_ALEN] = { 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF };
++
++/*************** STATION TABLE MANAGEMENT ****
++ *
++ * NOTE:  This needs to be overhauled to better synchronize between
++ * how the iwl-4965.c is using iwl_hw_find_station vs. iwl-3945.c
++ *
++ * mac80211 should also be examined to determine if sta_info is duplicating
++ * the functionality provided here
++ */
++
++/**************************************************************/
++static u8 iwl_remove_station(struct iwl_priv *priv, const u8 *addr, int is_ap)
++{
++	int index = IWL_INVALID_STATION;
++	int i;
++	unsigned long flags;
++
++	spin_lock_irqsave(&priv->sta_lock, flags);
++
++	if (is_ap)
++		index = IWL_AP_ID;
++	else if (is_broadcast_ether_addr(addr))
++		index = priv->hw_setting.bcast_sta_id;
++	else
++		for (i = IWL_STA_ID; i < priv->hw_setting.max_stations; i++)
++			if (priv->stations[i].used &&
++			    !compare_ether_addr(priv->stations[i].sta.sta.addr,
++						addr)) {
++				index = i;
++				break;
++			}
++
++	if (unlikely(index == IWL_INVALID_STATION))
++		goto out;
++
++	if (priv->stations[index].used) {
++		priv->stations[index].used = 0;
++		priv->num_stations--;
++	}
++
++	BUG_ON(priv->num_stations < 0);
++
++out:
++	spin_unlock_irqrestore(&priv->sta_lock, flags);
++	return 0;
++}
++
++static void iwl_clear_stations_table(struct iwl_priv *priv)
++{
++	unsigned long flags;
++
++	spin_lock_irqsave(&priv->sta_lock, flags);
++
++	priv->num_stations = 0;
++	memset(priv->stations, 0, sizeof(priv->stations));
++
++	spin_unlock_irqrestore(&priv->sta_lock, flags);
++}
++
++
++u8 iwl_add_station(struct iwl_priv *priv, const u8 *addr, int is_ap, u8 flags)
++{
++	int i;
++	int index = IWL_INVALID_STATION;
++	struct iwl_station_entry *station;
++	unsigned long flags_spin;
++
++	spin_lock_irqsave(&priv->sta_lock, flags_spin);
++	if (is_ap)
++		index = IWL_AP_ID;
++	else if (is_broadcast_ether_addr(addr))
++		index = priv->hw_setting.bcast_sta_id;
++	else
++		for (i = IWL_STA_ID; i < priv->hw_setting.max_stations; i++) {
++			if (!compare_ether_addr(priv->stations[i].sta.sta.addr,
++						addr)) {
++				index = i;
++				break;
++			}
++
++			if (!priv->stations[i].used &&
++			    index == IWL_INVALID_STATION)
++				index = i;
++		}
++
++	/* These twh conditions has the same outcome but keep them separate
++	  since they have different meaning */
++	if (unlikely(index == IWL_INVALID_STATION)) {
++		spin_unlock_irqrestore(&priv->sta_lock, flags_spin);
++		return index;
++	}
++
++	if (priv->stations[index].used &&
++	   !compare_ether_addr(priv->stations[index].sta.sta.addr, addr)) {
++		spin_unlock_irqrestore(&priv->sta_lock, flags_spin);
++		return index;
++	}
++
++	IWL_DEBUG_ASSOC("Add STA ID %d: " MAC_FMT "\n", index, MAC_ARG(addr));
++	station = &priv->stations[index];
++	station->used = 1;
++	priv->num_stations++;
++
++	memset(&station->sta, 0, sizeof(struct iwl_addsta_cmd));
++	memcpy(station->sta.sta.addr, addr, ETH_ALEN);
++	station->sta.mode = 0;
++	station->sta.sta.sta_id = index;
++	station->sta.station_flags = 0;
++
++	spin_unlock_irqrestore(&priv->sta_lock, flags_spin);
++	iwl_send_add_station(priv, &station->sta, flags);
++	return index;
++
++}
++
++/*************** DRIVER STATUS FUNCTIONS   *****/
++
++static inline int iwl_is_ready(struct iwl_priv *priv)
++{
++	/* The adapter is 'ready' if READY and GEO_CONFIGURED bits are
++	 * set but EXIT_PENDING is not */
++	return test_bit(STATUS_READY, &priv->status) &&
++	       test_bit(STATUS_GEO_CONFIGURED, &priv->status) &&
++	       !test_bit(STATUS_EXIT_PENDING, &priv->status);
++}
++
++static inline int iwl_is_alive(struct iwl_priv *priv)
++{
++	return test_bit(STATUS_ALIVE, &priv->status);
++}
++
++static inline int iwl_is_init(struct iwl_priv *priv)
++{
++	return test_bit(STATUS_INIT, &priv->status);
++}
++
++static inline int iwl_is_rfkill(struct iwl_priv *priv)
++{
++	return test_bit(STATUS_RF_KILL_HW, &priv->status) ||
++	       test_bit(STATUS_RF_KILL_SW, &priv->status);
++}
++
++static inline int iwl_is_ready_rf(struct iwl_priv *priv)
++{
++
++	if (iwl_is_rfkill(priv))
++		return 0;
++
++	return iwl_is_ready(priv);
++}
++
++/*************** HOST COMMAND QUEUE FUNCTIONS   *****/
++
++#define IWL_CMD(x) case x : return #x
++
++static const char *get_cmd_string(u8 cmd)
++{
++	switch (cmd) {
++		IWL_CMD(REPLY_ALIVE);
++		IWL_CMD(REPLY_ERROR);
++		IWL_CMD(REPLY_RXON);
++		IWL_CMD(REPLY_RXON_ASSOC);
++		IWL_CMD(REPLY_QOS_PARAM);
++		IWL_CMD(REPLY_RXON_TIMING);
++		IWL_CMD(REPLY_ADD_STA);
++		IWL_CMD(REPLY_REMOVE_STA);
++		IWL_CMD(REPLY_REMOVE_ALL_STA);
++		IWL_CMD(REPLY_3945_RX);
++		IWL_CMD(REPLY_TX);
++		IWL_CMD(REPLY_RATE_SCALE);
++		IWL_CMD(REPLY_LEDS_CMD);
++		IWL_CMD(REPLY_TX_LINK_QUALITY_CMD);
++		IWL_CMD(RADAR_NOTIFICATION);
++		IWL_CMD(REPLY_QUIET_CMD);
++		IWL_CMD(REPLY_CHANNEL_SWITCH);
++		IWL_CMD(CHANNEL_SWITCH_NOTIFICATION);
++		IWL_CMD(REPLY_SPECTRUM_MEASUREMENT_CMD);
++		IWL_CMD(SPECTRUM_MEASURE_NOTIFICATION);
++		IWL_CMD(POWER_TABLE_CMD);
++		IWL_CMD(PM_SLEEP_NOTIFICATION);
++		IWL_CMD(PM_DEBUG_STATISTIC_NOTIFIC);
++		IWL_CMD(REPLY_SCAN_CMD);
++		IWL_CMD(REPLY_SCAN_ABORT_CMD);
++		IWL_CMD(SCAN_START_NOTIFICATION);
++		IWL_CMD(SCAN_RESULTS_NOTIFICATION);
++		IWL_CMD(SCAN_COMPLETE_NOTIFICATION);
++		IWL_CMD(BEACON_NOTIFICATION);
++		IWL_CMD(REPLY_TX_BEACON);
++		IWL_CMD(WHO_IS_AWAKE_NOTIFICATION);
++		IWL_CMD(QUIET_NOTIFICATION);
++		IWL_CMD(REPLY_TX_PWR_TABLE_CMD);
++		IWL_CMD(MEASURE_ABORT_NOTIFICATION);
++		IWL_CMD(REPLY_BT_CONFIG);
++		IWL_CMD(REPLY_STATISTICS_CMD);
++		IWL_CMD(STATISTICS_NOTIFICATION);
++		IWL_CMD(REPLY_CARD_STATE_CMD);
++		IWL_CMD(CARD_STATE_NOTIFICATION);
++		IWL_CMD(MISSED_BEACONS_NOTIFICATION);
++	default:
++		return "UNKNOWN";
++
++	}
++}
++
++#define HOST_COMPLETE_TIMEOUT (HZ / 2)
++
++/**
++ * iwl_enqueue_hcmd - enqueue a uCode command
++ * @priv: device private data point
++ * @cmd: a point to the ucode command structure
++ *
++ * The function returns < 0 values to indicate the operation is
++ * failed. On success, it turns the index (> 0) of command in the
++ * command queue.
++ */
++static int iwl_enqueue_hcmd(struct iwl_priv *priv, struct iwl_host_cmd *cmd)
++{
++	struct iwl_tx_queue *txq = &priv->txq[IWL_CMD_QUEUE_NUM];
++	struct iwl_queue *q = &txq->q;
++	struct iwl_tfd_frame *tfd;
++	u32 *control_flags;
++	struct iwl_cmd *out_cmd;
++	u32 idx;
++	u16 fix_size = (u16)(cmd->len + sizeof(out_cmd->hdr));
++	dma_addr_t phys_addr;
++	int pad;
++	u16 count;
++	int ret;
++	unsigned long flags;
++
++	/* If any of the command structures end up being larger than
++	 * the TFD_MAX_PAYLOAD_SIZE, and it sent as a 'small' command then
++	 * we will need to increase the size of the TFD entries */
++	BUG_ON((fix_size > TFD_MAX_PAYLOAD_SIZE) &&
++	       !(cmd->meta.flags & CMD_SIZE_HUGE));
++
++	if (iwl_queue_space(q) < ((cmd->meta.flags & CMD_ASYNC) ? 2 : 1)) {
++		IWL_ERROR("No space for Tx\n");
++		return -ENOSPC;
++	}
++
++	spin_lock_irqsave(&priv->hcmd_lock, flags);
++
++	tfd = &txq->bd[q->first_empty];
++	memset(tfd, 0, sizeof(*tfd));
++
++	control_flags = (u32 *) tfd;
++
++	idx = get_cmd_index(q, q->first_empty, cmd->meta.flags & CMD_SIZE_HUGE);
++	out_cmd = &txq->cmd[idx];
++
++	out_cmd->hdr.cmd = cmd->id;
++	memcpy(&out_cmd->meta, &cmd->meta, sizeof(cmd->meta));
++	memcpy(&out_cmd->cmd.payload, cmd->data, cmd->len);
++
++	/* At this point, the out_cmd now has all of the incoming cmd
++	 * information */
++
++	out_cmd->hdr.flags = 0;
++	out_cmd->hdr.sequence = cpu_to_le16(QUEUE_TO_SEQ(IWL_CMD_QUEUE_NUM) |
++			INDEX_TO_SEQ(q->first_empty));
++	if (out_cmd->meta.flags & CMD_SIZE_HUGE)
++		out_cmd->hdr.sequence |= cpu_to_le16(SEQ_HUGE_FRAME);
++
++	phys_addr = txq->dma_addr_cmd + sizeof(txq->cmd[0]) * idx +
++			offsetof(struct iwl_cmd, hdr);
++	iwl_hw_txq_attach_buf_to_tfd(priv, tfd, phys_addr, fix_size);
++
++	pad = U32_PAD(cmd->len);
++	count = TFD_CTL_COUNT_GET(*control_flags);
++	*control_flags = TFD_CTL_COUNT_SET(count) | TFD_CTL_PAD_SET(pad);
++
++	IWL_DEBUG_HC("Sending command %s (#%x), seq: 0x%04X, "
++		     "%d bytes at %d[%d]:%d\n",
++		     get_cmd_string(out_cmd->hdr.cmd),
++		     out_cmd->hdr.cmd, le16_to_cpu(out_cmd->hdr.sequence),
++		     fix_size, q->first_empty, idx, IWL_CMD_QUEUE_NUM);
++
++	txq->need_update = 1;
++	q->first_empty = iwl_queue_inc_wrap(q->first_empty, q->n_bd);
++	ret = iwl_tx_queue_update_write_ptr(priv, txq);
++
++	spin_unlock_irqrestore(&priv->hcmd_lock, flags);
++	return ret ? ret : idx;
++}
++
++int iwl_send_cmd_async(struct iwl_priv *priv, struct iwl_host_cmd *cmd)
++{
++	int ret;
++
++	BUG_ON(!(cmd->meta.flags & CMD_ASYNC));
++
++	/* An asynchronous command can not expect an SKB to be set. */
++	BUG_ON(cmd->meta.flags & CMD_WANT_SKB);
++
++	/* An asynchronous command MUST have a callback. */
++	BUG_ON(!cmd->meta.u.callback);
++
++	if (test_bit(STATUS_EXIT_PENDING, &priv->status))
++		return -EBUSY;
++
++	ret = iwl_enqueue_hcmd(priv, cmd);
++	if (ret < 0) {
++		IWL_ERROR("Error sending %s: iwl_enqueue_hcmd failed: %d\n",
++			  get_cmd_string(cmd->id), ret);
++		return ret;
++	}
++	return 0;
++}
++
++int iwl_send_cmd_sync(struct iwl_priv *priv, struct iwl_host_cmd *cmd)
++{
++	int cmd_idx;
++	int ret;
++	static atomic_t entry = ATOMIC_INIT(0); /* reentrance protection */
++
++	BUG_ON(cmd->meta.flags & CMD_ASYNC);
++
++	 /* A synchronous command can not have a callback set. */
++	BUG_ON(cmd->meta.u.callback != NULL);
++
++	if (atomic_xchg(&entry, 1)) {
++		IWL_ERROR("Error sending %s: Already sending a host command\n",
++			  get_cmd_string(cmd->id));
++		return -EBUSY;
++	}
++
++	set_bit(STATUS_HCMD_ACTIVE, &priv->status);
++
++	if (cmd->meta.flags & CMD_WANT_SKB)
++		cmd->meta.source = &cmd->meta;
++
++	cmd_idx = iwl_enqueue_hcmd(priv, cmd);
++	if (cmd_idx < 0) {
++		ret = cmd_idx;
++		IWL_ERROR("Error sending %s: iwl_enqueue_hcmd failed: %d\n",
++			  get_cmd_string(cmd->id), ret);
++		goto out;
++	}
++
++	ret = wait_event_interruptible_timeout(priv->wait_command_queue,
++			!test_bit(STATUS_HCMD_ACTIVE, &priv->status),
++			HOST_COMPLETE_TIMEOUT);
++	if (!ret) {
++		if (test_bit(STATUS_HCMD_ACTIVE, &priv->status)) {
++			IWL_ERROR("Error sending %s: time out after %dms.\n",
++				  get_cmd_string(cmd->id),
++				  jiffies_to_msecs(HOST_COMPLETE_TIMEOUT));
++
++			clear_bit(STATUS_HCMD_ACTIVE, &priv->status);
++			ret = -ETIMEDOUT;
++			goto cancel;
++		}
++	}
++
++	if (test_bit(STATUS_RF_KILL_HW, &priv->status)) {
++		IWL_DEBUG_INFO("Command %s aborted: RF KILL Switch\n",
++			       get_cmd_string(cmd->id));
++		ret = -ECANCELED;
++		goto fail;
++	}
++	if (test_bit(STATUS_FW_ERROR, &priv->status)) {
++		IWL_DEBUG_INFO("Command %s failed: FW Error\n",
++			       get_cmd_string(cmd->id));
++		ret = -EIO;
++		goto fail;
++	}
++	if ((cmd->meta.flags & CMD_WANT_SKB) && !cmd->meta.u.skb) {
++		IWL_ERROR("Error: Response NULL in '%s'\n",
++			  get_cmd_string(cmd->id));
++		ret = -EIO;
++		goto out;
++	}
++
++	ret = 0;
++	goto out;
++
++cancel:
++	if (cmd->meta.flags & CMD_WANT_SKB) {
++		struct iwl_cmd *qcmd;
++
++		/* Cancel the CMD_WANT_SKB flag for the cmd in the
++		 * TX cmd queue. Otherwise in case the cmd comes
++		 * in later, it will possibly set an invalid
++		 * address (cmd->meta.source). */
++		qcmd = &priv->txq[IWL_CMD_QUEUE_NUM].cmd[cmd_idx];
++		qcmd->meta.flags &= ~CMD_WANT_SKB;
++	}
++fail:
++	if (cmd->meta.u.skb) {
++		dev_kfree_skb_any(cmd->meta.u.skb);
++		cmd->meta.u.skb = NULL;
++	}
++out:
++	atomic_set(&entry, 0);
++	return ret;
++}
++
++int iwl_send_cmd(struct iwl_priv *priv, struct iwl_host_cmd *cmd)
++{
++	/* A command can not be asynchronous AND expect an SKB to be set. */
++	BUG_ON((cmd->meta.flags & CMD_ASYNC) &&
++	       (cmd->meta.flags & CMD_WANT_SKB));
++
++	if (cmd->meta.flags & CMD_ASYNC)
++		return iwl_send_cmd_async(priv, cmd);
++
++	return iwl_send_cmd_sync(priv, cmd);
++}
++
++int iwl_send_cmd_pdu(struct iwl_priv *priv, u8 id, u16 len, const void *data)
++{
++	struct iwl_host_cmd cmd = {
++		.id = id,
++		.len = len,
++		.data = data,
++	};
++
++	return iwl_send_cmd_sync(priv, &cmd);
++}
++
++static int __must_check iwl_send_cmd_u32(struct iwl_priv *priv, u8 id, u32 val)
++{
++	struct iwl_host_cmd cmd = {
++		.id = id,
++		.len = sizeof(val),
++		.data = &val,
++	};
++
++	return iwl_send_cmd_sync(priv, &cmd);
++}
++
++int iwl_send_statistics_request(struct iwl_priv *priv)
++{
++	return iwl_send_cmd_u32(priv, REPLY_STATISTICS_CMD, 0);
++}
++
++/**
++ * iwl_rxon_add_station - add station into station table.
++ *
++ * there is only one AP station with id= IWL_AP_ID
++ * NOTE: mutex must be held before calling the this fnction
++*/
++static int iwl_rxon_add_station(struct iwl_priv *priv,
++				const u8 *addr, int is_ap)
++{
++	u8 rc;
++
++	/* Remove this station if it happens to already exist */
++	iwl_remove_station(priv, addr, is_ap);
++
++	rc = iwl_add_station(priv, addr, is_ap, 0);
++
++	return rc;
++}
++
++/**
++ * iwl_set_rxon_channel - Set the phymode and channel values in staging RXON
++ * @phymode: MODE_IEEE80211A sets to 5.2GHz; all else set to 2.4GHz
++ * @channel: Any channel valid for the requested phymode
++
++ * In addition to setting the staging RXON, priv->phymode is also set.
++ *
++ * NOTE:  Does not commit to the hardware; it sets appropriate bit fields
++ * in the staging RXON flag structure based on the phymode
++ */
++static int iwl_set_rxon_channel(struct iwl_priv *priv, u8 phymode, u16 channel)
++{
++	if (!iwl_get_channel_info(priv, phymode, channel)) {
++		IWL_DEBUG_INFO("Could not set channel to %d [%d]\n",
++			       channel, phymode);
++		return -EINVAL;
++	}
++
++	if ((le16_to_cpu(priv->staging_rxon.channel) == channel) &&
++	    (priv->phymode == phymode))
++		return 0;
++
++	priv->staging_rxon.channel = cpu_to_le16(channel);
++	if (phymode == MODE_IEEE80211A)
++		priv->staging_rxon.flags &= ~RXON_FLG_BAND_24G_MSK;
++	else
++		priv->staging_rxon.flags |= RXON_FLG_BAND_24G_MSK;
++
++	priv->phymode = phymode;
++
++	IWL_DEBUG_INFO("Staging channel set to %d [%d]\n", channel, phymode);
++
++	return 0;
++}
++
++/**
++ * iwl_check_rxon_cmd - validate RXON structure is valid
++ *
++ * NOTE:  This is really only useful during development and can eventually
++ * be #ifdef'd out once the driver is stable and folks aren't actively
++ * making changes
++ */
++static int iwl_check_rxon_cmd(struct iwl_rxon_cmd *rxon)
++{
++	int error = 0;
++	int counter = 1;
++
++	if (rxon->flags & RXON_FLG_BAND_24G_MSK) {
++		error |= le32_to_cpu(rxon->flags &
++				(RXON_FLG_TGJ_NARROW_BAND_MSK |
++				 RXON_FLG_RADAR_DETECT_MSK));
++		if (error)
++			IWL_WARNING("check 24G fields %d | %d\n",
++				    counter++, error);
++	} else {
++		error |= (rxon->flags & RXON_FLG_SHORT_SLOT_MSK) ?
++				0 : le32_to_cpu(RXON_FLG_SHORT_SLOT_MSK);
++		if (error)
++			IWL_WARNING("check 52 fields %d | %d\n",
++				    counter++, error);
++		error |= le32_to_cpu(rxon->flags & RXON_FLG_CCK_MSK);
++		if (error)
++			IWL_WARNING("check 52 CCK %d | %d\n",
++				    counter++, error);
++	}
++	error |= (rxon->node_addr[0] | rxon->bssid_addr[0]) & 0x1;
++	if (error)
++		IWL_WARNING("check mac addr %d | %d\n", counter++, error);
++
++	/* make sure basic rates 6Mbps and 1Mbps are supported */
++	error |= (((rxon->ofdm_basic_rates & IWL_RATE_6M_MASK) == 0) &&
++		  ((rxon->cck_basic_rates & IWL_RATE_1M_MASK) == 0));
++	if (error)
++		IWL_WARNING("check basic rate %d | %d\n", counter++, error);
++
++	error |= (le16_to_cpu(rxon->assoc_id) > 2007);
++	if (error)
++		IWL_WARNING("check assoc id %d | %d\n", counter++, error);
++
++	error |= ((rxon->flags & (RXON_FLG_CCK_MSK | RXON_FLG_SHORT_SLOT_MSK))
++			== (RXON_FLG_CCK_MSK | RXON_FLG_SHORT_SLOT_MSK));
++	if (error)
++		IWL_WARNING("check CCK and short slot %d | %d\n",
++			    counter++, error);
++
++	error |= ((rxon->flags & (RXON_FLG_CCK_MSK | RXON_FLG_AUTO_DETECT_MSK))
++			== (RXON_FLG_CCK_MSK | RXON_FLG_AUTO_DETECT_MSK));
++	if (error)
++		IWL_WARNING("check CCK & auto detect %d | %d\n",
++			    counter++, error);
++
++	error |= ((rxon->flags & (RXON_FLG_AUTO_DETECT_MSK |
++			RXON_FLG_TGG_PROTECT_MSK)) == RXON_FLG_TGG_PROTECT_MSK);
++	if (error)
++		IWL_WARNING("check TGG and auto detect %d | %d\n",
++			    counter++, error);
++
++	if ((rxon->flags & RXON_FLG_DIS_DIV_MSK))
++		error |= ((rxon->flags & (RXON_FLG_ANT_B_MSK |
++				RXON_FLG_ANT_A_MSK)) == 0);
++	if (error)
++		IWL_WARNING("check antenna %d %d\n", counter++, error);
++
++	if (error)
++		IWL_WARNING("Tuning to channel %d\n",
++			    le16_to_cpu(rxon->channel));
++
++	if (error) {
++		IWL_ERROR("Not a valid iwl_rxon_assoc_cmd field values\n");
++		return -1;
++	}
++	return 0;
++}
++
++/**
++ * iwl_full_rxon_required - determine if RXON_ASSOC can be used in RXON commit
++ * @priv: staging_rxon is comapred to active_rxon
++ *
++ * If the RXON structure is changing sufficient to require a new
++ * tune or to clear and reset the RXON_FILTER_ASSOC_MSK then return 1
++ * to indicate a new tune is required.
++ */
++static int iwl_full_rxon_required(struct iwl_priv *priv)
++{
++
++	/* These items are only settable from the full RXON command */
++	if (!(priv->active_rxon.filter_flags & RXON_FILTER_ASSOC_MSK) ||
++	    compare_ether_addr(priv->staging_rxon.bssid_addr,
++			       priv->active_rxon.bssid_addr) ||
++	    compare_ether_addr(priv->staging_rxon.node_addr,
++			       priv->active_rxon.node_addr) ||
++	    compare_ether_addr(priv->staging_rxon.wlap_bssid_addr,
++			       priv->active_rxon.wlap_bssid_addr) ||
++	    (priv->staging_rxon.dev_type != priv->active_rxon.dev_type) ||
++	    (priv->staging_rxon.channel != priv->active_rxon.channel) ||
++	    (priv->staging_rxon.air_propagation !=
++	     priv->active_rxon.air_propagation) ||
++	    (priv->staging_rxon.assoc_id != priv->active_rxon.assoc_id))
++		return 1;
++
++	/* flags, filter_flags, ofdm_basic_rates, and cck_basic_rates can
++	 * be updated with the RXON_ASSOC command -- however only some
++	 * flag transitions are allowed using RXON_ASSOC */
++
++	/* Check if we are not switching bands */
++	if ((priv->staging_rxon.flags & RXON_FLG_BAND_24G_MSK) !=
++	    (priv->active_rxon.flags & RXON_FLG_BAND_24G_MSK))
++		return 1;
++
++	/* Check if we are switching association toggle */
++	if ((priv->staging_rxon.filter_flags & RXON_FILTER_ASSOC_MSK) !=
++		(priv->active_rxon.filter_flags & RXON_FILTER_ASSOC_MSK))
++		return 1;
++
++	return 0;
++}
++
++static int iwl_send_rxon_assoc(struct iwl_priv *priv)
++{
++	int rc = 0;
++	struct iwl_rx_packet *res = NULL;
++	struct iwl_rxon_assoc_cmd rxon_assoc;
++	struct iwl_host_cmd cmd = {
++		.id = REPLY_RXON_ASSOC,
++		.len = sizeof(rxon_assoc),
++		.meta.flags = CMD_WANT_SKB,
++		.data = &rxon_assoc,
++	};
++	const struct iwl_rxon_cmd *rxon1 = &priv->staging_rxon;
++	const struct iwl_rxon_cmd *rxon2 = &priv->active_rxon;
++
++	if ((rxon1->flags == rxon2->flags) &&
++	    (rxon1->filter_flags == rxon2->filter_flags) &&
++	    (rxon1->cck_basic_rates == rxon2->cck_basic_rates) &&
++	    (rxon1->ofdm_basic_rates == rxon2->ofdm_basic_rates)) {
++		IWL_DEBUG_INFO("Using current RXON_ASSOC.  Not resending.\n");
++		return 0;
++	}
++
++	rxon_assoc.flags = priv->staging_rxon.flags;
++	rxon_assoc.filter_flags = priv->staging_rxon.filter_flags;
++	rxon_assoc.ofdm_basic_rates = priv->staging_rxon.ofdm_basic_rates;
++	rxon_assoc.cck_basic_rates = priv->staging_rxon.cck_basic_rates;
++	rxon_assoc.reserved = 0;
++
++	rc = iwl_send_cmd_sync(priv, &cmd);
++	if (rc)
++		return rc;
++
++	res = (struct iwl_rx_packet *)cmd.meta.u.skb->data;
++	if (res->hdr.flags & IWL_CMD_FAILED_MSK) {
++		IWL_ERROR("Bad return from REPLY_RXON_ASSOC command\n");
++		rc = -EIO;
++	}
++
++	priv->alloc_rxb_skb--;
++	dev_kfree_skb_any(cmd.meta.u.skb);
++
++	return rc;
++}
++
++/**
++ * iwl_commit_rxon - commit staging_rxon to hardware
++ *
++ * The RXON command in staging_rxon is commited to the hardware and
++ * the active_rxon structure is updated with the new data.  This
++ * function correctly transitions out of the RXON_ASSOC_MSK state if
++ * a HW tune is required based on the RXON structure changes.
++ */
++static int iwl_commit_rxon(struct iwl_priv *priv)
++{
++	/* cast away the const for active_rxon in this function */
++	struct iwl_rxon_cmd *active_rxon = (void *)&priv->active_rxon;
++	int rc = 0;
++
++	if (!iwl_is_alive(priv))
++		return -1;
++
++	/* always get timestamp with Rx frame */
++	priv->staging_rxon.flags |= RXON_FLG_TSF2HOST_MSK;
++
++	/* select antenna */
++	priv->staging_rxon.flags &=
++	    ~(RXON_FLG_DIS_DIV_MSK | RXON_FLG_ANT_SEL_MSK);
++	priv->staging_rxon.flags |= iwl3945_get_antenna_flags(priv);
++
++	rc = iwl_check_rxon_cmd(&priv->staging_rxon);
++	if (rc) {
++		IWL_ERROR("Invalid RXON configuration.  Not committing.\n");
++		return -EINVAL;
++	}
++
++	/* If we don't need to send a full RXON, we can use
++	 * iwl_rxon_assoc_cmd which is used to reconfigure filter
++	 * and other flags for the current radio configuration. */
++	if (!iwl_full_rxon_required(priv)) {
++		rc = iwl_send_rxon_assoc(priv);
++		if (rc) {
++			IWL_ERROR("Error setting RXON_ASSOC "
++				  "configuration (%d).\n", rc);
++			return rc;
++		}
++
++		memcpy(active_rxon, &priv->staging_rxon, sizeof(*active_rxon));
++
++		return 0;
++	}
++
++	/* If we are currently associated and the new config requires
++	 * an RXON_ASSOC and the new config wants the associated mask enabled,
++	 * we must clear the associated from the active configuration
++	 * before we apply the new config */
++	if (iwl_is_associated(priv) &&
++	    (priv->staging_rxon.filter_flags & RXON_FILTER_ASSOC_MSK)) {
++		IWL_DEBUG_INFO("Toggling associated bit on current RXON\n");
++		active_rxon->filter_flags &= ~RXON_FILTER_ASSOC_MSK;
++
++		rc = iwl_send_cmd_pdu(priv, REPLY_RXON,
++				      sizeof(struct iwl_rxon_cmd),
++				      &priv->active_rxon);
++
++		/* If the mask clearing failed then we set
++		 * active_rxon back to what it was previously */
++		if (rc) {
++			active_rxon->filter_flags |= RXON_FILTER_ASSOC_MSK;
++			IWL_ERROR("Error clearing ASSOC_MSK on current "
++				  "configuration (%d).\n", rc);
++			return rc;
++		}
++
++		/* The RXON bit toggling will have cleared out the
++		 * station table in the uCode, so blank it in the driver
++		 * as well */
++		iwl_clear_stations_table(priv);
++	} else if (priv->staging_rxon.filter_flags & RXON_FILTER_ASSOC_MSK) {
++		/* When switching from non-associated to associated, the
++		 * uCode clears out the station table; so clear it in the
++		 * driver as well */
++		iwl_clear_stations_table(priv);
++	}
++
++	IWL_DEBUG_INFO("Sending RXON\n"
++		       "* with%s RXON_FILTER_ASSOC_MSK\n"
++		       "* channel = %d\n"
++		       "* bssid = " MAC_FMT "\n",
++		       ((priv->staging_rxon.filter_flags &
++			 RXON_FILTER_ASSOC_MSK) ? "" : "out"),
++		       le16_to_cpu(priv->staging_rxon.channel),
++		       MAC_ARG(priv->staging_rxon.bssid_addr));
++
++	/* Apply the new configuration */
++	rc = iwl_send_cmd_pdu(priv, REPLY_RXON,
++			      sizeof(struct iwl_rxon_cmd), &priv->staging_rxon);
++	if (rc) {
++		IWL_ERROR("Error setting new configuration (%d).\n", rc);
++		return rc;
++	}
++
++	memcpy(active_rxon, &priv->staging_rxon, sizeof(*active_rxon));
++
++	/* If we issue a new RXON command which required a tune then we must
++	 * send a new TXPOWER command or we won't be able to Tx any frames */
++	rc = iwl_hw_reg_send_txpower(priv);
++	if (rc) {
++		IWL_ERROR("Error setting Tx power (%d).\n", rc);
++		return rc;
++	}
++
++	/* Add the broadcast address so we can send broadcast frames */
++	if (iwl_rxon_add_station(priv, BROADCAST_ADDR, 0) ==
++	    IWL_INVALID_STATION) {
++		IWL_ERROR("Error adding BROADCAST address for transmit.\n");
++		return -EIO;
++	}
++
++	/* If we have set the ASSOC_MSK and we are in BSS mode then
++	 * add the IWL_AP_ID to the station rate table */
++	if (iwl_is_associated(priv) &&
++	    (priv->iw_mode == IEEE80211_IF_TYPE_STA))
++		if (iwl_rxon_add_station(priv, priv->active_rxon.bssid_addr, 1)
++		    == IWL_INVALID_STATION) {
++			IWL_ERROR("Error adding AP address for transmit.\n");
++			return -EIO;
++		}
++
++	/* Init the hardware's rate fallback order based on the
++	 * phymode */
++	rc = iwl3945_init_hw_rate_table(priv);
++	if (rc) {
++		IWL_ERROR("Error setting HW rate table: %02X\n", rc);
++		return -EIO;
++	}
++
++	return 0;
++}
++
++static int iwl_send_bt_config(struct iwl_priv *priv)
++{
++	struct iwl_bt_cmd bt_cmd = {
++		.flags = 3,
++		.lead_time = 0xAA,
++		.max_kill = 1,
++		.kill_ack_mask = 0,
++		.kill_cts_mask = 0,
++	};
++
++	return iwl_send_cmd_pdu(priv, REPLY_BT_CONFIG,
++				sizeof(struct iwl_bt_cmd), &bt_cmd);
++}
++
++static int iwl_send_scan_abort(struct iwl_priv *priv)
++{
++	int rc = 0;
++	struct iwl_rx_packet *res;
++	struct iwl_host_cmd cmd = {
++		.id = REPLY_SCAN_ABORT_CMD,
++		.meta.flags = CMD_WANT_SKB,
++	};
++
++	/* If there isn't a scan actively going on in the hardware
++	 * then we are in between scan bands and not actually
++	 * actively scanning, so don't send the abort command */
++	if (!test_bit(STATUS_SCAN_HW, &priv->status)) {
++		clear_bit(STATUS_SCAN_ABORTING, &priv->status);
++		return 0;
++	}
++
++	rc = iwl_send_cmd_sync(priv, &cmd);
++	if (rc) {
++		clear_bit(STATUS_SCAN_ABORTING, &priv->status);
++		return rc;
++	}
++
++	res = (struct iwl_rx_packet *)cmd.meta.u.skb->data;
++	if (res->u.status != CAN_ABORT_STATUS) {
++		/* The scan abort will return 1 for success or
++		 * 2 for "failure".  A failure condition can be
++		 * due to simply not being in an active scan which
++		 * can occur if we send the scan abort before we
++		 * the microcode has notified us that a scan is
++		 * completed. */
++		IWL_DEBUG_INFO("SCAN_ABORT returned %d.\n", res->u.status);
++		clear_bit(STATUS_SCAN_ABORTING, &priv->status);
++		clear_bit(STATUS_SCAN_HW, &priv->status);
++	}
++
++	dev_kfree_skb_any(cmd.meta.u.skb);
++
++	return rc;
++}
++
++static int iwl_card_state_sync_callback(struct iwl_priv *priv,
++					struct iwl_cmd *cmd,
++					struct sk_buff *skb)
++{
++	return 1;
++}
++
++/*
++ * CARD_STATE_CMD
++ *
++ * Use: Sets the internal card state to enable, disable, or halt
++ *
++ * When in the 'enable' state the card operates as normal.
++ * When in the 'disable' state, the card enters into a low power mode.
++ * When in the 'halt' state, the card is shut down and must be fully
++ * restarted to come back on.
++ */
++static int iwl_send_card_state(struct iwl_priv *priv, u32 flags, u8 meta_flag)
++{
++	struct iwl_host_cmd cmd = {
++		.id = REPLY_CARD_STATE_CMD,
++		.len = sizeof(u32),
++		.data = &flags,
++		.meta.flags = meta_flag,
++	};
++
++	if (meta_flag & CMD_ASYNC)
++		cmd.meta.u.callback = iwl_card_state_sync_callback;
++
++	return iwl_send_cmd(priv, &cmd);
++}
++
++static int iwl_add_sta_sync_callback(struct iwl_priv *priv,
++				     struct iwl_cmd *cmd, struct sk_buff *skb)
++{
++	struct iwl_rx_packet *res = NULL;
++
++	if (!skb) {
++		IWL_ERROR("Error: Response NULL in REPLY_ADD_STA.\n");
++		return 1;
++	}
++
++	res = (struct iwl_rx_packet *)skb->data;
++	if (res->hdr.flags & IWL_CMD_FAILED_MSK) {
++		IWL_ERROR("Bad return from REPLY_ADD_STA (0x%08X)\n",
++			  res->hdr.flags);
++		return 1;
++	}
++
++	switch (res->u.add_sta.status) {
++	case ADD_STA_SUCCESS_MSK:
++		break;
++	default:
++		break;
++	}
++
++	/* We didn't cache the SKB; let the caller free it */
++	return 1;
++}
++
++int iwl_send_add_station(struct iwl_priv *priv,
++			 struct iwl_addsta_cmd *sta, u8 flags)
++{
++	struct iwl_rx_packet *res = NULL;
++	int rc = 0;
++	struct iwl_host_cmd cmd = {
++		.id = REPLY_ADD_STA,
++		.len = sizeof(struct iwl_addsta_cmd),
++		.meta.flags = flags,
++		.data = sta,
++	};
++
++	if (flags & CMD_ASYNC)
++		cmd.meta.u.callback = iwl_add_sta_sync_callback;
++	else
++		cmd.meta.flags |= CMD_WANT_SKB;
++
++	rc = iwl_send_cmd(priv, &cmd);
++
++	if (rc || (flags & CMD_ASYNC))
++		return rc;
++
++	res = (struct iwl_rx_packet *)cmd.meta.u.skb->data;
++	if (res->hdr.flags & IWL_CMD_FAILED_MSK) {
++		IWL_ERROR("Bad return from REPLY_ADD_STA (0x%08X)\n",
++			  res->hdr.flags);
++		rc = -EIO;
++	}
++
++	if (rc == 0) {
++		switch (res->u.add_sta.status) {
++		case ADD_STA_SUCCESS_MSK:
++			IWL_DEBUG_INFO("REPLY_ADD_STA PASSED\n");
++			break;
++		default:
++			rc = -EIO;
++			IWL_WARNING("REPLY_ADD_STA failed\n");
++			break;
++		}
++	}
++
++	priv->alloc_rxb_skb--;
++	dev_kfree_skb_any(cmd.meta.u.skb);
++
++	return rc;
++}
++
++static int iwl_update_sta_key_info(struct iwl_priv *priv,
++				   struct ieee80211_key_conf *keyconf,
++				   u8 sta_id)
++{
++	unsigned long flags;
++	__le16 key_flags = 0;
++
++	switch (keyconf->alg) {
++	case ALG_CCMP:
++		key_flags |= STA_KEY_FLG_CCMP;
++		key_flags |= cpu_to_le16(
++				keyconf->keyidx << STA_KEY_FLG_KEYID_POS);
++		key_flags &= ~STA_KEY_FLG_INVALID;
++		break;
++	case ALG_TKIP:
++	case ALG_WEP:
++		return -EINVAL;
++	default:
++		return -EINVAL;
++	}
++	spin_lock_irqsave(&priv->sta_lock, flags);
++	priv->stations[sta_id].keyinfo.alg = keyconf->alg;
++	priv->stations[sta_id].keyinfo.keylen = keyconf->keylen;
++	memcpy(priv->stations[sta_id].keyinfo.key, keyconf->key,
++	       keyconf->keylen);
++
++	memcpy(priv->stations[sta_id].sta.key.key, keyconf->key,
++	       keyconf->keylen);
++	priv->stations[sta_id].sta.key.key_flags = key_flags;
++	priv->stations[sta_id].sta.sta.modify_mask = STA_MODIFY_KEY_MASK;
++	priv->stations[sta_id].sta.mode = STA_CONTROL_MODIFY_MSK;
++
++	spin_unlock_irqrestore(&priv->sta_lock, flags);
++
++	IWL_DEBUG_INFO("hwcrypto: modify ucode station key info\n");
++	iwl_send_add_station(priv, &priv->stations[sta_id].sta, 0);
++	return 0;
++}
++
++static int iwl_clear_sta_key_info(struct iwl_priv *priv, u8 sta_id)
++{
++	unsigned long flags;
++
++	spin_lock_irqsave(&priv->sta_lock, flags);
++	memset(&priv->stations[sta_id].keyinfo, 0, sizeof(struct iwl_hw_key));
++	memset(&priv->stations[sta_id].sta.key, 0, sizeof(struct iwl_keyinfo));
++	priv->stations[sta_id].sta.key.key_flags = STA_KEY_FLG_NO_ENC;
++	priv->stations[sta_id].sta.sta.modify_mask = STA_MODIFY_KEY_MASK;
++	priv->stations[sta_id].sta.mode = STA_CONTROL_MODIFY_MSK;
++	spin_unlock_irqrestore(&priv->sta_lock, flags);
++
++	IWL_DEBUG_INFO("hwcrypto: clear ucode station key info\n");
++	iwl_send_add_station(priv, &priv->stations[sta_id].sta, 0);
++	return 0;
++}
++
++static void iwl_clear_free_frames(struct iwl_priv *priv)
++{
++	struct list_head *element;
++
++	IWL_DEBUG_INFO("%d frames on pre-allocated heap on clear.\n",
++		       priv->frames_count);
++
++	while (!list_empty(&priv->free_frames)) {
++		element = priv->free_frames.next;
++		list_del(element);
++		kfree(list_entry(element, struct iwl_frame, list));
++		priv->frames_count--;
++	}
++
++	if (priv->frames_count) {
++		IWL_WARNING("%d frames still in use.  Did we lose one?\n",
++			    priv->frames_count);
++		priv->frames_count = 0;
++	}
++}
++
++static struct iwl_frame *iwl_get_free_frame(struct iwl_priv *priv)
++{
++	struct iwl_frame *frame;
++	struct list_head *element;
++	if (list_empty(&priv->free_frames)) {
++		frame = kzalloc(sizeof(*frame), GFP_KERNEL);
++		if (!frame) {
++			IWL_ERROR("Could not allocate frame!\n");
++			return NULL;
++		}
++
++		priv->frames_count++;
++		return frame;
++	}
++
++	element = priv->free_frames.next;
++	list_del(element);
++	return list_entry(element, struct iwl_frame, list);
++}
++
++static void iwl_free_frame(struct iwl_priv *priv, struct iwl_frame *frame)
++{
++	memset(frame, 0, sizeof(*frame));
++	list_add(&frame->list, &priv->free_frames);
++}
++
++unsigned int iwl_fill_beacon_frame(struct iwl_priv *priv,
++				struct ieee80211_hdr *hdr,
++				const u8 *dest, int left)
++{
++
++	if (!iwl_is_associated(priv) || !priv->ibss_beacon ||
++	    ((priv->iw_mode != IEEE80211_IF_TYPE_IBSS) &&
++	     (priv->iw_mode != IEEE80211_IF_TYPE_AP)))
++		return 0;
++
++	if (priv->ibss_beacon->len > left)
++		return 0;
++
++	memcpy(hdr, priv->ibss_beacon->data, priv->ibss_beacon->len);
++
++	return priv->ibss_beacon->len;
++}
++
++static int iwl_rate_index_from_plcp(int plcp)
++{
++	int i = 0;
++
++	for (i = 0; i < IWL_RATE_COUNT; i++)
++		if (iwl_rates[i].plcp == plcp)
++			return i;
++	return -1;
++}
++
++static u8 iwl_rate_get_lowest_plcp(int rate_mask)
++{
++	u8 i;
++
++	for (i = IWL_RATE_1M_INDEX; i != IWL_RATE_INVALID;
++	     i = iwl_rates[i].next_ieee) {
++		if (rate_mask & (1 << i))
++			return iwl_rates[i].plcp;
++	}
++
++	return IWL_RATE_INVALID;
++}
++
++static int iwl_send_beacon_cmd(struct iwl_priv *priv)
++{
++	struct iwl_frame *frame;
++	unsigned int frame_size;
++	int rc;
++	u8 rate;
++
++	frame = iwl_get_free_frame(priv);
++
++	if (!frame) {
++		IWL_ERROR("Could not obtain free frame buffer for beacon "
++			  "command.\n");
++		return -ENOMEM;
++	}
++
++	if (!(priv->staging_rxon.flags & RXON_FLG_BAND_24G_MSK)) {
++		rate = iwl_rate_get_lowest_plcp(priv->active_rate_basic &
++						0xFF0);
++		if (rate == IWL_INVALID_RATE)
++			rate = IWL_RATE_6M_PLCP;
++	} else {
++		rate = iwl_rate_get_lowest_plcp(priv->active_rate_basic & 0xF);
++		if (rate == IWL_INVALID_RATE)
++			rate = IWL_RATE_1M_PLCP;
++	}
++
++	frame_size = iwl_hw_get_beacon_cmd(priv, frame, rate);
++
++	rc = iwl_send_cmd_pdu(priv, REPLY_TX_BEACON, frame_size,
++			      &frame->u.cmd[0]);
++
++	iwl_free_frame(priv, frame);
++
++	return rc;
++}
++
++/******************************************************************************
++ *
++ * EEPROM related functions
++ *
++ ******************************************************************************/
++
++static void get_eeprom_mac(struct iwl_priv *priv, u8 *mac)
++{
++	memcpy(mac, priv->eeprom.mac_address, 6);
++}
++
++/**
++ * iwl_eeprom_init - read EEPROM contents
++ *
++ * Load the EEPROM from adapter into priv->eeprom
++ *
++ * NOTE:  This routine uses the non-debug IO access functions.
++ */
++int iwl_eeprom_init(struct iwl_priv *priv)
++{
++	u16 *e = (u16 *)&priv->eeprom;
++	u32 gp = iwl_read32(priv, CSR_EEPROM_GP);
++	u32 r;
++	int sz = sizeof(priv->eeprom);
++	int rc;
++	int i;
++	u16 addr;
++
++	/* The EEPROM structure has several padding buffers within it
++	 * and when adding new EEPROM maps is subject to programmer errors
++	 * which may be very difficult to identify without explicitly
++	 * checking the resulting size of the eeprom map. */
++	BUILD_BUG_ON(sizeof(priv->eeprom) != IWL_EEPROM_IMAGE_SIZE);
++
++	if ((gp & CSR_EEPROM_GP_VALID_MSK) == CSR_EEPROM_GP_BAD_SIGNATURE) {
++		IWL_ERROR("EEPROM not found, EEPROM_GP=0x%08x", gp);
++		return -ENOENT;
++	}
++
++	rc = iwl_eeprom_aqcuire_semaphore(priv);
++	if (rc < 0) {
++		IWL_ERROR("Failed to aqcuire EEPROM semaphore.\n");
++		return -ENOENT;
++	}
++
++	/* eeprom is an array of 16bit values */
++	for (addr = 0; addr < sz; addr += sizeof(u16)) {
++		_iwl_write32(priv, CSR_EEPROM_REG, addr << 1);
++		_iwl_clear_bit(priv, CSR_EEPROM_REG, CSR_EEPROM_REG_BIT_CMD);
++
++		for (i = 0; i < IWL_EEPROM_ACCESS_TIMEOUT;
++					i += IWL_EEPROM_ACCESS_DELAY) {
++			r = _iwl_read_restricted(priv, CSR_EEPROM_REG);
++			if (r & CSR_EEPROM_REG_READ_VALID_MSK)
++				break;
++			udelay(IWL_EEPROM_ACCESS_DELAY);
++		}
++
++		if (!(r & CSR_EEPROM_REG_READ_VALID_MSK)) {
++			IWL_ERROR("Time out reading EEPROM[%d]", addr);
++			return -ETIMEDOUT;
++		}
++		e[addr / 2] = le16_to_cpu(r >> 16);
++	}
++
++	return 0;
++}
++
++/******************************************************************************
++ *
++ * Misc. internal state and helper functions
++ *
++ ******************************************************************************/
++#ifdef CONFIG_IWLWIFI_DEBUG
++
++/**
++ * iwl_report_frame - dump frame to syslog during debug sessions
++ *
++ * hack this function to show different aspects of received frames,
++ * including selective frame dumps.
++ * group100 parameter selects whether to show 1 out of 100 good frames.
++ *
++ * TODO:  ieee80211_hdr stuff is common to 3945 and 4965, so frame type
++ *        info output is okay, but some of this stuff (e.g. iwl_rx_frame_stats)
++ *        is 3945-specific and gives bad output for 4965.  Need to split the
++ *        functionality, keep common stuff here.
++ */
++void iwl_report_frame(struct iwl_priv *priv,
++		      struct iwl_rx_packet *pkt,
++		      struct ieee80211_hdr *header, int group100)
++{
++	u32 to_us;
++	u32 print_summary = 0;
++	u32 print_dump = 0;	/* set to 1 to dump all frames' contents */
++	u32 hundred = 0;
++	u32 dataframe = 0;
++	u16 fc;
++	u16 seq_ctl;
++	u16 channel;
++	u16 phy_flags;
++	int rate_sym;
++	u16 length;
++	u16 status;
++	u16 bcn_tmr;
++	u32 tsf_low;
++	u64 tsf;
++	u8 rssi;
++	u8 agc;
++	u16 sig_avg;
++	u16 noise_diff;
++	struct iwl_rx_frame_stats *rx_stats = IWL_RX_STATS(pkt);
++	struct iwl_rx_frame_hdr *rx_hdr = IWL_RX_HDR(pkt);
++	struct iwl_rx_frame_end *rx_end = IWL_RX_END(pkt);
++	u8 *data = IWL_RX_DATA(pkt);
++
++	/* MAC header */
++	fc = le16_to_cpu(header->frame_control);
++	seq_ctl = le16_to_cpu(header->seq_ctrl);
++
++	/* metadata */
++	channel = le16_to_cpu(rx_hdr->channel);
++	phy_flags = le16_to_cpu(rx_hdr->phy_flags);
++	rate_sym = rx_hdr->rate;
++	length = le16_to_cpu(rx_hdr->len);
++
++	/* end-of-frame status and timestamp */
++	status = le32_to_cpu(rx_end->status);
++	bcn_tmr = le32_to_cpu(rx_end->beacon_timestamp);
++	tsf_low = le64_to_cpu(rx_end->timestamp) & 0x0ffffffff;
++	tsf = le64_to_cpu(rx_end->timestamp);
++
++	/* signal statistics */
++	rssi = rx_stats->rssi;
++	agc = rx_stats->agc;
++	sig_avg = le16_to_cpu(rx_stats->sig_avg);
++	noise_diff = le16_to_cpu(rx_stats->noise_diff);
++
++	to_us = !compare_ether_addr(header->addr1, priv->mac_addr);
++
++	/* if data frame is to us and all is good,
++	 *   (optionally) print summary for only 1 out of every 100 */
++	if (to_us && (fc & ~IEEE80211_FCTL_PROTECTED) ==
++	    (IEEE80211_FCTL_FROMDS | IEEE80211_FTYPE_DATA)) {
++		dataframe = 1;
++		if (!group100)
++			print_summary = 1;	/* print each frame */
++		else if (priv->framecnt_to_us < 100) {
++			priv->framecnt_to_us++;
++			print_summary = 0;
++		} else {
++			priv->framecnt_to_us = 0;
++			print_summary = 1;
++			hundred = 1;
++		}
++	} else {
++		/* print summary for all other frames */
++		print_summary = 1;
++	}
++
++	if (print_summary) {
++		char *title;
++		u32 rate;
++
++		if (hundred)
++			title = "100Frames";
++		else if (fc & IEEE80211_FCTL_RETRY)
++			title = "Retry";
++		else if (ieee80211_is_assoc_response(fc))
++			title = "AscRsp";
++		else if (ieee80211_is_reassoc_response(fc))
++			title = "RasRsp";
++		else if (ieee80211_is_probe_response(fc)) {
++			title = "PrbRsp";
++			print_dump = 1;	/* dump frame contents */
++		} else if (ieee80211_is_beacon(fc)) {
++			title = "Beacon";
++			print_dump = 1;	/* dump frame contents */
++		} else if (ieee80211_is_atim(fc))
++			title = "ATIM";
++		else if (ieee80211_is_auth(fc))
++			title = "Auth";
++		else if (ieee80211_is_deauth(fc))
++			title = "DeAuth";
++		else if (ieee80211_is_disassoc(fc))
++			title = "DisAssoc";
++		else
++			title = "Frame";
++
++		rate = iwl_rate_index_from_plcp(rate_sym);
++		if (rate == -1)
++			rate = 0;
++		else
++			rate = iwl_rates[rate].ieee / 2;
++
++		/* print frame summary.
++		 * MAC addresses show just the last byte (for brevity),
++		 *    but you can hack it to show more, if you'd like to. */
++		if (dataframe)
++			IWL_DEBUG_RX("%s: mhd=0x%04x, dst=0x%02x, "
++				     "len=%u, rssi=%d, chnl=%d, rate=%u, \n",
++				     title, fc, header->addr1[5],
++				     length, rssi, channel, rate);
++		else {
++			/* src/dst addresses assume managed mode */
++			IWL_DEBUG_RX("%s: 0x%04x, dst=0x%02x, "
++				     "src=0x%02x, rssi=%u, tim=%lu usec, "
++				     "phy=0x%02x, chnl=%d\n",
++				     title, fc, header->addr1[5],
++				     header->addr3[5], rssi,
++				     tsf_low - priv->scan_start_tsf,
++				     phy_flags, channel);
++		}
++	}
++	if (print_dump)
++		iwl_print_hex_dump(IWL_DL_RX, data, length);
++}
++#endif
++
++static void iwl_unset_hw_setting(struct iwl_priv *priv)
++{
++	if (priv->hw_setting.shared_virt)
++		pci_free_consistent(priv->pci_dev,
++				    sizeof(struct iwl_shared),
++				    priv->hw_setting.shared_virt,
++				    priv->hw_setting.shared_phys);
++}
++
++/**
++ * iwl_supported_rate_to_ie - fill in the supported rate in IE field
++ *
++ * return : set the bit for each supported rate insert in ie
++ */
++static u16 iwl_supported_rate_to_ie(u8 *ie, u16 supported_rate,
++				    u16 basic_rate, int max_count)
++{
++	u16 ret_rates = 0, bit;
++	int i;
++	u8 *rates;
++
++	rates = &(ie[1]);
++
++	for (bit = 1, i = 0; i < IWL_RATE_COUNT; i++, bit <<= 1) {
++		if (bit & supported_rate) {
++			ret_rates |= bit;
++			rates[*ie] = iwl_rates[i].ieee |
++			    ((bit & basic_rate) ? 0x80 : 0x00);
++			*ie = *ie + 1;
++			if (*ie >= max_count)
++				break;
++		}
++	}
++
++	return ret_rates;
++}
++
++/**
++ * iwl_fill_probe_req - fill in all required fields and IE for probe request
++ */
++static u16 iwl_fill_probe_req(struct iwl_priv *priv,
++			      struct ieee80211_mgmt *frame,
++			      int left, int is_direct)
++{
++	int len = 0;
++	u8 *pos = NULL;
++	u16 ret_rates;
++
++	/* Make sure there is enough space for the probe request,
++	 * two mandatory IEs and the data */
++	left -= 24;
++	if (left < 0)
++		return 0;
++	len += 24;
++
++	frame->frame_control = cpu_to_le16(IEEE80211_STYPE_PROBE_REQ);
++	memcpy(frame->da, BROADCAST_ADDR, ETH_ALEN);
++	memcpy(frame->sa, priv->mac_addr, ETH_ALEN);
++	memcpy(frame->bssid, BROADCAST_ADDR, ETH_ALEN);
++	frame->seq_ctrl = 0;
++
++	/* fill in our indirect SSID IE */
++	/* ...next IE... */
++
++	left -= 2;
++	if (left < 0)
++		return 0;
++	len += 2;
++	pos = &(frame->u.probe_req.variable[0]);
++	*pos++ = WLAN_EID_SSID;
++	*pos++ = 0;
++
++	/* fill in our direct SSID IE... */
++	if (is_direct) {
++		/* ...next IE... */
++		left -= 2 + priv->essid_len;
++		if (left < 0)
++			return 0;
++		/* ... fill it in... */
++		*pos++ = WLAN_EID_SSID;
++		*pos++ = priv->essid_len;
++		memcpy(pos, priv->essid, priv->essid_len);
++		pos += priv->essid_len;
++		len += 2 + priv->essid_len;
++	}
++
++	/* fill in supported rate */
++	/* ...next IE... */
++	left -= 2;
++	if (left < 0)
++		return 0;
++	/* ... fill it in... */
++	*pos++ = WLAN_EID_SUPP_RATES;
++	*pos = 0;
++	ret_rates = priv->active_rate = priv->rates_mask;
++	priv->active_rate_basic = priv->rates_mask & IWL_BASIC_RATES_MASK;
++
++	iwl_supported_rate_to_ie(pos, priv->active_rate,
++				 priv->active_rate_basic, left);
++	len += 2 + *pos;
++	pos += (*pos) + 1;
++	ret_rates = ~ret_rates & priv->active_rate;
++
++	if (ret_rates == 0)
++		goto fill_end;
++
++	/* fill in supported extended rate */
++	/* ...next IE... */
++	left -= 2;
++	if (left < 0)
++		return 0;
++	/* ... fill it in... */
++	*pos++ = WLAN_EID_EXT_SUPP_RATES;
++	*pos = 0;
++	iwl_supported_rate_to_ie(pos, ret_rates, priv->active_rate_basic, left);
++	if (*pos > 0)
++		len += 2 + *pos;
++
++ fill_end:
++	return (u16)len;
++}
++
++/*
++ * QoS  support
++*/
++#ifdef CONFIG_IWLWIFI_QOS
++static int iwl_send_qos_params_command(struct iwl_priv *priv,
++				       struct iwl_qosparam_cmd *qos)
++{
++
++	return iwl_send_cmd_pdu(priv, REPLY_QOS_PARAM,
++				sizeof(struct iwl_qosparam_cmd), qos);
++}
++
++static void iwl_reset_qos(struct iwl_priv *priv)
++{
++	u16 cw_min = 15;
++	u16 cw_max = 1023;
++	u8 aifs = 2;
++	u8 is_legacy = 0;
++	unsigned long flags;
++	int i;
++
++	spin_lock_irqsave(&priv->lock, flags);
++	priv->qos_data.qos_active = 0;
++
++	if (priv->iw_mode == IEEE80211_IF_TYPE_IBSS) {
++		if (priv->qos_data.qos_enable)
++			priv->qos_data.qos_active = 1;
++		if (!(priv->active_rate & 0xfff0)) {
++			cw_min = 31;
++			is_legacy = 1;
++		}
++	} else if (priv->iw_mode == IEEE80211_IF_TYPE_AP) {
++		if (priv->qos_data.qos_enable)
++			priv->qos_data.qos_active = 1;
++	} else if (!(priv->staging_rxon.flags & RXON_FLG_SHORT_SLOT_MSK)) {
++		cw_min = 31;
++		is_legacy = 1;
++	}
++
++	if (priv->qos_data.qos_active)
++		aifs = 3;
++
++	priv->qos_data.def_qos_parm.ac[0].cw_min = cpu_to_le16(cw_min);
++	priv->qos_data.def_qos_parm.ac[0].cw_max = cpu_to_le16(cw_max);
++	priv->qos_data.def_qos_parm.ac[0].aifsn = aifs;
++	priv->qos_data.def_qos_parm.ac[0].edca_txop = 0;
++	priv->qos_data.def_qos_parm.ac[0].reserved1 = 0;
++
++	if (priv->qos_data.qos_active) {
++		i = 1;
++		priv->qos_data.def_qos_parm.ac[i].cw_min = cpu_to_le16(cw_min);
++		priv->qos_data.def_qos_parm.ac[i].cw_max = cpu_to_le16(cw_max);
++		priv->qos_data.def_qos_parm.ac[i].aifsn = 7;
++		priv->qos_data.def_qos_parm.ac[i].edca_txop = 0;
++		priv->qos_data.def_qos_parm.ac[i].reserved1 = 0;
++
++		i = 2;
++		priv->qos_data.def_qos_parm.ac[i].cw_min =
++			cpu_to_le16((cw_min + 1) / 2 - 1);
++		priv->qos_data.def_qos_parm.ac[i].cw_max =
++			cpu_to_le16(cw_max);
++		priv->qos_data.def_qos_parm.ac[i].aifsn = 2;
++		if (is_legacy)
++			priv->qos_data.def_qos_parm.ac[i].edca_txop =
++				cpu_to_le16(6016);
++		else
++			priv->qos_data.def_qos_parm.ac[i].edca_txop =
++				cpu_to_le16(3008);
++		priv->qos_data.def_qos_parm.ac[i].reserved1 = 0;
++
++		i = 3;
++		priv->qos_data.def_qos_parm.ac[i].cw_min =
++			cpu_to_le16((cw_min + 1) / 4 - 1);
++		priv->qos_data.def_qos_parm.ac[i].cw_max =
++			cpu_to_le16((cw_max + 1) / 2 - 1);
++		priv->qos_data.def_qos_parm.ac[i].aifsn = 2;
++		priv->qos_data.def_qos_parm.ac[i].reserved1 = 0;
++		if (is_legacy)
++			priv->qos_data.def_qos_parm.ac[i].edca_txop =
++				cpu_to_le16(3264);
++		else
++			priv->qos_data.def_qos_parm.ac[i].edca_txop =
++				cpu_to_le16(1504);
++	} else {
++		for (i = 1; i < 4; i++) {
++			priv->qos_data.def_qos_parm.ac[i].cw_min =
++				cpu_to_le16(cw_min);
++			priv->qos_data.def_qos_parm.ac[i].cw_max =
++				cpu_to_le16(cw_max);
++			priv->qos_data.def_qos_parm.ac[i].aifsn = aifs;
++			priv->qos_data.def_qos_parm.ac[i].edca_txop = 0;
++			priv->qos_data.def_qos_parm.ac[i].reserved1 = 0;
++		}
++	}
++	IWL_DEBUG_QOS("set QoS to default \n");
++
++	spin_unlock_irqrestore(&priv->lock, flags);
++}
++
++static void iwl_activate_qos(struct iwl_priv *priv, u8 force)
++{
++	unsigned long flags;
++
++	if (priv == NULL)
++		return;
++
++	if (test_bit(STATUS_EXIT_PENDING, &priv->status))
++		return;
++
++	if (!priv->qos_data.qos_enable)
++		return;
++
++	spin_lock_irqsave(&priv->lock, flags);
++	priv->qos_data.def_qos_parm.qos_flags = 0;
++
++	if (priv->qos_data.qos_cap.q_AP.queue_request &&
++	    !priv->qos_data.qos_cap.q_AP.txop_request)
++		priv->qos_data.def_qos_parm.qos_flags |=
++			QOS_PARAM_FLG_TXOP_TYPE_MSK;
++
++	if (priv->qos_data.qos_active)
++		priv->qos_data.def_qos_parm.qos_flags |=
++			QOS_PARAM_FLG_UPDATE_EDCA_MSK;
++
++	spin_unlock_irqrestore(&priv->lock, flags);
++
++	if (force || iwl_is_associated(priv)) {
++		IWL_DEBUG_QOS("send QoS cmd with Qos active %d \n",
++			      priv->qos_data.qos_active);
++
++		iwl_send_qos_params_command(priv,
++				&(priv->qos_data.def_qos_parm));
++	}
++}
++
++#endif /* CONFIG_IWLWIFI_QOS */
++/*
++ * Power management (not Tx power!) functions
++ */
++#define MSEC_TO_USEC 1024
++
++#define NOSLP __constant_cpu_to_le32(0)
++#define SLP IWL_POWER_DRIVER_ALLOW_SLEEP_MSK
++#define SLP_TIMEOUT(T) __constant_cpu_to_le32((T) * MSEC_TO_USEC)
++#define SLP_VEC(X0, X1, X2, X3, X4) {__constant_cpu_to_le32(X0), \
++				     __constant_cpu_to_le32(X1), \
++				     __constant_cpu_to_le32(X2), \
++				     __constant_cpu_to_le32(X3), \
++				     __constant_cpu_to_le32(X4)}
++
++
++/* default power management (not Tx power) table values */
++/* for tim  0-10 */
++static struct iwl_power_vec_entry range_0[IWL_POWER_AC] = {
++	{{NOSLP, SLP_TIMEOUT(0), SLP_TIMEOUT(0), SLP_VEC(0, 0, 0, 0, 0)}, 0},
++	{{SLP, SLP_TIMEOUT(200), SLP_TIMEOUT(500), SLP_VEC(1, 2, 3, 4, 4)}, 0},
++	{{SLP, SLP_TIMEOUT(200), SLP_TIMEOUT(300), SLP_VEC(2, 4, 6, 7, 7)}, 0},
++	{{SLP, SLP_TIMEOUT(50), SLP_TIMEOUT(100), SLP_VEC(2, 6, 9, 9, 10)}, 0},
++	{{SLP, SLP_TIMEOUT(50), SLP_TIMEOUT(25), SLP_VEC(2, 7, 9, 9, 10)}, 1},
++	{{SLP, SLP_TIMEOUT(25), SLP_TIMEOUT(25), SLP_VEC(4, 7, 10, 10, 10)}, 1}
++};
++
++/* for tim > 10 */
++static struct iwl_power_vec_entry range_1[IWL_POWER_AC] = {
++	{{NOSLP, SLP_TIMEOUT(0), SLP_TIMEOUT(0), SLP_VEC(0, 0, 0, 0, 0)}, 0},
++	{{SLP, SLP_TIMEOUT(200), SLP_TIMEOUT(500),
++		 SLP_VEC(1, 2, 3, 4, 0xFF)}, 0},
++	{{SLP, SLP_TIMEOUT(200), SLP_TIMEOUT(300),
++		 SLP_VEC(2, 4, 6, 7, 0xFF)}, 0},
++	{{SLP, SLP_TIMEOUT(50), SLP_TIMEOUT(100),
++		 SLP_VEC(2, 6, 9, 9, 0xFF)}, 0},
++	{{SLP, SLP_TIMEOUT(50), SLP_TIMEOUT(25), SLP_VEC(2, 7, 9, 9, 0xFF)}, 0},
++	{{SLP, SLP_TIMEOUT(25), SLP_TIMEOUT(25),
++		 SLP_VEC(4, 7, 10, 10, 0xFF)}, 0}
++};
++
++int iwl_power_init_handle(struct iwl_priv *priv)
++{
++	int rc = 0, i;
++	struct iwl_power_mgr *pow_data;
++	int size = sizeof(struct iwl_power_vec_entry) * IWL_POWER_AC;
++	u16 pci_pm;
++
++	IWL_DEBUG_POWER("Initialize power \n");
++
++	pow_data = &(priv->power_data);
++
++	memset(pow_data, 0, sizeof(*pow_data));
++
++	pow_data->active_index = IWL_POWER_RANGE_0;
++	pow_data->dtim_val = 0xffff;
++
++	memcpy(&pow_data->pwr_range_0[0], &range_0[0], size);
++	memcpy(&pow_data->pwr_range_1[0], &range_1[0], size);
++
++	rc = pci_read_config_word(priv->pci_dev, PCI_LINK_CTRL, &pci_pm);
++	if (rc != 0)
++		return 0;
++	else {
++		struct iwl_powertable_cmd *cmd;
++
++		IWL_DEBUG_POWER("adjust power command flags\n");
++
++		for (i = 0; i < IWL_POWER_AC; i++) {
++			cmd = &pow_data->pwr_range_0[i].cmd;
++
++			if (pci_pm & 0x1)
++				cmd->flags &= ~IWL_POWER_PCI_PM_MSK;
++			else
++				cmd->flags |= IWL_POWER_PCI_PM_MSK;
++		}
++	}
++	return rc;
++}
++
++static int iwl_update_power_cmd(struct iwl_priv *priv,
++				struct iwl_powertable_cmd *cmd, u32 mode)
++{
++	int rc = 0, i;
++	u8 skip;
++	u32 max_sleep = 0;
++	struct iwl_power_vec_entry *range;
++	u8 period = 0;
++	struct iwl_power_mgr *pow_data;
++
++	if (mode > IWL_POWER_INDEX_5) {
++		IWL_DEBUG_POWER("Error invalid power mode \n");
++		return -1;
++	}
++	pow_data = &(priv->power_data);
++
++	if (pow_data->active_index == IWL_POWER_RANGE_0)
++		range = &pow_data->pwr_range_0[0];
++	else
++		range = &pow_data->pwr_range_1[1];
++
++	memcpy(cmd, &range[mode].cmd, sizeof(struct iwl_powertable_cmd));
++
++#ifdef IWL_MAC80211_DISABLE
++	if (priv->assoc_network != NULL) {
++		unsigned long flags;
++
++		period = priv->assoc_network->tim.tim_period;
++	}
++#endif	/*IWL_MAC80211_DISABLE */
++	skip = range[mode].no_dtim;
++
++	if (period == 0) {
++		period = 1;
++		skip = 0;
++	}
++
++	if (skip == 0) {
++		max_sleep = period;
++		cmd->flags &= ~IWL_POWER_SLEEP_OVER_DTIM_MSK;
++	} else {
++		__le32 slp_itrvl = cmd->sleep_interval[IWL_POWER_VEC_SIZE - 1];
++		max_sleep = (le32_to_cpu(slp_itrvl) / period) * period;
++		cmd->flags |= IWL_POWER_SLEEP_OVER_DTIM_MSK;
++	}
++
++	for (i = 0; i < IWL_POWER_VEC_SIZE; i++) {
++		if (le32_to_cpu(cmd->sleep_interval[i]) > max_sleep)
++			cmd->sleep_interval[i] = cpu_to_le32(max_sleep);
++	}
++
++	IWL_DEBUG_POWER("Flags value = 0x%08X\n", cmd->flags);
++	IWL_DEBUG_POWER("Tx timeout = %u\n", le32_to_cpu(cmd->tx_data_timeout));
++	IWL_DEBUG_POWER("Rx timeout = %u\n", le32_to_cpu(cmd->rx_data_timeout));
++	IWL_DEBUG_POWER("Sleep interval vector = { %d , %d , %d , %d , %d }\n",
++			le32_to_cpu(cmd->sleep_interval[0]),
++			le32_to_cpu(cmd->sleep_interval[1]),
++			le32_to_cpu(cmd->sleep_interval[2]),
++			le32_to_cpu(cmd->sleep_interval[3]),
++			le32_to_cpu(cmd->sleep_interval[4]));
++
++	return rc;
++}
++
++static int iwl_send_power_mode(struct iwl_priv *priv, u32 mode)
++{
++	u32 final_mode = mode;
++	int rc;
++	struct iwl_powertable_cmd cmd;
++
++	/* If on battery, set to 3,
++	 * if plugged into AC power, set to CAM ("continuosly aware mode"),
++	 * else user level */
++	switch (mode) {
++	case IWL_POWER_BATTERY:
++		final_mode = IWL_POWER_INDEX_3;
++		break;
++	case IWL_POWER_AC:
++		final_mode = IWL_POWER_MODE_CAM;
++		break;
++	default:
++		final_mode = mode;
++		break;
++	}
++
++	iwl_update_power_cmd(priv, &cmd, final_mode);
++
++	rc = iwl_send_cmd_pdu(priv, POWER_TABLE_CMD, sizeof(cmd), &cmd);
++
++	if (final_mode == IWL_POWER_MODE_CAM)
++		clear_bit(STATUS_POWER_PMI, &priv->status);
++	else
++		set_bit(STATUS_POWER_PMI, &priv->status);
++
++	return rc;
++}
++
++int iwl_is_network_packet(struct iwl_priv *priv, struct ieee80211_hdr *header)
++{
++	/* Filter incoming packets to determine if they are targeted toward
++	 * this network, discarding packets coming from ourselves */
++	switch (priv->iw_mode) {
++	case IEEE80211_IF_TYPE_IBSS: /* Header: Dest. | Source    | BSSID */
++		/* packets from our adapter are dropped (echo) */
++		if (!compare_ether_addr(header->addr2, priv->mac_addr))
++			return 0;
++		/* {broad,multi}cast packets to our IBSS go through */
++		if (is_multicast_ether_addr(header->addr1))
++			return !compare_ether_addr(header->addr3, priv->bssid);
++		/* packets to our adapter go through */
++		return !compare_ether_addr(header->addr1, priv->mac_addr);
++	case IEEE80211_IF_TYPE_STA: /* Header: Dest. | AP{BSSID} | Source */
++		/* packets from our adapter are dropped (echo) */
++		if (!compare_ether_addr(header->addr3, priv->mac_addr))
++			return 0;
++		/* {broad,multi}cast packets to our BSS go through */
++		if (is_multicast_ether_addr(header->addr1))
++			return !compare_ether_addr(header->addr2, priv->bssid);
++		/* packets to our adapter go through */
++		return !compare_ether_addr(header->addr1, priv->mac_addr);
++	}
++
++	return 1;
++}
++
++#define TX_STATUS_ENTRY(x) case TX_STATUS_FAIL_ ## x: return #x
++
++const char *iwl_get_tx_fail_reason(u32 status)
++{
++	switch (status & TX_STATUS_MSK) {
++	case TX_STATUS_SUCCESS:
++		return "SUCCESS";
++		TX_STATUS_ENTRY(SHORT_LIMIT);
++		TX_STATUS_ENTRY(LONG_LIMIT);
++		TX_STATUS_ENTRY(FIFO_UNDERRUN);
++		TX_STATUS_ENTRY(MGMNT_ABORT);
++		TX_STATUS_ENTRY(NEXT_FRAG);
++		TX_STATUS_ENTRY(LIFE_EXPIRE);
++		TX_STATUS_ENTRY(DEST_PS);
++		TX_STATUS_ENTRY(ABORTED);
++		TX_STATUS_ENTRY(BT_RETRY);
++		TX_STATUS_ENTRY(STA_INVALID);
++		TX_STATUS_ENTRY(FRAG_DROPPED);
++		TX_STATUS_ENTRY(TID_DISABLE);
++		TX_STATUS_ENTRY(FRAME_FLUSHED);
++		TX_STATUS_ENTRY(INSUFFICIENT_CF_POLL);
++		TX_STATUS_ENTRY(TX_LOCKED);
++		TX_STATUS_ENTRY(NO_BEACON_ON_RADAR);
++	}
++
++	return "UNKNOWN";
++}
++
++/**
++ * iwl_scan_cancel - Cancel any currently executing HW scan
++ *
++ * NOTE: priv->mutex is not required before calling this function
++ */
++static int iwl_scan_cancel(struct iwl_priv *priv)
++{
++	if (!test_bit(STATUS_SCAN_HW, &priv->status)) {
++		clear_bit(STATUS_SCANNING, &priv->status);
++		return 0;
++	}
++
++	if (test_bit(STATUS_SCANNING, &priv->status)) {
++		if (!test_bit(STATUS_SCAN_ABORTING, &priv->status)) {
++			IWL_DEBUG_SCAN("Queuing scan abort.\n");
++			set_bit(STATUS_SCAN_ABORTING, &priv->status);
++			queue_work(priv->workqueue, &priv->abort_scan);
++
++		} else
++			IWL_DEBUG_SCAN("Scan abort already in progress.\n");
++
++		return test_bit(STATUS_SCANNING, &priv->status);
++	}
++
++	return 0;
++}
++
++/**
++ * iwl_scan_cancel_timeout - Cancel any currently executing HW scan
++ * @ms: amount of time to wait (in milliseconds) for scan to abort
++ *
++ * NOTE: priv->mutex must be held before calling this function
++ */
++static int iwl_scan_cancel_timeout(struct iwl_priv *priv, unsigned long ms)
++{
++	unsigned long now = jiffies;
++	int ret;
++
++	ret = iwl_scan_cancel(priv);
++	if (ret && ms) {
++		mutex_unlock(&priv->mutex);
++		while (!time_after(jiffies, now + msecs_to_jiffies(ms)) &&
++				test_bit(STATUS_SCANNING, &priv->status))
++			msleep(1);
++		mutex_lock(&priv->mutex);
++
++		return test_bit(STATUS_SCANNING, &priv->status);
++	}
++
++	return ret;
++}
++
++static void iwl_sequence_reset(struct iwl_priv *priv)
++{
++	/* Reset ieee stats */
++
++	/* We don't reset the net_device_stats (ieee->stats) on
++	 * re-association */
++
++	priv->last_seq_num = -1;
++	priv->last_frag_num = -1;
++	priv->last_packet_time = 0;
++
++	iwl_scan_cancel(priv);
++}
++
++#define MAX_UCODE_BEACON_INTERVAL	1024
++#define INTEL_CONN_LISTEN_INTERVAL	__constant_cpu_to_le16(0xA)
++
++static __le16 iwl_adjust_beacon_interval(u16 beacon_val)
++{
++	u16 new_val = 0;
++	u16 beacon_factor = 0;
++
++	beacon_factor =
++	    (beacon_val + MAX_UCODE_BEACON_INTERVAL)
++		/ MAX_UCODE_BEACON_INTERVAL;
++	new_val = beacon_val / beacon_factor;
++
++	return cpu_to_le16(new_val);
++}
++
++static void iwl_setup_rxon_timing(struct iwl_priv *priv)
++{
++	u64 interval_tm_unit;
++	u64 tsf, result;
++	unsigned long flags;
++	struct ieee80211_conf *conf = NULL;
++	u16 beacon_int = 0;
++
++	conf = ieee80211_get_hw_conf(priv->hw);
++
++	spin_lock_irqsave(&priv->lock, flags);
++	priv->rxon_timing.timestamp.dw[1] = cpu_to_le32(priv->timestamp1);
++	priv->rxon_timing.timestamp.dw[0] = cpu_to_le32(priv->timestamp0);
++
++	priv->rxon_timing.listen_interval = INTEL_CONN_LISTEN_INTERVAL;
++
++	tsf = priv->timestamp1;
++	tsf = ((tsf << 32) | priv->timestamp0);
++
++	beacon_int = priv->beacon_int;
++	spin_unlock_irqrestore(&priv->lock, flags);
++
++	if (priv->iw_mode == IEEE80211_IF_TYPE_STA) {
++		if (beacon_int == 0) {
++			priv->rxon_timing.beacon_interval = cpu_to_le16(100);
++			priv->rxon_timing.beacon_init_val = cpu_to_le32(102400);
++		} else {
++			priv->rxon_timing.beacon_interval =
++				cpu_to_le16(beacon_int);
++			priv->rxon_timing.beacon_interval =
++			    iwl_adjust_beacon_interval(
++				le16_to_cpu(priv->rxon_timing.beacon_interval));
++		}
++
++		priv->rxon_timing.atim_window = 0;
++	} else {
++		priv->rxon_timing.beacon_interval =
++			iwl_adjust_beacon_interval(conf->beacon_int);
++		/* TODO: we need to get atim_window from upper stack
++		 * for now we set to 0 */
++		priv->rxon_timing.atim_window = 0;
++	}
++
++	interval_tm_unit =
++		(le16_to_cpu(priv->rxon_timing.beacon_interval) * 1024);
++	result = do_div(tsf, interval_tm_unit);
++	priv->rxon_timing.beacon_init_val =
++	    cpu_to_le32((u32) ((u64) interval_tm_unit - result));
++
++	IWL_DEBUG_ASSOC
++	    ("beacon interval %d beacon timer %d beacon tim %d\n",
++		le16_to_cpu(priv->rxon_timing.beacon_interval),
++		le32_to_cpu(priv->rxon_timing.beacon_init_val),
++		le16_to_cpu(priv->rxon_timing.atim_window));
++}
++
++static int iwl_scan_initiate(struct iwl_priv *priv)
++{
++	if (priv->iw_mode == IEEE80211_IF_TYPE_AP) {
++		IWL_ERROR("APs don't scan.\n");
++		return 0;
++	}
++
++	if (!iwl_is_ready_rf(priv)) {
++		IWL_DEBUG_SCAN("Aborting scan due to not ready.\n");
++		return -EIO;
++	}
++
++	if (test_bit(STATUS_SCANNING, &priv->status)) {
++		IWL_DEBUG_SCAN("Scan already in progress.\n");
++		return -EAGAIN;
++	}
++
++	if (test_bit(STATUS_SCAN_ABORTING, &priv->status)) {
++		IWL_DEBUG_SCAN("Scan request while abort pending.  "
++			       "Queuing.\n");
++		return -EAGAIN;
++	}
++
++	IWL_DEBUG_INFO("Starting scan...\n");
++	priv->scan_bands = 2;
++	set_bit(STATUS_SCANNING, &priv->status);
++	priv->scan_start = jiffies;
++	priv->scan_pass_start = priv->scan_start;
++
++	queue_work(priv->workqueue, &priv->request_scan);
++
++	return 0;
++}
++
++static int iwl_set_rxon_hwcrypto(struct iwl_priv *priv, int hw_decrypt)
++{
++	struct iwl_rxon_cmd *rxon = &priv->staging_rxon;
++
++	if (hw_decrypt)
++		rxon->filter_flags &= ~RXON_FILTER_DIS_DECRYPT_MSK;
++	else
++		rxon->filter_flags |= RXON_FILTER_DIS_DECRYPT_MSK;
++
++	return 0;
++}
++
++static void iwl_set_flags_for_phymode(struct iwl_priv *priv, u8 phymode)
++{
++	if (phymode == MODE_IEEE80211A) {
++		priv->staging_rxon.flags &=
++		    ~(RXON_FLG_BAND_24G_MSK | RXON_FLG_AUTO_DETECT_MSK
++		      | RXON_FLG_CCK_MSK);
++		priv->staging_rxon.flags |= RXON_FLG_SHORT_SLOT_MSK;
++	} else {
++		/* Copied from iwl_bg_post_associate() */
++		if (priv->assoc_capability & WLAN_CAPABILITY_SHORT_SLOT_TIME)
++			priv->staging_rxon.flags |= RXON_FLG_SHORT_SLOT_MSK;
++		else
++			priv->staging_rxon.flags &= ~RXON_FLG_SHORT_SLOT_MSK;
++
++		if (priv->iw_mode == IEEE80211_IF_TYPE_IBSS)
++			priv->staging_rxon.flags &= ~RXON_FLG_SHORT_SLOT_MSK;
++
++		priv->staging_rxon.flags |= RXON_FLG_BAND_24G_MSK;
++		priv->staging_rxon.flags |= RXON_FLG_AUTO_DETECT_MSK;
++		priv->staging_rxon.flags &= ~RXON_FLG_CCK_MSK;
++	}
++}
++
++/*
++ * initilize rxon structure with default values fromm eeprom
++ */
++static void iwl_connection_init_rx_config(struct iwl_priv *priv)
++{
++	const struct iwl_channel_info *ch_info;
++
++	memset(&priv->staging_rxon, 0, sizeof(priv->staging_rxon));
++
++	switch (priv->iw_mode) {
++	case IEEE80211_IF_TYPE_AP:
++		priv->staging_rxon.dev_type = RXON_DEV_TYPE_AP;
++		break;
++
++	case IEEE80211_IF_TYPE_STA:
++		priv->staging_rxon.dev_type = RXON_DEV_TYPE_ESS;
++		priv->staging_rxon.filter_flags = RXON_FILTER_ACCEPT_GRP_MSK;
++		break;
++
++	case IEEE80211_IF_TYPE_IBSS:
++		priv->staging_rxon.dev_type = RXON_DEV_TYPE_IBSS;
++		priv->staging_rxon.flags = RXON_FLG_SHORT_PREAMBLE_MSK;
++		priv->staging_rxon.filter_flags = RXON_FILTER_BCON_AWARE_MSK |
++						  RXON_FILTER_ACCEPT_GRP_MSK;
++		break;
++
++	case IEEE80211_IF_TYPE_MNTR:
++		priv->staging_rxon.dev_type = RXON_DEV_TYPE_SNIFFER;
++		priv->staging_rxon.filter_flags = RXON_FILTER_PROMISC_MSK |
++		    RXON_FILTER_CTL2HOST_MSK | RXON_FILTER_ACCEPT_GRP_MSK;
++		break;
++	}
++
++#if 0
++	/* TODO:  Figure out when short_preamble would be set and cache from
++	 * that */
++	if (!hw_to_local(priv->hw)->short_preamble)
++		priv->staging_rxon.flags &= ~RXON_FLG_SHORT_PREAMBLE_MSK;
++	else
++		priv->staging_rxon.flags |= RXON_FLG_SHORT_PREAMBLE_MSK;
++#endif
++
++	ch_info = iwl_get_channel_info(priv, priv->phymode,
++				       le16_to_cpu(priv->staging_rxon.channel));
++
++	if (!ch_info)
++		ch_info = &priv->channel_info[0];
++
++	/*
++	 * in some case A channels are all non IBSS
++	 * in this case force B/G channel
++	 */
++	if ((priv->iw_mode == IEEE80211_IF_TYPE_IBSS) &&
++	    !(is_channel_ibss(ch_info)))
++		ch_info = &priv->channel_info[0];
++
++	priv->staging_rxon.channel = cpu_to_le16(ch_info->channel);
++	if (is_channel_a_band(ch_info))
++		priv->phymode = MODE_IEEE80211A;
++	else
++		priv->phymode = MODE_IEEE80211G;
++
++	iwl_set_flags_for_phymode(priv, priv->phymode);
++
++	priv->staging_rxon.ofdm_basic_rates =
++	    (IWL_OFDM_RATES_MASK >> IWL_FIRST_OFDM_RATE) & 0xFF;
++	priv->staging_rxon.cck_basic_rates =
++	    (IWL_CCK_RATES_MASK >> IWL_FIRST_CCK_RATE) & 0xF;
++}
++
++static int iwl_set_mode(struct iwl_priv *priv, int mode)
++{
++	if (!iwl_is_ready_rf(priv))
++		return -EAGAIN;
++
++	if (mode == IEEE80211_IF_TYPE_IBSS) {
++		const struct iwl_channel_info *ch_info;
++
++		ch_info = iwl_get_channel_info(priv,
++			priv->phymode,
++			le16_to_cpu(priv->staging_rxon.channel));
++
++		if (!ch_info || !is_channel_ibss(ch_info)) {
++			IWL_ERROR("channel %d not IBSS channel\n",
++				  le16_to_cpu(priv->staging_rxon.channel));
++			return -EINVAL;
++		}
++	}
++
++	cancel_delayed_work(&priv->scan_check);
++	if (iwl_scan_cancel_timeout(priv, 100)) {
++		IWL_WARNING("Aborted scan still in progress after 100ms\n");
++		IWL_DEBUG_MAC80211("leaving - scan abort failed.\n");
++		return -EAGAIN;
++	}
++
++	priv->iw_mode = mode;
++
++	iwl_connection_init_rx_config(priv);
++	memcpy(priv->staging_rxon.node_addr, priv->mac_addr, ETH_ALEN);
++
++	iwl_clear_stations_table(priv);
++
++	iwl_commit_rxon(priv);
++
++	return 0;
++}
++
++static void iwl_build_tx_cmd_hwcrypto(struct iwl_priv *priv,
++				      struct ieee80211_tx_control *ctl,
++				      struct iwl_cmd *cmd,
++				      struct sk_buff *skb_frag,
++				      int last_frag)
++{
++	struct iwl_hw_key *keyinfo = &priv->stations[ctl->key_idx].keyinfo;
++
++	switch (keyinfo->alg) {
++	case ALG_CCMP:
++		cmd->cmd.tx.sec_ctl = TX_CMD_SEC_CCM;
++		memcpy(cmd->cmd.tx.key, keyinfo->key, keyinfo->keylen);
++		IWL_DEBUG_TX("tx_cmd with aes hwcrypto\n");
++		break;
++
++	case ALG_TKIP:
++#if 0
++		cmd->cmd.tx.sec_ctl = TX_CMD_SEC_TKIP;
++
++		if (last_frag)
++			memcpy(cmd->cmd.tx.tkip_mic.byte, skb_frag->tail - 8,
++			       8);
++		else
++			memset(cmd->cmd.tx.tkip_mic.byte, 0, 8);
++#endif
++		break;
++
++	case ALG_WEP:
++		cmd->cmd.tx.sec_ctl = TX_CMD_SEC_WEP |
++		    (ctl->key_idx & TX_CMD_SEC_MSK) << TX_CMD_SEC_SHIFT;
++
++		if (keyinfo->keylen == 13)
++			cmd->cmd.tx.sec_ctl |= TX_CMD_SEC_KEY128;
++
++		memcpy(&cmd->cmd.tx.key[3], keyinfo->key, keyinfo->keylen);
++
++		IWL_DEBUG_TX("Configuring packet for WEP encryption "
++			     "with key %d\n", ctl->key_idx);
++		break;
++
++	case ALG_NONE:
++		IWL_DEBUG_TX("Tx packet in the clear (encrypt requested).\n");
++		break;
++
++	default:
++		printk(KERN_ERR "Unknown encode alg %d\n", keyinfo->alg);
++		break;
++	}
++}
++
++/*
++ * handle build REPLY_TX command notification.
++ */
++static void iwl_build_tx_cmd_basic(struct iwl_priv *priv,
++				  struct iwl_cmd *cmd,
++				  struct ieee80211_tx_control *ctrl,
++				  struct ieee80211_hdr *hdr,
++				  int is_unicast, u8 std_id)
++{
++	__le16 *qc;
++	u16 fc = le16_to_cpu(hdr->frame_control);
++	__le32 tx_flags = cmd->cmd.tx.tx_flags;
++
++	cmd->cmd.tx.stop_time.life_time = TX_CMD_LIFE_TIME_INFINITE;
++	if (!(ctrl->flags & IEEE80211_TXCTL_NO_ACK)) {
++		tx_flags |= TX_CMD_FLG_ACK_MSK;
++		if ((fc & IEEE80211_FCTL_FTYPE) == IEEE80211_FTYPE_MGMT)
++			tx_flags |= TX_CMD_FLG_SEQ_CTL_MSK;
++		if (ieee80211_is_probe_response(fc) &&
++		    !(le16_to_cpu(hdr->seq_ctrl) & 0xf))
++			tx_flags |= TX_CMD_FLG_TSF_MSK;
++	} else {
++		tx_flags &= (~TX_CMD_FLG_ACK_MSK);
++		tx_flags |= TX_CMD_FLG_SEQ_CTL_MSK;
++	}
++
++	cmd->cmd.tx.sta_id = std_id;
++	if (ieee80211_get_morefrag(hdr))
++		tx_flags |= TX_CMD_FLG_MORE_FRAG_MSK;
++
++	qc = ieee80211_get_qos_ctrl(hdr);
++	if (qc) {
++		cmd->cmd.tx.tid_tspec = (u8) (le16_to_cpu(*qc) & 0xf);
++		tx_flags &= ~TX_CMD_FLG_SEQ_CTL_MSK;
++	} else
++		tx_flags |= TX_CMD_FLG_SEQ_CTL_MSK;
++
++	if (ctrl->flags & IEEE80211_TXCTL_USE_RTS_CTS) {
++		tx_flags |= TX_CMD_FLG_RTS_MSK;
++		tx_flags &= ~TX_CMD_FLG_CTS_MSK;
++	} else if (ctrl->flags & IEEE80211_TXCTL_USE_CTS_PROTECT) {
++		tx_flags &= ~TX_CMD_FLG_RTS_MSK;
++		tx_flags |= TX_CMD_FLG_CTS_MSK;
++	}
++
++	if ((tx_flags & TX_CMD_FLG_RTS_MSK) || (tx_flags & TX_CMD_FLG_CTS_MSK))
++		tx_flags |= TX_CMD_FLG_FULL_TXOP_PROT_MSK;
++
++	tx_flags &= ~(TX_CMD_FLG_ANT_SEL_MSK);
++	if ((fc & IEEE80211_FCTL_FTYPE) == IEEE80211_FTYPE_MGMT) {
++		if ((fc & IEEE80211_FCTL_STYPE) == IEEE80211_STYPE_ASSOC_REQ ||
++		    (fc & IEEE80211_FCTL_STYPE) == IEEE80211_STYPE_REASSOC_REQ)
++			cmd->cmd.tx.timeout.pm_frame_timeout =
++				cpu_to_le16(3);
++		else
++			cmd->cmd.tx.timeout.pm_frame_timeout =
++				cpu_to_le16(2);
++	} else
++		cmd->cmd.tx.timeout.pm_frame_timeout = 0;
++
++	cmd->cmd.tx.driver_txop = 0;
++	cmd->cmd.tx.tx_flags = tx_flags;
++	cmd->cmd.tx.next_frame_len = 0;
++}
++
++static int iwl_get_sta_id(struct iwl_priv *priv, struct ieee80211_hdr *hdr)
++{
++	int sta_id;
++	u16 fc = le16_to_cpu(hdr->frame_control);
++
++	/* If this frame is broadcast or not data then use the broadcast
++	 * station id */
++	if (((fc & IEEE80211_FCTL_FTYPE) != IEEE80211_FTYPE_DATA) ||
++	    is_multicast_ether_addr(hdr->addr1))
++		return priv->hw_setting.bcast_sta_id;
++
++	switch (priv->iw_mode) {
++
++	/* If this frame is part of a BSS network (we're a station), then
++	 * we use the AP's station id */
++	case IEEE80211_IF_TYPE_STA:
++		return IWL_AP_ID;
++
++	/* If we are an AP, then find the station, or use BCAST */
++	case IEEE80211_IF_TYPE_AP:
++		sta_id = iwl_hw_find_station(priv, hdr->addr1);
++		if (sta_id != IWL_INVALID_STATION)
++			return sta_id;
++		return priv->hw_setting.bcast_sta_id;
++
++	/* If this frame is part of a IBSS network, then we use the
++	 * target specific station id */
++	case IEEE80211_IF_TYPE_IBSS:
++		sta_id = iwl_hw_find_station(priv, hdr->addr1);
++		if (sta_id != IWL_INVALID_STATION)
++			return sta_id;
++
++		sta_id = iwl_add_station(priv, hdr->addr1, 0, CMD_ASYNC);
++
++		if (sta_id != IWL_INVALID_STATION)
++			return sta_id;
++
++		IWL_DEBUG_DROP("Station " MAC_FMT " not in station map. "
++			       "Defaulting to broadcast...\n",
++			       MAC_ARG(hdr->addr1));
++		iwl_print_hex_dump(IWL_DL_DROP, (u8 *) hdr, sizeof(*hdr));
++		return priv->hw_setting.bcast_sta_id;
++
++	default:
++		IWL_WARNING("Unkown mode of operation: %d", priv->iw_mode);
++		return priv->hw_setting.bcast_sta_id;
++	}
++}
++
++/*
++ * start REPLY_TX command process
++ */
++static int iwl_tx_skb(struct iwl_priv *priv,
++		      struct sk_buff *skb, struct ieee80211_tx_control *ctl)
++{
++	struct ieee80211_hdr *hdr = (struct ieee80211_hdr *)skb->data;
++	struct iwl_tfd_frame *tfd;
++	u32 *control_flags;
++	int txq_id = ctl->queue;
++	struct iwl_tx_queue *txq = NULL;
++	struct iwl_queue *q = NULL;
++	dma_addr_t phys_addr;
++	dma_addr_t txcmd_phys;
++	struct iwl_cmd *out_cmd = NULL;
++	u16 len, idx, len_org;
++	u8 id, hdr_len, unicast;
++	u8 sta_id;
++	u16 seq_number = 0;
++	u16 fc;
++	__le16 *qc;
++	u8 wait_write_ptr = 0;
++	unsigned long flags;
++	int rc;
++
++	spin_lock_irqsave(&priv->lock, flags);
++	if (iwl_is_rfkill(priv)) {
++		IWL_DEBUG_DROP("Dropping - RF KILL\n");
++		goto drop_unlock;
++	}
++
++	if (!priv->interface_id) {
++		IWL_DEBUG_DROP("Dropping - !priv->interface_id\n");
++		goto drop_unlock;
++	}
++
++	if ((ctl->tx_rate & 0xFF) == IWL_INVALID_RATE) {
++		IWL_ERROR("ERROR: No TX rate available.\n");
++		goto drop_unlock;
++	}
++
++	unicast = !is_multicast_ether_addr(hdr->addr1);
++	id = 0;
++
++	fc = le16_to_cpu(hdr->frame_control);
++
++#ifdef CONFIG_IWLWIFI_DEBUG
++	if (ieee80211_is_auth(fc))
++		IWL_DEBUG_TX("Sending AUTH frame\n");
++	else if (ieee80211_is_assoc_request(fc))
++		IWL_DEBUG_TX("Sending ASSOC frame\n");
++	else if (ieee80211_is_reassoc_request(fc))
++		IWL_DEBUG_TX("Sending REASSOC frame\n");
++#endif
++
++	if (!iwl_is_associated(priv) &&
++	    ((fc & IEEE80211_FCTL_FTYPE) == IEEE80211_FTYPE_DATA)) {
++		IWL_DEBUG_DROP("Dropping - !iwl_is_associated\n");
++		goto drop_unlock;
++	}
++
++	spin_unlock_irqrestore(&priv->lock, flags);
++
++	hdr_len = ieee80211_get_hdrlen(fc);
++	sta_id = iwl_get_sta_id(priv, hdr);
++	if (sta_id == IWL_INVALID_STATION) {
++		IWL_DEBUG_DROP("Dropping - INVALID STATION: " MAC_FMT "\n",
++			       MAC_ARG(hdr->addr1));
++		goto drop;
++	}
++
++	IWL_DEBUG_RATE("station Id %d\n", sta_id);
++
++	qc = ieee80211_get_qos_ctrl(hdr);
++	if (qc) {
++		u8 tid = (u8)(le16_to_cpu(*qc) & 0xf);
++		seq_number = priv->stations[sta_id].tid[tid].seq_number &
++				IEEE80211_SCTL_SEQ;
++		hdr->seq_ctrl = cpu_to_le16(seq_number) |
++			(hdr->seq_ctrl &
++				__constant_cpu_to_le16(IEEE80211_SCTL_FRAG));
++		seq_number += 0x10;
++	}
++	txq = &priv->txq[txq_id];
++	q = &txq->q;
++
++	spin_lock_irqsave(&priv->lock, flags);
++
++	tfd = &txq->bd[q->first_empty];
++	memset(tfd, 0, sizeof(*tfd));
++	control_flags = (u32 *) tfd;
++	idx = get_cmd_index(q, q->first_empty, 0);
++
++	memset(&(txq->txb[q->first_empty]), 0, sizeof(struct iwl_tx_info));
++	txq->txb[q->first_empty].skb[0] = skb;
++	memcpy(&(txq->txb[q->first_empty].status.control),
++	       ctl, sizeof(struct ieee80211_tx_control));
++	out_cmd = &txq->cmd[idx];
++	memset(&out_cmd->hdr, 0, sizeof(out_cmd->hdr));
++	memset(&out_cmd->cmd.tx, 0, sizeof(out_cmd->cmd.tx));
++	out_cmd->hdr.cmd = REPLY_TX;
++	out_cmd->hdr.sequence = cpu_to_le16((u16)(QUEUE_TO_SEQ(txq_id) |
++				INDEX_TO_SEQ(q->first_empty)));
++	/* copy frags header */
++	memcpy(out_cmd->cmd.tx.hdr, hdr, hdr_len);
++
++	/* hdr = (struct ieee80211_hdr *)out_cmd->cmd.tx.hdr; */
++	len = priv->hw_setting.tx_cmd_len +
++		sizeof(struct iwl_cmd_header) + hdr_len;
++
++	len_org = len;
++	len = (len + 3) & ~3;
++
++	if (len_org != len)
++		len_org = 1;
++	else
++		len_org = 0;
++
++	txcmd_phys = txq->dma_addr_cmd + sizeof(struct iwl_cmd) * idx +
++		     offsetof(struct iwl_cmd, hdr);
++
++	iwl_hw_txq_attach_buf_to_tfd(priv, tfd, txcmd_phys, len);
++
++	if (ctl->key_idx != -1)
++		iwl_build_tx_cmd_hwcrypto(priv, ctl, out_cmd, skb, 0);
++
++	/* 802.11 null functions have no payload... */
++	len = skb->len - hdr_len;
++	if (len) {
++		phys_addr = pci_map_single(priv->pci_dev, skb->data + hdr_len,
++					   len, PCI_DMA_TODEVICE);
++		iwl_hw_txq_attach_buf_to_tfd(priv, tfd, phys_addr, len);
++	}
++
++	/* If there is no payload, then only one TFD is used */
++	if (!len)
++		*control_flags = TFD_CTL_COUNT_SET(1);
++	else
++		*control_flags = TFD_CTL_COUNT_SET(2) |
++			TFD_CTL_PAD_SET(U32_PAD(len));
++
++	len = (u16)skb->len;
++	out_cmd->cmd.tx.len = cpu_to_le16(len);
++
++	/* TODO need this for burst mode later on */
++	iwl_build_tx_cmd_basic(priv, out_cmd, ctl, hdr, unicast, sta_id);
++
++	/* set is_hcca to 0; it probably will never be implemented */
++	iwl_hw_build_tx_cmd_rate(priv, out_cmd, ctl, hdr, sta_id, 0);
++
++	out_cmd->cmd.tx.tx_flags &= ~TX_CMD_FLG_ANT_A_MSK;
++	out_cmd->cmd.tx.tx_flags &= ~TX_CMD_FLG_ANT_B_MSK;
++
++	if (!ieee80211_get_morefrag(hdr)) {
++		txq->need_update = 1;
++		if (qc) {
++			u8 tid = (u8)(le16_to_cpu(*qc) & 0xf);
++			priv->stations[sta_id].tid[tid].seq_number = seq_number;
++		}
++	} else {
++		wait_write_ptr = 1;
++		txq->need_update = 0;
++	}
++
++	iwl_print_hex_dump(IWL_DL_TX, out_cmd->cmd.payload,
++			   sizeof(out_cmd->cmd.tx));
++
++	iwl_print_hex_dump(IWL_DL_TX, (u8 *)out_cmd->cmd.tx.hdr,
++			   ieee80211_get_hdrlen(fc));
++
++	q->first_empty = iwl_queue_inc_wrap(q->first_empty, q->n_bd);
++	rc = iwl_tx_queue_update_write_ptr(priv, txq);
++	spin_unlock_irqrestore(&priv->lock, flags);
++
++	if (rc)
++		return rc;
++
++	if ((iwl_queue_space(q) < q->high_mark)
++	    && priv->mac80211_registered) {
++		if (wait_write_ptr) {
++			spin_lock_irqsave(&priv->lock, flags);
++			txq->need_update = 1;
++			iwl_tx_queue_update_write_ptr(priv, txq);
++			spin_unlock_irqrestore(&priv->lock, flags);
++		}
++
++		ieee80211_stop_queue(priv->hw, ctl->queue);
++	}
++
++	return 0;
++
++drop_unlock:
++	spin_unlock_irqrestore(&priv->lock, flags);
++drop:
++	return -1;
++}
++
++static void iwl_set_rate(struct iwl_priv *priv)
++{
++	const struct ieee80211_hw_mode *hw = NULL;
++	struct ieee80211_rate *rate;
++	int i;
++
++	hw = iwl_get_hw_mode(priv, priv->phymode);
++
++	priv->active_rate = 0;
++	priv->active_rate_basic = 0;
++
++	IWL_DEBUG_RATE("Setting rates for 802.11%c\n",
++		       hw->mode == MODE_IEEE80211A ?
++		       'a' : ((hw->mode == MODE_IEEE80211B) ? 'b' : 'g'));
++
++	for (i = 0; i < hw->num_rates; i++) {
++		rate = &(hw->rates[i]);
++		if ((rate->val < IWL_RATE_COUNT) &&
++		    (rate->flags & IEEE80211_RATE_SUPPORTED)) {
++			IWL_DEBUG_RATE("Adding rate index %d (plcp %d)%s\n",
++				       rate->val, iwl_rates[rate->val].plcp,
++				       (rate->flags & IEEE80211_RATE_BASIC) ?
++				       "*" : "");
++			priv->active_rate |= (1 << rate->val);
++			if (rate->flags & IEEE80211_RATE_BASIC)
++				priv->active_rate_basic |= (1 << rate->val);
++		} else
++			IWL_DEBUG_RATE("Not adding rate %d (plcp %d)\n",
++				       rate->val, iwl_rates[rate->val].plcp);
++	}
++
++	IWL_DEBUG_RATE("Set active_rate = %0x, active_rate_basic = %0x\n",
++		       priv->active_rate, priv->active_rate_basic);
++
++	/*
++	 * If a basic rate is configured, then use it (adding IWL_RATE_1M_MASK)
++	 * otherwise set it to the default of all CCK rates and 6, 12, 24 for
++	 * OFDM
++	 */
++	if (priv->active_rate_basic & IWL_CCK_BASIC_RATES_MASK)
++		priv->staging_rxon.cck_basic_rates =
++		    ((priv->active_rate_basic &
++		      IWL_CCK_RATES_MASK) >> IWL_FIRST_CCK_RATE) & 0xF;
++	else
++		priv->staging_rxon.cck_basic_rates =
++		    (IWL_CCK_BASIC_RATES_MASK >> IWL_FIRST_CCK_RATE) & 0xF;
++
++	if (priv->active_rate_basic & IWL_OFDM_BASIC_RATES_MASK)
++		priv->staging_rxon.ofdm_basic_rates =
++		    ((priv->active_rate_basic &
++		      (IWL_OFDM_BASIC_RATES_MASK | IWL_RATE_6M_MASK)) >>
++		      IWL_FIRST_OFDM_RATE) & 0xFF;
++	else
++		priv->staging_rxon.ofdm_basic_rates =
++		   (IWL_OFDM_BASIC_RATES_MASK >> IWL_FIRST_OFDM_RATE) & 0xFF;
++}
++
++static void iwl_radio_kill_sw(struct iwl_priv *priv, int disable_radio)
++{
++	unsigned long flags;
++
++	if (!!disable_radio == test_bit(STATUS_RF_KILL_SW, &priv->status))
++		return;
++
++	IWL_DEBUG_RF_KILL("Manual SW RF KILL set to: RADIO %s\n",
++			  disable_radio ? "OFF" : "ON");
++
++	if (disable_radio) {
++		iwl_scan_cancel(priv);
++		/* FIXME: This is a workaround for AP */
++		if (priv->iw_mode != IEEE80211_IF_TYPE_AP) {
++			spin_lock_irqsave(&priv->lock, flags);
++			iwl_write32(priv, CSR_UCODE_DRV_GP1_SET,
++				    CSR_UCODE_SW_BIT_RFKILL);
++			spin_unlock_irqrestore(&priv->lock, flags);
++			iwl_send_card_state(priv, CARD_STATE_CMD_DISABLE, 0);
++			set_bit(STATUS_RF_KILL_SW, &priv->status);
++		}
++		return;
++	}
++
++	spin_lock_irqsave(&priv->lock, flags);
++	iwl_write32(priv, CSR_UCODE_DRV_GP1_CLR, CSR_UCODE_SW_BIT_RFKILL);
++
++	clear_bit(STATUS_RF_KILL_SW, &priv->status);
++	spin_unlock_irqrestore(&priv->lock, flags);
++
++	/* wake up ucode */
++	msleep(10);
++
++	spin_lock_irqsave(&priv->lock, flags);
++	iwl_read32(priv, CSR_UCODE_DRV_GP1);
++	if (!iwl_grab_restricted_access(priv))
++		iwl_release_restricted_access(priv);
++	spin_unlock_irqrestore(&priv->lock, flags);
++
++	if (test_bit(STATUS_RF_KILL_HW, &priv->status)) {
++		IWL_DEBUG_RF_KILL("Can not turn radio back on - "
++				  "disabled by HW switch\n");
++		return;
++	}
++
++	queue_work(priv->workqueue, &priv->restart);
++	return;
++}
++
++void iwl_set_decrypted_flag(struct iwl_priv *priv, struct sk_buff *skb,
++			    u32 decrypt_res, struct ieee80211_rx_status *stats)
++{
++	u16 fc =
++	    le16_to_cpu(((struct ieee80211_hdr *)skb->data)->frame_control);
++
++	if (priv->active_rxon.filter_flags & RXON_FILTER_DIS_DECRYPT_MSK)
++		return;
++
++	if (!(fc & IEEE80211_FCTL_PROTECTED))
++		return;
++
++	IWL_DEBUG_RX("decrypt_res:0x%x\n", decrypt_res);
++	switch (decrypt_res & RX_RES_STATUS_SEC_TYPE_MSK) {
++	case RX_RES_STATUS_SEC_TYPE_TKIP:
++		if ((decrypt_res & RX_RES_STATUS_DECRYPT_TYPE_MSK) ==
++		    RX_RES_STATUS_BAD_ICV_MIC)
++			stats->flag |= RX_FLAG_MMIC_ERROR;
++	case RX_RES_STATUS_SEC_TYPE_WEP:
++	case RX_RES_STATUS_SEC_TYPE_CCMP:
++		if ((decrypt_res & RX_RES_STATUS_DECRYPT_TYPE_MSK) ==
++		    RX_RES_STATUS_DECRYPT_OK) {
++			IWL_DEBUG_RX("hw decrypt successfully!!!\n");
++			stats->flag |= RX_FLAG_DECRYPTED;
++		}
++		break;
++
++	default:
++		break;
++	}
++}
++
++void iwl_handle_data_packet_monitor(struct iwl_priv *priv,
++				    struct iwl_rx_mem_buffer *rxb,
++				    void *data, short len,
++				    struct ieee80211_rx_status *stats,
++				    u16 phy_flags)
++{
++	struct iwl_rt_rx_hdr *iwl_rt;
++
++	/* First cache any information we need before we overwrite
++	 * the information provided in the skb from the hardware */
++	s8 signal = stats->ssi;
++	s8 noise = 0;
++	int rate = stats->rate;
++	u64 tsf = stats->mactime;
++	__le16 phy_flags_hw = cpu_to_le16(phy_flags);
++
++	/* We received data from the HW, so stop the watchdog */
++	if (len > IWL_RX_BUF_SIZE - sizeof(*iwl_rt)) {
++		IWL_DEBUG_DROP("Dropping too large packet in monitor\n");
++		return;
++	}
++
++	/* copy the frame data to write after where the radiotap header goes */
++	iwl_rt = (void *)rxb->skb->data;
++	memmove(iwl_rt->payload, data, len);
++
++	iwl_rt->rt_hdr.it_version = PKTHDR_RADIOTAP_VERSION;
++	iwl_rt->rt_hdr.it_pad = 0; /* always good to zero */
++
++	/* total header + data */
++	iwl_rt->rt_hdr.it_len = cpu_to_le16(sizeof(*iwl_rt));
++
++	/* Set the size of the skb to the size of the frame */
++	skb_put(rxb->skb, sizeof(*iwl_rt) + len);
++
++	/* Big bitfield of all the fields we provide in radiotap */
++	iwl_rt->rt_hdr.it_present =
++	    cpu_to_le32((1 << IEEE80211_RADIOTAP_TSFT) |
++			(1 << IEEE80211_RADIOTAP_FLAGS) |
++			(1 << IEEE80211_RADIOTAP_RATE) |
++			(1 << IEEE80211_RADIOTAP_CHANNEL) |
++			(1 << IEEE80211_RADIOTAP_DBM_ANTSIGNAL) |
++			(1 << IEEE80211_RADIOTAP_DBM_ANTNOISE) |
++			(1 << IEEE80211_RADIOTAP_ANTENNA));
++
++	/* Zero the flags, we'll add to them as we go */
++	iwl_rt->rt_flags = 0;
++
++	iwl_rt->rt_tsf = cpu_to_le64(tsf);
++
++	/* Convert to dBm */
++	iwl_rt->rt_dbmsignal = signal;
++	iwl_rt->rt_dbmnoise = noise;
++
++	/* Convert the channel frequency and set the flags */
++	iwl_rt->rt_channelMHz = cpu_to_le16(stats->freq);
++	if (!(phy_flags_hw & RX_RES_PHY_FLAGS_BAND_24_MSK))
++		iwl_rt->rt_chbitmask =
++		    cpu_to_le16((IEEE80211_CHAN_OFDM | IEEE80211_CHAN_5GHZ));
++	else if (phy_flags_hw & RX_RES_PHY_FLAGS_MOD_CCK_MSK)
++		iwl_rt->rt_chbitmask =
++		    cpu_to_le16((IEEE80211_CHAN_CCK | IEEE80211_CHAN_2GHZ));
++	else	/* 802.11g */
++		iwl_rt->rt_chbitmask =
++		    cpu_to_le16((IEEE80211_CHAN_OFDM | IEEE80211_CHAN_2GHZ));
++
++	rate = iwl_rate_index_from_plcp(rate);
++	if (rate == -1)
++		iwl_rt->rt_rate = 0;
++	else
++		iwl_rt->rt_rate = iwl_rates[rate].ieee;
++
++	/* antenna number */
++	iwl_rt->rt_antenna =
++		le16_to_cpu(phy_flags_hw & RX_RES_PHY_FLAGS_ANTENNA_MSK) >> 4;
++
++	/* set the preamble flag if we have it */
++	if (phy_flags_hw & RX_RES_PHY_FLAGS_SHORT_PREAMBLE_MSK)
++		iwl_rt->rt_flags |= IEEE80211_RADIOTAP_F_SHORTPRE;
++
++	IWL_DEBUG_RX("Rx packet of %d bytes.\n", rxb->skb->len);
++
++	stats->flag |= RX_FLAG_RADIOTAP;
++	ieee80211_rx_irqsafe(priv->hw, rxb->skb, stats);
++	rxb->skb = NULL;
++}
++
++
++#define IWL_PACKET_RETRY_TIME HZ
++
++int is_duplicate_packet(struct iwl_priv *priv, struct ieee80211_hdr *header)
++{
++	u16 sc = le16_to_cpu(header->seq_ctrl);
++	u16 seq = (sc & IEEE80211_SCTL_SEQ) >> 4;
++	u16 frag = sc & IEEE80211_SCTL_FRAG;
++	u16 *last_seq, *last_frag;
++	unsigned long *last_time;
++
++	switch (priv->iw_mode) {
++	case IEEE80211_IF_TYPE_IBSS:{
++		struct list_head *p;
++		struct iwl_ibss_seq *entry = NULL;
++		u8 *mac = header->addr2;
++		int index = mac[5] & (IWL_IBSS_MAC_HASH_SIZE - 1);
++
++		__list_for_each(p, &priv->ibss_mac_hash[index]) {
++			entry =
++				list_entry(p, struct iwl_ibss_seq, list);
++			if (!compare_ether_addr(entry->mac, mac))
++				break;
++		}
++		if (p == &priv->ibss_mac_hash[index]) {
++			entry = kzalloc(sizeof(*entry), GFP_ATOMIC);
++			if (!entry) {
++				IWL_ERROR
++					("Cannot malloc new mac entry\n");
++				return 0;
++			}
++			memcpy(entry->mac, mac, ETH_ALEN);
++			entry->seq_num = seq;
++			entry->frag_num = frag;
++			entry->packet_time = jiffies;
++			list_add(&entry->list,
++				 &priv->ibss_mac_hash[index]);
++			return 0;
++		}
++		last_seq = &entry->seq_num;
++		last_frag = &entry->frag_num;
++		last_time = &entry->packet_time;
++		break;
++	}
++	case IEEE80211_IF_TYPE_STA:
++		last_seq = &priv->last_seq_num;
++		last_frag = &priv->last_frag_num;
++		last_time = &priv->last_packet_time;
++		break;
++	default:
++		return 0;
++	}
++	if ((*last_seq == seq) &&
++	    time_after(*last_time + IWL_PACKET_RETRY_TIME, jiffies)) {
++		if (*last_frag == frag)
++			goto drop;
++		if (*last_frag + 1 != frag)
++			/* out-of-order fragment */
++			goto drop;
++	} else
++		*last_seq = seq;
++
++	*last_frag = frag;
++	*last_time = jiffies;
++	return 0;
++
++ drop:
++	return 1;
++}
++
++#ifdef CONFIG_IWLWIFI_SPECTRUM_MEASUREMENT
++
++#include "iwl-spectrum.h"
++
++#define BEACON_TIME_MASK_LOW	0x00FFFFFF
++#define BEACON_TIME_MASK_HIGH	0xFF000000
++#define TIME_UNIT		1024
++
++/*
++ * extended beacon time format
++ * time in usec will be changed into a 32-bit value in 8:24 format
++ * the high 1 byte is the beacon counts
++ * the lower 3 bytes is the time in usec within one beacon interval
++ */
++
++static u32 iwl_usecs_to_beacons(u32 usec, u32 beacon_interval)
++{
++	u32 quot;
++	u32 rem;
++	u32 interval = beacon_interval * 1024;
++
++	if (!interval || !usec)
++		return 0;
++
++	quot = (usec / interval) & (BEACON_TIME_MASK_HIGH >> 24);
++	rem = (usec % interval) & BEACON_TIME_MASK_LOW;
++
++	return (quot << 24) + rem;
++}
++
++/* base is usually what we get from ucode with each received frame,
++ * the same as HW timer counter counting down
++ */
++
++static __le32 iwl_add_beacon_time(u32 base, u32 addon, u32 beacon_interval)
++{
++	u32 base_low = base & BEACON_TIME_MASK_LOW;
++	u32 addon_low = addon & BEACON_TIME_MASK_LOW;
++	u32 interval = beacon_interval * TIME_UNIT;
++	u32 res = (base & BEACON_TIME_MASK_HIGH) +
++	    (addon & BEACON_TIME_MASK_HIGH);
++
++	if (base_low > addon_low)
++		res += base_low - addon_low;
++	else if (base_low < addon_low) {
++		res += interval + base_low - addon_low;
++		res += (1 << 24);
++	} else
++		res += (1 << 24);
++
++	return cpu_to_le32(res);
++}
++
++static int iwl_get_measurement(struct iwl_priv *priv,
++			       struct ieee80211_measurement_params *params,
++			       u8 type)
++{
++	struct iwl_spectrum_cmd spectrum;
++	struct iwl_rx_packet *res;
++	struct iwl_host_cmd cmd = {
++		.id = REPLY_SPECTRUM_MEASUREMENT_CMD,
++		.data = (void *)&spectrum,
++		.meta.flags = CMD_WANT_SKB,
++	};
++	u32 add_time = le64_to_cpu(params->start_time);
++	int rc;
++	int spectrum_resp_status;
++	int duration = le16_to_cpu(params->duration);
++
++	if (iwl_is_associated(priv))
++		add_time =
++		    iwl_usecs_to_beacons(
++			le64_to_cpu(params->start_time) - priv->last_tsf,
++			le16_to_cpu(priv->rxon_timing.beacon_interval));
++
++	memset(&spectrum, 0, sizeof(spectrum));
++
++	spectrum.channel_count = cpu_to_le16(1);
++	spectrum.flags =
++	    RXON_FLG_TSF2HOST_MSK | RXON_FLG_ANT_A_MSK | RXON_FLG_DIS_DIV_MSK;
++	spectrum.filter_flags = MEASUREMENT_FILTER_FLAG;
++	cmd.len = sizeof(spectrum);
++	spectrum.len = cpu_to_le16(cmd.len - sizeof(spectrum.len));
++
++	if (iwl_is_associated(priv))
++		spectrum.start_time =
++		    iwl_add_beacon_time(priv->last_beacon_time,
++				add_time,
++				le16_to_cpu(priv->rxon_timing.beacon_interval));
++	else
++		spectrum.start_time = 0;
++
++	spectrum.channels[0].duration = cpu_to_le32(duration * TIME_UNIT);
++	spectrum.channels[0].channel = params->channel;
++	spectrum.channels[0].type = type;
++	if (priv->active_rxon.flags & RXON_FLG_BAND_24G_MSK)
++		spectrum.flags |= RXON_FLG_BAND_24G_MSK |
++		    RXON_FLG_AUTO_DETECT_MSK | RXON_FLG_TGG_PROTECT_MSK;
++
++	rc = iwl_send_cmd_sync(priv, &cmd);
++	if (rc)
++		return rc;
++
++	res = (struct iwl_rx_packet *)cmd.meta.u.skb->data;
++	if (res->hdr.flags & IWL_CMD_FAILED_MSK) {
++		IWL_ERROR("Bad return from REPLY_RX_ON_ASSOC command\n");
++		rc = -EIO;
++	}
++
++	spectrum_resp_status = le16_to_cpu(res->u.spectrum.status);
++	switch (spectrum_resp_status) {
++	case 0:		/* Command will be handled */
++		if (res->u.spectrum.id != 0xff) {
++			IWL_DEBUG_INFO
++			    ("Replaced existing measurement: %d\n",
++			     res->u.spectrum.id);
++			priv->measurement_status &= ~MEASUREMENT_READY;
++		}
++		priv->measurement_status |= MEASUREMENT_ACTIVE;
++		rc = 0;
++		break;
++
++	case 1:		/* Command will not be handled */
++		rc = -EAGAIN;
++		break;
++	}
++
++	dev_kfree_skb_any(cmd.meta.u.skb);
++
++	return rc;
++}
++#endif
++
++static void iwl_txstatus_to_ieee(struct iwl_priv *priv,
++				 struct iwl_tx_info *tx_sta)
++{
++
++	tx_sta->status.ack_signal = 0;
++	tx_sta->status.excessive_retries = 0;
++	tx_sta->status.queue_length = 0;
++	tx_sta->status.queue_number = 0;
++
++	if (in_interrupt())
++		ieee80211_tx_status_irqsafe(priv->hw,
++					    tx_sta->skb[0], &(tx_sta->status));
++	else
++		ieee80211_tx_status(priv->hw,
++				    tx_sta->skb[0], &(tx_sta->status));
++
++	tx_sta->skb[0] = NULL;
++}
++
++/**
++ * iwl_tx_queue_reclaim - Reclaim Tx queue entries no more used by NIC.
++ *
++ * When FW advances 'R' index, all entries between old and
++ * new 'R' index need to be reclaimed. As result, some free space
++ * forms. If there is enough free space (> low mark), wake Tx queue.
++ */
++int iwl_tx_queue_reclaim(struct iwl_priv *priv, int txq_id, int index)
++{
++	struct iwl_tx_queue *txq = &priv->txq[txq_id];
++	struct iwl_queue *q = &txq->q;
++	int nfreed = 0;
++
++	if ((index >= q->n_bd) || (x2_queue_used(q, index) == 0)) {
++		IWL_ERROR("Read index for DMA queue txq id (%d), index %d, "
++			  "is out of range [0-%d] %d %d.\n", txq_id,
++			  index, q->n_bd, q->first_empty, q->last_used);
++		return 0;
++	}
++
++	for (index = iwl_queue_inc_wrap(index, q->n_bd);
++		q->last_used != index;
++		q->last_used = iwl_queue_inc_wrap(q->last_used, q->n_bd)) {
++		if (txq_id != IWL_CMD_QUEUE_NUM) {
++			iwl_txstatus_to_ieee(priv,
++					&(txq->txb[txq->q.last_used]));
++			iwl_hw_txq_free_tfd(priv, txq);
++		} else if (nfreed > 1) {
++			IWL_ERROR("HCMD skipped: index (%d) %d %d\n", index,
++					q->first_empty, q->last_used);
++			queue_work(priv->workqueue, &priv->restart);
++		}
++		nfreed++;
++	}
++
++	if (iwl_queue_space(q) > q->low_mark && (txq_id >= 0) &&
++			(txq_id != IWL_CMD_QUEUE_NUM) &&
++			priv->mac80211_registered)
++		ieee80211_wake_queue(priv->hw, txq_id);
++
++
++	return nfreed;
++}
++
++static int iwl_is_tx_success(u32 status)
++{
++	return (status & 0xFF) == 0x1;
++}
++
++/******************************************************************************
++ *
++ * Generic RX handler implementations
++ *
++ ******************************************************************************/
++static void iwl_rx_reply_tx(struct iwl_priv *priv,
++			    struct iwl_rx_mem_buffer *rxb)
++{
++	struct iwl_rx_packet *pkt = (void *)rxb->skb->data;
++	u16 sequence = le16_to_cpu(pkt->hdr.sequence);
++	int txq_id = SEQ_TO_QUEUE(sequence);
++	int index = SEQ_TO_INDEX(sequence);
++	struct iwl_tx_queue *txq = &priv->txq[txq_id];
++	struct ieee80211_tx_status *tx_status;
++	struct iwl_tx_resp *tx_resp = (void *)&pkt->u.raw[0];
++	u32  status = le32_to_cpu(tx_resp->status);
++
++	if ((index >= txq->q.n_bd) || (x2_queue_used(&txq->q, index) == 0)) {
++		IWL_ERROR("Read index for DMA queue txq_id (%d) index %d "
++			  "is out of range [0-%d] %d %d\n", txq_id,
++			  index, txq->q.n_bd, txq->q.first_empty,
++			  txq->q.last_used);
++		return;
++	}
++
++	tx_status = &(txq->txb[txq->q.last_used].status);
++
++	tx_status->retry_count = tx_resp->failure_frame;
++	tx_status->queue_number = status;
++	tx_status->queue_length = tx_resp->bt_kill_count;
++	tx_status->queue_length |= tx_resp->failure_rts;
++
++	tx_status->flags =
++	    iwl_is_tx_success(status) ? IEEE80211_TX_STATUS_ACK : 0;
++
++	tx_status->control.tx_rate = iwl_rate_index_from_plcp(tx_resp->rate);
++
++	IWL_DEBUG_TX("Tx queue %d Status %s (0x%08x) plcp rate %d retries %d\n",
++			txq_id, iwl_get_tx_fail_reason(status), status,
++			tx_resp->rate, tx_resp->failure_frame);
++
++	IWL_DEBUG_TX_REPLY("Tx queue reclaim %d\n", index);
++	if (index != -1)
++		iwl_tx_queue_reclaim(priv, txq_id, index);
++
++	if (iwl_check_bits(status, TX_ABORT_REQUIRED_MSK))
++		IWL_ERROR("TODO:  Implement Tx ABORT REQUIRED!!!\n");
++}
++
++
++static void iwl_rx_reply_alive(struct iwl_priv *priv,
++			       struct iwl_rx_mem_buffer *rxb)
++{
++	struct iwl_rx_packet *pkt = (void *)rxb->skb->data;
++	struct iwl_alive_resp *palive;
++	struct delayed_work *pwork;
++
++	palive = &pkt->u.alive_frame;
++
++	IWL_DEBUG_INFO("Alive ucode status 0x%08X revision "
++		       "0x%01X 0x%01X\n",
++		       palive->is_valid, palive->ver_type,
++		       palive->ver_subtype);
++
++	if (palive->ver_subtype == INITIALIZE_SUBTYPE) {
++		IWL_DEBUG_INFO("Initialization Alive received.\n");
++		memcpy(&priv->card_alive_init,
++		       &pkt->u.alive_frame,
++		       sizeof(struct iwl_init_alive_resp));
++		pwork = &priv->init_alive_start;
++	} else {
++		IWL_DEBUG_INFO("Runtime Alive received.\n");
++		memcpy(&priv->card_alive, &pkt->u.alive_frame,
++		       sizeof(struct iwl_alive_resp));
++		pwork = &priv->alive_start;
++		iwl_disable_events(priv);
++	}
++
++	/* We delay the ALIVE response by 5ms to
++	 * give the HW RF Kill time to activate... */
++	if (palive->is_valid == UCODE_VALID_OK)
++		queue_delayed_work(priv->workqueue, pwork,
++				   msecs_to_jiffies(5));
++	else
++		IWL_WARNING("uCode did not respond OK.\n");
++}
++
++static void iwl_rx_reply_add_sta(struct iwl_priv *priv,
++				 struct iwl_rx_mem_buffer *rxb)
++{
++	struct iwl_rx_packet *pkt = (void *)rxb->skb->data;
++
++	IWL_DEBUG_RX("Received REPLY_ADD_STA: 0x%02X\n", pkt->u.status);
++	return;
++}
++
++static void iwl_rx_reply_error(struct iwl_priv *priv,
++			       struct iwl_rx_mem_buffer *rxb)
++{
++	struct iwl_rx_packet *pkt = (void *)rxb->skb->data;
++
++	IWL_ERROR("Error Reply type 0x%08X cmd %s (0x%02X) "
++		"seq 0x%04X ser 0x%08X\n",
++		le32_to_cpu(pkt->u.err_resp.error_type),
++		get_cmd_string(pkt->u.err_resp.cmd_id),
++		pkt->u.err_resp.cmd_id,
++		le16_to_cpu(pkt->u.err_resp.bad_cmd_seq_num),
++		le32_to_cpu(pkt->u.err_resp.error_info));
++}
++
++#define TX_STATUS_ENTRY(x) case TX_STATUS_FAIL_ ## x: return #x
++
++static void iwl_rx_csa(struct iwl_priv *priv, struct iwl_rx_mem_buffer *rxb)
++{
++	struct iwl_rx_packet *pkt = (void *)rxb->skb->data;
++	struct iwl_rxon_cmd *rxon = (void *)&priv->active_rxon;
++	struct iwl_csa_notification *csa = &(pkt->u.csa_notif);
++	IWL_DEBUG_11H("CSA notif: channel %d, status %d\n",
++		      le16_to_cpu(csa->channel), le32_to_cpu(csa->status));
++	rxon->channel = csa->channel;
++	priv->staging_rxon.channel = csa->channel;
++}
++
++static void iwl_rx_spectrum_measure_notif(struct iwl_priv *priv,
++					  struct iwl_rx_mem_buffer *rxb)
++{
++#ifdef CONFIG_IWLWIFI_SPECTRUM_MEASUREMENT
++	struct iwl_rx_packet *pkt = (void *)rxb->skb->data;
++	struct iwl_spectrum_notification *report = &(pkt->u.spectrum_notif);
++
++	if (!report->state) {
++		IWL_DEBUG(IWL_DL_11H | IWL_DL_INFO,
++			  "Spectrum Measure Notification: Start\n");
++		return;
++	}
++
++	memcpy(&priv->measure_report, report, sizeof(*report));
++	priv->measurement_status |= MEASUREMENT_READY;
++#endif
++}
++
++static void iwl_rx_pm_sleep_notif(struct iwl_priv *priv,
++				  struct iwl_rx_mem_buffer *rxb)
++{
++#ifdef CONFIG_IWLWIFI_DEBUG
++	struct iwl_rx_packet *pkt = (void *)rxb->skb->data;
++	struct iwl_sleep_notification *sleep = &(pkt->u.sleep_notif);
++	IWL_DEBUG_RX("sleep mode: %d, src: %d\n",
++		     sleep->pm_sleep_mode, sleep->pm_wakeup_src);
++#endif
++}
++
++static void iwl_rx_pm_debug_statistics_notif(struct iwl_priv *priv,
++					     struct iwl_rx_mem_buffer *rxb)
++{
++	struct iwl_rx_packet *pkt = (void *)rxb->skb->data;
++	IWL_DEBUG_RADIO("Dumping %d bytes of unhandled "
++			"notification for %s:\n",
++			le32_to_cpu(pkt->len), get_cmd_string(pkt->hdr.cmd));
++	iwl_print_hex_dump(IWL_DL_RADIO, pkt->u.raw, le32_to_cpu(pkt->len));
++}
++
++static void iwl_bg_beacon_update(struct work_struct *work)
++{
++	struct iwl_priv *priv =
++		container_of(work, struct iwl_priv, beacon_update);
++	struct sk_buff *beacon;
++
++	/* Pull updated AP beacon from mac80211. will fail if not in AP mode */
++	beacon = ieee80211_beacon_get(priv->hw, priv->interface_id, NULL);
++
++	if (!beacon) {
++		IWL_ERROR("update beacon failed\n");
++		return;
++	}
++
++	mutex_lock(&priv->mutex);
++	/* new beacon skb is allocated every time; dispose previous.*/
++	if (priv->ibss_beacon)
++		dev_kfree_skb(priv->ibss_beacon);
++
++	priv->ibss_beacon = beacon;
++	mutex_unlock(&priv->mutex);
++
++	iwl_send_beacon_cmd(priv);
++}
++
++static void iwl_rx_beacon_notif(struct iwl_priv *priv,
++				struct iwl_rx_mem_buffer *rxb)
++{
++#ifdef CONFIG_IWLWIFI_DEBUG
++	struct iwl_rx_packet *pkt = (void *)rxb->skb->data;
++	struct iwl_beacon_notif *beacon = &(pkt->u.beacon_status);
++	u8 rate = beacon->beacon_notify_hdr.rate;
++
++	IWL_DEBUG_RX("beacon status %x retries %d iss %d "
++		"tsf %d %d rate %d\n",
++		le32_to_cpu(beacon->beacon_notify_hdr.status) & TX_STATUS_MSK,
++		beacon->beacon_notify_hdr.failure_frame,
++		le32_to_cpu(beacon->ibss_mgr_status),
++		le32_to_cpu(beacon->high_tsf),
++		le32_to_cpu(beacon->low_tsf), rate);
++#endif
++
++	if ((priv->iw_mode == IEEE80211_IF_TYPE_AP) &&
++	    (!test_bit(STATUS_EXIT_PENDING, &priv->status)))
++		queue_work(priv->workqueue, &priv->beacon_update);
++}
++
++/* Service response to REPLY_SCAN_CMD (0x80) */
++static void iwl_rx_reply_scan(struct iwl_priv *priv,
++			      struct iwl_rx_mem_buffer *rxb)
++{
++#ifdef CONFIG_IWLWIFI_DEBUG
++	struct iwl_rx_packet *pkt = (void *)rxb->skb->data;
++	struct iwl_scanreq_notification *notif =
++	    (struct iwl_scanreq_notification *)pkt->u.raw;
++
++	IWL_DEBUG_RX("Scan request status = 0x%x\n", notif->status);
++#endif
++}
++
++/* Service SCAN_START_NOTIFICATION (0x82) */
++static void iwl_rx_scan_start_notif(struct iwl_priv *priv,
++				    struct iwl_rx_mem_buffer *rxb)
++{
++	struct iwl_rx_packet *pkt = (void *)rxb->skb->data;
++	struct iwl_scanstart_notification *notif =
++	    (struct iwl_scanstart_notification *)pkt->u.raw;
++	priv->scan_start_tsf = le32_to_cpu(notif->tsf_low);
++	IWL_DEBUG_SCAN("Scan start: "
++		       "%d [802.11%s] "
++		       "(TSF: 0x%08X:%08X) - %d (beacon timer %u)\n",
++		       notif->channel,
++		       notif->band ? "bg" : "a",
++		       notif->tsf_high,
++		       notif->tsf_low, notif->status, notif->beacon_timer);
++}
++
++/* Service SCAN_RESULTS_NOTIFICATION (0x83) */
++static void iwl_rx_scan_results_notif(struct iwl_priv *priv,
++				      struct iwl_rx_mem_buffer *rxb)
++{
++	struct iwl_rx_packet *pkt = (void *)rxb->skb->data;
++	struct iwl_scanresults_notification *notif =
++	    (struct iwl_scanresults_notification *)pkt->u.raw;
++
++	IWL_DEBUG_SCAN("Scan ch.res: "
++		       "%d [802.11%s] "
++		       "(TSF: 0x%08X:%08X) - %d "
++		       "elapsed=%lu usec (%dms since last)\n",
++		       notif->channel,
++		       notif->band ? "bg" : "a",
++		       le32_to_cpu(notif->tsf_high),
++		       le32_to_cpu(notif->tsf_low),
++		       le32_to_cpu(notif->statistics[0]),
++		       le32_to_cpu(notif->tsf_low) - priv->scan_start_tsf,
++		       jiffies_to_msecs(elapsed_jiffies
++					(priv->last_scan_jiffies, jiffies)));
++
++	priv->last_scan_jiffies = jiffies;
++}
++
++/* Service SCAN_COMPLETE_NOTIFICATION (0x84) */
++static void iwl_rx_scan_complete_notif(struct iwl_priv *priv,
++				       struct iwl_rx_mem_buffer *rxb)
++{
++	struct iwl_rx_packet *pkt = (void *)rxb->skb->data;
++	struct iwl_scancomplete_notification *scan_notif = (void *)pkt->u.raw;
++
++	IWL_DEBUG_SCAN("Scan complete: %d channels (TSF 0x%08X:%08X) - %d\n",
++		       scan_notif->scanned_channels,
++		       scan_notif->tsf_low,
++		       scan_notif->tsf_high, scan_notif->status);
++
++	/* The HW is no longer scanning */
++	clear_bit(STATUS_SCAN_HW, &priv->status);
++
++	/* The scan completion notification came in, so kill that timer... */
++	cancel_delayed_work(&priv->scan_check);
++
++	IWL_DEBUG_INFO("Scan pass on %sGHz took %dms\n",
++		       (priv->scan_bands == 2) ? "2.4" : "5.2",
++		       jiffies_to_msecs(elapsed_jiffies
++					(priv->scan_pass_start, jiffies)));
++
++	/* Remove this scanned band from the list
++	 * of pending bands to scan */
++	priv->scan_bands--;
++
++	/* If a request to abort was given, or the scan did not succeed
++	 * then we reset the scan state machine and terminate,
++	 * re-queuing another scan if one has been requested */
++	if (test_bit(STATUS_SCAN_ABORTING, &priv->status)) {
++		IWL_DEBUG_INFO("Aborted scan completed.\n");
++		clear_bit(STATUS_SCAN_ABORTING, &priv->status);
++	} else {
++		/* If there are more bands on this scan pass reschedule */
++		if (priv->scan_bands > 0)
++			goto reschedule;
++	}
++
++	priv->last_scan_jiffies = jiffies;
++	IWL_DEBUG_INFO("Setting scan to off\n");
++
++	clear_bit(STATUS_SCANNING, &priv->status);
++
++	IWL_DEBUG_INFO("Scan took %dms\n",
++		jiffies_to_msecs(elapsed_jiffies(priv->scan_start, jiffies)));
++
++	queue_work(priv->workqueue, &priv->scan_completed);
++
++	return;
++
++reschedule:
++	priv->scan_pass_start = jiffies;
++	queue_work(priv->workqueue, &priv->request_scan);
++}
++
++/* Handle notification from uCode that card's power state is changing
++ * due to software, hardware, or critical temperature RFKILL */
++static void iwl_rx_card_state_notif(struct iwl_priv *priv,
++				    struct iwl_rx_mem_buffer *rxb)
++{
++	struct iwl_rx_packet *pkt = (void *)rxb->skb->data;
++	u32 flags = le32_to_cpu(pkt->u.card_state_notif.flags);
++	unsigned long status = priv->status;
++
++	IWL_DEBUG_RF_KILL("Card state received: HW:%s SW:%s\n",
++			  (flags & HW_CARD_DISABLED) ? "Kill" : "On",
++			  (flags & SW_CARD_DISABLED) ? "Kill" : "On");
++
++	iwl_write32(priv, CSR_UCODE_DRV_GP1_SET,
++		    CSR_UCODE_DRV_GP1_BIT_CMD_BLOCKED);
++
++	if (flags & HW_CARD_DISABLED)
++		set_bit(STATUS_RF_KILL_HW, &priv->status);
++	else
++		clear_bit(STATUS_RF_KILL_HW, &priv->status);
++
++
++	if (flags & SW_CARD_DISABLED)
++		set_bit(STATUS_RF_KILL_SW, &priv->status);
++	else
++		clear_bit(STATUS_RF_KILL_SW, &priv->status);
++
++	iwl_scan_cancel(priv);
++
++	if ((test_bit(STATUS_RF_KILL_HW, &status) !=
++	     test_bit(STATUS_RF_KILL_HW, &priv->status)) ||
++	    (test_bit(STATUS_RF_KILL_SW, &status) !=
++	     test_bit(STATUS_RF_KILL_SW, &priv->status)))
++		queue_work(priv->workqueue, &priv->rf_kill);
++	else
++		wake_up_interruptible(&priv->wait_command_queue);
++}
++
++/**
++ * iwl_setup_rx_handlers - Initialize Rx handler callbacks
++ *
++ * Setup the RX handlers for each of the reply types sent from the uCode
++ * to the host.
++ *
++ * This function chains into the hardware specific files for them to setup
++ * any hardware specific handlers as well.
++ */
++static void iwl_setup_rx_handlers(struct iwl_priv *priv)
++{
++	priv->rx_handlers[REPLY_ALIVE] = iwl_rx_reply_alive;
++	priv->rx_handlers[REPLY_ADD_STA] = iwl_rx_reply_add_sta;
++	priv->rx_handlers[REPLY_ERROR] = iwl_rx_reply_error;
++	priv->rx_handlers[CHANNEL_SWITCH_NOTIFICATION] = iwl_rx_csa;
++	priv->rx_handlers[SPECTRUM_MEASURE_NOTIFICATION] =
++	    iwl_rx_spectrum_measure_notif;
++	priv->rx_handlers[PM_SLEEP_NOTIFICATION] = iwl_rx_pm_sleep_notif;
++	priv->rx_handlers[PM_DEBUG_STATISTIC_NOTIFIC] =
++	    iwl_rx_pm_debug_statistics_notif;
++	priv->rx_handlers[BEACON_NOTIFICATION] = iwl_rx_beacon_notif;
++
++	/* NOTE:  iwl_rx_statistics is different based on whether
++	 * the build is for the 3945 or the 4965.  See the
++	 * corresponding implementation in iwl-XXXX.c
++	 *
++	 * The same handler is used for both the REPLY to a
++	 * discrete statistics request from the host as well as
++	 * for the periodic statistics notification from the uCode
++	 */
++	priv->rx_handlers[REPLY_STATISTICS_CMD] = iwl_hw_rx_statistics;
++	priv->rx_handlers[STATISTICS_NOTIFICATION] = iwl_hw_rx_statistics;
++
++	priv->rx_handlers[REPLY_SCAN_CMD] = iwl_rx_reply_scan;
++	priv->rx_handlers[SCAN_START_NOTIFICATION] = iwl_rx_scan_start_notif;
++	priv->rx_handlers[SCAN_RESULTS_NOTIFICATION] =
++	    iwl_rx_scan_results_notif;
++	priv->rx_handlers[SCAN_COMPLETE_NOTIFICATION] =
++	    iwl_rx_scan_complete_notif;
++	priv->rx_handlers[CARD_STATE_NOTIFICATION] = iwl_rx_card_state_notif;
++	priv->rx_handlers[REPLY_TX] = iwl_rx_reply_tx;
++
++	/* Setup hardware specific Rx handlers */
++	iwl_hw_rx_handler_setup(priv);
++}
++
++/**
++ * iwl_tx_cmd_complete - Pull unused buffers off the queue and reclaim them
++ * @rxb: Rx buffer to reclaim
++ *
++ * If an Rx buffer has an async callback associated with it the callback
++ * will be executed.  The attached skb (if present) will only be freed
++ * if the callback returns 1
++ */
++static void iwl_tx_cmd_complete(struct iwl_priv *priv,
++				struct iwl_rx_mem_buffer *rxb)
++{
++	struct iwl_rx_packet *pkt = (struct iwl_rx_packet *)rxb->skb->data;
++	u16 sequence = le16_to_cpu(pkt->hdr.sequence);
++	int txq_id = SEQ_TO_QUEUE(sequence);
++	int index = SEQ_TO_INDEX(sequence);
++	int huge = sequence & SEQ_HUGE_FRAME;
++	int cmd_index;
++	struct iwl_cmd *cmd;
++
++	/* If a Tx command is being handled and it isn't in the actual
++	 * command queue then there a command routing bug has been introduced
++	 * in the queue management code. */
++	if (txq_id != IWL_CMD_QUEUE_NUM)
++		IWL_ERROR("Error wrong command queue %d command id 0x%X\n",
++			  txq_id, pkt->hdr.cmd);
++	BUG_ON(txq_id != IWL_CMD_QUEUE_NUM);
++
++	cmd_index = get_cmd_index(&priv->txq[IWL_CMD_QUEUE_NUM].q, index, huge);
++	cmd = &priv->txq[IWL_CMD_QUEUE_NUM].cmd[cmd_index];
++
++	/* Input error checking is done when commands are added to queue. */
++	if (cmd->meta.flags & CMD_WANT_SKB) {
++		cmd->meta.source->u.skb = rxb->skb;
++		rxb->skb = NULL;
++	} else if (cmd->meta.u.callback &&
++		   !cmd->meta.u.callback(priv, cmd, rxb->skb))
++		rxb->skb = NULL;
++
++	iwl_tx_queue_reclaim(priv, txq_id, index);
++
++	if (!(cmd->meta.flags & CMD_ASYNC)) {
++		clear_bit(STATUS_HCMD_ACTIVE, &priv->status);
++		wake_up_interruptible(&priv->wait_command_queue);
++	}
++}
++
++/************************** RX-FUNCTIONS ****************************/
++/*
++ * Rx theory of operation
++ *
++ * The host allocates 32 DMA target addresses and passes the host address
++ * to the firmware at register IWL_RFDS_TABLE_LOWER + N * RFD_SIZE where N is
++ * 0 to 31
++ *
++ * Rx Queue Indexes
++ * The host/firmware share two index registers for managing the Rx buffers.
++ *
++ * The READ index maps to the first position that the firmware may be writing
++ * to -- the driver can read up to (but not including) this position and get
++ * good data.
++ * The READ index is managed by the firmware once the card is enabled.
++ *
++ * The WRITE index maps to the last position the driver has read from -- the
++ * position preceding WRITE is the last slot the firmware can place a packet.
++ *
++ * The queue is empty (no good data) if WRITE = READ - 1, and is full if
++ * WRITE = READ.
++ *
++ * During initialization the host sets up the READ queue position to the first
++ * INDEX position, and WRITE to the last (READ - 1 wrapped)
++ *
++ * When the firmware places a packet in a buffer it will advance the READ index
++ * and fire the RX interrupt.  The driver can then query the READ index and
++ * process as many packets as possible, moving the WRITE index forward as it
++ * resets the Rx queue buffers with new memory.
++ *
++ * The management in the driver is as follows:
++ * + A list of pre-allocated SKBs is stored in iwl->rxq->rx_free.  When
++ *   iwl->rxq->free_count drops to or below RX_LOW_WATERMARK, work is scheduled
++ *   to replensish the iwl->rxq->rx_free.
++ * + In iwl_rx_replenish (scheduled) if 'processed' != 'read' then the
++ *   iwl->rxq is replenished and the READ INDEX is updated (updating the
++ *   'processed' and 'read' driver indexes as well)
++ * + A received packet is processed and handed to the kernel network stack,
++ *   detached from the iwl->rxq.  The driver 'processed' index is updated.
++ * + The Host/Firmware iwl->rxq is replenished at tasklet time from the rx_free
++ *   list. If there are no allocated buffers in iwl->rxq->rx_free, the READ
++ *   INDEX is not incremented and iwl->status(RX_STALLED) is set.  If there
++ *   were enough free buffers and RX_STALLED is set it is cleared.
++ *
++ *
++ * Driver sequence:
++ *
++ * iwl_rx_queue_alloc()       Allocates rx_free
++ * iwl_rx_replenish()         Replenishes rx_free list from rx_used, and calls
++ *                            iwl_rx_queue_restock
++ * iwl_rx_queue_restock()     Moves available buffers from rx_free into Rx
++ *                            queue, updates firmware pointers, and updates
++ *                            the WRITE index.  If insufficient rx_free buffers
++ *                            are available, schedules iwl_rx_replenish
++ *
++ * -- enable interrupts --
++ * ISR - iwl_rx()             Detach iwl_rx_mem_buffers from pool up to the
++ *                            READ INDEX, detaching the SKB from the pool.
++ *                            Moves the packet buffer from queue to rx_used.
++ *                            Calls iwl_rx_queue_restock to refill any empty
++ *                            slots.
++ * ...
++ *
++ */
++
++/**
++ * iwl_rx_queue_space - Return number of free slots available in queue.
++ */
++static int iwl_rx_queue_space(const struct iwl_rx_queue *q)
++{
++	int s = q->read - q->write;
++	if (s <= 0)
++		s += RX_QUEUE_SIZE;
++	/* keep some buffer to not confuse full and empty queue */
++	s -= 2;
++	if (s < 0)
++		s = 0;
++	return s;
++}
++
++/**
++ * iwl_rx_queue_update_write_ptr - Update the write pointer for the RX queue
++ *
++ * NOTE: This function has 3945 and 4965 specific code sections
++ * but is declared in base due to the majority of the
++ * implementation being the same (only a numeric constant is
++ * different)
++ *
++ */
++int iwl_rx_queue_update_write_ptr(struct iwl_priv *priv, struct iwl_rx_queue *q)
++{
++	u32 reg = 0;
++	int rc = 0;
++	unsigned long flags;
++
++	spin_lock_irqsave(&q->lock, flags);
++
++	if (q->need_update == 0)
++		goto exit_unlock;
++
++	if (test_bit(STATUS_POWER_PMI, &priv->status)) {
++		reg = iwl_read32(priv, CSR_UCODE_DRV_GP1);
++
++		if (reg & CSR_UCODE_DRV_GP1_BIT_MAC_SLEEP) {
++			iwl_set_bit(priv, CSR_GP_CNTRL,
++				    CSR_GP_CNTRL_REG_FLAG_MAC_ACCESS_REQ);
++			goto exit_unlock;
++		}
++
++		rc = iwl_grab_restricted_access(priv);
++		if (rc)
++			goto exit_unlock;
++
++		iwl_write_restricted(priv, FH_RSCSR_CHNL0_WPTR,
++				     q->write & ~0x7);
++		iwl_release_restricted_access(priv);
++	} else
++		iwl_write32(priv, FH_RSCSR_CHNL0_WPTR, q->write & ~0x7);
++
++
++	q->need_update = 0;
++
++ exit_unlock:
++	spin_unlock_irqrestore(&q->lock, flags);
++	return rc;
++}
++
++/**
++ * iwl_dma_addr2rbd_ptr - convert a DMA address to a uCode read buffer pointer.
++ *
++ * NOTE: This function has 3945 and 4965 specific code paths in it.
++ */
++static inline __le32 iwl_dma_addr2rbd_ptr(struct iwl_priv *priv,
++					  dma_addr_t dma_addr)
++{
++	return cpu_to_le32((u32)dma_addr);
++}
++
++/**
++ * iwl_rx_queue_restock - refill RX queue from pre-allocated pool
++ *
++ * If there are slots in the RX queue that  need to be restocked,
++ * and we have free pre-allocated buffers, fill the ranks as much
++ * as we can pulling from rx_free.
++ *
++ * This moves the 'write' index forward to catch up with 'processed', and
++ * also updates the memory address in the firmware to reference the new
++ * target buffer.
++ */
++int iwl_rx_queue_restock(struct iwl_priv *priv)
++{
++	struct iwl_rx_queue *rxq = &priv->rxq;
++	struct list_head *element;
++	struct iwl_rx_mem_buffer *rxb;
++	unsigned long flags;
++	int write, rc;
++
++	spin_lock_irqsave(&rxq->lock, flags);
++	write = rxq->write & ~0x7;
++	while ((iwl_rx_queue_space(rxq) > 0) && (rxq->free_count)) {
++		element = rxq->rx_free.next;
++		rxb = list_entry(element, struct iwl_rx_mem_buffer, list);
++		list_del(element);
++		rxq->bd[rxq->write] = iwl_dma_addr2rbd_ptr(priv, rxb->dma_addr);
++		rxq->queue[rxq->write] = rxb;
++		rxq->write = (rxq->write + 1) & RX_QUEUE_MASK;
++		rxq->free_count--;
++	}
++	spin_unlock_irqrestore(&rxq->lock, flags);
++	/* If the pre-allocated buffer pool is dropping low, schedule to
++	 * refill it */
++	if (rxq->free_count <= RX_LOW_WATERMARK)
++		queue_work(priv->workqueue, &priv->rx_replenish);
++
++
++	/* If we've added more space for the firmware to place data, tell it */
++	if ((write != (rxq->write & ~0x7))
++	    || (abs(rxq->write - rxq->read) > 7)) {
++		spin_lock_irqsave(&rxq->lock, flags);
++		rxq->need_update = 1;
++		spin_unlock_irqrestore(&rxq->lock, flags);
++		rc = iwl_rx_queue_update_write_ptr(priv, rxq);
++		if (rc)
++			return rc;
++	}
++
++	return 0;
++}
++
++/**
++ * iwl_rx_replensih - Move all used packet from rx_used to rx_free
++ *
++ * When moving to rx_free an SKB is allocated for the slot.
++ *
++ * Also restock the Rx queue via iwl_rx_queue_restock.
++ * This is called as a scheduled work item (except for during intialization)
++ */
++void iwl_rx_replenish(void *data)
++{
++	struct iwl_priv *priv = data;
++	struct iwl_rx_queue *rxq = &priv->rxq;
++	struct list_head *element;
++	struct iwl_rx_mem_buffer *rxb;
++	unsigned long flags;
++	spin_lock_irqsave(&rxq->lock, flags);
++	while (!list_empty(&rxq->rx_used)) {
++		element = rxq->rx_used.next;
++		rxb = list_entry(element, struct iwl_rx_mem_buffer, list);
++		rxb->skb =
++		    alloc_skb(IWL_RX_BUF_SIZE, __GFP_NOWARN | GFP_ATOMIC);
++		if (!rxb->skb) {
++			if (net_ratelimit())
++				printk(KERN_CRIT DRV_NAME
++				       ": Can not allocate SKB buffers\n");
++			/* We don't reschedule replenish work here -- we will
++			 * call the restock method and if it still needs
++			 * more buffers it will schedule replenish */
++			break;
++		}
++		priv->alloc_rxb_skb++;
++		list_del(element);
++		rxb->dma_addr =
++		    pci_map_single(priv->pci_dev, rxb->skb->data,
++				   IWL_RX_BUF_SIZE, PCI_DMA_FROMDEVICE);
++		list_add_tail(&rxb->list, &rxq->rx_free);
++		rxq->free_count++;
++	}
++	spin_unlock_irqrestore(&rxq->lock, flags);
++
++	spin_lock_irqsave(&priv->lock, flags);
++	iwl_rx_queue_restock(priv);
++	spin_unlock_irqrestore(&priv->lock, flags);
++}
++
++/* Assumes that the skb field of the buffers in 'pool' is kept accurate.
++ * If an SKB has been detached, the POOL needs to have it's SKB set to NULL
++ * This free routine walks the list of POOL entries and if SKB is set to
++ * non NULL it is unmapped and freed
++ */
++void iwl_rx_queue_free(struct iwl_priv *priv, struct iwl_rx_queue *rxq)
++{
++	int i;
++	for (i = 0; i < RX_QUEUE_SIZE + RX_FREE_BUFFERS; i++) {
++		if (rxq->pool[i].skb != NULL) {
++			pci_unmap_single(priv->pci_dev,
++					 rxq->pool[i].dma_addr,
++					 IWL_RX_BUF_SIZE, PCI_DMA_FROMDEVICE);
++			dev_kfree_skb(rxq->pool[i].skb);
++		}
++	}
++
++	pci_free_consistent(priv->pci_dev, 4 * RX_QUEUE_SIZE, rxq->bd,
++			    rxq->dma_addr);
++	rxq->bd = NULL;
++}
++
++int iwl_rx_queue_alloc(struct iwl_priv *priv)
++{
++	struct iwl_rx_queue *rxq = &priv->rxq;
++	struct pci_dev *dev = priv->pci_dev;
++	int i;
++
++	spin_lock_init(&rxq->lock);
++	INIT_LIST_HEAD(&rxq->rx_free);
++	INIT_LIST_HEAD(&rxq->rx_used);
++	rxq->bd = pci_alloc_consistent(dev, 4 * RX_QUEUE_SIZE, &rxq->dma_addr);
++	if (!rxq->bd)
++		return -ENOMEM;
++	/* Fill the rx_used queue with _all_ of the Rx buffers */
++	for (i = 0; i < RX_FREE_BUFFERS + RX_QUEUE_SIZE; i++)
++		list_add_tail(&rxq->pool[i].list, &rxq->rx_used);
++	/* Set us so that we have processed and used all buffers, but have
++	 * not restocked the Rx queue with fresh buffers */
++	rxq->read = rxq->write = 0;
++	rxq->free_count = 0;
++	rxq->need_update = 0;
++	return 0;
++}
++
++void iwl_rx_queue_reset(struct iwl_priv *priv, struct iwl_rx_queue *rxq)
++{
++	unsigned long flags;
++	int i;
++	spin_lock_irqsave(&rxq->lock, flags);
++	INIT_LIST_HEAD(&rxq->rx_free);
++	INIT_LIST_HEAD(&rxq->rx_used);
++	/* Fill the rx_used queue with _all_ of the Rx buffers */
++	for (i = 0; i < RX_FREE_BUFFERS + RX_QUEUE_SIZE; i++) {
++		/* In the reset function, these buffers may have been allocated
++		 * to an SKB, so we need to unmap and free potential storage */
++		if (rxq->pool[i].skb != NULL) {
++			pci_unmap_single(priv->pci_dev,
++					 rxq->pool[i].dma_addr,
++					 IWL_RX_BUF_SIZE, PCI_DMA_FROMDEVICE);
++			priv->alloc_rxb_skb--;
++			dev_kfree_skb(rxq->pool[i].skb);
++			rxq->pool[i].skb = NULL;
++		}
++		list_add_tail(&rxq->pool[i].list, &rxq->rx_used);
++	}
++
++	/* Set us so that we have processed and used all buffers, but have
++	 * not restocked the Rx queue with fresh buffers */
++	rxq->read = rxq->write = 0;
++	rxq->free_count = 0;
++	spin_unlock_irqrestore(&rxq->lock, flags);
++}
++
++/* Convert linear signal-to-noise ratio into dB */
++static u8 ratio2dB[100] = {
++/*	 0   1   2   3   4   5   6   7   8   9 */
++	 0,  0,  6, 10, 12, 14, 16, 17, 18, 19, /* 00 - 09 */
++	20, 21, 22, 22, 23, 23, 24, 25, 26, 26, /* 10 - 19 */
++	26, 26, 26, 27, 27, 28, 28, 28, 29, 29, /* 20 - 29 */
++	29, 30, 30, 30, 31, 31, 31, 31, 32, 32, /* 30 - 39 */
++	32, 32, 32, 33, 33, 33, 33, 33, 34, 34, /* 40 - 49 */
++	34, 34, 34, 34, 35, 35, 35, 35, 35, 35, /* 50 - 59 */
++	36, 36, 36, 36, 36, 36, 36, 37, 37, 37, /* 60 - 69 */
++	37, 37, 37, 37, 37, 38, 38, 38, 38, 38, /* 70 - 79 */
++	38, 38, 38, 38, 38, 39, 39, 39, 39, 39, /* 80 - 89 */
++	39, 39, 39, 39, 39, 40, 40, 40, 40, 40  /* 90 - 99 */
++};
++
++/* Calculates a relative dB value from a ratio of linear
++ *   (i.e. not dB) signal levels.
++ * Conversion assumes that levels are voltages (20*log), not powers (10*log). */
++int iwl_calc_db_from_ratio(int sig_ratio)
++{
++	/* Anything above 1000:1 just report as 60 dB */
++	if (sig_ratio > 1000)
++		return 60;
++
++	/* Above 100:1, divide by 10 and use table,
++	 *   add 20 dB to make up for divide by 10 */
++	if (sig_ratio > 100)
++		return (20 + (int)ratio2dB[sig_ratio/10]);
++
++	/* We shouldn't see this */
++	if (sig_ratio < 1)
++		return 0;
++
++	/* Use table for ratios 1:1 - 99:1 */
++	return (int)ratio2dB[sig_ratio];
++}
++
++#define PERFECT_RSSI (-20) /* dBm */
++#define WORST_RSSI (-95)   /* dBm */
++#define RSSI_RANGE (PERFECT_RSSI - WORST_RSSI)
++
++/* Calculate an indication of rx signal quality (a percentage, not dBm!).
++ * See http://www.ces.clemson.edu/linux/signal_quality.shtml for info
++ *   about formulas used below. */
++int iwl_calc_sig_qual(int rssi_dbm, int noise_dbm)
++{
++	int sig_qual;
++	int degradation = PERFECT_RSSI - rssi_dbm;
++
++	/* If we get a noise measurement, use signal-to-noise ratio (SNR)
++	 * as indicator; formula is (signal dbm - noise dbm).
++	 * SNR at or above 40 is a great signal (100%).
++	 * Below that, scale to fit SNR of 0 - 40 dB within 0 - 100% indicator.
++	 * Weakest usable signal is usually 10 - 15 dB SNR. */
++	if (noise_dbm) {
++		if (rssi_dbm - noise_dbm >= 40)
++			return 100;
++		else if (rssi_dbm < noise_dbm)
++			return 0;
++		sig_qual = ((rssi_dbm - noise_dbm) * 5) / 2;
++
++	/* Else use just the signal level.
++	 * This formula is a least squares fit of data points collected and
++	 *   compared with a reference system that had a percentage (%) display
++	 *   for signal quality. */
++	} else
++		sig_qual = (100 * (RSSI_RANGE * RSSI_RANGE) - degradation *
++			    (15 * RSSI_RANGE + 62 * degradation)) /
++			   (RSSI_RANGE * RSSI_RANGE);
++
++	if (sig_qual > 100)
++		sig_qual = 100;
++	else if (sig_qual < 1)
++		sig_qual = 0;
++
++	return sig_qual;
++}
++
++/**
++ * iwl_rx_handle - Main entry function for receiving responses from the uCode
++ *
++ * Uses the priv->rx_handlers callback function array to invoke
++ * the appropriate handlers, including command responses,
++ * frame-received notifications, and other notifications.
++ */
++static void iwl_rx_handle(struct iwl_priv *priv)
++{
++	struct iwl_rx_mem_buffer *rxb;
++	struct iwl_rx_packet *pkt;
++	struct iwl_rx_queue *rxq = &priv->rxq;
++	u32 r, i;
++	int reclaim;
++	unsigned long flags;
++
++	r = iwl_hw_get_rx_read(priv);
++	i = rxq->read;
++
++	/* Rx interrupt, but nothing sent from uCode */
++	if (i == r)
++		IWL_DEBUG(IWL_DL_RX | IWL_DL_ISR, "r = %d, i = %d\n", r, i);
++
++	while (i != r) {
++		rxb = rxq->queue[i];
++
++		/* If an RXB doesn't have a queue slot associated with it
++		 * then a bug has been introduced in the queue refilling
++		 * routines -- catch it here */
++		BUG_ON(rxb == NULL);
++
++		rxq->queue[i] = NULL;
++
++		pci_dma_sync_single_for_cpu(priv->pci_dev, rxb->dma_addr,
++					    IWL_RX_BUF_SIZE,
++					    PCI_DMA_FROMDEVICE);
++		pkt = (struct iwl_rx_packet *)rxb->skb->data;
++
++		/* Reclaim a command buffer only if this packet is a response
++		 *   to a (driver-originated) command.
++		 * If the packet (e.g. Rx frame) originated from uCode,
++		 *   there is no command buffer to reclaim.
++		 * Ucode should set SEQ_RX_FRAME bit if ucode-originated,
++		 *   but apparently a few don't get set; catch them here. */
++		reclaim = !(pkt->hdr.sequence & SEQ_RX_FRAME) &&
++			(pkt->hdr.cmd != STATISTICS_NOTIFICATION) &&
++			(pkt->hdr.cmd != REPLY_TX);
++
++		/* Based on type of command response or notification,
++		 *   handle those that need handling via function in
++		 *   rx_handlers table.  See iwl_setup_rx_handlers() */
++		if (priv->rx_handlers[pkt->hdr.cmd]) {
++			IWL_DEBUG(IWL_DL_HOST_COMMAND | IWL_DL_RX | IWL_DL_ISR,
++				"r = %d, i = %d, %s, 0x%02x\n", r, i,
++				get_cmd_string(pkt->hdr.cmd), pkt->hdr.cmd);
++			priv->rx_handlers[pkt->hdr.cmd] (priv, rxb);
++		} else {
++			/* No handling needed */
++			IWL_DEBUG(IWL_DL_HOST_COMMAND | IWL_DL_RX | IWL_DL_ISR,
++				"r %d i %d No handler needed for %s, 0x%02x\n",
++				r, i, get_cmd_string(pkt->hdr.cmd),
++				pkt->hdr.cmd);
++		}
++
++		if (reclaim) {
++			/* Invoke any callbacks, transfer the skb to caller,
++			 * and fire off the (possibly) blocking iwl_send_cmd()
++			 * as we reclaim the driver command queue */
++			if (rxb && rxb->skb)
++				iwl_tx_cmd_complete(priv, rxb);
++			else
++				IWL_WARNING("Claim null rxb?\n");
++		}
++
++		/* For now we just don't re-use anything.  We can tweak this
++		 * later to try and re-use notification packets and SKBs that
++		 * fail to Rx correctly */
++		if (rxb->skb != NULL) {
++			priv->alloc_rxb_skb--;
++			dev_kfree_skb_any(rxb->skb);
++			rxb->skb = NULL;
++		}
++
++		pci_unmap_single(priv->pci_dev, rxb->dma_addr,
++				 IWL_RX_BUF_SIZE, PCI_DMA_FROMDEVICE);
++		spin_lock_irqsave(&rxq->lock, flags);
++		list_add_tail(&rxb->list, &priv->rxq.rx_used);
++		spin_unlock_irqrestore(&rxq->lock, flags);
++		i = (i + 1) & RX_QUEUE_MASK;
++	}
++
++	/* Backtrack one entry */
++	priv->rxq.read = i;
++	iwl_rx_queue_restock(priv);
++}
++
++int iwl_tx_queue_update_write_ptr(struct iwl_priv *priv,
++				  struct iwl_tx_queue *txq)
++{
++	u32 reg = 0;
++	int rc = 0;
++	int txq_id = txq->q.id;
++
++	if (txq->need_update == 0)
++		return rc;
++
++	/* if we're trying to save power */
++	if (test_bit(STATUS_POWER_PMI, &priv->status)) {
++		/* wake up nic if it's powered down ...
++		 * uCode will wake up, and interrupt us again, so next
++		 * time we'll skip this part. */
++		reg = iwl_read32(priv, CSR_UCODE_DRV_GP1);
++
++		if (reg & CSR_UCODE_DRV_GP1_BIT_MAC_SLEEP) {
++			IWL_DEBUG_INFO("Requesting wakeup, GP1 = 0x%x\n", reg);
++			iwl_set_bit(priv, CSR_GP_CNTRL,
++				    CSR_GP_CNTRL_REG_FLAG_MAC_ACCESS_REQ);
++			return rc;
++		}
++
++		/* restore this queue's parameters in nic hardware. */
++		rc = iwl_grab_restricted_access(priv);
++		if (rc)
++			return rc;
++		iwl_write_restricted(priv, HBUS_TARG_WRPTR,
++				     txq->q.first_empty | (txq_id << 8));
++		iwl_release_restricted_access(priv);
++
++	/* else not in power-save mode, uCode will never sleep when we're
++	 * trying to tx (during RFKILL, we're not trying to tx). */
++	} else
++		iwl_write32(priv, HBUS_TARG_WRPTR,
++			    txq->q.first_empty | (txq_id << 8));
++
++	txq->need_update = 0;
++
++	return rc;
++}
++
++#ifdef CONFIG_IWLWIFI_DEBUG
++static void iwl_print_rx_config_cmd(struct iwl_rxon_cmd *rxon)
++{
++	IWL_DEBUG_RADIO("RX CONFIG:\n");
++	iwl_print_hex_dump(IWL_DL_RADIO, (u8 *) rxon, sizeof(*rxon));
++	IWL_DEBUG_RADIO("u16 channel: 0x%x\n", le16_to_cpu(rxon->channel));
++	IWL_DEBUG_RADIO("u32 flags: 0x%08X\n", le32_to_cpu(rxon->flags));
++	IWL_DEBUG_RADIO("u32 filter_flags: 0x%08x\n",
++			le32_to_cpu(rxon->filter_flags));
++	IWL_DEBUG_RADIO("u8 dev_type: 0x%x\n", rxon->dev_type);
++	IWL_DEBUG_RADIO("u8 ofdm_basic_rates: 0x%02x\n",
++			rxon->ofdm_basic_rates);
++	IWL_DEBUG_RADIO("u8 cck_basic_rates: 0x%02x\n", rxon->cck_basic_rates);
++	IWL_DEBUG_RADIO("u8[6] node_addr: " MAC_FMT "\n",
++			MAC_ARG(rxon->node_addr));
++	IWL_DEBUG_RADIO("u8[6] bssid_addr: " MAC_FMT "\n",
++			MAC_ARG(rxon->bssid_addr));
++	IWL_DEBUG_RADIO("u16 assoc_id: 0x%x\n", le16_to_cpu(rxon->assoc_id));
++}
++#endif
++
++static void iwl_enable_interrupts(struct iwl_priv *priv)
++{
++	IWL_DEBUG_ISR("Enabling interrupts\n");
++	set_bit(STATUS_INT_ENABLED, &priv->status);
++	iwl_write32(priv, CSR_INT_MASK, CSR_INI_SET_MASK);
++}
++
++static inline void iwl_disable_interrupts(struct iwl_priv *priv)
++{
++	clear_bit(STATUS_INT_ENABLED, &priv->status);
++
++	/* disable interrupts from uCode/NIC to host */
++	iwl_write32(priv, CSR_INT_MASK, 0x00000000);
++
++	/* acknowledge/clear/reset any interrupts still pending
++	 * from uCode or flow handler (Rx/Tx DMA) */
++	iwl_write32(priv, CSR_INT, 0xffffffff);
++	iwl_write32(priv, CSR_FH_INT_STATUS, 0xffffffff);
++	IWL_DEBUG_ISR("Disabled interrupts\n");
++}
++
++static const char *desc_lookup(int i)
++{
++	switch (i) {
++	case 1:
++		return "FAIL";
++	case 2:
++		return "BAD_PARAM";
++	case 3:
++		return "BAD_CHECKSUM";
++	case 4:
++		return "NMI_INTERRUPT";
++	case 5:
++		return "SYSASSERT";
++	case 6:
++		return "FATAL_ERROR";
++	}
++
++	return "UNKNOWN";
++}
++
++#define ERROR_START_OFFSET  (1 * sizeof(u32))
++#define ERROR_ELEM_SIZE     (7 * sizeof(u32))
++
++static void iwl_dump_nic_error_log(struct iwl_priv *priv)
++{
++	u32 i;
++	u32 desc, time, count, base, data1;
++	u32 blink1, blink2, ilink1, ilink2;
++	int rc;
++
++	base = le32_to_cpu(priv->card_alive.error_event_table_ptr);
++
++	if (!iwl_hw_valid_rtc_data_addr(base)) {
++		IWL_ERROR("Not valid error log pointer 0x%08X\n", base);
++		return;
++	}
++
++	rc = iwl_grab_restricted_access(priv);
++	if (rc) {
++		IWL_WARNING("Can not read from adapter at this time.\n");
++		return;
++	}
++
++	count = iwl_read_restricted_mem(priv, base);
++
++	if (ERROR_START_OFFSET <= count * ERROR_ELEM_SIZE) {
++		IWL_ERROR("Start IWL Error Log Dump:\n");
++		IWL_ERROR("Status: 0x%08lX, Config: %08X count: %d\n",
++			  priv->status, priv->config, count);
++	}
++
++	IWL_ERROR("Desc       Time       asrtPC  blink2 "
++		  "ilink1  nmiPC   Line\n");
++	for (i = ERROR_START_OFFSET;
++	     i < (count * ERROR_ELEM_SIZE) + ERROR_START_OFFSET;
++	     i += ERROR_ELEM_SIZE) {
++		desc = iwl_read_restricted_mem(priv, base + i);
++		time =
++		    iwl_read_restricted_mem(priv, base + i + 1 * sizeof(u32));
++		blink1 =
++		    iwl_read_restricted_mem(priv, base + i + 2 * sizeof(u32));
++		blink2 =
++		    iwl_read_restricted_mem(priv, base + i + 3 * sizeof(u32));
++		ilink1 =
++		    iwl_read_restricted_mem(priv, base + i + 4 * sizeof(u32));
++		ilink2 =
++		    iwl_read_restricted_mem(priv, base + i + 5 * sizeof(u32));
++		data1 =
++		    iwl_read_restricted_mem(priv, base + i + 6 * sizeof(u32));
++
++		IWL_ERROR
++		    ("%-13s (#%d) %010u 0x%05X 0x%05X 0x%05X 0x%05X %u\n\n",
++		     desc_lookup(desc), desc, time, blink1, blink2,
++		     ilink1, ilink2, data1);
++	}
++
++	iwl_release_restricted_access(priv);
++
++}
++
++#define EVENT_START_OFFSET  (4 * sizeof(u32))
++
++/**
++ * iwl_print_event_log - Dump error event log to syslog
++ *
++ * NOTE: Must be called with iwl_grab_restricted_access() already obtained!
++ */
++static void iwl_print_event_log(struct iwl_priv *priv, u32 start_idx,
++				u32 num_events, u32 mode)
++{
++	u32 i;
++	u32 base;       /* SRAM byte address of event log header */
++	u32 event_size;	/* 2 u32s, or 3 u32s if timestamp recorded */
++	u32 ptr;        /* SRAM byte address of log data */
++	u32 ev, time, data; /* event log data */
++
++	if (num_events == 0)
++		return;
++
++	base = le32_to_cpu(priv->card_alive.log_event_table_ptr);
++
++	if (mode == 0)
++		event_size = 2 * sizeof(u32);
++	else
++		event_size = 3 * sizeof(u32);
++
++	ptr = base + EVENT_START_OFFSET + (start_idx * event_size);
++
++	/* "time" is actually "data" for mode 0 (no timestamp).
++	 * place event id # at far right for easier visual parsing. */
++	for (i = 0; i < num_events; i++) {
++		ev = iwl_read_restricted_mem(priv, ptr);
++		ptr += sizeof(u32);
++		time = iwl_read_restricted_mem(priv, ptr);
++		ptr += sizeof(u32);
++		if (mode == 0)
++			IWL_ERROR("0x%08x\t%04u\n", time, ev); /* data, ev */
++		else {
++			data = iwl_read_restricted_mem(priv, ptr);
++			ptr += sizeof(u32);
++			IWL_ERROR("%010u\t0x%08x\t%04u\n", time, data, ev);
++		}
++	}
++}
++
++static void iwl_dump_nic_event_log(struct iwl_priv *priv)
++{
++	int rc;
++	u32 base;       /* SRAM byte address of event log header */
++	u32 capacity;   /* event log capacity in # entries */
++	u32 mode;       /* 0 - no timestamp, 1 - timestamp recorded */
++	u32 num_wraps;  /* # times uCode wrapped to top of log */
++	u32 next_entry; /* index of next entry to be written by uCode */
++	u32 size;       /* # entries that we'll print */
++
++	base = le32_to_cpu(priv->card_alive.log_event_table_ptr);
++	if (!iwl_hw_valid_rtc_data_addr(base)) {
++		IWL_ERROR("Invalid event log pointer 0x%08X\n", base);
++		return;
++	}
++
++	rc = iwl_grab_restricted_access(priv);
++	if (rc) {
++		IWL_WARNING("Can not read from adapter at this time.\n");
++		return;
++	}
++
++	/* event log header */
++	capacity = iwl_read_restricted_mem(priv, base);
++	mode = iwl_read_restricted_mem(priv, base + (1 * sizeof(u32)));
++	num_wraps = iwl_read_restricted_mem(priv, base + (2 * sizeof(u32)));
++	next_entry = iwl_read_restricted_mem(priv, base + (3 * sizeof(u32)));
++
++	size = num_wraps ? capacity : next_entry;
++
++	/* bail out if nothing in log */
++	if (size == 0) {
++		IWL_ERROR("Start IPW Event Log Dump: nothing in log\n");
++		iwl_release_restricted_access(priv);
++		return;
++	}
++
++	IWL_ERROR("Start IPW Event Log Dump: display count %d, wraps %d\n",
++		  size, num_wraps);
++
++	/* if uCode has wrapped back to top of log, start at the oldest entry,
++	 * i.e the next one that uCode would fill. */
++	if (num_wraps)
++		iwl_print_event_log(priv, next_entry,
++				    capacity - next_entry, mode);
++
++	/* (then/else) start at top of log */
++	iwl_print_event_log(priv, 0, next_entry, mode);
++
++	iwl_release_restricted_access(priv);
++}
++
++/**
++ * iwl_irq_handle_error - called for HW or SW error interrupt from card
++ */
++static void iwl_irq_handle_error(struct iwl_priv *priv)
++{
++	/* Set the FW error flag -- cleared on iwl_down */
++	set_bit(STATUS_FW_ERROR, &priv->status);
++
++	/* Cancel currently queued command. */
++	clear_bit(STATUS_HCMD_ACTIVE, &priv->status);
++
++#ifdef CONFIG_IWLWIFI_DEBUG
++	if (iwl_debug_level & IWL_DL_FW_ERRORS) {
++		iwl_dump_nic_error_log(priv);
++		iwl_dump_nic_event_log(priv);
++		iwl_print_rx_config_cmd(&priv->staging_rxon);
++	}
++#endif
++
++	wake_up_interruptible(&priv->wait_command_queue);
++
++	/* Keep the restart process from trying to send host
++	 * commands by clearing the INIT status bit */
++	clear_bit(STATUS_READY, &priv->status);
++
++	if (!test_bit(STATUS_EXIT_PENDING, &priv->status)) {
++		IWL_DEBUG(IWL_DL_INFO | IWL_DL_FW_ERRORS,
++			  "Restarting adapter due to uCode error.\n");
++
++		if (iwl_is_associated(priv)) {
++			memcpy(&priv->recovery_rxon, &priv->active_rxon,
++			       sizeof(priv->recovery_rxon));
++			priv->error_recovering = 1;
++		}
++		queue_work(priv->workqueue, &priv->restart);
++	}
++}
++
++static void iwl_error_recovery(struct iwl_priv *priv)
++{
++	unsigned long flags;
++
++	memcpy(&priv->staging_rxon, &priv->recovery_rxon,
++	       sizeof(priv->staging_rxon));
++	priv->staging_rxon.filter_flags &= ~RXON_FILTER_ASSOC_MSK;
++	iwl_commit_rxon(priv);
++
++	iwl_rxon_add_station(priv, priv->bssid, 1);
++
++	spin_lock_irqsave(&priv->lock, flags);
++	priv->assoc_id = le16_to_cpu(priv->staging_rxon.assoc_id);
++	priv->error_recovering = 0;
++	spin_unlock_irqrestore(&priv->lock, flags);
++}
++
++static void iwl_irq_tasklet(struct iwl_priv *priv)
++{
++	u32 inta, handled = 0;
++	u32 inta_fh;
++	unsigned long flags;
++#ifdef CONFIG_IWLWIFI_DEBUG
++	u32 inta_mask;
++#endif
++
++	spin_lock_irqsave(&priv->lock, flags);
++
++	/* Ack/clear/reset pending uCode interrupts.
++	 * Note:  Some bits in CSR_INT are "OR" of bits in CSR_FH_INT_STATUS,
++	 *  and will clear only when CSR_FH_INT_STATUS gets cleared. */
++	inta = iwl_read32(priv, CSR_INT);
++	iwl_write32(priv, CSR_INT, inta);
++
++	/* Ack/clear/reset pending flow-handler (DMA) interrupts.
++	 * Any new interrupts that happen after this, either while we're
++	 * in this tasklet, or later, will show up in next ISR/tasklet. */
++	inta_fh = iwl_read32(priv, CSR_FH_INT_STATUS);
++	iwl_write32(priv, CSR_FH_INT_STATUS, inta_fh);
++
++#ifdef CONFIG_IWLWIFI_DEBUG
++	if (iwl_debug_level & IWL_DL_ISR) {
++		inta_mask = iwl_read32(priv, CSR_INT_MASK); /* just for debug */
++		IWL_DEBUG_ISR("inta 0x%08x, enabled 0x%08x, fh 0x%08x\n",
++			      inta, inta_mask, inta_fh);
++	}
++#endif
++
++	/* Since CSR_INT and CSR_FH_INT_STATUS reads and clears are not
++	 * atomic, make sure that inta covers all the interrupts that
++	 * we've discovered, even if FH interrupt came in just after
++	 * reading CSR_INT. */
++	if (inta_fh & CSR_FH_INT_RX_MASK)
++		inta |= CSR_INT_BIT_FH_RX;
++	if (inta_fh & CSR_FH_INT_TX_MASK)
++		inta |= CSR_INT_BIT_FH_TX;
++
++	/* Now service all interrupt bits discovered above. */
++	if (inta & CSR_INT_BIT_HW_ERR) {
++		IWL_ERROR("Microcode HW error detected.  Restarting.\n");
++
++		/* Tell the device to stop sending interrupts */
++		iwl_disable_interrupts(priv);
++
++		iwl_irq_handle_error(priv);
++
++		handled |= CSR_INT_BIT_HW_ERR;
++
++		spin_unlock_irqrestore(&priv->lock, flags);
++
++		return;
++	}
++
++#ifdef CONFIG_IWLWIFI_DEBUG
++	if (iwl_debug_level & (IWL_DL_ISR)) {
++		/* NIC fires this, but we don't use it, redundant with WAKEUP */
++		if (inta & CSR_INT_BIT_MAC_CLK_ACTV)
++			IWL_DEBUG_ISR("Microcode started or stopped.\n");
++
++		/* Alive notification via Rx interrupt will do the real work */
++		if (inta & CSR_INT_BIT_ALIVE)
++			IWL_DEBUG_ISR("Alive interrupt\n");
++	}
++#endif
++	/* Safely ignore these bits for debug checks below */
++	inta &= ~(CSR_INT_BIT_MAC_CLK_ACTV | CSR_INT_BIT_ALIVE);
++
++	/* HW RF KILL switch toggled (4965 only) */
++	if (inta & CSR_INT_BIT_RF_KILL) {
++		int hw_rf_kill = 0;
++		if (!(iwl_read32(priv, CSR_GP_CNTRL) &
++				CSR_GP_CNTRL_REG_FLAG_HW_RF_KILL_SW))
++			hw_rf_kill = 1;
++
++		IWL_DEBUG(IWL_DL_INFO | IWL_DL_RF_KILL | IWL_DL_ISR,
++				"RF_KILL bit toggled to %s.\n",
++				hw_rf_kill ? "disable radio":"enable radio");
++
++		/* Queue restart only if RF_KILL switch was set to "kill"
++		 *   when we loaded driver, and is now set to "enable".
++		 * After we're Alive, RF_KILL gets handled by
++		 *   iwl_rx_card_state_notif() */
++		if (!hw_rf_kill && !test_bit(STATUS_ALIVE, &priv->status))
++			queue_work(priv->workqueue, &priv->restart);
++
++		handled |= CSR_INT_BIT_RF_KILL;
++	}
++
++	/* Chip got too hot and stopped itself (4965 only) */
++	if (inta & CSR_INT_BIT_CT_KILL) {
++		IWL_ERROR("Microcode CT kill error detected.\n");
++		handled |= CSR_INT_BIT_CT_KILL;
++	}
++
++	/* Error detected by uCode */
++	if (inta & CSR_INT_BIT_SW_ERR) {
++		IWL_ERROR("Microcode SW error detected.  Restarting 0x%X.\n",
++			  inta);
++		iwl_irq_handle_error(priv);
++		handled |= CSR_INT_BIT_SW_ERR;
++	}
++
++	/* uCode wakes up after power-down sleep */
++	if (inta & CSR_INT_BIT_WAKEUP) {
++		IWL_DEBUG_ISR("Wakeup interrupt\n");
++		iwl_rx_queue_update_write_ptr(priv, &priv->rxq);
++		iwl_tx_queue_update_write_ptr(priv, &priv->txq[0]);
++		iwl_tx_queue_update_write_ptr(priv, &priv->txq[1]);
++		iwl_tx_queue_update_write_ptr(priv, &priv->txq[2]);
++		iwl_tx_queue_update_write_ptr(priv, &priv->txq[3]);
++		iwl_tx_queue_update_write_ptr(priv, &priv->txq[4]);
++		iwl_tx_queue_update_write_ptr(priv, &priv->txq[5]);
++
++		handled |= CSR_INT_BIT_WAKEUP;
++	}
++
++	/* All uCode command responses, including Tx command responses,
++	 * Rx "responses" (frame-received notification), and other
++	 * notifications from uCode come through here*/
++	if (inta & (CSR_INT_BIT_FH_RX | CSR_INT_BIT_SW_RX)) {
++		iwl_rx_handle(priv);
++		handled |= (CSR_INT_BIT_FH_RX | CSR_INT_BIT_SW_RX);
++	}
++
++	if (inta & CSR_INT_BIT_FH_TX) {
++		IWL_DEBUG_ISR("Tx interrupt\n");
++
++		iwl_write32(priv, CSR_FH_INT_STATUS, (1 << 6));
++		if (!iwl_grab_restricted_access(priv)) {
++			iwl_write_restricted(priv,
++					     FH_TCSR_CREDIT
++					     (ALM_FH_SRVC_CHNL), 0x0);
++			iwl_release_restricted_access(priv);
++		}
++		handled |= CSR_INT_BIT_FH_TX;
++	}
++
++	if (inta & ~handled)
++		IWL_ERROR("Unhandled INTA bits 0x%08x\n", inta & ~handled);
++
++	if (inta & ~CSR_INI_SET_MASK) {
++		IWL_WARNING("Disabled INTA bits 0x%08x were pending\n",
++			 inta & ~CSR_INI_SET_MASK);
++		IWL_WARNING("   with FH_INT = 0x%08x\n", inta_fh);
++	}
++
++	/* Re-enable all interrupts */
++	iwl_enable_interrupts(priv);
++
++#ifdef CONFIG_IWLWIFI_DEBUG
++	if (iwl_debug_level & (IWL_DL_ISR)) {
++		inta = iwl_read32(priv, CSR_INT);
++		inta_mask = iwl_read32(priv, CSR_INT_MASK);
++		inta_fh = iwl_read32(priv, CSR_FH_INT_STATUS);
++		IWL_DEBUG_ISR("End inta 0x%08x, enabled 0x%08x, fh 0x%08x, "
++			"flags 0x%08lx\n", inta, inta_mask, inta_fh, flags);
++	}
++#endif
++	spin_unlock_irqrestore(&priv->lock, flags);
++}
++
++static irqreturn_t iwl_isr(int irq, void *data)
++{
++	struct iwl_priv *priv = data;
++	u32 inta, inta_mask;
++	u32 inta_fh;
++	if (!priv)
++		return IRQ_NONE;
++
++	spin_lock(&priv->lock);
++
++	/* Disable (but don't clear!) interrupts here to avoid
++	 *    back-to-back ISRs and sporadic interrupts from our NIC.
++	 * If we have something to service, the tasklet will re-enable ints.
++	 * If we *don't* have something, we'll re-enable before leaving here. */
++	inta_mask = iwl_read32(priv, CSR_INT_MASK);  /* just for debug */
++	iwl_write32(priv, CSR_INT_MASK, 0x00000000);
++
++	/* Discover which interrupts are active/pending */
++	inta = iwl_read32(priv, CSR_INT);
++	inta_fh = iwl_read32(priv, CSR_FH_INT_STATUS);
++
++	/* Ignore interrupt if there's nothing in NIC to service.
++	 * This may be due to IRQ shared with another device,
++	 * or due to sporadic interrupts thrown from our NIC. */
++	if (!inta && !inta_fh) {
++		IWL_DEBUG_ISR("Ignore interrupt, inta == 0, inta_fh == 0\n");
++		goto none;
++	}
++
++	if ((inta == 0xFFFFFFFF) || ((inta & 0xFFFFFFF0) == 0xa5a5a5a0)) {
++		/* Hardware disappeared */
++		IWL_WARNING("HARDWARE GONE?? INTA == 0x%080x\n", inta);
++		goto none;
++	}
++
++	IWL_DEBUG_ISR("ISR inta 0x%08x, enabled 0x%08x, fh 0x%08x\n",
++		      inta, inta_mask, inta_fh);
++
++	/* iwl_irq_tasklet() will service interrupts and re-enable them */
++	tasklet_schedule(&priv->irq_tasklet);
++	spin_unlock(&priv->lock);
++
++	return IRQ_HANDLED;
++
++ none:
++	/* re-enable interrupts here since we don't have anything to service. */
++	iwl_enable_interrupts(priv);
++	spin_unlock(&priv->lock);
++	return IRQ_NONE;
++}
++
++/************************** EEPROM BANDS ****************************
++ *
++ * The iwl_eeprom_band definitions below provide the mapping from the
++ * EEPROM contents to the specific channel number supported for each
++ * band.
++ *
++ * For example, iwl_priv->eeprom.band_3_channels[4] from the band_3
++ * definition below maps to physical channel 42 in the 5.2GHz spectrum.
++ * The specific geography and calibration information for that channel
++ * is contained in the eeprom map itself.
++ *
++ * During init, we copy the eeprom information and channel map
++ * information into priv->channel_info_24/52 and priv->channel_map_24/52
++ *
++ * channel_map_24/52 provides the index in the channel_info array for a
++ * given channel.  We have to have two separate maps as there is channel
++ * overlap with the 2.4GHz and 5.2GHz spectrum as seen in band_1 and
++ * band_2
++ *
++ * A value of 0xff stored in the channel_map indicates that the channel
++ * is not supported by the hardware at all.
++ *
++ * A value of 0xfe in the channel_map indicates that the channel is not
++ * valid for Tx with the current hardware.  This means that
++ * while the system can tune and receive on a given channel, it may not
++ * be able to associate or transmit any frames on that
++ * channel.  There is no corresponding channel information for that
++ * entry.
++ *
++ *********************************************************************/
++
++/* 2.4 GHz */
++static const u8 iwl_eeprom_band_1[14] = {
++	1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14
++};
++
++/* 5.2 GHz bands */
++static const u8 iwl_eeprom_band_2[] = {
++	183, 184, 185, 187, 188, 189, 192, 196, 7, 8, 11, 12, 16
++};
++
++static const u8 iwl_eeprom_band_3[] = {	/* 5205-5320MHz */
++	34, 36, 38, 40, 42, 44, 46, 48, 52, 56, 60, 64
++};
++
++static const u8 iwl_eeprom_band_4[] = {	/* 5500-5700MHz */
++	100, 104, 108, 112, 116, 120, 124, 128, 132, 136, 140
++};
++
++static const u8 iwl_eeprom_band_5[] = {	/* 5725-5825MHz */
++	145, 149, 153, 157, 161, 165
++};
++
++static void iwl_init_band_reference(const struct iwl_priv *priv, int band,
++				    int *eeprom_ch_count,
++				    const struct iwl_eeprom_channel
++				    **eeprom_ch_info,
++				    const u8 **eeprom_ch_index)
++{
++	switch (band) {
++	case 1:		/* 2.4GHz band */
++		*eeprom_ch_count = ARRAY_SIZE(iwl_eeprom_band_1);
++		*eeprom_ch_info = priv->eeprom.band_1_channels;
++		*eeprom_ch_index = iwl_eeprom_band_1;
++		break;
++	case 2:		/* 5.2GHz band */
++		*eeprom_ch_count = ARRAY_SIZE(iwl_eeprom_band_2);
++		*eeprom_ch_info = priv->eeprom.band_2_channels;
++		*eeprom_ch_index = iwl_eeprom_band_2;
++		break;
++	case 3:		/* 5.2GHz band */
++		*eeprom_ch_count = ARRAY_SIZE(iwl_eeprom_band_3);
++		*eeprom_ch_info = priv->eeprom.band_3_channels;
++		*eeprom_ch_index = iwl_eeprom_band_3;
++		break;
++	case 4:		/* 5.2GHz band */
++		*eeprom_ch_count = ARRAY_SIZE(iwl_eeprom_band_4);
++		*eeprom_ch_info = priv->eeprom.band_4_channels;
++		*eeprom_ch_index = iwl_eeprom_band_4;
++		break;
++	case 5:		/* 5.2GHz band */
++		*eeprom_ch_count = ARRAY_SIZE(iwl_eeprom_band_5);
++		*eeprom_ch_info = priv->eeprom.band_5_channels;
++		*eeprom_ch_index = iwl_eeprom_band_5;
++		break;
++	default:
++		BUG();
++		return;
++	}
++}
++
++const struct iwl_channel_info *iwl_get_channel_info(const struct iwl_priv *priv,
++						    int phymode, u16 channel)
++{
++	int i;
++
++	switch (phymode) {
++	case MODE_IEEE80211A:
++		for (i = 14; i < priv->channel_count; i++) {
++			if (priv->channel_info[i].channel == channel)
++				return &priv->channel_info[i];
++		}
++		break;
++
++	case MODE_IEEE80211B:
++	case MODE_IEEE80211G:
++		if (channel >= 1 && channel <= 14)
++			return &priv->channel_info[channel - 1];
++		break;
++
++	}
++
++	return NULL;
++}
++
++#define CHECK_AND_PRINT(x) ((eeprom_ch_info[ch].flags & EEPROM_CHANNEL_##x) \
++			    ? # x " " : "")
++
++static int iwl_init_channel_map(struct iwl_priv *priv)
++{
++	int eeprom_ch_count = 0;
++	const u8 *eeprom_ch_index = NULL;
++	const struct iwl_eeprom_channel *eeprom_ch_info = NULL;
++	int band, ch;
++	struct iwl_channel_info *ch_info;
++
++	if (priv->channel_count) {
++		IWL_DEBUG_INFO("Channel map already initialized.\n");
++		return 0;
++	}
++
++	if (priv->eeprom.version < 0x2f) {
++		IWL_WARNING("Unsupported EEPROM version: 0x%04X\n",
++			    priv->eeprom.version);
++		return -EINVAL;
++	}
++
++	IWL_DEBUG_INFO("Initializing regulatory info from EEPROM\n");
++
++	priv->channel_count =
++	    ARRAY_SIZE(iwl_eeprom_band_1) +
++	    ARRAY_SIZE(iwl_eeprom_band_2) +
++	    ARRAY_SIZE(iwl_eeprom_band_3) +
++	    ARRAY_SIZE(iwl_eeprom_band_4) +
++	    ARRAY_SIZE(iwl_eeprom_band_5);
++
++	IWL_DEBUG_INFO("Parsing data for %d channels.\n", priv->channel_count);
++
++	priv->channel_info = kzalloc(sizeof(struct iwl_channel_info) *
++				     priv->channel_count, GFP_KERNEL);
++	if (!priv->channel_info) {
++		IWL_ERROR("Could not allocate channel_info\n");
++		priv->channel_count = 0;
++		return -ENOMEM;
++	}
++
++	ch_info = priv->channel_info;
++
++	/* Loop through the 5 EEPROM bands adding them in order to the
++	 * channel map we maintain (that contains additional information than
++	 * what just in the EEPROM) */
++	for (band = 1; band <= 5; band++) {
++
++		iwl_init_band_reference(priv, band, &eeprom_ch_count,
++					&eeprom_ch_info, &eeprom_ch_index);
++
++		/* Loop through each band adding each of the channels */
++		for (ch = 0; ch < eeprom_ch_count; ch++) {
++			ch_info->channel = eeprom_ch_index[ch];
++			ch_info->phymode = (band == 1) ? MODE_IEEE80211B :
++			    MODE_IEEE80211A;
++
++			/* permanently store EEPROM's channel regulatory flags
++			 *   and max power in channel info database. */
++			ch_info->eeprom = eeprom_ch_info[ch];
++
++			/* Copy the run-time flags so they are there even on
++			 * invalid channels */
++			ch_info->flags = eeprom_ch_info[ch].flags;
++
++			if (!(is_channel_valid(ch_info))) {
++				IWL_DEBUG_INFO("Ch. %d Flags %x [%sGHz] - "
++					       "No traffic\n",
++					       ch_info->channel,
++					       ch_info->flags,
++					       is_channel_a_band(ch_info) ?
++					       "5.2" : "2.4");
++				ch_info++;
++				continue;
++			}
++
++			/* Initialize regulatory-based run-time data */
++			ch_info->max_power_avg = ch_info->curr_txpow =
++			    eeprom_ch_info[ch].max_power_avg;
++			ch_info->scan_power = eeprom_ch_info[ch].max_power_avg;
++			ch_info->min_power = 0;
++
++			IWL_DEBUG_INFO("Ch. %d [%sGHz] %s%s%s%s%s%s(0x%02x"
++				       " %ddBm): Ad-Hoc %ssupported\n",
++				       ch_info->channel,
++				       is_channel_a_band(ch_info) ?
++				       "5.2" : "2.4",
++				       CHECK_AND_PRINT(IBSS),
++				       CHECK_AND_PRINT(ACTIVE),
++				       CHECK_AND_PRINT(RADAR),
++				       CHECK_AND_PRINT(WIDE),
++				       CHECK_AND_PRINT(NARROW),
++				       CHECK_AND_PRINT(DFS),
++				       eeprom_ch_info[ch].flags,
++				       eeprom_ch_info[ch].max_power_avg,
++				       ((eeprom_ch_info[ch].
++					 flags & EEPROM_CHANNEL_IBSS)
++					&& !(eeprom_ch_info[ch].
++					     flags & EEPROM_CHANNEL_RADAR))
++				       ? "" : "not ");
++
++			/* Set the user_txpower_limit to the highest power
++			 * supported by any channel */
++			if (eeprom_ch_info[ch].max_power_avg >
++			    priv->user_txpower_limit)
++				priv->user_txpower_limit =
++				    eeprom_ch_info[ch].max_power_avg;
++
++			ch_info++;
++		}
++	}
++
++	if (iwl3945_txpower_set_from_eeprom(priv))
++		return -EIO;
++
++	return 0;
++}
++
++/* For active scan, listen ACTIVE_DWELL_TIME (msec) on each channel after
++ * sending probe req.  This should be set long enough to hear probe responses
++ * from more than one AP.  */
++#define IWL_ACTIVE_DWELL_TIME_24    (20)	/* all times in msec */
++#define IWL_ACTIVE_DWELL_TIME_52    (10)
++
++/* For faster active scanning, scan will move to the next channel if fewer than
++ * PLCP_QUIET_THRESH packets are heard on this channel within
++ * ACTIVE_QUIET_TIME after sending probe request.  This shortens the dwell
++ * time if it's a quiet channel (nothing responded to our probe, and there's
++ * no other traffic).
++ * Disable "quiet" feature by setting PLCP_QUIET_THRESH to 0. */
++#define IWL_PLCP_QUIET_THRESH       __constant_cpu_to_le16(1)	/* packets */
++#define IWL_ACTIVE_QUIET_TIME       __constant_cpu_to_le16(5)	/* msec */
++
++/* For passive scan, listen PASSIVE_DWELL_TIME (msec) on each channel.
++ * Must be set longer than active dwell time.
++ * For the most reliable scan, set > AP beacon interval (typically 100msec). */
++#define IWL_PASSIVE_DWELL_TIME_24   (20)	/* all times in msec */
++#define IWL_PASSIVE_DWELL_TIME_52   (10)
++#define IWL_PASSIVE_DWELL_BASE      (100)
++#define IWL_CHANNEL_TUNE_TIME       5
++
++static inline u16 iwl_get_active_dwell_time(struct iwl_priv *priv, int phymode)
++{
++	if (phymode == MODE_IEEE80211A)
++		return IWL_ACTIVE_DWELL_TIME_52;
++	else
++		return IWL_ACTIVE_DWELL_TIME_24;
++}
++
++static u16 iwl_get_passive_dwell_time(struct iwl_priv *priv, int phymode)
++{
++	u16 active = iwl_get_active_dwell_time(priv, phymode);
++	u16 passive = (phymode != MODE_IEEE80211A) ?
++	    IWL_PASSIVE_DWELL_BASE + IWL_PASSIVE_DWELL_TIME_24 :
++	    IWL_PASSIVE_DWELL_BASE + IWL_PASSIVE_DWELL_TIME_52;
++
++	if (iwl_is_associated(priv)) {
++		/* If we're associated, we clamp the maximum passive
++		 * dwell time to be 98% of the beacon interval (minus
++		 * 2 * channel tune time) */
++		passive = priv->beacon_int;
++		if ((passive > IWL_PASSIVE_DWELL_BASE) || !passive)
++			passive = IWL_PASSIVE_DWELL_BASE;
++		passive = (passive * 98) / 100 - IWL_CHANNEL_TUNE_TIME * 2;
++	}
++
++	if (passive <= active)
++		passive = active + 1;
++
++	return passive;
++}
++
++static int iwl_get_channels_for_scan(struct iwl_priv *priv, int phymode,
++				     u8 is_active, u8 direct_mask,
++				     struct iwl_scan_channel *scan_ch)
++{
++	const struct ieee80211_channel *channels = NULL;
++	const struct ieee80211_hw_mode *hw_mode;
++	const struct iwl_channel_info *ch_info;
++	u16 passive_dwell = 0;
++	u16 active_dwell = 0;
++	int added, i;
++
++	hw_mode = iwl_get_hw_mode(priv, phymode);
++	if (!hw_mode)
++		return 0;
++
++	channels = hw_mode->channels;
++
++	active_dwell = iwl_get_active_dwell_time(priv, phymode);
++	passive_dwell = iwl_get_passive_dwell_time(priv, phymode);
++
++	for (i = 0, added = 0; i < hw_mode->num_channels; i++) {
++		if (channels[i].chan ==
++		    le16_to_cpu(priv->active_rxon.channel)) {
++			if (iwl_is_associated(priv)) {
++				IWL_DEBUG_SCAN
++				    ("Skipping current channel %d\n",
++				     le16_to_cpu(priv->active_rxon.channel));
++				continue;
++			}
++		} else if (priv->only_active_channel)
++			continue;
++
++		scan_ch->channel = channels[i].chan;
++
++		ch_info = iwl_get_channel_info(priv, phymode, scan_ch->channel);
++		if (!is_channel_valid(ch_info)) {
++			IWL_DEBUG_SCAN("Channel %d is INVALID for this SKU.\n",
++				       scan_ch->channel);
++			continue;
++		}
++
++		if (!is_active || is_channel_passive(ch_info) ||
++		    !(channels[i].flag & IEEE80211_CHAN_W_ACTIVE_SCAN))
++			scan_ch->type = 0;	/* passive */
++		else
++			scan_ch->type = 1;	/* active */
++
++		if (scan_ch->type & 1)
++			scan_ch->type |= (direct_mask << 1);
++
++		if (is_channel_narrow(ch_info))
++			scan_ch->type |= (1 << 7);
++
++		scan_ch->active_dwell = cpu_to_le16(active_dwell);
++		scan_ch->passive_dwell = cpu_to_le16(passive_dwell);
++
++		/* Set power levels to defaults */
++		scan_ch->tpc.dsp_atten = 110;
++		/* scan_pwr_info->tpc.dsp_atten; */
++
++		/*scan_pwr_info->tpc.tx_gain; */
++		if (phymode == MODE_IEEE80211A)
++			scan_ch->tpc.tx_gain = ((1 << 5) | (3 << 3)) | 3;
++		else {
++			scan_ch->tpc.tx_gain = ((1 << 5) | (5 << 3));
++			/* NOTE: if we were doing 6Mb OFDM for scans we'd use
++			 * power level
++			 scan_ch->tpc.tx_gain = ((1<<5) | (2 << 3)) | 3;
++			 */
++		}
++
++		IWL_DEBUG_SCAN("Scanning %d [%s %d]\n",
++			       scan_ch->channel,
++			       (scan_ch->type & 1) ? "ACTIVE" : "PASSIVE",
++			       (scan_ch->type & 1) ?
++			       active_dwell : passive_dwell);
++
++		scan_ch++;
++		added++;
++	}
++
++	IWL_DEBUG_SCAN("total channels to scan %d \n", added);
++	return added;
++}
++
++static void iwl_reset_channel_flag(struct iwl_priv *priv)
++{
++	int i, j;
++	for (i = 0; i < 3; i++) {
++		struct ieee80211_hw_mode *hw_mode = (void *)&priv->modes[i];
++		for (j = 0; j < hw_mode->num_channels; j++)
++			hw_mode->channels[j].flag = hw_mode->channels[j].val;
++	}
++}
++
++static void iwl_init_hw_rates(struct iwl_priv *priv,
++			      struct ieee80211_rate *rates)
++{
++	int i;
++
++	for (i = 0; i < IWL_RATE_COUNT; i++) {
++		rates[i].rate = iwl_rates[i].ieee * 5;
++		rates[i].val = i; /* Rate scaling will work on indexes */
++		rates[i].val2 = i;
++		rates[i].flags = IEEE80211_RATE_SUPPORTED;
++		/* Only OFDM have the bits-per-symbol set */
++		if ((i <= IWL_LAST_OFDM_RATE) && (i >= IWL_FIRST_OFDM_RATE))
++			rates[i].flags |= IEEE80211_RATE_OFDM;
++		else {
++			/*
++			 * If CCK 1M then set rate flag to CCK else CCK_2
++			 * which is CCK | PREAMBLE2
++			 */
++			rates[i].flags |= (iwl_rates[i].plcp == 10) ?
++				IEEE80211_RATE_CCK : IEEE80211_RATE_CCK_2;
++		}
++
++		/* Set up which ones are basic rates... */
++		if (IWL_BASIC_RATES_MASK & (1 << i))
++			rates[i].flags |= IEEE80211_RATE_BASIC;
++	}
++}
++
++/**
++ * iwl_init_geos - Initialize mac80211's geo/channel info based from eeprom
++ */
++static int iwl_init_geos(struct iwl_priv *priv)
++{
++	struct iwl_channel_info *ch;
++	struct ieee80211_hw_mode *modes;
++	struct ieee80211_channel *channels;
++	struct ieee80211_channel *geo_ch;
++	struct ieee80211_rate *rates;
++	int i = 0;
++	enum {
++		A = 0,
++		B = 1,
++		G = 2,
++	};
++	int mode_count = 3;
++
++	if (priv->modes) {
++		IWL_DEBUG_INFO("Geography modes already initialized.\n");
++		set_bit(STATUS_GEO_CONFIGURED, &priv->status);
++		return 0;
++	}
++
++	modes = kzalloc(sizeof(struct ieee80211_hw_mode) * mode_count,
++			GFP_KERNEL);
++	if (!modes)
++		return -ENOMEM;
++
++	channels = kzalloc(sizeof(struct ieee80211_channel) *
++			   priv->channel_count, GFP_KERNEL);
++	if (!channels) {
++		kfree(modes);
++		return -ENOMEM;
++	}
++
++	rates = kzalloc((sizeof(struct ieee80211_rate) * (IWL_MAX_RATES + 1)),
++			GFP_KERNEL);
++	if (!rates) {
++		kfree(modes);
++		kfree(channels);
++		return -ENOMEM;
++	}
++
++	/* 0 = 802.11a
++	 * 1 = 802.11b
++	 * 2 = 802.11g
++	 */
++
++	/* 5.2GHz channels start after the 2.4GHz channels */
++	modes[A].mode = MODE_IEEE80211A;
++	modes[A].channels = &channels[ARRAY_SIZE(iwl_eeprom_band_1)];
++	modes[A].rates = rates;
++	modes[A].num_rates = 8;	/* just OFDM */
++	modes[A].num_channels = 0;
++
++	modes[B].mode = MODE_IEEE80211B;
++	modes[B].channels = channels;
++	modes[B].rates = &rates[8];
++	modes[B].num_rates = 4;	/* just CCK */
++	modes[B].num_channels = 0;
++
++	modes[G].mode = MODE_IEEE80211G;
++	modes[G].channels = channels;
++	modes[G].rates = rates;
++	modes[G].num_rates = 12;	/* OFDM & CCK */
++	modes[G].num_channels = 0;
++
++	priv->ieee_channels = channels;
++	priv->ieee_rates = rates;
++
++	iwl_init_hw_rates(priv, rates);
++
++	for (i = 0, geo_ch = channels; i < priv->channel_count; i++) {
++		ch = &priv->channel_info[i];
++
++		if (!is_channel_valid(ch)) {
++			IWL_DEBUG_INFO("Channel %d [%sGHz] is restricted -- "
++				    "skipping.\n",
++				    ch->channel, is_channel_a_band(ch) ?
++				    "5.2" : "2.4");
++			continue;
++		}
++
++		if (is_channel_a_band(ch))
++			geo_ch = &modes[A].channels[modes[A].num_channels++];
++		else {
++			geo_ch = &modes[B].channels[modes[B].num_channels++];
++			modes[G].num_channels++;
++		}
++
++		geo_ch->freq = ieee80211chan2mhz(ch->channel);
++		geo_ch->chan = ch->channel;
++		geo_ch->power_level = ch->max_power_avg;
++		geo_ch->antenna_max = 0xff;
++
++		if (is_channel_valid(ch)) {
++			geo_ch->flag = IEEE80211_CHAN_W_SCAN;
++			if (ch->flags & EEPROM_CHANNEL_IBSS)
++				geo_ch->flag |= IEEE80211_CHAN_W_IBSS;
++
++			if (ch->flags & EEPROM_CHANNEL_ACTIVE)
++				geo_ch->flag |= IEEE80211_CHAN_W_ACTIVE_SCAN;
++
++			if (ch->flags & EEPROM_CHANNEL_RADAR)
++				geo_ch->flag |= IEEE80211_CHAN_W_RADAR_DETECT;
++
++			if (ch->max_power_avg > priv->max_channel_txpower_limit)
++				priv->max_channel_txpower_limit =
++				    ch->max_power_avg;
++		}
++
++		geo_ch->val = geo_ch->flag;
++	}
++
++	if ((modes[A].num_channels == 0) && priv->is_abg) {
++		printk(KERN_INFO DRV_NAME
++		       ": Incorrectly detected BG card as ABG.  Please send "
++		       "your PCI ID 0x%04X:0x%04X to maintainer.\n",
++		       priv->pci_dev->device, priv->pci_dev->subsystem_device);
++		priv->is_abg = 0;
++	}
++
++	printk(KERN_INFO DRV_NAME
++	       ": Tunable channels: %d 802.11bg, %d 802.11a channels\n",
++	       modes[G].num_channels, modes[A].num_channels);
++
++	/*
++	 * NOTE:  We register these in preference of order -- the
++	 * stack doesn't currently (as of 7.0.6 / Apr 24 '07) pick
++	 * a phymode based on rates or AP capabilities but seems to
++	 * configure it purely on if the channel being configured
++	 * is supported by a mode -- and the first match is taken
++	 */
++
++	if (modes[G].num_channels)
++		ieee80211_register_hwmode(priv->hw, &modes[G]);
++	if (modes[B].num_channels)
++		ieee80211_register_hwmode(priv->hw, &modes[B]);
++	if (modes[A].num_channels)
++		ieee80211_register_hwmode(priv->hw, &modes[A]);
++
++	priv->modes = modes;
++	set_bit(STATUS_GEO_CONFIGURED, &priv->status);
++
++	return 0;
++}
++
++/******************************************************************************
++ *
++ * uCode download functions
++ *
++ ******************************************************************************/
++
++static void iwl_dealloc_ucode_pci(struct iwl_priv *priv)
++{
++	if (priv->ucode_code.v_addr != NULL) {
++		pci_free_consistent(priv->pci_dev,
++				    priv->ucode_code.len,
++				    priv->ucode_code.v_addr,
++				    priv->ucode_code.p_addr);
++		priv->ucode_code.v_addr = NULL;
++	}
++	if (priv->ucode_data.v_addr != NULL) {
++		pci_free_consistent(priv->pci_dev,
++				    priv->ucode_data.len,
++				    priv->ucode_data.v_addr,
++				    priv->ucode_data.p_addr);
++		priv->ucode_data.v_addr = NULL;
++	}
++	if (priv->ucode_data_backup.v_addr != NULL) {
++		pci_free_consistent(priv->pci_dev,
++				    priv->ucode_data_backup.len,
++				    priv->ucode_data_backup.v_addr,
++				    priv->ucode_data_backup.p_addr);
++		priv->ucode_data_backup.v_addr = NULL;
++	}
++	if (priv->ucode_init.v_addr != NULL) {
++		pci_free_consistent(priv->pci_dev,
++				    priv->ucode_init.len,
++				    priv->ucode_init.v_addr,
++				    priv->ucode_init.p_addr);
++		priv->ucode_init.v_addr = NULL;
++	}
++	if (priv->ucode_init_data.v_addr != NULL) {
++		pci_free_consistent(priv->pci_dev,
++				    priv->ucode_init_data.len,
++				    priv->ucode_init_data.v_addr,
++				    priv->ucode_init_data.p_addr);
++		priv->ucode_init_data.v_addr = NULL;
++	}
++	if (priv->ucode_boot.v_addr != NULL) {
++		pci_free_consistent(priv->pci_dev,
++				    priv->ucode_boot.len,
++				    priv->ucode_boot.v_addr,
++				    priv->ucode_boot.p_addr);
++		priv->ucode_boot.v_addr = NULL;
++	}
++}
++
++/**
++ * iwl_verify_inst_full - verify runtime uCode image in card vs. host,
++ *     looking at all data.
++ */
++static int iwl_verify_inst_full(struct iwl_priv *priv, __le32 * image, u32 len)
++{
++	u32 val;
++	u32 save_len = len;
++	int rc = 0;
++	u32 errcnt;
++
++	IWL_DEBUG_INFO("ucode inst image size is %u\n", len);
++
++	rc = iwl_grab_restricted_access(priv);
++	if (rc)
++		return rc;
++
++	iwl_write_restricted(priv, HBUS_TARG_MEM_RADDR, RTC_INST_LOWER_BOUND);
++
++	errcnt = 0;
++	for (; len > 0; len -= sizeof(u32), image++) {
++		/* read data comes through single port, auto-incr addr */
++		/* NOTE: Use the debugless read so we don't flood kernel log
++		 * if IWL_DL_IO is set */
++		val = _iwl_read_restricted(priv, HBUS_TARG_MEM_RDAT);
++		if (val != le32_to_cpu(*image)) {
++			IWL_ERROR("uCode INST section is invalid at "
++				  "offset 0x%x, is 0x%x, s/b 0x%x\n",
++				  save_len - len, val, le32_to_cpu(*image));
++			rc = -EIO;
++			errcnt++;
++			if (errcnt >= 20)
++				break;
++		}
++	}
++
++	iwl_release_restricted_access(priv);
++
++	if (!errcnt)
++		IWL_DEBUG_INFO
++		    ("ucode image in INSTRUCTION memory is good\n");
++
++	return rc;
++}
++
++
++/**
++ * iwl_verify_inst_sparse - verify runtime uCode image in card vs. host,
++ *   using sample data 100 bytes apart.  If these sample points are good,
++ *   it's a pretty good bet that everything between them is good, too.
++ */
++static int iwl_verify_inst_sparse(struct iwl_priv *priv, __le32 *image, u32 len)
++{
++	u32 val;
++	int rc = 0;
++	u32 errcnt = 0;
++	u32 i;
++
++	IWL_DEBUG_INFO("ucode inst image size is %u\n", len);
++
++	rc = iwl_grab_restricted_access(priv);
++	if (rc)
++		return rc;
++
++	for (i = 0; i < len; i += 100, image += 100/sizeof(u32)) {
++		/* read data comes through single port, auto-incr addr */
++		/* NOTE: Use the debugless read so we don't flood kernel log
++		 * if IWL_DL_IO is set */
++		iwl_write_restricted(priv, HBUS_TARG_MEM_RADDR,
++			i + RTC_INST_LOWER_BOUND);
++		val = _iwl_read_restricted(priv, HBUS_TARG_MEM_RDAT);
++		if (val != le32_to_cpu(*image)) {
++#if 0 /* Enable this if you want to see details */
++			IWL_ERROR("uCode INST section is invalid at "
++				  "offset 0x%x, is 0x%x, s/b 0x%x\n",
++				  i, val, *image);
++#endif
++			rc = -EIO;
++			errcnt++;
++			if (errcnt >= 3)
++				break;
++		}
++	}
++
++	iwl_release_restricted_access(priv);
++
++	return rc;
++}
++
++
++/**
++ * iwl_verify_ucode - determine which instruction image is in SRAM,
++ *    and verify its contents
++ */
++static int iwl_verify_ucode(struct iwl_priv *priv)
++{
++	__le32 *image;
++	u32 len;
++	int rc = 0;
++
++	/* Try bootstrap */
++	image = (__le32 *)priv->ucode_boot.v_addr;
++	len = priv->ucode_boot.len;
++	rc = iwl_verify_inst_sparse(priv, image, len);
++	if (rc == 0) {
++		IWL_DEBUG_INFO("Bootstrap uCode is good in inst SRAM\n");
++		return 0;
++	}
++
++	/* Try initialize */
++	image = (__le32 *)priv->ucode_init.v_addr;
++	len = priv->ucode_init.len;
++	rc = iwl_verify_inst_sparse(priv, image, len);
++	if (rc == 0) {
++		IWL_DEBUG_INFO("Initialize uCode is good in inst SRAM\n");
++		return 0;
++	}
++
++	/* Try runtime/protocol */
++	image = (__le32 *)priv->ucode_code.v_addr;
++	len = priv->ucode_code.len;
++	rc = iwl_verify_inst_sparse(priv, image, len);
++	if (rc == 0) {
++		IWL_DEBUG_INFO("Runtime uCode is good in inst SRAM\n");
++		return 0;
++	}
++
++	IWL_ERROR("NO VALID UCODE IMAGE IN INSTRUCTION SRAM!!\n");
++
++	/* Show first several data entries in instruction SRAM.
++	 * Selection of bootstrap image is arbitrary. */
++	image = (__le32 *)priv->ucode_boot.v_addr;
++	len = priv->ucode_boot.len;
++	rc = iwl_verify_inst_full(priv, image, len);
++
++	return rc;
++}
++
++
++/* check contents of special bootstrap uCode SRAM */
++static int iwl_verify_bsm(struct iwl_priv *priv)
++{
++	__le32 *image = priv->ucode_boot.v_addr;
++	u32 len = priv->ucode_boot.len;
++	u32 reg;
++	u32 val;
++
++	IWL_DEBUG_INFO("Begin verify bsm\n");
++
++	/* verify BSM SRAM contents */
++	val = iwl_read_restricted_reg(priv, BSM_WR_DWCOUNT_REG);
++	for (reg = BSM_SRAM_LOWER_BOUND;
++	     reg < BSM_SRAM_LOWER_BOUND + len;
++	     reg += sizeof(u32), image ++) {
++		val = iwl_read_restricted_reg(priv, reg);
++		if (val != le32_to_cpu(*image)) {
++			IWL_ERROR("BSM uCode verification failed at "
++				  "addr 0x%08X+%u (of %u), is 0x%x, s/b 0x%x\n",
++				  BSM_SRAM_LOWER_BOUND,
++				  reg - BSM_SRAM_LOWER_BOUND, len,
++				  val, le32_to_cpu(*image));
++			return -EIO;
++		}
++	}
++
++	IWL_DEBUG_INFO("BSM bootstrap uCode image OK\n");
++
++	return 0;
++}
++
++/**
++ * iwl_load_bsm - Load bootstrap instructions
++ *
++ * BSM operation:
++ *
++ * The Bootstrap State Machine (BSM) stores a short bootstrap uCode program
++ * in special SRAM that does not power down during RFKILL.  When powering back
++ * up after power-saving sleeps (or during initial uCode load), the BSM loads
++ * the bootstrap program into the on-board processor, and starts it.
++ *
++ * The bootstrap program loads (via DMA) instructions and data for a new
++ * program from host DRAM locations indicated by the host driver in the
++ * BSM_DRAM_* registers.  Once the new program is loaded, it starts
++ * automatically.
++ *
++ * When initializing the NIC, the host driver points the BSM to the
++ * "initialize" uCode image.  This uCode sets up some internal data, then
++ * notifies host via "initialize alive" that it is complete.
++ *
++ * The host then replaces the BSM_DRAM_* pointer values to point to the
++ * normal runtime uCode instructions and a backup uCode data cache buffer
++ * (filled initially with starting data values for the on-board processor),
++ * then triggers the "initialize" uCode to load and launch the runtime uCode,
++ * which begins normal operation.
++ *
++ * When doing a power-save shutdown, runtime uCode saves data SRAM into
++ * the backup data cache in DRAM before SRAM is powered down.
++ *
++ * When powering back up, the BSM loads the bootstrap program.  This reloads
++ * the runtime uCode instructions and the backup data cache into SRAM,
++ * and re-launches the runtime uCode from where it left off.
++ */
++static int iwl_load_bsm(struct iwl_priv *priv)
++{
++	__le32 *image = priv->ucode_boot.v_addr;
++	u32 len = priv->ucode_boot.len;
++	dma_addr_t pinst;
++	dma_addr_t pdata;
++	u32 inst_len;
++	u32 data_len;
++	int rc;
++	int i;
++	u32 done;
++	u32 reg_offset;
++
++	IWL_DEBUG_INFO("Begin load bsm\n");
++
++	/* make sure bootstrap program is no larger than BSM's SRAM size */
++	if (len > IWL_MAX_BSM_SIZE)
++		return -EINVAL;
++
++	/* Tell bootstrap uCode where to find the "Initialize" uCode
++	 *   in host DRAM ... bits 31:0 for 3945, bits 35:4 for 4965.
++	 * NOTE:  iwl_initialize_alive_start() will replace these values,
++	 *        after the "initialize" uCode has run, to point to
++	 *        runtime/protocol instructions and backup data cache. */
++	pinst = priv->ucode_init.p_addr;
++	pdata = priv->ucode_init_data.p_addr;
++	inst_len = priv->ucode_init.len;
++	data_len = priv->ucode_init_data.len;
++
++	rc = iwl_grab_restricted_access(priv);
++	if (rc)
++		return rc;
++
++	iwl_write_restricted_reg(priv, BSM_DRAM_INST_PTR_REG, pinst);
++	iwl_write_restricted_reg(priv, BSM_DRAM_DATA_PTR_REG, pdata);
++	iwl_write_restricted_reg(priv, BSM_DRAM_INST_BYTECOUNT_REG, inst_len);
++	iwl_write_restricted_reg(priv, BSM_DRAM_DATA_BYTECOUNT_REG, data_len);
++
++	/* Fill BSM memory with bootstrap instructions */
++	for (reg_offset = BSM_SRAM_LOWER_BOUND;
++	     reg_offset < BSM_SRAM_LOWER_BOUND + len;
++	     reg_offset += sizeof(u32), image++)
++		_iwl_write_restricted_reg(priv, reg_offset,
++					  le32_to_cpu(*image));
++
++	rc = iwl_verify_bsm(priv);
++	if (rc) {
++		iwl_release_restricted_access(priv);
++		return rc;
++	}
++
++	/* Tell BSM to copy from BSM SRAM into instruction SRAM, when asked */
++	iwl_write_restricted_reg(priv, BSM_WR_MEM_SRC_REG, 0x0);
++	iwl_write_restricted_reg(priv, BSM_WR_MEM_DST_REG,
++				 RTC_INST_LOWER_BOUND);
++	iwl_write_restricted_reg(priv, BSM_WR_DWCOUNT_REG, len / sizeof(u32));
++
++	/* Load bootstrap code into instruction SRAM now,
++	 *   to prepare to load "initialize" uCode */
++	iwl_write_restricted_reg(priv, BSM_WR_CTRL_REG,
++		BSM_WR_CTRL_REG_BIT_START);
++
++	/* Wait for load of bootstrap uCode to finish */
++	for (i = 0; i < 100; i++) {
++		done = iwl_read_restricted_reg(priv, BSM_WR_CTRL_REG);
++		if (!(done & BSM_WR_CTRL_REG_BIT_START))
++			break;
++		udelay(10);
++	}
++	if (i < 100)
++		IWL_DEBUG_INFO("BSM write complete, poll %d iterations\n", i);
++	else {
++		IWL_ERROR("BSM write did not complete!\n");
++		return -EIO;
++	}
++
++	/* Enable future boot loads whenever power management unit triggers it
++	 *   (e.g. when powering back up after power-save shutdown) */
++	iwl_write_restricted_reg(priv, BSM_WR_CTRL_REG,
++		BSM_WR_CTRL_REG_BIT_START_EN);
++
++	iwl_release_restricted_access(priv);
++
++	return 0;
++}
++
++static void iwl_nic_start(struct iwl_priv *priv)
++{
++	/* Remove all resets to allow NIC to operate */
++	iwl_write32(priv, CSR_RESET, 0);
++}
++
++/**
++ * iwl_read_ucode - Read uCode images from disk file.
++ *
++ * Copy into buffers for card to fetch via bus-mastering
++ */
++static int iwl_read_ucode(struct iwl_priv *priv)
++{
++	struct iwl_ucode *ucode;
++	int rc = 0;
++	const struct firmware *ucode_raw;
++	/* firmware file name contains uCode/driver compatibility version */
++	const char *name = "iwlwifi-3945" IWL3945_UCODE_API ".ucode";
++	u8 *src;
++	size_t len;
++	u32 ver, inst_size, data_size, init_size, init_data_size, boot_size;
++
++	/* Ask kernel firmware_class module to get the boot firmware off disk.
++	 * request_firmware() is synchronous, file is in memory on return. */
++	rc = request_firmware(&ucode_raw, name, &priv->pci_dev->dev);
++	if (rc < 0) {
++		IWL_ERROR("%s firmware file req failed: Reason %d\n", name, rc);
++		goto error;
++	}
++
++	IWL_DEBUG_INFO("Got firmware '%s' file (%zd bytes) from disk\n",
++		       name, ucode_raw->size);
++
++	/* Make sure that we got at least our header! */
++	if (ucode_raw->size < sizeof(*ucode)) {
++		IWL_ERROR("File size way too small!\n");
++		rc = -EINVAL;
++		goto err_release;
++	}
++
++	/* Data from ucode file:  header followed by uCode images */
++	ucode = (void *)ucode_raw->data;
++
++	ver = le32_to_cpu(ucode->ver);
++	inst_size = le32_to_cpu(ucode->inst_size);
++	data_size = le32_to_cpu(ucode->data_size);
++	init_size = le32_to_cpu(ucode->init_size);
++	init_data_size = le32_to_cpu(ucode->init_data_size);
++	boot_size = le32_to_cpu(ucode->boot_size);
++
++	IWL_DEBUG_INFO("f/w package hdr ucode version = 0x%x\n", ver);
++	IWL_DEBUG_INFO("f/w package hdr runtime inst size = %u\n",
++		       inst_size);
++	IWL_DEBUG_INFO("f/w package hdr runtime data size = %u\n",
++		       data_size);
++	IWL_DEBUG_INFO("f/w package hdr init inst size = %u\n",
++		       init_size);
++	IWL_DEBUG_INFO("f/w package hdr init data size = %u\n",
++		       init_data_size);
++	IWL_DEBUG_INFO("f/w package hdr boot inst size = %u\n",
++		       boot_size);
++
++	/* Verify size of file vs. image size info in file's header */
++	if (ucode_raw->size < sizeof(*ucode) +
++		inst_size + data_size + init_size +
++		init_data_size + boot_size) {
++
++		IWL_DEBUG_INFO("uCode file size %d too small\n",
++			       (int)ucode_raw->size);
++		rc = -EINVAL;
++		goto err_release;
++	}
++
++	/* Verify that uCode images will fit in card's SRAM */
++	if (inst_size > IWL_MAX_INST_SIZE) {
++		IWL_DEBUG_INFO("uCode instr len %d too large to fit in card\n",
++			       (int)inst_size);
++		rc = -EINVAL;
++		goto err_release;
++	}
++
++	if (data_size > IWL_MAX_DATA_SIZE) {
++		IWL_DEBUG_INFO("uCode data len %d too large to fit in card\n",
++			       (int)data_size);
++		rc = -EINVAL;
++		goto err_release;
++	}
++	if (init_size > IWL_MAX_INST_SIZE) {
++		IWL_DEBUG_INFO
++		    ("uCode init instr len %d too large to fit in card\n",
++		     (int)init_size);
++		rc = -EINVAL;
++		goto err_release;
++	}
++	if (init_data_size > IWL_MAX_DATA_SIZE) {
++		IWL_DEBUG_INFO
++		    ("uCode init data len %d too large to fit in card\n",
++		     (int)init_data_size);
++		rc = -EINVAL;
++		goto err_release;
++	}
++	if (boot_size > IWL_MAX_BSM_SIZE) {
++		IWL_DEBUG_INFO
++		    ("uCode boot instr len %d too large to fit in bsm\n",
++		     (int)boot_size);
++		rc = -EINVAL;
++		goto err_release;
++	}
++
++	/* Allocate ucode buffers for card's bus-master loading ... */
++
++	/* Runtime instructions and 2 copies of data:
++	 * 1) unmodified from disk
++	 * 2) backup cache for save/restore during power-downs */
++	priv->ucode_code.len = inst_size;
++	priv->ucode_code.v_addr =
++	    pci_alloc_consistent(priv->pci_dev,
++				 priv->ucode_code.len,
++				 &(priv->ucode_code.p_addr));
++
++	priv->ucode_data.len = data_size;
++	priv->ucode_data.v_addr =
++	    pci_alloc_consistent(priv->pci_dev,
++				 priv->ucode_data.len,
++				 &(priv->ucode_data.p_addr));
++
++	priv->ucode_data_backup.len = data_size;
++	priv->ucode_data_backup.v_addr =
++	    pci_alloc_consistent(priv->pci_dev,
++				 priv->ucode_data_backup.len,
++				 &(priv->ucode_data_backup.p_addr));
++
++
++	/* Initialization instructions and data */
++	priv->ucode_init.len = init_size;
++	priv->ucode_init.v_addr =
++	    pci_alloc_consistent(priv->pci_dev,
++				 priv->ucode_init.len,
++				 &(priv->ucode_init.p_addr));
++
++	priv->ucode_init_data.len = init_data_size;
++	priv->ucode_init_data.v_addr =
++	    pci_alloc_consistent(priv->pci_dev,
++				 priv->ucode_init_data.len,
++				 &(priv->ucode_init_data.p_addr));
++
++	/* Bootstrap (instructions only, no data) */
++	priv->ucode_boot.len = boot_size;
++	priv->ucode_boot.v_addr =
++	    pci_alloc_consistent(priv->pci_dev,
++				 priv->ucode_boot.len,
++				 &(priv->ucode_boot.p_addr));
++
++	if (!priv->ucode_code.v_addr || !priv->ucode_data.v_addr ||
++	    !priv->ucode_init.v_addr || !priv->ucode_init_data.v_addr ||
++	    !priv->ucode_boot.v_addr || !priv->ucode_data_backup.v_addr)
++		goto err_pci_alloc;
++
++	/* Copy images into buffers for card's bus-master reads ... */
++
++	/* Runtime instructions (first block of data in file) */
++	src = &ucode->data[0];
++	len = priv->ucode_code.len;
++	IWL_DEBUG_INFO("Copying (but not loading) uCode instr len %d\n",
++		       (int)len);
++	memcpy(priv->ucode_code.v_addr, src, len);
++	IWL_DEBUG_INFO("uCode instr buf vaddr = 0x%p, paddr = 0x%08x\n",
++		priv->ucode_code.v_addr, (u32)priv->ucode_code.p_addr);
++
++	/* Runtime data (2nd block)
++	 * NOTE:  Copy into backup buffer will be done in iwl_up()  */
++	src = &ucode->data[inst_size];
++	len = priv->ucode_data.len;
++	IWL_DEBUG_INFO("Copying (but not loading) uCode data len %d\n",
++		       (int)len);
++	memcpy(priv->ucode_data.v_addr, src, len);
++	memcpy(priv->ucode_data_backup.v_addr, src, len);
++
++	/* Initialization instructions (3rd block) */
++	if (init_size) {
++		src = &ucode->data[inst_size + data_size];
++		len = priv->ucode_init.len;
++		IWL_DEBUG_INFO("Copying (but not loading) init instr len %d\n",
++			       (int)len);
++		memcpy(priv->ucode_init.v_addr, src, len);
++	}
++
++	/* Initialization data (4th block) */
++	if (init_data_size) {
++		src = &ucode->data[inst_size + data_size + init_size];
++		len = priv->ucode_init_data.len;
++		IWL_DEBUG_INFO("Copying (but not loading) init data len %d\n",
++			       (int)len);
++		memcpy(priv->ucode_init_data.v_addr, src, len);
++	}
++
++	/* Bootstrap instructions (5th block) */
++	src = &ucode->data[inst_size + data_size + init_size + init_data_size];
++	len = priv->ucode_boot.len;
++	IWL_DEBUG_INFO("Copying (but not loading) boot instr len %d\n",
++		       (int)len);
++	memcpy(priv->ucode_boot.v_addr, src, len);
++
++	/* We have our copies now, allow OS release its copies */
++	release_firmware(ucode_raw);
++	return 0;
++
++ err_pci_alloc:
++	IWL_ERROR("failed to allocate pci memory\n");
++	rc = -ENOMEM;
++	iwl_dealloc_ucode_pci(priv);
++
++ err_release:
++	release_firmware(ucode_raw);
++
++ error:
++	return rc;
++}
++
++
++/**
++ * iwl_set_ucode_ptrs - Set uCode address location
++ *
++ * Tell initialization uCode where to find runtime uCode.
++ *
++ * BSM registers initially contain pointers to initialization uCode.
++ * We need to replace them to load runtime uCode inst and data,
++ * and to save runtime data when powering down.
++ */
++static int iwl_set_ucode_ptrs(struct iwl_priv *priv)
++{
++	dma_addr_t pinst;
++	dma_addr_t pdata;
++	int rc = 0;
++	unsigned long flags;
++
++	/* bits 31:0 for 3945 */
++	pinst = priv->ucode_code.p_addr;
++	pdata = priv->ucode_data_backup.p_addr;
++
++	spin_lock_irqsave(&priv->lock, flags);
++	rc = iwl_grab_restricted_access(priv);
++	if (rc) {
++		spin_unlock_irqrestore(&priv->lock, flags);
++		return rc;
++	}
++
++	/* Tell bootstrap uCode where to find image to load */
++	iwl_write_restricted_reg(priv, BSM_DRAM_INST_PTR_REG, pinst);
++	iwl_write_restricted_reg(priv, BSM_DRAM_DATA_PTR_REG, pdata);
++	iwl_write_restricted_reg(priv, BSM_DRAM_DATA_BYTECOUNT_REG,
++				 priv->ucode_data.len);
++
++	/* Inst bytecount must be last to set up, bit 31 signals uCode
++	 *   that all new ptr/size info is in place */
++	iwl_write_restricted_reg(priv, BSM_DRAM_INST_BYTECOUNT_REG,
++				 priv->ucode_code.len | BSM_DRAM_INST_LOAD);
++
++	iwl_release_restricted_access(priv);
++
++	spin_unlock_irqrestore(&priv->lock, flags);
++
++	IWL_DEBUG_INFO("Runtime uCode pointers are set.\n");
++
++	return rc;
++}
++
++/**
++ * iwl_init_alive_start - Called after REPLY_ALIVE notification receieved
++ *
++ * Called after REPLY_ALIVE notification received from "initialize" uCode.
++ *
++ * The 4965 "initialize" ALIVE reply contains calibration data for:
++ *   Voltage, temperature, and MIMO tx gain correction, now stored in priv
++ *   (3945 does not contain this data).
++ *
++ * Tell "initialize" uCode to go ahead and load the runtime uCode.
++*/
++static void iwl_init_alive_start(struct iwl_priv *priv)
++{
++	/* Check alive response for "valid" sign from uCode */
++	if (priv->card_alive_init.is_valid != UCODE_VALID_OK) {
++		/* We had an error bringing up the hardware, so take it
++		 * all the way back down so we can try again */
++		IWL_DEBUG_INFO("Initialize Alive failed.\n");
++		goto restart;
++	}
++
++	/* Bootstrap uCode has loaded initialize uCode ... verify inst image.
++	 * This is a paranoid check, because we would not have gotten the
++	 * "initialize" alive if code weren't properly loaded.  */
++	if (iwl_verify_ucode(priv)) {
++		/* Runtime instruction load was bad;
++		 * take it all the way back down so we can try again */
++		IWL_DEBUG_INFO("Bad \"initialize\" uCode load.\n");
++		goto restart;
++	}
++
++	/* Send pointers to protocol/runtime uCode image ... init code will
++	 * load and launch runtime uCode, which will send us another "Alive"
++	 * notification. */
++	IWL_DEBUG_INFO("Initialization Alive received.\n");
++	if (iwl_set_ucode_ptrs(priv)) {
++		/* Runtime instruction load won't happen;
++		 * take it all the way back down so we can try again */
++		IWL_DEBUG_INFO("Couldn't set up uCode pointers.\n");
++		goto restart;
++	}
++	return;
++
++ restart:
++	queue_work(priv->workqueue, &priv->restart);
++}
++
++
++/**
++ * iwl_alive_start - called after REPLY_ALIVE notification received
++ *                   from protocol/runtime uCode (initialization uCode's
++ *                   Alive gets handled by iwl_init_alive_start()).
++ */
++static void iwl_alive_start(struct iwl_priv *priv)
++{
++	int rc = 0;
++	int thermal_spin = 0;
++	u32 rfkill;
++
++	IWL_DEBUG_INFO("Runtime Alive received.\n");
++
++	if (priv->card_alive.is_valid != UCODE_VALID_OK) {
++		/* We had an error bringing up the hardware, so take it
++		 * all the way back down so we can try again */
++		IWL_DEBUG_INFO("Alive failed.\n");
++		goto restart;
++	}
++
++	/* Initialize uCode has loaded Runtime uCode ... verify inst image.
++	 * This is a paranoid check, because we would not have gotten the
++	 * "runtime" alive if code weren't properly loaded.  */
++	if (iwl_verify_ucode(priv)) {
++		/* Runtime instruction load was bad;
++		 * take it all the way back down so we can try again */
++		IWL_DEBUG_INFO("Bad runtime uCode load.\n");
++		goto restart;
++	}
++
++	iwl_clear_stations_table(priv);
++
++	rc = iwl_grab_restricted_access(priv);
++	if (rc) {
++		IWL_WARNING("Can not read rfkill status from adapter\n");
++		return;
++	}
++
++	rfkill = iwl_read_restricted_reg(priv, APMG_RFKILL_REG);
++	IWL_DEBUG_INFO("RFKILL status: 0x%x\n", rfkill);
++	iwl_release_restricted_access(priv);
++
++	if (rfkill & 0x1) {
++		clear_bit(STATUS_RF_KILL_HW, &priv->status);
++		/* if rfkill is not on, then wait for thermal
++		 * sensor in adapter to kick in */
++		while (iwl_hw_get_temperature(priv) == 0) {
++			thermal_spin++;
++			udelay(10);
++		}
++
++		if (thermal_spin)
++			IWL_DEBUG_INFO("Thermal calibration took %dus\n",
++				       thermal_spin * 10);
++	} else
++		set_bit(STATUS_RF_KILL_HW, &priv->status);
++
++	/* After the ALIVE response, we can process host commands */
++	set_bit(STATUS_ALIVE, &priv->status);
++
++	/* Clear out the uCode error bit if it is set */
++	clear_bit(STATUS_FW_ERROR, &priv->status);
++
++	rc = iwl_init_channel_map(priv);
++	if (rc) {
++		IWL_ERROR("initializing regulatory failed: %d\n", rc);
++		return;
++	}
++
++	iwl_init_geos(priv);
++
++	if (iwl_is_rfkill(priv))
++		return;
++
++	if (!priv->mac80211_registered) {
++		/* Unlock so any user space entry points can call back into
++		 * the driver without a deadlock... */
++		mutex_unlock(&priv->mutex);
++		iwl_rate_control_register(priv->hw);
++		rc = ieee80211_register_hw(priv->hw);
++		priv->hw->conf.beacon_int = 100;
++		mutex_lock(&priv->mutex);
++
++		if (rc) {
++			IWL_ERROR("Failed to register network "
++				  "device (error %d)\n", rc);
++			return;
++		}
++
++		priv->mac80211_registered = 1;
++
++		iwl_reset_channel_flag(priv);
++	} else
++		ieee80211_start_queues(priv->hw);
++
++	priv->active_rate = priv->rates_mask;
++	priv->active_rate_basic = priv->rates_mask & IWL_BASIC_RATES_MASK;
++
++	iwl_send_power_mode(priv, IWL_POWER_LEVEL(priv->power_mode));
++
++	if (iwl_is_associated(priv)) {
++		struct iwl_rxon_cmd *active_rxon =
++				(struct iwl_rxon_cmd *)(&priv->active_rxon);
++
++		memcpy(&priv->staging_rxon, &priv->active_rxon,
++		       sizeof(priv->staging_rxon));
++		active_rxon->filter_flags &= ~RXON_FILTER_ASSOC_MSK;
++	} else {
++		/* Initialize our rx_config data */
++		iwl_connection_init_rx_config(priv);
++		memcpy(priv->staging_rxon.node_addr, priv->mac_addr, ETH_ALEN);
++	}
++
++	/* Configure BT coexistence */
++	iwl_send_bt_config(priv);
++
++	/* Configure the adapter for unassociated operation */
++	iwl_commit_rxon(priv);
++
++	/* At this point, the NIC is initialized and operational */
++	priv->notif_missed_beacons = 0;
++	set_bit(STATUS_READY, &priv->status);
++
++	iwl3945_reg_txpower_periodic(priv);
++
++	IWL_DEBUG_INFO("ALIVE processing complete.\n");
++
++	if (priv->error_recovering)
++		iwl_error_recovery(priv);
++
++	return;
++
++ restart:
++	queue_work(priv->workqueue, &priv->restart);
++}
++
++static void iwl_cancel_deferred_work(struct iwl_priv *priv);
++
++static void __iwl_down(struct iwl_priv *priv)
++{
++	unsigned long flags;
++	int exit_pending = test_bit(STATUS_EXIT_PENDING, &priv->status);
++	struct ieee80211_conf *conf = NULL;
++
++	IWL_DEBUG_INFO(DRV_NAME " is going down\n");
++
++	conf = ieee80211_get_hw_conf(priv->hw);
++
++	if (!exit_pending)
++		set_bit(STATUS_EXIT_PENDING, &priv->status);
++
++	iwl_clear_stations_table(priv);
++
++	/* Unblock any waiting calls */
++	wake_up_interruptible_all(&priv->wait_command_queue);
++
++	iwl_cancel_deferred_work(priv);
++
++	/* Wipe out the EXIT_PENDING status bit if we are not actually
++	 * exiting the module */
++	if (!exit_pending)
++		clear_bit(STATUS_EXIT_PENDING, &priv->status);
++
++	/* stop and reset the on-board processor */
++	iwl_write32(priv, CSR_RESET, CSR_RESET_REG_FLAG_NEVO_RESET);
++
++	/* tell the device to stop sending interrupts */
++	iwl_disable_interrupts(priv);
++
++	if (priv->mac80211_registered)
++		ieee80211_stop_queues(priv->hw);
++
++	/* If we have not previously called iwl_init() then
++	 * clear all bits but the RF Kill and SUSPEND bits and return */
++	if (!iwl_is_init(priv)) {
++		priv->status = test_bit(STATUS_RF_KILL_HW, &priv->status) <<
++					STATUS_RF_KILL_HW |
++			       test_bit(STATUS_RF_KILL_SW, &priv->status) <<
++					STATUS_RF_KILL_SW |
++			       test_bit(STATUS_IN_SUSPEND, &priv->status) <<
++					STATUS_IN_SUSPEND;
++		goto exit;
++	}
++
++	/* ...otherwise clear out all the status bits but the RF Kill and
++	 * SUSPEND bits and continue taking the NIC down. */
++	priv->status &= test_bit(STATUS_RF_KILL_HW, &priv->status) <<
++				STATUS_RF_KILL_HW |
++			test_bit(STATUS_RF_KILL_SW, &priv->status) <<
++				STATUS_RF_KILL_SW |
++			test_bit(STATUS_IN_SUSPEND, &priv->status) <<
++				STATUS_IN_SUSPEND |
++			test_bit(STATUS_FW_ERROR, &priv->status) <<
++				STATUS_FW_ERROR;
++
++	spin_lock_irqsave(&priv->lock, flags);
++	iwl_clear_bit(priv, CSR_GP_CNTRL, CSR_GP_CNTRL_REG_FLAG_MAC_ACCESS_REQ);
++	spin_unlock_irqrestore(&priv->lock, flags);
++
++	iwl_hw_txq_ctx_stop(priv);
++	iwl_hw_rxq_stop(priv);
++
++	spin_lock_irqsave(&priv->lock, flags);
++	if (!iwl_grab_restricted_access(priv)) {
++		iwl_write_restricted_reg(priv, APMG_CLK_DIS_REG,
++					 APMG_CLK_VAL_DMA_CLK_RQT);
++		iwl_release_restricted_access(priv);
++	}
++	spin_unlock_irqrestore(&priv->lock, flags);
++
++	udelay(5);
++
++	iwl_hw_nic_stop_master(priv);
++	iwl_set_bit(priv, CSR_RESET, CSR_RESET_REG_FLAG_SW_RESET);
++	iwl_hw_nic_reset(priv);
++
++ exit:
++	memset(&priv->card_alive, 0, sizeof(struct iwl_alive_resp));
++
++	if (priv->ibss_beacon)
++		dev_kfree_skb(priv->ibss_beacon);
++	priv->ibss_beacon = NULL;
++
++	/* clear out any free frames */
++	iwl_clear_free_frames(priv);
++}
++
++static void iwl_down(struct iwl_priv *priv)
++{
++	mutex_lock(&priv->mutex);
++	__iwl_down(priv);
++	mutex_unlock(&priv->mutex);
++}
++
++#define MAX_HW_RESTARTS 5
++
++static int __iwl_up(struct iwl_priv *priv)
++{
++	int rc, i;
++
++	if (test_bit(STATUS_EXIT_PENDING, &priv->status)) {
++		IWL_WARNING("Exit pending; will not bring the NIC up\n");
++		return -EIO;
++	}
++
++	if (test_bit(STATUS_RF_KILL_SW, &priv->status)) {
++		IWL_WARNING("Radio disabled by SW RF kill (module "
++			    "parameter)\n");
++		return 0;
++	}
++
++	iwl_write32(priv, CSR_INT, 0xFFFFFFFF);
++
++	rc = iwl_hw_nic_init(priv);
++	if (rc) {
++		IWL_ERROR("Unable to int nic\n");
++		return rc;
++	}
++
++	/* make sure rfkill handshake bits are cleared */
++	iwl_write32(priv, CSR_UCODE_DRV_GP1_CLR, CSR_UCODE_SW_BIT_RFKILL);
++	iwl_write32(priv, CSR_UCODE_DRV_GP1_CLR,
++		    CSR_UCODE_DRV_GP1_BIT_CMD_BLOCKED);
++
++	/* clear (again), then enable host interrupts */
++	iwl_write32(priv, CSR_INT, 0xFFFFFFFF);
++	iwl_enable_interrupts(priv);
++
++	/* really make sure rfkill handshake bits are cleared */
++	iwl_write32(priv, CSR_UCODE_DRV_GP1_CLR, CSR_UCODE_SW_BIT_RFKILL);
++	iwl_write32(priv, CSR_UCODE_DRV_GP1_CLR, CSR_UCODE_SW_BIT_RFKILL);
++
++	/* Copy original ucode data image from disk into backup cache.
++	 * This will be used to initialize the on-board processor's
++	 * data SRAM for a clean start when the runtime program first loads. */
++	memcpy(priv->ucode_data_backup.v_addr, priv->ucode_data.v_addr,
++			priv->ucode_data.len);
++
++	for (i = 0; i < MAX_HW_RESTARTS; i++) {
++
++		iwl_clear_stations_table(priv);
++
++		/* load bootstrap state machine,
++		 * load bootstrap program into processor's memory,
++		 * prepare to load the "initialize" uCode */
++		rc = iwl_load_bsm(priv);
++
++		if (rc) {
++			IWL_ERROR("Unable to set up bootstrap uCode: %d\n", rc);
++			continue;
++		}
++
++		/* start card; "initialize" will load runtime ucode */
++		iwl_nic_start(priv);
++
++		/* MAC Address location in EEPROM same for 3945/4965 */
++		get_eeprom_mac(priv, priv->mac_addr);
++		IWL_DEBUG_INFO("MAC address: " MAC_FMT "\n",
++			       MAC_ARG(priv->mac_addr));
++
++		SET_IEEE80211_PERM_ADDR(priv->hw, priv->mac_addr);
++
++		IWL_DEBUG_INFO(DRV_NAME " is coming up\n");
++
++		return 0;
++	}
++
++	set_bit(STATUS_EXIT_PENDING, &priv->status);
++	__iwl_down(priv);
++
++	/* tried to restart and config the device for as long as our
++	 * patience could withstand */
++	IWL_ERROR("Unable to initialize device after %d attempts.\n", i);
++	return -EIO;
++}
++
++
++/*****************************************************************************
++ *
++ * Workqueue callbacks
++ *
++ *****************************************************************************/
++
++static void iwl_bg_init_alive_start(struct work_struct *data)
++{
++	struct iwl_priv *priv =
++	    container_of(data, struct iwl_priv, init_alive_start.work);
++
++	if (test_bit(STATUS_EXIT_PENDING, &priv->status))
++		return;
++
++	mutex_lock(&priv->mutex);
++	iwl_init_alive_start(priv);
++	mutex_unlock(&priv->mutex);
++}
++
++static void iwl_bg_alive_start(struct work_struct *data)
++{
++	struct iwl_priv *priv =
++	    container_of(data, struct iwl_priv, alive_start.work);
++
++	if (test_bit(STATUS_EXIT_PENDING, &priv->status))
++		return;
++
++	mutex_lock(&priv->mutex);
++	iwl_alive_start(priv);
++	mutex_unlock(&priv->mutex);
++}
++
++static void iwl_bg_rf_kill(struct work_struct *work)
++{
++	struct iwl_priv *priv = container_of(work, struct iwl_priv, rf_kill);
++
++	wake_up_interruptible(&priv->wait_command_queue);
++
++	if (test_bit(STATUS_EXIT_PENDING, &priv->status))
++		return;
++
++	mutex_lock(&priv->mutex);
++
++	if (!iwl_is_rfkill(priv)) {
++		IWL_DEBUG(IWL_DL_INFO | IWL_DL_RF_KILL,
++			  "HW and/or SW RF Kill no longer active, restarting "
++			  "device\n");
++		if (!test_bit(STATUS_EXIT_PENDING, &priv->status))
++			queue_work(priv->workqueue, &priv->restart);
++	} else {
++
++		if (!test_bit(STATUS_RF_KILL_HW, &priv->status))
++			IWL_DEBUG_RF_KILL("Can not turn radio back on - "
++					  "disabled by SW switch\n");
++		else
++			IWL_WARNING("Radio Frequency Kill Switch is On:\n"
++				    "Kill switch must be turned off for "
++				    "wireless networking to work.\n");
++	}
++	mutex_unlock(&priv->mutex);
++}
++
++#define IWL_SCAN_CHECK_WATCHDOG (7 * HZ)
++
++static void iwl_bg_scan_check(struct work_struct *data)
++{
++	struct iwl_priv *priv =
++	    container_of(data, struct iwl_priv, scan_check.work);
++
++	if (test_bit(STATUS_EXIT_PENDING, &priv->status))
++		return;
++
++	mutex_lock(&priv->mutex);
++	if (test_bit(STATUS_SCANNING, &priv->status) ||
++	    test_bit(STATUS_SCAN_ABORTING, &priv->status)) {
++		IWL_DEBUG(IWL_DL_INFO | IWL_DL_SCAN,
++			  "Scan completion watchdog resetting adapter (%dms)\n",
++			  jiffies_to_msecs(IWL_SCAN_CHECK_WATCHDOG));
++		if (!test_bit(STATUS_EXIT_PENDING, &priv->status))
++			queue_work(priv->workqueue, &priv->restart);
++	}
++	mutex_unlock(&priv->mutex);
++}
++
++static void iwl_bg_request_scan(struct work_struct *data)
++{
++	struct iwl_priv *priv =
++	    container_of(data, struct iwl_priv, request_scan);
++	struct iwl_host_cmd cmd = {
++		.id = REPLY_SCAN_CMD,
++		.len = sizeof(struct iwl_scan_cmd),
++		.meta.flags = CMD_SIZE_HUGE,
++	};
++	int rc = 0;
++	struct iwl_scan_cmd *scan;
++	struct ieee80211_conf *conf = NULL;
++	u8 direct_mask;
++	int phymode;
++
++	conf = ieee80211_get_hw_conf(priv->hw);
++
++	mutex_lock(&priv->mutex);
++
++	if (!iwl_is_ready(priv)) {
++		IWL_WARNING("request scan called when driver not ready.\n");
++		goto done;
++	}
++
++	/* Make sure the scan wasn't cancelled before this queued work
++	 * was given the chance to run... */
++	if (!test_bit(STATUS_SCANNING, &priv->status))
++		goto done;
++
++	/* This should never be called or scheduled if there is currently
++	 * a scan active in the hardware. */
++	if (test_bit(STATUS_SCAN_HW, &priv->status)) {
++		IWL_DEBUG_INFO("Multiple concurrent scan requests in parallel. "
++			       "Ignoring second request.\n");
++		rc = -EIO;
++		goto done;
++	}
++
++	if (test_bit(STATUS_EXIT_PENDING, &priv->status)) {
++		IWL_DEBUG_SCAN("Aborting scan due to device shutdown\n");
++		goto done;
++	}
++
++	if (test_bit(STATUS_SCAN_ABORTING, &priv->status)) {
++		IWL_DEBUG_HC("Scan request while abort pending.  Queuing.\n");
++		goto done;
++	}
++
++	if (iwl_is_rfkill(priv)) {
++		IWL_DEBUG_HC("Aborting scan due to RF Kill activation\n");
++		goto done;
++	}
++
++	if (!test_bit(STATUS_READY, &priv->status)) {
++		IWL_DEBUG_HC("Scan request while uninitialized.  Queuing.\n");
++		goto done;
++	}
++
++	if (!priv->scan_bands) {
++		IWL_DEBUG_HC("Aborting scan due to no requested bands\n");
++		goto done;
++	}
++
++	if (!priv->scan) {
++		priv->scan = kmalloc(sizeof(struct iwl_scan_cmd) +
++				     IWL_MAX_SCAN_SIZE, GFP_KERNEL);
++		if (!priv->scan) {
++			rc = -ENOMEM;
++			goto done;
++		}
++	}
++	scan = priv->scan;
++	memset(scan, 0, sizeof(struct iwl_scan_cmd) + IWL_MAX_SCAN_SIZE);
++
++	scan->quiet_plcp_th = IWL_PLCP_QUIET_THRESH;
++	scan->quiet_time = IWL_ACTIVE_QUIET_TIME;
++
++	if (iwl_is_associated(priv)) {
++		u16 interval = 0;
++		u32 extra;
++		u32 suspend_time = 100;
++		u32 scan_suspend_time = 100;
++		unsigned long flags;
++
++		IWL_DEBUG_INFO("Scanning while associated...\n");
++
++		spin_lock_irqsave(&priv->lock, flags);
++		interval = priv->beacon_int;
++		spin_unlock_irqrestore(&priv->lock, flags);
++
++		scan->suspend_time = 0;
++		scan->max_out_time = cpu_to_le32(600 * 1024);
++		if (!interval)
++			interval = suspend_time;
++		/*
++		 * suspend time format:
++		 *  0-19: beacon interval in usec (time before exec.)
++		 * 20-23: 0
++		 * 24-31: number of beacons (suspend between channels)
++		 */
++
++		extra = (suspend_time / interval) << 24;
++		scan_suspend_time = 0xFF0FFFFF &
++		    (extra | ((suspend_time % interval) * 1024));
++
++		scan->suspend_time = cpu_to_le32(scan_suspend_time);
++		IWL_DEBUG_SCAN("suspend_time 0x%X beacon interval %d\n",
++			       scan_suspend_time, interval);
++	}
++
++	/* We should add the ability for user to lock to PASSIVE ONLY */
++	if (priv->one_direct_scan) {
++		IWL_DEBUG_SCAN
++		    ("Kicking off one direct scan for '%s'\n",
++		     iwl_escape_essid(priv->direct_ssid,
++				      priv->direct_ssid_len));
++		scan->direct_scan[0].id = WLAN_EID_SSID;
++		scan->direct_scan[0].len = priv->direct_ssid_len;
++		memcpy(scan->direct_scan[0].ssid,
++		       priv->direct_ssid, priv->direct_ssid_len);
++		direct_mask = 1;
++	} else if (!iwl_is_associated(priv)) {
++		scan->direct_scan[0].id = WLAN_EID_SSID;
++		scan->direct_scan[0].len = priv->essid_len;
++		memcpy(scan->direct_scan[0].ssid, priv->essid, priv->essid_len);
++		direct_mask = 1;
++	} else
++		direct_mask = 0;
++
++	/* We don't build a direct scan probe request; the uCode will do
++	 * that based on the direct_mask added to each channel entry */
++	scan->tx_cmd.len = cpu_to_le16(
++		iwl_fill_probe_req(priv, (struct ieee80211_mgmt *)scan->data,
++			IWL_MAX_SCAN_SIZE - sizeof(scan), 0));
++	scan->tx_cmd.tx_flags = TX_CMD_FLG_SEQ_CTL_MSK;
++	scan->tx_cmd.sta_id = priv->hw_setting.bcast_sta_id;
++	scan->tx_cmd.stop_time.life_time = TX_CMD_LIFE_TIME_INFINITE;
++
++	/* flags + rate selection */
++
++	switch (priv->scan_bands) {
++	case 2:
++		scan->flags = RXON_FLG_BAND_24G_MSK | RXON_FLG_AUTO_DETECT_MSK;
++		scan->tx_cmd.rate = IWL_RATE_1M_PLCP;
++		scan->good_CRC_th = 0;
++		phymode = MODE_IEEE80211G;
++		break;
++
++	case 1:
++		scan->tx_cmd.rate = IWL_RATE_6M_PLCP;
++		scan->good_CRC_th = IWL_GOOD_CRC_TH;
++		phymode = MODE_IEEE80211A;
++		break;
++
++	default:
++		IWL_WARNING("Invalid scan band count\n");
++		goto done;
++	}
++
++	/* select Rx antennas */
++	scan->flags |= iwl3945_get_antenna_flags(priv);
++
++	if (priv->iw_mode == IEEE80211_IF_TYPE_MNTR)
++		scan->filter_flags = RXON_FILTER_PROMISC_MSK;
++
++	if (direct_mask)
++		IWL_DEBUG_SCAN
++		    ("Initiating direct scan for %s.\n",
++		     iwl_escape_essid(priv->essid, priv->essid_len));
++	else
++		IWL_DEBUG_SCAN("Initiating indirect scan.\n");
++
++	scan->channel_count =
++		iwl_get_channels_for_scan(
++			priv, phymode, 1, /* active */
++			direct_mask,
++			(void *)&scan->data[le16_to_cpu(scan->tx_cmd.len)]);
++
++	cmd.len += le16_to_cpu(scan->tx_cmd.len) +
++	    scan->channel_count * sizeof(struct iwl_scan_channel);
++	cmd.data = scan;
++	scan->len = cpu_to_le16(cmd.len);
++
++	set_bit(STATUS_SCAN_HW, &priv->status);
++	rc = iwl_send_cmd_sync(priv, &cmd);
++	if (rc)
++		goto done;
++
++	queue_delayed_work(priv->workqueue, &priv->scan_check,
++			   IWL_SCAN_CHECK_WATCHDOG);
++
++	mutex_unlock(&priv->mutex);
++	return;
++
++ done:
++	/* inform mac80211 sacn aborted */
++	queue_work(priv->workqueue, &priv->scan_completed);
++	mutex_unlock(&priv->mutex);
++}
++
++static void iwl_bg_up(struct work_struct *data)
++{
++	struct iwl_priv *priv = container_of(data, struct iwl_priv, up);
++
++	if (test_bit(STATUS_EXIT_PENDING, &priv->status))
++		return;
++
++	mutex_lock(&priv->mutex);
++	__iwl_up(priv);
++	mutex_unlock(&priv->mutex);
++}
++
++static void iwl_bg_restart(struct work_struct *data)
++{
++	struct iwl_priv *priv = container_of(data, struct iwl_priv, restart);
++
++	if (test_bit(STATUS_EXIT_PENDING, &priv->status))
++		return;
++
++	iwl_down(priv);
++	queue_work(priv->workqueue, &priv->up);
++}
++
++static void iwl_bg_rx_replenish(struct work_struct *data)
++{
++	struct iwl_priv *priv =
++	    container_of(data, struct iwl_priv, rx_replenish);
++
++	if (test_bit(STATUS_EXIT_PENDING, &priv->status))
++		return;
++
++	mutex_lock(&priv->mutex);
++	iwl_rx_replenish(priv);
++	mutex_unlock(&priv->mutex);
++}
++
++static void iwl_bg_post_associate(struct work_struct *data)
++{
++	struct iwl_priv *priv = container_of(data, struct iwl_priv,
++					     post_associate.work);
++
++	int rc = 0;
++	struct ieee80211_conf *conf = NULL;
++
++	if (priv->iw_mode == IEEE80211_IF_TYPE_AP) {
++		IWL_ERROR("%s Should not be called in AP mode\n", __FUNCTION__);
++		return;
++	}
++
++
++	IWL_DEBUG_ASSOC("Associated as %d to: " MAC_FMT "\n",
++			priv->assoc_id, MAC_ARG(priv->active_rxon.bssid_addr));
++
++	if (test_bit(STATUS_EXIT_PENDING, &priv->status))
++		return;
++
++	mutex_lock(&priv->mutex);
++
++	conf = ieee80211_get_hw_conf(priv->hw);
++
++	priv->staging_rxon.filter_flags &= ~RXON_FILTER_ASSOC_MSK;
++	iwl_commit_rxon(priv);
++
++	memset(&priv->rxon_timing, 0, sizeof(struct iwl_rxon_time_cmd));
++	iwl_setup_rxon_timing(priv);
++	rc = iwl_send_cmd_pdu(priv, REPLY_RXON_TIMING,
++			      sizeof(priv->rxon_timing), &priv->rxon_timing);
++	if (rc)
++		IWL_WARNING("REPLY_RXON_TIMING failed - "
++			    "Attempting to continue.\n");
++
++	priv->staging_rxon.filter_flags |= RXON_FILTER_ASSOC_MSK;
++
++	priv->staging_rxon.assoc_id = cpu_to_le16(priv->assoc_id);
++
++	IWL_DEBUG_ASSOC("assoc id %d beacon interval %d\n",
++			priv->assoc_id, priv->beacon_int);
++
++	if (priv->assoc_capability & WLAN_CAPABILITY_SHORT_PREAMBLE)
++		priv->staging_rxon.flags |= RXON_FLG_SHORT_PREAMBLE_MSK;
++	else
++		priv->staging_rxon.flags &= ~RXON_FLG_SHORT_PREAMBLE_MSK;
++
++	if (priv->staging_rxon.flags & RXON_FLG_BAND_24G_MSK) {
++		if (priv->assoc_capability & WLAN_CAPABILITY_SHORT_SLOT_TIME)
++			priv->staging_rxon.flags |= RXON_FLG_SHORT_SLOT_MSK;
++		else
++			priv->staging_rxon.flags &= ~RXON_FLG_SHORT_SLOT_MSK;
++
++		if (priv->iw_mode == IEEE80211_IF_TYPE_IBSS)
++			priv->staging_rxon.flags &= ~RXON_FLG_SHORT_SLOT_MSK;
++
++	}
++
++	iwl_commit_rxon(priv);
++
++	switch (priv->iw_mode) {
++	case IEEE80211_IF_TYPE_STA:
++		iwl_rate_scale_init(priv->hw, IWL_AP_ID);
++		break;
++
++	case IEEE80211_IF_TYPE_IBSS:
++
++		/* clear out the station table */
++		iwl_clear_stations_table(priv);
++
++		iwl_rxon_add_station(priv, BROADCAST_ADDR, 0);
++		iwl_rxon_add_station(priv, priv->bssid, 0);
++		iwl3945_sync_sta(priv, IWL_STA_ID,
++				 (priv->phymode == MODE_IEEE80211A)?
++				 IWL_RATE_6M_PLCP : IWL_RATE_1M_PLCP,
++				 CMD_ASYNC);
++		iwl_rate_scale_init(priv->hw, IWL_STA_ID);
++		iwl_send_beacon_cmd(priv);
++
++		break;
++
++	default:
++		 IWL_ERROR("%s Should not be called in %d mode\n",
++				__FUNCTION__, priv->iw_mode);
++		break;
++	}
++
++	iwl_sequence_reset(priv);
++
++#ifdef CONFIG_IWLWIFI_QOS
++	iwl_activate_qos(priv, 0);
++#endif /* CONFIG_IWLWIFI_QOS */
++	mutex_unlock(&priv->mutex);
++}
++
++static void iwl_bg_abort_scan(struct work_struct *work)
++{
++	struct iwl_priv *priv = container_of(work, struct iwl_priv,
++					     abort_scan);
++
++	if (!iwl_is_ready(priv))
++		return;
++
++	mutex_lock(&priv->mutex);
++
++	set_bit(STATUS_SCAN_ABORTING, &priv->status);
++	iwl_send_scan_abort(priv);
++
++	mutex_unlock(&priv->mutex);
++}
++
++static void iwl_bg_scan_completed(struct work_struct *work)
++{
++	struct iwl_priv *priv =
++	    container_of(work, struct iwl_priv, scan_completed);
++
++	IWL_DEBUG(IWL_DL_INFO | IWL_DL_SCAN, "SCAN complete scan\n");
++
++	if (test_bit(STATUS_EXIT_PENDING, &priv->status))
++		return;
++
++	ieee80211_scan_completed(priv->hw);
++
++	/* Since setting the TXPOWER may have been deferred while
++	 * performing the scan, fire one off */
++	mutex_lock(&priv->mutex);
++	iwl_hw_reg_send_txpower(priv);
++	mutex_unlock(&priv->mutex);
++}
++
++/*****************************************************************************
++ *
++ * mac80211 entry point functions
++ *
++ *****************************************************************************/
++
++static int iwl_mac_open(struct ieee80211_hw *hw)
++{
++	struct iwl_priv *priv = hw->priv;
++
++	IWL_DEBUG_MAC80211("enter\n");
++
++	/* we should be verifying the device is ready to be opened */
++	mutex_lock(&priv->mutex);
++
++	priv->is_open = 1;
++
++	if (!iwl_is_rfkill(priv))
++		ieee80211_start_queues(priv->hw);
++
++	mutex_unlock(&priv->mutex);
++	IWL_DEBUG_MAC80211("leave\n");
++	return 0;
++}
++
++static int iwl_mac_stop(struct ieee80211_hw *hw)
++{
++	struct iwl_priv *priv = hw->priv;
++
++	IWL_DEBUG_MAC80211("enter\n");
++	priv->is_open = 0;
++	/*netif_stop_queue(dev); */
++	flush_workqueue(priv->workqueue);
++	IWL_DEBUG_MAC80211("leave\n");
++
++	return 0;
++}
++
++static int iwl_mac_tx(struct ieee80211_hw *hw, struct sk_buff *skb,
++		      struct ieee80211_tx_control *ctl)
++{
++	struct iwl_priv *priv = hw->priv;
++
++	IWL_DEBUG_MAC80211("enter\n");
++
++	if (priv->iw_mode == IEEE80211_IF_TYPE_MNTR) {
++		IWL_DEBUG_MAC80211("leave - monitor\n");
++		return -1;
++	}
++
++	IWL_DEBUG_TX("dev->xmit(%d bytes) at rate 0x%02x\n", skb->len,
++		     ctl->tx_rate);
++
++	if (iwl_tx_skb(priv, skb, ctl))
++		dev_kfree_skb_any(skb);
++
++	IWL_DEBUG_MAC80211("leave\n");
++	return 0;
++}
++
++static int iwl_mac_add_interface(struct ieee80211_hw *hw,
++				 struct ieee80211_if_init_conf *conf)
++{
++	struct iwl_priv *priv = hw->priv;
++	unsigned long flags;
++
++	IWL_DEBUG_MAC80211("enter: id %d, type %d\n", conf->if_id, conf->type);
++	if (conf->mac_addr)
++		IWL_DEBUG_MAC80211("enter: MAC " MAC_FMT "\n",
++				   MAC_ARG(conf->mac_addr));
++
++	if (priv->interface_id) {
++		IWL_DEBUG_MAC80211("leave - interface_id != 0\n");
++		return 0;
++	}
++
++	spin_lock_irqsave(&priv->lock, flags);
++	priv->interface_id = conf->if_id;
++
++	spin_unlock_irqrestore(&priv->lock, flags);
++
++	mutex_lock(&priv->mutex);
++	iwl_set_mode(priv, conf->type);
++
++	IWL_DEBUG_MAC80211("leave\n");
++	mutex_unlock(&priv->mutex);
++
++	return 0;
++}
++
++/**
++ * iwl_mac_config - mac80211 config callback
++ *
++ * We ignore conf->flags & IEEE80211_CONF_SHORT_SLOT_TIME since it seems to
++ * be set inappropriately and the driver currently sets the hardware up to
++ * use it whenever needed.
++ */
++static int iwl_mac_config(struct ieee80211_hw *hw, struct ieee80211_conf *conf)
++{
++	struct iwl_priv *priv = hw->priv;
++	const struct iwl_channel_info *ch_info;
++	unsigned long flags;
++
++	mutex_lock(&priv->mutex);
++	IWL_DEBUG_MAC80211("enter to channel %d\n", conf->channel);
++
++	if (!iwl_is_ready(priv)) {
++		IWL_DEBUG_MAC80211("leave - not ready\n");
++		mutex_unlock(&priv->mutex);
++		return -EIO;
++	}
++
++	/* TODO: Figure out how to get ieee80211_local->sta_scanning w/ only
++	 * what is exposed through include/ declrations */
++	if (unlikely(!iwl_param_disable_hw_scan &&
++		     test_bit(STATUS_SCANNING, &priv->status))) {
++		IWL_DEBUG_MAC80211("leave - scanning\n");
++		mutex_unlock(&priv->mutex);
++		return 0;
++	}
++
++	spin_lock_irqsave(&priv->lock, flags);
++
++	ch_info = iwl_get_channel_info(priv, conf->phymode, conf->channel);
++	if (!is_channel_valid(ch_info)) {
++		IWL_DEBUG_SCAN("Channel %d [%d] is INVALID for this SKU.\n",
++			       conf->channel, conf->phymode);
++		IWL_DEBUG_MAC80211("leave - invalid channel\n");
++		spin_unlock_irqrestore(&priv->lock, flags);
++		mutex_unlock(&priv->mutex);
++		return -EINVAL;
++	}
++
++	iwl_set_rxon_channel(priv, conf->phymode, conf->channel);
++
++	iwl_set_flags_for_phymode(priv, conf->phymode);
++
++	/* The list of supported rates and rate mask can be different
++	 * for each phymode; since the phymode may have changed, reset
++	 * the rate mask to what mac80211 lists */
++	iwl_set_rate(priv);
++
++	spin_unlock_irqrestore(&priv->lock, flags);
++
++#ifdef IEEE80211_CONF_CHANNEL_SWITCH
++	if (conf->flags & IEEE80211_CONF_CHANNEL_SWITCH) {
++		iwl_hw_channel_switch(priv, conf->channel);
++		mutex_unlock(&priv->mutex);
++		return 0;
++	}
++#endif
++
++	iwl_radio_kill_sw(priv, !conf->radio_enabled);
++
++	if (!conf->radio_enabled) {
++		IWL_DEBUG_MAC80211("leave - radio disabled\n");
++		mutex_unlock(&priv->mutex);
++		return 0;
++	}
++
++	if (iwl_is_rfkill(priv)) {
++		IWL_DEBUG_MAC80211("leave - RF kill\n");
++		mutex_unlock(&priv->mutex);
++		return -EIO;
++	}
++
++	iwl_set_rate(priv);
++
++	if (memcmp(&priv->active_rxon,
++		   &priv->staging_rxon, sizeof(priv->staging_rxon)))
++		iwl_commit_rxon(priv);
++	else
++		IWL_DEBUG_INFO("No re-sending same RXON configuration.\n");
++
++	IWL_DEBUG_MAC80211("leave\n");
++
++	mutex_unlock(&priv->mutex);
++
++	return 0;
++}
++
++static void iwl_config_ap(struct iwl_priv *priv)
++{
++	int rc = 0;
++
++	if (priv->status & STATUS_EXIT_PENDING)
++		return;
++
++	/* The following should be done only at AP bring up */
++	if ((priv->active_rxon.filter_flags & RXON_FILTER_ASSOC_MSK) == 0) {
++
++		/* RXON - unassoc (to set timing command) */
++		priv->staging_rxon.filter_flags &= ~RXON_FILTER_ASSOC_MSK;
++		iwl_commit_rxon(priv);
++
++		/* RXON Timing */
++		memset(&priv->rxon_timing, 0, sizeof(struct iwl_rxon_time_cmd));
++		iwl_setup_rxon_timing(priv);
++		rc = iwl_send_cmd_pdu(priv, REPLY_RXON_TIMING,
++				sizeof(priv->rxon_timing), &priv->rxon_timing);
++		if (rc)
++			IWL_WARNING("REPLY_RXON_TIMING failed - "
++					"Attempting to continue.\n");
++
++		/* FIXME: what should be the assoc_id for AP? */
++		priv->staging_rxon.assoc_id = cpu_to_le16(priv->assoc_id);
++		if (priv->assoc_capability & WLAN_CAPABILITY_SHORT_PREAMBLE)
++			priv->staging_rxon.flags |=
++				RXON_FLG_SHORT_PREAMBLE_MSK;
++		else
++			priv->staging_rxon.flags &=
++				~RXON_FLG_SHORT_PREAMBLE_MSK;
++
++		if (priv->staging_rxon.flags & RXON_FLG_BAND_24G_MSK) {
++			if (priv->assoc_capability &
++				WLAN_CAPABILITY_SHORT_SLOT_TIME)
++				priv->staging_rxon.flags |=
++					RXON_FLG_SHORT_SLOT_MSK;
++			else
++				priv->staging_rxon.flags &=
++					~RXON_FLG_SHORT_SLOT_MSK;
++
++			if (priv->iw_mode == IEEE80211_IF_TYPE_IBSS)
++				priv->staging_rxon.flags &=
++					~RXON_FLG_SHORT_SLOT_MSK;
++		}
++		/* restore RXON assoc */
++		priv->staging_rxon.filter_flags |= RXON_FILTER_ASSOC_MSK;
++		iwl_commit_rxon(priv);
++		iwl_rxon_add_station(priv, BROADCAST_ADDR, 0);
++		iwl_send_beacon_cmd(priv);
++	} else
++		iwl_send_beacon_cmd(priv);
++
++	/* FIXME - we need to add code here to detect a totally new
++	 * configuration, reset the AP, unassoc, rxon timing, assoc,
++	 * clear sta table, add BCAST sta... */
++}
++
++static int iwl_mac_config_interface(struct ieee80211_hw *hw, int if_id,
++				    struct ieee80211_if_conf *conf)
++{
++	struct iwl_priv *priv = hw->priv;
++	unsigned long flags;
++	int rc;
++
++	if (conf == NULL)
++		return -EIO;
++
++	if ((priv->iw_mode == IEEE80211_IF_TYPE_AP) &&
++	    (!conf->beacon || !conf->ssid_len)) {
++		IWL_DEBUG_MAC80211
++		    ("Leaving in AP mode because HostAPD is not ready.\n");
++		return 0;
++	}
++
++	mutex_lock(&priv->mutex);
++
++	IWL_DEBUG_MAC80211("enter: interface id %d\n", if_id);
++	if (conf->bssid)
++		IWL_DEBUG_MAC80211("bssid: " MAC_FMT "\n",
++				   MAC_ARG(conf->bssid));
++
++	if (unlikely(test_bit(STATUS_SCANNING, &priv->status)) &&
++	    !(priv->hw->flags & IEEE80211_HW_NO_PROBE_FILTERING)) {
++		IWL_DEBUG_MAC80211("leave - scanning\n");
++		mutex_unlock(&priv->mutex);
++		return 0;
++	}
++
++	if (priv->interface_id != if_id) {
++		IWL_DEBUG_MAC80211("leave - interface_id != if_id\n");
++		mutex_unlock(&priv->mutex);
++		return 0;
++	}
++
++	if (priv->iw_mode == IEEE80211_IF_TYPE_AP) {
++		if (!conf->bssid) {
++			conf->bssid = priv->mac_addr;
++			memcpy(priv->bssid, priv->mac_addr, ETH_ALEN);
++			IWL_DEBUG_MAC80211("bssid was set to: " MAC_FMT "\n",
++					   MAC_ARG(conf->bssid));
++		}
++		if (priv->ibss_beacon)
++			dev_kfree_skb(priv->ibss_beacon);
++
++		priv->ibss_beacon = conf->beacon;
++	}
++
++	if (conf->bssid && !is_zero_ether_addr(conf->bssid) &&
++	    !is_multicast_ether_addr(conf->bssid)) {
++		/* If there is currently a HW scan going on in the background
++		 * then we need to cancel it else the RXON below will fail. */
++		if (iwl_scan_cancel_timeout(priv, 100)) {
++			IWL_WARNING("Aborted scan still in progress "
++				    "after 100ms\n");
++			IWL_DEBUG_MAC80211("leaving - scan abort failed.\n");
++			mutex_unlock(&priv->mutex);
++			return -EAGAIN;
++		}
++		memcpy(priv->staging_rxon.bssid_addr, conf->bssid, ETH_ALEN);
++
++		/* TODO: Audit driver for usage of these members and see
++		 * if mac80211 deprecates them (priv->bssid looks like it
++		 * shouldn't be there, but I haven't scanned the IBSS code
++		 * to verify) - jpk */
++		memcpy(priv->bssid, conf->bssid, ETH_ALEN);
++
++		if (priv->iw_mode == IEEE80211_IF_TYPE_AP)
++			iwl_config_ap(priv);
++		else {
++			priv->staging_rxon.filter_flags |=
++						RXON_FILTER_ASSOC_MSK;
++			rc = iwl_commit_rxon(priv);
++			if ((priv->iw_mode == IEEE80211_IF_TYPE_STA) && rc)
++				iwl_rxon_add_station(
++					priv, priv->active_rxon.bssid_addr, 1);
++		}
++
++	} else {
++		priv->staging_rxon.filter_flags &= ~RXON_FILTER_ASSOC_MSK;
++		iwl_commit_rxon(priv);
++	}
++
++	spin_lock_irqsave(&priv->lock, flags);
++	if (!conf->ssid_len)
++		memset(priv->essid, 0, IW_ESSID_MAX_SIZE);
++	else
++		memcpy(priv->essid, conf->ssid, conf->ssid_len);
++
++	priv->essid_len = conf->ssid_len;
++	spin_unlock_irqrestore(&priv->lock, flags);
++
++	IWL_DEBUG_MAC80211("leave\n");
++	mutex_unlock(&priv->mutex);
++
++	return 0;
++}
++
++static void iwl_mac_remove_interface(struct ieee80211_hw *hw,
++				     struct ieee80211_if_init_conf *conf)
++{
++	struct iwl_priv *priv = hw->priv;
++
++	IWL_DEBUG_MAC80211("enter\n");
++
++	mutex_lock(&priv->mutex);
++	if (priv->interface_id == conf->if_id) {
++		priv->interface_id = 0;
++		memset(priv->bssid, 0, ETH_ALEN);
++		memset(priv->essid, 0, IW_ESSID_MAX_SIZE);
++		priv->essid_len = 0;
++	}
++	mutex_unlock(&priv->mutex);
++
++	IWL_DEBUG_MAC80211("leave\n");
++
++}
++
++#define IWL_DELAY_NEXT_SCAN (HZ*2)
++static int iwl_mac_hw_scan(struct ieee80211_hw *hw, u8 *ssid, size_t len)
++{
++	int rc = 0;
++	unsigned long flags;
++	struct iwl_priv *priv = hw->priv;
++
++	IWL_DEBUG_MAC80211("enter\n");
++
++	spin_lock_irqsave(&priv->lock, flags);
++
++	if (!iwl_is_ready_rf(priv)) {
++		rc = -EIO;
++		IWL_DEBUG_MAC80211("leave - not ready or exit pending\n");
++		goto out_unlock;
++	}
++
++	if (priv->iw_mode == IEEE80211_IF_TYPE_AP) {	/* APs don't scan */
++		rc = -EIO;
++		IWL_ERROR("ERROR: APs don't scan\n");
++		goto out_unlock;
++	}
++
++	/* if we just finished scan ask for delay */
++	if (priv->last_scan_jiffies &&
++	    time_after(priv->last_scan_jiffies + IWL_DELAY_NEXT_SCAN,
++		       jiffies)) {
++		rc = -EAGAIN;
++		goto out_unlock;
++	}
++	if (len) {
++		IWL_DEBUG_SCAN("direct scan for  "
++			       "%s [%d]\n ",
++			       iwl_escape_essid(ssid, len), (int)len);
++
++		priv->one_direct_scan = 1;
++		priv->direct_ssid_len = (u8)
++		    min((u8) len, (u8) IW_ESSID_MAX_SIZE);
++		memcpy(priv->direct_ssid, ssid, priv->direct_ssid_len);
++	}
++
++	rc = iwl_scan_initiate(priv);
++
++	IWL_DEBUG_MAC80211("leave\n");
++
++out_unlock:
++	spin_unlock_irqrestore(&priv->lock, flags);
++
++	return rc;
++}
++
++static int iwl_mac_set_key(struct ieee80211_hw *hw, set_key_cmd cmd,
++			   const u8 *local_addr, const u8 *addr,
++			   struct ieee80211_key_conf *key)
++{
++	struct iwl_priv *priv = hw->priv;
++	int rc = 0;
++	u8 sta_id;
++
++	IWL_DEBUG_MAC80211("enter\n");
++
++	if (!iwl_param_hwcrypto) {
++		IWL_DEBUG_MAC80211("leave - hwcrypto disabled\n");
++		return -EOPNOTSUPP;
++	}
++
++	if (is_zero_ether_addr(addr))
++		/* only support pairwise keys */
++		return -EOPNOTSUPP;
++
++	sta_id = iwl_hw_find_station(priv, addr);
++	if (sta_id == IWL_INVALID_STATION) {
++		IWL_DEBUG_MAC80211("leave - " MAC_FMT " not in station map.\n",
++				   MAC_ARG(addr));
++		return -EINVAL;
++	}
++
++	mutex_lock(&priv->mutex);
++
++	switch (cmd) {
++	case  SET_KEY:
++		rc = iwl_update_sta_key_info(priv, key, sta_id);
++		if (!rc) {
++			iwl_set_rxon_hwcrypto(priv, 1);
++			iwl_commit_rxon(priv);
++			key->hw_key_idx = sta_id;
++			IWL_DEBUG_MAC80211("set_key success, using hwcrypto\n");
++		}
++		break;
++	case DISABLE_KEY:
++		rc = iwl_clear_sta_key_info(priv, sta_id);
++		if (!rc) {
++			iwl_set_rxon_hwcrypto(priv, 0);
++			iwl_commit_rxon(priv);
++			IWL_DEBUG_MAC80211("disable hwcrypto key\n");
++		}
++		break;
++	default:
++		rc = -EINVAL;
++	}
++
++	IWL_DEBUG_MAC80211("leave\n");
++	mutex_unlock(&priv->mutex);
++
++	return rc;
++}
++
++static int iwl_mac_conf_tx(struct ieee80211_hw *hw, int queue,
++			   const struct ieee80211_tx_queue_params *params)
++{
++	struct iwl_priv *priv = hw->priv;
++#ifdef CONFIG_IWLWIFI_QOS
++	unsigned long flags;
++	int q;
++#endif /* CONFIG_IWL_QOS */
++
++	IWL_DEBUG_MAC80211("enter\n");
++
++	if (!iwl_is_ready_rf(priv)) {
++		IWL_DEBUG_MAC80211("leave - RF not ready\n");
++		return -EIO;
++	}
++
++	if (queue >= AC_NUM) {
++		IWL_DEBUG_MAC80211("leave - queue >= AC_NUM %d\n", queue);
++		return 0;
++	}
++
++#ifdef CONFIG_IWLWIFI_QOS
++	if (!priv->qos_data.qos_enable) {
++		priv->qos_data.qos_active = 0;
++		IWL_DEBUG_MAC80211("leave - qos not enabled\n");
++		return 0;
++	}
++	q = AC_NUM - 1 - queue;
++
++	spin_lock_irqsave(&priv->lock, flags);
++
++	priv->qos_data.def_qos_parm.ac[q].cw_min = cpu_to_le16(params->cw_min);
++	priv->qos_data.def_qos_parm.ac[q].cw_max = cpu_to_le16(params->cw_max);
++	priv->qos_data.def_qos_parm.ac[q].aifsn = params->aifs;
++	priv->qos_data.def_qos_parm.ac[q].edca_txop =
++			cpu_to_le16((params->burst_time * 100));
++
++	priv->qos_data.def_qos_parm.ac[q].reserved1 = 0;
++	priv->qos_data.qos_active = 1;
++
++	spin_unlock_irqrestore(&priv->lock, flags);
++
++	mutex_lock(&priv->mutex);
++	if (priv->iw_mode == IEEE80211_IF_TYPE_AP)
++		iwl_activate_qos(priv, 1);
++	else if (priv->assoc_id && iwl_is_associated(priv))
++		iwl_activate_qos(priv, 0);
++
++	mutex_unlock(&priv->mutex);
++
++#endif /*CONFIG_IWLWIFI_QOS */
++
++	IWL_DEBUG_MAC80211("leave\n");
++	return 0;
++}
++
++static int iwl_mac_get_tx_stats(struct ieee80211_hw *hw,
++				struct ieee80211_tx_queue_stats *stats)
++{
++	struct iwl_priv *priv = hw->priv;
++	int i, avail;
++	struct iwl_tx_queue *txq;
++	struct iwl_queue *q;
++	unsigned long flags;
++
++	IWL_DEBUG_MAC80211("enter\n");
++
++	if (!iwl_is_ready_rf(priv)) {
++		IWL_DEBUG_MAC80211("leave - RF not ready\n");
++		return -EIO;
++	}
++
++	spin_lock_irqsave(&priv->lock, flags);
++
++	for (i = 0; i < AC_NUM; i++) {
++		txq = &priv->txq[i];
++		q = &txq->q;
++		avail = iwl_queue_space(q);
++
++		stats->data[i].len = q->n_window - avail;
++		stats->data[i].limit = q->n_window - q->high_mark;
++		stats->data[i].count = q->n_window;
++
++	}
++	spin_unlock_irqrestore(&priv->lock, flags);
++
++	IWL_DEBUG_MAC80211("leave\n");
++
++	return 0;
++}
++
++static int iwl_mac_get_stats(struct ieee80211_hw *hw,
++			     struct ieee80211_low_level_stats *stats)
++{
++	IWL_DEBUG_MAC80211("enter\n");
++	IWL_DEBUG_MAC80211("leave\n");
++
++	return 0;
++}
++
++static u64 iwl_mac_get_tsf(struct ieee80211_hw *hw)
++{
++	IWL_DEBUG_MAC80211("enter\n");
++	IWL_DEBUG_MAC80211("leave\n");
++
++	return 0;
++}
++
++static void iwl_mac_reset_tsf(struct ieee80211_hw *hw)
++{
++	struct iwl_priv *priv = hw->priv;
++	unsigned long flags;
++
++	mutex_lock(&priv->mutex);
++	IWL_DEBUG_MAC80211("enter\n");
++
++#ifdef CONFIG_IWLWIFI_QOS
++	iwl_reset_qos(priv);
++#endif
++	cancel_delayed_work(&priv->post_associate);
++
++	spin_lock_irqsave(&priv->lock, flags);
++	priv->assoc_id = 0;
++	priv->assoc_capability = 0;
++	priv->call_post_assoc_from_beacon = 0;
++
++	/* new association get rid of ibss beacon skb */
++	if (priv->ibss_beacon)
++		dev_kfree_skb(priv->ibss_beacon);
++
++	priv->ibss_beacon = NULL;
++
++	priv->beacon_int = priv->hw->conf.beacon_int;
++	priv->timestamp1 = 0;
++	priv->timestamp0 = 0;
++	if ((priv->iw_mode == IEEE80211_IF_TYPE_STA))
++		priv->beacon_int = 0;
++
++	spin_unlock_irqrestore(&priv->lock, flags);
++
++	/* Per mac80211.h: This is only used in IBSS mode... */
++	if (priv->iw_mode != IEEE80211_IF_TYPE_IBSS) {
++		IWL_DEBUG_MAC80211("leave - not in IBSS\n");
++		mutex_unlock(&priv->mutex);
++		return;
++	}
++
++	if (!iwl_is_ready_rf(priv)) {
++		IWL_DEBUG_MAC80211("leave - not ready\n");
++		mutex_unlock(&priv->mutex);
++		return;
++	}
++
++	priv->only_active_channel = 0;
++
++	iwl_set_rate(priv);
++
++	mutex_unlock(&priv->mutex);
++
++	IWL_DEBUG_MAC80211("leave\n");
++
++}
++
++static int iwl_mac_beacon_update(struct ieee80211_hw *hw, struct sk_buff *skb,
++				 struct ieee80211_tx_control *control)
++{
++	struct iwl_priv *priv = hw->priv;
++	unsigned long flags;
++
++	mutex_lock(&priv->mutex);
++	IWL_DEBUG_MAC80211("enter\n");
++
++	if (!iwl_is_ready_rf(priv)) {
++		IWL_DEBUG_MAC80211("leave - RF not ready\n");
++		mutex_unlock(&priv->mutex);
++		return -EIO;
++	}
++
++	if (priv->iw_mode != IEEE80211_IF_TYPE_IBSS) {
++		IWL_DEBUG_MAC80211("leave - not IBSS\n");
++		mutex_unlock(&priv->mutex);
++		return -EIO;
++	}
++
++	spin_lock_irqsave(&priv->lock, flags);
++
++	if (priv->ibss_beacon)
++		dev_kfree_skb(priv->ibss_beacon);
++
++	priv->ibss_beacon = skb;
++
++	priv->assoc_id = 0;
++
++	IWL_DEBUG_MAC80211("leave\n");
++	spin_unlock_irqrestore(&priv->lock, flags);
++
++#ifdef CONFIG_IWLWIFI_QOS
++	iwl_reset_qos(priv);
++#endif
++
++	queue_work(priv->workqueue, &priv->post_associate.work);
++
++	mutex_unlock(&priv->mutex);
++
++	return 0;
++}
++
++/*****************************************************************************
++ *
++ * sysfs attributes
++ *
++ *****************************************************************************/
++
++#ifdef CONFIG_IWLWIFI_DEBUG
++
++/*
++ * The following adds a new attribute to the sysfs representation
++ * of this device driver (i.e. a new file in /sys/bus/pci/drivers/iwl/)
++ * used for controlling the debug level.
++ *
++ * See the level definitions in iwl for details.
++ */
++
++static ssize_t show_debug_level(struct device_driver *d, char *buf)
++{
++	return sprintf(buf, "0x%08X\n", iwl_debug_level);
++}
++static ssize_t store_debug_level(struct device_driver *d,
++				 const char *buf, size_t count)
++{
++	char *p = (char *)buf;
++	u32 val;
++
++	val = simple_strtoul(p, &p, 0);
++	if (p == buf)
++		printk(KERN_INFO DRV_NAME
++		       ": %s is not in hex or decimal form.\n", buf);
++	else
++		iwl_debug_level = val;
++
++	return strnlen(buf, count);
++}
++
++static DRIVER_ATTR(debug_level, S_IWUSR | S_IRUGO,
++		   show_debug_level, store_debug_level);
++
++#endif /* CONFIG_IWLWIFI_DEBUG */
++
++static ssize_t show_rf_kill(struct device *d,
++			    struct device_attribute *attr, char *buf)
++{
++	/*
++	 * 0 - RF kill not enabled
++	 * 1 - SW based RF kill active (sysfs)
++	 * 2 - HW based RF kill active
++	 * 3 - Both HW and SW based RF kill active
++	 */
++	struct iwl_priv *priv = (struct iwl_priv *)d->driver_data;
++	int val = (test_bit(STATUS_RF_KILL_SW, &priv->status) ? 0x1 : 0x0) |
++		  (test_bit(STATUS_RF_KILL_HW, &priv->status) ? 0x2 : 0x0);
++
++	return sprintf(buf, "%i\n", val);
++}
++
++static ssize_t store_rf_kill(struct device *d,
++			     struct device_attribute *attr,
++			     const char *buf, size_t count)
++{
++	struct iwl_priv *priv = (struct iwl_priv *)d->driver_data;
++
++	mutex_lock(&priv->mutex);
++	iwl_radio_kill_sw(priv, buf[0] == '1');
++	mutex_unlock(&priv->mutex);
++
++	return count;
++}
++
++static DEVICE_ATTR(rf_kill, S_IWUSR | S_IRUGO, show_rf_kill, store_rf_kill);
++
++static ssize_t show_temperature(struct device *d,
++				struct device_attribute *attr, char *buf)
++{
++	struct iwl_priv *priv = (struct iwl_priv *)d->driver_data;
++
++	if (!iwl_is_alive(priv))
++		return -EAGAIN;
++
++	return sprintf(buf, "%d\n", iwl_hw_get_temperature(priv));
++}
++
++static DEVICE_ATTR(temperature, S_IRUGO, show_temperature, NULL);
++
++static ssize_t show_rs_window(struct device *d,
++			      struct device_attribute *attr,
++			      char *buf)
++{
++	struct iwl_priv *priv = d->driver_data;
++	return iwl_fill_rs_info(priv->hw, buf, IWL_AP_ID);
++}
++static DEVICE_ATTR(rs_window, S_IRUGO, show_rs_window, NULL);
++
++static ssize_t show_tx_power(struct device *d,
++			     struct device_attribute *attr, char *buf)
++{
++	struct iwl_priv *priv = (struct iwl_priv *)d->driver_data;
++	return sprintf(buf, "%d\n", priv->user_txpower_limit);
++}
++
++static ssize_t store_tx_power(struct device *d,
++			      struct device_attribute *attr,
++			      const char *buf, size_t count)
++{
++	struct iwl_priv *priv = (struct iwl_priv *)d->driver_data;
++	char *p = (char *)buf;
++	u32 val;
++
++	val = simple_strtoul(p, &p, 10);
++	if (p == buf)
++		printk(KERN_INFO DRV_NAME
++		       ": %s is not in decimal form.\n", buf);
++	else
++		iwl_hw_reg_set_txpower(priv, val);
++
++	return count;
++}
++
++static DEVICE_ATTR(tx_power, S_IWUSR | S_IRUGO, show_tx_power, store_tx_power);
++
++static ssize_t show_flags(struct device *d,
++			  struct device_attribute *attr, char *buf)
++{
++	struct iwl_priv *priv = (struct iwl_priv *)d->driver_data;
++
++	return sprintf(buf, "0x%04X\n", priv->active_rxon.flags);
++}
++
++static ssize_t store_flags(struct device *d,
++			   struct device_attribute *attr,
++			   const char *buf, size_t count)
++{
++	struct iwl_priv *priv = (struct iwl_priv *)d->driver_data;
++	u32 flags = simple_strtoul(buf, NULL, 0);
++
++	mutex_lock(&priv->mutex);
++	if (le32_to_cpu(priv->staging_rxon.flags) != flags) {
++		/* Cancel any currently running scans... */
++		if (iwl_scan_cancel_timeout(priv, 100))
++			IWL_WARNING("Could not cancel scan.\n");
++		else {
++			IWL_DEBUG_INFO("Committing rxon.flags = 0x%04X\n",
++				       flags);
++			priv->staging_rxon.flags = cpu_to_le32(flags);
++			iwl_commit_rxon(priv);
++		}
++	}
++	mutex_unlock(&priv->mutex);
++
++	return count;
++}
++
++static DEVICE_ATTR(flags, S_IWUSR | S_IRUGO, show_flags, store_flags);
++
++static ssize_t show_filter_flags(struct device *d,
++				 struct device_attribute *attr, char *buf)
++{
++	struct iwl_priv *priv = (struct iwl_priv *)d->driver_data;
++
++	return sprintf(buf, "0x%04X\n",
++		le32_to_cpu(priv->active_rxon.filter_flags));
++}
++
++static ssize_t store_filter_flags(struct device *d,
++				  struct device_attribute *attr,
++				  const char *buf, size_t count)
++{
++	struct iwl_priv *priv = (struct iwl_priv *)d->driver_data;
++	u32 filter_flags = simple_strtoul(buf, NULL, 0);
++
++	mutex_lock(&priv->mutex);
++	if (le32_to_cpu(priv->staging_rxon.filter_flags) != filter_flags) {
++		/* Cancel any currently running scans... */
++		if (iwl_scan_cancel_timeout(priv, 100))
++			IWL_WARNING("Could not cancel scan.\n");
++		else {
++			IWL_DEBUG_INFO("Committing rxon.filter_flags = "
++				       "0x%04X\n", filter_flags);
++			priv->staging_rxon.filter_flags =
++				cpu_to_le32(filter_flags);
++			iwl_commit_rxon(priv);
++		}
++	}
++	mutex_unlock(&priv->mutex);
++
++	return count;
++}
++
++static DEVICE_ATTR(filter_flags, S_IWUSR | S_IRUGO, show_filter_flags,
++		   store_filter_flags);
++
++static ssize_t show_tune(struct device *d,
++			 struct device_attribute *attr, char *buf)
++{
++	struct iwl_priv *priv = (struct iwl_priv *)d->driver_data;
++
++	return sprintf(buf, "0x%04X\n",
++		       (priv->phymode << 8) |
++			le16_to_cpu(priv->active_rxon.channel));
++}
++
++static void iwl_set_flags_for_phymode(struct iwl_priv *priv, u8 phymode);
++
++static ssize_t store_tune(struct device *d,
++			  struct device_attribute *attr,
++			  const char *buf, size_t count)
++{
++	struct iwl_priv *priv = (struct iwl_priv *)d->driver_data;
++	char *p = (char *)buf;
++	u16 tune = simple_strtoul(p, &p, 0);
++	u8 phymode = (tune >> 8) & 0xff;
++	u16 channel = tune & 0xff;
++
++	IWL_DEBUG_INFO("Tune request to:%d channel:%d\n", phymode, channel);
++
++	mutex_lock(&priv->mutex);
++	if ((le16_to_cpu(priv->staging_rxon.channel) != channel) ||
++	    (priv->phymode != phymode)) {
++		const struct iwl_channel_info *ch_info;
++
++		ch_info = iwl_get_channel_info(priv, phymode, channel);
++		if (!ch_info) {
++			IWL_WARNING("Requested invalid phymode/channel "
++				    "combination: %d %d\n", phymode, channel);
++			mutex_unlock(&priv->mutex);
++			return -EINVAL;
++		}
++
++		/* Cancel any currently running scans... */
++		if (iwl_scan_cancel_timeout(priv, 100))
++			IWL_WARNING("Could not cancel scan.\n");
++		else {
++			IWL_DEBUG_INFO("Committing phymode and "
++				       "rxon.channel = %d %d\n",
++				       phymode, channel);
++
++			iwl_set_rxon_channel(priv, phymode, channel);
++			iwl_set_flags_for_phymode(priv, phymode);
++
++			iwl_set_rate(priv);
++			iwl_commit_rxon(priv);
++		}
++	}
++	mutex_unlock(&priv->mutex);
++
++	return count;
++}
++
++static DEVICE_ATTR(tune, S_IWUSR | S_IRUGO, show_tune, store_tune);
++
++#ifdef CONFIG_IWLWIFI_SPECTRUM_MEASUREMENT
++
++static ssize_t show_measurement(struct device *d,
++				struct device_attribute *attr, char *buf)
++{
++	struct iwl_priv *priv = dev_get_drvdata(d);
++	struct iwl_spectrum_notification measure_report;
++	u32 size = sizeof(measure_report), len = 0, ofs = 0;
++	u8 *data = (u8 *) & measure_report;
++	unsigned long flags;
++
++	spin_lock_irqsave(&priv->lock, flags);
++	if (!(priv->measurement_status & MEASUREMENT_READY)) {
++		spin_unlock_irqrestore(&priv->lock, flags);
++		return 0;
++	}
++	memcpy(&measure_report, &priv->measure_report, size);
++	priv->measurement_status = 0;
++	spin_unlock_irqrestore(&priv->lock, flags);
++
++	while (size && (PAGE_SIZE - len)) {
++		hex_dump_to_buffer(data + ofs, size, 16, 1, buf + len,
++				   PAGE_SIZE - len, 1);
++		len = strlen(buf);
++		if (PAGE_SIZE - len)
++			buf[len++] = '\n';
++
++		ofs += 16;
++		size -= min(size, 16U);
++	}
++
++	return len;
++}
++
++static ssize_t store_measurement(struct device *d,
++				 struct device_attribute *attr,
++				 const char *buf, size_t count)
++{
++	struct iwl_priv *priv = dev_get_drvdata(d);
++	struct ieee80211_measurement_params params = {
++		.channel = le16_to_cpu(priv->active_rxon.channel),
++		.start_time = cpu_to_le64(priv->last_tsf),
++		.duration = cpu_to_le16(1),
++	};
++	u8 type = IWL_MEASURE_BASIC;
++	u8 buffer[32];
++	u8 channel;
++
++	if (count) {
++		char *p = buffer;
++		strncpy(buffer, buf, min(sizeof(buffer), count));
++		channel = simple_strtoul(p, NULL, 0);
++		if (channel)
++			params.channel = channel;
++
++		p = buffer;
++		while (*p && *p != ' ')
++			p++;
++		if (*p)
++			type = simple_strtoul(p + 1, NULL, 0);
++	}
++
++	IWL_DEBUG_INFO("Invoking measurement of type %d on "
++		       "channel %d (for '%s')\n", type, params.channel, buf);
++	iwl_get_measurement(priv, &params, type);
++
++	return count;
++}
++
++static DEVICE_ATTR(measurement, S_IRUSR | S_IWUSR,
++		   show_measurement, store_measurement);
++#endif /* CONFIG_IWLWIFI_SPECTRUM_MEASUREMENT */
++
++static ssize_t show_rate(struct device *d,
++			 struct device_attribute *attr, char *buf)
++{
++	struct iwl_priv *priv = dev_get_drvdata(d);
++	unsigned long flags;
++	int i;
++
++	spin_lock_irqsave(&priv->sta_lock, flags);
++	if (priv->iw_mode == IEEE80211_IF_TYPE_STA)
++		i = priv->stations[IWL_AP_ID].current_rate.s.rate;
++	else
++		i = priv->stations[IWL_STA_ID].current_rate.s.rate;
++	spin_unlock_irqrestore(&priv->sta_lock, flags);
++
++	i = iwl_rate_index_from_plcp(i);
++	if (i == -1)
++		return sprintf(buf, "0\n");
++
++	return sprintf(buf, "%d%s\n",
++		       (iwl_rates[i].ieee >> 1),
++		       (iwl_rates[i].ieee & 0x1) ? ".5" : "");
++}
++
++static DEVICE_ATTR(rate, S_IRUSR, show_rate, NULL);
++
++static ssize_t store_retry_rate(struct device *d,
++				struct device_attribute *attr,
++				const char *buf, size_t count)
++{
++	struct iwl_priv *priv = dev_get_drvdata(d);
++
++	priv->retry_rate = simple_strtoul(buf, NULL, 0);
++	if (priv->retry_rate <= 0)
++		priv->retry_rate = 1;
++
++	return count;
++}
++
++static ssize_t show_retry_rate(struct device *d,
++			       struct device_attribute *attr, char *buf)
++{
++	struct iwl_priv *priv = dev_get_drvdata(d);
++	return sprintf(buf, "%d", priv->retry_rate);
++}
++
++static DEVICE_ATTR(retry_rate, S_IWUSR | S_IRUSR, show_retry_rate,
++		   store_retry_rate);
++
++static ssize_t store_power_level(struct device *d,
++				 struct device_attribute *attr,
++				 const char *buf, size_t count)
++{
++	struct iwl_priv *priv = dev_get_drvdata(d);
++	int rc;
++	int mode;
++
++	mode = simple_strtoul(buf, NULL, 0);
++	mutex_lock(&priv->mutex);
++
++	if (!iwl_is_ready(priv)) {
++		rc = -EAGAIN;
++		goto out;
++	}
++
++	if ((mode < 1) || (mode > IWL_POWER_LIMIT) || (mode == IWL_POWER_AC))
++		mode = IWL_POWER_AC;
++	else
++		mode |= IWL_POWER_ENABLED;
++
++	if (mode != priv->power_mode) {
++		rc = iwl_send_power_mode(priv, IWL_POWER_LEVEL(mode));
++		if (rc) {
++			IWL_DEBUG_MAC80211("failed setting power mode.\n");
++			goto out;
++		}
++		priv->power_mode = mode;
++	}
++
++	rc = count;
++
++ out:
++	mutex_unlock(&priv->mutex);
++	return rc;
++}
++
++#define MAX_WX_STRING 80
++
++/* Values are in microsecond */
++static const s32 timeout_duration[] = {
++	350000,
++	250000,
++	75000,
++	37000,
++	25000,
++};
++static const s32 period_duration[] = {
++	400000,
++	700000,
++	1000000,
++	1000000,
++	1000000
++};
++
++static ssize_t show_power_level(struct device *d,
++				struct device_attribute *attr, char *buf)
++{
++	struct iwl_priv *priv = dev_get_drvdata(d);
++	int level = IWL_POWER_LEVEL(priv->power_mode);
++	char *p = buf;
++
++	p += sprintf(p, "%d ", level);
++	switch (level) {
++	case IWL_POWER_MODE_CAM:
++	case IWL_POWER_AC:
++		p += sprintf(p, "(AC)");
++		break;
++	case IWL_POWER_BATTERY:
++		p += sprintf(p, "(BATTERY)");
++		break;
++	default:
++		p += sprintf(p,
++			     "(Timeout %dms, Period %dms)",
++			     timeout_duration[level - 1] / 1000,
++			     period_duration[level - 1] / 1000);
++	}
++
++	if (!(priv->power_mode & IWL_POWER_ENABLED))
++		p += sprintf(p, " OFF\n");
++	else
++		p += sprintf(p, " \n");
++
++	return (p - buf + 1);
++
++}
++
++static DEVICE_ATTR(power_level, S_IWUSR | S_IRUSR, show_power_level,
++		   store_power_level);
++
++static ssize_t show_channels(struct device *d,
++			     struct device_attribute *attr, char *buf)
++{
++	struct iwl_priv *priv = dev_get_drvdata(d);
++	int len = 0, i;
++	struct ieee80211_channel *channels = NULL;
++	const struct ieee80211_hw_mode *hw_mode = NULL;
++	int count = 0;
++
++	if (!iwl_is_ready(priv))
++		return -EAGAIN;
++
++	hw_mode = iwl_get_hw_mode(priv, MODE_IEEE80211G);
++	if (!hw_mode)
++		hw_mode = iwl_get_hw_mode(priv, MODE_IEEE80211B);
++	if (hw_mode) {
++		channels = hw_mode->channels;
++		count = hw_mode->num_channels;
++	}
++
++	len +=
++	    sprintf(&buf[len],
++		    "Displaying %d channels in 2.4GHz band "
++		    "(802.11bg):\n", count);
++
++	for (i = 0; i < count; i++)
++		len += sprintf(&buf[len], "%d: %ddBm: BSS%s%s, %s.\n",
++			       channels[i].chan,
++			       channels[i].power_level,
++			       channels[i].
++			       flag & IEEE80211_CHAN_W_RADAR_DETECT ?
++			       " (IEEE 802.11h required)" : "",
++			       (!(channels[i].flag & IEEE80211_CHAN_W_IBSS)
++				|| (channels[i].
++				    flag &
++				    IEEE80211_CHAN_W_RADAR_DETECT)) ? "" :
++			       ", IBSS",
++			       channels[i].
++			       flag & IEEE80211_CHAN_W_ACTIVE_SCAN ?
++			       "active/passive" : "passive only");
++
++	hw_mode = iwl_get_hw_mode(priv, MODE_IEEE80211A);
++	if (hw_mode) {
++		channels = hw_mode->channels;
++		count = hw_mode->num_channels;
++	} else {
++		channels = NULL;
++		count = 0;
++	}
++
++	len += sprintf(&buf[len], "Displaying %d channels in 5.2GHz band "
++		       "(802.11a):\n", count);
++
++	for (i = 0; i < count; i++)
++		len += sprintf(&buf[len], "%d: %ddBm: BSS%s%s, %s.\n",
++			       channels[i].chan,
++			       channels[i].power_level,
++			       channels[i].
++			       flag & IEEE80211_CHAN_W_RADAR_DETECT ?
++			       " (IEEE 802.11h required)" : "",
++			       (!(channels[i].flag & IEEE80211_CHAN_W_IBSS)
++				|| (channels[i].
++				    flag &
++				    IEEE80211_CHAN_W_RADAR_DETECT)) ? "" :
++			       ", IBSS",
++			       channels[i].
++			       flag & IEEE80211_CHAN_W_ACTIVE_SCAN ?
++			       "active/passive" : "passive only");
++
++	return len;
++}
++
++static DEVICE_ATTR(channels, S_IRUSR, show_channels, NULL);
++
++static ssize_t show_statistics(struct device *d,
++			       struct device_attribute *attr, char *buf)
++{
++	struct iwl_priv *priv = dev_get_drvdata(d);
++	u32 size = sizeof(struct iwl_notif_statistics);
++	u32 len = 0, ofs = 0;
++	u8 *data = (u8 *) & priv->statistics;
++	int rc = 0;
++
++	if (!iwl_is_alive(priv))
++		return -EAGAIN;
++
++	mutex_lock(&priv->mutex);
++	rc = iwl_send_statistics_request(priv);
++	mutex_unlock(&priv->mutex);
++
++	if (rc) {
++		len = sprintf(buf,
++			      "Error sending statistics request: 0x%08X\n", rc);
++		return len;
++	}
++
++	while (size && (PAGE_SIZE - len)) {
++		hex_dump_to_buffer(data + ofs, size, 16, 1, buf + len,
++				   PAGE_SIZE - len, 1);
++		len = strlen(buf);
++		if (PAGE_SIZE - len)
++			buf[len++] = '\n';
++
++		ofs += 16;
++		size -= min(size, 16U);
++	}
++
++	return len;
++}
++
++static DEVICE_ATTR(statistics, S_IRUGO, show_statistics, NULL);
++
++static ssize_t show_antenna(struct device *d,
++			    struct device_attribute *attr, char *buf)
++{
++	struct iwl_priv *priv = dev_get_drvdata(d);
++
++	if (!iwl_is_alive(priv))
++		return -EAGAIN;
++
++	return sprintf(buf, "%d\n", priv->antenna);
++}
++
++static ssize_t store_antenna(struct device *d,
++			     struct device_attribute *attr,
++			     const char *buf, size_t count)
++{
++	int ant;
++	struct iwl_priv *priv = dev_get_drvdata(d);
++
++	if (count == 0)
++		return 0;
++
++	if (sscanf(buf, "%1i", &ant) != 1) {
++		IWL_DEBUG_INFO("not in hex or decimal form.\n");
++		return count;
++	}
++
++	if ((ant >= 0) && (ant <= 2)) {
++		IWL_DEBUG_INFO("Setting antenna select to %d.\n", ant);
++		priv->antenna = (enum iwl_antenna)ant;
++	} else
++		IWL_DEBUG_INFO("Bad antenna select value %d.\n", ant);
++
++
++	return count;
++}
++
++static DEVICE_ATTR(antenna, S_IWUSR | S_IRUGO, show_antenna, store_antenna);
++
++static ssize_t show_status(struct device *d,
++			   struct device_attribute *attr, char *buf)
++{
++	struct iwl_priv *priv = (struct iwl_priv *)d->driver_data;
++	if (!iwl_is_alive(priv))
++		return -EAGAIN;
++	return sprintf(buf, "0x%08x\n", (int)priv->status);
++}
++
++static DEVICE_ATTR(status, S_IRUGO, show_status, NULL);
++
++static ssize_t dump_error_log(struct device *d,
++			      struct device_attribute *attr,
++			      const char *buf, size_t count)
++{
++	char *p = (char *)buf;
++
++	if (p[0] == '1')
++		iwl_dump_nic_error_log((struct iwl_priv *)d->driver_data);
++
++	return strnlen(buf, count);
++}
++
++static DEVICE_ATTR(dump_errors, S_IWUSR, NULL, dump_error_log);
++
++static ssize_t dump_event_log(struct device *d,
++			      struct device_attribute *attr,
++			      const char *buf, size_t count)
++{
++	char *p = (char *)buf;
++
++	if (p[0] == '1')
++		iwl_dump_nic_event_log((struct iwl_priv *)d->driver_data);
++
++	return strnlen(buf, count);
++}
++
++static DEVICE_ATTR(dump_events, S_IWUSR, NULL, dump_event_log);
++
++/*****************************************************************************
++ *
++ * driver setup and teardown
++ *
++ *****************************************************************************/
++
++static void iwl_setup_deferred_work(struct iwl_priv *priv)
++{
++	priv->workqueue = create_workqueue(DRV_NAME);
++
++	init_waitqueue_head(&priv->wait_command_queue);
++
++	INIT_WORK(&priv->up, iwl_bg_up);
++	INIT_WORK(&priv->restart, iwl_bg_restart);
++	INIT_WORK(&priv->rx_replenish, iwl_bg_rx_replenish);
++	INIT_WORK(&priv->scan_completed, iwl_bg_scan_completed);
++	INIT_WORK(&priv->request_scan, iwl_bg_request_scan);
++	INIT_WORK(&priv->abort_scan, iwl_bg_abort_scan);
++	INIT_WORK(&priv->rf_kill, iwl_bg_rf_kill);
++	INIT_WORK(&priv->beacon_update, iwl_bg_beacon_update);
++	INIT_DELAYED_WORK(&priv->post_associate, iwl_bg_post_associate);
++	INIT_DELAYED_WORK(&priv->init_alive_start, iwl_bg_init_alive_start);
++	INIT_DELAYED_WORK(&priv->alive_start, iwl_bg_alive_start);
++	INIT_DELAYED_WORK(&priv->scan_check, iwl_bg_scan_check);
++
++	iwl_hw_setup_deferred_work(priv);
++
++	tasklet_init(&priv->irq_tasklet, (void (*)(unsigned long))
++		     iwl_irq_tasklet, (unsigned long)priv);
++}
++
++static void iwl_cancel_deferred_work(struct iwl_priv *priv)
++{
++	iwl_hw_cancel_deferred_work(priv);
++
++	cancel_delayed_work(&priv->scan_check);
++	cancel_delayed_work(&priv->alive_start);
++	cancel_delayed_work(&priv->post_associate);
++	cancel_work_sync(&priv->beacon_update);
++}
++
++static struct attribute *iwl_sysfs_entries[] = {
++	&dev_attr_antenna.attr,
++	&dev_attr_channels.attr,
++	&dev_attr_dump_errors.attr,
++	&dev_attr_dump_events.attr,
++	&dev_attr_flags.attr,
++	&dev_attr_filter_flags.attr,
++#ifdef CONFIG_IWLWIFI_SPECTRUM_MEASUREMENT
++	&dev_attr_measurement.attr,
++#endif
++	&dev_attr_power_level.attr,
++	&dev_attr_rate.attr,
++	&dev_attr_retry_rate.attr,
++	&dev_attr_rf_kill.attr,
++	&dev_attr_rs_window.attr,
++	&dev_attr_statistics.attr,
++	&dev_attr_status.attr,
++	&dev_attr_temperature.attr,
++	&dev_attr_tune.attr,
++	&dev_attr_tx_power.attr,
++
++	NULL
++};
++
++static struct attribute_group iwl_attribute_group = {
++	.name = NULL,		/* put in device directory */
++	.attrs = iwl_sysfs_entries,
++};
++
++static struct ieee80211_ops iwl_hw_ops = {
++	.tx = iwl_mac_tx,
++	.open = iwl_mac_open,
++	.stop = iwl_mac_stop,
++	.add_interface = iwl_mac_add_interface,
++	.remove_interface = iwl_mac_remove_interface,
++	.config = iwl_mac_config,
++	.config_interface = iwl_mac_config_interface,
++	.set_key = iwl_mac_set_key,
++	.get_stats = iwl_mac_get_stats,
++	.get_tx_stats = iwl_mac_get_tx_stats,
++	.conf_tx = iwl_mac_conf_tx,
++	.get_tsf = iwl_mac_get_tsf,
++	.reset_tsf = iwl_mac_reset_tsf,
++	.beacon_update = iwl_mac_beacon_update,
++	.hw_scan = iwl_mac_hw_scan
++};
++
++static int iwl_pci_probe(struct pci_dev *pdev, const struct pci_device_id *ent)
++{
++	int err = 0;
++	u32 pci_id;
++	struct iwl_priv *priv;
++	struct ieee80211_hw *hw;
++	int i;
++
++	if (iwl_param_disable_hw_scan) {
++		IWL_DEBUG_INFO("Disabling hw_scan\n");
++		iwl_hw_ops.hw_scan = NULL;
++	}
++
++	if ((iwl_param_queues_num > IWL_MAX_NUM_QUEUES) ||
++	    (iwl_param_queues_num < IWL_MIN_NUM_QUEUES)) {
++		IWL_ERROR("invalid queues_num, should be between %d and %d\n",
++			  IWL_MIN_NUM_QUEUES, IWL_MAX_NUM_QUEUES);
++		err = -EINVAL;
++		goto out;
++	}
++
++	/* mac80211 allocates memory for this device instance, including
++	 *   space for this driver's private structure */
++	hw = ieee80211_alloc_hw(sizeof(struct iwl_priv), &iwl_hw_ops);
++	if (hw == NULL) {
++		IWL_ERROR("Can not allocate network device\n");
++		err = -ENOMEM;
++		goto out;
++	}
++	SET_IEEE80211_DEV(hw, &pdev->dev);
++
++	IWL_DEBUG_INFO("*** LOAD DRIVER ***\n");
++	priv = hw->priv;
++	priv->hw = hw;
++
++	priv->pci_dev = pdev;
++	priv->antenna = (enum iwl_antenna)iwl_param_antenna;
++#ifdef CONFIG_IWLWIFI_DEBUG
++	iwl_debug_level = iwl_param_debug;
++	atomic_set(&priv->restrict_refcnt, 0);
++#endif
++	priv->retry_rate = 1;
++
++	priv->ibss_beacon = NULL;
++
++	/* Tell mac80211 and its clients (e.g. Wireless Extensions)
++	 *   the range of signal quality values that we'll provide.
++	 * Negative values for level/noise indicate that we'll provide dBm.
++	 * For WE, at least, non-0 values here *enable* display of values
++	 *   in app (iwconfig). */
++	hw->max_rssi = -20;	/* signal level, negative indicates dBm */
++	hw->max_noise = -20;	/* noise level, negative indicates dBm */
++	hw->max_signal = 100;	/* link quality indication (%) */
++
++	/* Tell mac80211 our Tx characteristics */
++	hw->flags = IEEE80211_HW_WEP_INCLUDE_IV |
++	    IEEE80211_HW_HOST_GEN_BEACON_TEMPLATE;
++
++	hw->queues = 4;
++
++	spin_lock_init(&priv->lock);
++	spin_lock_init(&priv->power_data.lock);
++	spin_lock_init(&priv->sta_lock);
++	spin_lock_init(&priv->hcmd_lock);
++
++	for (i = 0; i < IWL_IBSS_MAC_HASH_SIZE; i++)
++		INIT_LIST_HEAD(&priv->ibss_mac_hash[i]);
++
++	INIT_LIST_HEAD(&priv->free_frames);
++
++	mutex_init(&priv->mutex);
++	if (pci_enable_device(pdev)) {
++		err = -ENODEV;
++		goto out_ieee80211_free_hw;
++	}
++
++	pci_set_master(pdev);
++
++	iwl_clear_stations_table(priv);
++
++	priv->data_retry_limit = -1;
++	priv->ieee_channels = NULL;
++	priv->ieee_rates = NULL;
++	priv->phymode = -1;
++
++	err = pci_set_dma_mask(pdev, DMA_32BIT_MASK);
++	if (!err)
++		err = pci_set_consistent_dma_mask(pdev, DMA_32BIT_MASK);
++	if (err) {
++		printk(KERN_WARNING DRV_NAME ": No suitable DMA available.\n");
++		goto out_pci_disable_device;
++	}
++
++	pci_set_drvdata(pdev, priv);
++	err = pci_request_regions(pdev, DRV_NAME);
++	if (err)
++		goto out_pci_disable_device;
++	/* We disable the RETRY_TIMEOUT register (0x41) to keep
++	 * PCI Tx retries from interfering with C3 CPU state */
++	pci_write_config_byte(pdev, 0x41, 0x00);
++	priv->hw_base = pci_iomap(pdev, 0, 0);
++	if (!priv->hw_base) {
++		err = -ENODEV;
++		goto out_pci_release_regions;
++	}
++
++	IWL_DEBUG_INFO("pci_resource_len = 0x%08llx\n",
++			(unsigned long long) pci_resource_len(pdev, 0));
++	IWL_DEBUG_INFO("pci_resource_base = %p\n", priv->hw_base);
++
++	/* Initialize module parameter values here */
++
++	if (iwl_param_disable) {
++		set_bit(STATUS_RF_KILL_SW, &priv->status);
++		IWL_DEBUG_INFO("Radio disabled.\n");
++	}
++
++	priv->iw_mode = IEEE80211_IF_TYPE_STA;
++
++	pci_id =
++	    (priv->pci_dev->device << 16) | priv->pci_dev->subsystem_device;
++
++	switch (pci_id) {
++	case 0x42221005:	/* 0x4222 0x8086 0x1005 is BG SKU */
++	case 0x42221034:	/* 0x4222 0x8086 0x1034 is BG SKU */
++	case 0x42271014:	/* 0x4227 0x8086 0x1014 is BG SKU */
++	case 0x42221044:	/* 0x4222 0x8086 0x1044 is BG SKU */
++		priv->is_abg = 0;
++		break;
++
++	/*
++	 * Rest are assumed ABG SKU -- if this is not the
++	 * case then the card will get the wrong 'Detected'
++	 * line in the kernel log however the code that
++	 * initializes the GEO table will detect no A-band
++	 * channels and remove the is_abg mask.
++	 */
++	default:
++		priv->is_abg = 1;
++		break;
++	}
++
++	printk(KERN_INFO DRV_NAME
++	       ": Detected Intel PRO/Wireless 3945%sBG Network Connection\n",
++	       priv->is_abg ? "A" : "");
++
++	/* Device-specific setup */
++	if (iwl_hw_set_hw_setting(priv)) {
++		IWL_ERROR("failed to set hw settings\n");
++		mutex_unlock(&priv->mutex);
++		goto out_iounmap;
++	}
++
++#ifdef CONFIG_IWLWIFI_QOS
++	if (iwl_param_qos_enable)
++		priv->qos_data.qos_enable = 1;
++
++	iwl_reset_qos(priv);
++
++	priv->qos_data.qos_active = 0;
++	priv->qos_data.qos_cap.val = 0;
++#endif /* CONFIG_IWLWIFI_QOS */
++
++	iwl_set_rxon_channel(priv, MODE_IEEE80211G, 6);
++	iwl_setup_deferred_work(priv);
++	iwl_setup_rx_handlers(priv);
++
++	priv->rates_mask = IWL_RATES_MASK;
++	/* If power management is turned on, default to AC mode */
++	priv->power_mode = IWL_POWER_AC;
++	priv->user_txpower_limit = IWL_DEFAULT_TX_POWER;
++
++	pci_enable_msi(pdev);
++
++	err = request_irq(pdev->irq, iwl_isr, IRQF_SHARED, DRV_NAME, priv);
++	if (err) {
++		IWL_ERROR("Error allocating IRQ %d\n", pdev->irq);
++		goto out_disable_msi;
++	}
++
++	mutex_lock(&priv->mutex);
++
++	err = sysfs_create_group(&pdev->dev.kobj, &iwl_attribute_group);
++	if (err) {
++		IWL_ERROR("failed to create sysfs device attributes\n");
++		mutex_unlock(&priv->mutex);
++		goto out_release_irq;
++	}
++
++	/* fetch ucode file from disk, alloc and copy to bus-master buffers ...
++	 * ucode filename and max sizes are card-specific. */
++	err = iwl_read_ucode(priv);
++	if (err) {
++		IWL_ERROR("Could not read microcode: %d\n", err);
++		mutex_unlock(&priv->mutex);
++		goto out_pci_alloc;
++	}
++
++	mutex_unlock(&priv->mutex);
++
++	IWL_DEBUG_INFO("Queing UP work.\n");
++
++	queue_work(priv->workqueue, &priv->up);
++
++	return 0;
++
++ out_pci_alloc:
++	iwl_dealloc_ucode_pci(priv);
++
++	sysfs_remove_group(&pdev->dev.kobj, &iwl_attribute_group);
++
++ out_release_irq:
++	free_irq(pdev->irq, priv);
++
++ out_disable_msi:
++	pci_disable_msi(pdev);
++	destroy_workqueue(priv->workqueue);
++	priv->workqueue = NULL;
++	iwl_unset_hw_setting(priv);
++
++ out_iounmap:
++	pci_iounmap(pdev, priv->hw_base);
++ out_pci_release_regions:
++	pci_release_regions(pdev);
++ out_pci_disable_device:
++	pci_disable_device(pdev);
++	pci_set_drvdata(pdev, NULL);
++ out_ieee80211_free_hw:
++	ieee80211_free_hw(priv->hw);
++ out:
++	return err;
++}
++
++static void iwl_pci_remove(struct pci_dev *pdev)
++{
++	struct iwl_priv *priv = pci_get_drvdata(pdev);
++	struct list_head *p, *q;
++	int i;
++
++	if (!priv)
++		return;
++
++	IWL_DEBUG_INFO("*** UNLOAD DRIVER ***\n");
++
++	mutex_lock(&priv->mutex);
++	set_bit(STATUS_EXIT_PENDING, &priv->status);
++	__iwl_down(priv);
++	mutex_unlock(&priv->mutex);
++
++	/* Free MAC hash list for ADHOC */
++	for (i = 0; i < IWL_IBSS_MAC_HASH_SIZE; i++) {
++		list_for_each_safe(p, q, &priv->ibss_mac_hash[i]) {
++			list_del(p);
++			kfree(list_entry(p, struct iwl_ibss_seq, list));
++		}
++	}
++
++	sysfs_remove_group(&pdev->dev.kobj, &iwl_attribute_group);
++
++	iwl_dealloc_ucode_pci(priv);
++
++	if (priv->rxq.bd)
++		iwl_rx_queue_free(priv, &priv->rxq);
++	iwl_hw_txq_ctx_free(priv);
++
++	iwl_unset_hw_setting(priv);
++	iwl_clear_stations_table(priv);
++
++	if (priv->mac80211_registered) {
++		ieee80211_unregister_hw(priv->hw);
++		iwl_rate_control_unregister(priv->hw);
++	}
++
++	/* ieee80211_unregister_hw calls iwl_mac_stop, which flushes
++	 * priv->workqueue... so we can't take down the workqueue
++	 * until now... */
++	destroy_workqueue(priv->workqueue);
++	priv->workqueue = NULL;
++
++	free_irq(pdev->irq, priv);
++	pci_disable_msi(pdev);
++	pci_iounmap(pdev, priv->hw_base);
++	pci_release_regions(pdev);
++	pci_disable_device(pdev);
++	pci_set_drvdata(pdev, NULL);
++
++	kfree(priv->channel_info);
++
++	kfree(priv->ieee_channels);
++	kfree(priv->ieee_rates);
++
++	if (priv->ibss_beacon)
++		dev_kfree_skb(priv->ibss_beacon);
++
++	ieee80211_free_hw(priv->hw);
++}
++
++#ifdef CONFIG_PM
++
++static int iwl_pci_suspend(struct pci_dev *pdev, pm_message_t state)
++{
++	struct iwl_priv *priv = pci_get_drvdata(pdev);
++
++	mutex_lock(&priv->mutex);
++
++	set_bit(STATUS_IN_SUSPEND, &priv->status);
++
++	/* Take down the device; powers it off, etc. */
++	__iwl_down(priv);
++
++	if (priv->mac80211_registered)
++		ieee80211_stop_queues(priv->hw);
++
++	pci_save_state(pdev);
++	pci_disable_device(pdev);
++	pci_set_power_state(pdev, PCI_D3hot);
++
++	mutex_unlock(&priv->mutex);
++
++	return 0;
++}
++
++static void iwl_resume(struct iwl_priv *priv)
++{
++	unsigned long flags;
++
++	/* The following it a temporary work around due to the
++	 * suspend / resume not fully initializing the NIC correctly.
++	 * Without all of the following, resume will not attempt to take
++	 * down the NIC (it shouldn't really need to) and will just try
++	 * and bring the NIC back up.  However that fails during the
++	 * ucode verification process.  This then causes iwl_down to be
++	 * called *after* iwl_hw_nic_init() has succeeded -- which
++	 * then lets the next init sequence succeed.  So, we've
++	 * replicated all of that NIC init code here... */
++
++	iwl_write32(priv, CSR_INT, 0xFFFFFFFF);
++
++	iwl_hw_nic_init(priv);
++
++	iwl_write32(priv, CSR_UCODE_DRV_GP1_CLR, CSR_UCODE_SW_BIT_RFKILL);
++	iwl_write32(priv, CSR_UCODE_DRV_GP1_CLR,
++		    CSR_UCODE_DRV_GP1_BIT_CMD_BLOCKED);
++	iwl_write32(priv, CSR_INT, 0xFFFFFFFF);
++	iwl_write32(priv, CSR_UCODE_DRV_GP1_CLR, CSR_UCODE_SW_BIT_RFKILL);
++	iwl_write32(priv, CSR_UCODE_DRV_GP1_CLR, CSR_UCODE_SW_BIT_RFKILL);
++
++	/* tell the device to stop sending interrupts */
++	iwl_disable_interrupts(priv);
++
++	spin_lock_irqsave(&priv->lock, flags);
++	iwl_clear_bit(priv, CSR_GP_CNTRL, CSR_GP_CNTRL_REG_FLAG_MAC_ACCESS_REQ);
++
++	if (!iwl_grab_restricted_access(priv)) {
++		iwl_write_restricted_reg(priv, APMG_CLK_DIS_REG,
++					 APMG_CLK_VAL_DMA_CLK_RQT);
++		iwl_release_restricted_access(priv);
++	}
++	spin_unlock_irqrestore(&priv->lock, flags);
++
++	udelay(5);
++
++	iwl_hw_nic_reset(priv);
++
++	/* Bring the device back up */
++	clear_bit(STATUS_IN_SUSPEND, &priv->status);
++	queue_work(priv->workqueue, &priv->up);
++}
++
++static int iwl_pci_resume(struct pci_dev *pdev)
++{
++	struct iwl_priv *priv = pci_get_drvdata(pdev);
++	int err;
++
++	printk(KERN_INFO "Coming out of suspend...\n");
++
++	mutex_lock(&priv->mutex);
++
++	pci_set_power_state(pdev, PCI_D0);
++	err = pci_enable_device(pdev);
++	pci_restore_state(pdev);
++
++	/*
++	 * Suspend/Resume resets the PCI configuration space, so we have to
++	 * re-disable the RETRY_TIMEOUT register (0x41) to keep PCI Tx retries
++	 * from interfering with C3 CPU state. pci_restore_state won't help
++	 * here since it only restores the first 64 bytes pci config header.
++	 */
++	pci_write_config_byte(pdev, 0x41, 0x00);
++
++	iwl_resume(priv);
++	mutex_unlock(&priv->mutex);
++
++	return 0;
++}
++
++#endif /* CONFIG_PM */
++
++/*****************************************************************************
++ *
++ * driver and module entry point
++ *
++ *****************************************************************************/
++
++static struct pci_driver iwl_driver = {
++	.name = DRV_NAME,
++	.id_table = iwl_hw_card_ids,
++	.probe = iwl_pci_probe,
++	.remove = __devexit_p(iwl_pci_remove),
++#ifdef CONFIG_PM
++	.suspend = iwl_pci_suspend,
++	.resume = iwl_pci_resume,
++#endif
++};
++
++static int __init iwl_init(void)
++{
++
++	int ret;
++	printk(KERN_INFO DRV_NAME ": " DRV_DESCRIPTION ", " DRV_VERSION "\n");
++	printk(KERN_INFO DRV_NAME ": " DRV_COPYRIGHT "\n");
++	ret = pci_register_driver(&iwl_driver);
++	if (ret) {
++		IWL_ERROR("Unable to initialize PCI module\n");
++		return ret;
++	}
++#ifdef CONFIG_IWLWIFI_DEBUG
++	ret = driver_create_file(&iwl_driver.driver, &driver_attr_debug_level);
++	if (ret) {
++		IWL_ERROR("Unable to create driver sysfs file\n");
++		pci_unregister_driver(&iwl_driver);
++		return ret;
++	}
++#endif
++
++	return ret;
++}
++
++static void __exit iwl_exit(void)
++{
++#ifdef CONFIG_IWLWIFI_DEBUG
++	driver_remove_file(&iwl_driver.driver, &driver_attr_debug_level);
++#endif
++	pci_unregister_driver(&iwl_driver);
++}
++
++module_param_named(antenna, iwl_param_antenna, int, 0444);
++MODULE_PARM_DESC(antenna, "select antenna (1=Main, 2=Aux, default 0 [both])");
++module_param_named(disable, iwl_param_disable, int, 0444);
++MODULE_PARM_DESC(disable, "manually disable the radio (default 0 [radio on])");
++module_param_named(hwcrypto, iwl_param_hwcrypto, int, 0444);
++MODULE_PARM_DESC(hwcrypto,
++		 "using hardware crypto engine (default 0 [software])\n");
++module_param_named(debug, iwl_param_debug, int, 0444);
++MODULE_PARM_DESC(debug, "debug output mask");
++module_param_named(disable_hw_scan, iwl_param_disable_hw_scan, int, 0444);
++MODULE_PARM_DESC(disable_hw_scan, "disable hardware scanning (default 0)");
++
++module_param_named(queues_num, iwl_param_queues_num, int, 0444);
++MODULE_PARM_DESC(queues_num, "number of hw queues.");
++
++/* QoS */
++module_param_named(qos_enable, iwl_param_qos_enable, int, 0444);
++MODULE_PARM_DESC(qos_enable, "enable all QoS functionality");
++
++module_exit(iwl_exit);
++module_init(iwl_init);
+diff --git a/drivers/net/wireless/iwl4965-base.c b/drivers/net/wireless/iwl4965-base.c
+new file mode 100644
+index 0000000..a880414
+--- /dev/null
++++ b/drivers/net/wireless/iwl4965-base.c
+@@ -0,0 +1,9323 @@
++/******************************************************************************
++ *
++ * Copyright(c) 2003 - 2007 Intel Corporation. All rights reserved.
++ *
++ * Portions of this file are derived from the ipw3945 project, as well
++ * as portions of the ieee80211 subsystem header files.
++ *
++ * This program is free software; you can redistribute it and/or modify it
++ * under the terms of version 2 of the GNU General Public License as
++ * published by the Free Software Foundation.
++ *
++ * 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.,
++ * 51 Franklin Street, Fifth Floor, Boston, MA 02110, USA
++ *
++ * The full GNU General Public License is included in this distribution in the
++ * file called LICENSE.
++ *
++ * Contact Information:
++ * James P. Ketrenos <ipw2100-admin at linux.intel.com>
++ * Intel Corporation, 5200 N.E. Elam Young Parkway, Hillsboro, OR 97124-6497
++ *
++ *****************************************************************************/
++
++/*
++ * NOTE:  This file (iwl-base.c) is used to build to multiple hardware targets
++ * by defining IWL to either 3945 or 4965.  The Makefile used when building
++ * the base targets will create base-3945.o and base-4965.o
++ *
++ * The eventual goal is to move as many of the #if IWL / #endif blocks out of
++ * this file and into the hardware specific implementation files (iwl-XXXX.c)
++ * and leave only the common (non #ifdef sprinkled) code in this file
++ */
++
++#include <linux/kernel.h>
++#include <linux/module.h>
++#include <linux/version.h>
++#include <linux/init.h>
++#include <linux/pci.h>
++#include <linux/dma-mapping.h>
++#include <linux/delay.h>
++#include <linux/skbuff.h>
++#include <linux/netdevice.h>
++#include <linux/wireless.h>
++#include <linux/firmware.h>
++#include <linux/skbuff.h>
++#include <linux/netdevice.h>
++#include <linux/etherdevice.h>
++#include <linux/if_arp.h>
++
++#include <net/ieee80211_radiotap.h>
++#include <net/mac80211.h>
++
++#include <asm/div64.h>
++
++#include "iwlwifi.h"
++#include "iwl-4965.h"
++#include "iwl-helpers.h"
++
++#ifdef CONFIG_IWLWIFI_DEBUG
++u32 iwl_debug_level;
++#endif
++
++/******************************************************************************
++ *
++ * module boiler plate
++ *
++ ******************************************************************************/
++
++/* module parameters */
++int iwl_param_disable_hw_scan;
++int iwl_param_debug;
++int iwl_param_disable;      /* def: enable radio */
++int iwl_param_antenna;      /* def: 0 = both antennas (use diversity) */
++int iwl_param_hwcrypto;     /* def: using software encryption */
++int iwl_param_qos_enable = 1;
++int iwl_param_queues_num = IWL_MAX_NUM_QUEUES;
++
++/*
++ * module name, copyright, version, etc.
++ * NOTE: DRV_NAME is defined in iwlwifi.h for use by iwl-debug.h and printk
++ */
++
++#define DRV_DESCRIPTION	"Intel(R) Wireless WiFi Link 4965AGN driver for Linux"
++
++#ifdef CONFIG_IWLWIFI_DEBUG
++#define VD "d"
++#else
++#define VD
++#endif
++
++#ifdef CONFIG_IWLWIFI_SPECTRUM_MEASUREMENT
++#define VS "s"
++#else
++#define VS
++#endif
++
++#define IWLWIFI_VERSION "0.1.15k" VD VS
++#define DRV_COPYRIGHT	"Copyright(c) 2003-2007 Intel Corporation"
++#define DRV_VERSION     IWLWIFI_VERSION
++
++/* Change firmware file name, using "-" and incrementing number,
++ *   *only* when uCode interface or architecture changes so that it
++ *   is not compatible with earlier drivers.
++ * This number will also appear in << 8 position of 1st dword of uCode file */
++#define IWL4965_UCODE_API "-1"
++
++MODULE_DESCRIPTION(DRV_DESCRIPTION);
++MODULE_VERSION(DRV_VERSION);
++MODULE_AUTHOR(DRV_COPYRIGHT);
++MODULE_LICENSE("GPL");
++
++__le16 *ieee80211_get_qos_ctrl(struct ieee80211_hdr *hdr)
++{
++	u16 fc = le16_to_cpu(hdr->frame_control);
++	int hdr_len = ieee80211_get_hdrlen(fc);
++
++	if ((fc & 0x00cc) == (IEEE80211_STYPE_QOS_DATA | IEEE80211_FTYPE_DATA))
++		return (__le16 *) ((u8 *) hdr + hdr_len - QOS_CONTROL_LEN);
++	return NULL;
++}
++
++static const struct ieee80211_hw_mode *iwl_get_hw_mode(
++		struct iwl_priv *priv, int mode)
++{
++	int i;
++
++	for (i = 0; i < 3; i++)
++		if (priv->modes[i].mode == mode)
++			return &priv->modes[i];
++
++	return NULL;
++}
++
++static int iwl_is_empty_essid(const char *essid, int essid_len)
++{
++	/* Single white space is for Linksys APs */
++	if (essid_len == 1 && essid[0] == ' ')
++		return 1;
++
++	/* Otherwise, if the entire essid is 0, we assume it is hidden */
++	while (essid_len) {
++		essid_len--;
++		if (essid[essid_len] != '\0')
++			return 0;
++	}
++
++	return 1;
++}
++
++static const char *iwl_escape_essid(const char *essid, u8 essid_len)
++{
++	static char escaped[IW_ESSID_MAX_SIZE * 2 + 1];
++	const char *s = essid;
++	char *d = escaped;
++
++	if (iwl_is_empty_essid(essid, essid_len)) {
++		memcpy(escaped, "<hidden>", sizeof("<hidden>"));
++		return escaped;
++	}
++
++	essid_len = min(essid_len, (u8) IW_ESSID_MAX_SIZE);
++	while (essid_len--) {
++		if (*s == '\0') {
++			*d++ = '\\';
++			*d++ = '0';
++			s++;
++		} else
++			*d++ = *s++;
++	}
++	*d = '\0';
++	return escaped;
++}
++
++static void iwl_print_hex_dump(int level, void *p, u32 len)
++{
++#ifdef CONFIG_IWLWIFI_DEBUG
++	if (!(iwl_debug_level & level))
++		return;
++
++	print_hex_dump(KERN_DEBUG, "iwl data: ", DUMP_PREFIX_OFFSET, 16, 1,
++			p, len, 1);
++#endif
++}
++
++/*************** DMA-QUEUE-GENERAL-FUNCTIONS  *****
++ * DMA services
++ *
++ * Theory of operation
++ *
++ * A queue is a circular buffers with 'Read' and 'Write' pointers.
++ * 2 empty entries always kept in the buffer to protect from overflow.
++ *
++ * For Tx queue, there are low mark and high mark limits. If, after queuing
++ * the packet for Tx, free space become < low mark, Tx queue stopped. When
++ * reclaiming packets (on 'tx done IRQ), if free space become > high mark,
++ * Tx queue resumed.
++ *
++ * The IPW operates with six queues, one receive queue in the device's
++ * sram, one transmit queue for sending commands to the device firmware,
++ * and four transmit queues for data.
++ ***************************************************/
++
++static int iwl_queue_space(const struct iwl_queue *q)
++{
++	int s = q->last_used - q->first_empty;
++
++	if (q->last_used > q->first_empty)
++		s -= q->n_bd;
++
++	if (s <= 0)
++		s += q->n_window;
++	/* keep some reserve to not confuse empty and full situations */
++	s -= 2;
++	if (s < 0)
++		s = 0;
++	return s;
++}
++
++/* XXX: n_bd must be power-of-two size */
++static inline int iwl_queue_inc_wrap(int index, int n_bd)
++{
++	return ++index & (n_bd - 1);
++}
++
++/* XXX: n_bd must be power-of-two size */
++static inline int iwl_queue_dec_wrap(int index, int n_bd)
++{
++	return --index & (n_bd - 1);
++}
++
++static inline int x2_queue_used(const struct iwl_queue *q, int i)
++{
++	return q->first_empty > q->last_used ?
++		(i >= q->last_used && i < q->first_empty) :
++		!(i < q->last_used && i >= q->first_empty);
++}
++
++static inline u8 get_cmd_index(struct iwl_queue *q, u32 index, int is_huge)
++{
++	if (is_huge)
++		return q->n_window;
++
++	return index & (q->n_window - 1);
++}
++
++static int iwl_queue_init(struct iwl_priv *priv, struct iwl_queue *q,
++			  int count, int slots_num, u32 id)
++{
++	q->n_bd = count;
++	q->n_window = slots_num;
++	q->id = id;
++
++	/* count must be power-of-two size, otherwise iwl_queue_inc_wrap
++	 * and iwl_queue_dec_wrap are broken. */
++	BUG_ON(!is_power_of_2(count));
++
++	/* slots_num must be power-of-two size, otherwise
++	 * get_cmd_index is broken. */
++	BUG_ON(!is_power_of_2(slots_num));
++
++	q->low_mark = q->n_window / 4;
++	if (q->low_mark < 4)
++		q->low_mark = 4;
++
++	q->high_mark = q->n_window / 8;
++	if (q->high_mark < 2)
++		q->high_mark = 2;
++
++	q->first_empty = q->last_used = 0;
++
++	return 0;
++}
++
++static int iwl_tx_queue_alloc(struct iwl_priv *priv,
++			      struct iwl_tx_queue *txq, u32 id)
++{
++	struct pci_dev *dev = priv->pci_dev;
++
++	if (id != IWL_CMD_QUEUE_NUM) {
++		txq->txb = kmalloc(sizeof(txq->txb[0]) *
++				   TFD_QUEUE_SIZE_MAX, GFP_KERNEL);
++		if (!txq->txb) {
++			IWL_ERROR("kmalloc for auxilary BD "
++				  "structures failed\n");
++			goto error;
++		}
++	} else
++		txq->txb = NULL;
++
++	txq->bd = pci_alloc_consistent(dev,
++			sizeof(txq->bd[0]) * TFD_QUEUE_SIZE_MAX,
++			&txq->q.dma_addr);
++
++	if (!txq->bd) {
++		IWL_ERROR("pci_alloc_consistent(%zd) failed\n",
++			  sizeof(txq->bd[0]) * TFD_QUEUE_SIZE_MAX);
++		goto error;
++	}
++	txq->q.id = id;
++
++	return 0;
++
++ error:
++	if (txq->txb) {
++		kfree(txq->txb);
++		txq->txb = NULL;
++	}
++
++	return -ENOMEM;
++}
++
++int iwl_tx_queue_init(struct iwl_priv *priv,
++		      struct iwl_tx_queue *txq, int slots_num, u32 txq_id)
++{
++	struct pci_dev *dev = priv->pci_dev;
++	int len;
++	int rc = 0;
++
++	/* alocate command space + one big command for scan since scan
++	 * command is very huge the system will not have two scan at the
++	 * same time */
++	len = sizeof(struct iwl_cmd) * slots_num;
++	if (txq_id == IWL_CMD_QUEUE_NUM)
++		len +=  IWL_MAX_SCAN_SIZE;
++	txq->cmd = pci_alloc_consistent(dev, len, &txq->dma_addr_cmd);
++	if (!txq->cmd)
++		return -ENOMEM;
++
++	rc = iwl_tx_queue_alloc(priv, txq, txq_id);
++	if (rc) {
++		pci_free_consistent(dev, len, txq->cmd, txq->dma_addr_cmd);
++
++		return -ENOMEM;
++	}
++	txq->need_update = 0;
++
++	/* TFD_QUEUE_SIZE_MAX must be power-of-two size, otherwise
++	 * iwl_queue_inc_wrap and iwl_queue_dec_wrap are broken. */
++	BUILD_BUG_ON(TFD_QUEUE_SIZE_MAX & (TFD_QUEUE_SIZE_MAX - 1));
++	iwl_queue_init(priv, &txq->q, TFD_QUEUE_SIZE_MAX, slots_num, txq_id);
++
++	iwl_hw_tx_queue_init(priv, txq);
++
++	return 0;
++}
++
++/**
++ * iwl_tx_queue_free - Deallocate DMA queue.
++ * @txq: Transmit queue to deallocate.
++ *
++ * Empty queue by removing and destroying all BD's.
++ * Free all buffers.  txq itself is not freed.
++ *
++ */
++void iwl_tx_queue_free(struct iwl_priv *priv, struct iwl_tx_queue *txq)
++{
++	struct iwl_queue *q = &txq->q;
++	struct pci_dev *dev = priv->pci_dev;
++	int len;
++
++	if (q->n_bd == 0)
++		return;
++
++	/* first, empty all BD's */
++	for (; q->first_empty != q->last_used;
++	     q->last_used = iwl_queue_inc_wrap(q->last_used, q->n_bd))
++		iwl_hw_txq_free_tfd(priv, txq);
++
++	len = sizeof(struct iwl_cmd) * q->n_window;
++	if (q->id == IWL_CMD_QUEUE_NUM)
++		len += IWL_MAX_SCAN_SIZE;
++
++	pci_free_consistent(dev, len, txq->cmd, txq->dma_addr_cmd);
++
++	/* free buffers belonging to queue itself */
++	if (txq->q.n_bd)
++		pci_free_consistent(dev, sizeof(struct iwl_tfd_frame) *
++				    txq->q.n_bd, txq->bd, txq->q.dma_addr);
++
++	if (txq->txb) {
++		kfree(txq->txb);
++		txq->txb = NULL;
++	}
++
++	/* 0 fill whole structure */
++	memset(txq, 0, sizeof(*txq));
++}
++
++const u8 BROADCAST_ADDR[ETH_ALEN] = { 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF };
++
++/*************** STATION TABLE MANAGEMENT ****
++ *
++ * NOTE:  This needs to be overhauled to better synchronize between
++ * how the iwl-4965.c is using iwl_hw_find_station vs. iwl-3945.c
++ *
++ * mac80211 should also be examined to determine if sta_info is duplicating
++ * the functionality provided here
++ */
++
++/**************************************************************/
++
++static u8 iwl_remove_station(struct iwl_priv *priv, const u8 *addr, int is_ap)
++{
++	int index = IWL_INVALID_STATION;
++	int i;
++	unsigned long flags;
++
++	spin_lock_irqsave(&priv->sta_lock, flags);
++
++	if (is_ap)
++		index = IWL_AP_ID;
++	else if (is_broadcast_ether_addr(addr))
++		index = priv->hw_setting.bcast_sta_id;
++	else
++		for (i = IWL_STA_ID; i < priv->hw_setting.max_stations; i++)
++			if (priv->stations[i].used &&
++			    !compare_ether_addr(priv->stations[i].sta.sta.addr,
++						addr)) {
++				index = i;
++				break;
++			}
++
++	if (unlikely(index == IWL_INVALID_STATION))
++		goto out;
++
++	if (priv->stations[index].used) {
++		priv->stations[index].used = 0;
++		priv->num_stations--;
++	}
++
++	BUG_ON(priv->num_stations < 0);
++
++out:
++	spin_unlock_irqrestore(&priv->sta_lock, flags);
++	return 0;
++}
++
++static void iwl_clear_stations_table(struct iwl_priv *priv)
++{
++	unsigned long flags;
++
++	spin_lock_irqsave(&priv->sta_lock, flags);
++
++	priv->num_stations = 0;
++	memset(priv->stations, 0, sizeof(priv->stations));
++
++	spin_unlock_irqrestore(&priv->sta_lock, flags);
++}
++
++u8 iwl_add_station(struct iwl_priv *priv, const u8 *addr, int is_ap, u8 flags)
++{
++	int i;
++	int index = IWL_INVALID_STATION;
++	struct iwl_station_entry *station;
++	unsigned long flags_spin;
++
++	spin_lock_irqsave(&priv->sta_lock, flags_spin);
++	if (is_ap)
++		index = IWL_AP_ID;
++	else if (is_broadcast_ether_addr(addr))
++		index = priv->hw_setting.bcast_sta_id;
++	else
++		for (i = IWL_STA_ID; i < priv->hw_setting.max_stations; i++) {
++			if (!compare_ether_addr(priv->stations[i].sta.sta.addr,
++						addr)) {
++				index = i;
++				break;
++			}
++
++			if (!priv->stations[i].used &&
++			    index == IWL_INVALID_STATION)
++				index = i;
++		}
++
++
++	/* These twh conditions has the same outcome but keep them separate
++	  since they have different meaning */
++	if (unlikely(index == IWL_INVALID_STATION)) {
++		spin_unlock_irqrestore(&priv->sta_lock, flags_spin);
++		return index;
++	}
++
++	if (priv->stations[index].used &&
++	    !compare_ether_addr(priv->stations[index].sta.sta.addr, addr)) {
++		spin_unlock_irqrestore(&priv->sta_lock, flags_spin);
++		return index;
++	}
++
++
++	IWL_DEBUG_ASSOC("Add STA ID %d: " MAC_FMT "\n", index, MAC_ARG(addr));
++	station = &priv->stations[index];
++	station->used = 1;
++	priv->num_stations++;
++
++	memset(&station->sta, 0, sizeof(struct iwl_addsta_cmd));
++	memcpy(station->sta.sta.addr, addr, ETH_ALEN);
++	station->sta.mode = 0;
++	station->sta.sta.sta_id = index;
++	station->sta.station_flags = 0;
++
++#ifdef CONFIG_IWLWIFI_HT
++	/* BCAST station and IBSS stations do not work in HT mode */
++	if (index != priv->hw_setting.bcast_sta_id &&
++	    priv->iw_mode != IEEE80211_IF_TYPE_IBSS)
++		iwl4965_set_ht_add_station(priv, index);
++#endif /*CONFIG_IWLWIFI_HT*/
++
++	spin_unlock_irqrestore(&priv->sta_lock, flags_spin);
++	iwl_send_add_station(priv, &station->sta, flags);
++	return index;
++
++}
++
++/*************** DRIVER STATUS FUNCTIONS   *****/
++
++static inline int iwl_is_ready(struct iwl_priv *priv)
++{
++	/* The adapter is 'ready' if READY and GEO_CONFIGURED bits are
++	 * set but EXIT_PENDING is not */
++	return test_bit(STATUS_READY, &priv->status) &&
++	       test_bit(STATUS_GEO_CONFIGURED, &priv->status) &&
++	       !test_bit(STATUS_EXIT_PENDING, &priv->status);
++}
++
++static inline int iwl_is_alive(struct iwl_priv *priv)
++{
++	return test_bit(STATUS_ALIVE, &priv->status);
++}
++
++static inline int iwl_is_init(struct iwl_priv *priv)
++{
++	return test_bit(STATUS_INIT, &priv->status);
++}
++
++static inline int iwl_is_rfkill(struct iwl_priv *priv)
++{
++	return test_bit(STATUS_RF_KILL_HW, &priv->status) ||
++	       test_bit(STATUS_RF_KILL_SW, &priv->status);
++}
++
++static inline int iwl_is_ready_rf(struct iwl_priv *priv)
++{
++
++	if (iwl_is_rfkill(priv))
++		return 0;
++
++	return iwl_is_ready(priv);
++}
++
++/*************** HOST COMMAND QUEUE FUNCTIONS   *****/
++
++#define IWL_CMD(x) case x : return #x
++
++static const char *get_cmd_string(u8 cmd)
++{
++	switch (cmd) {
++		IWL_CMD(REPLY_ALIVE);
++		IWL_CMD(REPLY_ERROR);
++		IWL_CMD(REPLY_RXON);
++		IWL_CMD(REPLY_RXON_ASSOC);
++		IWL_CMD(REPLY_QOS_PARAM);
++		IWL_CMD(REPLY_RXON_TIMING);
++		IWL_CMD(REPLY_ADD_STA);
++		IWL_CMD(REPLY_REMOVE_STA);
++		IWL_CMD(REPLY_REMOVE_ALL_STA);
++		IWL_CMD(REPLY_TX);
++		IWL_CMD(REPLY_RATE_SCALE);
++		IWL_CMD(REPLY_LEDS_CMD);
++		IWL_CMD(REPLY_TX_LINK_QUALITY_CMD);
++		IWL_CMD(RADAR_NOTIFICATION);
++		IWL_CMD(REPLY_QUIET_CMD);
++		IWL_CMD(REPLY_CHANNEL_SWITCH);
++		IWL_CMD(CHANNEL_SWITCH_NOTIFICATION);
++		IWL_CMD(REPLY_SPECTRUM_MEASUREMENT_CMD);
++		IWL_CMD(SPECTRUM_MEASURE_NOTIFICATION);
++		IWL_CMD(POWER_TABLE_CMD);
++		IWL_CMD(PM_SLEEP_NOTIFICATION);
++		IWL_CMD(PM_DEBUG_STATISTIC_NOTIFIC);
++		IWL_CMD(REPLY_SCAN_CMD);
++		IWL_CMD(REPLY_SCAN_ABORT_CMD);
++		IWL_CMD(SCAN_START_NOTIFICATION);
++		IWL_CMD(SCAN_RESULTS_NOTIFICATION);
++		IWL_CMD(SCAN_COMPLETE_NOTIFICATION);
++		IWL_CMD(BEACON_NOTIFICATION);
++		IWL_CMD(REPLY_TX_BEACON);
++		IWL_CMD(WHO_IS_AWAKE_NOTIFICATION);
++		IWL_CMD(QUIET_NOTIFICATION);
++		IWL_CMD(REPLY_TX_PWR_TABLE_CMD);
++		IWL_CMD(MEASURE_ABORT_NOTIFICATION);
++		IWL_CMD(REPLY_BT_CONFIG);
++		IWL_CMD(REPLY_STATISTICS_CMD);
++		IWL_CMD(STATISTICS_NOTIFICATION);
++		IWL_CMD(REPLY_CARD_STATE_CMD);
++		IWL_CMD(CARD_STATE_NOTIFICATION);
++		IWL_CMD(MISSED_BEACONS_NOTIFICATION);
++		IWL_CMD(REPLY_CT_KILL_CONFIG_CMD);
++		IWL_CMD(SENSITIVITY_CMD);
++		IWL_CMD(REPLY_PHY_CALIBRATION_CMD);
++		IWL_CMD(REPLY_RX_PHY_CMD);
++		IWL_CMD(REPLY_RX_MPDU_CMD);
++		IWL_CMD(REPLY_4965_RX);
++		IWL_CMD(REPLY_COMPRESSED_BA);
++	default:
++		return "UNKNOWN";
++
++	}
++}
++
++#define HOST_COMPLETE_TIMEOUT (HZ / 2)
++
++/**
++ * iwl_enqueue_hcmd - enqueue a uCode command
++ * @priv: device private data point
++ * @cmd: a point to the ucode command structure
++ *
++ * The function returns < 0 values to indicate the operation is
++ * failed. On success, it turns the index (> 0) of command in the
++ * command queue.
++ */
++static int iwl_enqueue_hcmd(struct iwl_priv *priv, struct iwl_host_cmd *cmd)
++{
++	struct iwl_tx_queue *txq = &priv->txq[IWL_CMD_QUEUE_NUM];
++	struct iwl_queue *q = &txq->q;
++	struct iwl_tfd_frame *tfd;
++	u32 *control_flags;
++	struct iwl_cmd *out_cmd;
++	u32 idx;
++	u16 fix_size = (u16)(cmd->len + sizeof(out_cmd->hdr));
++	dma_addr_t phys_addr;
++	int ret;
++	unsigned long flags;
++
++	/* If any of the command structures end up being larger than
++	 * the TFD_MAX_PAYLOAD_SIZE, and it sent as a 'small' command then
++	 * we will need to increase the size of the TFD entries */
++	BUG_ON((fix_size > TFD_MAX_PAYLOAD_SIZE) &&
++	       !(cmd->meta.flags & CMD_SIZE_HUGE));
++
++	if (iwl_queue_space(q) < ((cmd->meta.flags & CMD_ASYNC) ? 2 : 1)) {
++		IWL_ERROR("No space for Tx\n");
++		return -ENOSPC;
++	}
++
++	spin_lock_irqsave(&priv->hcmd_lock, flags);
++
++	tfd = &txq->bd[q->first_empty];
++	memset(tfd, 0, sizeof(*tfd));
++
++	control_flags = (u32 *) tfd;
++
++	idx = get_cmd_index(q, q->first_empty, cmd->meta.flags & CMD_SIZE_HUGE);
++	out_cmd = &txq->cmd[idx];
++
++	out_cmd->hdr.cmd = cmd->id;
++	memcpy(&out_cmd->meta, &cmd->meta, sizeof(cmd->meta));
++	memcpy(&out_cmd->cmd.payload, cmd->data, cmd->len);
++
++	/* At this point, the out_cmd now has all of the incoming cmd
++	 * information */
++
++	out_cmd->hdr.flags = 0;
++	out_cmd->hdr.sequence = cpu_to_le16(QUEUE_TO_SEQ(IWL_CMD_QUEUE_NUM) |
++			INDEX_TO_SEQ(q->first_empty));
++	if (out_cmd->meta.flags & CMD_SIZE_HUGE)
++		out_cmd->hdr.sequence |= cpu_to_le16(SEQ_HUGE_FRAME);
++
++	phys_addr = txq->dma_addr_cmd + sizeof(txq->cmd[0]) * idx +
++			offsetof(struct iwl_cmd, hdr);
++	iwl_hw_txq_attach_buf_to_tfd(priv, tfd, phys_addr, fix_size);
++
++	IWL_DEBUG_HC("Sending command %s (#%x), seq: 0x%04X, "
++		     "%d bytes at %d[%d]:%d\n",
++		     get_cmd_string(out_cmd->hdr.cmd),
++		     out_cmd->hdr.cmd, le16_to_cpu(out_cmd->hdr.sequence),
++		     fix_size, q->first_empty, idx, IWL_CMD_QUEUE_NUM);
++
++	txq->need_update = 1;
++	ret = iwl4965_tx_queue_update_wr_ptr(priv, txq, 0);
++	q->first_empty = iwl_queue_inc_wrap(q->first_empty, q->n_bd);
++	iwl_tx_queue_update_write_ptr(priv, txq);
++
++	spin_unlock_irqrestore(&priv->hcmd_lock, flags);
++	return ret ? ret : idx;
++}
++
++int iwl_send_cmd_async(struct iwl_priv *priv, struct iwl_host_cmd *cmd)
++{
++	int ret;
++
++	BUG_ON(!(cmd->meta.flags & CMD_ASYNC));
++
++	/* An asynchronous command can not expect an SKB to be set. */
++	BUG_ON(cmd->meta.flags & CMD_WANT_SKB);
++
++	/* An asynchronous command MUST have a callback. */
++	BUG_ON(!cmd->meta.u.callback);
++
++	if (test_bit(STATUS_EXIT_PENDING, &priv->status))
++		return -EBUSY;
++
++	ret = iwl_enqueue_hcmd(priv, cmd);
++	if (ret < 0) {
++		IWL_ERROR("Error sending %s: iwl_enqueue_hcmd failed: %d\n",
++			  get_cmd_string(cmd->id), ret);
++		return ret;
++	}
++	return 0;
++}
++
++int iwl_send_cmd_sync(struct iwl_priv *priv, struct iwl_host_cmd *cmd)
++{
++	int cmd_idx;
++	int ret;
++	static atomic_t entry = ATOMIC_INIT(0); /* reentrance protection */
++
++	BUG_ON(cmd->meta.flags & CMD_ASYNC);
++
++	 /* A synchronous command can not have a callback set. */
++	BUG_ON(cmd->meta.u.callback != NULL);
++
++	if (atomic_xchg(&entry, 1)) {
++		IWL_ERROR("Error sending %s: Already sending a host command\n",
++			  get_cmd_string(cmd->id));
++		return -EBUSY;
++	}
++
++	set_bit(STATUS_HCMD_ACTIVE, &priv->status);
++
++	if (cmd->meta.flags & CMD_WANT_SKB)
++		cmd->meta.source = &cmd->meta;
++
++	cmd_idx = iwl_enqueue_hcmd(priv, cmd);
++	if (cmd_idx < 0) {
++		ret = cmd_idx;
++		IWL_ERROR("Error sending %s: iwl_enqueue_hcmd failed: %d\n",
++			  get_cmd_string(cmd->id), ret);
++		goto out;
++	}
++
++	ret = wait_event_interruptible_timeout(priv->wait_command_queue,
++			!test_bit(STATUS_HCMD_ACTIVE, &priv->status),
++			HOST_COMPLETE_TIMEOUT);
++	if (!ret) {
++		if (test_bit(STATUS_HCMD_ACTIVE, &priv->status)) {
++			IWL_ERROR("Error sending %s: time out after %dms.\n",
++				  get_cmd_string(cmd->id),
++				  jiffies_to_msecs(HOST_COMPLETE_TIMEOUT));
++
++			clear_bit(STATUS_HCMD_ACTIVE, &priv->status);
++			ret = -ETIMEDOUT;
++			goto cancel;
++		}
++	}
++
++	if (test_bit(STATUS_RF_KILL_HW, &priv->status)) {
++		IWL_DEBUG_INFO("Command %s aborted: RF KILL Switch\n",
++			       get_cmd_string(cmd->id));
++		ret = -ECANCELED;
++		goto fail;
++	}
++	if (test_bit(STATUS_FW_ERROR, &priv->status)) {
++		IWL_DEBUG_INFO("Command %s failed: FW Error\n",
++			       get_cmd_string(cmd->id));
++		ret = -EIO;
++		goto fail;
++	}
++	if ((cmd->meta.flags & CMD_WANT_SKB) && !cmd->meta.u.skb) {
++		IWL_ERROR("Error: Response NULL in '%s'\n",
++			  get_cmd_string(cmd->id));
++		ret = -EIO;
++		goto out;
++	}
++
++	ret = 0;
++	goto out;
++
++cancel:
++	if (cmd->meta.flags & CMD_WANT_SKB) {
++		struct iwl_cmd *qcmd;
++
++		/* Cancel the CMD_WANT_SKB flag for the cmd in the
++		 * TX cmd queue. Otherwise in case the cmd comes
++		 * in later, it will possibly set an invalid
++		 * address (cmd->meta.source). */
++		qcmd = &priv->txq[IWL_CMD_QUEUE_NUM].cmd[cmd_idx];
++		qcmd->meta.flags &= ~CMD_WANT_SKB;
++	}
++fail:
++	if (cmd->meta.u.skb) {
++		dev_kfree_skb_any(cmd->meta.u.skb);
++		cmd->meta.u.skb = NULL;
++	}
++out:
++	atomic_set(&entry, 0);
++	return ret;
++}
++
++int iwl_send_cmd(struct iwl_priv *priv, struct iwl_host_cmd *cmd)
++{
++	/* A command can not be asynchronous AND expect an SKB to be set. */
++	BUG_ON((cmd->meta.flags & CMD_ASYNC) &&
++	       (cmd->meta.flags & CMD_WANT_SKB));
++
++	if (cmd->meta.flags & CMD_ASYNC)
++		return iwl_send_cmd_async(priv, cmd);
++
++	return iwl_send_cmd_sync(priv, cmd);
++}
++
++int iwl_send_cmd_pdu(struct iwl_priv *priv, u8 id, u16 len, const void *data)
++{
++	struct iwl_host_cmd cmd = {
++		.id = id,
++		.len = len,
++		.data = data,
++	};
++
++	return iwl_send_cmd_sync(priv, &cmd);
++}
++
++static int __must_check iwl_send_cmd_u32(struct iwl_priv *priv, u8 id, u32 val)
++{
++	struct iwl_host_cmd cmd = {
++		.id = id,
++		.len = sizeof(val),
++		.data = &val,
++	};
++
++	return iwl_send_cmd_sync(priv, &cmd);
++}
++
++int iwl_send_statistics_request(struct iwl_priv *priv)
++{
++	return iwl_send_cmd_u32(priv, REPLY_STATISTICS_CMD, 0);
++}
++
++/**
++ * iwl_rxon_add_station - add station into station table.
++ *
++ * there is only one AP station with id= IWL_AP_ID
++ * NOTE: mutex must be held before calling the this fnction
++*/
++static int iwl_rxon_add_station(struct iwl_priv *priv,
++				const u8 *addr, int is_ap)
++{
++	u8 rc;
++
++	/* Remove this station if it happens to already exist */
++	iwl_remove_station(priv, addr, is_ap);
++
++	rc = iwl_add_station(priv, addr, is_ap, 0);
++
++	iwl4965_add_station(priv, addr, is_ap);
++
++	return rc;
++}
++
++/**
++ * iwl_set_rxon_channel - Set the phymode and channel values in staging RXON
++ * @phymode: MODE_IEEE80211A sets to 5.2GHz; all else set to 2.4GHz
++ * @channel: Any channel valid for the requested phymode
++
++ * In addition to setting the staging RXON, priv->phymode is also set.
++ *
++ * NOTE:  Does not commit to the hardware; it sets appropriate bit fields
++ * in the staging RXON flag structure based on the phymode
++ */
++static int iwl_set_rxon_channel(struct iwl_priv *priv, u8 phymode, u16 channel)
++{
++	if (!iwl_get_channel_info(priv, phymode, channel)) {
++		IWL_DEBUG_INFO("Could not set channel to %d [%d]\n",
++			       channel, phymode);
++		return -EINVAL;
++	}
++
++	if ((le16_to_cpu(priv->staging_rxon.channel) == channel) &&
++	    (priv->phymode == phymode))
++		return 0;
++
++	priv->staging_rxon.channel = cpu_to_le16(channel);
++	if (phymode == MODE_IEEE80211A)
++		priv->staging_rxon.flags &= ~RXON_FLG_BAND_24G_MSK;
++	else
++		priv->staging_rxon.flags |= RXON_FLG_BAND_24G_MSK;
++
++	priv->phymode = phymode;
++
++	IWL_DEBUG_INFO("Staging channel set to %d [%d]\n", channel, phymode);
++
++	return 0;
++}
++
++/**
++ * iwl_check_rxon_cmd - validate RXON structure is valid
++ *
++ * NOTE:  This is really only useful during development and can eventually
++ * be #ifdef'd out once the driver is stable and folks aren't actively
++ * making changes
++ */
++static int iwl_check_rxon_cmd(struct iwl_rxon_cmd *rxon)
++{
++	int error = 0;
++	int counter = 1;
++
++	if (rxon->flags & RXON_FLG_BAND_24G_MSK) {
++		error |= le32_to_cpu(rxon->flags &
++				(RXON_FLG_TGJ_NARROW_BAND_MSK |
++				 RXON_FLG_RADAR_DETECT_MSK));
++		if (error)
++			IWL_WARNING("check 24G fields %d | %d\n",
++				    counter++, error);
++	} else {
++		error |= (rxon->flags & RXON_FLG_SHORT_SLOT_MSK) ?
++				0 : le32_to_cpu(RXON_FLG_SHORT_SLOT_MSK);
++		if (error)
++			IWL_WARNING("check 52 fields %d | %d\n",
++				    counter++, error);
++		error |= le32_to_cpu(rxon->flags & RXON_FLG_CCK_MSK);
++		if (error)
++			IWL_WARNING("check 52 CCK %d | %d\n",
++				    counter++, error);
++	}
++	error |= (rxon->node_addr[0] | rxon->bssid_addr[0]) & 0x1;
++	if (error)
++		IWL_WARNING("check mac addr %d | %d\n", counter++, error);
++
++	/* make sure basic rates 6Mbps and 1Mbps are supported */
++	error |= (((rxon->ofdm_basic_rates & IWL_RATE_6M_MASK) == 0) &&
++		  ((rxon->cck_basic_rates & IWL_RATE_1M_MASK) == 0));
++	if (error)
++		IWL_WARNING("check basic rate %d | %d\n", counter++, error);
++
++	error |= (le16_to_cpu(rxon->assoc_id) > 2007);
++	if (error)
++		IWL_WARNING("check assoc id %d | %d\n", counter++, error);
++
++	error |= ((rxon->flags & (RXON_FLG_CCK_MSK | RXON_FLG_SHORT_SLOT_MSK))
++			== (RXON_FLG_CCK_MSK | RXON_FLG_SHORT_SLOT_MSK));
++	if (error)
++		IWL_WARNING("check CCK and short slot %d | %d\n",
++			    counter++, error);
++
++	error |= ((rxon->flags & (RXON_FLG_CCK_MSK | RXON_FLG_AUTO_DETECT_MSK))
++			== (RXON_FLG_CCK_MSK | RXON_FLG_AUTO_DETECT_MSK));
++	if (error)
++		IWL_WARNING("check CCK & auto detect %d | %d\n",
++			    counter++, error);
++
++	error |= ((rxon->flags & (RXON_FLG_AUTO_DETECT_MSK |
++			RXON_FLG_TGG_PROTECT_MSK)) == RXON_FLG_TGG_PROTECT_MSK);
++	if (error)
++		IWL_WARNING("check TGG and auto detect %d | %d\n",
++			    counter++, error);
++
++	if (error)
++		IWL_WARNING("Tuning to channel %d\n",
++			    le16_to_cpu(rxon->channel));
++
++	if (error) {
++		IWL_ERROR("Not a valid iwl_rxon_assoc_cmd field values\n");
++		return -1;
++	}
++	return 0;
++}
++
++/**
++ * iwl_full_rxon_required - determine if RXON_ASSOC can be used in RXON commit
++ * @priv: staging_rxon is comapred to active_rxon
++ *
++ * If the RXON structure is changing sufficient to require a new
++ * tune or to clear and reset the RXON_FILTER_ASSOC_MSK then return 1
++ * to indicate a new tune is required.
++ */
++static int iwl_full_rxon_required(struct iwl_priv *priv)
++{
++
++	/* These items are only settable from the full RXON command */
++	if (!(priv->active_rxon.filter_flags & RXON_FILTER_ASSOC_MSK) ||
++	    compare_ether_addr(priv->staging_rxon.bssid_addr,
++			       priv->active_rxon.bssid_addr) ||
++	    compare_ether_addr(priv->staging_rxon.node_addr,
++			       priv->active_rxon.node_addr) ||
++	    compare_ether_addr(priv->staging_rxon.wlap_bssid_addr,
++			       priv->active_rxon.wlap_bssid_addr) ||
++	    (priv->staging_rxon.dev_type != priv->active_rxon.dev_type) ||
++	    (priv->staging_rxon.channel != priv->active_rxon.channel) ||
++	    (priv->staging_rxon.air_propagation !=
++	     priv->active_rxon.air_propagation) ||
++	    (priv->staging_rxon.ofdm_ht_single_stream_basic_rates !=
++	     priv->active_rxon.ofdm_ht_single_stream_basic_rates) ||
++	    (priv->staging_rxon.ofdm_ht_dual_stream_basic_rates !=
++	     priv->active_rxon.ofdm_ht_dual_stream_basic_rates) ||
++	    (priv->staging_rxon.rx_chain != priv->active_rxon.rx_chain) ||
++	    (priv->staging_rxon.assoc_id != priv->active_rxon.assoc_id))
++		return 1;
++
++	/* flags, filter_flags, ofdm_basic_rates, and cck_basic_rates can
++	 * be updated with the RXON_ASSOC command -- however only some
++	 * flag transitions are allowed using RXON_ASSOC */
++
++	/* Check if we are not switching bands */
++	if ((priv->staging_rxon.flags & RXON_FLG_BAND_24G_MSK) !=
++	    (priv->active_rxon.flags & RXON_FLG_BAND_24G_MSK))
++		return 1;
++
++	/* Check if we are switching association toggle */
++	if ((priv->staging_rxon.filter_flags & RXON_FILTER_ASSOC_MSK) !=
++		(priv->active_rxon.filter_flags & RXON_FILTER_ASSOC_MSK))
++		return 1;
++
++	return 0;
++}
++
++static int iwl_send_rxon_assoc(struct iwl_priv *priv)
++{
++	int rc = 0;
++	struct iwl_rx_packet *res = NULL;
++	struct iwl_rxon_assoc_cmd rxon_assoc;
++	struct iwl_host_cmd cmd = {
++		.id = REPLY_RXON_ASSOC,
++		.len = sizeof(rxon_assoc),
++		.meta.flags = CMD_WANT_SKB,
++		.data = &rxon_assoc,
++	};
++	const struct iwl_rxon_cmd *rxon1 = &priv->staging_rxon;
++	const struct iwl_rxon_cmd *rxon2 = &priv->active_rxon;
++
++	if ((rxon1->flags == rxon2->flags) &&
++	    (rxon1->filter_flags == rxon2->filter_flags) &&
++	    (rxon1->cck_basic_rates == rxon2->cck_basic_rates) &&
++	    (rxon1->ofdm_ht_single_stream_basic_rates ==
++	     rxon2->ofdm_ht_single_stream_basic_rates) &&
++	    (rxon1->ofdm_ht_dual_stream_basic_rates ==
++	     rxon2->ofdm_ht_dual_stream_basic_rates) &&
++	    (rxon1->rx_chain == rxon2->rx_chain) &&
++	    (rxon1->ofdm_basic_rates == rxon2->ofdm_basic_rates)) {
++		IWL_DEBUG_INFO("Using current RXON_ASSOC.  Not resending.\n");
++		return 0;
++	}
++
++	rxon_assoc.flags = priv->staging_rxon.flags;
++	rxon_assoc.filter_flags = priv->staging_rxon.filter_flags;
++	rxon_assoc.ofdm_basic_rates = priv->staging_rxon.ofdm_basic_rates;
++	rxon_assoc.cck_basic_rates = priv->staging_rxon.cck_basic_rates;
++	rxon_assoc.reserved = 0;
++	rxon_assoc.ofdm_ht_single_stream_basic_rates =
++	    priv->staging_rxon.ofdm_ht_single_stream_basic_rates;
++	rxon_assoc.ofdm_ht_dual_stream_basic_rates =
++	    priv->staging_rxon.ofdm_ht_dual_stream_basic_rates;
++	rxon_assoc.rx_chain_select_flags = priv->staging_rxon.rx_chain;
++
++	rc = iwl_send_cmd_sync(priv, &cmd);
++	if (rc)
++		return rc;
++
++	res = (struct iwl_rx_packet *)cmd.meta.u.skb->data;
++	if (res->hdr.flags & IWL_CMD_FAILED_MSK) {
++		IWL_ERROR("Bad return from REPLY_RXON_ASSOC command\n");
++		rc = -EIO;
++	}
++
++	priv->alloc_rxb_skb--;
++	dev_kfree_skb_any(cmd.meta.u.skb);
++
++	return rc;
++}
++
++/**
++ * iwl_commit_rxon - commit staging_rxon to hardware
++ *
++ * The RXON command in staging_rxon is commited to the hardware and
++ * the active_rxon structure is updated with the new data.  This
++ * function correctly transitions out of the RXON_ASSOC_MSK state if
++ * a HW tune is required based on the RXON structure changes.
++ */
++static int iwl_commit_rxon(struct iwl_priv *priv)
++{
++	/* cast away the const for active_rxon in this function */
++	struct iwl_rxon_cmd *active_rxon = (void *)&priv->active_rxon;
++	int rc = 0;
++
++	if (!iwl_is_alive(priv))
++		return -1;
++
++	/* always get timestamp with Rx frame */
++	priv->staging_rxon.flags |= RXON_FLG_TSF2HOST_MSK;
++
++	rc = iwl_check_rxon_cmd(&priv->staging_rxon);
++	if (rc) {
++		IWL_ERROR("Invalid RXON configuration.  Not committing.\n");
++		return -EINVAL;
++	}
++
++	/* If we don't need to send a full RXON, we can use
++	 * iwl_rxon_assoc_cmd which is used to reconfigure filter
++	 * and other flags for the current radio configuration. */
++	if (!iwl_full_rxon_required(priv)) {
++		rc = iwl_send_rxon_assoc(priv);
++		if (rc) {
++			IWL_ERROR("Error setting RXON_ASSOC "
++				  "configuration (%d).\n", rc);
++			return rc;
++		}
++
++		memcpy(active_rxon, &priv->staging_rxon, sizeof(*active_rxon));
++
++		return 0;
++	}
++
++	/* station table will be cleared */
++	priv->assoc_station_added = 0;
++
++#ifdef CONFIG_IWLWIFI_SENSITIVITY
++	priv->sensitivity_data.state = IWL_SENS_CALIB_NEED_REINIT;
++	if (!priv->error_recovering)
++		priv->start_calib = 0;
++
++	iwl4965_init_sensitivity(priv, CMD_ASYNC, 1);
++#endif /* CONFIG_IWLWIFI_SENSITIVITY */
++
++	/* If we are currently associated and the new config requires
++	 * an RXON_ASSOC and the new config wants the associated mask enabled,
++	 * we must clear the associated from the active configuration
++	 * before we apply the new config */
++	if (iwl_is_associated(priv) &&
++	    (priv->staging_rxon.filter_flags & RXON_FILTER_ASSOC_MSK)) {
++		IWL_DEBUG_INFO("Toggling associated bit on current RXON\n");
++		active_rxon->filter_flags &= ~RXON_FILTER_ASSOC_MSK;
++
++		rc = iwl_send_cmd_pdu(priv, REPLY_RXON,
++				      sizeof(struct iwl_rxon_cmd),
++				      &priv->active_rxon);
++
++		/* If the mask clearing failed then we set
++		 * active_rxon back to what it was previously */
++		if (rc) {
++			active_rxon->filter_flags |= RXON_FILTER_ASSOC_MSK;
++			IWL_ERROR("Error clearing ASSOC_MSK on current "
++				  "configuration (%d).\n", rc);
++			return rc;
++		}
++
++		/* The RXON bit toggling will have cleared out the
++		 * station table in the uCode, so blank it in the driver
++		 * as well */
++		iwl_clear_stations_table(priv);
++	} else if (priv->staging_rxon.filter_flags & RXON_FILTER_ASSOC_MSK) {
++		/* When switching from non-associated to associated, the
++		 * uCode clears out the station table; so clear it in the
++		 * driver as well */
++		iwl_clear_stations_table(priv);
++	}
++
++	IWL_DEBUG_INFO("Sending RXON\n"
++		       "* with%s RXON_FILTER_ASSOC_MSK\n"
++		       "* channel = %d\n"
++		       "* bssid = " MAC_FMT "\n",
++		       ((priv->staging_rxon.filter_flags &
++			 RXON_FILTER_ASSOC_MSK) ? "" : "out"),
++		       le16_to_cpu(priv->staging_rxon.channel),
++		       MAC_ARG(priv->staging_rxon.bssid_addr));
++
++	/* Apply the new configuration */
++	rc = iwl_send_cmd_pdu(priv, REPLY_RXON,
++			      sizeof(struct iwl_rxon_cmd), &priv->staging_rxon);
++	if (rc) {
++		IWL_ERROR("Error setting new configuration (%d).\n", rc);
++		return rc;
++	}
++
++#ifdef CONFIG_IWLWIFI_SENSITIVITY
++	if (!priv->error_recovering)
++		priv->start_calib = 0;
++
++	priv->sensitivity_data.state = IWL_SENS_CALIB_NEED_REINIT;
++	iwl4965_init_sensitivity(priv, CMD_ASYNC, 1);
++#endif /* CONFIG_IWLWIFI_SENSITIVITY */
++
++	memcpy(active_rxon, &priv->staging_rxon, sizeof(*active_rxon));
++
++	/* If we issue a new RXON command which required a tune then we must
++	 * send a new TXPOWER command or we won't be able to Tx any frames */
++	rc = iwl_hw_reg_send_txpower(priv);
++	if (rc) {
++		IWL_ERROR("Error setting Tx power (%d).\n", rc);
++		return rc;
++	}
++
++	/* Add the broadcast address so we can send broadcast frames */
++	if (iwl_rxon_add_station(priv, BROADCAST_ADDR, 0) ==
++	    IWL_INVALID_STATION) {
++		IWL_ERROR("Error adding BROADCAST address for transmit.\n");
++		return -EIO;
++	}
++
++	/* If we have set the ASSOC_MSK and we are in BSS mode then
++	 * add the IWL_AP_ID to the station rate table */
++	if (iwl_is_associated(priv) &&
++	    (priv->iw_mode == IEEE80211_IF_TYPE_STA)) {
++		if (iwl_rxon_add_station(priv, priv->active_rxon.bssid_addr, 1)
++		    == IWL_INVALID_STATION) {
++			IWL_ERROR("Error adding AP address for transmit.\n");
++			return -EIO;
++		}
++		priv->assoc_station_added = 1;
++	}
++
++	return 0;
++}
++
++static int iwl_send_bt_config(struct iwl_priv *priv)
++{
++	struct iwl_bt_cmd bt_cmd = {
++		.flags = 3,
++		.lead_time = 0xAA,
++		.max_kill = 1,
++		.kill_ack_mask = 0,
++		.kill_cts_mask = 0,
++	};
++
++	return iwl_send_cmd_pdu(priv, REPLY_BT_CONFIG,
++				sizeof(struct iwl_bt_cmd), &bt_cmd);
++}
++
++static int iwl_send_scan_abort(struct iwl_priv *priv)
++{
++	int rc = 0;
++	struct iwl_rx_packet *res;
++	struct iwl_host_cmd cmd = {
++		.id = REPLY_SCAN_ABORT_CMD,
++		.meta.flags = CMD_WANT_SKB,
++	};
++
++	/* If there isn't a scan actively going on in the hardware
++	 * then we are in between scan bands and not actually
++	 * actively scanning, so don't send the abort command */
++	if (!test_bit(STATUS_SCAN_HW, &priv->status)) {
++		clear_bit(STATUS_SCAN_ABORTING, &priv->status);
++		return 0;
++	}
++
++	rc = iwl_send_cmd_sync(priv, &cmd);
++	if (rc) {
++		clear_bit(STATUS_SCAN_ABORTING, &priv->status);
++		return rc;
++	}
++
++	res = (struct iwl_rx_packet *)cmd.meta.u.skb->data;
++	if (res->u.status != CAN_ABORT_STATUS) {
++		/* The scan abort will return 1 for success or
++		 * 2 for "failure".  A failure condition can be
++		 * due to simply not being in an active scan which
++		 * can occur if we send the scan abort before we
++		 * the microcode has notified us that a scan is
++		 * completed. */
++		IWL_DEBUG_INFO("SCAN_ABORT returned %d.\n", res->u.status);
++		clear_bit(STATUS_SCAN_ABORTING, &priv->status);
++		clear_bit(STATUS_SCAN_HW, &priv->status);
++	}
++
++	dev_kfree_skb_any(cmd.meta.u.skb);
++
++	return rc;
++}
++
++static int iwl_card_state_sync_callback(struct iwl_priv *priv,
++					struct iwl_cmd *cmd,
++					struct sk_buff *skb)
++{
++	return 1;
++}
++
++/*
++ * CARD_STATE_CMD
++ *
++ * Use: Sets the internal card state to enable, disable, or halt
++ *
++ * When in the 'enable' state the card operates as normal.
++ * When in the 'disable' state, the card enters into a low power mode.
++ * When in the 'halt' state, the card is shut down and must be fully
++ * restarted to come back on.
++ */
++static int iwl_send_card_state(struct iwl_priv *priv, u32 flags, u8 meta_flag)
++{
++	struct iwl_host_cmd cmd = {
++		.id = REPLY_CARD_STATE_CMD,
++		.len = sizeof(u32),
++		.data = &flags,
++		.meta.flags = meta_flag,
++	};
++
++	if (meta_flag & CMD_ASYNC)
++		cmd.meta.u.callback = iwl_card_state_sync_callback;
++
++	return iwl_send_cmd(priv, &cmd);
++}
++
++static int iwl_add_sta_sync_callback(struct iwl_priv *priv,
++				     struct iwl_cmd *cmd, struct sk_buff *skb)
++{
++	struct iwl_rx_packet *res = NULL;
++
++	if (!skb) {
++		IWL_ERROR("Error: Response NULL in REPLY_ADD_STA.\n");
++		return 1;
++	}
++
++	res = (struct iwl_rx_packet *)skb->data;
++	if (res->hdr.flags & IWL_CMD_FAILED_MSK) {
++		IWL_ERROR("Bad return from REPLY_ADD_STA (0x%08X)\n",
++			  res->hdr.flags);
++		return 1;
++	}
++
++	switch (res->u.add_sta.status) {
++	case ADD_STA_SUCCESS_MSK:
++		break;
++	default:
++		break;
++	}
++
++	/* We didn't cache the SKB; let the caller free it */
++	return 1;
++}
++
++int iwl_send_add_station(struct iwl_priv *priv,
++			 struct iwl_addsta_cmd *sta, u8 flags)
++{
++	struct iwl_rx_packet *res = NULL;
++	int rc = 0;
++	struct iwl_host_cmd cmd = {
++		.id = REPLY_ADD_STA,
++		.len = sizeof(struct iwl_addsta_cmd),
++		.meta.flags = flags,
++		.data = sta,
++	};
++
++	if (flags & CMD_ASYNC)
++		cmd.meta.u.callback = iwl_add_sta_sync_callback;
++	else
++		cmd.meta.flags |= CMD_WANT_SKB;
++
++	rc = iwl_send_cmd(priv, &cmd);
++
++	if (rc || (flags & CMD_ASYNC))
++		return rc;
++
++	res = (struct iwl_rx_packet *)cmd.meta.u.skb->data;
++	if (res->hdr.flags & IWL_CMD_FAILED_MSK) {
++		IWL_ERROR("Bad return from REPLY_ADD_STA (0x%08X)\n",
++			  res->hdr.flags);
++		rc = -EIO;
++	}
++
++	if (rc == 0) {
++		switch (res->u.add_sta.status) {
++		case ADD_STA_SUCCESS_MSK:
++			IWL_DEBUG_INFO("REPLY_ADD_STA PASSED\n");
++			break;
++		default:
++			rc = -EIO;
++			IWL_WARNING("REPLY_ADD_STA failed\n");
++			break;
++		}
++	}
++
++	priv->alloc_rxb_skb--;
++	dev_kfree_skb_any(cmd.meta.u.skb);
++
++	return rc;
++}
++
++static int iwl_update_sta_key_info(struct iwl_priv *priv,
++				   struct ieee80211_key_conf *keyconf,
++				   u8 sta_id)
++{
++	unsigned long flags;
++	__le16 key_flags = 0;
++
++	switch (keyconf->alg) {
++	case ALG_CCMP:
++		key_flags |= STA_KEY_FLG_CCMP;
++		key_flags |= cpu_to_le16(
++				keyconf->keyidx << STA_KEY_FLG_KEYID_POS);
++		key_flags &= ~STA_KEY_FLG_INVALID;
++		break;
++	case ALG_TKIP:
++	case ALG_WEP:
++		return -EINVAL;
++	default:
++		return -EINVAL;
++	}
++	spin_lock_irqsave(&priv->sta_lock, flags);
++	priv->stations[sta_id].keyinfo.alg = keyconf->alg;
++	priv->stations[sta_id].keyinfo.keylen = keyconf->keylen;
++	memcpy(priv->stations[sta_id].keyinfo.key, keyconf->key,
++	       keyconf->keylen);
++
++	memcpy(priv->stations[sta_id].sta.key.key, keyconf->key,
++	       keyconf->keylen);
++	priv->stations[sta_id].sta.key.key_flags = key_flags;
++	priv->stations[sta_id].sta.sta.modify_mask = STA_MODIFY_KEY_MASK;
++	priv->stations[sta_id].sta.mode = STA_CONTROL_MODIFY_MSK;
++
++	spin_unlock_irqrestore(&priv->sta_lock, flags);
++
++	IWL_DEBUG_INFO("hwcrypto: modify ucode station key info\n");
++	iwl_send_add_station(priv, &priv->stations[sta_id].sta, 0);
++	return 0;
++}
++
++static int iwl_clear_sta_key_info(struct iwl_priv *priv, u8 sta_id)
++{
++	unsigned long flags;
++
++	spin_lock_irqsave(&priv->sta_lock, flags);
++	memset(&priv->stations[sta_id].keyinfo, 0, sizeof(struct iwl_hw_key));
++	memset(&priv->stations[sta_id].sta.key, 0, sizeof(struct iwl_keyinfo));
++	priv->stations[sta_id].sta.key.key_flags = STA_KEY_FLG_NO_ENC;
++	priv->stations[sta_id].sta.sta.modify_mask = STA_MODIFY_KEY_MASK;
++	priv->stations[sta_id].sta.mode = STA_CONTROL_MODIFY_MSK;
++	spin_unlock_irqrestore(&priv->sta_lock, flags);
++
++	IWL_DEBUG_INFO("hwcrypto: clear ucode station key info\n");
++	iwl_send_add_station(priv, &priv->stations[sta_id].sta, 0);
++	return 0;
++}
++
++static void iwl_clear_free_frames(struct iwl_priv *priv)
++{
++	struct list_head *element;
++
++	IWL_DEBUG_INFO("%d frames on pre-allocated heap on clear.\n",
++		       priv->frames_count);
++
++	while (!list_empty(&priv->free_frames)) {
++		element = priv->free_frames.next;
++		list_del(element);
++		kfree(list_entry(element, struct iwl_frame, list));
++		priv->frames_count--;
++	}
++
++	if (priv->frames_count) {
++		IWL_WARNING("%d frames still in use.  Did we lose one?\n",
++			    priv->frames_count);
++		priv->frames_count = 0;
++	}
++}
++
++static struct iwl_frame *iwl_get_free_frame(struct iwl_priv *priv)
++{
++	struct iwl_frame *frame;
++	struct list_head *element;
++	if (list_empty(&priv->free_frames)) {
++		frame = kzalloc(sizeof(*frame), GFP_KERNEL);
++		if (!frame) {
++			IWL_ERROR("Could not allocate frame!\n");
++			return NULL;
++		}
++
++		priv->frames_count++;
++		return frame;
++	}
++
++	element = priv->free_frames.next;
++	list_del(element);
++	return list_entry(element, struct iwl_frame, list);
++}
++
++static void iwl_free_frame(struct iwl_priv *priv, struct iwl_frame *frame)
++{
++	memset(frame, 0, sizeof(*frame));
++	list_add(&frame->list, &priv->free_frames);
++}
++
++unsigned int iwl_fill_beacon_frame(struct iwl_priv *priv,
++				struct ieee80211_hdr *hdr,
++				const u8 *dest, int left)
++{
++
++	if (!iwl_is_associated(priv) || !priv->ibss_beacon ||
++	    ((priv->iw_mode != IEEE80211_IF_TYPE_IBSS) &&
++	     (priv->iw_mode != IEEE80211_IF_TYPE_AP)))
++		return 0;
++
++	if (priv->ibss_beacon->len > left)
++		return 0;
++
++	memcpy(hdr, priv->ibss_beacon->data, priv->ibss_beacon->len);
++
++	return priv->ibss_beacon->len;
++}
++
++int iwl_rate_index_from_plcp(int plcp)
++{
++	int i = 0;
++
++	if (plcp & RATE_MCS_HT_MSK) {
++		i = (plcp & 0xff);
++
++		if (i >= IWL_RATE_MIMO_6M_PLCP)
++			i = i - IWL_RATE_MIMO_6M_PLCP;
++
++		i += IWL_FIRST_OFDM_RATE;
++		/* skip 9M not supported in ht*/
++		if (i >= IWL_RATE_9M_INDEX)
++			i += 1;
++		if ((i >= IWL_FIRST_OFDM_RATE) &&
++		    (i <= IWL_LAST_OFDM_RATE))
++			return i;
++	} else {
++		for (i = 0; i < ARRAY_SIZE(iwl_rates); i++)
++			if (iwl_rates[i].plcp == (plcp &0xFF))
++				return i;
++	}
++	return -1;
++}
++
++static u8 iwl_rate_get_lowest_plcp(int rate_mask)
++{
++	u8 i;
++
++	for (i = IWL_RATE_1M_INDEX; i != IWL_RATE_INVALID;
++	     i = iwl_rates[i].next_ieee) {
++		if (rate_mask & (1 << i))
++			return iwl_rates[i].plcp;
++	}
++
++	return IWL_RATE_INVALID;
++}
++
++static int iwl_send_beacon_cmd(struct iwl_priv *priv)
++{
++	struct iwl_frame *frame;
++	unsigned int frame_size;
++	int rc;
++	u8 rate;
++
++	frame = iwl_get_free_frame(priv);
++
++	if (!frame) {
++		IWL_ERROR("Could not obtain free frame buffer for beacon "
++			  "command.\n");
++		return -ENOMEM;
++	}
++
++	if (!(priv->staging_rxon.flags & RXON_FLG_BAND_24G_MSK)) {
++		rate = iwl_rate_get_lowest_plcp(priv->active_rate_basic &
++						0xFF0);
++		if (rate == IWL_INVALID_RATE)
++			rate = IWL_RATE_6M_PLCP;
++	} else {
++		rate = iwl_rate_get_lowest_plcp(priv->active_rate_basic & 0xF);
++		if (rate == IWL_INVALID_RATE)
++			rate = IWL_RATE_1M_PLCP;
++	}
++
++	frame_size = iwl_hw_get_beacon_cmd(priv, frame, rate);
++
++	rc = iwl_send_cmd_pdu(priv, REPLY_TX_BEACON, frame_size,
++			      &frame->u.cmd[0]);
++
++	iwl_free_frame(priv, frame);
++
++	return rc;
++}
++
++/******************************************************************************
++ *
++ * EEPROM related functions
++ *
++ ******************************************************************************/
++
++static void get_eeprom_mac(struct iwl_priv *priv, u8 *mac)
++{
++	memcpy(mac, priv->eeprom.mac_address, 6);
++}
++
++/**
++ * iwl_eeprom_init - read EEPROM contents
++ *
++ * Load the EEPROM from adapter into priv->eeprom
++ *
++ * NOTE:  This routine uses the non-debug IO access functions.
++ */
++int iwl_eeprom_init(struct iwl_priv *priv)
++{
++	u16 *e = (u16 *)&priv->eeprom;
++	u32 gp = iwl_read32(priv, CSR_EEPROM_GP);
++	u32 r;
++	int sz = sizeof(priv->eeprom);
++	int rc;
++	int i;
++	u16 addr;
++
++	/* The EEPROM structure has several padding buffers within it
++	 * and when adding new EEPROM maps is subject to programmer errors
++	 * which may be very difficult to identify without explicitly
++	 * checking the resulting size of the eeprom map. */
++	BUILD_BUG_ON(sizeof(priv->eeprom) != IWL_EEPROM_IMAGE_SIZE);
++
++	if ((gp & CSR_EEPROM_GP_VALID_MSK) == CSR_EEPROM_GP_BAD_SIGNATURE) {
++		IWL_ERROR("EEPROM not found, EEPROM_GP=0x%08x", gp);
++		return -ENOENT;
++	}
++
++	rc = iwl_eeprom_aqcuire_semaphore(priv);
++	if (rc < 0) {
++		IWL_ERROR("Failed to aqcuire EEPROM semaphore.\n");
++		return -ENOENT;
++	}
++
++	/* eeprom is an array of 16bit values */
++	for (addr = 0; addr < sz; addr += sizeof(u16)) {
++		_iwl_write32(priv, CSR_EEPROM_REG, addr << 1);
++		_iwl_clear_bit(priv, CSR_EEPROM_REG, CSR_EEPROM_REG_BIT_CMD);
++
++		for (i = 0; i < IWL_EEPROM_ACCESS_TIMEOUT;
++					i += IWL_EEPROM_ACCESS_DELAY) {
++			r = _iwl_read_restricted(priv, CSR_EEPROM_REG);
++			if (r & CSR_EEPROM_REG_READ_VALID_MSK)
++				break;
++			udelay(IWL_EEPROM_ACCESS_DELAY);
++		}
++
++		if (!(r & CSR_EEPROM_REG_READ_VALID_MSK)) {
++			IWL_ERROR("Time out reading EEPROM[%d]", addr);
++			rc = -ETIMEDOUT;
++			goto done;
++		}
++		e[addr / 2] = le16_to_cpu(r >> 16);
++	}
++	rc = 0;
++
++done:
++	iwl_eeprom_release_semaphore(priv);
++	return rc;
++}
++
++/******************************************************************************
++ *
++ * Misc. internal state and helper functions
++ *
++ ******************************************************************************/
++#ifdef CONFIG_IWLWIFI_DEBUG
++
++/**
++ * iwl_report_frame - dump frame to syslog during debug sessions
++ *
++ * hack this function to show different aspects of received frames,
++ * including selective frame dumps.
++ * group100 parameter selects whether to show 1 out of 100 good frames.
++ *
++ * TODO:  ieee80211_hdr stuff is common to 3945 and 4965, so frame type
++ *        info output is okay, but some of this stuff (e.g. iwl_rx_frame_stats)
++ *        is 3945-specific and gives bad output for 4965.  Need to split the
++ *        functionality, keep common stuff here.
++ */
++void iwl_report_frame(struct iwl_priv *priv,
++		      struct iwl_rx_packet *pkt,
++		      struct ieee80211_hdr *header, int group100)
++{
++	u32 to_us;
++	u32 print_summary = 0;
++	u32 print_dump = 0;	/* set to 1 to dump all frames' contents */
++	u32 hundred = 0;
++	u32 dataframe = 0;
++	u16 fc;
++	u16 seq_ctl;
++	u16 channel;
++	u16 phy_flags;
++	int rate_sym;
++	u16 length;
++	u16 status;
++	u16 bcn_tmr;
++	u32 tsf_low;
++	u64 tsf;
++	u8 rssi;
++	u8 agc;
++	u16 sig_avg;
++	u16 noise_diff;
++	struct iwl_rx_frame_stats *rx_stats = IWL_RX_STATS(pkt);
++	struct iwl_rx_frame_hdr *rx_hdr = IWL_RX_HDR(pkt);
++	struct iwl_rx_frame_end *rx_end = IWL_RX_END(pkt);
++	u8 *data = IWL_RX_DATA(pkt);
++
++	/* MAC header */
++	fc = le16_to_cpu(header->frame_control);
++	seq_ctl = le16_to_cpu(header->seq_ctrl);
++
++	/* metadata */
++	channel = le16_to_cpu(rx_hdr->channel);
++	phy_flags = le16_to_cpu(rx_hdr->phy_flags);
++	rate_sym = rx_hdr->rate;
++	length = le16_to_cpu(rx_hdr->len);
++
++	/* end-of-frame status and timestamp */
++	status = le32_to_cpu(rx_end->status);
++	bcn_tmr = le32_to_cpu(rx_end->beacon_timestamp);
++	tsf_low = le64_to_cpu(rx_end->timestamp) & 0x0ffffffff;
++	tsf = le64_to_cpu(rx_end->timestamp);
++
++	/* signal statistics */
++	rssi = rx_stats->rssi;
++	agc = rx_stats->agc;
++	sig_avg = le16_to_cpu(rx_stats->sig_avg);
++	noise_diff = le16_to_cpu(rx_stats->noise_diff);
++
++	to_us = !compare_ether_addr(header->addr1, priv->mac_addr);
++
++	/* if data frame is to us and all is good,
++	 *   (optionally) print summary for only 1 out of every 100 */
++	if (to_us && (fc & ~IEEE80211_FCTL_PROTECTED) ==
++	    (IEEE80211_FCTL_FROMDS | IEEE80211_FTYPE_DATA)) {
++		dataframe = 1;
++		if (!group100)
++			print_summary = 1;	/* print each frame */
++		else if (priv->framecnt_to_us < 100) {
++			priv->framecnt_to_us++;
++			print_summary = 0;
++		} else {
++			priv->framecnt_to_us = 0;
++			print_summary = 1;
++			hundred = 1;
++		}
++	} else {
++		/* print summary for all other frames */
++		print_summary = 1;
++	}
++
++	if (print_summary) {
++		char *title;
++		u32 rate;
++
++		if (hundred)
++			title = "100Frames";
++		else if (fc & IEEE80211_FCTL_RETRY)
++			title = "Retry";
++		else if (ieee80211_is_assoc_response(fc))
++			title = "AscRsp";
++		else if (ieee80211_is_reassoc_response(fc))
++			title = "RasRsp";
++		else if (ieee80211_is_probe_response(fc)) {
++			title = "PrbRsp";
++			print_dump = 1;	/* dump frame contents */
++		} else if (ieee80211_is_beacon(fc)) {
++			title = "Beacon";
++			print_dump = 1;	/* dump frame contents */
++		} else if (ieee80211_is_atim(fc))
++			title = "ATIM";
++		else if (ieee80211_is_auth(fc))
++			title = "Auth";
++		else if (ieee80211_is_deauth(fc))
++			title = "DeAuth";
++		else if (ieee80211_is_disassoc(fc))
++			title = "DisAssoc";
++		else
++			title = "Frame";
++
++		rate = iwl_rate_index_from_plcp(rate_sym);
++		if (rate == -1)
++			rate = 0;
++		else
++			rate = iwl_rates[rate].ieee / 2;
++
++		/* print frame summary.
++		 * MAC addresses show just the last byte (for brevity),
++		 *    but you can hack it to show more, if you'd like to. */
++		if (dataframe)
++			IWL_DEBUG_RX("%s: mhd=0x%04x, dst=0x%02x, "
++				     "len=%u, rssi=%d, chnl=%d, rate=%u, \n",
++				     title, fc, header->addr1[5],
++				     length, rssi, channel, rate);
++		else {
++			/* src/dst addresses assume managed mode */
++			IWL_DEBUG_RX("%s: 0x%04x, dst=0x%02x, "
++				     "src=0x%02x, rssi=%u, tim=%lu usec, "
++				     "phy=0x%02x, chnl=%d\n",
++				     title, fc, header->addr1[5],
++				     header->addr3[5], rssi,
++				     tsf_low - priv->scan_start_tsf,
++				     phy_flags, channel);
++		}
++	}
++	if (print_dump)
++		iwl_print_hex_dump(IWL_DL_RX, data, length);
++}
++#endif
++
++static void iwl_unset_hw_setting(struct iwl_priv *priv)
++{
++	if (priv->hw_setting.shared_virt)
++		pci_free_consistent(priv->pci_dev,
++				    sizeof(struct iwl_shared),
++				    priv->hw_setting.shared_virt,
++				    priv->hw_setting.shared_phys);
++}
++
++/**
++ * iwl_supported_rate_to_ie - fill in the supported rate in IE field
++ *
++ * return : set the bit for each supported rate insert in ie
++ */
++static u16 iwl_supported_rate_to_ie(u8 *ie, u16 supported_rate,
++				    u16 basic_rate, int max_count)
++{
++	u16 ret_rates = 0, bit;
++	int i;
++	u8 *rates;
++
++	rates = &(ie[1]);
++
++	for (bit = 1, i = 0; i < IWL_RATE_COUNT; i++, bit <<= 1) {
++		if (bit & supported_rate) {
++			ret_rates |= bit;
++			rates[*ie] = iwl_rates[i].ieee |
++			    ((bit & basic_rate) ? 0x80 : 0x00);
++			*ie = *ie + 1;
++			if (*ie >= max_count)
++				break;
++		}
++	}
++
++	return ret_rates;
++}
++
++#ifdef CONFIG_IWLWIFI_HT
++void static iwl_set_ht_capab(struct ieee80211_hw *hw,
++			     struct ieee80211_ht_capability *ht_cap,
++			     u8 use_wide_chan);
++#endif
++
++/**
++ * iwl_fill_probe_req - fill in all required fields and IE for probe request
++ */
++static u16 iwl_fill_probe_req(struct iwl_priv *priv,
++			      struct ieee80211_mgmt *frame,
++			      int left, int is_direct)
++{
++	int len = 0;
++	u8 *pos = NULL;
++	u16 ret_rates;
++
++	/* Make sure there is enough space for the probe request,
++	 * two mandatory IEs and the data */
++	left -= 24;
++	if (left < 0)
++		return 0;
++	len += 24;
++
++	frame->frame_control = cpu_to_le16(IEEE80211_STYPE_PROBE_REQ);
++	memcpy(frame->da, BROADCAST_ADDR, ETH_ALEN);
++	memcpy(frame->sa, priv->mac_addr, ETH_ALEN);
++	memcpy(frame->bssid, BROADCAST_ADDR, ETH_ALEN);
++	frame->seq_ctrl = 0;
++
++	/* fill in our indirect SSID IE */
++	/* ...next IE... */
++
++	left -= 2;
++	if (left < 0)
++		return 0;
++	len += 2;
++	pos = &(frame->u.probe_req.variable[0]);
++	*pos++ = WLAN_EID_SSID;
++	*pos++ = 0;
++
++	/* fill in our direct SSID IE... */
++	if (is_direct) {
++		/* ...next IE... */
++		left -= 2 + priv->essid_len;
++		if (left < 0)
++			return 0;
++		/* ... fill it in... */
++		*pos++ = WLAN_EID_SSID;
++		*pos++ = priv->essid_len;
++		memcpy(pos, priv->essid, priv->essid_len);
++		pos += priv->essid_len;
++		len += 2 + priv->essid_len;
++	}
++
++	/* fill in supported rate */
++	/* ...next IE... */
++	left -= 2;
++	if (left < 0)
++		return 0;
++	/* ... fill it in... */
++	*pos++ = WLAN_EID_SUPP_RATES;
++	*pos = 0;
++	ret_rates = priv->active_rate = priv->rates_mask;
++	priv->active_rate_basic = priv->rates_mask & IWL_BASIC_RATES_MASK;
++
++	iwl_supported_rate_to_ie(pos, priv->active_rate,
++				 priv->active_rate_basic, left);
++	len += 2 + *pos;
++	pos += (*pos) + 1;
++	ret_rates = ~ret_rates & priv->active_rate;
++
++	if (ret_rates == 0)
++		goto fill_end;
++
++	/* fill in supported extended rate */
++	/* ...next IE... */
++	left -= 2;
++	if (left < 0)
++		return 0;
++	/* ... fill it in... */
++	*pos++ = WLAN_EID_EXT_SUPP_RATES;
++	*pos = 0;
++	iwl_supported_rate_to_ie(pos, ret_rates, priv->active_rate_basic, left);
++	if (*pos > 0)
++		len += 2 + *pos;
++
++#ifdef CONFIG_IWLWIFI_HT
++	if (is_direct && priv->is_ht_enabled) {
++		u8 use_wide_chan = 1;
++
++		if (priv->channel_width != IWL_CHANNEL_WIDTH_40MHZ)
++			use_wide_chan = 0;
++		pos += (*pos) + 1;
++		*pos++ = WLAN_EID_HT_CAPABILITY;
++		*pos++ = sizeof(struct ieee80211_ht_capability);
++		iwl_set_ht_capab(NULL, (struct ieee80211_ht_capability *)pos,
++				 use_wide_chan);
++		len += 2 + sizeof(struct ieee80211_ht_capability);
++	}
++#endif  /*CONFIG_IWLWIFI_HT */
++
++ fill_end:
++	return (u16)len;
++}
++
++/*
++ * QoS  support
++*/
++#ifdef CONFIG_IWLWIFI_QOS
++static int iwl_send_qos_params_command(struct iwl_priv *priv,
++				       struct iwl_qosparam_cmd *qos)
++{
++
++	return iwl_send_cmd_pdu(priv, REPLY_QOS_PARAM,
++				sizeof(struct iwl_qosparam_cmd), qos);
++}
++
++static void iwl_reset_qos(struct iwl_priv *priv)
++{
++	u16 cw_min = 15;
++	u16 cw_max = 1023;
++	u8 aifs = 2;
++	u8 is_legacy = 0;
++	unsigned long flags;
++	int i;
++
++	spin_lock_irqsave(&priv->lock, flags);
++	priv->qos_data.qos_active = 0;
++
++	if (priv->iw_mode == IEEE80211_IF_TYPE_IBSS) {
++		if (priv->qos_data.qos_enable)
++			priv->qos_data.qos_active = 1;
++		if (!(priv->active_rate & 0xfff0)) {
++			cw_min = 31;
++			is_legacy = 1;
++		}
++	} else if (priv->iw_mode == IEEE80211_IF_TYPE_AP) {
++		if (priv->qos_data.qos_enable)
++			priv->qos_data.qos_active = 1;
++	} else if (!(priv->staging_rxon.flags & RXON_FLG_SHORT_SLOT_MSK)) {
++		cw_min = 31;
++		is_legacy = 1;
++	}
++
++	if (priv->qos_data.qos_active)
++		aifs = 3;
++
++	priv->qos_data.def_qos_parm.ac[0].cw_min = cpu_to_le16(cw_min);
++	priv->qos_data.def_qos_parm.ac[0].cw_max = cpu_to_le16(cw_max);
++	priv->qos_data.def_qos_parm.ac[0].aifsn = aifs;
++	priv->qos_data.def_qos_parm.ac[0].edca_txop = 0;
++	priv->qos_data.def_qos_parm.ac[0].reserved1 = 0;
++
++	if (priv->qos_data.qos_active) {
++		i = 1;
++		priv->qos_data.def_qos_parm.ac[i].cw_min = cpu_to_le16(cw_min);
++		priv->qos_data.def_qos_parm.ac[i].cw_max = cpu_to_le16(cw_max);
++		priv->qos_data.def_qos_parm.ac[i].aifsn = 7;
++		priv->qos_data.def_qos_parm.ac[i].edca_txop = 0;
++		priv->qos_data.def_qos_parm.ac[i].reserved1 = 0;
++
++		i = 2;
++		priv->qos_data.def_qos_parm.ac[i].cw_min =
++			cpu_to_le16((cw_min + 1) / 2 - 1);
++		priv->qos_data.def_qos_parm.ac[i].cw_max =
++			cpu_to_le16(cw_max);
++		priv->qos_data.def_qos_parm.ac[i].aifsn = 2;
++		if (is_legacy)
++			priv->qos_data.def_qos_parm.ac[i].edca_txop =
++				cpu_to_le16(6016);
++		else
++			priv->qos_data.def_qos_parm.ac[i].edca_txop =
++				cpu_to_le16(3008);
++		priv->qos_data.def_qos_parm.ac[i].reserved1 = 0;
++
++		i = 3;
++		priv->qos_data.def_qos_parm.ac[i].cw_min =
++			cpu_to_le16((cw_min + 1) / 4 - 1);
++		priv->qos_data.def_qos_parm.ac[i].cw_max =
++			cpu_to_le16((cw_max + 1) / 2 - 1);
++		priv->qos_data.def_qos_parm.ac[i].aifsn = 2;
++		priv->qos_data.def_qos_parm.ac[i].reserved1 = 0;
++		if (is_legacy)
++			priv->qos_data.def_qos_parm.ac[i].edca_txop =
++				cpu_to_le16(3264);
++		else
++			priv->qos_data.def_qos_parm.ac[i].edca_txop =
++				cpu_to_le16(1504);
++	} else {
++		for (i = 1; i < 4; i++) {
++			priv->qos_data.def_qos_parm.ac[i].cw_min =
++				cpu_to_le16(cw_min);
++			priv->qos_data.def_qos_parm.ac[i].cw_max =
++				cpu_to_le16(cw_max);
++			priv->qos_data.def_qos_parm.ac[i].aifsn = aifs;
++			priv->qos_data.def_qos_parm.ac[i].edca_txop = 0;
++			priv->qos_data.def_qos_parm.ac[i].reserved1 = 0;
++		}
++	}
++	IWL_DEBUG_QOS("set QoS to default \n");
++
++	spin_unlock_irqrestore(&priv->lock, flags);
++}
++
++static void iwl_activate_qos(struct iwl_priv *priv, u8 force)
++{
++	unsigned long flags;
++
++	if (priv == NULL)
++		return;
++
++	if (test_bit(STATUS_EXIT_PENDING, &priv->status))
++		return;
++
++	if (!priv->qos_data.qos_enable)
++		return;
++
++	spin_lock_irqsave(&priv->lock, flags);
++	priv->qos_data.def_qos_parm.qos_flags = 0;
++
++	if (priv->qos_data.qos_cap.q_AP.queue_request &&
++	    !priv->qos_data.qos_cap.q_AP.txop_request)
++		priv->qos_data.def_qos_parm.qos_flags |=
++			QOS_PARAM_FLG_TXOP_TYPE_MSK;
++
++	if (priv->qos_data.qos_active)
++		priv->qos_data.def_qos_parm.qos_flags |=
++			QOS_PARAM_FLG_UPDATE_EDCA_MSK;
++
++	spin_unlock_irqrestore(&priv->lock, flags);
++
++	if (force || iwl_is_associated(priv)) {
++		IWL_DEBUG_QOS("send QoS cmd with Qos active %d \n",
++			      priv->qos_data.qos_active);
++
++		iwl_send_qos_params_command(priv,
++				&(priv->qos_data.def_qos_parm));
++	}
++}
++
++#endif /* CONFIG_IWLWIFI_QOS */
++/*
++ * Power management (not Tx power!) functions
++ */
++#define MSEC_TO_USEC 1024
++
++#define NOSLP __constant_cpu_to_le16(0), 0, 0
++#define SLP IWL_POWER_DRIVER_ALLOW_SLEEP_MSK, 0, 0
++#define SLP_TIMEOUT(T) __constant_cpu_to_le32((T) * MSEC_TO_USEC)
++#define SLP_VEC(X0, X1, X2, X3, X4) {__constant_cpu_to_le32(X0), \
++				     __constant_cpu_to_le32(X1), \
++				     __constant_cpu_to_le32(X2), \
++				     __constant_cpu_to_le32(X3), \
++				     __constant_cpu_to_le32(X4)}
++
++
++/* default power management (not Tx power) table values */
++/* for tim  0-10 */
++static struct iwl_power_vec_entry range_0[IWL_POWER_AC] = {
++	{{NOSLP, SLP_TIMEOUT(0), SLP_TIMEOUT(0), SLP_VEC(0, 0, 0, 0, 0)}, 0},
++	{{SLP, SLP_TIMEOUT(200), SLP_TIMEOUT(500), SLP_VEC(1, 2, 3, 4, 4)}, 0},
++	{{SLP, SLP_TIMEOUT(200), SLP_TIMEOUT(300), SLP_VEC(2, 4, 6, 7, 7)}, 0},
++	{{SLP, SLP_TIMEOUT(50), SLP_TIMEOUT(100), SLP_VEC(2, 6, 9, 9, 10)}, 0},
++	{{SLP, SLP_TIMEOUT(50), SLP_TIMEOUT(25), SLP_VEC(2, 7, 9, 9, 10)}, 1},
++	{{SLP, SLP_TIMEOUT(25), SLP_TIMEOUT(25), SLP_VEC(4, 7, 10, 10, 10)}, 1}
++};
++
++/* for tim > 10 */
++static struct iwl_power_vec_entry range_1[IWL_POWER_AC] = {
++	{{NOSLP, SLP_TIMEOUT(0), SLP_TIMEOUT(0), SLP_VEC(0, 0, 0, 0, 0)}, 0},
++	{{SLP, SLP_TIMEOUT(200), SLP_TIMEOUT(500),
++		 SLP_VEC(1, 2, 3, 4, 0xFF)}, 0},
++	{{SLP, SLP_TIMEOUT(200), SLP_TIMEOUT(300),
++		 SLP_VEC(2, 4, 6, 7, 0xFF)}, 0},
++	{{SLP, SLP_TIMEOUT(50), SLP_TIMEOUT(100),
++		 SLP_VEC(2, 6, 9, 9, 0xFF)}, 0},
++	{{SLP, SLP_TIMEOUT(50), SLP_TIMEOUT(25), SLP_VEC(2, 7, 9, 9, 0xFF)}, 0},
++	{{SLP, SLP_TIMEOUT(25), SLP_TIMEOUT(25),
++		 SLP_VEC(4, 7, 10, 10, 0xFF)}, 0}
++};
++
++int iwl_power_init_handle(struct iwl_priv *priv)
++{
++	int rc = 0, i;
++	struct iwl_power_mgr *pow_data;
++	int size = sizeof(struct iwl_power_vec_entry) * IWL_POWER_AC;
++	u16 pci_pm;
++
++	IWL_DEBUG_POWER("Initialize power \n");
++
++	pow_data = &(priv->power_data);
++
++	memset(pow_data, 0, sizeof(*pow_data));
++
++	pow_data->active_index = IWL_POWER_RANGE_0;
++	pow_data->dtim_val = 0xffff;
++
++	memcpy(&pow_data->pwr_range_0[0], &range_0[0], size);
++	memcpy(&pow_data->pwr_range_1[0], &range_1[0], size);
++
++	rc = pci_read_config_word(priv->pci_dev, PCI_LINK_CTRL, &pci_pm);
++	if (rc != 0)
++		return 0;
++	else {
++		struct iwl_powertable_cmd *cmd;
++
++		IWL_DEBUG_POWER("adjust power command flags\n");
++
++		for (i = 0; i < IWL_POWER_AC; i++) {
++			cmd = &pow_data->pwr_range_0[i].cmd;
++
++			if (pci_pm & 0x1)
++				cmd->flags &= ~IWL_POWER_PCI_PM_MSK;
++			else
++				cmd->flags |= IWL_POWER_PCI_PM_MSK;
++		}
++	}
++	return rc;
++}
++
++static int iwl_update_power_cmd(struct iwl_priv *priv,
++				struct iwl_powertable_cmd *cmd, u32 mode)
++{
++	int rc = 0, i;
++	u8 skip;
++	u32 max_sleep = 0;
++	struct iwl_power_vec_entry *range;
++	u8 period = 0;
++	struct iwl_power_mgr *pow_data;
++
++	if (mode > IWL_POWER_INDEX_5) {
++		IWL_DEBUG_POWER("Error invalid power mode \n");
++		return -1;
++	}
++	pow_data = &(priv->power_data);
++
++	if (pow_data->active_index == IWL_POWER_RANGE_0)
++		range = &pow_data->pwr_range_0[0];
++	else
++		range = &pow_data->pwr_range_1[1];
++
++	memcpy(cmd, &range[mode].cmd, sizeof(struct iwl_powertable_cmd));
++
++#ifdef IWL_MAC80211_DISABLE
++	if (priv->assoc_network != NULL) {
++		unsigned long flags;
++
++		period = priv->assoc_network->tim.tim_period;
++	}
++#endif	/*IWL_MAC80211_DISABLE */
++	skip = range[mode].no_dtim;
++
++	if (period == 0) {
++		period = 1;
++		skip = 0;
++	}
++
++	if (skip == 0) {
++		max_sleep = period;
++		cmd->flags &= ~IWL_POWER_SLEEP_OVER_DTIM_MSK;
++	} else {
++		__le32 slp_itrvl = cmd->sleep_interval[IWL_POWER_VEC_SIZE - 1];
++		max_sleep = (le32_to_cpu(slp_itrvl) / period) * period;
++		cmd->flags |= IWL_POWER_SLEEP_OVER_DTIM_MSK;
++	}
++
++	for (i = 0; i < IWL_POWER_VEC_SIZE; i++) {
++		if (le32_to_cpu(cmd->sleep_interval[i]) > max_sleep)
++			cmd->sleep_interval[i] = cpu_to_le32(max_sleep);
++	}
++
++	IWL_DEBUG_POWER("Flags value = 0x%08X\n", cmd->flags);
++	IWL_DEBUG_POWER("Tx timeout = %u\n", le32_to_cpu(cmd->tx_data_timeout));
++	IWL_DEBUG_POWER("Rx timeout = %u\n", le32_to_cpu(cmd->rx_data_timeout));
++	IWL_DEBUG_POWER("Sleep interval vector = { %d , %d , %d , %d , %d }\n",
++			le32_to_cpu(cmd->sleep_interval[0]),
++			le32_to_cpu(cmd->sleep_interval[1]),
++			le32_to_cpu(cmd->sleep_interval[2]),
++			le32_to_cpu(cmd->sleep_interval[3]),
++			le32_to_cpu(cmd->sleep_interval[4]));
++
++	return rc;
++}
++
++static int iwl_send_power_mode(struct iwl_priv *priv, u32 mode)
++{
++	u32 final_mode = mode;
++	int rc;
++	struct iwl_powertable_cmd cmd;
++
++	/* If on battery, set to 3,
++	 * if plugged into AC power, set to CAM ("continuosly aware mode"),
++	 * else user level */
++	switch (mode) {
++	case IWL_POWER_BATTERY:
++		final_mode = IWL_POWER_INDEX_3;
++		break;
++	case IWL_POWER_AC:
++		final_mode = IWL_POWER_MODE_CAM;
++		break;
++	default:
++		final_mode = mode;
++		break;
++	}
++
++	cmd.keep_alive_beacons = 0;
++
++	iwl_update_power_cmd(priv, &cmd, final_mode);
++
++	rc = iwl_send_cmd_pdu(priv, POWER_TABLE_CMD, sizeof(cmd), &cmd);
++
++	if (final_mode == IWL_POWER_MODE_CAM)
++		clear_bit(STATUS_POWER_PMI, &priv->status);
++	else
++		set_bit(STATUS_POWER_PMI, &priv->status);
++
++	return rc;
++}
++
++int iwl_is_network_packet(struct iwl_priv *priv, struct ieee80211_hdr *header)
++{
++	/* Filter incoming packets to determine if they are targeted toward
++	 * this network, discarding packets coming from ourselves */
++	switch (priv->iw_mode) {
++	case IEEE80211_IF_TYPE_IBSS: /* Header: Dest. | Source    | BSSID */
++		/* packets from our adapter are dropped (echo) */
++		if (!compare_ether_addr(header->addr2, priv->mac_addr))
++			return 0;
++		/* {broad,multi}cast packets to our IBSS go through */
++		if (is_multicast_ether_addr(header->addr1))
++			return !compare_ether_addr(header->addr3, priv->bssid);
++		/* packets to our adapter go through */
++		return !compare_ether_addr(header->addr1, priv->mac_addr);
++	case IEEE80211_IF_TYPE_STA: /* Header: Dest. | AP{BSSID} | Source */
++		/* packets from our adapter are dropped (echo) */
++		if (!compare_ether_addr(header->addr3, priv->mac_addr))
++			return 0;
++		/* {broad,multi}cast packets to our BSS go through */
++		if (is_multicast_ether_addr(header->addr1))
++			return !compare_ether_addr(header->addr2, priv->bssid);
++		/* packets to our adapter go through */
++		return !compare_ether_addr(header->addr1, priv->mac_addr);
++	}
++
++	return 1;
++}
++
++#define TX_STATUS_ENTRY(x) case TX_STATUS_FAIL_ ## x: return #x
++
++const char *iwl_get_tx_fail_reason(u32 status)
++{
++	switch (status & TX_STATUS_MSK) {
++	case TX_STATUS_SUCCESS:
++		return "SUCCESS";
++		TX_STATUS_ENTRY(SHORT_LIMIT);
++		TX_STATUS_ENTRY(LONG_LIMIT);
++		TX_STATUS_ENTRY(FIFO_UNDERRUN);
++		TX_STATUS_ENTRY(MGMNT_ABORT);
++		TX_STATUS_ENTRY(NEXT_FRAG);
++		TX_STATUS_ENTRY(LIFE_EXPIRE);
++		TX_STATUS_ENTRY(DEST_PS);
++		TX_STATUS_ENTRY(ABORTED);
++		TX_STATUS_ENTRY(BT_RETRY);
++		TX_STATUS_ENTRY(STA_INVALID);
++		TX_STATUS_ENTRY(FRAG_DROPPED);
++		TX_STATUS_ENTRY(TID_DISABLE);
++		TX_STATUS_ENTRY(FRAME_FLUSHED);
++		TX_STATUS_ENTRY(INSUFFICIENT_CF_POLL);
++		TX_STATUS_ENTRY(TX_LOCKED);
++		TX_STATUS_ENTRY(NO_BEACON_ON_RADAR);
++	}
++
++	return "UNKNOWN";
++}
++
++/**
++ * iwl_scan_cancel - Cancel any currently executing HW scan
++ *
++ * NOTE: priv->mutex is not required before calling this function
++ */
++static int iwl_scan_cancel(struct iwl_priv *priv)
++{
++	if (!test_bit(STATUS_SCAN_HW, &priv->status)) {
++		clear_bit(STATUS_SCANNING, &priv->status);
++		return 0;
++	}
++
++	if (test_bit(STATUS_SCANNING, &priv->status)) {
++		if (!test_bit(STATUS_SCAN_ABORTING, &priv->status)) {
++			IWL_DEBUG_SCAN("Queuing scan abort.\n");
++			set_bit(STATUS_SCAN_ABORTING, &priv->status);
++			queue_work(priv->workqueue, &priv->abort_scan);
++
++		} else
++			IWL_DEBUG_SCAN("Scan abort already in progress.\n");
++
++		return test_bit(STATUS_SCANNING, &priv->status);
++	}
++
++	return 0;
++}
++
++/**
++ * iwl_scan_cancel_timeout - Cancel any currently executing HW scan
++ * @ms: amount of time to wait (in milliseconds) for scan to abort
++ *
++ * NOTE: priv->mutex must be held before calling this function
++ */
++static int iwl_scan_cancel_timeout(struct iwl_priv *priv, unsigned long ms)
++{
++	unsigned long now = jiffies;
++	int ret;
++
++	ret = iwl_scan_cancel(priv);
++	if (ret && ms) {
++		mutex_unlock(&priv->mutex);
++		while (!time_after(jiffies, now + msecs_to_jiffies(ms)) &&
++				test_bit(STATUS_SCANNING, &priv->status))
++			msleep(1);
++		mutex_lock(&priv->mutex);
++
++		return test_bit(STATUS_SCANNING, &priv->status);
++	}
++
++	return ret;
++}
++
++static void iwl_sequence_reset(struct iwl_priv *priv)
++{
++	/* Reset ieee stats */
++
++	/* We don't reset the net_device_stats (ieee->stats) on
++	 * re-association */
++
++	priv->last_seq_num = -1;
++	priv->last_frag_num = -1;
++	priv->last_packet_time = 0;
++
++	iwl_scan_cancel(priv);
++}
++
++#define MAX_UCODE_BEACON_INTERVAL	4096
++#define INTEL_CONN_LISTEN_INTERVAL	__constant_cpu_to_le16(0xA)
++
++static __le16 iwl_adjust_beacon_interval(u16 beacon_val)
++{
++	u16 new_val = 0;
++	u16 beacon_factor = 0;
++
++	beacon_factor =
++	    (beacon_val + MAX_UCODE_BEACON_INTERVAL)
++		/ MAX_UCODE_BEACON_INTERVAL;
++	new_val = beacon_val / beacon_factor;
++
++	return cpu_to_le16(new_val);
++}
++
++static void iwl_setup_rxon_timing(struct iwl_priv *priv)
++{
++	u64 interval_tm_unit;
++	u64 tsf, result;
++	unsigned long flags;
++	struct ieee80211_conf *conf = NULL;
++	u16 beacon_int = 0;
++
++	conf = ieee80211_get_hw_conf(priv->hw);
++
++	spin_lock_irqsave(&priv->lock, flags);
++	priv->rxon_timing.timestamp.dw[1] = cpu_to_le32(priv->timestamp1);
++	priv->rxon_timing.timestamp.dw[0] = cpu_to_le32(priv->timestamp0);
++
++	priv->rxon_timing.listen_interval = INTEL_CONN_LISTEN_INTERVAL;
++
++	tsf = priv->timestamp1;
++	tsf = ((tsf << 32) | priv->timestamp0);
++
++	beacon_int = priv->beacon_int;
++	spin_unlock_irqrestore(&priv->lock, flags);
++
++	if (priv->iw_mode == IEEE80211_IF_TYPE_STA) {
++		if (beacon_int == 0) {
++			priv->rxon_timing.beacon_interval = cpu_to_le16(100);
++			priv->rxon_timing.beacon_init_val = cpu_to_le32(102400);
++		} else {
++			priv->rxon_timing.beacon_interval =
++				cpu_to_le16(beacon_int);
++			priv->rxon_timing.beacon_interval =
++			    iwl_adjust_beacon_interval(
++				le16_to_cpu(priv->rxon_timing.beacon_interval));
++		}
++
++		priv->rxon_timing.atim_window = 0;
++	} else {
++		priv->rxon_timing.beacon_interval =
++			iwl_adjust_beacon_interval(conf->beacon_int);
++		/* TODO: we need to get atim_window from upper stack
++		 * for now we set to 0 */
++		priv->rxon_timing.atim_window = 0;
++	}
++
++	interval_tm_unit =
++		(le16_to_cpu(priv->rxon_timing.beacon_interval) * 1024);
++	result = do_div(tsf, interval_tm_unit);
++	priv->rxon_timing.beacon_init_val =
++	    cpu_to_le32((u32) ((u64) interval_tm_unit - result));
++
++	IWL_DEBUG_ASSOC
++	    ("beacon interval %d beacon timer %d beacon tim %d\n",
++		le16_to_cpu(priv->rxon_timing.beacon_interval),
++		le32_to_cpu(priv->rxon_timing.beacon_init_val),
++		le16_to_cpu(priv->rxon_timing.atim_window));
++}
++
++static int iwl_scan_initiate(struct iwl_priv *priv)
++{
++	if (priv->iw_mode == IEEE80211_IF_TYPE_AP) {
++		IWL_ERROR("APs don't scan.\n");
++		return 0;
++	}
++
++	if (!iwl_is_ready_rf(priv)) {
++		IWL_DEBUG_SCAN("Aborting scan due to not ready.\n");
++		return -EIO;
++	}
++
++	if (test_bit(STATUS_SCANNING, &priv->status)) {
++		IWL_DEBUG_SCAN("Scan already in progress.\n");
++		return -EAGAIN;
++	}
++
++	if (test_bit(STATUS_SCAN_ABORTING, &priv->status)) {
++		IWL_DEBUG_SCAN("Scan request while abort pending.  "
++			       "Queuing.\n");
++		return -EAGAIN;
++	}
++
++	IWL_DEBUG_INFO("Starting scan...\n");
++	priv->scan_bands = 2;
++	set_bit(STATUS_SCANNING, &priv->status);
++	priv->scan_start = jiffies;
++	priv->scan_pass_start = priv->scan_start;
++
++	queue_work(priv->workqueue, &priv->request_scan);
++
++	return 0;
++}
++
++static int iwl_set_rxon_hwcrypto(struct iwl_priv *priv, int hw_decrypt)
++{
++	struct iwl_rxon_cmd *rxon = &priv->staging_rxon;
++
++	if (hw_decrypt)
++		rxon->filter_flags &= ~RXON_FILTER_DIS_DECRYPT_MSK;
++	else
++		rxon->filter_flags |= RXON_FILTER_DIS_DECRYPT_MSK;
++
++	return 0;
++}
++
++static void iwl_set_flags_for_phymode(struct iwl_priv *priv, u8 phymode)
++{
++	if (phymode == MODE_IEEE80211A) {
++		priv->staging_rxon.flags &=
++		    ~(RXON_FLG_BAND_24G_MSK | RXON_FLG_AUTO_DETECT_MSK
++		      | RXON_FLG_CCK_MSK);
++		priv->staging_rxon.flags |= RXON_FLG_SHORT_SLOT_MSK;
++	} else {
++		/* Copied from iwl_bg_post_associate() */
++		if (priv->assoc_capability & WLAN_CAPABILITY_SHORT_SLOT_TIME)
++			priv->staging_rxon.flags |= RXON_FLG_SHORT_SLOT_MSK;
++		else
++			priv->staging_rxon.flags &= ~RXON_FLG_SHORT_SLOT_MSK;
++
++		if (priv->iw_mode == IEEE80211_IF_TYPE_IBSS)
++			priv->staging_rxon.flags &= ~RXON_FLG_SHORT_SLOT_MSK;
++
++		priv->staging_rxon.flags |= RXON_FLG_BAND_24G_MSK;
++		priv->staging_rxon.flags |= RXON_FLG_AUTO_DETECT_MSK;
++		priv->staging_rxon.flags &= ~RXON_FLG_CCK_MSK;
++	}
++}
++
++/*
++ * initilize rxon structure with default values fromm eeprom
++ */
++static void iwl_connection_init_rx_config(struct iwl_priv *priv)
++{
++	const struct iwl_channel_info *ch_info;
++
++	memset(&priv->staging_rxon, 0, sizeof(priv->staging_rxon));
++
++	switch (priv->iw_mode) {
++	case IEEE80211_IF_TYPE_AP:
++		priv->staging_rxon.dev_type = RXON_DEV_TYPE_AP;
++		break;
++
++	case IEEE80211_IF_TYPE_STA:
++		priv->staging_rxon.dev_type = RXON_DEV_TYPE_ESS;
++		priv->staging_rxon.filter_flags = RXON_FILTER_ACCEPT_GRP_MSK;
++		break;
++
++	case IEEE80211_IF_TYPE_IBSS:
++		priv->staging_rxon.dev_type = RXON_DEV_TYPE_IBSS;
++		priv->staging_rxon.flags = RXON_FLG_SHORT_PREAMBLE_MSK;
++		priv->staging_rxon.filter_flags = RXON_FILTER_BCON_AWARE_MSK |
++						  RXON_FILTER_ACCEPT_GRP_MSK;
++		break;
++
++	case IEEE80211_IF_TYPE_MNTR:
++		priv->staging_rxon.dev_type = RXON_DEV_TYPE_SNIFFER;
++		priv->staging_rxon.filter_flags = RXON_FILTER_PROMISC_MSK |
++		    RXON_FILTER_CTL2HOST_MSK | RXON_FILTER_ACCEPT_GRP_MSK;
++		break;
++	}
++
++#if 0
++	/* TODO:  Figure out when short_preamble would be set and cache from
++	 * that */
++	if (!hw_to_local(priv->hw)->short_preamble)
++		priv->staging_rxon.flags &= ~RXON_FLG_SHORT_PREAMBLE_MSK;
++	else
++		priv->staging_rxon.flags |= RXON_FLG_SHORT_PREAMBLE_MSK;
++#endif
++
++	ch_info = iwl_get_channel_info(priv, priv->phymode,
++				       le16_to_cpu(priv->staging_rxon.channel));
++
++	if (!ch_info)
++		ch_info = &priv->channel_info[0];
++
++	/*
++	 * in some case A channels are all non IBSS
++	 * in this case force B/G channel
++	 */
++	if ((priv->iw_mode == IEEE80211_IF_TYPE_IBSS) &&
++	    !(is_channel_ibss(ch_info)))
++		ch_info = &priv->channel_info[0];
++
++	priv->staging_rxon.channel = cpu_to_le16(ch_info->channel);
++	if (is_channel_a_band(ch_info))
++		priv->phymode = MODE_IEEE80211A;
++	else
++		priv->phymode = MODE_IEEE80211G;
++
++	iwl_set_flags_for_phymode(priv, priv->phymode);
++
++	priv->staging_rxon.ofdm_basic_rates =
++	    (IWL_OFDM_RATES_MASK >> IWL_FIRST_OFDM_RATE) & 0xFF;
++	priv->staging_rxon.cck_basic_rates =
++	    (IWL_CCK_RATES_MASK >> IWL_FIRST_CCK_RATE) & 0xF;
++
++	priv->staging_rxon.flags &= ~(RXON_FLG_CHANNEL_MODE_MIXED_MSK |
++					RXON_FLG_CHANNEL_MODE_PURE_40_MSK);
++	memcpy(priv->staging_rxon.node_addr, priv->mac_addr, ETH_ALEN);
++	memcpy(priv->staging_rxon.wlap_bssid_addr, priv->mac_addr, ETH_ALEN);
++	priv->staging_rxon.ofdm_ht_single_stream_basic_rates = 0xff;
++	priv->staging_rxon.ofdm_ht_dual_stream_basic_rates = 0xff;
++	iwl4965_set_rxon_chain(priv);
++}
++
++static int iwl_set_mode(struct iwl_priv *priv, int mode)
++{
++	if (!iwl_is_ready_rf(priv))
++		return -EAGAIN;
++
++	if (mode == IEEE80211_IF_TYPE_IBSS) {
++		const struct iwl_channel_info *ch_info;
++
++		ch_info = iwl_get_channel_info(priv,
++			priv->phymode,
++			le16_to_cpu(priv->staging_rxon.channel));
++
++		if (!ch_info || !is_channel_ibss(ch_info)) {
++			IWL_ERROR("channel %d not IBSS channel\n",
++				  le16_to_cpu(priv->staging_rxon.channel));
++			return -EINVAL;
++		}
++	}
++
++	cancel_delayed_work(&priv->scan_check);
++	if (iwl_scan_cancel_timeout(priv, 100)) {
++		IWL_WARNING("Aborted scan still in progress after 100ms\n");
++		IWL_DEBUG_MAC80211("leaving - scan abort failed.\n");
++		return -EAGAIN;
++	}
++
++	priv->iw_mode = mode;
++
++	iwl_connection_init_rx_config(priv);
++	memcpy(priv->staging_rxon.node_addr, priv->mac_addr, ETH_ALEN);
++
++	iwl_clear_stations_table(priv);
++
++	iwl_commit_rxon(priv);
++
++	return 0;
++}
++
++static void iwl_build_tx_cmd_hwcrypto(struct iwl_priv *priv,
++				      struct ieee80211_tx_control *ctl,
++				      struct iwl_cmd *cmd,
++				      struct sk_buff *skb_frag,
++				      int last_frag)
++{
++	struct iwl_hw_key *keyinfo = &priv->stations[ctl->key_idx].keyinfo;
++
++	switch (keyinfo->alg) {
++	case ALG_CCMP:
++		cmd->cmd.tx.sec_ctl = TX_CMD_SEC_CCM;
++		memcpy(cmd->cmd.tx.key, keyinfo->key, keyinfo->keylen);
++		IWL_DEBUG_TX("tx_cmd with aes hwcrypto\n");
++		break;
++
++	case ALG_TKIP:
++#if 0
++		cmd->cmd.tx.sec_ctl = TX_CMD_SEC_TKIP;
++
++		if (last_frag)
++			memcpy(cmd->cmd.tx.tkip_mic.byte, skb_frag->tail - 8,
++			       8);
++		else
++			memset(cmd->cmd.tx.tkip_mic.byte, 0, 8);
++#endif
++		break;
++
++	case ALG_WEP:
++		cmd->cmd.tx.sec_ctl = TX_CMD_SEC_WEP |
++			(ctl->key_idx & TX_CMD_SEC_MSK) << TX_CMD_SEC_SHIFT;
++
++		if (keyinfo->keylen == 13)
++			cmd->cmd.tx.sec_ctl |= TX_CMD_SEC_KEY128;
++
++		memcpy(&cmd->cmd.tx.key[3], keyinfo->key, keyinfo->keylen);
++
++		IWL_DEBUG_TX("Configuring packet for WEP encryption "
++			     "with key %d\n", ctl->key_idx);
++		break;
++
++	case ALG_NONE:
++		IWL_DEBUG_TX("Tx packet in the clear (encrypt requested).\n");
++		break;
++
++	default:
++		printk(KERN_ERR "Unknown encode alg %d\n", keyinfo->alg);
++		break;
++	}
++}
++
++/*
++ * handle build REPLY_TX command notification.
++ */
++static void iwl_build_tx_cmd_basic(struct iwl_priv *priv,
++				  struct iwl_cmd *cmd,
++				  struct ieee80211_tx_control *ctrl,
++				  struct ieee80211_hdr *hdr,
++				  int is_unicast, u8 std_id)
++{
++	__le16 *qc;
++	u16 fc = le16_to_cpu(hdr->frame_control);
++	__le32 tx_flags = cmd->cmd.tx.tx_flags;
++
++	cmd->cmd.tx.stop_time.life_time = TX_CMD_LIFE_TIME_INFINITE;
++	if (!(ctrl->flags & IEEE80211_TXCTL_NO_ACK)) {
++		tx_flags |= TX_CMD_FLG_ACK_MSK;
++		if ((fc & IEEE80211_FCTL_FTYPE) == IEEE80211_FTYPE_MGMT)
++			tx_flags |= TX_CMD_FLG_SEQ_CTL_MSK;
++		if (ieee80211_is_probe_response(fc) &&
++		    !(le16_to_cpu(hdr->seq_ctrl) & 0xf))
++			tx_flags |= TX_CMD_FLG_TSF_MSK;
++	} else {
++		tx_flags &= (~TX_CMD_FLG_ACK_MSK);
++		tx_flags |= TX_CMD_FLG_SEQ_CTL_MSK;
++	}
++
++	cmd->cmd.tx.sta_id = std_id;
++	if (ieee80211_get_morefrag(hdr))
++		tx_flags |= TX_CMD_FLG_MORE_FRAG_MSK;
++
++	qc = ieee80211_get_qos_ctrl(hdr);
++	if (qc) {
++		cmd->cmd.tx.tid_tspec = (u8) (le16_to_cpu(*qc) & 0xf);
++		tx_flags &= ~TX_CMD_FLG_SEQ_CTL_MSK;
++	} else
++		tx_flags |= TX_CMD_FLG_SEQ_CTL_MSK;
++
++	if (ctrl->flags & IEEE80211_TXCTL_USE_RTS_CTS) {
++		tx_flags |= TX_CMD_FLG_RTS_MSK;
++		tx_flags &= ~TX_CMD_FLG_CTS_MSK;
++	} else if (ctrl->flags & IEEE80211_TXCTL_USE_CTS_PROTECT) {
++		tx_flags &= ~TX_CMD_FLG_RTS_MSK;
++		tx_flags |= TX_CMD_FLG_CTS_MSK;
++	}
++
++	if ((tx_flags & TX_CMD_FLG_RTS_MSK) || (tx_flags & TX_CMD_FLG_CTS_MSK))
++		tx_flags |= TX_CMD_FLG_FULL_TXOP_PROT_MSK;
++
++	tx_flags &= ~(TX_CMD_FLG_ANT_SEL_MSK);
++	if ((fc & IEEE80211_FCTL_FTYPE) == IEEE80211_FTYPE_MGMT) {
++		if ((fc & IEEE80211_FCTL_STYPE) == IEEE80211_STYPE_ASSOC_REQ ||
++		    (fc & IEEE80211_FCTL_STYPE) == IEEE80211_STYPE_REASSOC_REQ)
++			cmd->cmd.tx.timeout.pm_frame_timeout =
++				cpu_to_le16(3);
++		else
++			cmd->cmd.tx.timeout.pm_frame_timeout =
++				cpu_to_le16(2);
++	} else
++		cmd->cmd.tx.timeout.pm_frame_timeout = 0;
++
++	cmd->cmd.tx.driver_txop = 0;
++	cmd->cmd.tx.tx_flags = tx_flags;
++	cmd->cmd.tx.next_frame_len = 0;
++}
++
++static int iwl_get_sta_id(struct iwl_priv *priv, struct ieee80211_hdr *hdr)
++{
++	int sta_id;
++	u16 fc = le16_to_cpu(hdr->frame_control);
++
++	/* If this frame is broadcast or not data then use the broadcast
++	 * station id */
++	if (((fc & IEEE80211_FCTL_FTYPE) != IEEE80211_FTYPE_DATA) ||
++	    is_multicast_ether_addr(hdr->addr1))
++		return priv->hw_setting.bcast_sta_id;
++
++	switch (priv->iw_mode) {
++
++	/* If this frame is part of a BSS network (we're a station), then
++	 * we use the AP's station id */
++	case IEEE80211_IF_TYPE_STA:
++		return IWL_AP_ID;
++
++	/* If we are an AP, then find the station, or use BCAST */
++	case IEEE80211_IF_TYPE_AP:
++		sta_id = iwl_hw_find_station(priv, hdr->addr1);
++		if (sta_id != IWL_INVALID_STATION)
++			return sta_id;
++		return priv->hw_setting.bcast_sta_id;
++
++	/* If this frame is part of a IBSS network, then we use the
++	 * target specific station id */
++	case IEEE80211_IF_TYPE_IBSS:
++		sta_id = iwl_hw_find_station(priv, hdr->addr1);
++		if (sta_id != IWL_INVALID_STATION)
++			return sta_id;
++
++		sta_id = iwl_add_station(priv, hdr->addr1, 0, CMD_ASYNC);
++
++		if (sta_id != IWL_INVALID_STATION)
++			return sta_id;
++
++		IWL_DEBUG_DROP("Station " MAC_FMT " not in station map. "
++			       "Defaulting to broadcast...\n",
++			       MAC_ARG(hdr->addr1));
++		iwl_print_hex_dump(IWL_DL_DROP, (u8 *) hdr, sizeof(*hdr));
++		return priv->hw_setting.bcast_sta_id;
++
++	default:
++		IWL_WARNING("Unkown mode of operation: %d", priv->iw_mode);
++		return priv->hw_setting.bcast_sta_id;
++	}
++}
++
++/*
++ * start REPLY_TX command process
++ */
++static int iwl_tx_skb(struct iwl_priv *priv,
++		      struct sk_buff *skb, struct ieee80211_tx_control *ctl)
++{
++	struct ieee80211_hdr *hdr = (struct ieee80211_hdr *)skb->data;
++	struct iwl_tfd_frame *tfd;
++	u32 *control_flags;
++	int txq_id = ctl->queue;
++	struct iwl_tx_queue *txq = NULL;
++	struct iwl_queue *q = NULL;
++	dma_addr_t phys_addr;
++	dma_addr_t txcmd_phys;
++	struct iwl_cmd *out_cmd = NULL;
++	u16 len, idx, len_org;
++	u8 id, hdr_len, unicast;
++	u8 sta_id;
++	u16 seq_number = 0;
++	u16 fc;
++	__le16 *qc;
++	u8 wait_write_ptr = 0;
++	unsigned long flags;
++	int rc;
++
++	spin_lock_irqsave(&priv->lock, flags);
++	if (iwl_is_rfkill(priv)) {
++		IWL_DEBUG_DROP("Dropping - RF KILL\n");
++		goto drop_unlock;
++	}
++
++	if (!priv->interface_id) {
++		IWL_DEBUG_DROP("Dropping - !priv->interface_id\n");
++		goto drop_unlock;
++	}
++
++	if ((ctl->tx_rate & 0xFF) == IWL_INVALID_RATE) {
++		IWL_ERROR("ERROR: No TX rate available.\n");
++		goto drop_unlock;
++	}
++
++	unicast = !is_multicast_ether_addr(hdr->addr1);
++	id = 0;
++
++	fc = le16_to_cpu(hdr->frame_control);
++
++#ifdef CONFIG_IWLWIFI_DEBUG
++	if (ieee80211_is_auth(fc))
++		IWL_DEBUG_TX("Sending AUTH frame\n");
++	else if (ieee80211_is_assoc_request(fc))
++		IWL_DEBUG_TX("Sending ASSOC frame\n");
++	else if (ieee80211_is_reassoc_request(fc))
++		IWL_DEBUG_TX("Sending REASSOC frame\n");
++#endif
++
++	if (!iwl_is_associated(priv) &&
++	    ((fc & IEEE80211_FCTL_FTYPE) == IEEE80211_FTYPE_DATA)) {
++		IWL_DEBUG_DROP("Dropping - !iwl_is_associated\n");
++		goto drop_unlock;
++	}
++
++	spin_unlock_irqrestore(&priv->lock, flags);
++
++	hdr_len = ieee80211_get_hdrlen(fc);
++	sta_id = iwl_get_sta_id(priv, hdr);
++	if (sta_id == IWL_INVALID_STATION) {
++		IWL_DEBUG_DROP("Dropping - INVALID STATION: " MAC_FMT "\n",
++			       MAC_ARG(hdr->addr1));
++		goto drop;
++	}
++
++	IWL_DEBUG_RATE("station Id %d\n", sta_id);
++
++	qc = ieee80211_get_qos_ctrl(hdr);
++	if (qc) {
++		u8 tid = (u8)(le16_to_cpu(*qc) & 0xf);
++		seq_number = priv->stations[sta_id].tid[tid].seq_number &
++				IEEE80211_SCTL_SEQ;
++		hdr->seq_ctrl = cpu_to_le16(seq_number) |
++			(hdr->seq_ctrl &
++				__constant_cpu_to_le16(IEEE80211_SCTL_FRAG));
++		seq_number += 0x10;
++#ifdef CONFIG_IWLWIFI_HT
++#ifdef CONFIG_IWLWIFI_HT_AGG
++		/* aggregation is on for this <sta,tid> */
++		if (ctl->flags & IEEE80211_TXCTL_HT_MPDU_AGG)
++			txq_id = priv->stations[sta_id].tid[tid].agg.txq_id;
++#endif /* CONFIG_IWLWIFI_HT_AGG */
++#endif /* CONFIG_IWLWIFI_HT */
++	}
++	txq = &priv->txq[txq_id];
++	q = &txq->q;
++
++	spin_lock_irqsave(&priv->lock, flags);
++
++	tfd = &txq->bd[q->first_empty];
++	memset(tfd, 0, sizeof(*tfd));
++	control_flags = (u32 *) tfd;
++	idx = get_cmd_index(q, q->first_empty, 0);
++
++	memset(&(txq->txb[q->first_empty]), 0, sizeof(struct iwl_tx_info));
++	txq->txb[q->first_empty].skb[0] = skb;
++	memcpy(&(txq->txb[q->first_empty].status.control),
++	       ctl, sizeof(struct ieee80211_tx_control));
++	out_cmd = &txq->cmd[idx];
++	memset(&out_cmd->hdr, 0, sizeof(out_cmd->hdr));
++	memset(&out_cmd->cmd.tx, 0, sizeof(out_cmd->cmd.tx));
++	out_cmd->hdr.cmd = REPLY_TX;
++	out_cmd->hdr.sequence = cpu_to_le16((u16)(QUEUE_TO_SEQ(txq_id) |
++				INDEX_TO_SEQ(q->first_empty)));
++	/* copy frags header */
++	memcpy(out_cmd->cmd.tx.hdr, hdr, hdr_len);
++
++	/* hdr = (struct ieee80211_hdr *)out_cmd->cmd.tx.hdr; */
++	len = priv->hw_setting.tx_cmd_len +
++		sizeof(struct iwl_cmd_header) + hdr_len;
++
++	len_org = len;
++	len = (len + 3) & ~3;
++
++	if (len_org != len)
++		len_org = 1;
++	else
++		len_org = 0;
++
++	txcmd_phys = txq->dma_addr_cmd + sizeof(struct iwl_cmd) * idx +
++		     offsetof(struct iwl_cmd, hdr);
++
++	iwl_hw_txq_attach_buf_to_tfd(priv, tfd, txcmd_phys, len);
++
++	if (ctl->key_idx != -1)
++		iwl_build_tx_cmd_hwcrypto(priv, ctl, out_cmd, skb, 0);
++
++	/* 802.11 null functions have no payload... */
++	len = skb->len - hdr_len;
++	if (len) {
++		phys_addr = pci_map_single(priv->pci_dev, skb->data + hdr_len,
++					   len, PCI_DMA_TODEVICE);
++		iwl_hw_txq_attach_buf_to_tfd(priv, tfd, phys_addr, len);
++	}
++
++	if (len_org)
++		out_cmd->cmd.tx.tx_flags |= TX_CMD_FLG_MH_PAD_MSK;
++
++	len = (u16)skb->len;
++	out_cmd->cmd.tx.len = cpu_to_le16(len);
++
++	/* TODO need this for burst mode later on */
++	iwl_build_tx_cmd_basic(priv, out_cmd, ctl, hdr, unicast, sta_id);
++
++	/* set is_hcca to 0; it probably will never be implemented */
++	iwl_hw_build_tx_cmd_rate(priv, out_cmd, ctl, hdr, sta_id, 0);
++
++	iwl4965_tx_cmd(priv, out_cmd, sta_id, txcmd_phys,
++		       hdr, hdr_len, ctl, NULL);
++
++	if (!ieee80211_get_morefrag(hdr)) {
++		txq->need_update = 1;
++		if (qc) {
++			u8 tid = (u8)(le16_to_cpu(*qc) & 0xf);
++			priv->stations[sta_id].tid[tid].seq_number = seq_number;
++		}
++	} else {
++		wait_write_ptr = 1;
++		txq->need_update = 0;
++	}
++
++	iwl_print_hex_dump(IWL_DL_TX, out_cmd->cmd.payload,
++			   sizeof(out_cmd->cmd.tx));
++
++	iwl_print_hex_dump(IWL_DL_TX, (u8 *)out_cmd->cmd.tx.hdr,
++			   ieee80211_get_hdrlen(fc));
++
++	iwl4965_tx_queue_update_wr_ptr(priv, txq, len);
++
++	q->first_empty = iwl_queue_inc_wrap(q->first_empty, q->n_bd);
++	rc = iwl_tx_queue_update_write_ptr(priv, txq);
++	spin_unlock_irqrestore(&priv->lock, flags);
++
++	if (rc)
++		return rc;
++
++	if ((iwl_queue_space(q) < q->high_mark)
++	    && priv->mac80211_registered) {
++		if (wait_write_ptr) {
++			spin_lock_irqsave(&priv->lock, flags);
++			txq->need_update = 1;
++			iwl_tx_queue_update_write_ptr(priv, txq);
++			spin_unlock_irqrestore(&priv->lock, flags);
++		}
++
++		ieee80211_stop_queue(priv->hw, ctl->queue);
++	}
++
++	return 0;
++
++drop_unlock:
++	spin_unlock_irqrestore(&priv->lock, flags);
++drop:
++	return -1;
++}
++
++static void iwl_set_rate(struct iwl_priv *priv)
++{
++	const struct ieee80211_hw_mode *hw = NULL;
++	struct ieee80211_rate *rate;
++	int i;
++
++	hw = iwl_get_hw_mode(priv, priv->phymode);
++
++	priv->active_rate = 0;
++	priv->active_rate_basic = 0;
++
++	IWL_DEBUG_RATE("Setting rates for 802.11%c\n",
++		       hw->mode == MODE_IEEE80211A ?
++		       'a' : ((hw->mode == MODE_IEEE80211B) ? 'b' : 'g'));
++
++	for (i = 0; i < hw->num_rates; i++) {
++		rate = &(hw->rates[i]);
++		if ((rate->val < IWL_RATE_COUNT) &&
++		    (rate->flags & IEEE80211_RATE_SUPPORTED)) {
++			IWL_DEBUG_RATE("Adding rate index %d (plcp %d)%s\n",
++				       rate->val, iwl_rates[rate->val].plcp,
++				       (rate->flags & IEEE80211_RATE_BASIC) ?
++				       "*" : "");
++			priv->active_rate |= (1 << rate->val);
++			if (rate->flags & IEEE80211_RATE_BASIC)
++				priv->active_rate_basic |= (1 << rate->val);
++		} else
++			IWL_DEBUG_RATE("Not adding rate %d (plcp %d)\n",
++				       rate->val, iwl_rates[rate->val].plcp);
++	}
++
++	IWL_DEBUG_RATE("Set active_rate = %0x, active_rate_basic = %0x\n",
++		       priv->active_rate, priv->active_rate_basic);
++
++	/*
++	 * If a basic rate is configured, then use it (adding IWL_RATE_1M_MASK)
++	 * otherwise set it to the default of all CCK rates and 6, 12, 24 for
++	 * OFDM
++	 */
++	if (priv->active_rate_basic & IWL_CCK_BASIC_RATES_MASK)
++		priv->staging_rxon.cck_basic_rates =
++		    ((priv->active_rate_basic &
++		      IWL_CCK_RATES_MASK) >> IWL_FIRST_CCK_RATE) & 0xF;
++	else
++		priv->staging_rxon.cck_basic_rates =
++		    (IWL_CCK_BASIC_RATES_MASK >> IWL_FIRST_CCK_RATE) & 0xF;
++
++	if (priv->active_rate_basic & IWL_OFDM_BASIC_RATES_MASK)
++		priv->staging_rxon.ofdm_basic_rates =
++		    ((priv->active_rate_basic &
++		      (IWL_OFDM_BASIC_RATES_MASK | IWL_RATE_6M_MASK)) >>
++		      IWL_FIRST_OFDM_RATE) & 0xFF;
++	else
++		priv->staging_rxon.ofdm_basic_rates =
++		   (IWL_OFDM_BASIC_RATES_MASK >> IWL_FIRST_OFDM_RATE) & 0xFF;
++}
++
++static void iwl_radio_kill_sw(struct iwl_priv *priv, int disable_radio)
++{
++	unsigned long flags;
++
++	if (!!disable_radio == test_bit(STATUS_RF_KILL_SW, &priv->status))
++		return;
++
++	IWL_DEBUG_RF_KILL("Manual SW RF KILL set to: RADIO %s\n",
++			  disable_radio ? "OFF" : "ON");
++
++	if (disable_radio) {
++		iwl_scan_cancel(priv);
++		/* FIXME: This is a workaround for AP */
++		if (priv->iw_mode != IEEE80211_IF_TYPE_AP) {
++			spin_lock_irqsave(&priv->lock, flags);
++			iwl_write32(priv, CSR_UCODE_DRV_GP1_SET,
++				    CSR_UCODE_SW_BIT_RFKILL);
++			spin_unlock_irqrestore(&priv->lock, flags);
++			iwl_send_card_state(priv, CARD_STATE_CMD_DISABLE, 0);
++			set_bit(STATUS_RF_KILL_SW, &priv->status);
++		}
++		return;
++	}
++
++	spin_lock_irqsave(&priv->lock, flags);
++	iwl_write32(priv, CSR_UCODE_DRV_GP1_CLR, CSR_UCODE_SW_BIT_RFKILL);
++
++	clear_bit(STATUS_RF_KILL_SW, &priv->status);
++	spin_unlock_irqrestore(&priv->lock, flags);
++
++	/* wake up ucode */
++	msleep(10);
++
++	spin_lock_irqsave(&priv->lock, flags);
++	iwl_read32(priv, CSR_UCODE_DRV_GP1);
++	if (!iwl_grab_restricted_access(priv))
++		iwl_release_restricted_access(priv);
++	spin_unlock_irqrestore(&priv->lock, flags);
++
++	if (test_bit(STATUS_RF_KILL_HW, &priv->status)) {
++		IWL_DEBUG_RF_KILL("Can not turn radio back on - "
++				  "disabled by HW switch\n");
++		return;
++	}
++
++	queue_work(priv->workqueue, &priv->restart);
++	return;
++}
++
++void iwl_set_decrypted_flag(struct iwl_priv *priv, struct sk_buff *skb,
++			    u32 decrypt_res, struct ieee80211_rx_status *stats)
++{
++	u16 fc =
++	    le16_to_cpu(((struct ieee80211_hdr *)skb->data)->frame_control);
++
++	if (priv->active_rxon.filter_flags & RXON_FILTER_DIS_DECRYPT_MSK)
++		return;
++
++	if (!(fc & IEEE80211_FCTL_PROTECTED))
++		return;
++
++	IWL_DEBUG_RX("decrypt_res:0x%x\n", decrypt_res);
++	switch (decrypt_res & RX_RES_STATUS_SEC_TYPE_MSK) {
++	case RX_RES_STATUS_SEC_TYPE_TKIP:
++		if ((decrypt_res & RX_RES_STATUS_DECRYPT_TYPE_MSK) ==
++		    RX_RES_STATUS_BAD_ICV_MIC)
++			stats->flag |= RX_FLAG_MMIC_ERROR;
++	case RX_RES_STATUS_SEC_TYPE_WEP:
++	case RX_RES_STATUS_SEC_TYPE_CCMP:
++		if ((decrypt_res & RX_RES_STATUS_DECRYPT_TYPE_MSK) ==
++		    RX_RES_STATUS_DECRYPT_OK) {
++			IWL_DEBUG_RX("hw decrypt successfully!!!\n");
++			stats->flag |= RX_FLAG_DECRYPTED;
++		}
++		break;
++
++	default:
++		break;
++	}
++}
++
++void iwl_handle_data_packet_monitor(struct iwl_priv *priv,
++				    struct iwl_rx_mem_buffer *rxb,
++				    void *data, short len,
++				    struct ieee80211_rx_status *stats,
++				    u16 phy_flags)
++{
++	struct iwl_rt_rx_hdr *iwl_rt;
++
++	/* First cache any information we need before we overwrite
++	 * the information provided in the skb from the hardware */
++	s8 signal = stats->ssi;
++	s8 noise = 0;
++	int rate = stats->rate;
++	u64 tsf = stats->mactime;
++	__le16 phy_flags_hw = cpu_to_le16(phy_flags);
++
++	/* We received data from the HW, so stop the watchdog */
++	if (len > IWL_RX_BUF_SIZE - sizeof(*iwl_rt)) {
++		IWL_DEBUG_DROP("Dropping too large packet in monitor\n");
++		return;
++	}
++
++	/* copy the frame data to write after where the radiotap header goes */
++	iwl_rt = (void *)rxb->skb->data;
++	memmove(iwl_rt->payload, data, len);
++
++	iwl_rt->rt_hdr.it_version = PKTHDR_RADIOTAP_VERSION;
++	iwl_rt->rt_hdr.it_pad = 0; /* always good to zero */
++
++	/* total header + data */
++	iwl_rt->rt_hdr.it_len = cpu_to_le16(sizeof(*iwl_rt));
++
++	/* Set the size of the skb to the size of the frame */
++	skb_put(rxb->skb, sizeof(*iwl_rt) + len);
++
++	/* Big bitfield of all the fields we provide in radiotap */
++	iwl_rt->rt_hdr.it_present =
++	    cpu_to_le32((1 << IEEE80211_RADIOTAP_TSFT) |
++			(1 << IEEE80211_RADIOTAP_FLAGS) |
++			(1 << IEEE80211_RADIOTAP_RATE) |
++			(1 << IEEE80211_RADIOTAP_CHANNEL) |
++			(1 << IEEE80211_RADIOTAP_DBM_ANTSIGNAL) |
++			(1 << IEEE80211_RADIOTAP_DBM_ANTNOISE) |
++			(1 << IEEE80211_RADIOTAP_ANTENNA));
++
++	/* Zero the flags, we'll add to them as we go */
++	iwl_rt->rt_flags = 0;
++
++	iwl_rt->rt_tsf = cpu_to_le64(tsf);
++
++	/* Convert to dBm */
++	iwl_rt->rt_dbmsignal = signal;
++	iwl_rt->rt_dbmnoise = noise;
++
++	/* Convert the channel frequency and set the flags */
++	iwl_rt->rt_channelMHz = cpu_to_le16(stats->freq);
++	if (!(phy_flags_hw & RX_RES_PHY_FLAGS_BAND_24_MSK))
++		iwl_rt->rt_chbitmask =
++		    cpu_to_le16((IEEE80211_CHAN_OFDM | IEEE80211_CHAN_5GHZ));
++	else if (phy_flags_hw & RX_RES_PHY_FLAGS_MOD_CCK_MSK)
++		iwl_rt->rt_chbitmask =
++		    cpu_to_le16((IEEE80211_CHAN_CCK | IEEE80211_CHAN_2GHZ));
++	else	/* 802.11g */
++		iwl_rt->rt_chbitmask =
++		    cpu_to_le16((IEEE80211_CHAN_OFDM | IEEE80211_CHAN_2GHZ));
++
++	rate = iwl_rate_index_from_plcp(rate);
++	if (rate == -1)
++		iwl_rt->rt_rate = 0;
++	else
++		iwl_rt->rt_rate = iwl_rates[rate].ieee;
++
++	/* antenna number */
++	iwl_rt->rt_antenna =
++		le16_to_cpu(phy_flags_hw & RX_RES_PHY_FLAGS_ANTENNA_MSK) >> 4;
++
++	/* set the preamble flag if we have it */
++	if (phy_flags_hw & RX_RES_PHY_FLAGS_SHORT_PREAMBLE_MSK)
++		iwl_rt->rt_flags |= IEEE80211_RADIOTAP_F_SHORTPRE;
++
++	IWL_DEBUG_RX("Rx packet of %d bytes.\n", rxb->skb->len);
++
++	stats->flag |= RX_FLAG_RADIOTAP;
++	ieee80211_rx_irqsafe(priv->hw, rxb->skb, stats);
++	rxb->skb = NULL;
++}
++
++
++#define IWL_PACKET_RETRY_TIME HZ
++
++int is_duplicate_packet(struct iwl_priv *priv, struct ieee80211_hdr *header)
++{
++	u16 sc = le16_to_cpu(header->seq_ctrl);
++	u16 seq = (sc & IEEE80211_SCTL_SEQ) >> 4;
++	u16 frag = sc & IEEE80211_SCTL_FRAG;
++	u16 *last_seq, *last_frag;
++	unsigned long *last_time;
++
++	switch (priv->iw_mode) {
++	case IEEE80211_IF_TYPE_IBSS:{
++		struct list_head *p;
++		struct iwl_ibss_seq *entry = NULL;
++		u8 *mac = header->addr2;
++		int index = mac[5] & (IWL_IBSS_MAC_HASH_SIZE - 1);
++
++		__list_for_each(p, &priv->ibss_mac_hash[index]) {
++			entry =
++				list_entry(p, struct iwl_ibss_seq, list);
++			if (!compare_ether_addr(entry->mac, mac))
++				break;
++		}
++		if (p == &priv->ibss_mac_hash[index]) {
++			entry = kzalloc(sizeof(*entry), GFP_ATOMIC);
++			if (!entry) {
++				IWL_ERROR
++					("Cannot malloc new mac entry\n");
++				return 0;
++			}
++			memcpy(entry->mac, mac, ETH_ALEN);
++			entry->seq_num = seq;
++			entry->frag_num = frag;
++			entry->packet_time = jiffies;
++			list_add(&entry->list,
++				 &priv->ibss_mac_hash[index]);
++			return 0;
++		}
++		last_seq = &entry->seq_num;
++		last_frag = &entry->frag_num;
++		last_time = &entry->packet_time;
++		break;
++	}
++	case IEEE80211_IF_TYPE_STA:
++		last_seq = &priv->last_seq_num;
++		last_frag = &priv->last_frag_num;
++		last_time = &priv->last_packet_time;
++		break;
++	default:
++		return 0;
++	}
++	if ((*last_seq == seq) &&
++	    time_after(*last_time + IWL_PACKET_RETRY_TIME, jiffies)) {
++		if (*last_frag == frag)
++			goto drop;
++		if (*last_frag + 1 != frag)
++			/* out-of-order fragment */
++			goto drop;
++	} else
++		*last_seq = seq;
++
++	*last_frag = frag;
++	*last_time = jiffies;
++	return 0;
++
++ drop:
++	return 1;
++}
++
++#ifdef CONFIG_IWLWIFI_SPECTRUM_MEASUREMENT
++
++#include "iwl-spectrum.h"
++
++#define BEACON_TIME_MASK_LOW	0x00FFFFFF
++#define BEACON_TIME_MASK_HIGH	0xFF000000
++#define TIME_UNIT		1024
++
++/*
++ * extended beacon time format
++ * time in usec will be changed into a 32-bit value in 8:24 format
++ * the high 1 byte is the beacon counts
++ * the lower 3 bytes is the time in usec within one beacon interval
++ */
++
++static u32 iwl_usecs_to_beacons(u32 usec, u32 beacon_interval)
++{
++	u32 quot;
++	u32 rem;
++	u32 interval = beacon_interval * 1024;
++
++	if (!interval || !usec)
++		return 0;
++
++	quot = (usec / interval) & (BEACON_TIME_MASK_HIGH >> 24);
++	rem = (usec % interval) & BEACON_TIME_MASK_LOW;
++
++	return (quot << 24) + rem;
++}
++
++/* base is usually what we get from ucode with each received frame,
++ * the same as HW timer counter counting down
++ */
++
++static __le32 iwl_add_beacon_time(u32 base, u32 addon, u32 beacon_interval)
++{
++	u32 base_low = base & BEACON_TIME_MASK_LOW;
++	u32 addon_low = addon & BEACON_TIME_MASK_LOW;
++	u32 interval = beacon_interval * TIME_UNIT;
++	u32 res = (base & BEACON_TIME_MASK_HIGH) +
++	    (addon & BEACON_TIME_MASK_HIGH);
++
++	if (base_low > addon_low)
++		res += base_low - addon_low;
++	else if (base_low < addon_low) {
++		res += interval + base_low - addon_low;
++		res += (1 << 24);
++	} else
++		res += (1 << 24);
++
++	return cpu_to_le32(res);
++}
++
++static int iwl_get_measurement(struct iwl_priv *priv,
++			       struct ieee80211_measurement_params *params,
++			       u8 type)
++{
++	struct iwl_spectrum_cmd spectrum;
++	struct iwl_rx_packet *res;
++	struct iwl_host_cmd cmd = {
++		.id = REPLY_SPECTRUM_MEASUREMENT_CMD,
++		.data = (void *)&spectrum,
++		.meta.flags = CMD_WANT_SKB,
++	};
++	u32 add_time = le64_to_cpu(params->start_time);
++	int rc;
++	int spectrum_resp_status;
++	int duration = le16_to_cpu(params->duration);
++
++	if (iwl_is_associated(priv))
++		add_time =
++		    iwl_usecs_to_beacons(
++			le64_to_cpu(params->start_time) - priv->last_tsf,
++			le16_to_cpu(priv->rxon_timing.beacon_interval));
++
++	memset(&spectrum, 0, sizeof(spectrum));
++
++	spectrum.channel_count = cpu_to_le16(1);
++	spectrum.flags =
++	    RXON_FLG_TSF2HOST_MSK | RXON_FLG_ANT_A_MSK | RXON_FLG_DIS_DIV_MSK;
++	spectrum.filter_flags = MEASUREMENT_FILTER_FLAG;
++	cmd.len = sizeof(spectrum);
++	spectrum.len = cpu_to_le16(cmd.len - sizeof(spectrum.len));
++
++	if (iwl_is_associated(priv))
++		spectrum.start_time =
++		    iwl_add_beacon_time(priv->last_beacon_time,
++				add_time,
++				le16_to_cpu(priv->rxon_timing.beacon_interval));
++	else
++		spectrum.start_time = 0;
++
++	spectrum.channels[0].duration = cpu_to_le32(duration * TIME_UNIT);
++	spectrum.channels[0].channel = params->channel;
++	spectrum.channels[0].type = type;
++	if (priv->active_rxon.flags & RXON_FLG_BAND_24G_MSK)
++		spectrum.flags |= RXON_FLG_BAND_24G_MSK |
++		    RXON_FLG_AUTO_DETECT_MSK | RXON_FLG_TGG_PROTECT_MSK;
++
++	rc = iwl_send_cmd_sync(priv, &cmd);
++	if (rc)
++		return rc;
++
++	res = (struct iwl_rx_packet *)cmd.meta.u.skb->data;
++	if (res->hdr.flags & IWL_CMD_FAILED_MSK) {
++		IWL_ERROR("Bad return from REPLY_RX_ON_ASSOC command\n");
++		rc = -EIO;
++	}
++
++	spectrum_resp_status = le16_to_cpu(res->u.spectrum.status);
++	switch (spectrum_resp_status) {
++	case 0:		/* Command will be handled */
++		if (res->u.spectrum.id != 0xff) {
++			IWL_DEBUG_INFO
++			    ("Replaced existing measurement: %d\n",
++			     res->u.spectrum.id);
++			priv->measurement_status &= ~MEASUREMENT_READY;
++		}
++		priv->measurement_status |= MEASUREMENT_ACTIVE;
++		rc = 0;
++		break;
++
++	case 1:		/* Command will not be handled */
++		rc = -EAGAIN;
++		break;
++	}
++
++	dev_kfree_skb_any(cmd.meta.u.skb);
++
++	return rc;
++}
++#endif
++
++static void iwl_txstatus_to_ieee(struct iwl_priv *priv,
++				 struct iwl_tx_info *tx_sta)
++{
++
++	tx_sta->status.ack_signal = 0;
++	tx_sta->status.excessive_retries = 0;
++	tx_sta->status.queue_length = 0;
++	tx_sta->status.queue_number = 0;
++
++	if (in_interrupt())
++		ieee80211_tx_status_irqsafe(priv->hw,
++					    tx_sta->skb[0], &(tx_sta->status));
++	else
++		ieee80211_tx_status(priv->hw,
++				    tx_sta->skb[0], &(tx_sta->status));
++
++	tx_sta->skb[0] = NULL;
++}
++
++/**
++ * iwl_tx_queue_reclaim - Reclaim Tx queue entries no more used by NIC.
++ *
++ * When FW advances 'R' index, all entries between old and
++ * new 'R' index need to be reclaimed. As result, some free space
++ * forms. If there is enough free space (> low mark), wake Tx queue.
++ */
++int iwl_tx_queue_reclaim(struct iwl_priv *priv, int txq_id, int index)
++{
++	struct iwl_tx_queue *txq = &priv->txq[txq_id];
++	struct iwl_queue *q = &txq->q;
++	int nfreed = 0;
++
++	if ((index >= q->n_bd) || (x2_queue_used(q, index) == 0)) {
++		IWL_ERROR("Read index for DMA queue txq id (%d), index %d, "
++			  "is out of range [0-%d] %d %d.\n", txq_id,
++			  index, q->n_bd, q->first_empty, q->last_used);
++		return 0;
++	}
++
++	for (index = iwl_queue_inc_wrap(index, q->n_bd);
++		q->last_used != index;
++		q->last_used = iwl_queue_inc_wrap(q->last_used, q->n_bd)) {
++		if (txq_id != IWL_CMD_QUEUE_NUM) {
++			iwl_txstatus_to_ieee(priv,
++					&(txq->txb[txq->q.last_used]));
++			iwl_hw_txq_free_tfd(priv, txq);
++		} else if (nfreed > 1) {
++			IWL_ERROR("HCMD skipped: index (%d) %d %d\n", index,
++					q->first_empty, q->last_used);
++			queue_work(priv->workqueue, &priv->restart);
++		}
++		nfreed++;
++	}
++
++	if (iwl_queue_space(q) > q->low_mark && (txq_id >= 0) &&
++			(txq_id != IWL_CMD_QUEUE_NUM) &&
++			priv->mac80211_registered)
++		ieee80211_wake_queue(priv->hw, txq_id);
++
++
++	return nfreed;
++}
++
++static int iwl_is_tx_success(u32 status)
++{
++	status &= TX_STATUS_MSK;
++	return (status == TX_STATUS_SUCCESS)
++	    || (status == TX_STATUS_DIRECT_DONE);
++}
++
++/******************************************************************************
++ *
++ * Generic RX handler implementations
++ *
++ ******************************************************************************/
++#ifdef CONFIG_IWLWIFI_HT
++#ifdef CONFIG_IWLWIFI_HT_AGG
++
++static inline int iwl_get_ra_sta_id(struct iwl_priv *priv,
++				    struct ieee80211_hdr *hdr)
++{
++	if (priv->iw_mode == IEEE80211_IF_TYPE_STA)
++		return IWL_AP_ID;
++	else {
++		u8 *da = ieee80211_get_DA(hdr);
++		return iwl_hw_find_station(priv, da);
++	}
++}
++
++static struct ieee80211_hdr *iwl_tx_queue_get_hdr(
++	struct iwl_priv *priv, int txq_id, int idx)
++{
++	if (priv->txq[txq_id].txb[idx].skb[0])
++		return (struct ieee80211_hdr *)priv->txq[txq_id].
++				txb[idx].skb[0]->data;
++	return NULL;
++}
++
++static inline u32 iwl_get_scd_ssn(struct iwl_tx_resp *tx_resp)
++{
++	__le32 *scd_ssn = (__le32 *)((u32 *)&tx_resp->status +
++				tx_resp->frame_count);
++	return le32_to_cpu(*scd_ssn) & MAX_SN;
++
++}
++static int iwl4965_tx_status_reply_tx(struct iwl_priv *priv,
++				      struct iwl_ht_agg *agg,
++				      struct iwl_tx_resp *tx_resp,
++				      u16 start_idx)
++{
++	u32 status;
++	__le32 *frame_status = &tx_resp->status;
++	struct ieee80211_tx_status *tx_status = NULL;
++	struct ieee80211_hdr *hdr = NULL;
++	int i, sh;
++	int txq_id, idx;
++	u16 seq;
++
++	if (agg->wait_for_ba)
++		IWL_DEBUG_TX_REPLY("got tx repsons w/o back\n");
++
++	agg->frame_count = tx_resp->frame_count;
++	agg->start_idx = start_idx;
++	agg->rate_n_flags = le32_to_cpu(tx_resp->rate_n_flags);
++	agg->bitmap0 = agg->bitmap1 = 0;
++
++	if (agg->frame_count == 1) {
++		struct iwl_tx_queue *txq ;
++		status = le32_to_cpu(frame_status[0]);
++
++		txq_id = agg->txq_id;
++		txq = &priv->txq[txq_id];
++		/* FIXME: code repetition */
++		IWL_DEBUG_TX_REPLY("FrameCnt = %d, StartIdx=%d \n",
++				   agg->frame_count, agg->start_idx);
++
++		tx_status = &(priv->txq[txq_id].txb[txq->q.last_used].status);
++		tx_status->retry_count = tx_resp->failure_frame;
++		tx_status->queue_number = status & 0xff;
++		tx_status->queue_length = tx_resp->bt_kill_count;
++		tx_status->queue_length |= tx_resp->failure_rts;
++
++		tx_status->flags = iwl_is_tx_success(status)?
++			IEEE80211_TX_STATUS_ACK : 0;
++		tx_status->control.tx_rate =
++				iwl_hw_get_rate_n_flags(tx_resp->rate_n_flags);
++		/* FIXME: code repetition end */
++
++		IWL_DEBUG_TX_REPLY("1 Frame 0x%x failure :%d\n",
++				    status & 0xff, tx_resp->failure_frame);
++		IWL_DEBUG_TX_REPLY("Rate Info rate_n_flags=%x\n",
++				iwl_hw_get_rate_n_flags(tx_resp->rate_n_flags));
++
++		agg->wait_for_ba = 0;
++	} else {
++		u64 bitmap = 0;
++		int start = agg->start_idx;
++
++		for (i = 0; i < agg->frame_count; i++) {
++			u16 sc;
++			status = le32_to_cpu(frame_status[i]);
++			seq  = status >> 16;
++			idx = SEQ_TO_INDEX(seq);
++			txq_id = SEQ_TO_QUEUE(seq);
++
++			if (status & (AGG_TX_STATE_FEW_BYTES_MSK |
++				      AGG_TX_STATE_ABORT_MSK))
++				continue;
++
++			IWL_DEBUG_TX_REPLY("FrameCnt = %d, txq_id=%d idx=%d\n",
++					   agg->frame_count, txq_id, idx);
++
++			hdr = iwl_tx_queue_get_hdr(priv, txq_id, idx);
++
++			sc = le16_to_cpu(hdr->seq_ctrl);
++			if (idx != (SEQ_TO_SN(sc) & 0xff)) {
++				IWL_ERROR("BUG_ON idx doesn't match seq control"
++					  " idx=%d, seq_idx=%d, seq=%d\n",
++					  idx, SEQ_TO_SN(sc),
++					  hdr->seq_ctrl);
++				return -1;
++			}
++
++			IWL_DEBUG_TX_REPLY("AGG Frame i=%d idx %d seq=%d\n",
++					   i, idx, SEQ_TO_SN(sc));
++
++			sh = idx - start;
++			if (sh > 64) {
++				sh = (start - idx) + 0xff;
++				bitmap = bitmap << sh;
++				sh = 0;
++				start = idx;
++			} else if (sh < -64)
++				sh  = 0xff - (start - idx);
++			else if (sh < 0) {
++				sh = start - idx;
++				start = idx;
++				bitmap = bitmap << sh;
++				sh = 0;
++			}
++			bitmap |= (1 << sh);
++			IWL_DEBUG_TX_REPLY("start=%d bitmap=0x%x\n",
++					   start, (u32)(bitmap & 0xFFFFFFFF));
++		}
++
++		agg->bitmap0 = bitmap & 0xFFFFFFFF;
++		agg->bitmap1 = bitmap >> 32;
++		agg->start_idx = start;
++		agg->rate_n_flags = le32_to_cpu(tx_resp->rate_n_flags);
++		IWL_DEBUG_TX_REPLY("Frames %d start_idx=%d bitmap=0x%x\n",
++				   agg->frame_count, agg->start_idx,
++				   agg->bitmap0);
++
++		if (bitmap)
++			agg->wait_for_ba = 1;
++	}
++	return 0;
++}
++#endif
++#endif
++
++static void iwl_rx_reply_tx(struct iwl_priv *priv,
++			    struct iwl_rx_mem_buffer *rxb)
++{
++	struct iwl_rx_packet *pkt = (void *)rxb->skb->data;
++	u16 sequence = le16_to_cpu(pkt->hdr.sequence);
++	int txq_id = SEQ_TO_QUEUE(sequence);
++	int index = SEQ_TO_INDEX(sequence);
++	struct iwl_tx_queue *txq = &priv->txq[txq_id];
++	struct ieee80211_tx_status *tx_status;
++	struct iwl_tx_resp *tx_resp = (void *)&pkt->u.raw[0];
++	u32  status = le32_to_cpu(tx_resp->status);
++#ifdef CONFIG_IWLWIFI_HT
++#ifdef CONFIG_IWLWIFI_HT_AGG
++	int tid, sta_id;
++#endif
++#endif
++
++	if ((index >= txq->q.n_bd) || (x2_queue_used(&txq->q, index) == 0)) {
++		IWL_ERROR("Read index for DMA queue txq_id (%d) index %d "
++			  "is out of range [0-%d] %d %d\n", txq_id,
++			  index, txq->q.n_bd, txq->q.first_empty,
++			  txq->q.last_used);
++		return;
++	}
++
++#ifdef CONFIG_IWLWIFI_HT
++#ifdef CONFIG_IWLWIFI_HT_AGG
++	if (txq->sched_retry) {
++		const u32 scd_ssn = iwl_get_scd_ssn(tx_resp);
++		struct ieee80211_hdr *hdr =
++			iwl_tx_queue_get_hdr(priv, txq_id, index);
++		struct iwl_ht_agg *agg = NULL;
++		__le16 *qc = ieee80211_get_qos_ctrl(hdr);
++
++		if (qc == NULL) {
++			IWL_ERROR("BUG_ON qc is null!!!!\n");
++			return;
++		}
++
++		tid = le16_to_cpu(*qc) & 0xf;
++
++		sta_id = iwl_get_ra_sta_id(priv, hdr);
++		if (unlikely(sta_id == IWL_INVALID_STATION)) {
++			IWL_ERROR("Station not known for\n");
++			return;
++		}
++
++		agg = &priv->stations[sta_id].tid[tid].agg;
++
++		iwl4965_tx_status_reply_tx(priv, agg, tx_resp, index);
++
++		if ((tx_resp->frame_count == 1) &&
++		    !iwl_is_tx_success(status)) {
++			/* TODO: send BAR */
++		}
++
++		if ((txq->q.last_used != (scd_ssn & 0xff))) {
++			index = iwl_queue_dec_wrap(scd_ssn & 0xff, txq->q.n_bd);
++			IWL_DEBUG_TX_REPLY("Retry scheduler reclaim scd_ssn "
++					   "%d index %d\n", scd_ssn , index);
++			iwl_tx_queue_reclaim(priv, txq_id, index);
++		}
++	} else {
++#endif /* CONFIG_IWLWIFI_HT_AGG */
++#endif /* CONFIG_IWLWIFI_HT */
++	tx_status = &(txq->txb[txq->q.last_used].status);
++
++	tx_status->retry_count = tx_resp->failure_frame;
++	tx_status->queue_number = status;
++	tx_status->queue_length = tx_resp->bt_kill_count;
++	tx_status->queue_length |= tx_resp->failure_rts;
++
++	tx_status->flags =
++	    iwl_is_tx_success(status) ? IEEE80211_TX_STATUS_ACK : 0;
++
++	tx_status->control.tx_rate =
++		iwl_hw_get_rate_n_flags(tx_resp->rate_n_flags);
++
++	IWL_DEBUG_TX("Tx queue %d Status %s (0x%08x) rate_n_flags 0x%x "
++		     "retries %d\n", txq_id, iwl_get_tx_fail_reason(status),
++		     status, le32_to_cpu(tx_resp->rate_n_flags),
++		     tx_resp->failure_frame);
++
++	IWL_DEBUG_TX_REPLY("Tx queue reclaim %d\n", index);
++	if (index != -1)
++		iwl_tx_queue_reclaim(priv, txq_id, index);
++#ifdef CONFIG_IWLWIFI_HT
++#ifdef CONFIG_IWLWIFI_HT_AGG
++	}
++#endif /* CONFIG_IWLWIFI_HT_AGG */
++#endif /* CONFIG_IWLWIFI_HT */
++
++	if (iwl_check_bits(status, TX_ABORT_REQUIRED_MSK))
++		IWL_ERROR("TODO:  Implement Tx ABORT REQUIRED!!!\n");
++}
++
++
++static void iwl_rx_reply_alive(struct iwl_priv *priv,
++			       struct iwl_rx_mem_buffer *rxb)
++{
++	struct iwl_rx_packet *pkt = (void *)rxb->skb->data;
++	struct iwl_alive_resp *palive;
++	struct delayed_work *pwork;
++
++	palive = &pkt->u.alive_frame;
++
++	IWL_DEBUG_INFO("Alive ucode status 0x%08X revision "
++		       "0x%01X 0x%01X\n",
++		       palive->is_valid, palive->ver_type,
++		       palive->ver_subtype);
++
++	if (palive->ver_subtype == INITIALIZE_SUBTYPE) {
++		IWL_DEBUG_INFO("Initialization Alive received.\n");
++		memcpy(&priv->card_alive_init,
++		       &pkt->u.alive_frame,
++		       sizeof(struct iwl_init_alive_resp));
++		pwork = &priv->init_alive_start;
++	} else {
++		IWL_DEBUG_INFO("Runtime Alive received.\n");
++		memcpy(&priv->card_alive, &pkt->u.alive_frame,
++		       sizeof(struct iwl_alive_resp));
++		pwork = &priv->alive_start;
++	}
++
++	/* We delay the ALIVE response by 5ms to
++	 * give the HW RF Kill time to activate... */
++	if (palive->is_valid == UCODE_VALID_OK)
++		queue_delayed_work(priv->workqueue, pwork,
++				   msecs_to_jiffies(5));
++	else
++		IWL_WARNING("uCode did not respond OK.\n");
++}
++
++static void iwl_rx_reply_add_sta(struct iwl_priv *priv,
++				 struct iwl_rx_mem_buffer *rxb)
++{
++	struct iwl_rx_packet *pkt = (void *)rxb->skb->data;
++
++	IWL_DEBUG_RX("Received REPLY_ADD_STA: 0x%02X\n", pkt->u.status);
++	return;
++}
++
++static void iwl_rx_reply_error(struct iwl_priv *priv,
++			       struct iwl_rx_mem_buffer *rxb)
++{
++	struct iwl_rx_packet *pkt = (void *)rxb->skb->data;
++
++	IWL_ERROR("Error Reply type 0x%08X cmd %s (0x%02X) "
++		"seq 0x%04X ser 0x%08X\n",
++		le32_to_cpu(pkt->u.err_resp.error_type),
++		get_cmd_string(pkt->u.err_resp.cmd_id),
++		pkt->u.err_resp.cmd_id,
++		le16_to_cpu(pkt->u.err_resp.bad_cmd_seq_num),
++		le32_to_cpu(pkt->u.err_resp.error_info));
++}
++
++#define TX_STATUS_ENTRY(x) case TX_STATUS_FAIL_ ## x: return #x
++
++static void iwl_rx_csa(struct iwl_priv *priv, struct iwl_rx_mem_buffer *rxb)
++{
++	struct iwl_rx_packet *pkt = (void *)rxb->skb->data;
++	struct iwl_rxon_cmd *rxon = (void *)&priv->active_rxon;
++	struct iwl_csa_notification *csa = &(pkt->u.csa_notif);
++	IWL_DEBUG_11H("CSA notif: channel %d, status %d\n",
++		      le16_to_cpu(csa->channel), le32_to_cpu(csa->status));
++	rxon->channel = csa->channel;
++	priv->staging_rxon.channel = csa->channel;
++}
++
++static void iwl_rx_spectrum_measure_notif(struct iwl_priv *priv,
++					  struct iwl_rx_mem_buffer *rxb)
++{
++#ifdef CONFIG_IWLWIFI_SPECTRUM_MEASUREMENT
++	struct iwl_rx_packet *pkt = (void *)rxb->skb->data;
++	struct iwl_spectrum_notification *report = &(pkt->u.spectrum_notif);
++
++	if (!report->state) {
++		IWL_DEBUG(IWL_DL_11H | IWL_DL_INFO,
++			  "Spectrum Measure Notification: Start\n");
++		return;
++	}
++
++	memcpy(&priv->measure_report, report, sizeof(*report));
++	priv->measurement_status |= MEASUREMENT_READY;
++#endif
++}
++
++static void iwl_rx_pm_sleep_notif(struct iwl_priv *priv,
++				  struct iwl_rx_mem_buffer *rxb)
++{
++#ifdef CONFIG_IWLWIFI_DEBUG
++	struct iwl_rx_packet *pkt = (void *)rxb->skb->data;
++	struct iwl_sleep_notification *sleep = &(pkt->u.sleep_notif);
++	IWL_DEBUG_RX("sleep mode: %d, src: %d\n",
++		     sleep->pm_sleep_mode, sleep->pm_wakeup_src);
++#endif
++}
++
++static void iwl_rx_pm_debug_statistics_notif(struct iwl_priv *priv,
++					     struct iwl_rx_mem_buffer *rxb)
++{
++	struct iwl_rx_packet *pkt = (void *)rxb->skb->data;
++	IWL_DEBUG_RADIO("Dumping %d bytes of unhandled "
++			"notification for %s:\n",
++			le32_to_cpu(pkt->len), get_cmd_string(pkt->hdr.cmd));
++	iwl_print_hex_dump(IWL_DL_RADIO, pkt->u.raw, le32_to_cpu(pkt->len));
++}
++
++static void iwl_bg_beacon_update(struct work_struct *work)
++{
++	struct iwl_priv *priv =
++		container_of(work, struct iwl_priv, beacon_update);
++	struct sk_buff *beacon;
++
++	/* Pull updated AP beacon from mac80211. will fail if not in AP mode */
++	beacon = ieee80211_beacon_get(priv->hw, priv->interface_id, NULL);
++
++	if (!beacon) {
++		IWL_ERROR("update beacon failed\n");
++		return;
++	}
++
++	mutex_lock(&priv->mutex);
++	/* new beacon skb is allocated every time; dispose previous.*/
++	if (priv->ibss_beacon)
++		dev_kfree_skb(priv->ibss_beacon);
++
++	priv->ibss_beacon = beacon;
++	mutex_unlock(&priv->mutex);
++
++	iwl_send_beacon_cmd(priv);
++}
++
++static void iwl_rx_beacon_notif(struct iwl_priv *priv,
++				struct iwl_rx_mem_buffer *rxb)
++{
++#ifdef CONFIG_IWLWIFI_DEBUG
++	struct iwl_rx_packet *pkt = (void *)rxb->skb->data;
++	struct iwl_beacon_notif *beacon = &(pkt->u.beacon_status);
++	u8 rate = iwl_hw_get_rate(beacon->beacon_notify_hdr.rate_n_flags);
++
++	IWL_DEBUG_RX("beacon status %x retries %d iss %d "
++		"tsf %d %d rate %d\n",
++		le32_to_cpu(beacon->beacon_notify_hdr.status) & TX_STATUS_MSK,
++		beacon->beacon_notify_hdr.failure_frame,
++		le32_to_cpu(beacon->ibss_mgr_status),
++		le32_to_cpu(beacon->high_tsf),
++		le32_to_cpu(beacon->low_tsf), rate);
++#endif
++
++	if ((priv->iw_mode == IEEE80211_IF_TYPE_AP) &&
++	    (!test_bit(STATUS_EXIT_PENDING, &priv->status)))
++		queue_work(priv->workqueue, &priv->beacon_update);
++}
++
++/* Service response to REPLY_SCAN_CMD (0x80) */
++static void iwl_rx_reply_scan(struct iwl_priv *priv,
++			      struct iwl_rx_mem_buffer *rxb)
++{
++#ifdef CONFIG_IWLWIFI_DEBUG
++	struct iwl_rx_packet *pkt = (void *)rxb->skb->data;
++	struct iwl_scanreq_notification *notif =
++	    (struct iwl_scanreq_notification *)pkt->u.raw;
++
++	IWL_DEBUG_RX("Scan request status = 0x%x\n", notif->status);
++#endif
++}
++
++/* Service SCAN_START_NOTIFICATION (0x82) */
++static void iwl_rx_scan_start_notif(struct iwl_priv *priv,
++				    struct iwl_rx_mem_buffer *rxb)
++{
++	struct iwl_rx_packet *pkt = (void *)rxb->skb->data;
++	struct iwl_scanstart_notification *notif =
++	    (struct iwl_scanstart_notification *)pkt->u.raw;
++	priv->scan_start_tsf = le32_to_cpu(notif->tsf_low);
++	IWL_DEBUG_SCAN("Scan start: "
++		       "%d [802.11%s] "
++		       "(TSF: 0x%08X:%08X) - %d (beacon timer %u)\n",
++		       notif->channel,
++		       notif->band ? "bg" : "a",
++		       notif->tsf_high,
++		       notif->tsf_low, notif->status, notif->beacon_timer);
++}
++
++/* Service SCAN_RESULTS_NOTIFICATION (0x83) */
++static void iwl_rx_scan_results_notif(struct iwl_priv *priv,
++				      struct iwl_rx_mem_buffer *rxb)
++{
++	struct iwl_rx_packet *pkt = (void *)rxb->skb->data;
++	struct iwl_scanresults_notification *notif =
++	    (struct iwl_scanresults_notification *)pkt->u.raw;
++
++	IWL_DEBUG_SCAN("Scan ch.res: "
++		       "%d [802.11%s] "
++		       "(TSF: 0x%08X:%08X) - %d "
++		       "elapsed=%lu usec (%dms since last)\n",
++		       notif->channel,
++		       notif->band ? "bg" : "a",
++		       le32_to_cpu(notif->tsf_high),
++		       le32_to_cpu(notif->tsf_low),
++		       le32_to_cpu(notif->statistics[0]),
++		       le32_to_cpu(notif->tsf_low) - priv->scan_start_tsf,
++		       jiffies_to_msecs(elapsed_jiffies
++					(priv->last_scan_jiffies, jiffies)));
++
++	priv->last_scan_jiffies = jiffies;
++}
++
++/* Service SCAN_COMPLETE_NOTIFICATION (0x84) */
++static void iwl_rx_scan_complete_notif(struct iwl_priv *priv,
++				       struct iwl_rx_mem_buffer *rxb)
++{
++	struct iwl_rx_packet *pkt = (void *)rxb->skb->data;
++	struct iwl_scancomplete_notification *scan_notif = (void *)pkt->u.raw;
++
++	IWL_DEBUG_SCAN("Scan complete: %d channels (TSF 0x%08X:%08X) - %d\n",
++		       scan_notif->scanned_channels,
++		       scan_notif->tsf_low,
++		       scan_notif->tsf_high, scan_notif->status);
++
++	/* The HW is no longer scanning */
++	clear_bit(STATUS_SCAN_HW, &priv->status);
++
++	/* The scan completion notification came in, so kill that timer... */
++	cancel_delayed_work(&priv->scan_check);
++
++	IWL_DEBUG_INFO("Scan pass on %sGHz took %dms\n",
++		       (priv->scan_bands == 2) ? "2.4" : "5.2",
++		       jiffies_to_msecs(elapsed_jiffies
++					(priv->scan_pass_start, jiffies)));
++
++	/* Remove this scanned band from the list
++	 * of pending bands to scan */
++	priv->scan_bands--;
++
++	/* If a request to abort was given, or the scan did not succeed
++	 * then we reset the scan state machine and terminate,
++	 * re-queuing another scan if one has been requested */
++	if (test_bit(STATUS_SCAN_ABORTING, &priv->status)) {
++		IWL_DEBUG_INFO("Aborted scan completed.\n");
++		clear_bit(STATUS_SCAN_ABORTING, &priv->status);
++	} else {
++		/* If there are more bands on this scan pass reschedule */
++		if (priv->scan_bands > 0)
++			goto reschedule;
++	}
++
++	priv->last_scan_jiffies = jiffies;
++	IWL_DEBUG_INFO("Setting scan to off\n");
++
++	clear_bit(STATUS_SCANNING, &priv->status);
++
++	IWL_DEBUG_INFO("Scan took %dms\n",
++		jiffies_to_msecs(elapsed_jiffies(priv->scan_start, jiffies)));
++
++	queue_work(priv->workqueue, &priv->scan_completed);
++
++	return;
++
++reschedule:
++	priv->scan_pass_start = jiffies;
++	queue_work(priv->workqueue, &priv->request_scan);
++}
++
++/* Handle notification from uCode that card's power state is changing
++ * due to software, hardware, or critical temperature RFKILL */
++static void iwl_rx_card_state_notif(struct iwl_priv *priv,
++				    struct iwl_rx_mem_buffer *rxb)
++{
++	struct iwl_rx_packet *pkt = (void *)rxb->skb->data;
++	u32 flags = le32_to_cpu(pkt->u.card_state_notif.flags);
++	unsigned long status = priv->status;
++
++	IWL_DEBUG_RF_KILL("Card state received: HW:%s SW:%s\n",
++			  (flags & HW_CARD_DISABLED) ? "Kill" : "On",
++			  (flags & SW_CARD_DISABLED) ? "Kill" : "On");
++
++	if (flags & (SW_CARD_DISABLED | HW_CARD_DISABLED |
++		     RF_CARD_DISABLED)) {
++
++		iwl_write32(priv, CSR_UCODE_DRV_GP1_SET,
++			    CSR_UCODE_DRV_GP1_BIT_CMD_BLOCKED);
++
++		if (!iwl_grab_restricted_access(priv)) {
++			iwl_write_restricted(
++				priv, HBUS_TARG_MBX_C,
++				HBUS_TARG_MBX_C_REG_BIT_CMD_BLOCKED);
++
++			iwl_release_restricted_access(priv);
++		}
++
++		if (!(flags & RXON_CARD_DISABLED)) {
++			iwl_write32(priv, CSR_UCODE_DRV_GP1_CLR,
++				    CSR_UCODE_DRV_GP1_BIT_CMD_BLOCKED);
++			if (!iwl_grab_restricted_access(priv)) {
++				iwl_write_restricted(
++					priv, HBUS_TARG_MBX_C,
++					HBUS_TARG_MBX_C_REG_BIT_CMD_BLOCKED);
++
++				iwl_release_restricted_access(priv);
++			}
++		}
++
++		if (flags & RF_CARD_DISABLED) {
++			iwl_write32(priv, CSR_UCODE_DRV_GP1_SET,
++				    CSR_UCODE_DRV_GP1_REG_BIT_CT_KILL_EXIT);
++			iwl_read32(priv, CSR_UCODE_DRV_GP1);
++			if (!iwl_grab_restricted_access(priv))
++				iwl_release_restricted_access(priv);
++		}
++	}
++
++	if (flags & HW_CARD_DISABLED)
++		set_bit(STATUS_RF_KILL_HW, &priv->status);
++	else
++		clear_bit(STATUS_RF_KILL_HW, &priv->status);
++
++
++	if (flags & SW_CARD_DISABLED)
++		set_bit(STATUS_RF_KILL_SW, &priv->status);
++	else
++		clear_bit(STATUS_RF_KILL_SW, &priv->status);
++
++	if (!(flags & RXON_CARD_DISABLED))
++		iwl_scan_cancel(priv);
++
++	if ((test_bit(STATUS_RF_KILL_HW, &status) !=
++	     test_bit(STATUS_RF_KILL_HW, &priv->status)) ||
++	    (test_bit(STATUS_RF_KILL_SW, &status) !=
++	     test_bit(STATUS_RF_KILL_SW, &priv->status)))
++		queue_work(priv->workqueue, &priv->rf_kill);
++	else
++		wake_up_interruptible(&priv->wait_command_queue);
++}
++
++/**
++ * iwl_setup_rx_handlers - Initialize Rx handler callbacks
++ *
++ * Setup the RX handlers for each of the reply types sent from the uCode
++ * to the host.
++ *
++ * This function chains into the hardware specific files for them to setup
++ * any hardware specific handlers as well.
++ */
++static void iwl_setup_rx_handlers(struct iwl_priv *priv)
++{
++	priv->rx_handlers[REPLY_ALIVE] = iwl_rx_reply_alive;
++	priv->rx_handlers[REPLY_ADD_STA] = iwl_rx_reply_add_sta;
++	priv->rx_handlers[REPLY_ERROR] = iwl_rx_reply_error;
++	priv->rx_handlers[CHANNEL_SWITCH_NOTIFICATION] = iwl_rx_csa;
++	priv->rx_handlers[SPECTRUM_MEASURE_NOTIFICATION] =
++	    iwl_rx_spectrum_measure_notif;
++	priv->rx_handlers[PM_SLEEP_NOTIFICATION] = iwl_rx_pm_sleep_notif;
++	priv->rx_handlers[PM_DEBUG_STATISTIC_NOTIFIC] =
++	    iwl_rx_pm_debug_statistics_notif;
++	priv->rx_handlers[BEACON_NOTIFICATION] = iwl_rx_beacon_notif;
++
++	/* NOTE:  iwl_rx_statistics is different based on whether
++	 * the build is for the 3945 or the 4965.  See the
++	 * corresponding implementation in iwl-XXXX.c
++	 *
++	 * The same handler is used for both the REPLY to a
++	 * discrete statistics request from the host as well as
++	 * for the periodic statistics notification from the uCode
++	 */
++	priv->rx_handlers[REPLY_STATISTICS_CMD] = iwl_hw_rx_statistics;
++	priv->rx_handlers[STATISTICS_NOTIFICATION] = iwl_hw_rx_statistics;
++
++	priv->rx_handlers[REPLY_SCAN_CMD] = iwl_rx_reply_scan;
++	priv->rx_handlers[SCAN_START_NOTIFICATION] = iwl_rx_scan_start_notif;
++	priv->rx_handlers[SCAN_RESULTS_NOTIFICATION] =
++	    iwl_rx_scan_results_notif;
++	priv->rx_handlers[SCAN_COMPLETE_NOTIFICATION] =
++	    iwl_rx_scan_complete_notif;
++	priv->rx_handlers[CARD_STATE_NOTIFICATION] = iwl_rx_card_state_notif;
++	priv->rx_handlers[REPLY_TX] = iwl_rx_reply_tx;
++
++	/* Setup hardware specific Rx handlers */
++	iwl_hw_rx_handler_setup(priv);
++}
++
++/**
++ * iwl_tx_cmd_complete - Pull unused buffers off the queue and reclaim them
++ * @rxb: Rx buffer to reclaim
++ *
++ * If an Rx buffer has an async callback associated with it the callback
++ * will be executed.  The attached skb (if present) will only be freed
++ * if the callback returns 1
++ */
++static void iwl_tx_cmd_complete(struct iwl_priv *priv,
++				struct iwl_rx_mem_buffer *rxb)
++{
++	struct iwl_rx_packet *pkt = (struct iwl_rx_packet *)rxb->skb->data;
++	u16 sequence = le16_to_cpu(pkt->hdr.sequence);
++	int txq_id = SEQ_TO_QUEUE(sequence);
++	int index = SEQ_TO_INDEX(sequence);
++	int huge = sequence & SEQ_HUGE_FRAME;
++	int cmd_index;
++	struct iwl_cmd *cmd;
++
++	/* If a Tx command is being handled and it isn't in the actual
++	 * command queue then there a command routing bug has been introduced
++	 * in the queue management code. */
++	if (txq_id != IWL_CMD_QUEUE_NUM)
++		IWL_ERROR("Error wrong command queue %d command id 0x%X\n",
++			  txq_id, pkt->hdr.cmd);
++	BUG_ON(txq_id != IWL_CMD_QUEUE_NUM);
++
++	cmd_index = get_cmd_index(&priv->txq[IWL_CMD_QUEUE_NUM].q, index, huge);
++	cmd = &priv->txq[IWL_CMD_QUEUE_NUM].cmd[cmd_index];
++
++	/* Input error checking is done when commands are added to queue. */
++	if (cmd->meta.flags & CMD_WANT_SKB) {
++		cmd->meta.source->u.skb = rxb->skb;
++		rxb->skb = NULL;
++	} else if (cmd->meta.u.callback &&
++		   !cmd->meta.u.callback(priv, cmd, rxb->skb))
++		rxb->skb = NULL;
++
++	iwl_tx_queue_reclaim(priv, txq_id, index);
++
++	if (!(cmd->meta.flags & CMD_ASYNC)) {
++		clear_bit(STATUS_HCMD_ACTIVE, &priv->status);
++		wake_up_interruptible(&priv->wait_command_queue);
++	}
++}
++
++/************************** RX-FUNCTIONS ****************************/
++/*
++ * Rx theory of operation
++ *
++ * The host allocates 32 DMA target addresses and passes the host address
++ * to the firmware at register IWL_RFDS_TABLE_LOWER + N * RFD_SIZE where N is
++ * 0 to 31
++ *
++ * Rx Queue Indexes
++ * The host/firmware share two index registers for managing the Rx buffers.
++ *
++ * The READ index maps to the first position that the firmware may be writing
++ * to -- the driver can read up to (but not including) this position and get
++ * good data.
++ * The READ index is managed by the firmware once the card is enabled.
++ *
++ * The WRITE index maps to the last position the driver has read from -- the
++ * position preceding WRITE is the last slot the firmware can place a packet.
++ *
++ * The queue is empty (no good data) if WRITE = READ - 1, and is full if
++ * WRITE = READ.
++ *
++ * During initialization the host sets up the READ queue position to the first
++ * INDEX position, and WRITE to the last (READ - 1 wrapped)
++ *
++ * When the firmware places a packet in a buffer it will advance the READ index
++ * and fire the RX interrupt.  The driver can then query the READ index and
++ * process as many packets as possible, moving the WRITE index forward as it
++ * resets the Rx queue buffers with new memory.
++ *
++ * The management in the driver is as follows:
++ * + A list of pre-allocated SKBs is stored in iwl->rxq->rx_free.  When
++ *   iwl->rxq->free_count drops to or below RX_LOW_WATERMARK, work is scheduled
++ *   to replensish the iwl->rxq->rx_free.
++ * + In iwl_rx_replenish (scheduled) if 'processed' != 'read' then the
++ *   iwl->rxq is replenished and the READ INDEX is updated (updating the
++ *   'processed' and 'read' driver indexes as well)
++ * + A received packet is processed and handed to the kernel network stack,
++ *   detached from the iwl->rxq.  The driver 'processed' index is updated.
++ * + The Host/Firmware iwl->rxq is replenished at tasklet time from the rx_free
++ *   list. If there are no allocated buffers in iwl->rxq->rx_free, the READ
++ *   INDEX is not incremented and iwl->status(RX_STALLED) is set.  If there
++ *   were enough free buffers and RX_STALLED is set it is cleared.
++ *
++ *
++ * Driver sequence:
++ *
++ * iwl_rx_queue_alloc()       Allocates rx_free
++ * iwl_rx_replenish()         Replenishes rx_free list from rx_used, and calls
++ *                            iwl_rx_queue_restock
++ * iwl_rx_queue_restock()     Moves available buffers from rx_free into Rx
++ *                            queue, updates firmware pointers, and updates
++ *                            the WRITE index.  If insufficient rx_free buffers
++ *                            are available, schedules iwl_rx_replenish
++ *
++ * -- enable interrupts --
++ * ISR - iwl_rx()             Detach iwl_rx_mem_buffers from pool up to the
++ *                            READ INDEX, detaching the SKB from the pool.
++ *                            Moves the packet buffer from queue to rx_used.
++ *                            Calls iwl_rx_queue_restock to refill any empty
++ *                            slots.
++ * ...
++ *
++ */
++
++/**
++ * iwl_rx_queue_space - Return number of free slots available in queue.
++ */
++static int iwl_rx_queue_space(const struct iwl_rx_queue *q)
++{
++	int s = q->read - q->write;
++	if (s <= 0)
++		s += RX_QUEUE_SIZE;
++	/* keep some buffer to not confuse full and empty queue */
++	s -= 2;
++	if (s < 0)
++		s = 0;
++	return s;
++}
++
++/**
++ * iwl_rx_queue_update_write_ptr - Update the write pointer for the RX queue
++ *
++ * NOTE: This function has 3945 and 4965 specific code sections
++ * but is declared in base due to the majority of the
++ * implementation being the same (only a numeric constant is
++ * different)
++ *
++ */
++int iwl_rx_queue_update_write_ptr(struct iwl_priv *priv, struct iwl_rx_queue *q)
++{
++	u32 reg = 0;
++	int rc = 0;
++	unsigned long flags;
++
++	spin_lock_irqsave(&q->lock, flags);
++
++	if (q->need_update == 0)
++		goto exit_unlock;
++
++	if (test_bit(STATUS_POWER_PMI, &priv->status)) {
++		reg = iwl_read32(priv, CSR_UCODE_DRV_GP1);
++
++		if (reg & CSR_UCODE_DRV_GP1_BIT_MAC_SLEEP) {
++			iwl_set_bit(priv, CSR_GP_CNTRL,
++				    CSR_GP_CNTRL_REG_FLAG_MAC_ACCESS_REQ);
++			goto exit_unlock;
++		}
++
++		rc = iwl_grab_restricted_access(priv);
++		if (rc)
++			goto exit_unlock;
++
++		iwl_write_restricted(priv, FH_RSCSR_CHNL0_WPTR,
++				     q->write & ~0x7);
++		iwl_release_restricted_access(priv);
++	} else
++		iwl_write32(priv, FH_RSCSR_CHNL0_WPTR, q->write & ~0x7);
++
++
++	q->need_update = 0;
++
++ exit_unlock:
++	spin_unlock_irqrestore(&q->lock, flags);
++	return rc;
++}
++
++/**
++ * iwl_dma_addr2rbd_ptr - convert a DMA address to a uCode read buffer pointer.
++ *
++ * NOTE: This function has 3945 and 4965 specific code paths in it.
++ */
++static inline __le32 iwl_dma_addr2rbd_ptr(struct iwl_priv *priv,
++					  dma_addr_t dma_addr)
++{
++	return cpu_to_le32((u32)(dma_addr >> 8));
++}
++
++
++/**
++ * iwl_rx_queue_restock - refill RX queue from pre-allocated pool
++ *
++ * If there are slots in the RX queue that  need to be restocked,
++ * and we have free pre-allocated buffers, fill the ranks as much
++ * as we can pulling from rx_free.
++ *
++ * This moves the 'write' index forward to catch up with 'processed', and
++ * also updates the memory address in the firmware to reference the new
++ * target buffer.
++ */
++int iwl_rx_queue_restock(struct iwl_priv *priv)
++{
++	struct iwl_rx_queue *rxq = &priv->rxq;
++	struct list_head *element;
++	struct iwl_rx_mem_buffer *rxb;
++	unsigned long flags;
++	int write, rc;
++
++	spin_lock_irqsave(&rxq->lock, flags);
++	write = rxq->write & ~0x7;
++	while ((iwl_rx_queue_space(rxq) > 0) && (rxq->free_count)) {
++		element = rxq->rx_free.next;
++		rxb = list_entry(element, struct iwl_rx_mem_buffer, list);
++		list_del(element);
++		rxq->bd[rxq->write] = iwl_dma_addr2rbd_ptr(priv, rxb->dma_addr);
++		rxq->queue[rxq->write] = rxb;
++		rxq->write = (rxq->write + 1) & RX_QUEUE_MASK;
++		rxq->free_count--;
++	}
++	spin_unlock_irqrestore(&rxq->lock, flags);
++	/* If the pre-allocated buffer pool is dropping low, schedule to
++	 * refill it */
++	if (rxq->free_count <= RX_LOW_WATERMARK)
++		queue_work(priv->workqueue, &priv->rx_replenish);
++
++
++	/* If we've added more space for the firmware to place data, tell it */
++	if ((write != (rxq->write & ~0x7))
++	    || (abs(rxq->write - rxq->read) > 7)) {
++		spin_lock_irqsave(&rxq->lock, flags);
++		rxq->need_update = 1;
++		spin_unlock_irqrestore(&rxq->lock, flags);
++		rc = iwl_rx_queue_update_write_ptr(priv, rxq);
++		if (rc)
++			return rc;
++	}
++
++	return 0;
++}
++
++/**
++ * iwl_rx_replensih - Move all used packet from rx_used to rx_free
++ *
++ * When moving to rx_free an SKB is allocated for the slot.
++ *
++ * Also restock the Rx queue via iwl_rx_queue_restock.
++ * This is called as a scheduled work item (except for during intialization)
++ */
++void iwl_rx_replenish(void *data)
++{
++	struct iwl_priv *priv = data;
++	struct iwl_rx_queue *rxq = &priv->rxq;
++	struct list_head *element;
++	struct iwl_rx_mem_buffer *rxb;
++	unsigned long flags;
++	spin_lock_irqsave(&rxq->lock, flags);
++	while (!list_empty(&rxq->rx_used)) {
++		element = rxq->rx_used.next;
++		rxb = list_entry(element, struct iwl_rx_mem_buffer, list);
++		rxb->skb =
++		    alloc_skb(IWL_RX_BUF_SIZE, __GFP_NOWARN | GFP_ATOMIC);
++		if (!rxb->skb) {
++			if (net_ratelimit())
++				printk(KERN_CRIT DRV_NAME
++				       ": Can not allocate SKB buffers\n");
++			/* We don't reschedule replenish work here -- we will
++			 * call the restock method and if it still needs
++			 * more buffers it will schedule replenish */
++			break;
++		}
++		priv->alloc_rxb_skb++;
++		list_del(element);
++		rxb->dma_addr =
++		    pci_map_single(priv->pci_dev, rxb->skb->data,
++				   IWL_RX_BUF_SIZE, PCI_DMA_FROMDEVICE);
++		list_add_tail(&rxb->list, &rxq->rx_free);
++		rxq->free_count++;
++	}
++	spin_unlock_irqrestore(&rxq->lock, flags);
++
++	spin_lock_irqsave(&priv->lock, flags);
++	iwl_rx_queue_restock(priv);
++	spin_unlock_irqrestore(&priv->lock, flags);
++}
++
++/* Assumes that the skb field of the buffers in 'pool' is kept accurate.
++ * If an SKB has been detached, the POOL needs to have it's SKB set to NULL
++ * This free routine walks the list of POOL entries and if SKB is set to
++ * non NULL it is unmapped and freed
++ */
++void iwl_rx_queue_free(struct iwl_priv *priv, struct iwl_rx_queue *rxq)
++{
++	int i;
++	for (i = 0; i < RX_QUEUE_SIZE + RX_FREE_BUFFERS; i++) {
++		if (rxq->pool[i].skb != NULL) {
++			pci_unmap_single(priv->pci_dev,
++					 rxq->pool[i].dma_addr,
++					 IWL_RX_BUF_SIZE, PCI_DMA_FROMDEVICE);
++			dev_kfree_skb(rxq->pool[i].skb);
++		}
++	}
++
++	pci_free_consistent(priv->pci_dev, 4 * RX_QUEUE_SIZE, rxq->bd,
++			    rxq->dma_addr);
++	rxq->bd = NULL;
++}
++
++int iwl_rx_queue_alloc(struct iwl_priv *priv)
++{
++	struct iwl_rx_queue *rxq = &priv->rxq;
++	struct pci_dev *dev = priv->pci_dev;
++	int i;
++
++	spin_lock_init(&rxq->lock);
++	INIT_LIST_HEAD(&rxq->rx_free);
++	INIT_LIST_HEAD(&rxq->rx_used);
++	rxq->bd = pci_alloc_consistent(dev, 4 * RX_QUEUE_SIZE, &rxq->dma_addr);
++	if (!rxq->bd)
++		return -ENOMEM;
++	/* Fill the rx_used queue with _all_ of the Rx buffers */
++	for (i = 0; i < RX_FREE_BUFFERS + RX_QUEUE_SIZE; i++)
++		list_add_tail(&rxq->pool[i].list, &rxq->rx_used);
++	/* Set us so that we have processed and used all buffers, but have
++	 * not restocked the Rx queue with fresh buffers */
++	rxq->read = rxq->write = 0;
++	rxq->free_count = 0;
++	rxq->need_update = 0;
++	return 0;
++}
++
++void iwl_rx_queue_reset(struct iwl_priv *priv, struct iwl_rx_queue *rxq)
++{
++	unsigned long flags;
++	int i;
++	spin_lock_irqsave(&rxq->lock, flags);
++	INIT_LIST_HEAD(&rxq->rx_free);
++	INIT_LIST_HEAD(&rxq->rx_used);
++	/* Fill the rx_used queue with _all_ of the Rx buffers */
++	for (i = 0; i < RX_FREE_BUFFERS + RX_QUEUE_SIZE; i++) {
++		/* In the reset function, these buffers may have been allocated
++		 * to an SKB, so we need to unmap and free potential storage */
++		if (rxq->pool[i].skb != NULL) {
++			pci_unmap_single(priv->pci_dev,
++					 rxq->pool[i].dma_addr,
++					 IWL_RX_BUF_SIZE, PCI_DMA_FROMDEVICE);
++			priv->alloc_rxb_skb--;
++			dev_kfree_skb(rxq->pool[i].skb);
++			rxq->pool[i].skb = NULL;
++		}
++		list_add_tail(&rxq->pool[i].list, &rxq->rx_used);
++	}
++
++	/* Set us so that we have processed and used all buffers, but have
++	 * not restocked the Rx queue with fresh buffers */
++	rxq->read = rxq->write = 0;
++	rxq->free_count = 0;
++	spin_unlock_irqrestore(&rxq->lock, flags);
++}
++
++/* Convert linear signal-to-noise ratio into dB */
++static u8 ratio2dB[100] = {
++/*	 0   1   2   3   4   5   6   7   8   9 */
++	 0,  0,  6, 10, 12, 14, 16, 17, 18, 19, /* 00 - 09 */
++	20, 21, 22, 22, 23, 23, 24, 25, 26, 26, /* 10 - 19 */
++	26, 26, 26, 27, 27, 28, 28, 28, 29, 29, /* 20 - 29 */
++	29, 30, 30, 30, 31, 31, 31, 31, 32, 32, /* 30 - 39 */
++	32, 32, 32, 33, 33, 33, 33, 33, 34, 34, /* 40 - 49 */
++	34, 34, 34, 34, 35, 35, 35, 35, 35, 35, /* 50 - 59 */
++	36, 36, 36, 36, 36, 36, 36, 37, 37, 37, /* 60 - 69 */
++	37, 37, 37, 37, 37, 38, 38, 38, 38, 38, /* 70 - 79 */
++	38, 38, 38, 38, 38, 39, 39, 39, 39, 39, /* 80 - 89 */
++	39, 39, 39, 39, 39, 40, 40, 40, 40, 40  /* 90 - 99 */
++};
++
++/* Calculates a relative dB value from a ratio of linear
++ *   (i.e. not dB) signal levels.
++ * Conversion assumes that levels are voltages (20*log), not powers (10*log). */
++int iwl_calc_db_from_ratio(int sig_ratio)
++{
++	/* Anything above 1000:1 just report as 60 dB */
++	if (sig_ratio > 1000)
++		return 60;
++
++	/* Above 100:1, divide by 10 and use table,
++	 *   add 20 dB to make up for divide by 10 */
++	if (sig_ratio > 100)
++		return (20 + (int)ratio2dB[sig_ratio/10]);
++
++	/* We shouldn't see this */
++	if (sig_ratio < 1)
++		return 0;
++
++	/* Use table for ratios 1:1 - 99:1 */
++	return (int)ratio2dB[sig_ratio];
++}
++
++#define PERFECT_RSSI (-20) /* dBm */
++#define WORST_RSSI (-95)   /* dBm */
++#define RSSI_RANGE (PERFECT_RSSI - WORST_RSSI)
++
++/* Calculate an indication of rx signal quality (a percentage, not dBm!).
++ * See http://www.ces.clemson.edu/linux/signal_quality.shtml for info
++ *   about formulas used below. */
++int iwl_calc_sig_qual(int rssi_dbm, int noise_dbm)
++{
++	int sig_qual;
++	int degradation = PERFECT_RSSI - rssi_dbm;
++
++	/* If we get a noise measurement, use signal-to-noise ratio (SNR)
++	 * as indicator; formula is (signal dbm - noise dbm).
++	 * SNR at or above 40 is a great signal (100%).
++	 * Below that, scale to fit SNR of 0 - 40 dB within 0 - 100% indicator.
++	 * Weakest usable signal is usually 10 - 15 dB SNR. */
++	if (noise_dbm) {
++		if (rssi_dbm - noise_dbm >= 40)
++			return 100;
++		else if (rssi_dbm < noise_dbm)
++			return 0;
++		sig_qual = ((rssi_dbm - noise_dbm) * 5) / 2;
++
++	/* Else use just the signal level.
++	 * This formula is a least squares fit of data points collected and
++	 *   compared with a reference system that had a percentage (%) display
++	 *   for signal quality. */
++	} else
++		sig_qual = (100 * (RSSI_RANGE * RSSI_RANGE) - degradation *
++			    (15 * RSSI_RANGE + 62 * degradation)) /
++			   (RSSI_RANGE * RSSI_RANGE);
++
++	if (sig_qual > 100)
++		sig_qual = 100;
++	else if (sig_qual < 1)
++		sig_qual = 0;
++
++	return sig_qual;
++}
++
++/**
++ * iwl_rx_handle - Main entry function for receiving responses from the uCode
++ *
++ * Uses the priv->rx_handlers callback function array to invoke
++ * the appropriate handlers, including command responses,
++ * frame-received notifications, and other notifications.
++ */
++static void iwl_rx_handle(struct iwl_priv *priv)
++{
++	struct iwl_rx_mem_buffer *rxb;
++	struct iwl_rx_packet *pkt;
++	struct iwl_rx_queue *rxq = &priv->rxq;
++	u32 r, i;
++	int reclaim;
++	unsigned long flags;
++
++	r = iwl_hw_get_rx_read(priv);
++	i = rxq->read;
++
++	/* Rx interrupt, but nothing sent from uCode */
++	if (i == r)
++		IWL_DEBUG(IWL_DL_RX | IWL_DL_ISR, "r = %d, i = %d\n", r, i);
++
++	while (i != r) {
++		rxb = rxq->queue[i];
++
++		/* If an RXB doesn't have a queue slot associated with it
++		 * then a bug has been introduced in the queue refilling
++		 * routines -- catch it here */
++		BUG_ON(rxb == NULL);
++
++		rxq->queue[i] = NULL;
++
++		pci_dma_sync_single_for_cpu(priv->pci_dev, rxb->dma_addr,
++					    IWL_RX_BUF_SIZE,
++					    PCI_DMA_FROMDEVICE);
++		pkt = (struct iwl_rx_packet *)rxb->skb->data;
++
++		/* Reclaim a command buffer only if this packet is a response
++		 *   to a (driver-originated) command.
++		 * If the packet (e.g. Rx frame) originated from uCode,
++		 *   there is no command buffer to reclaim.
++		 * Ucode should set SEQ_RX_FRAME bit if ucode-originated,
++		 *   but apparently a few don't get set; catch them here. */
++		reclaim = !(pkt->hdr.sequence & SEQ_RX_FRAME) &&
++			(pkt->hdr.cmd != REPLY_RX_PHY_CMD) &&
++			(pkt->hdr.cmd != REPLY_4965_RX) &&
++			(pkt->hdr.cmd != STATISTICS_NOTIFICATION) &&
++			(pkt->hdr.cmd != REPLY_TX);
++
++		/* Based on type of command response or notification,
++		 *   handle those that need handling via function in
++		 *   rx_handlers table.  See iwl_setup_rx_handlers() */
++		if (priv->rx_handlers[pkt->hdr.cmd]) {
++			IWL_DEBUG(IWL_DL_HOST_COMMAND | IWL_DL_RX | IWL_DL_ISR,
++				"r = %d, i = %d, %s, 0x%02x\n", r, i,
++				get_cmd_string(pkt->hdr.cmd), pkt->hdr.cmd);
++			priv->rx_handlers[pkt->hdr.cmd] (priv, rxb);
++		} else {
++			/* No handling needed */
++			IWL_DEBUG(IWL_DL_HOST_COMMAND | IWL_DL_RX | IWL_DL_ISR,
++				"r %d i %d No handler needed for %s, 0x%02x\n",
++				r, i, get_cmd_string(pkt->hdr.cmd),
++				pkt->hdr.cmd);
++		}
++
++		if (reclaim) {
++			/* Invoke any callbacks, transfer the skb to caller,
++			 * and fire off the (possibly) blocking iwl_send_cmd()
++			 * as we reclaim the driver command queue */
++			if (rxb && rxb->skb)
++				iwl_tx_cmd_complete(priv, rxb);
++			else
++				IWL_WARNING("Claim null rxb?\n");
++		}
++
++		/* For now we just don't re-use anything.  We can tweak this
++		 * later to try and re-use notification packets and SKBs that
++		 * fail to Rx correctly */
++		if (rxb->skb != NULL) {
++			priv->alloc_rxb_skb--;
++			dev_kfree_skb_any(rxb->skb);
++			rxb->skb = NULL;
++		}
++
++		pci_unmap_single(priv->pci_dev, rxb->dma_addr,
++				 IWL_RX_BUF_SIZE, PCI_DMA_FROMDEVICE);
++		spin_lock_irqsave(&rxq->lock, flags);
++		list_add_tail(&rxb->list, &priv->rxq.rx_used);
++		spin_unlock_irqrestore(&rxq->lock, flags);
++		i = (i + 1) & RX_QUEUE_MASK;
++	}
++
++	/* Backtrack one entry */
++	priv->rxq.read = i;
++	iwl_rx_queue_restock(priv);
++}
++
++int iwl_tx_queue_update_write_ptr(struct iwl_priv *priv,
++				  struct iwl_tx_queue *txq)
++{
++	u32 reg = 0;
++	int rc = 0;
++	int txq_id = txq->q.id;
++
++	if (txq->need_update == 0)
++		return rc;
++
++	/* if we're trying to save power */
++	if (test_bit(STATUS_POWER_PMI, &priv->status)) {
++		/* wake up nic if it's powered down ...
++		 * uCode will wake up, and interrupt us again, so next
++		 * time we'll skip this part. */
++		reg = iwl_read32(priv, CSR_UCODE_DRV_GP1);
++
++		if (reg & CSR_UCODE_DRV_GP1_BIT_MAC_SLEEP) {
++			IWL_DEBUG_INFO("Requesting wakeup, GP1 = 0x%x\n", reg);
++			iwl_set_bit(priv, CSR_GP_CNTRL,
++				    CSR_GP_CNTRL_REG_FLAG_MAC_ACCESS_REQ);
++			return rc;
++		}
++
++		/* restore this queue's parameters in nic hardware. */
++		rc = iwl_grab_restricted_access(priv);
++		if (rc)
++			return rc;
++		iwl_write_restricted(priv, HBUS_TARG_WRPTR,
++				     txq->q.first_empty | (txq_id << 8));
++		iwl_release_restricted_access(priv);
++
++	/* else not in power-save mode, uCode will never sleep when we're
++	 * trying to tx (during RFKILL, we're not trying to tx). */
++	} else
++		iwl_write32(priv, HBUS_TARG_WRPTR,
++			    txq->q.first_empty | (txq_id << 8));
++
++	txq->need_update = 0;
++
++	return rc;
++}
++
++#ifdef CONFIG_IWLWIFI_DEBUG
++static void iwl_print_rx_config_cmd(struct iwl_rxon_cmd *rxon)
++{
++	IWL_DEBUG_RADIO("RX CONFIG:\n");
++	iwl_print_hex_dump(IWL_DL_RADIO, (u8 *) rxon, sizeof(*rxon));
++	IWL_DEBUG_RADIO("u16 channel: 0x%x\n", le16_to_cpu(rxon->channel));
++	IWL_DEBUG_RADIO("u32 flags: 0x%08X\n", le32_to_cpu(rxon->flags));
++	IWL_DEBUG_RADIO("u32 filter_flags: 0x%08x\n",
++			le32_to_cpu(rxon->filter_flags));
++	IWL_DEBUG_RADIO("u8 dev_type: 0x%x\n", rxon->dev_type);
++	IWL_DEBUG_RADIO("u8 ofdm_basic_rates: 0x%02x\n",
++			rxon->ofdm_basic_rates);
++	IWL_DEBUG_RADIO("u8 cck_basic_rates: 0x%02x\n", rxon->cck_basic_rates);
++	IWL_DEBUG_RADIO("u8[6] node_addr: " MAC_FMT "\n",
++			MAC_ARG(rxon->node_addr));
++	IWL_DEBUG_RADIO("u8[6] bssid_addr: " MAC_FMT "\n",
++			MAC_ARG(rxon->bssid_addr));
++	IWL_DEBUG_RADIO("u16 assoc_id: 0x%x\n", le16_to_cpu(rxon->assoc_id));
++}
++#endif
++
++static void iwl_enable_interrupts(struct iwl_priv *priv)
++{
++	IWL_DEBUG_ISR("Enabling interrupts\n");
++	set_bit(STATUS_INT_ENABLED, &priv->status);
++	iwl_write32(priv, CSR_INT_MASK, CSR_INI_SET_MASK);
++}
++
++static inline void iwl_disable_interrupts(struct iwl_priv *priv)
++{
++	clear_bit(STATUS_INT_ENABLED, &priv->status);
++
++	/* disable interrupts from uCode/NIC to host */
++	iwl_write32(priv, CSR_INT_MASK, 0x00000000);
++
++	/* acknowledge/clear/reset any interrupts still pending
++	 * from uCode or flow handler (Rx/Tx DMA) */
++	iwl_write32(priv, CSR_INT, 0xffffffff);
++	iwl_write32(priv, CSR_FH_INT_STATUS, 0xffffffff);
++	IWL_DEBUG_ISR("Disabled interrupts\n");
++}
++
++static const char *desc_lookup(int i)
++{
++	switch (i) {
++	case 1:
++		return "FAIL";
++	case 2:
++		return "BAD_PARAM";
++	case 3:
++		return "BAD_CHECKSUM";
++	case 4:
++		return "NMI_INTERRUPT";
++	case 5:
++		return "SYSASSERT";
++	case 6:
++		return "FATAL_ERROR";
++	}
++
++	return "UNKNOWN";
++}
++
++#define ERROR_START_OFFSET  (1 * sizeof(u32))
++#define ERROR_ELEM_SIZE     (7 * sizeof(u32))
++
++static void iwl_dump_nic_error_log(struct iwl_priv *priv)
++{
++	u32 data2, line;
++	u32 desc, time, count, base, data1;
++	u32 blink1, blink2, ilink1, ilink2;
++	int rc;
++
++	base = le32_to_cpu(priv->card_alive.error_event_table_ptr);
++
++	if (!iwl_hw_valid_rtc_data_addr(base)) {
++		IWL_ERROR("Not valid error log pointer 0x%08X\n", base);
++		return;
++	}
++
++	rc = iwl_grab_restricted_access(priv);
++	if (rc) {
++		IWL_WARNING("Can not read from adapter at this time.\n");
++		return;
++	}
++
++	count = iwl_read_restricted_mem(priv, base);
++
++	if (ERROR_START_OFFSET <= count * ERROR_ELEM_SIZE) {
++		IWL_ERROR("Start IWL Error Log Dump:\n");
++		IWL_ERROR("Status: 0x%08lX, Config: %08X count: %d\n",
++			  priv->status, priv->config, count);
++	}
++
++	desc = iwl_read_restricted_mem(priv, base + 1 * sizeof(u32));
++	blink1 = iwl_read_restricted_mem(priv, base + 3 * sizeof(u32));
++	blink2 = iwl_read_restricted_mem(priv, base + 4 * sizeof(u32));
++	ilink1 = iwl_read_restricted_mem(priv, base + 5 * sizeof(u32));
++	ilink2 = iwl_read_restricted_mem(priv, base + 6 * sizeof(u32));
++	data1 = iwl_read_restricted_mem(priv, base + 7 * sizeof(u32));
++	data2 = iwl_read_restricted_mem(priv, base + 8 * sizeof(u32));
++	line = iwl_read_restricted_mem(priv, base + 9 * sizeof(u32));
++	time = iwl_read_restricted_mem(priv, base + 11 * sizeof(u32));
++
++	IWL_ERROR("Desc               Time       "
++		  "data1      data2      line\n");
++	IWL_ERROR("%-13s (#%d) %010u 0x%08X 0x%08X %u\n",
++		  desc_lookup(desc), desc, time, data1, data2, line);
++	IWL_ERROR("blink1  blink2  ilink1  ilink2\n");
++	IWL_ERROR("0x%05X 0x%05X 0x%05X 0x%05X\n", blink1, blink2,
++		  ilink1, ilink2);
++
++	iwl_release_restricted_access(priv);
++}
++
++#define EVENT_START_OFFSET  (4 * sizeof(u32))
++
++/**
++ * iwl_print_event_log - Dump error event log to syslog
++ *
++ * NOTE: Must be called with iwl_grab_restricted_access() already obtained!
++ */
++static void iwl_print_event_log(struct iwl_priv *priv, u32 start_idx,
++				u32 num_events, u32 mode)
++{
++	u32 i;
++	u32 base;       /* SRAM byte address of event log header */
++	u32 event_size;	/* 2 u32s, or 3 u32s if timestamp recorded */
++	u32 ptr;        /* SRAM byte address of log data */
++	u32 ev, time, data; /* event log data */
++
++	if (num_events == 0)
++		return;
++
++	base = le32_to_cpu(priv->card_alive.log_event_table_ptr);
++
++	if (mode == 0)
++		event_size = 2 * sizeof(u32);
++	else
++		event_size = 3 * sizeof(u32);
++
++	ptr = base + EVENT_START_OFFSET + (start_idx * event_size);
++
++	/* "time" is actually "data" for mode 0 (no timestamp).
++	 * place event id # at far right for easier visual parsing. */
++	for (i = 0; i < num_events; i++) {
++		ev = iwl_read_restricted_mem(priv, ptr);
++		ptr += sizeof(u32);
++		time = iwl_read_restricted_mem(priv, ptr);
++		ptr += sizeof(u32);
++		if (mode == 0)
++			IWL_ERROR("0x%08x\t%04u\n", time, ev); /* data, ev */
++		else {
++			data = iwl_read_restricted_mem(priv, ptr);
++			ptr += sizeof(u32);
++			IWL_ERROR("%010u\t0x%08x\t%04u\n", time, data, ev);
++		}
++	}
++}
++
++static void iwl_dump_nic_event_log(struct iwl_priv *priv)
++{
++	int rc;
++	u32 base;       /* SRAM byte address of event log header */
++	u32 capacity;   /* event log capacity in # entries */
++	u32 mode;       /* 0 - no timestamp, 1 - timestamp recorded */
++	u32 num_wraps;  /* # times uCode wrapped to top of log */
++	u32 next_entry; /* index of next entry to be written by uCode */
++	u32 size;       /* # entries that we'll print */
++
++	base = le32_to_cpu(priv->card_alive.log_event_table_ptr);
++	if (!iwl_hw_valid_rtc_data_addr(base)) {
++		IWL_ERROR("Invalid event log pointer 0x%08X\n", base);
++		return;
++	}
++
++	rc = iwl_grab_restricted_access(priv);
++	if (rc) {
++		IWL_WARNING("Can not read from adapter at this time.\n");
++		return;
++	}
++
++	/* event log header */
++	capacity = iwl_read_restricted_mem(priv, base);
++	mode = iwl_read_restricted_mem(priv, base + (1 * sizeof(u32)));
++	num_wraps = iwl_read_restricted_mem(priv, base + (2 * sizeof(u32)));
++	next_entry = iwl_read_restricted_mem(priv, base + (3 * sizeof(u32)));
++
++	size = num_wraps ? capacity : next_entry;
++
++	/* bail out if nothing in log */
++	if (size == 0) {
++		IWL_ERROR("Start IPW Event Log Dump: nothing in log\n");
++		iwl_release_restricted_access(priv);
++		return;
++	}
++
++	IWL_ERROR("Start IPW Event Log Dump: display count %d, wraps %d\n",
++		  size, num_wraps);
++
++	/* if uCode has wrapped back to top of log, start at the oldest entry,
++	 * i.e the next one that uCode would fill. */
++	if (num_wraps)
++		iwl_print_event_log(priv, next_entry,
++				    capacity - next_entry, mode);
++
++	/* (then/else) start at top of log */
++	iwl_print_event_log(priv, 0, next_entry, mode);
++
++	iwl_release_restricted_access(priv);
++}
++
++/**
++ * iwl_irq_handle_error - called for HW or SW error interrupt from card
++ */
++static void iwl_irq_handle_error(struct iwl_priv *priv)
++{
++	/* Set the FW error flag -- cleared on iwl_down */
++	set_bit(STATUS_FW_ERROR, &priv->status);
++
++	/* Cancel currently queued command. */
++	clear_bit(STATUS_HCMD_ACTIVE, &priv->status);
++
++#ifdef CONFIG_IWLWIFI_DEBUG
++	if (iwl_debug_level & IWL_DL_FW_ERRORS) {
++		iwl_dump_nic_error_log(priv);
++		iwl_dump_nic_event_log(priv);
++		iwl_print_rx_config_cmd(&priv->staging_rxon);
++	}
++#endif
++
++	wake_up_interruptible(&priv->wait_command_queue);
++
++	/* Keep the restart process from trying to send host
++	 * commands by clearing the INIT status bit */
++	clear_bit(STATUS_READY, &priv->status);
++
++	if (!test_bit(STATUS_EXIT_PENDING, &priv->status)) {
++		IWL_DEBUG(IWL_DL_INFO | IWL_DL_FW_ERRORS,
++			  "Restarting adapter due to uCode error.\n");
++
++		if (iwl_is_associated(priv)) {
++			memcpy(&priv->recovery_rxon, &priv->active_rxon,
++			       sizeof(priv->recovery_rxon));
++			priv->error_recovering = 1;
++		}
++		queue_work(priv->workqueue, &priv->restart);
++	}
++}
++
++static void iwl_error_recovery(struct iwl_priv *priv)
++{
++	unsigned long flags;
++
++	memcpy(&priv->staging_rxon, &priv->recovery_rxon,
++	       sizeof(priv->staging_rxon));
++	priv->staging_rxon.filter_flags &= ~RXON_FILTER_ASSOC_MSK;
++	iwl_commit_rxon(priv);
++
++	iwl_rxon_add_station(priv, priv->bssid, 1);
++
++	spin_lock_irqsave(&priv->lock, flags);
++	priv->assoc_id = le16_to_cpu(priv->staging_rxon.assoc_id);
++	priv->error_recovering = 0;
++	spin_unlock_irqrestore(&priv->lock, flags);
++}
++
++static void iwl_irq_tasklet(struct iwl_priv *priv)
++{
++	u32 inta, handled = 0;
++	u32 inta_fh;
++	unsigned long flags;
++#ifdef CONFIG_IWLWIFI_DEBUG
++	u32 inta_mask;
++#endif
++
++	spin_lock_irqsave(&priv->lock, flags);
++
++	/* Ack/clear/reset pending uCode interrupts.
++	 * Note:  Some bits in CSR_INT are "OR" of bits in CSR_FH_INT_STATUS,
++	 *  and will clear only when CSR_FH_INT_STATUS gets cleared. */
++	inta = iwl_read32(priv, CSR_INT);
++	iwl_write32(priv, CSR_INT, inta);
++
++	/* Ack/clear/reset pending flow-handler (DMA) interrupts.
++	 * Any new interrupts that happen after this, either while we're
++	 * in this tasklet, or later, will show up in next ISR/tasklet. */
++	inta_fh = iwl_read32(priv, CSR_FH_INT_STATUS);
++	iwl_write32(priv, CSR_FH_INT_STATUS, inta_fh);
++
++#ifdef CONFIG_IWLWIFI_DEBUG
++	if (iwl_debug_level & IWL_DL_ISR) {
++		inta_mask = iwl_read32(priv, CSR_INT_MASK); /* just for debug */
++		IWL_DEBUG_ISR("inta 0x%08x, enabled 0x%08x, fh 0x%08x\n",
++			      inta, inta_mask, inta_fh);
++	}
++#endif
++
++	/* Since CSR_INT and CSR_FH_INT_STATUS reads and clears are not
++	 * atomic, make sure that inta covers all the interrupts that
++	 * we've discovered, even if FH interrupt came in just after
++	 * reading CSR_INT. */
++	if (inta_fh & CSR_FH_INT_RX_MASK)
++		inta |= CSR_INT_BIT_FH_RX;
++	if (inta_fh & CSR_FH_INT_TX_MASK)
++		inta |= CSR_INT_BIT_FH_TX;
++
++	/* Now service all interrupt bits discovered above. */
++	if (inta & CSR_INT_BIT_HW_ERR) {
++		IWL_ERROR("Microcode HW error detected.  Restarting.\n");
++
++		/* Tell the device to stop sending interrupts */
++		iwl_disable_interrupts(priv);
++
++		iwl_irq_handle_error(priv);
++
++		handled |= CSR_INT_BIT_HW_ERR;
++
++		spin_unlock_irqrestore(&priv->lock, flags);
++
++		return;
++	}
++
++#ifdef CONFIG_IWLWIFI_DEBUG
++	if (iwl_debug_level & (IWL_DL_ISR)) {
++		/* NIC fires this, but we don't use it, redundant with WAKEUP */
++		if (inta & CSR_INT_BIT_MAC_CLK_ACTV)
++			IWL_DEBUG_ISR("Microcode started or stopped.\n");
++
++		/* Alive notification via Rx interrupt will do the real work */
++		if (inta & CSR_INT_BIT_ALIVE)
++			IWL_DEBUG_ISR("Alive interrupt\n");
++	}
++#endif
++	/* Safely ignore these bits for debug checks below */
++	inta &= ~(CSR_INT_BIT_MAC_CLK_ACTV | CSR_INT_BIT_ALIVE);
++
++	/* HW RF KILL switch toggled (4965 only) */
++	if (inta & CSR_INT_BIT_RF_KILL) {
++		int hw_rf_kill = 0;
++		if (!(iwl_read32(priv, CSR_GP_CNTRL) &
++				CSR_GP_CNTRL_REG_FLAG_HW_RF_KILL_SW))
++			hw_rf_kill = 1;
++
++		IWL_DEBUG(IWL_DL_INFO | IWL_DL_RF_KILL | IWL_DL_ISR,
++				"RF_KILL bit toggled to %s.\n",
++				hw_rf_kill ? "disable radio":"enable radio");
++
++		/* Queue restart only if RF_KILL switch was set to "kill"
++		 *   when we loaded driver, and is now set to "enable".
++		 * After we're Alive, RF_KILL gets handled by
++		 *   iwl_rx_card_state_notif() */
++		if (!hw_rf_kill && !test_bit(STATUS_ALIVE, &priv->status))
++			queue_work(priv->workqueue, &priv->restart);
++
++		handled |= CSR_INT_BIT_RF_KILL;
++	}
++
++	/* Chip got too hot and stopped itself (4965 only) */
++	if (inta & CSR_INT_BIT_CT_KILL) {
++		IWL_ERROR("Microcode CT kill error detected.\n");
++		handled |= CSR_INT_BIT_CT_KILL;
++	}
++
++	/* Error detected by uCode */
++	if (inta & CSR_INT_BIT_SW_ERR) {
++		IWL_ERROR("Microcode SW error detected.  Restarting 0x%X.\n",
++			  inta);
++		iwl_irq_handle_error(priv);
++		handled |= CSR_INT_BIT_SW_ERR;
++	}
++
++	/* uCode wakes up after power-down sleep */
++	if (inta & CSR_INT_BIT_WAKEUP) {
++		IWL_DEBUG_ISR("Wakeup interrupt\n");
++		iwl_rx_queue_update_write_ptr(priv, &priv->rxq);
++		iwl_tx_queue_update_write_ptr(priv, &priv->txq[0]);
++		iwl_tx_queue_update_write_ptr(priv, &priv->txq[1]);
++		iwl_tx_queue_update_write_ptr(priv, &priv->txq[2]);
++		iwl_tx_queue_update_write_ptr(priv, &priv->txq[3]);
++		iwl_tx_queue_update_write_ptr(priv, &priv->txq[4]);
++		iwl_tx_queue_update_write_ptr(priv, &priv->txq[5]);
++
++		handled |= CSR_INT_BIT_WAKEUP;
++	}
++
++	/* All uCode command responses, including Tx command responses,
++	 * Rx "responses" (frame-received notification), and other
++	 * notifications from uCode come through here*/
++	if (inta & (CSR_INT_BIT_FH_RX | CSR_INT_BIT_SW_RX)) {
++		iwl_rx_handle(priv);
++		handled |= (CSR_INT_BIT_FH_RX | CSR_INT_BIT_SW_RX);
++	}
++
++	if (inta & CSR_INT_BIT_FH_TX) {
++		IWL_DEBUG_ISR("Tx interrupt\n");
++		handled |= CSR_INT_BIT_FH_TX;
++	}
++
++	if (inta & ~handled)
++		IWL_ERROR("Unhandled INTA bits 0x%08x\n", inta & ~handled);
++
++	if (inta & ~CSR_INI_SET_MASK) {
++		IWL_WARNING("Disabled INTA bits 0x%08x were pending\n",
++			 inta & ~CSR_INI_SET_MASK);
++		IWL_WARNING("   with FH_INT = 0x%08x\n", inta_fh);
++	}
++
++	/* Re-enable all interrupts */
++	iwl_enable_interrupts(priv);
++
++#ifdef CONFIG_IWLWIFI_DEBUG
++	if (iwl_debug_level & (IWL_DL_ISR)) {
++		inta = iwl_read32(priv, CSR_INT);
++		inta_mask = iwl_read32(priv, CSR_INT_MASK);
++		inta_fh = iwl_read32(priv, CSR_FH_INT_STATUS);
++		IWL_DEBUG_ISR("End inta 0x%08x, enabled 0x%08x, fh 0x%08x, "
++			"flags 0x%08lx\n", inta, inta_mask, inta_fh, flags);
++	}
++#endif
++	spin_unlock_irqrestore(&priv->lock, flags);
++}
++
++static irqreturn_t iwl_isr(int irq, void *data)
++{
++	struct iwl_priv *priv = data;
++	u32 inta, inta_mask;
++	u32 inta_fh;
++	if (!priv)
++		return IRQ_NONE;
++
++	spin_lock(&priv->lock);
++
++	/* Disable (but don't clear!) interrupts here to avoid
++	 *    back-to-back ISRs and sporadic interrupts from our NIC.
++	 * If we have something to service, the tasklet will re-enable ints.
++	 * If we *don't* have something, we'll re-enable before leaving here. */
++	inta_mask = iwl_read32(priv, CSR_INT_MASK);  /* just for debug */
++	iwl_write32(priv, CSR_INT_MASK, 0x00000000);
++
++	/* Discover which interrupts are active/pending */
++	inta = iwl_read32(priv, CSR_INT);
++	inta_fh = iwl_read32(priv, CSR_FH_INT_STATUS);
++
++	/* Ignore interrupt if there's nothing in NIC to service.
++	 * This may be due to IRQ shared with another device,
++	 * or due to sporadic interrupts thrown from our NIC. */
++	if (!inta && !inta_fh) {
++		IWL_DEBUG_ISR("Ignore interrupt, inta == 0, inta_fh == 0\n");
++		goto none;
++	}
++
++	if ((inta == 0xFFFFFFFF) || ((inta & 0xFFFFFFF0) == 0xa5a5a5a0)) {
++		/* Hardware disappeared */
++		IWL_WARNING("HARDWARE GONE?? INTA == 0x%080x\n", inta);
++		goto none;
++	}
++
++	IWL_DEBUG_ISR("ISR inta 0x%08x, enabled 0x%08x, fh 0x%08x\n",
++		      inta, inta_mask, inta_fh);
++
++	/* iwl_irq_tasklet() will service interrupts and re-enable them */
++	tasklet_schedule(&priv->irq_tasklet);
++	spin_unlock(&priv->lock);
++
++	return IRQ_HANDLED;
++
++ none:
++	/* re-enable interrupts here since we don't have anything to service. */
++	iwl_enable_interrupts(priv);
++	spin_unlock(&priv->lock);
++	return IRQ_NONE;
++}
++
++/************************** EEPROM BANDS ****************************
++ *
++ * The iwl_eeprom_band definitions below provide the mapping from the
++ * EEPROM contents to the specific channel number supported for each
++ * band.
++ *
++ * For example, iwl_priv->eeprom.band_3_channels[4] from the band_3
++ * definition below maps to physical channel 42 in the 5.2GHz spectrum.
++ * The specific geography and calibration information for that channel
++ * is contained in the eeprom map itself.
++ *
++ * During init, we copy the eeprom information and channel map
++ * information into priv->channel_info_24/52 and priv->channel_map_24/52
++ *
++ * channel_map_24/52 provides the index in the channel_info array for a
++ * given channel.  We have to have two separate maps as there is channel
++ * overlap with the 2.4GHz and 5.2GHz spectrum as seen in band_1 and
++ * band_2
++ *
++ * A value of 0xff stored in the channel_map indicates that the channel
++ * is not supported by the hardware at all.
++ *
++ * A value of 0xfe in the channel_map indicates that the channel is not
++ * valid for Tx with the current hardware.  This means that
++ * while the system can tune and receive on a given channel, it may not
++ * be able to associate or transmit any frames on that
++ * channel.  There is no corresponding channel information for that
++ * entry.
++ *
++ *********************************************************************/
++
++/* 2.4 GHz */
++static const u8 iwl_eeprom_band_1[14] = {
++	1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14
++};
++
++/* 5.2 GHz bands */
++static const u8 iwl_eeprom_band_2[] = {
++	183, 184, 185, 187, 188, 189, 192, 196, 7, 8, 11, 12, 16
++};
++
++static const u8 iwl_eeprom_band_3[] = {	/* 5205-5320MHz */
++	34, 36, 38, 40, 42, 44, 46, 48, 52, 56, 60, 64
++};
++
++static const u8 iwl_eeprom_band_4[] = {	/* 5500-5700MHz */
++	100, 104, 108, 112, 116, 120, 124, 128, 132, 136, 140
++};
++
++static const u8 iwl_eeprom_band_5[] = {	/* 5725-5825MHz */
++	145, 149, 153, 157, 161, 165
++};
++
++static u8 iwl_eeprom_band_6[] = {       /* 2.4 FAT channel */
++	1, 2, 3, 4, 5, 6, 7
++};
++
++static u8 iwl_eeprom_band_7[] = {       /* 5.2 FAT channel */
++	36, 44, 52, 60, 100, 108, 116, 124, 132, 149, 157
++};
++
++static void iwl_init_band_reference(const struct iwl_priv *priv, int band,
++				    int *eeprom_ch_count,
++				    const struct iwl_eeprom_channel
++				    **eeprom_ch_info,
++				    const u8 **eeprom_ch_index)
++{
++	switch (band) {
++	case 1:		/* 2.4GHz band */
++		*eeprom_ch_count = ARRAY_SIZE(iwl_eeprom_band_1);
++		*eeprom_ch_info = priv->eeprom.band_1_channels;
++		*eeprom_ch_index = iwl_eeprom_band_1;
++		break;
++	case 2:		/* 5.2GHz band */
++		*eeprom_ch_count = ARRAY_SIZE(iwl_eeprom_band_2);
++		*eeprom_ch_info = priv->eeprom.band_2_channels;
++		*eeprom_ch_index = iwl_eeprom_band_2;
++		break;
++	case 3:		/* 5.2GHz band */
++		*eeprom_ch_count = ARRAY_SIZE(iwl_eeprom_band_3);
++		*eeprom_ch_info = priv->eeprom.band_3_channels;
++		*eeprom_ch_index = iwl_eeprom_band_3;
++		break;
++	case 4:		/* 5.2GHz band */
++		*eeprom_ch_count = ARRAY_SIZE(iwl_eeprom_band_4);
++		*eeprom_ch_info = priv->eeprom.band_4_channels;
++		*eeprom_ch_index = iwl_eeprom_band_4;
++		break;
++	case 5:		/* 5.2GHz band */
++		*eeprom_ch_count = ARRAY_SIZE(iwl_eeprom_band_5);
++		*eeprom_ch_info = priv->eeprom.band_5_channels;
++		*eeprom_ch_index = iwl_eeprom_band_5;
++		break;
++	case 6:
++		*eeprom_ch_count = ARRAY_SIZE(iwl_eeprom_band_6);
++		*eeprom_ch_info = priv->eeprom.band_24_channels;
++		*eeprom_ch_index = iwl_eeprom_band_6;
++		break;
++	case 7:
++		*eeprom_ch_count = ARRAY_SIZE(iwl_eeprom_band_7);
++		*eeprom_ch_info = priv->eeprom.band_52_channels;
++		*eeprom_ch_index = iwl_eeprom_band_7;
++		break;
++	default:
++		BUG();
++		return;
++	}
++}
++
++const struct iwl_channel_info *iwl_get_channel_info(const struct iwl_priv *priv,
++						    int phymode, u16 channel)
++{
++	int i;
++
++	switch (phymode) {
++	case MODE_IEEE80211A:
++		for (i = 14; i < priv->channel_count; i++) {
++			if (priv->channel_info[i].channel == channel)
++				return &priv->channel_info[i];
++		}
++		break;
++
++	case MODE_IEEE80211B:
++	case MODE_IEEE80211G:
++		if (channel >= 1 && channel <= 14)
++			return &priv->channel_info[channel - 1];
++		break;
++
++	}
++
++	return NULL;
++}
++
++#define CHECK_AND_PRINT(x) ((eeprom_ch_info[ch].flags & EEPROM_CHANNEL_##x) \
++			    ? # x " " : "")
++
++static int iwl_init_channel_map(struct iwl_priv *priv)
++{
++	int eeprom_ch_count = 0;
++	const u8 *eeprom_ch_index = NULL;
++	const struct iwl_eeprom_channel *eeprom_ch_info = NULL;
++	int band, ch;
++	struct iwl_channel_info *ch_info;
++
++	if (priv->channel_count) {
++		IWL_DEBUG_INFO("Channel map already initialized.\n");
++		return 0;
++	}
++
++	if (priv->eeprom.version < 0x2f) {
++		IWL_WARNING("Unsupported EEPROM version: 0x%04X\n",
++			    priv->eeprom.version);
++		return -EINVAL;
++	}
++
++	IWL_DEBUG_INFO("Initializing regulatory info from EEPROM\n");
++
++	priv->channel_count =
++	    ARRAY_SIZE(iwl_eeprom_band_1) +
++	    ARRAY_SIZE(iwl_eeprom_band_2) +
++	    ARRAY_SIZE(iwl_eeprom_band_3) +
++	    ARRAY_SIZE(iwl_eeprom_band_4) +
++	    ARRAY_SIZE(iwl_eeprom_band_5);
++
++	IWL_DEBUG_INFO("Parsing data for %d channels.\n", priv->channel_count);
++
++	priv->channel_info = kzalloc(sizeof(struct iwl_channel_info) *
++				     priv->channel_count, GFP_KERNEL);
++	if (!priv->channel_info) {
++		IWL_ERROR("Could not allocate channel_info\n");
++		priv->channel_count = 0;
++		return -ENOMEM;
++	}
++
++	ch_info = priv->channel_info;
++
++	/* Loop through the 5 EEPROM bands adding them in order to the
++	 * channel map we maintain (that contains additional information than
++	 * what just in the EEPROM) */
++	for (band = 1; band <= 5; band++) {
++
++		iwl_init_band_reference(priv, band, &eeprom_ch_count,
++					&eeprom_ch_info, &eeprom_ch_index);
++
++		/* Loop through each band adding each of the channels */
++		for (ch = 0; ch < eeprom_ch_count; ch++) {
++			ch_info->channel = eeprom_ch_index[ch];
++			ch_info->phymode = (band == 1) ? MODE_IEEE80211B :
++			    MODE_IEEE80211A;
++
++			/* permanently store EEPROM's channel regulatory flags
++			 *   and max power in channel info database. */
++			ch_info->eeprom = eeprom_ch_info[ch];
++
++			/* Copy the run-time flags so they are there even on
++			 * invalid channels */
++			ch_info->flags = eeprom_ch_info[ch].flags;
++
++			if (!(is_channel_valid(ch_info))) {
++				IWL_DEBUG_INFO("Ch. %d Flags %x [%sGHz] - "
++					       "No traffic\n",
++					       ch_info->channel,
++					       ch_info->flags,
++					       is_channel_a_band(ch_info) ?
++					       "5.2" : "2.4");
++				ch_info++;
++				continue;
++			}
++
++			/* Initialize regulatory-based run-time data */
++			ch_info->max_power_avg = ch_info->curr_txpow =
++			    eeprom_ch_info[ch].max_power_avg;
++			ch_info->scan_power = eeprom_ch_info[ch].max_power_avg;
++			ch_info->min_power = 0;
++
++			IWL_DEBUG_INFO("Ch. %d [%sGHz] %s%s%s%s%s%s(0x%02x"
++				       " %ddBm): Ad-Hoc %ssupported\n",
++				       ch_info->channel,
++				       is_channel_a_band(ch_info) ?
++				       "5.2" : "2.4",
++				       CHECK_AND_PRINT(IBSS),
++				       CHECK_AND_PRINT(ACTIVE),
++				       CHECK_AND_PRINT(RADAR),
++				       CHECK_AND_PRINT(WIDE),
++				       CHECK_AND_PRINT(NARROW),
++				       CHECK_AND_PRINT(DFS),
++				       eeprom_ch_info[ch].flags,
++				       eeprom_ch_info[ch].max_power_avg,
++				       ((eeprom_ch_info[ch].
++					 flags & EEPROM_CHANNEL_IBSS)
++					&& !(eeprom_ch_info[ch].
++					     flags & EEPROM_CHANNEL_RADAR))
++				       ? "" : "not ");
++
++			/* Set the user_txpower_limit to the highest power
++			 * supported by any channel */
++			if (eeprom_ch_info[ch].max_power_avg >
++			    priv->user_txpower_limit)
++				priv->user_txpower_limit =
++				    eeprom_ch_info[ch].max_power_avg;
++
++			ch_info++;
++		}
++	}
++
++	for (band = 6; band <= 7; band++) {
++		int phymode;
++		u8 fat_extension_chan;
++
++		iwl_init_band_reference(priv, band, &eeprom_ch_count,
++					&eeprom_ch_info, &eeprom_ch_index);
++
++		phymode = (band == 6) ? MODE_IEEE80211B : MODE_IEEE80211A;
++		/* Loop through each band adding each of the channels */
++		for (ch = 0; ch < eeprom_ch_count; ch++) {
++
++			if ((band == 6) &&
++			    ((eeprom_ch_index[ch] == 5) ||
++			    (eeprom_ch_index[ch] == 6) ||
++			    (eeprom_ch_index[ch] == 7)))
++			       fat_extension_chan = HT_IE_EXT_CHANNEL_MAX;
++			else
++				fat_extension_chan = HT_IE_EXT_CHANNEL_ABOVE;
++
++			iwl4965_set_fat_chan_info(priv, phymode,
++						  eeprom_ch_index[ch],
++						  &(eeprom_ch_info[ch]),
++						  fat_extension_chan);
++
++			iwl4965_set_fat_chan_info(priv, phymode,
++						  (eeprom_ch_index[ch] + 4),
++						  &(eeprom_ch_info[ch]),
++						  HT_IE_EXT_CHANNEL_BELOW);
++		}
++	}
++
++	return 0;
++}
++
++/* For active scan, listen ACTIVE_DWELL_TIME (msec) on each channel after
++ * sending probe req.  This should be set long enough to hear probe responses
++ * from more than one AP.  */
++#define IWL_ACTIVE_DWELL_TIME_24    (20)	/* all times in msec */
++#define IWL_ACTIVE_DWELL_TIME_52    (10)
++
++/* For faster active scanning, scan will move to the next channel if fewer than
++ * PLCP_QUIET_THRESH packets are heard on this channel within
++ * ACTIVE_QUIET_TIME after sending probe request.  This shortens the dwell
++ * time if it's a quiet channel (nothing responded to our probe, and there's
++ * no other traffic).
++ * Disable "quiet" feature by setting PLCP_QUIET_THRESH to 0. */
++#define IWL_PLCP_QUIET_THRESH       __constant_cpu_to_le16(1)	/* packets */
++#define IWL_ACTIVE_QUIET_TIME       __constant_cpu_to_le16(5)	/* msec */
++
++/* For passive scan, listen PASSIVE_DWELL_TIME (msec) on each channel.
++ * Must be set longer than active dwell time.
++ * For the most reliable scan, set > AP beacon interval (typically 100msec). */
++#define IWL_PASSIVE_DWELL_TIME_24   (20)	/* all times in msec */
++#define IWL_PASSIVE_DWELL_TIME_52   (10)
++#define IWL_PASSIVE_DWELL_BASE      (100)
++#define IWL_CHANNEL_TUNE_TIME       5
++
++static inline u16 iwl_get_active_dwell_time(struct iwl_priv *priv, int phymode)
++{
++	if (phymode == MODE_IEEE80211A)
++		return IWL_ACTIVE_DWELL_TIME_52;
++	else
++		return IWL_ACTIVE_DWELL_TIME_24;
++}
++
++static u16 iwl_get_passive_dwell_time(struct iwl_priv *priv, int phymode)
++{
++	u16 active = iwl_get_active_dwell_time(priv, phymode);
++	u16 passive = (phymode != MODE_IEEE80211A) ?
++	    IWL_PASSIVE_DWELL_BASE + IWL_PASSIVE_DWELL_TIME_24 :
++	    IWL_PASSIVE_DWELL_BASE + IWL_PASSIVE_DWELL_TIME_52;
++
++	if (iwl_is_associated(priv)) {
++		/* If we're associated, we clamp the maximum passive
++		 * dwell time to be 98% of the beacon interval (minus
++		 * 2 * channel tune time) */
++		passive = priv->beacon_int;
++		if ((passive > IWL_PASSIVE_DWELL_BASE) || !passive)
++			passive = IWL_PASSIVE_DWELL_BASE;
++		passive = (passive * 98) / 100 - IWL_CHANNEL_TUNE_TIME * 2;
++	}
++
++	if (passive <= active)
++		passive = active + 1;
++
++	return passive;
++}
++
++static int iwl_get_channels_for_scan(struct iwl_priv *priv, int phymode,
++				     u8 is_active, u8 direct_mask,
++				     struct iwl_scan_channel *scan_ch)
++{
++	const struct ieee80211_channel *channels = NULL;
++	const struct ieee80211_hw_mode *hw_mode;
++	const struct iwl_channel_info *ch_info;
++	u16 passive_dwell = 0;
++	u16 active_dwell = 0;
++	int added, i;
++
++	hw_mode = iwl_get_hw_mode(priv, phymode);
++	if (!hw_mode)
++		return 0;
++
++	channels = hw_mode->channels;
++
++	active_dwell = iwl_get_active_dwell_time(priv, phymode);
++	passive_dwell = iwl_get_passive_dwell_time(priv, phymode);
++
++	for (i = 0, added = 0; i < hw_mode->num_channels; i++) {
++		if (channels[i].chan ==
++		    le16_to_cpu(priv->active_rxon.channel)) {
++			if (iwl_is_associated(priv)) {
++				IWL_DEBUG_SCAN
++				    ("Skipping current channel %d\n",
++				     le16_to_cpu(priv->active_rxon.channel));
++				continue;
++			}
++		} else if (priv->only_active_channel)
++			continue;
++
++		scan_ch->channel = channels[i].chan;
++
++		ch_info = iwl_get_channel_info(priv, phymode, scan_ch->channel);
++		if (!is_channel_valid(ch_info)) {
++			IWL_DEBUG_SCAN("Channel %d is INVALID for this SKU.\n",
++				       scan_ch->channel);
++			continue;
++		}
++
++		if (!is_active || is_channel_passive(ch_info) ||
++		    !(channels[i].flag & IEEE80211_CHAN_W_ACTIVE_SCAN))
++			scan_ch->type = 0;	/* passive */
++		else
++			scan_ch->type = 1;	/* active */
++
++		if (scan_ch->type & 1)
++			scan_ch->type |= (direct_mask << 1);
++
++		if (is_channel_narrow(ch_info))
++			scan_ch->type |= (1 << 7);
++
++		scan_ch->active_dwell = cpu_to_le16(active_dwell);
++		scan_ch->passive_dwell = cpu_to_le16(passive_dwell);
++
++		/* Set power levels to defaults */
++		scan_ch->tpc.dsp_atten = 110;
++		/* scan_pwr_info->tpc.dsp_atten; */
++
++		/*scan_pwr_info->tpc.tx_gain; */
++		if (phymode == MODE_IEEE80211A)
++			scan_ch->tpc.tx_gain = ((1 << 5) | (3 << 3)) | 3;
++		else {
++			scan_ch->tpc.tx_gain = ((1 << 5) | (5 << 3));
++			/* NOTE: if we were doing 6Mb OFDM for scans we'd use
++			 * power level
++			 scan_ch->tpc.tx_gain = ((1<<5) | (2 << 3)) | 3;
++			 */
++		}
++
++		IWL_DEBUG_SCAN("Scanning %d [%s %d]\n",
++			       scan_ch->channel,
++			       (scan_ch->type & 1) ? "ACTIVE" : "PASSIVE",
++			       (scan_ch->type & 1) ?
++			       active_dwell : passive_dwell);
++
++		scan_ch++;
++		added++;
++	}
++
++	IWL_DEBUG_SCAN("total channels to scan %d \n", added);
++	return added;
++}
++
++static void iwl_reset_channel_flag(struct iwl_priv *priv)
++{
++	int i, j;
++	for (i = 0; i < 3; i++) {
++		struct ieee80211_hw_mode *hw_mode = (void *)&priv->modes[i];
++		for (j = 0; j < hw_mode->num_channels; j++)
++			hw_mode->channels[j].flag = hw_mode->channels[j].val;
++	}
++}
++
++static void iwl_init_hw_rates(struct iwl_priv *priv,
++			      struct ieee80211_rate *rates)
++{
++	int i;
++
++	for (i = 0; i < IWL_RATE_COUNT; i++) {
++		rates[i].rate = iwl_rates[i].ieee * 5;
++		rates[i].val = i; /* Rate scaling will work on indexes */
++		rates[i].val2 = i;
++		rates[i].flags = IEEE80211_RATE_SUPPORTED;
++		/* Only OFDM have the bits-per-symbol set */
++		if ((i <= IWL_LAST_OFDM_RATE) && (i >= IWL_FIRST_OFDM_RATE))
++			rates[i].flags |= IEEE80211_RATE_OFDM;
++		else {
++			/*
++			 * If CCK 1M then set rate flag to CCK else CCK_2
++			 * which is CCK | PREAMBLE2
++			 */
++			rates[i].flags |= (iwl_rates[i].plcp == 10) ?
++				IEEE80211_RATE_CCK : IEEE80211_RATE_CCK_2;
++		}
++
++		/* Set up which ones are basic rates... */
++		if (IWL_BASIC_RATES_MASK & (1 << i))
++			rates[i].flags |= IEEE80211_RATE_BASIC;
++	}
++
++	iwl4965_init_hw_rates(priv, rates);
++}
++
++/**
++ * iwl_init_geos - Initialize mac80211's geo/channel info based from eeprom
++ */
++static int iwl_init_geos(struct iwl_priv *priv)
++{
++	struct iwl_channel_info *ch;
++	struct ieee80211_hw_mode *modes;
++	struct ieee80211_channel *channels;
++	struct ieee80211_channel *geo_ch;
++	struct ieee80211_rate *rates;
++	int i = 0;
++	enum {
++		A = 0,
++		B = 1,
++		G = 2,
++		A_11N = 3,
++		G_11N = 4,
++	};
++	int mode_count = 5;
++
++	if (priv->modes) {
++		IWL_DEBUG_INFO("Geography modes already initialized.\n");
++		set_bit(STATUS_GEO_CONFIGURED, &priv->status);
++		return 0;
++	}
++
++	modes = kzalloc(sizeof(struct ieee80211_hw_mode) * mode_count,
++			GFP_KERNEL);
++	if (!modes)
++		return -ENOMEM;
++
++	channels = kzalloc(sizeof(struct ieee80211_channel) *
++			   priv->channel_count, GFP_KERNEL);
++	if (!channels) {
++		kfree(modes);
++		return -ENOMEM;
++	}
++
++	rates = kzalloc((sizeof(struct ieee80211_rate) * (IWL_MAX_RATES + 1)),
++			GFP_KERNEL);
++	if (!rates) {
++		kfree(modes);
++		kfree(channels);
++		return -ENOMEM;
++	}
++
++	/* 0 = 802.11a
++	 * 1 = 802.11b
++	 * 2 = 802.11g
++	 */
++
++	/* 5.2GHz channels start after the 2.4GHz channels */
++	modes[A].mode = MODE_IEEE80211A;
++	modes[A].channels = &channels[ARRAY_SIZE(iwl_eeprom_band_1)];
++	modes[A].rates = rates;
++	modes[A].num_rates = 8;	/* just OFDM */
++	modes[A].rates = &rates[4];
++	modes[A].num_channels = 0;
++
++	modes[B].mode = MODE_IEEE80211B;
++	modes[B].channels = channels;
++	modes[B].rates = rates;
++	modes[B].num_rates = 4;	/* just CCK */
++	modes[B].num_channels = 0;
++
++	modes[G].mode = MODE_IEEE80211G;
++	modes[G].channels = channels;
++	modes[G].rates = rates;
++	modes[G].num_rates = 12;	/* OFDM & CCK */
++	modes[G].num_channels = 0;
++
++	modes[G_11N].mode = MODE_IEEE80211G;
++	modes[G_11N].channels = channels;
++	modes[G_11N].num_rates = 13;        /* OFDM & CCK */
++	modes[G_11N].rates = rates;
++	modes[G_11N].num_channels = 0;
++
++	modes[A_11N].mode = MODE_IEEE80211A;
++	modes[A_11N].channels = &channels[ARRAY_SIZE(iwl_eeprom_band_1)];
++	modes[A_11N].rates = &rates[4];
++	modes[A_11N].num_rates = 9; /* just OFDM */
++	modes[A_11N].num_channels = 0;
++
++	priv->ieee_channels = channels;
++	priv->ieee_rates = rates;
++
++	iwl_init_hw_rates(priv, rates);
++
++	for (i = 0, geo_ch = channels; i < priv->channel_count; i++) {
++		ch = &priv->channel_info[i];
++
++		if (!is_channel_valid(ch)) {
++			IWL_DEBUG_INFO("Channel %d [%sGHz] is restricted -- "
++				    "skipping.\n",
++				    ch->channel, is_channel_a_band(ch) ?
++				    "5.2" : "2.4");
++			continue;
++		}
++
++		if (is_channel_a_band(ch)) {
++			geo_ch = &modes[A].channels[modes[A].num_channels++];
++			modes[A_11N].num_channels++;
++		} else {
++			geo_ch = &modes[B].channels[modes[B].num_channels++];
++			modes[G].num_channels++;
++			modes[G_11N].num_channels++;
++		}
++
++		geo_ch->freq = ieee80211chan2mhz(ch->channel);
++		geo_ch->chan = ch->channel;
++		geo_ch->power_level = ch->max_power_avg;
++		geo_ch->antenna_max = 0xff;
++
++		if (is_channel_valid(ch)) {
++			geo_ch->flag = IEEE80211_CHAN_W_SCAN;
++			if (ch->flags & EEPROM_CHANNEL_IBSS)
++				geo_ch->flag |= IEEE80211_CHAN_W_IBSS;
++
++			if (ch->flags & EEPROM_CHANNEL_ACTIVE)
++				geo_ch->flag |= IEEE80211_CHAN_W_ACTIVE_SCAN;
++
++			if (ch->flags & EEPROM_CHANNEL_RADAR)
++				geo_ch->flag |= IEEE80211_CHAN_W_RADAR_DETECT;
++
++			if (ch->max_power_avg > priv->max_channel_txpower_limit)
++				priv->max_channel_txpower_limit =
++				    ch->max_power_avg;
++		}
++
++		geo_ch->val = geo_ch->flag;
++	}
++
++	if ((modes[A].num_channels == 0) && priv->is_abg) {
++		printk(KERN_INFO DRV_NAME
++		       ": Incorrectly detected BG card as ABG.  Please send "
++		       "your PCI ID 0x%04X:0x%04X to maintainer.\n",
++		       priv->pci_dev->device, priv->pci_dev->subsystem_device);
++		priv->is_abg = 0;
++	}
++
++	printk(KERN_INFO DRV_NAME
++	       ": Tunable channels: %d 802.11bg, %d 802.11a channels\n",
++	       modes[G].num_channels, modes[A].num_channels);
++
++	/*
++	 * NOTE:  We register these in preference of order -- the
++	 * stack doesn't currently (as of 7.0.6 / Apr 24 '07) pick
++	 * a phymode based on rates or AP capabilities but seems to
++	 * configure it purely on if the channel being configured
++	 * is supported by a mode -- and the first match is taken
++	 */
++
++	if (modes[G].num_channels)
++		ieee80211_register_hwmode(priv->hw, &modes[G]);
++	if (modes[B].num_channels)
++		ieee80211_register_hwmode(priv->hw, &modes[B]);
++	if (modes[A].num_channels)
++		ieee80211_register_hwmode(priv->hw, &modes[A]);
++
++	priv->modes = modes;
++	set_bit(STATUS_GEO_CONFIGURED, &priv->status);
++
++	return 0;
++}
++
++/******************************************************************************
++ *
++ * uCode download functions
++ *
++ ******************************************************************************/
++
++static void iwl_dealloc_ucode_pci(struct iwl_priv *priv)
++{
++	if (priv->ucode_code.v_addr != NULL) {
++		pci_free_consistent(priv->pci_dev,
++				    priv->ucode_code.len,
++				    priv->ucode_code.v_addr,
++				    priv->ucode_code.p_addr);
++		priv->ucode_code.v_addr = NULL;
++	}
++	if (priv->ucode_data.v_addr != NULL) {
++		pci_free_consistent(priv->pci_dev,
++				    priv->ucode_data.len,
++				    priv->ucode_data.v_addr,
++				    priv->ucode_data.p_addr);
++		priv->ucode_data.v_addr = NULL;
++	}
++	if (priv->ucode_data_backup.v_addr != NULL) {
++		pci_free_consistent(priv->pci_dev,
++				    priv->ucode_data_backup.len,
++				    priv->ucode_data_backup.v_addr,
++				    priv->ucode_data_backup.p_addr);
++		priv->ucode_data_backup.v_addr = NULL;
++	}
++	if (priv->ucode_init.v_addr != NULL) {
++		pci_free_consistent(priv->pci_dev,
++				    priv->ucode_init.len,
++				    priv->ucode_init.v_addr,
++				    priv->ucode_init.p_addr);
++		priv->ucode_init.v_addr = NULL;
++	}
++	if (priv->ucode_init_data.v_addr != NULL) {
++		pci_free_consistent(priv->pci_dev,
++				    priv->ucode_init_data.len,
++				    priv->ucode_init_data.v_addr,
++				    priv->ucode_init_data.p_addr);
++		priv->ucode_init_data.v_addr = NULL;
++	}
++	if (priv->ucode_boot.v_addr != NULL) {
++		pci_free_consistent(priv->pci_dev,
++				    priv->ucode_boot.len,
++				    priv->ucode_boot.v_addr,
++				    priv->ucode_boot.p_addr);
++		priv->ucode_boot.v_addr = NULL;
++	}
++}
++
++/**
++ * iwl_verify_inst_full - verify runtime uCode image in card vs. host,
++ *     looking at all data.
++ */
++static int iwl_verify_inst_full(struct iwl_priv *priv, __le32 * image, u32 len)
++{
++	u32 val;
++	u32 save_len = len;
++	int rc = 0;
++	u32 errcnt;
++
++	IWL_DEBUG_INFO("ucode inst image size is %u\n", len);
++
++	rc = iwl_grab_restricted_access(priv);
++	if (rc)
++		return rc;
++
++	iwl_write_restricted(priv, HBUS_TARG_MEM_RADDR, RTC_INST_LOWER_BOUND);
++
++	errcnt = 0;
++	for (; len > 0; len -= sizeof(u32), image++) {
++		/* read data comes through single port, auto-incr addr */
++		/* NOTE: Use the debugless read so we don't flood kernel log
++		 * if IWL_DL_IO is set */
++		val = _iwl_read_restricted(priv, HBUS_TARG_MEM_RDAT);
++		if (val != le32_to_cpu(*image)) {
++			IWL_ERROR("uCode INST section is invalid at "
++				  "offset 0x%x, is 0x%x, s/b 0x%x\n",
++				  save_len - len, val, le32_to_cpu(*image));
++			rc = -EIO;
++			errcnt++;
++			if (errcnt >= 20)
++				break;
++		}
++	}
++
++	iwl_release_restricted_access(priv);
++
++	if (!errcnt)
++		IWL_DEBUG_INFO
++		    ("ucode image in INSTRUCTION memory is good\n");
++
++	return rc;
++}
++
++
++/**
++ * iwl_verify_inst_sparse - verify runtime uCode image in card vs. host,
++ *   using sample data 100 bytes apart.  If these sample points are good,
++ *   it's a pretty good bet that everything between them is good, too.
++ */
++static int iwl_verify_inst_sparse(struct iwl_priv *priv, __le32 *image, u32 len)
++{
++	u32 val;
++	int rc = 0;
++	u32 errcnt = 0;
++	u32 i;
++
++	IWL_DEBUG_INFO("ucode inst image size is %u\n", len);
++
++	rc = iwl_grab_restricted_access(priv);
++	if (rc)
++		return rc;
++
++	for (i = 0; i < len; i += 100, image += 100/sizeof(u32)) {
++		/* read data comes through single port, auto-incr addr */
++		/* NOTE: Use the debugless read so we don't flood kernel log
++		 * if IWL_DL_IO is set */
++		iwl_write_restricted(priv, HBUS_TARG_MEM_RADDR,
++			i + RTC_INST_LOWER_BOUND);
++		val = _iwl_read_restricted(priv, HBUS_TARG_MEM_RDAT);
++		if (val != le32_to_cpu(*image)) {
++#if 0 /* Enable this if you want to see details */
++			IWL_ERROR("uCode INST section is invalid at "
++				  "offset 0x%x, is 0x%x, s/b 0x%x\n",
++				  i, val, *image);
++#endif
++			rc = -EIO;
++			errcnt++;
++			if (errcnt >= 3)
++				break;
++		}
++	}
++
++	iwl_release_restricted_access(priv);
++
++	return rc;
++}
++
++
++/**
++ * iwl_verify_ucode - determine which instruction image is in SRAM,
++ *    and verify its contents
++ */
++static int iwl_verify_ucode(struct iwl_priv *priv)
++{
++	__le32 *image;
++	u32 len;
++	int rc = 0;
++
++	/* Try bootstrap */
++	image = (__le32 *)priv->ucode_boot.v_addr;
++	len = priv->ucode_boot.len;
++	rc = iwl_verify_inst_sparse(priv, image, len);
++	if (rc == 0) {
++		IWL_DEBUG_INFO("Bootstrap uCode is good in inst SRAM\n");
++		return 0;
++	}
++
++	/* Try initialize */
++	image = (__le32 *)priv->ucode_init.v_addr;
++	len = priv->ucode_init.len;
++	rc = iwl_verify_inst_sparse(priv, image, len);
++	if (rc == 0) {
++		IWL_DEBUG_INFO("Initialize uCode is good in inst SRAM\n");
++		return 0;
++	}
++
++	/* Try runtime/protocol */
++	image = (__le32 *)priv->ucode_code.v_addr;
++	len = priv->ucode_code.len;
++	rc = iwl_verify_inst_sparse(priv, image, len);
++	if (rc == 0) {
++		IWL_DEBUG_INFO("Runtime uCode is good in inst SRAM\n");
++		return 0;
++	}
++
++	IWL_ERROR("NO VALID UCODE IMAGE IN INSTRUCTION SRAM!!\n");
++
++	/* Show first several data entries in instruction SRAM.
++	 * Selection of bootstrap image is arbitrary. */
++	image = (__le32 *)priv->ucode_boot.v_addr;
++	len = priv->ucode_boot.len;
++	rc = iwl_verify_inst_full(priv, image, len);
++
++	return rc;
++}
++
++
++/* check contents of special bootstrap uCode SRAM */
++static int iwl_verify_bsm(struct iwl_priv *priv)
++{
++	__le32 *image = priv->ucode_boot.v_addr;
++	u32 len = priv->ucode_boot.len;
++	u32 reg;
++	u32 val;
++
++	IWL_DEBUG_INFO("Begin verify bsm\n");
++
++	/* verify BSM SRAM contents */
++	val = iwl_read_restricted_reg(priv, BSM_WR_DWCOUNT_REG);
++	for (reg = BSM_SRAM_LOWER_BOUND;
++	     reg < BSM_SRAM_LOWER_BOUND + len;
++	     reg += sizeof(u32), image ++) {
++		val = iwl_read_restricted_reg(priv, reg);
++		if (val != le32_to_cpu(*image)) {
++			IWL_ERROR("BSM uCode verification failed at "
++				  "addr 0x%08X+%u (of %u), is 0x%x, s/b 0x%x\n",
++				  BSM_SRAM_LOWER_BOUND,
++				  reg - BSM_SRAM_LOWER_BOUND, len,
++				  val, le32_to_cpu(*image));
++			return -EIO;
++		}
++	}
++
++	IWL_DEBUG_INFO("BSM bootstrap uCode image OK\n");
++
++	return 0;
++}
++
++/**
++ * iwl_load_bsm - Load bootstrap instructions
++ *
++ * BSM operation:
++ *
++ * The Bootstrap State Machine (BSM) stores a short bootstrap uCode program
++ * in special SRAM that does not power down during RFKILL.  When powering back
++ * up after power-saving sleeps (or during initial uCode load), the BSM loads
++ * the bootstrap program into the on-board processor, and starts it.
++ *
++ * The bootstrap program loads (via DMA) instructions and data for a new
++ * program from host DRAM locations indicated by the host driver in the
++ * BSM_DRAM_* registers.  Once the new program is loaded, it starts
++ * automatically.
++ *
++ * When initializing the NIC, the host driver points the BSM to the
++ * "initialize" uCode image.  This uCode sets up some internal data, then
++ * notifies host via "initialize alive" that it is complete.
++ *
++ * The host then replaces the BSM_DRAM_* pointer values to point to the
++ * normal runtime uCode instructions and a backup uCode data cache buffer
++ * (filled initially with starting data values for the on-board processor),
++ * then triggers the "initialize" uCode to load and launch the runtime uCode,
++ * which begins normal operation.
++ *
++ * When doing a power-save shutdown, runtime uCode saves data SRAM into
++ * the backup data cache in DRAM before SRAM is powered down.
++ *
++ * When powering back up, the BSM loads the bootstrap program.  This reloads
++ * the runtime uCode instructions and the backup data cache into SRAM,
++ * and re-launches the runtime uCode from where it left off.
++ */
++static int iwl_load_bsm(struct iwl_priv *priv)
++{
++	__le32 *image = priv->ucode_boot.v_addr;
++	u32 len = priv->ucode_boot.len;
++	dma_addr_t pinst;
++	dma_addr_t pdata;
++	u32 inst_len;
++	u32 data_len;
++	int rc;
++	int i;
++	u32 done;
++	u32 reg_offset;
++
++	IWL_DEBUG_INFO("Begin load bsm\n");
++
++	/* make sure bootstrap program is no larger than BSM's SRAM size */
++	if (len > IWL_MAX_BSM_SIZE)
++		return -EINVAL;
++
++	/* Tell bootstrap uCode where to find the "Initialize" uCode
++	 *   in host DRAM ... bits 31:0 for 3945, bits 35:4 for 4965.
++	 * NOTE:  iwl_initialize_alive_start() will replace these values,
++	 *        after the "initialize" uCode has run, to point to
++	 *        runtime/protocol instructions and backup data cache. */
++	pinst = priv->ucode_init.p_addr >> 4;
++	pdata = priv->ucode_init_data.p_addr >> 4;
++	inst_len = priv->ucode_init.len;
++	data_len = priv->ucode_init_data.len;
++
++	rc = iwl_grab_restricted_access(priv);
++	if (rc)
++		return rc;
++
++	iwl_write_restricted_reg(priv, BSM_DRAM_INST_PTR_REG, pinst);
++	iwl_write_restricted_reg(priv, BSM_DRAM_DATA_PTR_REG, pdata);
++	iwl_write_restricted_reg(priv, BSM_DRAM_INST_BYTECOUNT_REG, inst_len);
++	iwl_write_restricted_reg(priv, BSM_DRAM_DATA_BYTECOUNT_REG, data_len);
++
++	/* Fill BSM memory with bootstrap instructions */
++	for (reg_offset = BSM_SRAM_LOWER_BOUND;
++	     reg_offset < BSM_SRAM_LOWER_BOUND + len;
++	     reg_offset += sizeof(u32), image++)
++		_iwl_write_restricted_reg(priv, reg_offset,
++					  le32_to_cpu(*image));
++
++	rc = iwl_verify_bsm(priv);
++	if (rc) {
++		iwl_release_restricted_access(priv);
++		return rc;
++	}
++
++	/* Tell BSM to copy from BSM SRAM into instruction SRAM, when asked */
++	iwl_write_restricted_reg(priv, BSM_WR_MEM_SRC_REG, 0x0);
++	iwl_write_restricted_reg(priv, BSM_WR_MEM_DST_REG,
++				 RTC_INST_LOWER_BOUND);
++	iwl_write_restricted_reg(priv, BSM_WR_DWCOUNT_REG, len / sizeof(u32));
++
++	/* Load bootstrap code into instruction SRAM now,
++	 *   to prepare to load "initialize" uCode */
++	iwl_write_restricted_reg(priv, BSM_WR_CTRL_REG,
++		BSM_WR_CTRL_REG_BIT_START);
++
++	/* Wait for load of bootstrap uCode to finish */
++	for (i = 0; i < 100; i++) {
++		done = iwl_read_restricted_reg(priv, BSM_WR_CTRL_REG);
++		if (!(done & BSM_WR_CTRL_REG_BIT_START))
++			break;
++		udelay(10);
++	}
++	if (i < 100)
++		IWL_DEBUG_INFO("BSM write complete, poll %d iterations\n", i);
++	else {
++		IWL_ERROR("BSM write did not complete!\n");
++		return -EIO;
++	}
++
++	/* Enable future boot loads whenever power management unit triggers it
++	 *   (e.g. when powering back up after power-save shutdown) */
++	iwl_write_restricted_reg(priv, BSM_WR_CTRL_REG,
++		BSM_WR_CTRL_REG_BIT_START_EN);
++
++	iwl_release_restricted_access(priv);
++
++	return 0;
++}
++
++static void iwl_nic_start(struct iwl_priv *priv)
++{
++	/* Remove all resets to allow NIC to operate */
++	iwl_write32(priv, CSR_RESET, 0);
++}
++
++/**
++ * iwl_read_ucode - Read uCode images from disk file.
++ *
++ * Copy into buffers for card to fetch via bus-mastering
++ */
++static int iwl_read_ucode(struct iwl_priv *priv)
++{
++	struct iwl_ucode *ucode;
++	int rc = 0;
++	const struct firmware *ucode_raw;
++	const char *name = "iwlwifi-4965" IWL4965_UCODE_API ".ucode";
++	u8 *src;
++	size_t len;
++	u32 ver, inst_size, data_size, init_size, init_data_size, boot_size;
++
++	/* Ask kernel firmware_class module to get the boot firmware off disk.
++	 * request_firmware() is synchronous, file is in memory on return. */
++	rc = request_firmware(&ucode_raw, name, &priv->pci_dev->dev);
++	if (rc < 0) {
++		IWL_ERROR("%s firmware file req failed: Reason %d\n", name, rc);
++		goto error;
++	}
++
++	IWL_DEBUG_INFO("Got firmware '%s' file (%zd bytes) from disk\n",
++		       name, ucode_raw->size);
++
++	/* Make sure that we got at least our header! */
++	if (ucode_raw->size < sizeof(*ucode)) {
++		IWL_ERROR("File size way too small!\n");
++		rc = -EINVAL;
++		goto err_release;
++	}
++
++	/* Data from ucode file:  header followed by uCode images */
++	ucode = (void *)ucode_raw->data;
++
++	ver = le32_to_cpu(ucode->ver);
++	inst_size = le32_to_cpu(ucode->inst_size);
++	data_size = le32_to_cpu(ucode->data_size);
++	init_size = le32_to_cpu(ucode->init_size);
++	init_data_size = le32_to_cpu(ucode->init_data_size);
++	boot_size = le32_to_cpu(ucode->boot_size);
++
++	IWL_DEBUG_INFO("f/w package hdr ucode version = 0x%x\n", ver);
++	IWL_DEBUG_INFO("f/w package hdr runtime inst size = %u\n",
++		       inst_size);
++	IWL_DEBUG_INFO("f/w package hdr runtime data size = %u\n",
++		       data_size);
++	IWL_DEBUG_INFO("f/w package hdr init inst size = %u\n",
++		       init_size);
++	IWL_DEBUG_INFO("f/w package hdr init data size = %u\n",
++		       init_data_size);
++	IWL_DEBUG_INFO("f/w package hdr boot inst size = %u\n",
++		       boot_size);
++
++	/* Verify size of file vs. image size info in file's header */
++	if (ucode_raw->size < sizeof(*ucode) +
++		inst_size + data_size + init_size +
++		init_data_size + boot_size) {
++
++		IWL_DEBUG_INFO("uCode file size %d too small\n",
++			       (int)ucode_raw->size);
++		rc = -EINVAL;
++		goto err_release;
++	}
++
++	/* Verify that uCode images will fit in card's SRAM */
++	if (inst_size > IWL_MAX_INST_SIZE) {
++		IWL_DEBUG_INFO("uCode instr len %d too large to fit in card\n",
++			       (int)inst_size);
++		rc = -EINVAL;
++		goto err_release;
++	}
++
++	if (data_size > IWL_MAX_DATA_SIZE) {
++		IWL_DEBUG_INFO("uCode data len %d too large to fit in card\n",
++			       (int)data_size);
++		rc = -EINVAL;
++		goto err_release;
++	}
++	if (init_size > IWL_MAX_INST_SIZE) {
++		IWL_DEBUG_INFO
++		    ("uCode init instr len %d too large to fit in card\n",
++		     (int)init_size);
++		rc = -EINVAL;
++		goto err_release;
++	}
++	if (init_data_size > IWL_MAX_DATA_SIZE) {
++		IWL_DEBUG_INFO
++		    ("uCode init data len %d too large to fit in card\n",
++		     (int)init_data_size);
++		rc = -EINVAL;
++		goto err_release;
++	}
++	if (boot_size > IWL_MAX_BSM_SIZE) {
++		IWL_DEBUG_INFO
++		    ("uCode boot instr len %d too large to fit in bsm\n",
++		     (int)boot_size);
++		rc = -EINVAL;
++		goto err_release;
++	}
++
++	/* Allocate ucode buffers for card's bus-master loading ... */
++
++	/* Runtime instructions and 2 copies of data:
++	 * 1) unmodified from disk
++	 * 2) backup cache for save/restore during power-downs */
++	priv->ucode_code.len = inst_size;
++	priv->ucode_code.v_addr =
++	    pci_alloc_consistent(priv->pci_dev,
++				 priv->ucode_code.len,
++				 &(priv->ucode_code.p_addr));
++
++	priv->ucode_data.len = data_size;
++	priv->ucode_data.v_addr =
++	    pci_alloc_consistent(priv->pci_dev,
++				 priv->ucode_data.len,
++				 &(priv->ucode_data.p_addr));
++
++	priv->ucode_data_backup.len = data_size;
++	priv->ucode_data_backup.v_addr =
++	    pci_alloc_consistent(priv->pci_dev,
++				 priv->ucode_data_backup.len,
++				 &(priv->ucode_data_backup.p_addr));
++
++
++	/* Initialization instructions and data */
++	priv->ucode_init.len = init_size;
++	priv->ucode_init.v_addr =
++	    pci_alloc_consistent(priv->pci_dev,
++				 priv->ucode_init.len,
++				 &(priv->ucode_init.p_addr));
++
++	priv->ucode_init_data.len = init_data_size;
++	priv->ucode_init_data.v_addr =
++	    pci_alloc_consistent(priv->pci_dev,
++				 priv->ucode_init_data.len,
++				 &(priv->ucode_init_data.p_addr));
++
++	/* Bootstrap (instructions only, no data) */
++	priv->ucode_boot.len = boot_size;
++	priv->ucode_boot.v_addr =
++	    pci_alloc_consistent(priv->pci_dev,
++				 priv->ucode_boot.len,
++				 &(priv->ucode_boot.p_addr));
++
++	if (!priv->ucode_code.v_addr || !priv->ucode_data.v_addr ||
++	    !priv->ucode_init.v_addr || !priv->ucode_init_data.v_addr ||
++	    !priv->ucode_boot.v_addr || !priv->ucode_data_backup.v_addr)
++		goto err_pci_alloc;
++
++	/* Copy images into buffers for card's bus-master reads ... */
++
++	/* Runtime instructions (first block of data in file) */
++	src = &ucode->data[0];
++	len = priv->ucode_code.len;
++	IWL_DEBUG_INFO("Copying (but not loading) uCode instr len %d\n",
++		       (int)len);
++	memcpy(priv->ucode_code.v_addr, src, len);
++	IWL_DEBUG_INFO("uCode instr buf vaddr = 0x%p, paddr = 0x%08x\n",
++		priv->ucode_code.v_addr, (u32)priv->ucode_code.p_addr);
++
++	/* Runtime data (2nd block)
++	 * NOTE:  Copy into backup buffer will be done in iwl_up()  */
++	src = &ucode->data[inst_size];
++	len = priv->ucode_data.len;
++	IWL_DEBUG_INFO("Copying (but not loading) uCode data len %d\n",
++		       (int)len);
++	memcpy(priv->ucode_data.v_addr, src, len);
++	memcpy(priv->ucode_data_backup.v_addr, src, len);
++
++	/* Initialization instructions (3rd block) */
++	if (init_size) {
++		src = &ucode->data[inst_size + data_size];
++		len = priv->ucode_init.len;
++		IWL_DEBUG_INFO("Copying (but not loading) init instr len %d\n",
++			       (int)len);
++		memcpy(priv->ucode_init.v_addr, src, len);
++	}
++
++	/* Initialization data (4th block) */
++	if (init_data_size) {
++		src = &ucode->data[inst_size + data_size + init_size];
++		len = priv->ucode_init_data.len;
++		IWL_DEBUG_INFO("Copying (but not loading) init data len %d\n",
++			       (int)len);
++		memcpy(priv->ucode_init_data.v_addr, src, len);
++	}
++
++	/* Bootstrap instructions (5th block) */
++	src = &ucode->data[inst_size + data_size + init_size + init_data_size];
++	len = priv->ucode_boot.len;
++	IWL_DEBUG_INFO("Copying (but not loading) boot instr len %d\n",
++		       (int)len);
++	memcpy(priv->ucode_boot.v_addr, src, len);
++
++	/* We have our copies now, allow OS release its copies */
++	release_firmware(ucode_raw);
++	return 0;
++
++ err_pci_alloc:
++	IWL_ERROR("failed to allocate pci memory\n");
++	rc = -ENOMEM;
++	iwl_dealloc_ucode_pci(priv);
++
++ err_release:
++	release_firmware(ucode_raw);
++
++ error:
++	return rc;
++}
++
++
++/**
++ * iwl_set_ucode_ptrs - Set uCode address location
++ *
++ * Tell initialization uCode where to find runtime uCode.
++ *
++ * BSM registers initially contain pointers to initialization uCode.
++ * We need to replace them to load runtime uCode inst and data,
++ * and to save runtime data when powering down.
++ */
++static int iwl_set_ucode_ptrs(struct iwl_priv *priv)
++{
++	dma_addr_t pinst;
++	dma_addr_t pdata;
++	int rc = 0;
++	unsigned long flags;
++
++	/* bits 35:4 for 4965 */
++	pinst = priv->ucode_code.p_addr >> 4;
++	pdata = priv->ucode_data_backup.p_addr >> 4;
++
++	spin_lock_irqsave(&priv->lock, flags);
++	rc = iwl_grab_restricted_access(priv);
++	if (rc) {
++		spin_unlock_irqrestore(&priv->lock, flags);
++		return rc;
++	}
++
++	/* Tell bootstrap uCode where to find image to load */
++	iwl_write_restricted_reg(priv, BSM_DRAM_INST_PTR_REG, pinst);
++	iwl_write_restricted_reg(priv, BSM_DRAM_DATA_PTR_REG, pdata);
++	iwl_write_restricted_reg(priv, BSM_DRAM_DATA_BYTECOUNT_REG,
++				 priv->ucode_data.len);
++
++	/* Inst bytecount must be last to set up, bit 31 signals uCode
++	 *   that all new ptr/size info is in place */
++	iwl_write_restricted_reg(priv, BSM_DRAM_INST_BYTECOUNT_REG,
++				 priv->ucode_code.len | BSM_DRAM_INST_LOAD);
++
++	iwl_release_restricted_access(priv);
++
++	spin_unlock_irqrestore(&priv->lock, flags);
++
++	IWL_DEBUG_INFO("Runtime uCode pointers are set.\n");
++
++	return rc;
++}
++
++/**
++ * iwl_init_alive_start - Called after REPLY_ALIVE notification receieved
++ *
++ * Called after REPLY_ALIVE notification received from "initialize" uCode.
++ *
++ * The 4965 "initialize" ALIVE reply contains calibration data for:
++ *   Voltage, temperature, and MIMO tx gain correction, now stored in priv
++ *   (3945 does not contain this data).
++ *
++ * Tell "initialize" uCode to go ahead and load the runtime uCode.
++*/
++static void iwl_init_alive_start(struct iwl_priv *priv)
++{
++	/* Check alive response for "valid" sign from uCode */
++	if (priv->card_alive_init.is_valid != UCODE_VALID_OK) {
++		/* We had an error bringing up the hardware, so take it
++		 * all the way back down so we can try again */
++		IWL_DEBUG_INFO("Initialize Alive failed.\n");
++		goto restart;
++	}
++
++	/* Bootstrap uCode has loaded initialize uCode ... verify inst image.
++	 * This is a paranoid check, because we would not have gotten the
++	 * "initialize" alive if code weren't properly loaded.  */
++	if (iwl_verify_ucode(priv)) {
++		/* Runtime instruction load was bad;
++		 * take it all the way back down so we can try again */
++		IWL_DEBUG_INFO("Bad \"initialize\" uCode load.\n");
++		goto restart;
++	}
++
++	/* Calculate temperature */
++	priv->temperature = iwl4965_get_temperature(priv);
++
++	/* Send pointers to protocol/runtime uCode image ... init code will
++	 * load and launch runtime uCode, which will send us another "Alive"
++	 * notification. */
++	IWL_DEBUG_INFO("Initialization Alive received.\n");
++	if (iwl_set_ucode_ptrs(priv)) {
++		/* Runtime instruction load won't happen;
++		 * take it all the way back down so we can try again */
++		IWL_DEBUG_INFO("Couldn't set up uCode pointers.\n");
++		goto restart;
++	}
++	return;
++
++ restart:
++	queue_work(priv->workqueue, &priv->restart);
++}
++
++
++/**
++ * iwl_alive_start - called after REPLY_ALIVE notification received
++ *                   from protocol/runtime uCode (initialization uCode's
++ *                   Alive gets handled by iwl_init_alive_start()).
++ */
++static void iwl_alive_start(struct iwl_priv *priv)
++{
++	int rc = 0;
++
++	IWL_DEBUG_INFO("Runtime Alive received.\n");
++
++	if (priv->card_alive.is_valid != UCODE_VALID_OK) {
++		/* We had an error bringing up the hardware, so take it
++		 * all the way back down so we can try again */
++		IWL_DEBUG_INFO("Alive failed.\n");
++		goto restart;
++	}
++
++	/* Initialize uCode has loaded Runtime uCode ... verify inst image.
++	 * This is a paranoid check, because we would not have gotten the
++	 * "runtime" alive if code weren't properly loaded.  */
++	if (iwl_verify_ucode(priv)) {
++		/* Runtime instruction load was bad;
++		 * take it all the way back down so we can try again */
++		IWL_DEBUG_INFO("Bad runtime uCode load.\n");
++		goto restart;
++	}
++
++	iwl_clear_stations_table(priv);
++
++	rc = iwl4965_alive_notify(priv);
++	if (rc) {
++		IWL_WARNING("Could not complete ALIVE transition [ntf]: %d\n",
++			    rc);
++		goto restart;
++	}
++
++	/* After the ALIVE response, we can process host commands */
++	set_bit(STATUS_ALIVE, &priv->status);
++
++	/* Clear out the uCode error bit if it is set */
++	clear_bit(STATUS_FW_ERROR, &priv->status);
++
++	rc = iwl_init_channel_map(priv);
++	if (rc) {
++		IWL_ERROR("initializing regulatory failed: %d\n", rc);
++		return;
++	}
++
++	iwl_init_geos(priv);
++
++	if (iwl_is_rfkill(priv))
++		return;
++
++	if (!priv->mac80211_registered) {
++		/* Unlock so any user space entry points can call back into
++		 * the driver without a deadlock... */
++		mutex_unlock(&priv->mutex);
++		iwl_rate_control_register(priv->hw);
++		rc = ieee80211_register_hw(priv->hw);
++		priv->hw->conf.beacon_int = 100;
++		mutex_lock(&priv->mutex);
++
++		if (rc) {
++			IWL_ERROR("Failed to register network "
++				  "device (error %d)\n", rc);
++			return;
++		}
++
++		priv->mac80211_registered = 1;
++
++		iwl_reset_channel_flag(priv);
++	} else
++		ieee80211_start_queues(priv->hw);
++
++	priv->active_rate = priv->rates_mask;
++	priv->active_rate_basic = priv->rates_mask & IWL_BASIC_RATES_MASK;
++
++	iwl_send_power_mode(priv, IWL_POWER_LEVEL(priv->power_mode));
++
++	if (iwl_is_associated(priv)) {
++		struct iwl_rxon_cmd *active_rxon =
++				(struct iwl_rxon_cmd *)(&priv->active_rxon);
++
++		memcpy(&priv->staging_rxon, &priv->active_rxon,
++		       sizeof(priv->staging_rxon));
++		active_rxon->filter_flags &= ~RXON_FILTER_ASSOC_MSK;
++	} else {
++		/* Initialize our rx_config data */
++		iwl_connection_init_rx_config(priv);
++		memcpy(priv->staging_rxon.node_addr, priv->mac_addr, ETH_ALEN);
++	}
++
++	/* Configure BT coexistence */
++	iwl_send_bt_config(priv);
++
++	/* Configure the adapter for unassociated operation */
++	iwl_commit_rxon(priv);
++
++	/* At this point, the NIC is initialized and operational */
++	priv->notif_missed_beacons = 0;
++	set_bit(STATUS_READY, &priv->status);
++
++	iwl4965_rf_kill_ct_config(priv);
++	IWL_DEBUG_INFO("ALIVE processing complete.\n");
++
++	if (priv->error_recovering)
++		iwl_error_recovery(priv);
++
++	return;
++
++ restart:
++	queue_work(priv->workqueue, &priv->restart);
++}
++
++static void iwl_cancel_deferred_work(struct iwl_priv *priv);
++
++static void __iwl_down(struct iwl_priv *priv)
++{
++	unsigned long flags;
++	int exit_pending = test_bit(STATUS_EXIT_PENDING, &priv->status);
++	struct ieee80211_conf *conf = NULL;
++
++	IWL_DEBUG_INFO(DRV_NAME " is going down\n");
++
++	conf = ieee80211_get_hw_conf(priv->hw);
++
++	if (!exit_pending)
++		set_bit(STATUS_EXIT_PENDING, &priv->status);
++
++	iwl_clear_stations_table(priv);
++
++	/* Unblock any waiting calls */
++	wake_up_interruptible_all(&priv->wait_command_queue);
++
++	iwl_cancel_deferred_work(priv);
++
++	/* Wipe out the EXIT_PENDING status bit if we are not actually
++	 * exiting the module */
++	if (!exit_pending)
++		clear_bit(STATUS_EXIT_PENDING, &priv->status);
++
++	/* stop and reset the on-board processor */
++	iwl_write32(priv, CSR_RESET, CSR_RESET_REG_FLAG_NEVO_RESET);
++
++	/* tell the device to stop sending interrupts */
++	iwl_disable_interrupts(priv);
++
++	if (priv->mac80211_registered)
++		ieee80211_stop_queues(priv->hw);
++
++	/* If we have not previously called iwl_init() then
++	 * clear all bits but the RF Kill and SUSPEND bits and return */
++	if (!iwl_is_init(priv)) {
++		priv->status = test_bit(STATUS_RF_KILL_HW, &priv->status) <<
++					STATUS_RF_KILL_HW |
++			       test_bit(STATUS_RF_KILL_SW, &priv->status) <<
++					STATUS_RF_KILL_SW |
++			       test_bit(STATUS_IN_SUSPEND, &priv->status) <<
++					STATUS_IN_SUSPEND;
++		goto exit;
++	}
++
++	/* ...otherwise clear out all the status bits but the RF Kill and
++	 * SUSPEND bits and continue taking the NIC down. */
++	priv->status &= test_bit(STATUS_RF_KILL_HW, &priv->status) <<
++				STATUS_RF_KILL_HW |
++			test_bit(STATUS_RF_KILL_SW, &priv->status) <<
++				STATUS_RF_KILL_SW |
++			test_bit(STATUS_IN_SUSPEND, &priv->status) <<
++				STATUS_IN_SUSPEND |
++			test_bit(STATUS_FW_ERROR, &priv->status) <<
++				STATUS_FW_ERROR;
++
++	spin_lock_irqsave(&priv->lock, flags);
++	iwl_clear_bit(priv, CSR_GP_CNTRL, CSR_GP_CNTRL_REG_FLAG_MAC_ACCESS_REQ);
++	spin_unlock_irqrestore(&priv->lock, flags);
++
++	iwl_hw_txq_ctx_stop(priv);
++	iwl_hw_rxq_stop(priv);
++
++	spin_lock_irqsave(&priv->lock, flags);
++	if (!iwl_grab_restricted_access(priv)) {
++		iwl_write_restricted_reg(priv, APMG_CLK_DIS_REG,
++					 APMG_CLK_VAL_DMA_CLK_RQT);
++		iwl_release_restricted_access(priv);
++	}
++	spin_unlock_irqrestore(&priv->lock, flags);
++
++	udelay(5);
++
++	iwl_hw_nic_stop_master(priv);
++	iwl_set_bit(priv, CSR_RESET, CSR_RESET_REG_FLAG_SW_RESET);
++	iwl_hw_nic_reset(priv);
++
++ exit:
++	memset(&priv->card_alive, 0, sizeof(struct iwl_alive_resp));
++
++	if (priv->ibss_beacon)
++		dev_kfree_skb(priv->ibss_beacon);
++	priv->ibss_beacon = NULL;
++
++	/* clear out any free frames */
++	iwl_clear_free_frames(priv);
++}
++
++static void iwl_down(struct iwl_priv *priv)
++{
++	mutex_lock(&priv->mutex);
++	__iwl_down(priv);
++	mutex_unlock(&priv->mutex);
++}
++
++#define MAX_HW_RESTARTS 5
++
++static int __iwl_up(struct iwl_priv *priv)
++{
++	int rc, i;
++	u32 hw_rf_kill = 0;
++
++	if (test_bit(STATUS_EXIT_PENDING, &priv->status)) {
++		IWL_WARNING("Exit pending; will not bring the NIC up\n");
++		return -EIO;
++	}
++
++	if (test_bit(STATUS_RF_KILL_SW, &priv->status)) {
++		IWL_WARNING("Radio disabled by SW RF kill (module "
++			    "parameter)\n");
++		return 0;
++	}
++
++	iwl_write32(priv, CSR_INT, 0xFFFFFFFF);
++
++	rc = iwl_hw_nic_init(priv);
++	if (rc) {
++		IWL_ERROR("Unable to int nic\n");
++		return rc;
++	}
++
++	/* make sure rfkill handshake bits are cleared */
++	iwl_write32(priv, CSR_UCODE_DRV_GP1_CLR, CSR_UCODE_SW_BIT_RFKILL);
++	iwl_write32(priv, CSR_UCODE_DRV_GP1_CLR,
++		    CSR_UCODE_DRV_GP1_BIT_CMD_BLOCKED);
++
++	/* clear (again), then enable host interrupts */
++	iwl_write32(priv, CSR_INT, 0xFFFFFFFF);
++	iwl_enable_interrupts(priv);
++
++	/* really make sure rfkill handshake bits are cleared */
++	iwl_write32(priv, CSR_UCODE_DRV_GP1_CLR, CSR_UCODE_SW_BIT_RFKILL);
++	iwl_write32(priv, CSR_UCODE_DRV_GP1_CLR, CSR_UCODE_SW_BIT_RFKILL);
++
++	/* Copy original ucode data image from disk into backup cache.
++	 * This will be used to initialize the on-board processor's
++	 * data SRAM for a clean start when the runtime program first loads. */
++	memcpy(priv->ucode_data_backup.v_addr, priv->ucode_data.v_addr,
++			priv->ucode_data.len);
++
++	/* If platform's RF_KILL switch is set to KILL,
++	 * wait for BIT_INT_RF_KILL interrupt before loading uCode
++	 * and getting things started */
++	if (!(iwl_read32(priv, CSR_GP_CNTRL) &
++				CSR_GP_CNTRL_REG_FLAG_HW_RF_KILL_SW))
++		hw_rf_kill = 1;
++
++	if (test_bit(STATUS_RF_KILL_HW, &priv->status) || hw_rf_kill) {
++		IWL_WARNING("Radio disabled by HW RF Kill switch\n");
++		return 0;
++	}
++
++	for (i = 0; i < MAX_HW_RESTARTS; i++) {
++
++		iwl_clear_stations_table(priv);
++
++		/* load bootstrap state machine,
++		 * load bootstrap program into processor's memory,
++		 * prepare to load the "initialize" uCode */
++		rc = iwl_load_bsm(priv);
++
++		if (rc) {
++			IWL_ERROR("Unable to set up bootstrap uCode: %d\n", rc);
++			continue;
++		}
++
++		/* start card; "initialize" will load runtime ucode */
++		iwl_nic_start(priv);
++
++		/* MAC Address location in EEPROM same for 3945/4965 */
++		get_eeprom_mac(priv, priv->mac_addr);
++		IWL_DEBUG_INFO("MAC address: " MAC_FMT "\n",
++			       MAC_ARG(priv->mac_addr));
++
++		SET_IEEE80211_PERM_ADDR(priv->hw, priv->mac_addr);
++
++		IWL_DEBUG_INFO(DRV_NAME " is coming up\n");
++
++		return 0;
++	}
++
++	set_bit(STATUS_EXIT_PENDING, &priv->status);
++	__iwl_down(priv);
++
++	/* tried to restart and config the device for as long as our
++	 * patience could withstand */
++	IWL_ERROR("Unable to initialize device after %d attempts.\n", i);
++	return -EIO;
++}
++
++
++/*****************************************************************************
++ *
++ * Workqueue callbacks
++ *
++ *****************************************************************************/
++
++static void iwl_bg_init_alive_start(struct work_struct *data)
++{
++	struct iwl_priv *priv =
++	    container_of(data, struct iwl_priv, init_alive_start.work);
++
++	if (test_bit(STATUS_EXIT_PENDING, &priv->status))
++		return;
++
++	mutex_lock(&priv->mutex);
++	iwl_init_alive_start(priv);
++	mutex_unlock(&priv->mutex);
++}
++
++static void iwl_bg_alive_start(struct work_struct *data)
++{
++	struct iwl_priv *priv =
++	    container_of(data, struct iwl_priv, alive_start.work);
++
++	if (test_bit(STATUS_EXIT_PENDING, &priv->status))
++		return;
++
++	mutex_lock(&priv->mutex);
++	iwl_alive_start(priv);
++	mutex_unlock(&priv->mutex);
++}
++
++static void iwl_bg_rf_kill(struct work_struct *work)
++{
++	struct iwl_priv *priv = container_of(work, struct iwl_priv, rf_kill);
++
++	wake_up_interruptible(&priv->wait_command_queue);
++
++	if (test_bit(STATUS_EXIT_PENDING, &priv->status))
++		return;
++
++	mutex_lock(&priv->mutex);
++
++	if (!iwl_is_rfkill(priv)) {
++		IWL_DEBUG(IWL_DL_INFO | IWL_DL_RF_KILL,
++			  "HW and/or SW RF Kill no longer active, restarting "
++			  "device\n");
++		if (!test_bit(STATUS_EXIT_PENDING, &priv->status))
++			queue_work(priv->workqueue, &priv->restart);
++	} else {
++
++		if (!test_bit(STATUS_RF_KILL_HW, &priv->status))
++			IWL_DEBUG_RF_KILL("Can not turn radio back on - "
++					  "disabled by SW switch\n");
++		else
++			IWL_WARNING("Radio Frequency Kill Switch is On:\n"
++				    "Kill switch must be turned off for "
++				    "wireless networking to work.\n");
++	}
++	mutex_unlock(&priv->mutex);
++}
++
++#define IWL_SCAN_CHECK_WATCHDOG (7 * HZ)
++
++static void iwl_bg_scan_check(struct work_struct *data)
++{
++	struct iwl_priv *priv =
++	    container_of(data, struct iwl_priv, scan_check.work);
++
++	if (test_bit(STATUS_EXIT_PENDING, &priv->status))
++		return;
++
++	mutex_lock(&priv->mutex);
++	if (test_bit(STATUS_SCANNING, &priv->status) ||
++	    test_bit(STATUS_SCAN_ABORTING, &priv->status)) {
++		IWL_DEBUG(IWL_DL_INFO | IWL_DL_SCAN,
++			  "Scan completion watchdog resetting adapter (%dms)\n",
++			  jiffies_to_msecs(IWL_SCAN_CHECK_WATCHDOG));
++		if (!test_bit(STATUS_EXIT_PENDING, &priv->status))
++			queue_work(priv->workqueue, &priv->restart);
++	}
++	mutex_unlock(&priv->mutex);
++}
++
++static void iwl_bg_request_scan(struct work_struct *data)
++{
++	struct iwl_priv *priv =
++	    container_of(data, struct iwl_priv, request_scan);
++	struct iwl_host_cmd cmd = {
++		.id = REPLY_SCAN_CMD,
++		.len = sizeof(struct iwl_scan_cmd),
++		.meta.flags = CMD_SIZE_HUGE,
++	};
++	int rc = 0;
++	struct iwl_scan_cmd *scan;
++	struct ieee80211_conf *conf = NULL;
++	u8 direct_mask;
++	int phymode;
++
++	conf = ieee80211_get_hw_conf(priv->hw);
++
++	mutex_lock(&priv->mutex);
++
++	if (!iwl_is_ready(priv)) {
++		IWL_WARNING("request scan called when driver not ready.\n");
++		goto done;
++	}
++
++	/* Make sure the scan wasn't cancelled before this queued work
++	 * was given the chance to run... */
++	if (!test_bit(STATUS_SCANNING, &priv->status))
++		goto done;
++
++	/* This should never be called or scheduled if there is currently
++	 * a scan active in the hardware. */
++	if (test_bit(STATUS_SCAN_HW, &priv->status)) {
++		IWL_DEBUG_INFO("Multiple concurrent scan requests in parallel. "
++			       "Ignoring second request.\n");
++		rc = -EIO;
++		goto done;
++	}
++
++	if (test_bit(STATUS_EXIT_PENDING, &priv->status)) {
++		IWL_DEBUG_SCAN("Aborting scan due to device shutdown\n");
++		goto done;
++	}
++
++	if (test_bit(STATUS_SCAN_ABORTING, &priv->status)) {
++		IWL_DEBUG_HC("Scan request while abort pending.  Queuing.\n");
++		goto done;
++	}
++
++	if (iwl_is_rfkill(priv)) {
++		IWL_DEBUG_HC("Aborting scan due to RF Kill activation\n");
++		goto done;
++	}
++
++	if (!test_bit(STATUS_READY, &priv->status)) {
++		IWL_DEBUG_HC("Scan request while uninitialized.  Queuing.\n");
++		goto done;
++	}
++
++	if (!priv->scan_bands) {
++		IWL_DEBUG_HC("Aborting scan due to no requested bands\n");
++		goto done;
++	}
++
++	if (!priv->scan) {
++		priv->scan = kmalloc(sizeof(struct iwl_scan_cmd) +
++				     IWL_MAX_SCAN_SIZE, GFP_KERNEL);
++		if (!priv->scan) {
++			rc = -ENOMEM;
++			goto done;
++		}
++	}
++	scan = priv->scan;
++	memset(scan, 0, sizeof(struct iwl_scan_cmd) + IWL_MAX_SCAN_SIZE);
++
++	scan->quiet_plcp_th = IWL_PLCP_QUIET_THRESH;
++	scan->quiet_time = IWL_ACTIVE_QUIET_TIME;
++
++	if (iwl_is_associated(priv)) {
++		u16 interval = 0;
++		u32 extra;
++		u32 suspend_time = 100;
++		u32 scan_suspend_time = 100;
++		unsigned long flags;
++
++		IWL_DEBUG_INFO("Scanning while associated...\n");
++
++		spin_lock_irqsave(&priv->lock, flags);
++		interval = priv->beacon_int;
++		spin_unlock_irqrestore(&priv->lock, flags);
++
++		scan->suspend_time = 0;
++		scan->max_out_time = cpu_to_le32(600 * 1024);
++		if (!interval)
++			interval = suspend_time;
++
++		extra = (suspend_time / interval) << 22;
++		scan_suspend_time = (extra |
++		    ((suspend_time % interval) * 1024));
++		scan->suspend_time = cpu_to_le32(scan_suspend_time);
++		IWL_DEBUG_SCAN("suspend_time 0x%X beacon interval %d\n",
++			       scan_suspend_time, interval);
++	}
++
++	/* We should add the ability for user to lock to PASSIVE ONLY */
++	if (priv->one_direct_scan) {
++		IWL_DEBUG_SCAN
++		    ("Kicking off one direct scan for '%s'\n",
++		     iwl_escape_essid(priv->direct_ssid,
++				      priv->direct_ssid_len));
++		scan->direct_scan[0].id = WLAN_EID_SSID;
++		scan->direct_scan[0].len = priv->direct_ssid_len;
++		memcpy(scan->direct_scan[0].ssid,
++		       priv->direct_ssid, priv->direct_ssid_len);
++		direct_mask = 1;
++	} else if (!iwl_is_associated(priv)) {
++		scan->direct_scan[0].id = WLAN_EID_SSID;
++		scan->direct_scan[0].len = priv->essid_len;
++		memcpy(scan->direct_scan[0].ssid, priv->essid, priv->essid_len);
++		direct_mask = 1;
++	} else
++		direct_mask = 0;
++
++	/* We don't build a direct scan probe request; the uCode will do
++	 * that based on the direct_mask added to each channel entry */
++	scan->tx_cmd.len = cpu_to_le16(
++		iwl_fill_probe_req(priv, (struct ieee80211_mgmt *)scan->data,
++			IWL_MAX_SCAN_SIZE - sizeof(scan), 0));
++	scan->tx_cmd.tx_flags = TX_CMD_FLG_SEQ_CTL_MSK;
++	scan->tx_cmd.sta_id = priv->hw_setting.bcast_sta_id;
++	scan->tx_cmd.stop_time.life_time = TX_CMD_LIFE_TIME_INFINITE;
++
++	/* flags + rate selection */
++
++	scan->tx_cmd.tx_flags |= cpu_to_le32(0x200);
++
++	switch (priv->scan_bands) {
++	case 2:
++		scan->flags = RXON_FLG_BAND_24G_MSK | RXON_FLG_AUTO_DETECT_MSK;
++		scan->tx_cmd.rate_n_flags =
++				iwl_hw_set_rate_n_flags(IWL_RATE_1M_PLCP,
++				RATE_MCS_ANT_B_MSK|RATE_MCS_CCK_MSK);
++
++		scan->good_CRC_th = 0;
++		phymode = MODE_IEEE80211G;
++		break;
++
++	case 1:
++		scan->tx_cmd.rate_n_flags =
++				iwl_hw_set_rate_n_flags(IWL_RATE_6M_PLCP,
++				RATE_MCS_ANT_B_MSK);
++		scan->good_CRC_th = IWL_GOOD_CRC_TH;
++		phymode = MODE_IEEE80211A;
++		break;
++
++	default:
++		IWL_WARNING("Invalid scan band count\n");
++		goto done;
++	}
++
++	/* select Rx chains */
++
++	/* Force use of chains B and C (0x6) for scan Rx.
++	 * Avoid A (0x1) because of its off-channel reception on A-band.
++	 * MIMO is not used here, but value is required to make uCode happy. */
++	scan->rx_chain = RXON_RX_CHAIN_DRIVER_FORCE_MSK |
++			cpu_to_le16((0x7 << RXON_RX_CHAIN_VALID_POS) |
++			(0x6 << RXON_RX_CHAIN_FORCE_SEL_POS) |
++			(0x7 << RXON_RX_CHAIN_FORCE_MIMO_SEL_POS));
++
++	if (priv->iw_mode == IEEE80211_IF_TYPE_MNTR)
++		scan->filter_flags = RXON_FILTER_PROMISC_MSK;
++
++	if (direct_mask)
++		IWL_DEBUG_SCAN
++		    ("Initiating direct scan for %s.\n",
++		     iwl_escape_essid(priv->essid, priv->essid_len));
++	else
++		IWL_DEBUG_SCAN("Initiating indirect scan.\n");
++
++	scan->channel_count =
++		iwl_get_channels_for_scan(
++			priv, phymode, 1, /* active */
++			direct_mask,
++			(void *)&scan->data[le16_to_cpu(scan->tx_cmd.len)]);
++
++	cmd.len += le16_to_cpu(scan->tx_cmd.len) +
++	    scan->channel_count * sizeof(struct iwl_scan_channel);
++	cmd.data = scan;
++	scan->len = cpu_to_le16(cmd.len);
++
++	set_bit(STATUS_SCAN_HW, &priv->status);
++	rc = iwl_send_cmd_sync(priv, &cmd);
++	if (rc)
++		goto done;
++
++	queue_delayed_work(priv->workqueue, &priv->scan_check,
++			   IWL_SCAN_CHECK_WATCHDOG);
++
++	mutex_unlock(&priv->mutex);
++	return;
++
++ done:
++	/* inform mac80211 sacn aborted */
++	queue_work(priv->workqueue, &priv->scan_completed);
++	mutex_unlock(&priv->mutex);
++}
++
++static void iwl_bg_up(struct work_struct *data)
++{
++	struct iwl_priv *priv = container_of(data, struct iwl_priv, up);
++
++	if (test_bit(STATUS_EXIT_PENDING, &priv->status))
++		return;
++
++	mutex_lock(&priv->mutex);
++	__iwl_up(priv);
++	mutex_unlock(&priv->mutex);
++}
++
++static void iwl_bg_restart(struct work_struct *data)
++{
++	struct iwl_priv *priv = container_of(data, struct iwl_priv, restart);
++
++	if (test_bit(STATUS_EXIT_PENDING, &priv->status))
++		return;
++
++	iwl_down(priv);
++	queue_work(priv->workqueue, &priv->up);
++}
++
++static void iwl_bg_rx_replenish(struct work_struct *data)
++{
++	struct iwl_priv *priv =
++	    container_of(data, struct iwl_priv, rx_replenish);
++
++	if (test_bit(STATUS_EXIT_PENDING, &priv->status))
++		return;
++
++	mutex_lock(&priv->mutex);
++	iwl_rx_replenish(priv);
++	mutex_unlock(&priv->mutex);
++}
++
++static void iwl_bg_post_associate(struct work_struct *data)
++{
++	struct iwl_priv *priv = container_of(data, struct iwl_priv,
++					     post_associate.work);
++
++	int rc = 0;
++	struct ieee80211_conf *conf = NULL;
++
++	if (priv->iw_mode == IEEE80211_IF_TYPE_AP) {
++		IWL_ERROR("%s Should not be called in AP mode\n", __FUNCTION__);
++		return;
++	}
++
++	IWL_DEBUG_ASSOC("Associated as %d to: " MAC_FMT "\n",
++			priv->assoc_id, MAC_ARG(priv->active_rxon.bssid_addr));
++
++
++	if (test_bit(STATUS_EXIT_PENDING, &priv->status))
++		return;
++
++	mutex_lock(&priv->mutex);
++
++	conf = ieee80211_get_hw_conf(priv->hw);
++
++	priv->staging_rxon.filter_flags &= ~RXON_FILTER_ASSOC_MSK;
++	iwl_commit_rxon(priv);
++
++	memset(&priv->rxon_timing, 0, sizeof(struct iwl_rxon_time_cmd));
++	iwl_setup_rxon_timing(priv);
++	rc = iwl_send_cmd_pdu(priv, REPLY_RXON_TIMING,
++			      sizeof(priv->rxon_timing), &priv->rxon_timing);
++	if (rc)
++		IWL_WARNING("REPLY_RXON_TIMING failed - "
++			    "Attempting to continue.\n");
++
++	priv->staging_rxon.filter_flags |= RXON_FILTER_ASSOC_MSK;
++
++#ifdef CONFIG_IWLWIFI_HT
++	if (priv->is_ht_enabled && priv->current_assoc_ht.is_ht)
++		iwl4965_set_rxon_ht(priv, &priv->current_assoc_ht);
++	else {
++		priv->active_rate_ht[0] = 0;
++		priv->active_rate_ht[1] = 0;
++		priv->current_channel_width = IWL_CHANNEL_WIDTH_20MHZ;
++	}
++#endif /* CONFIG_IWLWIFI_HT*/
++	iwl4965_set_rxon_chain(priv);
++	priv->staging_rxon.assoc_id = cpu_to_le16(priv->assoc_id);
++
++	IWL_DEBUG_ASSOC("assoc id %d beacon interval %d\n",
++			priv->assoc_id, priv->beacon_int);
++
++	if (priv->assoc_capability & WLAN_CAPABILITY_SHORT_PREAMBLE)
++		priv->staging_rxon.flags |= RXON_FLG_SHORT_PREAMBLE_MSK;
++	else
++		priv->staging_rxon.flags &= ~RXON_FLG_SHORT_PREAMBLE_MSK;
++
++	if (priv->staging_rxon.flags & RXON_FLG_BAND_24G_MSK) {
++		if (priv->assoc_capability & WLAN_CAPABILITY_SHORT_SLOT_TIME)
++			priv->staging_rxon.flags |= RXON_FLG_SHORT_SLOT_MSK;
++		else
++			priv->staging_rxon.flags &= ~RXON_FLG_SHORT_SLOT_MSK;
++
++		if (priv->iw_mode == IEEE80211_IF_TYPE_IBSS)
++			priv->staging_rxon.flags &= ~RXON_FLG_SHORT_SLOT_MSK;
++
++	}
++
++	iwl_commit_rxon(priv);
++
++	switch (priv->iw_mode) {
++	case IEEE80211_IF_TYPE_STA:
++		iwl_rate_scale_init(priv->hw, IWL_AP_ID);
++		break;
++
++	case IEEE80211_IF_TYPE_IBSS:
++
++		/* clear out the station table */
++		iwl_clear_stations_table(priv);
++
++		iwl_rxon_add_station(priv, BROADCAST_ADDR, 0);
++		iwl_rxon_add_station(priv, priv->bssid, 0);
++		iwl_rate_scale_init(priv->hw, IWL_STA_ID);
++		iwl_send_beacon_cmd(priv);
++
++		break;
++
++	default:
++		IWL_ERROR("%s Should not be called in %d mode\n",
++				__FUNCTION__, priv->iw_mode);
++		break;
++	}
++
++	iwl_sequence_reset(priv);
++
++#ifdef CONFIG_IWLWIFI_SENSITIVITY
++	/* Enable Rx differential gain and sensitivity calibrations */
++	iwl4965_chain_noise_reset(priv);
++	priv->start_calib = 1;
++#endif /* CONFIG_IWLWIFI_SENSITIVITY */
++
++	if (priv->iw_mode == IEEE80211_IF_TYPE_IBSS)
++		priv->assoc_station_added = 1;
++
++#ifdef CONFIG_IWLWIFI_QOS
++	iwl_activate_qos(priv, 0);
++#endif /* CONFIG_IWLWIFI_QOS */
++	mutex_unlock(&priv->mutex);
++}
++
++static void iwl_bg_abort_scan(struct work_struct *work)
++{
++	struct iwl_priv *priv = container_of(work, struct iwl_priv,
++					     abort_scan);
++
++	if (!iwl_is_ready(priv))
++		return;
++
++	mutex_lock(&priv->mutex);
++
++	set_bit(STATUS_SCAN_ABORTING, &priv->status);
++	iwl_send_scan_abort(priv);
++
++	mutex_unlock(&priv->mutex);
++}
++
++static void iwl_bg_scan_completed(struct work_struct *work)
++{
++	struct iwl_priv *priv =
++	    container_of(work, struct iwl_priv, scan_completed);
++
++	IWL_DEBUG(IWL_DL_INFO | IWL_DL_SCAN, "SCAN complete scan\n");
++
++	if (test_bit(STATUS_EXIT_PENDING, &priv->status))
++		return;
++
++	ieee80211_scan_completed(priv->hw);
++
++	/* Since setting the TXPOWER may have been deferred while
++	 * performing the scan, fire one off */
++	mutex_lock(&priv->mutex);
++	iwl_hw_reg_send_txpower(priv);
++	mutex_unlock(&priv->mutex);
++}
++
++/*****************************************************************************
++ *
++ * mac80211 entry point functions
++ *
++ *****************************************************************************/
++
++static int iwl_mac_open(struct ieee80211_hw *hw)
++{
++	struct iwl_priv *priv = hw->priv;
++
++	IWL_DEBUG_MAC80211("enter\n");
++
++	/* we should be verifying the device is ready to be opened */
++	mutex_lock(&priv->mutex);
++
++	priv->is_open = 1;
++
++	if (!iwl_is_rfkill(priv))
++		ieee80211_start_queues(priv->hw);
++
++	mutex_unlock(&priv->mutex);
++	IWL_DEBUG_MAC80211("leave\n");
++	return 0;
++}
++
++static int iwl_mac_stop(struct ieee80211_hw *hw)
++{
++	struct iwl_priv *priv = hw->priv;
++
++	IWL_DEBUG_MAC80211("enter\n");
++	priv->is_open = 0;
++	/*netif_stop_queue(dev); */
++	flush_workqueue(priv->workqueue);
++	IWL_DEBUG_MAC80211("leave\n");
++
++	return 0;
++}
++
++static int iwl_mac_tx(struct ieee80211_hw *hw, struct sk_buff *skb,
++		      struct ieee80211_tx_control *ctl)
++{
++	struct iwl_priv *priv = hw->priv;
++
++	IWL_DEBUG_MAC80211("enter\n");
++
++	if (priv->iw_mode == IEEE80211_IF_TYPE_MNTR) {
++		IWL_DEBUG_MAC80211("leave - monitor\n");
++		return -1;
++	}
++
++	IWL_DEBUG_TX("dev->xmit(%d bytes) at rate 0x%02x\n", skb->len,
++		     ctl->tx_rate);
++
++	if (iwl_tx_skb(priv, skb, ctl))
++		dev_kfree_skb_any(skb);
++
++	IWL_DEBUG_MAC80211("leave\n");
++	return 0;
++}
++
++static int iwl_mac_add_interface(struct ieee80211_hw *hw,
++				 struct ieee80211_if_init_conf *conf)
++{
++	struct iwl_priv *priv = hw->priv;
++	unsigned long flags;
++
++	IWL_DEBUG_MAC80211("enter: id %d, type %d\n", conf->if_id, conf->type);
++	if (conf->mac_addr)
++		IWL_DEBUG_MAC80211("enter: MAC " MAC_FMT "\n",
++				   MAC_ARG(conf->mac_addr));
++
++	if (priv->interface_id) {
++		IWL_DEBUG_MAC80211("leave - interface_id != 0\n");
++		return 0;
++	}
++
++	spin_lock_irqsave(&priv->lock, flags);
++	priv->interface_id = conf->if_id;
++
++	spin_unlock_irqrestore(&priv->lock, flags);
++
++	mutex_lock(&priv->mutex);
++	iwl_set_mode(priv, conf->type);
++
++	IWL_DEBUG_MAC80211("leave\n");
++	mutex_unlock(&priv->mutex);
++
++	return 0;
++}
++
++/**
++ * iwl_mac_config - mac80211 config callback
++ *
++ * We ignore conf->flags & IEEE80211_CONF_SHORT_SLOT_TIME since it seems to
++ * be set inappropriately and the driver currently sets the hardware up to
++ * use it whenever needed.
++ */
++static int iwl_mac_config(struct ieee80211_hw *hw, struct ieee80211_conf *conf)
++{
++	struct iwl_priv *priv = hw->priv;
++	const struct iwl_channel_info *ch_info;
++	unsigned long flags;
++
++	mutex_lock(&priv->mutex);
++	IWL_DEBUG_MAC80211("enter to channel %d\n", conf->channel);
++
++	if (!iwl_is_ready(priv)) {
++		IWL_DEBUG_MAC80211("leave - not ready\n");
++		mutex_unlock(&priv->mutex);
++		return -EIO;
++	}
++
++	/* TODO: Figure out how to get ieee80211_local->sta_scanning w/ only
++	 * what is exposed through include/ declrations */
++	if (unlikely(!iwl_param_disable_hw_scan &&
++		     test_bit(STATUS_SCANNING, &priv->status))) {
++		IWL_DEBUG_MAC80211("leave - scanning\n");
++		mutex_unlock(&priv->mutex);
++		return 0;
++	}
++
++	spin_lock_irqsave(&priv->lock, flags);
++
++	ch_info = iwl_get_channel_info(priv, conf->phymode, conf->channel);
++	if (!is_channel_valid(ch_info)) {
++		IWL_DEBUG_SCAN("Channel %d [%d] is INVALID for this SKU.\n",
++			       conf->channel, conf->phymode);
++		IWL_DEBUG_MAC80211("leave - invalid channel\n");
++		spin_unlock_irqrestore(&priv->lock, flags);
++		mutex_unlock(&priv->mutex);
++		return -EINVAL;
++	}
++
++#ifdef CONFIG_IWLWIFI_HT
++	/* if we are switching fron ht to 2.4 clear flags
++	 * from any ht related info since 2.4 does not
++	 * support ht */
++	if ((le16_to_cpu(priv->staging_rxon.channel) != conf->channel)
++#ifdef IEEE80211_CONF_CHANNEL_SWITCH
++	    && !(conf->flags & IEEE80211_CONF_CHANNEL_SWITCH)
++#endif
++	)
++		priv->staging_rxon.flags = 0;
++#endif /* CONFIG_IWLWIFI_HT */
++
++	iwl_set_rxon_channel(priv, conf->phymode, conf->channel);
++
++	iwl_set_flags_for_phymode(priv, conf->phymode);
++
++	/* The list of supported rates and rate mask can be different
++	 * for each phymode; since the phymode may have changed, reset
++	 * the rate mask to what mac80211 lists */
++	iwl_set_rate(priv);
++
++	spin_unlock_irqrestore(&priv->lock, flags);
++
++#ifdef IEEE80211_CONF_CHANNEL_SWITCH
++	if (conf->flags & IEEE80211_CONF_CHANNEL_SWITCH) {
++		iwl_hw_channel_switch(priv, conf->channel);
++		mutex_unlock(&priv->mutex);
++		return 0;
++	}
++#endif
++
++	iwl_radio_kill_sw(priv, !conf->radio_enabled);
++
++	if (!conf->radio_enabled) {
++		IWL_DEBUG_MAC80211("leave - radio disabled\n");
++		mutex_unlock(&priv->mutex);
++		return 0;
++	}
++
++	if (iwl_is_rfkill(priv)) {
++		IWL_DEBUG_MAC80211("leave - RF kill\n");
++		mutex_unlock(&priv->mutex);
++		return -EIO;
++	}
++
++	iwl_set_rate(priv);
++
++	if (memcmp(&priv->active_rxon,
++		   &priv->staging_rxon, sizeof(priv->staging_rxon)))
++		iwl_commit_rxon(priv);
++	else
++		IWL_DEBUG_INFO("No re-sending same RXON configuration.\n");
++
++	IWL_DEBUG_MAC80211("leave\n");
++
++	mutex_unlock(&priv->mutex);
++
++	return 0;
++}
++
++static void iwl_config_ap(struct iwl_priv *priv)
++{
++	int rc = 0;
++
++	if (priv->status & STATUS_EXIT_PENDING)
++		return;
++
++	/* The following should be done only at AP bring up */
++	if ((priv->active_rxon.filter_flags & RXON_FILTER_ASSOC_MSK) == 0) {
++
++		/* RXON - unassoc (to set timing command) */
++		priv->staging_rxon.filter_flags &= ~RXON_FILTER_ASSOC_MSK;
++		iwl_commit_rxon(priv);
++
++		/* RXON Timing */
++		memset(&priv->rxon_timing, 0, sizeof(struct iwl_rxon_time_cmd));
++		iwl_setup_rxon_timing(priv);
++		rc = iwl_send_cmd_pdu(priv, REPLY_RXON_TIMING,
++				sizeof(priv->rxon_timing), &priv->rxon_timing);
++		if (rc)
++			IWL_WARNING("REPLY_RXON_TIMING failed - "
++					"Attempting to continue.\n");
++
++		iwl4965_set_rxon_chain(priv);
++
++		/* FIXME: what should be the assoc_id for AP? */
++		priv->staging_rxon.assoc_id = cpu_to_le16(priv->assoc_id);
++		if (priv->assoc_capability & WLAN_CAPABILITY_SHORT_PREAMBLE)
++			priv->staging_rxon.flags |=
++				RXON_FLG_SHORT_PREAMBLE_MSK;
++		else
++			priv->staging_rxon.flags &=
++				~RXON_FLG_SHORT_PREAMBLE_MSK;
++
++		if (priv->staging_rxon.flags & RXON_FLG_BAND_24G_MSK) {
++			if (priv->assoc_capability &
++				WLAN_CAPABILITY_SHORT_SLOT_TIME)
++				priv->staging_rxon.flags |=
++					RXON_FLG_SHORT_SLOT_MSK;
++			else
++				priv->staging_rxon.flags &=
++					~RXON_FLG_SHORT_SLOT_MSK;
++
++			if (priv->iw_mode == IEEE80211_IF_TYPE_IBSS)
++				priv->staging_rxon.flags &=
++					~RXON_FLG_SHORT_SLOT_MSK;
++		}
++		/* restore RXON assoc */
++		priv->staging_rxon.filter_flags |= RXON_FILTER_ASSOC_MSK;
++		iwl_commit_rxon(priv);
++#ifdef CONFIG_IWLWIFI_QOS
++		iwl_activate_qos(priv, 1);
++#endif
++		iwl_rxon_add_station(priv, BROADCAST_ADDR, 0);
++		iwl_send_beacon_cmd(priv);
++	} else
++		iwl_send_beacon_cmd(priv);
++
++	/* FIXME - we need to add code here to detect a totally new
++	 * configuration, reset the AP, unassoc, rxon timing, assoc,
++	 * clear sta table, add BCAST sta... */
++}
++
++static int iwl_mac_config_interface(struct ieee80211_hw *hw, int if_id,
++				    struct ieee80211_if_conf *conf)
++{
++	struct iwl_priv *priv = hw->priv;
++	unsigned long flags;
++	int rc;
++
++	if (conf == NULL)
++		return -EIO;
++
++	if ((priv->iw_mode == IEEE80211_IF_TYPE_AP) &&
++	    (!conf->beacon || !conf->ssid_len)) {
++		IWL_DEBUG_MAC80211
++		    ("Leaving in AP mode because HostAPD is not ready.\n");
++		return 0;
++	}
++
++	mutex_lock(&priv->mutex);
++
++	IWL_DEBUG_MAC80211("enter: interface id %d\n", if_id);
++	if (conf->bssid)
++		IWL_DEBUG_MAC80211("bssid: " MAC_FMT "\n",
++				   MAC_ARG(conf->bssid));
++
++	if (unlikely(test_bit(STATUS_SCANNING, &priv->status)) &&
++	    !(priv->hw->flags & IEEE80211_HW_NO_PROBE_FILTERING)) {
++		IWL_DEBUG_MAC80211("leave - scanning\n");
++		mutex_unlock(&priv->mutex);
++		return 0;
++	}
++
++	if (priv->interface_id != if_id) {
++		IWL_DEBUG_MAC80211("leave - interface_id != if_id\n");
++		mutex_unlock(&priv->mutex);
++		return 0;
++	}
++
++	if (priv->iw_mode == IEEE80211_IF_TYPE_AP) {
++		if (!conf->bssid) {
++			conf->bssid = priv->mac_addr;
++			memcpy(priv->bssid, priv->mac_addr, ETH_ALEN);
++			IWL_DEBUG_MAC80211("bssid was set to: " MAC_FMT "\n",
++					   MAC_ARG(conf->bssid));
++		}
++		if (priv->ibss_beacon)
++			dev_kfree_skb(priv->ibss_beacon);
++
++		priv->ibss_beacon = conf->beacon;
++	}
++
++	if (conf->bssid && !is_zero_ether_addr(conf->bssid) &&
++	    !is_multicast_ether_addr(conf->bssid)) {
++		/* If there is currently a HW scan going on in the background
++		 * then we need to cancel it else the RXON below will fail. */
++		if (iwl_scan_cancel_timeout(priv, 100)) {
++			IWL_WARNING("Aborted scan still in progress "
++				    "after 100ms\n");
++			IWL_DEBUG_MAC80211("leaving - scan abort failed.\n");
++			mutex_unlock(&priv->mutex);
++			return -EAGAIN;
++		}
++		memcpy(priv->staging_rxon.bssid_addr, conf->bssid, ETH_ALEN);
++
++		/* TODO: Audit driver for usage of these members and see
++		 * if mac80211 deprecates them (priv->bssid looks like it
++		 * shouldn't be there, but I haven't scanned the IBSS code
++		 * to verify) - jpk */
++		memcpy(priv->bssid, conf->bssid, ETH_ALEN);
++
++		if (priv->iw_mode == IEEE80211_IF_TYPE_AP)
++			iwl_config_ap(priv);
++		else {
++			priv->staging_rxon.filter_flags |=
++						RXON_FILTER_ASSOC_MSK;
++			rc = iwl_commit_rxon(priv);
++			if ((priv->iw_mode == IEEE80211_IF_TYPE_STA) && rc)
++				iwl_rxon_add_station(
++					priv, priv->active_rxon.bssid_addr, 1);
++		}
++
++	} else {
++		priv->staging_rxon.filter_flags &= ~RXON_FILTER_ASSOC_MSK;
++		iwl_commit_rxon(priv);
++	}
++
++	spin_lock_irqsave(&priv->lock, flags);
++	if (!conf->ssid_len)
++		memset(priv->essid, 0, IW_ESSID_MAX_SIZE);
++	else
++		memcpy(priv->essid, conf->ssid, conf->ssid_len);
++
++	priv->essid_len = conf->ssid_len;
++	spin_unlock_irqrestore(&priv->lock, flags);
++
++	IWL_DEBUG_MAC80211("leave\n");
++	mutex_unlock(&priv->mutex);
++
++	return 0;
++}
++
++static void iwl_mac_remove_interface(struct ieee80211_hw *hw,
++				     struct ieee80211_if_init_conf *conf)
++{
++	struct iwl_priv *priv = hw->priv;
++
++	IWL_DEBUG_MAC80211("enter\n");
++
++	mutex_lock(&priv->mutex);
++	if (priv->interface_id == conf->if_id) {
++		priv->interface_id = 0;
++		memset(priv->bssid, 0, ETH_ALEN);
++		memset(priv->essid, 0, IW_ESSID_MAX_SIZE);
++		priv->essid_len = 0;
++	}
++	mutex_unlock(&priv->mutex);
++
++	IWL_DEBUG_MAC80211("leave\n");
++
++}
++
++#define IWL_DELAY_NEXT_SCAN (HZ*2)
++static int iwl_mac_hw_scan(struct ieee80211_hw *hw, u8 *ssid, size_t len)
++{
++	int rc = 0;
++	unsigned long flags;
++	struct iwl_priv *priv = hw->priv;
++
++	IWL_DEBUG_MAC80211("enter\n");
++
++	spin_lock_irqsave(&priv->lock, flags);
++
++	if (!iwl_is_ready_rf(priv)) {
++		rc = -EIO;
++		IWL_DEBUG_MAC80211("leave - not ready or exit pending\n");
++		goto out_unlock;
++	}
++
++	if (priv->iw_mode == IEEE80211_IF_TYPE_AP) {	/* APs don't scan */
++		rc = -EIO;
++		IWL_ERROR("ERROR: APs don't scan\n");
++		goto out_unlock;
++	}
++
++	/* if we just finished scan ask for delay */
++	if (priv->last_scan_jiffies &&
++	    time_after(priv->last_scan_jiffies + IWL_DELAY_NEXT_SCAN,
++		       jiffies)) {
++		rc = -EAGAIN;
++		goto out_unlock;
++	}
++	if (len) {
++		IWL_DEBUG_SCAN("direct scan for  "
++			       "%s [%d]\n ",
++			       iwl_escape_essid(ssid, len), (int)len);
++
++		priv->one_direct_scan = 1;
++		priv->direct_ssid_len = (u8)
++		    min((u8) len, (u8) IW_ESSID_MAX_SIZE);
++		memcpy(priv->direct_ssid, ssid, priv->direct_ssid_len);
++	}
++
++	rc = iwl_scan_initiate(priv);
++
++	IWL_DEBUG_MAC80211("leave\n");
++
++out_unlock:
++	spin_unlock_irqrestore(&priv->lock, flags);
++
++	return rc;
++}
++
++static int iwl_mac_set_key(struct ieee80211_hw *hw, set_key_cmd cmd,
++			   const u8 *local_addr, const u8 *addr,
++			   struct ieee80211_key_conf *key)
++{
++	struct iwl_priv *priv = hw->priv;
++	int rc = 0;
++	u8 sta_id;
++
++	IWL_DEBUG_MAC80211("enter\n");
++
++	if (!iwl_param_hwcrypto) {
++		IWL_DEBUG_MAC80211("leave - hwcrypto disabled\n");
++		return -EOPNOTSUPP;
++	}
++
++	if (is_zero_ether_addr(addr))
++		/* only support pairwise keys */
++		return -EOPNOTSUPP;
++
++	sta_id = iwl_hw_find_station(priv, addr);
++	if (sta_id == IWL_INVALID_STATION) {
++		IWL_DEBUG_MAC80211("leave - " MAC_FMT " not in station map.\n",
++				   MAC_ARG(addr));
++		return -EINVAL;
++	}
++
++	mutex_lock(&priv->mutex);
++
++	switch (cmd) {
++	case  SET_KEY:
++		rc = iwl_update_sta_key_info(priv, key, sta_id);
++		if (!rc) {
++			iwl_set_rxon_hwcrypto(priv, 1);
++			iwl_commit_rxon(priv);
++			key->hw_key_idx = sta_id;
++			IWL_DEBUG_MAC80211("set_key success, using hwcrypto\n");
++		}
++		break;
++	case DISABLE_KEY:
++		rc = iwl_clear_sta_key_info(priv, sta_id);
++		if (!rc) {
++			iwl_set_rxon_hwcrypto(priv, 0);
++			iwl_commit_rxon(priv);
++			IWL_DEBUG_MAC80211("disable hwcrypto key\n");
++		}
++		break;
++	default:
++		rc = -EINVAL;
++	}
++
++	IWL_DEBUG_MAC80211("leave\n");
++	mutex_unlock(&priv->mutex);
++
++	return rc;
++}
++
++static int iwl_mac_conf_tx(struct ieee80211_hw *hw, int queue,
++			   const struct ieee80211_tx_queue_params *params)
++{
++	struct iwl_priv *priv = hw->priv;
++#ifdef CONFIG_IWLWIFI_QOS
++	unsigned long flags;
++	int q;
++#endif /* CONFIG_IWL_QOS */
++
++	IWL_DEBUG_MAC80211("enter\n");
++
++	if (!iwl_is_ready_rf(priv)) {
++		IWL_DEBUG_MAC80211("leave - RF not ready\n");
++		return -EIO;
++	}
++
++	if (queue >= AC_NUM) {
++		IWL_DEBUG_MAC80211("leave - queue >= AC_NUM %d\n", queue);
++		return 0;
++	}
++
++#ifdef CONFIG_IWLWIFI_QOS
++	if (!priv->qos_data.qos_enable) {
++		priv->qos_data.qos_active = 0;
++		IWL_DEBUG_MAC80211("leave - qos not enabled\n");
++		return 0;
++	}
++	q = AC_NUM - 1 - queue;
++
++	spin_lock_irqsave(&priv->lock, flags);
++
++	priv->qos_data.def_qos_parm.ac[q].cw_min = cpu_to_le16(params->cw_min);
++	priv->qos_data.def_qos_parm.ac[q].cw_max = cpu_to_le16(params->cw_max);
++	priv->qos_data.def_qos_parm.ac[q].aifsn = params->aifs;
++	priv->qos_data.def_qos_parm.ac[q].edca_txop =
++			cpu_to_le16((params->burst_time * 100));
++
++	priv->qos_data.def_qos_parm.ac[q].reserved1 = 0;
++	priv->qos_data.qos_active = 1;
++
++	spin_unlock_irqrestore(&priv->lock, flags);
++
++	mutex_lock(&priv->mutex);
++	if (priv->iw_mode == IEEE80211_IF_TYPE_AP)
++		iwl_activate_qos(priv, 1);
++	else if (priv->assoc_id && iwl_is_associated(priv))
++		iwl_activate_qos(priv, 0);
++
++	mutex_unlock(&priv->mutex);
++
++#endif /*CONFIG_IWLWIFI_QOS */
++
++	IWL_DEBUG_MAC80211("leave\n");
++	return 0;
++}
++
++static int iwl_mac_get_tx_stats(struct ieee80211_hw *hw,
++				struct ieee80211_tx_queue_stats *stats)
++{
++	struct iwl_priv *priv = hw->priv;
++	int i, avail;
++	struct iwl_tx_queue *txq;
++	struct iwl_queue *q;
++	unsigned long flags;
++
++	IWL_DEBUG_MAC80211("enter\n");
++
++	if (!iwl_is_ready_rf(priv)) {
++		IWL_DEBUG_MAC80211("leave - RF not ready\n");
++		return -EIO;
++	}
++
++	spin_lock_irqsave(&priv->lock, flags);
++
++	for (i = 0; i < AC_NUM; i++) {
++		txq = &priv->txq[i];
++		q = &txq->q;
++		avail = iwl_queue_space(q);
++
++		stats->data[i].len = q->n_window - avail;
++		stats->data[i].limit = q->n_window - q->high_mark;
++		stats->data[i].count = q->n_window;
++
++	}
++	spin_unlock_irqrestore(&priv->lock, flags);
++
++	IWL_DEBUG_MAC80211("leave\n");
++
++	return 0;
++}
++
++static int iwl_mac_get_stats(struct ieee80211_hw *hw,
++			     struct ieee80211_low_level_stats *stats)
++{
++	IWL_DEBUG_MAC80211("enter\n");
++	IWL_DEBUG_MAC80211("leave\n");
++
++	return 0;
++}
++
++static u64 iwl_mac_get_tsf(struct ieee80211_hw *hw)
++{
++	IWL_DEBUG_MAC80211("enter\n");
++	IWL_DEBUG_MAC80211("leave\n");
++
++	return 0;
++}
++
++static void iwl_mac_reset_tsf(struct ieee80211_hw *hw)
++{
++	struct iwl_priv *priv = hw->priv;
++	unsigned long flags;
++
++	mutex_lock(&priv->mutex);
++	IWL_DEBUG_MAC80211("enter\n");
++
++	priv->lq_mngr.lq_ready = 0;
++#ifdef CONFIG_IWLWIFI_HT
++	spin_lock_irqsave(&priv->lock, flags);
++	memset(&priv->current_assoc_ht, 0, sizeof(struct sta_ht_info));
++	spin_unlock_irqrestore(&priv->lock, flags);
++#ifdef CONFIG_IWLWIFI_HT_AGG
++/*	if (priv->lq_mngr.agg_ctrl.granted_ba)
++		iwl4965_turn_off_agg(priv, TID_ALL_SPECIFIED);*/
++
++	memset(&(priv->lq_mngr.agg_ctrl), 0, sizeof(struct iwl_agg_control));
++	priv->lq_mngr.agg_ctrl.tid_traffic_load_threshold = 10;
++	priv->lq_mngr.agg_ctrl.ba_timeout = 5000;
++	priv->lq_mngr.agg_ctrl.auto_agg = 1;
++
++	if (priv->lq_mngr.agg_ctrl.auto_agg)
++		priv->lq_mngr.agg_ctrl.requested_ba = TID_ALL_ENABLED;
++#endif /*CONFIG_IWLWIFI_HT_AGG */
++#endif /* CONFIG_IWLWIFI_HT */
++
++#ifdef CONFIG_IWLWIFI_QOS
++	iwl_reset_qos(priv);
++#endif
++
++	cancel_delayed_work(&priv->post_associate);
++
++	spin_lock_irqsave(&priv->lock, flags);
++	priv->assoc_id = 0;
++	priv->assoc_capability = 0;
++	priv->call_post_assoc_from_beacon = 0;
++	priv->assoc_station_added = 0;
++
++	/* new association get rid of ibss beacon skb */
++	if (priv->ibss_beacon)
++		dev_kfree_skb(priv->ibss_beacon);
++
++	priv->ibss_beacon = NULL;
++
++	priv->beacon_int = priv->hw->conf.beacon_int;
++	priv->timestamp1 = 0;
++	priv->timestamp0 = 0;
++	if ((priv->iw_mode == IEEE80211_IF_TYPE_STA))
++		priv->beacon_int = 0;
++
++	spin_unlock_irqrestore(&priv->lock, flags);
++
++	/* Per mac80211.h: This is only used in IBSS mode... */
++	if (priv->iw_mode != IEEE80211_IF_TYPE_IBSS) {
++		IWL_DEBUG_MAC80211("leave - not in IBSS\n");
++		mutex_unlock(&priv->mutex);
++		return;
++	}
++
++	if (!iwl_is_ready_rf(priv)) {
++		IWL_DEBUG_MAC80211("leave - not ready\n");
++		mutex_unlock(&priv->mutex);
++		return;
++	}
++
++	priv->only_active_channel = 0;
++
++	iwl_set_rate(priv);
++
++	mutex_unlock(&priv->mutex);
++
++	IWL_DEBUG_MAC80211("leave\n");
++
++}
++
++static int iwl_mac_beacon_update(struct ieee80211_hw *hw, struct sk_buff *skb,
++				 struct ieee80211_tx_control *control)
++{
++	struct iwl_priv *priv = hw->priv;
++	unsigned long flags;
++
++	mutex_lock(&priv->mutex);
++	IWL_DEBUG_MAC80211("enter\n");
++
++	if (!iwl_is_ready_rf(priv)) {
++		IWL_DEBUG_MAC80211("leave - RF not ready\n");
++		mutex_unlock(&priv->mutex);
++		return -EIO;
++	}
++
++	if (priv->iw_mode != IEEE80211_IF_TYPE_IBSS) {
++		IWL_DEBUG_MAC80211("leave - not IBSS\n");
++		mutex_unlock(&priv->mutex);
++		return -EIO;
++	}
++
++	spin_lock_irqsave(&priv->lock, flags);
++
++	if (priv->ibss_beacon)
++		dev_kfree_skb(priv->ibss_beacon);
++
++	priv->ibss_beacon = skb;
++
++	priv->assoc_id = 0;
++
++	IWL_DEBUG_MAC80211("leave\n");
++	spin_unlock_irqrestore(&priv->lock, flags);
++
++#ifdef CONFIG_IWLWIFI_QOS
++	iwl_reset_qos(priv);
++#endif
++
++	queue_work(priv->workqueue, &priv->post_associate.work);
++
++	mutex_unlock(&priv->mutex);
++
++	return 0;
++}
++
++#ifdef CONFIG_IWLWIFI_HT
++union ht_cap_info {
++	struct {
++		u16 advanced_coding_cap		:1;
++		u16 supported_chan_width_set	:1;
++		u16 mimo_power_save_mode	:2;
++		u16 green_field			:1;
++		u16 short_GI20			:1;
++		u16 short_GI40			:1;
++		u16 tx_stbc			:1;
++		u16 rx_stbc			:1;
++		u16 beam_forming		:1;
++		u16 delayed_ba			:1;
++		u16 maximal_amsdu_size		:1;
++		u16 cck_mode_at_40MHz		:1;
++		u16 psmp_support		:1;
++		u16 stbc_ctrl_frame_support	:1;
++		u16 sig_txop_protection_support	:1;
++	};
++	u16 val;
++} __attribute__ ((packed));
++
++union ht_param_info{
++	struct {
++		u8 max_rx_ampdu_factor	:2;
++		u8 mpdu_density		:3;
++		u8 reserved		:3;
++	};
++	u8 val;
++} __attribute__ ((packed));
++
++union ht_exra_param_info {
++	struct {
++		u8 ext_chan_offset		:2;
++		u8 tx_chan_width		:1;
++		u8 rifs_mode			:1;
++		u8 controlled_access_only	:1;
++		u8 service_interval_granularity	:3;
++	};
++	u8 val;
++} __attribute__ ((packed));
++
++union ht_operation_mode{
++	struct {
++		u16 op_mode	:2;
++		u16 non_GF	:1;
++		u16 reserved	:13;
++	};
++	u16 val;
++} __attribute__ ((packed));
++
++
++static int sta_ht_info_init(struct ieee80211_ht_capability *ht_cap,
++			    struct ieee80211_ht_additional_info *ht_extra,
++			    struct sta_ht_info *ht_info_ap,
++			    struct sta_ht_info *ht_info)
++{
++	union ht_cap_info cap;
++	union ht_operation_mode op_mode;
++	union ht_param_info param_info;
++	union ht_exra_param_info extra_param_info;
++
++	IWL_DEBUG_MAC80211("enter: \n");
++
++	if (!ht_info) {
++		IWL_DEBUG_MAC80211("leave: ht_info is NULL\n");
++		return -1;
++	}
++
++	if (ht_cap) {
++		cap.val = (u16) le16_to_cpu(ht_cap->capabilities_info);
++		param_info.val = ht_cap->mac_ht_params_info;
++		ht_info->is_ht = 1;
++		if (cap.short_GI20)
++			ht_info->sgf |= 0x1;
++		if (cap.short_GI40)
++			ht_info->sgf |= 0x2;
++		ht_info->is_green_field = cap.green_field;
++		ht_info->max_amsdu_size = cap.maximal_amsdu_size;
++		ht_info->supported_chan_width = cap.supported_chan_width_set;
++		ht_info->tx_mimo_ps_mode = cap.mimo_power_save_mode;
++		memcpy(ht_info->supp_rates, ht_cap->supported_mcs_set, 16);
++
++		ht_info->ampdu_factor = param_info.max_rx_ampdu_factor;
++		ht_info->mpdu_density = param_info.mpdu_density;
++
++		IWL_DEBUG_MAC80211("SISO mask 0x%X MIMO mask 0x%X \n",
++				    ht_cap->supported_mcs_set[0],
++				    ht_cap->supported_mcs_set[1]);
++
++		if (ht_info_ap) {
++			ht_info->control_channel = ht_info_ap->control_channel;
++			ht_info->extension_chan_offset =
++				ht_info_ap->extension_chan_offset;
++			ht_info->tx_chan_width = ht_info_ap->tx_chan_width;
++			ht_info->operating_mode = ht_info_ap->operating_mode;
++		}
++
++		if (ht_extra) {
++			extra_param_info.val = ht_extra->ht_param;
++			ht_info->control_channel = ht_extra->control_chan;
++			ht_info->extension_chan_offset =
++			    extra_param_info.ext_chan_offset;
++			ht_info->tx_chan_width = extra_param_info.tx_chan_width;
++			op_mode.val = (u16)
++			    le16_to_cpu(ht_extra->operation_mode);
++			ht_info->operating_mode = op_mode.op_mode;
++			IWL_DEBUG_MAC80211("control channel %d\n",
++					    ht_extra->control_chan);
++		}
++	} else
++		ht_info->is_ht = 0;
++
++	IWL_DEBUG_MAC80211("leave\n");
++	return 0;
++}
++
++static int iwl_mac_conf_ht(struct ieee80211_hw *hw,
++			   struct ieee80211_ht_capability *ht_cap,
++			   struct ieee80211_ht_additional_info *ht_extra)
++{
++	struct iwl_priv *priv = hw->priv;
++	int rs;
++
++	IWL_DEBUG_MAC80211("enter: \n");
++
++	rs = sta_ht_info_init(ht_cap, ht_extra, NULL, &priv->current_assoc_ht);
++	iwl4965_set_rxon_chain(priv);
++
++	if (priv && priv->assoc_id &&
++	    (priv->iw_mode == IEEE80211_IF_TYPE_STA)) {
++		unsigned long flags;
++
++		spin_lock_irqsave(&priv->lock, flags);
++		if (priv->beacon_int)
++			queue_work(priv->workqueue, &priv->post_associate.work);
++		else
++			priv->call_post_assoc_from_beacon = 1;
++		spin_unlock_irqrestore(&priv->lock, flags);
++	}
++
++	IWL_DEBUG_MAC80211("leave: control channel %d\n",
++			ht_extra->control_chan);
++	return rs;
++
++}
++
++static void iwl_set_ht_capab(struct ieee80211_hw *hw,
++			     struct ieee80211_ht_capability *ht_cap,
++			     u8 use_wide_chan)
++{
++	union ht_cap_info cap;
++	union ht_param_info param_info;
++
++	memset(&cap, 0, sizeof(union ht_cap_info));
++	memset(&param_info, 0, sizeof(union ht_param_info));
++
++	cap.maximal_amsdu_size = HT_IE_MAX_AMSDU_SIZE_4K;
++	cap.green_field = 1;
++	cap.short_GI20 = 1;
++	cap.short_GI40 = 1;
++	cap.supported_chan_width_set = use_wide_chan;
++	cap.mimo_power_save_mode = 0x3;
++
++	param_info.max_rx_ampdu_factor = CFG_HT_RX_AMPDU_FACTOR_DEF;
++	param_info.mpdu_density = CFG_HT_MPDU_DENSITY_DEF;
++	ht_cap->capabilities_info = (__le16) cpu_to_le16(cap.val);
++	ht_cap->mac_ht_params_info = (u8) param_info.val;
++
++	ht_cap->supported_mcs_set[0] = 0xff;
++	ht_cap->supported_mcs_set[1] = 0xff;
++	ht_cap->supported_mcs_set[4] =
++	    (cap.supported_chan_width_set) ? 0x1: 0x0;
++}
++
++static void iwl_mac_get_ht_capab(struct ieee80211_hw *hw,
++				 struct ieee80211_ht_capability *ht_cap)
++{
++	u8 use_wide_channel = 1;
++	struct iwl_priv *priv = hw->priv;
++
++	IWL_DEBUG_MAC80211("enter: \n");
++	if (priv->channel_width != IWL_CHANNEL_WIDTH_40MHZ)
++		use_wide_channel = 0;
++
++	/* no fat tx allowed on 2.4GHZ */
++	if (priv->phymode != MODE_IEEE80211A)
++		use_wide_channel = 0;
++
++	iwl_set_ht_capab(hw, ht_cap, use_wide_channel);
++	IWL_DEBUG_MAC80211("leave: \n");
++}
++#endif /*CONFIG_IWLWIFI_HT*/
++
++/*****************************************************************************
++ *
++ * sysfs attributes
++ *
++ *****************************************************************************/
++
++#ifdef CONFIG_IWLWIFI_DEBUG
++
++/*
++ * The following adds a new attribute to the sysfs representation
++ * of this device driver (i.e. a new file in /sys/bus/pci/drivers/iwl/)
++ * used for controlling the debug level.
++ *
++ * See the level definitions in iwl for details.
++ */
++
++static ssize_t show_debug_level(struct device_driver *d, char *buf)
++{
++	return sprintf(buf, "0x%08X\n", iwl_debug_level);
++}
++static ssize_t store_debug_level(struct device_driver *d,
++				 const char *buf, size_t count)
++{
++	char *p = (char *)buf;
++	u32 val;
++
++	val = simple_strtoul(p, &p, 0);
++	if (p == buf)
++		printk(KERN_INFO DRV_NAME
++		       ": %s is not in hex or decimal form.\n", buf);
++	else
++		iwl_debug_level = val;
++
++	return strnlen(buf, count);
++}
++
++static DRIVER_ATTR(debug_level, S_IWUSR | S_IRUGO,
++		   show_debug_level, store_debug_level);
++
++#endif /* CONFIG_IWLWIFI_DEBUG */
++
++static ssize_t show_rf_kill(struct device *d,
++			    struct device_attribute *attr, char *buf)
++{
++	/*
++	 * 0 - RF kill not enabled
++	 * 1 - SW based RF kill active (sysfs)
++	 * 2 - HW based RF kill active
++	 * 3 - Both HW and SW based RF kill active
++	 */
++	struct iwl_priv *priv = (struct iwl_priv *)d->driver_data;
++	int val = (test_bit(STATUS_RF_KILL_SW, &priv->status) ? 0x1 : 0x0) |
++		  (test_bit(STATUS_RF_KILL_HW, &priv->status) ? 0x2 : 0x0);
++
++	return sprintf(buf, "%i\n", val);
++}
++
++static ssize_t store_rf_kill(struct device *d,
++			     struct device_attribute *attr,
++			     const char *buf, size_t count)
++{
++	struct iwl_priv *priv = (struct iwl_priv *)d->driver_data;
++
++	mutex_lock(&priv->mutex);
++	iwl_radio_kill_sw(priv, buf[0] == '1');
++	mutex_unlock(&priv->mutex);
++
++	return count;
++}
++
++static DEVICE_ATTR(rf_kill, S_IWUSR | S_IRUGO, show_rf_kill, store_rf_kill);
++
++static ssize_t show_temperature(struct device *d,
++				struct device_attribute *attr, char *buf)
++{
++	struct iwl_priv *priv = (struct iwl_priv *)d->driver_data;
++
++	if (!iwl_is_alive(priv))
++		return -EAGAIN;
++
++	return sprintf(buf, "%d\n", iwl_hw_get_temperature(priv));
++}
++
++static DEVICE_ATTR(temperature, S_IRUGO, show_temperature, NULL);
++
++static ssize_t show_rs_window(struct device *d,
++			      struct device_attribute *attr,
++			      char *buf)
++{
++	struct iwl_priv *priv = d->driver_data;
++	return iwl_fill_rs_info(priv->hw, buf, IWL_AP_ID);
++}
++static DEVICE_ATTR(rs_window, S_IRUGO, show_rs_window, NULL);
++
++static ssize_t show_tx_power(struct device *d,
++			     struct device_attribute *attr, char *buf)
++{
++	struct iwl_priv *priv = (struct iwl_priv *)d->driver_data;
++	return sprintf(buf, "%d\n", priv->user_txpower_limit);
++}
++
++static ssize_t store_tx_power(struct device *d,
++			      struct device_attribute *attr,
++			      const char *buf, size_t count)
++{
++	struct iwl_priv *priv = (struct iwl_priv *)d->driver_data;
++	char *p = (char *)buf;
++	u32 val;
++
++	val = simple_strtoul(p, &p, 10);
++	if (p == buf)
++		printk(KERN_INFO DRV_NAME
++		       ": %s is not in decimal form.\n", buf);
++	else
++		iwl_hw_reg_set_txpower(priv, val);
++
++	return count;
++}
++
++static DEVICE_ATTR(tx_power, S_IWUSR | S_IRUGO, show_tx_power, store_tx_power);
++
++static ssize_t show_flags(struct device *d,
++			  struct device_attribute *attr, char *buf)
++{
++	struct iwl_priv *priv = (struct iwl_priv *)d->driver_data;
++
++	return sprintf(buf, "0x%04X\n", priv->active_rxon.flags);
++}
++
++static ssize_t store_flags(struct device *d,
++			   struct device_attribute *attr,
++			   const char *buf, size_t count)
++{
++	struct iwl_priv *priv = (struct iwl_priv *)d->driver_data;
++	u32 flags = simple_strtoul(buf, NULL, 0);
++
++	mutex_lock(&priv->mutex);
++	if (le32_to_cpu(priv->staging_rxon.flags) != flags) {
++		/* Cancel any currently running scans... */
++		if (iwl_scan_cancel_timeout(priv, 100))
++			IWL_WARNING("Could not cancel scan.\n");
++		else {
++			IWL_DEBUG_INFO("Committing rxon.flags = 0x%04X\n",
++				       flags);
++			priv->staging_rxon.flags = cpu_to_le32(flags);
++			iwl_commit_rxon(priv);
++		}
++	}
++	mutex_unlock(&priv->mutex);
++
++	return count;
++}
++
++static DEVICE_ATTR(flags, S_IWUSR | S_IRUGO, show_flags, store_flags);
++
++static ssize_t show_filter_flags(struct device *d,
++				 struct device_attribute *attr, char *buf)
++{
++	struct iwl_priv *priv = (struct iwl_priv *)d->driver_data;
++
++	return sprintf(buf, "0x%04X\n",
++		le32_to_cpu(priv->active_rxon.filter_flags));
++}
++
++static ssize_t store_filter_flags(struct device *d,
++				  struct device_attribute *attr,
++				  const char *buf, size_t count)
++{
++	struct iwl_priv *priv = (struct iwl_priv *)d->driver_data;
++	u32 filter_flags = simple_strtoul(buf, NULL, 0);
++
++	mutex_lock(&priv->mutex);
++	if (le32_to_cpu(priv->staging_rxon.filter_flags) != filter_flags) {
++		/* Cancel any currently running scans... */
++		if (iwl_scan_cancel_timeout(priv, 100))
++			IWL_WARNING("Could not cancel scan.\n");
++		else {
++			IWL_DEBUG_INFO("Committing rxon.filter_flags = "
++				       "0x%04X\n", filter_flags);
++			priv->staging_rxon.filter_flags =
++				cpu_to_le32(filter_flags);
++			iwl_commit_rxon(priv);
++		}
++	}
++	mutex_unlock(&priv->mutex);
++
++	return count;
++}
++
++static DEVICE_ATTR(filter_flags, S_IWUSR | S_IRUGO, show_filter_flags,
++		   store_filter_flags);
++
++static ssize_t show_tune(struct device *d,
++			 struct device_attribute *attr, char *buf)
++{
++	struct iwl_priv *priv = (struct iwl_priv *)d->driver_data;
++
++	return sprintf(buf, "0x%04X\n",
++		       (priv->phymode << 8) |
++			le16_to_cpu(priv->active_rxon.channel));
++}
++
++static void iwl_set_flags_for_phymode(struct iwl_priv *priv, u8 phymode);
++
++static ssize_t store_tune(struct device *d,
++			  struct device_attribute *attr,
++			  const char *buf, size_t count)
++{
++	struct iwl_priv *priv = (struct iwl_priv *)d->driver_data;
++	char *p = (char *)buf;
++	u16 tune = simple_strtoul(p, &p, 0);
++	u8 phymode = (tune >> 8) & 0xff;
++	u16 channel = tune & 0xff;
++
++	IWL_DEBUG_INFO("Tune request to:%d channel:%d\n", phymode, channel);
++
++	mutex_lock(&priv->mutex);
++	if ((le16_to_cpu(priv->staging_rxon.channel) != channel) ||
++	    (priv->phymode != phymode)) {
++		const struct iwl_channel_info *ch_info;
++
++		ch_info = iwl_get_channel_info(priv, phymode, channel);
++		if (!ch_info) {
++			IWL_WARNING("Requested invalid phymode/channel "
++				    "combination: %d %d\n", phymode, channel);
++			mutex_unlock(&priv->mutex);
++			return -EINVAL;
++		}
++
++		/* Cancel any currently running scans... */
++		if (iwl_scan_cancel_timeout(priv, 100))
++			IWL_WARNING("Could not cancel scan.\n");
++		else {
++			IWL_DEBUG_INFO("Committing phymode and "
++				       "rxon.channel = %d %d\n",
++				       phymode, channel);
++
++			iwl_set_rxon_channel(priv, phymode, channel);
++			iwl_set_flags_for_phymode(priv, phymode);
++
++			iwl_set_rate(priv);
++			iwl_commit_rxon(priv);
++		}
++	}
++	mutex_unlock(&priv->mutex);
++
++	return count;
++}
++
++static DEVICE_ATTR(tune, S_IWUSR | S_IRUGO, show_tune, store_tune);
++
++#ifdef CONFIG_IWLWIFI_SPECTRUM_MEASUREMENT
++
++static ssize_t show_measurement(struct device *d,
++				struct device_attribute *attr, char *buf)
++{
++	struct iwl_priv *priv = dev_get_drvdata(d);
++	struct iwl_spectrum_notification measure_report;
++	u32 size = sizeof(measure_report), len = 0, ofs = 0;
++	u8 *data = (u8 *) & measure_report;
++	unsigned long flags;
++
++	spin_lock_irqsave(&priv->lock, flags);
++	if (!(priv->measurement_status & MEASUREMENT_READY)) {
++		spin_unlock_irqrestore(&priv->lock, flags);
++		return 0;
++	}
++	memcpy(&measure_report, &priv->measure_report, size);
++	priv->measurement_status = 0;
++	spin_unlock_irqrestore(&priv->lock, flags);
++
++	while (size && (PAGE_SIZE - len)) {
++		hex_dump_to_buffer(data + ofs, size, 16, 1, buf + len,
++				   PAGE_SIZE - len, 1);
++		len = strlen(buf);
++		if (PAGE_SIZE - len)
++			buf[len++] = '\n';
++
++		ofs += 16;
++		size -= min(size, 16U);
++	}
++
++	return len;
++}
++
++static ssize_t store_measurement(struct device *d,
++				 struct device_attribute *attr,
++				 const char *buf, size_t count)
++{
++	struct iwl_priv *priv = dev_get_drvdata(d);
++	struct ieee80211_measurement_params params = {
++		.channel = le16_to_cpu(priv->active_rxon.channel),
++		.start_time = cpu_to_le64(priv->last_tsf),
++		.duration = cpu_to_le16(1),
++	};
++	u8 type = IWL_MEASURE_BASIC;
++	u8 buffer[32];
++	u8 channel;
++
++	if (count) {
++		char *p = buffer;
++		strncpy(buffer, buf, min(sizeof(buffer), count));
++		channel = simple_strtoul(p, NULL, 0);
++		if (channel)
++			params.channel = channel;
++
++		p = buffer;
++		while (*p && *p != ' ')
++			p++;
++		if (*p)
++			type = simple_strtoul(p + 1, NULL, 0);
++	}
++
++	IWL_DEBUG_INFO("Invoking measurement of type %d on "
++		       "channel %d (for '%s')\n", type, params.channel, buf);
++	iwl_get_measurement(priv, &params, type);
++
++	return count;
++}
++
++static DEVICE_ATTR(measurement, S_IRUSR | S_IWUSR,
++		   show_measurement, store_measurement);
++#endif /* CONFIG_IWLWIFI_SPECTRUM_MEASUREMENT */
++
++static ssize_t store_retry_rate(struct device *d,
++				struct device_attribute *attr,
++				const char *buf, size_t count)
++{
++	struct iwl_priv *priv = dev_get_drvdata(d);
++
++	priv->retry_rate = simple_strtoul(buf, NULL, 0);
++	if (priv->retry_rate <= 0)
++		priv->retry_rate = 1;
++
++	return count;
++}
++
++static ssize_t show_retry_rate(struct device *d,
++			       struct device_attribute *attr, char *buf)
++{
++	struct iwl_priv *priv = dev_get_drvdata(d);
++	return sprintf(buf, "%d", priv->retry_rate);
++}
++
++static DEVICE_ATTR(retry_rate, S_IWUSR | S_IRUSR, show_retry_rate,
++		   store_retry_rate);
++
++static ssize_t store_power_level(struct device *d,
++				 struct device_attribute *attr,
++				 const char *buf, size_t count)
++{
++	struct iwl_priv *priv = dev_get_drvdata(d);
++	int rc;
++	int mode;
++
++	mode = simple_strtoul(buf, NULL, 0);
++	mutex_lock(&priv->mutex);
++
++	if (!iwl_is_ready(priv)) {
++		rc = -EAGAIN;
++		goto out;
++	}
++
++	if ((mode < 1) || (mode > IWL_POWER_LIMIT) || (mode == IWL_POWER_AC))
++		mode = IWL_POWER_AC;
++	else
++		mode |= IWL_POWER_ENABLED;
++
++	if (mode != priv->power_mode) {
++		rc = iwl_send_power_mode(priv, IWL_POWER_LEVEL(mode));
++		if (rc) {
++			IWL_DEBUG_MAC80211("failed setting power mode.\n");
++			goto out;
++		}
++		priv->power_mode = mode;
++	}
++
++	rc = count;
++
++ out:
++	mutex_unlock(&priv->mutex);
++	return rc;
++}
++
++#define MAX_WX_STRING 80
++
++/* Values are in microsecond */
++static const s32 timeout_duration[] = {
++	350000,
++	250000,
++	75000,
++	37000,
++	25000,
++};
++static const s32 period_duration[] = {
++	400000,
++	700000,
++	1000000,
++	1000000,
++	1000000
++};
++
++static ssize_t show_power_level(struct device *d,
++				struct device_attribute *attr, char *buf)
++{
++	struct iwl_priv *priv = dev_get_drvdata(d);
++	int level = IWL_POWER_LEVEL(priv->power_mode);
++	char *p = buf;
++
++	p += sprintf(p, "%d ", level);
++	switch (level) {
++	case IWL_POWER_MODE_CAM:
++	case IWL_POWER_AC:
++		p += sprintf(p, "(AC)");
++		break;
++	case IWL_POWER_BATTERY:
++		p += sprintf(p, "(BATTERY)");
++		break;
++	default:
++		p += sprintf(p,
++			     "(Timeout %dms, Period %dms)",
++			     timeout_duration[level - 1] / 1000,
++			     period_duration[level - 1] / 1000);
++	}
++
++	if (!(priv->power_mode & IWL_POWER_ENABLED))
++		p += sprintf(p, " OFF\n");
++	else
++		p += sprintf(p, " \n");
++
++	return (p - buf + 1);
++
++}
++
++static DEVICE_ATTR(power_level, S_IWUSR | S_IRUSR, show_power_level,
++		   store_power_level);
++
++static ssize_t show_channels(struct device *d,
++			     struct device_attribute *attr, char *buf)
++{
++	struct iwl_priv *priv = dev_get_drvdata(d);
++	int len = 0, i;
++	struct ieee80211_channel *channels = NULL;
++	const struct ieee80211_hw_mode *hw_mode = NULL;
++	int count = 0;
++
++	if (!iwl_is_ready(priv))
++		return -EAGAIN;
++
++	hw_mode = iwl_get_hw_mode(priv, MODE_IEEE80211G);
++	if (!hw_mode)
++		hw_mode = iwl_get_hw_mode(priv, MODE_IEEE80211B);
++	if (hw_mode) {
++		channels = hw_mode->channels;
++		count = hw_mode->num_channels;
++	}
++
++	len +=
++	    sprintf(&buf[len],
++		    "Displaying %d channels in 2.4GHz band "
++		    "(802.11bg):\n", count);
++
++	for (i = 0; i < count; i++)
++		len += sprintf(&buf[len], "%d: %ddBm: BSS%s%s, %s.\n",
++			       channels[i].chan,
++			       channels[i].power_level,
++			       channels[i].
++			       flag & IEEE80211_CHAN_W_RADAR_DETECT ?
++			       " (IEEE 802.11h required)" : "",
++			       (!(channels[i].flag & IEEE80211_CHAN_W_IBSS)
++				|| (channels[i].
++				    flag &
++				    IEEE80211_CHAN_W_RADAR_DETECT)) ? "" :
++			       ", IBSS",
++			       channels[i].
++			       flag & IEEE80211_CHAN_W_ACTIVE_SCAN ?
++			       "active/passive" : "passive only");
++
++	hw_mode = iwl_get_hw_mode(priv, MODE_IEEE80211A);
++	if (hw_mode) {
++		channels = hw_mode->channels;
++		count = hw_mode->num_channels;
++	} else {
++		channels = NULL;
++		count = 0;
++	}
++
++	len += sprintf(&buf[len], "Displaying %d channels in 5.2GHz band "
++		       "(802.11a):\n", count);
++
++	for (i = 0; i < count; i++)
++		len += sprintf(&buf[len], "%d: %ddBm: BSS%s%s, %s.\n",
++			       channels[i].chan,
++			       channels[i].power_level,
++			       channels[i].
++			       flag & IEEE80211_CHAN_W_RADAR_DETECT ?
++			       " (IEEE 802.11h required)" : "",
++			       (!(channels[i].flag & IEEE80211_CHAN_W_IBSS)
++				|| (channels[i].
++				    flag &
++				    IEEE80211_CHAN_W_RADAR_DETECT)) ? "" :
++			       ", IBSS",
++			       channels[i].
++			       flag & IEEE80211_CHAN_W_ACTIVE_SCAN ?
++			       "active/passive" : "passive only");
++
++	return len;
++}
++
++static DEVICE_ATTR(channels, S_IRUSR, show_channels, NULL);
++
++static ssize_t show_statistics(struct device *d,
++			       struct device_attribute *attr, char *buf)
++{
++	struct iwl_priv *priv = dev_get_drvdata(d);
++	u32 size = sizeof(struct iwl_notif_statistics);
++	u32 len = 0, ofs = 0;
++	u8 *data = (u8 *) & priv->statistics;
++	int rc = 0;
++
++	if (!iwl_is_alive(priv))
++		return -EAGAIN;
++
++	mutex_lock(&priv->mutex);
++	rc = iwl_send_statistics_request(priv);
++	mutex_unlock(&priv->mutex);
++
++	if (rc) {
++		len = sprintf(buf,
++			      "Error sending statistics request: 0x%08X\n", rc);
++		return len;
++	}
++
++	while (size && (PAGE_SIZE - len)) {
++		hex_dump_to_buffer(data + ofs, size, 16, 1, buf + len,
++				   PAGE_SIZE - len, 1);
++		len = strlen(buf);
++		if (PAGE_SIZE - len)
++			buf[len++] = '\n';
++
++		ofs += 16;
++		size -= min(size, 16U);
++	}
++
++	return len;
++}
++
++static DEVICE_ATTR(statistics, S_IRUGO, show_statistics, NULL);
++
++static ssize_t show_antenna(struct device *d,
++			    struct device_attribute *attr, char *buf)
++{
++	struct iwl_priv *priv = dev_get_drvdata(d);
++
++	if (!iwl_is_alive(priv))
++		return -EAGAIN;
++
++	return sprintf(buf, "%d\n", priv->antenna);
++}
++
++static ssize_t store_antenna(struct device *d,
++			     struct device_attribute *attr,
++			     const char *buf, size_t count)
++{
++	int ant;
++	struct iwl_priv *priv = dev_get_drvdata(d);
++
++	if (count == 0)
++		return 0;
++
++	if (sscanf(buf, "%1i", &ant) != 1) {
++		IWL_DEBUG_INFO("not in hex or decimal form.\n");
++		return count;
++	}
++
++	if ((ant >= 0) && (ant <= 2)) {
++		IWL_DEBUG_INFO("Setting antenna select to %d.\n", ant);
++		priv->antenna = (enum iwl_antenna)ant;
++	} else
++		IWL_DEBUG_INFO("Bad antenna select value %d.\n", ant);
++
++
++	return count;
++}
++
++static DEVICE_ATTR(antenna, S_IWUSR | S_IRUGO, show_antenna, store_antenna);
++
++static ssize_t show_status(struct device *d,
++			   struct device_attribute *attr, char *buf)
++{
++	struct iwl_priv *priv = (struct iwl_priv *)d->driver_data;
++	if (!iwl_is_alive(priv))
++		return -EAGAIN;
++	return sprintf(buf, "0x%08x\n", (int)priv->status);
++}
++
++static DEVICE_ATTR(status, S_IRUGO, show_status, NULL);
++
++static ssize_t dump_error_log(struct device *d,
++			      struct device_attribute *attr,
++			      const char *buf, size_t count)
++{
++	char *p = (char *)buf;
++
++	if (p[0] == '1')
++		iwl_dump_nic_error_log((struct iwl_priv *)d->driver_data);
++
++	return strnlen(buf, count);
++}
++
++static DEVICE_ATTR(dump_errors, S_IWUSR, NULL, dump_error_log);
++
++static ssize_t dump_event_log(struct device *d,
++			      struct device_attribute *attr,
++			      const char *buf, size_t count)
++{
++	char *p = (char *)buf;
++
++	if (p[0] == '1')
++		iwl_dump_nic_event_log((struct iwl_priv *)d->driver_data);
++
++	return strnlen(buf, count);
++}
++
++static DEVICE_ATTR(dump_events, S_IWUSR, NULL, dump_event_log);
++
++/*****************************************************************************
++ *
++ * driver setup and teardown
++ *
++ *****************************************************************************/
++
++static void iwl_setup_deferred_work(struct iwl_priv *priv)
++{
++	priv->workqueue = create_workqueue(DRV_NAME);
++
++	init_waitqueue_head(&priv->wait_command_queue);
++
++	INIT_WORK(&priv->up, iwl_bg_up);
++	INIT_WORK(&priv->restart, iwl_bg_restart);
++	INIT_WORK(&priv->rx_replenish, iwl_bg_rx_replenish);
++	INIT_WORK(&priv->scan_completed, iwl_bg_scan_completed);
++	INIT_WORK(&priv->request_scan, iwl_bg_request_scan);
++	INIT_WORK(&priv->abort_scan, iwl_bg_abort_scan);
++	INIT_WORK(&priv->rf_kill, iwl_bg_rf_kill);
++	INIT_WORK(&priv->beacon_update, iwl_bg_beacon_update);
++	INIT_DELAYED_WORK(&priv->post_associate, iwl_bg_post_associate);
++	INIT_DELAYED_WORK(&priv->init_alive_start, iwl_bg_init_alive_start);
++	INIT_DELAYED_WORK(&priv->alive_start, iwl_bg_alive_start);
++	INIT_DELAYED_WORK(&priv->scan_check, iwl_bg_scan_check);
++
++	iwl_hw_setup_deferred_work(priv);
++
++	tasklet_init(&priv->irq_tasklet, (void (*)(unsigned long))
++		     iwl_irq_tasklet, (unsigned long)priv);
++}
++
++static void iwl_cancel_deferred_work(struct iwl_priv *priv)
++{
++	iwl_hw_cancel_deferred_work(priv);
++
++	cancel_delayed_work(&priv->scan_check);
++	cancel_delayed_work(&priv->alive_start);
++	cancel_delayed_work(&priv->post_associate);
++	cancel_work_sync(&priv->beacon_update);
++}
++
++static struct attribute *iwl_sysfs_entries[] = {
++	&dev_attr_antenna.attr,
++	&dev_attr_channels.attr,
++	&dev_attr_dump_errors.attr,
++	&dev_attr_dump_events.attr,
++	&dev_attr_flags.attr,
++	&dev_attr_filter_flags.attr,
++#ifdef CONFIG_IWLWIFI_SPECTRUM_MEASUREMENT
++	&dev_attr_measurement.attr,
++#endif
++	&dev_attr_power_level.attr,
++	&dev_attr_retry_rate.attr,
++	&dev_attr_rf_kill.attr,
++	&dev_attr_rs_window.attr,
++	&dev_attr_statistics.attr,
++	&dev_attr_status.attr,
++	&dev_attr_temperature.attr,
++	&dev_attr_tune.attr,
++	&dev_attr_tx_power.attr,
++
++	NULL
++};
++
++static struct attribute_group iwl_attribute_group = {
++	.name = NULL,		/* put in device directory */
++	.attrs = iwl_sysfs_entries,
++};
++
++static struct ieee80211_ops iwl_hw_ops = {
++	.tx = iwl_mac_tx,
++	.open = iwl_mac_open,
++	.stop = iwl_mac_stop,
++	.add_interface = iwl_mac_add_interface,
++	.remove_interface = iwl_mac_remove_interface,
++	.config = iwl_mac_config,
++	.config_interface = iwl_mac_config_interface,
++	.set_key = iwl_mac_set_key,
++	.get_stats = iwl_mac_get_stats,
++	.get_tx_stats = iwl_mac_get_tx_stats,
++	.conf_tx = iwl_mac_conf_tx,
++	.get_tsf = iwl_mac_get_tsf,
++	.reset_tsf = iwl_mac_reset_tsf,
++	.beacon_update = iwl_mac_beacon_update,
++#ifdef CONFIG_IWLWIFI_HT
++	.conf_ht = iwl_mac_conf_ht,
++	.get_ht_capab = iwl_mac_get_ht_capab,
++#ifdef CONFIG_IWLWIFI_HT_AGG
++	.ht_tx_agg_start = iwl_mac_ht_tx_agg_start,
++	.ht_tx_agg_stop = iwl_mac_ht_tx_agg_stop,
++	.ht_rx_agg_start = iwl_mac_ht_rx_agg_start,
++	.ht_rx_agg_stop = iwl_mac_ht_rx_agg_stop,
++#endif  /* CONFIG_IWLWIFI_HT_AGG */
++#endif  /* CONFIG_IWLWIFI_HT */
++	.hw_scan = iwl_mac_hw_scan
++};
++
++static int iwl_pci_probe(struct pci_dev *pdev, const struct pci_device_id *ent)
++{
++	int err = 0;
++	struct iwl_priv *priv;
++	struct ieee80211_hw *hw;
++	int i;
++
++	if (iwl_param_disable_hw_scan) {
++		IWL_DEBUG_INFO("Disabling hw_scan\n");
++		iwl_hw_ops.hw_scan = NULL;
++	}
++
++	if ((iwl_param_queues_num > IWL_MAX_NUM_QUEUES) ||
++	    (iwl_param_queues_num < IWL_MIN_NUM_QUEUES)) {
++		IWL_ERROR("invalid queues_num, should be between %d and %d\n",
++			  IWL_MIN_NUM_QUEUES, IWL_MAX_NUM_QUEUES);
++		err = -EINVAL;
++		goto out;
++	}
++
++	/* mac80211 allocates memory for this device instance, including
++	 *   space for this driver's private structure */
++	hw = ieee80211_alloc_hw(sizeof(struct iwl_priv), &iwl_hw_ops);
++	if (hw == NULL) {
++		IWL_ERROR("Can not allocate network device\n");
++		err = -ENOMEM;
++		goto out;
++	}
++	SET_IEEE80211_DEV(hw, &pdev->dev);
++
++	IWL_DEBUG_INFO("*** LOAD DRIVER ***\n");
++	priv = hw->priv;
++	priv->hw = hw;
++
++	priv->pci_dev = pdev;
++	priv->antenna = (enum iwl_antenna)iwl_param_antenna;
++#ifdef CONFIG_IWLWIFI_DEBUG
++	iwl_debug_level = iwl_param_debug;
++	atomic_set(&priv->restrict_refcnt, 0);
++#endif
++	priv->retry_rate = 1;
++
++	priv->ibss_beacon = NULL;
++
++	/* Tell mac80211 and its clients (e.g. Wireless Extensions)
++	 *   the range of signal quality values that we'll provide.
++	 * Negative values for level/noise indicate that we'll provide dBm.
++	 * For WE, at least, non-0 values here *enable* display of values
++	 *   in app (iwconfig). */
++	hw->max_rssi = -20;	/* signal level, negative indicates dBm */
++	hw->max_noise = -20;	/* noise level, negative indicates dBm */
++	hw->max_signal = 100;	/* link quality indication (%) */
++
++	/* Tell mac80211 our Tx characteristics */
++	hw->flags = IEEE80211_HW_WEP_INCLUDE_IV |
++	    IEEE80211_HW_HOST_GEN_BEACON_TEMPLATE;
++
++	hw->queues = 4;
++#ifdef CONFIG_IWLWIFI_HT
++#ifdef CONFIG_IWLWIFI_HT_AGG
++	hw->queues = 16;
++#endif /* CONFIG_IWLWIFI_HT_AGG */
++#endif /* CONFIG_IWLWIFI_HT */
++
++	spin_lock_init(&priv->lock);
++	spin_lock_init(&priv->power_data.lock);
++	spin_lock_init(&priv->sta_lock);
++	spin_lock_init(&priv->hcmd_lock);
++	spin_lock_init(&priv->lq_mngr.lock);
++
++	for (i = 0; i < IWL_IBSS_MAC_HASH_SIZE; i++)
++		INIT_LIST_HEAD(&priv->ibss_mac_hash[i]);
++
++	INIT_LIST_HEAD(&priv->free_frames);
++
++	mutex_init(&priv->mutex);
++	if (pci_enable_device(pdev)) {
++		err = -ENODEV;
++		goto out_ieee80211_free_hw;
++	}
++
++	pci_set_master(pdev);
++
++	iwl_clear_stations_table(priv);
++
++	priv->data_retry_limit = -1;
++	priv->ieee_channels = NULL;
++	priv->ieee_rates = NULL;
++	priv->phymode = -1;
++
++	err = pci_set_dma_mask(pdev, DMA_32BIT_MASK);
++	if (!err)
++		err = pci_set_consistent_dma_mask(pdev, DMA_32BIT_MASK);
++	if (err) {
++		printk(KERN_WARNING DRV_NAME ": No suitable DMA available.\n");
++		goto out_pci_disable_device;
++	}
++
++	pci_set_drvdata(pdev, priv);
++	err = pci_request_regions(pdev, DRV_NAME);
++	if (err)
++		goto out_pci_disable_device;
++	/* We disable the RETRY_TIMEOUT register (0x41) to keep
++	 * PCI Tx retries from interfering with C3 CPU state */
++	pci_write_config_byte(pdev, 0x41, 0x00);
++	priv->hw_base = pci_iomap(pdev, 0, 0);
++	if (!priv->hw_base) {
++		err = -ENODEV;
++		goto out_pci_release_regions;
++	}
++
++	IWL_DEBUG_INFO("pci_resource_len = 0x%08llx\n",
++			(unsigned long long) pci_resource_len(pdev, 0));
++	IWL_DEBUG_INFO("pci_resource_base = %p\n", priv->hw_base);
++
++	/* Initialize module parameter values here */
++
++	if (iwl_param_disable) {
++		set_bit(STATUS_RF_KILL_SW, &priv->status);
++		IWL_DEBUG_INFO("Radio disabled.\n");
++	}
++
++	priv->iw_mode = IEEE80211_IF_TYPE_STA;
++
++	priv->ps_mode = 0;
++	priv->use_ant_b_for_management_frame = 1; /* start with ant B */
++	priv->is_ht_enabled = 1;
++	priv->channel_width = IWL_CHANNEL_WIDTH_40MHZ;
++	priv->valid_antenna = 0x7;	/* assume all 3 connected */
++	priv->ps_mode = IWL_MIMO_PS_NONE;
++	priv->cck_power_index_compensation = iwl_read32(
++		priv, CSR_HW_REV_WA_REG);
++
++	iwl4965_set_rxon_chain(priv);
++
++	printk(KERN_INFO DRV_NAME
++	       ": Detected Intel Wireless WiFi Link 4965AGN\n");
++
++	/* Device-specific setup */
++	if (iwl_hw_set_hw_setting(priv)) {
++		IWL_ERROR("failed to set hw settings\n");
++		mutex_unlock(&priv->mutex);
++		goto out_iounmap;
++	}
++
++#ifdef CONFIG_IWLWIFI_QOS
++	if (iwl_param_qos_enable)
++		priv->qos_data.qos_enable = 1;
++
++	iwl_reset_qos(priv);
++
++	priv->qos_data.qos_active = 0;
++	priv->qos_data.qos_cap.val = 0;
++#endif /* CONFIG_IWLWIFI_QOS */
++
++	iwl_set_rxon_channel(priv, MODE_IEEE80211G, 6);
++	iwl_setup_deferred_work(priv);
++	iwl_setup_rx_handlers(priv);
++
++	priv->rates_mask = IWL_RATES_MASK;
++	/* If power management is turned on, default to AC mode */
++	priv->power_mode = IWL_POWER_AC;
++	priv->user_txpower_limit = IWL_DEFAULT_TX_POWER;
++
++	pci_enable_msi(pdev);
++
++	err = request_irq(pdev->irq, iwl_isr, IRQF_SHARED, DRV_NAME, priv);
++	if (err) {
++		IWL_ERROR("Error allocating IRQ %d\n", pdev->irq);
++		goto out_disable_msi;
++	}
++
++	mutex_lock(&priv->mutex);
++
++	err = sysfs_create_group(&pdev->dev.kobj, &iwl_attribute_group);
++	if (err) {
++		IWL_ERROR("failed to create sysfs device attributes\n");
++		mutex_unlock(&priv->mutex);
++		goto out_release_irq;
++	}
++
++	/* fetch ucode file from disk, alloc and copy to bus-master buffers ...
++	 * ucode filename and max sizes are card-specific. */
++	err = iwl_read_ucode(priv);
++	if (err) {
++		IWL_ERROR("Could not read microcode: %d\n", err);
++		mutex_unlock(&priv->mutex);
++		goto out_pci_alloc;
++	}
++
++	mutex_unlock(&priv->mutex);
++
++	IWL_DEBUG_INFO("Queing UP work.\n");
++
++	queue_work(priv->workqueue, &priv->up);
++
++	return 0;
++
++ out_pci_alloc:
++	iwl_dealloc_ucode_pci(priv);
++
++	sysfs_remove_group(&pdev->dev.kobj, &iwl_attribute_group);
++
++ out_release_irq:
++	free_irq(pdev->irq, priv);
++
++ out_disable_msi:
++	pci_disable_msi(pdev);
++	destroy_workqueue(priv->workqueue);
++	priv->workqueue = NULL;
++	iwl_unset_hw_setting(priv);
++
++ out_iounmap:
++	pci_iounmap(pdev, priv->hw_base);
++ out_pci_release_regions:
++	pci_release_regions(pdev);
++ out_pci_disable_device:
++	pci_disable_device(pdev);
++	pci_set_drvdata(pdev, NULL);
++ out_ieee80211_free_hw:
++	ieee80211_free_hw(priv->hw);
++ out:
++	return err;
++}
++
++static void iwl_pci_remove(struct pci_dev *pdev)
++{
++	struct iwl_priv *priv = pci_get_drvdata(pdev);
++	struct list_head *p, *q;
++	int i;
++
++	if (!priv)
++		return;
++
++	IWL_DEBUG_INFO("*** UNLOAD DRIVER ***\n");
++
++	mutex_lock(&priv->mutex);
++	set_bit(STATUS_EXIT_PENDING, &priv->status);
++	__iwl_down(priv);
++	mutex_unlock(&priv->mutex);
++
++	/* Free MAC hash list for ADHOC */
++	for (i = 0; i < IWL_IBSS_MAC_HASH_SIZE; i++) {
++		list_for_each_safe(p, q, &priv->ibss_mac_hash[i]) {
++			list_del(p);
++			kfree(list_entry(p, struct iwl_ibss_seq, list));
++		}
++	}
++
++	sysfs_remove_group(&pdev->dev.kobj, &iwl_attribute_group);
++
++	iwl_dealloc_ucode_pci(priv);
++
++	if (priv->rxq.bd)
++		iwl_rx_queue_free(priv, &priv->rxq);
++	iwl_hw_txq_ctx_free(priv);
++
++	iwl_unset_hw_setting(priv);
++	iwl_clear_stations_table(priv);
++
++	if (priv->mac80211_registered) {
++		ieee80211_unregister_hw(priv->hw);
++		iwl_rate_control_unregister(priv->hw);
++	}
++
++	/* ieee80211_unregister_hw calls iwl_mac_stop, which flushes
++	 * priv->workqueue... so we can't take down the workqueue
++	 * until now... */
++	destroy_workqueue(priv->workqueue);
++	priv->workqueue = NULL;
++
++	free_irq(pdev->irq, priv);
++	pci_disable_msi(pdev);
++	pci_iounmap(pdev, priv->hw_base);
++	pci_release_regions(pdev);
++	pci_disable_device(pdev);
++	pci_set_drvdata(pdev, NULL);
++
++	kfree(priv->channel_info);
++
++	kfree(priv->ieee_channels);
++	kfree(priv->ieee_rates);
++
++	if (priv->ibss_beacon)
++		dev_kfree_skb(priv->ibss_beacon);
++
++	ieee80211_free_hw(priv->hw);
++}
++
++#ifdef CONFIG_PM
++
++static int iwl_pci_suspend(struct pci_dev *pdev, pm_message_t state)
++{
++	struct iwl_priv *priv = pci_get_drvdata(pdev);
++
++	mutex_lock(&priv->mutex);
++
++	set_bit(STATUS_IN_SUSPEND, &priv->status);
++
++	/* Take down the device; powers it off, etc. */
++	__iwl_down(priv);
++
++	if (priv->mac80211_registered)
++		ieee80211_stop_queues(priv->hw);
++
++	pci_save_state(pdev);
++	pci_disable_device(pdev);
++	pci_set_power_state(pdev, PCI_D3hot);
++
++	mutex_unlock(&priv->mutex);
++
++	return 0;
++}
++
++static void iwl_resume(struct iwl_priv *priv)
++{
++	unsigned long flags;
++
++	/* The following it a temporary work around due to the
++	 * suspend / resume not fully initializing the NIC correctly.
++	 * Without all of the following, resume will not attempt to take
++	 * down the NIC (it shouldn't really need to) and will just try
++	 * and bring the NIC back up.  However that fails during the
++	 * ucode verification process.  This then causes iwl_down to be
++	 * called *after* iwl_hw_nic_init() has succeeded -- which
++	 * then lets the next init sequence succeed.  So, we've
++	 * replicated all of that NIC init code here... */
++
++	iwl_write32(priv, CSR_INT, 0xFFFFFFFF);
++
++	iwl_hw_nic_init(priv);
++
++	iwl_write32(priv, CSR_UCODE_DRV_GP1_CLR, CSR_UCODE_SW_BIT_RFKILL);
++	iwl_write32(priv, CSR_UCODE_DRV_GP1_CLR,
++		    CSR_UCODE_DRV_GP1_BIT_CMD_BLOCKED);
++	iwl_write32(priv, CSR_INT, 0xFFFFFFFF);
++	iwl_write32(priv, CSR_UCODE_DRV_GP1_CLR, CSR_UCODE_SW_BIT_RFKILL);
++	iwl_write32(priv, CSR_UCODE_DRV_GP1_CLR, CSR_UCODE_SW_BIT_RFKILL);
++
++	/* tell the device to stop sending interrupts */
++	iwl_disable_interrupts(priv);
++
++	spin_lock_irqsave(&priv->lock, flags);
++	iwl_clear_bit(priv, CSR_GP_CNTRL, CSR_GP_CNTRL_REG_FLAG_MAC_ACCESS_REQ);
++
++	if (!iwl_grab_restricted_access(priv)) {
++		iwl_write_restricted_reg(priv, APMG_CLK_DIS_REG,
++					 APMG_CLK_VAL_DMA_CLK_RQT);
++		iwl_release_restricted_access(priv);
++	}
++	spin_unlock_irqrestore(&priv->lock, flags);
++
++	udelay(5);
++
++	iwl_hw_nic_reset(priv);
++
++	/* Bring the device back up */
++	clear_bit(STATUS_IN_SUSPEND, &priv->status);
++	queue_work(priv->workqueue, &priv->up);
++}
++
++static int iwl_pci_resume(struct pci_dev *pdev)
++{
++	struct iwl_priv *priv = pci_get_drvdata(pdev);
++	int err;
++
++	printk(KERN_INFO "Coming out of suspend...\n");
++
++	mutex_lock(&priv->mutex);
++
++	pci_set_power_state(pdev, PCI_D0);
++	err = pci_enable_device(pdev);
++	pci_restore_state(pdev);
++
++	/*
++	 * Suspend/Resume resets the PCI configuration space, so we have to
++	 * re-disable the RETRY_TIMEOUT register (0x41) to keep PCI Tx retries
++	 * from interfering with C3 CPU state. pci_restore_state won't help
++	 * here since it only restores the first 64 bytes pci config header.
++	 */
++	pci_write_config_byte(pdev, 0x41, 0x00);
++
++	iwl_resume(priv);
++	mutex_unlock(&priv->mutex);
++
++	return 0;
++}
++
++#endif /* CONFIG_PM */
++
++/*****************************************************************************
++ *
++ * driver and module entry point
++ *
++ *****************************************************************************/
++
++static struct pci_driver iwl_driver = {
++	.name = DRV_NAME,
++	.id_table = iwl_hw_card_ids,
++	.probe = iwl_pci_probe,
++	.remove = __devexit_p(iwl_pci_remove),
++#ifdef CONFIG_PM
++	.suspend = iwl_pci_suspend,
++	.resume = iwl_pci_resume,
++#endif
++};
++
++static int __init iwl_init(void)
++{
++
++	int ret;
++	printk(KERN_INFO DRV_NAME ": " DRV_DESCRIPTION ", " DRV_VERSION "\n");
++	printk(KERN_INFO DRV_NAME ": " DRV_COPYRIGHT "\n");
++	ret = pci_register_driver(&iwl_driver);
++	if (ret) {
++		IWL_ERROR("Unable to initialize PCI module\n");
++		return ret;
++	}
++#ifdef CONFIG_IWLWIFI_DEBUG
++	ret = driver_create_file(&iwl_driver.driver, &driver_attr_debug_level);
++	if (ret) {
++		IWL_ERROR("Unable to create driver sysfs file\n");
++		pci_unregister_driver(&iwl_driver);
++		return ret;
++	}
++#endif
++
++	return ret;
++}
++
++static void __exit iwl_exit(void)
++{
++#ifdef CONFIG_IWLWIFI_DEBUG
++	driver_remove_file(&iwl_driver.driver, &driver_attr_debug_level);
++#endif
++	pci_unregister_driver(&iwl_driver);
++}
++
++module_param_named(antenna, iwl_param_antenna, int, 0444);
++MODULE_PARM_DESC(antenna, "select antenna (1=Main, 2=Aux, default 0 [both])");
++module_param_named(disable, iwl_param_disable, int, 0444);
++MODULE_PARM_DESC(disable, "manually disable the radio (default 0 [radio on])");
++module_param_named(hwcrypto, iwl_param_hwcrypto, int, 0444);
++MODULE_PARM_DESC(hwcrypto,
++		 "using hardware crypto engine (default 0 [software])\n");
++module_param_named(debug, iwl_param_debug, int, 0444);
++MODULE_PARM_DESC(debug, "debug output mask");
++module_param_named(disable_hw_scan, iwl_param_disable_hw_scan, int, 0444);
++MODULE_PARM_DESC(disable_hw_scan, "disable hardware scanning (default 0)");
++
++module_param_named(queues_num, iwl_param_queues_num, int, 0444);
++MODULE_PARM_DESC(queues_num, "number of hw queues.");
++
++/* QoS */
++module_param_named(qos_enable, iwl_param_qos_enable, int, 0444);
++MODULE_PARM_DESC(qos_enable, "enable all QoS functionality");
++
++module_exit(iwl_exit);
++module_init(iwl_init);
+diff --git a/drivers/net/wireless/iwlwifi.h b/drivers/net/wireless/iwlwifi.h
+new file mode 100644
+index 0000000..00c79e2
+--- /dev/null
++++ b/drivers/net/wireless/iwlwifi.h
+@@ -0,0 +1,713 @@
++/******************************************************************************
++ *
++ * Copyright(c) 2003 - 2007 Intel Corporation. All rights reserved.
++ *
++ * Portions of this file are derived from the ipw3945 project, as well
++ * as portions of the ieee80211 subsystem header files.
++ *
++ * This program is free software; you can redistribute it and/or modify it
++ * under the terms of version 2 of the GNU General Public License as
++ * published by the Free Software Foundation.
++ *
++ * 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.,
++ * 51 Franklin Street, Fifth Floor, Boston, MA 02110, USA
++ *
++ * The full GNU General Public License is included in this distribution in the
++ * file called LICENSE.
++ *
++ * Contact Information:
++ * James P. Ketrenos <ipw2100-admin at linux.intel.com>
++ * Intel Corporation, 5200 N.E. Elam Young Parkway, Hillsboro, OR 97124-6497
++ *
++ *****************************************************************************/
++
++#ifndef __iwlwifi_h__
++#define __iwlwifi_h__
++
++#include <linux/pci.h> /* for struct pci_device_id */
++#include <linux/kernel.h>
++#include <net/ieee80211_radiotap.h>
++
++struct iwl_priv;
++
++/* Hardware specific file defines the PCI IDs table for that hardware module */
++extern struct pci_device_id iwl_hw_card_ids[];
++
++#if IWL == 3945
++
++#define DRV_NAME	"iwl3945"
++#include "iwl-hw.h"
++#include "iwl-3945-hw.h"
++
++#elif IWL == 4965
++
++#define DRV_NAME        "iwl4965"
++#include "iwl-hw.h"
++#include "iwl-4965-hw.h"
++
++#endif
++
++#include "iwl-prph.h"
++
++/*
++ * Driver implementation data structures, constants, inline
++ * functions
++ *
++ * NOTE:  DO NOT PUT HARDWARE/UCODE SPECIFIC DECLRATIONS HERE
++ *
++ * Hardware specific declrations go into iwl-*hw.h
++ *
++ */
++
++#include "iwl-debug.h"
++
++/* Default noise level to report when noise measurement is not available.
++ *   This may be because we're:
++ *   1)  Not associated (4965, no beacon statistics being sent to driver)
++ *   2)  Scanning (noise measurement does not apply to associated channel)
++ *   3)  Receiving CCK (3945 delivers noise info only for OFDM frames)
++ * Use default noise value of -127 ... this is below the range of measurable
++ *   Rx dBm for either 3945 or 4965, so it can indicate "unmeasurable" to user.
++ *   Also, -127 works better than 0 when averaging frames with/without
++ *   noise info (e.g. averaging might be done in app); measured dBm values are
++ *   always negative ... using a negative value as the default keeps all
++ *   averages within an s8's (used in some apps) range of negative values. */
++#define IWL_NOISE_MEAS_NOT_AVAILABLE (-127)
++
++/* Module parameters accessible from iwl-*.c */
++extern int iwl_param_disable_hw_scan;
++extern int iwl_param_debug;
++extern int iwl_param_mode;
++extern int iwl_param_disable;
++extern int iwl_param_antenna;
++extern int iwl_param_hwcrypto;
++extern int iwl_param_qos_enable;
++extern int iwl_param_queues_num;
++
++enum iwl_antenna {
++	IWL_ANTENNA_DIVERSITY,
++	IWL_ANTENNA_MAIN,
++	IWL_ANTENNA_AUX
++};
++
++/*
++ * RTS threshold here is total size [2347] minus 4 FCS bytes
++ * Per spec:
++ *   a value of 0 means RTS on all data/management packets
++ *   a value > max MSDU size means no RTS
++ * else RTS for data/management frames where MPDU is larger
++ *   than RTS value.
++ */
++#define DEFAULT_RTS_THRESHOLD     2347U
++#define MIN_RTS_THRESHOLD         0U
++#define MAX_RTS_THRESHOLD         2347U
++#define MAX_MSDU_SIZE		  2304U
++#define MAX_MPDU_SIZE		  2346U
++#define DEFAULT_BEACON_INTERVAL   100U
++#define	DEFAULT_SHORT_RETRY_LIMIT 7U
++#define	DEFAULT_LONG_RETRY_LIMIT  4U
++
++struct iwl_rx_mem_buffer {
++	dma_addr_t dma_addr;
++	struct sk_buff *skb;
++	struct list_head list;
++};
++
++struct iwl_rt_rx_hdr {
++	struct ieee80211_radiotap_header rt_hdr;
++	__le64 rt_tsf;		/* TSF */
++	u8 rt_flags;		/* radiotap packet flags */
++	u8 rt_rate;		/* rate in 500kb/s */
++	__le16 rt_channelMHz;	/* channel in MHz */
++	__le16 rt_chbitmask;	/* channel bitfield */
++	s8 rt_dbmsignal;	/* signal in dBm, kluged to signed */
++	s8 rt_dbmnoise;
++	u8 rt_antenna;		/* antenna number */
++	u8 payload[0];		/* payload... */
++} __attribute__ ((packed));
++
++struct iwl_rt_tx_hdr {
++	struct ieee80211_radiotap_header rt_hdr;
++	u8 rt_rate;		/* rate in 500kb/s */
++	__le16 rt_channel;	/* channel in mHz */
++	__le16 rt_chbitmask;	/* channel bitfield */
++	s8 rt_dbmsignal;	/* signal in dBm, kluged to signed */
++	u8 rt_antenna;		/* antenna number */
++	u8 payload[0];		/* payload... */
++} __attribute__ ((packed));
++
++/*
++ * Generic queue structure
++ *
++ * Contains common data for Rx and Tx queues
++ */
++struct iwl_queue {
++	int n_bd;              /* number of BDs in this queue */
++	int first_empty;       /* 1-st empty entry (index) host_w*/
++	int last_used;         /* last used entry (index) host_r*/
++	dma_addr_t dma_addr;   /* physical addr for BD's */
++	int n_window;	       /* safe queue window */
++	u32 id;
++	int low_mark;	       /* low watermark, resume queue if free
++				* space more than this */
++	int high_mark;         /* high watermark, stop queue if free
++				* space less than this */
++} __attribute__ ((packed));
++
++#define MAX_NUM_OF_TBS          (20)
++
++struct iwl_tx_info {
++	struct ieee80211_tx_status status;
++	struct sk_buff *skb[MAX_NUM_OF_TBS];
++};
++
++/**
++ * struct iwl_tx_queue - Tx Queue for DMA
++ * @need_update: need to update read/write index
++ * @shed_retry: queue is HT AGG enabled
++ *
++ * Queue consists of circular buffer of BD's and required locking structures.
++ */
++struct iwl_tx_queue {
++	struct iwl_queue q;
++	struct iwl_tfd_frame *bd;
++	struct iwl_cmd *cmd;
++	dma_addr_t dma_addr_cmd;
++	struct iwl_tx_info *txb;
++	int need_update;
++	int sched_retry;
++	int active;
++};
++
++#include "iwl-channel.h"
++
++#if IWL == 3945
++#include "iwl-3945-rs.h"
++#else
++#include "iwl-4965-rs.h"
++#endif
++
++#define IWL_TX_FIFO_AC0	0
++#define IWL_TX_FIFO_AC1	1
++#define IWL_TX_FIFO_AC2	2
++#define IWL_TX_FIFO_AC3	3
++#define IWL_TX_FIFO_HCCA_1	5
++#define IWL_TX_FIFO_HCCA_2	6
++#define IWL_TX_FIFO_NONE	7
++
++/* Minimum number of queues. MAX_NUM is defined in hw specific files */
++#define IWL_MIN_NUM_QUEUES	4
++
++/* Power management (not Tx power) structures */
++
++struct iwl_power_vec_entry {
++	struct iwl_powertable_cmd cmd;
++	u8 no_dtim;
++};
++#define IWL_POWER_RANGE_0  (0)
++#define IWL_POWER_RANGE_1  (1)
++
++#define IWL_POWER_MODE_CAM	0x00	/* Continuously Aware Mode, always on */
++#define IWL_POWER_INDEX_3	0x03
++#define IWL_POWER_INDEX_5	0x05
++#define IWL_POWER_AC		0x06
++#define IWL_POWER_BATTERY	0x07
++#define IWL_POWER_LIMIT		0x07
++#define IWL_POWER_MASK		0x0F
++#define IWL_POWER_ENABLED	0x10
++#define IWL_POWER_LEVEL(x)	((x) & IWL_POWER_MASK)
++
++struct iwl_power_mgr {
++	spinlock_t lock;
++	struct iwl_power_vec_entry pwr_range_0[IWL_POWER_AC];
++	struct iwl_power_vec_entry pwr_range_1[IWL_POWER_AC];
++	u8 active_index;
++	u32 dtim_val;
++};
++
++#define IEEE80211_DATA_LEN              2304
++#define IEEE80211_4ADDR_LEN             30
++#define IEEE80211_HLEN                  (IEEE80211_4ADDR_LEN)
++#define IEEE80211_FRAME_LEN             (IEEE80211_DATA_LEN + IEEE80211_HLEN)
++
++struct iwl_frame {
++	union {
++		struct ieee80211_hdr frame;
++		struct iwl_tx_beacon_cmd beacon;
++		u8 raw[IEEE80211_FRAME_LEN];
++		u8 cmd[360];
++	} u;
++	struct list_head list;
++};
++
++#define SEQ_TO_QUEUE(x)  ((x >> 8) & 0xbf)
++#define QUEUE_TO_SEQ(x)  ((x & 0xbf) << 8)
++#define SEQ_TO_INDEX(x) (x & 0xff)
++#define INDEX_TO_SEQ(x) (x & 0xff)
++#define SEQ_HUGE_FRAME  (0x4000)
++#define SEQ_RX_FRAME    __constant_cpu_to_le16(0x8000)
++#define SEQ_TO_SN(seq) (((seq) & IEEE80211_SCTL_SEQ) >> 4)
++#define SN_TO_SEQ(ssn) (((ssn) << 4) & IEEE80211_SCTL_SEQ)
++#define MAX_SN ((IEEE80211_SCTL_SEQ) >> 4)
++
++enum {
++	/* CMD_SIZE_NORMAL = 0, */
++	CMD_SIZE_HUGE = (1 << 0),
++	/* CMD_SYNC = 0, */
++	CMD_ASYNC = (1 << 1),
++	/* CMD_NO_SKB = 0, */
++	CMD_WANT_SKB = (1 << 2),
++};
++
++struct iwl_cmd;
++struct iwl_priv;
++
++struct iwl_cmd_meta {
++	struct iwl_cmd_meta *source;
++	union {
++		struct sk_buff *skb;
++		int (*callback)(struct iwl_priv *priv,
++				struct iwl_cmd *cmd, struct sk_buff *skb);
++	} __attribute__ ((packed)) u;
++
++	/* The CMD_SIZE_HUGE flag bit indicates that the command
++	 * structure is stored at the end of the shared queue memory. */
++	u32 flags;
++
++} __attribute__ ((packed));
++
++struct iwl_cmd {
++	struct iwl_cmd_meta meta;
++	struct iwl_cmd_header hdr;
++	union {
++		struct iwl_addsta_cmd addsta;
++		struct iwl_led_cmd led;
++		u32 flags;
++		u8 val8;
++		u16 val16;
++		u32 val32;
++		struct iwl_bt_cmd bt;
++		struct iwl_rxon_time_cmd rxon_time;
++		struct iwl_powertable_cmd powertable;
++		struct iwl_qosparam_cmd qosparam;
++		struct iwl_tx_cmd tx;
++		struct iwl_tx_beacon_cmd tx_beacon;
++		struct iwl_rxon_assoc_cmd rxon_assoc;
++		u8 *indirect;
++		u8 payload[360];
++	} __attribute__ ((packed)) cmd;
++} __attribute__ ((packed));
++
++struct iwl_host_cmd {
++	u8 id;
++	u16 len;
++	struct iwl_cmd_meta meta;
++	const void *data;
++};
++
++#define TFD_MAX_PAYLOAD_SIZE (sizeof(struct iwl_cmd) - \
++			      sizeof(struct iwl_cmd_meta))
++
++/*
++ * RX related structures and functions
++ */
++#define RX_FREE_BUFFERS 64
++#define RX_LOW_WATERMARK 8
++
++#define SUP_RATE_11A_MAX_NUM_CHANNELS  8
++#define SUP_RATE_11B_MAX_NUM_CHANNELS  4
++#define SUP_RATE_11G_MAX_NUM_CHANNELS  12
++
++/**
++ * struct iwl_rx_queue - Rx queue
++ * @processed: Internal index to last handled Rx packet
++ * @read: Shared index to newest available Rx buffer
++ * @write: Shared index to oldest written Rx packet
++ * @free_count: Number of pre-allocated buffers in rx_free
++ * @rx_free: list of free SKBs for use
++ * @rx_used: List of Rx buffers with no SKB
++ * @need_update: flag to indicate we need to update read/write index
++ *
++ * NOTE:  rx_free and rx_used are used as a FIFO for iwl_rx_mem_buffers
++ */
++struct iwl_rx_queue {
++	__le32 *bd;
++	dma_addr_t dma_addr;
++	struct iwl_rx_mem_buffer pool[RX_QUEUE_SIZE + RX_FREE_BUFFERS];
++	struct iwl_rx_mem_buffer *queue[RX_QUEUE_SIZE];
++	u32 processed;
++	u32 read;
++	u32 write;
++	u32 free_count;
++	struct list_head rx_free;
++	struct list_head rx_used;
++	int need_update;
++	spinlock_t lock;
++};
++
++#define IWL_SUPPORTED_RATES_IE_LEN         8
++
++#define SCAN_INTERVAL 100
++
++#define MAX_A_CHANNELS  252
++#define MIN_A_CHANNELS  7
++
++#define MAX_B_CHANNELS  14
++#define MIN_B_CHANNELS  1
++
++#define STATUS_HCMD_ACTIVE	0	/* host command in progress */
++#define STATUS_INT_ENABLED	1
++#define STATUS_RF_KILL_HW	2
++#define STATUS_RF_KILL_SW	3
++#define STATUS_INIT		4
++#define STATUS_ALIVE		5
++#define STATUS_READY		6
++#define STATUS_TEMPERATURE	7
++#define STATUS_GEO_CONFIGURED	8
++#define STATUS_EXIT_PENDING	9
++#define STATUS_IN_SUSPEND	10
++#define STATUS_STATISTICS	11
++#define STATUS_SCANNING		12
++#define STATUS_SCAN_ABORTING	13
++#define STATUS_SCAN_HW		14
++#define STATUS_POWER_PMI	15
++#define STATUS_FW_ERROR		16
++
++#define MAX_TID_COUNT        9
++
++#define IWL_INVALID_RATE     0xFF
++#define IWL_INVALID_VALUE    -1
++
++#if IWL == 4965
++#ifdef CONFIG_IWLWIFI_HT
++#ifdef CONFIG_IWLWIFI_HT_AGG
++struct iwl_ht_agg {
++	u16 txq_id;
++	u16 frame_count;
++	u16 wait_for_ba;
++	u16 start_idx;
++	u32 bitmap0;
++	u32 bitmap1;
++	u32 rate_n_flags;
++};
++#endif /* CONFIG_IWLWIFI_HT_AGG */
++#endif /* CONFIG_IWLWIFI_HT */
++#endif
++
++struct iwl_tid_data {
++	u16 seq_number;
++#if IWL == 4965
++#ifdef CONFIG_IWLWIFI_HT
++#ifdef CONFIG_IWLWIFI_HT_AGG
++	struct iwl_ht_agg agg;
++#endif	/* CONFIG_IWLWIFI_HT_AGG */
++#endif /* CONFIG_IWLWIFI_HT */
++#endif
++};
++
++struct iwl_hw_key {
++	ieee80211_key_alg alg;
++	int keylen;
++	u8 key[32];
++};
++
++union iwl_ht_rate_supp {
++	u16 rates;
++	struct {
++		u8 siso_rate;
++		u8 mimo_rate;
++	};
++};
++
++#ifdef CONFIG_IWLWIFI_HT
++#define CFG_HT_RX_AMPDU_FACTOR_DEF  (0x3)
++#define HT_IE_MAX_AMSDU_SIZE_4K     (0)
++#define CFG_HT_MPDU_DENSITY_2USEC   (0x5)
++#define CFG_HT_MPDU_DENSITY_DEF CFG_HT_MPDU_DENSITY_2USEC
++
++struct sta_ht_info {
++	u8 is_ht;
++	u16 rx_mimo_ps_mode;
++	u16 tx_mimo_ps_mode;
++	u16 control_channel;
++	u8 max_amsdu_size;
++	u8 ampdu_factor;
++	u8 mpdu_density;
++	u8 operating_mode;
++	u8 supported_chan_width;
++	u8 extension_chan_offset;
++	u8 is_green_field;
++	u8 sgf;
++	u8 supp_rates[16];
++	u8 tx_chan_width;
++	u8 chan_width_cap;
++};
++#endif				/*CONFIG_IWLWIFI_HT */
++
++#ifdef CONFIG_IWLWIFI_QOS
++
++union iwl_qos_capabity {
++	struct {
++		u8 edca_count:4;	/* bit 0-3 */
++		u8 q_ack:1;		/* bit 4 */
++		u8 queue_request:1;	/* bit 5 */
++		u8 txop_request:1;	/* bit 6 */
++		u8 reserved:1;		/* bit 7 */
++	} q_AP;
++	struct {
++		u8 acvo_APSD:1;		/* bit 0 */
++		u8 acvi_APSD:1;		/* bit 1 */
++		u8 ac_bk_APSD:1;	/* bit 2 */
++		u8 ac_be_APSD:1;	/* bit 3 */
++		u8 q_ack:1;		/* bit 4 */
++		u8 max_len:2;		/* bit 5-6 */
++		u8 more_data_ack:1;	/* bit 7 */
++	} q_STA;
++	u8 val;
++};
++
++/* QoS sturctures */
++struct iwl_qos_info {
++	int qos_enable;
++	int qos_active;
++	union iwl_qos_capabity qos_cap;
++	struct iwl_qosparam_cmd def_qos_parm;
++};
++#endif /*CONFIG_IWLWIFI_QOS */
++
++#define STA_PS_STATUS_WAKE             0
++#define STA_PS_STATUS_SLEEP            1
++
++struct iwl_station_entry {
++	struct iwl_addsta_cmd sta;
++	struct iwl_tid_data tid[MAX_TID_COUNT];
++#if IWL == 3945
++	union {
++		struct {
++			u8 rate;
++			u8 flags;
++		} s;
++		u16 rate_n_flags;
++	} current_rate;
++#endif
++	u8 used;
++	u8 ps_status;
++	struct iwl_hw_key keyinfo;
++};
++
++/* one for each uCode image (inst/data, boot/init/runtime) */
++struct fw_image_desc {
++	void *v_addr;		/* access by driver */
++	dma_addr_t p_addr;	/* access by card's busmaster DMA */
++	u32 len;		/* bytes */
++};
++
++/* uCode file layout */
++struct iwl_ucode {
++	__le32 ver;		/* major/minor/subminor */
++	__le32 inst_size;	/* bytes of runtime instructions */
++	__le32 data_size;	/* bytes of runtime data */
++	__le32 init_size;	/* bytes of initialization instructions */
++	__le32 init_data_size;	/* bytes of initialization data */
++	__le32 boot_size;	/* bytes of bootstrap instructions */
++	u8 data[0];		/* data in same order as "size" elements */
++};
++
++#define IWL_IBSS_MAC_HASH_SIZE 32
++
++struct iwl_ibss_seq {
++	u8 mac[ETH_ALEN];
++	u16 seq_num;
++	u16 frag_num;
++	unsigned long packet_time;
++	struct list_head list;
++};
++
++struct iwl_driver_hw_info {
++	u16 max_txq_num;
++	u16 ac_queue_count;
++	u32 rx_buffer_size;
++	u16 tx_cmd_len;
++	u16 max_rxq_size;
++	u16 max_rxq_log;
++	u32 cck_flag;
++	u8  max_stations;
++	u8  bcast_sta_id;
++	void *shared_virt;
++	dma_addr_t shared_phys;
++};
++
++
++#define STA_FLG_RTS_MIMO_PROT_MSK	__constant_cpu_to_le32(1 << 17)
++#define STA_FLG_AGG_MPDU_8US_MSK	__constant_cpu_to_le32(1 << 18)
++#define STA_FLG_MAX_AGG_SIZE_POS	(19)
++#define STA_FLG_MAX_AGG_SIZE_MSK	__constant_cpu_to_le32(3 << 19)
++#define STA_FLG_FAT_EN_MSK		__constant_cpu_to_le32(1 << 21)
++#define STA_FLG_MIMO_DIS_MSK		__constant_cpu_to_le32(1 << 22)
++#define STA_FLG_AGG_MPDU_DENSITY_POS	(23)
++#define STA_FLG_AGG_MPDU_DENSITY_MSK	__constant_cpu_to_le32(7 << 23)
++#define HT_SHORT_GI_20MHZ_ONLY          (1 << 0)
++#define HT_SHORT_GI_40MHZ_ONLY          (1 << 1)
++
++
++#include "iwl-priv.h"
++
++/* Requires full declaration of iwl_priv before including */
++#include "iwl-io.h"
++
++#define IWL_RX_HDR(x) ((struct iwl_rx_frame_hdr *)(\
++		       x->u.rx_frame.stats.payload + \
++		       x->u.rx_frame.stats.phy_count))
++#define IWL_RX_END(x) ((struct iwl_rx_frame_end *)(\
++		       IWL_RX_HDR(x)->payload + \
++		       le16_to_cpu(IWL_RX_HDR(x)->len)))
++#define IWL_RX_STATS(x) (&x->u.rx_frame.stats)
++#define IWL_RX_DATA(x) (IWL_RX_HDR(x)->payload)
++
++
++/******************************************************************************
++ *
++ * Functions implemented in iwl-base.c which are forward declared here
++ * for use by iwl-*.c
++ *
++ *****************************************************************************/
++struct iwl_addsta_cmd;
++extern int iwl_send_add_station(struct iwl_priv *priv,
++				struct iwl_addsta_cmd *sta, u8 flags);
++extern const char *iwl_get_tx_fail_reason(u32 status);
++extern u8 iwl_add_station(struct iwl_priv *priv, const u8 *bssid,
++			  int is_ap, u8 flags);
++extern int iwl_is_network_packet(struct iwl_priv *priv,
++				 struct ieee80211_hdr *header);
++extern int iwl_power_init_handle(struct iwl_priv *priv);
++extern int iwl_eeprom_init(struct iwl_priv *priv);
++#ifdef CONFIG_IWLWIFI_DEBUG
++extern void iwl_report_frame(struct iwl_priv *priv,
++			     struct iwl_rx_packet *pkt,
++			     struct ieee80211_hdr *header, int group100);
++#else
++static inline void iwl_report_frame(struct iwl_priv *priv,
++				    struct iwl_rx_packet *pkt,
++				    struct ieee80211_hdr *header,
++				    int group100) {}
++#endif
++extern int iwl_tx_queue_update_write_ptr(struct iwl_priv *priv,
++					 struct iwl_tx_queue *txq);
++extern void iwl_handle_data_packet_monitor(struct iwl_priv *priv,
++					   struct iwl_rx_mem_buffer *rxb,
++					   void *data, short len,
++					   struct ieee80211_rx_status *stats,
++					   u16 phy_flags);
++extern int is_duplicate_packet(struct iwl_priv *priv, struct ieee80211_hdr
++			       *header);
++extern void iwl_rx_queue_free(struct iwl_priv *priv, struct iwl_rx_queue *rxq);
++extern int iwl_rx_queue_alloc(struct iwl_priv *priv);
++extern void iwl_rx_queue_reset(struct iwl_priv *priv,
++			       struct iwl_rx_queue *rxq);
++extern int iwl_calc_db_from_ratio(int sig_ratio);
++extern int iwl_calc_sig_qual(int rssi_dbm, int noise_dbm);
++extern int iwl_tx_queue_init(struct iwl_priv *priv,
++			     struct iwl_tx_queue *txq, int count, u32 id);
++extern int iwl_rx_queue_restock(struct iwl_priv *priv);
++extern void iwl_rx_replenish(void *data);
++extern void iwl_tx_queue_free(struct iwl_priv *priv, struct iwl_tx_queue *txq);
++extern int iwl_send_cmd_pdu(struct iwl_priv *priv, u8 id, u16 len,
++			    const void *data);
++extern int __must_check iwl_send_cmd_async(struct iwl_priv *priv,
++		struct iwl_host_cmd *cmd);
++extern int __must_check iwl_send_cmd_sync(struct iwl_priv *priv,
++		struct iwl_host_cmd *cmd);
++extern int __must_check iwl_send_cmd(struct iwl_priv *priv,
++		struct iwl_host_cmd *cmd);
++extern unsigned int iwl_fill_beacon_frame(struct iwl_priv *priv,
++					struct ieee80211_hdr *hdr,
++					const u8 *dest, int left);
++extern int iwl_rx_queue_update_write_ptr(struct iwl_priv *priv,
++					 struct iwl_rx_queue *q);
++extern int iwl_send_statistics_request(struct iwl_priv *priv);
++extern void iwl_set_decrypted_flag(struct iwl_priv *priv, struct sk_buff *skb,
++				   u32 decrypt_res,
++				   struct ieee80211_rx_status *stats);
++extern __le16 *ieee80211_get_qos_ctrl(struct ieee80211_hdr *hdr);
++
++extern const u8 BROADCAST_ADDR[ETH_ALEN];
++
++/*
++ * Currently used by iwl-3945-rs... look at restructuring so that it doesn't
++ * call this... todo... fix that.
++*/
++extern u8 iwl_sync_station(struct iwl_priv *priv, int sta_id,
++			   u16 tx_rate, u8 flags);
++
++static inline int iwl_is_associated(struct iwl_priv *priv)
++{
++	return (priv->active_rxon.filter_flags & RXON_FILTER_ASSOC_MSK) ? 1 : 0;
++}
++
++/******************************************************************************
++ *
++ * Functions implemented in iwl-[34]*.c which are forward declared here
++ * for use by iwl-base.c
++ *
++ * NOTE:  The implementation of these functions are hardware specific
++ * which is why they are in the hardware specific files (vs. iwl-base.c)
++ *
++ * Naming convention --
++ * iwl_         <-- Its part of iwlwifi (should be changed to iwl_)
++ * iwl_hw_      <-- Hardware specific (implemented in iwl-XXXX.c by all HW)
++ * iwlXXXX_     <-- Hardware specific (implemented in iwl-XXXX.c for XXXX)
++ * iwl_bg_      <-- Called from work queue context
++ * iwl_mac_     <-- mac80211 callback
++ *
++ ****************************************************************************/
++extern void iwl_hw_rx_handler_setup(struct iwl_priv *priv);
++extern void iwl_hw_setup_deferred_work(struct iwl_priv *priv);
++extern void iwl_hw_cancel_deferred_work(struct iwl_priv *priv);
++extern int iwl_hw_rxq_stop(struct iwl_priv *priv);
++extern int iwl_hw_set_hw_setting(struct iwl_priv *priv);
++extern int iwl_hw_nic_init(struct iwl_priv *priv);
++extern void iwl_hw_card_show_info(struct iwl_priv *priv);
++extern int iwl_hw_nic_stop_master(struct iwl_priv *priv);
++extern void iwl_hw_txq_ctx_free(struct iwl_priv *priv);
++extern void iwl_hw_txq_ctx_stop(struct iwl_priv *priv);
++extern int iwl_hw_nic_reset(struct iwl_priv *priv);
++extern int iwl_hw_txq_attach_buf_to_tfd(struct iwl_priv *priv, void *tfd,
++					dma_addr_t addr, u16 len);
++extern int iwl_hw_txq_free_tfd(struct iwl_priv *priv, struct iwl_tx_queue *txq);
++extern int iwl_hw_get_temperature(struct iwl_priv *priv);
++extern int iwl_hw_tx_queue_init(struct iwl_priv *priv,
++				struct iwl_tx_queue *txq);
++extern unsigned int iwl_hw_get_beacon_cmd(struct iwl_priv *priv,
++				 struct iwl_frame *frame, u8 rate);
++extern int iwl_hw_get_rx_read(struct iwl_priv *priv);
++extern void iwl_hw_build_tx_cmd_rate(struct iwl_priv *priv,
++				     struct iwl_cmd *cmd,
++				     struct ieee80211_tx_control *ctrl,
++				     struct ieee80211_hdr *hdr,
++				     int sta_id, int tx_id);
++extern int iwl_hw_reg_send_txpower(struct iwl_priv *priv);
++extern int iwl_hw_reg_set_txpower(struct iwl_priv *priv, s8 power);
++extern void iwl_hw_rx_statistics(struct iwl_priv *priv,
++				 struct iwl_rx_mem_buffer *rxb);
++extern void iwl_disable_events(struct iwl_priv *priv);
++extern int iwl4965_get_temperature(const struct iwl_priv *priv);
++
++/**
++ * iwl_hw_find_station - Find station id for a given BSSID
++ * @bssid: MAC address of station ID to find
++ *
++ * NOTE:  This should not be hardware specific but the code has
++ * not yet been merged into a single common layer for managing the
++ * station tables.
++ */
++extern u8 iwl_hw_find_station(struct iwl_priv *priv, const u8 *bssid);
++
++extern int iwl_hw_channel_switch(struct iwl_priv *priv, u16 channel);
++extern int iwl_tx_queue_reclaim(struct iwl_priv *priv, int txq_id, int index);
++#endif
+
+

Added: dists/sid/linux-2.6/debian/patches/features/all/vserver/vs2.2.0-rc5.patch
==============================================================================
--- (empty file)
+++ dists/sid/linux-2.6/debian/patches/features/all/vserver/vs2.2.0-rc5.patch	Mon Nov 26 20:06:56 2007
@@ -0,0 +1,27653 @@
+--- linux-2.6.22/Documentation/vserver/debug.txt	1970-01-01 01:00:00 +0100
++++ linux-2.6.22-vs2.2.0-rc5/Documentation/vserver/debug.txt	2007-06-15 02:37:02 +0200
+@@ -0,0 +1,154 @@
++
++debug_cvirt:
++
++ 2   4	"vx_map_tgid: %p/%llx: %d -> %d"
++	"vx_rmap_tgid: %p/%llx: %d -> %d"
++
++debug_dlim:
++
++ 0   1	"ALLOC (%p,#%d)%c inode (%d)"
++	"FREE  (%p,#%d)%c inode"
++ 1   2	"ALLOC (%p,#%d)%c %lld bytes (%d)"
++	"FREE  (%p,#%d)%c %lld bytes"
++ 2   4	"ADJUST: %lld,%lld on %ld,%ld [mult=%d]"
++ 3   8	"ext3_has_free_blocks(%p): %lu<%lu+1, %c, %u!=%u r=%d"
++	"ext3_has_free_blocks(%p): free=%lu, root=%lu"
++	"rcu_free_dl_info(%p)"
++ 4  10	"alloc_dl_info(%p,%d) = %p"
++	"dealloc_dl_info(%p)"
++	"get_dl_info(%p[#%d.%d])"
++	"put_dl_info(%p[#%d.%d])"
++ 5  20	"alloc_dl_info(%p,%d)*"
++ 6  40	"__hash_dl_info: %p[#%d]"
++	"__unhash_dl_info: %p[#%d]"
++ 7  80	"locate_dl_info(%p,#%d) = %p"
++
++debug_misc:
++
++ 0   1	"destroy_dqhash: %p [#0x%08x] c=%d"
++	"new_dqhash: %p [#0x%08x]"
++	"vroot[%d]_clr_dev: dev=%p[%lu,%d:%d]"
++	"vroot[%d]_get_real_bdev: dev=%p[%lu,%d:%d]"
++	"vroot[%d]_set_dev: dev=%p[%lu,%d:%d]"
++	"vroot_get_real_bdev not set"
++ 1   2	"cow_break_link(»%s«)"
++	"temp copy »%s«"
++ 2   4	"dentry_open(new): %p"
++	"dentry_open(old): %p"
++	"lookup_create(new): %p"
++	"old path »%s«"
++	"path_lookup(old): %d"
++	"vfs_create(new): %d"
++	"vfs_rename: %d"
++	"vfs_sendfile: %d"
++ 3   8	"fput(new_file=%p[#%d])"
++	"fput(old_file=%p[#%d])"
++ 4  10	"vx_info_kill(%p[#%d],%d,%d) = %d"
++	"vx_info_kill(%p[#%d],%d,%d)*"
++ 5  20	"vs_reboot(%p[#%d],%d)"
++ 6  40	"dropping task %p[#%u,%u] for %p[#%u,%u]"
++
++debug_net:
++
++ 2   4	"nx_addr_conflict(%p,%p) %d.%d,%d.%d"
++ 3   8	"inet_bind(%p) %d.%d.%d.%d, %d.%d.%d.%d, %d.%d.%d.%d"
++	"inet_bind(%p)* %p,%p;%lx %d.%d.%d.%d"
++ 4  10	"ip_route_connect(%p) %p,%p;%lx"
++ 5  20	"__addr_in_socket(%p,%d.%d.%d.%d) %p:%d.%d.%d.%d %p;%lx"
++ 6  40	"sk,egf: %p [#%d] (from %d)"
++	"sk,egn: %p [#%d] (from %d)"
++	"sk,req: %p [#%d] (from %d)"
++	"sk: %p [#%d] (from %d)"
++	"tw: %p [#%d] (from %d)"
++ 7  80	"__sock_recvmsg: %p[%p,%p,%p;%d]:%d/%d"
++	"__sock_sendmsg: %p[%p,%p,%p;%d]:%d/%d"
++
++debug_nid:
++
++ 0   1	"__lookup_nx_info(#%u): %p[#%u]"
++	"alloc_nx_info(%d) = %p"
++	"create_nx_info(%d) (dynamic rejected)"
++	"create_nx_info(%d) = %p (already there)"
++	"create_nx_info(%d) = %p (new)"
++	"dealloc_nx_info(%p)"
++ 1   2	"alloc_nx_info(%d)*"
++	"create_nx_info(%d)*"
++ 2   4	"get_nx_info(%p[#%d.%d])"
++	"put_nx_info(%p[#%d.%d])"
++ 3   8	"claim_nx_info(%p[#%d.%d.%d]) %p"
++	"clr_nx_info(%p[#%d.%d])"
++	"init_nx_info(%p[#%d.%d])"
++	"release_nx_info(%p[#%d.%d.%d]) %p"
++	"set_nx_info(%p[#%d.%d])"
++ 4  10	"__hash_nx_info: %p[#%d]"
++	"__nx_dynamic_id: [#%d]"
++	"__unhash_nx_info: %p[#%d.%d.%d]"
++ 5  20	"moved task %p into nxi:%p[#%d]"
++	"nx_migrate_task(%p,%p[#%d.%d.%d])"
++	"task_get_nx_info(%p)"
++ 6  40	"nx_clear_persistent(%p[#%d])"
++
++debug_quota:
++
++ 0   1	"quota_sync_dqh(%p,%d) discard inode %p"
++ 1   2	"quota_sync_dqh(%p,%d)"
++	"sync_dquots(%p,%d)"
++	"sync_dquots_dqh(%p,%d)"
++ 3   8	"do_quotactl(%p,%d,cmd=%d,id=%d,%p)"
++
++debug_switch:
++
++ 0   1	"vc: VCMD_%02d_%d[%d], %d,%p [%d,%d,%x,%x]"
++ 1   2	"vc: VCMD_%02d_%d[%d] = %08lx(%ld) [%d,%d]"
++ 4  10	"%s: (%s %s) returned %s with %d"
++
++debug_tag:
++
++ 7  80	"dx_parse_tag(»%s«): %d:#%d"
++	"dx_propagate_tag(%p[#%lu.%d]): %d,%d"
++
++debug_xid:
++
++ 0   1	"__lookup_vx_info(#%u): %p[#%u]"
++	"alloc_vx_info(%d) = %p"
++	"alloc_vx_info(%d)*"
++	"create_vx_info(%d) (dynamic rejected)"
++	"create_vx_info(%d) = %p (already there)"
++	"create_vx_info(%d) = %p (new)"
++	"dealloc_vx_info(%p)"
++	"loc_vx_info(%d) = %p (found)"
++	"loc_vx_info(%d) = %p (new)"
++	"loc_vx_info(%d) = %p (not available)"
++ 1   2	"create_vx_info(%d)*"
++	"loc_vx_info(%d)*"
++ 2   4	"get_vx_info(%p[#%d.%d])"
++	"put_vx_info(%p[#%d.%d])"
++ 3   8	"claim_vx_info(%p[#%d.%d.%d]) %p"
++	"clr_vx_info(%p[#%d.%d])"
++	"init_vx_info(%p[#%d.%d])"
++	"release_vx_info(%p[#%d.%d.%d]) %p"
++	"set_vx_info(%p[#%d.%d])"
++ 4  10	"__hash_vx_info: %p[#%d]"
++	"__unhash_vx_info: %p[#%d.%d.%d]"
++	"__vx_dynamic_id: [#%d]"
++ 5  20	"enter_vx_info(%p[#%d],%p) %p[#%d,%p]"
++	"leave_vx_info(%p[#%d,%p]) %p[#%d,%p]"
++	"moved task %p into vxi:%p[#%d]"
++	"task_get_vx_info(%p)"
++	"vx_migrate_task(%p,%p[#%d.%d])"
++ 6  40	"vx_clear_persistent(%p[#%d])"
++	"vx_exit_init(%p[#%d],%p[#%d,%d,%d])"
++	"vx_set_init(%p[#%d],%p[#%d,%d,%d])"
++	"vx_set_persistent(%p[#%d])"
++	"vx_set_reaper(%p[#%d],%p[#%d,%d])"
++ 7  80	"vx_child_reaper(%p[#%u,%u]) = %p[#%u,%u]"
++
++
++debug_limit:
++
++ n 2^n	"vx_acc_cres[%5d,%s,%2d]: %5d%s"
++	"vx_cres_avail[%5d,%s,%2d]: %5ld > %5d + %5d"
++
++ m 2^m	"vx_acc_page[%5d,%s,%2d]: %5d%s"
++	"vx_acc_pages[%5d,%s,%2d]: %5d += %5d"
++	"vx_pages_avail[%5d,%s,%2d]: %5ld > %5d + %5d"
+--- linux-2.6.22/arch/alpha/Kconfig	2007-07-09 13:17:31 +0200
++++ linux-2.6.22-vs2.2.0-rc5/arch/alpha/Kconfig	2007-06-15 02:37:02 +0200
+@@ -662,6 +662,8 @@ config DUMMY_CONSOLE
+ 	depends on VGA_HOSE
+ 	default y
+ 
++source "kernel/vserver/Kconfig"
++
+ source "security/Kconfig"
+ 
+ source "crypto/Kconfig"
+--- linux-2.6.22/arch/alpha/kernel/asm-offsets.c	2006-02-15 13:54:10 +0100
++++ linux-2.6.22-vs2.2.0-rc5/arch/alpha/kernel/asm-offsets.c	2007-06-15 02:37:02 +0200
+@@ -36,6 +36,7 @@ void foo(void)
+ 	DEFINE(PT_PTRACED, PT_PTRACED);
+ 	DEFINE(CLONE_VM, CLONE_VM);
+ 	DEFINE(CLONE_UNTRACED, CLONE_UNTRACED);
++	DEFINE(CLONE_KTHREAD, CLONE_KTHREAD);
+ 	DEFINE(SIGCHLD, SIGCHLD);
+ 	BLANK();
+ 
+--- linux-2.6.22/arch/alpha/kernel/entry.S	2007-07-09 13:17:31 +0200
++++ linux-2.6.22-vs2.2.0-rc5/arch/alpha/kernel/entry.S	2007-06-15 02:37:02 +0200
+@@ -643,7 +643,7 @@ kernel_thread:
+ 	stq	$2, 152($sp)		/* HAE */
+ 
+ 	/* Shuffle FLAGS to the front; add CLONE_VM.  */
+-	ldi	$1, CLONE_VM|CLONE_UNTRACED
++	ldi	$1, CLONE_VM | CLONE_UNTRACED | CLONE_KTHREAD;
+ 	or	$18, $1, $16
+ 	bsr	$26, sys_clone
+ 
+@@ -872,24 +872,15 @@ sys_getxgid:
+ 	.globl	sys_getxpid
+ 	.ent	sys_getxpid
+ sys_getxpid:
++	lda	$sp, -16($sp)
++	stq	$26, 0($sp)
+ 	.prologue 0
+-	ldq	$2, TI_TASK($8)
+ 
+-	/* See linux/kernel/timer.c sys_getppid for discussion
+-	   about this loop.  */
+-	ldq	$3, TASK_GROUP_LEADER($2)
+-	ldq	$4, TASK_REAL_PARENT($3)
+-	ldl	$0, TASK_TGID($2)
+-1:	ldl	$1, TASK_TGID($4)
+-#ifdef CONFIG_SMP
+-	mov	$4, $5
+-	mb
+-	ldq	$3, TASK_GROUP_LEADER($2)
+-	ldq	$4, TASK_REAL_PARENT($3)
+-	cmpeq	$4, $5, $5
+-	beq	$5, 1b
+-#endif
+-	stq	$1, 80($sp)
++	lda	$16, 96($sp)
++	jsr	$26, do_getxpid
++	ldq	$26, 0($sp)
++
++	lda	$sp, 16($sp)
+ 	ret
+ .end sys_getxpid
+ 
+--- linux-2.6.22/arch/alpha/kernel/osf_sys.c	2007-07-09 13:17:31 +0200
++++ linux-2.6.22-vs2.2.0-rc5/arch/alpha/kernel/osf_sys.c	2007-06-15 02:37:02 +0200
+@@ -883,7 +883,7 @@ osf_gettimeofday(struct timeval32 __user
+ {
+ 	if (tv) {
+ 		struct timeval ktv;
+-		do_gettimeofday(&ktv);
++		vx_gettimeofday(&ktv);
+ 		if (put_tv32(tv, &ktv))
+ 			return -EFAULT;
+ 	}
+--- linux-2.6.22/arch/alpha/kernel/ptrace.c	2006-04-09 13:49:39 +0200
++++ linux-2.6.22-vs2.2.0-rc5/arch/alpha/kernel/ptrace.c	2007-06-15 02:37:02 +0200
+@@ -15,6 +15,7 @@
+ #include <linux/slab.h>
+ #include <linux/security.h>
+ #include <linux/signal.h>
++#include <linux/vs_base.h>
+ 
+ #include <asm/uaccess.h>
+ #include <asm/pgtable.h>
+@@ -283,6 +284,11 @@ do_sys_ptrace(long request, long pid, lo
+ 		goto out_notsk;
+ 	}
+ 
++	if (!vx_check(vx_task_xid(child), VS_WATCH_P | VS_IDENT)) {
++		ret = -EPERM;
++		goto out;
++	}
++
+ 	if (request == PTRACE_ATTACH) {
+ 		ret = ptrace_attach(child);
+ 		goto out;
+--- linux-2.6.22/arch/alpha/kernel/semaphore.c	2004-08-14 12:55:32 +0200
++++ linux-2.6.22-vs2.2.0-rc5/arch/alpha/kernel/semaphore.c	2007-06-15 02:37:02 +0200
+@@ -68,8 +68,8 @@ __down_failed(struct semaphore *sem)
+ 	DECLARE_WAITQUEUE(wait, tsk);
+ 
+ #ifdef CONFIG_DEBUG_SEMAPHORE
+-	printk("%s(%d): down failed(%p)\n",
+-	       tsk->comm, tsk->pid, sem);
++	printk("%s(%d:#%u): down failed(%p)\n",
++	       tsk->comm, tsk->pid, tsk->xid, sem);
+ #endif
+ 
+ 	tsk->state = TASK_UNINTERRUPTIBLE;
+@@ -97,8 +97,8 @@ __down_failed(struct semaphore *sem)
+ 	wake_up(&sem->wait);
+ 
+ #ifdef CONFIG_DEBUG_SEMAPHORE
+-	printk("%s(%d): down acquired(%p)\n",
+-	       tsk->comm, tsk->pid, sem);
++	printk("%s(%d:#%u): down acquired(%p)\n",
++	       tsk->comm, tsk->pid, tsk->xid, sem);
+ #endif
+ }
+ 
+@@ -110,8 +110,8 @@ __down_failed_interruptible(struct semap
+ 	long ret = 0;
+ 
+ #ifdef CONFIG_DEBUG_SEMAPHORE
+-	printk("%s(%d): down failed(%p)\n",
+-	       tsk->comm, tsk->pid, sem);
++	printk("%s(%d:#%u): down failed(%p)\n",
++	       tsk->comm, tsk->pid, tsk->xid, sem);
+ #endif
+ 
+ 	tsk->state = TASK_INTERRUPTIBLE;
+--- linux-2.6.22/arch/alpha/kernel/systbls.S	2007-07-09 13:17:31 +0200
++++ linux-2.6.22-vs2.2.0-rc5/arch/alpha/kernel/systbls.S	2007-06-15 02:37:02 +0200
+@@ -446,7 +446,7 @@ sys_call_table:
+ 	.quad sys_stat64			/* 425 */
+ 	.quad sys_lstat64
+ 	.quad sys_fstat64
+-	.quad sys_ni_syscall			/* sys_vserver */
++	.quad sys_vserver			/* sys_vserver */
+ 	.quad sys_ni_syscall			/* sys_mbind */
+ 	.quad sys_ni_syscall			/* sys_get_mempolicy */
+ 	.quad sys_ni_syscall			/* sys_set_mempolicy */
+--- linux-2.6.22/arch/alpha/kernel/traps.c	2006-09-20 16:57:57 +0200
++++ linux-2.6.22-vs2.2.0-rc5/arch/alpha/kernel/traps.c	2007-06-15 02:37:02 +0200
+@@ -182,7 +182,8 @@ die_if_kernel(char * str, struct pt_regs
+ #ifdef CONFIG_SMP
+ 	printk("CPU %d ", hard_smp_processor_id());
+ #endif
+-	printk("%s(%d): %s %ld\n", current->comm, current->pid, str, err);
++	printk("%s(%d[#%u]): %s %ld\n", current->comm,
++		current->pid, current->xid, str, err);
+ 	dik_show_regs(regs, r9_15);
+ 	dik_show_trace((unsigned long *)(regs+1));
+ 	dik_show_code((unsigned int *)regs->pc);
+--- linux-2.6.22/arch/alpha/mm/fault.c	2007-07-09 13:17:32 +0200
++++ linux-2.6.22-vs2.2.0-rc5/arch/alpha/mm/fault.c	2007-06-15 02:37:02 +0200
+@@ -197,8 +197,8 @@ do_page_fault(unsigned long address, uns
+ 		down_read(&mm->mmap_sem);
+ 		goto survive;
+ 	}
+-	printk(KERN_ALERT "VM: killing process %s(%d)\n",
+-	       current->comm, current->pid);
++	printk(KERN_ALERT "VM: killing process %s(%d:#%u)\n",
++	       current->comm, current->pid, current->xid);
+ 	if (!user_mode(regs))
+ 		goto no_context;
+ 	do_exit(SIGKILL);
+--- linux-2.6.22/arch/arm/Kconfig	2007-07-09 13:17:32 +0200
++++ linux-2.6.22-vs2.2.0-rc5/arch/arm/Kconfig	2007-06-15 02:37:02 +0200
+@@ -1042,6 +1042,8 @@ source "arch/arm/oprofile/Kconfig"
+ 
+ source "arch/arm/Kconfig.debug"
+ 
++source "kernel/vserver/Kconfig"
++
+ source "security/Kconfig"
+ 
+ source "crypto/Kconfig"
+--- linux-2.6.22/arch/arm/kernel/calls.S	2007-07-09 13:17:32 +0200
++++ linux-2.6.22-vs2.2.0-rc5/arch/arm/kernel/calls.S	2007-07-07 03:52:53 +0200
+@@ -322,7 +322,7 @@
+ /* 310 */	CALL(sys_request_key)
+ 		CALL(sys_keyctl)
+ 		CALL(ABI(sys_semtimedop, sys_oabi_semtimedop))
+-/* vserver */	CALL(sys_ni_syscall)
++		CALL(sys_vserver)
+ 		CALL(sys_ioprio_set)
+ /* 315 */	CALL(sys_ioprio_get)
+ 		CALL(sys_inotify_init)
+--- linux-2.6.22/arch/arm/kernel/process.c	2007-07-09 13:17:32 +0200
++++ linux-2.6.22-vs2.2.0-rc5/arch/arm/kernel/process.c	2007-07-07 03:52:53 +0200
+@@ -261,7 +261,8 @@ void __show_regs(struct pt_regs *regs)
+ void show_regs(struct pt_regs * regs)
+ {
+ 	printk("\n");
+-	printk("Pid: %d, comm: %20s\n", current->pid, current->comm);
++	printk("Pid: %d[#%u], comm: %20s\n",
++		current->pid, current->xid, current->comm);
+ 	__show_regs(regs);
+ 	__backtrace();
+ }
+@@ -423,7 +424,8 @@ pid_t kernel_thread(int (*fn)(void *), v
+ 	regs.ARM_pc = (unsigned long)kernel_thread_helper;
+ 	regs.ARM_cpsr = SVC_MODE;
+ 
+-	return do_fork(flags|CLONE_VM|CLONE_UNTRACED, 0, &regs, 0, NULL, NULL);
++	return do_fork(flags | CLONE_VM | CLONE_UNTRACED | CLONE_KTHREAD,
++		0, &regs, 0, NULL, NULL);
+ }
+ EXPORT_SYMBOL(kernel_thread);
+ 
+--- linux-2.6.22/arch/arm/kernel/traps.c	2007-07-09 13:17:32 +0200
++++ linux-2.6.22-vs2.2.0-rc5/arch/arm/kernel/traps.c	2007-07-09 13:11:53 +0200
+@@ -222,8 +222,8 @@ static void __die(const char *str, int e
+ 	       str, err, ++die_counter);
+ 	print_modules();
+ 	__show_regs(regs);
+-	printk("Process %s (pid: %d, stack limit = 0x%p)\n",
+-		tsk->comm, tsk->pid, thread + 1);
++	printk("Process %s (pid: %d:#%u, stack limit = 0x%p)\n",
++		tsk->comm, tsk->pid, tsk->xid, thread + 1);
+ 
+ 	if (!user_mode(regs) || in_interrupt()) {
+ 		dump_mem("Stack: ", regs->ARM_sp,
+--- linux-2.6.22/arch/arm/mm/fault.c	2007-07-09 13:17:39 +0200
++++ linux-2.6.22-vs2.2.0-rc5/arch/arm/mm/fault.c	2007-06-15 02:37:02 +0200
+@@ -266,7 +266,8 @@ do_page_fault(unsigned long addr, unsign
+ 		 * happened to us that made us unable to handle
+ 		 * the page fault gracefully.
+ 		 */
+-		printk("VM: killing process %s\n", tsk->comm);
++		printk("VM: killing process %s(%d:#%u)\n",
++			tsk->comm, tsk->pid, tsk->xid);
+ 		do_exit(SIGKILL);
+ 		return 0;
+ 
+--- linux-2.6.22/arch/arm26/Kconfig	2007-07-09 13:17:40 +0200
++++ linux-2.6.22-vs2.2.0-rc5/arch/arm26/Kconfig	2007-06-15 02:37:02 +0200
+@@ -243,6 +243,8 @@ source "drivers/usb/Kconfig"
+ 
+ source "arch/arm26/Kconfig.debug"
+ 
++source "kernel/vserver/Kconfig"
++
+ source "security/Kconfig"
+ 
+ source "crypto/Kconfig"
+--- linux-2.6.22/arch/arm26/kernel/calls.S	2005-03-02 12:38:19 +0100
++++ linux-2.6.22-vs2.2.0-rc5/arch/arm26/kernel/calls.S	2007-06-15 02:37:02 +0200
+@@ -257,6 +257,11 @@ __syscall_start:
+ 		.long	sys_lremovexattr
+ 		.long	sys_fremovexattr
+ 		.long	sys_tkill
++
++		.rept	313 - (. - __syscall_start) / 4
++			.long	sys_ni_syscall
++		.endr
++		.long	sys_vserver	/* 313 */
+ __syscall_end:
+ 
+ 		.rept	NR_syscalls - (__syscall_end - __syscall_start) / 4
+--- linux-2.6.22/arch/arm26/kernel/process.c	2006-09-20 16:57:57 +0200
++++ linux-2.6.22-vs2.2.0-rc5/arch/arm26/kernel/process.c	2007-06-15 02:37:02 +0200
+@@ -365,7 +365,8 @@ pid_t kernel_thread(int (*fn)(void *), v
+         regs.ARM_r3 = (unsigned long)do_exit;
+         regs.ARM_pc = (unsigned long)kernel_thread_helper | MODE_SVC26;
+ 
+-        return do_fork(flags|CLONE_VM|CLONE_UNTRACED, 0, &regs, 0, NULL, NULL);
++	return do_fork(flags | CLONE_VM | CLONE_UNTRACED | CLONE_KTHREAD,
++		0, &regs, 0, NULL, NULL);
+ }
+ EXPORT_SYMBOL(kernel_thread);
+ 
+--- linux-2.6.22/arch/arm26/kernel/traps.c	2006-09-20 16:57:57 +0200
++++ linux-2.6.22-vs2.2.0-rc5/arch/arm26/kernel/traps.c	2007-06-15 02:37:02 +0200
+@@ -185,8 +185,9 @@ NORET_TYPE void die(const char *str, str
+ 	printk("Internal error: %s: %x\n", str, err);
+ 	printk("CPU: %d\n", smp_processor_id());
+ 	show_regs(regs);
+-	printk("Process %s (pid: %d, stack limit = 0x%p)\n",
+-		current->comm, current->pid, end_of_stack(tsk));
++	printk("Process %s (pid: %d[#%u], stack limit = 0x%p)\n",
++		current->comm, current->pid,
++		current->xid, end_of_stack(tsk));
+ 
+ 	if (!user_mode(regs) || in_interrupt()) {
+ 		__dump_stack(tsk, (unsigned long)(regs + 1));
+--- linux-2.6.22/arch/cris/Kconfig	2007-05-02 19:24:19 +0200
++++ linux-2.6.22-vs2.2.0-rc5/arch/cris/Kconfig	2007-06-15 02:37:02 +0200
+@@ -200,6 +200,8 @@ source "drivers/usb/Kconfig"
+ 
+ source "arch/cris/Kconfig.debug"
+ 
++source "kernel/vserver/Kconfig"
++
+ source "security/Kconfig"
+ 
+ source "crypto/Kconfig"
+--- linux-2.6.22/arch/cris/arch-v10/kernel/process.c	2006-09-20 16:57:57 +0200
++++ linux-2.6.22-vs2.2.0-rc5/arch/cris/arch-v10/kernel/process.c	2007-06-15 02:37:02 +0200
+@@ -103,7 +103,8 @@ int kernel_thread(int (*fn)(void *), voi
+ 	regs.dccr = 1 << I_DCCR_BITNR;
+ 
+ 	/* Ok, create the new process.. */
+-        return do_fork(flags | CLONE_VM | CLONE_UNTRACED, 0, &regs, 0, NULL, NULL);
++	return do_fork(flags | CLONE_VM | CLONE_UNTRACED | CLONE_KTHREAD,
++		0, &regs, 0, NULL, NULL);
+ }
+ 
+ /* setup the child's kernel stack with a pt_regs and switch_stack on it.
+--- linux-2.6.22/arch/cris/arch-v32/kernel/process.c	2006-09-20 16:57:57 +0200
++++ linux-2.6.22-vs2.2.0-rc5/arch/cris/arch-v32/kernel/process.c	2007-06-15 02:37:02 +0200
+@@ -120,7 +120,8 @@ kernel_thread(int (*fn)(void *), void * 
+ 	regs.ccs = 1 << (I_CCS_BITNR + CCS_SHIFT);
+ 
+ 	/* Create the new process. */
+-        return do_fork(flags | CLONE_VM | CLONE_UNTRACED, 0, &regs, 0, NULL, NULL);
++	return do_fork(flags | CLONE_VM | CLONE_UNTRACED | CLONE_KTHREAD,
++		0, &regs, 0, NULL, NULL);
+ }
+ 
+ /*
+--- linux-2.6.22/arch/frv/kernel/kernel_thread.S	2005-03-02 12:38:20 +0100
++++ linux-2.6.22-vs2.2.0-rc5/arch/frv/kernel/kernel_thread.S	2007-06-15 02:37:02 +0200
+@@ -13,6 +13,8 @@
+ #include <asm/unistd.h>
+ 
+ #define CLONE_VM	0x00000100	/* set if VM shared between processes */
++#define CLONE_KTHREAD	0x10000000	/* kernel thread */
++#define CLONE_KT	(CLONE_VM | CLONE_KTHREAD)	/* kernel thread flags */
+ #define	KERN_ERR	"<3>"
+ 
+ 	.section .rodata
+@@ -37,7 +39,7 @@ kernel_thread:
+ 
+ 	# start by forking the current process, but with shared VM
+ 	setlos.p	#__NR_clone,gr7		; syscall number
+-	ori		gr10,#CLONE_VM,gr8	; first syscall arg	[clone_flags]
++	ori		gr10,#CLONE_KT,gr8	; first syscall arg	[clone_flags]
+ 	sethi.p		#0xe4e4,gr9		; second syscall arg	[newsp]
+ 	setlo		#0xe4e4,gr9
+ 	setlos.p	#0,gr10			; third syscall arg	[parent_tidptr]
+--- linux-2.6.22/arch/h8300/Kconfig	2007-07-09 13:17:41 +0200
++++ linux-2.6.22-vs2.2.0-rc5/arch/h8300/Kconfig	2007-06-15 02:37:02 +0200
+@@ -222,6 +222,8 @@ source "fs/Kconfig"
+ 
+ source "arch/h8300/Kconfig.debug"
+ 
++source "kernel/vserver/Kconfig"
++
+ source "security/Kconfig"
+ 
+ source "crypto/Kconfig"
+--- linux-2.6.22/arch/h8300/kernel/process.c	2006-09-20 16:57:58 +0200
++++ linux-2.6.22-vs2.2.0-rc5/arch/h8300/kernel/process.c	2007-06-15 02:37:03 +0200
+@@ -134,7 +134,7 @@ int kernel_thread(int (*fn)(void *), voi
+ 
+ 	fs = get_fs();
+ 	set_fs (KERNEL_DS);
+-	clone_arg = flags | CLONE_VM;
++	clone_arg = flags | CLONE_VM | CLONE_KTHREAD;
+ 	__asm__("mov.l sp,er3\n\t"
+ 		"sub.l er2,er2\n\t"
+ 		"mov.l %2,er1\n\t"
+--- linux-2.6.22/arch/i386/Kconfig	2007-07-09 13:17:41 +0200
++++ linux-2.6.22-vs2.2.0-rc5/arch/i386/Kconfig	2007-07-09 13:11:53 +0200
+@@ -1230,6 +1230,8 @@ endmenu
+ 
+ source "arch/i386/Kconfig.debug"
+ 
++source "kernel/vserver/Kconfig"
++
+ source "security/Kconfig"
+ 
+ source "crypto/Kconfig"
+--- linux-2.6.22/arch/i386/kernel/process.c	2007-07-09 13:17:42 +0200
++++ linux-2.6.22-vs2.2.0-rc5/arch/i386/kernel/process.c	2007-06-15 02:37:03 +0200
+@@ -302,8 +302,10 @@ void show_regs(struct pt_regs * regs)
+ 	unsigned long cr0 = 0L, cr2 = 0L, cr3 = 0L, cr4 = 0L;
+ 
+ 	printk("\n");
+-	printk("Pid: %d, comm: %20s\n", current->pid, current->comm);
+-	printk("EIP: %04x:[<%08lx>] CPU: %d\n",0xffff & regs->xcs,regs->eip, smp_processor_id());
++	printk("Pid: %d[#%u], comm: %20s\n",
++		current->pid, current->xid, current->comm);
++	printk("EIP: %04x:[<%08lx>] CPU: %d\n",
++		0xffff & regs->xcs,regs->eip, smp_processor_id());
+ 	print_symbol("EIP is at %s\n", regs->eip);
+ 
+ 	if (user_mode_vm(regs))
+@@ -355,7 +357,8 @@ int kernel_thread(int (*fn)(void *), voi
+ 	regs.eflags = X86_EFLAGS_IF | X86_EFLAGS_SF | X86_EFLAGS_PF | 0x2;
+ 
+ 	/* Ok, create the new process.. */
+-	return do_fork(flags | CLONE_VM | CLONE_UNTRACED, 0, &regs, 0, NULL, NULL);
++	return do_fork(flags | CLONE_VM | CLONE_UNTRACED | CLONE_KTHREAD,
++		0, &regs, 0, NULL, NULL);
+ }
+ EXPORT_SYMBOL(kernel_thread);
+ 
+--- linux-2.6.22/arch/i386/kernel/syscall_table.S	2007-07-09 13:17:42 +0200
++++ linux-2.6.22-vs2.2.0-rc5/arch/i386/kernel/syscall_table.S	2007-06-15 02:37:03 +0200
+@@ -272,7 +272,7 @@ ENTRY(sys_call_table)
+ 	.long sys_tgkill	/* 270 */
+ 	.long sys_utimes
+  	.long sys_fadvise64_64
+-	.long sys_ni_syscall	/* sys_vserver */
++	.long sys_vserver
+ 	.long sys_mbind
+ 	.long sys_get_mempolicy
+ 	.long sys_set_mempolicy
+--- linux-2.6.22/arch/i386/kernel/sysenter.c	2007-07-09 13:17:42 +0200
++++ linux-2.6.22-vs2.2.0-rc5/arch/i386/kernel/sysenter.c	2007-06-15 02:37:03 +0200
+@@ -17,6 +17,7 @@
+ #include <linux/elf.h>
+ #include <linux/mm.h>
+ #include <linux/module.h>
++#include <linux/vs_memory.h>
+ 
+ #include <asm/cpufeature.h>
+ #include <asm/msr.h>
+--- linux-2.6.22/arch/i386/kernel/traps.c	2007-07-09 13:17:42 +0200
++++ linux-2.6.22-vs2.2.0-rc5/arch/i386/kernel/traps.c	2007-06-15 02:38:37 +0200
+@@ -56,6 +56,8 @@
+ #include <asm/stacktrace.h>
+ 
+ #include <linux/module.h>
++#include <linux/vs_context.h>
++#include <linux/vserver/history.h>
+ 
+ #include "mach_traps.h"
+ 
+@@ -303,8 +305,8 @@ void show_registers(struct pt_regs *regs
+ 		regs->esi, regs->edi, regs->ebp, esp);
+ 	printk(KERN_EMERG "ds: %04x   es: %04x   fs: %04x  gs: %04x  ss: %04x\n",
+ 	       regs->xds & 0xffff, regs->xes & 0xffff, regs->xfs & 0xffff, gs, ss);
+-	printk(KERN_EMERG "Process %.*s (pid: %d, ti=%p task=%p task.ti=%p)",
+-		TASK_COMM_LEN, current->comm, current->pid,
++	printk(KERN_EMERG "Process %.*s (pid: %d[#%u], ti=%p task=%p task.ti=%p)",
++		TASK_COMM_LEN, current->comm, current->pid, current->xid,
+ 		current_thread_info(), current, task_thread_info(current));
+ 	/*
+ 	 * When in-kernel, we also print out the stack and code at the
+@@ -375,6 +377,8 @@ void die(const char * str, struct pt_reg
+ 
+ 	oops_enter();
+ 
++	vxh_throw_oops();
++
+ 	if (die.lock_owner != raw_smp_processor_id()) {
+ 		console_verbose();
+ 		spin_lock_irqsave(&die.lock, flags);
+@@ -412,9 +416,9 @@ void die(const char * str, struct pt_reg
+ 		if (nl)
+ 			printk("\n");
+ 		if (notify_die(DIE_OOPS, str, regs, err,
+-					current->thread.trap_no, SIGSEGV) !=
+-				NOTIFY_STOP) {
++			current->thread.trap_no, SIGSEGV) != NOTIFY_STOP) {
+ 			show_registers(regs);
++			vxh_dump_history();
+ 			/* Executive summary in case the oops scrolled away */
+ 			esp = (unsigned long) (&regs->esp);
+ 			savesegment(ss, ss);
+--- linux-2.6.22/arch/i386/mm/fault.c	2007-07-09 13:17:43 +0200
++++ linux-2.6.22-vs2.2.0-rc5/arch/i386/mm/fault.c	2007-06-17 05:54:16 +0200
+@@ -586,7 +586,8 @@ out_of_memory:
+ 		down_read(&mm->mmap_sem);
+ 		goto survive;
+ 	}
+-	printk("VM: killing process %s\n", tsk->comm);
++	printk("VM: killing process %s(%d:#%u)\n",
++		tsk->comm, tsk->pid, tsk->xid);
+ 	if (error_code & 4)
+ 		do_exit(SIGKILL);
+ 	goto no_context;
+--- linux-2.6.22/arch/ia64/Kconfig	2007-07-09 13:17:43 +0200
++++ linux-2.6.22-vs2.2.0-rc5/arch/ia64/Kconfig	2007-06-15 02:37:03 +0200
+@@ -592,6 +592,8 @@ endmenu
+ 
+ source "arch/ia64/Kconfig.debug"
+ 
++source "kernel/vserver/Kconfig"
++
+ source "security/Kconfig"
+ 
+ source "crypto/Kconfig"
+--- linux-2.6.22/arch/ia64/ia32/binfmt_elf32.c	2007-05-02 19:24:20 +0200
++++ linux-2.6.22-vs2.2.0-rc5/arch/ia64/ia32/binfmt_elf32.c	2007-06-15 02:37:03 +0200
+@@ -233,7 +233,8 @@ ia32_setup_arg_pages (struct linux_binpr
+ 			kmem_cache_free(vm_area_cachep, mpnt);
+ 			return ret;
+ 		}
+-		current->mm->stack_vm = current->mm->total_vm = vma_pages(mpnt);
++		vx_vmpages_sub(current->mm, current->mm->total_vm - vma_pages(mpnt));
++		current->mm->stack_vm = current->mm->total_vm;
+ 	}
+ 
+ 	for (i = 0 ; i < MAX_ARG_PAGES ; i++) {
+--- linux-2.6.22/arch/ia64/ia32/ia32_entry.S	2007-07-09 13:17:43 +0200
++++ linux-2.6.22-vs2.2.0-rc5/arch/ia64/ia32/ia32_entry.S	2007-06-15 02:37:03 +0200
+@@ -446,7 +446,7 @@ ia32_syscall_table:
+  	data8 sys_tgkill	/* 270 */
+  	data8 compat_sys_utimes
+  	data8 sys32_fadvise64_64
+- 	data8 sys_ni_syscall
++	data8 sys32_vserver
+   	data8 sys_ni_syscall
+  	data8 sys_ni_syscall	/* 275 */
+   	data8 sys_ni_syscall
+--- linux-2.6.22/arch/ia64/ia32/sys_ia32.c	2007-05-02 19:24:20 +0200
++++ linux-2.6.22-vs2.2.0-rc5/arch/ia64/ia32/sys_ia32.c	2007-06-15 02:37:03 +0200
+@@ -1182,7 +1182,7 @@ sys32_gettimeofday (struct compat_timeva
+ {
+ 	if (tv) {
+ 		struct timeval ktv;
+-		do_gettimeofday(&ktv);
++		vx_gettimeofday(&ktv);
+ 		if (put_tv32(tv, &ktv))
+ 			return -EFAULT;
+ 	}
+--- linux-2.6.22/arch/ia64/kernel/asm-offsets.c	2007-05-02 19:24:20 +0200
++++ linux-2.6.22-vs2.2.0-rc5/arch/ia64/kernel/asm-offsets.c	2007-06-15 02:37:03 +0200
+@@ -192,6 +192,7 @@ void foo(void)
+     /* for assembly files which can't include sched.h: */
+ 	DEFINE(IA64_CLONE_VFORK, CLONE_VFORK);
+ 	DEFINE(IA64_CLONE_VM, CLONE_VM);
++	DEFINE(IA64_CLONE_KTHREAD, CLONE_KTHREAD);
+ 
+ 	BLANK();
+ 	DEFINE(IA64_CPUINFO_NSEC_PER_CYC_OFFSET,
+--- linux-2.6.22/arch/ia64/kernel/entry.S	2007-07-09 13:17:43 +0200
++++ linux-2.6.22-vs2.2.0-rc5/arch/ia64/kernel/entry.S	2007-06-15 02:37:03 +0200
+@@ -1547,7 +1547,7 @@ sys_call_table:
+ 	data8 sys_mq_notify
+ 	data8 sys_mq_getsetattr
+ 	data8 sys_kexec_load
+-	data8 sys_ni_syscall			// reserved for vserver
++	data8 sys_vserver
+ 	data8 sys_waitid			// 1270
+ 	data8 sys_add_key
+ 	data8 sys_request_key
+--- linux-2.6.22/arch/ia64/kernel/perfmon.c	2007-07-09 13:17:43 +0200
++++ linux-2.6.22-vs2.2.0-rc5/arch/ia64/kernel/perfmon.c	2007-06-15 02:37:03 +0200
+@@ -40,6 +40,7 @@
+ #include <linux/capability.h>
+ #include <linux/rcupdate.h>
+ #include <linux/completion.h>
++#include <linux/vs_memory.h>
+ 
+ #include <asm/errno.h>
+ #include <asm/intrinsics.h>
+@@ -2395,7 +2396,7 @@ pfm_smpl_buffer_alloc(struct task_struct
+ 	 */
+ 	insert_vm_struct(mm, vma);
+ 
+-	mm->total_vm  += size >> PAGE_SHIFT;
++	vx_vmpages_add(mm, size >> PAGE_SHIFT);
+ 	vm_stat_account(vma->vm_mm, vma->vm_flags, vma->vm_file,
+ 							vma_pages(vma));
+ 	up_write(&task->mm->mmap_sem);
+--- linux-2.6.22/arch/ia64/kernel/process.c	2007-07-09 13:17:43 +0200
++++ linux-2.6.22-vs2.2.0-rc5/arch/ia64/kernel/process.c	2007-06-15 02:37:03 +0200
+@@ -105,7 +105,8 @@ show_regs (struct pt_regs *regs)
+ 	unsigned long ip = regs->cr_iip + ia64_psr(regs)->ri;
+ 
+ 	print_modules();
+-	printk("\nPid: %d, CPU %d, comm: %20s\n", current->pid, smp_processor_id(), current->comm);
++	printk("\nPid: %d[#%u], CPU %d, comm: %20s\n",
++		current->pid, current->xid, smp_processor_id(), current->comm);
+ 	printk("psr : %016lx ifs : %016lx ip  : [<%016lx>]    %s\n",
+ 	       regs->cr_ipsr, regs->cr_ifs, ip, print_tainted());
+ 	print_symbol("ip is at %s\n", ip);
+@@ -696,7 +697,8 @@ kernel_thread (int (*fn)(void *), void *
+ 	regs.sw.ar_fpsr = regs.pt.ar_fpsr = ia64_getreg(_IA64_REG_AR_FPSR);
+ 	regs.sw.ar_bspstore = (unsigned long) current + IA64_RBS_OFFSET;
+ 	regs.sw.pr = (1 << PRED_KERNEL_STACK);
+-	return do_fork(flags | CLONE_VM | CLONE_UNTRACED, 0, &regs.pt, 0, NULL, NULL);
++	return do_fork(flags | CLONE_VM | CLONE_UNTRACED | CLONE_KTHREAD,
++		0, &regs.pt, 0, NULL, NULL);
+ }
+ EXPORT_SYMBOL(kernel_thread);
+ 
+--- linux-2.6.22/arch/ia64/kernel/ptrace.c	2007-05-02 19:24:20 +0200
++++ linux-2.6.22-vs2.2.0-rc5/arch/ia64/kernel/ptrace.c	2007-06-15 02:37:03 +0200
+@@ -17,6 +17,7 @@
+ #include <linux/security.h>
+ #include <linux/audit.h>
+ #include <linux/signal.h>
++#include <linux/vs_base.h>
+ 
+ #include <asm/pgtable.h>
+ #include <asm/processor.h>
+@@ -1443,6 +1444,9 @@ sys_ptrace (long request, pid_t pid, uns
+ 	read_unlock(&tasklist_lock);
+ 	if (!child)
+ 		goto out;
++	if (!vx_check(vx_task_xid(child), VS_WATCH_P | VS_IDENT))
++		goto out_tsk;
++
+ 	ret = -EPERM;
+ 	if (pid == 1)		/* no messing around with init! */
+ 		goto out_tsk;
+--- linux-2.6.22/arch/ia64/kernel/traps.c	2007-07-09 13:17:43 +0200
++++ linux-2.6.22-vs2.2.0-rc5/arch/ia64/kernel/traps.c	2007-06-15 02:37:03 +0200
+@@ -60,8 +60,9 @@ die (const char *str, struct pt_regs *re
+ 	put_cpu();
+ 
+ 	if (++die.lock_owner_depth < 3) {
+-		printk("%s[%d]: %s %ld [%d]\n",
+-			current->comm, current->pid, str, err, ++die_counter);
++		printk("%s[%d[#%u]]: %s %ld [%d]\n",
++			current->comm, current->pid, current->xid,
++			str, err, ++die_counter);
+ 		(void) notify_die(DIE_OOPS, (char *)str, regs, err, 255, SIGSEGV);
+ 		show_regs(regs);
+   	} else
+@@ -313,8 +314,9 @@ handle_fpu_swa (int fp_fault, struct pt_
+ 			if ((last.count & 15) < 5 && (ia64_fetchadd(1, &last.count, acq) & 15) < 5) {
+ 				last.time = current_jiffies + 5 * HZ;
+ 				printk(KERN_WARNING
+-		       			"%s(%d): floating-point assist fault at ip %016lx, isr %016lx\n",
+-		       			current->comm, current->pid, regs->cr_iip + ia64_psr(regs)->ri, isr);
++					"%s(%d[#%u]): floating-point assist fault at ip %016lx, isr %016lx\n",
++					current->comm, current->pid, current->xid,
++					regs->cr_iip + ia64_psr(regs)->ri, isr);
+ 			}
+ 		}
+ 	}
+--- linux-2.6.22/arch/ia64/mm/fault.c	2007-07-09 13:17:43 +0200
++++ linux-2.6.22-vs2.2.0-rc5/arch/ia64/mm/fault.c	2007-06-15 02:39:01 +0200
+@@ -10,6 +10,7 @@
+ #include <linux/interrupt.h>
+ #include <linux/kprobes.h>
+ #include <linux/kdebug.h>
++#include <linux/vs_memory.h>
+ 
+ #include <asm/pgtable.h>
+ #include <asm/processor.h>
+--- linux-2.6.22/arch/m32r/kernel/process.c	2007-05-02 19:24:21 +0200
++++ linux-2.6.22-vs2.2.0-rc5/arch/m32r/kernel/process.c	2007-06-15 02:37:03 +0200
+@@ -211,8 +211,8 @@ int kernel_thread(int (*fn)(void *), voi
+ 	regs.psw = M32R_PSW_BIE;
+ 
+ 	/* Ok, create the new process. */
+-	return do_fork(flags | CLONE_VM | CLONE_UNTRACED, 0, &regs, 0, NULL,
+-		NULL);
++	return do_fork(flags | CLONE_VM | CLONE_UNTRACED | CLONE_KTHREAD,
++		0, &regs, 0, NULL, NULL);
+ }
+ 
+ /*
+--- linux-2.6.22/arch/m32r/kernel/traps.c	2006-11-30 21:18:28 +0100
++++ linux-2.6.22-vs2.2.0-rc5/arch/m32r/kernel/traps.c	2007-06-15 02:37:03 +0200
+@@ -195,8 +195,9 @@ static void show_registers(struct pt_reg
+ 	} else {
+ 		printk("SPI: %08lx\n", sp);
+ 	}
+-	printk("Process %s (pid: %d, process nr: %d, stackpage=%08lx)",
+-		current->comm, current->pid, 0xffff & i, 4096+(unsigned long)current);
++	printk("Process %s (pid: %d[#%u], process nr: %d, stackpage=%08lx)",
++		current->comm, current->pid, current->xid,
++		0xffff & i, 4096+(unsigned long)current);
+ 
+ 	/*
+ 	 * When in-kernel, we also print out the stack and code at the
+--- linux-2.6.22/arch/m68k/Kconfig	2007-07-09 13:17:47 +0200
++++ linux-2.6.22-vs2.2.0-rc5/arch/m68k/Kconfig	2007-07-07 03:52:53 +0200
+@@ -678,6 +678,8 @@ source "fs/Kconfig"
+ 
+ source "arch/m68k/Kconfig.debug"
+ 
++source "kernel/vserver/Kconfig"
++
+ source "security/Kconfig"
+ 
+ source "crypto/Kconfig"
+--- linux-2.6.22/arch/m68k/kernel/process.c	2006-11-30 21:18:28 +0100
++++ linux-2.6.22-vs2.2.0-rc5/arch/m68k/kernel/process.c	2007-06-15 02:37:03 +0200
+@@ -159,7 +159,8 @@ int kernel_thread(int (*fn)(void *), voi
+ 
+ 	{
+ 	register long retval __asm__ ("d0");
+-	register long clone_arg __asm__ ("d1") = flags | CLONE_VM | CLONE_UNTRACED;
++	register long clone_arg __asm__ ("d1") =
++		flags | CLONE_VM | CLONE_UNTRACED | CLONE_KTHREAD;
+ 
+ 	retval = __NR_clone;
+ 	__asm__ __volatile__
+--- linux-2.6.22/arch/m68k/kernel/ptrace.c	2007-07-09 13:17:47 +0200
++++ linux-2.6.22-vs2.2.0-rc5/arch/m68k/kernel/ptrace.c	2007-06-15 02:37:03 +0200
+@@ -18,6 +18,7 @@
+ #include <linux/ptrace.h>
+ #include <linux/user.h>
+ #include <linux/signal.h>
++#include <linux/vs_base.h>
+ 
+ #include <asm/uaccess.h>
+ #include <asm/page.h>
+@@ -278,6 +279,8 @@ long arch_ptrace(struct task_struct *chi
+ 		ret = ptrace_request(child, request, addr, data);
+ 		break;
+ 	}
++	if (!vx_check(vx_task_xid(child), VS_WATCH_P | VS_IDENT))
++		goto out_tsk;
+ 
+ 	return ret;
+ out_eio:
+--- linux-2.6.22/arch/m68k/kernel/traps.c	2007-05-02 19:24:21 +0200
++++ linux-2.6.22-vs2.2.0-rc5/arch/m68k/kernel/traps.c	2007-06-15 02:37:03 +0200
+@@ -899,8 +899,8 @@ void show_registers(struct pt_regs *regs
+ 	printk("d4: %08lx    d5: %08lx    a0: %08lx    a1: %08lx\n",
+ 	       regs->d4, regs->d5, regs->a0, regs->a1);
+ 
+-	printk("Process %s (pid: %d, task=%p)\n",
+-		current->comm, current->pid, current);
++	printk("Process %s (pid: %d[#%u], task=%p)\n",
++		current->comm, current->pid, current->xid, current);
+ 	addr = (unsigned long)&fp->un;
+ 	printk("Frame format=%X ", regs->format);
+ 	switch (regs->format) {
+--- linux-2.6.22/arch/m68knommu/Kconfig	2007-07-09 13:17:47 +0200
++++ linux-2.6.22-vs2.2.0-rc5/arch/m68knommu/Kconfig	2007-06-15 02:37:03 +0200
+@@ -670,6 +670,8 @@ source "fs/Kconfig"
+ 
+ source "arch/m68knommu/Kconfig.debug"
+ 
++source "kernel/vserver/Kconfig"
++
+ source "security/Kconfig"
+ 
+ source "crypto/Kconfig"
+--- linux-2.6.22/arch/m68knommu/kernel/process.c	2007-02-06 03:00:08 +0100
++++ linux-2.6.22-vs2.2.0-rc5/arch/m68knommu/kernel/process.c	2007-06-15 02:37:03 +0200
+@@ -122,7 +122,7 @@ void show_regs(struct pt_regs * regs)
+ int kernel_thread(int (*fn)(void *), void * arg, unsigned long flags)
+ {
+ 	int retval;
+-	long clone_arg = flags | CLONE_VM;
++	long clone_arg = flags | CLONE_VM | CLONE_KTHREAD;
+ 	mm_segment_t fs;
+ 
+ 	fs = get_fs();
+--- linux-2.6.22/arch/m68knommu/kernel/traps.c	2007-05-02 19:24:21 +0200
++++ linux-2.6.22-vs2.2.0-rc5/arch/m68knommu/kernel/traps.c	2007-06-15 02:37:03 +0200
+@@ -80,8 +80,9 @@ void die_if_kernel(char *str, struct pt_
+ 	printk(KERN_EMERG "d4: %08lx    d5: %08lx    a0: %08lx    a1: %08lx\n",
+ 	       fp->d4, fp->d5, fp->a0, fp->a1);
+ 
+-	printk(KERN_EMERG "Process %s (pid: %d, stackpage=%08lx)\n",
+-		current->comm, current->pid, PAGE_SIZE+(unsigned long)current);
++	printk(KERN_EMERG "Process %s (pid: %d[#%u], stackpage=%08lx)\n",
++		current->comm, current->pid, current->xid,
++		PAGE_SIZE+(unsigned long)current);
+ 	show_stack(NULL, (unsigned long *)fp);
+ 	do_exit(SIGSEGV);
+ }
+--- linux-2.6.22/arch/mips/Kconfig	2007-07-09 13:17:47 +0200
++++ linux-2.6.22-vs2.2.0-rc5/arch/mips/Kconfig	2007-07-07 03:52:53 +0200
+@@ -1959,6 +1959,8 @@ source "arch/mips/oprofile/Kconfig"
+ 
+ source "arch/mips/Kconfig.debug"
+ 
++source "kernel/vserver/Kconfig"
++
+ source "security/Kconfig"
+ 
+ source "crypto/Kconfig"
+--- linux-2.6.22/arch/mips/kernel/linux32.c	2007-07-09 13:17:48 +0200
++++ linux-2.6.22-vs2.2.0-rc5/arch/mips/kernel/linux32.c	2007-06-17 05:54:16 +0200
+@@ -229,7 +229,7 @@ sys32_gettimeofday(struct compat_timeval
+ {
+ 	if (tv) {
+ 		struct timeval ktv;
+-		do_gettimeofday(&ktv);
++		vx_gettimeofday(&ktv);
+ 		if (put_tv32(tv, &ktv))
+ 			return -EFAULT;
+ 	}
+--- linux-2.6.22/arch/mips/kernel/process.c	2007-05-02 19:24:23 +0200
++++ linux-2.6.22-vs2.2.0-rc5/arch/mips/kernel/process.c	2007-06-15 02:37:03 +0200
+@@ -236,7 +236,8 @@ long kernel_thread(int (*fn)(void *), vo
+ #endif
+ 
+ 	/* Ok, create the new process.. */
+-	return do_fork(flags | CLONE_VM | CLONE_UNTRACED, 0, &regs, 0, NULL, NULL);
++	return do_fork(flags | CLONE_VM | CLONE_UNTRACED | CLONE_KTHREAD,
++		0, &regs, 0, NULL, NULL);
+ }
+ 
+ /*
+--- linux-2.6.22/arch/mips/kernel/ptrace.c	2007-07-09 13:17:48 +0200
++++ linux-2.6.22-vs2.2.0-rc5/arch/mips/kernel/ptrace.c	2007-06-15 02:37:03 +0200
+@@ -25,6 +25,7 @@
+ #include <linux/user.h>
+ #include <linux/security.h>
+ #include <linux/signal.h>
++#include <linux/vs_base.h>
+ 
+ #include <asm/byteorder.h>
+ #include <asm/cpu.h>
+@@ -171,6 +172,9 @@ long arch_ptrace(struct task_struct *chi
+ {
+ 	int ret;
+ 
++	if (!vx_check(vx_task_xid(child), VS_WATCH_P | VS_IDENT))
++		goto out;
++
+ 	switch (request) {
+ 	/* when I and D space are separate, these will need to be fixed. */
+ 	case PTRACE_PEEKTEXT: /* read word at location addr. */
+--- linux-2.6.22/arch/mips/kernel/scall32-o32.S	2007-07-09 13:17:48 +0200
++++ linux-2.6.22-vs2.2.0-rc5/arch/mips/kernel/scall32-o32.S	2007-06-17 05:54:16 +0200
+@@ -619,7 +619,7 @@ einval:	li	v0, -EINVAL
+ 	sys	sys_mq_timedreceive	5
+ 	sys	sys_mq_notify		2	/* 4275 */
+ 	sys	sys_mq_getsetattr	3
+-	sys	sys_ni_syscall		0	/* sys_vserver */
++	sys	sys_vserver		3
+ 	sys	sys_waitid		5
+ 	sys	sys_ni_syscall		0	/* available, was setaltroot */
+ 	sys	sys_add_key		5	/* 4280 */
+--- linux-2.6.22/arch/mips/kernel/scall64-64.S	2007-07-09 13:17:48 +0200
++++ linux-2.6.22-vs2.2.0-rc5/arch/mips/kernel/scall64-64.S	2007-06-17 05:54:16 +0200
+@@ -434,7 +434,7 @@ sys_call_table:
+ 	PTR	sys_mq_timedreceive
+ 	PTR	sys_mq_notify
+ 	PTR	sys_mq_getsetattr		/* 5235 */
+-	PTR	sys_ni_syscall			/* sys_vserver */
++	PTR	sys_vserver
+ 	PTR	sys_waitid
+ 	PTR	sys_ni_syscall			/* available, was setaltroot */
+ 	PTR	sys_add_key
+--- linux-2.6.22/arch/mips/kernel/scall64-n32.S	2007-07-09 13:17:48 +0200
++++ linux-2.6.22-vs2.2.0-rc5/arch/mips/kernel/scall64-n32.S	2007-06-17 05:54:16 +0200
+@@ -360,7 +360,7 @@ EXPORT(sysn32_call_table)
+ 	PTR	compat_sys_mq_timedreceive
+ 	PTR	compat_sys_mq_notify
+ 	PTR	compat_sys_mq_getsetattr
+-	PTR	sys_ni_syscall			/* 6240, sys_vserver */
++	PTR	sys32_vserver			/* 6240 */
+ 	PTR	compat_sys_waitid
+ 	PTR	sys_ni_syscall			/* available, was setaltroot */
+ 	PTR	sys_add_key
+--- linux-2.6.22/arch/mips/kernel/scall64-o32.S	2007-07-09 13:17:48 +0200
++++ linux-2.6.22-vs2.2.0-rc5/arch/mips/kernel/scall64-o32.S	2007-06-17 05:54:16 +0200
+@@ -482,7 +482,7 @@ sys_call_table:
+ 	PTR	compat_sys_mq_timedreceive
+ 	PTR	compat_sys_mq_notify		/* 4275 */
+ 	PTR	compat_sys_mq_getsetattr
+-	PTR	sys_ni_syscall			/* sys_vserver */
++	PTR	sys32_vserver
+ 	PTR	sys32_waitid
+ 	PTR	sys_ni_syscall			/* available, was setaltroot */
+ 	PTR	sys_add_key			/* 4280 */
+--- linux-2.6.22/arch/mips/kernel/traps.c	2007-07-09 13:17:48 +0200
++++ linux-2.6.22-vs2.2.0-rc5/arch/mips/kernel/traps.c	2007-07-09 13:11:53 +0200
+@@ -302,8 +302,9 @@ void show_registers(struct pt_regs *regs
+ {
+ 	show_regs(regs);
+ 	print_modules();
+-	printk("Process %s (pid: %d, threadinfo=%p, task=%p)\n",
+-	        current->comm, current->pid, current_thread_info(), current);
++	printk("Process %s (pid: %d:#%u, threadinfo=%p, task=%p)\n",
++		current->comm, current->pid, current->xid,
++		current_thread_info(), current);
+ 	show_stacktrace(current, regs);
+ 	show_code((unsigned int *) regs->cp0_epc);
+ 	printk("\n");
+--- linux-2.6.22/arch/mips/mm/fault.c	2007-07-09 13:17:48 +0200
++++ linux-2.6.22-vs2.2.0-rc5/arch/mips/mm/fault.c	2007-06-15 02:37:03 +0200
+@@ -179,7 +179,8 @@ out_of_memory:
+ 		down_read(&mm->mmap_sem);
+ 		goto survive;
+ 	}
+-	printk("VM: killing process %s\n", tsk->comm);
++	printk("VM: killing process %s(%d:#%u)\n",
++		tsk->comm, tsk->pid, tsk->xid);
+ 	if (user_mode(regs))
+ 		do_exit(SIGKILL);
+ 	goto no_context;
+--- linux-2.6.22/arch/parisc/Kconfig	2007-05-02 19:24:26 +0200
++++ linux-2.6.22-vs2.2.0-rc5/arch/parisc/Kconfig	2007-06-15 02:37:03 +0200
+@@ -271,6 +271,8 @@ source "arch/parisc/oprofile/Kconfig"
+ 
+ source "arch/parisc/Kconfig.debug"
+ 
++source "kernel/vserver/Kconfig"
++
+ source "security/Kconfig"
+ 
+ source "crypto/Kconfig"
+--- linux-2.6.22/arch/parisc/kernel/entry.S	2007-07-09 13:17:50 +0200
++++ linux-2.6.22-vs2.2.0-rc5/arch/parisc/kernel/entry.S	2007-06-17 05:54:16 +0200
+@@ -761,6 +761,7 @@ END(fault_vector_11)
+ 
+ #define CLONE_VM 0x100	/* Must agree with <linux/sched.h> */
+ #define CLONE_UNTRACED 0x00800000
++#define CLONE_KTHREAD 0x10000000
+ 
+ 	.import do_fork
+ ENTRY(__kernel_thread)
+--- linux-2.6.22/arch/parisc/kernel/process.c	2007-07-09 13:17:50 +0200
++++ linux-2.6.22-vs2.2.0-rc5/arch/parisc/kernel/process.c	2007-06-17 05:54:16 +0200
+@@ -173,7 +173,7 @@ pid_t kernel_thread(int (*fn)(void *), v
+ 	 *	  kernel_thread can become a #define.
+ 	 */
+ 
+-	return __kernel_thread(fn, arg, flags);
++	return __kernel_thread(fn, arg, flags | CLONE_KTHREAD);
+ }
+ EXPORT_SYMBOL(kernel_thread);
+ 
+--- linux-2.6.22/arch/parisc/kernel/sys_parisc32.c	2007-07-09 13:17:50 +0200
++++ linux-2.6.22-vs2.2.0-rc5/arch/parisc/kernel/sys_parisc32.c	2007-06-17 05:54:16 +0200
+@@ -204,11 +204,11 @@ static inline long get_ts32(struct times
+ asmlinkage int
+ sys32_gettimeofday(struct compat_timeval __user *tv, struct timezone __user *tz)
+ {
+-    extern void do_gettimeofday(struct timeval *tv);
++    extern void vx_gettimeofday(struct timeval *tv);
+ 
+     if (tv) {
+ 	    struct timeval ktv;
+-	    do_gettimeofday(&ktv);
++	    vx_gettimeofday(&ktv);
+ 	    if (put_compat_timeval(tv, &ktv))
+ 		    return -EFAULT;
+     }
+--- linux-2.6.22/arch/parisc/kernel/syscall_table.S	2007-07-09 13:17:50 +0200
++++ linux-2.6.22-vs2.2.0-rc5/arch/parisc/kernel/syscall_table.S	2007-06-17 05:54:16 +0200
+@@ -363,7 +363,7 @@
+ 	ENTRY_COMP(mbind)		/* 260 */
+ 	ENTRY_COMP(get_mempolicy)
+ 	ENTRY_COMP(set_mempolicy)
+-	ENTRY_SAME(ni_syscall)	/* 263: reserved for vserver */
++	ENTRY_DIFF(vserver)
+ 	ENTRY_SAME(add_key)
+ 	ENTRY_SAME(request_key)		/* 265 */
+ 	ENTRY_SAME(keyctl)
+--- linux-2.6.22/arch/parisc/kernel/traps.c	2007-07-09 13:17:50 +0200
++++ linux-2.6.22-vs2.2.0-rc5/arch/parisc/kernel/traps.c	2007-06-17 05:54:16 +0200
+@@ -218,8 +218,9 @@ void die_if_kernel(char *str, struct pt_
+ 		if (err == 0)
+ 			return; /* STFU */
+ 
+-		printk(KERN_CRIT "%s (pid %d): %s (code %ld) at " RFMT "\n",
+-			current->comm, current->pid, str, err, regs->iaoq[0]);
++		printk(KERN_CRIT "%s (pid %d:#%u): %s (code %ld) at " RFMT "\n",
++			current->comm, current->pid, current->xid,
++			str, err, regs->iaoq[0]);
+ #ifdef PRINT_USER_FAULTS
+ 		/* XXX for debugging only */
+ 		show_regs(regs);
+@@ -251,8 +252,8 @@ KERN_CRIT "                     ||     |
+ 		pdc_console_restart();
+ 	
+ 	if (err)
+-		printk(KERN_CRIT "%s (pid %d): %s (code %ld)\n",
+-			current->comm, current->pid, str, err);
++		printk(KERN_CRIT "%s (pid %d:#%u): %s (code %ld)\n",
++			current->comm, current->pid, current->xid, str, err);
+ 
+ 	/* Wot's wrong wif bein' racy? */
+ 	if (current->thread.flags & PARISC_KERNEL_DEATH) {
+--- linux-2.6.22/arch/parisc/mm/fault.c	2007-05-02 19:24:26 +0200
++++ linux-2.6.22-vs2.2.0-rc5/arch/parisc/mm/fault.c	2007-06-15 02:37:03 +0200
+@@ -209,8 +209,9 @@ bad_area:
+ 
+ #ifdef PRINT_USER_FAULTS
+ 		printk(KERN_DEBUG "\n");
+-		printk(KERN_DEBUG "do_page_fault() pid=%d command='%s' type=%lu address=0x%08lx\n",
+-		    tsk->pid, tsk->comm, code, address);
++		printk(KERN_DEBUG "do_page_fault() pid=%d:#%u "
++		    "command='%s' type=%lu address=0x%08lx\n",
++		    tsk->pid, tsk->xid, tsk->comm, code, address);
+ 		if (vma) {
+ 			printk(KERN_DEBUG "vm_start = 0x%08lx, vm_end = 0x%08lx\n",
+ 					vma->vm_start, vma->vm_end);
+@@ -260,7 +261,8 @@ no_context:
+ 
+   out_of_memory:
+ 	up_read(&mm->mmap_sem);
+-	printk(KERN_CRIT "VM: killing process %s\n", current->comm);
++	printk(KERN_CRIT "VM: killing process %s(%d:#%u)\n",
++		current->comm, current->pid, current->xid);
+ 	if (user_mode(regs))
+ 		do_exit(SIGKILL);
+ 	goto no_context;
+--- linux-2.6.22/arch/powerpc/Kconfig	2007-07-09 13:17:50 +0200
++++ linux-2.6.22-vs2.2.0-rc5/arch/powerpc/Kconfig	2007-06-15 02:37:03 +0200
+@@ -906,6 +906,8 @@ endmenu
+ 
+ source "arch/powerpc/Kconfig.debug"
+ 
++source "kernel/vserver/Kconfig"
++
+ source "security/Kconfig"
+ 
+ config KEYS_COMPAT
+--- linux-2.6.22/arch/powerpc/kernel/asm-offsets.c	2007-07-09 13:17:51 +0200
++++ linux-2.6.22-vs2.2.0-rc5/arch/powerpc/kernel/asm-offsets.c	2007-06-15 02:37:03 +0200
+@@ -250,6 +250,7 @@ int main(void)
+ 
+ 	DEFINE(CLONE_VM, CLONE_VM);
+ 	DEFINE(CLONE_UNTRACED, CLONE_UNTRACED);
++	DEFINE(CLONE_KTHREAD, CLONE_KTHREAD);
+ 
+ #ifndef CONFIG_PPC64
+ 	DEFINE(MM_PGD, offsetof(struct mm_struct, pgd));
+--- linux-2.6.22/arch/powerpc/kernel/irq.c	2007-07-09 13:17:51 +0200
++++ linux-2.6.22-vs2.2.0-rc5/arch/powerpc/kernel/irq.c	2007-07-09 13:11:53 +0200
+@@ -53,6 +53,7 @@
+ #include <linux/mutex.h>
+ #include <linux/bootmem.h>
+ #include <linux/pci.h>
++#include <linux/vs_context.h>
+ 
+ #include <asm/uaccess.h>
+ #include <asm/system.h>
+--- linux-2.6.22/arch/powerpc/kernel/misc_32.S	2007-07-09 13:17:51 +0200
++++ linux-2.6.22-vs2.2.0-rc5/arch/powerpc/kernel/misc_32.S	2007-06-15 02:37:03 +0200
+@@ -745,7 +745,7 @@ _GLOBAL(kernel_thread)
+ 	mr	r30,r3		/* function */
+ 	mr	r31,r4		/* argument */
+ 	ori	r3,r5,CLONE_VM	/* flags */
+-	oris	r3,r3,CLONE_UNTRACED>>16
++	oris	r3,r3,(CLONE_UNTRACED|CLONE_KTHREAD)>>16
+ 	li	r4,0		/* new sp (unused) */
+ 	li	r0,__NR_clone
+ 	sc
+--- linux-2.6.22/arch/powerpc/kernel/misc_64.S	2007-05-02 19:24:27 +0200
++++ linux-2.6.22-vs2.2.0-rc5/arch/powerpc/kernel/misc_64.S	2007-06-15 02:37:03 +0200
+@@ -434,7 +434,7 @@ _GLOBAL(kernel_thread)
+ 	mr	r29,r3
+ 	mr	r30,r4
+ 	ori	r3,r5,CLONE_VM	/* flags */
+-	oris	r3,r3,(CLONE_UNTRACED>>16)
++	oris	r3,r3,(CLONE_UNTRACED|CLONE_KTHREAD)>>16
+ 	li	r4,0		/* new sp (unused) */
+ 	li	r0,__NR_clone
+ 	sc
+--- linux-2.6.22/arch/powerpc/kernel/process.c	2007-07-09 13:17:51 +0200
++++ linux-2.6.22-vs2.2.0-rc5/arch/powerpc/kernel/process.c	2007-06-15 02:37:03 +0200
+@@ -422,8 +422,9 @@ void show_regs(struct pt_regs * regs)
+ 	trap = TRAP(regs);
+ 	if (trap == 0x300 || trap == 0x600)
+ 		printk("DAR: "REG", DSISR: "REG"\n", regs->dar, regs->dsisr);
+-	printk("TASK = %p[%d] '%s' THREAD: %p",
+-	       current, current->pid, current->comm, task_thread_info(current));
++	printk("TASK = %p[%d,#%u] '%s' THREAD: %p",
++	       current, current->pid, current->xid,
++	       current->comm, task_thread_info(current));
+ 
+ #ifdef CONFIG_SMP
+ 	printk(" CPU: %d", smp_processor_id());
+--- linux-2.6.22/arch/powerpc/kernel/sys_ppc32.c	2007-07-09 13:17:51 +0200
++++ linux-2.6.22-vs2.2.0-rc5/arch/powerpc/kernel/sys_ppc32.c	2007-07-07 03:52:53 +0200
+@@ -205,7 +205,7 @@ asmlinkage long compat_sys_gettimeofday(
+ {
+ 	if (tv) {
+ 		struct timeval ktv;
+-		do_gettimeofday(&ktv);
++		vx_gettimeofday(&ktv);
+ 		if (put_tv32(tv, &ktv))
+ 			return -EFAULT;
+ 	}
+--- linux-2.6.22/arch/powerpc/kernel/traps.c	2007-07-09 13:17:51 +0200
++++ linux-2.6.22-vs2.2.0-rc5/arch/powerpc/kernel/traps.c	2007-06-15 02:37:03 +0200
+@@ -878,8 +878,9 @@ void nonrecoverable_exception(struct pt_
+ 
+ void trace_syscall(struct pt_regs *regs)
+ {
+-	printk("Task: %p(%d), PC: %08lX/%08lX, Syscall: %3ld, Result: %s%ld    %s\n",
+-	       current, current->pid, regs->nip, regs->link, regs->gpr[0],
++	printk("Task: %p(%d[#%u]), PC: %08lX/%08lX, Syscall: %3ld, Result: %s%ld    %s\n",
++	       current, current->pid, current->xid,
++	       regs->nip, regs->link, regs->gpr[0],
+ 	       regs->ccr&0x10000000?"Error=":"", regs->gpr[3], print_tainted());
+ }
+ 
+--- linux-2.6.22/arch/powerpc/kernel/vdso.c	2007-07-09 13:17:51 +0200
++++ linux-2.6.22-vs2.2.0-rc5/arch/powerpc/kernel/vdso.c	2007-06-15 02:37:03 +0200
+@@ -21,6 +21,7 @@
+ #include <linux/elf.h>
+ #include <linux/security.h>
+ #include <linux/bootmem.h>
++#include <linux/vs_memory.h>
+ 
+ #include <asm/pgtable.h>
+ #include <asm/system.h>
+--- linux-2.6.22/arch/powerpc/mm/fault.c	2007-07-09 13:17:51 +0200
++++ linux-2.6.22-vs2.2.0-rc5/arch/powerpc/mm/fault.c	2007-07-07 03:52:53 +0200
+@@ -378,7 +378,8 @@ out_of_memory:
+ 		down_read(&mm->mmap_sem);
+ 		goto survive;
+ 	}
+-	printk("VM: killing process %s\n", current->comm);
++	printk("VM: killing process %s(%d:#%u)\n",
++		current->comm, current->pid, current->xid);
+ 	if (user_mode(regs))
+ 		do_exit(SIGKILL);
+ 	return SIGKILL;
+--- linux-2.6.22/arch/ppc/Kconfig	2007-05-02 19:24:28 +0200
++++ linux-2.6.22-vs2.2.0-rc5/arch/ppc/Kconfig	2007-06-15 02:37:03 +0200
+@@ -1455,6 +1455,8 @@ source "arch/powerpc/oprofile/Kconfig"
+ 
+ source "arch/ppc/Kconfig.debug"
+ 
++source "kernel/vserver/Kconfig"
++
+ source "security/Kconfig"
+ 
+ source "crypto/Kconfig"
+--- linux-2.6.22/arch/ppc/kernel/asm-offsets.c	2007-07-09 13:18:01 +0200
++++ linux-2.6.22-vs2.2.0-rc5/arch/ppc/kernel/asm-offsets.c	2007-06-15 02:37:03 +0200
+@@ -120,6 +120,7 @@ main(void)
+ 	DEFINE(TRAP, STACK_FRAME_OVERHEAD+offsetof(struct pt_regs, trap));
+ 	DEFINE(CLONE_VM, CLONE_VM);
+ 	DEFINE(CLONE_UNTRACED, CLONE_UNTRACED);
++	DEFINE(CLONE_KTHREAD, CLONE_KTHREAD);
+ 	DEFINE(MM_PGD, offsetof(struct mm_struct, pgd));
+ 
+ 	/* About the CPU features table */
+--- linux-2.6.22/arch/ppc/kernel/misc.S	2006-11-30 21:18:32 +0100
++++ linux-2.6.22-vs2.2.0-rc5/arch/ppc/kernel/misc.S	2007-06-15 02:37:03 +0200
+@@ -848,7 +848,7 @@ _GLOBAL(kernel_thread)
+ 	mr	r30,r3		/* function */
+ 	mr	r31,r4		/* argument */
+ 	ori	r3,r5,CLONE_VM	/* flags */
+-	oris	r3,r3,CLONE_UNTRACED>>16
++	oris	r3,r3,(CLONE_UNTRACED|CLONE_KTHREAD)>>16
+ 	li	r4,0		/* new sp (unused) */
+ 	li	r0,__NR_clone
+ 	sc
+--- linux-2.6.22/arch/ppc/kernel/traps.c	2007-07-09 13:18:01 +0200
++++ linux-2.6.22-vs2.2.0-rc5/arch/ppc/kernel/traps.c	2007-06-15 02:37:03 +0200
+@@ -696,8 +696,9 @@ void nonrecoverable_exception(struct pt_
+ 
+ void trace_syscall(struct pt_regs *regs)
+ {
+-	printk("Task: %p(%d), PC: %08lX/%08lX, Syscall: %3ld, Result: %s%ld    %s\n",
+-	       current, current->pid, regs->nip, regs->link, regs->gpr[0],
++	printk("Task: %p(%d[#%u]), PC: %08lX/%08lX, Syscall: %3ld, Result: %s%ld    %s\n",
++	       current, current->pid, current->xid,
++	       regs->nip, regs->link, regs->gpr[0],
+ 	       regs->ccr&0x10000000?"Error=":"", regs->gpr[3], print_tainted());
+ }
+ 
+--- linux-2.6.22/arch/ppc/mm/fault.c	2006-11-30 21:18:32 +0100
++++ linux-2.6.22-vs2.2.0-rc5/arch/ppc/mm/fault.c	2007-06-15 02:37:03 +0200
+@@ -296,7 +296,8 @@ out_of_memory:
+ 		down_read(&mm->mmap_sem);
+ 		goto survive;
+ 	}
+-	printk("VM: killing process %s\n", current->comm);
++	printk("VM: killing process %s(%d:#%u)\n",
++		current->comm, current->pid, current->xid);
+ 	if (user_mode(regs))
+ 		do_exit(SIGKILL);
+ 	return SIGKILL;
+--- linux-2.6.22/arch/s390/Kconfig	2007-07-09 13:18:02 +0200
++++ linux-2.6.22-vs2.2.0-rc5/arch/s390/Kconfig	2007-06-15 02:37:03 +0200
+@@ -551,6 +551,8 @@ endmenu
+ 
+ source "arch/s390/Kconfig.debug"
+ 
++source "kernel/vserver/Kconfig"
++
+ source "security/Kconfig"
+ 
+ source "crypto/Kconfig"
+--- linux-2.6.22/arch/s390/kernel/compat_linux.c	2007-07-09 13:18:02 +0200
++++ linux-2.6.22-vs2.2.0-rc5/arch/s390/kernel/compat_linux.c	2007-06-15 02:37:03 +0200
+@@ -567,7 +567,7 @@ asmlinkage long sys32_gettimeofday(struc
+ {
+ 	if (tv) {
+ 		struct timeval ktv;
+-		do_gettimeofday(&ktv);
++		vx_gettimeofday(&ktv);
+ 		if (put_tv32(tv, &ktv))
+ 			return -EFAULT;
+ 	}
+--- linux-2.6.22/arch/s390/kernel/process.c	2007-07-09 13:18:02 +0200
++++ linux-2.6.22-vs2.2.0-rc5/arch/s390/kernel/process.c	2007-06-15 02:37:03 +0200
+@@ -164,9 +164,9 @@ void show_regs(struct pt_regs *regs)
+ 	struct task_struct *tsk = current;
+ 
+         printk("CPU:    %d    %s\n", task_thread_info(tsk)->cpu, print_tainted());
+-        printk("Process %s (pid: %d, task: %p, ksp: %p)\n",
+-	       current->comm, current->pid, (void *) tsk,
+-	       (void *) tsk->thread.ksp);
++	printk("Process %s (pid: %d[#%u], task: %p, ksp: %p)\n",
++	       current->comm, current->pid, current->xid,
++	       (void *) tsk, (void *) tsk->thread.ksp);
+ 
+ 	show_registers(regs);
+ 	/* Show stack backtrace if pt_regs is from kernel mode */
+@@ -197,7 +197,7 @@ int kernel_thread(int (*fn)(void *), voi
+ 	regs.orig_gpr2 = -1;
+ 
+ 	/* Ok, create the new process.. */
+-	return do_fork(flags | CLONE_VM | CLONE_UNTRACED,
++	return do_fork(flags | CLONE_VM | CLONE_UNTRACED | CLONE_KTHREAD,
+ 		       0, &regs, 0, NULL, NULL);
+ }
+ 
+--- linux-2.6.22/arch/s390/kernel/ptrace.c	2007-05-02 19:24:29 +0200
++++ linux-2.6.22-vs2.2.0-rc5/arch/s390/kernel/ptrace.c	2007-06-15 02:37:03 +0200
+@@ -33,6 +33,7 @@
+ #include <linux/security.h>
+ #include <linux/audit.h>
+ #include <linux/signal.h>
++#include <linux/vs_base.h>
+ 
+ #include <asm/segment.h>
+ #include <asm/page.h>
+@@ -725,7 +726,13 @@ sys_ptrace(long request, long pid, long 
+ 		goto out;
+ 	}
+ 
++	if (!vx_check(vx_task_xid(child), VS_WATCH_P | VS_IDENT)) {
++		ret = -EPERM;
++		goto out_tsk;
++	}
++
+ 	ret = do_ptrace(child, request, addr, data);
++out_tsk:
+ 	put_task_struct(child);
+ out:
+ 	unlock_kernel();
+--- linux-2.6.22/arch/s390/kernel/syscalls.S	2007-07-09 13:18:02 +0200
++++ linux-2.6.22-vs2.2.0-rc5/arch/s390/kernel/syscalls.S	2007-06-15 02:37:03 +0200
+@@ -271,7 +271,7 @@ SYSCALL(sys_clock_settime,sys_clock_sett
+ SYSCALL(sys_clock_gettime,sys_clock_gettime,sys32_clock_gettime_wrapper)	/* 260 */
+ SYSCALL(sys_clock_getres,sys_clock_getres,sys32_clock_getres_wrapper)
+ SYSCALL(sys_clock_nanosleep,sys_clock_nanosleep,sys32_clock_nanosleep_wrapper)
+-NI_SYSCALL							/* reserved for vserver */
++SYSCALL(sys_vserver,sys_vserver,sys32_vserver)
+ SYSCALL(s390_fadvise64_64,sys_ni_syscall,sys32_fadvise64_64_wrapper)
+ SYSCALL(sys_statfs64,sys_statfs64,compat_sys_statfs64_wrapper)
+ SYSCALL(sys_fstatfs64,sys_fstatfs64,compat_sys_fstatfs64_wrapper)
+--- linux-2.6.22/arch/s390/mm/fault.c	2007-07-09 13:18:02 +0200
++++ linux-2.6.22-vs2.2.0-rc5/arch/s390/mm/fault.c	2007-06-15 02:37:03 +0200
+@@ -216,7 +216,8 @@ static int do_out_of_memory(struct pt_re
+ 		down_read(&mm->mmap_sem);
+ 		return 1;
+ 	}
+-	printk("VM: killing process %s\n", tsk->comm);
++	printk("VM: killing process %s(%d:#%u)\n",
++		tsk->comm, tsk->pid, tsk->xid);
+ 	if (regs->psw.mask & PSW_MASK_PSTATE)
+ 		do_exit(SIGKILL);
+ 	do_no_context(regs, error_code, address);
+--- linux-2.6.22/arch/sh/Kconfig	2007-07-09 13:18:02 +0200
++++ linux-2.6.22-vs2.2.0-rc5/arch/sh/Kconfig	2007-06-15 02:37:03 +0200
+@@ -723,6 +723,8 @@ source "arch/sh/oprofile/Kconfig"
+ 
+ source "arch/sh/Kconfig.debug"
+ 
++source "kernel/vserver/Kconfig"
++
+ source "security/Kconfig"
+ 
+ source "crypto/Kconfig"
+--- linux-2.6.22/arch/sh/kernel/irq.c	2007-07-09 13:18:03 +0200
++++ linux-2.6.22-vs2.2.0-rc5/arch/sh/kernel/irq.c	2007-06-15 02:37:03 +0200
+@@ -12,6 +12,7 @@
+ #include <linux/kernel_stat.h>
+ #include <linux/seq_file.h>
+ #include <linux/irq.h>
++#include <linux/vs_context.h>
+ #include <asm/processor.h>
+ #include <asm/machvec.h>
+ #include <asm/uaccess.h>
+--- linux-2.6.22/arch/sh/kernel/process.c	2007-07-09 13:18:03 +0200
++++ linux-2.6.22-vs2.2.0-rc5/arch/sh/kernel/process.c	2007-06-15 02:37:03 +0200
+@@ -118,7 +118,8 @@ void machine_power_off(void)
+ void show_regs(struct pt_regs * regs)
+ {
+ 	printk("\n");
+-	printk("Pid : %d, Comm: %20s\n", current->pid, current->comm);
++	printk("Pid : %d:#%u, Comm: %20s\n",
++		current->pid, current->xid, current->comm);
+ 	print_symbol("PC is at %s\n", instruction_pointer(regs));
+ 	printk("PC  : %08lx SP  : %08lx SR  : %08lx ",
+ 	       regs->pc, regs->regs[15], regs->sr);
+@@ -179,7 +180,7 @@ int kernel_thread(int (*fn)(void *), voi
+ 	regs.sr = (1 << 30);
+ 
+ 	/* Ok, create the new process.. */
+-	return do_fork(flags | CLONE_VM | CLONE_UNTRACED, 0,
++	return do_fork(flags | CLONE_VM | CLONE_UNTRACED | CLONE_KTHREAD, 0,
+ 		       &regs, 0, NULL, NULL);
+ }
+ 
+--- linux-2.6.22/arch/sh/kernel/vsyscall/vsyscall.c	2007-07-09 13:18:03 +0200
++++ linux-2.6.22-vs2.2.0-rc5/arch/sh/kernel/vsyscall/vsyscall.c	2007-06-15 02:39:24 +0200
+@@ -18,6 +18,7 @@
+ #include <linux/module.h>
+ #include <linux/elf.h>
+ #include <linux/sched.h>
++#include <linux/vs_memory.h>
+ 
+ /*
+  * Should the kernel map a VDSO page into processes and pass its
+--- linux-2.6.22/arch/sh/mm/fault.c	2007-07-09 13:18:03 +0200
++++ linux-2.6.22-vs2.2.0-rc5/arch/sh/mm/fault.c	2007-06-15 02:37:03 +0200
+@@ -201,7 +201,8 @@ out_of_memory:
+ 		down_read(&mm->mmap_sem);
+ 		goto survive;
+ 	}
+-	printk("VM: killing process %s\n", tsk->comm);
++	printk("VM: killing process %s(%d:#%u)\n",
++		tsk->comm, tsk->pid, tsk->xid);
+ 	if (user_mode(regs))
+ 		do_exit(SIGKILL);
+ 	goto no_context;
+--- linux-2.6.22/arch/sh64/kernel/process.c	2007-07-09 13:18:03 +0200
++++ linux-2.6.22-vs2.2.0-rc5/arch/sh64/kernel/process.c	2007-06-15 02:37:03 +0200
+@@ -400,8 +400,8 @@ int kernel_thread(int (*fn)(void *), voi
+ 	regs.pc = (unsigned long)kernel_thread_helper;
+ 	regs.sr = (1 << 30);
+ 
+-	return do_fork(flags | CLONE_VM | CLONE_UNTRACED, 0,
+-		       &regs, 0, NULL, NULL);
++	return do_fork(flags | CLONE_VM | CLONE_UNTRACED | CLONE_KTHREAD,
++		0, &regs, 0, NULL, NULL);
+ }
+ 
+ /*
+--- linux-2.6.22/arch/sh64/mm/fault.c	2007-07-09 13:18:04 +0200
++++ linux-2.6.22-vs2.2.0-rc5/arch/sh64/mm/fault.c	2007-06-15 02:37:03 +0200
+@@ -81,7 +81,7 @@ static inline void print_vma(struct vm_a
+ 
+ static inline void print_task(struct task_struct *tsk)
+ {
+-	printk("Task pid %d\n", tsk->pid);
++	printk("Task pid %d:#%u\n", tsk->pid, tsk->xid);
+ }
+ 
+ static pte_t *lookup_pte(struct mm_struct *mm, unsigned long address)
+@@ -330,7 +330,8 @@ out_of_memory:
+ 		down_read(&mm->mmap_sem);
+ 		goto survive;
+ 	}
+-	printk("VM: killing process %s\n", tsk->comm);
++	printk("VM: killing process %s(%d:#%u)\n",
++		tsk->comm, tsk->pid, tsk->xid);
+ 	if (user_mode(regs))
+ 		do_exit(SIGKILL);
+ 	goto no_context;
+--- linux-2.6.22/arch/sparc/Kconfig	2007-07-09 13:18:04 +0200
++++ linux-2.6.22-vs2.2.0-rc5/arch/sparc/Kconfig	2007-06-15 02:37:03 +0200
+@@ -317,6 +317,8 @@ endmenu
+ 
+ source "arch/sparc/Kconfig.debug"
+ 
++source "kernel/vserver/Kconfig"
++
+ source "security/Kconfig"
+ 
+ source "crypto/Kconfig"
+--- linux-2.6.22/arch/sparc/kernel/process.c	2007-07-09 13:18:04 +0200
++++ linux-2.6.22-vs2.2.0-rc5/arch/sparc/kernel/process.c	2007-06-15 02:37:03 +0200
+@@ -705,7 +705,8 @@ pid_t kernel_thread(int (*fn)(void *), v
+ 			     /* Notreached by child. */
+ 			     "1: mov %%o0, %0\n\t" :
+ 			     "=r" (retval) :
+-			     "i" (__NR_clone), "r" (flags | CLONE_VM | CLONE_UNTRACED),
++			     "i" (__NR_clone), "r" (flags |
++					CLONE_VM | CLONE_UNTRACED | CLONE_KTHREAD),
+ 			     "i" (__NR_exit),  "r" (fn), "r" (arg) :
+ 			     "g1", "g2", "g3", "o0", "o1", "memory", "cc");
+ 	return retval;
+--- linux-2.6.22/arch/sparc/kernel/ptrace.c	2007-02-06 03:00:18 +0100
++++ linux-2.6.22-vs2.2.0-rc5/arch/sparc/kernel/ptrace.c	2007-06-15 02:37:03 +0200
+@@ -19,6 +19,7 @@
+ #include <linux/smp_lock.h>
+ #include <linux/security.h>
+ #include <linux/signal.h>
++#include <linux/vs_base.h>
+ 
+ #include <asm/pgtable.h>
+ #include <asm/system.h>
+@@ -302,6 +303,10 @@ asmlinkage void do_ptrace(struct pt_regs
+ 		pt_error_return(regs, -ret);
+ 		goto out;
+ 	}
++	if (!vx_check(vx_task_xid(child), VS_WATCH_P | VS_IDENT)) {
++		pt_error_return(regs, ESRCH);
++		goto out_tsk;
++	}
+ 
+ 	if ((current->personality == PER_SUNOS && request == PTRACE_SUNATTACH)
+ 	    || (current->personality != PER_SUNOS && request == PTRACE_ATTACH)) {
+--- linux-2.6.22/arch/sparc/kernel/systbls.S	2007-07-09 13:18:04 +0200
++++ linux-2.6.22-vs2.2.0-rc5/arch/sparc/kernel/systbls.S	2007-06-15 02:37:03 +0200
+@@ -71,7 +71,7 @@ sys_call_table:
+ /*250*/	.long sparc_mremap, sys_sysctl, sys_getsid, sys_fdatasync, sys_nfsservctl
+ /*255*/	.long sys_sync_file_range, sys_clock_settime, sys_clock_gettime, sys_clock_getres, sys_clock_nanosleep
+ /*260*/	.long sys_sched_getaffinity, sys_sched_setaffinity, sys_timer_settime, sys_timer_gettime, sys_timer_getoverrun
+-/*265*/	.long sys_timer_delete, sys_timer_create, sys_nis_syscall, sys_io_setup, sys_io_destroy
++/*265*/	.long sys_timer_delete, sys_timer_create, sys_vserver, sys_io_setup, sys_io_destroy
+ /*270*/	.long sys_io_submit, sys_io_cancel, sys_io_getevents, sys_mq_open, sys_mq_unlink
+ /*275*/	.long sys_mq_timedsend, sys_mq_timedreceive, sys_mq_notify, sys_mq_getsetattr, sys_waitid
+ /*280*/	.long sys_tee, sys_add_key, sys_request_key, sys_keyctl, sys_openat
+--- linux-2.6.22/arch/sparc/kernel/traps.c	2007-07-09 13:18:05 +0200
++++ linux-2.6.22-vs2.2.0-rc5/arch/sparc/kernel/traps.c	2007-06-15 02:37:03 +0200
+@@ -99,7 +99,8 @@ void die_if_kernel(char *str, struct pt_
+ "              /_| \\__/ |_\\\n"
+ "                 \\__U_/\n");
+ 
+-	printk("%s(%d): %s [#%d]\n", current->comm, current->pid, str, ++die_counter);
++	printk("%s(%d[#%u]): %s [#%d]\n", current->comm,
++		current->pid, current->xid, str, ++die_counter);
+ 	show_regs(regs);
+ 
+ 	__SAVE; __SAVE; __SAVE; __SAVE;
+--- linux-2.6.22/arch/sparc/mm/fault.c	2007-07-09 13:18:05 +0200
++++ linux-2.6.22-vs2.2.0-rc5/arch/sparc/mm/fault.c	2007-06-15 02:37:03 +0200
+@@ -367,7 +367,8 @@ no_context:
+  */
+ out_of_memory:
+ 	up_read(&mm->mmap_sem);
+-	printk("VM: killing process %s\n", tsk->comm);
++	printk("VM: killing process %s(%d:#%u)\n",
++		tsk->comm, tsk->pid, tsk->xid);
+ 	if (from_user)
+ 		do_exit(SIGKILL);
+ 	goto no_context;
+--- linux-2.6.22/arch/sparc64/Kconfig	2007-07-09 13:18:06 +0200
++++ linux-2.6.22-vs2.2.0-rc5/arch/sparc64/Kconfig	2007-06-17 05:54:16 +0200
+@@ -451,6 +451,8 @@ endmenu
+ 
+ source "arch/sparc64/Kconfig.debug"
+ 
++source "kernel/vserver/Kconfig"
++
+ source "security/Kconfig"
+ 
+ source "crypto/Kconfig"
+--- linux-2.6.22/arch/sparc64/kernel/binfmt_aout32.c	2007-02-06 03:00:18 +0100
++++ linux-2.6.22-vs2.2.0-rc5/arch/sparc64/kernel/binfmt_aout32.c	2007-06-15 02:37:03 +0200
+@@ -27,6 +27,7 @@
+ #include <linux/binfmts.h>
+ #include <linux/personality.h>
+ #include <linux/init.h>
++#include <linux/vs_memory.h>
+ 
+ #include <asm/system.h>
+ #include <asm/uaccess.h>
+--- linux-2.6.22/arch/sparc64/kernel/process.c	2007-07-09 13:18:06 +0200
++++ linux-2.6.22-vs2.2.0-rc5/arch/sparc64/kernel/process.c	2007-06-15 02:37:03 +0200
+@@ -707,7 +707,8 @@ pid_t kernel_thread(int (*fn)(void *), v
+ 			     /* Notreached by child. */
+ 			     "1:" :
+ 			     "=r" (retval) :
+-			     "i" (__NR_clone), "r" (flags | CLONE_VM | CLONE_UNTRACED),
++			     "i" (__NR_clone), "r" (flags |
++				CLONE_VM | CLONE_UNTRACED | CLONE_KTHREAD),
+ 			     "i" (__NR_exit),  "r" (fn), "r" (arg) :
+ 			     "g1", "g2", "g3", "o0", "o1", "memory", "cc");
+ 	return retval;
+--- linux-2.6.22/arch/sparc64/kernel/ptrace.c	2007-02-06 03:00:18 +0100
++++ linux-2.6.22-vs2.2.0-rc5/arch/sparc64/kernel/ptrace.c	2007-06-15 02:37:03 +0200
+@@ -22,6 +22,7 @@
+ #include <linux/seccomp.h>
+ #include <linux/audit.h>
+ #include <linux/signal.h>
++#include <linux/vs_base.h>
+ 
+ #include <asm/asi.h>
+ #include <asm/pgtable.h>
+@@ -215,6 +216,10 @@ asmlinkage void do_ptrace(struct pt_regs
+ 		pt_error_return(regs, -ret);
+ 		goto out;
+ 	}
++	if (!vx_check(vx_task_xid(child), VS_WATCH_P | VS_IDENT)) {
++		pt_error_return(regs, ESRCH);
++		goto out_tsk;
++	}
+ 
+ 	if ((current->personality == PER_SUNOS && request == PTRACE_SUNATTACH)
+ 	    || (current->personality != PER_SUNOS && request == PTRACE_ATTACH)) {
+--- linux-2.6.22/arch/sparc64/kernel/sys_sparc32.c	2007-07-09 13:18:06 +0200
++++ linux-2.6.22-vs2.2.0-rc5/arch/sparc64/kernel/sys_sparc32.c	2007-06-15 02:37:03 +0200
+@@ -729,7 +729,7 @@ asmlinkage long sys32_gettimeofday(struc
+ {
+ 	if (tv) {
+ 		struct timeval ktv;
+-		do_gettimeofday(&ktv);
++		vx_gettimeofday(&ktv);
+ 		if (put_tv32(tv, &ktv))
+ 			return -EFAULT;
+ 	}
+--- linux-2.6.22/arch/sparc64/kernel/systbls.S	2007-07-09 13:18:06 +0200
++++ linux-2.6.22-vs2.2.0-rc5/arch/sparc64/kernel/systbls.S	2007-06-15 02:37:03 +0200
+@@ -72,7 +72,7 @@ sys_call_table32:
+ /*250*/	.word sys32_mremap, sys32_sysctl, sys32_getsid, sys_fdatasync, sys32_nfsservctl
+ 	.word sys32_sync_file_range, compat_sys_clock_settime, compat_sys_clock_gettime, compat_sys_clock_getres, sys32_clock_nanosleep
+ /*260*/	.word compat_sys_sched_getaffinity, compat_sys_sched_setaffinity, sys32_timer_settime, compat_sys_timer_gettime, sys_timer_getoverrun
+-	.word sys_timer_delete, compat_sys_timer_create, sys_ni_syscall, compat_sys_io_setup, sys_io_destroy
++	.word sys_timer_delete, compat_sys_timer_create, sys32_vserver, compat_sys_io_setup, sys_io_destroy
+ /*270*/	.word sys32_io_submit, sys_io_cancel, compat_sys_io_getevents, sys32_mq_open, sys_mq_unlink
+ 	.word compat_sys_mq_timedsend, compat_sys_mq_timedreceive, compat_sys_mq_notify, compat_sys_mq_getsetattr, compat_sys_waitid
+ /*280*/	.word sys32_tee, sys_add_key, sys_request_key, sys_keyctl, compat_sys_openat
+@@ -144,7 +144,7 @@ sys_call_table:
+ /*250*/	.word sys64_mremap, sys_sysctl, sys_getsid, sys_fdatasync, sys_nfsservctl
+ 	.word sys_sync_file_range, sys_clock_settime, sys_clock_gettime, sys_clock_getres, sys_clock_nanosleep
+ /*260*/	.word sys_sched_getaffinity, sys_sched_setaffinity, sys_timer_settime, sys_timer_gettime, sys_timer_getoverrun
+-	.word sys_timer_delete, sys_timer_create, sys_ni_syscall, sys_io_setup, sys_io_destroy
++	.word sys_timer_delete, sys_timer_create, sys_vserver, sys_io_setup, sys_io_destroy
+ /*270*/	.word sys_io_submit, sys_io_cancel, sys_io_getevents, sys_mq_open, sys_mq_unlink
+ 	.word sys_mq_timedsend, sys_mq_timedreceive, sys_mq_notify, sys_mq_getsetattr, sys_waitid
+ /*280*/	.word sys_tee, sys_add_key, sys_request_key, sys_keyctl, sys_openat
+--- linux-2.6.22/arch/sparc64/kernel/traps.c	2007-07-09 13:18:06 +0200
++++ linux-2.6.22-vs2.2.0-rc5/arch/sparc64/kernel/traps.c	2007-06-15 02:37:03 +0200
+@@ -2221,7 +2221,8 @@ void die_if_kernel(char *str, struct pt_
+ "              /_| \\__/ |_\\\n"
+ "                 \\__U_/\n");
+ 
+-	printk("%s(%d): %s [#%d]\n", current->comm, current->pid, str, ++die_counter);
++	printk("%s(%d[#%u]): %s [#%d]\n", current->comm,
++		current->pid, current->xid, str, ++die_counter);
+ 	notify_die(DIE_OOPS, str, regs, 0, 255, SIGSEGV);
+ 	__asm__ __volatile__("flushw");
+ 	__show_regs(regs);
+--- linux-2.6.22/arch/sparc64/mm/fault.c	2007-07-09 13:18:06 +0200
++++ linux-2.6.22-vs2.2.0-rc5/arch/sparc64/mm/fault.c	2007-06-15 02:37:03 +0200
+@@ -466,7 +466,8 @@ handle_kernel_fault:
+ out_of_memory:
+ 	insn = get_fault_insn(regs, insn);
+ 	up_read(&mm->mmap_sem);
+-	printk("VM: killing process %s\n", current->comm);
++	printk("VM: killing process %s(%d:#%u)\n",
++		current->comm, current->pid, current->xid);
+ 	if (!(regs->tstate & TSTATE_PRIV))
+ 		do_exit(SIGKILL);
+ 	goto handle_kernel_fault;
+--- linux-2.6.22/arch/sparc64/solaris/fs.c	2007-02-06 03:00:21 +0100
++++ linux-2.6.22-vs2.2.0-rc5/arch/sparc64/solaris/fs.c	2007-06-15 02:37:03 +0200
+@@ -368,7 +368,7 @@ static int report_statvfs(struct vfsmoun
+ 		int j = strlen (p);
+ 		
+ 		if (j > 15) j = 15;
+-		if (IS_RDONLY(inode)) i = 1;
++		if (IS_RDONLY(inode) || MNT_IS_RDONLY(mnt)) i = 1;
+ 		if (mnt->mnt_flags & MNT_NOSUID) i |= 2;
+ 		if (!sysv_valid_dev(inode->i_sb->s_dev))
+ 			return -EOVERFLOW;
+@@ -404,7 +404,7 @@ static int report_statvfs64(struct vfsmo
+ 		int j = strlen (p);
+ 		
+ 		if (j > 15) j = 15;
+-		if (IS_RDONLY(inode)) i = 1;
++		if (IS_RDONLY(inode) || MNT_IS_RDONLY(mnt)) i = 1;
+ 		if (mnt->mnt_flags & MNT_NOSUID) i |= 2;
+ 		if (!sysv_valid_dev(inode->i_sb->s_dev))
+ 			return -EOVERFLOW;
+--- linux-2.6.22/arch/um/Kconfig	2007-07-09 13:18:07 +0200
++++ linux-2.6.22-vs2.2.0-rc5/arch/um/Kconfig	2007-06-17 05:54:16 +0200
+@@ -316,6 +316,8 @@ source "drivers/connector/Kconfig"
+ 
+ source "fs/Kconfig"
+ 
++source "kernel/vserver/Kconfig"
++
+ source "security/Kconfig"
+ 
+ source "crypto/Kconfig"
+--- linux-2.6.22/arch/um/kernel/trap.c	2007-07-09 13:18:07 +0200
++++ linux-2.6.22-vs2.2.0-rc5/arch/um/kernel/trap.c	2007-06-15 02:37:03 +0200
+@@ -210,7 +210,8 @@ unsigned long segv(struct faultinfo fi, 
+ 		current->thread.arch.faultinfo = fi;
+ 		force_sig_info(SIGBUS, &si, current);
+ 	} else if (err == -ENOMEM) {
+-		printk("VM: killing process %s\n", current->comm);
++		printk("VM: killing process %s(%d:#%u)\n",
++			current->comm, current->pid, current->xid);
+ 		do_exit(SIGKILL);
+ 	} else {
+ 		BUG_ON(err != -EFAULT);
+--- linux-2.6.22/arch/v850/Kconfig	2007-07-09 13:18:08 +0200
++++ linux-2.6.22-vs2.2.0-rc5/arch/v850/Kconfig	2007-06-15 02:37:03 +0200
+@@ -333,6 +333,8 @@ source "drivers/usb/Kconfig"
+ 
+ source "arch/v850/Kconfig.debug"
+ 
++source "kernel/vserver/Kconfig"
++
+ source "security/Kconfig"
+ 
+ source "crypto/Kconfig"
+--- linux-2.6.22/arch/v850/kernel/process.c	2007-07-09 13:18:08 +0200
++++ linux-2.6.22-vs2.2.0-rc5/arch/v850/kernel/process.c	2007-06-15 02:37:03 +0200
+@@ -82,7 +82,7 @@ int kernel_thread (int (*fn)(void *), vo
+ 	/* Clone this thread.  Note that we don't pass the clone syscall's
+ 	   second argument -- it's ignored for calls from kernel mode (the
+ 	   child's SP is always set to the top of the kernel stack).  */
+-	arg0 = flags | CLONE_VM;
++	arg0 = flags | CLONE_VM | CLONE_KTHREAD;
+ 	syscall = __NR_clone;
+ 	asm volatile ("trap " SYSCALL_SHORT_TRAP
+ 		      : "=r" (ret), "=r" (syscall)
+--- linux-2.6.22/arch/v850/kernel/ptrace.c	2007-07-09 13:18:08 +0200
++++ linux-2.6.22-vs2.2.0-rc5/arch/v850/kernel/ptrace.c	2007-06-15 02:37:03 +0200
+@@ -23,6 +23,7 @@
+ #include <linux/sched.h>
+ #include <linux/ptrace.h>
+ #include <linux/signal.h>
++#include <linux/vs_base.h>
+ 
+ #include <asm/errno.h>
+ #include <asm/ptrace.h>
+@@ -116,6 +117,9 @@ long arch_ptrace(struct task_struct *chi
+ {
+ 	int rval;
+ 
++	if (!vx_check(vx_task_xid(child), VS_WATCH_P | VS_IDENT))
++		goto out;
++
+ 	switch (request) {
+ 		unsigned long val, copied;
+ 
+--- linux-2.6.22/arch/x86_64/Kconfig	2007-07-09 13:18:08 +0200
++++ linux-2.6.22-vs2.2.0-rc5/arch/x86_64/Kconfig	2007-06-15 02:37:03 +0200
+@@ -782,6 +782,8 @@ endmenu
+ 
+ source "arch/x86_64/Kconfig.debug"
+ 
++source "kernel/vserver/Kconfig"
++
+ source "security/Kconfig"
+ 
+ source "crypto/Kconfig"
+--- linux-2.6.22/arch/x86_64/ia32/ia32_aout.c	2007-02-06 03:00:21 +0100
++++ linux-2.6.22-vs2.2.0-rc5/arch/x86_64/ia32/ia32_aout.c	2007-06-15 02:37:03 +0200
+@@ -25,6 +25,7 @@
+ #include <linux/binfmts.h>
+ #include <linux/personality.h>
+ #include <linux/init.h>
++#include <linux/vs_memory.h>
+ 
+ #include <asm/system.h>
+ #include <asm/uaccess.h>
+--- linux-2.6.22/arch/x86_64/ia32/ia32_binfmt.c	2007-07-09 13:18:08 +0200
++++ linux-2.6.22-vs2.2.0-rc5/arch/x86_64/ia32/ia32_binfmt.c	2007-06-15 02:37:03 +0200
+@@ -324,7 +324,8 @@ int ia32_setup_arg_pages(struct linux_bi
+ 			kmem_cache_free(vm_area_cachep, mpnt);
+ 			return ret;
+ 		}
+-		mm->stack_vm = mm->total_vm = vma_pages(mpnt);
++		vx_vmpages_sub(mm, mm->total_vm - vma_pages(mpnt));
++		mm->stack_vm = mm->total_vm;
+ 	} 
+ 
+ 	for (i = 0 ; i < MAX_ARG_PAGES ; i++) {
+--- linux-2.6.22/arch/x86_64/ia32/ia32entry.S	2007-07-09 13:18:08 +0200
++++ linux-2.6.22-vs2.2.0-rc5/arch/x86_64/ia32/ia32entry.S	2007-07-07 03:52:53 +0200
+@@ -668,7 +668,7 @@ ia32_sys_call_table:
+ 	.quad sys_tgkill		/* 270 */
+ 	.quad compat_sys_utimes
+ 	.quad sys32_fadvise64_64
+-	.quad quiet_ni_syscall	/* sys_vserver */
++	.quad sys32_vserver
+ 	.quad sys_mbind
+ 	.quad compat_sys_get_mempolicy	/* 275 */
+ 	.quad sys_set_mempolicy
+--- linux-2.6.22/arch/x86_64/ia32/sys_ia32.c	2007-07-09 13:18:08 +0200
++++ linux-2.6.22-vs2.2.0-rc5/arch/x86_64/ia32/sys_ia32.c	2007-07-07 03:52:53 +0200
+@@ -454,7 +454,7 @@ sys32_gettimeofday(struct compat_timeval
+ {
+ 	if (tv) {
+ 		struct timeval ktv;
+-		do_gettimeofday(&ktv);
++		vx_gettimeofday(&ktv);
+ 		if (put_tv32(tv, &ktv))
+ 			return -EFAULT;
+ 	}
+--- linux-2.6.22/arch/x86_64/ia32/syscall32.c	2007-07-09 13:18:08 +0200
++++ linux-2.6.22-vs2.2.0-rc5/arch/x86_64/ia32/syscall32.c	2007-06-15 02:37:03 +0200
+@@ -10,6 +10,7 @@
+ #include <linux/init.h>
+ #include <linux/stringify.h>
+ #include <linux/security.h>
++#include <linux/vs_memory.h>
+ #include <asm/proto.h>
+ #include <asm/tlbflush.h>
+ #include <asm/ia32_unistd.h>
+--- linux-2.6.22/arch/x86_64/kernel/process.c	2007-07-09 13:18:08 +0200
++++ linux-2.6.22-vs2.2.0-rc5/arch/x86_64/kernel/process.c	2007-06-15 02:37:03 +0200
+@@ -54,7 +54,8 @@
+ 
+ asmlinkage extern void ret_from_fork(void);
+ 
+-unsigned long kernel_thread_flags = CLONE_VM | CLONE_UNTRACED;
++unsigned long kernel_thread_flags =
++	CLONE_VM | CLONE_UNTRACED | CLONE_KTHREAD;
+ 
+ unsigned long boot_option_idle_override = 0;
+ EXPORT_SYMBOL(boot_option_idle_override);
+@@ -310,8 +311,8 @@ void __show_regs(struct pt_regs * regs)
+ 
+ 	printk("\n");
+ 	print_modules();
+-	printk("Pid: %d, comm: %.20s %s %s %.*s\n",
+-		current->pid, current->comm, print_tainted(),
++	printk("Pid: %d:#%u, comm: %.20s %s %s %.*s\n",
++		current->pid, current->xid, current->comm, print_tainted(),
+ 		init_utsname()->release,
+ 		(int)strcspn(init_utsname()->version, " "),
+ 		init_utsname()->version);
+--- linux-2.6.22/arch/x86_64/kernel/traps.c	2007-07-09 13:18:08 +0200
++++ linux-2.6.22-vs2.2.0-rc5/arch/x86_64/kernel/traps.c	2007-06-17 05:54:16 +0200
+@@ -413,8 +413,9 @@ void show_registers(struct pt_regs *regs
+ 	rsp = regs->rsp;
+ 	printk("CPU %d ", cpu);
+ 	__show_regs(regs);
+-	printk("Process %s (pid: %d, threadinfo %p, task %p)\n",
+-		cur->comm, cur->pid, task_thread_info(cur), cur);
++	printk("Process %s (pid: %d[#%u], threadinfo %p, task %p)\n",
++		cur->comm, cur->pid, cur->xid,
++		task_thread_info(cur), cur);
+ 
+ 	/*
+ 	 * When in-kernel, we also print out the stack and code at the
+@@ -580,8 +581,8 @@ static void __kprobes do_trap(int trapnr
+ 
+ 		if (exception_trace && unhandled_signal(tsk, signr))
+ 			printk(KERN_INFO
+-			       "%s[%d] trap %s rip:%lx rsp:%lx error:%lx\n",
+-			       tsk->comm, tsk->pid, str,
++			       "%s[%d:#%u] trap %s rip:%lx rsp:%lx error:%lx\n",
++			       tsk->comm, tsk->pid, tsk->xid, str,
+ 			       regs->rip, regs->rsp, error_code); 
+ 
+ 		if (info)
+@@ -684,8 +685,8 @@ asmlinkage void __kprobes do_general_pro
+ 
+ 		if (exception_trace && unhandled_signal(tsk, SIGSEGV))
+ 			printk(KERN_INFO
+-		       "%s[%d] general protection rip:%lx rsp:%lx error:%lx\n",
+-			       tsk->comm, tsk->pid,
++		       "%s[%d:#%u] general protection rip:%lx rsp:%lx error:%lx\n",
++			       tsk->comm, tsk->pid, tsk->xid,
+ 			       regs->rip, regs->rsp, error_code); 
+ 
+ 		force_sig(SIGSEGV, tsk);
+--- linux-2.6.22/arch/x86_64/mm/fault.c	2007-07-09 13:18:08 +0200
++++ linux-2.6.22-vs2.2.0-rc5/arch/x86_64/mm/fault.c	2007-06-17 05:54:16 +0200
+@@ -497,10 +497,10 @@ bad_area_nosemaphore:
+ 
+ 		if (exception_trace && unhandled_signal(tsk, SIGSEGV)) {
+ 			printk(
+-		       "%s%s[%d]: segfault at %016lx rip %016lx rsp %016lx error %lx\n",
++		       "%s%s[%d:#%u]: segfault at %016lx rip %016lx rsp %016lx error %lx\n",
+ 					tsk->pid > 1 ? KERN_INFO : KERN_EMERG,
+-					tsk->comm, tsk->pid, address, regs->rip,
+-					regs->rsp, error_code);
++					tsk->comm, tsk->pid, tsk->xid, address,
++					regs->rip, regs->rsp, error_code);
+ 		}
+        
+ 		tsk->thread.cr2 = address;
+@@ -567,7 +567,8 @@ out_of_memory:
+ 		yield();
+ 		goto again;
+ 	}
+-	printk("VM: killing process %s\n", tsk->comm);
++	printk("VM: killing process %s(%d:#%u)\n",
++		tsk->comm, tsk->pid, tsk->xid);
+ 	if (error_code & 4)
+ 		do_exit(SIGKILL);
+ 	goto no_context;
+--- linux-2.6.22/drivers/block/Kconfig	2007-07-09 13:18:16 +0200
++++ linux-2.6.22-vs2.2.0-rc5/drivers/block/Kconfig	2007-06-15 02:37:03 +0200
+@@ -311,6 +311,13 @@ config BLK_DEV_CRYPTOLOOP
+ 	  instead, which can be configured to be on-disk compatible with the
+ 	  cryptoloop device.
+ 
++config BLK_DEV_VROOT
++	tristate "Virtual Root device support"
++	depends on QUOTACTL
++	---help---
++	  Saying Y here will allow you to use quota/fs ioctls on a shared
++	  partition within a virtual server without compromising security.
++
+ config BLK_DEV_NBD
+ 	tristate "Network block device support"
+ 	depends on NET
+--- linux-2.6.22/drivers/block/Makefile	2007-02-06 03:00:26 +0100
++++ linux-2.6.22-vs2.2.0-rc5/drivers/block/Makefile	2007-06-15 02:37:03 +0200
+@@ -28,4 +28,5 @@ obj-$(CONFIG_BLK_DEV_CRYPTOLOOP) += cryp
+ obj-$(CONFIG_VIODASD)		+= viodasd.o
+ obj-$(CONFIG_BLK_DEV_SX8)	+= sx8.o
+ obj-$(CONFIG_BLK_DEV_UB)	+= ub.o
++obj-$(CONFIG_BLK_DEV_VROOT)	+= vroot.o
+ 
+--- linux-2.6.22/drivers/block/loop.c	2007-07-09 13:18:16 +0200
++++ linux-2.6.22-vs2.2.0-rc5/drivers/block/loop.c	2007-06-17 05:54:16 +0200
+@@ -74,6 +74,7 @@
+ #include <linux/highmem.h>
+ #include <linux/gfp.h>
+ #include <linux/kthread.h>
++#include <linux/vs_context.h>
+ 
+ #include <asm/uaccess.h>
+ 
+@@ -790,6 +791,7 @@ static int loop_set_fd(struct loop_devic
+ 	lo->lo_blocksize = lo_blocksize;
+ 	lo->lo_device = bdev;
+ 	lo->lo_flags = lo_flags;
++	lo->lo_xid = vx_current_xid();
+ 	lo->lo_backing_file = file;
+ 	lo->transfer = transfer_none;
+ 	lo->ioctl = NULL;
+@@ -930,7 +932,7 @@ loop_set_status(struct loop_device *lo, 
+ 	struct loop_func_table *xfer;
+ 
+ 	if (lo->lo_encrypt_key_size && lo->lo_key_owner != current->uid &&
+-	    !capable(CAP_SYS_ADMIN))
++	    !vx_capable(CAP_SYS_ADMIN, VXC_ADMIN_CLOOP))
+ 		return -EPERM;
+ 	if (lo->lo_state != Lo_bound)
+ 		return -ENXIO;
+@@ -1010,7 +1012,8 @@ loop_get_status(struct loop_device *lo, 
+ 	memcpy(info->lo_crypt_name, lo->lo_crypt_name, LO_NAME_SIZE);
+ 	info->lo_encrypt_type =
+ 		lo->lo_encryption ? lo->lo_encryption->number : 0;
+-	if (lo->lo_encrypt_key_size && capable(CAP_SYS_ADMIN)) {
++	if (lo->lo_encrypt_key_size &&
++		vx_capable(CAP_SYS_ADMIN, VXC_ADMIN_CLOOP)) {
+ 		info->lo_encrypt_key_size = lo->lo_encrypt_key_size;
+ 		memcpy(info->lo_encrypt_key, lo->lo_encrypt_key,
+ 		       lo->lo_encrypt_key_size);
+@@ -1321,6 +1324,9 @@ static int lo_open(struct inode *inode, 
+ {
+ 	struct loop_device *lo = inode->i_bdev->bd_disk->private_data;
+ 
++	if (!vx_check(lo->lo_xid, VS_IDENT|VS_HOSTID))
++		return -EACCES;
++
+ 	mutex_lock(&lo->lo_ctl_mutex);
+ 	lo->lo_refcnt++;
+ 	mutex_unlock(&lo->lo_ctl_mutex);
+--- linux-2.6.22/drivers/block/vroot.c	1970-01-01 01:00:00 +0100
++++ linux-2.6.22-vs2.2.0-rc5/drivers/block/vroot.c	2007-06-15 02:37:03 +0200
+@@ -0,0 +1,281 @@
++/*
++ *  linux/drivers/block/vroot.c
++ *
++ *  written by Herbert Pötzl, 9/11/2002
++ *  ported to 2.6.10 by Herbert Pötzl, 30/12/2004
++ *
++ *  based on the loop.c code by Theodore Ts'o.
++ *
++ * Copyright (C) 2002-2007 by Herbert Pötzl.
++ * Redistribution of this file is permitted under the
++ * GNU General Public License.
++ *
++ */
++
++#include <linux/module.h>
++#include <linux/moduleparam.h>
++#include <linux/file.h>
++#include <linux/major.h>
++#include <linux/blkdev.h>
++
++#include <linux/vroot.h>
++#include <linux/vs_context.h>
++
++
++static int max_vroot = 8;
++
++static struct vroot_device *vroot_dev;
++static struct gendisk **disks;
++
++
++static int vroot_set_dev(
++	struct vroot_device *vr,
++	struct file *vr_file,
++	struct block_device *bdev,
++	unsigned int arg)
++{
++	struct block_device *real_bdev;
++	struct file *file;
++	struct inode *inode;
++	int error;
++
++	error = -EBUSY;
++	if (vr->vr_state != Vr_unbound)
++		goto out;
++
++	error = -EBADF;
++	file = fget(arg);
++	if (!file)
++		goto out;
++
++	error = -EINVAL;
++	inode = file->f_dentry->d_inode;
++
++
++	if (S_ISBLK(inode->i_mode)) {
++		real_bdev = inode->i_bdev;
++		vr->vr_device = real_bdev;
++		__iget(real_bdev->bd_inode);
++	} else
++		goto out_fput;
++
++	vxdprintk(VXD_CBIT(misc, 0),
++		"vroot[%d]_set_dev: dev=" VXF_DEV,
++		vr->vr_number, VXD_DEV(real_bdev));
++
++	vr->vr_state = Vr_bound;
++	error = 0;
++
++ out_fput:
++	fput(file);
++ out:
++	return error;
++}
++
++static int vroot_clr_dev(
++	struct vroot_device *vr,
++	struct file *vr_file,
++	struct block_device *bdev)
++{
++	struct block_device *real_bdev;
++
++	if (vr->vr_state != Vr_bound)
++		return -ENXIO;
++	if (vr->vr_refcnt > 1)	/* we needed one fd for the ioctl */
++		return -EBUSY;
++
++	real_bdev = vr->vr_device;
++
++	vxdprintk(VXD_CBIT(misc, 0),
++		"vroot[%d]_clr_dev: dev=" VXF_DEV,
++		vr->vr_number, VXD_DEV(real_bdev));
++
++	bdput(real_bdev);
++	vr->vr_state = Vr_unbound;
++	vr->vr_device = NULL;
++	return 0;
++}
++
++
++static int vr_ioctl(struct inode *inode, struct file *file,
++	unsigned int cmd, unsigned long arg)
++{
++	struct vroot_device *vr = inode->i_bdev->bd_disk->private_data;
++	int err;
++
++	down(&vr->vr_ctl_mutex);
++	switch (cmd) {
++	case VROOT_SET_DEV:
++		err = vroot_set_dev(vr, file, inode->i_bdev, arg);
++		break;
++	case VROOT_CLR_DEV:
++		err = vroot_clr_dev(vr, file, inode->i_bdev);
++		break;
++	default:
++		err = -EINVAL;
++		break;
++	}
++	up(&vr->vr_ctl_mutex);
++	return err;
++}
++
++static int vr_open(struct inode *inode, struct file *file)
++{
++	struct vroot_device *vr = inode->i_bdev->bd_disk->private_data;
++
++	down(&vr->vr_ctl_mutex);
++	vr->vr_refcnt++;
++	up(&vr->vr_ctl_mutex);
++	return 0;
++}
++
++static int vr_release(struct inode *inode, struct file *file)
++{
++	struct vroot_device *vr = inode->i_bdev->bd_disk->private_data;
++
++	down(&vr->vr_ctl_mutex);
++	--vr->vr_refcnt;
++	up(&vr->vr_ctl_mutex);
++	return 0;
++}
++
++static struct block_device_operations vr_fops = {
++	.owner =	THIS_MODULE,
++	.open =		vr_open,
++	.release =	vr_release,
++	.ioctl =	vr_ioctl,
++};
++
++struct block_device *__vroot_get_real_bdev(struct block_device *bdev)
++{
++	struct inode *inode = bdev->bd_inode;
++	struct vroot_device *vr;
++	struct block_device *real_bdev;
++	int minor = iminor(inode);
++
++	vr = &vroot_dev[minor];
++	real_bdev = vr->vr_device;
++
++	vxdprintk(VXD_CBIT(misc, 0),
++		"vroot[%d]_get_real_bdev: dev=" VXF_DEV,
++		vr->vr_number, VXD_DEV(real_bdev));
++
++	if (vr->vr_state != Vr_bound)
++		return ERR_PTR(-ENXIO);
++
++	__iget(real_bdev->bd_inode);
++	return real_bdev;
++}
++
++/*
++ * And now the modules code and kernel interface.
++ */
++
++module_param(max_vroot, int, 0);
++
++MODULE_PARM_DESC(max_vroot, "Maximum number of vroot devices (1-256)");
++MODULE_LICENSE("GPL");
++MODULE_ALIAS_BLOCKDEV_MAJOR(VROOT_MAJOR);
++
++MODULE_AUTHOR ("Herbert Pötzl");
++MODULE_DESCRIPTION ("Virtual Root Device Mapper");
++
++
++int __init vroot_init(void)
++{
++	int err, i;
++
++	if (max_vroot < 1 || max_vroot > 256) {
++		max_vroot = MAX_VROOT_DEFAULT;
++		printk(KERN_WARNING "vroot: invalid max_vroot "
++			"(must be between 1 and 256), "
++			"using default (%d)\n", max_vroot);
++	}
++
++	if (register_blkdev(VROOT_MAJOR, "vroot"))
++		return -EIO;
++
++	err = -ENOMEM;
++	vroot_dev = kmalloc(max_vroot * sizeof(struct vroot_device), GFP_KERNEL);
++	if (!vroot_dev)
++		goto out_mem1;
++	memset(vroot_dev, 0, max_vroot * sizeof(struct vroot_device));
++
++	disks = kmalloc(max_vroot * sizeof(struct gendisk *), GFP_KERNEL);
++	if (!disks)
++		goto out_mem2;
++
++	for (i = 0; i < max_vroot; i++) {
++		disks[i] = alloc_disk(1);
++		if (!disks[i])
++			goto out_mem3;
++	}
++
++	for (i = 0; i < max_vroot; i++) {
++		struct vroot_device *vr = &vroot_dev[i];
++		struct gendisk *disk = disks[i];
++
++		memset(vr, 0, sizeof(*vr));
++		init_MUTEX(&vr->vr_ctl_mutex);
++		vr->vr_number = i;
++		disk->major = VROOT_MAJOR;
++		disk->first_minor = i;
++		disk->fops = &vr_fops;
++		sprintf(disk->disk_name, "vroot%d", i);
++		disk->private_data = vr;
++	}
++
++	err = register_vroot_grb(&__vroot_get_real_bdev);
++	if (err)
++		goto out_mem3;
++
++	for (i = 0; i < max_vroot; i++)
++		add_disk(disks[i]);
++	printk(KERN_INFO "vroot: loaded (max %d devices)\n", max_vroot);
++	return 0;
++
++out_mem3:
++	while (i--)
++		put_disk(disks[i]);
++	kfree(disks);
++out_mem2:
++	kfree(vroot_dev);
++out_mem1:
++	unregister_blkdev(VROOT_MAJOR, "vroot");
++	printk(KERN_ERR "vroot: ran out of memory\n");
++	return err;
++}
++
++void vroot_exit(void)
++{
++	int i;
++
++	if (unregister_vroot_grb(&__vroot_get_real_bdev))
++		printk(KERN_WARNING "vroot: cannot unregister grb\n");
++
++	for (i = 0; i < max_vroot; i++) {
++		del_gendisk(disks[i]);
++		put_disk(disks[i]);
++	}
++	if (unregister_blkdev(VROOT_MAJOR, "vroot"))
++		printk(KERN_WARNING "vroot: cannot unregister blkdev\n");
++
++	kfree(disks);
++	kfree(vroot_dev);
++}
++
++module_init(vroot_init);
++module_exit(vroot_exit);
++
++#ifndef MODULE
++
++static int __init max_vroot_setup(char *str)
++{
++	max_vroot = simple_strtol(str, NULL, 0);
++	return 1;
++}
++
++__setup("max_vroot=", max_vroot_setup);
++
++#endif
++
+--- linux-2.6.22/drivers/char/sysrq.c	2007-07-09 13:18:20 +0200
++++ linux-2.6.22-vs2.2.0-rc5/drivers/char/sysrq.c	2007-06-15 02:37:03 +0200
+@@ -36,6 +36,7 @@
+ #include <linux/kexec.h>
+ #include <linux/irq.h>
+ #include <linux/hrtimer.h>
++#include <linux/vserver/debug.h>
+ 
+ #include <asm/ptrace.h>
+ #include <asm/irq_regs.h>
+@@ -309,6 +310,21 @@ static struct sysrq_key_op sysrq_unrt_op
+ 	.enable_mask	= SYSRQ_ENABLE_RTNICE,
+ };
+ 
++
++#ifdef CONFIG_VSERVER_DEBUG
++static void sysrq_handle_vxinfo(int key, struct tty_struct *tty)
++{
++	dump_vx_info_inactive((key == 'x')?0:1);
++}
++
++static struct sysrq_key_op sysrq_showvxinfo_op = {
++	.handler	= sysrq_handle_vxinfo,
++	.help_msg	= "conteXt",
++	.action_msg	= "Show Context Info",
++	.enable_mask	= SYSRQ_ENABLE_DUMP,
++};
++#endif
++
+ /* Key Operations table and lock */
+ static DEFINE_SPINLOCK(sysrq_key_table_lock);
+ 
+@@ -357,7 +373,11 @@ static struct sysrq_key_op *sysrq_key_ta
+ 	/* x: May be registered on ppc/powerpc for xmon */
+ 	NULL,				/* x */
+ 	NULL,				/* y */
+-	NULL				/* z */
++#ifdef CONFIG_VSERVER_DEBUG
++	&sysrq_showvxinfo_op,		/* z */
++#else
++	NULL,				/* z */
++#endif
+ };
+ 
+ /* key2index calculation, -1 on invalid index */
+@@ -369,6 +389,8 @@ static int sysrq_key_table_key2index(int
+ 		retval = key - '0';
+ 	else if ((key >= 'a') && (key <= 'z'))
+ 		retval = key + 10 - 'a';
++	else if ((key >= 'A') && (key <= 'Z'))
++		retval = key + 10 - 'A';
+ 	else
+ 		retval = -1;
+ 	return retval;
+--- linux-2.6.22/drivers/char/tty_io.c	2007-07-09 13:18:20 +0200
++++ linux-2.6.22-vs2.2.0-rc5/drivers/char/tty_io.c	2007-06-17 05:54:17 +0200
+@@ -103,6 +103,7 @@
+ #include <linux/selection.h>
+ 
+ #include <linux/kmod.h>
++#include <linux/vs_pid.h>
+ 
+ #undef TTY_DEBUG_HANGUP
+ 
+@@ -191,6 +192,7 @@ static inline void free_tty_struct(struc
+ {
+ 	kfree(tty->write_buf);
+ 	tty_buffer_free_all(tty);
++	memset(tty, 0xDEADDEAD, sizeof(struct tty_struct));
+ 	kfree(tty);
+ }
+ 
+@@ -3049,13 +3051,15 @@ unlock:
+ 
+ static int tiocgpgrp(struct tty_struct *tty, struct tty_struct *real_tty, pid_t __user *p)
+ {
++	pid_t pgrp;
+ 	/*
+ 	 * (tty == real_tty) is a cheap way of
+ 	 * testing if the tty is NOT a master pty.
+ 	 */
+ 	if (tty == real_tty && current->signal->tty != real_tty)
+ 		return -ENOTTY;
+-	return put_user(pid_nr(real_tty->pgrp), p);
++	pgrp = vx_map_pid(pid_nr(real_tty->pgrp));
++	return put_user(pgrp, p);
+ }
+ 
+ /**
+@@ -3086,6 +3090,7 @@ static int tiocspgrp(struct tty_struct *
+ 		return -ENOTTY;
+ 	if (get_user(pgrp_nr, p))
+ 		return -EFAULT;
++	pgrp_nr = vx_rmap_pid(pgrp_nr);
+ 	if (pgrp_nr < 0)
+ 		return -EINVAL;
+ 	rcu_read_lock();
+@@ -3910,6 +3915,9 @@ EXPORT_SYMBOL(tty_unregister_driver);
+ 
+ dev_t tty_devnum(struct tty_struct *tty)
+ {
++	WARN_ON(!tty);
++	WARN_ON(!tty->magic);
++	WARN_ON(!tty->driver);
+ 	return MKDEV(tty->driver->major, tty->driver->minor_start) + tty->index;
+ }
+ EXPORT_SYMBOL(tty_devnum);
+--- linux-2.6.22/drivers/infiniband/hw/ipath/ipath_user_pages.c	2007-02-06 03:00:37 +0100
++++ linux-2.6.22-vs2.2.0-rc5/drivers/infiniband/hw/ipath/ipath_user_pages.c	2007-06-15 02:37:03 +0200
+@@ -33,6 +33,7 @@
+ 
+ #include <linux/mm.h>
+ #include <linux/device.h>
++#include <linux/vs_memory.h>
+ 
+ #include "ipath_kernel.h"
+ 
+@@ -61,7 +62,8 @@ static int __get_user_pages(unsigned lon
+ 	lock_limit = current->signal->rlim[RLIMIT_MEMLOCK].rlim_cur >>
+ 		PAGE_SHIFT;
+ 
+-	if (num_pages > lock_limit) {
++	if (num_pages > lock_limit ||
++		!vx_vmlocked_avail(current->mm, num_pages)) {
+ 		ret = -ENOMEM;
+ 		goto bail;
+ 	}
+@@ -78,7 +80,7 @@ static int __get_user_pages(unsigned lon
+ 			goto bail_release;
+ 	}
+ 
+-	current->mm->locked_vm += num_pages;
++	vx_vmlocked_add(current->mm, num_pages);
+ 
+ 	ret = 0;
+ 	goto bail;
+@@ -203,7 +205,7 @@ void ipath_release_user_pages(struct pag
+ 
+ 	__ipath_release_user_pages(p, num_pages, 1);
+ 
+-	current->mm->locked_vm -= num_pages;
++	vx_vmlocked_sub(current->mm, num_pages);
+ 
+ 	up_write(&current->mm->mmap_sem);
+ }
+@@ -220,7 +222,7 @@ static void user_pages_account(struct wo
+ 		container_of(_work, struct ipath_user_pages_work, work);
+ 
+ 	down_write(&work->mm->mmap_sem);
+-	work->mm->locked_vm -= work->num_pages;
++	vx_vmlocked_sub(work->mm, work->num_pages);
+ 	up_write(&work->mm->mmap_sem);
+ 	mmput(work->mm);
+ 	kfree(work);
+--- linux-2.6.22/drivers/md/dm-ioctl.c	2007-05-02 19:24:50 +0200
++++ linux-2.6.22-vs2.2.0-rc5/drivers/md/dm-ioctl.c	2007-06-15 02:37:03 +0200
+@@ -15,6 +15,7 @@
+ #include <linux/slab.h>
+ #include <linux/dm-ioctl.h>
+ #include <linux/hdreg.h>
++#include <linux/vs_context.h>
+ 
+ #include <asm/uaccess.h>
+ 
+@@ -100,7 +101,8 @@ static struct hash_cell *__get_name_cell
+ 	unsigned int h = hash_str(str);
+ 
+ 	list_for_each_entry (hc, _name_buckets + h, name_list)
+-		if (!strcmp(hc->name, str)) {
++		if (vx_check(dm_get_xid(hc->md), VS_WATCH_P | VS_IDENT) &&
++			!strcmp(hc->name, str)) {
+ 			dm_get(hc->md);
+ 			return hc;
+ 		}
+@@ -114,7 +116,8 @@ static struct hash_cell *__get_uuid_cell
+ 	unsigned int h = hash_str(str);
+ 
+ 	list_for_each_entry (hc, _uuid_buckets + h, uuid_list)
+-		if (!strcmp(hc->uuid, str)) {
++		if (vx_check(dm_get_xid(hc->md), VS_WATCH_P | VS_IDENT) &&
++			!strcmp(hc->uuid, str)) {
+ 			dm_get(hc->md);
+ 			return hc;
+ 		}
+@@ -349,6 +352,9 @@ typedef int (*ioctl_fn)(struct dm_ioctl 
+ 
+ static int remove_all(struct dm_ioctl *param, size_t param_size)
+ {
++	if (!vx_check(0, VS_ADMIN))
++		return -EPERM;
++
+ 	dm_hash_remove_all(1);
+ 	param->data_size = 0;
+ 	return 0;
+@@ -396,6 +402,8 @@ static int list_devices(struct dm_ioctl 
+ 	 */
+ 	for (i = 0; i < NUM_BUCKETS; i++) {
+ 		list_for_each_entry (hc, _name_buckets + i, name_list) {
++			if (!vx_check(dm_get_xid(hc->md), VS_WATCH_P | VS_IDENT))
++				continue;
+ 			needed += sizeof(struct dm_name_list);
+ 			needed += strlen(hc->name) + 1;
+ 			needed += ALIGN_MASK;
+@@ -419,6 +427,8 @@ static int list_devices(struct dm_ioctl 
+ 	 */
+ 	for (i = 0; i < NUM_BUCKETS; i++) {
+ 		list_for_each_entry (hc, _name_buckets + i, name_list) {
++			if (!vx_check(dm_get_xid(hc->md), VS_WATCH_P | VS_IDENT))
++				continue;
+ 			if (old_nl)
+ 				old_nl->next = (uint32_t) ((void *) nl -
+ 							   (void *) old_nl);
+@@ -609,10 +619,11 @@ static struct hash_cell *__find_device_h
+ 	if (!md)
+ 		goto out;
+ 
+-	mdptr = dm_get_mdptr(md);
++	if (vx_check(dm_get_xid(md), VS_WATCH_P | VS_IDENT))
++		mdptr = dm_get_mdptr(md);
++
+ 	if (!mdptr)
+ 		dm_put(md);
+-
+ out:
+ 	return mdptr;
+ }
+@@ -1409,8 +1420,8 @@ static int ctl_ioctl(struct inode *inode
+ 	ioctl_fn fn = NULL;
+ 	size_t param_size;
+ 
+-	/* only root can play with this */
+-	if (!capable(CAP_SYS_ADMIN))
++	/* only root and certain contexts can play with this */
++	if (!vx_capable(CAP_SYS_ADMIN, VXC_ADMIN_MAPPER))
+ 		return -EACCES;
+ 
+ 	if (_IOC_TYPE(command) != DM_IOCTL)
+--- linux-2.6.22/drivers/md/dm.c	2007-07-09 13:18:44 +0200
++++ linux-2.6.22-vs2.2.0-rc5/drivers/md/dm.c	2007-06-15 02:37:03 +0200
+@@ -21,6 +21,7 @@
+ #include <linux/hdreg.h>
+ #include <linux/blktrace_api.h>
+ #include <linux/smp_lock.h>
++#include <linux/vs_base.h>
+ 
+ #define DM_MSG_PREFIX "core"
+ 
+@@ -77,6 +78,7 @@ struct mapped_device {
+ 	rwlock_t map_lock;
+ 	atomic_t holders;
+ 	atomic_t open_count;
++	xid_t xid;
+ 
+ 	unsigned long flags;
+ 
+@@ -223,6 +225,7 @@ static void __exit dm_exit(void)
+ static int dm_blk_open(struct inode *inode, struct file *file)
+ {
+ 	struct mapped_device *md;
++	int ret = -ENXIO;
+ 
+ 	spin_lock(&_minor_lock);
+ 
+@@ -231,18 +234,19 @@ static int dm_blk_open(struct inode *ino
+ 		goto out;
+ 
+ 	if (test_bit(DMF_FREEING, &md->flags) ||
+-	    test_bit(DMF_DELETING, &md->flags)) {
+-		md = NULL;
++	    test_bit(DMF_DELETING, &md->flags))
++		goto out;
++
++	ret = -EACCES;
++	if (!vx_check(md->xid, VS_IDENT|VS_HOSTID))
+ 		goto out;
+-	}
+ 
+ 	dm_get(md);
+ 	atomic_inc(&md->open_count);
+-
++	ret = 0;
+ out:
+ 	spin_unlock(&_minor_lock);
+-
+-	return md ? 0 : -ENXIO;
++	return ret;
+ }
+ 
+ static int dm_blk_close(struct inode *inode, struct file *file)
+@@ -438,6 +442,14 @@ int dm_set_geometry(struct mapped_device
+ 	return 0;
+ }
+ 
++/*
++ * Get the xid associated with a dm device
++ */
++xid_t dm_get_xid(struct mapped_device *md)
++{
++	return md->xid;
++}
++
+ /*-----------------------------------------------------------------
+  * CRUD START:
+  *   A more elegant soln is in the works that uses the queue
+@@ -991,6 +1003,7 @@ static struct mapped_device *alloc_dev(i
+ 	atomic_set(&md->holders, 1);
+ 	atomic_set(&md->open_count, 0);
+ 	atomic_set(&md->event_nr, 0);
++	md->xid = vx_current_xid();
+ 
+ 	md->queue = blk_alloc_queue(GFP_KERNEL);
+ 	if (!md->queue)
+--- linux-2.6.22/drivers/md/dm.h	2007-02-06 03:00:41 +0100
++++ linux-2.6.22-vs2.2.0-rc5/drivers/md/dm.h	2007-06-15 02:37:03 +0200
+@@ -91,6 +91,8 @@ void dm_put_target_type(struct target_ty
+ int dm_target_iterate(void (*iter_func)(struct target_type *tt,
+ 					void *param), void *param);
+ 
++xid_t dm_get_xid(struct mapped_device *md);
++
+ /*-----------------------------------------------------------------
+  * Useful inlines.
+  *---------------------------------------------------------------*/
+--- linux-2.6.22/fs/attr.c	2007-07-09 13:19:22 +0200
++++ linux-2.6.22-vs2.2.0-rc5/fs/attr.c	2007-06-15 02:37:03 +0200
+@@ -14,6 +14,9 @@
+ #include <linux/fcntl.h>
+ #include <linux/quotaops.h>
+ #include <linux/security.h>
++#include <linux/proc_fs.h>
++#include <linux/devpts_fs.h>
++#include <linux/vs_base.h>
+ 
+ /* Taken over from the old code... */
+ 
+@@ -55,6 +58,30 @@ int inode_change_ok(struct inode *inode,
+ 		if (current->fsuid != inode->i_uid && !capable(CAP_FOWNER))
+ 			goto error;
+ 	}
++
++	/* Check for evil vserver activity */
++	if (vx_check(0, VS_ADMIN))
++		goto fine;
++
++	if (IS_BARRIER(inode)) {
++		vxwprintk(1, "xid=%d messing with the barrier.",
++			vx_current_xid());
++		goto error;
++	}
++	switch (inode->i_sb->s_magic) {
++		case PROC_SUPER_MAGIC:
++			/* maybe allow that in the future? */
++			vxwprintk(1, "xid=%d messing with the procfs.",
++				vx_current_xid());
++			goto error;
++		case DEVPTS_SUPER_MAGIC:
++			/* devpts is xid tagged */
++			if (vx_check((xid_t)inode->i_tag, VS_IDENT))
++				goto fine;
++			vxwprintk(1, "xid=%d messing with the devpts.",
++				vx_current_xid());
++			goto error;
++	}
+ fine:
+ 	retval = 0;
+ error:
+@@ -78,6 +105,8 @@ int inode_setattr(struct inode * inode, 
+ 		inode->i_uid = attr->ia_uid;
+ 	if (ia_valid & ATTR_GID)
+ 		inode->i_gid = attr->ia_gid;
++	if ((ia_valid & ATTR_TAG) && IS_TAGGED(inode))
++		inode->i_tag = attr->ia_tag;
+ 	if (ia_valid & ATTR_ATIME)
+ 		inode->i_atime = timespec_trunc(attr->ia_atime,
+ 						inode->i_sb->s_time_gran);
+@@ -152,7 +181,8 @@ int notify_change(struct dentry * dentry
+ 			error = security_inode_setattr(dentry, attr);
+ 		if (!error) {
+ 			if ((ia_valid & ATTR_UID && attr->ia_uid != inode->i_uid) ||
+-			    (ia_valid & ATTR_GID && attr->ia_gid != inode->i_gid))
++			    (ia_valid & ATTR_GID && attr->ia_gid != inode->i_gid) ||
++			    (ia_valid & ATTR_TAG && attr->ia_tag != inode->i_tag))
+ 				error = DQUOT_TRANSFER(inode, attr) ? -EDQUOT : 0;
+ 			if (!error)
+ 				error = inode_setattr(inode, attr);
+--- linux-2.6.22/fs/binfmt_aout.c	2007-02-06 03:01:16 +0100
++++ linux-2.6.22-vs2.2.0-rc5/fs/binfmt_aout.c	2007-06-15 02:37:03 +0200
+@@ -24,6 +24,7 @@
+ #include <linux/binfmts.h>
+ #include <linux/personality.h>
+ #include <linux/init.h>
++#include <linux/vs_memory.h>
+ 
+ #include <asm/system.h>
+ #include <asm/uaccess.h>
+--- linux-2.6.22/fs/binfmt_elf.c	2007-07-09 13:19:22 +0200
++++ linux-2.6.22-vs2.2.0-rc5/fs/binfmt_elf.c	2007-07-09 13:11:54 +0200
+@@ -39,6 +39,7 @@
+ #include <linux/random.h>
+ #include <linux/elf.h>
+ #include <linux/utsname.h>
++#include <linux/vs_memory.h>
+ #include <asm/uaccess.h>
+ #include <asm/param.h>
+ #include <asm/page.h>
+--- linux-2.6.22/fs/binfmt_flat.c	2007-07-09 13:19:22 +0200
++++ linux-2.6.22-vs2.2.0-rc5/fs/binfmt_flat.c	2007-06-17 05:54:17 +0200
+@@ -36,6 +36,7 @@
+ #include <linux/init.h>
+ #include <linux/flat.h>
+ #include <linux/syscalls.h>
++#include <linux/vs_memory.h>
+ 
+ #include <asm/byteorder.h>
+ #include <asm/system.h>
+--- linux-2.6.22/fs/binfmt_som.c	2006-11-30 21:19:19 +0100
++++ linux-2.6.22-vs2.2.0-rc5/fs/binfmt_som.c	2007-06-15 02:37:03 +0200
+@@ -28,6 +28,7 @@
+ #include <linux/shm.h>
+ #include <linux/personality.h>
+ #include <linux/init.h>
++#include <linux/vs_memory.h>
+ 
+ #include <asm/a.out.h>
+ #include <asm/uaccess.h>
+--- linux-2.6.22/fs/dcache.c	2007-07-09 13:19:23 +0200
++++ linux-2.6.22-vs2.2.0-rc5/fs/dcache.c	2007-06-15 02:37:03 +0200
+@@ -31,6 +31,7 @@
+ #include <linux/seqlock.h>
+ #include <linux/swap.h>
+ #include <linux/bootmem.h>
++#include <linux/vs_limit.h>
+ #include "internal.h"
+ 
+ 
+@@ -176,6 +177,7 @@ void dput(struct dentry *dentry)
+ 	if (!dentry)
+ 		return;
+ 
++	vx_dentry_dec(dentry);
+ repeat:
+ 	if (atomic_read(&dentry->d_count) == 1)
+ 		might_sleep();
+@@ -189,6 +191,8 @@ repeat:
+ 		return;
+ 	}
+ 
++	vx_dentry_dec(dentry);
++
+ 	/*
+ 	 * AV: ->d_delete() is _NOT_ allowed to block now.
+ 	 */
+@@ -288,6 +292,7 @@ static inline struct dentry * __dget_loc
+ 	if (!list_empty(&dentry->d_lru)) {
+ 		dentry_stat.nr_unused--;
+ 		list_del_init(&dentry->d_lru);
++		vx_dentry_inc(dentry);
+ 	}
+ 	return dentry;
+ }
+@@ -898,6 +903,9 @@ struct dentry *d_alloc(struct dentry * p
+ 	struct dentry *dentry;
+ 	char *dname;
+ 
++	if (!vx_dentry_avail(1))
++		return NULL;
++
+ 	dentry = kmem_cache_alloc(dentry_cache, GFP_KERNEL); 
+ 	if (!dentry)
+ 		return NULL;
+@@ -946,6 +954,7 @@ struct dentry *d_alloc(struct dentry * p
+ 	if (parent)
+ 		list_add(&dentry->d_u.d_child, &parent->d_subdirs);
+ 	dentry_stat.nr_dentry++;
++	vx_dentry_inc(dentry);
+ 	spin_unlock(&dcache_lock);
+ 
+ 	return dentry;
+@@ -1295,6 +1304,7 @@ struct dentry * __d_lookup(struct dentry
+ 
+ 		if (!d_unhashed(dentry)) {
+ 			atomic_inc(&dentry->d_count);
++			vx_dentry_inc(dentry);
+ 			found = dentry;
+ 		}
+ 		spin_unlock(&dentry->d_lock);
+--- linux-2.6.22/fs/devpts/inode.c	2007-07-09 13:19:23 +0200
++++ linux-2.6.22-vs2.2.0-rc5/fs/devpts/inode.c	2007-06-15 02:41:30 +0200
+@@ -20,8 +20,22 @@
+ #include <linux/devpts_fs.h>
+ #include <linux/parser.h>
+ #include <linux/fsnotify.h>
++#include <linux/vs_base.h>
++
+ 
+-#define DEVPTS_SUPER_MAGIC 0x1cd1
++static int devpts_permission(struct inode *inode, int mask, struct nameidata *nd)
++{
++	int ret = -EACCES;
++
++	/* devpts is xid tagged */
++	if (vx_check((xid_t)inode->i_tag, VS_WATCH_P | VS_IDENT))
++		ret = generic_permission(inode, mask, NULL);
++	return ret;
++}
++
++static struct inode_operations devpts_file_inode_operations = {
++	.permission     = devpts_permission,
++};
+ 
+ static struct vfsmount *devpts_mnt;
+ static struct dentry *devpts_root;
+@@ -92,6 +106,25 @@ static int devpts_remount(struct super_b
+ 	return 0;
+ }
+ 
++static int devpts_filter(struct dentry *de)
++{
++	/* devpts is xid tagged */
++	return vx_check((xid_t)de->d_inode->i_tag, VS_WATCH_P | VS_IDENT);
++}
++
++static int devpts_readdir(struct file * filp, void * dirent, filldir_t filldir)
++{
++	return dcache_readdir_filter(filp, dirent, filldir, devpts_filter);
++}
++
++static struct file_operations devpts_dir_operations = {
++	.open		= dcache_dir_open,
++	.release	= dcache_dir_close,
++	.llseek		= dcache_dir_lseek,
++	.read		= generic_read_dir,
++	.readdir	= devpts_readdir,
++};
++
+ static const struct super_operations devpts_sops = {
+ 	.statfs		= simple_statfs,
+ 	.remount_fs	= devpts_remount,
+@@ -117,8 +150,10 @@ devpts_fill_super(struct super_block *s,
+ 	inode->i_uid = inode->i_gid = 0;
+ 	inode->i_mode = S_IFDIR | S_IRUGO | S_IXUGO | S_IWUSR;
+ 	inode->i_op = &simple_dir_inode_operations;
+-	inode->i_fop = &simple_dir_operations;
++	inode->i_fop = &devpts_dir_operations;
+ 	inode->i_nlink = 2;
++	/* devpts is xid tagged */
++	inode->i_tag = (tag_t)vx_current_xid();
+ 
+ 	devpts_root = s->s_root = d_alloc_root(inode);
+ 	if (s->s_root)
+@@ -176,6 +211,9 @@ int devpts_pty_new(struct tty_struct *tt
+ 	inode->i_gid = config.setgid ? config.gid : current->fsgid;
+ 	inode->i_mtime = inode->i_atime = inode->i_ctime = CURRENT_TIME;
+ 	init_special_inode(inode, S_IFCHR|config.mode, device);
++	/* devpts is xid tagged */
++	inode->i_tag = (tag_t)vx_current_xid();
++	inode->i_op = &devpts_file_inode_operations;
+ 	inode->i_private = tty;
+ 
+ 	dentry = get_node(number);
+--- linux-2.6.22/fs/ecryptfs/inode.c	2007-07-09 13:19:23 +0200
++++ linux-2.6.22-vs2.2.0-rc5/fs/ecryptfs/inode.c	2007-07-07 03:52:53 +0200
+@@ -423,7 +423,7 @@ static int ecryptfs_link(struct dentry *
+ 	dget(lower_new_dentry);
+ 	lower_dir_dentry = lock_parent(lower_new_dentry);
+ 	rc = vfs_link(lower_old_dentry, lower_dir_dentry->d_inode,
+-		      lower_new_dentry);
++		      lower_new_dentry, NULL);
+ 	if (rc || !lower_new_dentry->d_inode)
+ 		goto out_lock;
+ 	rc = ecryptfs_interpose(lower_new_dentry, new_dentry, dir->i_sb, 0);
+@@ -451,7 +451,7 @@ static int ecryptfs_unlink(struct inode 
+ 	struct inode *lower_dir_inode = ecryptfs_inode_to_lower(dir);
+ 
+ 	lock_parent(lower_dentry);
+-	rc = vfs_unlink(lower_dir_inode, lower_dentry);
++	rc = vfs_unlink(lower_dir_inode, lower_dentry, NULL);
+ 	if (rc) {
+ 		printk(KERN_ERR "Error in vfs_unlink; rc = [%d]\n", rc);
+ 		goto out_unlock;
+@@ -488,7 +488,7 @@ static int ecryptfs_symlink(struct inode
+ 		goto out_lock;
+ 	}
+ 	rc = vfs_symlink(lower_dir_dentry->d_inode, lower_dentry,
+-			 encoded_symname, mode);
++			 encoded_symname, mode, NULL);
+ 	kfree(encoded_symname);
+ 	if (rc || !lower_dentry->d_inode)
+ 		goto out_lock;
+@@ -513,7 +513,7 @@ static int ecryptfs_mkdir(struct inode *
+ 
+ 	lower_dentry = ecryptfs_dentry_to_lower(dentry);
+ 	lower_dir_dentry = lock_parent(lower_dentry);
+-	rc = vfs_mkdir(lower_dir_dentry->d_inode, lower_dentry, mode);
++	rc = vfs_mkdir(lower_dir_dentry->d_inode, lower_dentry, mode, NULL);
+ 	if (rc || !lower_dentry->d_inode)
+ 		goto out;
+ 	rc = ecryptfs_interpose(lower_dentry, dentry, dir->i_sb, 0);
+@@ -539,7 +539,7 @@ static int ecryptfs_rmdir(struct inode *
+ 	dget(dentry);
+ 	lower_dir_dentry = lock_parent(lower_dentry);
+ 	dget(lower_dentry);
+-	rc = vfs_rmdir(lower_dir_dentry->d_inode, lower_dentry);
++	rc = vfs_rmdir(lower_dir_dentry->d_inode, lower_dentry, NULL);
+ 	dput(lower_dentry);
+ 	if (!rc)
+ 		d_delete(lower_dentry);
+@@ -561,7 +561,7 @@ ecryptfs_mknod(struct inode *dir, struct
+ 
+ 	lower_dentry = ecryptfs_dentry_to_lower(dentry);
+ 	lower_dir_dentry = lock_parent(lower_dentry);
+-	rc = vfs_mknod(lower_dir_dentry->d_inode, lower_dentry, mode, dev);
++	rc = vfs_mknod(lower_dir_dentry->d_inode, lower_dentry, mode, dev, NULL);
+ 	if (rc || !lower_dentry->d_inode)
+ 		goto out;
+ 	rc = ecryptfs_interpose(lower_dentry, dentry, dir->i_sb, 0);
+--- linux-2.6.22/fs/exec.c	2007-07-09 13:19:23 +0200
++++ linux-2.6.22-vs2.2.0-rc5/fs/exec.c	2007-06-15 03:12:04 +0200
+@@ -51,6 +51,7 @@
+ #include <linux/cn_proc.h>
+ #include <linux/audit.h>
+ #include <linux/signalfd.h>
++#include <linux/vs_memory.h>
+ 
+ #include <asm/uaccess.h>
+ #include <asm/mmu_context.h>
+@@ -440,7 +441,8 @@ int setup_arg_pages(struct linux_binprm 
+ 			kmem_cache_free(vm_area_cachep, mpnt);
+ 			return ret;
+ 		}
+-		mm->stack_vm = mm->total_vm = vma_pages(mpnt);
++		vx_vmpages_sub(mm, mm->total_vm - vma_pages(mpnt));
++		mm->stack_vm = mm->total_vm;
+ 	}
+ 
+ 	for (i = 0 ; i < MAX_ARG_PAGES ; i++) {
+@@ -1336,7 +1338,7 @@ static int format_corename(char *corenam
+ 			/* UNIX time of coredump */
+ 			case 't': {
+ 				struct timeval tv;
+-				do_gettimeofday(&tv);
++				vx_gettimeofday(&tv);
+ 				rc = snprintf(out_ptr, out_end - out_ptr,
+ 					      "%lu", tv.tv_sec);
+ 				if (rc > out_end - out_ptr)
+--- linux-2.6.22/fs/ext2/balloc.c	2007-05-02 19:25:17 +0200
++++ linux-2.6.22-vs2.2.0-rc5/fs/ext2/balloc.c	2007-06-15 02:37:03 +0200
+@@ -16,6 +16,8 @@
+ #include <linux/sched.h>
+ #include <linux/buffer_head.h>
+ #include <linux/capability.h>
++#include <linux/vs_dlimit.h>
++#include <linux/vs_tag.h>
+ 
+ /*
+  * balloc.c contains the blocks allocation and deallocation routines
+@@ -102,12 +104,13 @@ static int reserve_blocks(struct super_b
+ {
+ 	struct ext2_sb_info *sbi = EXT2_SB(sb);
+ 	struct ext2_super_block *es = sbi->s_es;
+-	unsigned free_blocks;
+-	unsigned root_blocks;
++	unsigned long long free_blocks, root_blocks;
+ 
+ 	free_blocks = percpu_counter_read_positive(&sbi->s_freeblocks_counter);
+ 	root_blocks = le32_to_cpu(es->s_r_blocks_count);
+ 
++	DLIMIT_ADJUST_BLOCK(sb, dx_current_tag(), &free_blocks, &root_blocks);
++
+ 	if (free_blocks < count)
+ 		count = free_blocks;
+ 
+@@ -258,6 +261,7 @@ do_more:
+ 	}
+ error_return:
+ 	brelse(bitmap_bh);
++	DLIMIT_FREE_BLOCK(inode, freed);
+ 	release_blocks(sb, freed);
+ 	DQUOT_FREE_BLOCK(inode, freed);
+ }
+@@ -361,6 +365,10 @@ int ext2_new_block(struct inode *inode, 
+ 		*err = -ENOSPC;
+ 		goto out_dquot;
+ 	}
++	if (DLIMIT_ALLOC_BLOCK(inode, es_alloc)) {
++		*err = -ENOSPC;
++		goto out_dlimit;
++	}
+ 
+ 	ext2_debug ("goal=%lu.\n", goal);
+ 
+@@ -508,6 +516,8 @@ got_block:
+ 	*err = 0;
+ out_release:
+ 	group_release_blocks(sb, group_no, desc, gdp_bh, group_alloc);
++	DLIMIT_FREE_BLOCK(inode, es_alloc);
++out_dlimit:
+ 	release_blocks(sb, es_alloc);
+ out_dquot:
+ 	DQUOT_FREE_BLOCK(inode, dq_alloc);
+--- linux-2.6.22/fs/ext2/ext2.h	2007-07-09 13:19:23 +0200
++++ linux-2.6.22-vs2.2.0-rc5/fs/ext2/ext2.h	2007-06-15 02:37:03 +0200
+@@ -167,6 +167,7 @@ extern const struct file_operations ext2
+ extern const struct address_space_operations ext2_aops;
+ extern const struct address_space_operations ext2_aops_xip;
+ extern const struct address_space_operations ext2_nobh_aops;
++extern int ext2_sync_flags(struct inode *inode);
+ 
+ /* namei.c */
+ extern const struct inode_operations ext2_dir_inode_operations;
+--- linux-2.6.22/fs/ext2/file.c	2007-05-02 19:25:17 +0200
++++ linux-2.6.22-vs2.2.0-rc5/fs/ext2/file.c	2007-06-15 02:37:03 +0200
+@@ -54,6 +54,7 @@ const struct file_operations ext2_file_o
+ 	.release	= ext2_release_file,
+ 	.fsync		= ext2_sync_file,
+ 	.sendfile	= generic_file_sendfile,
++	.sendpage	= generic_file_sendpage,
+ 	.splice_read	= generic_file_splice_read,
+ 	.splice_write	= generic_file_splice_write,
+ };
+@@ -85,4 +86,5 @@ const struct inode_operations ext2_file_
+ #endif
+ 	.setattr	= ext2_setattr,
+ 	.permission	= ext2_permission,
++	.sync_flags	= ext2_sync_flags,
+ };
+--- linux-2.6.22/fs/ext2/ialloc.c	2006-11-30 21:19:19 +0100
++++ linux-2.6.22-vs2.2.0-rc5/fs/ext2/ialloc.c	2007-06-15 02:37:03 +0200
+@@ -17,6 +17,8 @@
+ #include <linux/backing-dev.h>
+ #include <linux/buffer_head.h>
+ #include <linux/random.h>
++#include <linux/vs_dlimit.h>
++#include <linux/vs_tag.h>
+ #include "ext2.h"
+ #include "xattr.h"
+ #include "acl.h"
+@@ -125,6 +127,7 @@ void ext2_free_inode (struct inode * ino
+ 		ext2_xattr_delete_inode(inode);
+ 	    	DQUOT_FREE_INODE(inode);
+ 		DQUOT_DROP(inode);
++		DLIMIT_FREE_INODE(inode);
+ 	}
+ 
+ 	es = EXT2_SB(sb)->s_es;
+@@ -464,6 +467,11 @@ struct inode *ext2_new_inode(struct inod
+ 	if (!inode)
+ 		return ERR_PTR(-ENOMEM);
+ 
++	inode->i_tag = dx_current_fstag(sb);
++	if (DLIMIT_ALLOC_INODE(inode)) {
++		err = -ENOSPC;
++		goto fail_dlim;
++	}
+ 	ei = EXT2_I(inode);
+ 	sbi = EXT2_SB(sb);
+ 	es = sbi->s_es;
+@@ -577,7 +585,8 @@ got:
+ 	inode->i_blocks = 0;
+ 	inode->i_mtime = inode->i_atime = inode->i_ctime = CURRENT_TIME_SEC;
+ 	memset(ei->i_data, 0, sizeof(ei->i_data));
+-	ei->i_flags = EXT2_I(dir)->i_flags & ~EXT2_BTREE_FL;
++	ei->i_flags = EXT2_I(dir)->i_flags &
++		~(EXT2_BTREE_FL|EXT2_IUNLINK_FL|EXT2_BARRIER_FL);
+ 	if (S_ISLNK(mode))
+ 		ei->i_flags &= ~(EXT2_IMMUTABLE_FL|EXT2_APPEND_FL);
+ 	/* dirsync is only applied to directories */
+@@ -625,12 +634,15 @@ fail_free_drop:
+ 
+ fail_drop:
+ 	DQUOT_DROP(inode);
++	DLIMIT_FREE_INODE(inode);
+ 	inode->i_flags |= S_NOQUOTA;
+ 	inode->i_nlink = 0;
+ 	iput(inode);
+ 	return ERR_PTR(err);
+ 
+ fail:
++	DLIMIT_FREE_INODE(inode);
++fail_dlim:
+ 	make_bad_inode(inode);
+ 	iput(inode);
+ 	return ERR_PTR(err);
+--- linux-2.6.22/fs/ext2/inode.c	2007-07-09 13:19:23 +0200
++++ linux-2.6.22-vs2.2.0-rc5/fs/ext2/inode.c	2007-06-15 02:57:56 +0200
+@@ -31,6 +31,7 @@
+ #include <linux/writeback.h>
+ #include <linux/buffer_head.h>
+ #include <linux/mpage.h>
++#include <linux/vs_tag.h>
+ #include "ext2.h"
+ #include "acl.h"
+ #include "xip.h"
+@@ -913,7 +914,7 @@ void ext2_truncate (struct inode * inode
+ 		return;
+ 	if (ext2_inode_is_fast_symlink(inode))
+ 		return;
+-	if (IS_APPEND(inode) || IS_IMMUTABLE(inode))
++	if (IS_APPEND(inode) || IS_IXORUNLINK(inode))
+ 		return;
+ 
+ 	ext2_discard_prealloc(inode);
+@@ -1042,13 +1043,20 @@ void ext2_set_inode_flags(struct inode *
+ {
+ 	unsigned int flags = EXT2_I(inode)->i_flags;
+ 
+-	inode->i_flags &= ~(S_SYNC|S_APPEND|S_IMMUTABLE|S_NOATIME|S_DIRSYNC);
++	inode->i_flags &= ~(S_IMMUTABLE | S_IUNLINK | S_BARRIER |
++		S_SYNC | S_APPEND | S_NOATIME | S_DIRSYNC);
++
++	if (flags & EXT2_IMMUTABLE_FL)
++		inode->i_flags |= S_IMMUTABLE;
++	if (flags & EXT2_IUNLINK_FL)
++		inode->i_flags |= S_IUNLINK;
++	if (flags & EXT2_BARRIER_FL)
++		inode->i_flags |= S_BARRIER;
++
+ 	if (flags & EXT2_SYNC_FL)
+ 		inode->i_flags |= S_SYNC;
+ 	if (flags & EXT2_APPEND_FL)
+ 		inode->i_flags |= S_APPEND;
+-	if (flags & EXT2_IMMUTABLE_FL)
+-		inode->i_flags |= S_IMMUTABLE;
+ 	if (flags & EXT2_NOATIME_FL)
+ 		inode->i_flags |= S_NOATIME;
+ 	if (flags & EXT2_DIRSYNC_FL)
+@@ -1074,12 +1082,37 @@ void ext2_get_inode_flags(struct ext2_in
+ 		ei->i_flags |= EXT2_DIRSYNC_FL;
+ }
+ 
++int ext2_sync_flags(struct inode *inode)
++{
++	unsigned int oldflags, newflags;
++
++	oldflags = EXT2_I(inode)->i_flags;
++	newflags = oldflags & ~(EXT2_IMMUTABLE_FL |
++		EXT2_IUNLINK_FL | EXT2_BARRIER_FL);
++
++	if (IS_IMMUTABLE(inode))
++		newflags |= EXT2_IMMUTABLE_FL;
++	if (IS_IUNLINK(inode))
++		newflags |= EXT2_IUNLINK_FL;
++	if (IS_BARRIER(inode))
++		newflags |= EXT2_BARRIER_FL;
++
++	if (oldflags ^ newflags) {
++		EXT2_I(inode)->i_flags = newflags;
++		inode->i_ctime = CURRENT_TIME;
++		mark_inode_dirty(inode);
++	}
++	return 0;
++}
++
+ void ext2_read_inode (struct inode * inode)
+ {
+ 	struct ext2_inode_info *ei = EXT2_I(inode);
+ 	ino_t ino = inode->i_ino;
+ 	struct buffer_head * bh;
+ 	struct ext2_inode * raw_inode = ext2_get_inode(inode->i_sb, ino, &bh);
++	uid_t uid;
++	gid_t gid;
+ 	int n;
+ 
+ #ifdef CONFIG_EXT2_FS_POSIX_ACL
+@@ -1090,12 +1123,17 @@ void ext2_read_inode (struct inode * ino
+  		goto bad_inode;
+ 
+ 	inode->i_mode = le16_to_cpu(raw_inode->i_mode);
+-	inode->i_uid = (uid_t)le16_to_cpu(raw_inode->i_uid_low);
+-	inode->i_gid = (gid_t)le16_to_cpu(raw_inode->i_gid_low);
++	uid = (uid_t)le16_to_cpu(raw_inode->i_uid_low);
++	gid = (gid_t)le16_to_cpu(raw_inode->i_gid_low);
+ 	if (!(test_opt (inode->i_sb, NO_UID32))) {
+-		inode->i_uid |= le16_to_cpu(raw_inode->i_uid_high) << 16;
+-		inode->i_gid |= le16_to_cpu(raw_inode->i_gid_high) << 16;
++		uid |= le16_to_cpu(raw_inode->i_uid_high) << 16;
++		gid |= le16_to_cpu(raw_inode->i_gid_high) << 16;
+ 	}
++	inode->i_uid = INOTAG_UID(DX_TAG(inode), uid, gid);
++	inode->i_gid = INOTAG_GID(DX_TAG(inode), uid, gid);
++	inode->i_tag = INOTAG_TAG(DX_TAG(inode), uid, gid,
++		le16_to_cpu(raw_inode->i_raw_tag));
++
+ 	inode->i_nlink = le16_to_cpu(raw_inode->i_links_count);
+ 	inode->i_size = le32_to_cpu(raw_inode->i_size);
+ 	inode->i_atime.tv_sec = (signed)le32_to_cpu(raw_inode->i_atime);
+@@ -1192,8 +1230,8 @@ static int ext2_update_inode(struct inod
+ 	struct ext2_inode_info *ei = EXT2_I(inode);
+ 	struct super_block *sb = inode->i_sb;
+ 	ino_t ino = inode->i_ino;
+-	uid_t uid = inode->i_uid;
+-	gid_t gid = inode->i_gid;
++	uid_t uid = TAGINO_UID(DX_TAG(inode), inode->i_uid, inode->i_tag);
++	gid_t gid = TAGINO_GID(DX_TAG(inode), inode->i_gid, inode->i_tag);
+ 	struct buffer_head * bh;
+ 	struct ext2_inode * raw_inode = ext2_get_inode(sb, ino, &bh);
+ 	int n;
+@@ -1229,6 +1267,9 @@ static int ext2_update_inode(struct inod
+ 		raw_inode->i_uid_high = 0;
+ 		raw_inode->i_gid_high = 0;
+ 	}
++#ifdef CONFIG_TAGGING_INTERN
++	raw_inode->i_raw_tag = cpu_to_le16(inode->i_tag);
++#endif
+ 	raw_inode->i_links_count = cpu_to_le16(inode->i_nlink);
+ 	raw_inode->i_size = cpu_to_le32(inode->i_size);
+ 	raw_inode->i_atime = cpu_to_le32(inode->i_atime.tv_sec);
+@@ -1315,7 +1356,8 @@ int ext2_setattr(struct dentry *dentry, 
+ 	if (error)
+ 		return error;
+ 	if ((iattr->ia_valid & ATTR_UID && iattr->ia_uid != inode->i_uid) ||
+-	    (iattr->ia_valid & ATTR_GID && iattr->ia_gid != inode->i_gid)) {
++	    (iattr->ia_valid & ATTR_GID && iattr->ia_gid != inode->i_gid) ||
++	    (iattr->ia_valid & ATTR_TAG && iattr->ia_tag != inode->i_tag)) {
+ 		error = DQUOT_TRANSFER(inode, iattr) ? -EDQUOT : 0;
+ 		if (error)
+ 			return error;
+--- linux-2.6.22/fs/ext2/ioctl.c	2007-07-09 13:19:23 +0200
++++ linux-2.6.22-vs2.2.0-rc5/fs/ext2/ioctl.c	2007-06-15 02:37:03 +0200
+@@ -13,6 +13,7 @@
+ #include <linux/sched.h>
+ #include <linux/compat.h>
+ #include <linux/smp_lock.h>
++#include <linux/mount.h>
+ #include <asm/current.h>
+ #include <asm/uaccess.h>
+ 
+@@ -33,7 +34,8 @@ int ext2_ioctl (struct inode * inode, st
+ 	case EXT2_IOC_SETFLAGS: {
+ 		unsigned int oldflags;
+ 
+-		if (IS_RDONLY(inode))
++		if (IS_RDONLY(inode) ||
++			(filp && MNT_IS_RDONLY(filp->f_vfsmnt)))
+ 			return -EROFS;
+ 
+ 		if ((current->fsuid != inode->i_uid) && !capable(CAP_FOWNER))
+@@ -54,7 +56,9 @@ int ext2_ioctl (struct inode * inode, st
+ 		 *
+ 		 * This test looks nicer. Thanks to Pauline Middelink
+ 		 */
+-		if ((flags ^ oldflags) & (EXT2_APPEND_FL | EXT2_IMMUTABLE_FL)) {
++		if ((oldflags & EXT2_IMMUTABLE_FL) ||
++			((flags ^ oldflags) & (EXT2_APPEND_FL |
++			EXT2_IMMUTABLE_FL | EXT2_IUNLINK_FL))) {
+ 			if (!capable(CAP_LINUX_IMMUTABLE)) {
+ 				mutex_unlock(&inode->i_mutex);
+ 				return -EPERM;
+@@ -76,7 +80,8 @@ int ext2_ioctl (struct inode * inode, st
+ 	case EXT2_IOC_SETVERSION:
+ 		if ((current->fsuid != inode->i_uid) && !capable(CAP_FOWNER))
+ 			return -EPERM;
+-		if (IS_RDONLY(inode))
++		if (IS_RDONLY(inode) ||
++			(filp && MNT_IS_RDONLY(filp->f_vfsmnt)))
+ 			return -EROFS;
+ 		if (get_user(inode->i_generation, (int __user *) arg))
+ 			return -EFAULT;	
+--- linux-2.6.22/fs/ext2/namei.c	2007-05-02 19:25:17 +0200
++++ linux-2.6.22-vs2.2.0-rc5/fs/ext2/namei.c	2007-06-15 02:37:03 +0200
+@@ -31,6 +31,7 @@
+  */
+ 
+ #include <linux/pagemap.h>
++#include <linux/vs_tag.h>
+ #include "ext2.h"
+ #include "xattr.h"
+ #include "acl.h"
+@@ -66,6 +67,7 @@ static struct dentry *ext2_lookup(struct
+ 		inode = iget(dir->i_sb, ino);
+ 		if (!inode)
+ 			return ERR_PTR(-EACCES);
++		dx_propagate_tag(nd, inode);
+ 	}
+ 	return d_splice_alias(inode, dentry);
+ }
+@@ -391,6 +393,7 @@ const struct inode_operations ext2_dir_i
+ #endif
+ 	.setattr	= ext2_setattr,
+ 	.permission	= ext2_permission,
++	.sync_flags	= ext2_sync_flags,
+ };
+ 
+ const struct inode_operations ext2_special_inode_operations = {
+@@ -402,4 +405,5 @@ const struct inode_operations ext2_speci
+ #endif
+ 	.setattr	= ext2_setattr,
+ 	.permission	= ext2_permission,
++	.sync_flags	= ext2_sync_flags,
+ };
+--- linux-2.6.22/fs/ext2/super.c	2007-07-09 13:19:23 +0200
++++ linux-2.6.22-vs2.2.0-rc5/fs/ext2/super.c	2007-07-07 03:52:53 +0200
+@@ -321,7 +321,7 @@ enum {
+ 	Opt_err_ro, Opt_nouid32, Opt_nocheck, Opt_debug,
+ 	Opt_oldalloc, Opt_orlov, Opt_nobh, Opt_user_xattr, Opt_nouser_xattr,
+ 	Opt_acl, Opt_noacl, Opt_xip, Opt_ignore, Opt_err, Opt_quota,
+-	Opt_usrquota, Opt_grpquota
++	Opt_usrquota, Opt_grpquota, Opt_tag, Opt_notag, Opt_tagid
+ };
+ 
+ static match_table_t tokens = {
+@@ -349,6 +349,10 @@ static match_table_t tokens = {
+ 	{Opt_acl, "acl"},
+ 	{Opt_noacl, "noacl"},
+ 	{Opt_xip, "xip"},
++	{Opt_tag, "tag"},
++	{Opt_notag, "notag"},
++	{Opt_tagid, "tagid=%u"},
++	{Opt_tag, "tagxid"},
+ 	{Opt_grpquota, "grpquota"},
+ 	{Opt_ignore, "noquota"},
+ 	{Opt_quota, "quota"},
+@@ -417,6 +421,20 @@ static int parse_options (char * options
+ 		case Opt_nouid32:
+ 			set_opt (sbi->s_mount_opt, NO_UID32);
+ 			break;
++#ifndef CONFIG_TAGGING_NONE
++		case Opt_tag:
++			set_opt (sbi->s_mount_opt, TAGGED);
++			break;
++		case Opt_notag:
++			clear_opt (sbi->s_mount_opt, TAGGED);
++			break;
++#endif
++#ifdef CONFIG_PROPAGATE
++		case Opt_tagid:
++			/* use args[0] */
++			set_opt (sbi->s_mount_opt, TAGGED);
++			break;
++#endif
+ 		case Opt_nocheck:
+ 			clear_opt (sbi->s_mount_opt, CHECK);
+ 			break;
+@@ -727,6 +745,8 @@ static int ext2_fill_super(struct super_
+ 	if (!parse_options ((char *) data, sbi))
+ 		goto failed_mount;
+ 
++	if (EXT2_SB(sb)->s_mount_opt & EXT2_MOUNT_TAGGED)
++		sb->s_flags |= MS_TAGGED;
+ 	sb->s_flags = (sb->s_flags & ~MS_POSIXACL) |
+ 		((EXT2_SB(sb)->s_mount_opt & EXT2_MOUNT_POSIX_ACL) ?
+ 		 MS_POSIXACL : 0);
+@@ -1035,6 +1055,13 @@ static int ext2_remount (struct super_bl
+ 		goto restore_opts;
+ 	}
+ 
++	if ((sbi->s_mount_opt & EXT2_MOUNT_TAGGED) &&
++		!(sb->s_flags & MS_TAGGED)) {
++		printk("EXT2-fs: %s: tagging not permitted on remount.\n",
++		       sb->s_id);
++		return -EINVAL;
++	}
++
+ 	sb->s_flags = (sb->s_flags & ~MS_POSIXACL) |
+ 		((sbi->s_mount_opt & EXT2_MOUNT_POSIX_ACL) ? MS_POSIXACL : 0);
+ 
+--- linux-2.6.22/fs/ext2/symlink.c	2007-05-02 19:25:17 +0200
++++ linux-2.6.22-vs2.2.0-rc5/fs/ext2/symlink.c	2007-06-15 02:37:03 +0200
+@@ -38,6 +38,7 @@ const struct inode_operations ext2_symli
+ 	.listxattr	= ext2_listxattr,
+ 	.removexattr	= generic_removexattr,
+ #endif
++	.sync_flags	= ext2_sync_flags,
+ };
+  
+ const struct inode_operations ext2_fast_symlink_inode_operations = {
+@@ -49,4 +50,5 @@ const struct inode_operations ext2_fast_
+ 	.listxattr	= ext2_listxattr,
+ 	.removexattr	= generic_removexattr,
+ #endif
++	.sync_flags	= ext2_sync_flags,
+ };
+--- linux-2.6.22/fs/ext2/xattr.c	2007-02-06 03:01:18 +0100
++++ linux-2.6.22-vs2.2.0-rc5/fs/ext2/xattr.c	2007-06-15 02:37:03 +0200
+@@ -60,6 +60,7 @@
+ #include <linux/mbcache.h>
+ #include <linux/quotaops.h>
+ #include <linux/rwsem.h>
++#include <linux/vs_dlimit.h>
+ #include "ext2.h"
+ #include "xattr.h"
+ #include "acl.h"
+@@ -641,8 +642,12 @@ ext2_xattr_set2(struct inode *inode, str
+ 				   the inode.  */
+ 				ea_bdebug(new_bh, "reusing block");
+ 
++				error = -ENOSPC;
++				if (DLIMIT_ALLOC_BLOCK(inode, 1))
++					goto cleanup;
+ 				error = -EDQUOT;
+ 				if (DQUOT_ALLOC_BLOCK(inode, 1)) {
++					DLIMIT_FREE_BLOCK(inode, 1);
+ 					unlock_buffer(new_bh);
+ 					goto cleanup;
+ 				}
+@@ -736,6 +741,7 @@ ext2_xattr_set2(struct inode *inode, str
+ 				le32_to_cpu(HDR(old_bh)->h_refcount) - 1);
+ 			if (ce)
+ 				mb_cache_entry_release(ce);
++			DLIMIT_FREE_BLOCK(inode, 1);
+ 			DQUOT_FREE_BLOCK(inode, 1);
+ 			mark_buffer_dirty(old_bh);
+ 			ea_bdebug(old_bh, "refcount now=%d",
+@@ -800,6 +806,7 @@ ext2_xattr_delete_inode(struct inode *in
+ 		mark_buffer_dirty(bh);
+ 		if (IS_SYNC(inode))
+ 			sync_dirty_buffer(bh);
++		DLIMIT_FREE_BLOCK(inode, 1);
+ 		DQUOT_FREE_BLOCK(inode, 1);
+ 	}
+ 	EXT2_I(inode)->i_file_acl = 0;
+--- linux-2.6.22/fs/ext3/balloc.c	2007-05-02 19:25:17 +0200
++++ linux-2.6.22-vs2.2.0-rc5/fs/ext3/balloc.c	2007-06-15 02:37:03 +0200
+@@ -19,6 +19,8 @@
+ #include <linux/ext3_jbd.h>
+ #include <linux/quotaops.h>
+ #include <linux/buffer_head.h>
++#include <linux/vs_dlimit.h>
++#include <linux/vs_tag.h>
+ 
+ /*
+  * balloc.c contains the blocks allocation and deallocation routines
+@@ -613,8 +615,10 @@ void ext3_free_blocks(handle_t *handle, 
+ 		return;
+ 	}
+ 	ext3_free_blocks_sb(handle, sb, block, count, &dquot_freed_blocks);
+-	if (dquot_freed_blocks)
++	if (dquot_freed_blocks) {
++		DLIMIT_FREE_BLOCK(inode, dquot_freed_blocks);
+ 		DQUOT_FREE_BLOCK(inode, dquot_freed_blocks);
++	}
+ 	return;
+ }
+ 
+@@ -1353,18 +1357,33 @@ out:
+  *
+  * Check if filesystem has at least 1 free block available for allocation.
+  */
+-static int ext3_has_free_blocks(struct ext3_sb_info *sbi)
++static int ext3_has_free_blocks(struct super_block *sb)
+ {
+-	ext3_fsblk_t free_blocks, root_blocks;
++	struct ext3_sb_info *sbi = EXT3_SB(sb);
++	unsigned long long free_blocks, root_blocks;
++	int cond;
+ 
+ 	free_blocks = percpu_counter_read_positive(&sbi->s_freeblocks_counter);
+ 	root_blocks = le32_to_cpu(sbi->s_es->s_r_blocks_count);
+-	if (free_blocks < root_blocks + 1 && !capable(CAP_SYS_RESOURCE) &&
++
++	vxdprintk(VXD_CBIT(dlim, 3),
++		"ext3_has_free_blocks(%p): free=%llu, root=%llu",
++		sb, free_blocks, root_blocks);
++
++	DLIMIT_ADJUST_BLOCK(sb, dx_current_tag(), &free_blocks, &root_blocks);
++
++	cond = (free_blocks < root_blocks + 1 &&
++		!capable(CAP_SYS_RESOURCE) &&
+ 		sbi->s_resuid != current->fsuid &&
+-		(sbi->s_resgid == 0 || !in_group_p (sbi->s_resgid))) {
+-		return 0;
+-	}
+-	return 1;
++		(sbi->s_resgid == 0 || !in_group_p (sbi->s_resgid)));
++
++	vxdprintk(VXD_CBIT(dlim, 3),
++		"ext3_has_free_blocks(%p): %llu<%llu+1, %c, %u!=%u r=%d",
++		sb, free_blocks, root_blocks,
++		!capable(CAP_SYS_RESOURCE)?'1':'0',
++		sbi->s_resuid, current->fsuid, cond?0:1);
++
++	return (cond ? 0 : 1);
+ }
+ 
+ /**
+@@ -1381,7 +1400,7 @@ static int ext3_has_free_blocks(struct e
+  */
+ int ext3_should_retry_alloc(struct super_block *sb, int *retries)
+ {
+-	if (!ext3_has_free_blocks(EXT3_SB(sb)) || (*retries)++ > 3)
++	if (!ext3_has_free_blocks(sb) || (*retries)++ > 3)
+ 		return 0;
+ 
+ 	jbd_debug(1, "%s: retrying operation after ENOSPC\n", sb->s_id);
+@@ -1444,6 +1463,8 @@ ext3_fsblk_t ext3_new_blocks(handle_t *h
+ 		*errp = -EDQUOT;
+ 		return 0;
+ 	}
++	if (DLIMIT_ALLOC_BLOCK(inode, 1))
++	    goto out_dlimit;
+ 
+ 	sbi = EXT3_SB(sb);
+ 	es = EXT3_SB(sb)->s_es;
+@@ -1460,7 +1481,7 @@ ext3_fsblk_t ext3_new_blocks(handle_t *h
+ 	if (block_i && ((windowsz = block_i->rsv_window_node.rsv_goal_size) > 0))
+ 		my_rsv = &block_i->rsv_window_node;
+ 
+-	if (!ext3_has_free_blocks(sbi)) {
++	if (!ext3_has_free_blocks(sb)) {
+ 		*errp = -ENOSPC;
+ 		goto out;
+ 	}
+@@ -1653,6 +1674,9 @@ allocated:
+ io_error:
+ 	*errp = -EIO;
+ out:
++	if (!performed_allocation)
++		DLIMIT_FREE_BLOCK(inode, 1);
++out_dlimit:
+ 	if (fatal) {
+ 		*errp = fatal;
+ 		ext3_std_error(sb, fatal);
+--- linux-2.6.22/fs/ext3/file.c	2007-05-02 19:25:17 +0200
++++ linux-2.6.22-vs2.2.0-rc5/fs/ext3/file.c	2007-06-15 02:37:03 +0200
+@@ -121,6 +121,7 @@ const struct file_operations ext3_file_o
+ 	.release	= ext3_release_file,
+ 	.fsync		= ext3_sync_file,
+ 	.sendfile	= generic_file_sendfile,
++	.sendpage	= generic_file_sendpage,
+ 	.splice_read	= generic_file_splice_read,
+ 	.splice_write	= generic_file_splice_write,
+ };
+@@ -135,5 +136,6 @@ const struct inode_operations ext3_file_
+ 	.removexattr	= generic_removexattr,
+ #endif
+ 	.permission	= ext3_permission,
++	.sync_flags	= ext3_sync_flags,
+ };
+ 
+--- linux-2.6.22/fs/ext3/ialloc.c	2006-11-30 21:19:19 +0100
++++ linux-2.6.22-vs2.2.0-rc5/fs/ext3/ialloc.c	2007-06-15 02:37:03 +0200
+@@ -23,6 +23,8 @@
+ #include <linux/buffer_head.h>
+ #include <linux/random.h>
+ #include <linux/bitops.h>
++#include <linux/vs_dlimit.h>
++#include <linux/vs_tag.h>
+ 
+ #include <asm/byteorder.h>
+ 
+@@ -127,6 +129,7 @@ void ext3_free_inode (handle_t *handle, 
+ 	ext3_xattr_delete_inode(handle, inode);
+ 	DQUOT_FREE_INODE(inode);
+ 	DQUOT_DROP(inode);
++	DLIMIT_FREE_INODE(inode);
+ 
+ 	is_directory = S_ISDIR(inode->i_mode);
+ 
+@@ -445,6 +448,12 @@ struct inode *ext3_new_inode(handle_t *h
+ 	inode = new_inode(sb);
+ 	if (!inode)
+ 		return ERR_PTR(-ENOMEM);
++
++	inode->i_tag = dx_current_fstag(sb);
++	if (DLIMIT_ALLOC_INODE(inode)) {
++		err = -ENOSPC;
++		goto out_dlimit;
++	}
+ 	ei = EXT3_I(inode);
+ 
+ 	sbi = EXT3_SB(sb);
+@@ -566,7 +575,8 @@ got:
+ 	ei->i_dir_start_lookup = 0;
+ 	ei->i_disksize = 0;
+ 
+-	ei->i_flags = EXT3_I(dir)->i_flags & ~EXT3_INDEX_FL;
++	ei->i_flags = EXT3_I(dir)->i_flags &
++		~(EXT3_INDEX_FL|EXT3_IUNLINK_FL|EXT3_BARRIER_FL);
+ 	if (S_ISLNK(mode))
+ 		ei->i_flags &= ~(EXT3_IMMUTABLE_FL|EXT3_APPEND_FL);
+ 	/* dirsync only applies to directories */
+@@ -621,6 +631,8 @@ got:
+ fail:
+ 	ext3_std_error(sb, err);
+ out:
++	DLIMIT_FREE_INODE(inode);
++out_dlimit:
+ 	iput(inode);
+ 	ret = ERR_PTR(err);
+ really_out:
+@@ -632,6 +644,7 @@ fail_free_drop:
+ 
+ fail_drop:
+ 	DQUOT_DROP(inode);
++	DLIMIT_FREE_INODE(inode);
+ 	inode->i_flags |= S_NOQUOTA;
+ 	inode->i_nlink = 0;
+ 	iput(inode);
+--- linux-2.6.22/fs/ext3/inode.c	2007-07-09 13:19:23 +0200
++++ linux-2.6.22-vs2.2.0-rc5/fs/ext3/inode.c	2007-07-07 03:52:53 +0200
+@@ -36,6 +36,7 @@
+ #include <linux/mpage.h>
+ #include <linux/uio.h>
+ #include <linux/bio.h>
++#include <linux/vs_tag.h>
+ #include "xattr.h"
+ #include "acl.h"
+ 
+@@ -2237,7 +2238,7 @@ void ext3_truncate(struct inode *inode)
+ 		return;
+ 	if (ext3_inode_is_fast_symlink(inode))
+ 		return;
+-	if (IS_APPEND(inode) || IS_IMMUTABLE(inode))
++	if (IS_APPEND(inode) || IS_IXORUNLINK(inode))
+ 		return;
+ 
+ 	/*
+@@ -2559,13 +2560,20 @@ void ext3_set_inode_flags(struct inode *
+ {
+ 	unsigned int flags = EXT3_I(inode)->i_flags;
+ 
+-	inode->i_flags &= ~(S_SYNC|S_APPEND|S_IMMUTABLE|S_NOATIME|S_DIRSYNC);
++	inode->i_flags &= ~(S_IMMUTABLE | S_IUNLINK | S_BARRIER |
++		S_SYNC | S_APPEND | S_NOATIME | S_DIRSYNC);
++
++	if (flags & EXT3_IMMUTABLE_FL)
++		inode->i_flags |= S_IMMUTABLE;
++	if (flags & EXT3_IUNLINK_FL)
++		inode->i_flags |= S_IUNLINK;
++	if (flags & EXT3_BARRIER_FL)
++		inode->i_flags |= S_BARRIER;
++
+ 	if (flags & EXT3_SYNC_FL)
+ 		inode->i_flags |= S_SYNC;
+ 	if (flags & EXT3_APPEND_FL)
+ 		inode->i_flags |= S_APPEND;
+-	if (flags & EXT3_IMMUTABLE_FL)
+-		inode->i_flags |= S_IMMUTABLE;
+ 	if (flags & EXT3_NOATIME_FL)
+ 		inode->i_flags |= S_NOATIME;
+ 	if (flags & EXT3_DIRSYNC_FL)
+@@ -2591,6 +2599,45 @@ void ext3_get_inode_flags(struct ext3_in
+ 		ei->i_flags |= EXT3_DIRSYNC_FL;
+ }
+ 
++int ext3_sync_flags(struct inode *inode)
++{
++	unsigned int oldflags, newflags;
++	int err = 0;
++
++	oldflags = EXT3_I(inode)->i_flags;
++	newflags = oldflags & ~(EXT3_IMMUTABLE_FL |
++		EXT3_IUNLINK_FL | EXT3_BARRIER_FL);
++
++	if (IS_IMMUTABLE(inode))
++		newflags |= EXT3_IMMUTABLE_FL;
++	if (IS_IUNLINK(inode))
++		newflags |= EXT3_IUNLINK_FL;
++	if (IS_BARRIER(inode))
++		newflags |= EXT3_BARRIER_FL;
++
++	if (oldflags ^ newflags) {
++		handle_t *handle;
++		struct ext3_iloc iloc;
++
++		handle = ext3_journal_start(inode, 1);
++		if (IS_ERR(handle))
++			return PTR_ERR(handle);
++		if (IS_SYNC(inode))
++			handle->h_sync = 1;
++		err = ext3_reserve_inode_write(handle, inode, &iloc);
++		if (err)
++			goto flags_err;
++
++		EXT3_I(inode)->i_flags = newflags;
++		inode->i_ctime = CURRENT_TIME;
++
++		err = ext3_mark_iloc_dirty(handle, inode, &iloc);
++	flags_err:
++		ext3_journal_stop(handle);
++	}
++	return err;
++}
++
+ void ext3_read_inode(struct inode * inode)
+ {
+ 	struct ext3_iloc iloc;
+@@ -2598,6 +2645,8 @@ void ext3_read_inode(struct inode * inod
+ 	struct ext3_inode_info *ei = EXT3_I(inode);
+ 	struct buffer_head *bh;
+ 	int block;
++	uid_t uid;
++	gid_t gid;
+ 
+ #ifdef CONFIG_EXT3_FS_POSIX_ACL
+ 	ei->i_acl = EXT3_ACL_NOT_CACHED;
+@@ -2610,12 +2659,17 @@ void ext3_read_inode(struct inode * inod
+ 	bh = iloc.bh;
+ 	raw_inode = ext3_raw_inode(&iloc);
+ 	inode->i_mode = le16_to_cpu(raw_inode->i_mode);
+-	inode->i_uid = (uid_t)le16_to_cpu(raw_inode->i_uid_low);
+-	inode->i_gid = (gid_t)le16_to_cpu(raw_inode->i_gid_low);
++	uid = (uid_t)le16_to_cpu(raw_inode->i_uid_low);
++	gid = (gid_t)le16_to_cpu(raw_inode->i_gid_low);
+ 	if(!(test_opt (inode->i_sb, NO_UID32))) {
+-		inode->i_uid |= le16_to_cpu(raw_inode->i_uid_high) << 16;
+-		inode->i_gid |= le16_to_cpu(raw_inode->i_gid_high) << 16;
++		uid |= le16_to_cpu(raw_inode->i_uid_high) << 16;
++		gid |= le16_to_cpu(raw_inode->i_gid_high) << 16;
+ 	}
++	inode->i_uid = INOTAG_UID(DX_TAG(inode), uid, gid);
++	inode->i_gid = INOTAG_GID(DX_TAG(inode), uid, gid);
++	inode->i_tag = INOTAG_TAG(DX_TAG(inode), uid, gid,
++		le16_to_cpu(raw_inode->i_raw_tag));
++
+ 	inode->i_nlink = le16_to_cpu(raw_inode->i_links_count);
+ 	inode->i_size = le32_to_cpu(raw_inode->i_size);
+ 	inode->i_atime.tv_sec = (signed)le32_to_cpu(raw_inode->i_atime);
+@@ -2741,6 +2795,8 @@ static int ext3_do_update_inode(handle_t
+ 	struct ext3_inode *raw_inode = ext3_raw_inode(iloc);
+ 	struct ext3_inode_info *ei = EXT3_I(inode);
+ 	struct buffer_head *bh = iloc->bh;
++	uid_t uid = TAGINO_UID(DX_TAG(inode), inode->i_uid, inode->i_tag);
++	gid_t gid = TAGINO_GID(DX_TAG(inode), inode->i_gid, inode->i_tag);
+ 	int err = 0, rc, block;
+ 
+ 	/* For fields not not tracking in the in-memory inode,
+@@ -2751,29 +2807,32 @@ static int ext3_do_update_inode(handle_t
+ 	ext3_get_inode_flags(ei);
+ 	raw_inode->i_mode = cpu_to_le16(inode->i_mode);
+ 	if(!(test_opt(inode->i_sb, NO_UID32))) {
+-		raw_inode->i_uid_low = cpu_to_le16(low_16_bits(inode->i_uid));
+-		raw_inode->i_gid_low = cpu_to_le16(low_16_bits(inode->i_gid));
++		raw_inode->i_uid_low = cpu_to_le16(low_16_bits(uid));
++		raw_inode->i_gid_low = cpu_to_le16(low_16_bits(gid));
+ /*
+  * Fix up interoperability with old kernels. Otherwise, old inodes get
+  * re-used with the upper 16 bits of the uid/gid intact
+  */
+ 		if(!ei->i_dtime) {
+ 			raw_inode->i_uid_high =
+-				cpu_to_le16(high_16_bits(inode->i_uid));
++				cpu_to_le16(high_16_bits(uid));
+ 			raw_inode->i_gid_high =
+-				cpu_to_le16(high_16_bits(inode->i_gid));
++				cpu_to_le16(high_16_bits(gid));
+ 		} else {
+ 			raw_inode->i_uid_high = 0;
+ 			raw_inode->i_gid_high = 0;
+ 		}
+ 	} else {
+ 		raw_inode->i_uid_low =
+-			cpu_to_le16(fs_high2lowuid(inode->i_uid));
++			cpu_to_le16(fs_high2lowuid(uid));
+ 		raw_inode->i_gid_low =
+-			cpu_to_le16(fs_high2lowgid(inode->i_gid));
++			cpu_to_le16(fs_high2lowgid(gid));
+ 		raw_inode->i_uid_high = 0;
+ 		raw_inode->i_gid_high = 0;
+ 	}
++#ifdef CONFIG_TAGGING_INTERN
++	raw_inode->i_raw_tag = cpu_to_le16(inode->i_tag);
++#endif
+ 	raw_inode->i_links_count = cpu_to_le16(inode->i_nlink);
+ 	raw_inode->i_size = cpu_to_le32(ei->i_disksize);
+ 	raw_inode->i_atime = cpu_to_le32(inode->i_atime.tv_sec);
+@@ -2926,7 +2985,8 @@ int ext3_setattr(struct dentry *dentry, 
+ 		return error;
+ 
+ 	if ((ia_valid & ATTR_UID && attr->ia_uid != inode->i_uid) ||
+-		(ia_valid & ATTR_GID && attr->ia_gid != inode->i_gid)) {
++		(ia_valid & ATTR_GID && attr->ia_gid != inode->i_gid) ||
++		(ia_valid & ATTR_TAG && attr->ia_tag != inode->i_tag)) {
+ 		handle_t *handle;
+ 
+ 		/* (user+group)*(old+new) structure, inode write (sb,
+@@ -2948,6 +3008,8 @@ int ext3_setattr(struct dentry *dentry, 
+ 			inode->i_uid = attr->ia_uid;
+ 		if (attr->ia_valid & ATTR_GID)
+ 			inode->i_gid = attr->ia_gid;
++		if ((attr->ia_valid & ATTR_TAG) && IS_TAGGED(inode))
++			inode->i_tag = attr->ia_tag;
+ 		error = ext3_mark_inode_dirty(handle, inode);
+ 		ext3_journal_stop(handle);
+ 	}
+--- linux-2.6.22/fs/ext3/ioctl.c	2007-07-09 13:19:23 +0200
++++ linux-2.6.22-vs2.2.0-rc5/fs/ext3/ioctl.c	2007-06-15 02:37:03 +0200
+@@ -8,6 +8,7 @@
+  */
+ 
+ #include <linux/fs.h>
++#include <linux/mount.h>
+ #include <linux/jbd.h>
+ #include <linux/capability.h>
+ #include <linux/ext3_fs.h>
+@@ -15,6 +16,7 @@
+ #include <linux/time.h>
+ #include <linux/compat.h>
+ #include <linux/smp_lock.h>
++#include <linux/vs_tag.h>
+ #include <asm/uaccess.h>
+ 
+ int ext3_ioctl (struct inode * inode, struct file * filp, unsigned int cmd,
+@@ -38,7 +40,8 @@ int ext3_ioctl (struct inode * inode, st
+ 		unsigned int oldflags;
+ 		unsigned int jflag;
+ 
+-		if (IS_RDONLY(inode))
++		if (IS_RDONLY(inode) ||
++			(filp && MNT_IS_RDONLY(filp->f_vfsmnt)))
+ 			return -EROFS;
+ 
+ 		if ((current->fsuid != inode->i_uid) && !capable(CAP_FOWNER))
+@@ -62,7 +65,9 @@ int ext3_ioctl (struct inode * inode, st
+ 		 *
+ 		 * This test looks nicer. Thanks to Pauline Middelink
+ 		 */
+-		if ((flags ^ oldflags) & (EXT3_APPEND_FL | EXT3_IMMUTABLE_FL)) {
++		if ((oldflags & EXT3_IMMUTABLE_FL) ||
++			((flags ^ oldflags) & (EXT3_APPEND_FL |
++			EXT3_IMMUTABLE_FL | EXT3_IUNLINK_FL))) {
+ 			if (!capable(CAP_LINUX_IMMUTABLE)) {
+ 				mutex_unlock(&inode->i_mutex);
+ 				return -EPERM;
+@@ -124,7 +129,8 @@ flags_err:
+ 
+ 		if ((current->fsuid != inode->i_uid) && !capable(CAP_FOWNER))
+ 			return -EPERM;
+-		if (IS_RDONLY(inode))
++		if (IS_RDONLY(inode) ||
++			(filp && MNT_IS_RDONLY(filp->f_vfsmnt)))
+ 			return -EROFS;
+ 		if (get_user(generation, (int __user *) arg))
+ 			return -EFAULT;
+@@ -178,7 +184,8 @@ flags_err:
+ 		if (!test_opt(inode->i_sb, RESERVATION) ||!S_ISREG(inode->i_mode))
+ 			return -ENOTTY;
+ 
+-		if (IS_RDONLY(inode))
++		if (IS_RDONLY(inode) ||
++			(filp && MNT_IS_RDONLY(filp->f_vfsmnt)))
+ 			return -EROFS;
+ 
+ 		if ((current->fsuid != inode->i_uid) && !capable(CAP_FOWNER))
+@@ -213,7 +220,8 @@ flags_err:
+ 		if (!capable(CAP_SYS_RESOURCE))
+ 			return -EPERM;
+ 
+-		if (IS_RDONLY(inode))
++		if (IS_RDONLY(inode) ||
++			(filp && MNT_IS_RDONLY(filp->f_vfsmnt)))
+ 			return -EROFS;
+ 
+ 		if (get_user(n_blocks_count, (__u32 __user *)arg))
+@@ -234,7 +242,8 @@ flags_err:
+ 		if (!capable(CAP_SYS_RESOURCE))
+ 			return -EPERM;
+ 
+-		if (IS_RDONLY(inode))
++		if (IS_RDONLY(inode) ||
++			(filp && MNT_IS_RDONLY(filp->f_vfsmnt)))
+ 			return -EROFS;
+ 
+ 		if (copy_from_user(&input, (struct ext3_new_group_input __user *)arg,
+@@ -249,6 +258,38 @@ flags_err:
+ 		return err;
+ 	}
+ 
++#if defined(CONFIG_VSERVER_LEGACY) && !defined(CONFIG_TAGGING_NONE)
++	case EXT3_IOC_SETTAG: {
++		handle_t *handle;
++		struct ext3_iloc iloc;
++		int tag;
++		int err;
++
++		/* fixme: if stealth, return -ENOTTY */
++		if (!capable(CAP_CONTEXT))
++			return -EPERM;
++		if (IS_RDONLY(inode))
++			return -EROFS;
++		if (!(inode->i_sb->s_flags & MS_TAGGED))
++			return -ENOSYS;
++		if (get_user(tag, (int __user *) arg))
++			return -EFAULT;
++
++		handle = ext3_journal_start(inode, 1);
++		if (IS_ERR(handle))
++			return PTR_ERR(handle);
++		err = ext3_reserve_inode_write(handle, inode, &iloc);
++		if (err)
++			return err;
++
++		inode->i_tag = (tag & 0xFFFF);
++		inode->i_ctime = CURRENT_TIME;
++
++		err = ext3_mark_iloc_dirty(handle, inode, &iloc);
++		ext3_journal_stop(handle);
++		return err;
++	}
++#endif
+ 
+ 	default:
+ 		return -ENOTTY;
+--- linux-2.6.22/fs/ext3/namei.c	2007-07-09 13:19:23 +0200
++++ linux-2.6.22-vs2.2.0-rc5/fs/ext3/namei.c	2007-06-15 03:00:11 +0200
+@@ -36,6 +36,7 @@
+ #include <linux/quotaops.h>
+ #include <linux/buffer_head.h>
+ #include <linux/bio.h>
++#include <linux/vs_tag.h>
+ 
+ #include "namei.h"
+ #include "xattr.h"
+@@ -1019,6 +1020,7 @@ static struct dentry *ext3_lookup(struct
+ 
+ 		if (!inode)
+ 			return ERR_PTR(-EACCES);
++		dx_propagate_tag(nd, inode);
+ 	}
+ 	return d_splice_alias(inode, dentry);
+ }
+@@ -2386,6 +2388,7 @@ const struct inode_operations ext3_dir_i
+ 	.removexattr	= generic_removexattr,
+ #endif
+ 	.permission	= ext3_permission,
++	.sync_flags	= ext3_sync_flags,
+ };
+ 
+ const struct inode_operations ext3_special_inode_operations = {
+@@ -2397,4 +2400,5 @@ const struct inode_operations ext3_speci
+ 	.removexattr	= generic_removexattr,
+ #endif
+ 	.permission	= ext3_permission,
++	.sync_flags	= ext3_sync_flags,
+ };
+--- linux-2.6.22/fs/ext3/super.c	2007-07-09 13:19:23 +0200
++++ linux-2.6.22-vs2.2.0-rc5/fs/ext3/super.c	2007-06-15 02:37:03 +0200
+@@ -674,7 +674,7 @@ enum {
+ 	Opt_usrjquota, Opt_grpjquota, Opt_offusrjquota, Opt_offgrpjquota,
+ 	Opt_jqfmt_vfsold, Opt_jqfmt_vfsv0, Opt_quota, Opt_noquota,
+ 	Opt_ignore, Opt_barrier, Opt_err, Opt_resize, Opt_usrquota,
+-	Opt_grpquota
++	Opt_grpquota, Opt_tag, Opt_notag, Opt_tagid
+ };
+ 
+ static match_table_t tokens = {
+@@ -724,6 +724,10 @@ static match_table_t tokens = {
+ 	{Opt_quota, "quota"},
+ 	{Opt_usrquota, "usrquota"},
+ 	{Opt_barrier, "barrier=%u"},
++	{Opt_tag, "tag"},
++	{Opt_notag, "notag"},
++	{Opt_tagid, "tagid=%u"},
++	{Opt_tag, "tagxid"},
+ 	{Opt_err, NULL},
+ 	{Opt_resize, "resize"},
+ };
+@@ -817,6 +821,20 @@ static int parse_options (char *options,
+ 		case Opt_nouid32:
+ 			set_opt (sbi->s_mount_opt, NO_UID32);
+ 			break;
++#ifndef CONFIG_TAGGING_NONE
++		case Opt_tag:
++			set_opt (sbi->s_mount_opt, TAGGED);
++			break;
++		case Opt_notag:
++			clear_opt (sbi->s_mount_opt, TAGGED);
++			break;
++#endif
++#ifdef CONFIG_PROPAGATE
++		case Opt_tagid:
++			/* use args[0] */
++			set_opt (sbi->s_mount_opt, TAGGED);
++			break;
++#endif
+ 		case Opt_nocheck:
+ 			clear_opt (sbi->s_mount_opt, CHECK);
+ 			break;
+@@ -1487,6 +1505,9 @@ static int ext3_fill_super (struct super
+ 			    NULL, 0))
+ 		goto failed_mount;
+ 
++	if (EXT3_SB(sb)->s_mount_opt & EXT3_MOUNT_TAGGED)
++		sb->s_flags |= MS_TAGGED;
++
+ 	sb->s_flags = (sb->s_flags & ~MS_POSIXACL) |
+ 		((sbi->s_mount_opt & EXT3_MOUNT_POSIX_ACL) ? MS_POSIXACL : 0);
+ 
+@@ -2302,6 +2323,12 @@ static int ext3_remount (struct super_bl
+ 
+ 	if (sbi->s_mount_opt & EXT3_MOUNT_ABORT)
+ 		ext3_abort(sb, __FUNCTION__, "Abort forced by user");
++	if ((sbi->s_mount_opt & EXT3_MOUNT_TAGGED) &&
++		!(sb->s_flags & MS_TAGGED)) {
++		printk("EXT3-fs: %s: tagging not permitted on remount.\n",
++			sb->s_id);
++		return -EINVAL;
++	}
+ 
+ 	sb->s_flags = (sb->s_flags & ~MS_POSIXACL) |
+ 		((sbi->s_mount_opt & EXT3_MOUNT_POSIX_ACL) ? MS_POSIXACL : 0);
+--- linux-2.6.22/fs/ext3/symlink.c	2007-05-02 19:25:17 +0200
++++ linux-2.6.22-vs2.2.0-rc5/fs/ext3/symlink.c	2007-06-15 02:37:03 +0200
+@@ -40,6 +40,7 @@ const struct inode_operations ext3_symli
+ 	.listxattr	= ext3_listxattr,
+ 	.removexattr	= generic_removexattr,
+ #endif
++	.sync_flags	= ext3_sync_flags,
+ };
+ 
+ const struct inode_operations ext3_fast_symlink_inode_operations = {
+@@ -51,4 +52,5 @@ const struct inode_operations ext3_fast_
+ 	.listxattr	= ext3_listxattr,
+ 	.removexattr	= generic_removexattr,
+ #endif
++	.sync_flags	= ext3_sync_flags,
+ };
+--- linux-2.6.22/fs/ext3/xattr.c	2007-05-02 19:25:17 +0200
++++ linux-2.6.22-vs2.2.0-rc5/fs/ext3/xattr.c	2007-06-15 02:37:03 +0200
+@@ -58,6 +58,7 @@
+ #include <linux/mbcache.h>
+ #include <linux/quotaops.h>
+ #include <linux/rwsem.h>
++#include <linux/vs_dlimit.h>
+ #include "xattr.h"
+ #include "acl.h"
+ 
+@@ -497,6 +498,7 @@ ext3_xattr_release_block(handle_t *handl
+ 		error = ext3_journal_dirty_metadata(handle, bh);
+ 		if (IS_SYNC(inode))
+ 			handle->h_sync = 1;
++			DLIMIT_FREE_BLOCK(inode, 1);
+ 		DQUOT_FREE_BLOCK(inode, 1);
+ 		ea_bdebug(bh, "refcount now=%d; releasing",
+ 			  le32_to_cpu(BHDR(bh)->h_refcount));
+@@ -771,11 +773,14 @@ inserted:
+ 			if (new_bh == bs->bh)
+ 				ea_bdebug(new_bh, "keeping");
+ 			else {
++				error = -ENOSPC;
++				if (DLIMIT_ALLOC_BLOCK(inode, 1))
++					goto cleanup;
+ 				/* The old block is released after updating
+ 				   the inode. */
+ 				error = -EDQUOT;
+ 				if (DQUOT_ALLOC_BLOCK(inode, 1))
+-					goto cleanup;
++					goto cleanup_dlimit;
+ 				error = ext3_journal_get_write_access(handle,
+ 								      new_bh);
+ 				if (error)
+@@ -852,6 +857,8 @@ cleanup:
+ 
+ cleanup_dquot:
+ 	DQUOT_FREE_BLOCK(inode, 1);
++cleanup_dlimit:
++	DLIMIT_FREE_BLOCK(inode, 1);
+ 	goto cleanup;
+ 
+ bad_block:
+--- linux-2.6.22/fs/ext4/balloc.c	2007-07-09 13:19:23 +0200
++++ linux-2.6.22-vs2.2.0-rc5/fs/ext4/balloc.c	2007-06-15 02:37:03 +0200
+@@ -19,6 +19,8 @@
+ #include <linux/ext4_jbd2.h>
+ #include <linux/quotaops.h>
+ #include <linux/buffer_head.h>
++#include <linux/vs_dlimit.h>
++#include <linux/vs_tag.h>
+ 
+ /*
+  * balloc.c contains the blocks allocation and deallocation routines
+@@ -630,8 +632,10 @@ void ext4_free_blocks(handle_t *handle, 
+ 		return;
+ 	}
+ 	ext4_free_blocks_sb(handle, sb, block, count, &dquot_freed_blocks);
+-	if (dquot_freed_blocks)
++	if (dquot_freed_blocks) {
++		DLIMIT_FREE_BLOCK(inode, dquot_freed_blocks);
+ 		DQUOT_FREE_BLOCK(inode, dquot_freed_blocks);
++	}
+ 	return;
+ }
+ 
+@@ -1370,18 +1374,33 @@ out:
+  *
+  * Check if filesystem has at least 1 free block available for allocation.
+  */
+-static int ext4_has_free_blocks(struct ext4_sb_info *sbi)
++static int ext4_has_free_blocks(struct super_block *sb)
+ {
++	struct ext4_sb_info *sbi = EXT4_SB(sb);
+ 	ext4_fsblk_t free_blocks, root_blocks;
++	int cond;
+ 
+ 	free_blocks = percpu_counter_read_positive(&sbi->s_freeblocks_counter);
+ 	root_blocks = ext4_r_blocks_count(sbi->s_es);
+-	if (free_blocks < root_blocks + 1 && !capable(CAP_SYS_RESOURCE) &&
++
++	vxdprintk(VXD_CBIT(dlim, 3),
++		"ext4_has_free_blocks(%p): free=%llu, root=%llu",
++		sb, free_blocks, root_blocks);
++
++	DLIMIT_ADJUST_BLOCK(sb, dx_current_tag(), &free_blocks, &root_blocks);
++
++	cond = (free_blocks < root_blocks + 1 &&
++		!capable(CAP_SYS_RESOURCE) &&
+ 		sbi->s_resuid != current->fsuid &&
+-		(sbi->s_resgid == 0 || !in_group_p (sbi->s_resgid))) {
+-		return 0;
+-	}
+-	return 1;
++		(sbi->s_resgid == 0 || !in_group_p (sbi->s_resgid)));
++
++	vxdprintk(VXD_CBIT(dlim, 3),
++		"ext4_has_free_blocks(%p): %llu<%llu+1, %c, %u!=%u r=%d",
++		sb, free_blocks, root_blocks,
++		!capable(CAP_SYS_RESOURCE)?'1':'0',
++		sbi->s_resuid, current->fsuid, cond?0:1);
++
++	return (cond ? 0 : 1);
+ }
+ 
+ /**
+@@ -1398,7 +1417,7 @@ static int ext4_has_free_blocks(struct e
+  */
+ int ext4_should_retry_alloc(struct super_block *sb, int *retries)
+ {
+-	if (!ext4_has_free_blocks(EXT4_SB(sb)) || (*retries)++ > 3)
++	if (!ext4_has_free_blocks(sb) || (*retries)++ > 3)
+ 		return 0;
+ 
+ 	jbd_debug(1, "%s: retrying operation after ENOSPC\n", sb->s_id);
+@@ -1461,6 +1480,8 @@ ext4_fsblk_t ext4_new_blocks(handle_t *h
+ 		*errp = -EDQUOT;
+ 		return 0;
+ 	}
++	if (DLIMIT_ALLOC_BLOCK(inode, 1))
++	    goto out_dlimit;
+ 
+ 	sbi = EXT4_SB(sb);
+ 	es = EXT4_SB(sb)->s_es;
+@@ -1477,7 +1498,7 @@ ext4_fsblk_t ext4_new_blocks(handle_t *h
+ 	if (block_i && ((windowsz = block_i->rsv_window_node.rsv_goal_size) > 0))
+ 		my_rsv = &block_i->rsv_window_node;
+ 
+-	if (!ext4_has_free_blocks(sbi)) {
++	if (!ext4_has_free_blocks(sb)) {
+ 		*errp = -ENOSPC;
+ 		goto out;
+ 	}
+@@ -1667,6 +1688,9 @@ allocated:
+ io_error:
+ 	*errp = -EIO;
+ out:
++	if (!performed_allocation)
++		DLIMIT_FREE_BLOCK(inode, 1);
++out_dlimit:
+ 	if (fatal) {
+ 		*errp = fatal;
+ 		ext4_std_error(sb, fatal);
+--- linux-2.6.22/fs/ext4/file.c	2007-05-02 19:25:17 +0200
++++ linux-2.6.22-vs2.2.0-rc5/fs/ext4/file.c	2007-06-15 02:37:03 +0200
+@@ -121,6 +121,7 @@ const struct file_operations ext4_file_o
+ 	.release	= ext4_release_file,
+ 	.fsync		= ext4_sync_file,
+ 	.sendfile	= generic_file_sendfile,
++	.sendpage	= generic_file_sendpage,
+ 	.splice_read	= generic_file_splice_read,
+ 	.splice_write	= generic_file_splice_write,
+ };
+@@ -135,5 +136,6 @@ const struct inode_operations ext4_file_
+ 	.removexattr	= generic_removexattr,
+ #endif
+ 	.permission	= ext4_permission,
++	.sync_flags	= ext4_sync_flags,
+ };
+ 
+--- linux-2.6.22/fs/ext4/ialloc.c	2006-11-30 21:19:20 +0100
++++ linux-2.6.22-vs2.2.0-rc5/fs/ext4/ialloc.c	2007-06-15 02:37:03 +0200
+@@ -24,6 +24,8 @@
+ #include <linux/random.h>
+ #include <linux/bitops.h>
+ #include <linux/blkdev.h>
++#include <linux/vs_dlimit.h>
++#include <linux/vs_tag.h>
+ #include <asm/byteorder.h>
+ 
+ #include "xattr.h"
+@@ -127,6 +129,7 @@ void ext4_free_inode (handle_t *handle, 
+ 	ext4_xattr_delete_inode(handle, inode);
+ 	DQUOT_FREE_INODE(inode);
+ 	DQUOT_DROP(inode);
++	DLIMIT_FREE_INODE(inode);
+ 
+ 	is_directory = S_ISDIR(inode->i_mode);
+ 
+@@ -448,6 +451,12 @@ struct inode *ext4_new_inode(handle_t *h
+ 	inode = new_inode(sb);
+ 	if (!inode)
+ 		return ERR_PTR(-ENOMEM);
++
++	inode->i_tag = dx_current_fstag(sb);
++	if (DLIMIT_ALLOC_INODE(inode)) {
++		err = -ENOSPC;
++		goto out_dlimit;
++	}
+ 	ei = EXT4_I(inode);
+ 
+ 	sbi = EXT4_SB(sb);
+@@ -569,7 +578,8 @@ got:
+ 	ei->i_dir_start_lookup = 0;
+ 	ei->i_disksize = 0;
+ 
+-	ei->i_flags = EXT4_I(dir)->i_flags & ~EXT4_INDEX_FL;
++	ei->i_flags = EXT4_I(dir)->i_flags &
++		~(EXT4_INDEX_FL|EXT4_IUNLINK_FL|EXT4_BARRIER_FL);
+ 	if (S_ISLNK(mode))
+ 		ei->i_flags &= ~(EXT4_IMMUTABLE_FL|EXT4_APPEND_FL);
+ 	/* dirsync only applies to directories */
+@@ -635,6 +645,8 @@ got:
+ fail:
+ 	ext4_std_error(sb, err);
+ out:
++	DLIMIT_FREE_INODE(inode);
++out_dlimit:
+ 	iput(inode);
+ 	ret = ERR_PTR(err);
+ really_out:
+@@ -646,6 +658,7 @@ fail_free_drop:
+ 
+ fail_drop:
+ 	DQUOT_DROP(inode);
++	DLIMIT_FREE_INODE(inode);
+ 	inode->i_flags |= S_NOQUOTA;
+ 	inode->i_nlink = 0;
+ 	iput(inode);
+--- linux-2.6.22/fs/ext4/inode.c	2007-07-09 13:19:23 +0200
++++ linux-2.6.22-vs2.2.0-rc5/fs/ext4/inode.c	2007-07-07 03:52:53 +0200
+@@ -36,6 +36,7 @@
+ #include <linux/mpage.h>
+ #include <linux/uio.h>
+ #include <linux/bio.h>
++#include <linux/vs_tag.h>
+ #include "xattr.h"
+ #include "acl.h"
+ 
+@@ -2244,7 +2245,7 @@ void ext4_truncate(struct inode *inode)
+ 		return;
+ 	if (ext4_inode_is_fast_symlink(inode))
+ 		return;
+-	if (IS_APPEND(inode) || IS_IMMUTABLE(inode))
++	if (IS_APPEND(inode) || IS_IXORUNLINK(inode))
+ 		return;
+ 
+ 	/*
+@@ -2570,19 +2571,65 @@ void ext4_set_inode_flags(struct inode *
+ {
+ 	unsigned int flags = EXT4_I(inode)->i_flags;
+ 
+-	inode->i_flags &= ~(S_SYNC|S_APPEND|S_IMMUTABLE|S_NOATIME|S_DIRSYNC);
++	inode->i_flags &= ~(S_IMMUTABLE | S_IUNLINK | S_BARRIER |
++		S_SYNC | S_APPEND | S_NOATIME | S_DIRSYNC);
++
++	if (flags & EXT4_IMMUTABLE_FL)
++		inode->i_flags |= S_IMMUTABLE;
++	if (flags & EXT4_IUNLINK_FL)
++		inode->i_flags |= S_IUNLINK;
++	if (flags & EXT4_BARRIER_FL)
++		inode->i_flags |= S_BARRIER;
++
+ 	if (flags & EXT4_SYNC_FL)
+ 		inode->i_flags |= S_SYNC;
+ 	if (flags & EXT4_APPEND_FL)
+ 		inode->i_flags |= S_APPEND;
+-	if (flags & EXT4_IMMUTABLE_FL)
+-		inode->i_flags |= S_IMMUTABLE;
+ 	if (flags & EXT4_NOATIME_FL)
+ 		inode->i_flags |= S_NOATIME;
+ 	if (flags & EXT4_DIRSYNC_FL)
+ 		inode->i_flags |= S_DIRSYNC;
+ }
+ 
++int ext4_sync_flags(struct inode *inode)
++{
++	unsigned int oldflags, newflags;
++	int err = 0;
++
++	oldflags = EXT4_I(inode)->i_flags;
++	newflags = oldflags & ~(EXT4_IMMUTABLE_FL |
++		EXT4_IUNLINK_FL | EXT4_BARRIER_FL);
++
++	if (IS_IMMUTABLE(inode))
++		newflags |= EXT4_IMMUTABLE_FL;
++	if (IS_IUNLINK(inode))
++		newflags |= EXT4_IUNLINK_FL;
++	if (IS_BARRIER(inode))
++		newflags |= EXT4_BARRIER_FL;
++
++	if (oldflags ^ newflags) {
++		handle_t *handle;
++		struct ext4_iloc iloc;
++
++		handle = ext4_journal_start(inode, 1);
++		if (IS_ERR(handle))
++			return PTR_ERR(handle);
++		if (IS_SYNC(inode))
++			handle->h_sync = 1;
++		err = ext4_reserve_inode_write(handle, inode, &iloc);
++		if (err)
++			goto flags_err;
++
++		EXT4_I(inode)->i_flags = newflags;
++		inode->i_ctime = CURRENT_TIME;
++
++		err = ext4_mark_iloc_dirty(handle, inode, &iloc);
++	flags_err:
++		ext4_journal_stop(handle);
++	}
++	return err;
++}
++
+ void ext4_read_inode(struct inode * inode)
+ {
+ 	struct ext4_iloc iloc;
+@@ -2590,6 +2637,8 @@ void ext4_read_inode(struct inode * inod
+ 	struct ext4_inode_info *ei = EXT4_I(inode);
+ 	struct buffer_head *bh;
+ 	int block;
++	uid_t uid;
++	gid_t gid;
+ 
+ #ifdef CONFIG_EXT4DEV_FS_POSIX_ACL
+ 	ei->i_acl = EXT4_ACL_NOT_CACHED;
+@@ -2602,12 +2651,17 @@ void ext4_read_inode(struct inode * inod
+ 	bh = iloc.bh;
+ 	raw_inode = ext4_raw_inode(&iloc);
+ 	inode->i_mode = le16_to_cpu(raw_inode->i_mode);
+-	inode->i_uid = (uid_t)le16_to_cpu(raw_inode->i_uid_low);
+-	inode->i_gid = (gid_t)le16_to_cpu(raw_inode->i_gid_low);
++	uid = (uid_t)le16_to_cpu(raw_inode->i_uid_low);
++	gid = (gid_t)le16_to_cpu(raw_inode->i_gid_low);
+ 	if(!(test_opt (inode->i_sb, NO_UID32))) {
+-		inode->i_uid |= le16_to_cpu(raw_inode->i_uid_high) << 16;
+-		inode->i_gid |= le16_to_cpu(raw_inode->i_gid_high) << 16;
++		uid |= le16_to_cpu(raw_inode->i_uid_high) << 16;
++		gid |= le16_to_cpu(raw_inode->i_gid_high) << 16;
+ 	}
++	inode->i_uid = INOTAG_UID(DX_TAG(inode), uid, gid);
++	inode->i_gid = INOTAG_GID(DX_TAG(inode), uid, gid);
++	inode->i_tag = INOTAG_TAG(DX_TAG(inode), uid, gid,
++		le16_to_cpu(raw_inode->i_raw_tag));
++
+ 	inode->i_nlink = le16_to_cpu(raw_inode->i_links_count);
+ 	inode->i_size = le32_to_cpu(raw_inode->i_size);
+ 	inode->i_atime.tv_sec = (signed)le32_to_cpu(raw_inode->i_atime);
+@@ -2737,6 +2791,8 @@ static int ext4_do_update_inode(handle_t
+ 	struct ext4_inode *raw_inode = ext4_raw_inode(iloc);
+ 	struct ext4_inode_info *ei = EXT4_I(inode);
+ 	struct buffer_head *bh = iloc->bh;
++	uid_t uid = TAGINO_UID(DX_TAG(inode), inode->i_uid, inode->i_tag);
++	gid_t gid = TAGINO_GID(DX_TAG(inode), inode->i_gid, inode->i_tag);
+ 	int err = 0, rc, block;
+ 
+ 	/* For fields not not tracking in the in-memory inode,
+@@ -2746,29 +2802,32 @@ static int ext4_do_update_inode(handle_t
+ 
+ 	raw_inode->i_mode = cpu_to_le16(inode->i_mode);
+ 	if(!(test_opt(inode->i_sb, NO_UID32))) {
+-		raw_inode->i_uid_low = cpu_to_le16(low_16_bits(inode->i_uid));
+-		raw_inode->i_gid_low = cpu_to_le16(low_16_bits(inode->i_gid));
++		raw_inode->i_uid_low = cpu_to_le16(low_16_bits(uid));
++		raw_inode->i_gid_low = cpu_to_le16(low_16_bits(gid));
+ /*
+  * Fix up interoperability with old kernels. Otherwise, old inodes get
+  * re-used with the upper 16 bits of the uid/gid intact
+  */
+ 		if(!ei->i_dtime) {
+ 			raw_inode->i_uid_high =
+-				cpu_to_le16(high_16_bits(inode->i_uid));
++				cpu_to_le16(high_16_bits(uid));
+ 			raw_inode->i_gid_high =
+-				cpu_to_le16(high_16_bits(inode->i_gid));
++				cpu_to_le16(high_16_bits(gid));
+ 		} else {
+ 			raw_inode->i_uid_high = 0;
+ 			raw_inode->i_gid_high = 0;
+ 		}
+ 	} else {
+ 		raw_inode->i_uid_low =
+-			cpu_to_le16(fs_high2lowuid(inode->i_uid));
++			cpu_to_le16(fs_high2lowuid(uid));
+ 		raw_inode->i_gid_low =
+-			cpu_to_le16(fs_high2lowgid(inode->i_gid));
++			cpu_to_le16(fs_high2lowgid(gid));
+ 		raw_inode->i_uid_high = 0;
+ 		raw_inode->i_gid_high = 0;
+ 	}
++#ifdef CONFIG_TAGGING_INTERN
++	raw_inode->i_raw_tag = cpu_to_le16(inode->i_tag);
++#endif
+ 	raw_inode->i_links_count = cpu_to_le16(inode->i_nlink);
+ 	raw_inode->i_size = cpu_to_le32(ei->i_disksize);
+ 	raw_inode->i_atime = cpu_to_le32(inode->i_atime.tv_sec);
+@@ -2925,7 +2984,8 @@ int ext4_setattr(struct dentry *dentry, 
+ 		return error;
+ 
+ 	if ((ia_valid & ATTR_UID && attr->ia_uid != inode->i_uid) ||
+-		(ia_valid & ATTR_GID && attr->ia_gid != inode->i_gid)) {
++		(ia_valid & ATTR_GID && attr->ia_gid != inode->i_gid) ||
++		(ia_valid & ATTR_TAG && attr->ia_tag != inode->i_tag)) {
+ 		handle_t *handle;
+ 
+ 		/* (user+group)*(old+new) structure, inode write (sb,
+@@ -2947,6 +3007,8 @@ int ext4_setattr(struct dentry *dentry, 
+ 			inode->i_uid = attr->ia_uid;
+ 		if (attr->ia_valid & ATTR_GID)
+ 			inode->i_gid = attr->ia_gid;
++		if ((attr->ia_valid & ATTR_TAG) && IS_TAGGED(inode))
++			inode->i_tag = attr->ia_tag;
+ 		error = ext4_mark_inode_dirty(handle, inode);
+ 		ext4_journal_stop(handle);
+ 	}
+--- linux-2.6.22/fs/ext4/ioctl.c	2007-02-06 03:01:18 +0100
++++ linux-2.6.22-vs2.2.0-rc5/fs/ext4/ioctl.c	2007-06-15 02:37:03 +0200
+@@ -8,6 +8,7 @@
+  */
+ 
+ #include <linux/fs.h>
++#include <linux/mount.h>
+ #include <linux/jbd2.h>
+ #include <linux/capability.h>
+ #include <linux/ext4_fs.h>
+@@ -15,6 +16,7 @@
+ #include <linux/time.h>
+ #include <linux/compat.h>
+ #include <linux/smp_lock.h>
++#include <linux/vs_tag.h>
+ #include <asm/uaccess.h>
+ 
+ int ext4_ioctl (struct inode * inode, struct file * filp, unsigned int cmd,
+@@ -37,7 +39,8 @@ int ext4_ioctl (struct inode * inode, st
+ 		unsigned int oldflags;
+ 		unsigned int jflag;
+ 
+-		if (IS_RDONLY(inode))
++		if (IS_RDONLY(inode) ||
++			(filp && MNT_IS_RDONLY(filp->f_vfsmnt)))
+ 			return -EROFS;
+ 
+ 		if ((current->fsuid != inode->i_uid) && !capable(CAP_FOWNER))
+@@ -61,7 +64,9 @@ int ext4_ioctl (struct inode * inode, st
+ 		 *
+ 		 * This test looks nicer. Thanks to Pauline Middelink
+ 		 */
+-		if ((flags ^ oldflags) & (EXT4_APPEND_FL | EXT4_IMMUTABLE_FL)) {
++		if ((oldflags & EXT4_IMMUTABLE_FL) ||
++			((flags ^ oldflags) & (EXT4_APPEND_FL |
++			EXT4_IMMUTABLE_FL | EXT4_IUNLINK_FL))) {
+ 			if (!capable(CAP_LINUX_IMMUTABLE)) {
+ 				mutex_unlock(&inode->i_mutex);
+ 				return -EPERM;
+@@ -123,7 +128,8 @@ flags_err:
+ 
+ 		if ((current->fsuid != inode->i_uid) && !capable(CAP_FOWNER))
+ 			return -EPERM;
+-		if (IS_RDONLY(inode))
++		if (IS_RDONLY(inode) ||
++			(filp && MNT_IS_RDONLY(filp->f_vfsmnt)))
+ 			return -EROFS;
+ 		if (get_user(generation, (int __user *) arg))
+ 			return -EFAULT;
+@@ -177,7 +183,8 @@ flags_err:
+ 		if (!test_opt(inode->i_sb, RESERVATION) ||!S_ISREG(inode->i_mode))
+ 			return -ENOTTY;
+ 
+-		if (IS_RDONLY(inode))
++		if (IS_RDONLY(inode) ||
++			(filp && MNT_IS_RDONLY(filp->f_vfsmnt)))
+ 			return -EROFS;
+ 
+ 		if ((current->fsuid != inode->i_uid) && !capable(CAP_FOWNER))
+@@ -212,7 +219,8 @@ flags_err:
+ 		if (!capable(CAP_SYS_RESOURCE))
+ 			return -EPERM;
+ 
+-		if (IS_RDONLY(inode))
++		if (IS_RDONLY(inode) ||
++			(filp && MNT_IS_RDONLY(filp->f_vfsmnt)))
+ 			return -EROFS;
+ 
+ 		if (get_user(n_blocks_count, (__u32 __user *)arg))
+@@ -233,7 +241,8 @@ flags_err:
+ 		if (!capable(CAP_SYS_RESOURCE))
+ 			return -EPERM;
+ 
+-		if (IS_RDONLY(inode))
++		if (IS_RDONLY(inode) ||
++			(filp && MNT_IS_RDONLY(filp->f_vfsmnt)))
+ 			return -EROFS;
+ 
+ 		if (copy_from_user(&input, (struct ext4_new_group_input __user *)arg,
+@@ -248,6 +257,39 @@ flags_err:
+ 		return err;
+ 	}
+ 
++#if defined(CONFIG_VSERVER_LEGACY) && !defined(CONFIG_TAGGING_NONE)
++	case EXT4_IOC_SETTAG: {
++		handle_t *handle;
++		struct ext4_iloc iloc;
++		int tag;
++		int err;
++
++		/* fixme: if stealth, return -ENOTTY */
++		if (!capable(CAP_CONTEXT))
++			return -EPERM;
++		if (IS_RDONLY(inode))
++			return -EROFS;
++		if (!(inode->i_sb->s_flags & MS_TAGGED))
++			return -ENOSYS;
++		if (get_user(tag, (int __user *) arg))
++			return -EFAULT;
++
++		handle = ext4_journal_start(inode, 1);
++		if (IS_ERR(handle))
++			return PTR_ERR(handle);
++		err = ext4_reserve_inode_write(handle, inode, &iloc);
++		if (err)
++			return err;
++
++		inode->i_tag = (tag & 0xFFFF);
++		inode->i_ctime = CURRENT_TIME;
++
++		err = ext4_mark_iloc_dirty(handle, inode, &iloc);
++		ext4_journal_stop(handle);
++		return err;
++	}
++#endif
++
+ 	default:
+ 		return -ENOTTY;
+ 	}
+--- linux-2.6.22/fs/ext4/namei.c	2007-07-09 13:19:23 +0200
++++ linux-2.6.22-vs2.2.0-rc5/fs/ext4/namei.c	2007-06-15 03:11:13 +0200
+@@ -36,6 +36,7 @@
+ #include <linux/quotaops.h>
+ #include <linux/buffer_head.h>
+ #include <linux/bio.h>
++#include <linux/vs_tag.h>
+ 
+ #include "namei.h"
+ #include "xattr.h"
+@@ -1017,6 +1018,7 @@ static struct dentry *ext4_lookup(struct
+ 
+ 		if (!inode)
+ 			return ERR_PTR(-EACCES);
++		dx_propagate_tag(nd, inode);
+ 	}
+ 	return d_splice_alias(inode, dentry);
+ }
+@@ -2384,6 +2386,7 @@ const struct inode_operations ext4_dir_i
+ 	.removexattr	= generic_removexattr,
+ #endif
+ 	.permission	= ext4_permission,
++	.sync_flags	= ext4_sync_flags,
+ };
+ 
+ const struct inode_operations ext4_special_inode_operations = {
+@@ -2395,4 +2398,5 @@ const struct inode_operations ext4_speci
+ 	.removexattr	= generic_removexattr,
+ #endif
+ 	.permission	= ext4_permission,
++	.sync_flags	= ext4_sync_flags,
+ };
+--- linux-2.6.22/fs/ext4/super.c	2007-07-09 13:19:23 +0200
++++ linux-2.6.22-vs2.2.0-rc5/fs/ext4/super.c	2007-06-15 02:37:03 +0200
+@@ -725,7 +725,7 @@ enum {
+ 	Opt_usrjquota, Opt_grpjquota, Opt_offusrjquota, Opt_offgrpjquota,
+ 	Opt_jqfmt_vfsold, Opt_jqfmt_vfsv0, Opt_quota, Opt_noquota,
+ 	Opt_ignore, Opt_barrier, Opt_err, Opt_resize, Opt_usrquota,
+-	Opt_grpquota, Opt_extents,
++	Opt_grpquota, Opt_extents, Opt_tag, Opt_notag, Opt_tagid
+ };
+ 
+ static match_table_t tokens = {
+@@ -776,6 +776,10 @@ static match_table_t tokens = {
+ 	{Opt_usrquota, "usrquota"},
+ 	{Opt_barrier, "barrier=%u"},
+ 	{Opt_extents, "extents"},
++	{Opt_tag, "tag"},
++	{Opt_notag, "notag"},
++	{Opt_tagid, "tagid=%u"},
++	{Opt_tag, "tagxid"},
+ 	{Opt_err, NULL},
+ 	{Opt_resize, "resize"},
+ };
+@@ -869,6 +873,20 @@ static int parse_options (char *options,
+ 		case Opt_nouid32:
+ 			set_opt (sbi->s_mount_opt, NO_UID32);
+ 			break;
++#ifndef CONFIG_TAGGING_NONE
++		case Opt_tag:
++			set_opt (sbi->s_mount_opt, TAGGED);
++			break;
++		case Opt_notag:
++			clear_opt (sbi->s_mount_opt, TAGGED);
++			break;
++#endif
++#ifdef CONFIG_PROPAGATE
++		case Opt_tagid:
++			/* use args[0] */
++			set_opt (sbi->s_mount_opt, TAGGED);
++			break;
++#endif
+ 		case Opt_nocheck:
+ 			clear_opt (sbi->s_mount_opt, CHECK);
+ 			break;
+@@ -1546,6 +1564,9 @@ static int ext4_fill_super (struct super
+ 			    NULL, 0))
+ 		goto failed_mount;
+ 
++	if (EXT4_SB(sb)->s_mount_opt & EXT4_MOUNT_TAGGED)
++		sb->s_flags |= MS_TAGGED;
++
+ 	sb->s_flags = (sb->s_flags & ~MS_POSIXACL) |
+ 		((sbi->s_mount_opt & EXT4_MOUNT_POSIX_ACL) ? MS_POSIXACL : 0);
+ 
+@@ -2377,6 +2398,12 @@ static int ext4_remount (struct super_bl
+ 
+ 	if (sbi->s_mount_opt & EXT4_MOUNT_ABORT)
+ 		ext4_abort(sb, __FUNCTION__, "Abort forced by user");
++	if ((sbi->s_mount_opt & EXT4_MOUNT_TAGGED) &&
++		!(sb->s_flags & MS_TAGGED)) {
++		printk("EXT4-fs: %s: tagging not permitted on remount.\n",
++			sb->s_id);
++		return -EINVAL;
++	}
+ 
+ 	sb->s_flags = (sb->s_flags & ~MS_POSIXACL) |
+ 		((sbi->s_mount_opt & EXT4_MOUNT_POSIX_ACL) ? MS_POSIXACL : 0);
+--- linux-2.6.22/fs/ext4/symlink.c	2007-05-02 19:25:17 +0200
++++ linux-2.6.22-vs2.2.0-rc5/fs/ext4/symlink.c	2007-06-15 02:37:03 +0200
+@@ -40,6 +40,7 @@ const struct inode_operations ext4_symli
+ 	.listxattr	= ext4_listxattr,
+ 	.removexattr	= generic_removexattr,
+ #endif
++	.sync_flags	= ext4_sync_flags,
+ };
+ 
+ const struct inode_operations ext4_fast_symlink_inode_operations = {
+@@ -51,4 +52,5 @@ const struct inode_operations ext4_fast_
+ 	.listxattr	= ext4_listxattr,
+ 	.removexattr	= generic_removexattr,
+ #endif
++	.sync_flags	= ext4_sync_flags,
+ };
+--- linux-2.6.22/fs/ext4/xattr.c	2007-05-02 19:25:17 +0200
++++ linux-2.6.22-vs2.2.0-rc5/fs/ext4/xattr.c	2007-06-15 02:37:03 +0200
+@@ -58,6 +58,7 @@
+ #include <linux/mbcache.h>
+ #include <linux/quotaops.h>
+ #include <linux/rwsem.h>
++#include <linux/vs_dlimit.h>
+ #include "xattr.h"
+ #include "acl.h"
+ 
+@@ -496,6 +497,7 @@ ext4_xattr_release_block(handle_t *handl
+ 		error = ext4_journal_dirty_metadata(handle, bh);
+ 		if (IS_SYNC(inode))
+ 			handle->h_sync = 1;
++			DLIMIT_FREE_BLOCK(inode, 1);
+ 		DQUOT_FREE_BLOCK(inode, 1);
+ 		ea_bdebug(bh, "refcount now=%d; releasing",
+ 			  le32_to_cpu(BHDR(bh)->h_refcount));
+@@ -769,11 +771,14 @@ inserted:
+ 			if (new_bh == bs->bh)
+ 				ea_bdebug(new_bh, "keeping");
+ 			else {
++				error = -ENOSPC;
++				if (DLIMIT_ALLOC_BLOCK(inode, 1))
++					goto cleanup;
+ 				/* The old block is released after updating
+ 				   the inode. */
+ 				error = -EDQUOT;
+ 				if (DQUOT_ALLOC_BLOCK(inode, 1))
+-					goto cleanup;
++					goto cleanup_dlimit;
+ 				error = ext4_journal_get_write_access(handle,
+ 								      new_bh);
+ 				if (error)
+@@ -850,6 +855,8 @@ cleanup:
+ 
+ cleanup_dquot:
+ 	DQUOT_FREE_BLOCK(inode, 1);
++cleanup_dlimit:
++	DLIMIT_FREE_BLOCK(inode, 1);
+ 	goto cleanup;
+ 
+ bad_block:
+--- linux-2.6.22/fs/fcntl.c	2007-02-06 03:01:18 +0100
++++ linux-2.6.22-vs2.2.0-rc5/fs/fcntl.c	2007-06-15 02:37:03 +0200
+@@ -18,6 +18,7 @@
+ #include <linux/ptrace.h>
+ #include <linux/signal.h>
+ #include <linux/rcupdate.h>
++#include <linux/vs_limit.h>
+ 
+ #include <asm/poll.h>
+ #include <asm/siginfo.h>
+@@ -84,6 +85,8 @@ repeat:
+ 	error = -EMFILE;
+ 	if (newfd >= current->signal->rlim[RLIMIT_NOFILE].rlim_cur)
+ 		goto out;
++	if (!vx_files_avail(1))
++		goto out;
+ 
+ 	error = expand_files(files, newfd);
+ 	if (error < 0)
+@@ -124,6 +127,7 @@ static int dupfd(struct file *file, unsi
+ 		FD_SET(fd, fdt->open_fds);
+ 		FD_CLR(fd, fdt->close_on_exec);
+ 		spin_unlock(&files->file_lock);
++		vx_openfd_inc(fd);
+ 		fd_install(fd, file);
+ 	} else {
+ 		spin_unlock(&files->file_lock);
+@@ -176,6 +180,9 @@ asmlinkage long sys_dup2(unsigned int ol
+ 
+ 	if (tofree)
+ 		filp_close(tofree, files);
++	else
++		vx_openfd_inc(newfd);	/* fd was unused */
++
+ 	err = newfd;
+ out:
+ 	return err;
+--- linux-2.6.22/fs/file_table.c	2007-07-09 13:19:23 +0200
++++ linux-2.6.22-vs2.2.0-rc5/fs/file_table.c	2007-06-15 02:37:03 +0200
+@@ -20,6 +20,8 @@
+ #include <linux/fsnotify.h>
+ #include <linux/sysctl.h>
+ #include <linux/percpu_counter.h>
++#include <linux/vs_limit.h>
++#include <linux/vs_context.h>
+ 
+ #include <asm/atomic.h>
+ 
+@@ -119,6 +121,8 @@ struct file *get_empty_filp(void)
+ 	f->f_gid = tsk->fsgid;
+ 	eventpoll_init_file(f);
+ 	/* f->f_version: 0 */
++	f->f_xid = vx_current_xid();
++	vx_files_inc(f);
+ 	return f;
+ 
+ over:
+@@ -174,6 +178,8 @@ void fastcall __fput(struct file *file)
+ 	if (file->f_mode & FMODE_WRITE)
+ 		put_write_access(inode);
+ 	put_pid(file->f_owner.pid);
++	vx_files_dec(file);
++	file->f_xid = 0;
+ 	file_kill(file);
+ 	file->f_path.dentry = NULL;
+ 	file->f_path.mnt = NULL;
+@@ -239,6 +245,8 @@ void put_filp(struct file *file)
+ {
+ 	if (atomic_dec_and_test(&file->f_count)) {
+ 		security_file_free(file);
++		vx_files_dec(file);
++		file->f_xid = 0;
+ 		file_kill(file);
+ 		file_free(file);
+ 	}
+--- linux-2.6.22/fs/hfsplus/ioctl.c	2006-11-30 21:19:25 +0100
++++ linux-2.6.22-vs2.2.0-rc5/fs/hfsplus/ioctl.c	2007-06-15 02:37:03 +0200
+@@ -16,6 +16,7 @@
+ #include <linux/fs.h>
+ #include <linux/sched.h>
+ #include <linux/xattr.h>
++#include <linux/mount.h>
+ #include <asm/uaccess.h>
+ #include "hfsplus_fs.h"
+ 
+@@ -35,7 +36,8 @@ int hfsplus_ioctl(struct inode *inode, s
+ 			flags |= FS_NODUMP_FL; /* EXT2_NODUMP_FL */
+ 		return put_user(flags, (int __user *)arg);
+ 	case HFSPLUS_IOC_EXT2_SETFLAGS: {
+-		if (IS_RDONLY(inode))
++		if (IS_RDONLY(inode) ||
++			(filp && MNT_IS_RDONLY(filp->f_vfsmnt)))
+ 			return -EROFS;
+ 
+ 		if ((current->fsuid != inode->i_uid) && !capable(CAP_FOWNER))
+--- linux-2.6.22/fs/inode.c	2007-07-09 13:19:24 +0200
++++ linux-2.6.22-vs2.2.0-rc5/fs/inode.c	2007-06-15 02:37:03 +0200
+@@ -115,6 +115,9 @@ static struct inode *alloc_inode(struct 
+ 		struct address_space * const mapping = &inode->i_data;
+ 
+ 		inode->i_sb = sb;
++
++		/* essential because of inode slab reuse */
++		inode->i_tag = 0;
+ 		inode->i_blkbits = sb->s_blocksize_bits;
+ 		inode->i_flags = 0;
+ 		atomic_set(&inode->i_count, 1);
+@@ -231,6 +234,8 @@ void __iget(struct inode * inode)
+ 	inodes_stat.nr_unused--;
+ }
+ 
++EXPORT_SYMBOL_GPL(__iget);
++
+ /**
+  * clear_inode - clear an inode
+  * @inode: inode to clear
+--- linux-2.6.22/fs/ioctl.c	2007-07-09 13:19:24 +0200
++++ linux-2.6.22-vs2.2.0-rc5/fs/ioctl.c	2007-06-15 03:12:40 +0200
+@@ -13,10 +13,19 @@
+ #include <linux/security.h>
+ #include <linux/module.h>
+ #include <linux/kallsyms.h>
++#include <linux/proc_fs.h>
++#include <linux/vserver/inode.h>
++#include <linux/vs_tag.h>
+ 
+ #include <asm/uaccess.h>
+ #include <asm/ioctls.h>
+ 
++
++#ifdef	CONFIG_VSERVER_LEGACY
++extern int vx_proc_ioctl(struct inode *, struct file *,
++	unsigned int, unsigned long);
++#endif
++
+ static long do_ioctl(struct file *filp, unsigned int cmd,
+ 		unsigned long arg)
+ {
+@@ -152,6 +161,48 @@ int vfs_ioctl(struct file *filp, unsigne
+ 			else
+ 				error = -ENOTTY;
+ 			break;
++#ifdef	CONFIG_VSERVER_LEGACY
++#ifndef CONFIG_TAGGING_NONE
++		case FIOC_GETTAG: {
++			struct inode *inode = filp->f_dentry->d_inode;
++
++			/* fixme: if stealth, return -ENOTTY */
++			error = -EPERM;
++			if (capable(CAP_CONTEXT))
++				error = put_user(inode->i_tag, (int __user *) arg);
++			break;
++		}
++		case FIOC_SETTAG: {
++			struct inode *inode = filp->f_dentry->d_inode;
++			int tag;
++
++			/* fixme: if stealth, return -ENOTTY */
++			error = -EPERM;
++			if (!capable(CAP_CONTEXT))
++				break;
++			error = -EROFS;
++			if (IS_RDONLY(inode))
++				break;
++			error = -ENOSYS;
++			if (!(inode->i_sb->s_flags & MS_TAGGED))
++				break;
++			error = -EFAULT;
++			if (get_user(tag, (int __user *) arg))
++				break;
++			error = 0;
++			inode->i_tag = (tag & 0xFFFF);
++			inode->i_ctime = CURRENT_TIME;
++			mark_inode_dirty(inode);
++			break;
++		}
++#endif
++		case FIOC_GETXFLG:
++		case FIOC_SETXFLG:
++			error = -ENOTTY;
++			if (filp->f_dentry->d_inode->i_sb->s_magic == PROC_SUPER_MAGIC)
++				error = vx_proc_ioctl(filp->f_dentry->d_inode, filp, cmd, arg);
++			break;
++#endif
+ 		default:
+ 			if (S_ISREG(filp->f_path.dentry->d_inode->i_mode))
+ 				error = file_ioctl(filp, cmd, arg);
+--- linux-2.6.22/fs/ioprio.c	2007-05-02 19:25:18 +0200
++++ linux-2.6.22-vs2.2.0-rc5/fs/ioprio.c	2007-06-15 02:37:03 +0200
+@@ -25,6 +25,7 @@
+ #include <linux/capability.h>
+ #include <linux/syscalls.h>
+ #include <linux/security.h>
++#include <linux/vs_base.h>
+ 
+ static int set_task_ioprio(struct task_struct *task, int ioprio)
+ {
+@@ -103,6 +104,8 @@ asmlinkage long sys_ioprio_set(int which
+ 			else
+ 				pgrp = find_pid(who);
+ 			do_each_pid_task(pgrp, PIDTYPE_PGID, p) {
++				if (!vx_check(p->xid, VS_ADMIN_P | VS_IDENT))
++					continue;
+ 				ret = set_task_ioprio(p, ioprio);
+ 				if (ret)
+ 					break;
+@@ -112,7 +115,7 @@ asmlinkage long sys_ioprio_set(int which
+ 			if (!who)
+ 				user = current->user;
+ 			else
+-				user = find_user(who);
++				user = find_user(vx_current_xid(), who);
+ 
+ 			if (!user)
+ 				break;
+@@ -190,6 +193,8 @@ asmlinkage long sys_ioprio_get(int which
+ 			else
+ 				pgrp = find_pid(who);
+ 			do_each_pid_task(pgrp, PIDTYPE_PGID, p) {
++				if (!vx_check(p->xid, VS_ADMIN_P | VS_IDENT))
++					continue;
+ 				tmpio = get_task_ioprio(p);
+ 				if (tmpio < 0)
+ 					continue;
+@@ -203,7 +208,7 @@ asmlinkage long sys_ioprio_get(int which
+ 			if (!who)
+ 				user = current->user;
+ 			else
+-				user = find_user(who);
++				user = find_user(vx_current_xid(), who);
+ 
+ 			if (!user)
+ 				break;
+--- linux-2.6.22/fs/jfs/acl.c	2006-11-30 21:19:25 +0100
++++ linux-2.6.22-vs2.2.0-rc5/fs/jfs/acl.c	2007-06-15 02:37:03 +0200
+@@ -232,7 +232,8 @@ int jfs_setattr(struct dentry *dentry, s
+ 		return rc;
+ 
+ 	if ((iattr->ia_valid & ATTR_UID && iattr->ia_uid != inode->i_uid) ||
+-	    (iattr->ia_valid & ATTR_GID && iattr->ia_gid != inode->i_gid)) {
++	    (iattr->ia_valid & ATTR_GID && iattr->ia_gid != inode->i_gid) ||
++	    (iattr->ia_valid & ATTR_TAG && iattr->ia_tag != inode->i_tag)) {
+ 		if (DQUOT_TRANSFER(inode, iattr))
+ 			return -EDQUOT;
+ 	}
+--- linux-2.6.22/fs/jfs/file.c	2007-05-02 19:25:18 +0200
++++ linux-2.6.22-vs2.2.0-rc5/fs/jfs/file.c	2007-06-15 02:37:03 +0200
+@@ -98,6 +98,7 @@ const struct inode_operations jfs_file_i
+ 	.setattr	= jfs_setattr,
+ 	.permission	= jfs_permission,
+ #endif
++	.sync_flags	= jfs_sync_flags,
+ };
+ 
+ const struct file_operations jfs_file_operations = {
+@@ -109,6 +110,7 @@ const struct file_operations jfs_file_op
+ 	.aio_write	= generic_file_aio_write,
+ 	.mmap		= generic_file_mmap,
+ 	.sendfile	= generic_file_sendfile,
++	.sendpage	= generic_file_sendpage,
+ 	.splice_read	= generic_file_splice_read,
+ 	.splice_write	= generic_file_splice_write,
+ 	.fsync		= jfs_fsync,
+--- linux-2.6.22/fs/jfs/inode.c	2007-07-09 13:19:26 +0200
++++ linux-2.6.22-vs2.2.0-rc5/fs/jfs/inode.c	2007-06-15 02:37:03 +0200
+@@ -22,6 +22,7 @@
+ #include <linux/buffer_head.h>
+ #include <linux/pagemap.h>
+ #include <linux/quotaops.h>
++#include <linux/vs_dlimit.h>
+ #include "jfs_incore.h"
+ #include "jfs_inode.h"
+ #include "jfs_filsys.h"
+@@ -143,6 +144,7 @@ void jfs_delete_inode(struct inode *inod
+ 		DQUOT_INIT(inode);
+ 		DQUOT_FREE_INODE(inode);
+ 		DQUOT_DROP(inode);
++		DLIMIT_FREE_INODE(inode);
+ 	}
+ 
+ 	clear_inode(inode);
+--- linux-2.6.22/fs/jfs/ioctl.c	2007-07-09 13:19:27 +0200
++++ linux-2.6.22-vs2.2.0-rc5/fs/jfs/ioctl.c	2007-06-15 02:37:03 +0200
+@@ -10,6 +10,7 @@
+ #include <linux/capability.h>
+ #include <linux/time.h>
+ #include <linux/sched.h>
++#include <linux/mount.h>
+ #include <asm/current.h>
+ #include <asm/uaccess.h>
+ 
+@@ -66,7 +67,8 @@ int jfs_ioctl(struct inode * inode, stru
+ 	case JFS_IOC_SETFLAGS: {
+ 		unsigned int oldflags;
+ 
+-		if (IS_RDONLY(inode))
++		if (IS_RDONLY(inode) ||
++			(filp && MNT_IS_RDONLY(filp->f_vfsmnt)))
+ 			return -EROFS;
+ 
+ 		if ((current->fsuid != inode->i_uid) && !capable(CAP_FOWNER))
+@@ -87,8 +89,8 @@ int jfs_ioctl(struct inode * inode, stru
+ 		 * the relevant capability.
+ 		 */
+ 		if ((oldflags & JFS_IMMUTABLE_FL) ||
+-			((flags ^ oldflags) &
+-			(JFS_APPEND_FL | JFS_IMMUTABLE_FL))) {
++			((flags ^ oldflags) & (JFS_APPEND_FL |
++			JFS_IMMUTABLE_FL | JFS_IUNLINK_FL))) {
+ 			if (!capable(CAP_LINUX_IMMUTABLE))
+ 				return -EPERM;
+ 		}
+--- linux-2.6.22/fs/jfs/jfs_dinode.h	2006-11-30 21:19:25 +0100
++++ linux-2.6.22-vs2.2.0-rc5/fs/jfs/jfs_dinode.h	2007-06-15 02:37:03 +0200
+@@ -162,9 +162,12 @@ struct dinode {
+ #define JFS_APPEND_FL		0x01000000 /* writes to file may only append */
+ #define JFS_IMMUTABLE_FL	0x02000000 /* Immutable file */
+ 
+-#define JFS_FL_USER_VISIBLE	0x03F80000
++#define JFS_BARRIER_FL		0x04000000 /* Barrier for chroot() */
++#define JFS_IUNLINK_FL		0x08000000 /* Immutable unlink */
++
++#define JFS_FL_USER_VISIBLE	0x0FF80000
+ #define JFS_FL_USER_MODIFIABLE	0x03F80000
+-#define JFS_FL_INHERIT		0x03C80000
++#define JFS_FL_INHERIT		0x0BC80000
+ 
+ /* These are identical to EXT[23]_IOC_GETFLAGS/SETFLAGS */
+ #define JFS_IOC_GETFLAGS	_IOR('f', 1, long)
+--- linux-2.6.22/fs/jfs/jfs_dtree.c	2007-02-06 03:01:24 +0100
++++ linux-2.6.22-vs2.2.0-rc5/fs/jfs/jfs_dtree.c	2007-06-15 02:37:03 +0200
+@@ -102,6 +102,7 @@
+ 
+ #include <linux/fs.h>
+ #include <linux/quotaops.h>
++#include <linux/vs_dlimit.h>
+ #include "jfs_incore.h"
+ #include "jfs_superblock.h"
+ #include "jfs_filsys.h"
+@@ -383,10 +384,10 @@ static u32 add_index(tid_t tid, struct i
+ 		 */
+ 		if (DQUOT_ALLOC_BLOCK(ip, sbi->nbperpage))
+ 			goto clean_up;
+-		if (dbAlloc(ip, 0, sbi->nbperpage, &xaddr)) {
+-			DQUOT_FREE_BLOCK(ip, sbi->nbperpage);
+-			goto clean_up;
+-		}
++		if (DLIMIT_ALLOC_BLOCK(ip, sbi->nbperpage))
++			goto clean_up_dquot;
++		if (dbAlloc(ip, 0, sbi->nbperpage, &xaddr))
++			goto clean_up_dlimit;
+ 
+ 		/*
+ 		 * Save the table, we're going to overwrite it with the
+@@ -479,6 +480,12 @@ static u32 add_index(tid_t tid, struct i
+ 
+ 	return index;
+ 
++      clean_up_dlimit:
++	DLIMIT_FREE_BLOCK(ip, sbi->nbperpage);
++
++      clean_up_dquot:
++	DQUOT_FREE_BLOCK(ip, sbi->nbperpage);
++
+       clean_up:
+ 
+ 	jfs_ip->next_index--;
+@@ -952,6 +959,7 @@ static int dtSplitUp(tid_t tid,
+ 	struct tlock *tlck;
+ 	struct lv *lv;
+ 	int quota_allocation = 0;
++	int dlimit_allocation = 0;
+ 
+ 	/* get split page */
+ 	smp = split->mp;
+@@ -1036,6 +1044,12 @@ static int dtSplitUp(tid_t tid,
+ 		}
+ 		quota_allocation += n;
+ 
++		if (DLIMIT_ALLOC_BLOCK(ip, n)) {
++			rc = -ENOSPC;
++			goto extendOut;
++		}
++		dlimit_allocation += n;
++
+ 		if ((rc = dbReAlloc(sbi->ipbmap, xaddr, (s64) xlen,
+ 				    (s64) n, &nxaddr)))
+ 			goto extendOut;
+@@ -1309,6 +1323,9 @@ static int dtSplitUp(tid_t tid,
+       freeKeyName:
+ 	kfree(key.name);
+ 
++	/* Rollback dlimit allocation */
++	if (rc && dlimit_allocation)
++		DLIMIT_FREE_BLOCK(ip, dlimit_allocation);
+ 	/* Rollback quota allocation */
+ 	if (rc && quota_allocation)
+ 		DQUOT_FREE_BLOCK(ip, quota_allocation);
+@@ -1376,6 +1393,12 @@ static int dtSplitPage(tid_t tid, struct
+ 		release_metapage(rmp);
+ 		return -EDQUOT;
+ 	}
++	/* Allocate blocks to dlimit. */
++	if (DLIMIT_ALLOC_BLOCK(ip, lengthPXD(pxd))) {
++		DQUOT_FREE_BLOCK(ip, lengthPXD(pxd));
++		release_metapage(rmp);
++		return -ENOSPC;
++	}
+ 
+ 	jfs_info("dtSplitPage: ip:0x%p smp:0x%p rmp:0x%p", ip, smp, rmp);
+ 
+@@ -1926,6 +1949,12 @@ static int dtSplitRoot(tid_t tid,
+ 		release_metapage(rmp);
+ 		return -EDQUOT;
+ 	}
++	/* Allocate blocks to dlimit. */
++	if (DLIMIT_ALLOC_BLOCK(ip, lengthPXD(pxd))) {
++		DQUOT_FREE_BLOCK(ip, lengthPXD(pxd));
++		release_metapage(rmp);
++		return -ENOSPC;
++	}
+ 
+ 	BT_MARK_DIRTY(rmp, ip);
+ 	/*
+@@ -2292,6 +2321,8 @@ static int dtDeleteUp(tid_t tid, struct 
+ 
+ 	xlen = lengthPXD(&fp->header.self);
+ 
++	/* Free dlimit allocation. */
++	DLIMIT_FREE_BLOCK(ip, xlen);
+ 	/* Free quota allocation. */
+ 	DQUOT_FREE_BLOCK(ip, xlen);
+ 
+@@ -2368,6 +2399,8 @@ static int dtDeleteUp(tid_t tid, struct 
+ 
+ 				xlen = lengthPXD(&p->header.self);
+ 
++				/* Free dlimit allocation */
++				DLIMIT_FREE_BLOCK(ip, xlen);
+ 				/* Free quota allocation */
+ 				DQUOT_FREE_BLOCK(ip, xlen);
+ 
+--- linux-2.6.22/fs/jfs/jfs_extent.c	2006-11-30 21:19:25 +0100
++++ linux-2.6.22-vs2.2.0-rc5/fs/jfs/jfs_extent.c	2007-06-15 02:37:03 +0200
+@@ -18,6 +18,7 @@
+ 
+ #include <linux/fs.h>
+ #include <linux/quotaops.h>
++#include <linux/vs_dlimit.h>
+ #include "jfs_incore.h"
+ #include "jfs_inode.h"
+ #include "jfs_superblock.h"
+@@ -147,6 +148,14 @@ extAlloc(struct inode *ip, s64 xlen, s64
+ 		return -EDQUOT;
+ 	}
+ 
++	/* Allocate blocks to dlimit. */
++	if (DLIMIT_ALLOC_BLOCK(ip, nxlen)) {
++		DQUOT_FREE_BLOCK(ip, nxlen);
++		dbFree(ip, nxaddr, (s64) nxlen);
++		mutex_unlock(&JFS_IP(ip)->commit_mutex);
++		return -ENOSPC;
++	}
++
+ 	/* determine the value of the extent flag */
+ 	xflag = abnr ? XAD_NOTRECORDED : 0;
+ 
+@@ -164,6 +173,7 @@ extAlloc(struct inode *ip, s64 xlen, s64
+ 	 */
+ 	if (rc) {
+ 		dbFree(ip, nxaddr, nxlen);
++		DLIMIT_FREE_BLOCK(ip, nxlen);
+ 		DQUOT_FREE_BLOCK(ip, nxlen);
+ 		mutex_unlock(&JFS_IP(ip)->commit_mutex);
+ 		return (rc);
+@@ -261,6 +271,13 @@ int extRealloc(struct inode *ip, s64 nxl
+ 		mutex_unlock(&JFS_IP(ip)->commit_mutex);
+ 		return -EDQUOT;
+ 	}
++	/* Allocate blocks to dlimit. */
++	if (DLIMIT_ALLOC_BLOCK(ip, nxlen)) {
++		DQUOT_FREE_BLOCK(ip, nxlen);
++		dbFree(ip, nxaddr, (s64) nxlen);
++		up(&JFS_IP(ip)->commit_sem);
++		return -ENOSPC;
++	}
+ 
+ 	delta = nxlen - xlen;
+ 
+@@ -297,6 +314,7 @@ int extRealloc(struct inode *ip, s64 nxl
+ 		/* extend the extent */
+ 		if ((rc = xtExtend(0, ip, xoff + xlen, (int) nextend, 0))) {
+ 			dbFree(ip, xaddr + xlen, delta);
++			DLIMIT_FREE_BLOCK(ip, nxlen);
+ 			DQUOT_FREE_BLOCK(ip, nxlen);
+ 			goto exit;
+ 		}
+@@ -308,6 +326,7 @@ int extRealloc(struct inode *ip, s64 nxl
+ 		 */
+ 		if ((rc = xtTailgate(0, ip, xoff, (int) ntail, nxaddr, 0))) {
+ 			dbFree(ip, nxaddr, nxlen);
++			DLIMIT_FREE_BLOCK(ip, nxlen);
+ 			DQUOT_FREE_BLOCK(ip, nxlen);
+ 			goto exit;
+ 		}
+--- linux-2.6.22/fs/jfs/jfs_filsys.h	2007-02-06 03:01:24 +0100
++++ linux-2.6.22-vs2.2.0-rc5/fs/jfs/jfs_filsys.h	2007-06-15 02:37:03 +0200
+@@ -264,6 +264,7 @@
+ #define JFS_NAME_MAX	255
+ #define JFS_PATH_MAX	BPSIZE
+ 
++#define JFS_TAGGED		0x00800000	/* Context Tagging */
+ 
+ /*
+  *	file system state (superblock state)
+--- linux-2.6.22/fs/jfs/jfs_imap.c	2007-07-09 13:19:27 +0200
++++ linux-2.6.22-vs2.2.0-rc5/fs/jfs/jfs_imap.c	2007-06-15 03:01:50 +0200
+@@ -45,6 +45,7 @@
+ #include <linux/buffer_head.h>
+ #include <linux/pagemap.h>
+ #include <linux/quotaops.h>
++#include <linux/vs_tag.h>
+ 
+ #include "jfs_incore.h"
+ #include "jfs_inode.h"
+@@ -3075,6 +3076,8 @@ static int copy_from_dinode(struct dinod
+ {
+ 	struct jfs_inode_info *jfs_ip = JFS_IP(ip);
+ 	struct jfs_sb_info *sbi = JFS_SBI(ip->i_sb);
++	uid_t uid;
++	gid_t gid;
+ 
+ 	jfs_ip->fileset = le32_to_cpu(dip->di_fileset);
+ 	jfs_ip->mode2 = le32_to_cpu(dip->di_mode);
+@@ -3095,14 +3098,18 @@ static int copy_from_dinode(struct dinod
+ 	}
+ 	ip->i_nlink = le32_to_cpu(dip->di_nlink);
+ 
+-	jfs_ip->saved_uid = le32_to_cpu(dip->di_uid);
++	uid = le32_to_cpu(dip->di_uid);
++	gid = le32_to_cpu(dip->di_gid);
++	ip->i_tag = INOTAG_TAG(DX_TAG(ip), uid, gid, 0);
++
++	jfs_ip->saved_uid = INOTAG_UID(DX_TAG(ip), uid, gid);
+ 	if (sbi->uid == -1)
+ 		ip->i_uid = jfs_ip->saved_uid;
+ 	else {
+ 		ip->i_uid = sbi->uid;
+ 	}
+ 
+-	jfs_ip->saved_gid = le32_to_cpu(dip->di_gid);
++	jfs_ip->saved_gid = INOTAG_GID(DX_TAG(ip), uid, gid);
+ 	if (sbi->gid == -1)
+ 		ip->i_gid = jfs_ip->saved_gid;
+ 	else {
+@@ -3167,14 +3174,12 @@ static void copy_to_dinode(struct dinode
+ 	dip->di_size = cpu_to_le64(ip->i_size);
+ 	dip->di_nblocks = cpu_to_le64(PBLK2LBLK(ip->i_sb, ip->i_blocks));
+ 	dip->di_nlink = cpu_to_le32(ip->i_nlink);
+-	if (sbi->uid == -1)
+-		dip->di_uid = cpu_to_le32(ip->i_uid);
+-	else
+-		dip->di_uid = cpu_to_le32(jfs_ip->saved_uid);
+-	if (sbi->gid == -1)
+-		dip->di_gid = cpu_to_le32(ip->i_gid);
+-	else
+-		dip->di_gid = cpu_to_le32(jfs_ip->saved_gid);
++
++	dip->di_uid = cpu_to_le32(TAGINO_UID(DX_TAG(ip),
++		(sbi->uid == -1) ? ip->i_uid : jfs_ip->saved_uid, ip->i_tag));
++	dip->di_gid = cpu_to_le32(TAGINO_GID(DX_TAG(ip),
++		(sbi->gid == -1) ? ip->i_gid : jfs_ip->saved_gid, ip->i_tag));
++
+ 	jfs_get_inode_flags(jfs_ip);
+ 	/*
+ 	 * mode2 is only needed for storing the higher order bits.
+--- linux-2.6.22/fs/jfs/jfs_inode.c	2007-07-09 13:19:27 +0200
++++ linux-2.6.22-vs2.2.0-rc5/fs/jfs/jfs_inode.c	2007-06-15 02:37:03 +0200
+@@ -18,6 +18,8 @@
+ 
+ #include <linux/fs.h>
+ #include <linux/quotaops.h>
++#include <linux/vs_dlimit.h>
++#include <linux/vs_tag.h>
+ #include "jfs_incore.h"
+ #include "jfs_inode.h"
+ #include "jfs_filsys.h"
+@@ -30,19 +32,47 @@ void jfs_set_inode_flags(struct inode *i
+ {
+ 	unsigned int flags = JFS_IP(inode)->mode2;
+ 
+-	inode->i_flags &= ~(S_IMMUTABLE | S_APPEND |
+-		S_NOATIME | S_DIRSYNC | S_SYNC);
++	inode->i_flags &= ~(S_IMMUTABLE | S_IUNLINK | S_BARRIER |
++		S_SYNC | S_APPEND | S_NOATIME | S_DIRSYNC);
+ 
+ 	if (flags & JFS_IMMUTABLE_FL)
+ 		inode->i_flags |= S_IMMUTABLE;
++	if (flags & JFS_IUNLINK_FL)
++		inode->i_flags |= S_IUNLINK;
++	if (flags & JFS_BARRIER_FL)
++		inode->i_flags |= S_BARRIER;
++
++	if (flags & JFS_SYNC_FL)
++		inode->i_flags |= S_SYNC;
+ 	if (flags & JFS_APPEND_FL)
+ 		inode->i_flags |= S_APPEND;
+ 	if (flags & JFS_NOATIME_FL)
+ 		inode->i_flags |= S_NOATIME;
+ 	if (flags & JFS_DIRSYNC_FL)
+ 		inode->i_flags |= S_DIRSYNC;
+-	if (flags & JFS_SYNC_FL)
+-		inode->i_flags |= S_SYNC;
++}
++
++int jfs_sync_flags(struct inode *inode)
++{
++	unsigned int oldflags, newflags;
++
++	oldflags = JFS_IP(inode)->mode2;
++	newflags = oldflags & ~(JFS_IMMUTABLE_FL |
++		JFS_IUNLINK_FL | JFS_BARRIER_FL);
++
++	if (IS_IMMUTABLE(inode))
++		newflags |= JFS_IMMUTABLE_FL;
++	if (IS_IUNLINK(inode))
++		newflags |= JFS_IUNLINK_FL;
++	if (IS_BARRIER(inode))
++		newflags |= JFS_BARRIER_FL;
++
++	if (oldflags ^ newflags) {
++		JFS_IP(inode)->mode2 = newflags;
++		inode->i_ctime = CURRENT_TIME;
++		mark_inode_dirty(inode);
++	}
++	return 0;
+ }
+ 
+ void jfs_get_inode_flags(struct jfs_inode_info *jfs_ip)
+@@ -108,10 +138,17 @@ struct inode *ialloc(struct inode *paren
+ 	jfs_inode->saved_uid = inode->i_uid;
+ 	jfs_inode->saved_gid = inode->i_gid;
+ 
++	inode->i_tag = dx_current_fstag(sb);
++	if (DLIMIT_ALLOC_INODE(inode)) {
++		iput(inode);
++		return NULL;
++	}
++
+ 	/*
+ 	 * Allocate inode to quota.
+ 	 */
+ 	if (DQUOT_ALLOC_INODE(inode)) {
++		DLIMIT_FREE_INODE(inode);
+ 		DQUOT_DROP(inode);
+ 		inode->i_flags |= S_NOQUOTA;
+ 		inode->i_nlink = 0;
+--- linux-2.6.22/fs/jfs/jfs_inode.h	2007-07-09 13:19:27 +0200
++++ linux-2.6.22-vs2.2.0-rc5/fs/jfs/jfs_inode.h	2007-06-15 03:02:28 +0200
+@@ -33,6 +33,7 @@ extern void jfs_free_zero_link(struct in
+ extern struct dentry *jfs_get_parent(struct dentry *dentry);
+ extern void jfs_get_inode_flags(struct jfs_inode_info *);
+ extern void jfs_set_inode_flags(struct inode *);
++extern int jfs_sync_flags(struct inode *);
+ extern int jfs_get_block(struct inode *, sector_t, struct buffer_head *, int);
+ 
+ extern const struct address_space_operations jfs_aops;
+--- linux-2.6.22/fs/jfs/jfs_xtree.c	2007-05-02 19:25:18 +0200
++++ linux-2.6.22-vs2.2.0-rc5/fs/jfs/jfs_xtree.c	2007-06-15 02:37:03 +0200
+@@ -21,6 +21,7 @@
+ 
+ #include <linux/fs.h>
+ #include <linux/quotaops.h>
++#include <linux/vs_dlimit.h>
+ #include "jfs_incore.h"
+ #include "jfs_filsys.h"
+ #include "jfs_metapage.h"
+@@ -846,7 +847,12 @@ int xtInsert(tid_t tid,		/* transaction 
+ 			hint = 0;
+ 		if ((rc = DQUOT_ALLOC_BLOCK(ip, xlen)))
+ 			goto out;
++		if ((rc = DLIMIT_ALLOC_BLOCK(ip, xlen))) {
++			DQUOT_FREE_BLOCK(ip, xlen);
++			goto out;
++		}
+ 		if ((rc = dbAlloc(ip, hint, (s64) xlen, &xaddr))) {
++			DLIMIT_FREE_BLOCK(ip, xlen);
+ 			DQUOT_FREE_BLOCK(ip, xlen);
+ 			goto out;
+ 		}
+@@ -876,6 +882,7 @@ int xtInsert(tid_t tid,		/* transaction 
+ 			/* undo data extent allocation */
+ 			if (*xaddrp == 0) {
+ 				dbFree(ip, xaddr, (s64) xlen);
++				DLIMIT_FREE_BLOCK(ip, xlen);
+ 				DQUOT_FREE_BLOCK(ip, xlen);
+ 			}
+ 			return rc;
+@@ -1236,6 +1243,7 @@ xtSplitPage(tid_t tid, struct inode *ip,
+ 	struct tlock *tlck;
+ 	struct xtlock *sxtlck = NULL, *rxtlck = NULL;
+ 	int quota_allocation = 0;
++	int dlimit_allocation = 0;
+ 
+ 	smp = split->mp;
+ 	sp = XT_PAGE(ip, smp);
+@@ -1255,6 +1263,13 @@ xtSplitPage(tid_t tid, struct inode *ip,
+ 
+ 	quota_allocation += lengthPXD(pxd);
+ 
++	/* Allocate blocks to dlimit. */
++	if (DLIMIT_ALLOC_BLOCK(ip, lengthPXD(pxd))) {
++	       rc = -ENOSPC;
++	       goto clean_up;
++	}
++	dlimit_allocation += lengthPXD(pxd);
++
+ 	/*
+ 	 * allocate the new right page for the split
+ 	 */
+@@ -1456,6 +1471,9 @@ xtSplitPage(tid_t tid, struct inode *ip,
+ 
+       clean_up:
+ 
++	/* Rollback dlimit allocation. */
++	if (dlimit_allocation)
++		DLIMIT_FREE_BLOCK(ip, dlimit_allocation);
+ 	/* Rollback quota allocation. */
+ 	if (quota_allocation)
+ 		DQUOT_FREE_BLOCK(ip, quota_allocation);
+@@ -1520,6 +1538,12 @@ xtSplitRoot(tid_t tid,
+ 		release_metapage(rmp);
+ 		return -EDQUOT;
+ 	}
++	/* Allocate blocks to dlimit. */
++	if (DLIMIT_ALLOC_BLOCK(ip, lengthPXD(pxd))) {
++		DQUOT_FREE_BLOCK(ip, lengthPXD(pxd));
++		release_metapage(rmp);
++		return -ENOSPC;
++	}
+ 
+ 	jfs_info("xtSplitRoot: ip:0x%p rmp:0x%p", ip, rmp);
+ 
+@@ -3951,6 +3975,8 @@ s64 xtTruncate(tid_t tid, struct inode *
+ 	else
+ 		ip->i_size = newsize;
+ 
++	/* update dlimit allocation to reflect freed blocks */
++	DLIMIT_FREE_BLOCK(ip, nfreed);
+ 	/* update quota allocation to reflect freed blocks */
+ 	DQUOT_FREE_BLOCK(ip, nfreed);
+ 
+--- linux-2.6.22/fs/jfs/namei.c	2007-05-02 19:25:18 +0200
++++ linux-2.6.22-vs2.2.0-rc5/fs/jfs/namei.c	2007-06-15 02:37:03 +0200
+@@ -20,6 +20,7 @@
+ #include <linux/fs.h>
+ #include <linux/ctype.h>
+ #include <linux/quotaops.h>
++#include <linux/vs_tag.h>
+ #include "jfs_incore.h"
+ #include "jfs_superblock.h"
+ #include "jfs_inode.h"
+@@ -1469,6 +1470,7 @@ static struct dentry *jfs_lookup(struct 
+ 		return ERR_PTR(-EACCES);
+ 	}
+ 
++	dx_propagate_tag(nd, ip);
+ 	dentry = d_splice_alias(ip, dentry);
+ 
+ 	if (dentry && (JFS_SBI(dip->i_sb)->mntflag & JFS_OS2))
+@@ -1521,6 +1523,7 @@ const struct inode_operations jfs_dir_in
+ 	.setattr	= jfs_setattr,
+ 	.permission	= jfs_permission,
+ #endif
++	.sync_flags	= jfs_sync_flags,
+ };
+ 
+ const struct file_operations jfs_dir_operations = {
+--- linux-2.6.22/fs/jfs/super.c	2007-07-09 13:19:27 +0200
++++ linux-2.6.22-vs2.2.0-rc5/fs/jfs/super.c	2007-06-15 02:37:03 +0200
+@@ -194,7 +194,8 @@ static void jfs_put_super(struct super_b
+ enum {
+ 	Opt_integrity, Opt_nointegrity, Opt_iocharset, Opt_resize,
+ 	Opt_resize_nosize, Opt_errors, Opt_ignore, Opt_err, Opt_quota,
+-	Opt_usrquota, Opt_grpquota, Opt_uid, Opt_gid, Opt_umask
++	Opt_usrquota, Opt_grpquota, Opt_uid, Opt_gid, Opt_umask,
++	Opt_tag, Opt_notag, Opt_tagid
+ };
+ 
+ static match_table_t tokens = {
+@@ -204,6 +205,10 @@ static match_table_t tokens = {
+ 	{Opt_resize, "resize=%u"},
+ 	{Opt_resize_nosize, "resize"},
+ 	{Opt_errors, "errors=%s"},
++	{Opt_tag, "tag"},
++	{Opt_notag, "notag"},
++	{Opt_tagid, "tagid=%u"},
++	{Opt_tag, "tagxid"},
+ 	{Opt_ignore, "noquota"},
+ 	{Opt_ignore, "quota"},
+ 	{Opt_usrquota, "usrquota"},
+@@ -338,6 +343,20 @@ static int parse_options(char *options, 
+ 			}
+ 			break;
+ 		}
++#ifndef CONFIG_TAGGING_NONE
++		case Opt_tag:
++			*flag |= JFS_TAGGED;
++			break;
++		case Opt_notag:
++			*flag &= JFS_TAGGED;
++			break;
++#endif
++#ifdef CONFIG_PROPAGATE
++		case Opt_tagid:
++			/* use args[0] */
++			*flag |= JFS_TAGGED;
++			break;
++#endif
+ 		default:
+ 			printk("jfs: Unrecognized mount option \"%s\" "
+ 					" or missing value\n", p);
+@@ -368,6 +387,13 @@ static int jfs_remount(struct super_bloc
+ 	if (!parse_options(data, sb, &newLVSize, &flag)) {
+ 		return -EINVAL;
+ 	}
++
++	if ((flag & JFS_TAGGED) && !(sb->s_flags & MS_TAGGED)) {
++		printk(KERN_ERR "JFS: %s: tagging not permitted on remount.\n",
++			sb->s_id);
++		return -EINVAL;
++	}
++
+ 	if (newLVSize) {
+ 		if (sb->s_flags & MS_RDONLY) {
+ 			printk(KERN_ERR
+@@ -439,6 +465,9 @@ static int jfs_fill_super(struct super_b
+ #ifdef CONFIG_JFS_POSIX_ACL
+ 	sb->s_flags |= MS_POSIXACL;
+ #endif
++	/* map mount option tagxid */
++	if (sbi->flag & JFS_TAGGED)
++		sb->s_flags |= MS_TAGGED;
+ 
+ 	if (newLVSize) {
+ 		printk(KERN_ERR "resize option for remount only\n");
+--- linux-2.6.22/fs/jfs/xattr.c	2006-11-30 21:19:26 +0100
++++ linux-2.6.22-vs2.2.0-rc5/fs/jfs/xattr.c	2007-06-15 02:37:03 +0200
+@@ -23,6 +23,7 @@
+ #include <linux/posix_acl_xattr.h>
+ #include <linux/quotaops.h>
+ #include <linux/security.h>
++#include <linux/vs_dlimit.h>
+ #include "jfs_incore.h"
+ #include "jfs_superblock.h"
+ #include "jfs_dmap.h"
+@@ -263,9 +264,16 @@ static int ea_write(struct inode *ip, st
+ 	if (DQUOT_ALLOC_BLOCK(ip, nblocks)) {
+ 		return -EDQUOT;
+ 	}
++	/* Allocate new blocks to dlimit. */
++	if (DLIMIT_ALLOC_BLOCK(ip, nblocks)) {
++		DQUOT_FREE_BLOCK(ip, nblocks);
++		return -ENOSPC;
++	}
+ 
+ 	rc = dbAlloc(ip, INOHINT(ip), nblocks, &blkno);
+ 	if (rc) {
++		/*Rollback dlimit allocation. */
++		DLIMIT_FREE_BLOCK(ip, nblocks);
+ 		/*Rollback quota allocation. */
+ 		DQUOT_FREE_BLOCK(ip, nblocks);
+ 		return rc;
+@@ -332,6 +340,8 @@ static int ea_write(struct inode *ip, st
+ 
+       failed:
+ 	/* Rollback quota allocation. */
++	DLIMIT_FREE_BLOCK(ip, nblocks);
++	/* Rollback quota allocation. */
+ 	DQUOT_FREE_BLOCK(ip, nblocks);
+ 
+ 	dbFree(ip, blkno, nblocks);
+@@ -468,6 +478,7 @@ static int ea_get(struct inode *inode, s
+ 	s64 blkno;
+ 	int rc;
+ 	int quota_allocation = 0;
++	int dlimit_allocation = 0;
+ 
+ 	/* When fsck.jfs clears a bad ea, it doesn't clear the size */
+ 	if (ji->ea.flag == 0)
+@@ -543,6 +554,12 @@ static int ea_get(struct inode *inode, s
+ 
+ 		quota_allocation = blocks_needed;
+ 
++		/* Allocate new blocks to dlimit. */
++		rc = -ENOSPC;
++		if (DLIMIT_ALLOC_BLOCK(inode, blocks_needed))
++			goto clean_up;
++		dlimit_allocation = blocks_needed;
++
+ 		rc = dbAlloc(inode, INOHINT(inode), (s64) blocks_needed,
+ 			     &blkno);
+ 		if (rc)
+@@ -599,6 +616,9 @@ static int ea_get(struct inode *inode, s
+ 	return ea_size;
+ 
+       clean_up:
++	/* Rollback dlimit allocation */
++	if (dlimit_allocation)
++		DLIMIT_FREE_BLOCK(inode, dlimit_allocation);
+ 	/* Rollback quota allocation */
+ 	if (quota_allocation)
+ 		DQUOT_FREE_BLOCK(inode, quota_allocation);
+@@ -675,8 +695,10 @@ static int ea_put(tid_t tid, struct inod
+ 	}
+ 
+ 	/* If old blocks exist, they must be removed from quota allocation. */
+-	if (old_blocks)
++	if (old_blocks) {
++		DLIMIT_FREE_BLOCK(inode, old_blocks);
+ 		DQUOT_FREE_BLOCK(inode, old_blocks);
++	}
+ 
+ 	inode->i_ctime = CURRENT_TIME;
+ 
+--- linux-2.6.22/fs/libfs.c	2007-07-09 13:19:27 +0200
++++ linux-2.6.22-vs2.2.0-rc5/fs/libfs.c	2007-06-15 02:37:03 +0200
+@@ -124,7 +124,8 @@ static inline unsigned char dt_type(stru
+  * both impossible due to the lock on directory.
+  */
+ 
+-int dcache_readdir(struct file * filp, void * dirent, filldir_t filldir)
++static inline int do_dcache_readdir_filter(struct file *filp,
++	void *dirent, filldir_t filldir, int (*filter)(struct dentry *dentry))
+ {
+ 	struct dentry *dentry = filp->f_path.dentry;
+ 	struct dentry *cursor = filp->private_data;
+@@ -157,6 +158,8 @@ int dcache_readdir(struct file * filp, v
+ 				next = list_entry(p, struct dentry, d_u.d_child);
+ 				if (d_unhashed(next) || !next->d_inode)
+ 					continue;
++				if (filter && !filter(next))
++					continue;
+ 
+ 				spin_unlock(&dcache_lock);
+ 				if (filldir(dirent, next->d_name.name, 
+@@ -175,6 +178,18 @@ int dcache_readdir(struct file * filp, v
+ 	return 0;
+ }
+ 
++int dcache_readdir(struct file *filp, void *dirent, filldir_t filldir)
++{
++	return do_dcache_readdir_filter(filp, dirent, filldir, NULL);
++}
++
++int dcache_readdir_filter(struct file *filp, void *dirent, filldir_t filldir,
++	int (*filter)(struct dentry *))
++{
++	return do_dcache_readdir_filter(filp, dirent, filldir, filter);
++}
++
++
+ ssize_t generic_read_dir(struct file *filp, char __user *buf, size_t siz, loff_t *ppos)
+ {
+ 	return -EISDIR;
+@@ -640,6 +655,7 @@ EXPORT_SYMBOL(dcache_dir_close);
+ EXPORT_SYMBOL(dcache_dir_lseek);
+ EXPORT_SYMBOL(dcache_dir_open);
+ EXPORT_SYMBOL(dcache_readdir);
++EXPORT_SYMBOL(dcache_readdir_filter);
+ EXPORT_SYMBOL(generic_read_dir);
+ EXPORT_SYMBOL(get_sb_pseudo);
+ EXPORT_SYMBOL(simple_commit_write);
+--- linux-2.6.22/fs/locks.c	2007-07-09 13:19:27 +0200
++++ linux-2.6.22-vs2.2.0-rc5/fs/locks.c	2007-06-15 03:16:26 +0200
+@@ -125,6 +125,8 @@
+ #include <linux/syscalls.h>
+ #include <linux/time.h>
+ #include <linux/rcupdate.h>
++#include <linux/vs_base.h>
++#include <linux/vs_limit.h>
+ 
+ #include <asm/semaphore.h>
+ #include <asm/uaccess.h>
+@@ -147,6 +149,8 @@ static struct kmem_cache *filelock_cache
+ /* Allocate an empty lock structure. */
+ static struct file_lock *locks_alloc_lock(void)
+ {
++	if (!vx_locks_avail(1))
++		return NULL;
+ 	return kmem_cache_alloc(filelock_cache, GFP_KERNEL);
+ }
+ 
+@@ -172,6 +176,7 @@ static void locks_free_lock(struct file_
+ 	BUG_ON(!list_empty(&fl->fl_block));
+ 	BUG_ON(!list_empty(&fl->fl_link));
+ 
++	vx_locks_dec(fl);
+ 	locks_release_private(fl);
+ 	kmem_cache_free(filelock_cache, fl);
+ }
+@@ -191,6 +196,7 @@ void locks_init_lock(struct file_lock *f
+ 	fl->fl_start = fl->fl_end = 0;
+ 	fl->fl_ops = NULL;
+ 	fl->fl_lmops = NULL;
++	fl->fl_xid = -1;
+ }
+ 
+ EXPORT_SYMBOL(locks_init_lock);
+@@ -244,6 +250,7 @@ void locks_copy_lock(struct file_lock *n
+ 	new->fl_file = fl->fl_file;
+ 	new->fl_ops = fl->fl_ops;
+ 	new->fl_lmops = fl->fl_lmops;
++	new->fl_xid = fl->fl_xid;
+ 
+ 	locks_copy_private(new, fl);
+ }
+@@ -282,6 +289,11 @@ static int flock_make_lock(struct file *
+ 	fl->fl_flags = FL_FLOCK;
+ 	fl->fl_type = type;
+ 	fl->fl_end = OFFSET_MAX;
++
++	vxd_assert(filp->f_xid == vx_current_xid(),
++		"f_xid(%d) == current(%d)", filp->f_xid, vx_current_xid());
++	fl->fl_xid = filp->f_xid;
++	vx_locks_inc(fl);
+ 	
+ 	*lock = fl;
+ 	return 0;
+@@ -447,6 +459,7 @@ static int lease_init(struct file *filp,
+ 
+ 	fl->fl_owner = current->files;
+ 	fl->fl_pid = current->tgid;
++	fl->fl_xid = vx_current_xid();
+ 
+ 	fl->fl_file = filp;
+ 	fl->fl_flags = FL_LEASE;
+@@ -466,6 +479,11 @@ static int lease_alloc(struct file *filp
+ 	if (fl == NULL)
+ 		goto out;
+ 
++	fl->fl_xid = vx_current_xid();
++	if (filp)
++		vxd_assert(filp->f_xid == fl->fl_xid,
++			"f_xid(%d) == fl_xid(%d)", filp->f_xid, fl->fl_xid);
++	vx_locks_inc(fl);
+ 	error = lease_init(filp, type, fl);
+ 	if (error) {
+ 		locks_free_lock(fl);
+@@ -769,6 +787,7 @@ static int flock_lock_file(struct file *
+ 	if (found)
+ 		cond_resched();
+ 
++	new_fl->fl_xid = -1;
+ find_conflict:
+ 	for_each_lock(inode, before) {
+ 		struct file_lock *fl = *before;
+@@ -787,6 +806,7 @@ find_conflict:
+ 		goto out;
+ 	locks_copy_lock(new_fl, request);
+ 	locks_insert_lock(&inode->i_flock, new_fl);
++	vx_locks_inc(new_fl);
+ 	new_fl = NULL;
+ 	error = 0;
+ 
+@@ -797,7 +817,8 @@ out:
+ 	return error;
+ }
+ 
+-static int __posix_lock_file(struct inode *inode, struct file_lock *request, struct file_lock *conflock)
++static int __posix_lock_file(struct inode *inode, struct file_lock *request,
++	struct file_lock *conflock, xid_t xid)
+ {
+ 	struct file_lock *fl;
+ 	struct file_lock *new_fl = NULL;
+@@ -807,6 +828,8 @@ static int __posix_lock_file(struct inod
+ 	struct file_lock **before;
+ 	int error, added = 0;
+ 
++	vxd_assert(xid == vx_current_xid(),
++		"xid(%d) == current(%d)", xid, vx_current_xid());
+ 	/*
+ 	 * We may need two file_lock structures for this operation,
+ 	 * so we get them in advance to avoid races.
+@@ -817,7 +840,11 @@ static int __posix_lock_file(struct inod
+ 	    (request->fl_type != F_UNLCK ||
+ 	     request->fl_start != 0 || request->fl_end != OFFSET_MAX)) {
+ 		new_fl = locks_alloc_lock();
++		new_fl->fl_xid = xid;
++		vx_locks_inc(new_fl);
+ 		new_fl2 = locks_alloc_lock();
++		new_fl2->fl_xid = xid;
++		vx_locks_inc(new_fl2);
+ 	}
+ 
+ 	lock_kernel();
+@@ -1016,7 +1043,8 @@ static int __posix_lock_file(struct inod
+ int posix_lock_file(struct file *filp, struct file_lock *fl,
+ 			struct file_lock *conflock)
+ {
+-	return __posix_lock_file(filp->f_path.dentry->d_inode, fl, conflock);
++	return __posix_lock_file(filp->f_path.dentry->d_inode,
++		fl, conflock, filp->f_xid);
+ }
+ EXPORT_SYMBOL(posix_lock_file);
+ 
+@@ -1106,7 +1134,7 @@ int locks_mandatory_area(int read_write,
+ 	fl.fl_end = offset + count - 1;
+ 
+ 	for (;;) {
+-		error = __posix_lock_file(inode, &fl, NULL);
++		error = __posix_lock_file(inode, &fl, NULL, filp->f_xid);
+ 		if (error != -EAGAIN)
+ 			break;
+ 		if (!(fl.fl_flags & FL_SLEEP))
+@@ -1410,8 +1438,8 @@ static int __setlease(struct file *filp,
+ 		goto out;
+ 
+ 	locks_copy_lock(fl, lease);
+-
+ 	locks_insert_lock(before, fl);
++	vx_locks_inc(fl);
+ 
+ 	*flp = fl;
+ 	error = 0;
+@@ -1738,6 +1766,11 @@ int fcntl_setlk(unsigned int fd, struct 
+ 	if (file_lock == NULL)
+ 		return -ENOLCK;
+ 
++	vxd_assert(filp->f_xid == vx_current_xid(),
++		"f_xid(%d) == current(%d)", filp->f_xid, vx_current_xid());
++	file_lock->fl_xid = filp->f_xid;
++	vx_locks_inc(file_lock);
++
+ 	/*
+ 	 * This might block, so we do it before checking the inode.
+ 	 */
+@@ -1864,6 +1897,11 @@ int fcntl_setlk64(unsigned int fd, struc
+ 	if (file_lock == NULL)
+ 		return -ENOLCK;
+ 
++	vxd_assert(filp->f_xid == vx_current_xid(),
++		"f_xid(%d) == current(%d)", filp->f_xid, vx_current_xid());
++	file_lock->fl_xid = filp->f_xid;
++	vx_locks_inc(file_lock);
++
+ 	/*
+ 	 * This might block, so we do it before checking the inode.
+ 	 */
+@@ -2168,6 +2206,10 @@ int get_locks_status(char *buffer, char 
+ 	list_for_each(tmp, &file_lock_list) {
+ 		struct list_head *btmp;
+ 		struct file_lock *fl = list_entry(tmp, struct file_lock, fl_link);
++
++		if (!vx_check(fl->fl_xid, VS_WATCH_P | VS_IDENT))
++			continue;
++
+ 		lock_get_status(q, fl, ++i, "");
+ 		move_lock_status(&q, &pos, offset);
+ 
+--- linux-2.6.22/fs/namei.c	2007-07-09 13:19:27 +0200
++++ linux-2.6.22-vs2.2.0-rc5/fs/namei.c	2007-06-15 02:37:03 +0200
+@@ -31,6 +31,11 @@
+ #include <linux/file.h>
+ #include <linux/fcntl.h>
+ #include <linux/namei.h>
++#include <linux/proc_fs.h>
++#include <linux/vserver/inode.h>
++#include <linux/vs_base.h>
++#include <linux/vs_tag.h>
++#include <linux/vs_cowbl.h>
+ #include <asm/namei.h>
+ #include <asm/uaccess.h>
+ 
+@@ -224,6 +229,31 @@ int generic_permission(struct inode *ino
+ 	return -EACCES;
+ }
+ 
++static inline int dx_barrier(struct inode *inode)
++{
++	if (IS_BARRIER(inode) && !vx_check(0, VS_ADMIN)) {
++		vxwprintk(1, "xid=%d did hit the barrier.",
++			vx_current_xid());
++		return 1;
++	}
++	return 0;
++}
++
++static inline int dx_permission(struct inode *inode, int mask, struct nameidata *nd)
++{
++	if (dx_barrier(inode))
++		return -EACCES;
++	if (inode->i_tag == 0)
++		return 0;
++	if (dx_check(inode->i_tag, DX_ADMIN|DX_WATCH|DX_IDENT))
++		return 0;
++
++	vxwprintk(1, "xid=%d denied access to %p[#%d,%lu] »%s«.",
++		vx_current_xid(), inode, inode->i_tag, inode->i_ino,
++		vxd_cond_path(nd));
++	return -EACCES;
++}
++
+ int permission(struct inode *inode, int mask, struct nameidata *nd)
+ {
+ 	umode_t mode = inode->i_mode;
+@@ -234,14 +264,14 @@ int permission(struct inode *inode, int 
+ 		/*
+ 		 * Nobody gets write access to a read-only fs.
+ 		 */
+-		if (IS_RDONLY(inode) &&
++		if ((IS_RDONLY(inode) || (nd && MNT_IS_RDONLY(nd->mnt))) &&
+ 		    (S_ISREG(mode) || S_ISDIR(mode) || S_ISLNK(mode)))
+ 			return -EROFS;
+ 
+ 		/*
+ 		 * Nobody gets write access to an immutable file.
+ 		 */
+-		if (IS_IMMUTABLE(inode))
++		if (IS_IMMUTABLE(inode) && !IS_COW(inode))
+ 			return -EACCES;
+ 	}
+ 
+@@ -257,6 +287,8 @@ int permission(struct inode *inode, int 
+ 
+ 	/* Ordinary permission routines do not understand MAY_APPEND. */
+ 	submask = mask & ~MAY_APPEND;
++	if ((retval = dx_permission(inode, mask, nd)))
++		return retval;
+ 	if (inode->i_op && inode->i_op->permission)
+ 		retval = inode->i_op->permission(inode, submask, nd);
+ 	else
+@@ -432,6 +464,8 @@ static int exec_permission_lite(struct i
+ {
+ 	umode_t	mode = inode->i_mode;
+ 
++	if (dx_barrier(inode))
++		return -EACCES;
+ 	if (inode->i_op && inode->i_op->permission)
+ 		return -EAGAIN;
+ 
+@@ -732,7 +766,8 @@ static __always_inline void follow_dotdo
+ 		if (nd->dentry == fs->root &&
+ 		    nd->mnt == fs->rootmnt) {
+                         read_unlock(&fs->lock);
+-			break;
++			/* for sane '/' avoid follow_mount() */
++			return;
+ 		}
+                 read_unlock(&fs->lock);
+ 		spin_lock(&dcache_lock);
+@@ -769,16 +804,34 @@ static int do_lookup(struct nameidata *n
+ {
+ 	struct vfsmount *mnt = nd->mnt;
+ 	struct dentry *dentry = __d_lookup(nd->dentry, name);
++	struct inode *inode;
+ 
+ 	if (!dentry)
+ 		goto need_lookup;
+ 	if (dentry->d_op && dentry->d_op->d_revalidate)
+ 		goto need_revalidate;
++	inode = dentry->d_inode;
++	if (!inode)
++		goto done;
++	if (inode->i_sb->s_magic == PROC_SUPER_MAGIC) {
++		struct proc_dir_entry *de = PDE(inode);
++
++		if (de && !vx_hide_check(0, de->vx_flags))
++			goto hidden;
++	}
++	if (!dx_check(inode->i_tag, DX_WATCH|DX_ADMIN|DX_HOSTID|DX_IDENT))
++		goto hidden;
+ done:
+ 	path->mnt = mnt;
+ 	path->dentry = dentry;
+ 	__follow_mount(path);
+ 	return 0;
++hidden:
++	vxwprintk(1, "xid=%d did lookup hidden %p[#%d,%lu] »%s«.",
++		vx_current_xid(), inode, inode->i_tag, inode->i_ino,
++		vxd_path(dentry, mnt));
++	dput(dentry);
++	return -ENOENT;
+ 
+ need_lookup:
+ 	dentry = real_lookup(nd->dentry, name, nd);
+@@ -1399,7 +1452,8 @@ static inline int check_sticky(struct in
+  * 10. We don't allow removal of NFS sillyrenamed files; it's handled by
+  *     nfs_async_unlink().
+  */
+-static int may_delete(struct inode *dir,struct dentry *victim,int isdir)
++static int may_delete(struct inode *dir, struct dentry *victim,
++	int isdir, struct nameidata *nd)
+ {
+ 	int error;
+ 
+@@ -1409,13 +1463,13 @@ static int may_delete(struct inode *dir,
+ 	BUG_ON(victim->d_parent->d_inode != dir);
+ 	audit_inode_child(victim->d_name.name, victim->d_inode, dir);
+ 
+-	error = permission(dir,MAY_WRITE | MAY_EXEC, NULL);
++	error = permission(dir,MAY_WRITE | MAY_EXEC, nd);
+ 	if (error)
+ 		return error;
+ 	if (IS_APPEND(dir))
+ 		return -EPERM;
+ 	if (check_sticky(dir, victim->d_inode)||IS_APPEND(victim->d_inode)||
+-	    IS_IMMUTABLE(victim->d_inode))
++		IS_IXORUNLINK(victim->d_inode))
+ 		return -EPERM;
+ 	if (isdir) {
+ 		if (!S_ISDIR(victim->d_inode->i_mode))
+@@ -1546,6 +1600,14 @@ int may_open(struct nameidata *nd, int a
+ 	if (S_ISDIR(inode->i_mode) && (flag & FMODE_WRITE))
+ 		return -EISDIR;
+ 
++#ifdef	CONFIG_VSERVER_COWBL
++	if (IS_COW(inode) && (flag & FMODE_WRITE)) {
++		if (IS_COW_LINK(inode))
++			return -EMLINK;
++		inode->i_flags &= ~(S_IUNLINK|S_IMMUTABLE);
++		mark_inode_dirty(inode);
++	}
++#endif
+ 	error = vfs_permission(nd, acc_mode);
+ 	if (error)
+ 		return error;
+@@ -1562,7 +1624,8 @@ int may_open(struct nameidata *nd, int a
+ 			return -EACCES;
+ 
+ 		flag &= ~O_TRUNC;
+-	} else if (IS_RDONLY(inode) && (flag & FMODE_WRITE))
++	} else if ((IS_RDONLY(inode) || MNT_IS_RDONLY(nd->mnt))
++		&& (flag & FMODE_WRITE))
+ 		return -EROFS;
+ 	/*
+ 	 * An append-only file must be opened in append mode for writing.
+@@ -1650,6 +1713,11 @@ int open_namei(int dfd, const char *path
+ 	struct dentry *dir;
+ 	int count = 0;
+ 
++#ifdef	CONFIG_VSERVER_COWBL
++	int rflag = flag;
++	int rmode = mode;
++restart:
++#endif
+ 	acc_mode = ACC_MODE(flag);
+ 
+ 	/* O_TRUNC implies we need access checks for write permissions */
+@@ -1743,6 +1811,22 @@ do_last:
+ 		goto exit;
+ ok:
+ 	error = may_open(nd, acc_mode, flag);
++#ifdef	CONFIG_VSERVER_COWBL
++	if (error == -EMLINK) {
++		struct dentry *dentry;
++		dentry = cow_break_link(pathname);
++		if (IS_ERR(dentry)) {
++			error = PTR_ERR(dentry);
++			goto exit;
++		}
++		dput(dentry);
++		release_open_intent(nd);
++		path_release(nd);
++		flag = rflag;
++		mode = rmode;
++		goto restart;
++	}
++#endif
+ 	if (error)
+ 		goto exit;
+ 	return 0;
+@@ -1854,9 +1938,10 @@ fail:
+ }
+ EXPORT_SYMBOL_GPL(lookup_create);
+ 
+-int vfs_mknod(struct inode *dir, struct dentry *dentry, int mode, dev_t dev)
++int vfs_mknod(struct inode *dir, struct dentry *dentry,
++	int mode, dev_t dev, struct nameidata *nd)
+ {
+-	int error = may_create(dir, dentry, NULL);
++	int error = may_create(dir, dentry, nd);
+ 
+ 	if (error)
+ 		return error;
+@@ -1906,11 +1991,12 @@ asmlinkage long sys_mknodat(int dfd, con
+ 			error = vfs_create(nd.dentry->d_inode,dentry,mode,&nd);
+ 			break;
+ 		case S_IFCHR: case S_IFBLK:
+-			error = vfs_mknod(nd.dentry->d_inode,dentry,mode,
+-					new_decode_dev(dev));
++			error = vfs_mknod(nd.dentry->d_inode, dentry, mode,
++					new_decode_dev(dev), &nd);
+ 			break;
+ 		case S_IFIFO: case S_IFSOCK:
+-			error = vfs_mknod(nd.dentry->d_inode,dentry,mode,0);
++			error = vfs_mknod(nd.dentry->d_inode, dentry, mode,
++					0, &nd);
+ 			break;
+ 		case S_IFDIR:
+ 			error = -EPERM;
+@@ -1933,9 +2019,10 @@ asmlinkage long sys_mknod(const char __u
+ 	return sys_mknodat(AT_FDCWD, filename, mode, dev);
+ }
+ 
+-int vfs_mkdir(struct inode *dir, struct dentry *dentry, int mode)
++int vfs_mkdir(struct inode *dir, struct dentry *dentry,
++	int mode, struct nameidata *nd)
+ {
+-	int error = may_create(dir, dentry, NULL);
++	int error = may_create(dir, dentry, nd);
+ 
+ 	if (error)
+ 		return error;
+@@ -1977,7 +2064,7 @@ asmlinkage long sys_mkdirat(int dfd, con
+ 
+ 	if (!IS_POSIXACL(nd.dentry->d_inode))
+ 		mode &= ~current->fs->umask;
+-	error = vfs_mkdir(nd.dentry->d_inode, dentry, mode);
++	error = vfs_mkdir(nd.dentry->d_inode, dentry, mode, &nd);
+ 	dput(dentry);
+ out_unlock:
+ 	mutex_unlock(&nd.dentry->d_inode->i_mutex);
+@@ -2020,9 +2107,10 @@ void dentry_unhash(struct dentry *dentry
+ 	spin_unlock(&dcache_lock);
+ }
+ 
+-int vfs_rmdir(struct inode *dir, struct dentry *dentry)
++int vfs_rmdir(struct inode *dir, struct dentry *dentry,
++	struct nameidata *nd)
+ {
+-	int error = may_delete(dir, dentry, 1);
++	int error = may_delete(dir, dentry, 1, nd);
+ 
+ 	if (error)
+ 		return error;
+@@ -2084,7 +2172,7 @@ static long do_rmdir(int dfd, const char
+ 	error = PTR_ERR(dentry);
+ 	if (IS_ERR(dentry))
+ 		goto exit2;
+-	error = vfs_rmdir(nd.dentry->d_inode, dentry);
++	error = vfs_rmdir(nd.dentry->d_inode, dentry, &nd);
+ 	dput(dentry);
+ exit2:
+ 	mutex_unlock(&nd.dentry->d_inode->i_mutex);
+@@ -2100,9 +2188,10 @@ asmlinkage long sys_rmdir(const char __u
+ 	return do_rmdir(AT_FDCWD, pathname);
+ }
+ 
+-int vfs_unlink(struct inode *dir, struct dentry *dentry)
++int vfs_unlink(struct inode *dir, struct dentry *dentry,
++	struct nameidata *nd)
+ {
+-	int error = may_delete(dir, dentry, 0);
++	int error = may_delete(dir, dentry, 0, nd);
+ 
+ 	if (error)
+ 		return error;
+@@ -2164,7 +2253,7 @@ static long do_unlinkat(int dfd, const c
+ 		inode = dentry->d_inode;
+ 		if (inode)
+ 			atomic_inc(&inode->i_count);
+-		error = vfs_unlink(nd.dentry->d_inode, dentry);
++		error = vfs_unlink(nd.dentry->d_inode, dentry, &nd);
+ 	exit2:
+ 		dput(dentry);
+ 	}
+@@ -2199,9 +2288,10 @@ asmlinkage long sys_unlink(const char __
+ 	return do_unlinkat(AT_FDCWD, pathname);
+ }
+ 
+-int vfs_symlink(struct inode *dir, struct dentry *dentry, const char *oldname, int mode)
++int vfs_symlink(struct inode *dir, struct dentry *dentry,
++	const char *oldname, int mode, struct nameidata *nd)
+ {
+-	int error = may_create(dir, dentry, NULL);
++	int error = may_create(dir, dentry, nd);
+ 
+ 	if (error)
+ 		return error;
+@@ -2245,7 +2335,7 @@ asmlinkage long sys_symlinkat(const char
+ 	if (IS_ERR(dentry))
+ 		goto out_unlock;
+ 
+-	error = vfs_symlink(nd.dentry->d_inode, dentry, from, S_IALLUGO);
++	error = vfs_symlink(nd.dentry->d_inode, dentry, from, S_IALLUGO, &nd);
+ 	dput(dentry);
+ out_unlock:
+ 	mutex_unlock(&nd.dentry->d_inode->i_mutex);
+@@ -2262,7 +2352,8 @@ asmlinkage long sys_symlink(const char _
+ 	return sys_symlinkat(oldname, AT_FDCWD, newname);
+ }
+ 
+-int vfs_link(struct dentry *old_dentry, struct inode *dir, struct dentry *new_dentry)
++int vfs_link(struct dentry *old_dentry, struct inode *dir,
++	struct dentry *new_dentry, struct nameidata *nd)
+ {
+ 	struct inode *inode = old_dentry->d_inode;
+ 	int error;
+@@ -2270,7 +2361,7 @@ int vfs_link(struct dentry *old_dentry, 
+ 	if (!inode)
+ 		return -ENOENT;
+ 
+-	error = may_create(dir, new_dentry, NULL);
++	error = may_create(dir, new_dentry, nd);
+ 	if (error)
+ 		return error;
+ 
+@@ -2280,7 +2371,7 @@ int vfs_link(struct dentry *old_dentry, 
+ 	/*
+ 	 * A link to an append-only or immutable file cannot be created.
+ 	 */
+-	if (IS_APPEND(inode) || IS_IMMUTABLE(inode))
++	if (IS_APPEND(inode) || IS_IXORUNLINK(inode))
+ 		return -EPERM;
+ 	if (!dir->i_op || !dir->i_op->link)
+ 		return -EPERM;
+@@ -2340,7 +2431,7 @@ asmlinkage long sys_linkat(int olddfd, c
+ 	error = PTR_ERR(new_dentry);
+ 	if (IS_ERR(new_dentry))
+ 		goto out_unlock;
+-	error = vfs_link(old_nd.dentry, nd.dentry->d_inode, new_dentry);
++	error = vfs_link(old_nd.dentry, nd.dentry->d_inode, new_dentry, &nd);
+ 	dput(new_dentry);
+ out_unlock:
+ 	mutex_unlock(&nd.dentry->d_inode->i_mutex);
+@@ -2472,14 +2563,14 @@ int vfs_rename(struct inode *old_dir, st
+ 	if (old_dentry->d_inode == new_dentry->d_inode)
+  		return 0;
+  
+-	error = may_delete(old_dir, old_dentry, is_dir);
++	error = may_delete(old_dir, old_dentry, is_dir, NULL);
+ 	if (error)
+ 		return error;
+ 
+ 	if (!new_dentry->d_inode)
+ 		error = may_create(new_dir, new_dentry, NULL);
+ 	else
+-		error = may_delete(new_dir, new_dentry, is_dir);
++		error = may_delete(new_dir, new_dentry, is_dir, NULL);
+ 	if (error)
+ 		return error;
+ 
+@@ -2557,6 +2648,9 @@ static int do_rename(int olddfd, const c
+ 	error = -EINVAL;
+ 	if (old_dentry == trap)
+ 		goto exit4;
++	error = -EROFS;
++	if (MNT_IS_RDONLY(newnd.mnt))
++		goto exit4;
+ 	new_dentry = lookup_hash(&newnd);
+ 	error = PTR_ERR(new_dentry);
+ 	if (IS_ERR(new_dentry))
+@@ -2650,6 +2744,129 @@ int vfs_follow_link(struct nameidata *nd
+ 	return __vfs_follow_link(nd, link);
+ }
+ 
++
++#ifdef	CONFIG_VSERVER_COWBL
++
++#include <linux/file.h>
++
++struct dentry *cow_break_link(const char *pathname)
++{
++	int ret, mode, pathlen;
++	struct nameidata old_nd, dir_nd;
++	struct dentry *old_dentry, *new_dentry;
++	struct dentry *res = ERR_PTR(-EMLINK);
++	struct vfsmount *old_mnt, *new_mnt;
++	struct file *old_file;
++	struct file *new_file;
++	char *to, *path, pad='\251';
++	loff_t size;
++
++	vxdprintk(VXD_CBIT(misc, 1), "cow_break_link(»%s«)", pathname);
++	path = kmalloc(PATH_MAX, GFP_KERNEL);
++
++	ret = path_lookup(pathname, LOOKUP_FOLLOW, &old_nd);
++	vxdprintk(VXD_CBIT(misc, 2), "path_lookup(old): %d", ret);
++	old_dentry = old_nd.dentry;
++	old_mnt = old_nd.mnt;
++	mode = old_dentry->d_inode->i_mode;
++
++	to = d_path(old_dentry, old_mnt, path, PATH_MAX-2);
++	pathlen = strlen(to);
++	vxdprintk(VXD_CBIT(misc, 2), "old path »%s«", to);
++
++	to[pathlen+1] = 0;
++retry:
++	to[pathlen] = pad--;
++	if (pad <= '\240')
++		goto out_rel_old;
++
++	vxdprintk(VXD_CBIT(misc, 1), "temp copy »%s«", to);
++	ret = path_lookup(to,
++		LOOKUP_PARENT|LOOKUP_OPEN|LOOKUP_CREATE, &dir_nd);
++
++	/* this puppy downs the inode sem */
++	new_dentry = lookup_create(&dir_nd, 0);
++	vxdprintk(VXD_CBIT(misc, 2),
++		"lookup_create(new): %p", new_dentry);
++	if (!new_dentry) {
++		path_release(&dir_nd);
++		goto retry;
++	}
++
++	ret = vfs_create(dir_nd.dentry->d_inode, new_dentry, mode, &dir_nd);
++	vxdprintk(VXD_CBIT(misc, 2),
++		"vfs_create(new): %d", ret);
++	if (ret == -EEXIST) {
++		mutex_unlock(&dir_nd.dentry->d_inode->i_mutex);
++		dput(new_dentry);
++		path_release(&dir_nd);
++		goto retry;
++	}
++	else if (ret < 0) {
++		res = ERR_PTR(ret);
++		goto out_rel_both;
++	}
++
++	new_mnt = dir_nd.mnt;
++
++	dget(old_dentry);
++	mntget(old_mnt);
++	/* this one cleans up the dentry in case of failure */
++	old_file = dentry_open(old_dentry, old_mnt, O_RDONLY);
++	vxdprintk(VXD_CBIT(misc, 2),
++		"dentry_open(old): %p", old_file);
++	if (!old_file)
++		goto out_rel_both;
++
++	dget(new_dentry);
++	mntget(new_mnt);
++	/* this one cleans up the dentry in case of failure */
++	new_file = dentry_open(new_dentry, new_mnt, O_WRONLY);
++	vxdprintk(VXD_CBIT(misc, 2),
++		"dentry_open(new): %p", new_file);
++	if (!new_file)
++		goto out_fput_old;
++
++	size = i_size_read(old_file->f_dentry->d_inode);
++	ret = vfs_sendfile(new_file, old_file, NULL, size, 0);
++	vxdprintk(VXD_CBIT(misc, 2), "vfs_sendfile: %d", ret);
++
++	if (ret < 0)
++		goto out_fput_both;
++
++	ret = vfs_rename(dir_nd.dentry->d_inode, new_dentry,
++		old_nd.dentry->d_parent->d_inode, old_dentry);
++	vxdprintk(VXD_CBIT(misc, 2), "vfs_rename: %d", ret);
++	if (!ret) {
++		res = new_dentry;
++		dget(new_dentry);
++	}
++
++out_fput_both:
++	vxdprintk(VXD_CBIT(misc, 3),
++		"fput(new_file=%p[#%d])", new_file,
++		atomic_read(&new_file->f_count));
++	fput(new_file);
++
++out_fput_old:
++	vxdprintk(VXD_CBIT(misc, 3),
++		"fput(old_file=%p[#%d])", old_file,
++		atomic_read(&old_file->f_count));
++	fput(old_file);
++
++out_rel_both:
++	mutex_unlock(&dir_nd.dentry->d_inode->i_mutex);
++	dput(new_dentry);
++
++	path_release(&dir_nd);
++out_rel_old:
++	path_release(&old_nd);
++	kfree(path);
++	return res;
++}
++
++#endif
++
+ /* get the link contents into pagecache */
+ static char *page_getlink(struct dentry * dentry, struct page **ppage)
+ {
+--- linux-2.6.22/fs/namespace.c	2007-07-09 13:19:27 +0200
++++ linux-2.6.22-vs2.2.0-rc5/fs/namespace.c	2007-06-15 03:24:51 +0200
+@@ -25,6 +25,11 @@
+ #include <linux/security.h>
+ #include <linux/mount.h>
+ #include <linux/ramfs.h>
++#include <linux/vs_base.h>
++#include <linux/vs_context.h>
++#include <linux/vs_tag.h>
++#include <linux/vserver/space.h>
++#include <linux/vserver/global.h>
+ #include <asm/uaccess.h>
+ #include <asm/unistd.h>
+ #include "pnode.h"
+@@ -240,6 +245,7 @@ static struct vfsmount *clone_mnt(struct
+ 		mnt->mnt_root = dget(root);
+ 		mnt->mnt_mountpoint = mnt->mnt_root;
+ 		mnt->mnt_parent = mnt;
++		mnt->mnt_tag = old->mnt_tag;
+ 
+ 		if (flag & CL_SLAVE) {
+ 			list_add(&mnt->mnt_slave, &old->mnt_slave_list);
+@@ -348,48 +354,91 @@ static inline void mangle(struct seq_fil
+ 	seq_escape(m, s, " \t\n\\");
+ }
+ 
++static int mnt_is_reachable(struct vfsmount *mnt)
++{
++	struct vfsmount *root_mnt;
++	struct dentry *root, *point;
++	int ret;
++
++	if (mnt == mnt->mnt_ns->root)
++		return 1;
++
++	spin_lock(&vfsmount_lock);
++	root_mnt = current->fs->rootmnt;
++	root = current->fs->root;
++	point = root;
++
++	while ((mnt != mnt->mnt_parent) && (mnt != root_mnt)) {
++		point = mnt->mnt_mountpoint;
++		mnt = mnt->mnt_parent;
++	}
++
++	ret = (mnt == root_mnt) && is_subdir(point, root);
++
++	spin_unlock(&vfsmount_lock);
++
++	return ret;
++}
++
+ static int show_vfsmnt(struct seq_file *m, void *v)
+ {
+ 	struct vfsmount *mnt = v;
+ 	int err = 0;
+ 	static struct proc_fs_info {
+-		int flag;
+-		char *str;
++		int s_flag;
++		int mnt_flag;
++		char *set_str;
++		char *unset_str;
+ 	} fs_info[] = {
+-		{ MS_SYNCHRONOUS, ",sync" },
+-		{ MS_DIRSYNC, ",dirsync" },
+-		{ MS_MANDLOCK, ",mand" },
+-		{ 0, NULL }
+-	};
+-	static struct proc_fs_info mnt_info[] = {
+-		{ MNT_NOSUID, ",nosuid" },
+-		{ MNT_NODEV, ",nodev" },
+-		{ MNT_NOEXEC, ",noexec" },
+-		{ MNT_NOATIME, ",noatime" },
+-		{ MNT_NODIRATIME, ",nodiratime" },
+-		{ MNT_RELATIME, ",relatime" },
+-		{ 0, NULL }
++		{ MS_RDONLY, MNT_RDONLY, "ro", "rw" },
++		{ MS_SYNCHRONOUS, 0, ",sync", NULL },
++		{ MS_DIRSYNC, 0, ",dirsync", NULL },
++		{ MS_MANDLOCK, 0, ",mand", NULL },
++		{ MS_TAGGED, 0, ",tag", NULL },
++		{ MS_NOATIME, MNT_NOATIME, ",noatime", NULL },
++		{ MS_NODIRATIME, MNT_NODIRATIME, ",nodiratime", NULL },
++		{ MS_RELATIME, MNT_RELATIME, ",relatime", NULL },
++		{ 0, MNT_NOSUID, ",nosuid", NULL },
++		{ 0, MNT_NODEV, ",nodev", NULL },
++		{ 0, MNT_NOEXEC, ",noexec", NULL },
++		{ 0, 0, NULL, NULL }
+ 	};
+-	struct proc_fs_info *fs_infop;
++	struct proc_fs_info *p;
++	unsigned long s_flags = mnt->mnt_sb->s_flags;
++	int mnt_flags = mnt->mnt_flags;
+ 
+-	mangle(m, mnt->mnt_devname ? mnt->mnt_devname : "none");
+-	seq_putc(m, ' ');
+-	seq_path(m, mnt, mnt->mnt_root, " \t\n\\");
+-	seq_putc(m, ' ');
+-	mangle(m, mnt->mnt_sb->s_type->name);
+-	if (mnt->mnt_sb->s_subtype && mnt->mnt_sb->s_subtype[0]) {
+-		seq_putc(m, '.');
+-		mangle(m, mnt->mnt_sb->s_subtype);
+-	}
+-	seq_puts(m, mnt->mnt_sb->s_flags & MS_RDONLY ? " ro" : " rw");
+-	for (fs_infop = fs_info; fs_infop->flag; fs_infop++) {
+-		if (mnt->mnt_sb->s_flags & fs_infop->flag)
+-			seq_puts(m, fs_infop->str);
++	if (vx_flags(VXF_HIDE_MOUNT, 0))
++		return 0;
++	if (!mnt_is_reachable(mnt) && !vx_check(0, VS_WATCH_P))
++		return 0;
++
++	if (!vx_check(0, VS_ADMIN|VS_WATCH) &&
++		mnt == current->fs->rootmnt) {
++		seq_puts(m, "/dev/root / ");
++	} else {
++		mangle(m, mnt->mnt_devname ? mnt->mnt_devname : "none");
++		seq_putc(m, ' ');
++		seq_path(m, mnt, mnt->mnt_root, " \t\n\\");
++		seq_putc(m, ' ');
++
++		if (mnt->mnt_sb->s_subtype && mnt->mnt_sb->s_subtype[0]) {
++			seq_putc(m, '.');
++			mangle(m, mnt->mnt_sb->s_subtype);
++		}
+ 	}
+-	for (fs_infop = mnt_info; fs_infop->flag; fs_infop++) {
+-		if (mnt->mnt_flags & fs_infop->flag)
+-			seq_puts(m, fs_infop->str);
++	mangle(m, mnt->mnt_sb->s_type->name);
++	seq_putc(m, ' ');
++	for (p = fs_info; (p->s_flag | p->mnt_flag) ; p++) {
++		if ((s_flags & p->s_flag) || (mnt_flags & p->mnt_flag)) {
++			if (p->set_str)
++				seq_puts(m, p->set_str);
++		} else {
++			if (p->unset_str)
++				seq_puts(m, p->unset_str);
++		}
+ 	}
++	if (mnt->mnt_flags & MNT_TAGID)
++		seq_printf(m, ",tag=%d", mnt->mnt_tag);
+ 	if (mnt->mnt_sb->s_op->show_options)
+ 		err = mnt->mnt_sb->s_op->show_options(m, mnt);
+ 	seq_puts(m, " 0 0\n");
+@@ -408,17 +457,27 @@ static int show_vfsstat(struct seq_file 
+ 	struct vfsmount *mnt = v;
+ 	int err = 0;
+ 
+-	/* device */
+-	if (mnt->mnt_devname) {
+-		seq_puts(m, "device ");
+-		mangle(m, mnt->mnt_devname);
+-	} else
+-		seq_puts(m, "no device");
++	if (vx_flags(VXF_HIDE_MOUNT, 0))
++		return 0;
++	if (!mnt_is_reachable(mnt) && !vx_check(0, VS_WATCH_P))
++		return 0;
+ 
+-	/* mount point */
+-	seq_puts(m, " mounted on ");
+-	seq_path(m, mnt, mnt->mnt_root, " \t\n\\");
+-	seq_putc(m, ' ');
++	if (!vx_check(0, VS_ADMIN|VS_WATCH) &&
++		mnt == current->fs->rootmnt) {
++		seq_puts(m, "device /dev/root mounted on / ");
++	} else {
++		/* device */
++		if (mnt->mnt_devname) {
++			seq_puts(m, "device ");
++			mangle(m, mnt->mnt_devname);
++		} else
++			seq_puts(m, "no device");
++
++		/* mount point */
++		seq_puts(m, " mounted on ");
++		seq_path(m, mnt, mnt->mnt_root, " \t\n\\");
++		seq_putc(m, ' ');
++	}
+ 
+ 	/* file system type */
+ 	seq_puts(m, "with fstype ");
+@@ -648,7 +707,7 @@ asmlinkage long sys_umount(char __user *
+ 		goto dput_and_out;
+ 
+ 	retval = -EPERM;
+-	if (!capable(CAP_SYS_ADMIN))
++	if (!vx_capable(CAP_SYS_ADMIN, VXC_SECURE_MOUNT))
+ 		goto dput_and_out;
+ 
+ 	retval = do_umount(nd.mnt, flags);
+@@ -672,7 +731,7 @@ asmlinkage long sys_oldumount(char __use
+ 
+ static int mount_is_safe(struct nameidata *nd)
+ {
+-	if (capable(CAP_SYS_ADMIN))
++	if (vx_capable(CAP_SYS_ADMIN, VXC_SECURE_MOUNT))
+ 		return 0;
+ 	return -EPERM;
+ #ifdef notyet
+@@ -904,11 +963,13 @@ static int do_change_type(struct nameida
+ /*
+  * do loopback mount.
+  */
+-static int do_loopback(struct nameidata *nd, char *old_name, int recurse)
++static int do_loopback(struct nameidata *nd, char *old_name, tag_t tag,
++	unsigned long flags, int mnt_flags)
+ {
+ 	struct nameidata old_nd;
+ 	struct vfsmount *mnt = NULL;
+ 	int err = mount_is_safe(nd);
++	int recurse = flags & MS_REC;
+ 	if (err)
+ 		return err;
+ 	if (!old_name || !*old_name)
+@@ -934,6 +995,12 @@ static int do_loopback(struct nameidata 
+ 	if (!mnt)
+ 		goto out;
+ 
++	mnt->mnt_flags = mnt_flags;
++	if (flags & MS_TAGID) {
++		mnt->mnt_tag = tag;
++		mnt->mnt_flags |= MNT_TAGID;
++	}
++
+ 	err = graft_tree(mnt, nd);
+ 	if (err) {
+ 		LIST_HEAD(umount_list);
+@@ -942,6 +1009,7 @@ static int do_loopback(struct nameidata 
+ 		spin_unlock(&vfsmount_lock);
+ 		release_mounts(&umount_list);
+ 	}
++	mnt->mnt_flags = mnt_flags;
+ 
+ out:
+ 	up_write(&namespace_sem);
+@@ -955,12 +1023,12 @@ out:
+  * on it - tough luck.
+  */
+ static int do_remount(struct nameidata *nd, int flags, int mnt_flags,
+-		      void *data)
++		      void *data, xid_t xid)
+ {
+ 	int err;
+ 	struct super_block *sb = nd->mnt->mnt_sb;
+ 
+-	if (!capable(CAP_SYS_ADMIN))
++	if (!vx_capable(CAP_SYS_ADMIN, VXC_SECURE_REMOUNT))
+ 		return -EPERM;
+ 
+ 	if (!check_mnt(nd->mnt))
+@@ -994,7 +1062,7 @@ static int do_move_mount(struct nameidat
+ 	struct nameidata old_nd, parent_nd;
+ 	struct vfsmount *p;
+ 	int err = 0;
+-	if (!capable(CAP_SYS_ADMIN))
++	if (!vx_capable(CAP_SYS_ADMIN, VXC_SECURE_MOUNT))
+ 		return -EPERM;
+ 	if (!old_name || !*old_name)
+ 		return -EINVAL;
+@@ -1074,7 +1142,7 @@ static int do_new_mount(struct nameidata
+ 		return -EINVAL;
+ 
+ 	/* we need capabilities... */
+-	if (!capable(CAP_SYS_ADMIN))
++	if (!vx_capable(CAP_SYS_ADMIN, VXC_SECURE_MOUNT))
+ 		return -EPERM;
+ 
+ 	mnt = do_kern_mount(type, flags, name, data);
+@@ -1386,6 +1454,7 @@ long do_mount(char *dev_name, char *dir_
+ 	struct nameidata nd;
+ 	int retval = 0;
+ 	int mnt_flags = 0;
++	tag_t tag = 0;
+ 
+ 	/* Discard magic */
+ 	if ((flags & MS_MGC_MSK) == MS_MGC_VAL)
+@@ -1401,7 +1470,19 @@ long do_mount(char *dev_name, char *dir_
+ 	if (data_page)
+ 		((char *)data_page)[PAGE_SIZE - 1] = 0;
+ 
++#ifdef	CONFIG_PROPAGATE
++	retval = dx_parse_tag(data_page, &tag, 1);
++	if (retval) {
++		mnt_flags |= MNT_TAGID;
++		/* bind and re-mounts get the tag flag */
++		if (flags & (MS_BIND|MS_REMOUNT))
++			flags |= MS_TAGID;
++	}
++#endif
++
+ 	/* Separate the per-mountpoint flags */
++	if (flags & MS_RDONLY)
++		mnt_flags |= MNT_RDONLY;
+ 	if (flags & MS_NOSUID)
+ 		mnt_flags |= MNT_NOSUID;
+ 	if (flags & MS_NODEV)
+@@ -1415,6 +1496,8 @@ long do_mount(char *dev_name, char *dir_
+ 	if (flags & MS_RELATIME)
+ 		mnt_flags |= MNT_RELATIME;
+ 
++	if (!capable(CAP_SYS_ADMIN))
++		mnt_flags |= MNT_NODEV;
+ 	flags &= ~(MS_NOSUID | MS_NOEXEC | MS_NODEV | MS_ACTIVE |
+ 		   MS_NOATIME | MS_NODIRATIME | MS_RELATIME);
+ 
+@@ -1429,9 +1512,9 @@ long do_mount(char *dev_name, char *dir_
+ 
+ 	if (flags & MS_REMOUNT)
+ 		retval = do_remount(&nd, flags & ~MS_REMOUNT, mnt_flags,
+-				    data_page);
++				    data_page, tag);
+ 	else if (flags & MS_BIND)
+-		retval = do_loopback(&nd, dev_name, flags & MS_REC);
++		retval = do_loopback(&nd, dev_name, tag, flags, mnt_flags);
+ 	else if (flags & (MS_SHARED | MS_PRIVATE | MS_SLAVE | MS_UNBINDABLE))
+ 		retval = do_change_type(&nd, flags);
+ 	else if (flags & MS_MOVE)
+@@ -1504,6 +1587,7 @@ static struct mnt_namespace *dup_mnt_ns(
+ 		q = next_mnt(q, new_ns->root);
+ 	}
+ 	up_write(&namespace_sem);
++	atomic_inc(&vs_global_mnt_ns);
+ 
+ 	if (rootmnt)
+ 		mntput(rootmnt);
+@@ -1866,5 +1950,6 @@ void __put_mnt_ns(struct mnt_namespace *
+ 	spin_unlock(&vfsmount_lock);
+ 	up_write(&namespace_sem);
+ 	release_mounts(&umount_list);
++	atomic_dec(&vs_global_mnt_ns);
+ 	kfree(ns);
+ }
+--- linux-2.6.22/fs/nfs/client.c	2007-07-09 13:19:27 +0200
++++ linux-2.6.22-vs2.2.0-rc5/fs/nfs/client.c	2007-06-15 02:37:03 +0200
+@@ -521,6 +521,9 @@ static int nfs_init_server_rpcclient(str
+ 	if (server->flags & NFS4_MOUNT_INTR)
+ 		server->client->cl_intr = 1;
+ 
++	server->client->cl_tag = 0;
++	if (server->flags & NFS_MOUNT_TAGGED)
++		server->client->cl_tag = 1;
+ 	return 0;
+ }
+ 
+@@ -678,6 +681,10 @@ static void nfs_server_set_fsinfo(struct
+ 		server->acdirmin = server->acdirmax = 0;
+ 	}
+ 
++	/* FIXME: needs fsinfo
++	if (server->flags & NFS_MOUNT_TAGGED)
++		sb->s_flags |= MS_TAGGED;	*/
++
+ 	server->maxfilesize = fsinfo->maxfilesize;
+ 
+ 	/* We're airborne Set socket buffersize */
+--- linux-2.6.22/fs/nfs/dir.c	2007-07-09 13:19:27 +0200
++++ linux-2.6.22-vs2.2.0-rc5/fs/nfs/dir.c	2007-06-15 03:02:49 +0200
+@@ -34,6 +34,7 @@
+ #include <linux/namei.h>
+ #include <linux/mount.h>
+ #include <linux/sched.h>
++#include <linux/vs_tag.h>
+ 
+ #include "nfs4_fs.h"
+ #include "delegation.h"
+@@ -956,6 +957,7 @@ static struct dentry *nfs_lookup(struct 
+ 	if (IS_ERR(res))
+ 		goto out_unlock;
+ 
++	dx_propagate_tag(nd, inode);
+ no_entry:
+ 	res = d_materialise_unique(dentry, inode);
+ 	if (res != NULL) {
+@@ -998,7 +1000,8 @@ static int is_atomic_open(struct inode *
+ 	if (nd->flags & LOOKUP_DIRECTORY)
+ 		return 0;
+ 	/* Are we trying to write to a read only partition? */
+-	if (IS_RDONLY(dir) && (nd->intent.open.flags & (O_CREAT|O_TRUNC|FMODE_WRITE)))
++	if ((IS_RDONLY(dir) || MNT_IS_RDONLY(nd->mnt)) &&
++		(nd->intent.open.flags & (O_CREAT|O_TRUNC|FMODE_WRITE)))
+ 		return 0;
+ 	return 1;
+ }
+--- linux-2.6.22/fs/nfs/inode.c	2007-07-09 13:19:27 +0200
++++ linux-2.6.22-vs2.2.0-rc5/fs/nfs/inode.c	2007-06-15 02:37:03 +0200
+@@ -37,6 +37,7 @@
+ #include <linux/vfs.h>
+ #include <linux/inet.h>
+ #include <linux/nfs_xdr.h>
++#include <linux/vs_tag.h>
+ 
+ #include <asm/system.h>
+ #include <asm/uaccess.h>
+@@ -285,8 +286,10 @@ nfs_fhget(struct super_block *sb, struct
+ 			nfsi->change_attr = fattr->change_attr;
+ 		inode->i_size = nfs_size_to_loff_t(fattr->size);
+ 		inode->i_nlink = fattr->nlink;
+-		inode->i_uid = fattr->uid;
+-		inode->i_gid = fattr->gid;
++		inode->i_uid = INOTAG_UID(DX_TAG(inode), fattr->uid, fattr->gid);
++		inode->i_gid = INOTAG_GID(DX_TAG(inode), fattr->uid, fattr->gid);
++		inode->i_tag = INOTAG_TAG(DX_TAG(inode), fattr->uid, fattr->gid, 0);
++					 /* maybe fattr->xid someday */
+ 		if (fattr->valid & (NFS_ATTR_FATTR_V3 | NFS_ATTR_FATTR_V4)) {
+ 			/*
+ 			 * report the blocks in 512byte units
+@@ -377,6 +380,8 @@ void nfs_setattr_update_inode(struct ino
+ 			inode->i_uid = attr->ia_uid;
+ 		if ((attr->ia_valid & ATTR_GID) != 0)
+ 			inode->i_gid = attr->ia_gid;
++		if ((attr->ia_valid & ATTR_TAG) && IS_TAGGED(inode))
++			inode->i_tag = attr->ia_tag;
+ 		spin_lock(&inode->i_lock);
+ 		NFS_I(inode)->cache_validity |= NFS_INO_INVALID_ACCESS|NFS_INO_INVALID_ACL;
+ 		spin_unlock(&inode->i_lock);
+@@ -825,6 +830,9 @@ static int nfs_check_inode_attributes(st
+ 	struct nfs_inode *nfsi = NFS_I(inode);
+ 	loff_t cur_size, new_isize;
+ 	int data_unstable;
++	uid_t uid;
++	gid_t gid;
++	tag_t tag;
+ 
+ 
+ 	/* Has the inode gone and changed behind our back? */
+@@ -852,10 +860,15 @@ static int nfs_check_inode_attributes(st
+ 	if (cur_size != new_isize && nfsi->npages == 0)
+ 		nfsi->cache_validity |= NFS_INO_INVALID_ATTR|NFS_INO_REVAL_PAGECACHE;
+ 
++	uid = INOTAG_UID(DX_TAG(inode), fattr->uid, fattr->gid);
++	gid = INOTAG_GID(DX_TAG(inode), fattr->uid, fattr->gid);
++	tag = INOTAG_TAG(DX_TAG(inode), fattr->uid, fattr->gid, 0);
++
+ 	/* Have any file permissions changed? */
+ 	if ((inode->i_mode & S_IALLUGO) != (fattr->mode & S_IALLUGO)
+-			|| inode->i_uid != fattr->uid
+-			|| inode->i_gid != fattr->gid)
++			|| inode->i_uid != uid
++			|| inode->i_gid != gid
++			|| inode->i_tag != tag)
+ 		nfsi->cache_validity |= NFS_INO_INVALID_ATTR | NFS_INO_INVALID_ACCESS | NFS_INO_INVALID_ACL;
+ 
+ 	/* Has the link count changed? */
+@@ -946,6 +959,9 @@ static int nfs_update_inode(struct inode
+ 	unsigned int	invalid = 0;
+ 	unsigned long now = jiffies;
+ 	int data_stable;
++	uid_t uid;
++	gid_t gid;
++	tag_t tag;
+ 
+ 	dfprintk(VFS, "NFS: %s(%s/%ld ct=%d info=0x%x)\n",
+ 			__FUNCTION__, inode->i_sb->s_id, inode->i_ino,
+@@ -1022,15 +1038,21 @@ static int nfs_update_inode(struct inode
+ 	}
+ 	memcpy(&inode->i_atime, &fattr->atime, sizeof(inode->i_atime));
+ 
++	uid = INOTAG_UID(DX_TAG(inode), fattr->uid, fattr->gid);
++	gid = INOTAG_GID(DX_TAG(inode), fattr->uid, fattr->gid);
++	tag = INOTAG_TAG(DX_TAG(inode), fattr->uid, fattr->gid, 0);
++
+ 	if ((inode->i_mode & S_IALLUGO) != (fattr->mode & S_IALLUGO) ||
+-	    inode->i_uid != fattr->uid ||
+-	    inode->i_gid != fattr->gid)
++	    inode->i_uid != uid ||
++	    inode->i_gid != gid ||
++	    inode->i_tag != tag)
+ 		invalid |= NFS_INO_INVALID_ATTR|NFS_INO_INVALID_ACCESS|NFS_INO_INVALID_ACL;
+ 
+ 	inode->i_mode = fattr->mode;
+ 	inode->i_nlink = fattr->nlink;
+-	inode->i_uid = fattr->uid;
+-	inode->i_gid = fattr->gid;
++	inode->i_uid = uid;
++	inode->i_gid = gid;
++	inode->i_tag = tag;
+ 
+ 	if (fattr->valid & (NFS_ATTR_FATTR_V3 | NFS_ATTR_FATTR_V4)) {
+ 		/*
+--- linux-2.6.22/fs/nfs/nfs3xdr.c	2007-07-09 13:19:27 +0200
++++ linux-2.6.22-vs2.2.0-rc5/fs/nfs/nfs3xdr.c	2007-06-15 02:37:03 +0200
+@@ -22,6 +22,7 @@
+ #include <linux/nfs3.h>
+ #include <linux/nfs_fs.h>
+ #include <linux/nfsacl.h>
++#include <linux/vs_tag.h>
+ #include "internal.h"
+ 
+ #define NFSDBG_FACILITY		NFSDBG_XDR
+@@ -178,7 +179,7 @@ xdr_decode_fattr(__be32 *p, struct nfs_f
+ }
+ 
+ static inline __be32 *
+-xdr_encode_sattr(__be32 *p, struct iattr *attr)
++xdr_encode_sattr(__be32 *p, struct iattr *attr, int tag)
+ {
+ 	if (attr->ia_valid & ATTR_MODE) {
+ 		*p++ = xdr_one;
+@@ -186,15 +187,17 @@ xdr_encode_sattr(__be32 *p, struct iattr
+ 	} else {
+ 		*p++ = xdr_zero;
+ 	}
+-	if (attr->ia_valid & ATTR_UID) {
++	if (attr->ia_valid & ATTR_UID ||
++		(tag && (attr->ia_valid & ATTR_TAG))) {
+ 		*p++ = xdr_one;
+-		*p++ = htonl(attr->ia_uid);
++		*p++ = htonl(TAGINO_UID(tag, attr->ia_uid, attr->ia_tag));
+ 	} else {
+ 		*p++ = xdr_zero;
+ 	}
+-	if (attr->ia_valid & ATTR_GID) {
++	if (attr->ia_valid & ATTR_GID ||
++		(tag && (attr->ia_valid & ATTR_TAG))) {
+ 		*p++ = xdr_one;
+-		*p++ = htonl(attr->ia_gid);
++		*p++ = htonl(TAGINO_GID(tag, attr->ia_gid, attr->ia_tag));
+ 	} else {
+ 		*p++ = xdr_zero;
+ 	}
+@@ -279,7 +282,8 @@ static int
+ nfs3_xdr_sattrargs(struct rpc_rqst *req, __be32 *p, struct nfs3_sattrargs *args)
+ {
+ 	p = xdr_encode_fhandle(p, args->fh);
+-	p = xdr_encode_sattr(p, args->sattr);
++	p = xdr_encode_sattr(p, args->sattr,
++		req->rq_task->tk_client->cl_tag);
+ 	*p++ = htonl(args->guard);
+ 	if (args->guard)
+ 		p = xdr_encode_time3(p, &args->guardtime);
+@@ -370,7 +374,8 @@ nfs3_xdr_createargs(struct rpc_rqst *req
+ 		*p++ = args->verifier[0];
+ 		*p++ = args->verifier[1];
+ 	} else
+-		p = xdr_encode_sattr(p, args->sattr);
++		p = xdr_encode_sattr(p, args->sattr,
++			req->rq_task->tk_client->cl_tag);
+ 
+ 	req->rq_slen = xdr_adjust_iovec(req->rq_svec, p);
+ 	return 0;
+@@ -384,7 +389,8 @@ nfs3_xdr_mkdirargs(struct rpc_rqst *req,
+ {
+ 	p = xdr_encode_fhandle(p, args->fh);
+ 	p = xdr_encode_array(p, args->name, args->len);
+-	p = xdr_encode_sattr(p, args->sattr);
++	p = xdr_encode_sattr(p, args->sattr,
++		req->rq_task->tk_client->cl_tag);
+ 	req->rq_slen = xdr_adjust_iovec(req->rq_svec, p);
+ 	return 0;
+ }
+@@ -397,7 +403,8 @@ nfs3_xdr_symlinkargs(struct rpc_rqst *re
+ {
+ 	p = xdr_encode_fhandle(p, args->fromfh);
+ 	p = xdr_encode_array(p, args->fromname, args->fromlen);
+-	p = xdr_encode_sattr(p, args->sattr);
++	p = xdr_encode_sattr(p, args->sattr,
++		req->rq_task->tk_client->cl_tag);
+ 	*p++ = htonl(args->pathlen);
+ 	req->rq_slen = xdr_adjust_iovec(req->rq_svec, p);
+ 
+@@ -415,7 +422,8 @@ nfs3_xdr_mknodargs(struct rpc_rqst *req,
+ 	p = xdr_encode_fhandle(p, args->fh);
+ 	p = xdr_encode_array(p, args->name, args->len);
+ 	*p++ = htonl(args->type);
+-	p = xdr_encode_sattr(p, args->sattr);
++	p = xdr_encode_sattr(p, args->sattr,
++		req->rq_task->tk_client->cl_tag);
+ 	if (args->type == NF3CHR || args->type == NF3BLK) {
+ 		*p++ = htonl(MAJOR(args->rdev));
+ 		*p++ = htonl(MINOR(args->rdev));
+--- linux-2.6.22/fs/nfs/nfsroot.c	2007-07-09 13:19:27 +0200
++++ linux-2.6.22-vs2.2.0-rc5/fs/nfs/nfsroot.c	2007-06-15 02:37:03 +0200
+@@ -118,12 +118,12 @@ static int mount_port __initdata = 0;		/
+ enum {
+ 	/* Options that take integer arguments */
+ 	Opt_port, Opt_rsize, Opt_wsize, Opt_timeo, Opt_retrans, Opt_acregmin,
+-	Opt_acregmax, Opt_acdirmin, Opt_acdirmax,
++	Opt_acregmax, Opt_acdirmin, Opt_acdirmax, Opt_tagid,
+ 	/* Options that take no arguments */
+ 	Opt_soft, Opt_hard, Opt_intr,
+ 	Opt_nointr, Opt_posix, Opt_noposix, Opt_cto, Opt_nocto, Opt_ac, 
+ 	Opt_noac, Opt_lock, Opt_nolock, Opt_v2, Opt_v3, Opt_udp, Opt_tcp,
+-	Opt_acl, Opt_noacl,
++	Opt_acl, Opt_noacl, Opt_tag, Opt_notag,
+ 	/* Error token */
+ 	Opt_err
+ };
+@@ -160,6 +160,10 @@ static match_table_t __initdata tokens =
+ 	{Opt_tcp, "tcp"},
+ 	{Opt_acl, "acl"},
+ 	{Opt_noacl, "noacl"},
++	{Opt_tag, "tag"},
++	{Opt_notag, "notag"},
++	{Opt_tagid, "tagid=%u"},
++	{Opt_tag, "tagxid"},
+ 	{Opt_err, NULL}
+ 	
+ };
+@@ -274,6 +278,20 @@ static int __init root_nfs_parse(char *n
+ 			case Opt_noacl:
+ 				nfs_data.flags |= NFS_MOUNT_NOACL;
+ 				break;
++#ifndef CONFIG_TAGGING_NONE
++			case Opt_tag:
++				nfs_data.flags |= NFS_MOUNT_TAGGED;
++				break;
++			case Opt_notag:
++				nfs_data.flags &= ~NFS_MOUNT_TAGGED;
++				break;
++#endif
++#ifdef CONFIG_PROPAGATE
++			case Opt_tagid:
++				/* use args[0] */
++				nfs_data.flags |= NFS_MOUNT_TAGGED;
++				break;
++#endif
+ 			default:
+ 				printk(KERN_WARNING "Root-NFS: unknown "
+ 					"option: %s\n", p);
+--- linux-2.6.22/fs/nfs/super.c	2007-07-09 13:19:27 +0200
++++ linux-2.6.22-vs2.2.0-rc5/fs/nfs/super.c	2007-06-15 03:03:21 +0200
+@@ -45,6 +45,7 @@
+ #include <linux/inet.h>
+ #include <linux/nfs_xdr.h>
+ #include <linux/magic.h>
++#include <linux/vs_tag.h>
+ 
+ #include <asm/system.h>
+ #include <asm/uaccess.h>
+@@ -291,6 +292,7 @@ static void nfs_show_mount_options(struc
+ 		{ NFS_MOUNT_NONLM, ",nolock", "" },
+ 		{ NFS_MOUNT_NOACL, ",noacl", "" },
+ 		{ NFS_MOUNT_NORDIRPLUS, ",nordirplus", "" },
++		{ NFS_MOUNT_TAGGED, ",tag", "" },
+ 		{ 0, NULL, NULL }
+ 	};
+ 	const struct proc_nfs_info *nfs_infop;
+--- linux-2.6.22/fs/nfsd/auth.c	2006-06-18 04:54:42 +0200
++++ linux-2.6.22-vs2.2.0-rc5/fs/nfsd/auth.c	2007-06-15 02:37:03 +0200
+@@ -9,6 +9,7 @@
+ #include <linux/sunrpc/svc.h>
+ #include <linux/sunrpc/svcauth.h>
+ #include <linux/nfsd/nfsd.h>
++#include <linux/vs_tag.h>
+ 
+ #define	CAP_NFSD_MASK (CAP_FS_MASK|CAP_TO_MASK(CAP_SYS_RESOURCE))
+ 
+@@ -41,19 +42,22 @@ int nfsd_setuser(struct svc_rqst *rqstp,
+ 		get_group_info(cred.cr_group_info);
+ 
+ 	if (cred.cr_uid != (uid_t) -1)
+-		current->fsuid = cred.cr_uid;
++		current->fsuid = INOTAG_UID(DX_TAG_NFSD, cred.cr_uid, cred.cr_gid);
+ 	else
+ 		current->fsuid = exp->ex_anon_uid;
+ 	if (cred.cr_gid != (gid_t) -1)
+-		current->fsgid = cred.cr_gid;
++		current->fsgid = INOTAG_GID(DX_TAG_NFSD, cred.cr_uid, cred.cr_gid);
+ 	else
+ 		current->fsgid = exp->ex_anon_gid;
+ 
++	/* this desperately needs a tag :) */
++	current->xid = (xid_t)INOTAG_TAG(DX_TAG_NFSD, cred.cr_uid, cred.cr_gid, 0);
++
+ 	if (!cred.cr_group_info)
+ 		return -ENOMEM;
+ 	ret = set_current_groups(cred.cr_group_info);
+ 	put_group_info(cred.cr_group_info);
+-	if ((cred.cr_uid)) {
++	if (INOTAG_UID(DX_TAG_NFSD, cred.cr_uid, cred.cr_gid)) {
+ 		cap_t(current->cap_effective) &= ~CAP_NFSD_MASK;
+ 	} else {
+ 		cap_t(current->cap_effective) |= (CAP_NFSD_MASK &
+--- linux-2.6.22/fs/nfsd/nfs3xdr.c	2007-07-09 13:19:27 +0200
++++ linux-2.6.22-vs2.2.0-rc5/fs/nfsd/nfs3xdr.c	2007-06-15 02:37:03 +0200
+@@ -21,6 +21,7 @@
+ #include <linux/sunrpc/svc.h>
+ #include <linux/nfsd/nfsd.h>
+ #include <linux/nfsd/xdr3.h>
++#include <linux/vs_tag.h>
+ 
+ #define NFSDDBG_FACILITY		NFSDDBG_XDR
+ 
+@@ -107,6 +108,8 @@ static __be32 *
+ decode_sattr3(__be32 *p, struct iattr *iap)
+ {
+ 	u32	tmp;
++	uid_t	uid = 0;
++	gid_t	gid = 0;
+ 
+ 	iap->ia_valid = 0;
+ 
+@@ -116,12 +119,15 @@ decode_sattr3(__be32 *p, struct iattr *i
+ 	}
+ 	if (*p++) {
+ 		iap->ia_valid |= ATTR_UID;
+-		iap->ia_uid = ntohl(*p++);
++		uid = ntohl(*p++);
+ 	}
+ 	if (*p++) {
+ 		iap->ia_valid |= ATTR_GID;
+-		iap->ia_gid = ntohl(*p++);
++		gid = ntohl(*p++);
+ 	}
++	iap->ia_uid = INOTAG_UID(DX_TAG_NFSD, uid, gid);
++	iap->ia_gid = INOTAG_GID(DX_TAG_NFSD, uid, gid);
++	iap->ia_tag = INOTAG_TAG(DX_TAG_NFSD, uid, gid, 0);
+ 	if (*p++) {
+ 		u64	newsize;
+ 
+@@ -180,8 +186,10 @@ encode_fattr3(struct svc_rqst *rqstp, __
+ 	*p++ = htonl(nfs3_ftypes[(stat->mode & S_IFMT) >> 12]);
+ 	*p++ = htonl((u32) stat->mode);
+ 	*p++ = htonl((u32) stat->nlink);
+-	*p++ = htonl((u32) nfsd_ruid(rqstp, stat->uid));
+-	*p++ = htonl((u32) nfsd_rgid(rqstp, stat->gid));
++	*p++ = htonl((u32) nfsd_ruid(rqstp,
++		TAGINO_UID(DX_TAG(dentry->d_inode), stat->uid, stat->tag)));
++	*p++ = htonl((u32) nfsd_rgid(rqstp,
++		TAGINO_GID(DX_TAG(dentry->d_inode), stat->gid, stat->tag)));
+ 	if (S_ISLNK(stat->mode) && stat->size > NFS3_MAXPATHLEN) {
+ 		p = xdr_encode_hyper(p, (u64) NFS3_MAXPATHLEN);
+ 	} else {
+--- linux-2.6.22/fs/nfsd/nfs4recover.c	2007-07-09 13:19:27 +0200
++++ linux-2.6.22-vs2.2.0-rc5/fs/nfsd/nfs4recover.c	2007-06-15 02:37:03 +0200
+@@ -156,7 +156,7 @@ nfsd4_create_clid_dir(struct nfs4_client
+ 		dprintk("NFSD: nfsd4_create_clid_dir: DIRECTORY EXISTS\n");
+ 		goto out_put;
+ 	}
+-	status = vfs_mkdir(rec_dir.dentry->d_inode, dentry, S_IRWXU);
++	status = vfs_mkdir(rec_dir.dentry->d_inode, dentry, S_IRWXU, NULL);
+ out_put:
+ 	dput(dentry);
+ out_unlock:
+@@ -260,7 +260,7 @@ nfsd4_remove_clid_file(struct dentry *di
+ 		return -EINVAL;
+ 	}
+ 	mutex_lock_nested(&dir->d_inode->i_mutex, I_MUTEX_PARENT);
+-	status = vfs_unlink(dir->d_inode, dentry);
++	status = vfs_unlink(dir->d_inode, dentry, NULL);
+ 	mutex_unlock(&dir->d_inode->i_mutex);
+ 	return status;
+ }
+@@ -275,7 +275,7 @@ nfsd4_clear_clid_dir(struct dentry *dir,
+ 	 * a kernel from the future.... */
+ 	nfsd4_list_rec_dir(dentry, nfsd4_remove_clid_file);
+ 	mutex_lock_nested(&dir->d_inode->i_mutex, I_MUTEX_PARENT);
+-	status = vfs_rmdir(dir->d_inode, dentry);
++	status = vfs_rmdir(dir->d_inode, dentry, NULL);
+ 	mutex_unlock(&dir->d_inode->i_mutex);
+ 	return status;
+ }
+--- linux-2.6.22/fs/nfsd/nfs4xdr.c	2007-07-09 13:19:27 +0200
++++ linux-2.6.22-vs2.2.0-rc5/fs/nfsd/nfs4xdr.c	2007-06-15 02:37:03 +0200
+@@ -56,6 +56,7 @@
+ #include <linux/nfsd_idmap.h>
+ #include <linux/nfs4.h>
+ #include <linux/nfs4_acl.h>
++#include <linux/vs_tag.h>
+ 
+ #define NFSDDBG_FACILITY		NFSDDBG_XDR
+ 
+@@ -1727,14 +1728,18 @@ out_acl:
+ 		WRITE32(stat.nlink);
+ 	}
+ 	if (bmval1 & FATTR4_WORD1_OWNER) {
+-		status = nfsd4_encode_user(rqstp, stat.uid, &p, &buflen);
++		status = nfsd4_encode_user(rqstp,
++			TAGINO_UID(DX_TAG(dentry->d_inode),
++			stat.uid, stat.tag), &p, &buflen);
+ 		if (status == nfserr_resource)
+ 			goto out_resource;
+ 		if (status)
+ 			goto out;
+ 	}
+ 	if (bmval1 & FATTR4_WORD1_OWNER_GROUP) {
+-		status = nfsd4_encode_group(rqstp, stat.gid, &p, &buflen);
++		status = nfsd4_encode_group(rqstp,
++			TAGINO_GID(DX_TAG(dentry->d_inode),
++			stat.gid, stat.tag), &p, &buflen);
+ 		if (status == nfserr_resource)
+ 			goto out_resource;
+ 		if (status)
+--- linux-2.6.22/fs/nfsd/nfsxdr.c	2007-07-09 13:19:27 +0200
++++ linux-2.6.22-vs2.2.0-rc5/fs/nfsd/nfsxdr.c	2007-06-15 02:37:03 +0200
+@@ -15,6 +15,7 @@
+ #include <linux/nfsd/nfsd.h>
+ #include <linux/nfsd/xdr.h>
+ #include <linux/mm.h>
++#include <linux/vs_tag.h>
+ 
+ #define NFSDDBG_FACILITY		NFSDDBG_XDR
+ 
+@@ -97,6 +98,8 @@ static __be32 *
+ decode_sattr(__be32 *p, struct iattr *iap)
+ {
+ 	u32	tmp, tmp1;
++	uid_t	uid = 0;
++	gid_t	gid = 0;
+ 
+ 	iap->ia_valid = 0;
+ 
+@@ -110,12 +113,15 @@ decode_sattr(__be32 *p, struct iattr *ia
+ 	}
+ 	if ((tmp = ntohl(*p++)) != (u32)-1) {
+ 		iap->ia_valid |= ATTR_UID;
+-		iap->ia_uid = tmp;
++		uid = tmp;
+ 	}
+ 	if ((tmp = ntohl(*p++)) != (u32)-1) {
+ 		iap->ia_valid |= ATTR_GID;
+-		iap->ia_gid = tmp;
++		gid = tmp;
+ 	}
++	iap->ia_uid = INOTAG_UID(DX_TAG_NFSD, uid, gid);
++	iap->ia_gid = INOTAG_GID(DX_TAG_NFSD, uid, gid);
++	iap->ia_tag = INOTAG_TAG(DX_TAG_NFSD, uid, gid, 0);
+ 	if ((tmp = ntohl(*p++)) != (u32)-1) {
+ 		iap->ia_valid |= ATTR_SIZE;
+ 		iap->ia_size = tmp;
+@@ -160,8 +166,10 @@ encode_fattr(struct svc_rqst *rqstp, __b
+ 	*p++ = htonl(nfs_ftypes[type >> 12]);
+ 	*p++ = htonl((u32) stat->mode);
+ 	*p++ = htonl((u32) stat->nlink);
+-	*p++ = htonl((u32) nfsd_ruid(rqstp, stat->uid));
+-	*p++ = htonl((u32) nfsd_rgid(rqstp, stat->gid));
++	*p++ = htonl((u32) nfsd_ruid(rqstp,
++		TAGINO_UID(DX_TAG(dentry->d_inode), stat->uid, stat->tag)));
++	*p++ = htonl((u32) nfsd_rgid(rqstp,
++		TAGINO_GID(DX_TAG(dentry->d_inode), stat->gid, stat->tag)));
+ 
+ 	if (S_ISLNK(type) && stat->size > NFS_MAXPATHLEN) {
+ 		*p++ = htonl(NFS_MAXPATHLEN);
+--- linux-2.6.22/fs/nfsd/vfs.c	2007-05-02 19:25:19 +0200
++++ linux-2.6.22-vs2.2.0-rc5/fs/nfsd/vfs.c	2007-06-15 02:37:03 +0200
+@@ -1186,13 +1186,13 @@ nfsd_create(struct svc_rqst *rqstp, stru
+ 		host_err = vfs_create(dirp, dchild, iap->ia_mode, NULL);
+ 		break;
+ 	case S_IFDIR:
+-		host_err = vfs_mkdir(dirp, dchild, iap->ia_mode);
++		host_err = vfs_mkdir(dirp, dchild, iap->ia_mode, NULL);
+ 		break;
+ 	case S_IFCHR:
+ 	case S_IFBLK:
+ 	case S_IFIFO:
+ 	case S_IFSOCK:
+-		host_err = vfs_mknod(dirp, dchild, iap->ia_mode, rdev);
++		host_err = vfs_mknod(dirp, dchild, iap->ia_mode, rdev, NULL);
+ 		break;
+ 	default:
+ 	        printk("nfsd: bad file type %o in nfsd_create\n", type);
+@@ -1466,11 +1466,13 @@ nfsd_symlink(struct svc_rqst *rqstp, str
+ 		else {
+ 			strncpy(path_alloced, path, plen);
+ 			path_alloced[plen] = 0;
+-			host_err = vfs_symlink(dentry->d_inode, dnew, path_alloced, mode);
++			host_err = vfs_symlink(dentry->d_inode, dnew,
++				path_alloced, mode, NULL);
+ 			kfree(path_alloced);
+ 		}
+ 	} else
+-		host_err = vfs_symlink(dentry->d_inode, dnew, path, mode);
++		host_err = vfs_symlink(dentry->d_inode, dnew,
++			path, mode, NULL);
+ 
+ 	if (!host_err) {
+ 		if (EX_ISSYNC(fhp->fh_export))
+@@ -1529,7 +1531,7 @@ nfsd_link(struct svc_rqst *rqstp, struct
+ 	dold = tfhp->fh_dentry;
+ 	dest = dold->d_inode;
+ 
+-	host_err = vfs_link(dold, dirp, dnew);
++	host_err = vfs_link(dold, dirp, dnew, NULL);
+ 	if (!host_err) {
+ 		if (EX_ISSYNC(ffhp->fh_export)) {
+ 			err = nfserrno(nfsd_sync_dir(ddir));
+@@ -1694,9 +1696,9 @@ nfsd_unlink(struct svc_rqst *rqstp, stru
+ 			host_err = -EPERM;
+ 		} else
+ #endif
+-		host_err = vfs_unlink(dirp, rdentry);
++		host_err = vfs_unlink(dirp, rdentry, NULL);
+ 	} else { /* It's RMDIR */
+-		host_err = vfs_rmdir(dirp, rdentry);
++		host_err = vfs_rmdir(dirp, rdentry, NULL);
+ 	}
+ 
+ 	dput(rdentry);
+@@ -1807,7 +1809,8 @@ nfsd_permission(struct svc_export *exp, 
+ 	 */
+ 	if (!(acc & MAY_LOCAL_ACCESS))
+ 		if (acc & (MAY_WRITE | MAY_SATTR | MAY_TRUNC)) {
+-			if (EX_RDONLY(exp) || IS_RDONLY(inode))
++			if (EX_RDONLY(exp) || IS_RDONLY(inode)
++				|| MNT_IS_RDONLY(exp->ex_mnt))
+ 				return nfserr_rofs;
+ 			if (/* (acc & MAY_WRITE) && */ IS_IMMUTABLE(inode))
+ 				return nfserr_perm;
+--- linux-2.6.22/fs/ocfs2/dlm/dlmfs.c	2007-07-09 13:19:28 +0200
++++ linux-2.6.22-vs2.2.0-rc5/fs/ocfs2/dlm/dlmfs.c	2007-06-15 02:37:03 +0200
+@@ -43,6 +43,7 @@
+ #include <linux/init.h>
+ #include <linux/string.h>
+ #include <linux/backing-dev.h>
++#include <linux/vs_tag.h>
+ 
+ #include <asm/uaccess.h>
+ 
+@@ -331,6 +332,7 @@ static struct inode *dlmfs_get_root_inod
+ 		inode->i_mode = mode;
+ 		inode->i_uid = current->fsuid;
+ 		inode->i_gid = current->fsgid;
++		inode->i_tag = dx_current_fstag(sb);
+ 		inode->i_blocks = 0;
+ 		inode->i_mapping->backing_dev_info = &dlmfs_backing_dev_info;
+ 		inode->i_atime = inode->i_mtime = inode->i_ctime = CURRENT_TIME;
+@@ -357,6 +359,7 @@ static struct inode *dlmfs_get_inode(str
+ 	inode->i_mode = mode;
+ 	inode->i_uid = current->fsuid;
+ 	inode->i_gid = current->fsgid;
++	inode->i_tag = dx_current_fstag(sb);
+ 	inode->i_blocks = 0;
+ 	inode->i_mapping->backing_dev_info = &dlmfs_backing_dev_info;
+ 	inode->i_atime = inode->i_mtime = inode->i_ctime = CURRENT_TIME;
+--- linux-2.6.22/fs/ocfs2/dlmglue.c	2007-07-09 13:19:28 +0200
++++ linux-2.6.22-vs2.2.0-rc5/fs/ocfs2/dlmglue.c	2007-06-15 02:37:03 +0200
+@@ -1475,6 +1475,7 @@ static void __ocfs2_stuff_meta_lvb(struc
+ 	lvb->lvb_iclusters = cpu_to_be32(oi->ip_clusters);
+ 	lvb->lvb_iuid      = cpu_to_be32(inode->i_uid);
+ 	lvb->lvb_igid      = cpu_to_be32(inode->i_gid);
++	lvb->lvb_itag      = cpu_to_be16(inode->i_tag);
+ 	lvb->lvb_imode     = cpu_to_be16(inode->i_mode);
+ 	lvb->lvb_inlink    = cpu_to_be16(inode->i_nlink);
+ 	lvb->lvb_iatime_packed  =
+@@ -1527,6 +1528,7 @@ static void ocfs2_refresh_inode_from_lvb
+ 
+ 	inode->i_uid     = be32_to_cpu(lvb->lvb_iuid);
+ 	inode->i_gid     = be32_to_cpu(lvb->lvb_igid);
++	inode->i_tag     = be16_to_cpu(lvb->lvb_itag);
+ 	inode->i_mode    = be16_to_cpu(lvb->lvb_imode);
+ 	inode->i_nlink   = be16_to_cpu(lvb->lvb_inlink);
+ 	ocfs2_unpack_timespec(&inode->i_atime,
+--- linux-2.6.22/fs/ocfs2/dlmglue.h	2007-07-09 13:19:28 +0200
++++ linux-2.6.22-vs2.2.0-rc5/fs/ocfs2/dlmglue.h	2007-06-15 02:37:03 +0200
+@@ -34,7 +34,7 @@
+ struct ocfs2_meta_lvb {
+ 	__u8         lvb_version;
+ 	__u8         lvb_reserved0;
+-	__be16       lvb_reserved1;
++	__be16       lvb_itag;
+ 	__be32       lvb_iclusters;
+ 	__be32       lvb_iuid;
+ 	__be32       lvb_igid;
+--- linux-2.6.22/fs/ocfs2/file.c	2007-07-09 13:19:28 +0200
++++ linux-2.6.22-vs2.2.0-rc5/fs/ocfs2/file.c	2007-06-15 02:37:03 +0200
+@@ -943,13 +943,15 @@ int ocfs2_setattr(struct dentry *dentry,
+ 		mlog(0, "uid change: %d\n", attr->ia_uid);
+ 	if (attr->ia_valid & ATTR_GID)
+ 		mlog(0, "gid change: %d\n", attr->ia_gid);
++	if (attr->ia_valid & ATTR_TAG)
++		mlog(0, "tag change: %d\n", attr->ia_tag);
+ 	if (attr->ia_valid & ATTR_SIZE)
+ 		mlog(0, "size change...\n");
+ 	if (attr->ia_valid & (ATTR_ATIME | ATTR_MTIME | ATTR_CTIME))
+ 		mlog(0, "time change...\n");
+ 
+ #define OCFS2_VALID_ATTRS (ATTR_ATIME | ATTR_MTIME | ATTR_CTIME | ATTR_SIZE \
+-			   | ATTR_GID | ATTR_UID | ATTR_MODE)
++			   | ATTR_GID | ATTR_UID | ATTR_TAG | ATTR_MODE)
+ 	if (!(attr->ia_valid & OCFS2_VALID_ATTRS)) {
+ 		mlog(0, "can't handle attrs: 0x%x\n", attr->ia_valid);
+ 		return 0;
+@@ -1805,6 +1807,7 @@ bail:
+ const struct inode_operations ocfs2_file_iops = {
+ 	.setattr	= ocfs2_setattr,
+ 	.getattr	= ocfs2_getattr,
++	.sync_flags     = ocfs2_sync_flags,
+ 	.permission	= ocfs2_permission,
+ };
+ 
+--- linux-2.6.22/fs/ocfs2/inode.c	2007-07-09 13:19:28 +0200
++++ linux-2.6.22-vs2.2.0-rc5/fs/ocfs2/inode.c	2007-06-15 03:10:27 +0200
+@@ -28,6 +28,7 @@
+ #include <linux/slab.h>
+ #include <linux/highmem.h>
+ #include <linux/pagemap.h>
++#include <linux/vs_tag.h>
+ 
+ #include <asm/byteorder.h>
+ 
+@@ -42,6 +43,7 @@
+ #include "file.h"
+ #include "heartbeat.h"
+ #include "inode.h"
++#include "ioctl.h"
+ #include "journal.h"
+ #include "namei.h"
+ #include "suballoc.h"
+@@ -77,6 +79,10 @@ void ocfs2_set_inode_flags(struct inode 
+ 
+ 	if (flags & OCFS2_IMMUTABLE_FL)
+ 		inode->i_flags |= S_IMMUTABLE;
++	if (flags & OCFS2_IUNLINK_FL)
++		inode->i_flags |= S_IUNLINK;
++	if (flags & OCFS2_BARRIER_FL)
++		inode->i_flags |= S_BARRIER;
+ 
+ 	if (flags & OCFS2_SYNC_FL)
+ 		inode->i_flags |= S_SYNC;
+@@ -107,6 +113,27 @@ void ocfs2_get_inode_flags(struct ocfs2_
+ 		oi->ip_attr |= OCFS2_DIRSYNC_FL;
+ }
+ 
++int ocfs2_sync_flags(struct inode *inode)
++{
++	unsigned int oldflags, newflags;
++
++	oldflags = OCFS2_I(inode)->ip_flags;
++	newflags = oldflags & ~(OCFS2_IMMUTABLE_FL |
++		OCFS2_IUNLINK_FL | OCFS2_BARRIER_FL);
++
++	if (IS_IMMUTABLE(inode))
++		newflags |= OCFS2_IMMUTABLE_FL;
++	if (IS_IUNLINK(inode))
++		newflags |= OCFS2_IUNLINK_FL;
++	if (IS_BARRIER(inode))
++		newflags |= OCFS2_BARRIER_FL;
++
++	if (oldflags ^ newflags)
++		return ocfs2_set_inode_attr(inode,
++			newflags, OCFS2_FL_MASK);
++	return 0;
++}
++
+ struct inode *ocfs2_iget(struct ocfs2_super *osb, u64 blkno, int flags)
+ {
+ 	struct inode *inode = NULL;
+@@ -212,6 +239,8 @@ int ocfs2_populate_inode(struct inode *i
+ 	struct super_block *sb;
+ 	struct ocfs2_super *osb;
+ 	int status = -EINVAL;
++	uid_t uid;
++	gid_t gid;
+ 
+ 	mlog_entry("(0x%p, size:%llu)\n", inode,
+ 		   (unsigned long long)le64_to_cpu(fe->i_size));
+@@ -246,8 +275,12 @@ int ocfs2_populate_inode(struct inode *i
+ 	inode->i_generation = le32_to_cpu(fe->i_generation);
+ 	inode->i_rdev = huge_decode_dev(le64_to_cpu(fe->id1.dev1.i_rdev));
+ 	inode->i_mode = le16_to_cpu(fe->i_mode);
+-	inode->i_uid = le32_to_cpu(fe->i_uid);
+-	inode->i_gid = le32_to_cpu(fe->i_gid);
++	uid = le32_to_cpu(fe->i_uid);
++	gid = le32_to_cpu(fe->i_gid);
++	inode->i_uid = INOTAG_UID(DX_TAG(inode), uid, gid);
++	inode->i_gid = INOTAG_GID(DX_TAG(inode), uid, gid);
++	inode->i_tag = INOTAG_TAG(DX_TAG(inode), uid, gid,
++		/* le16_to_cpu(raw_inode->i_raw_tag)i */ 0);
+ 
+ 	/* Fast symlinks will have i_size but no allocated clusters. */
+ 	if (S_ISLNK(inode->i_mode) && !fe->i_clusters)
+@@ -1224,8 +1257,11 @@ int ocfs2_mark_inode_dirty(handle_t *han
+ 
+ 	fe->i_size = cpu_to_le64(i_size_read(inode));
+ 	fe->i_links_count = cpu_to_le16(inode->i_nlink);
+-	fe->i_uid = cpu_to_le32(inode->i_uid);
+-	fe->i_gid = cpu_to_le32(inode->i_gid);
++	fe->i_uid = cpu_to_le32(TAGINO_UID(DX_TAG(inode),
++		inode->i_uid, inode->i_tag));
++	fe->i_gid = cpu_to_le32(TAGINO_GID(DX_TAG(inode),
++		inode->i_gid, inode->i_tag));
++	/* i_tag = = cpu_to_le16(inode->i_tag); */
+ 	fe->i_mode = cpu_to_le16(inode->i_mode);
+ 	fe->i_atime = cpu_to_le64(inode->i_atime.tv_sec);
+ 	fe->i_atime_nsec = cpu_to_le32(inode->i_atime.tv_nsec);
+@@ -1253,15 +1289,24 @@ leave:
+ void ocfs2_refresh_inode(struct inode *inode,
+ 			 struct ocfs2_dinode *fe)
+ {
++	uid_t uid;
++	gid_t gid;
++
+ 	spin_lock(&OCFS2_I(inode)->ip_lock);
+ 
+ 	OCFS2_I(inode)->ip_clusters = le32_to_cpu(fe->i_clusters);
+ 	OCFS2_I(inode)->ip_attr = le32_to_cpu(fe->i_attr);
++	/* OCFS2_I(inode)->ip_flags &= ~OCFS2_FL_MASK;
++	   OCFS2_I(inode)->ip_flags |= le32_to_cpu(fe->i_flags) & OCFS2_FL_MASK; */
+ 	ocfs2_set_inode_flags(inode);
+ 	i_size_write(inode, le64_to_cpu(fe->i_size));
+ 	inode->i_nlink = le16_to_cpu(fe->i_links_count);
+-	inode->i_uid = le32_to_cpu(fe->i_uid);
+-	inode->i_gid = le32_to_cpu(fe->i_gid);
++	uid = le32_to_cpu(fe->i_uid);
++	gid = le32_to_cpu(fe->i_gid);
++	inode->i_uid = INOTAG_UID(DX_TAG(inode), uid, gid);
++	inode->i_gid = INOTAG_GID(DX_TAG(inode), uid, gid);
++	inode->i_tag = INOTAG_TAG(DX_TAG(inode), uid, gid,
++		/* le16_to_cpu(raw_inode->i_raw_tag)i */ 0);
+ 	inode->i_mode = le16_to_cpu(fe->i_mode);
+ 	if (S_ISLNK(inode->i_mode) && le32_to_cpu(fe->i_clusters) == 0)
+ 		inode->i_blocks = 0;
+--- linux-2.6.22/fs/ocfs2/inode.h	2007-07-09 13:19:28 +0200
++++ linux-2.6.22-vs2.2.0-rc5/fs/ocfs2/inode.h	2007-06-15 03:10:53 +0200
+@@ -142,6 +142,7 @@ int ocfs2_aio_write(struct file *file, s
+ 
+ void ocfs2_set_inode_flags(struct inode *inode);
+ void ocfs2_get_inode_flags(struct ocfs2_inode_info *oi);
++int ocfs2_sync_flags(struct inode *inode);
+ 
+ static inline blkcnt_t ocfs2_inode_sector_count(struct inode *inode)
+ {
+--- linux-2.6.22/fs/ocfs2/ioctl.c	2007-07-09 13:19:28 +0200
++++ linux-2.6.22-vs2.2.0-rc5/fs/ocfs2/ioctl.c	2007-06-15 02:37:03 +0200
+@@ -39,7 +39,7 @@ static int ocfs2_get_inode_attr(struct i
+ 	return status;
+ }
+ 
+-static int ocfs2_set_inode_attr(struct inode *inode, unsigned flags,
++int ocfs2_set_inode_attr(struct inode *inode, unsigned flags,
+ 				unsigned mask)
+ {
+ 	struct ocfs2_inode_info *ocfs2_inode = OCFS2_I(inode);
+--- linux-2.6.22/fs/ocfs2/ioctl.h	2007-07-09 13:19:28 +0200
++++ linux-2.6.22-vs2.2.0-rc5/fs/ocfs2/ioctl.h	2007-06-15 02:37:03 +0200
+@@ -10,6 +10,9 @@
+ #ifndef OCFS2_IOCTL_H
+ #define OCFS2_IOCTL_H
+ 
++int ocfs2_set_inode_attr(struct inode *inode, unsigned flags,
++				unsigned mask);
++
+ int ocfs2_ioctl(struct inode * inode, struct file * filp,
+ 	unsigned int cmd, unsigned long arg);
+ long ocfs2_compat_ioctl(struct file *file, unsigned cmd, unsigned long arg);
+--- linux-2.6.22/fs/ocfs2/namei.c	2007-07-09 13:19:28 +0200
++++ linux-2.6.22-vs2.2.0-rc5/fs/ocfs2/namei.c	2007-06-15 02:37:03 +0200
+@@ -40,6 +40,7 @@
+ #include <linux/types.h>
+ #include <linux/slab.h>
+ #include <linux/highmem.h>
++#include <linux/vs_tag.h>
+ 
+ #define MLOG_MASK_PREFIX ML_NAMEI
+ #include <cluster/masklog.h>
+@@ -483,6 +484,9 @@ static int ocfs2_mknod_locked(struct ocf
+ 	u64 fe_blkno = 0;
+ 	u16 suballoc_bit;
+ 	struct inode *inode = NULL;
++	uid_t uid;
++	gid_t gid;
++	tag_t tag;
+ 
+ 	mlog_entry("(0x%p, 0x%p, %d, %lu, '%.*s')\n", dir, dentry, mode,
+ 		   (unsigned long)dev, dentry->d_name.len,
+@@ -542,13 +546,19 @@ static int ocfs2_mknod_locked(struct ocf
+ 	fe->i_blkno = cpu_to_le64(fe_blkno);
+ 	fe->i_suballoc_bit = cpu_to_le16(suballoc_bit);
+ 	fe->i_suballoc_slot = cpu_to_le16(osb->slot_num);
+-	fe->i_uid = cpu_to_le32(current->fsuid);
++
++	tag = dx_current_fstag(osb->sb);
++	uid = current->fsuid;
+ 	if (dir->i_mode & S_ISGID) {
+-		fe->i_gid = cpu_to_le32(dir->i_gid);
++		gid = dir->i_gid;
+ 		if (S_ISDIR(mode))
+ 			mode |= S_ISGID;
+ 	} else
+-		fe->i_gid = cpu_to_le32(current->fsgid);
++		gid = current->fsgid;
++
++	fe->i_uid = cpu_to_le32(TAGINO_UID(DX_TAG(inode), uid, tag));
++	fe->i_gid = cpu_to_le32(TAGINO_GID(DX_TAG(inode), gid, tag));
++	inode->i_tag = tag;
+ 	fe->i_mode = cpu_to_le16(mode);
+ 	if (S_ISCHR(mode) || S_ISBLK(mode))
+ 		fe->id1.dev1.i_rdev = cpu_to_le64(huge_encode_dev(dev));
+@@ -2316,5 +2326,6 @@ const struct inode_operations ocfs2_dir_
+ 	.rename		= ocfs2_rename,
+ 	.setattr	= ocfs2_setattr,
+ 	.getattr	= ocfs2_getattr,
++	.sync_flags     = ocfs2_sync_flags,
+ 	.permission	= ocfs2_permission,
+ };
+--- linux-2.6.22/fs/ocfs2/ocfs2.h	2007-07-09 13:19:28 +0200
++++ linux-2.6.22-vs2.2.0-rc5/fs/ocfs2/ocfs2.h	2007-06-15 02:37:03 +0200
+@@ -170,6 +170,7 @@ enum ocfs2_mount_options
+ 	OCFS2_MOUNT_NOINTR  = 1 << 2,   /* Don't catch signals */
+ 	OCFS2_MOUNT_ERRORS_PANIC = 1 << 3, /* Panic on errors */
+ 	OCFS2_MOUNT_DATA_WRITEBACK = 1 << 4, /* No data ordering */
++	OCFS2_MOUNT_TAGGED = 1 << 8, /* use tagging */
+ };
+ 
+ #define OCFS2_OSB_SOFT_RO	0x0001
+--- linux-2.6.22/fs/ocfs2/ocfs2_fs.h	2007-07-09 13:19:28 +0200
++++ linux-2.6.22-vs2.2.0-rc5/fs/ocfs2/ocfs2_fs.h	2007-06-15 02:37:03 +0200
+@@ -152,8 +152,12 @@
+ #define OCFS2_NOATIME_FL	(0x00000080)	/* do not update atime */
+ #define OCFS2_DIRSYNC_FL	(0x00010000)	/* dirsync behaviour (directories only) */
+ 
++#define OCFS2_BARRIER_FL	(0x04000000)	/* Barrier for chroot() */
++#define OCFS2_IUNLINK_FL	(0x08000000)	/* Immutable unlink */
++
+ #define OCFS2_FL_VISIBLE	(0x000100FF)	/* User visible flags */
+ #define OCFS2_FL_MODIFIABLE	(0x000100FF)	/* User modifiable flags */
++#define OCFS2_FL_MASK		(0x0F0100FF)
+ 
+ /*
+  * Extent record flags (e_node.leaf.flags)
+--- linux-2.6.22/fs/ocfs2/super.c	2007-07-09 13:19:28 +0200
++++ linux-2.6.22-vs2.2.0-rc5/fs/ocfs2/super.c	2007-06-15 02:37:03 +0200
+@@ -140,6 +140,7 @@ enum {
+ 	Opt_data_ordered,
+ 	Opt_data_writeback,
+ 	Opt_atime_quantum,
++	Opt_tag, Opt_notag, Opt_tagid,
+ 	Opt_err,
+ };
+ 
+@@ -154,6 +155,10 @@ static match_table_t tokens = {
+ 	{Opt_data_ordered, "data=ordered"},
+ 	{Opt_data_writeback, "data=writeback"},
+ 	{Opt_atime_quantum, "atime_quantum=%u"},
++	{Opt_tag, "tag"},
++	{Opt_tag, "tagxid"},
++	{Opt_notag, "notag"},
++	{Opt_tagid, "tagid=%u"},
+ 	{Opt_err, NULL}
+ };
+ 
+@@ -362,6 +367,14 @@ static int ocfs2_remount(struct super_bl
+ 		goto out;
+ 	}
+ 
++	printk("ocfs2_remount: %lx,%lx\n", osb->s_mount_opt, sb->s_flags);
++	if ((parsed_options & OCFS2_MOUNT_TAGGED) &&
++		!(sb->s_flags & MS_TAGGED)) {
++		ret = -EINVAL;
++		mlog(ML_ERROR, "Cannot change tagging on remount\n");
++		goto out;
++	}
++
+ 	if ((osb->s_mount_opt & OCFS2_MOUNT_HB_LOCAL) !=
+ 	    (parsed_options & OCFS2_MOUNT_HB_LOCAL)) {
+ 		ret = -EINVAL;
+@@ -654,6 +667,9 @@ static int ocfs2_fill_super(struct super
+ 
+ 	ocfs2_complete_mount_recovery(osb);
+ 
++	if (osb->s_mount_opt & OCFS2_MOUNT_TAGGED)
++		sb->s_flags |= MS_TAGGED;
++
+ 	if (ocfs2_mount_local(osb))
+ 		snprintf(nodestr, sizeof(nodestr), "local");
+ 	else
+@@ -782,6 +798,20 @@ static int ocfs2_parse_options(struct su
+ 			else
+ 				osb->s_atime_quantum = OCFS2_DEFAULT_ATIME_QUANTUM;
+ 			break;
++#ifndef CONFIG_TAGGING_NONE
++		case Opt_tag:
++			*mount_opt |= OCFS2_MOUNT_TAGGED;
++			break;
++		case Opt_notag:
++			*mount_opt &= ~OCFS2_MOUNT_TAGGED;
++			break;
++#endif
++#ifdef CONFIG_PROPAGATE
++		case Opt_tagid:
++			/* use args[0] */
++			*mount_opt |= OCFS2_MOUNT_TAGGED;
++			break;
++#endif
+ 		default:
+ 			mlog(ML_ERROR,
+ 			     "Unrecognized mount option \"%s\" "
+--- linux-2.6.22/fs/open.c	2007-07-09 13:19:28 +0200
++++ linux-2.6.22-vs2.2.0-rc5/fs/open.c	2007-06-15 02:37:03 +0200
+@@ -26,22 +26,31 @@
+ #include <linux/syscalls.h>
+ #include <linux/rcupdate.h>
+ #include <linux/audit.h>
++#include <linux/vs_base.h>
++#include <linux/vs_limit.h>
++#include <linux/vs_dlimit.h>
++#include <linux/vs_tag.h>
++#include <linux/vs_cowbl.h>
+ 
+ int vfs_statfs(struct dentry *dentry, struct kstatfs *buf)
+ {
+ 	int retval = -ENODEV;
+ 
+ 	if (dentry) {
++		struct super_block *sb = dentry->d_sb;
++
+ 		retval = -ENOSYS;
+-		if (dentry->d_sb->s_op->statfs) {
++		if (sb->s_op->statfs) {
+ 			memset(buf, 0, sizeof(*buf));
+ 			retval = security_sb_statfs(dentry);
+ 			if (retval)
+ 				return retval;
+-			retval = dentry->d_sb->s_op->statfs(dentry, buf);
++			retval = sb->s_op->statfs(dentry, buf);
+ 			if (retval == 0 && buf->f_frsize == 0)
+ 				buf->f_frsize = buf->f_bsize;
+ 		}
++		if (!vx_check(0, VS_ADMIN|VS_WATCH))
++			vx_vsi_statfs(sb, buf);
+ 	}
+ 	return retval;
+ }
+@@ -248,7 +257,7 @@ static long do_sys_truncate(const char _
+ 		goto dput_and_out;
+ 
+ 	error = -EROFS;
+-	if (IS_RDONLY(inode))
++	if (IS_RDONLY(inode) || MNT_IS_RDONLY(nd.mnt))
+ 		goto dput_and_out;
+ 
+ 	error = -EPERM;
+@@ -397,7 +406,7 @@ asmlinkage long sys_faccessat(int dfd, c
+ 	   special_file(nd.dentry->d_inode->i_mode))
+ 		goto out_path_release;
+ 
+-	if(IS_RDONLY(nd.dentry->d_inode))
++	if(IS_RDONLY(nd.dentry->d_inode) || MNT_IS_RDONLY(nd.mnt))
+ 		res = -EROFS;
+ 
+ out_path_release:
+@@ -511,7 +520,7 @@ asmlinkage long sys_fchmod(unsigned int 
+ 	audit_inode(NULL, inode);
+ 
+ 	err = -EROFS;
+-	if (IS_RDONLY(inode))
++	if (IS_RDONLY(inode) || MNT_IS_RDONLY(file->f_vfsmnt))
+ 		goto out_putf;
+ 	err = -EPERM;
+ 	if (IS_IMMUTABLE(inode) || IS_APPEND(inode))
+@@ -541,11 +550,11 @@ asmlinkage long sys_fchmodat(int dfd, co
+ 	error = __user_walk_fd(dfd, filename, LOOKUP_FOLLOW, &nd);
+ 	if (error)
+ 		goto out;
+-	inode = nd.dentry->d_inode;
+ 
+-	error = -EROFS;
+-	if (IS_RDONLY(inode))
++	error = cow_check_and_break(&nd);
++	if (error)
+ 		goto dput_and_out;
++	inode = nd.dentry->d_inode;
+ 
+ 	error = -EPERM;
+ 	if (IS_IMMUTABLE(inode) || IS_APPEND(inode))
+@@ -570,7 +579,8 @@ asmlinkage long sys_chmod(const char __u
+ 	return sys_fchmodat(AT_FDCWD, filename, mode);
+ }
+ 
+-static int chown_common(struct dentry * dentry, uid_t user, gid_t group)
++static int chown_common(struct dentry *dentry, struct vfsmount *mnt,
++	uid_t user, gid_t group)
+ {
+ 	struct inode * inode;
+ 	int error;
+@@ -582,7 +592,7 @@ static int chown_common(struct dentry * 
+ 		goto out;
+ 	}
+ 	error = -EROFS;
+-	if (IS_RDONLY(inode))
++	if (IS_RDONLY(inode) || MNT_IS_RDONLY(mnt))
+ 		goto out;
+ 	error = -EPERM;
+ 	if (IS_IMMUTABLE(inode) || IS_APPEND(inode))
+@@ -590,11 +600,11 @@ static int chown_common(struct dentry * 
+ 	newattrs.ia_valid =  ATTR_CTIME;
+ 	if (user != (uid_t) -1) {
+ 		newattrs.ia_valid |= ATTR_UID;
+-		newattrs.ia_uid = user;
++		newattrs.ia_uid = dx_map_uid(user);
+ 	}
+ 	if (group != (gid_t) -1) {
+ 		newattrs.ia_valid |= ATTR_GID;
+-		newattrs.ia_gid = group;
++		newattrs.ia_gid = dx_map_gid(group);
+ 	}
+ 	if (!S_ISDIR(inode->i_mode))
+ 		newattrs.ia_valid |= ATTR_KILL_SUID|ATTR_KILL_SGID;
+@@ -613,7 +623,11 @@ asmlinkage long sys_chown(const char __u
+ 	error = user_path_walk(filename, &nd);
+ 	if (error)
+ 		goto out;
+-	error = chown_common(nd.dentry, user, group);
++#ifdef CONFIG_VSERVER_COWBL
++	error = cow_check_and_break(&nd);
++	if (!error)
++#endif
++		error = chown_common(nd.dentry, nd.mnt, user, group);
+ 	path_release(&nd);
+ out:
+ 	return error;
+@@ -633,7 +647,11 @@ asmlinkage long sys_fchownat(int dfd, co
+ 	error = __user_walk_fd(dfd, filename, follow, &nd);
+ 	if (error)
+ 		goto out;
+-	error = chown_common(nd.dentry, user, group);
++#ifdef CONFIG_VSERVER_COWBL
++	error = cow_check_and_break(&nd);
++	if (!error)
++#endif
++		error = chown_common(nd.dentry, nd.mnt, user, group);
+ 	path_release(&nd);
+ out:
+ 	return error;
+@@ -647,7 +665,11 @@ asmlinkage long sys_lchown(const char __
+ 	error = user_path_walk_link(filename, &nd);
+ 	if (error)
+ 		goto out;
+-	error = chown_common(nd.dentry, user, group);
++#ifdef CONFIG_VSERVER_COWBL
++	error = cow_check_and_break(&nd);
++	if (!error)
++#endif
++		error = chown_common(nd.dentry, nd.mnt, user, group);
+ 	path_release(&nd);
+ out:
+ 	return error;
+@@ -666,7 +688,7 @@ asmlinkage long sys_fchown(unsigned int 
+ 
+ 	dentry = file->f_path.dentry;
+ 	audit_inode(NULL, dentry->d_inode);
+-	error = chown_common(dentry, user, group);
++	error = chown_common(dentry, file->f_vfsmnt, user, group);
+ 	fput(file);
+ out:
+ 	return error;
+@@ -893,6 +915,7 @@ repeat:
+ 	FD_SET(fd, fdt->open_fds);
+ 	FD_CLR(fd, fdt->close_on_exec);
+ 	files->next_fd = fd + 1;
++	vx_openfd_inc(fd);
+ #if 1
+ 	/* Sanity check */
+ 	if (fdt->fd[fd] != NULL) {
+@@ -915,6 +938,7 @@ static void __put_unused_fd(struct files
+ 	__FD_CLR(fd, fdt->open_fds);
+ 	if (fd < files->next_fd)
+ 		files->next_fd = fd;
++	vx_openfd_dec(fd);
+ }
+ 
+ void fastcall put_unused_fd(unsigned int fd)
+--- linux-2.6.22/fs/proc/array.c	2007-07-09 13:19:28 +0200
++++ linux-2.6.22-vs2.2.0-rc5/fs/proc/array.c	2007-06-15 03:04:38 +0200
+@@ -75,6 +75,8 @@
+ #include <linux/cpuset.h>
+ #include <linux/rcupdate.h>
+ #include <linux/delayacct.h>
++#include <linux/vs_context.h>
++#include <linux/vs_network.h>
+ 
+ #include <asm/uaccess.h>
+ #include <asm/pgtable.h>
+@@ -134,8 +136,9 @@ static const char *task_state_array[] = 
+ 	"D (disk sleep)",	/*  2 */
+ 	"T (stopped)",		/*  4 */
+ 	"T (tracing stop)",	/*  8 */
+-	"Z (zombie)",		/* 16 */
+-	"X (dead)"		/* 32 */
++	"H (on hold)",		/* 16 */
++	"Z (zombie)",		/* 32 */
++	"X (dead)",		/* 64 */
+ };
+ 
+ static inline const char * get_task_state(struct task_struct *tsk)
+@@ -144,7 +147,8 @@ static inline const char * get_task_stat
+ 					    TASK_INTERRUPTIBLE |
+ 					    TASK_UNINTERRUPTIBLE |
+ 					    TASK_STOPPED |
+-					    TASK_TRACED)) |
++					   TASK_TRACED |
++					   TASK_ONHOLD)) |
+ 			(tsk->exit_state & (EXIT_ZOMBIE |
+ 					    EXIT_DEAD));
+ 	const char **p = &task_state_array[0];
+@@ -161,8 +165,16 @@ static inline char * task_state(struct t
+ 	struct group_info *group_info;
+ 	int g;
+ 	struct fdtable *fdt = NULL;
++	pid_t pid, ptgid, tppid, tgid;
+ 
+ 	rcu_read_lock();
++	tgid = vx_map_tgid(p->tgid);
++	pid = vx_map_pid(p->pid);
++	ptgid = vx_map_pid(pid_alive(p) ?
++		rcu_dereference(p->real_parent)->tgid : 0);
++	tppid = vx_map_pid(pid_alive(p) && p->ptrace ?
++		rcu_dereference(p->parent)->pid : 0);
++
+ 	buffer += sprintf(buffer,
+ 		"State:\t%s\n"
+ 		"SleepAVG:\t%lu%%\n"
+@@ -174,9 +186,7 @@ static inline char * task_state(struct t
+ 		"Gid:\t%d\t%d\t%d\t%d\n",
+ 		get_task_state(p),
+ 		(p->sleep_avg/1024)*100/(1020000000/1024),
+-	       	p->tgid, p->pid,
+-	       	pid_alive(p) ? rcu_dereference(p->real_parent)->tgid : 0,
+-		pid_alive(p) && p->ptrace ? rcu_dereference(p->parent)->pid : 0,
++		tgid, pid, (pid > 1) ? ptgid : 0, tppid,
+ 		p->uid, p->euid, p->suid, p->fsuid,
+ 		p->gid, p->egid, p->sgid, p->fsgid);
+ 
+@@ -283,17 +293,26 @@ static inline char * task_sig(struct tas
+ 
+ static inline char *task_cap(struct task_struct *p, char *buffer)
+ {
+-    return buffer + sprintf(buffer, "CapInh:\t%016x\n"
+-			    "CapPrm:\t%016x\n"
+-			    "CapEff:\t%016x\n",
+-			    cap_t(p->cap_inheritable),
+-			    cap_t(p->cap_permitted),
+-			    cap_t(p->cap_effective));
++	struct vx_info *vxi = p->vx_info;
++
++	return buffer + sprintf(buffer,
++		"CapInh:\t%016x\n"
++		"CapPrm:\t%016x\n"
++		"CapEff:\t%016x\n",
++		(unsigned)vx_info_mbcap(vxi, p->cap_inheritable),
++		(unsigned)vx_info_mbcap(vxi, p->cap_permitted),
++		(unsigned)vx_info_mbcap(vxi, p->cap_effective));
+ }
+ 
+ int proc_pid_status(struct task_struct *task, char * buffer)
+ {
+ 	char * orig = buffer;
++#ifdef	CONFIG_VSERVER_LEGACY
++	struct vx_info *vxi;
++#endif
++#ifdef	CONFIG_VSERVER_LEGACYNET
++	struct nx_info *nxi;
++#endif
+ 	struct mm_struct *mm = get_task_mm(task);
+ 
+ 	buffer = task_name(task, buffer);
+@@ -306,6 +325,46 @@ int proc_pid_status(struct task_struct *
+ 	buffer = task_sig(task, buffer);
+ 	buffer = task_cap(task, buffer);
+ 	buffer = cpuset_task_status_allowed(task, buffer);
++
++	if (task_vx_flags(task, VXF_HIDE_VINFO, 0))
++		goto skip;
++#ifdef	CONFIG_VSERVER_LEGACY
++	buffer += sprintf (buffer,"s_context: %d\n", vx_task_xid(task));
++	vxi = task_get_vx_info(task);
++	if (vxi) {
++		buffer += sprintf (buffer,"ctxflags: %08llx\n"
++			,(unsigned long long)vxi->vx_flags);
++		buffer += sprintf (buffer,"initpid: %d\n"
++			,vxi->vx_initpid);
++	} else {
++		buffer += sprintf (buffer,"ctxflags: none\n");
++		buffer += sprintf (buffer,"initpid: none\n");
++	}
++	put_vx_info(vxi);
++#else
++	buffer += sprintf (buffer,"VxID: %d\n", vx_task_xid(task));
++#endif
++#ifdef	CONFIG_VSERVER_LEGACYNET
++	nxi = task_get_nx_info(task);
++	if (nxi) {
++		int i;
++
++		buffer += sprintf (buffer,"ipv4root:");
++		for (i=0; i<nxi->nbipv4; i++){
++			buffer += sprintf (buffer," %08x/%08x"
++				,nxi->ipv4[i]
++				,nxi->mask[i]);
++		}
++		*buffer++ = '\n';
++		buffer += sprintf (buffer,"ipv4root_bcast: %08x\n"
++			,nxi->v4_bcast);
++	} else {
++		buffer += sprintf (buffer,"ipv4root: 0\n");
++		buffer += sprintf (buffer,"ipv4root_bcast: 0\n");
++	}
++	put_nx_info(nxi);
++#endif
++skip:
+ #if defined(CONFIG_S390)
+ 	buffer = task_show_regs(task, buffer);
+ #endif
+@@ -320,7 +379,7 @@ static int do_task_stat(struct task_stru
+ 	sigset_t sigign, sigcatch;
+ 	char state;
+ 	int res;
+- 	pid_t ppid = 0, pgid = -1, sid = -1;
++	pid_t pid = 0, ppid = 0, pgid = -1, sid = -1;
+ 	int num_threads = 0;
+ 	struct mm_struct *mm;
+ 	unsigned long long start_time;
+@@ -382,8 +441,10 @@ static int do_task_stat(struct task_stru
+ 		}
+ 
+ 		sid = signal_session(sig);
+-		pgid = process_group(task);
+-		ppid = rcu_dereference(task->real_parent)->tgid;
++		pid = vx_info_map_pid(task->vx_info, task->pid);
++		pgid = vx_info_map_pid(task->vx_info, process_group(task));
++		ppid = (pid > 1) ? vx_info_map_tgid(task->vx_info,
++			rcu_dereference(task->real_parent)->tgid) : 0;
+ 
+ 		unlock_task_sighand(task, &flags);
+ 	}
+@@ -410,10 +471,21 @@ static int do_task_stat(struct task_stru
+ 	/* convert nsec -> ticks */
+ 	start_time = nsec_to_clock_t(start_time);
+ 
++	/* fixup start time for virt uptime */
++	if (vx_flags(VXF_VIRT_UPTIME, 0)) {
++		unsigned long long bias =
++			current->vx_info->cvirt.bias_clock;
++
++		if (start_time > bias)
++			start_time -= bias;
++		else
++			start_time = 0;
++	}
++
+ 	res = sprintf(buffer,"%d (%s) %c %d %d %d %d %d %u %lu \
+ %lu %lu %lu %lu %lu %ld %ld %ld %ld %d 0 %llu %lu %ld %lu %lu %lu %lu %lu \
+ %lu %lu %lu %lu %lu %lu %lu %lu %d %d %u %u %llu\n",
+-		task->pid,
++		pid,
+ 		tcomm,
+ 		state,
+ 		ppid,
+--- linux-2.6.22/fs/proc/base.c	2007-07-09 13:19:28 +0200
++++ linux-2.6.22-vs2.2.0-rc5/fs/proc/base.c	2007-06-15 03:06:14 +0200
+@@ -73,6 +73,9 @@
+ #include <linux/poll.h>
+ #include <linux/nsproxy.h>
+ #include <linux/oom.h>
++#include <linux/vs_context.h>
++#include <linux/vs_network.h>
++
+ #include "internal.h"
+ 
+ /* NOTE:
+@@ -1049,6 +1052,8 @@ static struct inode *proc_pid_make_inode
+ 		inode->i_uid = task->euid;
+ 		inode->i_gid = task->egid;
+ 	}
++	/* procfs is xid tagged */
++	inode->i_tag = (tag_t)vx_task_xid(task);
+ 	security_task_to_inode(task, inode);
+ 
+ out:
+@@ -1595,6 +1600,13 @@ static struct dentry *proc_pident_lookup
+ 	if (!task)
+ 		goto out_no_task;
+ 
++	/* TODO: maybe we can come up with a generic approach? */
++	if (task_vx_flags(task, VXF_HIDE_VINFO, 0) &&
++		(dentry->d_name.len == 5) &&
++		(!memcmp(dentry->d_name.name, "vinfo", 5) ||
++		!memcmp(dentry->d_name.name, "ninfo", 5)))
++		goto out;
++
+ 	/*
+ 	 * Yes, it does not scale. And it should not. Don't add
+ 	 * new entries into /proc/<tgid>/ without very good reasons.
+@@ -1790,14 +1802,14 @@ static int proc_self_readlink(struct den
+ 			      int buflen)
+ {
+ 	char tmp[PROC_NUMBUF];
+-	sprintf(tmp, "%d", current->tgid);
++	sprintf(tmp, "%d", vx_map_tgid(current->tgid));
+ 	return vfs_readlink(dentry,buffer,buflen,tmp);
+ }
+ 
+ static void *proc_self_follow_link(struct dentry *dentry, struct nameidata *nd)
+ {
+ 	char tmp[PROC_NUMBUF];
+-	sprintf(tmp, "%d", current->tgid);
++	sprintf(tmp, "%d", vx_map_tgid(current->tgid));
+ 	return ERR_PTR(vfs_follow_link(nd,tmp));
+ }
+ 
+@@ -1891,7 +1903,7 @@ out_iput:
+ static struct dentry *proc_base_lookup(struct inode *dir, struct dentry *dentry)
+ {
+ 	struct dentry *error;
+-	struct task_struct *task = get_proc_task(dir);
++	struct task_struct *task = get_proc_task_real(dir);
+ 	const struct pid_entry *p, *last;
+ 
+ 	error = ERR_PTR(-ENOENT);
+@@ -1956,6 +1968,9 @@ static int proc_pid_io_accounting(struct
+ static const struct file_operations proc_task_operations;
+ static const struct inode_operations proc_task_inode_operations;
+ 
++extern int proc_pid_vx_info(struct task_struct *, char *);
++extern int proc_pid_nx_info(struct task_struct *, char *);
++
+ static const struct pid_entry tgid_base_stuff[] = {
+ 	DIR("task",       S_IRUGO|S_IXUGO, task),
+ 	DIR("fd",         S_IRUSR|S_IXUSR, fd),
+@@ -1995,6 +2010,8 @@ static const struct pid_entry tgid_base_
+ #ifdef CONFIG_CPUSETS
+ 	REG("cpuset",     S_IRUGO, cpuset),
+ #endif
++	INF("vinfo",      S_IRUGO, pid_vx_info),
++	INF("ninfo",	  S_IRUGO, pid_nx_info),
+ 	INF("oom_score",  S_IRUGO, oom_score),
+ 	REG("oom_adj",    S_IRUGO|S_IWUSR, oom_adjust),
+ #ifdef CONFIG_AUDITSYSCALL
+@@ -2143,7 +2160,7 @@ struct dentry *proc_pid_lookup(struct in
+ 		goto out;
+ 
+ 	rcu_read_lock();
+-	task = find_task_by_pid(tgid);
++	task = vx_find_proc_task_by_pid(tgid);
+ 	if (task)
+ 		get_task_struct(task);
+ 	rcu_read_unlock();
+@@ -2207,7 +2224,7 @@ static int proc_pid_fill_cache(struct fi
+ int proc_pid_readdir(struct file * filp, void * dirent, filldir_t filldir)
+ {
+ 	unsigned int nr = filp->f_pos - FIRST_PROCESS_ENTRY;
+-	struct task_struct *reaper = get_proc_task(filp->f_path.dentry->d_inode);
++	struct task_struct *reaper = get_proc_task_real(filp->f_path.dentry->d_inode);
+ 	struct task_struct *task;
+ 	int tgid;
+ 
+@@ -2226,6 +2243,8 @@ int proc_pid_readdir(struct file * filp,
+ 	     put_task_struct(task), task = next_tgid(tgid + 1)) {
+ 		tgid = task->pid;
+ 		filp->f_pos = tgid + TGID_OFFSET;
++		if (!vx_proc_task_visible(task))
++			continue;
+ 		if (proc_pid_fill_cache(filp, dirent, filldir, task, tgid) < 0) {
+ 			put_task_struct(task);
+ 			goto out;
+@@ -2352,9 +2371,11 @@ static struct dentry *proc_task_lookup(s
+ 	tid = name_to_int(dentry);
+ 	if (tid == ~0U)
+ 		goto out;
++	if (vx_current_initpid(tid))
++		goto out;
+ 
+ 	rcu_read_lock();
+-	task = find_task_by_pid(tid);
++	task = vx_find_proc_task_by_pid(tid);
+ 	if (task)
+ 		get_task_struct(task);
+ 	rcu_read_unlock();
+@@ -2499,7 +2520,7 @@ static int proc_task_readdir(struct file
+ 	for (task = first_tid(leader, tid, pos - 2);
+ 	     task;
+ 	     task = next_tid(task), pos++) {
+-		tid = task->pid;
++		tid = vx_map_pid(task->pid);
+ 		if (proc_task_fill_cache(filp, dirent, filldir, task, tid) < 0) {
+ 			/* returning this tgid failed, save it as the first
+ 			 * pid for the next readir call */
+--- linux-2.6.22/fs/proc/generic.c	2007-07-09 13:19:28 +0200
++++ linux-2.6.22-vs2.2.0-rc5/fs/proc/generic.c	2007-06-15 03:08:54 +0200
+@@ -20,6 +20,7 @@
+ #include <linux/namei.h>
+ #include <linux/bitops.h>
+ #include <linux/spinlock.h>
++#include <linux/vserver/inode.h>
+ #include <asm/uaccess.h>
+ 
+ #include "internal.h"
+@@ -395,6 +396,8 @@ struct dentry *proc_lookup(struct inode 
+ 		for (de = de->subdir; de ; de = de->next) {
+ 			if (de->namelen != dentry->d_name.len)
+ 				continue;
++			if (!vx_hide_check(0, de->vx_flags))
++				continue;
+ 			if (!memcmp(dentry->d_name.name, de->name, de->namelen)) {
+ 				unsigned int ino = de->low_ino;
+ 
+@@ -402,6 +405,8 @@ struct dentry *proc_lookup(struct inode 
+ 				spin_unlock(&proc_subdir_lock);
+ 				error = -EINVAL;
+ 				inode = proc_get_inode(dir->i_sb, ino, de);
++				/* generic proc entries belong to the host */
++				inode->i_tag = 0;
+ 				spin_lock(&proc_subdir_lock);
+ 				break;
+ 			}
+@@ -482,6 +487,8 @@ int proc_readdir(struct file * filp,
+ 
+ 				/* filldir passes info to user space */
+ 				de_get(de);
++				if (!vx_hide_check(0, de->vx_flags))
++					goto skip;
+ 				spin_unlock(&proc_subdir_lock);
+ 				if (filldir(dirent, de->name, de->namelen, filp->f_pos,
+ 					    de->low_ino, de->mode >> 12) < 0) {
+@@ -489,6 +496,7 @@ int proc_readdir(struct file * filp,
+ 					goto out;
+ 				}
+ 				spin_lock(&proc_subdir_lock);
++			skip:
+ 				filp->f_pos++;
+ 				next = de->next;
+ 				de_put(de);
+@@ -613,6 +621,7 @@ static struct proc_dir_entry *proc_creat
+ 	ent->namelen = len;
+ 	ent->mode = mode;
+ 	ent->nlink = nlink;
++	ent->vx_flags = IATTR_PROC_DEFAULT;
+  out:
+ 	return ent;
+ }
+@@ -633,7 +642,8 @@ struct proc_dir_entry *proc_symlink(cons
+ 				kfree(ent->data);
+ 				kfree(ent);
+ 				ent = NULL;
+-			}
++			} else
++				ent->vx_flags = IATTR_PROC_SYMLINK;
+ 		} else {
+ 			kfree(ent);
+ 			ent = NULL;
+--- linux-2.6.22/fs/proc/inode.c	2007-07-09 13:19:28 +0200
++++ linux-2.6.22-vs2.2.0-rc5/fs/proc/inode.c	2007-06-15 02:37:03 +0200
+@@ -160,6 +160,8 @@ struct inode *proc_get_inode(struct supe
+ 			inode->i_uid = de->uid;
+ 			inode->i_gid = de->gid;
+ 		}
++		if (de->vx_flags)
++			PROC_I(inode)->vx_flags = de->vx_flags;
+ 		if (de->size)
+ 			inode->i_size = de->size;
+ 		if (de->nlink)
+--- linux-2.6.22/fs/proc/internal.h	2007-07-09 13:19:28 +0200
++++ linux-2.6.22-vs2.2.0-rc5/fs/proc/internal.h	2007-06-15 02:37:03 +0200
+@@ -10,6 +10,7 @@
+  */
+ 
+ #include <linux/proc_fs.h>
++#include <linux/vs_pid.h>
+ 
+ #ifdef CONFIG_PROC_SYSCTL
+ extern int proc_sys_init(void);
+@@ -64,11 +65,16 @@ static inline struct pid *proc_pid(struc
+ 	return PROC_I(inode)->pid;
+ }
+ 
+-static inline struct task_struct *get_proc_task(struct inode *inode)
++static inline struct task_struct *get_proc_task_real(struct inode *inode)
+ {
+ 	return get_pid_task(proc_pid(inode), PIDTYPE_PID);
+ }
+ 
++static inline struct task_struct *get_proc_task(struct inode *inode)
++{
++	return vx_get_proc_task(inode, proc_pid(inode));
++}
++
+ static inline int proc_fd(struct inode *inode)
+ {
+ 	return PROC_I(inode)->fd;
+--- linux-2.6.22/fs/proc/proc_misc.c	2007-07-09 13:19:28 +0200
++++ linux-2.6.22-vs2.2.0-rc5/fs/proc/proc_misc.c	2007-06-15 02:37:03 +0200
+@@ -53,6 +53,8 @@
+ #include <asm/div64.h>
+ #include "internal.h"
+ 
++#include <linux/vs_cvirt.h>
++
+ #define LOAD_INT(x) ((x) >> FSHIFT)
+ #define LOAD_FRAC(x) LOAD_INT(((x) & (FIXED_1-1)) * 100)
+ /*
+@@ -82,17 +84,32 @@ static int proc_calc_metrics(char *page,
+ static int loadavg_read_proc(char *page, char **start, off_t off,
+ 				 int count, int *eof, void *data)
+ {
++	unsigned int running, threads;
+ 	int a, b, c;
+ 	int len;
+ 
+-	a = avenrun[0] + (FIXED_1/200);
+-	b = avenrun[1] + (FIXED_1/200);
+-	c = avenrun[2] + (FIXED_1/200);
+-	len = sprintf(page,"%d.%02d %d.%02d %d.%02d %ld/%d %d\n",
++	if (vx_flags(VXF_VIRT_LOAD, 0)) {
++		struct vx_info *vxi = current->vx_info;
++
++		a = vxi->cvirt.load[0] + (FIXED_1/200);
++		b = vxi->cvirt.load[1] + (FIXED_1/200);
++		c = vxi->cvirt.load[2] + (FIXED_1/200);
++
++		running = atomic_read(&vxi->cvirt.nr_running);
++		threads = atomic_read(&vxi->cvirt.nr_threads);
++	} else {
++		a = avenrun[0] + (FIXED_1/200);
++		b = avenrun[1] + (FIXED_1/200);
++		c = avenrun[2] + (FIXED_1/200);
++
++		running = nr_running();
++		threads = nr_threads;
++	}
++	len = sprintf(page,"%d.%02d %d.%02d %d.%02d %d/%d %d\n",
+ 		LOAD_INT(a), LOAD_FRAC(a),
+ 		LOAD_INT(b), LOAD_FRAC(b),
+ 		LOAD_INT(c), LOAD_FRAC(c),
+-		nr_running(), nr_threads, current->nsproxy->pid_ns->last_pid);
++		running, threads, current->nsproxy->pid_ns->last_pid);
+ 	return proc_calc_metrics(page, start, off, count, eof, len);
+ }
+ 
+@@ -106,6 +123,9 @@ static int uptime_read_proc(char *page, 
+ 
+ 	do_posix_clock_monotonic_gettime(&uptime);
+ 	cputime_to_timespec(idletime, &idle);
++	if (vx_flags(VXF_VIRT_UPTIME, 0))
++		vx_vsi_uptime(&uptime, &idle);
++
+ 	len = sprintf(page,"%lu.%02lu %lu.%02lu\n",
+ 			(unsigned long) uptime.tv_sec,
+ 			(uptime.tv_nsec / (NSEC_PER_SEC / 100)),
+@@ -137,7 +157,7 @@ static int meminfo_read_proc(char *page,
+ 
+ 	cached = global_page_state(NR_FILE_PAGES) -
+ 			total_swapcache_pages - i.bufferram;
+-	if (cached < 0)
++	if (cached < 0 || vx_flags(VXF_VIRT_MEM, 0))
+ 		cached = 0;
+ 
+ 	get_vmalloc_info(&vmi);
+--- linux-2.6.22/fs/proc/root.c	2007-05-02 19:25:21 +0200
++++ linux-2.6.22-vs2.2.0-rc5/fs/proc/root.c	2007-06-15 02:37:03 +0200
+@@ -22,6 +22,9 @@
+ #include "internal.h"
+ 
+ struct proc_dir_entry *proc_net, *proc_net_stat, *proc_bus, *proc_root_fs, *proc_root_driver;
++struct proc_dir_entry *proc_virtual;
++
++extern void proc_vx_init(void);
+ 
+ static int proc_get_sb(struct file_system_type *fs_type,
+ 	int flags, const char *dev_name, void *data, struct vfsmount *mnt)
+@@ -79,6 +82,7 @@ void __init proc_root_init(void)
+ 	proc_device_tree_init();
+ #endif
+ 	proc_bus = proc_mkdir("bus", NULL);
++	proc_vx_init();
+ 	proc_sys_init();
+ }
+ 
+--- linux-2.6.22/fs/quota.c	2007-07-09 13:19:28 +0200
++++ linux-2.6.22-vs2.2.0-rc5/fs/quota.c	2007-06-15 02:37:03 +0200
+@@ -16,6 +16,7 @@
+ #include <linux/buffer_head.h>
+ #include <linux/capability.h>
+ #include <linux/quotaops.h>
++#include <linux/vs_context.h>
+ 
+ /* Check validity of generic quotactl commands */
+ static int generic_quotactl_valid(struct super_block *sb, int type, int cmd, qid_t id)
+@@ -80,11 +81,11 @@ static int generic_quotactl_valid(struct
+ 	if (cmd == Q_GETQUOTA) {
+ 		if (((type == USRQUOTA && current->euid != id) ||
+ 		     (type == GRPQUOTA && !in_egroup_p(id))) &&
+-		    !capable(CAP_SYS_ADMIN))
++		    !vx_capable(CAP_SYS_ADMIN, VXC_QUOTA_CTL))
+ 			return -EPERM;
+ 	}
+ 	else if (cmd != Q_GETFMT && cmd != Q_SYNC && cmd != Q_GETINFO)
+-		if (!capable(CAP_SYS_ADMIN))
++		if (!vx_capable(CAP_SYS_ADMIN, VXC_QUOTA_CTL))
+ 			return -EPERM;
+ 
+ 	return 0;
+@@ -131,10 +132,10 @@ static int xqm_quotactl_valid(struct sup
+ 	if (cmd == Q_XGETQUOTA) {
+ 		if (((type == XQM_USRQUOTA && current->euid != id) ||
+ 		     (type == XQM_GRPQUOTA && !in_egroup_p(id))) &&
+-		     !capable(CAP_SYS_ADMIN))
++		     !vx_capable(CAP_SYS_ADMIN, VXC_QUOTA_CTL))
+ 			return -EPERM;
+ 	} else if (cmd != Q_XGETQSTAT && cmd != Q_XQUOTASYNC) {
+-		if (!capable(CAP_SYS_ADMIN))
++		if (!vx_capable(CAP_SYS_ADMIN, VXC_QUOTA_CTL))
+ 			return -EPERM;
+ 	}
+ 
+@@ -327,6 +328,46 @@ static int do_quotactl(struct super_bloc
+ 	return 0;
+ }
+ 
++#if defined(CONFIG_BLK_DEV_VROOT) || defined(CONFIG_BLK_DEV_VROOT_MODULE)
++
++#include <linux/vroot.h>
++#include <linux/major.h>
++#include <linux/module.h>
++#include <linux/kallsyms.h>
++#include <linux/vserver/debug.h>
++
++static vroot_grb_func *vroot_get_real_bdev = NULL;
++
++static spinlock_t vroot_grb_lock = SPIN_LOCK_UNLOCKED;
++
++int register_vroot_grb(vroot_grb_func *func) {
++	int ret = -EBUSY;
++
++	spin_lock(&vroot_grb_lock);
++	if (!vroot_get_real_bdev) {
++		vroot_get_real_bdev = func;
++		ret = 0;
++	}
++	spin_unlock(&vroot_grb_lock);
++	return ret;
++}
++EXPORT_SYMBOL(register_vroot_grb);
++
++int unregister_vroot_grb(vroot_grb_func *func) {
++	int ret = -EINVAL;
++
++	spin_lock(&vroot_grb_lock);
++	if (vroot_get_real_bdev) {
++		vroot_get_real_bdev = NULL;
++		ret = 0;
++	}
++	spin_unlock(&vroot_grb_lock);
++	return ret;
++}
++EXPORT_SYMBOL(unregister_vroot_grb);
++
++#endif
++
+ /*
+  * look up a superblock on which quota ops will be performed
+  * - use the name of a block device to find the superblock thereon
+@@ -344,6 +385,22 @@ static inline struct super_block *quotac
+ 	putname(tmp);
+ 	if (IS_ERR(bdev))
+ 		return ERR_PTR(PTR_ERR(bdev));
++#if defined(CONFIG_BLK_DEV_VROOT) || defined(CONFIG_BLK_DEV_VROOT_MODULE)
++	if (bdev && bdev->bd_inode &&
++			imajor(bdev->bd_inode) == VROOT_MAJOR) {
++		struct block_device *bdnew = (void *)-EINVAL;
++
++		if (vroot_get_real_bdev)
++			bdnew = vroot_get_real_bdev(bdev);
++		else
++			vxdprintk(VXD_CBIT(misc, 0),
++					"vroot_get_real_bdev not set");
++		bdput(bdev);
++		if (IS_ERR(bdnew))
++			return ERR_PTR(PTR_ERR(bdnew));
++		bdev = bdnew;
++	}
++#endif
+ 	sb = get_super(bdev);
+ 	bdput(bdev);
+ 	if (!sb)
+--- linux-2.6.22/fs/read_write.c	2007-07-09 13:19:28 +0200
++++ linux-2.6.22-vs2.2.0-rc5/fs/read_write.c	2007-06-15 02:37:03 +0200
+@@ -701,12 +701,77 @@ sys_writev(unsigned long fd, const struc
+ 	return ret;
+ }
+ 
++ssize_t vfs_sendfile(struct file *out_file, struct file *in_file, loff_t *ppos,
++		     size_t count, loff_t max)
++{
++	struct inode * in_inode, * out_inode;
++	loff_t pos;
++	ssize_t ret;
++
++	/* verify in_file */
++	in_inode = in_file->f_path.dentry->d_inode;
++	if (!in_inode)
++		return -EINVAL;
++	if (!in_file->f_op || !in_file->f_op->sendfile)
++		return -EINVAL;
++
++	if (!ppos)
++		ppos = &in_file->f_pos;
++	else
++		if (!(in_file->f_mode & FMODE_PREAD))
++			return -ESPIPE;
++
++	ret = rw_verify_area(READ, in_file, ppos, count);
++	if (ret < 0)
++		return ret;
++	count = ret;
++
++	/* verify out_file */
++	out_inode = out_file->f_path.dentry->d_inode;
++	if (!out_inode)
++		return -EINVAL;
++	if (!out_file->f_op || !out_file->f_op->sendpage)
++		return -EINVAL;
++
++	ret = rw_verify_area(WRITE, out_file, &out_file->f_pos, count);
++	if (ret < 0)
++		return ret;
++	count = ret;
++
++	ret = security_file_permission (out_file, MAY_WRITE);
++	if (ret)
++		return ret;
++
++	if (!max)
++		max = min(in_inode->i_sb->s_maxbytes, out_inode->i_sb->s_maxbytes);
++
++	pos = *ppos;
++	if (unlikely(pos < 0))
++		return -EINVAL;
++	if (unlikely(pos + count > max)) {
++		if (pos >= max)
++			return -EOVERFLOW;
++		count = max - pos;
++	}
++
++	ret = in_file->f_op->sendfile(in_file, ppos, count, file_send_actor, out_file);
++
++	if (ret > 0) {
++		add_rchar(current, ret);
++		add_wchar(current, ret);
++	}
++
++	if (*ppos > max)
++		return -EOVERFLOW;
++	return ret;
++}
++
++EXPORT_SYMBOL(vfs_sendfile);
++
+ static ssize_t do_sendfile(int out_fd, int in_fd, loff_t *ppos,
+ 			   size_t count, loff_t max)
+ {
+ 	struct file * in_file, * out_file;
+-	struct inode * in_inode, * out_inode;
+-	loff_t pos;
+ 	ssize_t retval;
+ 	int fput_needed_in, fput_needed_out;
+ 
+@@ -719,22 +784,6 @@ static ssize_t do_sendfile(int out_fd, i
+ 		goto out;
+ 	if (!(in_file->f_mode & FMODE_READ))
+ 		goto fput_in;
+-	retval = -EINVAL;
+-	in_inode = in_file->f_path.dentry->d_inode;
+-	if (!in_inode)
+-		goto fput_in;
+-	if (!in_file->f_op || !in_file->f_op->sendfile)
+-		goto fput_in;
+-	retval = -ESPIPE;
+-	if (!ppos)
+-		ppos = &in_file->f_pos;
+-	else
+-		if (!(in_file->f_mode & FMODE_PREAD))
+-			goto fput_in;
+-	retval = rw_verify_area(READ, in_file, ppos, count);
+-	if (retval < 0)
+-		goto fput_in;
+-	count = retval;
+ 
+ 	retval = security_file_permission (in_file, MAY_READ);
+ 	if (retval)
+@@ -749,45 +798,11 @@ static ssize_t do_sendfile(int out_fd, i
+ 		goto fput_in;
+ 	if (!(out_file->f_mode & FMODE_WRITE))
+ 		goto fput_out;
+-	retval = -EINVAL;
+-	if (!out_file->f_op || !out_file->f_op->sendpage)
+-		goto fput_out;
+-	out_inode = out_file->f_path.dentry->d_inode;
+-	retval = rw_verify_area(WRITE, out_file, &out_file->f_pos, count);
+-	if (retval < 0)
+-		goto fput_out;
+-	count = retval;
+-
+-	retval = security_file_permission (out_file, MAY_WRITE);
+-	if (retval)
+-		goto fput_out;
+-
+-	if (!max)
+-		max = min(in_inode->i_sb->s_maxbytes, out_inode->i_sb->s_maxbytes);
+-
+-	pos = *ppos;
+-	retval = -EINVAL;
+-	if (unlikely(pos < 0))
+-		goto fput_out;
+-	if (unlikely(pos + count > max)) {
+-		retval = -EOVERFLOW;
+-		if (pos >= max)
+-			goto fput_out;
+-		count = max - pos;
+-	}
+-
+-	retval = in_file->f_op->sendfile(in_file, ppos, count, file_send_actor, out_file);
+ 
+-	if (retval > 0) {
+-		add_rchar(current, retval);
+-		add_wchar(current, retval);
+-	}
++	retval = vfs_sendfile(out_file, in_file, ppos, count, max);
+ 
+ 	inc_syscr(current);
+ 	inc_syscw(current);
+-	if (*ppos > max)
+-		retval = -EOVERFLOW;
+-
+ fput_out:
+ 	fput_light(out_file, fput_needed_out);
+ fput_in:
+--- linux-2.6.22/fs/reiserfs/bitmap.c	2007-02-06 03:01:29 +0100
++++ linux-2.6.22-vs2.2.0-rc5/fs/reiserfs/bitmap.c	2007-06-15 02:37:03 +0200
+@@ -13,6 +13,7 @@
+ #include <linux/reiserfs_fs_sb.h>
+ #include <linux/reiserfs_fs_i.h>
+ #include <linux/quotaops.h>
++#include <linux/vs_dlimit.h>
+ 
+ #define PREALLOCATION_SIZE 9
+ 
+@@ -425,8 +426,10 @@ static void _reiserfs_free_block(struct 
+ 	set_sb_free_blocks(rs, sb_free_blocks(rs) + 1);
+ 
+ 	journal_mark_dirty(th, s, sbh);
+-	if (for_unformatted)
++	if (for_unformatted) {
++		DLIMIT_FREE_BLOCK(inode, 1);
+ 		DQUOT_FREE_BLOCK_NODIRTY(inode, 1);
++	}
+ }
+ 
+ void reiserfs_free_block(struct reiserfs_transaction_handle *th,
+@@ -1034,6 +1037,7 @@ static inline int blocknrs_and_prealloc_
+ 	b_blocknr_t finish = SB_BLOCK_COUNT(s) - 1;
+ 	int passno = 0;
+ 	int nr_allocated = 0;
++	int blocks;
+ 
+ 	determine_prealloc_size(hint);
+ 	if (!hint->formatted_node) {
+@@ -1043,19 +1047,30 @@ static inline int blocknrs_and_prealloc_
+ 			       "reiserquota: allocating %d blocks id=%u",
+ 			       amount_needed, hint->inode->i_uid);
+ #endif
+-		quota_ret =
+-		    DQUOT_ALLOC_BLOCK_NODIRTY(hint->inode, amount_needed);
+-		if (quota_ret)	/* Quota exceeded? */
++		quota_ret = DQUOT_ALLOC_BLOCK_NODIRTY(hint->inode,
++			amount_needed);
++		if (quota_ret)
+ 			return QUOTA_EXCEEDED;
++		if (DLIMIT_ALLOC_BLOCK(hint->inode, amount_needed)) {
++			DQUOT_FREE_BLOCK_NODIRTY(hint->inode,
++				amount_needed);
++			return NO_DISK_SPACE;
++		}
++
+ 		if (hint->preallocate && hint->prealloc_size) {
+ #ifdef REISERQUOTA_DEBUG
+ 			reiserfs_debug(s, REISERFS_DEBUG_CODE,
+ 				       "reiserquota: allocating (prealloc) %d blocks id=%u",
+ 				       hint->prealloc_size, hint->inode->i_uid);
+ #endif
+-			quota_ret =
+-			    DQUOT_PREALLOC_BLOCK_NODIRTY(hint->inode,
+-							 hint->prealloc_size);
++			quota_ret = DQUOT_PREALLOC_BLOCK_NODIRTY(hint->inode,
++				hint->prealloc_size);
++			if (!quota_ret &&
++				DLIMIT_ALLOC_BLOCK(hint->inode, hint->prealloc_size)) {
++				DQUOT_FREE_BLOCK_NODIRTY(hint->inode,
++					hint->prealloc_size);
++				quota_ret = 1;
++			}
+ 			if (quota_ret)
+ 				hint->preallocate = hint->prealloc_size = 0;
+ 		}
+@@ -1087,7 +1102,10 @@ static inline int blocknrs_and_prealloc_
+ 					       nr_allocated,
+ 					       hint->inode->i_uid);
+ #endif
+-				DQUOT_FREE_BLOCK_NODIRTY(hint->inode, amount_needed + hint->prealloc_size - nr_allocated);	/* Free not allocated blocks */
++				/* Free not allocated blocks */
++				blocks = amount_needed + hint->prealloc_size - nr_allocated;
++				DLIMIT_FREE_BLOCK(hint->inode, blocks);
++				DQUOT_FREE_BLOCK_NODIRTY(hint->inode, blocks);
+ 			}
+ 			while (nr_allocated--)
+ 				reiserfs_free_block(hint->th, hint->inode,
+@@ -1118,10 +1136,10 @@ static inline int blocknrs_and_prealloc_
+ 			       REISERFS_I(hint->inode)->i_prealloc_count,
+ 			       hint->inode->i_uid);
+ #endif
+-		DQUOT_FREE_BLOCK_NODIRTY(hint->inode, amount_needed +
+-					 hint->prealloc_size - nr_allocated -
+-					 REISERFS_I(hint->inode)->
+-					 i_prealloc_count);
++		blocks = amount_needed + hint->prealloc_size - nr_allocated -
++			REISERFS_I(hint->inode)->i_prealloc_count;
++		DLIMIT_FREE_BLOCK(hint->inode, blocks);
++		DQUOT_FREE_BLOCK_NODIRTY(hint->inode, blocks);
+ 	}
+ 
+ 	return CARRY_ON;
+--- linux-2.6.22/fs/reiserfs/file.c	2007-07-09 13:19:28 +0200
++++ linux-2.6.22-vs2.2.0-rc5/fs/reiserfs/file.c	2007-06-15 02:37:03 +0200
+@@ -1532,6 +1532,7 @@ const struct file_operations reiserfs_fi
+ 	.release = reiserfs_file_release,
+ 	.fsync = reiserfs_sync_file,
+ 	.sendfile = generic_file_sendfile,
++	.sendpage = generic_file_sendpage,
+ 	.aio_read = generic_file_aio_read,
+ 	.aio_write = generic_file_aio_write,
+ 	.splice_read = generic_file_splice_read,
+@@ -1546,4 +1547,5 @@ const struct inode_operations reiserfs_f
+ 	.listxattr = reiserfs_listxattr,
+ 	.removexattr = reiserfs_removexattr,
+ 	.permission = reiserfs_permission,
++	.sync_flags = reiserfs_sync_flags,
+ };
+--- linux-2.6.22/fs/reiserfs/inode.c	2007-07-09 13:19:28 +0200
++++ linux-2.6.22-vs2.2.0-rc5/fs/reiserfs/inode.c	2007-06-15 02:37:03 +0200
+@@ -16,6 +16,8 @@
+ #include <linux/mpage.h>
+ #include <linux/writeback.h>
+ #include <linux/quotaops.h>
++#include <linux/vs_dlimit.h>
++#include <linux/vs_tag.h>
+ 
+ static int reiserfs_commit_write(struct file *f, struct page *page,
+ 				 unsigned from, unsigned to);
+@@ -50,6 +52,7 @@ void reiserfs_delete_inode(struct inode 
+ 		 * stat data deletion */
+ 		if (!err) 
+ 			DQUOT_FREE_INODE(inode);
++		DLIMIT_FREE_INODE(inode);
+ 
+ 		if (journal_end(&th, inode->i_sb, jbegin_count))
+ 			goto out;
+@@ -1112,6 +1115,8 @@ static void init_inode(struct inode *ino
+ 	struct buffer_head *bh;
+ 	struct item_head *ih;
+ 	__u32 rdev;
++	uid_t uid;
++	gid_t gid;
+ 	//int version = ITEM_VERSION_1;
+ 
+ 	bh = PATH_PLAST_BUFFER(path);
+@@ -1135,12 +1140,13 @@ static void init_inode(struct inode *ino
+ 		    (struct stat_data_v1 *)B_I_PITEM(bh, ih);
+ 		unsigned long blocks;
+ 
++		uid = sd_v1_uid(sd);
++		gid = sd_v1_gid(sd);
++
+ 		set_inode_item_key_version(inode, KEY_FORMAT_3_5);
+ 		set_inode_sd_version(inode, STAT_DATA_V1);
+ 		inode->i_mode = sd_v1_mode(sd);
+ 		inode->i_nlink = sd_v1_nlink(sd);
+-		inode->i_uid = sd_v1_uid(sd);
+-		inode->i_gid = sd_v1_gid(sd);
+ 		inode->i_size = sd_v1_size(sd);
+ 		inode->i_atime.tv_sec = sd_v1_atime(sd);
+ 		inode->i_mtime.tv_sec = sd_v1_mtime(sd);
+@@ -1182,11 +1188,12 @@ static void init_inode(struct inode *ino
+ 		// (directories and symlinks)
+ 		struct stat_data *sd = (struct stat_data *)B_I_PITEM(bh, ih);
+ 
++		uid    = sd_v2_uid(sd);
++		gid    = sd_v2_gid(sd);
++
+ 		inode->i_mode = sd_v2_mode(sd);
+ 		inode->i_nlink = sd_v2_nlink(sd);
+-		inode->i_uid = sd_v2_uid(sd);
+ 		inode->i_size = sd_v2_size(sd);
+-		inode->i_gid = sd_v2_gid(sd);
+ 		inode->i_mtime.tv_sec = sd_v2_mtime(sd);
+ 		inode->i_atime.tv_sec = sd_v2_atime(sd);
+ 		inode->i_ctime.tv_sec = sd_v2_ctime(sd);
+@@ -1216,6 +1223,10 @@ static void init_inode(struct inode *ino
+ 		sd_attrs_to_i_attrs(sd_v2_attrs(sd), inode);
+ 	}
+ 
++	inode->i_uid = INOTAG_UID(DX_TAG(inode), uid, gid);
++	inode->i_gid = INOTAG_GID(DX_TAG(inode), uid, gid);
++	inode->i_tag = INOTAG_TAG(DX_TAG(inode), uid, gid, 0);
++
+ 	pathrelse(path);
+ 	if (S_ISREG(inode->i_mode)) {
+ 		inode->i_op = &reiserfs_file_inode_operations;
+@@ -1238,13 +1249,15 @@ static void init_inode(struct inode *ino
+ static void inode2sd(void *sd, struct inode *inode, loff_t size)
+ {
+ 	struct stat_data *sd_v2 = (struct stat_data *)sd;
++	uid_t uid = TAGINO_UID(DX_TAG(inode), inode->i_uid, inode->i_tag);
++	gid_t gid = TAGINO_GID(DX_TAG(inode), inode->i_gid, inode->i_tag);
+ 	__u16 flags;
+ 
++	set_sd_v2_uid(sd_v2, uid);
++	set_sd_v2_gid(sd_v2, gid);
+ 	set_sd_v2_mode(sd_v2, inode->i_mode);
+ 	set_sd_v2_nlink(sd_v2, inode->i_nlink);
+-	set_sd_v2_uid(sd_v2, inode->i_uid);
+ 	set_sd_v2_size(sd_v2, size);
+-	set_sd_v2_gid(sd_v2, inode->i_gid);
+ 	set_sd_v2_mtime(sd_v2, inode->i_mtime.tv_sec);
+ 	set_sd_v2_atime(sd_v2, inode->i_atime.tv_sec);
+ 	set_sd_v2_ctime(sd_v2, inode->i_ctime.tv_sec);
+@@ -1775,6 +1788,10 @@ int reiserfs_new_inode(struct reiserfs_t
+ 
+ 	BUG_ON(!th->t_trans_id);
+ 
++	if (DLIMIT_ALLOC_INODE(inode)) {
++		err = -ENOSPC;
++		goto out_bad_dlimit;
++	}
+ 	if (DQUOT_ALLOC_INODE(inode)) {
+ 		err = -EDQUOT;
+ 		goto out_end_trans;
+@@ -1960,6 +1977,9 @@ int reiserfs_new_inode(struct reiserfs_t
+ 	DQUOT_FREE_INODE(inode);
+ 
+       out_end_trans:
++	DLIMIT_FREE_INODE(inode);
++
++      out_bad_dlimit:
+ 	journal_end(th, th->t_super, th->t_blocks_allocated);
+ 	/* Drop can be outside and it needs more credits so it's better to have it outside */
+ 	DQUOT_DROP(inode);
+@@ -2690,6 +2710,14 @@ void sd_attrs_to_i_attrs(__u16 sd_attrs,
+ 			inode->i_flags |= S_IMMUTABLE;
+ 		else
+ 			inode->i_flags &= ~S_IMMUTABLE;
++		if (sd_attrs & REISERFS_IUNLINK_FL)
++			inode->i_flags |= S_IUNLINK;
++		else
++			inode->i_flags &= ~S_IUNLINK;
++		if (sd_attrs & REISERFS_BARRIER_FL)
++			inode->i_flags |= S_BARRIER;
++		else
++			inode->i_flags &= ~S_BARRIER;
+ 		if (sd_attrs & REISERFS_APPEND_FL)
+ 			inode->i_flags |= S_APPEND;
+ 		else
+@@ -2712,6 +2740,14 @@ void i_attrs_to_sd_attrs(struct inode *i
+ 			*sd_attrs |= REISERFS_IMMUTABLE_FL;
+ 		else
+ 			*sd_attrs &= ~REISERFS_IMMUTABLE_FL;
++		if (inode->i_flags & S_IUNLINK)
++			*sd_attrs |= REISERFS_IUNLINK_FL;
++		else
++			*sd_attrs &= ~REISERFS_IUNLINK_FL;
++		if (inode->i_flags & S_BARRIER)
++			*sd_attrs |= REISERFS_BARRIER_FL;
++		else
++			*sd_attrs &= ~REISERFS_BARRIER_FL;
+ 		if (inode->i_flags & S_SYNC)
+ 			*sd_attrs |= REISERFS_SYNC_FL;
+ 		else
+@@ -2891,6 +2927,22 @@ static ssize_t reiserfs_direct_IO(int rw
+ 				  reiserfs_get_blocks_direct_io, NULL);
+ }
+ 
++int reiserfs_sync_flags(struct inode *inode)
++{
++	u16 oldflags, newflags;
++
++	oldflags = REISERFS_I(inode)->i_attrs;
++	newflags = oldflags;
++	i_attrs_to_sd_attrs(inode, &newflags);
++
++	if (oldflags ^ newflags) {
++		REISERFS_I(inode)->i_attrs = newflags;
++		inode->i_ctime = CURRENT_TIME_SEC;
++		mark_inode_dirty(inode);
++	}
++	return 0;
++}
++
+ int reiserfs_setattr(struct dentry *dentry, struct iattr *attr)
+ {
+ 	struct inode *inode = dentry->d_inode;
+@@ -2940,9 +2992,11 @@ int reiserfs_setattr(struct dentry *dent
+ 	}
+ 
+ 	error = inode_change_ok(inode, attr);
++
+ 	if (!error) {
+ 		if ((ia_valid & ATTR_UID && attr->ia_uid != inode->i_uid) ||
+-		    (ia_valid & ATTR_GID && attr->ia_gid != inode->i_gid)) {
++		    (ia_valid & ATTR_GID && attr->ia_gid != inode->i_gid) ||
++		    (ia_valid & ATTR_TAG && attr->ia_tag != inode->i_tag)) {
+ 			error = reiserfs_chown_xattrs(inode, attr);
+ 
+ 			if (!error) {
+@@ -2972,6 +3026,9 @@ int reiserfs_setattr(struct dentry *dent
+ 					inode->i_uid = attr->ia_uid;
+ 				if (attr->ia_valid & ATTR_GID)
+ 					inode->i_gid = attr->ia_gid;
++				if ((attr->ia_valid & ATTR_TAG) &&
++					IS_TAGGED(inode))
++					inode->i_tag = attr->ia_tag;
+ 				mark_inode_dirty(inode);
+ 				error =
+ 				    journal_end(&th, inode->i_sb, jbegin_count);
+--- linux-2.6.22/fs/reiserfs/ioctl.c	2007-02-06 03:01:29 +0100
++++ linux-2.6.22-vs2.2.0-rc5/fs/reiserfs/ioctl.c	2007-06-15 02:37:03 +0200
+@@ -4,6 +4,7 @@
+ 
+ #include <linux/capability.h>
+ #include <linux/fs.h>
++#include <linux/mount.h>
+ #include <linux/reiserfs_fs.h>
+ #include <linux/time.h>
+ #include <asm/uaccess.h>
+@@ -24,7 +25,7 @@ static int reiserfs_unpack(struct inode 
+ int reiserfs_ioctl(struct inode *inode, struct file *filp, unsigned int cmd,
+ 		   unsigned long arg)
+ {
+-	unsigned int flags;
++	unsigned int flags, oldflags;
+ 
+ 	switch (cmd) {
+ 	case REISERFS_IOC_UNPACK:
+@@ -43,12 +44,14 @@ int reiserfs_ioctl(struct inode *inode, 
+ 
+ 		flags = REISERFS_I(inode)->i_attrs;
+ 		i_attrs_to_sd_attrs(inode, (__u16 *) & flags);
++		flags &= REISERFS_FL_USER_VISIBLE;
+ 		return put_user(flags, (int __user *)arg);
+ 	case REISERFS_IOC_SETFLAGS:{
+ 			if (!reiserfs_attrs(inode->i_sb))
+ 				return -ENOTTY;
+ 
+-			if (IS_RDONLY(inode))
++			if (IS_RDONLY(inode) ||
++				(filp && MNT_IS_RDONLY(filp->f_vfsmnt)))
+ 				return -EROFS;
+ 
+ 			if ((current->fsuid != inode->i_uid)
+@@ -58,10 +61,12 @@ int reiserfs_ioctl(struct inode *inode, 
+ 			if (get_user(flags, (int __user *)arg))
+ 				return -EFAULT;
+ 
+-			if (((flags ^ REISERFS_I(inode)->
+-			      i_attrs) & (REISERFS_IMMUTABLE_FL |
+-					  REISERFS_APPEND_FL))
+-			    && !capable(CAP_LINUX_IMMUTABLE))
++			oldflags = REISERFS_I(inode) -> i_attrs;
++			if (((oldflags & REISERFS_IMMUTABLE_FL) ||
++				((flags ^ oldflags) &
++				(REISERFS_IMMUTABLE_FL | REISERFS_IUNLINK_FL |
++				 REISERFS_APPEND_FL))) &&
++				!capable(CAP_LINUX_IMMUTABLE))
+ 				return -EPERM;
+ 
+ 			if ((flags & REISERFS_NOTAIL_FL) &&
+@@ -72,6 +77,9 @@ int reiserfs_ioctl(struct inode *inode, 
+ 				if (result)
+ 					return result;
+ 			}
++
++			flags = flags & REISERFS_FL_USER_MODIFIABLE;
++			flags |= oldflags & ~REISERFS_FL_USER_MODIFIABLE;
+ 			sd_attrs_to_i_attrs(flags, inode);
+ 			REISERFS_I(inode)->i_attrs = flags;
+ 			inode->i_ctime = CURRENT_TIME_SEC;
+@@ -83,7 +91,8 @@ int reiserfs_ioctl(struct inode *inode, 
+ 	case REISERFS_IOC_SETVERSION:
+ 		if ((current->fsuid != inode->i_uid) && !capable(CAP_FOWNER))
+ 			return -EPERM;
+-		if (IS_RDONLY(inode))
++		if (IS_RDONLY(inode) ||
++			(filp && MNT_IS_RDONLY(filp->f_vfsmnt)))
+ 			return -EROFS;
+ 		if (get_user(inode->i_generation, (int __user *)arg))
+ 			return -EFAULT;
+--- linux-2.6.22/fs/reiserfs/namei.c	2007-07-09 13:19:28 +0200
++++ linux-2.6.22-vs2.2.0-rc5/fs/reiserfs/namei.c	2007-06-15 02:37:03 +0200
+@@ -17,6 +17,7 @@
+ #include <linux/reiserfs_acl.h>
+ #include <linux/reiserfs_xattr.h>
+ #include <linux/quotaops.h>
++#include <linux/vs_tag.h>
+ 
+ #define INC_DIR_INODE_NLINK(i) if (i->i_nlink != 1) { inc_nlink(i); if (i->i_nlink >= REISERFS_LINK_MAX) i->i_nlink=1; }
+ #define DEC_DIR_INODE_NLINK(i) if (i->i_nlink != 1) drop_nlink(i);
+@@ -360,6 +361,7 @@ static struct dentry *reiserfs_lookup(st
+ 			reiserfs_write_unlock(dir->i_sb);
+ 			return ERR_PTR(-EACCES);
+ 		}
++		dx_propagate_tag(nd, inode);
+ 
+ 		/* Propogate the priv_object flag so we know we're in the priv tree */
+ 		if (is_reiserfs_priv_object(dir))
+@@ -595,6 +597,7 @@ static int new_inode_init(struct inode *
+ 	} else {
+ 		inode->i_gid = current->fsgid;
+ 	}
++	inode->i_tag = dx_current_fstag(inode->i_sb);
+ 	DQUOT_INIT(inode);
+ 	return 0;
+ }
+@@ -1541,6 +1544,7 @@ const struct inode_operations reiserfs_d
+ 	.listxattr = reiserfs_listxattr,
+ 	.removexattr = reiserfs_removexattr,
+ 	.permission = reiserfs_permission,
++	.sync_flags = reiserfs_sync_flags,
+ };
+ 
+ /*
+@@ -1557,6 +1561,7 @@ const struct inode_operations reiserfs_s
+ 	.listxattr = reiserfs_listxattr,
+ 	.removexattr = reiserfs_removexattr,
+ 	.permission = reiserfs_permission,
++	.sync_flags = reiserfs_sync_flags,
+ 
+ };
+ 
+@@ -1570,5 +1575,6 @@ const struct inode_operations reiserfs_s
+ 	.listxattr = reiserfs_listxattr,
+ 	.removexattr = reiserfs_removexattr,
+ 	.permission = reiserfs_permission,
++	.sync_flags = reiserfs_sync_flags,
+ 
+ };
+--- linux-2.6.22/fs/reiserfs/stree.c	2007-07-09 13:19:28 +0200
++++ linux-2.6.22-vs2.2.0-rc5/fs/reiserfs/stree.c	2007-06-15 02:37:03 +0200
+@@ -55,6 +55,7 @@
+ #include <linux/reiserfs_fs.h>
+ #include <linux/buffer_head.h>
+ #include <linux/quotaops.h>
++#include <linux/vs_dlimit.h>
+ 
+ /* Does the buffer contain a disk block which is in the tree. */
+ inline int B_IS_IN_TREE(const struct buffer_head *p_s_bh)
+@@ -1296,6 +1297,7 @@ int reiserfs_delete_item(struct reiserfs
+ 		       "reiserquota delete_item(): freeing %u, id=%u type=%c",
+ 		       quota_cut_bytes, p_s_inode->i_uid, head2type(&s_ih));
+ #endif
++	DLIMIT_FREE_SPACE(p_s_inode, quota_cut_bytes);
+ 	DQUOT_FREE_SPACE_NODIRTY(p_s_inode, quota_cut_bytes);
+ 
+ 	/* Return deleted body length */
+@@ -1384,6 +1386,7 @@ void reiserfs_delete_solid_item(struct r
+ #endif
+ 				DQUOT_FREE_SPACE_NODIRTY(inode,
+ 							 quota_cut_bytes);
++				DLIMIT_FREE_SPACE(inode, quota_cut_bytes);
+ 			}
+ 			break;
+ 		}
+@@ -1737,6 +1740,7 @@ int reiserfs_cut_from_item(struct reiser
+ 		       "reiserquota cut_from_item(): freeing %u id=%u type=%c",
+ 		       quota_cut_bytes, p_s_inode->i_uid, '?');
+ #endif
++	DLIMIT_FREE_SPACE(p_s_inode, quota_cut_bytes);
+ 	DQUOT_FREE_SPACE_NODIRTY(p_s_inode, quota_cut_bytes);
+ 	return n_ret_value;
+ }
+@@ -1978,6 +1982,11 @@ int reiserfs_paste_into_item(struct reis
+ 		pathrelse(p_s_search_path);
+ 		return -EDQUOT;
+ 	}
++	if (DLIMIT_ALLOC_SPACE(inode, n_pasted_size)) {
++		DQUOT_FREE_SPACE_NODIRTY(inode, n_pasted_size);
++		pathrelse(p_s_search_path);
++		return -ENOSPC;
++	}
+ 	init_tb_struct(th, &s_paste_balance, th->t_super, p_s_search_path,
+ 		       n_pasted_size);
+ #ifdef DISPLACE_NEW_PACKING_LOCALITIES
+@@ -2030,6 +2039,7 @@ int reiserfs_paste_into_item(struct reis
+ 		       n_pasted_size, inode->i_uid,
+ 		       key2type(&(p_s_key->on_disk_key)));
+ #endif
++	DLIMIT_FREE_SPACE(inode, n_pasted_size);
+ 	DQUOT_FREE_SPACE_NODIRTY(inode, n_pasted_size);
+ 	return retval;
+ }
+@@ -2067,6 +2077,11 @@ int reiserfs_insert_item(struct reiserfs
+ 			pathrelse(p_s_path);
+ 			return -EDQUOT;
+ 		}
++		if (DLIMIT_ALLOC_SPACE(inode, quota_bytes)) {
++			DQUOT_FREE_SPACE_NODIRTY(inode, quota_bytes);
++			pathrelse(p_s_path);
++			return -ENOSPC;
++		}
+ 	}
+ 	init_tb_struct(th, &s_ins_balance, th->t_super, p_s_path,
+ 		       IH_SIZE + ih_item_len(p_s_ih));
+@@ -2114,7 +2129,9 @@ int reiserfs_insert_item(struct reiserfs
+ 		       "reiserquota insert_item(): freeing %u id=%u type=%c",
+ 		       quota_bytes, inode->i_uid, head2type(p_s_ih));
+ #endif
+-	if (inode)
++	if (inode) {
++		DLIMIT_FREE_SPACE(inode, quota_bytes);
+ 		DQUOT_FREE_SPACE_NODIRTY(inode, quota_bytes);
++	}
+ 	return retval;
+ }
+--- linux-2.6.22/fs/reiserfs/super.c	2007-07-09 13:19:28 +0200
++++ linux-2.6.22-vs2.2.0-rc5/fs/reiserfs/super.c	2007-06-15 02:37:03 +0200
+@@ -882,6 +882,14 @@ static int reiserfs_parse_options(struct
+ 		{"user_xattr",.setmask = 1 << REISERFS_UNSUPPORTED_OPT},
+ 		{"nouser_xattr",.clrmask = 1 << REISERFS_UNSUPPORTED_OPT},
+ #endif
++#ifndef CONFIG_TAGGING_NONE
++		{"tagxid",.setmask = 1 << REISERFS_TAGGED},
++		{"tag",.setmask = 1 << REISERFS_TAGGED},
++		{"notag",.clrmask = 1 << REISERFS_TAGGED},
++#endif
++#ifdef CONFIG_PROPAGATE
++		{"tag",.arg_required = 'T',.values = NULL},
++#endif
+ #ifdef CONFIG_REISERFS_FS_POSIX_ACL
+ 		{"acl",.setmask = 1 << REISERFS_POSIXACL},
+ 		{"noacl",.clrmask = 1 << REISERFS_POSIXACL},
+@@ -1143,6 +1151,12 @@ static int reiserfs_remount(struct super
+ 		return -EINVAL;
+ 	}
+ 
++	if ((mount_options & (1 << REISERFS_TAGGED)) &&
++		!(s->s_flags & MS_TAGGED)) {
++		reiserfs_warning(s, "reiserfs: tagging not permitted on remount.");
++		return -EINVAL;
++	}
++
+ 	handle_attrs(s);
+ 
+ 	/* Add options that are safe here */
+@@ -1591,6 +1605,10 @@ static int reiserfs_fill_super(struct su
+ 		goto error;
+ 	}
+ 
++	/* map mount option tagxid */
++	if (REISERFS_SB(s)->s_mount_opt & (1 << REISERFS_TAGGED))
++		s->s_flags |= MS_TAGGED;
++
+ 	rs = SB_DISK_SUPER_BLOCK(s);
+ 	/* Let's do basic sanity check to verify that underlying device is not
+ 	   smaller than the filesystem. If the check fails then abort and scream,
+--- linux-2.6.22/fs/reiserfs/xattr.c	2007-07-09 13:19:28 +0200
++++ linux-2.6.22-vs2.2.0-rc5/fs/reiserfs/xattr.c	2007-06-15 02:37:04 +0200
+@@ -35,6 +35,7 @@
+ #include <linux/namei.h>
+ #include <linux/errno.h>
+ #include <linux/fs.h>
++#include <linux/mount.h>
+ #include <linux/file.h>
+ #include <linux/pagemap.h>
+ #include <linux/xattr.h>
+@@ -775,7 +776,7 @@ int reiserfs_delete_xattrs(struct inode 
+ 	if (dir->d_inode->i_nlink <= 2) {
+ 		root = get_xa_root(inode->i_sb, XATTR_REPLACE);
+ 		reiserfs_write_lock_xattrs(inode->i_sb);
+-		err = vfs_rmdir(root->d_inode, dir);
++		err = vfs_rmdir(root->d_inode, dir, NULL);
+ 		reiserfs_write_unlock_xattrs(inode->i_sb);
+ 		dput(root);
+ 	} else {
+--- linux-2.6.22/fs/stat.c	2007-07-09 13:19:28 +0200
++++ linux-2.6.22-vs2.2.0-rc5/fs/stat.c	2007-06-15 02:37:04 +0200
+@@ -26,6 +26,7 @@ void generic_fillattr(struct inode *inod
+ 	stat->nlink = inode->i_nlink;
+ 	stat->uid = inode->i_uid;
+ 	stat->gid = inode->i_gid;
++	stat->tag = inode->i_tag;
+ 	stat->rdev = inode->i_rdev;
+ 	stat->atime = inode->i_atime;
+ 	stat->mtime = inode->i_mtime;
+--- linux-2.6.22/fs/super.c	2007-07-09 13:19:28 +0200
++++ linux-2.6.22-vs2.2.0-rc5/fs/super.c	2007-06-15 03:26:55 +0200
+@@ -37,6 +37,9 @@
+ #include <linux/idr.h>
+ #include <linux/kobject.h>
+ #include <linux/mutex.h>
++#include <linux/devpts_fs.h>
++#include <linux/proc_fs.h>
++#include <linux/vs_context.h>
+ #include <asm/uaccess.h>
+ 
+ 
+@@ -860,12 +863,18 @@ struct vfsmount *
+ vfs_kern_mount(struct file_system_type *type, int flags, const char *name, void *data)
+ {
+ 	struct vfsmount *mnt;
++	struct super_block *sb;
+ 	char *secdata = NULL;
+ 	int error;
+ 
+ 	if (!type)
+ 		return ERR_PTR(-ENODEV);
+ 
++	error = -EPERM;
++	if ((type->fs_flags & FS_BINARY_MOUNTDATA) &&
++		!vx_capable(CAP_SYS_ADMIN, VXC_BINARY_MOUNT))
++		goto out;
++
+ 	error = -ENOMEM;
+ 	mnt = alloc_vfsmnt(name);
+ 	if (!mnt)
+@@ -885,7 +894,14 @@ vfs_kern_mount(struct file_system_type *
+ 	if (error < 0)
+ 		goto out_free_secdata;
+ 
+- 	error = security_sb_kern_mount(mnt->mnt_sb, secdata);
++	sb = mnt->mnt_sb;
++	error = -EPERM;
++	if (!vx_capable(CAP_SYS_ADMIN, VXC_BINARY_MOUNT) && !sb->s_bdev &&
++		(sb->s_magic != PROC_SUPER_MAGIC) &&
++		(sb->s_magic != DEVPTS_SUPER_MAGIC))
++		goto out_sb;
++
++	error = security_sb_kern_mount(sb, secdata);
+  	if (error)
+  		goto out_sb;
+ 
+--- linux-2.6.22/fs/sysfs/mount.c	2007-07-09 13:19:28 +0200
++++ linux-2.6.22-vs2.2.0-rc5/fs/sysfs/mount.c	2007-06-17 05:54:17 +0200
+@@ -12,8 +12,6 @@
+ 
+ #include "sysfs.h"
+ 
+-/* Random magic number */
+-#define SYSFS_MAGIC 0x62656572
+ 
+ struct vfsmount *sysfs_mount;
+ struct super_block * sysfs_sb = NULL;
+@@ -48,7 +46,7 @@ static int sysfs_fill_super(struct super
+ 
+ 	sb->s_blocksize = PAGE_CACHE_SIZE;
+ 	sb->s_blocksize_bits = PAGE_CACHE_SHIFT;
+-	sb->s_magic = SYSFS_MAGIC;
++	sb->s_magic = SYSFS_SUPER_MAGIC;
+ 	sb->s_op = &sysfs_ops;
+ 	sb->s_time_gran = 1;
+ 	sysfs_sb = sb;
+--- linux-2.6.22/fs/utimes.c	2007-07-09 13:19:29 +0200
++++ linux-2.6.22-vs2.2.0-rc5/fs/utimes.c	2007-07-09 13:11:54 +0200
+@@ -6,6 +6,8 @@
+ #include <linux/sched.h>
+ #include <linux/stat.h>
+ #include <linux/utime.h>
++#include <linux/mount.h>
++#include <linux/vs_cowbl.h>
+ #include <asm/uaccess.h>
+ #include <asm/unistd.h>
+ 
+@@ -70,14 +72,16 @@ long do_utimes(int dfd, char __user *fil
+ 		if (error)
+ 			goto out;
+ 
++		error = cow_check_and_break(&nd);
++		if (error)
++			goto dput_and_out;
+ 		dentry = nd.dentry;
+ 	}
+ 
+ 	inode = dentry->d_inode;
+-
+ 	error = -EROFS;
+ 	if (IS_RDONLY(inode))
+-		goto dput_and_out;
++		goto dput_and_out;
+ 
+ 	/* Don't worry, the checks are done in inode_change_ok() */
+ 	newattrs.ia_valid = ATTR_CTIME | ATTR_MTIME | ATTR_ATIME;
+--- linux-2.6.22/fs/xattr.c	2007-07-09 13:19:29 +0200
++++ linux-2.6.22-vs2.2.0-rc5/fs/xattr.c	2007-06-15 02:37:04 +0200
+@@ -17,6 +17,7 @@
+ #include <linux/module.h>
+ #include <linux/fsnotify.h>
+ #include <linux/audit.h>
++#include <linux/mount.h>
+ #include <asm/uaccess.h>
+ 
+ 
+@@ -194,7 +195,7 @@ EXPORT_SYMBOL_GPL(vfs_removexattr);
+  */
+ static long
+ setxattr(struct dentry *d, char __user *name, void __user *value,
+-	 size_t size, int flags)
++	 size_t size, int flags, struct vfsmount *mnt)
+ {
+ 	int error;
+ 	void *kvalue = NULL;
+@@ -221,6 +222,9 @@ setxattr(struct dentry *d, char __user *
+ 		}
+ 	}
+ 
++	if (MNT_IS_RDONLY(mnt))
++		return -EROFS;
++
+ 	error = vfs_setxattr(d, kname, kvalue, size, flags);
+ 	kfree(kvalue);
+ 	return error;
+@@ -236,7 +240,7 @@ sys_setxattr(char __user *path, char __u
+ 	error = user_path_walk(path, &nd);
+ 	if (error)
+ 		return error;
+-	error = setxattr(nd.dentry, name, value, size, flags);
++	error = setxattr(nd.dentry, name, value, size, flags, nd.mnt);
+ 	path_release(&nd);
+ 	return error;
+ }
+@@ -251,7 +255,7 @@ sys_lsetxattr(char __user *path, char __
+ 	error = user_path_walk_link(path, &nd);
+ 	if (error)
+ 		return error;
+-	error = setxattr(nd.dentry, name, value, size, flags);
++	error = setxattr(nd.dentry, name, value, size, flags, nd.mnt);
+ 	path_release(&nd);
+ 	return error;
+ }
+@@ -269,7 +273,7 @@ sys_fsetxattr(int fd, char __user *name,
+ 		return error;
+ 	dentry = f->f_path.dentry;
+ 	audit_inode(NULL, dentry->d_inode);
+-	error = setxattr(dentry, name, value, size, flags);
++	error = setxattr(dentry, name, value, size, flags, f->f_vfsmnt);
+ 	fput(f);
+ 	return error;
+ }
+@@ -433,7 +437,7 @@ sys_flistxattr(int fd, char __user *list
+  * Extended attribute REMOVE operations
+  */
+ static long
+-removexattr(struct dentry *d, char __user *name)
++removexattr(struct dentry *d, char __user *name, struct vfsmount *mnt)
+ {
+ 	int error;
+ 	char kname[XATTR_NAME_MAX + 1];
+@@ -444,6 +448,9 @@ removexattr(struct dentry *d, char __use
+ 	if (error < 0)
+ 		return error;
+ 
++	if (MNT_IS_RDONLY(mnt))
++		return -EROFS;
++
+ 	return vfs_removexattr(d, kname);
+ }
+ 
+@@ -456,7 +463,7 @@ sys_removexattr(char __user *path, char 
+ 	error = user_path_walk(path, &nd);
+ 	if (error)
+ 		return error;
+-	error = removexattr(nd.dentry, name);
++	error = removexattr(nd.dentry, name, nd.mnt);
+ 	path_release(&nd);
+ 	return error;
+ }
+@@ -470,7 +477,7 @@ sys_lremovexattr(char __user *path, char
+ 	error = user_path_walk_link(path, &nd);
+ 	if (error)
+ 		return error;
+-	error = removexattr(nd.dentry, name);
++	error = removexattr(nd.dentry, name, nd.mnt);
+ 	path_release(&nd);
+ 	return error;
+ }
+@@ -487,7 +494,7 @@ sys_fremovexattr(int fd, char __user *na
+ 		return error;
+ 	dentry = f->f_path.dentry;
+ 	audit_inode(NULL, dentry->d_inode);
+-	error = removexattr(dentry, name);
++	error = removexattr(dentry, name, f->f_vfsmnt);
+ 	fput(f);
+ 	return error;
+ }
+--- linux-2.6.22/fs/xfs/linux-2.6/xfs_file.c	2007-05-02 19:25:22 +0200
++++ linux-2.6.22-vs2.2.0-rc5/fs/xfs/linux-2.6/xfs_file.c	2007-06-15 02:37:04 +0200
+@@ -453,6 +453,7 @@ const struct file_operations xfs_file_op
+ 	.aio_read	= xfs_file_aio_read,
+ 	.aio_write	= xfs_file_aio_write,
+ 	.sendfile	= xfs_file_sendfile,
++	.sendpage	= generic_file_sendpage,
+ 	.splice_read	= xfs_file_splice_read,
+ 	.splice_write	= xfs_file_splice_write,
+ 	.unlocked_ioctl	= xfs_file_ioctl,
+@@ -476,6 +477,7 @@ const struct file_operations xfs_invis_f
+ 	.aio_read	= xfs_file_aio_read_invis,
+ 	.aio_write	= xfs_file_aio_write_invis,
+ 	.sendfile	= xfs_file_sendfile_invis,
++	.sendpage	= generic_file_sendpage,
+ 	.splice_read	= xfs_file_splice_read_invis,
+ 	.splice_write	= xfs_file_splice_write_invis,
+ 	.unlocked_ioctl	= xfs_file_ioctl_invis,
+--- linux-2.6.22/fs/xfs/linux-2.6/xfs_ioctl.c	2007-05-02 19:25:22 +0200
++++ linux-2.6.22-vs2.2.0-rc5/fs/xfs/linux-2.6/xfs_ioctl.c	2007-06-15 02:37:04 +0200
+@@ -1128,6 +1128,10 @@ xfs_di2lxflags(
+ 
+ 	if (di_flags & XFS_DIFLAG_IMMUTABLE)
+ 		flags |= FS_IMMUTABLE_FL;
++	if (di_flags & XFS_DIFLAG_IUNLINK)
++		flags |= FS_IUNLINK_FL;
++	if (di_flags & XFS_DIFLAG_BARRIER)
++		flags |= FS_BARRIER_FL;
+ 	if (di_flags & XFS_DIFLAG_APPEND)
+ 		flags |= FS_APPEND_FL;
+ 	if (di_flags & XFS_DIFLAG_SYNC)
+--- linux-2.6.22/fs/xfs/linux-2.6/xfs_iops.c	2007-05-02 19:25:22 +0200
++++ linux-2.6.22-vs2.2.0-rc5/fs/xfs/linux-2.6/xfs_iops.c	2007-06-15 02:37:04 +0200
+@@ -51,6 +51,7 @@
+ #include <linux/xattr.h>
+ #include <linux/namei.h>
+ #include <linux/security.h>
++#include <linux/vs_tag.h>
+ 
+ /*
+  * Get a XFS inode from a given vnode.
+@@ -400,6 +401,7 @@ xfs_vn_lookup(
+ 		d_add(dentry, NULL);
+ 		return NULL;
+ 	}
++	dx_propagate_tag(nd, vn_to_inode(cvp));
+ 
+ 	return d_splice_alias(vn_to_inode(cvp), dentry);
+ }
+@@ -657,6 +659,10 @@ xfs_vn_setattr(
+ 	int		flags = 0;
+ 	int		error;
+ 
++	error = inode_change_ok(inode, attr);
++	if (error)
++		return error;
++
+ 	if (ia_valid & ATTR_UID) {
+ 		vattr.va_mask |= XFS_AT_UID;
+ 		vattr.va_uid = attr->ia_uid;
+@@ -665,6 +671,10 @@ xfs_vn_setattr(
+ 		vattr.va_mask |= XFS_AT_GID;
+ 		vattr.va_gid = attr->ia_gid;
+ 	}
++	if ((ia_valid & ATTR_TAG) && IS_TAGGED(inode)) {
++		vattr.va_mask |= XFS_AT_TAG;
++		vattr.va_tag = attr->ia_tag;
++	}
+ 	if (ia_valid & ATTR_SIZE) {
+ 		vattr.va_mask |= XFS_AT_SIZE;
+ 		vattr.va_size = attr->ia_size;
+@@ -710,6 +720,42 @@ xfs_vn_truncate(
+ }
+ 
+ STATIC int
++xfs_vn_sync_flags(struct inode *inode)
++{
++	unsigned int oldflags, newflags;
++	int		flags = 0;
++	int		error;
++	bhv_vattr_t	vattr;
++	bhv_vnode_t	*vp = vn_from_inode(inode);
++
++	memset(&vattr, 0, sizeof vattr);
++
++	vattr.va_mask = XFS_AT_XFLAGS;
++	error = bhv_vop_getattr(vp, &vattr, 0, NULL);
++
++	if (error)
++		return error;
++	oldflags = vattr.va_xflags;
++	newflags = oldflags & ~(XFS_XFLAG_IMMUTABLE |
++		XFS_XFLAG_IUNLINK | XFS_XFLAG_BARRIER);
++
++	if (IS_IMMUTABLE(inode))
++		newflags |= XFS_XFLAG_IMMUTABLE;
++	if (IS_IUNLINK(inode))
++		newflags |= XFS_XFLAG_IUNLINK;
++	if (IS_BARRIER(inode))
++		newflags |= XFS_XFLAG_BARRIER;
++
++	if (oldflags ^ newflags) {
++		vattr.va_xflags = newflags;
++		vattr.va_mask |= XFS_AT_XFLAGS;
++		error = bhv_vop_setattr(vp, &vattr, flags, NULL);
++	}
++	vn_revalidate(vp);
++	return error;
++}
++
++STATIC int
+ xfs_vn_setxattr(
+ 	struct dentry	*dentry,
+ 	const char	*name,
+@@ -822,6 +868,7 @@ const struct inode_operations xfs_inode_
+ 	.getxattr		= xfs_vn_getxattr,
+ 	.listxattr		= xfs_vn_listxattr,
+ 	.removexattr		= xfs_vn_removexattr,
++	.sync_flags		= xfs_vn_sync_flags,
+ };
+ 
+ const struct inode_operations xfs_dir_inode_operations = {
+@@ -841,6 +888,7 @@ const struct inode_operations xfs_dir_in
+ 	.getxattr		= xfs_vn_getxattr,
+ 	.listxattr		= xfs_vn_listxattr,
+ 	.removexattr		= xfs_vn_removexattr,
++	.sync_flags		= xfs_vn_sync_flags,
+ };
+ 
+ const struct inode_operations xfs_symlink_inode_operations = {
+@@ -854,4 +902,5 @@ const struct inode_operations xfs_symlin
+ 	.getxattr		= xfs_vn_getxattr,
+ 	.listxattr		= xfs_vn_listxattr,
+ 	.removexattr		= xfs_vn_removexattr,
++	.sync_flags		= xfs_vn_sync_flags,
+ };
+--- linux-2.6.22/fs/xfs/linux-2.6/xfs_linux.h	2007-05-02 19:25:22 +0200
++++ linux-2.6.22-vs2.2.0-rc5/fs/xfs/linux-2.6/xfs_linux.h	2007-06-15 02:37:04 +0200
+@@ -129,6 +129,7 @@
+ #define current_pid()		(current->pid)
+ #define current_fsuid(cred)	(current->fsuid)
+ #define current_fsgid(cred)	(current->fsgid)
++#define current_fstag(cred,vp)	(dx_current_fstag(vn_to_inode(vp)->i_sb))
+ #define current_test_flags(f)	(current->flags & (f))
+ #define current_set_flags_nested(sp, f)		\
+ 		(*(sp) = current->flags, current->flags |= (f))
+--- linux-2.6.22/fs/xfs/linux-2.6/xfs_super.c	2007-07-09 13:19:29 +0200
++++ linux-2.6.22-vs2.2.0-rc5/fs/xfs/linux-2.6/xfs_super.c	2007-06-15 02:37:04 +0200
+@@ -157,6 +157,7 @@ xfs_revalidate_inode(
+ 	inode->i_nlink	= ip->i_d.di_nlink;
+ 	inode->i_uid	= ip->i_d.di_uid;
+ 	inode->i_gid	= ip->i_d.di_gid;
++	inode->i_tag	= ip->i_d.di_tag;
+ 
+ 	switch (inode->i_mode & S_IFMT) {
+ 	case S_IFBLK:
+@@ -184,6 +185,14 @@ xfs_revalidate_inode(
+ 		inode->i_flags |= S_IMMUTABLE;
+ 	else
+ 		inode->i_flags &= ~S_IMMUTABLE;
++	if (ip->i_d.di_flags & XFS_DIFLAG_IUNLINK)
++		inode->i_flags |= S_IUNLINK;
++	else
++		inode->i_flags &= ~S_IUNLINK;
++	if (ip->i_d.di_flags & XFS_DIFLAG_BARRIER)
++		inode->i_flags |= S_BARRIER;
++	else
++		inode->i_flags &= ~S_BARRIER;
+ 	if (ip->i_d.di_flags & XFS_DIFLAG_APPEND)
+ 		inode->i_flags |= S_APPEND;
+ 	else
+@@ -712,6 +721,12 @@ xfs_fs_remount(
+ 	int			error;
+ 
+ 	error = bhv_vfs_parseargs(vfsp, options, args, 1);
++	if ((args->flags2 & XFSMNT2_TAGGED) &&
++		!(sb->s_flags & MS_TAGGED)) {
++		printk("XFS: %s: tagging not permitted on remount.\n",
++			sb->s_id);
++		error = EINVAL;
++	}
+ 	if (!error)
+ 		error = bhv_vfs_mntupdate(vfsp, flags, args);
+ 	kmem_free(args, sizeof(*args));
+--- linux-2.6.22/fs/xfs/linux-2.6/xfs_vnode.c	2007-05-02 19:25:22 +0200
++++ linux-2.6.22-vs2.2.0-rc5/fs/xfs/linux-2.6/xfs_vnode.c	2007-06-15 02:37:04 +0200
+@@ -119,6 +119,7 @@ vn_revalidate_core(
+ 	inode->i_nlink	    = vap->va_nlink;
+ 	inode->i_uid	    = vap->va_uid;
+ 	inode->i_gid	    = vap->va_gid;
++	inode->i_tag	    = vap->va_tag;
+ 	inode->i_blocks	    = vap->va_nblocks;
+ 	inode->i_mtime	    = vap->va_mtime;
+ 	inode->i_ctime	    = vap->va_ctime;
+@@ -126,6 +127,14 @@ vn_revalidate_core(
+ 		inode->i_flags |= S_IMMUTABLE;
+ 	else
+ 		inode->i_flags &= ~S_IMMUTABLE;
++	if (vap->va_xflags & XFS_XFLAG_IUNLINK)
++		inode->i_flags |= S_IUNLINK;
++	else
++		inode->i_flags &= ~S_IUNLINK;
++	if (vap->va_xflags & XFS_XFLAG_BARRIER)
++		inode->i_flags |= S_BARRIER;
++	else
++		inode->i_flags &= ~S_BARRIER;
+ 	if (vap->va_xflags & XFS_XFLAG_APPEND)
+ 		inode->i_flags |= S_APPEND;
+ 	else
+--- linux-2.6.22/fs/xfs/linux-2.6/xfs_vnode.h	2007-07-09 13:19:29 +0200
++++ linux-2.6.22-vs2.2.0-rc5/fs/xfs/linux-2.6/xfs_vnode.h	2007-06-15 02:37:04 +0200
+@@ -350,6 +350,7 @@ typedef struct bhv_vattr {
+ 	xfs_nlink_t	va_nlink;	/* number of references to file */
+ 	uid_t		va_uid;		/* owner user id */
+ 	gid_t		va_gid;		/* owner group id */
++	tag_t		va_tag;		/* owner group id */
+ 	xfs_ino_t	va_nodeid;	/* file id */
+ 	xfs_off_t	va_size;	/* file size in bytes */
+ 	u_long		va_blocksize;	/* blocksize preferred for i/o */
+@@ -398,13 +399,15 @@ typedef struct bhv_vattr {
+ #define XFS_AT_PROJID		0x04000000
+ #define XFS_AT_SIZE_NOPERM	0x08000000
+ #define XFS_AT_GENCOUNT		0x10000000
++#define XFS_AT_TAG		0x20000000
+ 
+ #define XFS_AT_ALL	(XFS_AT_TYPE|XFS_AT_MODE|XFS_AT_UID|XFS_AT_GID|\
+ 		XFS_AT_FSID|XFS_AT_NODEID|XFS_AT_NLINK|XFS_AT_SIZE|\
+ 		XFS_AT_ATIME|XFS_AT_MTIME|XFS_AT_CTIME|XFS_AT_RDEV|\
+ 		XFS_AT_BLKSIZE|XFS_AT_NBLOCKS|XFS_AT_VCODE|XFS_AT_MAC|\
+ 		XFS_AT_ACL|XFS_AT_CAP|XFS_AT_INF|XFS_AT_XFLAGS|XFS_AT_EXTSIZE|\
+-		XFS_AT_NEXTENTS|XFS_AT_ANEXTENTS|XFS_AT_PROJID|XFS_AT_GENCOUNT)
++		XFS_AT_NEXTENTS|XFS_AT_ANEXTENTS|XFS_AT_PROJID|XFS_AT_GENCOUNT\
++		XFS_AT_TAG)
+ 
+ #define XFS_AT_STAT	(XFS_AT_TYPE|XFS_AT_MODE|XFS_AT_UID|XFS_AT_GID|\
+ 		XFS_AT_FSID|XFS_AT_NODEID|XFS_AT_NLINK|XFS_AT_SIZE|\
+--- linux-2.6.22/fs/xfs/quota/xfs_qm_syscalls.c	2007-07-09 13:19:29 +0200
++++ linux-2.6.22-vs2.2.0-rc5/fs/xfs/quota/xfs_qm_syscalls.c	2007-06-15 02:37:04 +0200
+@@ -17,6 +17,7 @@
+  */
+ 
+ #include <linux/capability.h>
++#include <linux/vs_context.h>
+ 
+ #include "xfs.h"
+ #include "xfs_fs.h"
+@@ -211,7 +212,7 @@ xfs_qm_scall_quotaoff(
+ 	xfs_qoff_logitem_t	*qoffstart;
+ 	int			nculprits;
+ 
+-	if (!force && !capable(CAP_SYS_ADMIN))
++	if (!force && !vx_capable(CAP_SYS_ADMIN, VXC_QUOTA_CTL))
+ 		return XFS_ERROR(EPERM);
+ 	/*
+ 	 * No file system can have quotas enabled on disk but not in core.
+@@ -380,7 +381,7 @@ xfs_qm_scall_trunc_qfiles(
+ 	int		error;
+ 	xfs_inode_t	*qip;
+ 
+-	if (!capable(CAP_SYS_ADMIN))
++	if (!vx_capable(CAP_SYS_ADMIN, VXC_QUOTA_CTL))
+ 		return XFS_ERROR(EPERM);
+ 	error = 0;
+ 	if (!XFS_SB_VERSION_HASQUOTA(&mp->m_sb) || flags == 0) {
+@@ -425,7 +426,7 @@ xfs_qm_scall_quotaon(
+ 	uint		accflags;
+ 	__int64_t	sbflags;
+ 
+-	if (!capable(CAP_SYS_ADMIN))
++	if (!vx_capable(CAP_SYS_ADMIN, VXC_QUOTA_CTL))
+ 		return XFS_ERROR(EPERM);
+ 
+ 	flags &= (XFS_ALL_QUOTA_ACCT | XFS_ALL_QUOTA_ENFD);
+@@ -594,7 +595,7 @@ xfs_qm_scall_setqlim(
+ 	int			error;
+ 	xfs_qcnt_t		hard, soft;
+ 
+-	if (!capable(CAP_SYS_ADMIN))
++	if (!vx_capable(CAP_SYS_ADMIN, VXC_QUOTA_CTL))
+ 		return XFS_ERROR(EPERM);
+ 
+ 	if ((newlim->d_fieldmask &
+--- linux-2.6.22/fs/xfs/xfs_clnt.h	2006-06-18 04:54:50 +0200
++++ linux-2.6.22-vs2.2.0-rc5/fs/xfs/xfs_clnt.h	2007-06-15 02:37:04 +0200
+@@ -99,5 +99,7 @@ struct xfs_mount_args {
+  */
+ #define XFSMNT2_COMPAT_IOSIZE	0x00000001	/* don't report large preferred
+ 						 * I/O size in stat(2) */
++#define XFSMNT2_TAGGED		0x80000000	/* context tagging */
++
+ 
+ #endif	/* __XFS_CLNT_H__ */
+--- linux-2.6.22/fs/xfs/xfs_dinode.h	2006-09-20 16:58:40 +0200
++++ linux-2.6.22-vs2.2.0-rc5/fs/xfs/xfs_dinode.h	2007-06-15 02:37:04 +0200
+@@ -53,7 +53,8 @@ typedef struct xfs_dinode_core
+ 	__uint32_t	di_gid;		/* owner's group id */
+ 	__uint32_t	di_nlink;	/* number of links to file */
+ 	__uint16_t	di_projid;	/* owner's project id */
+-	__uint8_t	di_pad[8];	/* unused, zeroed space */
++	__uint16_t	di_tag;		/* context tagging */
++	__uint8_t	di_pad[6];	/* unused, zeroed space */
+ 	__uint16_t	di_flushiter;	/* incremented on flush */
+ 	xfs_timestamp_t	di_atime;	/* time last accessed */
+ 	xfs_timestamp_t	di_mtime;	/* time last modified */
+@@ -257,6 +258,9 @@ typedef enum xfs_dinode_fmt
+ #define XFS_DIFLAG_EXTSIZE_BIT      11	/* inode extent size allocator hint */
+ #define XFS_DIFLAG_EXTSZINHERIT_BIT 12	/* inherit inode extent size */
+ #define XFS_DIFLAG_NODEFRAG_BIT     13	/* do not reorganize/defragment */
++#define XFS_DIFLAG_BARRIER_BIT	14	/* chroot() barrier */
++#define XFS_DIFLAG_IUNLINK_BIT	15	/* immutable unlink */
++
+ #define XFS_DIFLAG_REALTIME      (1 << XFS_DIFLAG_REALTIME_BIT)
+ #define XFS_DIFLAG_PREALLOC      (1 << XFS_DIFLAG_PREALLOC_BIT)
+ #define XFS_DIFLAG_NEWRTBM       (1 << XFS_DIFLAG_NEWRTBM_BIT)
+@@ -271,12 +275,15 @@ typedef enum xfs_dinode_fmt
+ #define XFS_DIFLAG_EXTSIZE       (1 << XFS_DIFLAG_EXTSIZE_BIT)
+ #define XFS_DIFLAG_EXTSZINHERIT  (1 << XFS_DIFLAG_EXTSZINHERIT_BIT)
+ #define XFS_DIFLAG_NODEFRAG      (1 << XFS_DIFLAG_NODEFRAG_BIT)
++#define XFS_DIFLAG_BARRIER	 (1 << XFS_DIFLAG_BARRIER_BIT)
++#define XFS_DIFLAG_IUNLINK	 (1 << XFS_DIFLAG_IUNLINK_BIT)
+ 
+ #define XFS_DIFLAG_ANY \
+ 	(XFS_DIFLAG_REALTIME | XFS_DIFLAG_PREALLOC | XFS_DIFLAG_NEWRTBM | \
+ 	 XFS_DIFLAG_IMMUTABLE | XFS_DIFLAG_APPEND | XFS_DIFLAG_SYNC | \
+ 	 XFS_DIFLAG_NOATIME | XFS_DIFLAG_NODUMP | XFS_DIFLAG_RTINHERIT | \
+ 	 XFS_DIFLAG_PROJINHERIT | XFS_DIFLAG_NOSYMLINKS | XFS_DIFLAG_EXTSIZE | \
+-	 XFS_DIFLAG_EXTSZINHERIT | XFS_DIFLAG_NODEFRAG)
++	 XFS_DIFLAG_EXTSZINHERIT | XFS_DIFLAG_NODEFRAG | XFS_DIFLAG_BARRIER | \
++	 XFS_DIFLAG_IUNLINK)
+ 
+ #endif	/* __XFS_DINODE_H__ */
+--- linux-2.6.22/fs/xfs/xfs_fs.h	2006-11-30 21:19:29 +0100
++++ linux-2.6.22-vs2.2.0-rc5/fs/xfs/xfs_fs.h	2007-06-15 02:37:04 +0200
+@@ -66,6 +66,8 @@ struct fsxattr {
+ #define XFS_XFLAG_EXTSIZE	0x00000800	/* extent size allocator hint */
+ #define XFS_XFLAG_EXTSZINHERIT	0x00001000	/* inherit inode extent size */
+ #define XFS_XFLAG_NODEFRAG	0x00002000  	/* do not defragment */
++#define XFS_XFLAG_BARRIER	0x00004000	/* chroot() barrier */
++#define XFS_XFLAG_IUNLINK	0x00008000	/* immutable unlink */
+ #define XFS_XFLAG_HASATTR	0x80000000	/* no DIFLAG for this	*/
+ 
+ /*
+@@ -294,7 +296,8 @@ typedef struct xfs_bstat {
+ 	__s32		bs_extents;	/* number of extents		*/
+ 	__u32		bs_gen;		/* generation count		*/
+ 	__u16		bs_projid;	/* project id			*/
+-	unsigned char	bs_pad[14];	/* pad space, unused		*/
++	__u16		bs_tag;		/* context tagging		*/
++	unsigned char	bs_pad[12];	/* pad space, unused		*/
+ 	__u32		bs_dmevmask;	/* DMIG event mask		*/
+ 	__u16		bs_dmstate;	/* DMIG state info		*/
+ 	__u16		bs_aextents;	/* attribute number of extents	*/
+--- linux-2.6.22/fs/xfs/xfs_inode.c	2007-07-09 13:19:34 +0200
++++ linux-2.6.22-vs2.2.0-rc5/fs/xfs/xfs_inode.c	2007-06-15 02:37:04 +0200
+@@ -49,6 +49,7 @@
+ #include "xfs_quota.h"
+ #include "xfs_acl.h"
+ 
++#include <linux/vs_tag.h>
+ 
+ kmem_zone_t *xfs_ifork_zone;
+ kmem_zone_t *xfs_inode_zone;
+@@ -736,20 +737,35 @@ xfs_xlate_dinode_core(
+ 	xfs_dinode_core_t	*buf_core = (xfs_dinode_core_t *)buf;
+ 	xfs_dinode_core_t	*mem_core = (xfs_dinode_core_t *)dip;
+ 	xfs_arch_t		arch = ARCH_CONVERT;
++	uint32_t		uid = 0, gid = 0;
++	uint16_t		tag = 0;
+ 
+ 	ASSERT(dir);
+ 
++	if (dir < 0) {
++		tag = mem_core->di_tag;
++		/* FIXME: supposed to use superblock flag */
++		uid = TAGINO_UID(1, mem_core->di_uid, tag);
++		gid = TAGINO_GID(1, mem_core->di_gid, tag);
++		tag = TAGINO_TAG(1, tag);
++	}
++
+ 	INT_XLATE(buf_core->di_magic, mem_core->di_magic, dir, arch);
+ 	INT_XLATE(buf_core->di_mode, mem_core->di_mode, dir, arch);
+ 	INT_XLATE(buf_core->di_version,	mem_core->di_version, dir, arch);
+ 	INT_XLATE(buf_core->di_format, mem_core->di_format, dir, arch);
+ 	INT_XLATE(buf_core->di_onlink, mem_core->di_onlink, dir, arch);
+-	INT_XLATE(buf_core->di_uid, mem_core->di_uid, dir, arch);
+-	INT_XLATE(buf_core->di_gid, mem_core->di_gid, dir, arch);
++	INT_XLATE(buf_core->di_uid, uid, dir, arch);
++	INT_XLATE(buf_core->di_gid, gid, dir, arch);
++	INT_XLATE(buf_core->di_tag, tag, dir, arch);
+ 	INT_XLATE(buf_core->di_nlink, mem_core->di_nlink, dir, arch);
+ 	INT_XLATE(buf_core->di_projid, mem_core->di_projid, dir, arch);
+ 
+ 	if (dir > 0) {
++		/* FIXME: supposed to use superblock flag */
++		mem_core->di_uid = INOTAG_UID(1, uid, gid);
++		mem_core->di_gid = INOTAG_GID(1, uid, gid);
++		mem_core->di_tag = INOTAG_TAG(1, uid, gid, tag);
+ 		memcpy(mem_core->di_pad, buf_core->di_pad,
+ 			sizeof(buf_core->di_pad));
+ 	} else {
+@@ -797,6 +813,10 @@ _xfs_dic2xflags(
+ 			flags |= XFS_XFLAG_PREALLOC;
+ 		if (di_flags & XFS_DIFLAG_IMMUTABLE)
+ 			flags |= XFS_XFLAG_IMMUTABLE;
++		if (di_flags & XFS_DIFLAG_IUNLINK)
++			flags |= XFS_XFLAG_IUNLINK;
++		if (di_flags & XFS_DIFLAG_BARRIER)
++			flags |= XFS_XFLAG_BARRIER;
+ 		if (di_flags & XFS_DIFLAG_APPEND)
+ 			flags |= XFS_XFLAG_APPEND;
+ 		if (di_flags & XFS_DIFLAG_SYNC)
+@@ -1129,6 +1149,7 @@ xfs_ialloc(
+ 	ASSERT(ip->i_d.di_nlink == nlink);
+ 	ip->i_d.di_uid = current_fsuid(cr);
+ 	ip->i_d.di_gid = current_fsgid(cr);
++	ip->i_d.di_tag = current_fstag(cr, vp);
+ 	ip->i_d.di_projid = prid;
+ 	memset(&(ip->i_d.di_pad[0]), 0, sizeof(ip->i_d.di_pad));
+ 
+--- linux-2.6.22/fs/xfs/xfs_itable.c	2007-07-09 13:19:34 +0200
++++ linux-2.6.22-vs2.2.0-rc5/fs/xfs/xfs_itable.c	2007-06-15 02:37:04 +0200
+@@ -89,6 +89,7 @@ xfs_bulkstat_one_iget(
+ 	buf->bs_mode = dic->di_mode;
+ 	buf->bs_uid = dic->di_uid;
+ 	buf->bs_gid = dic->di_gid;
++	buf->bs_tag = dic->di_tag;
+ 	buf->bs_size = dic->di_size;
+ 	vn_atime_to_bstime(vp, &buf->bs_atime);
+ 	buf->bs_mtime.tv_sec = dic->di_mtime.t_sec;
+@@ -163,6 +164,7 @@ xfs_bulkstat_one_dinode(
+ 	buf->bs_mode = INT_GET(dic->di_mode, ARCH_CONVERT);
+ 	buf->bs_uid = INT_GET(dic->di_uid, ARCH_CONVERT);
+ 	buf->bs_gid = INT_GET(dic->di_gid, ARCH_CONVERT);
++	buf->bs_tag = INT_GET(dic->di_tag, ARCH_CONVERT);
+ 	buf->bs_size = INT_GET(dic->di_size, ARCH_CONVERT);
+ 	buf->bs_atime.tv_sec = INT_GET(dic->di_atime.t_sec, ARCH_CONVERT);
+ 	buf->bs_atime.tv_nsec = INT_GET(dic->di_atime.t_nsec, ARCH_CONVERT);
+--- linux-2.6.22/fs/xfs/xfs_mount.h	2007-05-02 19:25:23 +0200
++++ linux-2.6.22-vs2.2.0-rc5/fs/xfs/xfs_mount.h	2007-06-15 02:37:04 +0200
+@@ -464,6 +464,7 @@ typedef struct xfs_mount {
+ #define XFS_MOUNT_NO_PERCPU_SB	(1ULL << 23)	/* don't use per-cpu superblock
+ 						   counters */
+ 
++#define XFS_MOUNT_TAGGED	(1ULL << 31)	/* context tagging */
+ 
+ /*
+  * Default minimum read and write sizes.
+--- linux-2.6.22/fs/xfs/xfs_vfsops.c	2007-07-09 13:19:34 +0200
++++ linux-2.6.22-vs2.2.0-rc5/fs/xfs/xfs_vfsops.c	2007-06-15 02:37:04 +0200
+@@ -300,6 +300,8 @@ xfs_start_flags(
+ 
+ 	if (ap->flags2 & XFSMNT2_COMPAT_IOSIZE)
+ 		mp->m_flags |= XFS_MOUNT_COMPAT_IOSIZE;
++	if (ap->flags2 & XFSMNT2_TAGGED)
++		mp->m_flags |= XFS_MOUNT_TAGGED;
+ 
+ 	/*
+ 	 * no recovery flag requires a read-only mount
+@@ -394,6 +396,8 @@ xfs_finish_flags(
+ 			return XFS_ERROR(EINVAL);
+ 	}
+ 
++	if (ap->flags2 & XFSMNT2_TAGGED)
++		vfs->vfs_super->s_flags |= MS_TAGGED;
+ 	return 0;
+ }
+ 
+@@ -1645,6 +1649,9 @@ xfs_vget(
+ 					 * in stat(). */
+ #define MNTOPT_ATTR2	"attr2"		/* do use attr2 attribute format */
+ #define MNTOPT_NOATTR2	"noattr2"	/* do not use attr2 attribute format */
++#define MNTOPT_TAGXID	"tagxid"	/* context tagging for inodes */
++#define MNTOPT_TAGGED	"tag"		/* context tagging for inodes */
++#define MNTOPT_NOTAGTAG	"notag"		/* do not use context tagging */
+ 
+ STATIC unsigned long
+ suffix_strtoul(char *s, char **endp, unsigned int base)
+@@ -1831,6 +1838,19 @@ xfs_parseargs(
+ 			args->flags |= XFSMNT_ATTR2;
+ 		} else if (!strcmp(this_char, MNTOPT_NOATTR2)) {
+ 			args->flags &= ~XFSMNT_ATTR2;
++#ifndef CONFIG_TAGGING_NONE
++		} else if (!strcmp(this_char, MNTOPT_TAGGED)) {
++			args->flags2 |= XFSMNT2_TAGGED;
++		} else if (!strcmp(this_char, MNTOPT_NOTAGTAG)) {
++			args->flags2 &= ~XFSMNT2_TAGGED;
++		} else if (!strcmp(this_char, MNTOPT_TAGXID)) {
++			args->flags2 |= XFSMNT2_TAGGED;
++#endif
++#ifdef CONFIG_PROPAGATE
++		} else if (!strcmp(this_char, MNTOPT_TAGGED)) {
++			/* use value */
++			args->flags2 |= XFSMNT2_TAGGED;
++#endif
+ 		} else if (!strcmp(this_char, "osyncisdsync")) {
+ 			/* no-op, this is now the default */
+ 			cmn_err(CE_WARN,
+--- linux-2.6.22/fs/xfs/xfs_vnodeops.c	2007-07-09 13:19:34 +0200
++++ linux-2.6.22-vs2.2.0-rc5/fs/xfs/xfs_vnodeops.c	2007-06-15 02:37:04 +0200
+@@ -159,6 +159,7 @@ xfs_getattr(
+ 	vap->va_mode = ip->i_d.di_mode;
+ 	vap->va_uid = ip->i_d.di_uid;
+ 	vap->va_gid = ip->i_d.di_gid;
++	vap->va_tag = ip->i_d.di_tag;
+ 	vap->va_projid = ip->i_d.di_projid;
+ 
+ 	/*
+@@ -259,6 +260,7 @@ xfs_setattr(
+ 	uint			commit_flags=0;
+ 	uid_t			uid=0, iuid=0;
+ 	gid_t			gid=0, igid=0;
++	tag_t			tag=0, itag=0;
+ 	int			timeflags = 0;
+ 	bhv_vnode_t		*vp;
+ 	xfs_prid_t		projid=0, iprojid=0;
+@@ -315,6 +317,7 @@ xfs_setattr(
+ 	    (mask & (XFS_AT_UID|XFS_AT_GID|XFS_AT_PROJID))) {
+ 		uint	qflags = 0;
+ 
++		/* TODO: handle tagging? */
+ 		if ((mask & XFS_AT_UID) && XFS_IS_UQUOTA_ON(mp)) {
+ 			uid = vap->va_uid;
+ 			qflags |= XFS_QMOPT_UQUOTA;
+@@ -394,6 +397,8 @@ xfs_setattr(
+ 	if (mask &
+ 	    (XFS_AT_MODE|XFS_AT_XFLAGS|XFS_AT_EXTSIZE|XFS_AT_UID|
+ 	     XFS_AT_GID|XFS_AT_PROJID)) {
++		/* TODO: handle tagging? */
++
+ 		/*
+ 		 * CAP_FOWNER overrides the following restrictions:
+ 		 *
+@@ -442,7 +447,7 @@ xfs_setattr(
+ 	 * and can change the group id only to a group of which he
+ 	 * or she is a member.
+ 	 */
+-	if (mask & (XFS_AT_UID|XFS_AT_GID|XFS_AT_PROJID)) {
++	if (mask & (XFS_AT_UID|XFS_AT_GID|XFS_AT_TAG|XFS_AT_PROJID)) {
+ 		/*
+ 		 * These IDs could have changed since we last looked at them.
+ 		 * But, we're assured that if the ownership did change
+@@ -450,10 +455,12 @@ xfs_setattr(
+ 		 * would have changed also.
+ 		 */
+ 		iuid = ip->i_d.di_uid;
+-		iprojid = ip->i_d.di_projid;
+ 		igid = ip->i_d.di_gid;
+-		gid = (mask & XFS_AT_GID) ? vap->va_gid : igid;
++		itag = ip->i_d.di_tag;
++		iprojid = ip->i_d.di_projid;
+ 		uid = (mask & XFS_AT_UID) ? vap->va_uid : iuid;
++		gid = (mask & XFS_AT_GID) ? vap->va_gid : igid;
++		tag = (mask & XFS_AT_TAG) ? vap->va_tag : itag;
+ 		projid = (mask & XFS_AT_PROJID) ? (xfs_prid_t)vap->va_projid :
+ 			 iprojid;
+ 
+@@ -481,6 +488,7 @@ xfs_setattr(
+ 		if ((XFS_IS_UQUOTA_ON(mp) && iuid != uid) ||
+ 		    (XFS_IS_PQUOTA_ON(mp) && iprojid != projid) ||
+ 		    (XFS_IS_GQUOTA_ON(mp) && igid != gid)) {
++			/* TODO: handle tagging? */
+ 			ASSERT(tp);
+ 			code = XFS_QM_DQVOPCHOWNRESV(mp, tp, ip, udqp, gdqp,
+ 						capable(CAP_FOWNER) ?
+@@ -706,7 +714,7 @@ xfs_setattr(
+ 	 * and can change the group id only to a group of which he
+ 	 * or she is a member.
+ 	 */
+-	if (mask & (XFS_AT_UID|XFS_AT_GID|XFS_AT_PROJID)) {
++	if (mask & (XFS_AT_UID|XFS_AT_GID|XFS_AT_TAG|XFS_AT_PROJID)) {
+ 		/*
+ 		 * CAP_FSETID overrides the following restrictions:
+ 		 *
+@@ -722,6 +730,9 @@ xfs_setattr(
+ 		 * Change the ownerships and register quota modifications
+ 		 * in the transaction.
+ 		 */
++		if (itag != tag) {
++			ip->i_d.di_tag = tag;
++		}
+ 		if (iuid != uid) {
+ 			if (XFS_IS_UQUOTA_ON(mp)) {
+ 				ASSERT(mask & XFS_AT_UID);
+@@ -802,6 +813,10 @@ xfs_setattr(
+ 			di_flags = (ip->i_d.di_flags & XFS_DIFLAG_PREALLOC);
+ 			if (vap->va_xflags & XFS_XFLAG_IMMUTABLE)
+ 				di_flags |= XFS_DIFLAG_IMMUTABLE;
++			if (vap->va_xflags & XFS_XFLAG_IUNLINK)
++				di_flags |= XFS_DIFLAG_IUNLINK;
++			if (vap->va_xflags & XFS_XFLAG_BARRIER)
++				di_flags |= XFS_DIFLAG_BARRIER;
+ 			if (vap->va_xflags & XFS_XFLAG_APPEND)
+ 				di_flags |= XFS_DIFLAG_APPEND;
+ 			if (vap->va_xflags & XFS_XFLAG_SYNC)
+--- linux-2.6.22/include/asm-arm/tlb.h	2006-06-18 04:54:58 +0200
++++ linux-2.6.22-vs2.2.0-rc5/include/asm-arm/tlb.h	2007-06-15 02:37:04 +0200
+@@ -28,6 +28,7 @@
+ #else /* !CONFIG_MMU */
+ 
+ #include <asm/pgalloc.h>
++#include <linux/vs_memory.h>
+ 
+ /*
+  * TLB handling.  This allows us to remove pages from the page
+--- linux-2.6.22/include/asm-arm26/tlb.h	2006-01-03 17:30:02 +0100
++++ linux-2.6.22-vs2.2.0-rc5/include/asm-arm26/tlb.h	2007-06-15 02:37:04 +0200
+@@ -3,6 +3,7 @@
+ 
+ #include <asm/pgalloc.h>
+ #include <asm/tlbflush.h>
++#include <linux/vs_memory.h>
+ 
+ /*
+  * TLB handling.  This allows us to remove pages from the page
+--- linux-2.6.22/include/asm-arm26/unistd.h	2007-02-06 03:01:35 +0100
++++ linux-2.6.22-vs2.2.0-rc5/include/asm-arm26/unistd.h	2007-06-15 02:37:04 +0200
+@@ -302,6 +302,8 @@
+ #define __NR_mq_getsetattr		(__NR_SYSCALL_BASE+279)
+ #define __NR_waitid			(__NR_SYSCALL_BASE+280)
+ 
++#define __NR_vserver			(__NR_SYSCALL_BASE+313)
++
+ /*
+  * The following SWIs are ARM private. FIXME - make appropriate for arm26
+  */
+--- linux-2.6.22/include/asm-generic/tlb.h	2006-11-30 21:19:31 +0100
++++ linux-2.6.22-vs2.2.0-rc5/include/asm-generic/tlb.h	2007-06-15 02:37:04 +0200
+@@ -14,6 +14,7 @@
+ #define _ASM_GENERIC__TLB_H
+ 
+ #include <linux/swap.h>
++#include <linux/vs_memory.h>
+ #include <asm/pgalloc.h>
+ #include <asm/tlbflush.h>
+ 
+--- linux-2.6.22/include/asm-ia64/tlb.h	2006-09-20 16:58:40 +0200
++++ linux-2.6.22-vs2.2.0-rc5/include/asm-ia64/tlb.h	2007-06-15 02:37:04 +0200
+@@ -40,6 +40,7 @@
+ #include <linux/mm.h>
+ #include <linux/pagemap.h>
+ #include <linux/swap.h>
++#include <linux/vs_memory.h>
+ 
+ #include <asm/pgalloc.h>
+ #include <asm/processor.h>
+--- linux-2.6.22/include/asm-powerpc/systbl.h	2007-07-09 13:19:44 +0200
++++ linux-2.6.22-vs2.2.0-rc5/include/asm-powerpc/systbl.h	2007-07-07 03:52:53 +0200
+@@ -260,7 +260,7 @@ COMPAT_SYS_SPU(fstatfs64)
+ SYSX(sys_ni_syscall, ppc_fadvise64_64, ppc_fadvise64_64)
+ PPC_SYS_SPU(rtas)
+ OLDSYS(debug_setcontext)
+-SYSCALL(ni_syscall)
++SYSX(sys_vserver, sys32_vserver, sys_vserver)
+ COMPAT_SYS(migrate_pages)
+ COMPAT_SYS(mbind)
+ COMPAT_SYS(get_mempolicy)
+--- linux-2.6.22/include/asm-powerpc/unistd.h	2007-07-09 13:19:45 +0200
++++ linux-2.6.22-vs2.2.0-rc5/include/asm-powerpc/unistd.h	2007-07-07 03:52:53 +0200
+@@ -275,7 +275,7 @@
+ #endif
+ #define __NR_rtas		255
+ #define __NR_sys_debug_setcontext 256
+-/* Number 257 is reserved for vserver */
++#define __NR_vserver		257
+ #define __NR_migrate_pages	258
+ #define __NR_mbind		259
+ #define __NR_get_mempolicy	260
+--- linux-2.6.22/include/asm-s390/unistd.h	2007-07-09 13:19:45 +0200
++++ linux-2.6.22-vs2.2.0-rc5/include/asm-s390/unistd.h	2007-06-15 02:37:04 +0200
+@@ -202,7 +202,7 @@
+ #define __NR_clock_gettime	(__NR_timer_create+6)
+ #define __NR_clock_getres	(__NR_timer_create+7)
+ #define __NR_clock_nanosleep	(__NR_timer_create+8)
+-/* Number 263 is reserved for vserver */
++#define __NR_vserver		263
+ #define __NR_statfs64		265
+ #define __NR_fstatfs64		266
+ #define __NR_remap_file_pages	267
+--- linux-2.6.22/include/asm-sparc/unistd.h	2007-07-09 13:19:54 +0200
++++ linux-2.6.22-vs2.2.0-rc5/include/asm-sparc/unistd.h	2007-06-15 02:37:04 +0200
+@@ -283,7 +283,7 @@
+ #define __NR_timer_getoverrun	264
+ #define __NR_timer_delete	265
+ #define __NR_timer_create	266
+-/* #define __NR_vserver		267 Reserved for VSERVER */
++#define __NR_vserver		267
+ #define __NR_io_setup		268
+ #define __NR_io_destroy		269
+ #define __NR_io_submit		270
+--- linux-2.6.22/include/asm-sparc64/tlb.h	2007-07-09 13:19:54 +0200
++++ linux-2.6.22-vs2.2.0-rc5/include/asm-sparc64/tlb.h	2007-07-07 03:54:19 +0200
+@@ -3,6 +3,7 @@
+ 
+ #include <linux/swap.h>
+ #include <linux/pagemap.h>
++#include <linux/vs_memory.h>
+ #include <asm/pgalloc.h>
+ #include <asm/tlbflush.h>
+ #include <asm/mmu_context.h>
+--- linux-2.6.22/include/asm-sparc64/unistd.h	2007-07-09 13:19:54 +0200
++++ linux-2.6.22-vs2.2.0-rc5/include/asm-sparc64/unistd.h	2007-06-15 02:37:04 +0200
+@@ -285,7 +285,7 @@
+ #define __NR_timer_getoverrun	264
+ #define __NR_timer_delete	265
+ #define __NR_timer_create	266
+-/* #define __NR_vserver		267 Reserved for VSERVER */
++#define __NR_vserver		267
+ #define __NR_io_setup		268
+ #define __NR_io_destroy		269
+ #define __NR_io_submit		270
+--- linux-2.6.22/include/asm-x86_64/unistd.h	2007-07-09 13:19:55 +0200
++++ linux-2.6.22-vs2.2.0-rc5/include/asm-x86_64/unistd.h	2007-07-07 03:52:53 +0200
+@@ -532,7 +532,7 @@ __SYSCALL(__NR_tgkill, sys_tgkill)
+ #define __NR_utimes		235
+ __SYSCALL(__NR_utimes, sys_utimes)
+ #define __NR_vserver		236
+-__SYSCALL(__NR_vserver, sys_ni_syscall)
++__SYSCALL(__NR_vserver, sys_vserver)
+ #define __NR_mbind 		237
+ __SYSCALL(__NR_mbind, sys_mbind)
+ #define __NR_set_mempolicy 	238
+--- linux-2.6.22/include/linux/Kbuild	2007-07-09 13:19:55 +0200
++++ linux-2.6.22-vs2.2.0-rc5/include/linux/Kbuild	2007-06-15 02:37:04 +0200
+@@ -349,3 +349,6 @@ unifdef-y += xattr.h
+ unifdef-y += xfrm.h
+ 
+ objhdr-y += version.h
++
++header-y += vserver/
++
+--- linux-2.6.22/include/linux/capability.h	2007-07-09 13:19:55 +0200
++++ linux-2.6.22-vs2.2.0-rc5/include/linux/capability.h	2007-06-15 02:37:04 +0200
+@@ -237,6 +237,7 @@ typedef __u32 kernel_cap_t;
+    arbitrary SCSI commands */
+ /* Allow setting encryption key on loopback filesystem */
+ /* Allow setting zone reclaim policy */
++/* Allow the selection of a security context */
+ 
+ #define CAP_SYS_ADMIN        21
+ 
+@@ -290,6 +291,11 @@ typedef __u32 kernel_cap_t;
+ 
+ #define CAP_AUDIT_CONTROL    30
+ 
++/* Allow context manipulations */
++/* Allow changing context info on files */
++
++#define CAP_CONTEXT	     31
++
+ #ifdef __KERNEL__
+ /* 
+  * Bounding set
+--- linux-2.6.22/include/linux/devpts_fs.h	2004-08-14 12:55:59 +0200
++++ linux-2.6.22-vs2.2.0-rc5/include/linux/devpts_fs.h	2007-06-15 02:37:04 +0200
+@@ -30,5 +30,7 @@ static inline void devpts_pty_kill(int n
+ 
+ #endif
+ 
++#define DEVPTS_SUPER_MAGIC	0x00001cd1
++
+ 
+ #endif /* _LINUX_DEVPTS_FS_H */
+--- linux-2.6.22/include/linux/ext2_fs.h	2006-11-30 21:19:37 +0100
++++ linux-2.6.22-vs2.2.0-rc5/include/linux/ext2_fs.h	2007-06-15 02:37:04 +0200
+@@ -188,6 +188,8 @@ struct ext2_group_desc
+ #define EXT2_NOTAIL_FL			FS_NOTAIL_FL	/* file tail should not be merged */
+ #define EXT2_DIRSYNC_FL			FS_DIRSYNC_FL	/* dirsync behaviour (directories only) */
+ #define EXT2_TOPDIR_FL			FS_TOPDIR_FL	/* Top of directory hierarchies*/
++#define EXT2_BARRIER_FL			FS_BARRIER_FL	/* Barrier for chroot() */
++#define EXT2_IUNLINK_FL			FS_IUNLINK_FL	/* Immutable unlink */
+ #define EXT2_RESERVED_FL		FS_RESERVED_FL	/* reserved for ext2 lib */
+ 
+ #define EXT2_FL_USER_VISIBLE		FS_FL_USER_VISIBLE	/* User visible flags */
+@@ -244,7 +246,7 @@ struct ext2_inode {
+ 		struct {
+ 			__u8	l_i_frag;	/* Fragment number */
+ 			__u8	l_i_fsize;	/* Fragment size */
+-			__u16	i_pad1;
++			__u16	l_i_tag;	/* Context Tag */
+ 			__le16	l_i_uid_high;	/* these 2 fields    */
+ 			__le16	l_i_gid_high;	/* were reserved2[0] */
+ 			__u32	l_i_reserved2;
+@@ -276,6 +278,7 @@ struct ext2_inode {
+ #define i_gid_low	i_gid
+ #define i_uid_high	osd2.linux2.l_i_uid_high
+ #define i_gid_high	osd2.linux2.l_i_gid_high
++#define i_raw_tag	osd2.linux2.l_i_tag
+ #define i_reserved2	osd2.linux2.l_i_reserved2
+ #endif
+ 
+@@ -317,8 +320,9 @@ struct ext2_inode {
+ #define EXT2_MOUNT_XATTR_USER		0x004000  /* Extended user attributes */
+ #define EXT2_MOUNT_POSIX_ACL		0x008000  /* POSIX Access Control Lists */
+ #define EXT2_MOUNT_XIP			0x010000  /* Execute in place */
+-#define EXT2_MOUNT_USRQUOTA		0x020000 /* user quota */
+-#define EXT2_MOUNT_GRPQUOTA		0x040000 /* group quota */
++#define EXT2_MOUNT_USRQUOTA		0x020000  /* user quota */
++#define EXT2_MOUNT_GRPQUOTA		0x040000  /* group quota */
++#define EXT2_MOUNT_TAGGED		(1<<24)	  /* Enable Context Tags */
+ 
+ 
+ #define clear_opt(o, opt)		o &= ~EXT2_MOUNT_##opt
+--- linux-2.6.22/include/linux/ext3_fs.h	2007-07-09 13:19:56 +0200
++++ linux-2.6.22-vs2.2.0-rc5/include/linux/ext3_fs.h	2007-06-15 02:37:04 +0200
+@@ -177,10 +177,20 @@ struct ext3_group_desc
+ #define EXT3_NOTAIL_FL			0x00008000 /* file tail should not be merged */
+ #define EXT3_DIRSYNC_FL			0x00010000 /* dirsync behaviour (directories only) */
+ #define EXT3_TOPDIR_FL			0x00020000 /* Top of directory hierarchies*/
++#define EXT3_BARRIER_FL			0x04000000 /* Barrier for chroot() */
++#define EXT3_IUNLINK_FL			0x08000000 /* Immutable unlink */
+ #define EXT3_RESERVED_FL		0x80000000 /* reserved for ext3 lib */
+ 
++#ifdef CONFIG_VSERVER_LEGACY
++#define EXT3_FL_USER_VISIBLE		0x0803DFFF /* User visible flags */
++#define EXT3_FL_USER_MODIFIABLE		0x080380FF /* User modifiable flags */
++#else
+ #define EXT3_FL_USER_VISIBLE		0x0003DFFF /* User visible flags */
+ #define EXT3_FL_USER_MODIFIABLE		0x000380FF /* User modifiable flags */
++#endif
++#ifdef	CONFIG_VSERVER_LEGACY
++#define EXT3_IOC_SETTAG			FIOC_SETTAGJ
++#endif
+ 
+ /*
+  * Inode dynamic state flags
+@@ -296,7 +306,7 @@ struct ext3_inode {
+ 		struct {
+ 			__u8	l_i_frag;	/* Fragment number */
+ 			__u8	l_i_fsize;	/* Fragment size */
+-			__u16	i_pad1;
++			__u16	l_i_tag;	/* Context Tag */
+ 			__le16	l_i_uid_high;	/* these 2 fields    */
+ 			__le16	l_i_gid_high;	/* were reserved2[0] */
+ 			__u32	l_i_reserved2;
+@@ -330,6 +340,7 @@ struct ext3_inode {
+ #define i_gid_low	i_gid
+ #define i_uid_high	osd2.linux2.l_i_uid_high
+ #define i_gid_high	osd2.linux2.l_i_gid_high
++#define i_raw_tag	osd2.linux2.l_i_tag
+ #define i_reserved2	osd2.linux2.l_i_reserved2
+ 
+ #elif defined(__GNU__)
+@@ -384,6 +395,7 @@ struct ext3_inode {
+ #define EXT3_MOUNT_QUOTA		0x80000 /* Some quota option set */
+ #define EXT3_MOUNT_USRQUOTA		0x100000 /* "old" user quota */
+ #define EXT3_MOUNT_GRPQUOTA		0x200000 /* "old" group quota */
++#define EXT3_MOUNT_TAGGED		(1<<24) /* Enable Context Tags */
+ 
+ /* Compatibility, for having both ext2_fs.h and ext3_fs.h included at once */
+ #ifndef _LINUX_EXT2_FS_H
+@@ -812,6 +824,7 @@ struct buffer_head * ext3_bread (handle_
+ int ext3_get_blocks_handle(handle_t *handle, struct inode *inode,
+ 	sector_t iblock, unsigned long maxblocks, struct buffer_head *bh_result,
+ 	int create, int extend_disksize);
++extern int ext3_sync_flags(struct inode *inode);
+ 
+ extern void ext3_read_inode (struct inode *);
+ extern int  ext3_write_inode (struct inode *, int);
+--- linux-2.6.22/include/linux/ext4_fs.h	2007-07-09 13:19:56 +0200
++++ linux-2.6.22-vs2.2.0-rc5/include/linux/ext4_fs.h	2007-06-15 02:37:04 +0200
+@@ -189,11 +189,21 @@ struct ext4_group_desc
+ #define EXT4_NOTAIL_FL			0x00008000 /* file tail should not be merged */
+ #define EXT4_DIRSYNC_FL			0x00010000 /* dirsync behaviour (directories only) */
+ #define EXT4_TOPDIR_FL			0x00020000 /* Top of directory hierarchies*/
+-#define EXT4_RESERVED_FL		0x80000000 /* reserved for ext4 lib */
+ #define EXT4_EXTENTS_FL			0x00080000 /* Inode uses extents */
++#define EXT4_BARRIER_FL			0x04000000 /* Barrier for chroot() */
++#define EXT4_IUNLINK_FL			0x08000000 /* Immutable unlink */
++#define EXT4_RESERVED_FL		0x80000000 /* reserved for ext4 lib */
+ 
++#ifdef CONFIG_VSERVER_LEGACY
++#define EXT4_FL_USER_VISIBLE		0x080BDFFF /* User visible flags */
++#define EXT4_FL_USER_MODIFIABLE		0x080380FF /* User modifiable flags */
++#else
+ #define EXT4_FL_USER_VISIBLE		0x000BDFFF /* User visible flags */
+ #define EXT4_FL_USER_MODIFIABLE		0x000380FF /* User modifiable flags */
++#endif
++#ifdef	CONFIG_VSERVER_LEGACY
++#define EXT4_IOC_SETTAG			FIOC_SETTAGJ
++#endif
+ 
+ /*
+  * Inode dynamic state flags
+@@ -312,7 +322,8 @@ struct ext4_inode {
+ 			__le16	l_i_file_acl_high;
+ 			__le16	l_i_uid_high;	/* these 2 fields */
+ 			__le16	l_i_gid_high;	/* were reserved2[0] */
+-			__u32	l_i_reserved2;
++			__u16	l_i_tag;	/* Context Tag */
++			__u16	l_i_reserved2;
+ 		} linux2;
+ 		struct {
+ 			__u8	h_i_frag;	/* Fragment number */
+@@ -344,6 +355,7 @@ struct ext4_inode {
+ #define i_gid_low	i_gid
+ #define i_uid_high	osd2.linux2.l_i_uid_high
+ #define i_gid_high	osd2.linux2.l_i_gid_high
++#define i_raw_tag	osd2.linux2.l_i_tag
+ #define i_reserved2	osd2.linux2.l_i_reserved2
+ 
+ #elif defined(__GNU__)
+@@ -400,6 +412,7 @@ struct ext4_inode {
+ #define EXT4_MOUNT_USRQUOTA		0x100000 /* "old" user quota */
+ #define EXT4_MOUNT_GRPQUOTA		0x200000 /* "old" group quota */
+ #define EXT4_MOUNT_EXTENTS		0x400000 /* Extents support */
++#define EXT4_MOUNT_TAGGED		(1<<24) /* Enable Context Tags */
+ 
+ /* Compatibility, for having both ext2_fs.h and ext4_fs.h included at once */
+ #ifndef _LINUX_EXT2_FS_H
+@@ -850,6 +863,7 @@ struct buffer_head * ext4_bread (handle_
+ int ext4_get_blocks_handle(handle_t *handle, struct inode *inode,
+ 	sector_t iblock, unsigned long maxblocks, struct buffer_head *bh_result,
+ 	int create, int extend_disksize);
++extern int ext4_sync_flags(struct inode *inode);
+ 
+ extern void ext4_read_inode (struct inode *);
+ extern int  ext4_write_inode (struct inode *, int);
+--- linux-2.6.22/include/linux/fs.h	2007-07-09 13:19:56 +0200
++++ linux-2.6.22-vs2.2.0-rc5/include/linux/fs.h	2007-07-07 03:52:54 +0200
+@@ -123,6 +123,8 @@ extern int dir_notify_enable;
+ #define MS_SLAVE	(1<<19)	/* change to slave */
+ #define MS_SHARED	(1<<20)	/* change to shared */
+ #define MS_RELATIME	(1<<21)	/* Update atime relative to mtime/ctime. */
++#define MS_TAGGED	(1<<24) /* use generic inode tagging */
++#define MS_TAGID	(1<<25) /* use specific tag for this mount */
+ #define MS_ACTIVE	(1<<30)
+ #define MS_NOUSER	(1<<31)
+ 
+@@ -149,6 +151,8 @@ extern int dir_notify_enable;
+ #define S_NOCMTIME	128	/* Do not update file c/mtime */
+ #define S_SWAPFILE	256	/* Do not truncate: swapon got its bmaps */
+ #define S_PRIVATE	512	/* Inode is fs-internal */
++#define S_BARRIER	1024	/* Barrier for chroot() */
++#define S_IUNLINK	2048	/* Immutable unlink */
+ 
+ /*
+  * Note that nosuid etc flags are inode-specific: setting some file-system
+@@ -165,24 +169,36 @@ extern int dir_notify_enable;
+  */
+ #define __IS_FLG(inode,flg) ((inode)->i_sb->s_flags & (flg))
+ 
+-#define IS_RDONLY(inode) ((inode)->i_sb->s_flags & MS_RDONLY)
++#define IS_RDONLY(inode)	__IS_FLG(inode, MS_RDONLY)
+ #define IS_SYNC(inode)		(__IS_FLG(inode, MS_SYNCHRONOUS) || \
+ 					((inode)->i_flags & S_SYNC))
+ #define IS_DIRSYNC(inode)	(__IS_FLG(inode, MS_SYNCHRONOUS|MS_DIRSYNC) || \
+ 					((inode)->i_flags & (S_SYNC|S_DIRSYNC)))
+ #define IS_MANDLOCK(inode)	__IS_FLG(inode, MS_MANDLOCK)
+-#define IS_NOATIME(inode)   __IS_FLG(inode, MS_RDONLY|MS_NOATIME)
++#define IS_NOATIME(inode)  	__IS_FLG(inode, MS_RDONLY|MS_NOATIME)
++#define IS_TAGGED(inode)	__IS_FLG(inode, MS_TAGGED)
+ 
+ #define IS_NOQUOTA(inode)	((inode)->i_flags & S_NOQUOTA)
+ #define IS_APPEND(inode)	((inode)->i_flags & S_APPEND)
+ #define IS_IMMUTABLE(inode)	((inode)->i_flags & S_IMMUTABLE)
++#define IS_IUNLINK(inode)	((inode)->i_flags & S_IUNLINK)
++#define IS_IXORUNLINK(inode)	((IS_IUNLINK(inode) ? S_IMMUTABLE : 0) ^ IS_IMMUTABLE(inode))
+ #define IS_POSIXACL(inode)	__IS_FLG(inode, MS_POSIXACL)
+ 
++#define IS_BARRIER(inode)	(S_ISDIR((inode)->i_mode) && ((inode)->i_flags & S_BARRIER))
+ #define IS_DEADDIR(inode)	((inode)->i_flags & S_DEAD)
+ #define IS_NOCMTIME(inode)	((inode)->i_flags & S_NOCMTIME)
+ #define IS_SWAPFILE(inode)	((inode)->i_flags & S_SWAPFILE)
+ #define IS_PRIVATE(inode)	((inode)->i_flags & S_PRIVATE)
+ 
++#ifdef CONFIG_VSERVER_COWBL
++#  define IS_COW(inode)		(IS_IUNLINK(inode) && IS_IMMUTABLE(inode))
++#  define IS_COW_LINK(inode)	(S_ISREG((inode)->i_mode) && ((inode)->i_nlink > 1))
++#else
++#  define IS_COW(inode)		(0)
++#  define IS_COW_LINK(inode)	(0)
++#endif
++
+ /* the read-only stuff doesn't really belong here, but any other place is
+    probably as bad and I don't want to create yet another include file. */
+ 
+@@ -256,11 +272,17 @@ extern int dir_notify_enable;
+ #define FS_TOPDIR_FL			0x00020000 /* Top of directory hierarchies*/
+ #define FS_EXTENT_FL			0x00080000 /* Extents */
+ #define FS_DIRECTIO_FL			0x00100000 /* Use direct i/o */
++#define FS_BARRIER_FL			0x04000000 /* Barrier for chroot() */
++#define FS_IUNLINK_FL			0x08000000 /* Immutable unlink */
+ #define FS_RESERVED_FL			0x80000000 /* reserved for ext2 lib */
+ 
++#ifdef CONFIG_VSERVER_LEGACY
++#define FS_FL_USER_VISIBLE		0x0803DFFF /* User visible flags */
++#define FS_FL_USER_MODIFIABLE		0x080380FF /* User modifiable flags */
++#else
+ #define FS_FL_USER_VISIBLE		0x0003DFFF /* User visible flags */
+ #define FS_FL_USER_MODIFIABLE		0x000380FF /* User modifiable flags */
+-
++#endif
+ 
+ #define SYNC_FILE_RANGE_WAIT_BEFORE	1
+ #define SYNC_FILE_RANGE_WRITE		2
+@@ -327,6 +349,7 @@ typedef void (dio_iodone_t)(struct kiocb
+ #define ATTR_KILL_SUID	2048
+ #define ATTR_KILL_SGID	4096
+ #define ATTR_FILE	8192
++#define ATTR_TAG	16384
+ 
+ /*
+  * This is the Inode Attributes structure, used for notify_change().  It
+@@ -342,6 +365,7 @@ struct iattr {
+ 	umode_t		ia_mode;
+ 	uid_t		ia_uid;
+ 	gid_t		ia_gid;
++	tag_t		ia_tag;
+ 	loff_t		ia_size;
+ 	struct timespec	ia_atime;
+ 	struct timespec	ia_mtime;
+@@ -355,6 +379,9 @@ struct iattr {
+ 	struct file	*ia_file;
+ };
+ 
++#define ATTR_FLAG_BARRIER	512	/* Barrier for chroot() */
++#define ATTR_FLAG_IUNLINK	1024	/* Immutable unlink */
++
+ /*
+  * Includes for diskquotas.
+  */
+@@ -537,6 +564,7 @@ struct inode {
+ 	unsigned int		i_nlink;
+ 	uid_t			i_uid;
+ 	gid_t			i_gid;
++	tag_t			i_tag;
+ 	dev_t			i_rdev;
+ 	unsigned long		i_version;
+ 	loff_t			i_size;
+@@ -728,6 +756,7 @@ struct file {
+ 	loff_t			f_pos;
+ 	struct fown_struct	f_owner;
+ 	unsigned int		f_uid, f_gid;
++	xid_t			f_xid;
+ 	struct file_ra_state	f_ra;
+ 
+ 	unsigned long		f_version;
+@@ -811,6 +840,7 @@ struct file_lock {
+ 	unsigned char fl_type;
+ 	loff_t fl_start;
+ 	loff_t fl_end;
++	xid_t fl_xid;
+ 
+ 	struct fasync_struct *	fl_fasync; /* for lease break notifications */
+ 	unsigned long fl_break_time;	/* for nonblocking lease breaks */
+@@ -993,12 +1023,12 @@ extern void unlock_super(struct super_bl
+  */
+ extern int vfs_permission(struct nameidata *, int);
+ extern int vfs_create(struct inode *, struct dentry *, int, struct nameidata *);
+-extern int vfs_mkdir(struct inode *, struct dentry *, int);
+-extern int vfs_mknod(struct inode *, struct dentry *, int, dev_t);
+-extern int vfs_symlink(struct inode *, struct dentry *, const char *, int);
+-extern int vfs_link(struct dentry *, struct inode *, struct dentry *);
+-extern int vfs_rmdir(struct inode *, struct dentry *);
+-extern int vfs_unlink(struct inode *, struct dentry *);
++extern int vfs_mkdir(struct inode *, struct dentry *, int, struct nameidata *);
++extern int vfs_mknod(struct inode *, struct dentry *, int, dev_t, struct nameidata *);
++extern int vfs_symlink(struct inode *, struct dentry *, const char *, int, struct nameidata *);
++extern int vfs_link(struct dentry *, struct inode *, struct dentry *, struct nameidata *);
++extern int vfs_rmdir(struct inode *, struct dentry *, struct nameidata *);
++extern int vfs_unlink(struct inode *, struct dentry *, struct nameidata *);
+ extern int vfs_rename(struct inode *, struct dentry *, struct inode *, struct dentry *);
+ 
+ /*
+@@ -1138,6 +1168,7 @@ struct inode_operations {
+ 	ssize_t (*listxattr) (struct dentry *, char *, size_t);
+ 	int (*removexattr) (struct dentry *, const char *);
+ 	void (*truncate_range)(struct inode *, loff_t, loff_t);
++	int (*sync_flags) (struct inode *);
+ };
+ 
+ struct seq_file;
+@@ -1153,6 +1184,7 @@ extern ssize_t vfs_readv(struct file *, 
+ 		unsigned long, loff_t *);
+ extern ssize_t vfs_writev(struct file *, const struct iovec __user *,
+ 		unsigned long, loff_t *);
++ssize_t vfs_sendfile(struct file *, struct file *, loff_t *, size_t, loff_t);
+ 
+ /*
+  * NOTE: write_inode, delete_inode, clear_inode, put_inode can be called
+@@ -1763,6 +1795,7 @@ extern ssize_t generic_file_buffered_wri
+ extern ssize_t do_sync_read(struct file *filp, char __user *buf, size_t len, loff_t *ppos);
+ extern ssize_t do_sync_write(struct file *filp, const char __user *buf, size_t len, loff_t *ppos);
+ extern ssize_t generic_file_sendfile(struct file *, loff_t *, size_t, read_actor_t, void *);
++extern ssize_t generic_file_sendpage(struct file *, struct page *, int, size_t, loff_t *, int);
+ extern void do_generic_mapping_read(struct address_space *mapping,
+ 				    struct file_ra_state *, struct file *,
+ 				    loff_t *, read_descriptor_t *, read_actor_t);
+@@ -1898,6 +1931,7 @@ extern int dcache_dir_open(struct inode 
+ extern int dcache_dir_close(struct inode *, struct file *);
+ extern loff_t dcache_dir_lseek(struct file *, loff_t, int);
+ extern int dcache_readdir(struct file *, void *, filldir_t);
++extern int dcache_readdir_filter(struct file *, void *, filldir_t, int (*)(struct dentry *));
+ extern int simple_getattr(struct vfsmount *, struct dentry *, struct kstat *);
+ extern int simple_statfs(struct dentry *, struct kstatfs *);
+ extern int simple_link(struct dentry *, struct inode *, struct dentry *);
+--- linux-2.6.22/include/linux/init_task.h	2007-07-09 13:19:56 +0200
++++ linux-2.6.22-vs2.2.0-rc5/include/linux/init_task.h	2007-06-15 02:37:04 +0200
+@@ -169,6 +169,10 @@ extern struct group_info init_groups;
+ 	},								\
+ 	INIT_TRACE_IRQFLAGS						\
+ 	INIT_LOCKDEP							\
++	.xid		= 0,						\
++	.vx_info	= NULL,						\
++	.nid		= 0,						\
++	.nx_info	= NULL,						\
+ }
+ 
+ 
+--- linux-2.6.22/include/linux/ipc.h	2007-07-09 13:19:56 +0200
++++ linux-2.6.22-vs2.2.0-rc5/include/linux/ipc.h	2007-06-15 02:37:04 +0200
+@@ -63,6 +63,7 @@ struct kern_ipc_perm
+ 	key_t		key;
+ 	uid_t		uid;
+ 	gid_t		gid;
++	xid_t		xid;
+ 	uid_t		cuid;
+ 	gid_t		cgid;
+ 	mode_t		mode; 
+--- linux-2.6.22/include/linux/loop.h	2007-07-09 13:19:56 +0200
++++ linux-2.6.22-vs2.2.0-rc5/include/linux/loop.h	2007-06-15 02:37:04 +0200
+@@ -45,6 +45,7 @@ struct loop_device {
+ 	struct loop_func_table *lo_encryption;
+ 	__u32           lo_init[2];
+ 	uid_t		lo_key_owner;	/* Who set the key */
++	xid_t		lo_xid;
+ 	int		(*ioctl)(struct loop_device *, int cmd, 
+ 				 unsigned long arg); 
+ 
+--- linux-2.6.22/include/linux/major.h	2007-07-09 13:19:56 +0200
++++ linux-2.6.22-vs2.2.0-rc5/include/linux/major.h	2007-06-15 02:37:04 +0200
+@@ -15,6 +15,7 @@
+ #define HD_MAJOR		IDE0_MAJOR
+ #define PTY_SLAVE_MAJOR		3
+ #define TTY_MAJOR		4
++#define VROOT_MAJOR		4
+ #define TTYAUX_MAJOR		5
+ #define LP_MAJOR		6
+ #define VCS_MAJOR		7
+--- linux-2.6.22/include/linux/mount.h	2007-07-09 13:19:56 +0200
++++ linux-2.6.22-vs2.2.0-rc5/include/linux/mount.h	2007-06-15 03:54:15 +0200
+@@ -28,12 +28,16 @@ struct mnt_namespace;
+ #define MNT_NOATIME	0x08
+ #define MNT_NODIRATIME	0x10
+ #define MNT_RELATIME	0x20
++#define MNT_RDONLY	0x40
++
++#define MNT_IS_RDONLY(m)	((m) && ((m)->mnt_flags & MNT_RDONLY))
+ 
+ #define MNT_SHRINKABLE	0x100
+ 
+ #define MNT_SHARED	0x1000	/* if the vfsmount is a shared mount */
+ #define MNT_UNBINDABLE	0x2000	/* if the vfsmount is a unbindable mount */
+ #define MNT_PNODE_MASK	0x3000	/* propagation flag mask */
++#define MNT_TAGID	0x8000
+ 
+ struct vfsmount {
+ 	struct list_head mnt_hash;
+@@ -61,6 +65,7 @@ struct vfsmount {
+ 	atomic_t mnt_count;
+ 	int mnt_expiry_mark;		/* true if marked for expiry */
+ 	int mnt_pinned;
++	tag_t mnt_tag;			/* tagging used for vfsmount */
+ };
+ 
+ static inline struct vfsmount *mntget(struct vfsmount *mnt)
+--- linux-2.6.22/include/linux/net.h	2007-07-09 13:19:56 +0200
++++ linux-2.6.22-vs2.2.0-rc5/include/linux/net.h	2007-06-15 02:37:04 +0200
+@@ -63,6 +63,7 @@ typedef enum {
+ #define SOCK_NOSPACE		2
+ #define SOCK_PASSCRED		3
+ #define SOCK_PASSSEC		4
++#define SOCK_USER_SOCKET	5
+ 
+ #ifndef ARCH_HAS_SOCKET_TYPES
+ /**
+--- linux-2.6.22/include/linux/nfs_mount.h	2007-07-09 13:20:00 +0200
++++ linux-2.6.22-vs2.2.0-rc5/include/linux/nfs_mount.h	2007-06-15 03:54:39 +0200
+@@ -62,6 +62,7 @@ struct nfs_mount_data {
+ #define NFS_MOUNT_STRICTLOCK	0x1000	/* reserved for NFSv4 */
+ #define NFS_MOUNT_SECFLAVOUR	0x2000	/* 5 */
+ #define NFS_MOUNT_NORDIRPLUS	0x4000	/* 5 */
++#define NFS_MOUNT_TAGGED	0x8000	/* context tagging */
+ #define NFS_MOUNT_FLAGMASK	0xFFFF
+ 
+ #endif
+--- linux-2.6.22/include/linux/nsproxy.h	2007-07-09 13:20:00 +0200
++++ linux-2.6.22-vs2.2.0-rc5/include/linux/nsproxy.h	2007-06-16 05:37:45 +0200
+@@ -3,6 +3,7 @@
+ 
+ #include <linux/spinlock.h>
+ #include <linux/sched.h>
++#include <linux/vserver/debug.h>
+ 
+ struct mnt_namespace;
+ struct uts_namespace;
+@@ -32,26 +33,46 @@ struct nsproxy {
+ extern struct nsproxy init_nsproxy;
+ 
+ int copy_namespaces(int flags, struct task_struct *tsk);
++struct nsproxy *copy_nsproxy(struct nsproxy *orig);
+ void get_task_namespaces(struct task_struct *tsk);
+ void free_nsproxy(struct nsproxy *ns);
+ int unshare_nsproxy_namespaces(unsigned long, struct nsproxy **,
+ 	struct fs_struct *);
+ 
+-static inline void put_nsproxy(struct nsproxy *ns)
++#define	get_nsproxy(n)	__get_nsproxy(n, __FILE__, __LINE__)
++
++static inline void __get_nsproxy(struct nsproxy *ns,
++	const char *_file, int _line)
+ {
++	vxlprintk(VXD_CBIT(space, 0), "get_nsproxy(%p[%u])",
++		ns, atomic_read(&ns->count), _file, _line);
++	atomic_inc(&ns->count);
++}
++
++#define	put_nsproxy(n)	__put_nsproxy(n, __FILE__, __LINE__)
++
++static inline void __put_nsproxy(struct nsproxy *ns,
++	const char *_file, int _line)
++{
++	vxlprintk(VXD_CBIT(space, 0), "put_nsproxy(%p[%u])",
++		ns, atomic_read(&ns->count), _file, _line);
+ 	if (atomic_dec_and_test(&ns->count)) {
+ 		free_nsproxy(ns);
+ 	}
+ }
+ 
+-static inline void exit_task_namespaces(struct task_struct *p)
++#define	exit_task_namespaces(p)	__exit_task_namespaces(p, __FILE__, __LINE__)
++
++static inline void __exit_task_namespaces(struct task_struct *p,
++	const char *_file, int _line)
+ {
+ 	struct nsproxy *ns = p->nsproxy;
+ 	if (ns) {
+ 		task_lock(p);
+ 		p->nsproxy = NULL;
+ 		task_unlock(p);
+-		put_nsproxy(ns);
++		__put_nsproxy(ns, _file, _line);
+ 	}
+ }
++
+ #endif
+--- linux-2.6.22/include/linux/pid.h	2007-07-09 13:20:00 +0200
++++ linux-2.6.22-vs2.2.0-rc5/include/linux/pid.h	2007-06-15 02:37:04 +0200
+@@ -8,7 +8,8 @@ enum pid_type
+ 	PIDTYPE_PID,
+ 	PIDTYPE_PGID,
+ 	PIDTYPE_SID,
+-	PIDTYPE_MAX
++	PIDTYPE_MAX,
++	PIDTYPE_REALPID
+ };
+ 
+ /*
+--- linux-2.6.22/include/linux/proc_fs.h	2007-07-09 13:20:00 +0200
++++ linux-2.6.22-vs2.2.0-rc5/include/linux/proc_fs.h	2007-06-15 02:37:04 +0200
+@@ -54,6 +54,7 @@ struct proc_dir_entry {
+ 	nlink_t nlink;
+ 	uid_t uid;
+ 	gid_t gid;
++	int vx_flags;
+ 	loff_t size;
+ 	const struct inode_operations *proc_iops;
+ 	const struct file_operations *proc_fops;
+@@ -246,13 +247,20 @@ static inline void kclist_add(struct kco
+ extern void kclist_add(struct kcore_list *, void *, size_t);
+ #endif
+ 
++struct vx_info;
++struct nx_info;
++
+ union proc_op {
+ 	int (*proc_get_link)(struct inode *, struct dentry **, struct vfsmount **);
+ 	int (*proc_read)(struct task_struct *task, char *page);
++	int (*proc_vs_read)(char *page);
++	int (*proc_vxi_read)(struct vx_info *vxi, char *page);
++	int (*proc_nxi_read)(struct nx_info *nxi, char *page);
+ };
+ 
+ struct proc_inode {
+ 	struct pid *pid;
++	int vx_flags;
+ 	int fd;
+ 	union proc_op op;
+ 	struct proc_dir_entry *pde;
+--- linux-2.6.22/include/linux/reiserfs_fs.h	2007-05-02 19:25:34 +0200
++++ linux-2.6.22-vs2.2.0-rc5/include/linux/reiserfs_fs.h	2007-06-15 02:37:04 +0200
+@@ -821,6 +821,10 @@ struct stat_data_v1 {
+ #define REISERFS_COMPR_FL     FS_COMPR_FL
+ #define REISERFS_NOTAIL_FL    FS_NOTAIL_FL
+ 
++/* unfortunately reiserfs sdattr is only 16 bit */
++#define REISERFS_BARRIER_FL   (FS_BARRIER_FL >> 16)
++#define REISERFS_IUNLINK_FL   (FS_IUNLINK_FL >> 16)
++
+ /* persistent flags that file inherits from the parent directory */
+ #define REISERFS_INHERIT_MASK ( REISERFS_IMMUTABLE_FL |	\
+ 				REISERFS_SYNC_FL |	\
+@@ -830,6 +834,14 @@ struct stat_data_v1 {
+ 				REISERFS_COMPR_FL |	\
+ 				REISERFS_NOTAIL_FL )
+ 
++#ifdef CONFIG_VSERVER_LEGACY
++#define REISERFS_FL_USER_VISIBLE	(REISERFS_IUNLINK_FL|0x80FF)
++#define REISERFS_FL_USER_MODIFIABLE	(REISERFS_IUNLINK_FL|0x80FF)
++#else
++#define REISERFS_FL_USER_VISIBLE	0x80FF
++#define REISERFS_FL_USER_MODIFIABLE	0x80FF
++#endif
++
+ /* Stat Data on disk (reiserfs version of UFS disk inode minus the
+    address blocks) */
+ struct stat_data {
+@@ -1901,6 +1913,7 @@ static inline void reiserfs_update_sd(st
+ void sd_attrs_to_i_attrs(__u16 sd_attrs, struct inode *inode);
+ void i_attrs_to_sd_attrs(struct inode *inode, __u16 * sd_attrs);
+ int reiserfs_setattr(struct dentry *dentry, struct iattr *attr);
++int reiserfs_sync_flags(struct inode *inode);
+ 
+ /* namei.c */
+ void set_de_name_and_namelen(struct reiserfs_dir_entry *de);
+--- linux-2.6.22/include/linux/reiserfs_fs_sb.h	2007-07-09 13:20:00 +0200
++++ linux-2.6.22-vs2.2.0-rc5/include/linux/reiserfs_fs_sb.h	2007-06-15 02:37:04 +0200
+@@ -458,6 +458,7 @@ enum reiserfs_mount_options {
+ 	REISERFS_POSIXACL,
+ 	REISERFS_BARRIER_NONE,
+ 	REISERFS_BARRIER_FLUSH,
++	REISERFS_TAGGED,
+ 
+ 	/* Actions on error */
+ 	REISERFS_ERROR_PANIC,
+--- linux-2.6.22/include/linux/sched.h	2007-07-09 13:20:01 +0200
++++ linux-2.6.22-vs2.2.0-rc5/include/linux/sched.h	2007-06-17 05:54:19 +0200
+@@ -26,6 +26,7 @@
+ #define CLONE_STOPPED		0x02000000	/* Start in stopped state */
+ #define CLONE_NEWUTS		0x04000000	/* New utsname group? */
+ #define CLONE_NEWIPC		0x08000000	/* New ipcs */
++#define CLONE_KTHREAD		0x10000000	/* clone a kernel thread */
+ 
+ /*
+  * Scheduling policies
+@@ -94,7 +95,7 @@ struct bio;
+  * List of flags we want to share for kernel threads,
+  * if only because they are not used by them anyway.
+  */
+-#define CLONE_KERNEL	(CLONE_FS | CLONE_FILES | CLONE_SIGHAND)
++#define CLONE_KERNEL	(CLONE_FS|CLONE_FILES|CLONE_SIGHAND|CLONE_KTHREAD)
+ 
+ /*
+  * These are the constant used to fake the fixed-point load-average
+@@ -146,12 +147,13 @@ extern unsigned long weighted_cpuload(co
+ #define TASK_UNINTERRUPTIBLE	2
+ #define TASK_STOPPED		4
+ #define TASK_TRACED		8
++#define TASK_ONHOLD		16
+ /* in tsk->exit_state */
+-#define EXIT_ZOMBIE		16
+-#define EXIT_DEAD		32
++#define EXIT_ZOMBIE		32
++#define EXIT_DEAD		64
+ /* in tsk->state again */
+-#define TASK_NONINTERACTIVE	64
+-#define TASK_DEAD		128
++#define TASK_NONINTERACTIVE	128
++#define TASK_DEAD		256
+ 
+ #define __set_task_state(tsk, state_value)		\
+ 	do { (tsk)->state = (state_value); } while (0)
+@@ -287,27 +289,30 @@ extern void arch_unmap_area_topdown(stru
+  * The mm counters are not protected by its page_table_lock,
+  * so must be incremented atomically.
+  */
+-#define set_mm_counter(mm, member, value) atomic_long_set(&(mm)->_##member, value)
+-#define get_mm_counter(mm, member) ((unsigned long)atomic_long_read(&(mm)->_##member))
+-#define add_mm_counter(mm, member, value) atomic_long_add(value, &(mm)->_##member)
+-#define inc_mm_counter(mm, member) atomic_long_inc(&(mm)->_##member)
+-#define dec_mm_counter(mm, member) atomic_long_dec(&(mm)->_##member)
+ typedef atomic_long_t mm_counter_t;
++#define __set_mm_counter(mm, member, value) \
++	atomic_long_set(&(mm)->_##member, value)
++#define get_mm_counter(mm, member) \
++	((unsigned long)atomic_long_read(&(mm)->_##member))
+ 
+ #else  /* NR_CPUS < CONFIG_SPLIT_PTLOCK_CPUS */
+ /*
+  * The mm counters are protected by its page_table_lock,
+  * so can be incremented directly.
+  */
+-#define set_mm_counter(mm, member, value) (mm)->_##member = (value)
+-#define get_mm_counter(mm, member) ((mm)->_##member)
+-#define add_mm_counter(mm, member, value) (mm)->_##member += (value)
+-#define inc_mm_counter(mm, member) (mm)->_##member++
+-#define dec_mm_counter(mm, member) (mm)->_##member--
+ typedef unsigned long mm_counter_t;
++#define __set_mm_counter(mm, member, value) (mm)->_##member = (value)
++#define get_mm_counter(mm, member) ((mm)->_##member)
+ 
+ #endif /* NR_CPUS < CONFIG_SPLIT_PTLOCK_CPUS */
+ 
++#define set_mm_counter(mm, member, value) \
++	vx_ ## member ## pages_sub((mm), (get_mm_counter(mm, member) - value))
++#define add_mm_counter(mm, member, value) \
++	vx_ ## member ## pages_add((mm), (value))
++#define inc_mm_counter(mm, member) vx_ ## member ## pages_inc((mm))
++#define dec_mm_counter(mm, member) vx_ ## member ## pages_dec((mm))
++
+ #define get_mm_rss(mm)					\
+ 	(get_mm_counter(mm, file_rss) + get_mm_counter(mm, anon_rss))
+ #define update_hiwater_rss(mm)	do {			\
+@@ -365,6 +370,7 @@ struct mm_struct {
+ 
+ 	/* Architecture-specific MM context */
+ 	mm_context_t context;
++	struct vx_info *mm_vx_info;
+ 
+ 	/* Swap token stuff */
+ 	/*
+@@ -570,9 +576,10 @@ struct user_struct {
+ 	/* Hash table maintenance information */
+ 	struct list_head uidhash_list;
+ 	uid_t uid;
++	xid_t xid;
+ };
+ 
+-extern struct user_struct *find_user(uid_t);
++extern struct user_struct *find_user(xid_t, uid_t);
+ 
+ extern struct user_struct root_user;
+ #define INIT_USER (&root_user)
+@@ -969,6 +976,14 @@ struct task_struct {
+ 	
+ 	void *security;
+ 	struct audit_context *audit_context;
++
++/* vserver context data */
++	struct vx_info *vx_info;
++	struct nx_info *nx_info;
++
++	xid_t xid;
++	nid_t nid;
++
+ 	seccomp_t seccomp;
+ 
+ /* Thread group tracking */
+@@ -1290,12 +1305,16 @@ extern struct task_struct init_task;
+ 
+ extern struct   mm_struct init_mm;
+ 
+-#define find_task_by_pid(nr)	find_task_by_pid_type(PIDTYPE_PID, nr)
++#define find_task_by_real_pid(nr) \
++	find_task_by_pid_type(PIDTYPE_REALPID, nr)
++#define find_task_by_pid(nr) \
++	find_task_by_pid_type(PIDTYPE_PID, nr)
++
+ extern struct task_struct *find_task_by_pid_type(int type, int pid);
+ extern void __set_special_pids(pid_t session, pid_t pgrp);
+ 
+ /* per-UID process charging. */
+-extern struct user_struct * alloc_uid(uid_t);
++extern struct user_struct * alloc_uid(xid_t, uid_t);
+ static inline struct user_struct *get_uid(struct user_struct *u)
+ {
+ 	atomic_inc(&u->__count);
+--- linux-2.6.22/include/linux/shmem_fs.h	2006-11-30 21:19:39 +0100
++++ linux-2.6.22-vs2.2.0-rc5/include/linux/shmem_fs.h	2007-06-15 02:37:04 +0200
+@@ -8,6 +8,9 @@
+ 
+ #define SHMEM_NR_DIRECT 16
+ 
++#define TMPFS_SUPER_MAGIC	0x01021994
++
++
+ struct shmem_inode_info {
+ 	spinlock_t		lock;
+ 	unsigned long		flags;
+--- linux-2.6.22/include/linux/stat.h	2007-07-09 13:20:01 +0200
++++ linux-2.6.22-vs2.2.0-rc5/include/linux/stat.h	2007-06-15 02:37:04 +0200
+@@ -66,6 +66,7 @@ struct kstat {
+ 	unsigned int	nlink;
+ 	uid_t		uid;
+ 	gid_t		gid;
++	tag_t		tag;
+ 	dev_t		rdev;
+ 	loff_t		size;
+ 	struct timespec  atime;
+--- linux-2.6.22/include/linux/sunrpc/auth.h	2006-11-30 21:19:40 +0100
++++ linux-2.6.22-vs2.2.0-rc5/include/linux/sunrpc/auth.h	2007-06-15 02:37:04 +0200
+@@ -24,6 +24,7 @@
+ struct auth_cred {
+ 	uid_t	uid;
+ 	gid_t	gid;
++	tag_t	tag;
+ 	struct group_info *group_info;
+ };
+ 
+--- linux-2.6.22/include/linux/sunrpc/clnt.h	2007-07-09 13:20:01 +0200
++++ linux-2.6.22-vs2.2.0-rc5/include/linux/sunrpc/clnt.h	2007-06-15 02:37:04 +0200
+@@ -43,7 +43,8 @@ struct rpc_clnt {
+ 				cl_discrtry : 1,/* disconnect before retry */
+ 				cl_autobind : 1,/* use getport() */
+ 				cl_oneshot  : 1,/* dispose after use */
+-				cl_dead     : 1;/* abandoned */
++				cl_dead     : 1,/* abandoned */
++				cl_tag      : 1;/* context tagging */
+ 
+ 	struct rpc_rtt *	cl_rtt;		/* RTO estimator data */
+ 
+--- linux-2.6.22/include/linux/syscalls.h	2007-07-09 13:20:01 +0200
++++ linux-2.6.22-vs2.2.0-rc5/include/linux/syscalls.h	2007-07-07 03:52:54 +0200
+@@ -294,6 +294,8 @@ asmlinkage long sys_symlink(const char _
+ asmlinkage long sys_unlink(const char __user *pathname);
+ asmlinkage long sys_rename(const char __user *oldname,
+ 				const char __user *newname);
++asmlinkage long sys_copyfile(const char __user *from, const char __user *to,
++				umode_t mode);
+ asmlinkage long sys_chmod(const char __user *filename, mode_t mode);
+ asmlinkage long sys_fchmod(unsigned int fd, mode_t mode);
+ 
+--- linux-2.6.22/include/linux/sysctl.h	2007-07-09 13:20:01 +0200
++++ linux-2.6.22-vs2.2.0-rc5/include/linux/sysctl.h	2007-06-15 02:37:04 +0200
+@@ -106,6 +106,7 @@ enum
+ 	KERN_CAP_BSET=14,	/* int: capability bounding set */
+ 	KERN_PANIC=15,		/* int: panic timeout */
+ 	KERN_REALROOTDEV=16,	/* real root device to mount after initrd */
++	KERN_VSHELPER=17,	/* string: path to vshelper policy agent */
+ 
+ 	KERN_SPARC_REBOOT=21,	/* reboot command on Sparc */
+ 	KERN_CTLALTDEL=22,	/* int: allow ctl-alt-del to reboot */
+--- linux-2.6.22/include/linux/sysfs.h	2007-07-09 13:20:01 +0200
++++ linux-2.6.22-vs2.2.0-rc5/include/linux/sysfs.h	2007-06-15 02:37:04 +0200
+@@ -15,6 +15,8 @@
+ #include <linux/list.h>
+ #include <asm/atomic.h>
+ 
++#define SYSFS_SUPER_MAGIC	0x62656572
++
+ struct kobject;
+ struct module;
+ struct nameidata;
+--- linux-2.6.22/include/linux/time.h	2007-07-09 13:20:01 +0200
++++ linux-2.6.22-vs2.2.0-rc5/include/linux/time.h	2007-06-15 02:37:04 +0200
+@@ -176,6 +176,9 @@ static inline void timespec_add_ns(struc
+ 	}
+ 	a->tv_nsec = ns;
+ }
++
++#include <linux/vs_time.h>
++
+ #endif /* __KERNEL__ */
+ 
+ #define NFDBITS			__NFDBITS
+--- linux-2.6.22/include/linux/types.h	2007-02-06 03:01:52 +0100
++++ linux-2.6.22-vs2.2.0-rc5/include/linux/types.h	2007-06-15 02:37:04 +0200
+@@ -39,6 +39,9 @@ typedef __kernel_uid32_t	uid_t;
+ typedef __kernel_gid32_t	gid_t;
+ typedef __kernel_uid16_t        uid16_t;
+ typedef __kernel_gid16_t        gid16_t;
++typedef unsigned int		xid_t;
++typedef unsigned int		nid_t;
++typedef unsigned int		tag_t;
+ 
+ #ifdef CONFIG_UID16
+ /* This is defined by include/asm-{arch}/posix_types.h */
+--- linux-2.6.22/include/linux/vroot.h	1970-01-01 01:00:00 +0100
++++ linux-2.6.22-vs2.2.0-rc5/include/linux/vroot.h	2007-06-15 02:37:04 +0200
+@@ -0,0 +1,51 @@
++
++/*
++ * include/linux/vroot.h
++ *
++ * written by Herbert Pötzl, 9/11/2002
++ * ported to 2.6 by Herbert Pötzl, 30/12/2004
++ *
++ * Copyright (C) 2002-2007 by Herbert Pötzl.
++ * Redistribution of this file is permitted under the
++ * GNU General Public License.
++ */
++
++#ifndef _LINUX_VROOT_H
++#define _LINUX_VROOT_H
++
++
++#ifdef __KERNEL__
++
++/* Possible states of device */
++enum {
++	Vr_unbound,
++	Vr_bound,
++};
++
++struct vroot_device {
++	int		vr_number;
++	int		vr_refcnt;
++
++	struct semaphore	vr_ctl_mutex;
++	struct block_device    *vr_device;
++	int			vr_state;
++};
++
++
++typedef struct block_device *(vroot_grb_func)(struct block_device *);
++
++extern int register_vroot_grb(vroot_grb_func *);
++extern int unregister_vroot_grb(vroot_grb_func *);
++
++#endif /* __KERNEL__ */
++
++#define MAX_VROOT_DEFAULT	8
++
++/*
++ * IOCTL commands --- we will commandeer 0x56 ('V')
++ */
++
++#define VROOT_SET_DEV		0x5600
++#define VROOT_CLR_DEV		0x5601
++
++#endif /* _LINUX_VROOT_H */
+--- linux-2.6.22/include/linux/vs_base.h	1970-01-01 01:00:00 +0100
++++ linux-2.6.22-vs2.2.0-rc5/include/linux/vs_base.h	2007-06-15 02:37:04 +0200
+@@ -0,0 +1,9 @@
++#ifndef _VS_BASE_H
++#define _VS_BASE_H
++
++#include "vserver/base.h"
++#include "vserver/debug.h"
++
++#else
++#warning duplicate inclusion
++#endif
+--- linux-2.6.22/include/linux/vs_context.h	1970-01-01 01:00:00 +0100
++++ linux-2.6.22-vs2.2.0-rc5/include/linux/vs_context.h	2007-06-15 02:37:04 +0200
+@@ -0,0 +1,224 @@
++#ifndef _VS_CONTEXT_H
++#define _VS_CONTEXT_H
++
++#include "vserver/base.h"
++#include "vserver/context.h"
++#include "vserver/history.h"
++#include "vserver/debug.h"
++
++
++#define get_vx_info(i) __get_vx_info(i, __FILE__, __LINE__, __HERE__)
++
++static inline struct vx_info *__get_vx_info(struct vx_info *vxi,
++	const char *_file, int _line, void *_here)
++{
++	if (!vxi)
++		return NULL;
++
++	vxlprintk(VXD_CBIT(xid, 2), "get_vx_info(%p[#%d.%d])",
++		vxi, vxi ? vxi->vx_id : 0,
++		vxi ? atomic_read(&vxi->vx_usecnt) : 0,
++		_file, _line);
++	__vxh_get_vx_info(vxi, _here);
++
++	atomic_inc(&vxi->vx_usecnt);
++	return vxi;
++}
++
++
++extern void free_vx_info(struct vx_info *);
++
++#define put_vx_info(i) __put_vx_info(i, __FILE__, __LINE__, __HERE__)
++
++static inline void __put_vx_info(struct vx_info *vxi,
++	const char *_file, int _line, void *_here)
++{
++	if (!vxi)
++		return;
++
++	vxlprintk(VXD_CBIT(xid, 2), "put_vx_info(%p[#%d.%d])",
++		vxi, vxi ? vxi->vx_id : 0,
++		vxi ? atomic_read(&vxi->vx_usecnt) : 0,
++		_file, _line);
++	__vxh_put_vx_info(vxi, _here);
++
++	if (atomic_dec_and_test(&vxi->vx_usecnt))
++		free_vx_info(vxi);
++}
++
++
++#define init_vx_info(p, i) \
++	__init_vx_info(p, i, __FILE__, __LINE__, __HERE__)
++
++static inline void __init_vx_info(struct vx_info **vxp, struct vx_info *vxi,
++	const char *_file, int _line, void *_here)
++{
++	if (vxi) {
++		vxlprintk(VXD_CBIT(xid, 3),
++			"init_vx_info(%p[#%d.%d])",
++			vxi, vxi ? vxi->vx_id : 0,
++			vxi ? atomic_read(&vxi->vx_usecnt) : 0,
++			_file, _line);
++		__vxh_init_vx_info(vxi, vxp, _here);
++
++		atomic_inc(&vxi->vx_usecnt);
++	}
++	*vxp = vxi;
++}
++
++
++#define set_vx_info(p, i) \
++	__set_vx_info(p, i, __FILE__, __LINE__, __HERE__)
++
++static inline void __set_vx_info(struct vx_info **vxp, struct vx_info *vxi,
++	const char *_file, int _line, void *_here)
++{
++	struct vx_info *vxo;
++
++	if (!vxi)
++		return;
++
++	vxlprintk(VXD_CBIT(xid, 3), "set_vx_info(%p[#%d.%d])",
++		vxi, vxi ? vxi->vx_id : 0,
++		vxi ? atomic_read(&vxi->vx_usecnt) : 0,
++		_file, _line);
++	__vxh_set_vx_info(vxi, vxp, _here);
++
++	atomic_inc(&vxi->vx_usecnt);
++	vxo = xchg(vxp, vxi);
++	BUG_ON(vxo);
++}
++
++
++#define clr_vx_info(p) __clr_vx_info(p, __FILE__, __LINE__, __HERE__)
++
++static inline void __clr_vx_info(struct vx_info **vxp,
++	const char *_file, int _line, void *_here)
++{
++	struct vx_info *vxo;
++
++	vxo = xchg(vxp, NULL);
++	if (!vxo)
++		return;
++
++	vxlprintk(VXD_CBIT(xid, 3), "clr_vx_info(%p[#%d.%d])",
++		vxo, vxo ? vxo->vx_id : 0,
++		vxo ? atomic_read(&vxo->vx_usecnt) : 0,
++		_file, _line);
++	__vxh_clr_vx_info(vxo, vxp, _here);
++
++	if (atomic_dec_and_test(&vxo->vx_usecnt))
++		free_vx_info(vxo);
++}
++
++
++#define claim_vx_info(v, p) \
++	__claim_vx_info(v, p, __FILE__, __LINE__, __HERE__)
++
++static inline void __claim_vx_info(struct vx_info *vxi,
++	struct task_struct *task,
++	const char *_file, int _line, void *_here)
++{
++	vxlprintk(VXD_CBIT(xid, 3), "claim_vx_info(%p[#%d.%d.%d]) %p",
++		vxi, vxi ? vxi->vx_id : 0,
++		vxi ? atomic_read(&vxi->vx_usecnt) : 0,
++		vxi ? atomic_read(&vxi->vx_tasks) : 0,
++		task, _file, _line);
++	__vxh_claim_vx_info(vxi, task, _here);
++
++	atomic_inc(&vxi->vx_tasks);
++}
++
++
++extern void unhash_vx_info(struct vx_info *);
++
++#define release_vx_info(v, p) \
++	__release_vx_info(v, p, __FILE__, __LINE__, __HERE__)
++
++static inline void __release_vx_info(struct vx_info *vxi,
++	struct task_struct *task,
++	const char *_file, int _line, void *_here)
++{
++	vxlprintk(VXD_CBIT(xid, 3), "release_vx_info(%p[#%d.%d.%d]) %p",
++		vxi, vxi ? vxi->vx_id : 0,
++		vxi ? atomic_read(&vxi->vx_usecnt) : 0,
++		vxi ? atomic_read(&vxi->vx_tasks) : 0,
++		task, _file, _line);
++	__vxh_release_vx_info(vxi, task, _here);
++
++	might_sleep();
++
++	if (atomic_dec_and_test(&vxi->vx_tasks))
++		unhash_vx_info(vxi);
++}
++
++
++#define task_get_vx_info(p) \
++	__task_get_vx_info(p, __FILE__, __LINE__, __HERE__)
++
++static inline struct vx_info *__task_get_vx_info(struct task_struct *p,
++	const char *_file, int _line, void *_here)
++{
++	struct vx_info *vxi;
++
++	task_lock(p);
++	vxlprintk(VXD_CBIT(xid, 5), "task_get_vx_info(%p)",
++		p, _file, _line);
++	vxi = __get_vx_info(p->vx_info, _file, _line, _here);
++	task_unlock(p);
++	return vxi;
++}
++
++
++static inline void __wakeup_vx_info(struct vx_info *vxi)
++{
++	if (waitqueue_active(&vxi->vx_wait))
++		wake_up_interruptible(&vxi->vx_wait);
++}
++
++
++#define enter_vx_info(v, s) __enter_vx_info(v, s, __FILE__, __LINE__)
++
++static inline void __enter_vx_info(struct vx_info *vxi,
++	struct vx_info_save *vxis, const char *_file, int _line)
++{
++	vxlprintk(VXD_CBIT(xid, 5), "enter_vx_info(%p[#%d],%p) %p[#%d,%p]",
++		vxi, vxi ? vxi->vx_id : 0, vxis, current,
++		current->xid, current->vx_info, _file, _line);
++	vxis->vxi = xchg(&current->vx_info, vxi);
++	vxis->xid = current->xid;
++	current->xid = vxi ? vxi->vx_id : 0;
++}
++
++#define leave_vx_info(s) __leave_vx_info(s, __FILE__, __LINE__)
++
++static inline void __leave_vx_info(struct vx_info_save *vxis,
++	const char *_file, int _line)
++{
++	vxlprintk(VXD_CBIT(xid, 5), "leave_vx_info(%p[#%d,%p]) %p[#%d,%p]",
++		vxis, vxis->xid, vxis->vxi, current,
++		current->xid, current->vx_info, _file, _line);
++	(void)xchg(&current->vx_info, vxis->vxi);
++	current->xid = vxis->xid;
++}
++
++
++static inline void __enter_vx_admin(struct vx_info_save *vxis)
++{
++	vxis->vxi = xchg(&current->vx_info, NULL);
++	vxis->xid = xchg(&current->xid, (xid_t)0);
++}
++
++static inline void __leave_vx_admin(struct vx_info_save *vxis)
++{
++	(void)xchg(&current->xid, vxis->xid);
++	(void)xchg(&current->vx_info, vxis->vxi);
++}
++
++extern void exit_vx_info(struct task_struct *, int);
++extern void exit_vx_info_early(struct task_struct *, int);
++
++
++#else
++#warning duplicate inclusion
++#endif
+--- linux-2.6.22/include/linux/vs_cowbl.h	1970-01-01 01:00:00 +0100
++++ linux-2.6.22-vs2.2.0-rc5/include/linux/vs_cowbl.h	2007-06-15 02:37:04 +0200
+@@ -0,0 +1,44 @@
++#ifndef _VS_COWBL_H
++#define _VS_COWBL_H
++
++#include <linux/fs.h>
++#include <linux/dcache.h>
++#include <linux/namei.h>
++
++extern struct dentry *cow_break_link(const char *pathname);
++
++static inline int cow_check_and_break(struct nameidata *nd)
++{
++	struct inode *inode = nd->dentry->d_inode;
++	int error = 0;
++	if (IS_RDONLY(inode) || MNT_IS_RDONLY(nd->mnt))
++		return -EROFS;
++	if (IS_COW(inode)) {
++		if (IS_COW_LINK(inode)) {
++			struct dentry *new_dentry, *old_dentry = nd->dentry;
++			char *path, *buf;
++
++			buf = kmalloc(PATH_MAX, GFP_KERNEL);
++			if (!buf) {
++				return -ENOMEM;
++			}
++			path = d_path(nd->dentry, nd->mnt, buf, PATH_MAX);
++			new_dentry = cow_break_link(path);
++			kfree(buf);
++			if (!IS_ERR(new_dentry)) {
++				nd->dentry = new_dentry;
++				dput(old_dentry);
++			} else
++				error = PTR_ERR(new_dentry);
++		} else {
++			inode->i_flags &= ~(S_IUNLINK | S_IMMUTABLE);
++			inode->i_ctime = CURRENT_TIME;
++			mark_inode_dirty(inode);
++		}
++	}
++	return error;
++}
++
++#else
++#warning duplicate inclusion
++#endif
+--- linux-2.6.22/include/linux/vs_cvirt.h	1970-01-01 01:00:00 +0100
++++ linux-2.6.22-vs2.2.0-rc5/include/linux/vs_cvirt.h	2007-06-15 02:37:04 +0200
+@@ -0,0 +1,49 @@
++#ifndef _VS_CVIRT_H
++#define _VS_CVIRT_H
++
++#include "vserver/cvirt.h"
++#include "vserver/context.h"
++#include "vserver/base.h"
++#include "vserver/debug.h"
++
++
++static inline void vx_activate_task(struct task_struct *p)
++{
++	struct vx_info *vxi;
++
++	if ((vxi = p->vx_info)) {
++		vx_update_load(vxi);
++		atomic_inc(&vxi->cvirt.nr_running);
++	}
++}
++
++static inline void vx_deactivate_task(struct task_struct *p)
++{
++	struct vx_info *vxi;
++
++	if ((vxi = p->vx_info)) {
++		vx_update_load(vxi);
++		atomic_dec(&vxi->cvirt.nr_running);
++	}
++}
++
++static inline void vx_uninterruptible_inc(struct task_struct *p)
++{
++	struct vx_info *vxi;
++
++	if ((vxi = p->vx_info))
++		atomic_inc(&vxi->cvirt.nr_uninterruptible);
++}
++
++static inline void vx_uninterruptible_dec(struct task_struct *p)
++{
++	struct vx_info *vxi;
++
++	if ((vxi = p->vx_info))
++		atomic_dec(&vxi->cvirt.nr_uninterruptible);
++}
++
++
++#else
++#warning duplicate inclusion
++#endif
+--- linux-2.6.22/include/linux/vs_dlimit.h	1970-01-01 01:00:00 +0100
++++ linux-2.6.22-vs2.2.0-rc5/include/linux/vs_dlimit.h	2007-06-15 02:37:04 +0200
+@@ -0,0 +1,209 @@
++#ifndef _VS_DLIMIT_H
++#define _VS_DLIMIT_H
++
++#include "vserver/dlimit.h"
++#include "vserver/base.h"
++#include "vserver/debug.h"
++
++
++#define get_dl_info(i)	__get_dl_info(i, __FILE__, __LINE__)
++
++static inline struct dl_info *__get_dl_info(struct dl_info *dli,
++	const char *_file, int _line)
++{
++	if (!dli)
++		return NULL;
++	vxlprintk(VXD_CBIT(dlim, 4), "get_dl_info(%p[#%d.%d])",
++		dli, dli ? dli->dl_tag : 0,
++		dli ? atomic_read(&dli->dl_usecnt) : 0,
++		_file, _line);
++	atomic_inc(&dli->dl_usecnt);
++	return dli;
++}
++
++
++#define free_dl_info(i) \
++	call_rcu(&(i)->dl_rcu, rcu_free_dl_info)
++
++#define put_dl_info(i)	__put_dl_info(i, __FILE__, __LINE__)
++
++static inline void __put_dl_info(struct dl_info *dli,
++	const char *_file, int _line)
++{
++	if (!dli)
++		return;
++	vxlprintk(VXD_CBIT(dlim, 4), "put_dl_info(%p[#%d.%d])",
++		dli, dli ? dli->dl_tag : 0,
++		dli ? atomic_read(&dli->dl_usecnt) : 0,
++		_file, _line);
++	if (atomic_dec_and_test(&dli->dl_usecnt))
++		free_dl_info(dli);
++}
++
++
++#define __dlimit_char(d)	((d) ? '*' : ' ')
++
++static inline int __dl_alloc_space(struct super_block *sb,
++	tag_t tag, dlsize_t nr, const char *file, int line)
++{
++	struct dl_info *dli = NULL;
++	int ret = 0;
++
++	if (nr == 0)
++		goto out;
++	dli = locate_dl_info(sb, tag);
++	if (!dli)
++		goto out;
++
++	spin_lock(&dli->dl_lock);
++	ret = (dli->dl_space_used + nr > dli->dl_space_total);
++	if (!ret)
++		dli->dl_space_used += nr;
++	spin_unlock(&dli->dl_lock);
++	put_dl_info(dli);
++out:
++	vxlprintk(VXD_CBIT(dlim, 1),
++		"ALLOC (%p,#%d)%c %lld bytes (%d)",
++		sb, tag, __dlimit_char(dli), (long long)nr,
++		ret, file, line);
++	return ret;
++}
++
++static inline void __dl_free_space(struct super_block *sb,
++	tag_t tag, dlsize_t nr, const char *_file, int _line)
++{
++	struct dl_info *dli = NULL;
++
++	if (nr == 0)
++		goto out;
++	dli = locate_dl_info(sb, tag);
++	if (!dli)
++		goto out;
++
++	spin_lock(&dli->dl_lock);
++	if (dli->dl_space_used > nr)
++		dli->dl_space_used -= nr;
++	else
++		dli->dl_space_used = 0;
++	spin_unlock(&dli->dl_lock);
++	put_dl_info(dli);
++out:
++	vxlprintk(VXD_CBIT(dlim, 1),
++		"FREE  (%p,#%d)%c %lld bytes",
++		sb, tag, __dlimit_char(dli), (long long)nr,
++		_file, _line);
++}
++
++static inline int __dl_alloc_inode(struct super_block *sb,
++	tag_t tag, const char *_file, int _line)
++{
++	struct dl_info *dli;
++	int ret = 0;
++
++	dli = locate_dl_info(sb, tag);
++	if (!dli)
++		goto out;
++
++	spin_lock(&dli->dl_lock);
++	ret = (dli->dl_inodes_used >= dli->dl_inodes_total);
++	if (!ret)
++		dli->dl_inodes_used++;
++	spin_unlock(&dli->dl_lock);
++	put_dl_info(dli);
++out:
++	vxlprintk(VXD_CBIT(dlim, 0),
++		"ALLOC (%p,#%d)%c inode (%d)",
++		sb, tag, __dlimit_char(dli), ret, _file, _line);
++	return ret;
++}
++
++static inline void __dl_free_inode(struct super_block *sb,
++	tag_t tag, const char *_file, int _line)
++{
++	struct dl_info *dli;
++
++	dli = locate_dl_info(sb, tag);
++	if (!dli)
++		goto out;
++
++	spin_lock(&dli->dl_lock);
++	if (dli->dl_inodes_used > 1)
++		dli->dl_inodes_used--;
++	else
++		dli->dl_inodes_used = 0;
++	spin_unlock(&dli->dl_lock);
++	put_dl_info(dli);
++out:
++	vxlprintk(VXD_CBIT(dlim, 0),
++		"FREE  (%p,#%d)%c inode",
++		sb, tag, __dlimit_char(dli), _file, _line);
++}
++
++static inline void __dl_adjust_block(struct super_block *sb, tag_t tag,
++	unsigned long long *free_blocks, unsigned long long *root_blocks,
++	const char *_file, int _line)
++{
++	struct dl_info *dli;
++	uint64_t broot, bfree;
++
++	dli = locate_dl_info(sb, tag);
++	if (!dli)
++		return;
++
++	spin_lock(&dli->dl_lock);
++	broot = (dli->dl_space_total -
++		(dli->dl_space_total >> 10) * dli->dl_nrlmult)
++		>> sb->s_blocksize_bits;
++	bfree = (dli->dl_space_total - dli->dl_space_used)
++			>> sb->s_blocksize_bits;
++	spin_unlock(&dli->dl_lock);
++
++	vxlprintk(VXD_CBIT(dlim, 2),
++		"ADJUST: %lld,%lld on %lld,%lld [mult=%d]",
++		(long long)bfree, (long long)broot,
++		*free_blocks, *root_blocks, dli->dl_nrlmult,
++		_file, _line);
++	if (free_blocks) {
++		if (*free_blocks > bfree)
++			*free_blocks = bfree;
++	}
++	if (root_blocks) {
++		if (*root_blocks > broot)
++			*root_blocks = broot;
++	}
++	put_dl_info(dli);
++}
++
++#define DLIMIT_ALLOC_SPACE(in, bytes) \
++	__dl_alloc_space((in)->i_sb, (in)->i_tag, (dlsize_t)(bytes), \
++		__FILE__, __LINE__ )
++
++#define DLIMIT_FREE_SPACE(in, bytes) \
++	__dl_free_space((in)->i_sb, (in)->i_tag, (dlsize_t)(bytes), \
++		__FILE__, __LINE__ )
++
++#define DLIMIT_ALLOC_BLOCK(in, nr) \
++	__dl_alloc_space((in)->i_sb, (in)->i_tag, \
++		((dlsize_t)(nr)) << (in)->i_sb->s_blocksize_bits, \
++		__FILE__, __LINE__ )
++
++#define DLIMIT_FREE_BLOCK(in, nr) \
++	__dl_free_space((in)->i_sb, (in)->i_tag, \
++		((dlsize_t)(nr)) << (in)->i_sb->s_blocksize_bits, \
++		__FILE__, __LINE__ )
++
++
++#define DLIMIT_ALLOC_INODE(in) \
++	__dl_alloc_inode((in)->i_sb, (in)->i_tag, __FILE__, __LINE__ )
++
++#define DLIMIT_FREE_INODE(in) \
++	__dl_free_inode((in)->i_sb, (in)->i_tag, __FILE__, __LINE__ )
++
++
++#define DLIMIT_ADJUST_BLOCK(sb, tag, fb, rb) \
++	__dl_adjust_block(sb, tag, fb, rb, __FILE__, __LINE__ )
++
++
++#else
++#warning duplicate inclusion
++#endif
+--- linux-2.6.22/include/linux/vs_limit.h	1970-01-01 01:00:00 +0100
++++ linux-2.6.22-vs2.2.0-rc5/include/linux/vs_limit.h	2007-06-15 02:37:04 +0200
+@@ -0,0 +1,140 @@
++#ifndef _VS_LIMIT_H
++#define _VS_LIMIT_H
++
++#include "vserver/limit.h"
++#include "vserver/base.h"
++#include "vserver/context.h"
++#include "vserver/debug.h"
++#include "vserver/context.h"
++#include "vserver/limit_int.h"
++
++
++#define vx_acc_cres(v, d, p, r) \
++	__vx_acc_cres(v, r, d, p, __FILE__, __LINE__)
++
++#define vx_acc_cres_cond(x, d, p, r) \
++	__vx_acc_cres(((x) == vx_current_xid()) ? current->vx_info : 0, \
++	r, d, p, __FILE__, __LINE__)
++
++
++#define vx_add_cres(v, a, p, r) \
++	__vx_add_cres(v, r, a, p, __FILE__, __LINE__)
++#define vx_sub_cres(v, a, p, r)		vx_add_cres(v, -(a), p, r)
++
++#define vx_add_cres_cond(x, a, p, r) \
++	__vx_add_cres(((x) == vx_current_xid()) ? current->vx_info : 0, \
++	r, a, p, __FILE__, __LINE__)
++#define vx_sub_cres_cond(x, a, p, r)	vx_add_cres_cond(x, -(a), p, r)
++
++
++/* process and file limits */
++
++#define vx_nproc_inc(p) \
++	vx_acc_cres((p)->vx_info, 1, p, RLIMIT_NPROC)
++
++#define vx_nproc_dec(p) \
++	vx_acc_cres((p)->vx_info,-1, p, RLIMIT_NPROC)
++
++#define vx_files_inc(f) \
++	vx_acc_cres_cond((f)->f_xid, 1, f, RLIMIT_NOFILE)
++
++#define vx_files_dec(f) \
++	vx_acc_cres_cond((f)->f_xid,-1, f, RLIMIT_NOFILE)
++
++#define vx_locks_inc(l) \
++	vx_acc_cres_cond((l)->fl_xid, 1, l, RLIMIT_LOCKS)
++
++#define vx_locks_dec(l) \
++	vx_acc_cres_cond((l)->fl_xid,-1, l, RLIMIT_LOCKS)
++
++#define vx_openfd_inc(f) \
++	vx_acc_cres(current->vx_info, 1, (void *)(long)(f), VLIMIT_OPENFD)
++
++#define vx_openfd_dec(f) \
++	vx_acc_cres(current->vx_info,-1, (void *)(long)(f), VLIMIT_OPENFD)
++
++
++#define vx_cres_avail(v, n, r) \
++	__vx_cres_avail(v, r, n, __FILE__, __LINE__)
++
++
++#define vx_nproc_avail(n) \
++	vx_cres_avail(current->vx_info, n, RLIMIT_NPROC)
++
++#define vx_files_avail(n) \
++	vx_cres_avail(current->vx_info, n, RLIMIT_NOFILE)
++
++#define vx_locks_avail(n) \
++	vx_cres_avail(current->vx_info, n, RLIMIT_LOCKS)
++
++#define vx_openfd_avail(n) \
++	vx_cres_avail(current->vx_info, n, VLIMIT_OPENFD)
++
++
++/* dentry limits */
++
++#define vx_dentry_inc(d) do {						\
++	if (atomic_read(&d->d_count) == 1)				\
++		vx_acc_cres(current->vx_info, 1, d, VLIMIT_DENTRY);	\
++	} while (0)
++
++#define vx_dentry_dec(d) do {						\
++	if (atomic_read(&d->d_count) == 0)				\
++		vx_acc_cres(current->vx_info,-1, d, VLIMIT_DENTRY);	\
++	} while (0)
++
++#define vx_dentry_avail(n) \
++	vx_cres_avail(current->vx_info, n, VLIMIT_DENTRY)
++
++
++/* socket limits */
++
++#define vx_sock_inc(s) \
++	vx_acc_cres((s)->sk_vx_info, 1, s, VLIMIT_NSOCK)
++
++#define vx_sock_dec(s) \
++	vx_acc_cres((s)->sk_vx_info,-1, s, VLIMIT_NSOCK)
++
++#define vx_sock_avail(n) \
++	vx_cres_avail(current->vx_info, n, VLIMIT_NSOCK)
++
++
++/* ipc resource limits */
++
++#define vx_ipcmsg_add(v, u, a) \
++	vx_add_cres(v, a, u, RLIMIT_MSGQUEUE)
++
++#define vx_ipcmsg_sub(v, u, a) \
++	vx_sub_cres(v, a, u, RLIMIT_MSGQUEUE)
++
++#define vx_ipcmsg_avail(v, a) \
++	vx_cres_avail(v, a, RLIMIT_MSGQUEUE)
++
++
++#define vx_ipcshm_add(v, k, a) \
++	vx_add_cres(v, a, (void *)(long)(k), VLIMIT_SHMEM)
++
++#define vx_ipcshm_sub(v, k, a) \
++	vx_sub_cres(v, a, (void *)(long)(k), VLIMIT_SHMEM)
++
++#define vx_ipcshm_avail(v, a) \
++	vx_cres_avail(v, a, VLIMIT_SHMEM)
++
++
++#define vx_semary_inc(a) \
++	vx_acc_cres(current->vx_info, 1, a, VLIMIT_SEMARY)
++
++#define vx_semary_dec(a) \
++	vx_acc_cres(current->vx_info, -1, a, VLIMIT_SEMARY)
++
++
++#define vx_nsems_add(a,n) \
++	vx_add_cres(current->vx_info, n, a, VLIMIT_NSEMS)
++
++#define vx_nsems_sub(a,n) \
++	vx_sub_cres(current->vx_info, n, a, VLIMIT_NSEMS)
++
++
++#else
++#warning duplicate inclusion
++#endif
+--- linux-2.6.22/include/linux/vs_memory.h	1970-01-01 01:00:00 +0100
++++ linux-2.6.22-vs2.2.0-rc5/include/linux/vs_memory.h	2007-06-15 02:37:04 +0200
+@@ -0,0 +1,159 @@
++#ifndef _VS_MEMORY_H
++#define _VS_MEMORY_H
++
++#include "vserver/limit.h"
++#include "vserver/base.h"
++#include "vserver/context.h"
++#include "vserver/debug.h"
++#include "vserver/context.h"
++#include "vserver/limit_int.h"
++
++
++#define __acc_add_long(a, v)	(*(v) += (a))
++#define __acc_inc_long(v)	(++*(v))
++#define __acc_dec_long(v)	(--*(v))
++
++#if	NR_CPUS >= CONFIG_SPLIT_PTLOCK_CPUS
++#define __acc_add_atomic(a, v)	atomic_long_add(a, v)
++#define __acc_inc_atomic(v)	atomic_long_inc(v)
++#define __acc_dec_atomic(v)	atomic_long_dec(v)
++#else  /* NR_CPUS < CONFIG_SPLIT_PTLOCK_CPUS */
++#define __acc_add_atomic(a, v)	__acc_add_long(a, v)
++#define __acc_inc_atomic(v)	__acc_inc_long(v)
++#define __acc_dec_atomic(v)	__acc_dec_long(v)
++#endif /* NR_CPUS < CONFIG_SPLIT_PTLOCK_CPUS */
++
++
++#define vx_acc_page(m, d, v, r) do {					\
++	if ((d) > 0)							\
++		__acc_inc_long(&(m)->v);				\
++	else								\
++		__acc_dec_long(&(m)->v);				\
++	__vx_acc_cres(m->mm_vx_info, r, d, m, __FILE__, __LINE__);	\
++} while (0)
++
++#define vx_acc_page_atomic(m, d, v, r) do {				\
++	if ((d) > 0)							\
++		__acc_inc_atomic(&(m)->v);				\
++	else								\
++		__acc_dec_atomic(&(m)->v);				\
++	__vx_acc_cres(m->mm_vx_info, r, d, m, __FILE__, __LINE__);	\
++} while (0)
++
++
++#define vx_acc_pages(m, p, v, r) do {					\
++	unsigned long __p = (p);					\
++	__acc_add_long(__p, &(m)->v);					\
++	__vx_add_cres(m->mm_vx_info, r, __p, m, __FILE__, __LINE__);	\
++} while (0)
++
++#define vx_acc_pages_atomic(m, p, v, r) do {				\
++	unsigned long __p = (p);					\
++	__acc_add_atomic(__p, &(m)->v);					\
++	__vx_add_cres(m->mm_vx_info, r, __p, m, __FILE__, __LINE__);	\
++} while (0)
++
++
++
++#define vx_acc_vmpage(m, d) \
++	vx_acc_page(m, d, total_vm,  RLIMIT_AS)
++#define vx_acc_vmlpage(m, d) \
++	vx_acc_page(m, d, locked_vm, RLIMIT_MEMLOCK)
++#define vx_acc_file_rsspage(m, d) \
++	vx_acc_page_atomic(m, d, _file_rss, VLIMIT_MAPPED)
++#define vx_acc_anon_rsspage(m, d) \
++	vx_acc_page_atomic(m, d, _anon_rss, VLIMIT_ANON)
++
++#define vx_acc_vmpages(m, p) \
++	vx_acc_pages(m, p, total_vm,  RLIMIT_AS)
++#define vx_acc_vmlpages(m, p) \
++	vx_acc_pages(m, p, locked_vm, RLIMIT_MEMLOCK)
++#define vx_acc_file_rsspages(m, p) \
++	vx_acc_pages_atomic(m, p, _file_rss, VLIMIT_MAPPED)
++#define vx_acc_anon_rsspages(m, p) \
++	vx_acc_pages_atomic(m, p, _anon_rss, VLIMIT_ANON)
++
++#define vx_pages_add(s, r, p)	__vx_add_cres(s, r, p, 0, __FILE__, __LINE__)
++#define vx_pages_sub(s, r, p)	vx_pages_add(s, r, -(p))
++
++#define vx_vmpages_inc(m)		vx_acc_vmpage(m, 1)
++#define vx_vmpages_dec(m)		vx_acc_vmpage(m, -1)
++#define vx_vmpages_add(m, p)		vx_acc_vmpages(m, p)
++#define vx_vmpages_sub(m, p)		vx_acc_vmpages(m, -(p))
++
++#define vx_vmlocked_inc(m)		vx_acc_vmlpage(m, 1)
++#define vx_vmlocked_dec(m)		vx_acc_vmlpage(m, -1)
++#define vx_vmlocked_add(m, p)		vx_acc_vmlpages(m, p)
++#define vx_vmlocked_sub(m, p)		vx_acc_vmlpages(m, -(p))
++
++#define vx_file_rsspages_inc(m)		vx_acc_file_rsspage(m, 1)
++#define vx_file_rsspages_dec(m)		vx_acc_file_rsspage(m, -1)
++#define vx_file_rsspages_add(m, p)	vx_acc_file_rsspages(m, p)
++#define vx_file_rsspages_sub(m, p)	vx_acc_file_rsspages(m, -(p))
++
++#define vx_anon_rsspages_inc(m)		vx_acc_anon_rsspage(m, 1)
++#define vx_anon_rsspages_dec(m)		vx_acc_anon_rsspage(m, -1)
++#define vx_anon_rsspages_add(m, p)	vx_acc_anon_rsspages(m, p)
++#define vx_anon_rsspages_sub(m, p)	vx_acc_anon_rsspages(m, -(p))
++
++
++#define vx_pages_avail(m, p, r) \
++	__vx_cres_avail((m)->mm_vx_info, r, p, __FILE__, __LINE__)
++
++#define vx_vmpages_avail(m, p)	vx_pages_avail(m, p, RLIMIT_AS)
++#define vx_vmlocked_avail(m, p)	vx_pages_avail(m, p, RLIMIT_MEMLOCK)
++#define vx_anon_avail(m, p)	vx_pages_avail(m, p, VLIMIT_ANON)
++#define vx_mapped_avail(m, p)	vx_pages_avail(m, p, VLIMIT_MAPPED)
++
++#define vx_rss_avail(m, p) \
++	__vx_cres_array_avail((m)->mm_vx_info, VLA_RSS, p, __FILE__, __LINE__)
++
++
++enum {
++	VXPT_UNKNOWN = 0,
++	VXPT_ANON,
++	VXPT_NONE,
++	VXPT_FILE,
++	VXPT_SWAP,
++	VXPT_WRITE
++};
++
++#if 0
++#define	vx_page_fault(mm, vma, type, ret)
++#else
++
++static inline
++void __vx_page_fault(struct mm_struct *mm,
++	struct vm_area_struct *vma, int type, int ret)
++{
++	struct vx_info *vxi = mm->mm_vx_info;
++	int what;
++/*
++	static char *page_type[6] =
++		{ "UNKNOWN", "ANON", "NONE", "FILE", "SWAP", "WRITE" };
++	static char *page_what[4] =
++		{ "FAULT_OOM", "FAULT_SIGBUS", "FAULT_MINOR", "FAULT_MAJOR" };
++*/
++
++	if (!vxi)
++		return;
++
++	what = (ret & 0x3);
++
++/*	printk("[%d] page[%d][%d] %2x %s %s\n", vxi->vx_id,
++		type, what, ret, page_type[type], page_what[what]);
++*/
++	if (ret & VM_FAULT_WRITE)
++		what |= 0x4;
++	atomic_inc(&vxi->cacct.page[type][what]);
++}
++
++#define	vx_page_fault(mm, vma, type, ret)	__vx_page_fault(mm, vma, type, ret)
++#endif
++
++
++extern unsigned long vx_badness(struct task_struct *task, struct mm_struct *mm);
++
++#else
++#warning duplicate inclusion
++#endif
+--- linux-2.6.22/include/linux/vs_network.h	1970-01-01 01:00:00 +0100
++++ linux-2.6.22-vs2.2.0-rc5/include/linux/vs_network.h	2007-06-15 02:37:04 +0200
+@@ -0,0 +1,185 @@
++#ifndef _NX_VS_NETWORK_H
++#define _NX_VS_NETWORK_H
++
++#include "vserver/context.h"
++#include "vserver/network.h"
++#include "vserver/base.h"
++#include "vserver/debug.h"
++
++
++#define get_nx_info(i) __get_nx_info(i, __FILE__, __LINE__)
++
++static inline struct nx_info *__get_nx_info(struct nx_info *nxi,
++	const char *_file, int _line)
++{
++	if (!nxi)
++		return NULL;
++
++	vxlprintk(VXD_CBIT(nid, 2), "get_nx_info(%p[#%d.%d])",
++		nxi, nxi ? nxi->nx_id : 0,
++		nxi ? atomic_read(&nxi->nx_usecnt) : 0,
++		_file, _line);
++
++	atomic_inc(&nxi->nx_usecnt);
++	return nxi;
++}
++
++
++extern void free_nx_info(struct nx_info *);
++
++#define put_nx_info(i) __put_nx_info(i, __FILE__, __LINE__)
++
++static inline void __put_nx_info(struct nx_info *nxi, const char *_file, int _line)
++{
++	if (!nxi)
++		return;
++
++	vxlprintk(VXD_CBIT(nid, 2), "put_nx_info(%p[#%d.%d])",
++		nxi, nxi ? nxi->nx_id : 0,
++		nxi ? atomic_read(&nxi->nx_usecnt) : 0,
++		_file, _line);
++
++	if (atomic_dec_and_test(&nxi->nx_usecnt))
++		free_nx_info(nxi);
++}
++
++
++#define init_nx_info(p, i) __init_nx_info(p, i, __FILE__, __LINE__)
++
++static inline void __init_nx_info(struct nx_info **nxp, struct nx_info *nxi,
++		const char *_file, int _line)
++{
++	if (nxi) {
++		vxlprintk(VXD_CBIT(nid, 3),
++			"init_nx_info(%p[#%d.%d])",
++			nxi, nxi ? nxi->nx_id : 0,
++			nxi ? atomic_read(&nxi->nx_usecnt) : 0,
++			_file, _line);
++
++		atomic_inc(&nxi->nx_usecnt);
++	}
++	*nxp = nxi;
++}
++
++
++#define set_nx_info(p, i) __set_nx_info(p, i, __FILE__, __LINE__)
++
++static inline void __set_nx_info(struct nx_info **nxp, struct nx_info *nxi,
++	const char *_file, int _line)
++{
++	struct nx_info *nxo;
++
++	if (!nxi)
++		return;
++
++	vxlprintk(VXD_CBIT(nid, 3), "set_nx_info(%p[#%d.%d])",
++		nxi, nxi ? nxi->nx_id : 0,
++		nxi ? atomic_read(&nxi->nx_usecnt) : 0,
++		_file, _line);
++
++	atomic_inc(&nxi->nx_usecnt);
++	nxo = xchg(nxp, nxi);
++	BUG_ON(nxo);
++}
++
++#define clr_nx_info(p) __clr_nx_info(p, __FILE__, __LINE__)
++
++static inline void __clr_nx_info(struct nx_info **nxp,
++	const char *_file, int _line)
++{
++	struct nx_info *nxo;
++
++	nxo = xchg(nxp, NULL);
++	if (!nxo)
++		return;
++
++	vxlprintk(VXD_CBIT(nid, 3), "clr_nx_info(%p[#%d.%d])",
++		nxo, nxo ? nxo->nx_id : 0,
++		nxo ? atomic_read(&nxo->nx_usecnt) : 0,
++		_file, _line);
++
++	if (atomic_dec_and_test(&nxo->nx_usecnt))
++		free_nx_info(nxo);
++}
++
++
++#define claim_nx_info(v, p) __claim_nx_info(v, p, __FILE__, __LINE__)
++
++static inline void __claim_nx_info(struct nx_info *nxi,
++	struct task_struct *task, const char *_file, int _line)
++{
++	vxlprintk(VXD_CBIT(nid, 3), "claim_nx_info(%p[#%d.%d.%d]) %p",
++		nxi, nxi ? nxi->nx_id : 0,
++		nxi?atomic_read(&nxi->nx_usecnt):0,
++		nxi?atomic_read(&nxi->nx_tasks):0,
++		task, _file, _line);
++
++	atomic_inc(&nxi->nx_tasks);
++}
++
++
++extern void unhash_nx_info(struct nx_info *);
++
++#define release_nx_info(v, p) __release_nx_info(v, p, __FILE__, __LINE__)
++
++static inline void __release_nx_info(struct nx_info *nxi,
++	struct task_struct *task, const char *_file, int _line)
++{
++	vxlprintk(VXD_CBIT(nid, 3), "release_nx_info(%p[#%d.%d.%d]) %p",
++		nxi, nxi ? nxi->nx_id : 0,
++		nxi ? atomic_read(&nxi->nx_usecnt) : 0,
++		nxi ? atomic_read(&nxi->nx_tasks) : 0,
++		task, _file, _line);
++
++	might_sleep();
++
++	if (atomic_dec_and_test(&nxi->nx_tasks))
++		unhash_nx_info(nxi);
++}
++
++
++#define task_get_nx_info(i)	__task_get_nx_info(i, __FILE__, __LINE__)
++
++static __inline__ struct nx_info *__task_get_nx_info(struct task_struct *p,
++	const char *_file, int _line)
++{
++	struct nx_info *nxi;
++
++	task_lock(p);
++	vxlprintk(VXD_CBIT(nid, 5), "task_get_nx_info(%p)",
++		p, _file, _line);
++	nxi = __get_nx_info(p->nx_info, _file, _line);
++	task_unlock(p);
++	return nxi;
++}
++
++
++
++
++static inline int addr_in_nx_info(struct nx_info *nxi, uint32_t addr)
++{
++	int n, i;
++
++	if (!nxi)
++		return 1;
++
++	n = nxi->nbipv4;
++	if (n && (nxi->ipv4[0] == 0))
++		return 1;
++	for (i = 0; i < n; i++) {
++		if (nxi->ipv4[i] == addr)
++			return 1;
++	}
++	return 0;
++}
++
++static inline void exit_nx_info(struct task_struct *p)
++{
++	if (p->nx_info)
++		release_nx_info(p->nx_info, p);
++}
++
++
++#else
++#warning duplicate inclusion
++#endif
+--- linux-2.6.22/include/linux/vs_pid.h	1970-01-01 01:00:00 +0100
++++ linux-2.6.22-vs2.2.0-rc5/include/linux/vs_pid.h	2007-06-15 02:37:04 +0200
+@@ -0,0 +1,133 @@
++#ifndef _VS_PID_H
++#define _VS_PID_H
++
++#include "vserver/base.h"
++#include "vserver/context.h"
++#include "vserver/debug.h"
++#include <linux/pid_namespace.h>
++
++
++/* pid faking stuff */
++
++
++#define vx_info_map_pid(v, p) \
++	__vx_info_map_pid((v), (p), __FUNC__, __FILE__, __LINE__)
++#define vx_info_map_tgid(v,p)  vx_info_map_pid(v,p)
++#define vx_map_pid(p) vx_info_map_pid(current->vx_info, p)
++#define vx_map_tgid(p) vx_map_pid(p)
++
++static inline int __vx_info_map_pid(struct vx_info *vxi, int pid,
++	const char *func, const char *file, int line)
++{
++	if (vx_info_flags(vxi, VXF_INFO_INIT, 0)) {
++		vxfprintk(VXD_CBIT(cvirt, 2),
++			"vx_map_tgid: %p/%llx: %d -> %d",
++			vxi, (long long)vxi->vx_flags, pid,
++			(pid && pid == vxi->vx_initpid) ? 1 : pid,
++			func, file, line);
++		if (pid == 0)
++			return 0;
++		if (pid == vxi->vx_initpid)
++			return 1;
++	}
++	return pid;
++}
++
++#define vx_info_rmap_pid(v, p) \
++	__vx_info_rmap_pid((v), (p), __FUNC__, __FILE__, __LINE__)
++#define vx_rmap_pid(p) vx_info_rmap_pid(current->vx_info, p)
++#define vx_rmap_tgid(p) vx_rmap_pid(p)
++
++static inline int __vx_info_rmap_pid(struct vx_info *vxi, int pid,
++	const char *func, const char *file, int line)
++{
++	if (vx_info_flags(vxi, VXF_INFO_INIT, 0)) {
++		vxfprintk(VXD_CBIT(cvirt, 2),
++			"vx_rmap_tgid: %p/%llx: %d -> %d",
++			vxi, (long long)vxi->vx_flags, pid,
++			(pid == 1) ? vxi->vx_initpid : pid,
++			func, file, line);
++		if ((pid == 1) && vxi->vx_initpid)
++			return vxi->vx_initpid;
++		if (pid == vxi->vx_initpid)
++			return ~0U;
++	}
++	return pid;
++}
++
++
++#define VXF_FAKE_INIT	(VXF_INFO_INIT | VXF_STATE_INIT)
++
++static inline
++int vx_proc_task_visible(struct task_struct *task)
++{
++	if ((task->pid == 1) &&
++		!vx_flags(VXF_FAKE_INIT, VXF_FAKE_INIT))
++		/* show a blend through init */
++		goto visible;
++	if (vx_check(vx_task_xid(task), VS_WATCH | VS_IDENT))
++		goto visible;
++	return 0;
++visible:
++	return 1;
++}
++
++static inline
++struct task_struct *vx_find_proc_task_by_pid(int pid)
++{
++	struct task_struct *task = find_task_by_real_pid(pid);
++
++	if (task && !vx_proc_task_visible(task)) {
++		vxdprintk(VXD_CBIT(misc, 6),
++			"dropping task (find) %p[#%u,%u] for %p[#%u,%u]",
++			task, task->xid, task->pid,
++			current, current->xid, current->pid);
++		task = NULL;
++	}
++	return task;
++}
++
++static inline
++struct task_struct *vx_get_proc_task(struct inode *inode, struct pid *pid)
++{
++	struct task_struct *task = get_pid_task(pid, PIDTYPE_PID);
++
++	if (task && !vx_proc_task_visible(task)) {
++		vxdprintk(VXD_CBIT(misc, 6),
++			"dropping task (get) %p[#%u,%u] for %p[#%u,%u]",
++			task, task->xid, task->pid,
++			current, current->xid, current->pid);
++		put_task_struct(task);
++		task = NULL;
++	}
++	return task;
++}
++
++
++static inline
++struct task_struct *vx_child_reaper(struct task_struct *p)
++{
++	struct vx_info *vxi = p->vx_info;
++	struct task_struct *reaper = child_reaper(p);
++
++	if (!vxi)
++		goto out;
++
++	BUG_ON(!p->vx_info->vx_reaper);
++
++	/* child reaper for the guest reaper */
++	if (vxi->vx_reaper == p)
++		goto out;
++
++	reaper = vxi->vx_reaper;
++out:
++	vxdprintk(VXD_CBIT(xid, 7),
++		"vx_child_reaper(%p[#%u,%u]) = %p[#%u,%u]",
++		p, p->xid, p->pid, reaper, reaper->xid, reaper->pid);
++	return reaper;
++}
++
++
++#else
++#warning duplicate inclusion
++#endif
+--- linux-2.6.22/include/linux/vs_sched.h	1970-01-01 01:00:00 +0100
++++ linux-2.6.22-vs2.2.0-rc5/include/linux/vs_sched.h	2007-06-15 02:37:04 +0200
+@@ -0,0 +1,110 @@
++#ifndef _VS_SCHED_H
++#define _VS_SCHED_H
++
++#include "vserver/base.h"
++#include "vserver/context.h"
++#include "vserver/sched.h"
++
++
++#define VAVAVOOM_RATIO		 50
++
++#define MAX_PRIO_BIAS		 20
++#define MIN_PRIO_BIAS		-20
++
++
++#ifdef CONFIG_VSERVER_HARDCPU
++
++/*
++ * effective_prio - return the priority that is based on the static
++ * priority but is modified by bonuses/penalties.
++ *
++ * We scale the actual sleep average [0 .... MAX_SLEEP_AVG]
++ * into a -4 ... 0 ... +4 bonus/penalty range.
++ *
++ * Additionally, we scale another amount based on the number of
++ * CPU tokens currently held by the context, if the process is
++ * part of a context (and the appropriate SCHED flag is set).
++ * This ranges from -5 ... 0 ... +15, quadratically.
++ *
++ * So, the total bonus is -9 .. 0 .. +19
++ * We use ~50% of the full 0...39 priority range so that:
++ *
++ * 1) nice +19 interactive tasks do not preempt nice 0 CPU hogs.
++ * 2) nice -20 CPU hogs do not get preempted by nice 0 tasks.
++ *    unless that context is far exceeding its CPU allocation.
++ *
++ * Both properties are important to certain workloads.
++ */
++static inline
++int vx_effective_vavavoom(struct _vx_sched_pc *sched_pc, int max_prio)
++{
++	int vavavoom, max;
++
++	/* lots of tokens = lots of vavavoom
++	 *      no tokens = no vavavoom      */
++	if ((vavavoom = sched_pc->tokens) >= 0) {
++		max = sched_pc->tokens_max;
++		vavavoom = max - vavavoom;
++		max = max * max;
++		vavavoom = max_prio * VAVAVOOM_RATIO / 100
++			* (vavavoom*vavavoom - (max >> 2)) / max;
++		return vavavoom;
++	}
++	return 0;
++}
++
++
++static inline
++int vx_adjust_prio(struct task_struct *p, int prio, int max_user)
++{
++	struct vx_info *vxi = p->vx_info;
++	struct _vx_sched_pc *sched_pc;
++
++	if (!vxi)
++		return prio;
++
++	sched_pc = &vx_cpu(vxi, sched_pc);
++	if (vx_info_flags(vxi, VXF_SCHED_PRIO, 0)) {
++		int vavavoom = vx_effective_vavavoom(sched_pc, max_user);
++
++		sched_pc->vavavoom = vavavoom;
++		prio += vavavoom;
++	}
++	prio += sched_pc->prio_bias;
++	return prio;
++}
++
++#else /* !CONFIG_VSERVER_HARDCPU */
++
++static inline
++int vx_adjust_prio(struct task_struct *p, int prio, int max_user)
++{
++	struct vx_info *vxi = p->vx_info;
++
++	if (vxi)
++		prio += vx_cpu(vxi, sched_pc).prio_bias;
++	return prio;
++}
++
++#endif /* CONFIG_VSERVER_HARDCPU */
++
++
++static inline void vx_account_user(struct vx_info *vxi,
++	cputime_t cputime, int nice)
++{
++	if (!vxi)
++		return;
++	vx_cpu(vxi, sched_pc).user_ticks += cputime;
++}
++
++static inline void vx_account_system(struct vx_info *vxi,
++	cputime_t cputime, int idle)
++{
++	if (!vxi)
++		return;
++	vx_cpu(vxi, sched_pc).sys_ticks += cputime;
++}
++
++#else
++#warning duplicate inclusion
++#endif
+--- linux-2.6.22/include/linux/vs_socket.h	1970-01-01 01:00:00 +0100
++++ linux-2.6.22-vs2.2.0-rc5/include/linux/vs_socket.h	2007-06-15 02:37:04 +0200
+@@ -0,0 +1,67 @@
++#ifndef _VS_SOCKET_H
++#define _VS_SOCKET_H
++
++#include "vserver/debug.h"
++#include "vserver/base.h"
++#include "vserver/cacct.h"
++#include "vserver/context.h"
++
++
++/* socket accounting */
++
++#include <linux/socket.h>
++
++static inline int vx_sock_type(int family)
++{
++	switch (family) {
++	case PF_UNSPEC:
++		return VXA_SOCK_UNSPEC;
++	case PF_UNIX:
++		return VXA_SOCK_UNIX;
++	case PF_INET:
++		return VXA_SOCK_INET;
++	case PF_INET6:
++		return VXA_SOCK_INET6;
++	case PF_PACKET:
++		return VXA_SOCK_PACKET;
++	default:
++		return VXA_SOCK_OTHER;
++	}
++}
++
++#define vx_acc_sock(v, f, p, s) \
++	__vx_acc_sock(v, f, p, s, __FILE__, __LINE__)
++
++static inline void __vx_acc_sock(struct vx_info *vxi,
++	int family, int pos, int size, char *file, int line)
++{
++	if (vxi) {
++		int type = vx_sock_type(family);
++
++		atomic_long_inc(&vxi->cacct.sock[type][pos].count);
++		atomic_long_add(size, &vxi->cacct.sock[type][pos].total);
++	}
++}
++
++#define vx_sock_recv(sk, s) \
++	vx_acc_sock((sk)->sk_vx_info, (sk)->sk_family, 0, s)
++#define vx_sock_send(sk, s) \
++	vx_acc_sock((sk)->sk_vx_info, (sk)->sk_family, 1, s)
++#define vx_sock_fail(sk, s) \
++	vx_acc_sock((sk)->sk_vx_info, (sk)->sk_family, 2, s)
++
++
++#define sock_vx_init(s) do {		\
++	(s)->sk_xid = 0;		\
++	(s)->sk_vx_info = NULL;		\
++	} while (0)
++
++#define sock_nx_init(s) do {		\
++	(s)->sk_nid = 0;		\
++	(s)->sk_nx_info = NULL;		\
++	} while (0)
++
++
++#else
++#warning duplicate inclusion
++#endif
+--- linux-2.6.22/include/linux/vs_tag.h	1970-01-01 01:00:00 +0100
++++ linux-2.6.22-vs2.2.0-rc5/include/linux/vs_tag.h	2007-06-15 02:37:04 +0200
+@@ -0,0 +1,43 @@
++#ifndef _VS_TAG_H
++#define _VS_TAG_H
++
++#include <linux/vserver/tag.h>
++
++/* check conditions */
++
++#define DX_ADMIN	0x0001
++#define DX_WATCH	0x0002
++#define DX_HOSTID	0x0008
++
++#define DX_IDENT	0x0010
++
++#define DX_ARG_MASK	0x0010
++
++
++#define dx_task_tag(t)	((t)->xid)
++
++#define dx_current_tag() dx_task_tag(current)
++
++#define dx_check(c, m)	__dx_check(dx_current_tag(), c, m)
++
++#define dx_weak_check(c, m)	((m) ? dx_check(c, m) : 1)
++
++
++/*
++ * check current context for ADMIN/WATCH and
++ * optionally against supplied argument
++ */
++static inline int __dx_check(tag_t cid, tag_t id, unsigned int mode)
++{
++	if (mode & DX_ARG_MASK) {
++		if ((mode & DX_IDENT) && (id == cid))
++			return 1;
++	}
++	return (((mode & DX_ADMIN) && (cid == 0)) ||
++		((mode & DX_WATCH) && (cid == 1)) ||
++		((mode & DX_HOSTID) && (id == 0)));
++}
++
++#else
++#warning duplicate inclusion
++#endif
+--- linux-2.6.22/include/linux/vs_time.h	1970-01-01 01:00:00 +0100
++++ linux-2.6.22-vs2.2.0-rc5/include/linux/vs_time.h	2007-06-15 02:37:04 +0200
+@@ -0,0 +1,19 @@
++#ifndef _VS_TIME_H
++#define _VS_TIME_H
++
++
++/* time faking stuff */
++
++#ifdef CONFIG_VSERVER_VTIME
++
++extern void vx_gettimeofday(struct timeval *tv);
++extern int vx_settimeofday(struct timespec *ts);
++
++#else
++#define	vx_gettimeofday(t)	do_gettimeofday(t)
++#define	vx_settimeofday(t)	do_settimeofday(t)
++#endif
++
++#else
++#warning duplicate inclusion
++#endif
+--- linux-2.6.22/include/linux/vserver/Kbuild	1970-01-01 01:00:00 +0100
++++ linux-2.6.22-vs2.2.0-rc5/include/linux/vserver/Kbuild	2007-06-16 19:48:30 +0200
+@@ -0,0 +1,9 @@
++
++unifdef-y += context_cmd.h network_cmd.h space_cmd.h \
++	cacct_cmd.h cvirt_cmd.h limit_cmd.h dlimit_cmd.h \
++	inode_cmd.h sched_cmd.h signal_cmd.h debug_cmd.h
++
++unifdef-y += switch.h network.h monitor.h inode.h
++
++unifdef-y += legacy.h
++
+--- linux-2.6.22/include/linux/vserver/base.h	1970-01-01 01:00:00 +0100
++++ linux-2.6.22-vs2.2.0-rc5/include/linux/vserver/base.h	2007-06-15 02:37:04 +0200
+@@ -0,0 +1,236 @@
++#ifndef _VX_BASE_H
++#define _VX_BASE_H
++
++
++/* context state changes */
++
++enum {
++	VSC_STARTUP = 1,
++	VSC_SHUTDOWN,
++
++	VSC_NETUP,
++	VSC_NETDOWN,
++};
++
++
++#define MAX_S_CONTEXT	65535	/* Arbitrary limit */
++
++#ifdef	CONFIG_VSERVER_DYNAMIC_IDS
++#define MIN_D_CONTEXT	49152	/* dynamic contexts start here */
++#else
++#define MIN_D_CONTEXT	65536
++#endif
++
++/* check conditions */
++
++#define VS_ADMIN	0x0001
++#define VS_WATCH	0x0002
++#define VS_HIDE		0x0004
++#define VS_HOSTID	0x0008
++
++#define VS_IDENT	0x0010
++#define VS_EQUIV	0x0020
++#define VS_PARENT	0x0040
++#define VS_CHILD	0x0080
++
++#define VS_ARG_MASK	0x00F0
++
++#define VS_DYNAMIC	0x0100
++#define VS_STATIC	0x0200
++
++#define VS_ATR_MASK	0x0F00
++
++#ifdef	CONFIG_VSERVER_PRIVACY
++#define VS_ADMIN_P	(0)
++#define VS_WATCH_P	(0)
++#else
++#define VS_ADMIN_P	VS_ADMIN
++#define VS_WATCH_P	VS_WATCH
++#endif
++
++#define VS_HARDIRQ	0x1000
++#define VS_SOFTIRQ	0x2000
++#define VS_IRQ		0x4000
++
++#define VS_IRQ_MASK	0xF000
++
++#include <linux/hardirq.h>
++
++/*
++ * check current context for ADMIN/WATCH and
++ * optionally against supplied argument
++ */
++static inline int __vs_check(int cid, int id, unsigned int mode)
++{
++	if (mode & VS_ARG_MASK) {
++		if ((mode & VS_IDENT) && (id == cid))
++			return 1;
++	}
++	if (mode & VS_ATR_MASK) {
++		if ((mode & VS_DYNAMIC) &&
++			(id >= MIN_D_CONTEXT) &&
++			(id <= MAX_S_CONTEXT))
++			return 1;
++		if ((mode & VS_STATIC) &&
++			(id > 1) && (id < MIN_D_CONTEXT))
++			return 1;
++	}
++	if (mode & VS_IRQ_MASK) {
++		if ((mode & VS_IRQ) && unlikely(in_interrupt()))
++			return 1;
++		if ((mode & VS_HARDIRQ) && unlikely(in_irq()))
++			return 1;
++		if ((mode & VS_SOFTIRQ) && unlikely(in_softirq()))
++			return 1;
++	}
++	return (((mode & VS_ADMIN) && (cid == 0)) ||
++		((mode & VS_WATCH) && (cid == 1)) ||
++		((mode & VS_HOSTID) && (id == 0)));
++}
++
++#define vx_task_xid(t)	((t)->xid)
++
++#define vx_current_xid() vx_task_xid(current)
++
++#define current_vx_info() (current->vx_info)
++
++
++#define vx_check(c, m)	__vs_check(vx_current_xid(), c, (m) | VS_IRQ)
++
++#define vx_weak_check(c, m)	((m) ? vx_check(c, m) : 1)
++
++
++#define nx_task_nid(t)	((t)->nid)
++
++#define nx_current_nid() nx_task_nid(current)
++
++#define current_nx_info() (current->nx_info)
++
++
++#define nx_check(c, m)	__vs_check(nx_current_nid(), c, m)
++
++#define nx_weak_check(c, m)	((m) ? nx_check(c, m) : 1)
++
++
++
++/* generic flag merging */
++
++#define vs_check_flags(v, m, f)	(((v) & (m)) ^ (f))
++
++#define vs_mask_flags(v, f, m)	(((v) & ~(m)) | ((f) & (m)))
++
++#define vs_mask_mask(v, f, m)	(((v) & ~(m)) | ((v) & (f) & (m)))
++
++#define vs_check_bit(v, n)	((v) & (1LL << (n)))
++
++
++/* context flags */
++
++#define __vx_flags(v)	((v) ? (v)->vx_flags : 0)
++
++#define vx_current_flags()	__vx_flags(current->vx_info)
++
++#define vx_info_flags(v, m, f) \
++	vs_check_flags(__vx_flags(v), m, f)
++
++#define task_vx_flags(t, m, f) \
++	((t) && vx_info_flags((t)->vx_info, m, f))
++
++#define vx_flags(m, f)	vx_info_flags(current->vx_info, m, f)
++
++
++/* context caps */
++
++#define __vx_ccaps(v)	((v) ? (v)->vx_ccaps : 0)
++
++#define vx_current_ccaps()	__vx_ccaps(current->vx_info)
++
++#define vx_info_ccaps(v, c)	(__vx_ccaps(v) & (c))
++
++#define vx_ccaps(c)	vx_info_ccaps(current->vx_info, (c))
++
++
++
++/* network flags */
++
++#define __nx_flags(v)	((v) ? (v)->nx_flags : 0)
++
++#define nx_current_flags()	__nx_flags(current->nx_info)
++
++#define nx_info_flags(v, m, f) \
++	vs_check_flags(__nx_flags(v), m, f)
++
++#define task_nx_flags(t, m, f) \
++	((t) && nx_info_flags((t)->nx_info, m, f))
++
++#define nx_flags(m, f)	nx_info_flags(current->nx_info, m, f)
++
++
++/* network caps */
++
++#define __nx_ncaps(v)	((v) ? (v)->nx_ncaps : 0)
++
++#define nx_current_ncaps()	__nx_ncaps(current->nx_info)
++
++#define nx_info_ncaps(v, c)	(__nx_ncaps(v) & (c))
++
++#define nx_ncaps(c)	nx_info_ncaps(current->nx_info, c)
++
++
++/* context mask capabilities */
++
++#define __vx_mcaps(v)	((v) ? (v)->vx_ccaps >> 32UL : ~0 )
++
++#define vx_info_mcaps(v, c)	(__vx_mcaps(v) & (c))
++
++#define vx_mcaps(c)	vx_info_mcaps(current->vx_info, c)
++
++
++/* context bcap mask */
++
++#define __vx_bcaps(v)	((v) ? (v)->vx_bcaps : ~0 )
++
++#define vx_current_bcaps()	__vx_bcaps(current->vx_info)
++
++#define vx_info_bcaps(v, c)	(__vx_bcaps(v) & (c))
++
++#define vx_bcaps(c)	vx_info_bcaps(current->vx_info, c)
++
++
++#define vx_info_cap_bset(v)	((v) ? (v)->vx_cap_bset : cap_bset)
++
++#define vx_current_cap_bset()	vx_info_cap_bset(current->vx_info)
++
++
++#define __vx_info_mbcap(v, b) \
++	(!vx_info_flags(v, VXF_STATE_SETUP, 0) ? \
++	vx_info_bcaps(v, b) : (b))
++
++#define vx_info_mbcap(v, b)	__vx_info_mbcap(v, cap_t(b))
++
++#define task_vx_mbcap(t, b) \
++	vx_info_mbcap((t)->vx_info, (t)->b)
++
++#define vx_mbcap(b)	task_vx_mbcap(current, b)
++
++#define vx_cap_raised(v, c, f)	(vx_info_mbcap(v, c) & CAP_TO_MASK(f))
++
++#define vx_capable(b, c) (capable(b) || \
++	(cap_raised(current->cap_effective, b) && vx_ccaps(c)))
++
++
++#define vx_current_initpid(n) \
++	(current->vx_info && \
++	(current->vx_info->vx_initpid == (n)))
++
++
++#define __vx_state(v)	((v) ? ((v)->vx_state) : 0)
++
++#define vx_info_state(v, m)	(__vx_state(v) & (m))
++
++
++#define __nx_state(v)	((v) ? ((v)->nx_state) : 0)
++
++#define nx_info_state(v, m)	(__nx_state(v) & (m))
++
++#endif
+--- linux-2.6.22/include/linux/vserver/cacct.h	1970-01-01 01:00:00 +0100
++++ linux-2.6.22-vs2.2.0-rc5/include/linux/vserver/cacct.h	2007-06-15 02:37:04 +0200
+@@ -0,0 +1,15 @@
++#ifndef _VX_CACCT_H
++#define _VX_CACCT_H
++
++
++enum sock_acc_field {
++	VXA_SOCK_UNSPEC = 0,
++	VXA_SOCK_UNIX,
++	VXA_SOCK_INET,
++	VXA_SOCK_INET6,
++	VXA_SOCK_PACKET,
++	VXA_SOCK_OTHER,
++	VXA_SOCK_SIZE	/* array size */
++};
++
++#endif	/* _VX_CACCT_H */
+--- linux-2.6.22/include/linux/vserver/cacct_cmd.h	1970-01-01 01:00:00 +0100
++++ linux-2.6.22-vs2.2.0-rc5/include/linux/vserver/cacct_cmd.h	2007-06-15 02:37:04 +0200
+@@ -0,0 +1,23 @@
++#ifndef _VX_CACCT_CMD_H
++#define _VX_CACCT_CMD_H
++
++
++/* virtual host info name commands */
++
++#define VCMD_sock_stat		VC_CMD(VSTAT, 5, 0)
++
++struct	vcmd_sock_stat_v0 {
++	uint32_t field;
++	uint32_t count[3];
++	uint64_t total[3];
++};
++
++
++#ifdef	__KERNEL__
++
++#include <linux/compiler.h>
++
++extern int vc_sock_stat(struct vx_info *, void __user *);
++
++#endif	/* __KERNEL__ */
++#endif	/* _VX_CACCT_CMD_H */
+--- linux-2.6.22/include/linux/vserver/cacct_def.h	1970-01-01 01:00:00 +0100
++++ linux-2.6.22-vs2.2.0-rc5/include/linux/vserver/cacct_def.h	2007-06-15 02:37:04 +0200
+@@ -0,0 +1,43 @@
++#ifndef _VX_CACCT_DEF_H
++#define _VX_CACCT_DEF_H
++
++#include <asm/atomic.h>
++#include <linux/vserver/cacct.h>
++
++
++struct _vx_sock_acc {
++	atomic_long_t count;
++	atomic_long_t total;
++};
++
++/* context sub struct */
++
++struct _vx_cacct {
++	struct _vx_sock_acc sock[VXA_SOCK_SIZE][3];
++	atomic_t slab[8];
++	atomic_t page[6][8];
++};
++
++#ifdef CONFIG_VSERVER_DEBUG
++
++static inline void __dump_vx_cacct(struct _vx_cacct *cacct)
++{
++	int i, j;
++
++	printk("\t_vx_cacct:");
++	for (i = 0; i < 6; i++) {
++		struct _vx_sock_acc *ptr = cacct->sock[i];
++
++		printk("\t [%d] =", i);
++		for (j = 0; j < 3; j++) {
++			printk(" [%d] = %8lu, %8lu", j,
++				atomic_long_read(&ptr[j].count),
++				atomic_long_read(&ptr[j].total));
++		}
++		printk("\n");
++	}
++}
++
++#endif
++
++#endif	/* _VX_CACCT_DEF_H */
+--- linux-2.6.22/include/linux/vserver/cacct_int.h	1970-01-01 01:00:00 +0100
++++ linux-2.6.22-vs2.2.0-rc5/include/linux/vserver/cacct_int.h	2007-06-15 02:37:04 +0200
+@@ -0,0 +1,21 @@
++#ifndef _VX_CACCT_INT_H
++#define _VX_CACCT_INT_H
++
++
++#ifdef	__KERNEL__
++
++static inline
++unsigned long vx_sock_count(struct _vx_cacct *cacct, int type, int pos)
++{
++	return atomic_long_read(&cacct->sock[type][pos].count);
++}
++
++
++static inline
++unsigned long vx_sock_total(struct _vx_cacct *cacct, int type, int pos)
++{
++	return atomic_long_read(&cacct->sock[type][pos].total);
++}
++
++#endif	/* __KERNEL__ */
++#endif	/* _VX_CACCT_INT_H */
+--- linux-2.6.22/include/linux/vserver/context.h	1970-01-01 01:00:00 +0100
++++ linux-2.6.22-vs2.2.0-rc5/include/linux/vserver/context.h	2007-06-15 02:37:04 +0200
+@@ -0,0 +1,172 @@
++#ifndef _VX_CONTEXT_H
++#define _VX_CONTEXT_H
++
++#include <linux/types.h>
++#include <linux/capability.h>
++
++
++#define VX_DYNAMIC_ID	((uint32_t)-1)		/* id for dynamic context */
++
++/* context flags */
++
++#define VXF_INFO_SCHED		0x00000002
++#define VXF_INFO_NPROC		0x00000004
++#define VXF_INFO_PRIVATE	0x00000008
++
++#define VXF_INFO_INIT		0x00000010
++#define VXF_INFO_HIDE		0x00000020
++#define VXF_INFO_ULIMIT		0x00000040
++#define VXF_INFO_NSPACE		0x00000080
++
++#define VXF_SCHED_HARD		0x00000100
++#define VXF_SCHED_PRIO		0x00000200
++#define VXF_SCHED_PAUSE		0x00000400
++
++#define VXF_VIRT_MEM		0x00010000
++#define VXF_VIRT_UPTIME		0x00020000
++#define VXF_VIRT_CPU		0x00040000
++#define VXF_VIRT_LOAD		0x00080000
++#define VXF_VIRT_TIME		0x00100000
++
++#define VXF_HIDE_MOUNT		0x01000000
++#define VXF_HIDE_NETIF		0x02000000
++#define VXF_HIDE_VINFO		0x04000000
++
++#define VXF_STATE_SETUP		(1ULL << 32)
++#define VXF_STATE_INIT		(1ULL << 33)
++#define VXF_STATE_ADMIN		(1ULL << 34)
++
++#define VXF_SC_HELPER		(1ULL << 36)
++#define VXF_REBOOT_KILL		(1ULL << 37)
++#define VXF_PERSISTENT		(1ULL << 38)
++
++#define VXF_FORK_RSS		(1ULL << 48)
++#define VXF_PROLIFIC		(1ULL << 49)
++
++#define VXF_IGNEG_NICE		(1ULL << 52)
++
++#define VXF_ONE_TIME		(0x0007ULL << 32)
++
++#define VXF_INIT_SET		(VXF_STATE_SETUP | VXF_STATE_INIT | VXF_STATE_ADMIN)
++
++
++/* context migration */
++
++#define VXM_SET_INIT		0x00000001
++#define VXM_SET_REAPER		0x00000002
++
++/* context caps */
++
++#define VXC_CAP_MASK		0x00000000
++
++#define VXC_SET_UTSNAME		0x00000001
++#define VXC_SET_RLIMIT		0x00000002
++
++#define VXC_RAW_ICMP		0x00000100
++#define VXC_SYSLOG		0x00001000
++
++#define VXC_SECURE_MOUNT	0x00010000
++#define VXC_SECURE_REMOUNT	0x00020000
++#define VXC_BINARY_MOUNT	0x00040000
++
++#define VXC_QUOTA_CTL		0x00100000
++#define VXC_ADMIN_MAPPER	0x00200000
++#define VXC_ADMIN_CLOOP		0x00400000
++
++
++#ifdef	__KERNEL__
++
++#include <linux/list.h>
++#include <linux/spinlock.h>
++#include <linux/rcupdate.h>
++
++#include "limit_def.h"
++#include "sched_def.h"
++#include "cvirt_def.h"
++#include "cacct_def.h"
++
++struct _vx_info_pc {
++	struct _vx_sched_pc sched_pc;
++	struct _vx_cvirt_pc cvirt_pc;
++};
++
++struct vx_info {
++	struct hlist_node vx_hlist;		/* linked list of contexts */
++	xid_t vx_id;				/* context id */
++	atomic_t vx_usecnt;			/* usage count */
++	atomic_t vx_tasks;			/* tasks count */
++	struct vx_info *vx_parent;		/* parent context */
++	int vx_state;				/* context state */
++
++	unsigned long vx_nsmask;		/* assignment mask */
++	struct nsproxy *vx_nsproxy;		/* private namespace */
++	struct fs_struct *vx_fs;		/* private namespace fs */
++
++	uint64_t vx_flags;			/* context flags */
++	uint64_t vx_bcaps;			/* bounding caps (system) */
++	uint64_t vx_ccaps;			/* context caps (vserver) */
++	kernel_cap_t vx_cap_bset;		/* the guest's bset */
++
++	struct task_struct *vx_reaper;		/* guest reaper process */
++	pid_t vx_initpid;			/* PID of guest init */
++
++	struct _vx_limit limit;			/* vserver limits */
++	struct _vx_sched sched;			/* vserver scheduler */
++	struct _vx_cvirt cvirt;			/* virtual/bias stuff */
++	struct _vx_cacct cacct;			/* context accounting */
++
++#ifndef CONFIG_SMP
++	struct _vx_info_pc info_pc;		/* per cpu data */
++#else
++	struct _vx_info_pc *ptr_pc;		/* per cpu array */
++#endif
++
++	wait_queue_head_t vx_wait;		/* context exit waitqueue */
++	int reboot_cmd;				/* last sys_reboot() cmd */
++	int exit_code;				/* last process exit code */
++
++	char vx_name[65];			/* vserver name */
++};
++
++#ifndef CONFIG_SMP
++#define	vx_ptr_pc(vxi)		(&(vxi)->info_pc)
++#define	vx_per_cpu(vxi, v, id)	vx_ptr_pc(vxi)->v
++#else
++#define	vx_ptr_pc(vxi)		((vxi)->ptr_pc)
++#define	vx_per_cpu(vxi, v, id)	per_cpu_ptr(vx_ptr_pc(vxi), id)->v
++#endif
++
++#define	vx_cpu(vxi, v)		vx_per_cpu(vxi, v, smp_processor_id())
++
++
++struct vx_info_save {
++	struct vx_info *vxi;
++	xid_t xid;
++};
++
++
++/* status flags */
++
++#define VXS_HASHED	0x0001
++#define VXS_PAUSED	0x0010
++#define VXS_SHUTDOWN	0x0100
++#define VXS_HELPER	0x1000
++#define VXS_RELEASED	0x8000
++
++
++extern void claim_vx_info(struct vx_info *, struct task_struct *);
++extern void release_vx_info(struct vx_info *, struct task_struct *);
++
++extern struct vx_info *lookup_vx_info(int);
++extern struct vx_info *lookup_or_create_vx_info(int);
++
++extern int get_xid_list(int, unsigned int *, int);
++extern int xid_is_hashed(xid_t);
++
++extern int vx_migrate_task(struct task_struct *, struct vx_info *, int);
++
++extern long vs_state_change(struct vx_info *, unsigned int);
++
++
++#endif	/* __KERNEL__ */
++#endif	/* _VX_CONTEXT_H */
+--- linux-2.6.22/include/linux/vserver/context_cmd.h	1970-01-01 01:00:00 +0100
++++ linux-2.6.22-vs2.2.0-rc5/include/linux/vserver/context_cmd.h	2007-06-15 02:37:04 +0200
+@@ -0,0 +1,123 @@
++#ifndef _VX_CONTEXT_CMD_H
++#define _VX_CONTEXT_CMD_H
++
++
++/* vinfo commands */
++
++#define VCMD_task_xid		VC_CMD(VINFO, 1, 0)
++
++#ifdef	__KERNEL__
++extern int vc_task_xid(uint32_t, void __user *);
++
++#endif	/* __KERNEL__ */
++
++#define VCMD_vx_info		VC_CMD(VINFO, 5, 0)
++
++struct	vcmd_vx_info_v0 {
++	uint32_t xid;
++	uint32_t initpid;
++	/* more to come */
++};
++
++#ifdef	__KERNEL__
++extern int vc_vx_info(struct vx_info *, void __user *);
++
++#endif	/* __KERNEL__ */
++
++#define VCMD_ctx_stat		VC_CMD(VSTAT, 0, 0)
++
++struct	vcmd_ctx_stat_v0 {
++	uint32_t usecnt;
++	uint32_t tasks;
++	/* more to come */
++};
++
++#ifdef	__KERNEL__
++extern int vc_ctx_stat(struct vx_info *, void __user *);
++
++#endif	/* __KERNEL__ */
++
++/* context commands */
++
++#define VCMD_ctx_create_v0	VC_CMD(VPROC, 1, 0)
++#define VCMD_ctx_create		VC_CMD(VPROC, 1, 1)
++
++struct	vcmd_ctx_create {
++	uint64_t flagword;
++};
++
++#define VCMD_ctx_migrate_v0	VC_CMD(PROCMIG, 1, 0)
++#define VCMD_ctx_migrate	VC_CMD(PROCMIG, 1, 1)
++
++struct	vcmd_ctx_migrate {
++	uint64_t flagword;
++};
++
++#ifdef	__KERNEL__
++extern int vc_ctx_create(uint32_t, void __user *);
++extern int vc_ctx_migrate(struct vx_info *, void __user *);
++
++#endif	/* __KERNEL__ */
++
++
++/* flag commands */
++
++#define VCMD_get_cflags		VC_CMD(FLAGS, 1, 0)
++#define VCMD_set_cflags		VC_CMD(FLAGS, 2, 0)
++
++struct	vcmd_ctx_flags_v0 {
++	uint64_t flagword;
++	uint64_t mask;
++};
++
++#ifdef	__KERNEL__
++extern int vc_get_cflags(struct vx_info *, void __user *);
++extern int vc_set_cflags(struct vx_info *, void __user *);
++
++#endif	/* __KERNEL__ */
++
++
++/* context caps commands */
++
++#define VCMD_get_ccaps_v0	VC_CMD(FLAGS, 3, 0)
++#define VCMD_set_ccaps_v0	VC_CMD(FLAGS, 4, 0)
++
++struct	vcmd_ctx_caps_v0 {
++	uint64_t bcaps;
++	uint64_t ccaps;
++	uint64_t cmask;
++};
++
++#define VCMD_get_ccaps		VC_CMD(FLAGS, 3, 1)
++#define VCMD_set_ccaps		VC_CMD(FLAGS, 4, 1)
++
++struct	vcmd_ctx_caps_v1 {
++	uint64_t ccaps;
++	uint64_t cmask;
++};
++
++#ifdef	__KERNEL__
++extern int vc_get_ccaps_v0(struct vx_info *, void __user *);
++extern int vc_set_ccaps_v0(struct vx_info *, void __user *);
++extern int vc_get_ccaps(struct vx_info *, void __user *);
++extern int vc_set_ccaps(struct vx_info *, void __user *);
++
++#endif	/* __KERNEL__ */
++
++
++/* bcaps commands */
++
++#define VCMD_get_bcaps		VC_CMD(FLAGS, 9, 0)
++#define VCMD_set_bcaps		VC_CMD(FLAGS, 10, 0)
++
++struct	vcmd_bcaps {
++	uint64_t bcaps;
++	uint64_t bmask;
++};
++
++#ifdef	__KERNEL__
++extern int vc_get_bcaps(struct vx_info *, void __user *);
++extern int vc_set_bcaps(struct vx_info *, void __user *);
++
++#endif	/* __KERNEL__ */
++#endif	/* _VX_CONTEXT_CMD_H */
+--- linux-2.6.22/include/linux/vserver/cvirt.h	1970-01-01 01:00:00 +0100
++++ linux-2.6.22-vs2.2.0-rc5/include/linux/vserver/cvirt.h	2007-06-15 02:37:04 +0200
+@@ -0,0 +1,20 @@
++#ifndef _VX_CVIRT_H
++#define _VX_CVIRT_H
++
++
++#ifdef	__KERNEL__
++
++struct timespec;
++
++void vx_vsi_uptime(struct timespec *, struct timespec *);
++
++
++struct vx_info;
++
++void vx_update_load(struct vx_info *);
++
++
++int vx_do_syslog(int, char __user *, int);
++
++#endif	/* __KERNEL__ */
++#endif	/* _VX_CVIRT_H */
+--- linux-2.6.22/include/linux/vserver/cvirt_cmd.h	1970-01-01 01:00:00 +0100
++++ linux-2.6.22-vs2.2.0-rc5/include/linux/vserver/cvirt_cmd.h	2007-06-15 02:37:04 +0200
+@@ -0,0 +1,53 @@
++#ifndef _VX_CVIRT_CMD_H
++#define _VX_CVIRT_CMD_H
++
++
++/* virtual host info name commands */
++
++#define VCMD_set_vhi_name	VC_CMD(VHOST, 1, 0)
++#define VCMD_get_vhi_name	VC_CMD(VHOST, 2, 0)
++
++struct	vcmd_vhi_name_v0 {
++	uint32_t field;
++	char name[65];
++};
++
++
++enum vhi_name_field {
++	VHIN_CONTEXT = 0,
++	VHIN_SYSNAME,
++	VHIN_NODENAME,
++	VHIN_RELEASE,
++	VHIN_VERSION,
++	VHIN_MACHINE,
++	VHIN_DOMAINNAME,
++};
++
++
++#ifdef	__KERNEL__
++
++#include <linux/compiler.h>
++
++extern int vc_set_vhi_name(struct vx_info *, void __user *);
++extern int vc_get_vhi_name(struct vx_info *, void __user *);
++
++#endif	/* __KERNEL__ */
++
++#define VCMD_virt_stat		VC_CMD(VSTAT, 3, 0)
++
++struct	vcmd_virt_stat_v0 {
++	uint64_t offset;
++	uint64_t uptime;
++	uint32_t nr_threads;
++	uint32_t nr_running;
++	uint32_t nr_uninterruptible;
++	uint32_t nr_onhold;
++	uint32_t nr_forks;
++	uint32_t load[3];
++};
++
++#ifdef	__KERNEL__
++extern int vc_virt_stat(struct vx_info *, void __user *);
++
++#endif	/* __KERNEL__ */
++#endif	/* _VX_CVIRT_CMD_H */
+--- linux-2.6.22/include/linux/vserver/cvirt_def.h	1970-01-01 01:00:00 +0100
++++ linux-2.6.22-vs2.2.0-rc5/include/linux/vserver/cvirt_def.h	2007-06-15 02:37:04 +0200
+@@ -0,0 +1,81 @@
++#ifndef _VX_CVIRT_DEF_H
++#define _VX_CVIRT_DEF_H
++
++#include <linux/jiffies.h>
++#include <linux/spinlock.h>
++#include <linux/wait.h>
++#include <linux/time.h>
++#include <linux/utsname.h>
++#include <asm/atomic.h>
++
++
++struct _vx_usage_stat {
++	uint64_t user;
++	uint64_t nice;
++	uint64_t system;
++	uint64_t softirq;
++	uint64_t irq;
++	uint64_t idle;
++	uint64_t iowait;
++};
++
++struct _vx_syslog {
++	wait_queue_head_t log_wait;
++	spinlock_t logbuf_lock;		/* lock for the log buffer */
++
++	unsigned long log_start;	/* next char to be read by syslog() */
++	unsigned long con_start;	/* next char to be sent to consoles */
++	unsigned long log_end;	/* most-recently-written-char + 1 */
++	unsigned long logged_chars;	/* #chars since last read+clear operation */
++
++	char log_buf[1024];
++};
++
++
++/* context sub struct */
++
++struct _vx_cvirt {
++	atomic_t nr_threads;		/* number of current threads */
++	atomic_t nr_running;		/* number of running threads */
++	atomic_t nr_uninterruptible;	/* number of uninterruptible threads */
++
++	atomic_t nr_onhold;		/* processes on hold */
++	uint32_t onhold_last;		/* jiffies when put on hold */
++
++	struct timeval bias_tv;		/* time offset to the host */
++	struct timespec bias_idle;
++	struct timespec bias_uptime;	/* context creation point */
++	uint64_t bias_clock;		/* offset in clock_t */
++
++	spinlock_t load_lock;		/* lock for the load averages */
++	atomic_t load_updates;		/* nr of load updates done so far */
++	uint32_t load_last;		/* last time load was calculated */
++	uint32_t load[3];		/* load averages 1,5,15 */
++
++	atomic_t total_forks;		/* number of forks so far */
++
++	struct _vx_syslog syslog;
++};
++
++struct _vx_cvirt_pc {
++	struct _vx_usage_stat cpustat;
++};
++
++
++#ifdef CONFIG_VSERVER_DEBUG
++
++static inline void __dump_vx_cvirt(struct _vx_cvirt *cvirt)
++{
++	printk("\t_vx_cvirt:\n");
++	printk("\t threads: %4d, %4d, %4d, %4d\n",
++		atomic_read(&cvirt->nr_threads),
++		atomic_read(&cvirt->nr_running),
++		atomic_read(&cvirt->nr_uninterruptible),
++		atomic_read(&cvirt->nr_onhold));
++	/* add rest here */
++	printk("\t total_forks = %d\n", atomic_read(&cvirt->total_forks));
++}
++
++#endif
++
++#endif	/* _VX_CVIRT_DEF_H */
+--- linux-2.6.22/include/linux/vserver/debug.h	1970-01-01 01:00:00 +0100
++++ linux-2.6.22-vs2.2.0-rc5/include/linux/vserver/debug.h	2007-06-16 05:47:03 +0200
+@@ -0,0 +1,113 @@
++#ifndef _VX_DEBUG_H
++#define _VX_DEBUG_H
++
++
++#define VXD_CBIT(n, m)	(vx_debug_ ## n & (1 << (m)))
++#define VXD_CMIN(n, m)	(vx_debug_ ## n > (m))
++#define VXD_MASK(n, m)	(vx_debug_ ## n & (m))
++
++#define VXD_DEV(d)	(d), (d)->bd_inode->i_ino,		\
++			imajor((d)->bd_inode), iminor((d)->bd_inode)
++#define VXF_DEV		"%p[%lu,%d:%d]"
++
++
++#define __FUNC__	__func__
++
++
++#define vxd_path(d, m)						\
++	({ static char _buffer[PATH_MAX];			\
++	   d_path(d, m, _buffer, sizeof(_buffer)); })
++
++#define vxd_cond_path(n)					\
++	((n) ? vxd_path((n)->dentry, (n)->mnt) : "<null>" )
++
++
++#ifdef	CONFIG_VSERVER_DEBUG
++
++extern unsigned int vx_debug_switch;
++extern unsigned int vx_debug_xid;
++extern unsigned int vx_debug_nid;
++extern unsigned int vx_debug_tag;
++extern unsigned int vx_debug_net;
++extern unsigned int vx_debug_limit;
++extern unsigned int vx_debug_cres;
++extern unsigned int vx_debug_dlim;
++extern unsigned int vx_debug_quota;
++extern unsigned int vx_debug_cvirt;
++extern unsigned int vx_debug_space;
++extern unsigned int vx_debug_misc;
++
++
++#define VX_LOGLEVEL	"vxD: "
++
++#define vxdprintk(c, f, x...)					\
++	do {							\
++		if (c)						\
++			printk(VX_LOGLEVEL f "\n" , ##x);	\
++	} while (0)
++
++#define vxlprintk(c, f, x...)					\
++	do {							\
++		if (c)						\
++			printk(VX_LOGLEVEL f " @%s:%d\n", x);	\
++	} while (0)
++
++#define vxfprintk(c, f, x...)					\
++	do {							\
++		if (c)						\
++			printk(VX_LOGLEVEL f " %s@%s:%d\n", x); \
++	} while (0)
++
++
++struct vx_info;
++
++void dump_vx_info(struct vx_info *, int);
++void dump_vx_info_inactive(int);
++
++#else	/* CONFIG_VSERVER_DEBUG */
++
++#define vx_debug_switch 0
++#define vx_debug_xid	0
++#define vx_debug_nid	0
++#define vx_debug_tag	0
++#define vx_debug_net	0
++#define vx_debug_limit	0
++#define vx_debug_cres	0
++#define vx_debug_dlim	0
++#define vx_debug_cvirt	0
++
++#define vxdprintk(x...) do { } while (0)
++#define vxlprintk(x...) do { } while (0)
++#define vxfprintk(x...) do { } while (0)
++
++#endif	/* CONFIG_VSERVER_DEBUG */
++
++
++#ifdef	CONFIG_VSERVER_WARN
++
++#define VX_WARNLEVEL	KERN_WARNING "vxW: "
++
++#define vxwprintk(c, f, x...)					\
++	do {							\
++		if (c)						\
++			printk(VX_WARNLEVEL f "\n" , ##x);	\
++	} while (0)
++
++#else	/* CONFIG_VSERVER_WARN */
++
++#define vxwprintk(x...) do { } while (0)
++
++#endif	/* CONFIG_VSERVER_WARN */
++
++
++#ifdef	CONFIG_VSERVER_DEBUG
++#define vxd_assert_lock(l)	assert_spin_locked(l)
++#define vxd_assert(c, f, x...)	vxlprintk(!(c), \
++	"assertion [" f "] failed.", ##x, __FILE__, __LINE__)
++#else
++#define vxd_assert_lock(l)	do { } while (0)
++#define vxd_assert(c, f, x...)	do { } while (0)
++#endif
++
++
++#endif /* _VX_DEBUG_H */
+--- linux-2.6.22/include/linux/vserver/debug_cmd.h	1970-01-01 01:00:00 +0100
++++ linux-2.6.22-vs2.2.0-rc5/include/linux/vserver/debug_cmd.h	2007-06-15 02:37:04 +0200
+@@ -0,0 +1,58 @@
++#ifndef _VX_DEBUG_CMD_H
++#define _VX_DEBUG_CMD_H
++
++
++/* debug commands */
++
++#define VCMD_dump_history	VC_CMD(DEBUG, 1, 0)
++
++#define VCMD_read_history	VC_CMD(DEBUG, 5, 0)
++#define VCMD_read_monitor	VC_CMD(DEBUG, 6, 0)
++
++struct  vcmd_read_history_v0 {
++	uint32_t index;
++	uint32_t count;
++	char __user *data;
++};
++
++struct  vcmd_read_monitor_v0 {
++	uint32_t index;
++	uint32_t count;
++	char __user *data;
++};
++
++
++#ifdef	__KERNEL__
++
++#ifdef	CONFIG_COMPAT
++
++#include <asm/compat.h>
++
++struct	vcmd_read_history_v0_x32 {
++	uint32_t index;
++	uint32_t count;
++	compat_uptr_t data_ptr;
++};
++
++struct	vcmd_read_monitor_v0_x32 {
++	uint32_t index;
++	uint32_t count;
++	compat_uptr_t data_ptr;
++};
++
++#endif  /* CONFIG_COMPAT */
++
++extern int vc_dump_history(uint32_t);
++
++extern int vc_read_history(uint32_t, void __user *);
++extern int vc_read_monitor(uint32_t, void __user *);
++
++#ifdef	CONFIG_COMPAT
++
++extern int vc_read_history_x32(uint32_t, void __user *);
++extern int vc_read_monitor_x32(uint32_t, void __user *);
++
++#endif  /* CONFIG_COMPAT */
++
++#endif	/* __KERNEL__ */
++#endif	/* _VX_DEBUG_CMD_H */
+--- linux-2.6.22/include/linux/vserver/dlimit.h	1970-01-01 01:00:00 +0100
++++ linux-2.6.22-vs2.2.0-rc5/include/linux/vserver/dlimit.h	2007-06-15 02:37:04 +0200
+@@ -0,0 +1,53 @@
++#ifndef _VX_DLIMIT_H
++#define _VX_DLIMIT_H
++
++#include "switch.h"
++
++
++#ifdef	__KERNEL__
++
++/*      keep in sync with CDLIM_INFINITY	*/
++
++#define DLIM_INFINITY		(~0ULL)
++
++#include <linux/spinlock.h>
++
++struct super_block;
++
++struct dl_info {
++	struct hlist_node dl_hlist;		/* linked list of contexts */
++	struct rcu_head dl_rcu;			/* the rcu head */
++	tag_t dl_tag;				/* context tag */
++	atomic_t dl_usecnt;			/* usage count */
++	atomic_t dl_refcnt;			/* reference count */
++
++	struct super_block *dl_sb;		/* associated superblock */
++
++	spinlock_t dl_lock;			/* protect the values */
++
++	unsigned long long dl_space_used;	/* used space in bytes */
++	unsigned long long dl_space_total;	/* maximum space in bytes */
++	unsigned long dl_inodes_used;		/* used inodes */
++	unsigned long dl_inodes_total;		/* maximum inodes */
++
++	unsigned int dl_nrlmult;		/* non root limit mult */
++};
++
++struct rcu_head;
++
++extern void rcu_free_dl_info(struct rcu_head *);
++extern void unhash_dl_info(struct dl_info *);
++
++extern struct dl_info *locate_dl_info(struct super_block *, tag_t);
++
++
++struct kstatfs;
++
++extern void vx_vsi_statfs(struct super_block *, struct kstatfs *);
++
++typedef uint64_t dlsize_t;
++
++#endif	/* __KERNEL__ */
++#else	/* _VX_DLIMIT_H */
++#warning duplicate inclusion
++#endif	/* _VX_DLIMIT_H */
+--- linux-2.6.22/include/linux/vserver/dlimit_cmd.h	1970-01-01 01:00:00 +0100
++++ linux-2.6.22-vs2.2.0-rc5/include/linux/vserver/dlimit_cmd.h	2007-06-15 02:37:04 +0200
+@@ -0,0 +1,74 @@
++#ifndef _VX_DLIMIT_CMD_H
++#define _VX_DLIMIT_CMD_H
++
++
++/*  dlimit vserver commands */
++
++#define VCMD_add_dlimit		VC_CMD(DLIMIT, 1, 0)
++#define VCMD_rem_dlimit		VC_CMD(DLIMIT, 2, 0)
++
++#define VCMD_set_dlimit		VC_CMD(DLIMIT, 5, 0)
++#define VCMD_get_dlimit		VC_CMD(DLIMIT, 6, 0)
++
++struct	vcmd_ctx_dlimit_base_v0 {
++	const char __user *name;
++	uint32_t flags;
++};
++
++struct	vcmd_ctx_dlimit_v0 {
++	const char __user *name;
++	uint32_t space_used;			/* used space in kbytes */
++	uint32_t space_total;			/* maximum space in kbytes */
++	uint32_t inodes_used;			/* used inodes */
++	uint32_t inodes_total;			/* maximum inodes */
++	uint32_t reserved;			/* reserved for root in % */
++	uint32_t flags;
++};
++
++#define CDLIM_UNSET		((uint32_t)0UL)
++#define CDLIM_INFINITY		((uint32_t)~0UL)
++#define CDLIM_KEEP		((uint32_t)~1UL)
++
++#ifdef	__KERNEL__
++
++#ifdef	CONFIG_COMPAT
++
++#include <asm/compat.h>
++
++struct	vcmd_ctx_dlimit_base_v0_x32 {
++	compat_uptr_t name_ptr;
++	uint32_t flags;
++};
++
++struct	vcmd_ctx_dlimit_v0_x32 {
++	compat_uptr_t name_ptr;
++	uint32_t space_used;			/* used space in kbytes */
++	uint32_t space_total;			/* maximum space in kbytes */
++	uint32_t inodes_used;			/* used inodes */
++	uint32_t inodes_total;			/* maximum inodes */
++	uint32_t reserved;			/* reserved for root in % */
++	uint32_t flags;
++};
++
++#endif	/* CONFIG_COMPAT */
++
++#include <linux/compiler.h>
++
++extern int vc_add_dlimit(uint32_t, void __user *);
++extern int vc_rem_dlimit(uint32_t, void __user *);
++
++extern int vc_set_dlimit(uint32_t, void __user *);
++extern int vc_get_dlimit(uint32_t, void __user *);
++
++#ifdef	CONFIG_COMPAT
++
++extern int vc_add_dlimit_x32(uint32_t, void __user *);
++extern int vc_rem_dlimit_x32(uint32_t, void __user *);
++
++extern int vc_set_dlimit_x32(uint32_t, void __user *);
++extern int vc_get_dlimit_x32(uint32_t, void __user *);
++
++#endif	/* CONFIG_COMPAT */
++
++#endif	/* __KERNEL__ */
++#endif	/* _VX_DLIMIT_CMD_H */
+--- linux-2.6.22/include/linux/vserver/global.h	1970-01-01 01:00:00 +0100
++++ linux-2.6.22-vs2.2.0-rc5/include/linux/vserver/global.h	2007-06-15 02:37:04 +0200
+@@ -0,0 +1,18 @@
++#ifndef _VX_GLOBAL_H
++#define _VX_GLOBAL_H
++
++
++extern atomic_t vx_global_ctotal;
++extern atomic_t vx_global_cactive;
++
++extern atomic_t nx_global_ctotal;
++extern atomic_t nx_global_cactive;
++
++extern atomic_t vs_global_nsproxy;
++extern atomic_t vs_global_fs;
++extern atomic_t vs_global_mnt_ns;
++extern atomic_t vs_global_uts_ns;
++extern atomic_t vs_global_ipc_ns;
++
++
++#endif /* _VX_GLOBAL_H */
+--- linux-2.6.22/include/linux/vserver/history.h	1970-01-01 01:00:00 +0100
++++ linux-2.6.22-vs2.2.0-rc5/include/linux/vserver/history.h	2007-06-15 02:37:04 +0200
+@@ -0,0 +1,197 @@
++#ifndef _VX_HISTORY_H
++#define _VX_HISTORY_H
++
++
++enum {
++	VXH_UNUSED = 0,
++	VXH_THROW_OOPS = 1,
++
++	VXH_GET_VX_INFO,
++	VXH_PUT_VX_INFO,
++	VXH_INIT_VX_INFO,
++	VXH_SET_VX_INFO,
++	VXH_CLR_VX_INFO,
++	VXH_CLAIM_VX_INFO,
++	VXH_RELEASE_VX_INFO,
++	VXH_ALLOC_VX_INFO,
++	VXH_DEALLOC_VX_INFO,
++	VXH_HASH_VX_INFO,
++	VXH_UNHASH_VX_INFO,
++	VXH_LOC_VX_INFO,
++	VXH_LOOKUP_VX_INFO,
++	VXH_CREATE_VX_INFO,
++};
++
++struct _vxhe_vxi {
++	struct vx_info *ptr;
++	unsigned xid;
++	unsigned usecnt;
++	unsigned tasks;
++};
++
++struct _vxhe_set_clr {
++	void *data;
++};
++
++struct _vxhe_loc_lookup {
++	unsigned arg;
++};
++
++struct _vx_hist_entry {
++	void *loc;
++	unsigned short seq;
++	unsigned short type;
++	struct _vxhe_vxi vxi;
++	union {
++		struct _vxhe_set_clr sc;
++		struct _vxhe_loc_lookup ll;
++	};
++};
++
++#ifdef	CONFIG_VSERVER_HISTORY
++
++extern unsigned volatile int vxh_active;
++
++struct _vx_hist_entry *vxh_advance(void *loc);
++
++
++static inline
++void	__vxh_copy_vxi(struct _vx_hist_entry *entry, struct vx_info *vxi)
++{
++	entry->vxi.ptr = vxi;
++	if (vxi) {
++		entry->vxi.usecnt = atomic_read(&vxi->vx_usecnt);
++		entry->vxi.tasks = atomic_read(&vxi->vx_tasks);
++		entry->vxi.xid = vxi->vx_id;
++	}
++}
++
++
++#define	__HERE__ current_text_addr()
++
++#define __VXH_BODY(__type, __data, __here)	\
++	struct _vx_hist_entry *entry;		\
++						\
++	preempt_disable();			\
++	entry = vxh_advance(__here);		\
++	__data;					\
++	entry->type = __type;			\
++	preempt_enable();
++
++
++	/* pass vxi only */
++
++#define __VXH_SMPL				\
++	__vxh_copy_vxi(entry, vxi)
++
++static inline
++void	__vxh_smpl(struct vx_info *vxi, int __type, void *__here)
++{
++	__VXH_BODY(__type, __VXH_SMPL, __here)
++}
++
++	/* pass vxi and data (void *) */
++
++#define __VXH_DATA				\
++	__vxh_copy_vxi(entry, vxi);		\
++	entry->sc.data = data
++
++static inline
++void	__vxh_data(struct vx_info *vxi, void *data,
++			int __type, void *__here)
++{
++	__VXH_BODY(__type, __VXH_DATA, __here)
++}
++
++	/* pass vxi and arg (long) */
++
++#define __VXH_LONG				\
++	__vxh_copy_vxi(entry, vxi);		\
++	entry->ll.arg = arg
++
++static inline
++void	__vxh_long(struct vx_info *vxi, long arg,
++			int __type, void *__here)
++{
++	__VXH_BODY(__type, __VXH_LONG, __here)
++}
++
++
++static inline
++void	__vxh_throw_oops(void *__here)
++{
++	__VXH_BODY(VXH_THROW_OOPS, {}, __here);
++	/* prevent further acquisition */
++	vxh_active = 0;
++}
++
++
++#define vxh_throw_oops()	__vxh_throw_oops(__HERE__);
++
++#define __vxh_get_vx_info(v, h)	__vxh_smpl(v, VXH_GET_VX_INFO, h);
++#define __vxh_put_vx_info(v, h)	__vxh_smpl(v, VXH_PUT_VX_INFO, h);
++
++#define __vxh_init_vx_info(v, d, h) \
++	__vxh_data(v, d, VXH_INIT_VX_INFO, h);
++#define __vxh_set_vx_info(v, d, h) \
++	__vxh_data(v, d, VXH_SET_VX_INFO, h);
++#define __vxh_clr_vx_info(v, d, h) \
++	__vxh_data(v, d, VXH_CLR_VX_INFO, h);
++
++#define __vxh_claim_vx_info(v, d, h) \
++	__vxh_data(v, d, VXH_CLAIM_VX_INFO, h);
++#define __vxh_release_vx_info(v, d, h) \
++	__vxh_data(v, d, VXH_RELEASE_VX_INFO, h);
++
++#define vxh_alloc_vx_info(v) \
++	__vxh_smpl(v, VXH_ALLOC_VX_INFO, __HERE__);
++#define vxh_dealloc_vx_info(v) \
++	__vxh_smpl(v, VXH_DEALLOC_VX_INFO, __HERE__);
++
++#define vxh_hash_vx_info(v) \
++	__vxh_smpl(v, VXH_HASH_VX_INFO, __HERE__);
++#define vxh_unhash_vx_info(v) \
++	__vxh_smpl(v, VXH_UNHASH_VX_INFO, __HERE__);
++
++#define vxh_loc_vx_info(v, l) \
++	__vxh_long(v, l, VXH_LOC_VX_INFO, __HERE__);
++#define vxh_lookup_vx_info(v, l) \
++	__vxh_long(v, l, VXH_LOOKUP_VX_INFO, __HERE__);
++#define vxh_create_vx_info(v, l) \
++	__vxh_long(v, l, VXH_CREATE_VX_INFO, __HERE__);
++
++extern void vxh_dump_history(void);
++
++
++#else  /* CONFIG_VSERVER_HISTORY */
++
++#define	__HERE__	0
++
++#define vxh_throw_oops()		do { } while (0)
++
++#define __vxh_get_vx_info(v, h)		do { } while (0)
++#define __vxh_put_vx_info(v, h)		do { } while (0)
++
++#define __vxh_init_vx_info(v, d, h)	do { } while (0)
++#define __vxh_set_vx_info(v, d, h)	do { } while (0)
++#define __vxh_clr_vx_info(v, d, h)	do { } while (0)
++
++#define __vxh_claim_vx_info(v, d, h)	do { } while (0)
++#define __vxh_release_vx_info(v, d, h)	do { } while (0)
++
++#define vxh_alloc_vx_info(v)		do { } while (0)
++#define vxh_dealloc_vx_info(v)		do { } while (0)
++
++#define vxh_hash_vx_info(v)		do { } while (0)
++#define vxh_unhash_vx_info(v)		do { } while (0)
++
++#define vxh_loc_vx_info(v, l)		do { } while (0)
++#define vxh_lookup_vx_info(v, l)	do { } while (0)
++#define vxh_create_vx_info(v, l)	do { } while (0)
++
++#define vxh_dump_history()		do { } while (0)
++
++
++#endif /* CONFIG_VSERVER_HISTORY */
++
++#endif /* _VX_HISTORY_H */
+--- linux-2.6.22/include/linux/vserver/inode.h	1970-01-01 01:00:00 +0100
++++ linux-2.6.22-vs2.2.0-rc5/include/linux/vserver/inode.h	2007-06-15 02:37:04 +0200
+@@ -0,0 +1,38 @@
++#ifndef _VX_INODE_H
++#define _VX_INODE_H
++
++
++#define IATTR_TAG	0x01000000
++
++#define IATTR_ADMIN	0x00000001
++#define IATTR_WATCH	0x00000002
++#define IATTR_HIDE	0x00000004
++#define IATTR_FLAGS	0x00000007
++
++#define IATTR_BARRIER	0x00010000
++#define IATTR_IUNLINK	0x00020000
++#define IATTR_IMMUTABLE 0x00040000
++
++#ifdef	__KERNEL__
++
++
++#ifdef	CONFIG_VSERVER_PROC_SECURE
++#define IATTR_PROC_DEFAULT	( IATTR_ADMIN | IATTR_HIDE )
++#define IATTR_PROC_SYMLINK	( IATTR_ADMIN )
++#else
++#define IATTR_PROC_DEFAULT	( IATTR_ADMIN )
++#define IATTR_PROC_SYMLINK	( IATTR_ADMIN )
++#endif
++
++#define vx_hide_check(c, m)	(((m) & IATTR_HIDE) ? vx_check(c, m) : 1)
++
++#endif	/* __KERNEL__ */
++
++/* inode ioctls */
++
++#define FIOC_GETXFLG	_IOR('x', 5, long)
++#define FIOC_SETXFLG	_IOW('x', 6, long)
++
++#else	/* _VX_INODE_H */
++#warning duplicate inclusion
++#endif	/* _VX_INODE_H */
+--- linux-2.6.22/include/linux/vserver/inode_cmd.h	1970-01-01 01:00:00 +0100
++++ linux-2.6.22-vs2.2.0-rc5/include/linux/vserver/inode_cmd.h	2007-06-15 02:37:04 +0200
+@@ -0,0 +1,61 @@
++#ifndef _VX_INODE_CMD_H
++#define _VX_INODE_CMD_H
++
++
++/*  inode vserver commands */
++
++#define VCMD_get_iattr_v0	VC_CMD(INODE, 1, 0)
++#define VCMD_set_iattr_v0	VC_CMD(INODE, 2, 0)
++
++#define VCMD_get_iattr		VC_CMD(INODE, 1, 1)
++#define VCMD_set_iattr		VC_CMD(INODE, 2, 1)
++
++struct	vcmd_ctx_iattr_v0 {
++	/* device handle in id */
++	uint64_t ino;
++	uint32_t xid;
++	uint32_t flags;
++	uint32_t mask;
++};
++
++struct	vcmd_ctx_iattr_v1 {
++	const char __user *name;
++	uint32_t xid;
++	uint32_t flags;
++	uint32_t mask;
++};
++
++
++#ifdef	__KERNEL__
++
++
++#ifdef	CONFIG_COMPAT
++
++#include <asm/compat.h>
++
++struct	vcmd_ctx_iattr_v1_x32 {
++	compat_uptr_t name_ptr;
++	uint32_t xid;
++	uint32_t flags;
++	uint32_t mask;
++};
++
++#endif	/* CONFIG_COMPAT */
++
++#include <linux/compiler.h>
++
++extern int vc_get_iattr_v0(uint32_t, void __user *);
++extern int vc_set_iattr_v0(uint32_t, void __user *);
++
++extern int vc_get_iattr(uint32_t, void __user *);
++extern int vc_set_iattr(uint32_t, void __user *);
++
++#ifdef	CONFIG_COMPAT
++
++extern int vc_get_iattr_x32(uint32_t, void __user *);
++extern int vc_set_iattr_x32(uint32_t, void __user *);
++
++#endif	/* CONFIG_COMPAT */
++
++#endif	/* __KERNEL__ */
++#endif	/* _VX_INODE_CMD_H */
+--- linux-2.6.22/include/linux/vserver/legacy.h	1970-01-01 01:00:00 +0100
++++ linux-2.6.22-vs2.2.0-rc5/include/linux/vserver/legacy.h	2007-06-15 02:37:04 +0200
+@@ -0,0 +1,49 @@
++#ifndef _VX_LEGACY_H
++#define _VX_LEGACY_H
++
++#include "switch.h"
++
++
++/*  compatibiliy vserver commands */
++
++#define VCMD_new_s_context	VC_CMD(COMPAT, 1, 1)
++#define VCMD_set_ipv4root	VC_CMD(COMPAT, 2, 3)
++
++#define VCMD_create_context	VC_CMD(VSETUP, 1, 0)
++
++/*  compatibiliy vserver arguments */
++
++struct	vcmd_new_s_context_v1 {
++	uint32_t remove_cap;
++	uint32_t flags;
++};
++
++struct	vcmd_set_ipv4root_v3 {
++	/* number of pairs in id */
++	uint32_t broadcast;
++	struct {
++		uint32_t ip;
++		uint32_t mask;
++	} nx_mask_pair[NB_IPV4ROOT];
++};
++
++
++#define VX_INFO_LOCK		1	/* Can't request a new vx_id */
++#define VX_INFO_NPROC		4	/* Limit number of processes in a context */
++#define VX_INFO_PRIVATE		8	/* Noone can join this security context */
++#define VX_INFO_INIT		16	/* This process wants to become the */
++					/* logical process 1 of the security */
++					/* context */
++#define VX_INFO_HIDEINFO	32	/* Hide some information in /proc */
++#define VX_INFO_ULIMIT		64	/* Use ulimit of the current process */
++					/* to become the global limits */
++					/* of the context */
++#define VX_INFO_NAMESPACE	128	/* save private namespace */
++
++
++#ifdef	__KERNEL__
++extern int vc_new_s_context(uint32_t, void __user *);
++extern int vc_set_ipv4root(uint32_t, void __user *);
++
++#endif	/* __KERNEL__ */
++#endif	/* _VX_LEGACY_H */
+--- linux-2.6.22/include/linux/vserver/limit.h	1970-01-01 01:00:00 +0100
++++ linux-2.6.22-vs2.2.0-rc5/include/linux/vserver/limit.h	2007-06-15 02:37:04 +0200
+@@ -0,0 +1,68 @@
++#ifndef _VX_LIMIT_H
++#define _VX_LIMIT_H
++
++
++#define VLIMIT_NSOCK	16
++#define VLIMIT_OPENFD	17
++#define VLIMIT_ANON	18
++#define VLIMIT_SHMEM	19
++#define VLIMIT_SEMARY	20
++#define VLIMIT_NSEMS	21
++#define VLIMIT_DENTRY	22
++#define VLIMIT_MAPPED	23
++
++
++#ifdef	__KERNEL__
++
++#define	VLIM_NOCHECK	((1L << VLIMIT_DENTRY) | (1L << RLIMIT_RSS))
++
++/*	keep in sync with CRLIM_INFINITY */
++
++#define	VLIM_INFINITY	(~0ULL)
++
++#ifndef RLIM_INFINITY
++#warning RLIM_INFINITY is undefined
++#endif
++
++#define __rlim_val(l, r, v)	((l)->res[r].v)
++
++#define __rlim_soft(l, r)	__rlim_val(l, r, soft)
++#define __rlim_hard(l, r)	__rlim_val(l, r, hard)
++
++#define __rlim_rcur(l, r)	__rlim_val(l, r, rcur)
++#define __rlim_rmin(l, r)	__rlim_val(l, r, rmin)
++#define __rlim_rmax(l, r)	__rlim_val(l, r, rmax)
++
++#define __rlim_lhit(l, r)	__rlim_val(l, r, lhit)
++#define __rlim_hit(l, r)	atomic_inc(&__rlim_lhit(l, r))
++
++typedef atomic_long_t rlim_atomic_t;
++typedef unsigned long rlim_t;
++
++#define __rlim_get(l, r)	atomic_long_read(&__rlim_rcur(l, r))
++#define __rlim_set(l, r, v)	atomic_long_set(&__rlim_rcur(l, r), v)
++#define __rlim_inc(l, r)	atomic_long_inc(&__rlim_rcur(l, r))
++#define __rlim_dec(l, r)	atomic_long_dec(&__rlim_rcur(l, r))
++#define __rlim_add(l, r, v)	atomic_long_add(v, &__rlim_rcur(l, r))
++#define __rlim_sub(l, r, v)	atomic_long_sub(v, &__rlim_rcur(l, r))
++
++
++#if	(RLIM_INFINITY == VLIM_INFINITY)
++#define	VX_VLIM(r) ((long long)(long)(r))
++#define	VX_RLIM(v) ((rlim_t)(v))
++#else
++#define	VX_VLIM(r) (((r) == RLIM_INFINITY) \
++		? VLIM_INFINITY : (long long)(r))
++#define	VX_RLIM(v) (((v) == VLIM_INFINITY) \
++		? RLIM_INFINITY : (rlim_t)(v))
++#endif
++
++struct sysinfo;
++
++void vx_vsi_meminfo(struct sysinfo *);
++void vx_vsi_swapinfo(struct sysinfo *);
++
++#define NUM_LIMITS	24
++
++#endif	/* __KERNEL__ */
++#endif	/* _VX_LIMIT_H */
+--- linux-2.6.22/include/linux/vserver/limit_cmd.h	1970-01-01 01:00:00 +0100
++++ linux-2.6.22-vs2.2.0-rc5/include/linux/vserver/limit_cmd.h	2007-06-15 02:37:04 +0200
+@@ -0,0 +1,69 @@
++#ifndef _VX_LIMIT_CMD_H
++#define _VX_LIMIT_CMD_H
++
++
++/*  rlimit vserver commands */
++
++#define VCMD_get_rlimit		VC_CMD(RLIMIT, 1, 0)
++#define VCMD_set_rlimit		VC_CMD(RLIMIT, 2, 0)
++#define VCMD_get_rlimit_mask	VC_CMD(RLIMIT, 3, 0)
++#define VCMD_reset_minmax	VC_CMD(RLIMIT, 9, 0)
++
++struct	vcmd_ctx_rlimit_v0 {
++	uint32_t id;
++	uint64_t minimum;
++	uint64_t softlimit;
++	uint64_t maximum;
++};
++
++struct	vcmd_ctx_rlimit_mask_v0 {
++	uint32_t minimum;
++	uint32_t softlimit;
++	uint32_t maximum;
++};
++
++#define VCMD_rlimit_stat	VC_CMD(VSTAT, 1, 0)
++
++struct	vcmd_rlimit_stat_v0 {
++	uint32_t id;
++	uint32_t hits;
++	uint64_t value;
++	uint64_t minimum;
++	uint64_t maximum;
++};
++
++#define CRLIM_UNSET		(0ULL)
++#define CRLIM_INFINITY		(~0ULL)
++#define CRLIM_KEEP		(~1ULL)
++
++#ifdef	__KERNEL__
++
++#ifdef	CONFIG_IA32_EMULATION
++
++struct	vcmd_ctx_rlimit_v0_x32 {
++	uint32_t id;
++	uint64_t minimum;
++	uint64_t softlimit;
++	uint64_t maximum;
++} __attribute__ ((aligned (4)));
++
++#endif	/* CONFIG_IA32_EMULATION */
++
++#include <linux/compiler.h>
++
++extern int vc_get_rlimit_mask(uint32_t, void __user *);
++extern int vc_get_rlimit(struct vx_info *, void __user *);
++extern int vc_set_rlimit(struct vx_info *, void __user *);
++extern int vc_reset_minmax(struct vx_info *, void __user *);
++
++extern int vc_rlimit_stat(struct vx_info *, void __user *);
++
++#ifdef	CONFIG_IA32_EMULATION
++
++extern int vc_get_rlimit_x32(struct vx_info *, void __user *);
++extern int vc_set_rlimit_x32(struct vx_info *, void __user *);
++
++#endif	/* CONFIG_IA32_EMULATION */
++
++#endif	/* __KERNEL__ */
++#endif	/* _VX_LIMIT_CMD_H */
+--- linux-2.6.22/include/linux/vserver/limit_def.h	1970-01-01 01:00:00 +0100
++++ linux-2.6.22-vs2.2.0-rc5/include/linux/vserver/limit_def.h	2007-06-15 02:37:04 +0200
+@@ -0,0 +1,47 @@
++#ifndef _VX_LIMIT_DEF_H
++#define _VX_LIMIT_DEF_H
++
++#include <asm/atomic.h>
++#include <asm/resource.h>
++
++#include "limit.h"
++
++
++struct _vx_res_limit {
++	rlim_t soft;		/* Context soft limit */
++	rlim_t hard;		/* Context hard limit */
++
++	rlim_atomic_t rcur;	/* Current value */
++	rlim_t rmin;		/* Context minimum */
++	rlim_t rmax;		/* Context maximum */
++
++	atomic_t lhit;		/* Limit hits */
++};
++
++/* context sub struct */
++
++struct _vx_limit {
++	struct _vx_res_limit res[NUM_LIMITS];
++};
++
++#ifdef CONFIG_VSERVER_DEBUG
++
++static inline void __dump_vx_limit(struct _vx_limit *limit)
++{
++	int i;
++
++	printk("\t_vx_limit:");
++	for (i = 0; i < NUM_LIMITS; i++) {
++		printk("\t [%2d] = %8lu %8lu/%8lu, %8ld/%8ld, %8d\n",
++			i, (unsigned long)__rlim_get(limit, i),
++			(unsigned long)__rlim_rmin(limit, i),
++			(unsigned long)__rlim_rmax(limit, i),
++			(long)__rlim_soft(limit, i),
++			(long)__rlim_hard(limit, i),
++			atomic_read(&__rlim_lhit(limit, i)));
++	}
++}
++
++#endif
++
++#endif	/* _VX_LIMIT_DEF_H */
+--- linux-2.6.22/include/linux/vserver/limit_int.h	1970-01-01 01:00:00 +0100
++++ linux-2.6.22-vs2.2.0-rc5/include/linux/vserver/limit_int.h	2007-06-15 02:37:04 +0200
+@@ -0,0 +1,198 @@
++#ifndef _VX_LIMIT_INT_H
++#define _VX_LIMIT_INT_H
++
++#include "context.h"
++
++#ifdef	__KERNEL__
++
++#define VXD_RCRES_COND(r)	VXD_CBIT(cres, r)
++#define VXD_RLIMIT_COND(r)	VXD_CBIT(limit, r)
++
++extern const char *vlimit_name[NUM_LIMITS];
++
++static inline void __vx_acc_cres(struct vx_info *vxi,
++	int res, int dir, void *_data, char *_file, int _line)
++{
++	if (VXD_RCRES_COND(res))
++		vxlprintk(1, "vx_acc_cres[%5d,%s,%2d]: %5ld%s (%p)",
++			(vxi ? vxi->vx_id : -1), vlimit_name[res], res,
++			(vxi ? (long)__rlim_get(&vxi->limit, res) : 0),
++			(dir > 0) ? "++" : "--", _data, _file, _line);
++	if (!vxi)
++		return;
++
++	if (dir > 0)
++		__rlim_inc(&vxi->limit, res);
++	else
++		__rlim_dec(&vxi->limit, res);
++}
++
++static inline void __vx_add_cres(struct vx_info *vxi,
++	int res, int amount, void *_data, char *_file, int _line)
++{
++	if (VXD_RCRES_COND(res))
++		vxlprintk(1, "vx_add_cres[%5d,%s,%2d]: %5ld += %5d (%p)",
++			(vxi ? vxi->vx_id : -1), vlimit_name[res], res,
++			(vxi ? (long)__rlim_get(&vxi->limit, res) : 0),
++			amount, _data, _file, _line);
++	if (amount == 0)
++		return;
++	if (!vxi)
++		return;
++	__rlim_add(&vxi->limit, res, amount);
++}
++
++static inline
++int __vx_cres_adjust_max(struct _vx_limit *limit, int res, rlim_t value)
++{
++	int cond = (value > __rlim_rmax(limit, res));
++
++	if (cond)
++		__rlim_rmax(limit, res) = value;
++	return cond;
++}
++
++static inline
++int __vx_cres_adjust_min(struct _vx_limit *limit, int res, rlim_t value)
++{
++	int cond = (value < __rlim_rmin(limit, res));
++
++	if (cond)
++		__rlim_rmin(limit, res) = value;
++	return cond;
++}
++
++static inline
++void __vx_cres_fixup(struct _vx_limit *limit, int res, rlim_t value)
++{
++	if (!__vx_cres_adjust_max(limit, res, value))
++		__vx_cres_adjust_min(limit, res, value);
++}
++
++
++/*	return values:
++	 +1 ... no limit hit
++	 -1 ... over soft limit
++	  0 ... over hard limit		*/
++
++static inline int __vx_cres_avail(struct vx_info *vxi,
++	int res, int num, char *_file, int _line)
++{
++	struct _vx_limit *limit;
++	rlim_t value;
++
++	if (VXD_RLIMIT_COND(res))
++		vxlprintk(1, "vx_cres_avail[%5d,%s,%2d]: %5ld/%5ld > %5ld + %5d",
++			(vxi ? vxi->vx_id : -1), vlimit_name[res], res,
++			(vxi ? (long)__rlim_soft(&vxi->limit, res) : -1),
++			(vxi ? (long)__rlim_hard(&vxi->limit, res) : -1),
++			(vxi ? (long)__rlim_get(&vxi->limit, res) : 0),
++			num, _file, _line);
++	if (!vxi)
++		return 1;
++
++	limit = &vxi->limit;
++	value = __rlim_get(limit, res);
++
++	if (!__vx_cres_adjust_max(limit, res, value))
++		__vx_cres_adjust_min(limit, res, value);
++
++	if (num == 0)
++		return 1;
++
++	if (__rlim_soft(limit, res) == RLIM_INFINITY)
++		return -1;
++	if (value + num <= __rlim_soft(limit, res))
++		return -1;
++
++	if (__rlim_hard(limit, res) == RLIM_INFINITY)
++		return 1;
++	if (value + num <= __rlim_hard(limit, res))
++		return 1;
++
++	__rlim_hit(limit, res);
++	return 0;
++}
++
++
++static const int VLA_RSS[] = { RLIMIT_RSS, VLIMIT_ANON, VLIMIT_MAPPED, 0 };
++
++static inline
++rlim_t __vx_cres_array_sum(struct _vx_limit *limit, const int *array)
++{
++	rlim_t value, sum = 0;
++	int res;
++
++	while ((res = *array++)) {
++		value = __rlim_get(limit, res);
++		__vx_cres_fixup(limit, res, value);
++		sum += value;
++	}
++	return sum;
++}
++
++static inline
++rlim_t __vx_cres_array_fixup(struct _vx_limit *limit, const int *array)
++{
++	rlim_t value = __vx_cres_array_sum(limit, array + 1);
++	int res = *array;
++
++	if (value == __rlim_get(limit, res))
++		return value;
++
++	__rlim_set(limit, res, value);
++	/* now adjust min/max */
++	if (!__vx_cres_adjust_max(limit, res, value))
++		__vx_cres_adjust_min(limit, res, value);
++
++	return value;
++}
++
++static inline int __vx_cres_array_avail(struct vx_info *vxi,
++	const int *array, int num, char *_file, int _line)
++{
++	struct _vx_limit *limit;
++	rlim_t value = 0;
++	int res;
++
++	if (num == 0)
++		return 1;
++	if (!vxi)
++		return 1;
++
++	limit = &vxi->limit;
++	res = *array;
++	value = __vx_cres_array_sum(limit, array + 1);
++
++	__rlim_set(limit, res, value);
++	__vx_cres_fixup(limit, res, value);
++
++	return __vx_cres_avail(vxi, res, num, _file, _line);
++}
++
++
++static inline void vx_limit_fixup(struct _vx_limit *limit, int id)
++{
++	rlim_t value;
++	int res;
++
++	/* complex resources first */
++	if ((id < 0) || (id == RLIMIT_RSS))
++		__vx_cres_array_fixup(limit, VLA_RSS);
++
++	for (res = 0; res < NUM_LIMITS; res++) {
++		if ((id > 0) && (res != id))
++			continue;
++
++		value = __rlim_get(limit, res);
++		__vx_cres_fixup(limit, res, value);
++
++		/* not supposed to happen, maybe warn? */
++		if (__rlim_rmax(limit, res) > __rlim_hard(limit, res))
++			__rlim_rmax(limit, res) = __rlim_hard(limit, res);
++	}
++}
++
++
++#endif	/* __KERNEL__ */
++#endif	/* _VX_LIMIT_INT_H */
+--- linux-2.6.22/include/linux/vserver/monitor.h	1970-01-01 01:00:00 +0100
++++ linux-2.6.22-vs2.2.0-rc5/include/linux/vserver/monitor.h	2007-06-15 02:37:04 +0200
+@@ -0,0 +1,95 @@
++#ifndef _VX_MONITOR_H
++#define _VX_MONITOR_H
++
++
++enum {
++	VXM_UNUSED = 0,
++
++	VXM_SYNC = 0x10,
++
++	VXM_UPDATE = 0x20,
++	VXM_UPDATE_1,
++	VXM_UPDATE_2,
++
++	VXM_RQINFO_1 = 0x24,
++	VXM_RQINFO_2,
++
++	VXM_ACTIVATE = 0x40,
++	VXM_DEACTIVATE,
++	VXM_IDLE,
++
++	VXM_HOLD = 0x44,
++	VXM_UNHOLD,
++
++	VXM_MIGRATE = 0x48,
++	VXM_RESCHED,
++
++	/* all other bits are flags */
++	VXM_SCHED = 0x80,
++};
++
++struct _vxm_update_1 {
++	uint32_t tokens_max;
++	uint32_t fill_rate;
++	uint32_t interval;
++};
++
++struct _vxm_update_2 {
++	uint32_t tokens_min;
++	uint32_t fill_rate;
++	uint32_t interval;
++};
++
++struct _vxm_rqinfo_1 {
++	uint16_t running;
++	uint16_t onhold;
++	uint16_t iowait;
++	uint16_t uintr;
++	uint32_t idle_tokens;
++};
++
++struct _vxm_rqinfo_2 {
++	uint32_t norm_time;
++	uint32_t idle_time;
++	uint32_t idle_skip;
++};
++
++struct _vxm_sched {
++	uint32_t tokens;
++	uint32_t norm_time;
++	uint32_t idle_time;
++};
++
++struct _vxm_task {
++	uint16_t pid;
++	uint16_t state;
++};
++
++struct _vxm_event {
++	uint32_t jif;
++	union {
++		uint32_t seq;
++		uint32_t sec;
++	};
++	union {
++		uint32_t tokens;
++		uint32_t nsec;
++		struct _vxm_task tsk;
++	};
++};
++
++struct _vx_mon_entry {
++	uint16_t type;
++	uint16_t xid;
++	union {
++		struct _vxm_event ev;
++		struct _vxm_sched sd;
++		struct _vxm_update_1 u1;
++		struct _vxm_update_2 u2;
++		struct _vxm_rqinfo_1 q1;
++		struct _vxm_rqinfo_2 q2;
++	};
++};
++
++
++#endif /* _VX_MONITOR_H */
+--- linux-2.6.22/include/linux/vserver/network.h	1970-01-01 01:00:00 +0100
++++ linux-2.6.22-vs2.2.0-rc5/include/linux/vserver/network.h	2007-06-15 02:37:04 +0200
+@@ -0,0 +1,142 @@
++#ifndef _VX_NETWORK_H
++#define _VX_NETWORK_H
++
++#include <linux/types.h>
++
++
++#define MAX_N_CONTEXT	65535	/* Arbitrary limit */
++
++#define NX_DYNAMIC_ID	((uint32_t)-1)		/* id for dynamic context */
++
++#define NB_IPV4ROOT	16
++
++
++/* network flags */
++
++#define NXF_INFO_PRIVATE	0x00000008
++
++#define NXF_STATE_SETUP		(1ULL << 32)
++#define NXF_STATE_ADMIN		(1ULL << 34)
++
++#define NXF_SC_HELPER		(1ULL << 36)
++#define NXF_PERSISTENT		(1ULL << 38)
++
++#define NXF_ONE_TIME		(0x0005ULL << 32)
++
++#define NXF_INIT_SET		(NXF_STATE_ADMIN)
++
++
++/* address types */
++
++#define NXA_TYPE_IPV4		1
++#define NXA_TYPE_IPV6		2
++
++#define NXA_MOD_BCAST		(1 << 8)
++
++#define NXA_TYPE_ANY		((uint16_t)-1)
++
++
++#ifdef	__KERNEL__
++
++#include <linux/list.h>
++#include <linux/spinlock.h>
++#include <linux/rcupdate.h>
++#include <asm/atomic.h>
++
++
++struct nx_info {
++	struct hlist_node nx_hlist;	/* linked list of nxinfos */
++	nid_t nx_id;			/* vnet id */
++	atomic_t nx_usecnt;		/* usage count */
++	atomic_t nx_tasks;		/* tasks count */
++	int nx_state;			/* context state */
++
++	uint64_t nx_flags;		/* network flag word */
++	uint64_t nx_ncaps;		/* network capabilities */
++
++	int nbipv4;
++	__u32 ipv4[NB_IPV4ROOT];	/* Process can only bind to these IPs */
++					/* The first one is used to connect */
++					/* and for bind any service */
++					/* The other must be used explicity */
++	__u32 mask[NB_IPV4ROOT];	/* Netmask for each ipv4 */
++					/* Used to select the proper source */
++					/* address for sockets */
++	__u32 v4_bcast;			/* Broadcast address to receive UDP  */
++
++	char nx_name[65];		/* network context name */
++};
++
++
++/* status flags */
++
++#define NXS_HASHED      0x0001
++#define NXS_SHUTDOWN    0x0100
++#define NXS_RELEASED    0x8000
++
++/* check conditions */
++
++#define NX_ADMIN	0x0001
++#define NX_WATCH	0x0002
++#define NX_BLEND	0x0004
++#define NX_HOSTID	0x0008
++
++#define NX_IDENT	0x0010
++#define NX_EQUIV	0x0020
++#define NX_PARENT	0x0040
++#define NX_CHILD	0x0080
++
++#define NX_ARG_MASK	0x00F0
++
++#define NX_DYNAMIC	0x0100
++#define NX_STATIC	0x0200
++
++#define NX_ATR_MASK	0x0F00
++
++
++extern struct nx_info *lookup_nx_info(int);
++
++extern int get_nid_list(int, unsigned int *, int);
++extern int nid_is_hashed(nid_t);
++
++extern int nx_migrate_task(struct task_struct *, struct nx_info *);
++
++extern long vs_net_change(struct nx_info *, unsigned int);
++
++struct in_ifaddr;
++struct net_device;
++
++#ifdef CONFIG_INET
++int ifa_in_nx_info(struct in_ifaddr *, struct nx_info *);
++int dev_in_nx_info(struct net_device *, struct nx_info *);
++
++#else /* CONFIG_INET */
++static inline
++int ifa_in_nx_info(struct in_ifaddr *a, struct nx_info *n)
++{
++	return 1;
++}
++
++static inline
++int dev_in_nx_info(struct net_device *d, struct nx_info *n)
++{
++	return 1;
++}
++#endif /* CONFIG_INET */
++
++struct sock;
++
++#ifdef CONFIG_INET
++int nx_addr_conflict(struct nx_info *, uint32_t, const struct sock *);
++#else /* CONFIG_INET */
++static inline
++int nx_addr_conflict(struct nx_info *n, uint32_t a, const struct sock *s)
++{
++	return 1;
++}
++#endif /* CONFIG_INET */
++
++#endif	/* __KERNEL__ */
++#else	/* _VX_NETWORK_H */
++#warning duplicate inclusion
++#endif	/* _VX_NETWORK_H */
+--- linux-2.6.22/include/linux/vserver/network_cmd.h	1970-01-01 01:00:00 +0100
++++ linux-2.6.22-vs2.2.0-rc5/include/linux/vserver/network_cmd.h	2007-06-15 02:37:04 +0200
+@@ -0,0 +1,89 @@
++#ifndef _VX_NETWORK_CMD_H
++#define _VX_NETWORK_CMD_H
++
++
++/* vinfo commands */
++
++#define VCMD_task_nid		VC_CMD(VINFO, 2, 0)
++
++#ifdef	__KERNEL__
++extern int vc_task_nid(uint32_t, void __user *);
++
++#endif	/* __KERNEL__ */
++
++#define VCMD_nx_info		VC_CMD(VINFO, 6, 0)
++
++struct	vcmd_nx_info_v0 {
++	uint32_t nid;
++	/* more to come */
++};
++
++#ifdef	__KERNEL__
++extern int vc_nx_info(struct nx_info *, void __user *);
++
++#endif	/* __KERNEL__ */
++
++#define VCMD_net_create_v0	VC_CMD(VNET, 1, 0)
++#define VCMD_net_create		VC_CMD(VNET, 1, 1)
++
++struct  vcmd_net_create {
++	uint64_t flagword;
++};
++
++#define VCMD_net_migrate	VC_CMD(NETMIG, 1, 0)
++
++#define VCMD_net_add		VC_CMD(NETALT, 1, 0)
++#define VCMD_net_remove		VC_CMD(NETALT, 2, 0)
++
++struct	vcmd_net_addr_v0 {
++	uint16_t type;
++	uint16_t count;
++	uint32_t ip[4];
++	uint32_t mask[4];
++	/* more to come */
++};
++
++
++#ifdef	__KERNEL__
++extern int vc_net_create(uint32_t, void __user *);
++extern int vc_net_migrate(struct nx_info *, void __user *);
++
++extern int vc_net_add(struct nx_info *, void __user *);
++extern int vc_net_remove(struct nx_info *, void __user *);
++
++#endif	/* __KERNEL__ */
++
++
++/* flag commands */
++
++#define VCMD_get_nflags		VC_CMD(FLAGS, 5, 0)
++#define VCMD_set_nflags		VC_CMD(FLAGS, 6, 0)
++
++struct	vcmd_net_flags_v0 {
++	uint64_t flagword;
++	uint64_t mask;
++};
++
++#ifdef	__KERNEL__
++extern int vc_get_nflags(struct nx_info *, void __user *);
++extern int vc_set_nflags(struct nx_info *, void __user *);
++
++#endif	/* __KERNEL__ */
++
++
++/* network caps commands */
++
++#define VCMD_get_ncaps		VC_CMD(FLAGS, 7, 0)
++#define VCMD_set_ncaps		VC_CMD(FLAGS, 8, 0)
++
++struct	vcmd_net_caps_v0 {
++	uint64_t ncaps;
++	uint64_t cmask;
++};
++
++#ifdef	__KERNEL__
++extern int vc_get_ncaps(struct nx_info *, void __user *);
++extern int vc_set_ncaps(struct nx_info *, void __user *);
++
++#endif	/* __KERNEL__ */
++#endif	/* _VX_CONTEXT_CMD_H */
+--- linux-2.6.22/include/linux/vserver/percpu.h	1970-01-01 01:00:00 +0100
++++ linux-2.6.22-vs2.2.0-rc5/include/linux/vserver/percpu.h	2007-06-15 02:37:04 +0200
+@@ -0,0 +1,14 @@
++#ifndef _VX_PERCPU_H
++#define _VX_PERCPU_H
++
++#include "cvirt_def.h"
++#include "sched_def.h"
++
++struct	_vx_percpu {
++	struct _vx_cvirt_pc cvirt;
++	struct _vx_sched_pc sched;
++};
++
++#define	PERCPU_PERCTX	(sizeof(struct _vx_percpu))
++
++#endif	/* _VX_PERCPU_H */
+--- linux-2.6.22/include/linux/vserver/sched.h	1970-01-01 01:00:00 +0100
++++ linux-2.6.22-vs2.2.0-rc5/include/linux/vserver/sched.h	2007-06-15 02:37:04 +0200
+@@ -0,0 +1,26 @@
++#ifndef _VX_SCHED_H
++#define _VX_SCHED_H
++
++
++#ifdef	__KERNEL__
++
++struct timespec;
++
++void vx_vsi_uptime(struct timespec *, struct timespec *);
++
++
++struct vx_info;
++
++void vx_update_load(struct vx_info *);
++
++
++int vx_tokens_recalc(struct _vx_sched_pc *,
++	unsigned long *, unsigned long *, int [2]);
++
++void vx_update_sched_param(struct _vx_sched *sched,
++	struct _vx_sched_pc *sched_pc);
++
++#endif	/* __KERNEL__ */
++#else	/* _VX_SCHED_H */
++#warning duplicate inclusion
++#endif	/* _VX_SCHED_H */
+--- linux-2.6.22/include/linux/vserver/sched_cmd.h	1970-01-01 01:00:00 +0100
++++ linux-2.6.22-vs2.2.0-rc5/include/linux/vserver/sched_cmd.h	2007-06-15 02:37:04 +0200
+@@ -0,0 +1,108 @@
++#ifndef _VX_SCHED_CMD_H
++#define _VX_SCHED_CMD_H
++
++
++/*  sched vserver commands */
++
++#define VCMD_set_sched_v2	VC_CMD(SCHED, 1, 2)
++#define VCMD_set_sched_v3	VC_CMD(SCHED, 1, 3)
++#define VCMD_set_sched_v4	VC_CMD(SCHED, 1, 4)
++
++struct	vcmd_set_sched_v2 {
++	int32_t fill_rate;
++	int32_t interval;
++	int32_t tokens;
++	int32_t tokens_min;
++	int32_t tokens_max;
++	uint64_t cpu_mask;
++};
++
++struct	vcmd_set_sched_v3 {
++	uint32_t set_mask;
++	int32_t fill_rate;
++	int32_t interval;
++	int32_t tokens;
++	int32_t tokens_min;
++	int32_t tokens_max;
++	int32_t priority_bias;
++};
++
++struct	vcmd_set_sched_v4 {
++	uint32_t set_mask;
++	int32_t fill_rate;
++	int32_t interval;
++	int32_t tokens;
++	int32_t tokens_min;
++	int32_t tokens_max;
++	int32_t prio_bias;
++	int32_t cpu_id;
++	int32_t bucket_id;
++};
++
++#define VCMD_set_sched		VC_CMD(SCHED, 1, 5)
++#define VCMD_get_sched		VC_CMD(SCHED, 2, 5)
++
++struct	vcmd_sched_v5 {
++	uint32_t mask;
++	int32_t cpu_id;
++	int32_t bucket_id;
++	int32_t fill_rate[2];
++	int32_t interval[2];
++	int32_t tokens;
++	int32_t tokens_min;
++	int32_t tokens_max;
++	int32_t prio_bias;
++};
++
++#define VXSM_FILL_RATE		0x0001
++#define VXSM_INTERVAL		0x0002
++#define VXSM_FILL_RATE2		0x0004
++#define VXSM_INTERVAL2		0x0008
++#define VXSM_TOKENS		0x0010
++#define VXSM_TOKENS_MIN		0x0020
++#define VXSM_TOKENS_MAX		0x0040
++#define VXSM_PRIO_BIAS		0x0100
++
++#define VXSM_IDLE_TIME		0x0200
++#define VXSM_FORCE		0x0400
++
++#define	VXSM_V3_MASK		0x0173
++#define	VXSM_SET_MASK		0x01FF
++
++#define VXSM_CPU_ID		0x1000
++#define VXSM_BUCKET_ID		0x2000
++
++#define VXSM_MSEC		0x4000
++
++#define SCHED_KEEP		(-2)	/* only for v2 */
++
++#ifdef	__KERNEL__
++
++#include <linux/compiler.h>
++
++extern int vc_set_sched_v2(struct vx_info *, void __user *);
++extern int vc_set_sched_v3(struct vx_info *, void __user *);
++extern int vc_set_sched_v4(struct vx_info *, void __user *);
++extern int vc_set_sched(struct vx_info *, void __user *);
++extern int vc_get_sched(struct vx_info *, void __user *);
++
++#endif	/* __KERNEL__ */
++
++#define VCMD_sched_info		VC_CMD(SCHED, 3, 0)
++
++struct	vcmd_sched_info {
++	int32_t cpu_id;
++	int32_t bucket_id;
++	uint64_t user_msec;
++	uint64_t sys_msec;
++	uint64_t hold_msec;
++	uint32_t token_usec;
++	int32_t vavavoom;
++};
++
++#ifdef	__KERNEL__
++
++extern int vc_sched_info(struct vx_info *, void __user *);
++
++#endif	/* __KERNEL__ */
++#endif	/* _VX_SCHED_CMD_H */
+--- linux-2.6.22/include/linux/vserver/sched_def.h	1970-01-01 01:00:00 +0100
++++ linux-2.6.22-vs2.2.0-rc5/include/linux/vserver/sched_def.h	2007-06-15 02:37:04 +0200
+@@ -0,0 +1,68 @@
++#ifndef _VX_SCHED_DEF_H
++#define _VX_SCHED_DEF_H
++
++#include <linux/spinlock.h>
++#include <linux/jiffies.h>
++#include <linux/cpumask.h>
++#include <asm/atomic.h>
++#include <asm/param.h>
++
++
++/* context sub struct */
++
++struct _vx_sched {
++	spinlock_t tokens_lock;		/* lock for token bucket */
++
++	int tokens;			/* number of CPU tokens */
++	int fill_rate[2];		/* Fill rate: add X tokens... */
++	int interval[2];		/* Divisor:   per Y jiffies   */
++	int tokens_min;			/* Limit:     minimum for unhold */
++	int tokens_max;			/* Limit:     no more than N tokens */
++
++	int prio_bias;			/* bias offset for priority */
++
++	unsigned update_mask;		/* which features should be updated */
++	cpumask_t update;		/* CPUs which should update */
++};
++
++struct _vx_sched_pc {
++	int tokens;			/* number of CPU tokens */
++	int flags;			/* bucket flags */
++
++	int fill_rate[2];		/* Fill rate: add X tokens... */
++	int interval[2];		/* Divisor:   per Y jiffies   */
++	int tokens_min;			/* Limit:     minimum for unhold */
++	int tokens_max;			/* Limit:     no more than N tokens */
++
++	int prio_bias;			/* bias offset for priority */
++	int vavavoom;			/* last calculated vavavoom */
++
++	unsigned long norm_time;	/* last time accounted */
++	unsigned long idle_time;	/* non linear time for fair sched */
++	unsigned long token_time;	/* token time for accounting */
++	unsigned long onhold;		/* jiffies when put on hold */
++
++	uint64_t user_ticks;		/* token tick events */
++	uint64_t sys_ticks;		/* token tick events */
++	uint64_t hold_ticks;		/* token ticks paused */
++};
++
++
++#define VXSF_ONHOLD	0x0001
++#define VXSF_IDLE_TIME	0x0100
++
++#ifdef CONFIG_VSERVER_DEBUG
++
++static inline void __dump_vx_sched(struct _vx_sched *sched)
++{
++	printk("\t_vx_sched:\n");
++	printk("\t tokens: %4d/%4d, %4d/%4d, %4d, %4d\n",
++		sched->fill_rate[0], sched->interval[0],
++		sched->fill_rate[1], sched->interval[1],
++		sched->tokens_min, sched->tokens_max);
++	printk("\t priority = %4d\n", sched->prio_bias);
++}
++
++#endif
++
++#endif	/* _VX_SCHED_DEF_H */
+--- linux-2.6.22/include/linux/vserver/signal.h	1970-01-01 01:00:00 +0100
++++ linux-2.6.22-vs2.2.0-rc5/include/linux/vserver/signal.h	2007-06-15 02:37:04 +0200
+@@ -0,0 +1,14 @@
++#ifndef _VX_SIGNAL_H
++#define _VX_SIGNAL_H
++
++
++#ifdef	__KERNEL__
++
++struct vx_info;
++
++int vx_info_kill(struct vx_info *, int, int);
++
++#endif	/* __KERNEL__ */
++#else	/* _VX_SIGNAL_H */
++#warning duplicate inclusion
++#endif	/* _VX_SIGNAL_H */
+--- linux-2.6.22/include/linux/vserver/signal_cmd.h	1970-01-01 01:00:00 +0100
++++ linux-2.6.22-vs2.2.0-rc5/include/linux/vserver/signal_cmd.h	2007-06-15 02:37:04 +0200
+@@ -0,0 +1,43 @@
++#ifndef _VX_SIGNAL_CMD_H
++#define _VX_SIGNAL_CMD_H
++
++
++/*  signalling vserver commands */
++
++#define VCMD_ctx_kill		VC_CMD(PROCTRL, 1, 0)
++#define VCMD_wait_exit		VC_CMD(EVENT, 99, 0)
++
++struct	vcmd_ctx_kill_v0 {
++	int32_t pid;
++	int32_t sig;
++};
++
++struct	vcmd_wait_exit_v0 {
++	int32_t reboot_cmd;
++	int32_t exit_code;
++};
++
++#ifdef	__KERNEL__
++
++extern int vc_ctx_kill(struct vx_info *, void __user *);
++extern int vc_wait_exit(struct vx_info *, void __user *);
++
++#endif	/* __KERNEL__ */
++
++/*  process alteration commands */
++
++#define VCMD_get_pflags		VC_CMD(PROCALT, 5, 0)
++#define VCMD_set_pflags		VC_CMD(PROCALT, 6, 0)
++
++struct	vcmd_pflags_v0 {
++	uint32_t flagword;
++	uint32_t mask;
++};
++
++#ifdef	__KERNEL__
++
++extern int vc_get_pflags(uint32_t pid, void __user *);
++extern int vc_set_pflags(uint32_t pid, void __user *);
++
++#endif	/* __KERNEL__ */
++#endif	/* _VX_SIGNAL_CMD_H */
+--- linux-2.6.22/include/linux/vserver/space.h	1970-01-01 01:00:00 +0100
++++ linux-2.6.22-vs2.2.0-rc5/include/linux/vserver/space.h	2007-06-15 02:37:04 +0200
+@@ -0,0 +1,13 @@
++#ifndef _VX_SPACE_H
++#define _VX_SPACE_H
++
++
++#include <linux/types.h>
++
++struct vx_info;
++
++int vx_set_space(struct vx_info *vxi, unsigned long mask);
++
++#else	/* _VX_SPACE_H */
++#warning duplicate inclusion
++#endif	/* _VX_SPACE_H */
+--- linux-2.6.22/include/linux/vserver/space_cmd.h	1970-01-01 01:00:00 +0100
++++ linux-2.6.22-vs2.2.0-rc5/include/linux/vserver/space_cmd.h	2007-06-15 02:37:04 +0200
+@@ -0,0 +1,26 @@
++#ifndef _VX_SPACE_CMD_H
++#define _VX_SPACE_CMD_H
++
++
++#define VCMD_enter_space_v0	VC_CMD(PROCALT, 1, 0)
++#define VCMD_enter_space	VC_CMD(PROCALT, 1, 1)
++
++#define VCMD_set_space_v0	VC_CMD(PROCALT, 3, 0)
++#define VCMD_set_space		VC_CMD(PROCALT, 3, 1)
++
++#define VCMD_get_space_mask	VC_CMD(PROCALT, 4, 0)
++
++
++struct	vcmd_space_mask {
++	uint64_t mask;
++};
++
++
++#ifdef	__KERNEL__
++
++extern int vc_enter_space(struct vx_info *, void __user *);
++extern int vc_set_space(struct vx_info *, void __user *);
++extern int vc_get_space_mask(struct vx_info *, void __user *);
++
++#endif	/* __KERNEL__ */
++#endif	/* _VX_SPACE_CMD_H */
+--- linux-2.6.22/include/linux/vserver/switch.h	1970-01-01 01:00:00 +0100
++++ linux-2.6.22-vs2.2.0-rc5/include/linux/vserver/switch.h	2007-06-15 02:37:04 +0200
+@@ -0,0 +1,95 @@
++#ifndef _VX_SWITCH_H
++#define _VX_SWITCH_H
++
++#include <linux/types.h>
++
++
++#define VC_CATEGORY(c)		(((c) >> 24) & 0x3F)
++#define VC_COMMAND(c)		(((c) >> 16) & 0xFF)
++#define VC_VERSION(c)		((c) & 0xFFF)
++
++#define VC_CMD(c, i, v)		((((VC_CAT_ ## c) & 0x3F) << 24) \
++				| (((i) & 0xFF) << 16) | ((v) & 0xFFF))
++
++/*
++
++  Syscall Matrix V2.8
++
++	 |VERSION|CREATE |MODIFY |MIGRATE|CONTROL|EXPERIM| |SPECIAL|SPECIAL|
++	 |STATS  |DESTROY|ALTER  |CHANGE |LIMIT  |TEST   | |       |       |
++	 |INFO   |SETUP  |       |MOVE   |       |       | |       |       |
++  -------+-------+-------+-------+-------+-------+-------+ +-------+-------+
++  SYSTEM |VERSION|VSETUP |VHOST  |       |       |       | |DEVICES|       |
++  HOST   |     00|     01|     02|     03|     04|     05| |     06|     07|
++  -------+-------+-------+-------+-------+-------+-------+ +-------+-------+
++  CPU    |       |VPROC  |PROCALT|PROCMIG|PROCTRL|       | |SCHED. |       |
++  PROCESS|     08|     09|     10|     11|     12|     13| |     14|     15|
++  -------+-------+-------+-------+-------+-------+-------+ +-------+-------+
++  MEMORY |       |       |       |       |       |       | |SWAP   |       |
++	 |     16|     17|     18|     19|     20|     21| |     22|     23|
++  -------+-------+-------+-------+-------+-------+-------+ +-------+-------+
++  NETWORK|       |VNET   |NETALT |NETMIG |NETCTL |       | |SERIAL |       |
++	 |     24|     25|     26|     27|     28|     29| |     30|     31|
++  -------+-------+-------+-------+-------+-------+-------+ +-------+-------+
++  DISK   |       |       |       |       |DLIMIT |       | |INODE  |       |
++  VFS    |     32|     33|     34|     35|     36|     37| |     38|     39|
++  -------+-------+-------+-------+-------+-------+-------+ +-------+-------+
++  OTHER  |VSTAT  |       |       |       |       |       | |VINFO  |       |
++	 |     40|     41|     42|     43|     44|     45| |     46|     47|
++  =======+=======+=======+=======+=======+=======+=======+ +=======+=======+
++  SPECIAL|EVENT  |       |       |       |FLAGS  |       | |       |       |
++	 |     48|     49|     50|     51|     52|     53| |     54|     55|
++  -------+-------+-------+-------+-------+-------+-------+ +-------+-------+
++  SPECIAL|DEBUG  |       |       |       |RLIMIT |SYSCALL| |       |COMPAT |
++	 |     56|     57|     58|     59|     60|TEST 61| |     62|     63|
++  -------+-------+-------+-------+-------+-------+-------+ +-------+-------+
++
++*/
++
++#define VC_CAT_VERSION		0
++
++#define VC_CAT_VSETUP		1
++#define VC_CAT_VHOST		2
++
++#define VC_CAT_VPROC		9
++#define VC_CAT_PROCALT		10
++#define VC_CAT_PROCMIG		11
++#define VC_CAT_PROCTRL		12
++
++#define VC_CAT_SCHED		14
++
++#define VC_CAT_VNET		25
++#define VC_CAT_NETALT		26
++#define VC_CAT_NETMIG		27
++#define VC_CAT_NETCTRL		28
++
++#define VC_CAT_DLIMIT		36
++#define VC_CAT_INODE		38
++
++#define VC_CAT_VSTAT		40
++#define VC_CAT_VINFO		46
++#define VC_CAT_EVENT		48
++
++#define VC_CAT_FLAGS		52
++#define VC_CAT_DEBUG		56
++#define VC_CAT_RLIMIT		60
++
++#define VC_CAT_SYSTEST		61
++#define VC_CAT_COMPAT		63
++
++/*  query version */
++
++#define VCMD_get_version	VC_CMD(VERSION, 0, 0)
++#define VCMD_get_vci		VC_CMD(VERSION, 1, 0)
++
++
++#ifdef	__KERNEL__
++
++#include <linux/errno.h>
++
++
++#else	/* __KERNEL__ */
++#define __user
++#endif	/* __KERNEL__ */
++
++#endif	/* _VX_SWITCH_H */
+--- linux-2.6.22/include/linux/vserver/tag.h	1970-01-01 01:00:00 +0100
++++ linux-2.6.22-vs2.2.0-rc5/include/linux/vserver/tag.h	2007-06-15 02:37:04 +0200
+@@ -0,0 +1,140 @@
++#ifndef _DX_TAG_H
++#define _DX_TAG_H
++
++
++#define DX_TAG(in)	(IS_TAGGED(in))
++
++
++#ifdef CONFIG_DX_TAG_NFSD
++#define DX_TAG_NFSD	1
++#else
++#define DX_TAG_NFSD	0
++#endif
++
++
++#ifdef CONFIG_TAGGING_NONE
++
++#define MAX_UID		0xFFFFFFFF
++#define MAX_GID		0xFFFFFFFF
++
++#define INOTAG_TAG(cond, uid, gid, tag)	(0)
++
++#define TAGINO_UID(cond, uid, tag)	(uid)
++#define TAGINO_GID(cond, gid, tag)	(gid)
++
++#endif
++
++
++#ifdef CONFIG_TAGGING_GID16
++
++#define MAX_UID		0xFFFFFFFF
++#define MAX_GID		0x0000FFFF
++
++#define INOTAG_TAG(cond, uid, gid, tag)	\
++	((cond) ? (((gid) >> 16) & 0xFFFF) : 0)
++
++#define TAGINO_UID(cond, uid, tag)	(uid)
++#define TAGINO_GID(cond, gid, tag)	\
++	((cond) ? (((gid) & 0xFFFF) | ((tag) << 16)) : (gid))
++
++#endif
++
++
++#ifdef CONFIG_TAGGING_ID24
++
++#define MAX_UID		0x00FFFFFF
++#define MAX_GID		0x00FFFFFF
++
++#define INOTAG_TAG(cond, uid, gid, tag)	\
++	((cond) ? ((((uid) >> 16) & 0xFF00) | (((gid) >> 24) & 0xFF)) : 0)
++
++#define TAGINO_UID(cond, uid, tag)	\
++	((cond) ? (((uid) & 0xFFFFFF) | (((tag) & 0xFF00) << 16)) : (uid))
++#define TAGINO_GID(cond, gid, tag)	\
++	((cond) ? (((gid) & 0xFFFFFF) | (((tag) & 0x00FF) << 24)) : (gid))
++
++#endif
++
++
++#ifdef CONFIG_TAGGING_UID16
++
++#define MAX_UID		0x0000FFFF
++#define MAX_GID		0xFFFFFFFF
++
++#define INOTAG_TAG(cond, uid, gid, tag)	\
++	((cond) ? (((uid) >> 16) & 0xFFFF) : 0)
++
++#define TAGINO_UID(cond, uid, tag)	\
++	((cond) ? (((uid) & 0xFFFF) | ((tag) << 16)) : (uid))
++#define TAGINO_GID(cond, gid, tag)	(gid)
++
++#endif
++
++
++#ifdef CONFIG_TAGGING_INTERN
++
++#define MAX_UID		0xFFFFFFFF
++#define MAX_GID		0xFFFFFFFF
++
++#define INOTAG_TAG(cond, uid, gid, tag)	\
++	((cond) ? (tag) : 0)
++
++#define TAGINO_UID(cond, uid, tag)	(uid)
++#define TAGINO_GID(cond, gid, tag)	(gid)
++
++#endif
++
++
++#ifndef CONFIG_TAGGING_NONE
++#define dx_current_fstag(sb)	\
++	((sb)->s_flags & MS_TAGGED ? dx_current_tag() : 0)
++#else
++#define dx_current_fstag(sb)	(0)
++#endif
++
++#ifndef CONFIG_TAGGING_INTERN
++#define TAGINO_TAG(cond, tag)	(0)
++#else
++#define TAGINO_TAG(cond, tag)	((cond) ? (tag) : 0)
++#endif
++
++#define INOTAG_UID(cond, uid, gid)	\
++	((cond) ? ((uid) & MAX_UID) : (uid))
++#define INOTAG_GID(cond, uid, gid)	\
++	((cond) ? ((gid) & MAX_GID) : (gid))
++
++
++static inline uid_t dx_map_uid(uid_t uid)
++{
++	if ((uid > MAX_UID) && (uid != -1))
++		uid = -2;
++	return (uid & MAX_UID);
++}
++
++static inline gid_t dx_map_gid(gid_t gid)
++{
++	if ((gid > MAX_GID) && (gid != -1))
++		gid = -2;
++	return (gid & MAX_GID);
++}
++
++
++#ifdef	CONFIG_VSERVER_LEGACY
++#define FIOC_GETTAG	_IOR('x', 1, long)
++#define FIOC_SETTAG	_IOW('x', 2, long)
++#define FIOC_SETTAGJ	_IOW('x', 3, long)
++#endif
++
++#ifdef	CONFIG_PROPAGATE
++
++int dx_parse_tag(char *string, tag_t *tag, int remove);
++
++void __dx_propagate_tag(struct nameidata *nd, struct inode *inode);
++
++#define dx_propagate_tag(n, i)	__dx_propagate_tag(n, i)
++
++#else
++#define dx_propagate_tag(n, i)	do { } while (0)
++#endif
++
++#endif /* _DX_TAG_H */
+--- linux-2.6.22/include/net/af_unix.h	2007-07-09 13:20:01 +0200
++++ linux-2.6.22-vs2.2.0-rc5/include/net/af_unix.h	2007-06-15 02:37:04 +0200
+@@ -4,6 +4,7 @@
+ #include <linux/socket.h>
+ #include <linux/un.h>
+ #include <linux/mutex.h>
++#include <linux/vs_base.h>
+ #include <net/sock.h>
+ 
+ extern void unix_inflight(struct file *fp);
+@@ -17,9 +18,9 @@ extern spinlock_t unix_table_lock;
+ 
+ extern atomic_t unix_tot_inflight;
+ 
+-static inline struct sock *first_unix_socket(int *i)
++static inline struct sock *next_unix_socket_table(int *i)
+ {
+-	for (*i = 0; *i <= UNIX_HASH_SIZE; (*i)++) {
++	for ((*i)++; *i <= UNIX_HASH_SIZE; (*i)++) {
+ 		if (!hlist_empty(&unix_socket_table[*i]))
+ 			return __sk_head(&unix_socket_table[*i]);
+ 	}
+@@ -28,16 +29,19 @@ static inline struct sock *first_unix_so
+ 
+ static inline struct sock *next_unix_socket(int *i, struct sock *s)
+ {
+-	struct sock *next = sk_next(s);
+-	/* More in this chain? */
+-	if (next)
+-		return next;
+-	/* Look for next non-empty chain. */
+-	for ((*i)++; *i <= UNIX_HASH_SIZE; (*i)++) {
+-		if (!hlist_empty(&unix_socket_table[*i]))
+-			return __sk_head(&unix_socket_table[*i]);
+-	}
+-	return NULL;
++	do {
++		if (s)
++			s = sk_next(s);
++		if (!s)
++			s = next_unix_socket_table(i);
++	} while (s && !nx_check(s->sk_nid, VS_WATCH_P | VS_IDENT));
++	return s;
++}
++
++static inline struct sock *first_unix_socket(int *i)
++{
++	*i = 0;
++	return next_unix_socket(i, NULL);
+ }
+ 
+ #define forall_unix_sockets(i, s) \
+--- linux-2.6.22/include/net/inet_hashtables.h	2007-05-02 19:25:35 +0200
++++ linux-2.6.22-vs2.2.0-rc5/include/net/inet_hashtables.h	2007-06-15 02:37:04 +0200
+@@ -271,6 +271,26 @@ static inline int inet_iif(const struct 
+ 	return ((struct rtable *)skb->dst)->rt_iif;
+ }
+ 
++/*
++ *      Check if a given address matches for an inet socket
++ *
++ *      nxi:	the socket's nx_info if any
++ *      addr:	to be verified address
++ *      saddr:	socket addresses
++ */
++static inline int inet_addr_match (
++	struct nx_info *nxi,
++	uint32_t addr,
++	uint32_t saddr)
++{
++	if (addr && (saddr == addr))
++		return 1;
++	if (!saddr)
++		return addr_in_nx_info(nxi, addr);
++	return 0;
++}
++
++
+ extern struct sock *__inet_lookup_listener(struct inet_hashinfo *hashinfo,
+ 					   const __be32 daddr,
+ 					   const unsigned short hnum,
+--- linux-2.6.22/include/net/inet_sock.h	2007-07-09 13:20:01 +0200
++++ linux-2.6.22-vs2.2.0-rc5/include/net/inet_sock.h	2007-06-15 02:37:04 +0200
+@@ -113,6 +113,7 @@ struct inet_sock {
+ 	/* Socket demultiplex comparisons on incoming packets. */
+ 	__be32			daddr;
+ 	__be32			rcv_saddr;
++	__be32			rcv_saddr2;	/* Second bound ipv4 addr, for ipv4root */
+ 	__be16			dport;
+ 	__u16			num;
+ 	__be32			saddr;
+--- linux-2.6.22/include/net/inet_timewait_sock.h	2007-05-02 19:25:35 +0200
++++ linux-2.6.22-vs2.2.0-rc5/include/net/inet_timewait_sock.h	2007-06-15 02:37:04 +0200
+@@ -115,6 +115,10 @@ struct inet_timewait_sock {
+ #define tw_refcnt		__tw_common.skc_refcnt
+ #define tw_hash			__tw_common.skc_hash
+ #define tw_prot			__tw_common.skc_prot
++#define tw_xid		__tw_common.skc_xid
++#define tw_vx_info		__tw_common.skc_vx_info
++#define tw_nid		__tw_common.skc_nid
++#define tw_nx_info		__tw_common.skc_nx_info
+ 	volatile unsigned char	tw_substate;
+ 	/* 3 bits hole, try to pack */
+ 	unsigned char		tw_rcv_wscale;
+--- linux-2.6.22/include/net/route.h	2007-05-02 19:25:35 +0200
++++ linux-2.6.22-vs2.2.0-rc5/include/net/route.h	2007-06-15 02:37:04 +0200
+@@ -27,12 +27,16 @@
+ #include <net/dst.h>
+ #include <net/inetpeer.h>
+ #include <net/flow.h>
++#include <net/inet_sock.h>
+ #include <linux/in_route.h>
+ #include <linux/rtnetlink.h>
+ #include <linux/route.h>
+ #include <linux/ip.h>
+ #include <linux/cache.h>
+ #include <linux/security.h>
++#include <linux/vs_base.h>
++#include <linux/vs_network.h>
++#include <linux/in.h>
+ 
+ #ifndef __KERNEL__
+ #warning This file is not supposed to be used outside of kernel.
+@@ -143,6 +147,59 @@ static inline char rt_tos2priority(u8 to
+ 	return ip_tos2prio[IPTOS_TOS(tos)>>1];
+ }
+ 
++#define IPI_LOOPBACK	htonl(INADDR_LOOPBACK)
++
++static inline int ip_find_src(struct nx_info *nxi, struct rtable **rp, struct flowi *fl)
++{
++	int err;
++	int i, n = nxi->nbipv4;
++	u32 ipv4root = nxi->ipv4[0];
++
++	if (ipv4root == 0)
++		return 0;
++
++	if (fl->fl4_src == 0) {
++		if (n > 1) {
++			u32 foundsrc;
++
++			err = __ip_route_output_key(rp, fl);
++			if (err) {
++				fl->fl4_src = ipv4root;
++				err = __ip_route_output_key(rp, fl);
++			}
++			if (err)
++				return err;
++
++			foundsrc = (*rp)->rt_src;
++			ip_rt_put(*rp);
++
++			for (i=0; i<n; i++){
++				u32 mask = nxi->mask[i];
++				u32 ipv4 = nxi->ipv4[i];
++				u32 net4 = ipv4 & mask;
++
++				if (foundsrc == ipv4) {
++					fl->fl4_src = ipv4;
++					break;
++				}
++				if (!fl->fl4_src && (foundsrc & mask) == net4)
++					fl->fl4_src = ipv4;
++			}
++		}
++		if (fl->fl4_src == 0)
++			fl->fl4_src = (fl->fl4_dst == IPI_LOOPBACK)
++				? IPI_LOOPBACK : ipv4root;
++	} else {
++		for (i=0; i<n; i++) {
++			if (nxi->ipv4[i] == fl->fl4_src)
++				break;
++		}
++		if (i == n)
++			return -EPERM;
++	}
++	return 0;
++}
++
+ static inline int ip_route_connect(struct rtable **rp, __be32 dst,
+ 				   __be32 src, u32 tos, int oif, u8 protocol,
+ 				   __be16 sport, __be16 dport, struct sock *sk,
+@@ -158,7 +215,27 @@ static inline int ip_route_connect(struc
+ 					 .dport = dport } } };
+ 
+ 	int err;
+-	if (!dst || !src) {
++	struct nx_info *nx_info = current->nx_info;
++
++	if (sk)
++		nx_info = sk->sk_nx_info;
++	vxdprintk(VXD_CBIT(net, 4),
++		"ip_route_connect(%p) %p,%p;%lx",
++		sk, nx_info, sk->sk_socket,
++		(sk->sk_socket?sk->sk_socket->flags:0));
++
++	if (nx_info) {
++		err = ip_find_src(nx_info, rp, &fl);
++		if (err)
++			return err;
++		if (fl.fl4_dst == IPI_LOOPBACK && !nx_check(0, VS_ADMIN))
++			fl.fl4_dst = nx_info->ipv4[0];
++#ifdef CONFIG_VSERVER_REMAP_SADDR
++		if (fl.fl4_src == IPI_LOOPBACK && !nx_check(0, VS_ADMIN))
++			fl.fl4_src = nx_info->ipv4[0];
++#endif
++	}
++	if (!fl.fl4_dst || !fl.fl4_src) {
+ 		err = __ip_route_output_key(rp, &fl);
+ 		if (err)
+ 			return err;
+--- linux-2.6.22/include/net/sock.h	2007-07-09 13:20:02 +0200
++++ linux-2.6.22-vs2.2.0-rc5/include/net/sock.h	2007-06-15 02:37:04 +0200
+@@ -119,6 +119,10 @@ struct sock_common {
+ 	atomic_t		skc_refcnt;
+ 	unsigned int		skc_hash;
+ 	struct proto		*skc_prot;
++	xid_t			skc_xid;
++	struct vx_info		*skc_vx_info;
++	nid_t			skc_nid;
++	struct nx_info		*skc_nx_info;
+ };
+ 
+ /**
+@@ -195,6 +199,10 @@ struct sock {
+ #define sk_refcnt		__sk_common.skc_refcnt
+ #define sk_hash			__sk_common.skc_hash
+ #define sk_prot			__sk_common.skc_prot
++#define sk_xid			__sk_common.skc_xid
++#define sk_vx_info		__sk_common.skc_vx_info
++#define sk_nid			__sk_common.skc_nid
++#define sk_nx_info		__sk_common.skc_nx_info
+ 	unsigned char		sk_shutdown : 2,
+ 				sk_no_check : 2,
+ 				sk_userlocks : 4;
+--- linux-2.6.22/init/main.c	2007-07-09 13:20:03 +0200
++++ linux-2.6.22-vs2.2.0-rc5/init/main.c	2007-06-15 04:03:00 +0200
+@@ -55,6 +55,7 @@
+ #include <linux/pid_namespace.h>
+ #include <linux/device.h>
+ #include <linux/kthread.h>
++#include <linux/vserver/percpu.h>
+ 
+ #include <asm/io.h>
+ #include <asm/bugs.h>
+@@ -364,12 +365,14 @@ EXPORT_SYMBOL(__per_cpu_offset);
+ 
+ static void __init setup_per_cpu_areas(void)
+ {
+-	unsigned long size, i;
++	unsigned long size, vspc, i;
+ 	char *ptr;
+ 	unsigned long nr_possible_cpus = num_possible_cpus();
+ 
++	vspc = PERCPU_PERCTX * CONFIG_VSERVER_CONTEXTS;
++
+ 	/* Copy section for each CPU (we discard the original) */
+-	size = ALIGN(PERCPU_ENOUGH_ROOM, PAGE_SIZE);
++	size = ALIGN(PERCPU_ENOUGH_ROOM + vspc, PAGE_SIZE);
+ 	ptr = alloc_bootmem_pages(size * nr_possible_cpus);
+ 
+ 	for_each_possible_cpu(i) {
+--- linux-2.6.22/ipc/mqueue.c	2007-07-09 13:20:03 +0200
++++ linux-2.6.22-vs2.2.0-rc5/ipc/mqueue.c	2007-06-15 02:37:04 +0200
+@@ -29,6 +29,8 @@
+ #include <linux/audit.h>
+ #include <linux/signal.h>
+ #include <linux/mutex.h>
++#include <linux/vs_context.h>
++#include <linux/vs_limit.h>
+ 
+ #include <net/sock.h>
+ #include "util.h"
+@@ -151,17 +153,20 @@ static struct inode *mqueue_get_inode(st
+ 			spin_lock(&mq_lock);
+ 			if (u->mq_bytes + mq_bytes < u->mq_bytes ||
+ 		 	    u->mq_bytes + mq_bytes >
+-			    p->signal->rlim[RLIMIT_MSGQUEUE].rlim_cur) {
++			    p->signal->rlim[RLIMIT_MSGQUEUE].rlim_cur ||
++			    !vx_ipcmsg_avail(p->vx_info, mq_bytes)) {
+ 				spin_unlock(&mq_lock);
+ 				goto out_inode;
+ 			}
+ 			u->mq_bytes += mq_bytes;
++			vx_ipcmsg_add(p->vx_info, u, mq_bytes);
+ 			spin_unlock(&mq_lock);
+ 
+ 			info->messages = kmalloc(mq_msg_tblsz, GFP_KERNEL);
+ 			if (!info->messages) {
+ 				spin_lock(&mq_lock);
+ 				u->mq_bytes -= mq_bytes;
++				vx_ipcmsg_sub(p->vx_info, u, mq_bytes);
+ 				spin_unlock(&mq_lock);
+ 				goto out_inode;
+ 			}
+@@ -257,10 +262,14 @@ static void mqueue_delete_inode(struct i
+ 		   (info->attr.mq_maxmsg * info->attr.mq_msgsize));
+ 	user = info->user;
+ 	if (user) {
++		struct vx_info *vxi = lookup_vx_info(user->xid);
++
+ 		spin_lock(&mq_lock);
+ 		user->mq_bytes -= mq_bytes;
++		vx_ipcmsg_sub(vxi, user, mq_bytes);
+ 		queues_count--;
+ 		spin_unlock(&mq_lock);
++		put_vx_info(vxi);
+ 		free_uid(user);
+ 	}
+ }
+@@ -748,7 +757,7 @@ asmlinkage long sys_mq_unlink(const char
+ 	if (inode)
+ 		atomic_inc(&inode->i_count);
+ 
+-	err = vfs_unlink(dentry->d_parent->d_inode, dentry);
++	err = vfs_unlink(dentry->d_parent->d_inode, dentry, NULL);
+ out_err:
+ 	dput(dentry);
+ 
+--- linux-2.6.22/ipc/msg.c	2007-02-06 03:01:55 +0100
++++ linux-2.6.22-vs2.2.0-rc5/ipc/msg.c	2007-06-15 02:37:04 +0200
+@@ -36,6 +36,7 @@
+ #include <linux/seq_file.h>
+ #include <linux/mutex.h>
+ #include <linux/nsproxy.h>
++#include <linux/vs_base.h>
+ 
+ #include <asm/current.h>
+ #include <asm/uaccess.h>
+@@ -149,6 +150,7 @@ static int newque (struct ipc_namespace 
+ 
+ 	msq->q_perm.mode = msgflg & S_IRWXUGO;
+ 	msq->q_perm.key = key;
++	msq->q_perm.xid = vx_current_xid();
+ 
+ 	msq->q_perm.security = NULL;
+ 	retval = security_msg_queue_alloc(msq);
+--- linux-2.6.22/ipc/sem.c	2007-07-09 13:20:03 +0200
++++ linux-2.6.22-vs2.2.0-rc5/ipc/sem.c	2007-06-15 02:37:04 +0200
+@@ -82,6 +82,8 @@
+ #include <linux/seq_file.h>
+ #include <linux/mutex.h>
+ #include <linux/nsproxy.h>
++#include <linux/vs_base.h>
++#include <linux/vs_limit.h>
+ 
+ #include <asm/uaccess.h>
+ #include "util.h"
+@@ -229,6 +231,7 @@ static int newary (struct ipc_namespace 
+ 
+ 	sma->sem_perm.mode = (semflg & S_IRWXUGO);
+ 	sma->sem_perm.key = key;
++	sma->sem_perm.xid = vx_current_xid();
+ 
+ 	sma->sem_perm.security = NULL;
+ 	retval = security_sem_alloc(sma);
+@@ -244,6 +247,9 @@ static int newary (struct ipc_namespace 
+ 		return -ENOSPC;
+ 	}
+ 	ns->used_sems += nsems;
++	/* FIXME: obsoleted? */
++	vx_semary_inc(sma);
++	vx_nsems_add(sma, nsems);
+ 
+ 	sma->sem_id = sem_buildid(ns, id, sma->sem_perm.seq);
+ 	sma->sem_base = (struct sem *) &sma[1];
+@@ -525,6 +531,9 @@ static void freeary (struct ipc_namespac
+ 	sem_unlock(sma);
+ 
+ 	ns->used_sems -= sma->sem_nsems;
++	/* FIXME: obsoleted? */
++	vx_nsems_sub(sma, sma->sem_nsems);
++	vx_semary_dec(sma);
+ 	size = sizeof (*sma) + sma->sem_nsems * sizeof (struct sem);
+ 	security_sem_free(sma);
+ 	ipc_rcu_putref(sma);
+--- linux-2.6.22/ipc/shm.c	2007-07-09 13:20:03 +0200
++++ linux-2.6.22-vs2.2.0-rc5/ipc/shm.c	2007-06-17 05:54:20 +0200
+@@ -38,6 +38,8 @@
+ #include <linux/mutex.h>
+ #include <linux/nsproxy.h>
+ #include <linux/mount.h>
++#include <linux/vs_context.h>
++#include <linux/vs_limit.h>
+ 
+ #include <asm/uaccess.h>
+ 
+@@ -185,7 +187,12 @@ static void shm_open(struct vm_area_stru
+  */
+ static void shm_destroy(struct ipc_namespace *ns, struct shmid_kernel *shp)
+ {
+-	ns->shm_tot -= (shp->shm_segsz + PAGE_SIZE - 1) >> PAGE_SHIFT;
++	struct vx_info *vxi = lookup_vx_info(shp->shm_perm.xid);
++	int numpages = (shp->shm_segsz + PAGE_SIZE - 1) >> PAGE_SHIFT;
++
++	vx_ipcshm_sub(vxi, shp, numpages);
++	ns->shm_tot -= numpages;
++
+ 	shm_rmid(ns, shp->id);
+ 	shm_unlock(shp);
+ 	if (!is_file_hugepages(shp->shm_file))
+@@ -195,6 +202,7 @@ static void shm_destroy(struct ipc_names
+ 						shp->mlock_user);
+ 	fput (shp->shm_file);
+ 	security_shm_free(shp);
++	put_vx_info(vxi);
+ 	ipc_rcu_putref(shp);
+ }
+ 
+@@ -351,11 +359,15 @@ static int newseg (struct ipc_namespace 
+ 	if (ns->shm_tot + numpages > ns->shm_ctlall)
+ 		return -ENOSPC;
+ 
++	if (!vx_ipcshm_avail(current->vx_info, numpages))
++		return -ENOSPC;
++
+ 	shp = ipc_rcu_alloc(sizeof(*shp));
+ 	if (!shp)
+ 		return -ENOMEM;
+ 
+ 	shp->shm_perm.key = key;
++	shp->shm_perm.xid = vx_current_xid();
+ 	shp->shm_perm.mode = (shmflg & S_IRWXUGO);
+ 	shp->mlock_user = NULL;
+ 
+@@ -406,6 +418,7 @@ static int newseg (struct ipc_namespace 
+ 	file->f_dentry->d_inode->i_ino = shp->id;
+ 
+ 	ns->shm_tot += numpages;
++	vx_ipcshm_add(current->vx_info, key, numpages);
+ 	shm_unlock(shp);
+ 	return shp->id;
+ 
+--- linux-2.6.22/ipc/util.c	2007-07-09 13:20:03 +0200
++++ linux-2.6.22-vs2.2.0-rc5/ipc/util.c	2007-06-15 02:37:04 +0200
+@@ -32,6 +32,8 @@
+ #include <linux/proc_fs.h>
+ #include <linux/audit.h>
+ #include <linux/nsproxy.h>
++#include <linux/vs_base.h>
++#include <linux/vserver/global.h>
+ 
+ #include <asm/unistd.h>
+ 
+@@ -72,6 +74,7 @@ static struct ipc_namespace *clone_ipc_n
+ 		goto err_shm;
+ 
+ 	kref_init(&ns->kref);
++	atomic_inc(&vs_global_ipc_ns);
+ 	return ns;
+ 
+ err_shm:
+@@ -108,6 +111,7 @@ void free_ipc_ns(struct kref *kref)
+ 	sem_exit_ns(ns);
+ 	msg_exit_ns(ns);
+ 	shm_exit_ns(ns);
++	atomic_dec(&vs_global_ipc_ns);
+ 	kfree(ns);
+ }
+ #else
+--- linux-2.6.22/kernel/Makefile	2007-07-09 13:20:03 +0200
++++ linux-2.6.22-vs2.2.0-rc5/kernel/Makefile	2007-06-15 02:37:04 +0200
+@@ -10,6 +10,8 @@ obj-y     = sched.o fork.o exec_domain.o
+ 	    kthread.o wait.o kfifo.o sys_ni.o posix-cpu-timers.o mutex.o \
+ 	    hrtimer.o rwsem.o latency.o nsproxy.o srcu.o die_notifier.o
+ 
++obj-y	  += vserver/
++
+ obj-$(CONFIG_STACKTRACE) += stacktrace.o
+ obj-y += time/
+ obj-$(CONFIG_DEBUG_MUTEXES) += mutex-debug.o
+--- linux-2.6.22/kernel/capability.c	2007-05-02 19:25:37 +0200
++++ linux-2.6.22-vs2.2.0-rc5/kernel/capability.c	2007-06-15 02:37:04 +0200
+@@ -12,6 +12,7 @@
+ #include <linux/module.h>
+ #include <linux/security.h>
+ #include <linux/syscalls.h>
++#include <linux/vs_context.h>
+ #include <asm/uaccess.h>
+ 
+ unsigned securebits = SECUREBITS_DEFAULT; /* systemwide security settings */
+@@ -103,6 +104,8 @@ static inline int cap_set_pg(int pgrp_nr
+ 
+ 	pgrp = find_pid(pgrp_nr);
+ 	do_each_pid_task(pgrp, PIDTYPE_PGID, g) {
++		if (!vx_check(g->xid, VS_ADMIN_P | VS_IDENT))
++			continue;
+ 		target = g;
+ 		while_each_thread(g, target) {
+ 			if (!security_capset_check(target, effective,
+@@ -246,8 +249,12 @@ int __capable(struct task_struct *t, int
+ }
+ EXPORT_SYMBOL(__capable);
+ 
++#include <linux/vserver/base.h>
+ int capable(int cap)
+ {
++	/* here for now so we don't require task locking */
++	if (vs_check_bit(VXC_CAP_MASK, cap) && !vx_mcaps(1L << cap))
++		return 0;
+ 	return __capable(current, cap);
+ }
+ EXPORT_SYMBOL(capable);
+--- linux-2.6.22/kernel/compat.c	2007-07-09 13:20:03 +0200
++++ linux-2.6.22-vs2.2.0-rc5/kernel/compat.c	2007-06-15 02:37:04 +0200
+@@ -846,7 +846,7 @@ asmlinkage long compat_sys_time(compat_t
+ 	compat_time_t i;
+ 	struct timeval tv;
+ 
+-	do_gettimeofday(&tv);
++	vx_gettimeofday(&tv);
+ 	i = tv.tv_sec;
+ 
+ 	if (tloc) {
+@@ -870,7 +870,7 @@ asmlinkage long compat_sys_stime(compat_
+ 	if (err)
+ 		return err;
+ 
+-	do_settimeofday(&tv);
++	vx_settimeofday(&tv);
+ 	return 0;
+ }
+ 
+--- linux-2.6.22/kernel/exit.c	2007-07-09 13:20:03 +0200
++++ linux-2.6.22-vs2.2.0-rc5/kernel/exit.c	2007-06-17 05:54:20 +0200
+@@ -44,6 +44,11 @@
+ #include <linux/resource.h>
+ #include <linux/blkdev.h>
+ #include <linux/task_io_accounting_ops.h>
++#include <linux/vs_limit.h>
++#include <linux/vs_context.h>
++#include <linux/vs_network.h>
++#include <linux/vs_pid.h>
++#include <linux/vserver/global.h>
+ 
+ #include <asm/uaccess.h>
+ #include <asm/unistd.h>
+@@ -443,9 +448,11 @@ static void close_files(struct files_str
+ 					filp_close(file, files);
+ 					cond_resched();
+ 				}
++				vx_openfd_dec(i);
+ 			}
+ 			i++;
+ 			set >>= 1;
++			cond_resched();
+ 		}
+ 	}
+ }
+@@ -525,6 +532,7 @@ static inline void __put_fs_struct(struc
+ 			dput(fs->altroot);
+ 			mntput(fs->altrootmnt);
+ 		}
++		atomic_dec(&vs_global_fs);
+ 		kmem_cache_free(fs_cachep, fs);
+ 	}
+ }
+@@ -596,6 +604,14 @@ static void exit_mm(struct task_struct *
+ static inline void
+ choose_new_parent(struct task_struct *p, struct task_struct *reaper)
+ {
++	/* check for reaper context */
++	vxwprintk((p->xid != reaper->xid) && (reaper != child_reaper(p)),
++		"rogue reaper: %p[%d,#%u] <> %p[%d,#%u]",
++		p, p->pid, p->xid, reaper, reaper->pid, reaper->xid);
++
++	if (p == reaper)
++		reaper = vx_child_reaper(p);
++
+ 	/*
+ 	 * Make sure we're not reparenting to ourselves and that
+ 	 * the parent is not a zombie.
+@@ -687,7 +703,8 @@ forget_original_parent(struct task_struc
+ 	do {
+ 		reaper = next_thread(reaper);
+ 		if (reaper == father) {
+-			reaper = child_reaper(father);
++			// reaper = child_reaper(father);
++			reaper = vx_child_reaper(father);
+ 			break;
+ 		}
+ 	} while (reaper->exit_state);
+@@ -964,7 +981,11 @@ fastcall NORET_TYPE void do_exit(long co
+ 	tsk->exit_code = code;
+ 	proc_exit_connector(tsk);
+ 	exit_task_namespaces(tsk);
++	// ns = exit_task_namespaces_early(tsk);
++	/* needs to stay before exit_notify() */
++	exit_vx_info_early(tsk, code);
+ 	exit_notify(tsk);
++	// exit_task_namespaces(tsk, ns);
+ #ifdef CONFIG_NUMA
+ 	mpol_free(tsk->mempolicy);
+ 	tsk->mempolicy = NULL;
+@@ -994,6 +1015,10 @@ fastcall NORET_TYPE void do_exit(long co
+ 	if (tsk->splice_pipe)
+ 		__free_pipe_info(tsk->splice_pipe);
+ 
++	/* needs to stay after exit_notify() */
++	exit_vx_info(tsk, code);
++	exit_nx_info(tsk);
++
+ 	preempt_disable();
+ 	/* causes final put_task_struct in finish_task_switch(). */
+ 	tsk->state = TASK_DEAD;
+--- linux-2.6.22/kernel/fork.c	2007-07-09 13:20:03 +0200
++++ linux-2.6.22-vs2.2.0-rc5/kernel/fork.c	2007-06-15 02:37:04 +0200
+@@ -49,6 +49,11 @@
+ #include <linux/delayacct.h>
+ #include <linux/taskstats_kern.h>
+ #include <linux/random.h>
++#include <linux/vs_context.h>
++#include <linux/vs_network.h>
++#include <linux/vs_limit.h>
++#include <linux/vs_memory.h>
++#include <linux/vserver/global.h>
+ 
+ #include <asm/pgtable.h>
+ #include <asm/pgalloc.h>
+@@ -108,6 +113,8 @@ void free_task(struct task_struct *tsk)
+ {
+ 	free_thread_info(tsk->stack);
+ 	rt_mutex_debug_task_free(tsk);
++	clr_vx_info(&tsk->vx_info);
++	clr_nx_info(&tsk->nx_info);
+ 	free_task_struct(tsk);
+ }
+ EXPORT_SYMBOL(free_task);
+@@ -215,6 +222,8 @@ static inline int dup_mmap(struct mm_str
+ 	mm->free_area_cache = oldmm->mmap_base;
+ 	mm->cached_hole_size = ~0UL;
+ 	mm->map_count = 0;
++	__set_mm_counter(mm, file_rss, 0);
++	__set_mm_counter(mm, anon_rss, 0);
+ 	cpus_clear(mm->cpu_vm_mask);
+ 	mm->mm_rb = RB_ROOT;
+ 	rb_link = &mm->mm_rb.rb_node;
+@@ -226,7 +235,7 @@ static inline int dup_mmap(struct mm_str
+ 
+ 		if (mpnt->vm_flags & VM_DONTCOPY) {
+ 			long pages = vma_pages(mpnt);
+-			mm->total_vm -= pages;
++			vx_vmpages_sub(mm, pages);
+ 			vm_stat_account(mm, mpnt->vm_flags, mpnt->vm_file,
+ 								-pages);
+ 			continue;
+@@ -335,8 +344,8 @@ static struct mm_struct * mm_init(struct
+ 	INIT_LIST_HEAD(&mm->mmlist);
+ 	mm->core_waiters = 0;
+ 	mm->nr_ptes = 0;
+-	set_mm_counter(mm, file_rss, 0);
+-	set_mm_counter(mm, anon_rss, 0);
++	__set_mm_counter(mm, file_rss, 0);
++	__set_mm_counter(mm, anon_rss, 0);
+ 	spin_lock_init(&mm->page_table_lock);
+ 	rwlock_init(&mm->ioctx_list_lock);
+ 	mm->ioctx_list = NULL;
+@@ -345,6 +354,7 @@ static struct mm_struct * mm_init(struct
+ 
+ 	if (likely(!mm_alloc_pgd(mm))) {
+ 		mm->def_flags = 0;
++		set_vx_info(&mm->mm_vx_info, current->vx_info);
+ 		return mm;
+ 	}
+ 	free_mm(mm);
+@@ -376,6 +386,7 @@ void fastcall __mmdrop(struct mm_struct 
+ 	BUG_ON(mm == &init_mm);
+ 	mm_free_pgd(mm);
+ 	destroy_context(mm);
++	clr_vx_info(&mm->mm_vx_info);
+ 	free_mm(mm);
+ }
+ 
+@@ -490,6 +501,7 @@ static struct mm_struct *dup_mm(struct t
+ 		goto fail_nomem;
+ 
+ 	memcpy(mm, oldmm, sizeof(*mm));
++	mm->mm_vx_info = NULL;
+ 
+ 	/* Initializing for Swap token stuff */
+ 	mm->token_priority = 0;
+@@ -521,6 +533,7 @@ fail_nocontext:
+ 	 * If init_new_context() failed, we cannot use mmput() to free the mm
+ 	 * because it calls destroy_context()
+ 	 */
++	clr_vx_info(&mm->mm_vx_info);
+ 	mm_free_pgd(mm);
+ 	free_mm(mm);
+ 	return NULL;
+@@ -591,6 +604,7 @@ static inline struct fs_struct *__copy_f
+ 			fs->altroot = NULL;
+ 		}
+ 		read_unlock(&old->lock);
++		atomic_inc(&vs_global_fs);
+ 	}
+ 	return fs;
+ }
+@@ -709,6 +723,8 @@ static struct files_struct *dup_fd(struc
+ 		struct file *f = *old_fds++;
+ 		if (f) {
+ 			get_file(f);
++			/* TODO: sum it first for check and performance */
++			vx_openfd_inc(open_files - i);
+ 		} else {
+ 			/*
+ 			 * The fd may be claimed in the fd bitmap but not yet
+@@ -961,6 +977,8 @@ static struct task_struct *copy_process(
+ {
+ 	int retval;
+ 	struct task_struct *p = NULL;
++	struct vx_info *vxi;
++	struct nx_info *nxi;
+ 
+ 	if ((clone_flags & (CLONE_NEWNS|CLONE_FS)) == (CLONE_NEWNS|CLONE_FS))
+ 		return ERR_PTR(-EINVAL);
+@@ -995,12 +1013,30 @@ static struct task_struct *copy_process(
+ 	DEBUG_LOCKS_WARN_ON(!p->hardirqs_enabled);
+ 	DEBUG_LOCKS_WARN_ON(!p->softirqs_enabled);
+ #endif
++	init_vx_info(&p->vx_info, current->vx_info);
++	init_nx_info(&p->nx_info, current->nx_info);
++
++	/* check vserver memory */
++	if (p->mm && !(clone_flags & CLONE_VM)) {
++		if (vx_vmpages_avail(p->mm, p->mm->total_vm))
++			vx_pages_add(p->vx_info, RLIMIT_AS, p->mm->total_vm);
++		else
++			goto bad_fork_free;
++	}
++	if (p->mm && vx_flags(VXF_FORK_RSS, 0)) {
++		if (!vx_rss_avail(p->mm, get_mm_counter(p->mm, file_rss)))
++			goto bad_fork_cleanup_vm;
++	}
++
+ 	retval = -EAGAIN;
++	if (!vx_nproc_avail(1))
++		goto bad_fork_cleanup_vm;
++
+ 	if (atomic_read(&p->user->processes) >=
+ 			p->signal->rlim[RLIMIT_NPROC].rlim_cur) {
+ 		if (!capable(CAP_SYS_ADMIN) && !capable(CAP_SYS_RESOURCE) &&
+ 				p->user != &root_user)
+-			goto bad_fork_free;
++			goto bad_fork_cleanup_vm;
+ 	}
+ 
+ 	atomic_inc(&p->user->__count);
+@@ -1265,6 +1301,18 @@ static struct task_struct *copy_process(
+ 
+ 	total_forks++;
+ 	spin_unlock(&current->sighand->siglock);
++
++	/* p is copy of current */
++	vxi = p->vx_info;
++	if (vxi) {
++		claim_vx_info(vxi, p);
++		atomic_inc(&vxi->cvirt.nr_threads);
++		atomic_inc(&vxi->cvirt.total_forks);
++		vx_nproc_inc(p);
++	}
++	nxi = p->nx_info;
++	if (nxi)
++		claim_nx_info(nxi, p);
+ 	write_unlock_irq(&tasklist_lock);
+ 	proc_fork_connector(p);
+ 	return p;
+@@ -1306,6 +1354,9 @@ bad_fork_cleanup_count:
+ 	put_group_info(p->group_info);
+ 	atomic_dec(&p->user->processes);
+ 	free_uid(p->user);
++bad_fork_cleanup_vm:
++	if (p->mm && !(clone_flags & CLONE_VM))
++		vx_pages_sub(p->vx_info, RLIMIT_AS, p->mm->total_vm);
+ bad_fork_free:
+ 	free_task(p);
+ fork_out:
+@@ -1367,6 +1418,15 @@ long do_fork(unsigned long clone_flags,
+ 
+ 	if (!pid)
+ 		return -EAGAIN;
++
++	/* kernel threads are host only */
++	if ((clone_flags & CLONE_KTHREAD) && !vx_check(0, VS_ADMIN)) {
++		vxwprintk(1, "xid=%d tried to spawn a kernel thread.",
++			vx_current_xid());
++		free_pid(pid);
++		return -EPERM;
++	}
++
+ 	nr = pid->nr;
+ 	if (unlikely(current->ptrace)) {
+ 		trace = fork_traceflag (clone_flags);
+--- linux-2.6.22/kernel/kthread.c	2007-07-09 13:20:03 +0200
++++ linux-2.6.22-vs2.2.0-rc5/kernel/kthread.c	2007-06-15 02:37:04 +0200
+@@ -96,7 +96,7 @@ static void create_kthread(struct kthrea
+ 	} else {
+ 		wait_for_completion(&create->started);
+ 		read_lock(&tasklist_lock);
+-		create->result = find_task_by_pid(pid);
++		create->result = find_task_by_real_pid(pid);
+ 		read_unlock(&tasklist_lock);
+ 	}
+ 	complete(&create->done);
+--- linux-2.6.22/kernel/nsproxy.c	2007-07-09 13:20:03 +0200
++++ linux-2.6.22-vs2.2.0-rc5/kernel/nsproxy.c	2007-07-07 04:12:31 +0200
+@@ -20,14 +20,11 @@
+ #include <linux/mnt_namespace.h>
+ #include <linux/utsname.h>
+ #include <linux/pid_namespace.h>
++#include <linux/vserver/global.h>
++#include <linux/vserver/debug.h>
+ 
+ struct nsproxy init_nsproxy = INIT_NSPROXY(init_nsproxy);
+ 
+-static inline void get_nsproxy(struct nsproxy *ns)
+-{
+-	atomic_inc(&ns->count);
+-}
+-
+ void get_task_namespaces(struct task_struct *tsk)
+ {
+ 	struct nsproxy *ns = tsk->nsproxy;
+@@ -46,6 +43,9 @@ static inline struct nsproxy *clone_nspr
+ 	ns = kmemdup(orig, sizeof(struct nsproxy), GFP_KERNEL);
+ 	if (ns)
+ 		atomic_set(&ns->count, 1);
++	vxdprintk(VXD_CBIT(space, 2), "clone_nsproxy(%p[%u] = %p[1]",
++		orig, atomic_read(&orig->count), ns);
++	atomic_inc(&vs_global_nsproxy);
+ 	return ns;
+ }
+ 
+@@ -54,28 +54,32 @@ static inline struct nsproxy *clone_nspr
+  * Return the newly created nsproxy.  Do not attach this to the task,
+  * leave it to the caller to do proper locking and attach it to task.
+  */
+-static struct nsproxy *create_new_namespaces(int flags, struct task_struct *tsk,
++static struct nsproxy *unshare_namespaces(int flags, struct nsproxy *orig,
+ 			struct fs_struct *new_fs)
+ {
+ 	struct nsproxy *new_nsp;
+ 
+-	new_nsp = clone_nsproxy(tsk->nsproxy);
++	vxdprintk(VXD_CBIT(space, 4),
++		"unshare_namespaces(0x%08x,%p,%p)",
++		flags, orig, new_fs);
++
++	new_nsp = clone_nsproxy(orig);
+ 	if (!new_nsp)
+ 		return ERR_PTR(-ENOMEM);
+ 
+-	new_nsp->mnt_ns = copy_mnt_ns(flags, tsk->nsproxy->mnt_ns, new_fs);
++	new_nsp->mnt_ns = copy_mnt_ns(flags, orig->mnt_ns, new_fs);
+ 	if (IS_ERR(new_nsp->mnt_ns))
+ 		goto out_ns;
+ 
+-	new_nsp->uts_ns = copy_utsname(flags, tsk->nsproxy->uts_ns);
++	new_nsp->uts_ns = copy_utsname(flags, orig->uts_ns);
+ 	if (IS_ERR(new_nsp->uts_ns))
+ 		goto out_uts;
+ 
+-	new_nsp->ipc_ns = copy_ipcs(flags, tsk->nsproxy->ipc_ns);
++	new_nsp->ipc_ns = copy_ipcs(flags, orig->ipc_ns);
+ 	if (IS_ERR(new_nsp->ipc_ns))
+ 		goto out_ipc;
+ 
+-	new_nsp->pid_ns = copy_pid_ns(flags, tsk->nsproxy->pid_ns);
++	new_nsp->pid_ns = copy_pid_ns(flags, orig->pid_ns);
+ 	if (IS_ERR(new_nsp->pid_ns))
+ 		goto out_pid;
+ 
+@@ -95,6 +99,33 @@ out_ns:
+ 	return ERR_PTR(-ENOMEM);
+ }
+ 
++static struct nsproxy *create_new_namespaces(int flags, struct task_struct *tsk,
++			struct fs_struct *new_fs)
++{
++	return unshare_namespaces(flags, tsk->nsproxy, new_fs);
++}
++
++/*
++ * copies the nsproxy, setting refcount to 1, and grabbing a
++ * reference to all contained namespaces.
++ */
++struct nsproxy *copy_nsproxy(struct nsproxy *orig)
++{
++	struct nsproxy *ns = clone_nsproxy(orig);
++
++	if (ns) {
++		if (ns->mnt_ns)
++			get_mnt_ns(ns->mnt_ns);
++		if (ns->uts_ns)
++			get_uts_ns(ns->uts_ns);
++		if (ns->ipc_ns)
++			get_ipc_ns(ns->ipc_ns);
++		if (ns->pid_ns)
++			get_pid_ns(ns->pid_ns);
++	}
++	return ns;
++}
++
+ /*
+  * called from clone.  This now handles copy for nsproxy and all
+  * namespaces therein.
+@@ -102,9 +133,12 @@ out_ns:
+ int copy_namespaces(int flags, struct task_struct *tsk)
+ {
+ 	struct nsproxy *old_ns = tsk->nsproxy;
+-	struct nsproxy *new_ns;
++	struct nsproxy *new_ns = NULL;
+ 	int err = 0;
+ 
++	vxdprintk(VXD_CBIT(space, 7), "copy_namespaces(0x%08x,%p[%p])",
++		flags, tsk, old_ns);
++
+ 	if (!old_ns)
+ 		return 0;
+ 
+@@ -127,6 +161,9 @@ int copy_namespaces(int flags, struct ta
+ 	tsk->nsproxy = new_ns;
+ out:
+ 	put_nsproxy(old_ns);
++	vxdprintk(VXD_CBIT(space, 3),
++		"copy_namespaces(0x%08x,%p[%p]) = %d [%p]",
++		flags, tsk, old_ns, err, new_ns);
+ 	return err;
+ }
+ 
+@@ -140,6 +177,7 @@ void free_nsproxy(struct nsproxy *ns)
+ 		put_ipc_ns(ns->ipc_ns);
+ 	if (ns->pid_ns)
+ 		put_pid_ns(ns->pid_ns);
++	atomic_dec(&vs_global_nsproxy);
+ 	kfree(ns);
+ }
+ 
+@@ -152,6 +190,10 @@ int unshare_nsproxy_namespaces(unsigned 
+ {
+ 	int err = 0;
+ 
++	vxdprintk(VXD_CBIT(space, 4),
++		"unshare_nsproxy_namespaces(0x%08lx,[%p])",
++		unshare_flags, current->nsproxy);
++
+ 	if (!(unshare_flags & (CLONE_NEWNS | CLONE_NEWUTS | CLONE_NEWIPC)))
+ 		return 0;
+ 
+--- linux-2.6.22/kernel/pid.c	2007-07-09 13:20:03 +0200
++++ linux-2.6.22-vs2.2.0-rc5/kernel/pid.c	2007-06-15 04:04:09 +0200
+@@ -28,6 +28,7 @@
+ #include <linux/hash.h>
+ #include <linux/pid_namespace.h>
+ #include <linux/init_task.h>
++#include <linux/vs_pid.h>
+ 
+ #define pid_hashfn(nr) hash_long((unsigned long)nr, pidhash_shift)
+ static struct hlist_head *pid_hash;
+@@ -295,6 +296,9 @@ void fastcall transfer_pid(struct task_s
+ struct task_struct * fastcall pid_task(struct pid *pid, enum pid_type type)
+ {
+ 	struct task_struct *result = NULL;
++
++	if (type == PIDTYPE_REALPID)
++		type = PIDTYPE_PID;
+ 	if (pid) {
+ 		struct hlist_node *first;
+ 		first = rcu_dereference(pid->tasks[type].first);
+@@ -309,7 +313,17 @@ struct task_struct * fastcall pid_task(s
+  */
+ struct task_struct *find_task_by_pid_type(int type, int nr)
+ {
+-	return pid_task(find_pid(nr), type);
++	struct task_struct *task;
++
++	if (type == PIDTYPE_PID)
++		nr = vx_rmap_pid(nr);
++
++	task = pid_task(find_pid(nr), type);
++	if (task && (type != PIDTYPE_REALPID) &&
++		/* maybe VS_WATCH_P in the future? */
++		!vx_check(task->xid, VS_WATCH|VS_IDENT))
++		return NULL;
++	return task;
+ }
+ 
+ EXPORT_SYMBOL(find_task_by_pid_type);
+--- linux-2.6.22/kernel/posix-timers.c	2007-07-09 13:20:03 +0200
++++ linux-2.6.22-vs2.2.0-rc5/kernel/posix-timers.c	2007-07-07 03:52:54 +0200
+@@ -47,6 +47,7 @@
+ #include <linux/wait.h>
+ #include <linux/workqueue.h>
+ #include <linux/module.h>
++#include <linux/vs_context.h>
+ 
+ /*
+  * Management arrays for POSIX timers.	 Timers are kept in slab memory
+@@ -297,6 +298,10 @@ void do_schedule_next_timer(struct sigin
+ 
+ int posix_timer_event(struct k_itimer *timr,int si_private)
+ {
++	struct vx_info_save vxis;
++	int ret;
++
++	enter_vx_info(task_get_vx_info(timr->it_process), &vxis);
+ 	memset(&timr->sigq->info, 0, sizeof(siginfo_t));
+ 	timr->sigq->info.si_sys_private = si_private;
+ 	/* Send signal to the process that owns this timer.*/
+@@ -309,11 +314,11 @@ int posix_timer_event(struct k_itimer *t
+ 
+ 	if (timr->it_sigev_notify & SIGEV_THREAD_ID) {
+ 		struct task_struct *leader;
+-		int ret = send_sigqueue(timr->it_sigev_signo, timr->sigq,
+-					timr->it_process);
+ 
++		ret = send_sigqueue(timr->it_sigev_signo, timr->sigq,
++				    timr->it_process);
+ 		if (likely(ret >= 0))
+-			return ret;
++			goto out;
+ 
+ 		timr->it_sigev_notify = SIGEV_SIGNAL;
+ 		leader = timr->it_process->group_leader;
+@@ -321,8 +326,12 @@ int posix_timer_event(struct k_itimer *t
+ 		timr->it_process = leader;
+ 	}
+ 
+-	return send_group_sigqueue(timr->it_sigev_signo, timr->sigq,
++	ret = send_group_sigqueue(timr->it_sigev_signo, timr->sigq,
+ 				   timr->it_process);
++out:
++	leave_vx_info(&vxis);
++	put_vx_info(vxis.vxi);
++	return ret;
+ }
+ EXPORT_SYMBOL_GPL(posix_timer_event);
+ 
+@@ -402,7 +411,7 @@ static struct task_struct * good_sigeven
+ 	struct task_struct *rtn = current->group_leader;
+ 
+ 	if ((event->sigev_notify & SIGEV_THREAD_ID ) &&
+-		(!(rtn = find_task_by_pid(event->sigev_notify_thread_id)) ||
++		(!(rtn = find_task_by_real_pid(event->sigev_notify_thread_id)) ||
+ 		 rtn->tgid != current->tgid ||
+ 		 (event->sigev_notify & ~SIGEV_THREAD_ID) != SIGEV_SIGNAL))
+ 		return NULL;
+--- linux-2.6.22/kernel/printk.c	2007-07-09 13:20:03 +0200
++++ linux-2.6.22-vs2.2.0-rc5/kernel/printk.c	2007-06-15 02:37:04 +0200
+@@ -31,6 +31,7 @@
+ #include <linux/bootmem.h>
+ #include <linux/syscalls.h>
+ #include <linux/jiffies.h>
++#include <linux/vs_cvirt.h>
+ 
+ #include <asm/uaccess.h>
+ 
+@@ -182,18 +183,13 @@ int do_syslog(int type, char __user *buf
+ 	unsigned long i, j, limit, count;
+ 	int do_clear = 0;
+ 	char c;
+-	int error = 0;
++	int error;
+ 
+ 	error = security_syslog(type);
+ 	if (error)
+ 		return error;
+ 
+-	switch (type) {
+-	case 0:		/* Close log */
+-		break;
+-	case 1:		/* Open log */
+-		break;
+-	case 2:		/* Read from log */
++	if ((type >= 2) && (type <= 4)) {
+ 		error = -EINVAL;
+ 		if (!buf || len < 0)
+ 			goto out;
+@@ -204,6 +200,16 @@ int do_syslog(int type, char __user *buf
+ 			error = -EFAULT;
+ 			goto out;
+ 		}
++	}
++	if (!vx_check(0, VS_ADMIN|VS_WATCH))
++		return vx_do_syslog(type, buf, len);
++
++	switch (type) {
++	case 0:		/* Close log */
++		break;
++	case 1:		/* Open log */
++		break;
++	case 2:		/* Read from log */
+ 		error = wait_event_interruptible(log_wait,
+ 							(log_start - log_end));
+ 		if (error)
+@@ -228,16 +234,6 @@ int do_syslog(int type, char __user *buf
+ 		do_clear = 1;
+ 		/* FALL THRU */
+ 	case 3:		/* Read last kernel messages */
+-		error = -EINVAL;
+-		if (!buf || len < 0)
+-			goto out;
+-		error = 0;
+-		if (!len)
+-			goto out;
+-		if (!access_ok(VERIFY_WRITE, buf, len)) {
+-			error = -EFAULT;
+-			goto out;
+-		}
+ 		count = len;
+ 		if (count > log_buf_len)
+ 			count = log_buf_len;
+--- linux-2.6.22/kernel/ptrace.c	2007-07-09 13:20:03 +0200
++++ linux-2.6.22-vs2.2.0-rc5/kernel/ptrace.c	2007-06-15 04:28:02 +0200
+@@ -19,6 +19,7 @@
+ #include <linux/security.h>
+ #include <linux/signal.h>
+ #include <linux/audit.h>
++#include <linux/vs_context.h>
+ 
+ #include <asm/pgtable.h>
+ #include <asm/uaccess.h>
+@@ -145,6 +146,11 @@ static int may_attach(struct task_struct
+ 		dumpable = task->mm->dumpable;
+ 	if (!dumpable && !capable(CAP_SYS_PTRACE))
+ 		return -EPERM;
++	if (!vx_check(task->xid, VS_ADMIN_P|VS_IDENT))
++		return -EPERM;
++	if (!vx_check(task->xid, VS_IDENT) &&
++		!task_vx_flags(task, VXF_STATE_ADMIN, 0))
++		return -EACCES;
+ 
+ 	return security_ptrace(current, task);
+ }
+@@ -471,6 +477,10 @@ asmlinkage long sys_ptrace(long request,
+ 		goto out;
+ 	}
+ 
++	ret = -EPERM;
++	if (!vx_check(vx_task_xid(child), VS_WATCH_P | VS_IDENT))
++		goto out_put_task_struct;
++
+ 	if (request == PTRACE_ATTACH) {
+ 		ret = ptrace_attach(child);
+ 		goto out_put_task_struct;
+--- linux-2.6.22/kernel/sched.c	2007-07-09 13:20:03 +0200
++++ linux-2.6.22-vs2.2.0-rc5/kernel/sched.c	2007-07-07 03:52:54 +0200
+@@ -56,6 +56,8 @@
+ 
+ #include <asm/tlb.h>
+ #include <asm/unistd.h>
++#include <linux/vs_sched.h>
++#include <linux/vs_cvirt.h>
+ 
+ /*
+  * Scheduler clock - returns current time in nanosec units.
+@@ -281,6 +283,16 @@ struct rq {
+ 	struct task_struct *migration_thread;
+ 	struct list_head migration_queue;
+ #endif
++	unsigned long norm_time;
++	unsigned long idle_time;
++#ifdef CONFIG_VSERVER_IDLETIME
++	int idle_skip;
++#endif
++#ifdef CONFIG_VSERVER_HARDCPU
++	struct list_head hold_queue;
++	unsigned long nr_onhold;
++	int idle_tokens;
++#endif
+ 
+ #ifdef CONFIG_SCHEDSTATS
+ 	/* latency stats */
+@@ -714,6 +726,7 @@ sched_info_switch(struct task_struct *pr
+  */
+ static void dequeue_task(struct task_struct *p, struct prio_array *array)
+ {
++	BUG_ON(p->state & TASK_ONHOLD);
+ 	array->nr_active--;
+ 	list_del(&p->run_list);
+ 	if (list_empty(array->queue + p->prio))
+@@ -722,6 +735,7 @@ static void dequeue_task(struct task_str
+ 
+ static void enqueue_task(struct task_struct *p, struct prio_array *array)
+ {
++	BUG_ON(p->state & TASK_ONHOLD);
+ 	sched_info_queued(p);
+ 	list_add_tail(&p->run_list, array->queue + p->prio);
+ 	__set_bit(p->prio, array->bitmap);
+@@ -735,12 +749,14 @@ static void enqueue_task(struct task_str
+  */
+ static void requeue_task(struct task_struct *p, struct prio_array *array)
+ {
++	BUG_ON(p->state & TASK_ONHOLD);
+ 	list_move_tail(&p->run_list, array->queue + p->prio);
+ }
+ 
+ static inline void
+ enqueue_task_head(struct task_struct *p, struct prio_array *array)
+ {
++	BUG_ON(p->state & TASK_ONHOLD);
+ 	list_add(&p->run_list, array->queue + p->prio);
+ 	__set_bit(p->prio, array->bitmap);
+ 	array->nr_active++;
+@@ -769,6 +785,10 @@ static inline int __normal_prio(struct t
+ 	bonus = CURRENT_BONUS(p) - MAX_BONUS / 2;
+ 
+ 	prio = p->static_prio - bonus;
++
++	/* adjust effective priority */
++	prio = vx_adjust_prio(p, prio, MAX_USER_PRIO);
++
+ 	if (prio < MAX_RT_PRIO)
+ 		prio = MAX_RT_PRIO;
+ 	if (prio > MAX_PRIO-1)
+@@ -878,6 +898,9 @@ static int effective_prio(struct task_st
+ 	return p->prio;
+ }
+ 
++#include "sched_mon.h"
++
++
+ /*
+  * __activate_task - move a task to the runqueue.
+  */
+@@ -887,6 +910,7 @@ static void __activate_task(struct task_
+ 
+ 	if (batch_task(p))
+ 		target = rq->expired;
++	vxm_activate_task(p, rq);
+ 	enqueue_task(p, target);
+ 	inc_nr_running(p, rq);
+ }
+@@ -896,6 +920,7 @@ static void __activate_task(struct task_
+  */
+ static inline void __activate_idle_task(struct task_struct *p, struct rq *rq)
+ {
++	vxm_activate_idle(p, rq);
+ 	enqueue_task_head(p, rq->active);
+ 	inc_nr_running(p, rq);
+ }
+@@ -1030,19 +1055,30 @@ static void activate_task(struct task_st
+ 	}
+ 	p->timestamp = now;
+ out:
++	vx_activate_task(p);
+ 	__activate_task(p, rq);
+ }
+ 
+ /*
+- * deactivate_task - remove a task from the runqueue.
++ * __deactivate_task - remove a task from the runqueue.
+  */
+-static void deactivate_task(struct task_struct *p, struct rq *rq)
++static void __deactivate_task(struct task_struct *p, struct rq *rq)
+ {
+ 	dec_nr_running(p, rq);
+ 	dequeue_task(p, p->array);
++	vxm_deactivate_task(p, rq);
+ 	p->array = NULL;
+ }
+ 
++static inline
++void deactivate_task(struct task_struct *p, struct rq *rq)
++{
++	vx_deactivate_task(p);
++	__deactivate_task(p, rq);
++}
++
++#include "sched_hard.h"
++
+ /*
+  * resched_task - mark a task 'to be rescheduled now'.
+  *
+@@ -1129,6 +1165,7 @@ migrate_task(struct task_struct *p, int 
+ {
+ 	struct rq *rq = task_rq(p);
+ 
++	vxm_migrate_task(p, rq, dest_cpu);
+ 	/*
+ 	 * If the task is not on a runqueue (and not running), then
+ 	 * it is sufficient to simply update the task's cpu field.
+@@ -1518,6 +1555,12 @@ static int try_to_wake_up(struct task_st
+ 
+ 	rq = task_rq_lock(p, &flags);
+ 	old_state = p->state;
++
++	/* we need to unhold suspended tasks */
++	if (old_state & TASK_ONHOLD) {
++		vx_unhold_task(p, rq);
++		old_state = p->state;
++	}
+ 	if (!(old_state & state))
+ 		goto out;
+ 
+@@ -1625,6 +1668,7 @@ out_activate:
+ #endif /* CONFIG_SMP */
+ 	if (old_state == TASK_UNINTERRUPTIBLE) {
+ 		rq->nr_uninterruptible--;
++		vx_uninterruptible_dec(p);
+ 		/*
+ 		 * Tasks on involuntary sleep don't earn
+ 		 * sleep_avg beyond just interactive state.
+@@ -1676,7 +1720,7 @@ int fastcall wake_up_state(struct task_s
+ 	return try_to_wake_up(p, state, 0);
+ }
+ 
+-static void task_running_tick(struct rq *rq, struct task_struct *p);
++static void task_running_tick(struct rq *rq, struct task_struct *p, int cpu);
+ /*
+  * Perform scheduler related setup for a newly forked process p.
+  * p is forked by current.
+@@ -1737,7 +1781,7 @@ void fastcall sched_fork(struct task_str
+ 		 * runqueue lock is not a problem.
+ 		 */
+ 		current->time_slice = 1;
+-		task_running_tick(cpu_rq(cpu), current);
++		task_running_tick(cpu_rq(cpu), current, cpu);
+ 	}
+ 	local_irq_enable();
+ 	put_cpu();
+@@ -1772,6 +1816,7 @@ void fastcall wake_up_new_task(struct ta
+ 
+ 	p->prio = effective_prio(p);
+ 
++	vx_activate_task(p);
+ 	if (likely(cpu == this_cpu)) {
+ 		if (!(clone_flags & CLONE_VM)) {
+ 			/*
+@@ -1783,6 +1828,7 @@ void fastcall wake_up_new_task(struct ta
+ 				__activate_task(p, rq);
+ 			else {
+ 				p->prio = current->prio;
++				BUG_ON(p->state & TASK_ONHOLD);
+ 				p->normal_prio = current->normal_prio;
+ 				list_add_tail(&p->run_list, &current->run_list);
+ 				p->array = current->array;
+@@ -3351,13 +3397,16 @@ static inline int expired_starving(struc
+ void account_user_time(struct task_struct *p, cputime_t cputime)
+ {
+ 	struct cpu_usage_stat *cpustat = &kstat_this_cpu.cpustat;
++	struct vx_info *vxi = p->vx_info;  /* p is _always_ current */
+ 	cputime64_t tmp;
++	int nice = (TASK_NICE(p) > 0);
+ 
+ 	p->utime = cputime_add(p->utime, cputime);
++	vx_account_user(vxi, cputime, nice);
+ 
+ 	/* Add user time to cpustat. */
+ 	tmp = cputime_to_cputime64(cputime);
+-	if (TASK_NICE(p) > 0)
++	if (nice)
+ 		cpustat->nice = cputime64_add(cpustat->nice, tmp);
+ 	else
+ 		cpustat->user = cputime64_add(cpustat->user, tmp);
+@@ -3373,10 +3422,12 @@ void account_system_time(struct task_str
+ 			 cputime_t cputime)
+ {
+ 	struct cpu_usage_stat *cpustat = &kstat_this_cpu.cpustat;
++	struct vx_info *vxi = p->vx_info;  /* p is _always_ current */
+ 	struct rq *rq = this_rq();
+ 	cputime64_t tmp;
+ 
+ 	p->stime = cputime_add(p->stime, cputime);
++	vx_account_system(vxi, cputime, (p == rq->idle));
+ 
+ 	/* Add system time to cpustat. */
+ 	tmp = cputime_to_cputime64(cputime);
+@@ -3415,7 +3466,7 @@ void account_steal_time(struct task_stru
+ 		cpustat->steal = cputime64_add(cpustat->steal, tmp);
+ }
+ 
+-static void task_running_tick(struct rq *rq, struct task_struct *p)
++static void task_running_tick(struct rq *rq, struct task_struct *p, int cpu)
+ {
+ 	if (p->array != rq->active) {
+ 		/* Task has expired but was not scheduled yet */
+@@ -3445,7 +3496,7 @@ static void task_running_tick(struct rq 
+ 		}
+ 		goto out_unlock;
+ 	}
+-	if (!--p->time_slice) {
++	if (vx_need_resched(p, --p->time_slice, cpu)) {
+ 		dequeue_task(p, rq->active);
+ 		set_tsk_need_resched(p);
+ 		p->prio = effective_prio(p);
+@@ -3506,9 +3557,12 @@ void scheduler_tick(void)
+ 	struct rq *rq = cpu_rq(cpu);
+ 
+ 	update_cpu_clock(p, rq, now);
+-
+-	if (!idle_at_tick)
+-		task_running_tick(rq, p);
++	vxm_sync(now, cpu);
++
++	if (idle_at_tick)
++		vx_idle_resched(rq);
++	else
++		task_running_tick(rq, p, cpu);
+ #ifdef CONFIG_SMP
+ 	update_load(rq);
+ 	rq->idle_at_tick = idle_at_tick;
+@@ -3630,14 +3684,25 @@ need_resched_nonpreemptible:
+ 				unlikely(signal_pending(prev))))
+ 			prev->state = TASK_RUNNING;
+ 		else {
+-			if (prev->state == TASK_UNINTERRUPTIBLE)
++			if (prev->state == TASK_UNINTERRUPTIBLE) {
+ 				rq->nr_uninterruptible++;
++				vx_uninterruptible_inc(prev);
++			}
+ 			deactivate_task(prev, rq);
+ 		}
+ 	}
+ 
+ 	cpu = smp_processor_id();
++	vx_set_rq_time(rq, jiffies);
++try_unhold:
++	vx_try_unhold(rq, cpu);
++pick_next:
++
+ 	if (unlikely(!rq->nr_running)) {
++		/* can we skip idle time? */
++		if (vx_try_skip(rq, cpu))
++			goto try_unhold;
++
+ 		idle_balance(cpu, rq);
+ 		if (!rq->nr_running) {
+ 			next = rq->idle;
+@@ -3663,6 +3728,10 @@ need_resched_nonpreemptible:
+ 	queue = array->queue + idx;
+ 	next = list_entry(queue->next, struct task_struct, run_list);
+ 
++	/* check before we schedule this context */
++	if (!vx_schedule(next, rq, cpu))
++		goto pick_next;
++
+ 	if (!rt_task(next) && interactive_sleep(next->sleep_type)) {
+ 		unsigned long long delta = now - next->timestamp;
+ 		if (unlikely((long long)(now - next->timestamp) < 0))
+@@ -4263,7 +4332,7 @@ asmlinkage long sys_nice(int increment)
+ 		nice = 19;
+ 
+ 	if (increment < 0 && !can_nice(current, nice))
+-		return -EPERM;
++		return vx_flags(VXF_IGNEG_NICE, 0) ? 0 : -EPERM;
+ 
+ 	retval = security_task_setnice(current, nice);
+ 	if (retval)
+@@ -4435,6 +4504,7 @@ recheck:
+ 	oldprio = p->prio;
+ 	__setscheduler(p, policy, param->sched_priority);
+ 	if (array) {
++		vx_activate_task(p);
+ 		__activate_task(p, rq);
+ 		/*
+ 		 * Reschedule if we are currently running on this runqueue and
+@@ -5188,6 +5258,7 @@ static int __migrate_task(struct task_st
+ 		p->timestamp = p->timestamp - rq_src->most_recent_timestamp
+ 				+ rq_dest->most_recent_timestamp;
+ 		deactivate_task(p, rq_src);
++		vx_activate_task(p);
+ 		__activate_task(p, rq_dest);
+ 		if (TASK_PREEMPTS_CURR(p, rq_dest))
+ 			resched_task(rq_dest->curr);
+@@ -7058,7 +7129,10 @@ void __init sched_init(void)
+ 		INIT_LIST_HEAD(&rq->migration_queue);
+ #endif
+ 		atomic_set(&rq->nr_iowait, 0);
+-
++#ifdef CONFIG_VSERVER_HARDCPU
++		INIT_LIST_HEAD(&rq->hold_queue);
++		rq->nr_onhold = 0;
++#endif
+ 		for (j = 0; j < 2; j++) {
+ 			array = rq->arrays + j;
+ 			for (k = 0; k < MAX_PRIO; k++) {
+@@ -7144,6 +7218,7 @@ void normalize_rt_tasks(void)
+ 			deactivate_task(p, task_rq(p));
+ 		__setscheduler(p, SCHED_NORMAL, 0);
+ 		if (array) {
++			vx_activate_task(p);
+ 			__activate_task(p, task_rq(p));
+ 			resched_task(rq->curr);
+ 		}
+--- linux-2.6.22/kernel/sched_hard.h	1970-01-01 01:00:00 +0100
++++ linux-2.6.22-vs2.2.0-rc5/kernel/sched_hard.h	2007-06-15 19:20:10 +0200
+@@ -0,0 +1,324 @@
++
++#ifdef CONFIG_VSERVER_IDLELIMIT
++
++/*
++ * vx_idle_resched - reschedule after maxidle
++ */
++static inline
++void vx_idle_resched(struct rq *rq)
++{
++	/* maybe have a better criterion for paused */
++	if (!--rq->idle_tokens && !list_empty(&rq->hold_queue))
++		set_need_resched();
++}
++
++#else /* !CONFIG_VSERVER_IDLELIMIT */
++
++#define vx_idle_resched(rq)
++
++#endif /* CONFIG_VSERVER_IDLELIMIT */
++
++
++
++#ifdef CONFIG_VSERVER_IDLETIME
++
++#define vx_set_rq_min_skip(rq, min)		\
++	(rq)->idle_skip = (min)
++
++#define vx_save_min_skip(ret, min, val)		\
++	__vx_save_min_skip(ret, min, val)
++
++static inline
++void __vx_save_min_skip(int ret, int *min, int val)
++{
++	if (ret > -2)
++		return;
++	if ((*min > val) || !*min)
++		*min = val;
++}
++
++static inline
++int vx_try_skip(struct rq *rq, int cpu)
++{
++	/* artificially advance time */
++	if (rq->idle_skip > 0) {
++		vxdprintk(list_empty(&rq->hold_queue),
++			"hold queue empty on cpu %d", cpu);
++		rq->idle_time += rq->idle_skip;
++		vxm_idle_skip(rq, cpu);
++		return 1;
++	}
++	return 0;
++}
++
++#else /* !CONFIG_VSERVER_IDLETIME */
++
++#define vx_set_rq_min_skip(rq, min)		\
++	({ int dummy = (min); dummy; })
++
++#define vx_save_min_skip(ret, min, val)
++
++static inline
++int vx_try_skip(struct rq *rq, int cpu)
++{
++	return 0;
++}
++
++#endif /* CONFIG_VSERVER_IDLETIME */
++
++
++
++#ifdef CONFIG_VSERVER_HARDCPU
++
++#define vx_set_rq_max_idle(rq, max)		\
++	(rq)->idle_tokens = (max)
++
++#define vx_save_max_idle(ret, min, val)		\
++	__vx_save_max_idle(ret, min, val)
++
++static inline
++void __vx_save_max_idle(int ret, int *min, int val)
++{
++	if (*min > val)
++		*min = val;
++}
++
++
++/*
++ * vx_hold_task - put a task on the hold queue
++ */
++static inline
++void vx_hold_task(struct task_struct *p, struct rq *rq)
++{
++	__deactivate_task(p, rq);
++	p->state |= TASK_ONHOLD;
++	/* a new one on hold */
++	rq->nr_onhold++;
++	vxm_hold_task(p, rq);
++	list_add_tail(&p->run_list, &rq->hold_queue);
++}
++
++/*
++ * vx_unhold_task - put a task back to the runqueue
++ */
++static inline
++void vx_unhold_task(struct task_struct *p, struct rq *rq)
++{
++	list_del(&p->run_list);
++	/* one less waiting */
++	rq->nr_onhold--;
++	p->state &= ~TASK_ONHOLD;
++	enqueue_task(p, rq->expired);
++	inc_nr_running(p, rq);
++	vxm_unhold_task(p, rq);
++
++	if (p->static_prio < rq->best_expired_prio)
++		rq->best_expired_prio = p->static_prio;
++}
++
++unsigned long nr_onhold(void)
++{
++	unsigned long i, sum = 0;
++
++	for_each_online_cpu(i)
++		sum += cpu_rq(i)->nr_onhold;
++
++	return sum;
++}
++
++
++
++static inline
++int __vx_tokens_avail(struct _vx_sched_pc *sched_pc)
++{
++	return sched_pc->tokens;
++}
++
++static inline
++void __vx_consume_token(struct _vx_sched_pc *sched_pc)
++{
++	sched_pc->tokens--;
++}
++
++static inline
++int vx_need_resched(struct task_struct *p, int slice, int cpu)
++{
++	struct vx_info *vxi = p->vx_info;
++
++	if (vx_info_flags(vxi, VXF_SCHED_HARD|VXF_SCHED_PRIO, 0)) {
++		struct _vx_sched_pc *sched_pc =
++			&vx_per_cpu(vxi, sched_pc, cpu);
++		int tokens;
++
++		/* maybe we can simplify that to decrement
++		   the token counter unconditional? */
++
++		if ((tokens = __vx_tokens_avail(sched_pc)) > 0)
++			__vx_consume_token(sched_pc);
++
++		/* for tokens > 0, one token was consumed */
++		if (tokens < 2)
++			slice = 0;
++	}
++	vxm_need_resched(p, slice, cpu);
++	return (slice == 0);
++}
++
++
++#define vx_set_rq_time(rq, time) do {	\
++	rq->norm_time = time;		\
++} while (0)
++
++
++static inline
++void vx_try_unhold(struct rq *rq, int cpu)
++{
++	struct vx_info *vxi = NULL;
++	struct list_head *l, *n;
++	int maxidle = HZ;
++	int minskip = 0;
++
++	/* nothing to do? what about pause? */
++	if (list_empty(&rq->hold_queue))
++		return;
++
++	list_for_each_safe(l, n, &rq->hold_queue) {
++		int ret, delta_min[2];
++		struct _vx_sched_pc *sched_pc;
++		struct task_struct *p;
++
++		p = list_entry(l, struct task_struct, run_list);
++		/* don't bother with same context */
++		if (vxi == p->vx_info)
++			continue;
++
++		vxi = p->vx_info;
++		/* ignore paused contexts */
++		if (vx_info_flags(vxi, VXF_SCHED_PAUSE, 0))
++			continue;
++
++		sched_pc = &vx_per_cpu(vxi, sched_pc, cpu);
++
++		/* recalc tokens */
++		vxm_sched_info(sched_pc, vxi, cpu);
++		ret = vx_tokens_recalc(sched_pc,
++			&rq->norm_time, &rq->idle_time, delta_min);
++		vxm_tokens_recalc(sched_pc, rq, vxi, cpu);
++
++		if (ret > 0) {
++			/* we found a runable context */
++			vx_unhold_task(p, rq);
++			break;
++		}
++		vx_save_max_idle(ret, &maxidle, delta_min[0]);
++		vx_save_min_skip(ret, &minskip, delta_min[1]);
++	}
++	vx_set_rq_max_idle(rq, maxidle);
++	vx_set_rq_min_skip(rq, minskip);
++	vxm_rq_max_min(rq, cpu);
++}
++
++
++static inline
++int vx_schedule(struct task_struct *next, struct rq *rq, int cpu)
++{
++	struct vx_info *vxi = next->vx_info;
++	struct _vx_sched_pc *sched_pc;
++	int delta_min[2];
++	int flags, ret;
++
++	if (!vxi)
++		return 1;
++
++	flags = vxi->vx_flags;
++
++	if (unlikely(vs_check_flags(flags, VXF_SCHED_PAUSE, 0)))
++		goto put_on_hold;
++	if (!vs_check_flags(flags, VXF_SCHED_HARD | VXF_SCHED_PRIO, 0))
++		return 1;
++
++	sched_pc = &vx_per_cpu(vxi, sched_pc, cpu);
++#ifdef CONFIG_SMP
++	/* update scheduler params */
++	if (cpu_isset(cpu, vxi->sched.update)) {
++		vx_update_sched_param(&vxi->sched, sched_pc);
++		vxm_update_sched(sched_pc, vxi, cpu);
++		cpu_clear(cpu, vxi->sched.update);
++	}
++#endif
++	vxm_sched_info(sched_pc, vxi, cpu);
++	ret  = vx_tokens_recalc(sched_pc,
++		&rq->norm_time, &rq->idle_time, delta_min);
++	vxm_tokens_recalc(sched_pc, rq, vxi, cpu);
++
++	if (!vs_check_flags(flags, VXF_SCHED_HARD, 0))
++		return 1;
++
++	if (unlikely(ret < 0)) {
++		vx_save_max_idle(ret, &rq->idle_tokens, delta_min[0]);
++		vx_save_min_skip(ret, &rq->idle_skip, delta_min[1]);
++		vxm_rq_max_min(rq, cpu);
++	put_on_hold:
++		vx_hold_task(next, rq);
++		return 0;
++	}
++	return 1;
++}
++
++
++#else /* CONFIG_VSERVER_HARDCPU */
++
++static inline
++void vx_hold_task(struct task_struct *p, struct rq *rq)
++{
++	return;
++}
++
++static inline
++void vx_unhold_task(struct task_struct *p, struct rq *rq)
++{
++	return;
++}
++
++unsigned long nr_onhold(void)
++{
++	return 0;
++}
++
++
++static inline
++int vx_need_resched(struct task_struct *p, int slice, int cpu)
++{
++	return (slice == 0);
++}
++
++
++#define vx_set_rq_time(rq, time)
++
++static inline
++void vx_try_unhold(struct rq *rq, int cpu)
++{
++	return;
++}
++
++static inline
++int vx_schedule(struct task_struct *next, struct rq *rq, int cpu)
++{
++	struct vx_info *vxi = next->vx_info;
++	struct _vx_sched_pc *sched_pc;
++	int delta_min[2];
++	int ret;
++
++	if (!vx_info_flags(vxi, VXF_SCHED_PRIO, 0))
++		return 1;
++
++	sched_pc = &vx_per_cpu(vxi, sched_pc, cpu);
++	vxm_sched_info(sched_pc, vxi, cpu);
++	ret  = vx_tokens_recalc(sched_pc,
++		&rq->norm_time, &rq->idle_time, delta_min);
++	vxm_tokens_recalc(sched_pc, rq, vxi, cpu);
++	return 1;
++}
++
++#endif /* CONFIG_VSERVER_HARDCPU */
++
+--- linux-2.6.22/kernel/sched_mon.h	1970-01-01 01:00:00 +0100
++++ linux-2.6.22-vs2.2.0-rc5/kernel/sched_mon.h	2007-06-15 02:37:04 +0200
+@@ -0,0 +1,200 @@
++
++#include <linux/vserver/monitor.h>
++
++#ifdef  CONFIG_VSERVER_MONITOR
++
++#ifdef	CONFIG_VSERVER_HARDCPU
++#define HARDCPU(x) (x)
++#else
++#define HARDCPU(x) (0)
++#endif
++
++#ifdef	CONFIG_VSERVER_IDLETIME
++#define IDLETIME(x) (x)
++#else
++#define IDLETIME(x) (0)
++#endif
++
++struct _vx_mon_entry *vxm_advance(int cpu);
++
++
++static inline
++void	__vxm_basic(struct _vx_mon_entry *entry, xid_t xid, int type)
++{
++	entry->type = type;
++	entry->xid = xid;
++}
++
++static inline
++void	__vxm_sync(int cpu)
++{
++	struct _vx_mon_entry *entry = vxm_advance(cpu);
++
++	__vxm_basic(entry, 0, VXM_SYNC);
++	entry->ev.sec = xtime.tv_sec;
++	entry->ev.nsec = xtime.tv_nsec;
++}
++
++static inline
++void	__vxm_task(struct task_struct *p, int type)
++{
++	struct _vx_mon_entry *entry = vxm_advance(task_cpu(p));
++
++	__vxm_basic(entry, p->xid, type);
++	entry->ev.tsk.pid = p->pid;
++	entry->ev.tsk.state = p->state;
++}
++
++static inline
++void	__vxm_sched(struct _vx_sched_pc *s, struct vx_info *vxi, int cpu)
++{
++	struct _vx_mon_entry *entry = vxm_advance(cpu);
++
++	__vxm_basic(entry, vxi->vx_id, (VXM_SCHED | s->flags));
++	entry->sd.tokens = s->tokens;
++	entry->sd.norm_time = s->norm_time;
++	entry->sd.idle_time = s->idle_time;
++}
++
++static inline
++void	__vxm_rqinfo1(struct rq *q, int cpu)
++{
++	struct _vx_mon_entry *entry = vxm_advance(cpu);
++
++	entry->type = VXM_RQINFO_1;
++	entry->xid = ((unsigned long)q >> 16) & 0xffff;
++	entry->q1.running = q->nr_running;
++	entry->q1.onhold = HARDCPU(q->nr_onhold);
++	entry->q1.iowait = atomic_read(&q->nr_iowait);
++	entry->q1.uintr = q->nr_uninterruptible;
++	entry->q1.idle_tokens = IDLETIME(q->idle_tokens);
++}
++
++static inline
++void	__vxm_rqinfo2(struct rq *q, int cpu)
++{
++	struct _vx_mon_entry *entry = vxm_advance(cpu);
++
++	entry->type = VXM_RQINFO_2;
++	entry->xid = (unsigned long)q & 0xffff;
++	entry->q2.norm_time = q->norm_time;
++	entry->q2.idle_time = q->idle_time;
++	entry->q2.idle_skip = IDLETIME(q->idle_skip);
++}
++
++static inline
++void	__vxm_update(struct _vx_sched_pc *s, struct vx_info *vxi, int cpu)
++{
++	struct _vx_mon_entry *entry = vxm_advance(cpu);
++
++	__vxm_basic(entry, vxi->vx_id, VXM_UPDATE);
++	entry->ev.tokens = s->tokens;
++}
++
++static inline
++void	__vxm_update1(struct _vx_sched_pc *s, struct vx_info *vxi, int cpu)
++{
++	struct _vx_mon_entry *entry = vxm_advance(cpu);
++
++	__vxm_basic(entry, vxi->vx_id, VXM_UPDATE_1);
++	entry->u1.tokens_max = s->tokens_max;
++	entry->u1.fill_rate = s->fill_rate[0];
++	entry->u1.interval = s->interval[0];
++}
++
++static inline
++void	__vxm_update2(struct _vx_sched_pc *s, struct vx_info *vxi, int cpu)
++{
++	struct _vx_mon_entry *entry = vxm_advance(cpu);
++
++	__vxm_basic(entry, vxi->vx_id, VXM_UPDATE_2);
++	entry->u2.tokens_min = s->tokens_min;
++	entry->u2.fill_rate = s->fill_rate[1];
++	entry->u2.interval = s->interval[1];
++}
++
++
++#define	vxm_activate_task(p,q)		__vxm_task(p, VXM_ACTIVATE)
++#define	vxm_activate_idle(p,q)		__vxm_task(p, VXM_IDLE)
++#define	vxm_deactivate_task(p,q)	__vxm_task(p, VXM_DEACTIVATE)
++#define	vxm_hold_task(p,q)		__vxm_task(p, VXM_HOLD)
++#define	vxm_unhold_task(p,q)		__vxm_task(p, VXM_UNHOLD)
++
++static inline
++void	vxm_migrate_task(struct task_struct *p, struct rq *rq, int dest)
++{
++	__vxm_task(p, VXM_MIGRATE);
++	__vxm_rqinfo1(rq, task_cpu(p));
++	__vxm_rqinfo2(rq, task_cpu(p));
++}
++
++static inline
++void	vxm_idle_skip(struct rq *rq, int cpu)
++{
++	__vxm_rqinfo1(rq, cpu);
++	__vxm_rqinfo2(rq, cpu);
++}
++
++static inline
++void	vxm_need_resched(struct task_struct *p, int slice, int cpu)
++{
++	if (slice)
++		return;
++
++	__vxm_task(p, VXM_RESCHED);
++}
++
++static inline
++void	vxm_sync(unsigned long now, int cpu)
++{
++	if (!CONFIG_VSERVER_MONITOR_SYNC ||
++		(now % CONFIG_VSERVER_MONITOR_SYNC))
++		return;
++
++	__vxm_sync(cpu);
++}
++
++#define	vxm_sched_info(s,v,c)		__vxm_sched(s,v,c)
++
++static inline
++void	vxm_tokens_recalc(struct _vx_sched_pc *s, struct rq *rq,
++	struct vx_info *vxi, int cpu)
++{
++	__vxm_sched(s, vxi, cpu);
++	__vxm_rqinfo2(rq, cpu);
++}
++
++static inline
++void	vxm_update_sched(struct _vx_sched_pc *s, struct vx_info *vxi, int cpu)
++{
++	__vxm_sched(s, vxi, cpu);
++	__vxm_update(s, vxi, cpu);
++	__vxm_update1(s, vxi, cpu);
++	__vxm_update2(s, vxi, cpu);
++}
++
++static inline
++void	vxm_rq_max_min(struct rq *rq, int cpu)
++{
++	__vxm_rqinfo1(rq, cpu);
++	__vxm_rqinfo2(rq, cpu);
++}
++
++#else  /* CONFIG_VSERVER_MONITOR */
++
++#define	vxm_activate_task(t,q)		do { } while (0)
++#define	vxm_activate_idle(t,q)		do { } while (0)
++#define	vxm_deactivate_task(t,q)	do { } while (0)
++#define	vxm_hold_task(t,q)		do { } while (0)
++#define	vxm_unhold_task(t,q)		do { } while (0)
++#define	vxm_migrate_task(t,q,d)		do { } while (0)
++#define	vxm_idle_skip(q,c)		do { } while (0)
++#define	vxm_need_resched(t,s,c)		do { } while (0)
++#define	vxm_sync(s,c)			do { } while (0)
++#define	vxm_sched_info(s,v,c)		do { } while (0)
++#define	vxm_tokens_recalc(s,q,v,c)	do { } while (0)
++#define	vxm_update_sched(s,v,c)		do { } while (0)
++#define	vxm_rq_max_min(q,c)		do { } while (0)
++
++#endif /* CONFIG_VSERVER_MONITOR */
++
+--- linux-2.6.22/kernel/signal.c	2007-07-09 13:20:03 +0200
++++ linux-2.6.22-vs2.2.0-rc5/kernel/signal.c	2007-07-07 03:52:54 +0200
+@@ -26,6 +26,8 @@
+ #include <linux/freezer.h>
+ #include <linux/pid_namespace.h>
+ #include <linux/nsproxy.h>
++#include <linux/vs_context.h>
++#include <linux/vs_pid.h>
+ 
+ #include <asm/param.h>
+ #include <asm/uaccess.h>
+@@ -523,19 +525,34 @@ static int check_kill_permission(int sig
+ 	if (!valid_signal(sig))
+ 		return error;
+ 
++	if ((info != SEND_SIG_NOINFO) &&
++		(is_si_special(info) || !SI_FROMUSER(info)))
++		goto skip;
++
++	vxdprintk(VXD_CBIT(misc, 7),
++		"check_kill_permission(%d,%p,%p[#%u,%u])",
++		sig, info, t, vx_task_xid(t), t->pid);
++
+ 	error = audit_signal_info(sig, t); /* Let audit system see the signal */
+ 	if (error)
+ 		return error;
+ 
+ 	error = -EPERM;
+-	if ((info == SEND_SIG_NOINFO || (!is_si_special(info) && SI_FROMUSER(info)))
+-	    && ((sig != SIGCONT) ||
++	if (((sig != SIGCONT) ||
+ 		(process_session(current) != process_session(t)))
+ 	    && (current->euid ^ t->suid) && (current->euid ^ t->uid)
+ 	    && (current->uid ^ t->suid) && (current->uid ^ t->uid)
+ 	    && !capable(CAP_KILL))
+ 		return error;
+ 
++	error = -ESRCH;
++	if (!vx_check(vx_task_xid(t), VS_WATCH_P | VS_IDENT)) {
++		vxdprintk(current->xid || VXD_CBIT(misc, 7),
++			"signal %d[%p] xid mismatch %p[#%u,%u] xid=#%u",
++			sig, info, t, vx_task_xid(t), t->pid, current->xid);
++		return error;
++	}
++skip:
+ 	return security_task_kill(t, info, sig, 0);
+ }
+ 
+@@ -1043,7 +1060,7 @@ int kill_pid_info(int sig, struct siginf
+ 
+ 	p = pid_task(pid, PIDTYPE_PID);
+ 	error = -ESRCH;
+-	if (p)
++	if (p && vx_check(vx_task_xid(p), VS_IDENT))
+ 		error = group_send_sig_info(sig, info, p);
+ 
+ 	if (unlikely(sig_needs_tasklist(sig)))
+@@ -1057,7 +1074,7 @@ kill_proc_info(int sig, struct siginfo *
+ {
+ 	int error;
+ 	rcu_read_lock();
+-	error = kill_pid_info(sig, info, find_pid(pid));
++	error = kill_pid_info(sig, info, find_pid(vx_rmap_pid(pid)));
+ 	rcu_read_unlock();
+ 	return error;
+ }
+@@ -1118,7 +1135,8 @@ static int kill_something_info(int sig, 
+ 
+ 		read_lock(&tasklist_lock);
+ 		for_each_process(p) {
+-			if (p->pid > 1 && p->tgid != current->tgid) {
++			if (vx_check(vx_task_xid(p), VS_ADMIN_P|VS_IDENT) &&
++				p->pid > 1 && p->tgid != current->tgid) {
+ 				int err = group_send_sig_info(sig, info, p);
+ 				++count;
+ 				if (err != -EPERM)
+@@ -1815,6 +1833,11 @@ relock:
+ 		if (current == child_reaper(current))
+ 			continue;
+ 
++		/* virtual init is protected against user signals */
++		if ((info->si_code == SI_USER) &&
++			vx_current_initpid(current->pid))
++			continue;
++
+ 		if (sig_kernel_stop(signr)) {
+ 			/*
+ 			 * The default action is to stop all threads in
+--- linux-2.6.22/kernel/softirq.c	2007-07-09 13:20:03 +0200
++++ linux-2.6.22-vs2.2.0-rc5/kernel/softirq.c	2007-06-15 02:37:04 +0200
+@@ -18,6 +18,7 @@
+ #include <linux/rcupdate.h>
+ #include <linux/smp.h>
+ #include <linux/tick.h>
++#include <linux/vs_context.h>
+ 
+ #include <asm/irq.h>
+ /*
+--- linux-2.6.22/kernel/sys.c	2007-07-09 13:20:03 +0200
++++ linux-2.6.22-vs2.2.0-rc5/kernel/sys.c	2007-06-15 05:28:51 +0200
+@@ -35,6 +35,7 @@
+ #include <linux/compat.h>
+ #include <linux/syscalls.h>
+ #include <linux/kprobes.h>
++#include <linux/vs_pid.h>
+ 
+ #include <asm/uaccess.h>
+ #include <asm/io.h>
+@@ -638,7 +639,10 @@ static int set_one_prio(struct task_stru
+ 		goto out;
+ 	}
+ 	if (niceval < task_nice(p) && !can_nice(p, niceval)) {
+-		error = -EACCES;
++		if (vx_flags(VXF_IGNEG_NICE, 0))
++			error = 0;
++		else
++			error = -EACCES;
+ 		goto out;
+ 	}
+ 	no_nice = security_task_setnice(p, niceval);
+@@ -686,6 +690,8 @@ asmlinkage long sys_setpriority(int whic
+ 			else
+ 				pgrp = task_pgrp(current);
+ 			do_each_pid_task(pgrp, PIDTYPE_PGID, p) {
++				if (!vx_check(p->xid, VS_ADMIN_P | VS_IDENT))
++					continue;
+ 				error = set_one_prio(p, niceval, error);
+ 			} while_each_pid_task(pgrp, PIDTYPE_PGID, p);
+ 			break;
+@@ -694,7 +700,8 @@ asmlinkage long sys_setpriority(int whic
+ 			if (!who)
+ 				who = current->uid;
+ 			else
+-				if ((who != current->uid) && !(user = find_user(who)))
++				if ((who != current->uid) &&
++					!(user = find_user(vx_current_xid(), who)))
+ 					goto out_unlock;	/* No processes for this user */
+ 
+ 			do_each_thread(g, p)
+@@ -746,6 +753,8 @@ asmlinkage long sys_getpriority(int whic
+ 			else
+ 				pgrp = task_pgrp(current);
+ 			do_each_pid_task(pgrp, PIDTYPE_PGID, p) {
++				if (!vx_check(p->xid, VS_ADMIN_P | VS_IDENT))
++					continue;
+ 				niceval = 20 - task_nice(p);
+ 				if (niceval > retval)
+ 					retval = niceval;
+@@ -756,7 +765,8 @@ asmlinkage long sys_getpriority(int whic
+ 			if (!who)
+ 				who = current->uid;
+ 			else
+-				if ((who != current->uid) && !(user = find_user(who)))
++				if ((who != current->uid) &&
++					!(user = find_user(vx_current_xid(), who)))
+ 					goto out_unlock;	/* No processes for this user */
+ 
+ 			do_each_thread(g, p)
+@@ -869,6 +879,9 @@ void kernel_power_off(void)
+ 	machine_power_off();
+ }
+ EXPORT_SYMBOL_GPL(kernel_power_off);
++
++long vs_reboot(unsigned int, void __user *);
++
+ /*
+  * Reboot system call: for obvious reasons only root may call it,
+  * and even root needs to set up some magic numbers in the registers
+@@ -899,6 +912,9 @@ asmlinkage long sys_reboot(int magic1, i
+ 	if ((cmd == LINUX_REBOOT_CMD_POWER_OFF) && !pm_power_off)
+ 		cmd = LINUX_REBOOT_CMD_HALT;
+ 
++	if (!vx_check(0, VS_ADMIN|VS_WATCH))
++		return vs_reboot(cmd, arg);
++
+ 	lock_kernel();
+ 	switch (cmd) {
+ 	case LINUX_REBOOT_CMD_RESTART:
+@@ -1078,7 +1094,7 @@ static int set_user(uid_t new_ruid, int 
+ {
+ 	struct user_struct *new_user;
+ 
+-	new_user = alloc_uid(new_ruid);
++	new_user = alloc_uid(vx_current_xid(), new_ruid);
+ 	if (!new_user)
+ 		return -EAGAIN;
+ 
+@@ -1433,15 +1449,18 @@ asmlinkage long sys_setpgid(pid_t pid, p
+ {
+ 	struct task_struct *p;
+ 	struct task_struct *group_leader = current->group_leader;
++	pid_t rpgid;
+ 	int err = -EINVAL;
+ 
+ 	if (!pid)
+-		pid = group_leader->pid;
++		pid = vx_map_pid(group_leader->pid);
+ 	if (!pgid)
+ 		pgid = pid;
+ 	if (pgid < 0)
+ 		return -EINVAL;
+ 
++	rpgid = vx_rmap_pid(pgid);
++
+ 	/* From this point forward we keep holding onto the tasklist lock
+ 	 * so that our parent does not change from under us. -DaveM
+ 	 */
+@@ -1475,20 +1494,20 @@ asmlinkage long sys_setpgid(pid_t pid, p
+ 
+ 	if (pgid != pid) {
+ 		struct task_struct *g =
+-			find_task_by_pid_type(PIDTYPE_PGID, pgid);
++			find_task_by_pid_type(PIDTYPE_PGID, rpgid);
+ 
+ 		if (!g || task_session(g) != task_session(group_leader))
+ 			goto out;
+ 	}
+ 
+-	err = security_task_setpgid(p, pgid);
++	err = security_task_setpgid(p, rpgid);
+ 	if (err)
+ 		goto out;
+ 
+-	if (process_group(p) != pgid) {
++	if (process_group(p) != rpgid) {
+ 		detach_pid(p, PIDTYPE_PGID);
+-		p->signal->pgrp = pgid;
+-		attach_pid(p, PIDTYPE_PGID, find_pid(pgid));
++		p->signal->pgrp = rpgid;
++		attach_pid(p, PIDTYPE_PGID, find_pid(rpgid));
+ 	}
+ 
+ 	err = 0;
+@@ -1501,7 +1520,7 @@ out:
+ asmlinkage long sys_getpgid(pid_t pid)
+ {
+ 	if (!pid)
+-		return process_group(current);
++		return vx_rmap_pid(process_group(current));
+ 	else {
+ 		int retval;
+ 		struct task_struct *p;
+@@ -1513,7 +1532,7 @@ asmlinkage long sys_getpgid(pid_t pid)
+ 		if (p) {
+ 			retval = security_task_getpgid(p);
+ 			if (!retval)
+-				retval = process_group(p);
++				retval = vx_rmap_pid(process_group(p));
+ 		}
+ 		read_unlock(&tasklist_lock);
+ 		return retval;
+@@ -1864,7 +1883,7 @@ asmlinkage long sys_sethostname(char __u
+ 	int errno;
+ 	char tmp[__NEW_UTS_LEN];
+ 
+-	if (!capable(CAP_SYS_ADMIN))
++	if (!vx_capable(CAP_SYS_ADMIN, VXC_SET_UTSNAME))
+ 		return -EPERM;
+ 	if (len < 0 || len > __NEW_UTS_LEN)
+ 		return -EINVAL;
+@@ -1909,7 +1928,7 @@ asmlinkage long sys_setdomainname(char _
+ 	int errno;
+ 	char tmp[__NEW_UTS_LEN];
+ 
+-	if (!capable(CAP_SYS_ADMIN))
++	if (!vx_capable(CAP_SYS_ADMIN, VXC_SET_UTSNAME))
+ 		return -EPERM;
+ 	if (len < 0 || len > __NEW_UTS_LEN)
+ 		return -EINVAL;
+@@ -1976,7 +1995,7 @@ asmlinkage long sys_setrlimit(unsigned i
+ 		return -EINVAL;
+ 	old_rlim = current->signal->rlim + resource;
+ 	if ((new_rlim.rlim_max > old_rlim->rlim_max) &&
+-	    !capable(CAP_SYS_RESOURCE))
++	    !vx_capable(CAP_SYS_RESOURCE, VXC_SET_RLIMIT))
+ 		return -EPERM;
+ 	if (resource == RLIMIT_NOFILE && new_rlim.rlim_max > NR_OPEN)
+ 		return -EPERM;
+--- linux-2.6.22/kernel/sysctl.c	2007-07-09 13:20:03 +0200
++++ linux-2.6.22-vs2.2.0-rc5/kernel/sysctl.c	2007-06-15 02:37:04 +0200
+@@ -89,6 +89,7 @@ static int ngroups_max = NGROUPS_MAX;
+ #ifdef CONFIG_KMOD
+ extern char modprobe_path[];
+ #endif
++extern char vshelper_path[];
+ #ifdef CONFIG_CHR_DEV_SG
+ extern int sg_big_buff;
+ #endif
+@@ -343,6 +344,15 @@ static ctl_table kern_table[] = {
+ 		.strategy	= &sysctl_string,
+ 	},
+ #endif
++	{
++		.ctl_name	= KERN_VSHELPER,
++		.procname	= "vshelper",
++		.data		= &vshelper_path,
++		.maxlen		= 256,
++		.mode		= 0644,
++		.proc_handler	= &proc_dostring,
++		.strategy	= &sysctl_string,
++	},
+ #ifdef CONFIG_CHR_DEV_SG
+ 	{
+ 		.ctl_name	= KERN_SG_BIG_BUFF,
+--- linux-2.6.22/kernel/time.c	2007-07-09 13:20:03 +0200
++++ linux-2.6.22-vs2.2.0-rc5/kernel/time.c	2007-06-15 02:37:04 +0200
+@@ -60,7 +60,7 @@ asmlinkage long sys_time(time_t __user *
+ 	time_t i;
+ 	struct timeval tv;
+ 
+-	do_gettimeofday(&tv);
++	vx_gettimeofday(&tv);
+ 	i = tv.tv_sec;
+ 
+ 	if (tloc) {
+@@ -91,7 +91,7 @@ asmlinkage long sys_stime(time_t __user 
+ 	if (err)
+ 		return err;
+ 
+-	do_settimeofday(&tv);
++	vx_settimeofday(&tv);
+ 	return 0;
+ }
+ 
+@@ -101,7 +101,7 @@ asmlinkage long sys_gettimeofday(struct 
+ {
+ 	if (likely(tv != NULL)) {
+ 		struct timeval ktv;
+-		do_gettimeofday(&ktv);
++		vx_gettimeofday(&ktv);
+ 		if (copy_to_user(tv, &ktv, sizeof(ktv)))
+ 			return -EFAULT;
+ 	}
+@@ -175,7 +175,7 @@ int do_sys_settimeofday(struct timespec 
+ 		/* SMP safe, again the code in arch/foo/time.c should
+ 		 * globally block out interrupts when it runs.
+ 		 */
+-		return do_settimeofday(tv);
++		return vx_settimeofday(tv);
+ 	}
+ 	return 0;
+ }
+@@ -388,7 +388,7 @@ void getnstimeofday(struct timespec *tv)
+ {
+ 	struct timeval x;
+ 
+-	do_gettimeofday(&x);
++	vx_gettimeofday(&x);
+ 	tv->tv_sec = x.tv_sec;
+ 	tv->tv_nsec = x.tv_usec * NSEC_PER_USEC;
+ }
+--- linux-2.6.22/kernel/timer.c	2007-07-09 13:20:04 +0200
++++ linux-2.6.22-vs2.2.0-rc5/kernel/timer.c	2007-06-15 02:37:04 +0200
+@@ -36,6 +36,10 @@
+ #include <linux/delay.h>
+ #include <linux/tick.h>
+ #include <linux/kallsyms.h>
++#include <linux/vs_base.h>
++#include <linux/vs_cvirt.h>
++#include <linux/vs_pid.h>
++#include <linux/vserver/sched.h>
+ 
+ #include <asm/uaccess.h>
+ #include <asm/unistd.h>
+@@ -921,12 +925,6 @@ asmlinkage unsigned long sys_alarm(unsig
+ 
+ #endif
+ 
+-#ifndef __alpha__
+-
+-/*
+- * The Alpha uses getxpid, getxuid, and getxgid instead.  Maybe this
+- * should be moved into arch/i386 instead?
+- */
+ 
+ /**
+  * sys_getpid - return the thread group id of the current process
+@@ -939,7 +937,7 @@ asmlinkage unsigned long sys_alarm(unsig
+  */
+ asmlinkage long sys_getpid(void)
+ {
+-	return current->tgid;
++	return vx_map_tgid(current->tgid);
+ }
+ 
+ /*
+@@ -955,10 +953,23 @@ asmlinkage long sys_getppid(void)
+ 	rcu_read_lock();
+ 	pid = rcu_dereference(current->real_parent)->tgid;
+ 	rcu_read_unlock();
++	return vx_map_pid(pid);
++}
+ 
+-	return pid;
++#ifdef __alpha__
++
++/*
++ * The Alpha uses getxpid, getxuid, and getxgid instead.
++ */
++
++asmlinkage long do_getxpid(long *ppid)
++{
++	*ppid = sys_getppid();
++	return sys_getpid();
+ }
+ 
++#else /* _alpha_ */
++
+ asmlinkage long sys_getuid(void)
+ {
+ 	/* Only we change this so SMP safe */
+@@ -1118,6 +1129,8 @@ int do_sysinfo(struct sysinfo *info)
+ 			tp.tv_nsec = tp.tv_nsec - NSEC_PER_SEC;
+ 			tp.tv_sec++;
+ 		}
++		if (vx_flags(VXF_VIRT_UPTIME, 0))
++			vx_vsi_uptime(&tp, NULL);
+ 		info->uptime = tp.tv_sec + (tp.tv_nsec ? 1 : 0);
+ 
+ 		info->loads[0] = avenrun[0] << (SI_LOAD_SHIFT - FSHIFT);
+--- linux-2.6.22/kernel/user.c	2007-02-06 03:01:56 +0100
++++ linux-2.6.22-vs2.2.0-rc5/kernel/user.c	2007-06-15 02:37:04 +0200
+@@ -23,8 +23,8 @@
+ #define UIDHASH_BITS (CONFIG_BASE_SMALL ? 3 : 8)
+ #define UIDHASH_SZ		(1 << UIDHASH_BITS)
+ #define UIDHASH_MASK		(UIDHASH_SZ - 1)
+-#define __uidhashfn(uid)	(((uid >> UIDHASH_BITS) + uid) & UIDHASH_MASK)
+-#define uidhashentry(uid)	(uidhash_table + __uidhashfn((uid)))
++#define __uidhashfn(xid,uid)	((((uid) >> UIDHASH_BITS) + ((uid)^(xid))) & UIDHASH_MASK)
++#define uidhashentry(xid,uid)	(uidhash_table + __uidhashfn((xid),(uid)))
+ 
+ static struct kmem_cache *uid_cachep;
+ static struct list_head uidhash_table[UIDHASH_SZ];
+@@ -66,7 +66,7 @@ static inline void uid_hash_remove(struc
+ 	list_del(&up->uidhash_list);
+ }
+ 
+-static inline struct user_struct *uid_hash_find(uid_t uid, struct list_head *hashent)
++static inline struct user_struct *uid_hash_find(xid_t xid, uid_t uid, struct list_head *hashent)
+ {
+ 	struct list_head *up;
+ 
+@@ -75,7 +75,7 @@ static inline struct user_struct *uid_ha
+ 
+ 		user = list_entry(up, struct user_struct, uidhash_list);
+ 
+-		if(user->uid == uid) {
++		if(user->uid == uid && user->xid == xid) {
+ 			atomic_inc(&user->__count);
+ 			return user;
+ 		}
+@@ -90,13 +90,13 @@ static inline struct user_struct *uid_ha
+  *
+  * If the user_struct could not be found, return NULL.
+  */
+-struct user_struct *find_user(uid_t uid)
++struct user_struct *find_user(xid_t xid, uid_t uid)
+ {
+ 	struct user_struct *ret;
+ 	unsigned long flags;
+ 
+ 	spin_lock_irqsave(&uidhash_lock, flags);
+-	ret = uid_hash_find(uid, uidhashentry(uid));
++	ret = uid_hash_find(xid, uid, uidhashentry(xid, uid));
+ 	spin_unlock_irqrestore(&uidhash_lock, flags);
+ 	return ret;
+ }
+@@ -120,13 +120,13 @@ void free_uid(struct user_struct *up)
+ 	}
+ }
+ 
+-struct user_struct * alloc_uid(uid_t uid)
++struct user_struct * alloc_uid(xid_t xid, uid_t uid)
+ {
+-	struct list_head *hashent = uidhashentry(uid);
++	struct list_head *hashent = uidhashentry(xid, uid);
+ 	struct user_struct *up;
+ 
+ 	spin_lock_irq(&uidhash_lock);
+-	up = uid_hash_find(uid, hashent);
++	up = uid_hash_find(xid, uid, hashent);
+ 	spin_unlock_irq(&uidhash_lock);
+ 
+ 	if (!up) {
+@@ -136,6 +136,7 @@ struct user_struct * alloc_uid(uid_t uid
+ 		if (!new)
+ 			return NULL;
+ 		new->uid = uid;
++		new->xid = xid;
+ 		atomic_set(&new->__count, 1);
+ 		atomic_set(&new->processes, 0);
+ 		atomic_set(&new->files, 0);
+@@ -158,7 +159,7 @@ struct user_struct * alloc_uid(uid_t uid
+ 		 * on adding the same user already..
+ 		 */
+ 		spin_lock_irq(&uidhash_lock);
+-		up = uid_hash_find(uid, hashent);
++		up = uid_hash_find(xid, uid, hashent);
+ 		if (up) {
+ 			key_put(new->uid_keyring);
+ 			key_put(new->session_keyring);
+@@ -215,7 +216,7 @@ static int __init uid_cache_init(void)
+ 
+ 	/* Insert the root user immediately (init already runs as root) */
+ 	spin_lock_irq(&uidhash_lock);
+-	uid_hash_insert(&root_user, uidhashentry(0));
++	uid_hash_insert(&root_user, uidhashentry(0,0));
+ 	spin_unlock_irq(&uidhash_lock);
+ 
+ 	return 0;
+--- linux-2.6.22/kernel/utsname.c	2007-07-09 13:20:04 +0200
++++ linux-2.6.22-vs2.2.0-rc5/kernel/utsname.c	2007-06-15 02:37:04 +0200
+@@ -13,6 +13,7 @@
+ #include <linux/uts.h>
+ #include <linux/utsname.h>
+ #include <linux/version.h>
++#include <linux/vserver/global.h>
+ 
+ /*
+  * Clone a new ns copying an original utsname, setting refcount to 1
+@@ -27,6 +28,7 @@ static struct uts_namespace *clone_uts_n
+ 	if (ns) {
+ 		memcpy(&ns->name, &old_ns->name, sizeof(ns->name));
+ 		kref_init(&ns->kref);
++		atomic_inc(&vs_global_uts_ns);
+ 	}
+ 	return ns;
+ }
+@@ -58,5 +60,6 @@ void free_uts_ns(struct kref *kref)
+ 	struct uts_namespace *ns;
+ 
+ 	ns = container_of(kref, struct uts_namespace, kref);
++	atomic_dec(&vs_global_uts_ns);
+ 	kfree(ns);
+ }
+--- linux-2.6.22/kernel/vserver/Kconfig	1970-01-01 01:00:00 +0100
++++ linux-2.6.22-vs2.2.0-rc5/kernel/vserver/Kconfig	2007-06-15 02:37:04 +0200
+@@ -0,0 +1,284 @@
++#
++# Linux VServer configuration
++#
++
++menu "Linux VServer"
++
++config	VSERVER_LEGACY
++	bool	"Enable Legacy Kernel API"
++	depends on EXPERIMENTAL
++	default n
++	help
++	  This enables the legacy API used in vs1.xx, maintaining
++	  compatibility with older vserver tools, and guest images
++	  that are configured using the legacy method.
++
++config	VSERVER_LEGACY_VERSION
++	bool	"Show a Legacy Version ID"
++	depends on VSERVER_LEGACY
++	default n
++	help
++	  This shows a special legacy version to very old tools
++	  which do not handle the current version correctly.
++
++	  Warning: recent tools are not able to utilize the
++	  newer APIs when this is enabled, so some features will
++	  not be available. Better avoid it, unless you really,
++	  really need it for backwards compatibility.
++
++config	VSERVER_DYNAMIC_IDS
++	bool	"Enable dynamic context IDs"
++	depends on EXPERIMENTAL && VSERVER_LEGACY
++	default n
++	help
++	  This enables support of in kernel dynamic context IDs,
++	  which is deprecated and will probably be removed in the
++	  next release.
++
++config	VSERVER_LEGACYNET
++	bool	"Enable Legacy Networking Kernel API"
++	depends on EXPERIMENTAL
++	default n
++	help
++	  This enables the legacy networking API which is used
++	  by older tools (pre 0.30.210) to set up the network
++	  context (chbind).
++
++config	VSERVER_REMAP_SADDR
++	bool	"Remap Source IP Address"
++	depends on EXPERIMENTAL
++	default n
++	help
++	  This allows to remap the source IP address of 'local'
++	  connections from 127.0.0.1 to the first assigned
++	  guest IP.
++
++config	VSERVER_COWBL
++	bool	"Enable COW Immutable Link Breaking"
++	default y
++	help
++	  This enables the COW (Copy-On-Write) link break code.
++	  It allows you to treat unified files like normal files
++	  when writing to them (which will implicitely break the
++	  link and create a copy of the unified file)
++
++config	VSERVER_VTIME
++	bool	"Enable Virtualized Guest Time"
++	depends on EXPERIMENTAL
++	default n
++	help
++	  This enables per guest time offsets to allow for
++	  adjusting the system clock individually per guest.
++	  this adds some overhead to the time functions and
++	  therefore should not be enabled without good reason.
++
++config	VSERVER_PROC_SECURE
++	bool	"Enable Proc Security"
++	depends on PROC_FS
++	default y
++	help
++	  This configures ProcFS security to initially hide
++	  non-process entries for all contexts except the main and
++	  spectator context (i.e. for all guests), which is a secure
++	  default.
++
++	  (note: on 1.2x the entries were visible by default)
++
++config	VSERVER_HARDCPU
++	bool	"Enable Hard CPU Limits"
++	default y
++	help
++	  Activate the Hard CPU Limits
++
++	  This will compile in code that allows the Token Bucket
++	  Scheduler to put processes on hold when a context's
++	  tokens are depleted (provided that its per-context
++	  sched_hard flag is set).
++
++	  Processes belonging to that context will not be able
++	  to consume CPU resources again until a per-context
++	  configured minimum of tokens has been reached.
++
++config	VSERVER_IDLETIME
++	bool	"Avoid idle CPUs by skipping Time"
++	depends on VSERVER_HARDCPU
++	default y
++	help
++	  This option allows the scheduler to artificially
++	  advance time (per cpu) when otherwise the idle
++	  task would be scheduled, thus keeping the cpu
++	  busy and sharing the available resources among
++	  certain contexts.
++
++config	VSERVER_IDLELIMIT
++	bool	"Limit the IDLE task"
++	depends on VSERVER_HARDCPU
++	default n
++	help
++	  Limit the idle slices, so the the next context
++	  will be scheduled as soon as possible.
++
++	  This might improve interactivity and latency, but
++	  will also marginally increase scheduling overhead.
++
++choice
++	prompt	"Persistent Inode Tagging"
++	default	TAGGING_ID24
++	help
++	  This adds persistent context information to filesystems
++	  mounted with the tagxid option. Tagging is a requirement
++	  for per-context disk limits and per-context quota.
++
++
++config	TAGGING_NONE
++	bool	"Disabled"
++	help
++	  do not store per-context information in inodes.
++
++config	TAGGING_UID16
++	bool	"UID16/GID32"
++	help
++	  reduces UID to 16 bit, but leaves GID at 32 bit.
++
++config	TAGGING_GID16
++	bool	"UID32/GID16"
++	help
++	  reduces GID to 16 bit, but leaves UID at 32 bit.
++
++config	TAGGING_ID24
++	bool	"UID24/GID24"
++	help
++	  uses the upper 8bit from UID and GID for XID tagging
++	  which leaves 24bit for UID/GID each, which should be
++	  more than sufficient for normal use.
++
++config	TAGGING_INTERN
++	bool	"UID32/GID32"
++	help
++	  this uses otherwise reserved inode fields in the on
++	  disk representation, which limits the use to a few
++	  filesystems (currently ext2 and ext3)
++
++endchoice
++
++config	TAG_NFSD
++	bool	"Tag NFSD User Auth and Files"
++	default n
++	help
++	  Enable this if you do want the in-kernel NFS
++	  Server to use the tagging specified above.
++	  (will require patched clients too)
++
++config	PROPAGATE
++	bool	"Enable Inode Tag Propagation"
++	default n
++	depends on EXPERIMENTAL
++	help
++	  This allows for the tagid= mount option to specify
++	  a tagid which is to be used for the entire mount
++	  tree.
++
++config	VSERVER_PRIVACY
++	bool	"Honor Privacy Aspects of Guests"
++	default y
++	help
++	  When enabled, most context checks will disallow
++	  access to structures assigned to a specific context,
++	  like ptys or loop devices.
++
++config	VSERVER_CONTEXTS
++	int	"Maximum number of Contexts (1-65533)"	if EMBEDDED
++	range 1 65533
++	default "768"	if 64BIT
++	default "256"
++	help
++	  This setting will optimize certain data structures
++	  and memory allocations according to the expected
++	  maximum.
++
++	  note: this is not a strict upper limit.
++
++config	VSERVER_WARN
++	bool	"VServer Warnings"
++	default y
++	help
++	  This enables various runtime warnings, which will
++	  notify about potential manipulation attempts or
++	  resource shortage. It is generally considered to
++	  be a good idea to have that enabled.
++
++config	VSERVER_DEBUG
++	bool	"VServer Debugging Code"
++	default n
++	help
++	  Set this to yes if you want to be able to activate
++	  debugging output at runtime. It adds a very small
++	  overhead to all vserver related functions and
++	  increases the kernel size by about 20k.
++
++config	VSERVER_HISTORY
++	bool	"VServer History Tracing"
++	depends on VSERVER_DEBUG
++	default n
++	help
++	  Set this to yes if you want to record the history of
++	  linux-vserver activities, so they can be replayed in
++	  the event of a kernel panic or oops.
++
++config	VSERVER_HISTORY_SIZE
++	int	"Per-CPU History Size (32-65536)"
++	depends on VSERVER_HISTORY
++	range 32 65536
++	default 64
++	help
++	  This allows you to specify the number of entries in
++	  the per-CPU history buffer.
++
++config	VSERVER_MONITOR
++	bool	"VServer Scheduling Monitor"
++	depends on VSERVER_DEBUG
++	default n
++	help
++	  Set this to yes if you want to record the scheduling
++	  decisions, so that they can be relayed to userspace
++	  for detailed analysis.
++
++config	VSERVER_MONITOR_SIZE
++	int	"Per-CPU Monitor Queue Size (32-65536)"
++	depends on VSERVER_MONITOR
++	range 32 65536
++	default 1024
++	help
++	  This allows you to specify the number of entries in
++	  the per-CPU scheduling monitor buffer.
++
++config	VSERVER_MONITOR_SYNC
++	int	"Per-CPU Monitor Sync Interval (0-65536)"
++	depends on VSERVER_MONITOR
++	range 0 65536
++	default 256
++	help
++	  This allows you to specify the interval in ticks
++	  when a time sync entry is inserted.
++
++endmenu
++
++
++config	VSERVER
++	bool
++	default y
++	select UTS_NS
++	select SYSVIPC
++	select IPC_NS
++
++config	VSERVER_SECURITY
++	bool
++	depends on SECURITY
++	default y
++	select SECURITY_CAPABILITIES
++
++config	VSERVER_NGNET
++	bool
++	depends on EXPERIMENTAL && !VSERVER_LEGACYNET
++	default y
++
+--- linux-2.6.22/kernel/vserver/Makefile	1970-01-01 01:00:00 +0100
++++ linux-2.6.22-vs2.2.0-rc5/kernel/vserver/Makefile	2007-06-15 02:37:04 +0200
+@@ -0,0 +1,17 @@
++#
++# Makefile for the Linux vserver routines.
++#
++
++
++obj-y		+= vserver.o
++
++vserver-y	:= switch.o context.o space.o sched.o network.o inode.o \
++		   limit.o cvirt.o cacct.o signal.o helper.o init.o dlimit.o
++
++vserver-$(CONFIG_PROC_FS) += proc.o
++vserver-$(CONFIG_VSERVER_DEBUG) += sysctl.o debug.o
++vserver-$(CONFIG_VSERVER_LEGACY) += legacy.o
++vserver-$(CONFIG_VSERVER_LEGACYNET) += legacynet.o
++vserver-$(CONFIG_VSERVER_HISTORY) += history.o
++vserver-$(CONFIG_VSERVER_MONITOR) += monitor.o
++
+--- linux-2.6.22/kernel/vserver/cacct.c	1970-01-01 01:00:00 +0100
++++ linux-2.6.22-vs2.2.0-rc5/kernel/vserver/cacct.c	2007-06-15 02:37:04 +0200
+@@ -0,0 +1,44 @@
++/*
++ *  linux/kernel/vserver/cacct.c
++ *
++ *  Virtual Server: Context Accounting
++ *
++ *  Copyright (C) 2006-2007 Herbert Pötzl
++ *
++ *  V0.01  added accounting stats
++ *
++ */
++
++#include <linux/types.h>
++#include <linux/sched.h>
++#include <linux/vs_context.h>
++#include <linux/vserver/switch.h>
++#include <linux/vserver/cacct_cmd.h>
++#include <linux/vserver/cacct_int.h>
++
++#include <asm/errno.h>
++#include <asm/uaccess.h>
++
++
++int vc_sock_stat(struct vx_info *vxi, void __user *data)
++{
++	struct vcmd_sock_stat_v0 vc_data;
++	int j, field;
++
++	if (copy_from_user(&vc_data, data, sizeof(vc_data)))
++		return -EFAULT;
++
++	field = vc_data.field;
++	if ((field < 0) || (field >= VXA_SOCK_SIZE))
++		return -EINVAL;
++
++	for (j = 0; j < 3; j++) {
++		vc_data.count[j] = vx_sock_count(&vxi->cacct, field, j);
++		vc_data.total[j] = vx_sock_total(&vxi->cacct, field, j);
++	}
++
++	if (copy_to_user(data, &vc_data, sizeof(vc_data)))
++		return -EFAULT;
++	return 0;
++}
++
+--- linux-2.6.22/kernel/vserver/cacct_init.h	1970-01-01 01:00:00 +0100
++++ linux-2.6.22-vs2.2.0-rc5/kernel/vserver/cacct_init.h	2007-06-15 02:37:04 +0200
+@@ -0,0 +1,25 @@
++
++
++static inline void vx_info_init_cacct(struct _vx_cacct *cacct)
++{
++	int i, j;
++
++
++	for (i = 0; i < VXA_SOCK_SIZE; i++) {
++		for (j = 0; j < 3; j++) {
++			atomic_set(&cacct->sock[i][j].count, 0);
++			atomic_set(&cacct->sock[i][j].total, 0);
++		}
++	}
++	for (i = 0; i < 8; i++)
++		atomic_set(&cacct->slab[i], 0);
++	for (i = 0; i < 5; i++)
++		for (j = 0; j < 4; j++)
++			atomic_set(&cacct->page[i][j], 0);
++}
++
++static inline void vx_info_exit_cacct(struct _vx_cacct *cacct)
++{
++	return;
++}
++
+--- linux-2.6.22/kernel/vserver/cacct_proc.h	1970-01-01 01:00:00 +0100
++++ linux-2.6.22-vs2.2.0-rc5/kernel/vserver/cacct_proc.h	2007-06-15 02:37:04 +0200
+@@ -0,0 +1,53 @@
++#ifndef _VX_CACCT_PROC_H
++#define _VX_CACCT_PROC_H
++
++#include <linux/vserver/cacct_int.h>
++
++
++#define VX_SOCKA_TOP	\
++	"Type\t    recv #/bytes\t\t   send #/bytes\t\t    fail #/bytes\n"
++
++static inline int vx_info_proc_cacct(struct _vx_cacct *cacct, char *buffer)
++{
++	int i, j, length = 0;
++	static char *type[VXA_SOCK_SIZE] = {
++		"UNSPEC", "UNIX", "INET", "INET6", "PACKET", "OTHER"
++	};
++
++	length += sprintf(buffer + length, VX_SOCKA_TOP);
++	for (i = 0; i < VXA_SOCK_SIZE; i++) {
++		length += sprintf(buffer + length, "%s:", type[i]);
++		for (j = 0; j < 3; j++) {
++			length += sprintf(buffer + length,
++				"\t%10lu/%-10lu",
++				vx_sock_count(cacct, i, j),
++				vx_sock_total(cacct, i, j));
++		}
++		buffer[length++] = '\n';
++	}
++
++	length += sprintf(buffer + length, "\n");
++	length += sprintf(buffer + length,
++		"slab:\t %8u %8u %8u %8u\n",
++		atomic_read(&cacct->slab[1]),
++		atomic_read(&cacct->slab[4]),
++		atomic_read(&cacct->slab[0]),
++		atomic_read(&cacct->slab[2]));
++
++	length += sprintf(buffer + length, "\n");
++	for (i = 0; i < 5; i++) {
++		length += sprintf(buffer + length,
++			"page[%d]: %8u %8u %8u %8u\t %8u %8u %8u %8u\n", i,
++			atomic_read(&cacct->page[i][0]),
++			atomic_read(&cacct->page[i][1]),
++			atomic_read(&cacct->page[i][2]),
++			atomic_read(&cacct->page[i][3]),
++			atomic_read(&cacct->page[i][4]),
++			atomic_read(&cacct->page[i][5]),
++			atomic_read(&cacct->page[i][6]),
++			atomic_read(&cacct->page[i][7]));
++	}
++	return length;
++}
++
++#endif	/* _VX_CACCT_PROC_H */
+--- linux-2.6.22/kernel/vserver/context.c	1970-01-01 01:00:00 +0100
++++ linux-2.6.22-vs2.2.0-rc5/kernel/vserver/context.c	2007-06-16 06:44:23 +0200
+@@ -0,0 +1,1106 @@
++/*
++ *  linux/kernel/vserver/context.c
++ *
++ *  Virtual Server: Context Support
++ *
++ *  Copyright (C) 2003-2007  Herbert Pötzl
++ *
++ *  V0.01  context helper
++ *  V0.02  vx_ctx_kill syscall command
++ *  V0.03  replaced context_info calls
++ *  V0.04  redesign of struct (de)alloc
++ *  V0.05  rlimit basic implementation
++ *  V0.06  task_xid and info commands
++ *  V0.07  context flags and caps
++ *  V0.08  switch to RCU based hash
++ *  V0.09  revert to non RCU for now
++ *  V0.10  and back to working RCU hash
++ *  V0.11  and back to locking again
++ *  V0.12  referenced context store
++ *  V0.13  separate per cpu data
++ *  V0.14  changed vcmds to vxi arg
++ *  V0.15  added context stat
++ *  V0.16  have __create claim() the vxi
++ *
++ */
++
++#include <linux/slab.h>
++#include <linux/types.h>
++#include <linux/mnt_namespace.h>
++#include <linux/pid_namespace.h>
++
++#include <linux/sched.h>
++#include <linux/vserver/context.h>
++#include <linux/vserver/network.h>
++#include <linux/vserver/legacy.h>
++#include <linux/vserver/debug.h>
++#include <linux/vserver/limit.h>
++#include <linux/vserver/limit_int.h>
++#include <linux/vserver/space.h>
++
++#include <linux/vs_context.h>
++#include <linux/vs_limit.h>
++#include <linux/vserver/context_cmd.h>
++
++#include <linux/err.h>
++#include <asm/errno.h>
++
++#include "cvirt_init.h"
++#include "cacct_init.h"
++#include "limit_init.h"
++#include "sched_init.h"
++
++
++atomic_t vx_global_ctotal	= ATOMIC_INIT(0);
++atomic_t vx_global_cactive	= ATOMIC_INIT(0);
++
++
++/*	now inactive context structures */
++
++static struct hlist_head vx_info_inactive = HLIST_HEAD_INIT;
++
++static spinlock_t vx_info_inactive_lock = SPIN_LOCK_UNLOCKED;
++
++
++/*	__alloc_vx_info()
++
++	* allocate an initialized vx_info struct
++	* doesn't make it visible (hash)			*/
++
++static struct vx_info *__alloc_vx_info(xid_t xid)
++{
++	struct vx_info *new = NULL;
++	int cpu;
++
++	vxdprintk(VXD_CBIT(xid, 0), "alloc_vx_info(%d)*", xid);
++
++	/* would this benefit from a slab cache? */
++	new = kmalloc(sizeof(struct vx_info), GFP_KERNEL);
++	if (!new)
++		return 0;
++
++	memset(new, 0, sizeof(struct vx_info));
++#ifdef CONFIG_SMP
++	new->ptr_pc = alloc_percpu(struct _vx_info_pc);
++	if (!new->ptr_pc)
++		goto error;
++#endif
++	new->vx_id = xid;
++	INIT_HLIST_NODE(&new->vx_hlist);
++	atomic_set(&new->vx_usecnt, 0);
++	atomic_set(&new->vx_tasks, 0);
++	new->vx_parent = NULL;
++	new->vx_state = 0;
++	init_waitqueue_head(&new->vx_wait);
++
++	/* prepare reaper */
++	get_task_struct(init_pid_ns.child_reaper);
++	new->vx_reaper = init_pid_ns.child_reaper;
++
++	/* rest of init goes here */
++	vx_info_init_limit(&new->limit);
++	vx_info_init_sched(&new->sched);
++	vx_info_init_cvirt(&new->cvirt);
++	vx_info_init_cacct(&new->cacct);
++
++	/* per cpu data structures */
++	for_each_possible_cpu(cpu) {
++		vx_info_init_sched_pc(
++			&vx_per_cpu(new, sched_pc, cpu), cpu);
++		vx_info_init_cvirt_pc(
++			&vx_per_cpu(new, cvirt_pc, cpu), cpu);
++	}
++
++	new->vx_flags = VXF_INIT_SET;
++	new->vx_bcaps = CAP_INIT_EFF_SET;
++	new->vx_ccaps = 0;
++	new->vx_cap_bset = cap_bset;
++
++	new->reboot_cmd = 0;
++	new->exit_code = 0;
++
++	vxdprintk(VXD_CBIT(xid, 0),
++		"alloc_vx_info(%d) = %p", xid, new);
++	vxh_alloc_vx_info(new);
++	atomic_inc(&vx_global_ctotal);
++	return new;
++#ifdef CONFIG_SMP
++error:
++	kfree(new);
++	return 0;
++#endif
++}
++
++/*	__dealloc_vx_info()
++
++	* final disposal of vx_info				*/
++
++static void __dealloc_vx_info(struct vx_info *vxi)
++{
++	int cpu;
++
++	vxdprintk(VXD_CBIT(xid, 0),
++		"dealloc_vx_info(%p)", vxi);
++	vxh_dealloc_vx_info(vxi);
++
++	vxi->vx_id = -1;
++
++	vx_info_exit_limit(&vxi->limit);
++	vx_info_exit_sched(&vxi->sched);
++	vx_info_exit_cvirt(&vxi->cvirt);
++	vx_info_exit_cacct(&vxi->cacct);
++
++	for_each_possible_cpu(cpu) {
++		vx_info_exit_sched_pc(
++			&vx_per_cpu(vxi, sched_pc, cpu), cpu);
++		vx_info_exit_cvirt_pc(
++			&vx_per_cpu(vxi, cvirt_pc, cpu), cpu);
++	}
++
++	vxi->vx_state |= VXS_RELEASED;
++
++#ifdef CONFIG_SMP
++	free_percpu(vxi->ptr_pc);
++#endif
++	kfree(vxi);
++	atomic_dec(&vx_global_ctotal);
++}
++
++static void __shutdown_vx_info(struct vx_info *vxi)
++{
++	struct nsproxy *nsproxy;
++	struct fs_struct *fs;
++
++	might_sleep();
++
++	vxi->vx_state |= VXS_SHUTDOWN;
++	vs_state_change(vxi, VSC_SHUTDOWN);
++
++	nsproxy = xchg(&vxi->vx_nsproxy, NULL);
++	fs = xchg(&vxi->vx_fs, NULL);
++
++	if (nsproxy)
++		put_nsproxy(nsproxy);
++	if (fs)
++		put_fs_struct(fs);
++}
++
++/* exported stuff */
++
++void free_vx_info(struct vx_info *vxi)
++{
++	unsigned long flags;
++
++	/* context shutdown is mandatory */
++	BUG_ON(!vx_info_state(vxi, VXS_SHUTDOWN));
++
++	BUG_ON(atomic_read(&vxi->vx_usecnt));
++	BUG_ON(atomic_read(&vxi->vx_tasks));
++
++	BUG_ON(vx_info_state(vxi, VXS_HASHED));
++
++	BUG_ON(vxi->vx_nsproxy);
++	BUG_ON(vxi->vx_fs);
++
++	spin_lock_irqsave(&vx_info_inactive_lock, flags);
++	hlist_del(&vxi->vx_hlist);
++	spin_unlock_irqrestore(&vx_info_inactive_lock, flags);
++
++	__dealloc_vx_info(vxi);
++}
++
++
++/*	hash table for vx_info hash */
++
++#define VX_HASH_SIZE	13
++
++static struct hlist_head vx_info_hash[VX_HASH_SIZE] =
++	{ [0 ... VX_HASH_SIZE-1] = HLIST_HEAD_INIT };
++
++static spinlock_t vx_info_hash_lock = SPIN_LOCK_UNLOCKED;
++
++
++static inline unsigned int __hashval(xid_t xid)
++{
++	return (xid % VX_HASH_SIZE);
++}
++
++
++
++/*	__hash_vx_info()
++
++	* add the vxi to the global hash table
++	* requires the hash_lock to be held			*/
++
++static inline void __hash_vx_info(struct vx_info *vxi)
++{
++	struct hlist_head *head;
++
++	vxd_assert_lock(&vx_info_hash_lock);
++	vxdprintk(VXD_CBIT(xid, 4),
++		"__hash_vx_info: %p[#%d]", vxi, vxi->vx_id);
++	vxh_hash_vx_info(vxi);
++
++	/* context must not be hashed */
++	BUG_ON(vx_info_state(vxi, VXS_HASHED));
++
++	vxi->vx_state |= VXS_HASHED;
++	head = &vx_info_hash[__hashval(vxi->vx_id)];
++	hlist_add_head(&vxi->vx_hlist, head);
++	atomic_inc(&vx_global_cactive);
++}
++
++/*	__unhash_vx_info()
++
++	* remove the vxi from the global hash table
++	* requires the hash_lock to be held			*/
++
++static inline void __unhash_vx_info(struct vx_info *vxi)
++{
++	unsigned long flags;
++
++	vxd_assert_lock(&vx_info_hash_lock);
++	vxdprintk(VXD_CBIT(xid, 4),
++		"__unhash_vx_info: %p[#%d.%d.%d]", vxi, vxi->vx_id,
++		atomic_read(&vxi->vx_usecnt), atomic_read(&vxi->vx_tasks));
++	vxh_unhash_vx_info(vxi);
++
++	/* context must be hashed */
++	BUG_ON(!vx_info_state(vxi, VXS_HASHED));
++	/* but without tasks */
++	BUG_ON(atomic_read(&vxi->vx_tasks));
++
++	vxi->vx_state &= ~VXS_HASHED;
++	hlist_del_init(&vxi->vx_hlist);
++	spin_lock_irqsave(&vx_info_inactive_lock, flags);
++	hlist_add_head(&vxi->vx_hlist, &vx_info_inactive);
++	spin_unlock_irqrestore(&vx_info_inactive_lock, flags);
++	atomic_dec(&vx_global_cactive);
++}
++
++
++/*	__lookup_vx_info()
++
++	* requires the hash_lock to be held
++	* doesn't increment the vx_refcnt			*/
++
++static inline struct vx_info *__lookup_vx_info(xid_t xid)
++{
++	struct hlist_head *head = &vx_info_hash[__hashval(xid)];
++	struct hlist_node *pos;
++	struct vx_info *vxi;
++
++	vxd_assert_lock(&vx_info_hash_lock);
++	hlist_for_each(pos, head) {
++		vxi = hlist_entry(pos, struct vx_info, vx_hlist);
++
++		if (vxi->vx_id == xid)
++			goto found;
++	}
++	vxi = NULL;
++found:
++	vxdprintk(VXD_CBIT(xid, 0),
++		"__lookup_vx_info(#%u): %p[#%u]",
++		xid, vxi, vxi ? vxi->vx_id : 0);
++	vxh_lookup_vx_info(vxi, xid);
++	return vxi;
++}
++
++
++/*	__vx_dynamic_id()
++
++	* find unused dynamic xid
++	* requires the hash_lock to be held			*/
++
++static inline xid_t __vx_dynamic_id(void)
++{
++	static xid_t seq = MAX_S_CONTEXT;
++	xid_t barrier = seq;
++
++	vxd_assert_lock(&vx_info_hash_lock);
++	do {
++		if (++seq > MAX_S_CONTEXT)
++			seq = MIN_D_CONTEXT;
++		if (!__lookup_vx_info(seq)) {
++			vxdprintk(VXD_CBIT(xid, 4),
++				"__vx_dynamic_id: [#%d]", seq);
++			return seq;
++		}
++	} while (barrier != seq);
++	return 0;
++}
++
++#ifdef	CONFIG_VSERVER_LEGACY
++
++/*	__loc_vx_info()
++
++	* locate or create the requested context
++	* get() it and if new hash it				*/
++
++static struct vx_info *__loc_vx_info(int id, int *err)
++{
++	struct vx_info *new, *vxi = NULL;
++
++	vxdprintk(VXD_CBIT(xid, 1), "loc_vx_info(%d)*", id);
++
++	if (!(new = __alloc_vx_info(id))) {
++		*err = -ENOMEM;
++		return NULL;
++	}
++
++	/* required to make dynamic xids unique */
++	spin_lock(&vx_info_hash_lock);
++
++	/* dynamic context requested */
++	if (id == VX_DYNAMIC_ID) {
++#ifdef	CONFIG_VSERVER_DYNAMIC_IDS
++		id = __vx_dynamic_id();
++		if (!id) {
++			printk(KERN_ERR "no dynamic context available.\n");
++			goto out_unlock;
++		}
++		new->vx_id = id;
++#else
++		printk(KERN_ERR "dynamic contexts disabled.\n");
++		goto out_unlock;
++#endif
++	}
++	/* existing context requested */
++	else if ((vxi = __lookup_vx_info(id))) {
++		/* context in setup is not available */
++		if (vxi->vx_flags & VXF_STATE_SETUP) {
++			vxdprintk(VXD_CBIT(xid, 0),
++				"loc_vx_info(%d) = %p (not available)", id, vxi);
++			vxi = NULL;
++			*err = -EBUSY;
++		} else {
++			vxdprintk(VXD_CBIT(xid, 0),
++				"loc_vx_info(%d) = %p (found)", id, vxi);
++			get_vx_info(vxi);
++			*err = 0;
++		}
++		goto out_unlock;
++	}
++
++	/* new context requested */
++	vxdprintk(VXD_CBIT(xid, 0),
++		"loc_vx_info(%d) = %p (new)", id, new);
++	__hash_vx_info(get_vx_info(new));
++	vxi = new, new = NULL;
++	*err = 1;
++
++out_unlock:
++	spin_unlock(&vx_info_hash_lock);
++	vxh_loc_vx_info(vxi, id);
++	if (new)
++		__dealloc_vx_info(new);
++	return vxi;
++}
++
++#endif
++
++/*	__create_vx_info()
++
++	* create the requested context
++	* get(), claim() and hash it				*/
++
++static struct vx_info *__create_vx_info(int id)
++{
++	struct vx_info *new, *vxi = NULL;
++
++	vxdprintk(VXD_CBIT(xid, 1), "create_vx_info(%d)*", id);
++
++	if (!(new = __alloc_vx_info(id)))
++		return ERR_PTR(-ENOMEM);
++
++	/* required to make dynamic xids unique */
++	spin_lock(&vx_info_hash_lock);
++
++	/* dynamic context requested */
++	if (id == VX_DYNAMIC_ID) {
++#ifdef	CONFIG_VSERVER_DYNAMIC_IDS
++		id = __vx_dynamic_id();
++		if (!id) {
++			printk(KERN_ERR "no dynamic context available.\n");
++			vxi = ERR_PTR(-EAGAIN);
++			goto out_unlock;
++		}
++		new->vx_id = id;
++#else
++		printk(KERN_ERR "dynamic contexts disabled.\n");
++		vxi = ERR_PTR(-EINVAL);
++		goto out_unlock;
++#endif
++	}
++	/* static context requested */
++	else if ((vxi = __lookup_vx_info(id))) {
++		vxdprintk(VXD_CBIT(xid, 0),
++			"create_vx_info(%d) = %p (already there)", id, vxi);
++		if (vx_info_flags(vxi, VXF_STATE_SETUP, 0))
++			vxi = ERR_PTR(-EBUSY);
++		else
++			vxi = ERR_PTR(-EEXIST);
++		goto out_unlock;
++	}
++#ifdef	CONFIG_VSERVER_DYNAMIC_IDS
++	/* dynamic xid creation blocker */
++	else if (id >= MIN_D_CONTEXT) {
++		vxdprintk(VXD_CBIT(xid, 0),
++			"create_vx_info(%d) (dynamic rejected)", id);
++		vxi = ERR_PTR(-EINVAL);
++		goto out_unlock;
++	}
++#endif
++
++	/* new context */
++	vxdprintk(VXD_CBIT(xid, 0),
++		"create_vx_info(%d) = %p (new)", id, new);
++	claim_vx_info(new, NULL);
++	__hash_vx_info(get_vx_info(new));
++	vxi = new, new = NULL;
++
++out_unlock:
++	spin_unlock(&vx_info_hash_lock);
++	vxh_create_vx_info(IS_ERR(vxi) ? NULL : vxi, id);
++	if (new)
++		__dealloc_vx_info(new);
++	return vxi;
++}
++
++
++/*	exported stuff						*/
++
++
++void unhash_vx_info(struct vx_info *vxi)
++{
++	__shutdown_vx_info(vxi);
++	spin_lock(&vx_info_hash_lock);
++	__unhash_vx_info(vxi);
++	spin_unlock(&vx_info_hash_lock);
++	__wakeup_vx_info(vxi);
++}
++
++
++/*	lookup_vx_info()
++
++	* search for a vx_info and get() it
++	* negative id means current				*/
++
++struct vx_info *lookup_vx_info(int id)
++{
++	struct vx_info *vxi = NULL;
++
++	if (id < 0) {
++		vxi = get_vx_info(current->vx_info);
++	} else if (id > 1) {
++		spin_lock(&vx_info_hash_lock);
++		vxi = get_vx_info(__lookup_vx_info(id));
++		spin_unlock(&vx_info_hash_lock);
++	}
++	return vxi;
++}
++
++/*	xid_is_hashed()
++
++	* verify that xid is still hashed			*/
++
++int xid_is_hashed(xid_t xid)
++{
++	int hashed;
++
++	spin_lock(&vx_info_hash_lock);
++	hashed = (__lookup_vx_info(xid) != NULL);
++	spin_unlock(&vx_info_hash_lock);
++	return hashed;
++}
++
++#ifdef	CONFIG_VSERVER_LEGACY
++
++struct vx_info *lookup_or_create_vx_info(int id)
++{
++	int err;
++
++	return __loc_vx_info(id, &err);
++}
++
++#endif
++
++#ifdef	CONFIG_PROC_FS
++
++/*	get_xid_list()
++
++	* get a subset of hashed xids for proc
++	* assumes size is at least one				*/
++
++int get_xid_list(int index, unsigned int *xids, int size)
++{
++	int hindex, nr_xids = 0;
++
++	/* only show current and children */
++	if (!vx_check(0, VS_ADMIN | VS_WATCH)) {
++		if (index > 0)
++			return 0;
++		xids[nr_xids] = vx_current_xid();
++		return 1;
++	}
++
++	for (hindex = 0; hindex < VX_HASH_SIZE; hindex++) {
++		struct hlist_head *head = &vx_info_hash[hindex];
++		struct hlist_node *pos;
++
++		spin_lock(&vx_info_hash_lock);
++		hlist_for_each(pos, head) {
++			struct vx_info *vxi;
++
++			if (--index > 0)
++				continue;
++
++			vxi = hlist_entry(pos, struct vx_info, vx_hlist);
++			xids[nr_xids] = vxi->vx_id;
++			if (++nr_xids >= size) {
++				spin_unlock(&vx_info_hash_lock);
++				goto out;
++			}
++		}
++		/* keep the lock time short */
++		spin_unlock(&vx_info_hash_lock);
++	}
++out:
++	return nr_xids;
++}
++#endif
++
++#ifdef	CONFIG_VSERVER_DEBUG
++
++void	dump_vx_info_inactive(int level)
++{
++	struct hlist_node *entry, *next;
++
++	hlist_for_each_safe(entry, next, &vx_info_inactive) {
++		struct vx_info *vxi =
++			list_entry(entry, struct vx_info, vx_hlist);
++
++		dump_vx_info(vxi, level);
++	}
++}
++
++#endif
++
++int vx_migrate_user(struct task_struct *p, struct vx_info *vxi)
++{
++	struct user_struct *new_user, *old_user;
++
++	if (!p || !vxi)
++		BUG();
++
++	if (vx_info_flags(vxi, VXF_INFO_PRIVATE, 0))
++		return -EACCES;
++
++	new_user = alloc_uid(vxi->vx_id, p->uid);
++	if (!new_user)
++		return -ENOMEM;
++
++	old_user = p->user;
++	if (new_user != old_user) {
++		atomic_inc(&new_user->processes);
++		atomic_dec(&old_user->processes);
++		p->user = new_user;
++	}
++	free_uid(old_user);
++	return 0;
++}
++
++void vx_mask_cap_bset(struct vx_info *vxi, struct task_struct *p)
++{
++	p->cap_effective &= vxi->vx_cap_bset;
++	p->cap_inheritable &= vxi->vx_cap_bset;
++	p->cap_permitted &= vxi->vx_cap_bset;
++}
++
++
++#include <linux/file.h>
++
++static int vx_openfd_task(struct task_struct *tsk)
++{
++	struct files_struct *files = tsk->files;
++	struct fdtable *fdt;
++	const unsigned long *bptr;
++	int count, total;
++
++	/* no rcu_read_lock() because of spin_lock() */
++	spin_lock(&files->file_lock);
++	fdt = files_fdtable(files);
++	bptr = fdt->open_fds->fds_bits;
++	count = fdt->max_fds / (sizeof(unsigned long) * 8);
++	for (total = 0; count > 0; count--) {
++		if (*bptr)
++			total += hweight_long(*bptr);
++		bptr++;
++	}
++	spin_unlock(&files->file_lock);
++	return total;
++}
++
++
++/* 	for *space compatibility */
++
++asmlinkage long sys_unshare(unsigned long);
++
++/*
++ *	migrate task to new context
++ *	gets vxi, puts old_vxi on change
++ *	optionally unshares namespaces (hack)
++ */
++
++int vx_migrate_task(struct task_struct *p, struct vx_info *vxi, int unshare)
++{
++	struct vx_info *old_vxi;
++	int ret = 0;
++
++	if (!p || !vxi)
++		BUG();
++
++	vxdprintk(VXD_CBIT(xid, 5),
++		"vx_migrate_task(%p,%p[#%d.%d])", p, vxi,
++		vxi->vx_id, atomic_read(&vxi->vx_usecnt));
++
++	if (vx_info_flags(vxi, VXF_INFO_PRIVATE, 0) &&
++		!vx_info_flags(vxi, VXF_STATE_SETUP, 0))
++		return -EACCES;
++
++	if (vx_info_state(vxi, VXS_SHUTDOWN))
++		return -EFAULT;
++
++	old_vxi = task_get_vx_info(p);
++	if (old_vxi == vxi)
++		goto out;
++
++	if (!(ret = vx_migrate_user(p, vxi))) {
++		int openfd;
++
++		task_lock(p);
++		openfd = vx_openfd_task(p);
++
++		if (old_vxi) {
++			atomic_dec(&old_vxi->cvirt.nr_threads);
++			atomic_dec(&old_vxi->cvirt.nr_running);
++			__rlim_dec(&old_vxi->limit, RLIMIT_NPROC);
++			/* FIXME: what about the struct files here? */
++			__rlim_sub(&old_vxi->limit, VLIMIT_OPENFD, openfd);
++			/* account for the executable */
++			__rlim_dec(&old_vxi->limit, VLIMIT_DENTRY);
++		}
++		atomic_inc(&vxi->cvirt.nr_threads);
++		atomic_inc(&vxi->cvirt.nr_running);
++		__rlim_inc(&vxi->limit, RLIMIT_NPROC);
++		/* FIXME: what about the struct files here? */
++		__rlim_add(&vxi->limit, VLIMIT_OPENFD, openfd);
++		/* account for the executable */
++		__rlim_inc(&vxi->limit, VLIMIT_DENTRY);
++
++		if (old_vxi) {
++			release_vx_info(old_vxi, p);
++			clr_vx_info(&p->vx_info);
++		}
++		claim_vx_info(vxi, p);
++		set_vx_info(&p->vx_info, vxi);
++		p->xid = vxi->vx_id;
++
++		vxdprintk(VXD_CBIT(xid, 5),
++			"moved task %p into vxi:%p[#%d]",
++			p, vxi, vxi->vx_id);
++
++		vx_mask_cap_bset(vxi, p);
++		task_unlock(p);
++
++		/* hack for *spaces to provide compatibility */
++		if (unshare) {
++			struct nsproxy *old_nsp = p->nsproxy;
++			struct nsproxy *new_nsp;
++
++			ret = unshare_nsproxy_namespaces(
++				CLONE_NEWUTS | CLONE_NEWIPC,
++				&new_nsp, NULL);
++			if (ret)
++				goto out;
++
++			new_nsp = xchg(&p->nsproxy, new_nsp);
++			vx_set_space(vxi, CLONE_NEWUTS | CLONE_NEWIPC);
++			put_nsproxy(old_nsp);
++			put_nsproxy(new_nsp);
++		}
++	}
++out:
++	put_vx_info(old_vxi);
++	return ret;
++}
++
++int vx_set_reaper(struct vx_info *vxi, struct task_struct *p)
++{
++	struct task_struct *old_reaper;
++
++	if (!vxi)
++		return -EINVAL;
++
++	vxdprintk(VXD_CBIT(xid, 6),
++		"vx_set_reaper(%p[#%d],%p[#%d,%d])",
++		vxi, vxi->vx_id, p, p->xid, p->pid);
++
++	old_reaper = vxi->vx_reaper;
++	if (old_reaper == p)
++		return 0;
++
++	/* set new child reaper */
++	get_task_struct(p);
++	vxi->vx_reaper = p;
++	put_task_struct(old_reaper);
++	return 0;
++}
++
++int vx_set_init(struct vx_info *vxi, struct task_struct *p)
++{
++	if (!vxi)
++		return -EINVAL;
++
++	vxdprintk(VXD_CBIT(xid, 6),
++		"vx_set_init(%p[#%d],%p[#%d,%d,%d])",
++		vxi, vxi->vx_id, p, p->xid, p->pid, p->tgid);
++
++	vxi->vx_flags &= ~VXF_STATE_INIT;
++	vxi->vx_initpid = p->tgid;
++	return 0;
++}
++
++void vx_exit_init(struct vx_info *vxi, struct task_struct *p, int code)
++{
++	vxdprintk(VXD_CBIT(xid, 6),
++		"vx_exit_init(%p[#%d],%p[#%d,%d,%d])",
++		vxi, vxi->vx_id, p, p->xid, p->pid, p->tgid);
++
++	vxi->exit_code = code;
++	vxi->vx_initpid = 0;
++}
++
++
++void vx_set_persistent(struct vx_info *vxi)
++{
++	vxdprintk(VXD_CBIT(xid, 6),
++		"vx_set_persistent(%p[#%d])", vxi, vxi->vx_id);
++
++	get_vx_info(vxi);
++	claim_vx_info(vxi, NULL);
++}
++
++void vx_clear_persistent(struct vx_info *vxi)
++{
++	vxdprintk(VXD_CBIT(xid, 6),
++		"vx_clear_persistent(%p[#%d])", vxi, vxi->vx_id);
++
++	release_vx_info(vxi, NULL);
++	put_vx_info(vxi);
++}
++
++void vx_update_persistent(struct vx_info *vxi)
++{
++	if (vx_info_flags(vxi, VXF_PERSISTENT, 0))
++		vx_set_persistent(vxi);
++	else
++		vx_clear_persistent(vxi);
++}
++
++
++/*	task must be current or locked		*/
++
++void	exit_vx_info(struct task_struct *p, int code)
++{
++	struct vx_info *vxi = p->vx_info;
++
++	if (vxi) {
++		atomic_dec(&vxi->cvirt.nr_threads);
++		vx_nproc_dec(p);
++
++		vxi->exit_code = code;
++		release_vx_info(vxi, p);
++	}
++}
++
++void	exit_vx_info_early(struct task_struct *p, int code)
++{
++	struct vx_info *vxi = p->vx_info;
++
++	if (vxi) {
++		if (vxi->vx_initpid == p->tgid)
++			vx_exit_init(vxi, p, code);
++		if (vxi->vx_reaper == p)
++			vx_set_reaper(vxi, init_pid_ns.child_reaper);
++	}
++}
++
++
++/* vserver syscall commands below here */
++
++/* taks xid and vx_info functions */
++
++#include <asm/uaccess.h>
++
++
++int vc_task_xid(uint32_t id, void __user *data)
++{
++	xid_t xid;
++
++	if (id) {
++		struct task_struct *tsk;
++
++		if (!vx_check(0, VS_ADMIN | VS_WATCH))
++			return -EPERM;
++
++		read_lock(&tasklist_lock);
++		tsk = find_task_by_real_pid(id);
++		xid = (tsk) ? tsk->xid : -ESRCH;
++		read_unlock(&tasklist_lock);
++	} else
++		xid = vx_current_xid();
++	return xid;
++}
++
++
++int vc_vx_info(struct vx_info *vxi, void __user *data)
++{
++	struct vcmd_vx_info_v0 vc_data;
++
++	vc_data.xid = vxi->vx_id;
++	vc_data.initpid = vxi->vx_initpid;
++
++	if (copy_to_user(data, &vc_data, sizeof(vc_data)))
++		return -EFAULT;
++	return 0;
++}
++
++
++int vc_ctx_stat(struct vx_info *vxi, void __user *data)
++{
++	struct vcmd_ctx_stat_v0 vc_data;
++
++	vc_data.usecnt = atomic_read(&vxi->vx_usecnt);
++	vc_data.tasks = atomic_read(&vxi->vx_tasks);
++
++	if (copy_to_user(data, &vc_data, sizeof(vc_data)))
++		return -EFAULT;
++	return 0;
++}
++
++
++/* context functions */
++
++int vc_ctx_create(uint32_t xid, void __user *data)
++{
++	struct vcmd_ctx_create vc_data = { .flagword = VXF_INIT_SET };
++	struct vx_info *new_vxi;
++	int ret;
++
++	if (data && copy_from_user(&vc_data, data, sizeof(vc_data)))
++		return -EFAULT;
++
++	if ((xid > MAX_S_CONTEXT) && (xid != VX_DYNAMIC_ID))
++		return -EINVAL;
++	if (xid < 2)
++		return -EINVAL;
++
++	new_vxi = __create_vx_info(xid);
++	if (IS_ERR(new_vxi))
++		return PTR_ERR(new_vxi);
++
++	/* initial flags */
++	new_vxi->vx_flags = vc_data.flagword;
++
++	ret = -ENOEXEC;
++	if (vs_state_change(new_vxi, VSC_STARTUP))
++		goto out;
++
++	ret = vx_migrate_task(current, new_vxi, (!data));
++	if (ret)
++		goto out;
++
++	/* return context id on success */
++	ret = new_vxi->vx_id;
++
++	/* get a reference for persistent contexts */
++	if ((vc_data.flagword & VXF_PERSISTENT))
++		vx_set_persistent(new_vxi);
++out:
++	release_vx_info(new_vxi, NULL);
++	put_vx_info(new_vxi);
++	return ret;
++}
++
++
++int vc_ctx_migrate(struct vx_info *vxi, void __user *data)
++{
++	struct vcmd_ctx_migrate vc_data = { .flagword = 0 };
++	int ret;
++
++	if (data && copy_from_user(&vc_data, data, sizeof(vc_data)))
++		return -EFAULT;
++
++	ret = vx_migrate_task(current, vxi, 0);
++	if (ret)
++		return ret;
++	if (vc_data.flagword & VXM_SET_INIT)
++		ret = vx_set_init(vxi, current);
++	if (ret)
++		return ret;
++	if (vc_data.flagword & VXM_SET_REAPER)
++		ret = vx_set_reaper(vxi, current);
++	return ret;
++}
++
++
++int vc_get_cflags(struct vx_info *vxi, void __user *data)
++{
++	struct vcmd_ctx_flags_v0 vc_data;
++
++	vc_data.flagword = vxi->vx_flags;
++
++	/* special STATE flag handling */
++	vc_data.mask = vs_mask_flags(~0UL, vxi->vx_flags, VXF_ONE_TIME);
++
++	if (copy_to_user(data, &vc_data, sizeof(vc_data)))
++		return -EFAULT;
++	return 0;
++}
++
++int vc_set_cflags(struct vx_info *vxi, void __user *data)
++{
++	struct vcmd_ctx_flags_v0 vc_data;
++	uint64_t mask, trigger;
++
++	if (copy_from_user(&vc_data, data, sizeof(vc_data)))
++		return -EFAULT;
++
++	/* special STATE flag handling */
++	mask = vs_mask_mask(vc_data.mask, vxi->vx_flags, VXF_ONE_TIME);
++	trigger = (mask & vxi->vx_flags) ^ (mask & vc_data.flagword);
++
++	if (vxi == current->vx_info) {
++		if (trigger & VXF_STATE_SETUP)
++			vx_mask_cap_bset(vxi, current);
++		if (trigger & VXF_STATE_INIT) {
++			int ret;
++
++			ret = vx_set_init(vxi, current);
++			if (ret)
++				return ret;
++			ret = vx_set_reaper(vxi, current);
++			if (ret)
++				return ret;
++		}
++	}
++
++	vxi->vx_flags = vs_mask_flags(vxi->vx_flags,
++		vc_data.flagword, mask);
++	if (trigger & VXF_PERSISTENT)
++		vx_update_persistent(vxi);
++
++	return 0;
++}
++
++static int do_get_caps(struct vx_info *vxi, uint64_t *bcaps, uint64_t *ccaps)
++{
++	if (bcaps)
++		*bcaps = vxi->vx_bcaps;
++	if (ccaps)
++		*ccaps = vxi->vx_ccaps;
++
++	return 0;
++}
++
++int vc_get_ccaps_v0(struct vx_info *vxi, void __user *data)
++{
++	struct vcmd_ctx_caps_v0 vc_data;
++	int ret;
++
++	ret = do_get_caps(vxi, &vc_data.bcaps, &vc_data.ccaps);
++	if (ret)
++		return ret;
++	vc_data.cmask = ~0UL;
++
++	if (copy_to_user(data, &vc_data, sizeof(vc_data)))
++		return -EFAULT;
++	return 0;
++}
++
++int vc_get_ccaps(struct vx_info *vxi, void __user *data)
++{
++	struct vcmd_ctx_caps_v1 vc_data;
++	int ret;
++
++	ret = do_get_caps(vxi, NULL, &vc_data.ccaps);
++	if (ret)
++		return ret;
++	vc_data.cmask = ~0UL;
++
++	if (copy_to_user(data, &vc_data, sizeof(vc_data)))
++		return -EFAULT;
++	return 0;
++}
++
++static int do_set_caps(struct vx_info *vxi,
++	uint64_t bcaps, uint64_t bmask, uint64_t ccaps, uint64_t cmask)
++{
++	vxi->vx_bcaps = vs_mask_flags(vxi->vx_bcaps, bcaps, bmask);
++	vxi->vx_ccaps = vs_mask_flags(vxi->vx_ccaps, ccaps, cmask);
++
++	return 0;
++}
++
++int vc_set_ccaps_v0(struct vx_info *vxi, void __user *data)
++{
++	struct vcmd_ctx_caps_v0 vc_data;
++
++	if (copy_from_user(&vc_data, data, sizeof(vc_data)))
++		return -EFAULT;
++
++	/* simulate old &= behaviour for bcaps */
++	return do_set_caps(vxi, 0, ~vc_data.bcaps,
++		vc_data.ccaps, vc_data.cmask);
++}
++
++int vc_set_ccaps(struct vx_info *vxi, void __user *data)
++{
++	struct vcmd_ctx_caps_v1 vc_data;
++
++	if (copy_from_user(&vc_data, data, sizeof(vc_data)))
++		return -EFAULT;
++
++	return do_set_caps(vxi, 0, 0, vc_data.ccaps, vc_data.cmask);
++}
++
++int vc_get_bcaps(struct vx_info *vxi, void __user *data)
++{
++	struct vcmd_bcaps vc_data;
++	int ret;
++
++	ret = do_get_caps(vxi, &vc_data.bcaps, NULL);
++	if (ret)
++		return ret;
++	vc_data.bmask = ~0UL;
++
++	if (copy_to_user(data, &vc_data, sizeof(vc_data)))
++		return -EFAULT;
++	return 0;
++}
++
++int vc_set_bcaps(struct vx_info *vxi, void __user *data)
++{
++	struct vcmd_bcaps vc_data;
++
++	if (copy_from_user(&vc_data, data, sizeof(vc_data)))
++		return -EFAULT;
++
++	return do_set_caps(vxi, vc_data.bcaps, vc_data.bmask, 0, 0);
++}
++
++#include <linux/module.h>
++
++EXPORT_SYMBOL_GPL(free_vx_info);
++
+--- linux-2.6.22/kernel/vserver/cvirt.c	1970-01-01 01:00:00 +0100
++++ linux-2.6.22-vs2.2.0-rc5/kernel/vserver/cvirt.c	2007-06-15 02:37:04 +0200
+@@ -0,0 +1,304 @@
++/*
++ *  linux/kernel/vserver/cvirt.c
++ *
++ *  Virtual Server: Context Virtualization
++ *
++ *  Copyright (C) 2004-2007  Herbert Pötzl
++ *
++ *  V0.01  broken out from limit.c
++ *  V0.02  added utsname stuff
++ *  V0.03  changed vcmds to vxi arg
++ *
++ */
++
++#include <linux/sched.h>
++#include <linux/sysctl.h>
++#include <linux/types.h>
++#include <linux/vs_context.h>
++#include <linux/vs_cvirt.h>
++#include <linux/vserver/switch.h>
++#include <linux/vserver/cvirt_cmd.h>
++
++#include <asm/errno.h>
++#include <asm/uaccess.h>
++
++
++void vx_vsi_uptime(struct timespec *uptime, struct timespec *idle)
++{
++	struct vx_info *vxi = current->vx_info;
++
++	set_normalized_timespec(uptime,
++		uptime->tv_sec - vxi->cvirt.bias_uptime.tv_sec,
++		uptime->tv_nsec - vxi->cvirt.bias_uptime.tv_nsec);
++	if (!idle)
++		return;
++	set_normalized_timespec(idle,
++		idle->tv_sec - vxi->cvirt.bias_idle.tv_sec,
++		idle->tv_nsec - vxi->cvirt.bias_idle.tv_nsec);
++	return;
++}
++
++uint64_t vx_idle_jiffies(void)
++{
++	return init_task.utime + init_task.stime;
++}
++
++
++
++static inline uint32_t __update_loadavg(uint32_t load,
++	int wsize, int delta, int n)
++{
++	unsigned long long calc, prev;
++
++	/* just set it to n */
++	if (unlikely(delta >= wsize))
++		return (n << FSHIFT);
++
++	calc = delta * n;
++	calc <<= FSHIFT;
++	prev = (wsize - delta);
++	prev *= load;
++	calc += prev;
++	do_div(calc, wsize);
++	return calc;
++}
++
++
++void vx_update_load(struct vx_info *vxi)
++{
++	uint32_t now, last, delta;
++	unsigned int nr_running, nr_uninterruptible;
++	unsigned int total;
++	unsigned long flags;
++
++	spin_lock_irqsave(&vxi->cvirt.load_lock, flags);
++
++	now = jiffies;
++	last = vxi->cvirt.load_last;
++	delta = now - last;
++
++	if (delta < 5*HZ)
++		goto out;
++
++	nr_running = atomic_read(&vxi->cvirt.nr_running);
++	nr_uninterruptible = atomic_read(&vxi->cvirt.nr_uninterruptible);
++	total = nr_running + nr_uninterruptible;
++
++	vxi->cvirt.load[0] = __update_loadavg(vxi->cvirt.load[0],
++		60*HZ, delta, total);
++	vxi->cvirt.load[1] = __update_loadavg(vxi->cvirt.load[1],
++		5*60*HZ, delta, total);
++	vxi->cvirt.load[2] = __update_loadavg(vxi->cvirt.load[2],
++		15*60*HZ, delta, total);
++
++	vxi->cvirt.load_last = now;
++out:
++	atomic_inc(&vxi->cvirt.load_updates);
++	spin_unlock_irqrestore(&vxi->cvirt.load_lock, flags);
++}
++
++
++/*
++ * Commands to do_syslog:
++ *
++ *      0 -- Close the log.  Currently a NOP.
++ *      1 -- Open the log. Currently a NOP.
++ *      2 -- Read from the log.
++ *      3 -- Read all messages remaining in the ring buffer.
++ *      4 -- Read and clear all messages remaining in the ring buffer
++ *      5 -- Clear ring buffer.
++ *      6 -- Disable printk's to console
++ *      7 -- Enable printk's to console
++ *      8 -- Set level of messages printed to console
++ *      9 -- Return number of unread characters in the log buffer
++ *     10 -- Return size of the log buffer
++ */
++int vx_do_syslog(int type, char __user *buf, int len)
++{
++	int error = 0;
++	int do_clear = 0;
++	struct vx_info *vxi = current->vx_info;
++	struct _vx_syslog *log;
++
++	if (!vxi)
++		return -EINVAL;
++	log = &vxi->cvirt.syslog;
++
++	switch (type) {
++	case 0:		/* Close log */
++	case 1:		/* Open log */
++		break;
++	case 2:		/* Read from log */
++		error = wait_event_interruptible(log->log_wait,
++			(log->log_start - log->log_end));
++		if (error)
++			break;
++		spin_lock_irq(&log->logbuf_lock);
++		spin_unlock_irq(&log->logbuf_lock);
++		break;
++	case 4:		/* Read/clear last kernel messages */
++		do_clear = 1;
++		/* fall through */
++	case 3:		/* Read last kernel messages */
++		return 0;
++
++	case 5:		/* Clear ring buffer */
++		return 0;
++
++	case 6:		/* Disable logging to console */
++	case 7:		/* Enable logging to console */
++	case 8:		/* Set level of messages printed to console */
++		break;
++
++	case 9:		/* Number of chars in the log buffer */
++		return 0;
++	case 10:	/* Size of the log buffer */
++		return 0;
++	default:
++		error = -EINVAL;
++		break;
++	}
++	return error;
++}
++
++
++/* virtual host info names */
++
++static char *vx_vhi_name(struct vx_info *vxi, int id)
++{
++	struct nsproxy *nsproxy;
++	struct uts_namespace *uts;
++
++
++	if (id == VHIN_CONTEXT)
++		return vxi->vx_name;
++
++	nsproxy = vxi->vx_nsproxy;
++	if (!nsproxy)
++		return NULL;
++
++	uts = nsproxy->uts_ns;
++	if (!uts)
++		return NULL;
++
++	switch (id) {
++	case VHIN_SYSNAME:
++		return uts->name.sysname;
++	case VHIN_NODENAME:
++		return uts->name.nodename;
++	case VHIN_RELEASE:
++		return uts->name.release;
++	case VHIN_VERSION:
++		return uts->name.version;
++	case VHIN_MACHINE:
++		return uts->name.machine;
++	case VHIN_DOMAINNAME:
++		return uts->name.domainname;
++	default:
++		return NULL;
++	}
++	return NULL;
++}
++
++int vc_set_vhi_name(struct vx_info *vxi, void __user *data)
++{
++	struct vcmd_vhi_name_v0 vc_data;
++	char *name;
++
++	if (copy_from_user(&vc_data, data, sizeof(vc_data)))
++		return -EFAULT;
++
++	name = vx_vhi_name(vxi, vc_data.field);
++	if (!name)
++		return -EINVAL;
++
++	memcpy(name, vc_data.name, 65);
++	return 0;
++}
++
++int vc_get_vhi_name(struct vx_info *vxi, void __user *data)
++{
++	struct vcmd_vhi_name_v0 vc_data;
++	char *name;
++
++	if (copy_from_user(&vc_data, data, sizeof(vc_data)))
++		return -EFAULT;
++
++	name = vx_vhi_name(vxi, vc_data.field);
++	if (!name)
++		return -EINVAL;
++
++	memcpy(vc_data.name, name, 65);
++	if (copy_to_user(data, &vc_data, sizeof(vc_data)))
++		return -EFAULT;
++	return 0;
++}
++
++
++int vc_virt_stat(struct vx_info *vxi, void __user *data)
++{
++	struct vcmd_virt_stat_v0 vc_data;
++	struct _vx_cvirt *cvirt = &vxi->cvirt;
++	struct timespec uptime;
++
++	do_posix_clock_monotonic_gettime(&uptime);
++	set_normalized_timespec(&uptime,
++		uptime.tv_sec - cvirt->bias_uptime.tv_sec,
++		uptime.tv_nsec - cvirt->bias_uptime.tv_nsec);
++
++	vc_data.offset = timeval_to_ns(&cvirt->bias_tv);
++	vc_data.uptime = timespec_to_ns(&uptime);
++	vc_data.nr_threads = atomic_read(&cvirt->nr_threads);
++	vc_data.nr_running = atomic_read(&cvirt->nr_running);
++	vc_data.nr_uninterruptible = atomic_read(&cvirt->nr_uninterruptible);
++	vc_data.nr_onhold = atomic_read(&cvirt->nr_onhold);
++	vc_data.nr_forks = atomic_read(&cvirt->total_forks);
++	vc_data.load[0] = cvirt->load[0];
++	vc_data.load[1] = cvirt->load[1];
++	vc_data.load[2] = cvirt->load[2];
++
++	if (copy_to_user(data, &vc_data, sizeof(vc_data)))
++		return -EFAULT;
++	return 0;
++}
++
++
++#ifdef CONFIG_VSERVER_VTIME
++
++/* virtualized time base */
++
++void vx_gettimeofday(struct timeval *tv)
++{
++	do_gettimeofday(tv);
++	if (!vx_flags(VXF_VIRT_TIME, 0))
++		return;
++
++	tv->tv_sec += current->vx_info->cvirt.bias_tv.tv_sec;
++	tv->tv_usec += current->vx_info->cvirt.bias_tv.tv_usec;
++
++	if (tv->tv_usec >= USEC_PER_SEC) {
++		tv->tv_sec++;
++		tv->tv_usec -= USEC_PER_SEC;
++	} else if (tv->tv_usec < 0) {
++		tv->tv_sec--;
++		tv->tv_usec += USEC_PER_SEC;
++	}
++}
++
++int vx_settimeofday(struct timespec *ts)
++{
++	struct timeval tv;
++
++	if (!vx_flags(VXF_VIRT_TIME, 0))
++		return do_settimeofday(ts);
++
++	do_gettimeofday(&tv);
++	current->vx_info->cvirt.bias_tv.tv_sec =
++		ts->tv_sec - tv.tv_sec;
++	current->vx_info->cvirt.bias_tv.tv_usec =
++		(ts->tv_nsec/NSEC_PER_USEC) - tv.tv_usec;
++	return 0;
++}
++
++#endif
++
+--- linux-2.6.22/kernel/vserver/cvirt_init.h	1970-01-01 01:00:00 +0100
++++ linux-2.6.22-vs2.2.0-rc5/kernel/vserver/cvirt_init.h	2007-06-15 02:37:04 +0200
+@@ -0,0 +1,69 @@
++
++
++extern uint64_t vx_idle_jiffies(void);
++
++static inline void vx_info_init_cvirt(struct _vx_cvirt *cvirt)
++{
++	uint64_t idle_jiffies = vx_idle_jiffies();
++	uint64_t nsuptime;
++
++	do_posix_clock_monotonic_gettime(&cvirt->bias_uptime);
++	nsuptime = (unsigned long long)cvirt->bias_uptime.tv_sec
++		* NSEC_PER_SEC + cvirt->bias_uptime.tv_nsec;
++	cvirt->bias_clock = nsec_to_clock_t(nsuptime);
++	cvirt->bias_tv.tv_sec = 0;
++	cvirt->bias_tv.tv_usec = 0;
++
++	jiffies_to_timespec(idle_jiffies, &cvirt->bias_idle);
++	atomic_set(&cvirt->nr_threads, 0);
++	atomic_set(&cvirt->nr_running, 0);
++	atomic_set(&cvirt->nr_uninterruptible, 0);
++	atomic_set(&cvirt->nr_onhold, 0);
++
++	spin_lock_init(&cvirt->load_lock);
++	cvirt->load_last = jiffies;
++	atomic_set(&cvirt->load_updates, 0);
++	cvirt->load[0] = 0;
++	cvirt->load[1] = 0;
++	cvirt->load[2] = 0;
++	atomic_set(&cvirt->total_forks, 0);
++
++	spin_lock_init(&cvirt->syslog.logbuf_lock);
++	init_waitqueue_head(&cvirt->syslog.log_wait);
++	cvirt->syslog.log_start = 0;
++	cvirt->syslog.log_end = 0;
++	cvirt->syslog.con_start = 0;
++	cvirt->syslog.logged_chars = 0;
++}
++
++static inline
++void vx_info_init_cvirt_pc(struct _vx_cvirt_pc *cvirt_pc, int cpu)
++{
++	// cvirt_pc->cpustat = { 0 };
++}
++
++static inline void vx_info_exit_cvirt(struct _vx_cvirt *cvirt)
++{
++	int value;
++
++	vxwprintk((value = atomic_read(&cvirt->nr_threads)),
++		"!!! cvirt: %p[nr_threads] = %d on exit.",
++		cvirt, value);
++	vxwprintk((value = atomic_read(&cvirt->nr_running)),
++		"!!! cvirt: %p[nr_running] = %d on exit.",
++		cvirt, value);
++	vxwprintk((value = atomic_read(&cvirt->nr_uninterruptible)),
++		"!!! cvirt: %p[nr_uninterruptible] = %d on exit.",
++		cvirt, value);
++	vxwprintk((value = atomic_read(&cvirt->nr_onhold)),
++		"!!! cvirt: %p[nr_onhold] = %d on exit.",
++		cvirt, value);
++	return;
++}
++
++static inline
++void vx_info_exit_cvirt_pc(struct _vx_cvirt_pc *cvirt_pc, int cpu)
++{
++	return;
++}
++
+--- linux-2.6.22/kernel/vserver/cvirt_proc.h	1970-01-01 01:00:00 +0100
++++ linux-2.6.22-vs2.2.0-rc5/kernel/vserver/cvirt_proc.h	2007-06-15 02:37:04 +0200
+@@ -0,0 +1,133 @@
++#ifndef _VX_CVIRT_PROC_H
++#define _VX_CVIRT_PROC_H
++
++#include <linux/nsproxy.h>
++#include <linux/mnt_namespace.h>
++#include <linux/utsname.h>
++#include <linux/ipc.h>
++
++
++static inline
++int vx_info_proc_nsproxy(struct nsproxy *nsproxy, char *buffer)
++{
++	struct mnt_namespace *ns;
++	struct uts_namespace *uts;
++	struct ipc_namespace *ipc;
++	struct vfsmount *mnt;
++	char *path, *root;
++	int length = 0;
++
++	if (!nsproxy)
++		goto out;
++
++	length += sprintf(buffer + length,
++		"NSProxy:\t%p [%p,%p,%p]\n",
++		nsproxy, nsproxy->mnt_ns,
++		nsproxy->uts_ns, nsproxy->ipc_ns);
++
++	ns = nsproxy->mnt_ns;
++	if (!ns)
++		goto skip_ns;
++
++	path = kmalloc(PATH_MAX, GFP_KERNEL);
++	if (!path)
++		goto skip_ns;
++
++	mnt = ns->root;
++	root = d_path(mnt->mnt_root, mnt->mnt_parent, path, PATH_MAX - 2);
++	length += sprintf(buffer + length,
++		"Namespace:\t%p [#%u]\n"
++		"RootPath:\t%s\n",
++		ns, atomic_read(&ns->count),
++		root);
++	kfree(path);
++skip_ns:
++
++	uts = nsproxy->uts_ns;
++	if (!uts)
++		goto skip_uts;
++
++	length += sprintf(buffer + length,
++		"SysName:\t%.*s\n"
++		"NodeName:\t%.*s\n"
++		"Release:\t%.*s\n"
++		"Version:\t%.*s\n"
++		"Machine:\t%.*s\n"
++		"DomainName:\t%.*s\n",
++		__NEW_UTS_LEN, uts->name.sysname,
++		__NEW_UTS_LEN, uts->name.nodename,
++		__NEW_UTS_LEN, uts->name.release,
++		__NEW_UTS_LEN, uts->name.version,
++		__NEW_UTS_LEN, uts->name.machine,
++		__NEW_UTS_LEN, uts->name.domainname);
++skip_uts:
++
++	ipc = nsproxy->ipc_ns;
++	if (!ipc)
++		goto skip_ipc;
++
++	length += sprintf(buffer + length,
++		"SEMS:\t\t%d %d %d %d  %d\n"
++		"MSG:\t\t%d %d %d\n"
++		"SHM:\t\t%lu %lu  %d %d\n",
++		ipc->sem_ctls[0], ipc->sem_ctls[1],
++		ipc->sem_ctls[2], ipc->sem_ctls[3],
++		ipc->used_sems,
++		ipc->msg_ctlmax, ipc->msg_ctlmnb, ipc->msg_ctlmni,
++		(unsigned long)ipc->shm_ctlmax,
++		(unsigned long)ipc->shm_ctlall,
++		ipc->shm_ctlmni, ipc->shm_tot);
++skip_ipc:
++out:
++	return length;
++}
++
++
++#include <linux/sched.h>
++
++#define LOAD_INT(x) ((x) >> FSHIFT)
++#define LOAD_FRAC(x) LOAD_INT(((x) & (FIXED_1 - 1)) * 100)
++
++static inline
++int vx_info_proc_cvirt(struct _vx_cvirt *cvirt, char *buffer)
++{
++	int length = 0;
++	int a, b, c;
++
++	length += sprintf(buffer + length,
++		"BiasUptime:\t%lu.%02lu\n",
++		(unsigned long)cvirt->bias_uptime.tv_sec,
++		(cvirt->bias_uptime.tv_nsec / (NSEC_PER_SEC / 100)));
++
++	a = cvirt->load[0] + (FIXED_1 / 200);
++	b = cvirt->load[1] + (FIXED_1 / 200);
++	c = cvirt->load[2] + (FIXED_1 / 200);
++	length += sprintf(buffer + length,
++		"nr_threads:\t%d\n"
++		"nr_running:\t%d\n"
++		"nr_unintr:\t%d\n"
++		"nr_onhold:\t%d\n"
++		"load_updates:\t%d\n"
++		"loadavg:\t%d.%02d %d.%02d %d.%02d\n"
++		"total_forks:\t%d\n",
++		atomic_read(&cvirt->nr_threads),
++		atomic_read(&cvirt->nr_running),
++		atomic_read(&cvirt->nr_uninterruptible),
++		atomic_read(&cvirt->nr_onhold),
++		atomic_read(&cvirt->load_updates),
++		LOAD_INT(a), LOAD_FRAC(a),
++		LOAD_INT(b), LOAD_FRAC(b),
++		LOAD_INT(c), LOAD_FRAC(c),
++		atomic_read(&cvirt->total_forks));
++	return length;
++}
++
++static inline
++int vx_info_proc_cvirt_pc(struct _vx_cvirt_pc *cvirt_pc,
++	char *buffer, int cpu)
++{
++	int length = 0;
++	return length;
++}
++
++#endif	/* _VX_CVIRT_PROC_H */
+--- linux-2.6.22/kernel/vserver/debug.c	1970-01-01 01:00:00 +0100
++++ linux-2.6.22-vs2.2.0-rc5/kernel/vserver/debug.c	2007-06-15 02:37:04 +0200
+@@ -0,0 +1,35 @@
++/*
++ *  kernel/vserver/debug.c
++ *
++ *  Copyright (C) 2005-2007 Herbert Pötzl
++ *
++ *  V0.01  vx_info dump support
++ *
++ */
++
++#include <linux/errno.h>
++#include <linux/kernel.h>
++#include <linux/module.h>
++#include <linux/vs_base.h>
++
++#include <linux/vserver/context.h>
++
++
++void	dump_vx_info(struct vx_info *vxi, int level)
++{
++	printk("vx_info %p[#%d, %d.%d, %4x]\n", vxi, vxi->vx_id,
++		atomic_read(&vxi->vx_usecnt),
++		atomic_read(&vxi->vx_tasks),
++		vxi->vx_state);
++	if (level > 0) {
++		__dump_vx_limit(&vxi->limit);
++		__dump_vx_sched(&vxi->sched);
++		__dump_vx_cvirt(&vxi->cvirt);
++		__dump_vx_cacct(&vxi->cacct);
++	}
++	printk("---\n");
++}
++
++
++EXPORT_SYMBOL_GPL(dump_vx_info);
++
+--- linux-2.6.22/kernel/vserver/dlimit.c	1970-01-01 01:00:00 +0100
++++ linux-2.6.22-vs2.2.0-rc5/kernel/vserver/dlimit.c	2007-06-15 02:37:04 +0200
+@@ -0,0 +1,527 @@
++/*
++ *  linux/kernel/vserver/dlimit.c
++ *
++ *  Virtual Server: Context Disk Limits
++ *
++ *  Copyright (C) 2004-2007  Herbert Pötzl
++ *
++ *  V0.01  initial version
++ *  V0.02  compat32 splitup
++ *
++ */
++
++#include <linux/fs.h>
++// #include <linux/mnt_namespace.h>
++#include <linux/namei.h>
++#include <linux/statfs.h>
++#include <linux/compat.h>
++#include <linux/vserver/switch.h>
++#include <linux/vs_context.h>
++#include <linux/vs_tag.h>
++#include <linux/vs_dlimit.h>
++#include <linux/vserver/dlimit_cmd.h>
++
++#include <asm/errno.h>
++#include <asm/uaccess.h>
++
++/*	__alloc_dl_info()
++
++	* allocate an initialized dl_info struct
++	* doesn't make it visible (hash)			*/
++
++static struct dl_info *__alloc_dl_info(struct super_block *sb, tag_t tag)
++{
++	struct dl_info *new = NULL;
++
++	vxdprintk(VXD_CBIT(dlim, 5),
++		"alloc_dl_info(%p,%d)*", sb, tag);
++
++	/* would this benefit from a slab cache? */
++	new = kmalloc(sizeof(struct dl_info), GFP_KERNEL);
++	if (!new)
++		return 0;
++
++	memset(new, 0, sizeof(struct dl_info));
++	new->dl_tag = tag;
++	new->dl_sb = sb;
++	INIT_RCU_HEAD(&new->dl_rcu);
++	INIT_HLIST_NODE(&new->dl_hlist);
++	spin_lock_init(&new->dl_lock);
++	atomic_set(&new->dl_refcnt, 0);
++	atomic_set(&new->dl_usecnt, 0);
++
++	/* rest of init goes here */
++
++	vxdprintk(VXD_CBIT(dlim, 4),
++		"alloc_dl_info(%p,%d) = %p", sb, tag, new);
++	return new;
++}
++
++/*	__dealloc_dl_info()
++
++	* final disposal of dl_info				*/
++
++static void __dealloc_dl_info(struct dl_info *dli)
++{
++	vxdprintk(VXD_CBIT(dlim, 4),
++		"dealloc_dl_info(%p)", dli);
++
++	dli->dl_hlist.next = LIST_POISON1;
++	dli->dl_tag = -1;
++	dli->dl_sb = 0;
++
++	BUG_ON(atomic_read(&dli->dl_usecnt));
++	BUG_ON(atomic_read(&dli->dl_refcnt));
++
++	kfree(dli);
++}
++
++
++/*	hash table for dl_info hash */
++
++#define DL_HASH_SIZE	13
++
++struct hlist_head dl_info_hash[DL_HASH_SIZE];
++
++static spinlock_t dl_info_hash_lock = SPIN_LOCK_UNLOCKED;
++
++
++static inline unsigned int __hashval(struct super_block *sb, tag_t tag)
++{
++	return ((tag ^ (unsigned long)sb) % DL_HASH_SIZE);
++}
++
++
++
++/*	__hash_dl_info()
++
++	* add the dli to the global hash table
++	* requires the hash_lock to be held			*/
++
++static inline void __hash_dl_info(struct dl_info *dli)
++{
++	struct hlist_head *head;
++
++	vxdprintk(VXD_CBIT(dlim, 6),
++		"__hash_dl_info: %p[#%d]", dli, dli->dl_tag);
++	get_dl_info(dli);
++	head = &dl_info_hash[__hashval(dli->dl_sb, dli->dl_tag)];
++	hlist_add_head_rcu(&dli->dl_hlist, head);
++}
++
++/*	__unhash_dl_info()
++
++	* remove the dli from the global hash table
++	* requires the hash_lock to be held			*/
++
++static inline void __unhash_dl_info(struct dl_info *dli)
++{
++	vxdprintk(VXD_CBIT(dlim, 6),
++		"__unhash_dl_info: %p[#%d]", dli, dli->dl_tag);
++	hlist_del_rcu(&dli->dl_hlist);
++	put_dl_info(dli);
++}
++
++
++/*	__lookup_dl_info()
++
++	* requires the rcu_read_lock()
++	* doesn't increment the dl_refcnt			*/
++
++static inline struct dl_info *__lookup_dl_info(struct super_block *sb, tag_t tag)
++{
++	struct hlist_head *head = &dl_info_hash[__hashval(sb, tag)];
++	struct hlist_node *pos;
++	struct dl_info *dli;
++
++	hlist_for_each_entry_rcu(dli, pos, head, dl_hlist) {
++
++		if (dli->dl_tag == tag && dli->dl_sb == sb) {
++			return dli;
++		}
++	}
++	return NULL;
++}
++
++
++struct dl_info *locate_dl_info(struct super_block *sb, tag_t tag)
++{
++	struct dl_info *dli;
++
++	rcu_read_lock();
++	dli = get_dl_info(__lookup_dl_info(sb, tag));
++	vxdprintk(VXD_CBIT(dlim, 7),
++		"locate_dl_info(%p,#%d) = %p", sb, tag, dli);
++	rcu_read_unlock();
++	return dli;
++}
++
++void rcu_free_dl_info(struct rcu_head *head)
++{
++	struct dl_info *dli = container_of(head, struct dl_info, dl_rcu);
++	int usecnt, refcnt;
++
++	BUG_ON(!dli || !head);
++
++	usecnt = atomic_read(&dli->dl_usecnt);
++	BUG_ON(usecnt < 0);
++
++	refcnt = atomic_read(&dli->dl_refcnt);
++	BUG_ON(refcnt < 0);
++
++	vxdprintk(VXD_CBIT(dlim, 3),
++		"rcu_free_dl_info(%p)", dli);
++	if (!usecnt)
++		__dealloc_dl_info(dli);
++	else
++		printk("!!! rcu didn't free\n");
++}
++
++
++
++
++static int do_addrem_dlimit(uint32_t id, const char __user *name,
++	uint32_t flags, int add)
++{
++	struct nameidata nd;
++	int ret;
++
++	ret = user_path_walk_link(name, &nd);
++	if (!ret) {
++		struct super_block *sb;
++		struct dl_info *dli;
++
++		ret = -EINVAL;
++		if (!nd.dentry->d_inode)
++			goto out_release;
++		if (!(sb = nd.dentry->d_inode->i_sb))
++			goto out_release;
++
++		if (add) {
++			dli = __alloc_dl_info(sb, id);
++			spin_lock(&dl_info_hash_lock);
++
++			ret = -EEXIST;
++			if (__lookup_dl_info(sb, id))
++				goto out_unlock;
++			__hash_dl_info(dli);
++			dli = NULL;
++		} else {
++			spin_lock(&dl_info_hash_lock);
++			dli = __lookup_dl_info(sb, id);
++
++			ret = -ESRCH;
++			if (!dli)
++				goto out_unlock;
++			__unhash_dl_info(dli);
++		}
++		ret = 0;
++	out_unlock:
++		spin_unlock(&dl_info_hash_lock);
++		if (add && dli)
++			__dealloc_dl_info(dli);
++	out_release:
++		path_release(&nd);
++	}
++	return ret;
++}
++
++int vc_add_dlimit(uint32_t id, void __user *data)
++{
++	struct vcmd_ctx_dlimit_base_v0 vc_data;
++
++	if (copy_from_user(&vc_data, data, sizeof(vc_data)))
++		return -EFAULT;
++
++	return do_addrem_dlimit(id, vc_data.name, vc_data.flags, 1);
++}
++
++int vc_rem_dlimit(uint32_t id, void __user *data)
++{
++	struct vcmd_ctx_dlimit_base_v0 vc_data;
++
++	if (copy_from_user(&vc_data, data, sizeof(vc_data)))
++		return -EFAULT;
++
++	return do_addrem_dlimit(id, vc_data.name, vc_data.flags, 0);
++}
++
++#ifdef	CONFIG_COMPAT
++
++int vc_add_dlimit_x32(uint32_t id, void __user *data)
++{
++	struct vcmd_ctx_dlimit_base_v0_x32 vc_data;
++
++	if (copy_from_user(&vc_data, data, sizeof(vc_data)))
++		return -EFAULT;
++
++	return do_addrem_dlimit(id,
++		compat_ptr(vc_data.name_ptr), vc_data.flags, 1);
++}
++
++int vc_rem_dlimit_x32(uint32_t id, void __user *data)
++{
++	struct vcmd_ctx_dlimit_base_v0_x32 vc_data;
++
++	if (copy_from_user(&vc_data, data, sizeof(vc_data)))
++		return -EFAULT;
++
++	return do_addrem_dlimit(id,
++		compat_ptr(vc_data.name_ptr), vc_data.flags, 0);
++}
++
++#endif	/* CONFIG_COMPAT */
++
++
++static inline
++int do_set_dlimit(uint32_t id, const char __user *name,
++	uint32_t space_used, uint32_t space_total,
++	uint32_t inodes_used, uint32_t inodes_total,
++	uint32_t reserved, uint32_t flags)
++{
++	struct nameidata nd;
++	int ret;
++
++	ret = user_path_walk_link(name, &nd);
++	if (!ret) {
++		struct super_block *sb;
++		struct dl_info *dli;
++
++		ret = -EINVAL;
++		if (!nd.dentry->d_inode)
++			goto out_release;
++		if (!(sb = nd.dentry->d_inode->i_sb))
++			goto out_release;
++		if ((reserved != CDLIM_KEEP &&
++			reserved > 100) ||
++			(inodes_used != CDLIM_KEEP &&
++			inodes_used > inodes_total) ||
++			(space_used != CDLIM_KEEP &&
++			space_used > space_total))
++			goto out_release;
++
++		ret = -ESRCH;
++		dli = locate_dl_info(sb, id);
++		if (!dli)
++			goto out_release;
++
++		spin_lock(&dli->dl_lock);
++
++		if (inodes_used != CDLIM_KEEP)
++			dli->dl_inodes_used = inodes_used;
++		if (inodes_total != CDLIM_KEEP)
++			dli->dl_inodes_total = inodes_total;
++		if (space_used != CDLIM_KEEP) {
++			dli->dl_space_used = space_used;
++			dli->dl_space_used <<= 10;
++		}
++		if (space_total == CDLIM_INFINITY)
++			dli->dl_space_total = DLIM_INFINITY;
++		else if (space_total != CDLIM_KEEP) {
++			dli->dl_space_total = space_total;
++			dli->dl_space_total <<= 10;
++		}
++		if (reserved != CDLIM_KEEP)
++			dli->dl_nrlmult = (1 << 10) * (100 - reserved) / 100;
++
++		spin_unlock(&dli->dl_lock);
++
++		put_dl_info(dli);
++		ret = 0;
++
++	out_release:
++		path_release(&nd);
++	}
++	return ret;
++}
++
++int vc_set_dlimit(uint32_t id, void __user *data)
++{
++	struct vcmd_ctx_dlimit_v0 vc_data;
++
++	if (copy_from_user(&vc_data, data, sizeof(vc_data)))
++		return -EFAULT;
++
++	return do_set_dlimit(id, vc_data.name,
++		vc_data.space_used, vc_data.space_total,
++		vc_data.inodes_used, vc_data.inodes_total,
++		vc_data.reserved, vc_data.flags);
++}
++
++#ifdef	CONFIG_COMPAT
++
++int vc_set_dlimit_x32(uint32_t id, void __user *data)
++{
++	struct vcmd_ctx_dlimit_v0_x32 vc_data;
++
++	if (copy_from_user(&vc_data, data, sizeof(vc_data)))
++		return -EFAULT;
++
++	return do_set_dlimit(id, compat_ptr(vc_data.name_ptr),
++		vc_data.space_used, vc_data.space_total,
++		vc_data.inodes_used, vc_data.inodes_total,
++		vc_data.reserved, vc_data.flags);
++}
++
++#endif	/* CONFIG_COMPAT */
++
++
++static inline
++int do_get_dlimit(uint32_t id, const char __user *name,
++	uint32_t *space_used, uint32_t *space_total,
++	uint32_t *inodes_used, uint32_t *inodes_total,
++	uint32_t *reserved, uint32_t *flags)
++{
++	struct nameidata nd;
++	int ret;
++
++	ret = user_path_walk_link(name, &nd);
++	if (!ret) {
++		struct super_block *sb;
++		struct dl_info *dli;
++
++		ret = -EINVAL;
++		if (!nd.dentry->d_inode)
++			goto out_release;
++		if (!(sb = nd.dentry->d_inode->i_sb))
++			goto out_release;
++
++		ret = -ESRCH;
++		dli = locate_dl_info(sb, id);
++		if (!dli)
++			goto out_release;
++
++		spin_lock(&dli->dl_lock);
++		*inodes_used = dli->dl_inodes_used;
++		*inodes_total = dli->dl_inodes_total;
++		*space_used = dli->dl_space_used >> 10;
++		if (dli->dl_space_total == DLIM_INFINITY)
++			*space_total = CDLIM_INFINITY;
++		else
++			*space_total = dli->dl_space_total >> 10;
++
++		*reserved = 100 - ((dli->dl_nrlmult * 100 + 512) >> 10);
++		spin_unlock(&dli->dl_lock);
++
++		put_dl_info(dli);
++		ret = -EFAULT;
++
++		ret = 0;
++	out_release:
++		path_release(&nd);
++	}
++	return ret;
++}
++
++
++int vc_get_dlimit(uint32_t id, void __user *data)
++{
++	struct vcmd_ctx_dlimit_v0 vc_data;
++	int ret;
++
++	if (copy_from_user(&vc_data, data, sizeof(vc_data)))
++		return -EFAULT;
++
++	ret = do_get_dlimit(id, vc_data.name,
++		&vc_data.space_used, &vc_data.space_total,
++		&vc_data.inodes_used, &vc_data.inodes_total,
++		&vc_data.reserved, &vc_data.flags);
++	if (ret)
++		return ret;
++
++	if (copy_to_user(data, &vc_data, sizeof(vc_data)))
++		return -EFAULT;
++	return 0;
++}
++
++#ifdef	CONFIG_COMPAT
++
++int vc_get_dlimit_x32(uint32_t id, void __user *data)
++{
++	struct vcmd_ctx_dlimit_v0_x32 vc_data;
++	int ret;
++
++	if (copy_from_user(&vc_data, data, sizeof(vc_data)))
++		return -EFAULT;
++
++	ret = do_get_dlimit(id, compat_ptr(vc_data.name_ptr),
++		&vc_data.space_used, &vc_data.space_total,
++		&vc_data.inodes_used, &vc_data.inodes_total,
++		&vc_data.reserved, &vc_data.flags);
++	if (ret)
++		return ret;
++
++	if (copy_to_user(data, &vc_data, sizeof(vc_data)))
++		return -EFAULT;
++	return 0;
++}
++
++#endif	/* CONFIG_COMPAT */
++
++
++void vx_vsi_statfs(struct super_block *sb, struct kstatfs *buf)
++{
++	struct dl_info *dli;
++	__u64 blimit, bfree, bavail;
++	__u32 ifree;
++
++	dli = locate_dl_info(sb, dx_current_tag());
++	if (!dli)
++		return;
++
++	spin_lock(&dli->dl_lock);
++	if (dli->dl_inodes_total == (unsigned long)DLIM_INFINITY)
++		goto no_ilim;
++
++	/* reduce max inodes available to limit */
++	if (buf->f_files > dli->dl_inodes_total)
++		buf->f_files = dli->dl_inodes_total;
++
++	ifree = dli->dl_inodes_total - dli->dl_inodes_used;
++	/* reduce free inodes to min */
++	if (ifree < buf->f_ffree)
++		buf->f_ffree = ifree;
++
++no_ilim:
++	if (dli->dl_space_total == DLIM_INFINITY)
++		goto no_blim;
++
++	blimit = dli->dl_space_total >> sb->s_blocksize_bits;
++
++	if (dli->dl_space_total < dli->dl_space_used)
++		bfree = 0;
++	else
++		bfree = (dli->dl_space_total - dli->dl_space_used)
++			>> sb->s_blocksize_bits;
++
++	bavail = ((dli->dl_space_total >> 10) * dli->dl_nrlmult);
++	if (bavail < dli->dl_space_used)
++		bavail = 0;
++	else
++		bavail = (bavail - dli->dl_space_used)
++			>> sb->s_blocksize_bits;
++
++	/* reduce max space available to limit */
++	if (buf->f_blocks > blimit)
++		buf->f_blocks = blimit;
++
++	/* reduce free space to min */
++	if (bfree < buf->f_bfree)
++		buf->f_bfree = bfree;
++
++	/* reduce avail space to min */
++	if (bavail < buf->f_bavail)
++		buf->f_bavail = bavail;
++
++no_blim:
++	spin_unlock(&dli->dl_lock);
++	put_dl_info(dli);
++
++	return;
++}
++
++#include <linux/module.h>
++
++EXPORT_SYMBOL_GPL(locate_dl_info);
++EXPORT_SYMBOL_GPL(rcu_free_dl_info);
++
+--- linux-2.6.22/kernel/vserver/helper.c	1970-01-01 01:00:00 +0100
++++ linux-2.6.22-vs2.2.0-rc5/kernel/vserver/helper.c	2007-06-15 02:37:04 +0200
+@@ -0,0 +1,208 @@
++/*
++ *  linux/kernel/vserver/helper.c
++ *
++ *  Virtual Context Support
++ *
++ *  Copyright (C) 2004-2007  Herbert Pötzl
++ *
++ *  V0.01  basic helper
++ *
++ */
++
++#include <linux/errno.h>
++#include <linux/kmod.h>
++#include <linux/sched.h>
++#include <linux/reboot.h>
++#include <linux/vs_context.h>
++#include <linux/vs_network.h>
++#include <linux/vserver/signal.h>
++
++#include <asm/uaccess.h>
++#include <asm/unistd.h>
++
++
++char vshelper_path[255] = "/sbin/vshelper";
++
++
++static int do_vshelper(char *name, char *argv[], char *envp[], int sync)
++{
++	int ret;
++
++	if ((ret = call_usermodehelper(name, argv, envp, sync))) {
++		printk(	KERN_WARNING
++			"%s: (%s %s) returned %s with %d\n",
++			name, argv[1], argv[2],
++			sync ? "sync" : "async", ret);
++	}
++	vxdprintk(VXD_CBIT(switch, 4),
++		"%s: (%s %s) returned %s with %d",
++		name, argv[1], argv[2], sync ? "sync" : "async", ret);
++	return ret;
++}
++
++/*
++ *      vshelper path is set via /proc/sys
++ *      invoked by vserver sys_reboot(), with
++ *      the following arguments
++ *
++ *      argv [0] = vshelper_path;
++ *      argv [1] = action: "restart", "halt", "poweroff", ...
++ *      argv [2] = context identifier
++ *
++ *      envp [*] = type-specific parameters
++ */
++
++long vs_reboot_helper(struct vx_info *vxi, int cmd, void __user *arg)
++{
++	char id_buf[8], cmd_buf[16];
++	char uid_buf[16], pid_buf[16];
++	int ret;
++
++	char *argv[] = {vshelper_path, NULL, id_buf, 0};
++	char *envp[] = {"HOME=/", "TERM=linux",
++			"PATH=/sbin:/usr/sbin:/bin:/usr/bin",
++			uid_buf, pid_buf, cmd_buf, 0};
++
++	if (vx_info_state(vxi, VXS_HELPER))
++		return -EAGAIN;
++	vxi->vx_state |= VXS_HELPER;
++
++	snprintf(id_buf, sizeof(id_buf)-1, "%d", vxi->vx_id);
++
++	snprintf(cmd_buf, sizeof(cmd_buf)-1, "VS_CMD=%08x", cmd);
++	snprintf(uid_buf, sizeof(uid_buf)-1, "VS_UID=%d", current->uid);
++	snprintf(pid_buf, sizeof(pid_buf)-1, "VS_PID=%d", current->pid);
++
++	switch (cmd) {
++	case LINUX_REBOOT_CMD_RESTART:
++		argv[1] = "restart";
++		break;
++
++	case LINUX_REBOOT_CMD_HALT:
++		argv[1] = "halt";
++		break;
++
++	case LINUX_REBOOT_CMD_POWER_OFF:
++		argv[1] = "poweroff";
++		break;
++
++	case LINUX_REBOOT_CMD_SW_SUSPEND:
++		argv[1] = "swsusp";
++		break;
++
++	default:
++		vxi->vx_state &= ~VXS_HELPER;
++		return 0;
++	}
++
++#ifndef CONFIG_VSERVER_LEGACY
++	ret = do_vshelper(vshelper_path, argv, envp, 1);
++#else
++	ret = do_vshelper(vshelper_path, argv, envp, 0);
++#endif
++	vxi->vx_state &= ~VXS_HELPER;
++	__wakeup_vx_info(vxi);
++	return (ret) ? -EPERM : 0;
++}
++
++
++long vs_reboot(unsigned int cmd, void __user *arg)
++{
++	struct vx_info *vxi = current->vx_info;
++	long ret = 0;
++
++	vxdprintk(VXD_CBIT(misc, 5),
++		"vs_reboot(%p[#%d],%d)",
++		vxi, vxi ? vxi->vx_id : 0, cmd);
++
++	ret = vs_reboot_helper(vxi, cmd, arg);
++	if (ret)
++		return ret;
++
++	vxi->reboot_cmd = cmd;
++	if (vx_info_flags(vxi, VXF_REBOOT_KILL, 0)) {
++		switch (cmd) {
++		case LINUX_REBOOT_CMD_RESTART:
++		case LINUX_REBOOT_CMD_HALT:
++		case LINUX_REBOOT_CMD_POWER_OFF:
++			vx_info_kill(vxi, 0, SIGKILL);
++			vx_info_kill(vxi, 1, SIGKILL);
++		default:
++			break;
++		}
++	}
++	return 0;
++}
++
++
++/*
++ *      argv [0] = vshelper_path;
++ *      argv [1] = action: "startup", "shutdown"
++ *      argv [2] = context identifier
++ *
++ *      envp [*] = type-specific parameters
++ */
++
++long vs_state_change(struct vx_info *vxi, unsigned int cmd)
++{
++	char id_buf[8], cmd_buf[16];
++	char *argv[] = {vshelper_path, NULL, id_buf, 0};
++	char *envp[] = {"HOME=/", "TERM=linux",
++			"PATH=/sbin:/usr/sbin:/bin:/usr/bin", cmd_buf, 0};
++
++	if (!vx_info_flags(vxi, VXF_SC_HELPER, 0))
++		return 0;
++
++	snprintf(id_buf, sizeof(id_buf)-1, "%d", vxi->vx_id);
++	snprintf(cmd_buf, sizeof(cmd_buf)-1, "VS_CMD=%08x", cmd);
++
++	switch (cmd) {
++	case VSC_STARTUP:
++		argv[1] = "startup";
++		break;
++	case VSC_SHUTDOWN:
++		argv[1] = "shutdown";
++		break;
++	default:
++		return 0;
++	}
++
++	return do_vshelper(vshelper_path, argv, envp, 1);
++}
++
++
++/*
++ *      argv [0] = vshelper_path;
++ *      argv [1] = action: "netup", "netdown"
++ *      argv [2] = context identifier
++ *
++ *      envp [*] = type-specific parameters
++ */
++
++long vs_net_change(struct nx_info *nxi, unsigned int cmd)
++{
++	char id_buf[8], cmd_buf[16];
++	char *argv[] = {vshelper_path, NULL, id_buf, 0};
++	char *envp[] = {"HOME=/", "TERM=linux",
++			"PATH=/sbin:/usr/sbin:/bin:/usr/bin", cmd_buf, 0};
++
++	if (!nx_info_flags(nxi, NXF_SC_HELPER, 0))
++		return 0;
++
++	snprintf(id_buf, sizeof(id_buf)-1, "%d", nxi->nx_id);
++	snprintf(cmd_buf, sizeof(cmd_buf)-1, "VS_CMD=%08x", cmd);
++
++	switch (cmd) {
++	case VSC_NETUP:
++		argv[1] = "netup";
++		break;
++	case VSC_NETDOWN:
++		argv[1] = "netdown";
++		break;
++	default:
++		return 0;
++	}
++
++	return do_vshelper(vshelper_path, argv, envp, 1);
++}
++
+--- linux-2.6.22/kernel/vserver/history.c	1970-01-01 01:00:00 +0100
++++ linux-2.6.22-vs2.2.0-rc5/kernel/vserver/history.c	2007-06-15 02:37:04 +0200
+@@ -0,0 +1,264 @@
++/*
++ *  kernel/vserver/history.c
++ *
++ *  Virtual Context History Backtrace
++ *
++ *  Copyright (C) 2004-2007  Herbert Pötzl
++ *
++ *  V0.01  basic structure
++ *  V0.02  hash/unhash and trace
++ *  V0.03  preemption fixes
++ *
++ */
++
++#include <linux/errno.h>
++#include <linux/module.h>
++#include <linux/types.h>
++#include <linux/ctype.h>
++
++#include <asm/uaccess.h>
++#include <asm/atomic.h>
++#include <asm/unistd.h>
++
++#include <linux/vserver/context.h>
++#include <linux/vserver/debug.h>
++#include <linux/vserver/debug_cmd.h>
++#include <linux/vserver/history.h>
++
++
++#ifdef	CONFIG_VSERVER_HISTORY
++#define VXH_SIZE	CONFIG_VSERVER_HISTORY_SIZE
++#else
++#define VXH_SIZE	64
++#endif
++
++struct _vx_history {
++	unsigned int counter;
++
++	struct _vx_hist_entry entry[VXH_SIZE + 1];
++};
++
++
++DEFINE_PER_CPU(struct _vx_history, vx_history_buffer);
++
++unsigned volatile int vxh_active = 1;
++
++static atomic_t sequence = ATOMIC_INIT(0);
++
++
++/*	vxh_advance()
++
++	* requires disabled preemption				*/
++
++struct _vx_hist_entry *vxh_advance(void *loc)
++{
++	unsigned int cpu = smp_processor_id();
++	struct _vx_history *hist = &per_cpu(vx_history_buffer, cpu);
++	struct _vx_hist_entry *entry;
++	unsigned int index;
++
++	index = vxh_active ? (hist->counter++ % VXH_SIZE) : VXH_SIZE;
++	entry = &hist->entry[index];
++
++	entry->seq = atomic_inc_return(&sequence);
++	entry->loc = loc;
++	return entry;
++}
++
++EXPORT_SYMBOL_GPL(vxh_advance);
++
++
++#define VXH_LOC_FMTS	"(#%04x,*%d):%p"
++
++#define VXH_LOC_ARGS(e)	(e)->seq, cpu, (e)->loc
++
++
++#define VXH_VXI_FMTS	"%p[#%d,%d.%d]"
++
++#define VXH_VXI_ARGS(e)	(e)->vxi.ptr,				\
++			(e)->vxi.ptr ? (e)->vxi.xid : 0,	\
++			(e)->vxi.ptr ? (e)->vxi.usecnt : 0,	\
++			(e)->vxi.ptr ? (e)->vxi.tasks : 0
++
++void	vxh_dump_entry(struct _vx_hist_entry *e, unsigned cpu)
++{
++	switch (e->type) {
++	case VXH_THROW_OOPS:
++		printk( VXH_LOC_FMTS " oops \n", VXH_LOC_ARGS(e));
++		break;
++
++	case VXH_GET_VX_INFO:
++	case VXH_PUT_VX_INFO:
++		printk( VXH_LOC_FMTS " %s_vx_info " VXH_VXI_FMTS "\n",
++			VXH_LOC_ARGS(e),
++			(e->type == VXH_GET_VX_INFO) ? "get" : "put",
++			VXH_VXI_ARGS(e));
++		break;
++
++	case VXH_INIT_VX_INFO:
++	case VXH_SET_VX_INFO:
++	case VXH_CLR_VX_INFO:
++		printk( VXH_LOC_FMTS " %s_vx_info " VXH_VXI_FMTS " @%p\n",
++			VXH_LOC_ARGS(e),
++			(e->type == VXH_INIT_VX_INFO) ? "init" :
++			((e->type == VXH_SET_VX_INFO) ? "set" : "clr"),
++			VXH_VXI_ARGS(e), e->sc.data);
++		break;
++
++	case VXH_CLAIM_VX_INFO:
++	case VXH_RELEASE_VX_INFO:
++		printk( VXH_LOC_FMTS " %s_vx_info " VXH_VXI_FMTS " @%p\n",
++			VXH_LOC_ARGS(e),
++			(e->type == VXH_CLAIM_VX_INFO) ? "claim" : "release",
++			VXH_VXI_ARGS(e), e->sc.data);
++		break;
++
++	case VXH_ALLOC_VX_INFO:
++	case VXH_DEALLOC_VX_INFO:
++		printk( VXH_LOC_FMTS " %s_vx_info " VXH_VXI_FMTS "\n",
++			VXH_LOC_ARGS(e),
++			(e->type == VXH_ALLOC_VX_INFO) ? "alloc" : "dealloc",
++			VXH_VXI_ARGS(e));
++		break;
++
++	case VXH_HASH_VX_INFO:
++	case VXH_UNHASH_VX_INFO:
++		printk( VXH_LOC_FMTS " __%s_vx_info " VXH_VXI_FMTS "\n",
++			VXH_LOC_ARGS(e),
++			(e->type == VXH_HASH_VX_INFO) ? "hash" : "unhash",
++			VXH_VXI_ARGS(e));
++		break;
++
++	case VXH_LOC_VX_INFO:
++	case VXH_LOOKUP_VX_INFO:
++	case VXH_CREATE_VX_INFO:
++		printk( VXH_LOC_FMTS " __%s_vx_info [#%d] -> " VXH_VXI_FMTS "\n",
++			VXH_LOC_ARGS(e),
++			(e->type == VXH_CREATE_VX_INFO) ? "create" :
++			((e->type == VXH_LOC_VX_INFO) ? "loc" : "lookup"),
++			e->ll.arg, VXH_VXI_ARGS(e));
++		break;
++	}
++}
++
++static void __vxh_dump_history(void)
++{
++	unsigned int i, cpu;
++
++	printk("History:\tSEQ: %8x\tNR_CPUS: %d\n",
++		atomic_read(&sequence), NR_CPUS);
++
++	for (i = 0; i < VXH_SIZE; i++) {
++		for_each_online_cpu(cpu) {
++			struct _vx_history *hist =
++				&per_cpu(vx_history_buffer, cpu);
++			unsigned int index = (hist->counter - i) % VXH_SIZE;
++			struct _vx_hist_entry *entry = &hist->entry[index];
++
++			vxh_dump_entry(entry, cpu);
++		}
++	}
++}
++
++void	vxh_dump_history(void)
++{
++	vxh_active = 0;
++#ifdef CONFIG_SMP
++	local_irq_enable();
++	smp_send_stop();
++	local_irq_disable();
++#endif
++	__vxh_dump_history();
++}
++
++
++/* vserver syscall commands below here */
++
++
++int vc_dump_history(uint32_t id)
++{
++	vxh_active = 0;
++	__vxh_dump_history();
++	vxh_active = 1;
++
++	return 0;
++}
++
++
++int do_read_history(struct __user _vx_hist_entry *data,
++	int cpu, uint32_t *index, uint32_t *count)
++{
++	int pos, ret = 0;
++	struct _vx_history *hist = &per_cpu(vx_history_buffer, cpu);
++	int end = hist->counter;
++	int start = end - VXH_SIZE + 2;
++	int idx = *index;
++
++	/* special case: get current pos */
++	if (!*count) {
++		*index = end;
++		return 0;
++	}
++
++	/* have we lost some data? */
++	if (idx < start)
++		idx = start;
++
++	for (pos = 0; (pos < *count) && (idx < end); pos++, idx++) {
++		struct _vx_hist_entry *entry =
++			&hist->entry[idx % VXH_SIZE];
++
++		/* send entry to userspace */
++		ret = copy_to_user(&data[pos], entry, sizeof(*entry));
++		if (ret)
++			break;
++	}
++	/* save new index and count */
++	*index = idx;
++	*count = pos;
++	return ret ? ret : (*index < end);
++}
++
++int vc_read_history(uint32_t id, void __user *data)
++{
++	struct vcmd_read_history_v0 vc_data;
++	int ret;
++
++	if (id >= NR_CPUS)
++		return -EINVAL;
++
++	if (copy_from_user(&vc_data, data, sizeof(vc_data)))
++		return -EFAULT;
++
++	ret = do_read_history((struct __user _vx_hist_entry *)vc_data.data,
++		id, &vc_data.index, &vc_data.count);
++
++	if (copy_to_user(data, &vc_data, sizeof(vc_data)))
++		return -EFAULT;
++	return ret;
++}
++
++#ifdef	CONFIG_COMPAT
++
++int vc_read_history_x32(uint32_t id, void __user *data)
++{
++	struct vcmd_read_history_v0_x32 vc_data;
++	int ret;
++
++	if (id >= NR_CPUS)
++		return -EINVAL;
++
++	if (copy_from_user(&vc_data, data, sizeof(vc_data)))
++		return -EFAULT;
++
++	ret = do_read_history((struct __user _vx_hist_entry *)
++		compat_ptr(vc_data.data_ptr),
++		id, &vc_data.index, &vc_data.count);
++
++	if (copy_to_user(data, &vc_data, sizeof(vc_data)))
++		return -EFAULT;
++	return ret;
++}
++
++#endif	/* CONFIG_COMPAT */
++
+--- linux-2.6.22/kernel/vserver/init.c	1970-01-01 01:00:00 +0100
++++ linux-2.6.22-vs2.2.0-rc5/kernel/vserver/init.c	2007-06-15 02:37:04 +0200
+@@ -0,0 +1,47 @@
++/*
++ *  linux/kernel/init.c
++ *
++ *  Virtual Server Init
++ *
++ *  Copyright (C) 2004-2007  Herbert Pötzl
++ *
++ *  V0.01  basic structure
++ *
++ */
++
++#include <linux/errno.h>
++#include <linux/init.h>
++#include <linux/module.h>
++
++int	vserver_register_sysctl(void);
++void	vserver_unregister_sysctl(void);
++
++
++static int __init init_vserver(void)
++{
++	int ret = 0;
++
++#ifdef	CONFIG_VSERVER_DEBUG
++	vserver_register_sysctl();
++#endif
++	return ret;
++}
++
++
++static void __exit exit_vserver(void)
++{
++
++#ifdef	CONFIG_VSERVER_DEBUG
++	vserver_unregister_sysctl();
++#endif
++	return;
++}
++
++/* FIXME: GFP_ZONETYPES gone
++long vx_slab[GFP_ZONETYPES]; */
++long vx_area;
++
++
++module_init(init_vserver);
++module_exit(exit_vserver);
++
+--- linux-2.6.22/kernel/vserver/inode.c	1970-01-01 01:00:00 +0100
++++ linux-2.6.22-vs2.2.0-rc5/kernel/vserver/inode.c	2007-06-15 02:37:04 +0200
+@@ -0,0 +1,369 @@
++/*
++ *  linux/kernel/vserver/inode.c
++ *
++ *  Virtual Server: File System Support
++ *
++ *  Copyright (C) 2004-2007  Herbert Pötzl
++ *
++ *  V0.01  separated from vcontext V0.05
++ *
++ */
++
++#include <linux/sched.h>
++#include <linux/proc_fs.h>
++#include <linux/devpts_fs.h>
++#include <linux/namei.h>
++#include <linux/mount.h>
++#include <linux/parser.h>
++#include <linux/compat.h>
++#include <linux/vserver/inode.h>
++#include <linux/vserver/inode_cmd.h>
++#include <linux/vs_base.h>
++#include <linux/vs_tag.h>
++
++#include <asm/errno.h>
++#include <asm/uaccess.h>
++
++
++static int __vc_get_iattr(struct inode *in, uint32_t *tag, uint32_t *flags, uint32_t *mask)
++{
++	struct proc_dir_entry *entry;
++
++	if (!in || !in->i_sb)
++		return -ESRCH;
++
++	*flags = IATTR_TAG
++		| (IS_BARRIER(in) ? IATTR_BARRIER : 0)
++		| (IS_IUNLINK(in) ? IATTR_IUNLINK : 0)
++		| (IS_IMMUTABLE(in) ? IATTR_IMMUTABLE : 0);
++	*mask = IATTR_IUNLINK | IATTR_IMMUTABLE;
++
++	if (S_ISDIR(in->i_mode))
++		*mask |= IATTR_BARRIER;
++
++	if (IS_TAGGED(in)) {
++		*tag = in->i_tag;
++		*mask |= IATTR_TAG;
++	}
++
++	switch (in->i_sb->s_magic) {
++	case PROC_SUPER_MAGIC:
++		entry = PROC_I(in)->pde;
++
++		/* check for specific inodes? */
++		if (entry)
++			*mask |= IATTR_FLAGS;
++		if (entry)
++			*flags |= (entry->vx_flags & IATTR_FLAGS);
++		else
++			*flags |= (PROC_I(in)->vx_flags & IATTR_FLAGS);
++		break;
++
++	case DEVPTS_SUPER_MAGIC:
++		*tag = in->i_tag;
++		*mask |= IATTR_TAG;
++		break;
++
++	default:
++		break;
++	}
++	return 0;
++}
++
++int vc_get_iattr(uint32_t id, void __user *data)
++{
++	struct nameidata nd;
++	struct vcmd_ctx_iattr_v1 vc_data = { .xid = -1 };
++	int ret;
++
++	if (copy_from_user(&vc_data, data, sizeof(vc_data)))
++		return -EFAULT;
++
++	ret = user_path_walk_link(vc_data.name, &nd);
++	if (!ret) {
++		ret = __vc_get_iattr(nd.dentry->d_inode,
++			&vc_data.xid, &vc_data.flags, &vc_data.mask);
++		path_release(&nd);
++	}
++	if (ret)
++		return ret;
++
++	if (copy_to_user(data, &vc_data, sizeof(vc_data)))
++		ret = -EFAULT;
++	return ret;
++}
++
++#ifdef	CONFIG_COMPAT
++
++int vc_get_iattr_x32(uint32_t id, void __user *data)
++{
++	struct nameidata nd;
++	struct vcmd_ctx_iattr_v1_x32 vc_data = { .xid = -1 };
++	int ret;
++
++	if (!vx_check(0, VS_ADMIN))
++		return -ENOSYS;
++	if (copy_from_user(&vc_data, data, sizeof(vc_data)))
++		return -EFAULT;
++
++	ret = user_path_walk_link(compat_ptr(vc_data.name_ptr), &nd);
++	if (!ret) {
++		ret = __vc_get_iattr(nd.dentry->d_inode,
++			&vc_data.xid, &vc_data.flags, &vc_data.mask);
++		path_release(&nd);
++	}
++	if (ret)
++		return ret;
++
++	if (copy_to_user(data, &vc_data, sizeof(vc_data)))
++		ret = -EFAULT;
++	return ret;
++}
++
++#endif	/* CONFIG_COMPAT */
++
++
++static int __vc_set_iattr(struct dentry *de, uint32_t *tag, uint32_t *flags, uint32_t *mask)
++{
++	struct inode *in = de->d_inode;
++	int error = 0, is_proc = 0, has_tag = 0;
++	struct iattr attr = { 0 };
++
++	if (!in || !in->i_sb)
++		return -ESRCH;
++
++	is_proc = (in->i_sb->s_magic == PROC_SUPER_MAGIC);
++	if ((*mask & IATTR_FLAGS) && !is_proc)
++		return -EINVAL;
++
++	has_tag = IS_TAGGED(in) ||
++		(in->i_sb->s_magic == DEVPTS_SUPER_MAGIC);
++	if ((*mask & IATTR_TAG) && !has_tag)
++		return -EINVAL;
++
++	mutex_lock(&in->i_mutex);
++	if (*mask & IATTR_TAG) {
++		attr.ia_tag = *tag;
++		attr.ia_valid |= ATTR_TAG;
++	}
++
++	if (*mask & IATTR_FLAGS) {
++		struct proc_dir_entry *entry = PROC_I(in)->pde;
++		unsigned int iflags = PROC_I(in)->vx_flags;
++
++		iflags = (iflags & ~(*mask & IATTR_FLAGS))
++			| (*flags & IATTR_FLAGS);
++		PROC_I(in)->vx_flags = iflags;
++		if (entry)
++			entry->vx_flags = iflags;
++	}
++
++	if (*mask & (IATTR_BARRIER | IATTR_IUNLINK | IATTR_IMMUTABLE)) {
++		if (*mask & IATTR_IMMUTABLE) {
++			if (*flags & IATTR_IMMUTABLE)
++				in->i_flags |= S_IMMUTABLE;
++			else
++				in->i_flags &= ~S_IMMUTABLE;
++		}
++		if (*mask & IATTR_IUNLINK) {
++			if (*flags & IATTR_IUNLINK)
++				in->i_flags |= S_IUNLINK;
++			else
++				in->i_flags &= ~S_IUNLINK;
++		}
++		if (S_ISDIR(in->i_mode) && (*mask & IATTR_BARRIER)) {
++			if (*flags & IATTR_BARRIER)
++				in->i_flags |= S_BARRIER;
++			else
++				in->i_flags &= ~S_BARRIER;
++		}
++		if (in->i_op && in->i_op->sync_flags) {
++			error = in->i_op->sync_flags(in);
++			if (error)
++				goto out;
++		}
++	}
++
++	if (attr.ia_valid) {
++		if (in->i_op && in->i_op->setattr)
++			error = in->i_op->setattr(de, &attr);
++		else {
++			error = inode_change_ok(in, &attr);
++			if (!error)
++				error = inode_setattr(in, &attr);
++		}
++	}
++
++out:
++	mutex_unlock(&in->i_mutex);
++	return error;
++}
++
++int vc_set_iattr(uint32_t id, void __user *data)
++{
++	struct nameidata nd;
++	struct vcmd_ctx_iattr_v1 vc_data;
++	int ret;
++
++	if (!capable(CAP_LINUX_IMMUTABLE))
++		return -EPERM;
++	if (copy_from_user(&vc_data, data, sizeof(vc_data)))
++		return -EFAULT;
++
++	ret = user_path_walk_link(vc_data.name, &nd);
++	if (!ret) {
++		ret = __vc_set_iattr(nd.dentry,
++			&vc_data.xid, &vc_data.flags, &vc_data.mask);
++		path_release(&nd);
++	}
++
++	if (copy_to_user(data, &vc_data, sizeof(vc_data)))
++		ret = -EFAULT;
++	return ret;
++}
++
++#ifdef	CONFIG_COMPAT
++
++int vc_set_iattr_x32(uint32_t id, void __user *data)
++{
++	struct nameidata nd;
++	struct vcmd_ctx_iattr_v1_x32 vc_data;
++	int ret;
++
++	if (!capable(CAP_LINUX_IMMUTABLE))
++		return -EPERM;
++	if (copy_from_user(&vc_data, data, sizeof(vc_data)))
++		return -EFAULT;
++
++	ret = user_path_walk_link(compat_ptr(vc_data.name_ptr), &nd);
++	if (!ret) {
++		ret = __vc_set_iattr(nd.dentry,
++			&vc_data.xid, &vc_data.flags, &vc_data.mask);
++		path_release(&nd);
++	}
++
++	if (copy_to_user(data, &vc_data, sizeof(vc_data)))
++		ret = -EFAULT;
++	return ret;
++}
++
++#endif	/* CONFIG_COMPAT */
++
++#ifdef	CONFIG_VSERVER_LEGACY
++
++#define PROC_DYNAMIC_FIRST 0xF0000000UL
++
++int vx_proc_ioctl(struct inode *inode, struct file *filp,
++	unsigned int cmd, unsigned long arg)
++{
++	struct proc_dir_entry *entry;
++	int error = 0;
++	int flags;
++
++	if (inode->i_ino < PROC_DYNAMIC_FIRST)
++		return -ENOTTY;
++
++	entry = PROC_I(inode)->pde;
++	if (!entry)
++		return -ENOTTY;
++
++	switch(cmd) {
++	case FIOC_GETXFLG: {
++		/* fixme: if stealth, return -ENOTTY */
++		error = -EPERM;
++		flags = entry->vx_flags;
++		if (capable(CAP_CONTEXT))
++			error = put_user(flags, (int __user *) arg);
++		break;
++	}
++	case FIOC_SETXFLG: {
++		/* fixme: if stealth, return -ENOTTY */
++		error = -EPERM;
++		if (!capable(CAP_CONTEXT))
++			break;
++		error = -EROFS;
++		if (IS_RDONLY(inode))
++			break;
++		error = -EFAULT;
++		if (get_user(flags, (int __user *) arg))
++			break;
++		error = 0;
++		entry->vx_flags = flags;
++		break;
++	}
++	default:
++		return -ENOTTY;
++	}
++	return error;
++}
++#endif	/* CONFIG_VSERVER_LEGACY */
++
++#ifdef	CONFIG_PROPAGATE
++
++int dx_parse_tag(char *string, tag_t *tag, int remove)
++{
++	static match_table_t tokens = {
++		{1, "tagid=%u"},
++		{0, NULL}
++	};
++	substring_t args[MAX_OPT_ARGS];
++	int token, option = 0;
++
++	if (!string)
++		return 0;
++
++	token = match_token(string, tokens, args);
++	if (token && tag && !match_int(args, &option))
++		*tag = option;
++
++	vxdprintk(VXD_CBIT(tag, 7),
++		"dx_parse_tag(»%s«): %d:#%d",
++		string, token, option);
++
++	if ((token == 1) && remove) {
++		char *p = strstr(string, "tagid=");
++		char *q = p;
++
++		if (p) {
++			while (*q != '\0' && *q != ',')
++				q++;
++			while (*q)
++				*p++ = *q++;
++			while (*p)
++				*p++ = '\0';
++		}
++	}
++	return token;
++}
++
++void __dx_propagate_tag(struct nameidata *nd, struct inode *inode)
++{
++	tag_t new_tag = 0;
++	struct vfsmount *mnt;
++	int propagate;
++
++	if (!nd)
++		return;
++	mnt = nd->mnt;
++	if (!mnt)
++		return;
++
++	propagate = (mnt->mnt_flags & MNT_TAGID);
++	if (propagate)
++		new_tag = mnt->mnt_tag;
++
++	vxdprintk(VXD_CBIT(tag, 7),
++		"dx_propagate_tag(%p[#%lu.%d]): %d,%d",
++		inode, inode->i_ino, inode->i_tag,
++		new_tag, (propagate) ? 1 : 0);
++
++	if (propagate)
++		inode->i_tag = new_tag;
++}
++
++#include <linux/module.h>
++
++EXPORT_SYMBOL_GPL(__dx_propagate_tag);
++
++#endif	/* CONFIG_PROPAGATE */
++
+--- linux-2.6.22/kernel/vserver/legacy.c	1970-01-01 01:00:00 +0100
++++ linux-2.6.22-vs2.2.0-rc5/kernel/vserver/legacy.c	2007-06-15 02:37:04 +0200
+@@ -0,0 +1,114 @@
++/*
++ *  linux/kernel/vserver/legacy.c
++ *
++ *  Virtual Server: Legacy Funtions
++ *
++ *  Copyright (C) 2001-2003  Jacques Gelinas
++ *  Copyright (C) 2003-2007  Herbert Pötzl
++ *
++ *  V0.01  broken out from vcontext.c V0.05
++ *  V0.02  updated to spaces *sigh*
++ *
++ */
++
++#include <linux/sched.h>
++#include <linux/vs_context.h>
++#include <linux/vs_network.h>
++#include <linux/vserver/legacy.h>
++#include <linux/vserver/space.h>
++// #include <linux/mnt_namespace.h>
++
++#include <asm/errno.h>
++#include <asm/uaccess.h>
++
++
++extern int vx_set_init(struct vx_info *, struct task_struct *);
++
++static int vx_set_initpid(struct vx_info *vxi, int pid)
++{
++	struct task_struct *init;
++
++	init = find_task_by_real_pid(pid);
++	if (!init)
++		return -ESRCH;
++	return vx_set_init(vxi, init);
++}
++
++int vc_new_s_context(uint32_t ctx, void __user *data)
++{
++	int ret = -ENOMEM;
++	struct vcmd_new_s_context_v1 vc_data;
++	struct vx_info *new_vxi;
++
++	if (copy_from_user(&vc_data, data, sizeof(vc_data)))
++		return -EFAULT;
++
++	/* legacy hack, will be removed soon */
++	if (ctx == -2) {
++		/* assign flags and initpid */
++		if (!current->vx_info)
++			return -EINVAL;
++		ret = 0;
++		if (vc_data.flags & VX_INFO_INIT)
++			ret = vx_set_initpid(current->vx_info, current->tgid);
++		if (ret == 0) {
++			/* We keep the same vx_id, but lower the capabilities */
++			current->vx_info->vx_bcaps &= (~vc_data.remove_cap);
++			ret = vx_current_xid();
++			current->vx_info->vx_flags |= vc_data.flags;
++		}
++		return ret;
++	}
++
++	if (!vx_check(0, VS_ADMIN) || !capable(CAP_SYS_ADMIN)
++		/* might make sense in the future, or not ... */
++		|| vx_flags(VX_INFO_PRIVATE, 0))
++		return -EPERM;
++
++	/* ugly hack for Spectator */
++	if (ctx == 1) {
++		current->xid = 1;
++		return 0;
++	}
++
++	if (((ctx > MAX_S_CONTEXT) && (ctx != VX_DYNAMIC_ID)) ||
++		(ctx == 0))
++		return -EINVAL;
++
++	if ((ctx == VX_DYNAMIC_ID) || (ctx < MIN_D_CONTEXT))
++		new_vxi = lookup_or_create_vx_info(ctx);
++	else
++		new_vxi = lookup_vx_info(ctx);
++
++	if (!new_vxi)
++		return -EINVAL;
++
++	ret = -EPERM;
++	if (!vx_info_flags(new_vxi, VXF_STATE_SETUP, 0) &&
++		vx_info_flags(new_vxi, VX_INFO_PRIVATE, 0))
++		goto out_put;
++
++	ret = vx_migrate_task(current, new_vxi,
++		vx_info_flags(new_vxi, VXF_STATE_SETUP, 0));
++	new_vxi->vx_flags &= ~VXF_STATE_SETUP;
++
++	if (ret == 0) {
++		current->vx_info->vx_bcaps &= (~vc_data.remove_cap);
++		new_vxi->vx_flags |= vc_data.flags;
++		if (vc_data.flags & VX_INFO_INIT)
++			vx_set_initpid(new_vxi, current->tgid);
++		if (vc_data.flags & VX_INFO_NAMESPACE)
++			vx_set_space(new_vxi, CLONE_NEWNS | CLONE_FS);
++		if (vc_data.flags & VX_INFO_NPROC)
++			__rlim_set(&new_vxi->limit, RLIMIT_NPROC,
++				current->signal->rlim[RLIMIT_NPROC].rlim_max);
++
++		/* tweak some defaults for legacy */
++		new_vxi->vx_flags |= (VXF_HIDE_NETIF | VXF_INFO_INIT);
++		ret = new_vxi->vx_id;
++	}
++out_put:
++	put_vx_info(new_vxi);
++	return ret;
++}
++
+--- linux-2.6.22/kernel/vserver/legacynet.c	1970-01-01 01:00:00 +0100
++++ linux-2.6.22-vs2.2.0-rc5/kernel/vserver/legacynet.c	2007-06-15 02:37:04 +0200
+@@ -0,0 +1,85 @@
++
++/*
++ *  linux/kernel/vserver/legacynet.c
++ *
++ *  Virtual Server: Legacy Network Funtions
++ *
++ *  Copyright (C) 2001-2003  Jacques Gelinas
++ *  Copyright (C) 2003-2007  Herbert Pötzl
++ *
++ *  V0.01  broken out from legacy.c
++ *
++ */
++
++#include <linux/sched.h>
++#include <linux/vs_context.h>
++#include <linux/vs_network.h>
++#include <linux/vserver/legacy.h>
++// #include <linux/mnt_namespace.h>
++#include <linux/err.h>
++
++#include <asm/errno.h>
++#include <asm/uaccess.h>
++
++
++extern struct nx_info *create_nx_info(void);
++
++/*  set ipv4 root (syscall) */
++
++int vc_set_ipv4root(uint32_t nbip, void __user *data)
++{
++	int i, err = -EPERM;
++	struct vcmd_set_ipv4root_v3 vc_data;
++	struct nx_info *new_nxi, *nxi = current->nx_info;
++
++	if (nbip < 0 || nbip > NB_IPV4ROOT)
++		return -EINVAL;
++	if (copy_from_user(&vc_data, data, sizeof(vc_data)))
++		return -EFAULT;
++
++	if (!nxi || nxi->ipv4[0] == 0 || capable(CAP_NET_ADMIN))
++		/* We are allowed to change everything */
++		err = 0;
++	else if (nxi) {
++		int found = 0;
++
++		/* We are allowed to select a subset of the currently
++		   installed IP numbers. No new one are allowed
++		   We can't change the broadcast address though */
++		for (i = 0; i < nbip; i++) {
++			int j;
++			__u32 nxip = vc_data.nx_mask_pair[i].ip;
++			for (j = 0; j < nxi->nbipv4; j++) {
++				if (nxip == nxi->ipv4[j]) {
++					found++;
++					break;
++				}
++			}
++		}
++		if ((found == nbip) &&
++			(vc_data.broadcast == nxi->v4_bcast))
++			err = 0;
++	}
++	if (err)
++		return err;
++
++	new_nxi = create_nx_info();
++	if (IS_ERR(new_nxi))
++		return -EINVAL;
++
++	new_nxi->nbipv4 = nbip;
++	for (i = 0; i < nbip; i++) {
++		new_nxi->ipv4[i] = vc_data.nx_mask_pair[i].ip;
++		new_nxi->mask[i] = vc_data.nx_mask_pair[i].mask;
++	}
++	new_nxi->v4_bcast = vc_data.broadcast;
++	if (nxi)
++		printk("!!! switching nx_info %p->%p\n", nxi, new_nxi);
++
++	nx_migrate_task(current, new_nxi);
++	release_nx_info(new_nxi, NULL);
++	put_nx_info(new_nxi);
++	return 0;
++}
++
++
+--- linux-2.6.22/kernel/vserver/limit.c	1970-01-01 01:00:00 +0100
++++ linux-2.6.22-vs2.2.0-rc5/kernel/vserver/limit.c	2007-06-15 02:37:04 +0200
+@@ -0,0 +1,319 @@
++/*
++ *  linux/kernel/vserver/limit.c
++ *
++ *  Virtual Server: Context Limits
++ *
++ *  Copyright (C) 2004-2007  Herbert Pötzl
++ *
++ *  V0.01  broken out from vcontext V0.05
++ *  V0.02  changed vcmds to vxi arg
++ *
++ */
++
++#include <linux/module.h>
++#include <linux/vs_context.h>
++#include <linux/vs_limit.h>
++#include <linux/vserver/limit.h>
++#include <linux/vserver/switch.h>
++#include <linux/vserver/limit_cmd.h>
++
++#include <asm/errno.h>
++#include <asm/uaccess.h>
++
++
++const char *vlimit_name[NUM_LIMITS] = {
++	[RLIMIT_CPU]		= "CPU",
++	[RLIMIT_RSS]		= "RSS",
++	[RLIMIT_NPROC]		= "NPROC",
++	[RLIMIT_NOFILE]		= "NOFILE",
++	[RLIMIT_MEMLOCK]	= "VML",
++	[RLIMIT_AS]		= "VM",
++	[RLIMIT_LOCKS]		= "LOCKS",
++	[RLIMIT_SIGPENDING]	= "SIGP",
++	[RLIMIT_MSGQUEUE]	= "MSGQ",
++
++	[VLIMIT_NSOCK]		= "NSOCK",
++	[VLIMIT_OPENFD]		= "OPENFD",
++	[VLIMIT_ANON]		= "ANON",
++	[VLIMIT_SHMEM]		= "SHMEM",
++	[VLIMIT_DENTRY]		= "DENTRY",
++};
++
++EXPORT_SYMBOL_GPL(vlimit_name);
++
++#define MASK_ENTRY(x)	(1 << (x))
++
++const struct vcmd_ctx_rlimit_mask_v0 vlimit_mask = {
++		/* minimum */
++	0
++	,	/* softlimit */
++	MASK_ENTRY( RLIMIT_RSS		) |
++	MASK_ENTRY( VLIMIT_ANON		) |
++	0
++	,       /* maximum */
++	MASK_ENTRY( RLIMIT_RSS		) |
++	MASK_ENTRY( RLIMIT_NPROC	) |
++	MASK_ENTRY( RLIMIT_NOFILE	) |
++	MASK_ENTRY( RLIMIT_MEMLOCK	) |
++	MASK_ENTRY( RLIMIT_AS		) |
++	MASK_ENTRY( RLIMIT_LOCKS	) |
++	MASK_ENTRY( RLIMIT_MSGQUEUE	) |
++
++	MASK_ENTRY( VLIMIT_NSOCK	) |
++	MASK_ENTRY( VLIMIT_OPENFD	) |
++	MASK_ENTRY( VLIMIT_ANON		) |
++	MASK_ENTRY( VLIMIT_SHMEM	) |
++	MASK_ENTRY( VLIMIT_DENTRY	) |
++	0
++};
++		/* accounting only */
++uint32_t account_mask =
++	MASK_ENTRY( VLIMIT_SEMARY	) |
++	MASK_ENTRY( VLIMIT_NSEMS	) |
++	MASK_ENTRY( VLIMIT_MAPPED	) |
++	0;
++
++
++static int is_valid_vlimit(int id)
++{
++	uint32_t mask = vlimit_mask.minimum |
++		vlimit_mask.softlimit | vlimit_mask.maximum;
++	return mask & (1 << id);
++}
++
++static int is_accounted_vlimit(int id)
++{
++	if (is_valid_vlimit(id))
++		return 1;
++	return account_mask & (1 << id);
++}
++
++
++static inline uint64_t vc_get_soft(struct vx_info *vxi, int id)
++{
++	rlim_t limit = __rlim_soft(&vxi->limit, id);
++	return VX_VLIM(limit);
++}
++
++static inline uint64_t vc_get_hard(struct vx_info *vxi, int id)
++{
++	rlim_t limit = __rlim_hard(&vxi->limit, id);
++	return VX_VLIM(limit);
++}
++
++static int do_get_rlimit(struct vx_info *vxi, uint32_t id,
++	uint64_t *minimum, uint64_t *softlimit, uint64_t *maximum)
++{
++	if (!is_valid_vlimit(id))
++		return -EINVAL;
++
++	if (minimum)
++		*minimum = CRLIM_UNSET;
++	if (softlimit)
++		*softlimit = vc_get_soft(vxi, id);
++	if (maximum)
++		*maximum = vc_get_hard(vxi, id);
++	return 0;
++}
++
++int vc_get_rlimit(struct vx_info *vxi, void __user *data)
++{
++	struct vcmd_ctx_rlimit_v0 vc_data;
++	int ret;
++
++	if (copy_from_user(&vc_data, data, sizeof(vc_data)))
++		return -EFAULT;
++
++	ret = do_get_rlimit(vxi, vc_data.id,
++		&vc_data.minimum, &vc_data.softlimit, &vc_data.maximum);
++	if (ret)
++		return ret;
++
++	if (copy_to_user(data, &vc_data, sizeof(vc_data)))
++		return -EFAULT;
++	return 0;
++}
++
++static int do_set_rlimit(struct vx_info *vxi, uint32_t id,
++	uint64_t minimum, uint64_t softlimit, uint64_t maximum)
++{
++	if (!is_valid_vlimit(id))
++		return -EINVAL;
++
++	if (maximum != CRLIM_KEEP)
++		__rlim_hard(&vxi->limit, id) = VX_RLIM(maximum);
++	if (softlimit != CRLIM_KEEP)
++		__rlim_soft(&vxi->limit, id) = VX_RLIM(softlimit);
++
++	/* clamp soft limit */
++	if (__rlim_soft(&vxi->limit, id) > __rlim_hard(&vxi->limit, id))
++		__rlim_soft(&vxi->limit, id) = __rlim_hard(&vxi->limit, id);
++
++	return 0;
++}
++
++int vc_set_rlimit(struct vx_info *vxi, void __user *data)
++{
++	struct vcmd_ctx_rlimit_v0 vc_data;
++
++	if (copy_from_user(&vc_data, data, sizeof(vc_data)))
++		return -EFAULT;
++
++	return do_set_rlimit(vxi, vc_data.id,
++		vc_data.minimum, vc_data.softlimit, vc_data.maximum);
++}
++
++#ifdef	CONFIG_IA32_EMULATION
++
++int vc_set_rlimit_x32(struct vx_info *vxi, void __user *data)
++{
++	struct vcmd_ctx_rlimit_v0_x32 vc_data;
++
++	if (copy_from_user(&vc_data, data, sizeof(vc_data)))
++		return -EFAULT;
++
++	return do_set_rlimit(vxi, vc_data.id,
++		vc_data.minimum, vc_data.softlimit, vc_data.maximum);
++}
++
++int vc_get_rlimit_x32(struct vx_info *vxi, void __user *data)
++{
++	struct vcmd_ctx_rlimit_v0_x32 vc_data;
++	int ret;
++
++	if (copy_from_user(&vc_data, data, sizeof(vc_data)))
++		return -EFAULT;
++
++	ret = do_get_rlimit(vxi, vc_data.id,
++		&vc_data.minimum, &vc_data.softlimit, &vc_data.maximum);
++	if (ret)
++		return ret;
++
++	if (copy_to_user(data, &vc_data, sizeof(vc_data)))
++		return -EFAULT;
++	return 0;
++}
++
++#endif	/* CONFIG_IA32_EMULATION */
++
++
++int vc_get_rlimit_mask(uint32_t id, void __user *data)
++{
++	if (copy_to_user(data, &vlimit_mask, sizeof(vlimit_mask)))
++		return -EFAULT;
++	return 0;
++}
++
++
++static inline void vx_reset_minmax(struct _vx_limit *limit)
++{
++	rlim_t value;
++	int lim;
++
++	for (lim = 0; lim < NUM_LIMITS; lim++) {
++		value = __rlim_get(limit, lim);
++		__rlim_rmax(limit, lim) = value;
++		__rlim_rmin(limit, lim) = value;
++	}
++}
++
++
++int vc_reset_minmax(struct vx_info *vxi, void __user *data)
++{
++	vx_reset_minmax(&vxi->limit);
++	return 0;
++}
++
++
++int vc_rlimit_stat(struct vx_info *vxi, void __user *data)
++{
++	struct vcmd_rlimit_stat_v0 vc_data;
++	struct _vx_limit *limit = &vxi->limit;
++	int id;
++
++	if (copy_from_user(&vc_data, data, sizeof(vc_data)))
++		return -EFAULT;
++
++	id = vc_data.id;
++	if (!is_accounted_vlimit(id))
++		return -EINVAL;
++
++	vx_limit_fixup(limit, id);
++	vc_data.hits = atomic_read(&__rlim_lhit(limit, id));
++	vc_data.value = __rlim_get(limit, id);
++	vc_data.minimum = __rlim_rmin(limit, id);
++	vc_data.maximum = __rlim_rmax(limit, id);
++
++	if (copy_to_user(data, &vc_data, sizeof(vc_data)))
++		return -EFAULT;
++	return 0;
++}
++
++
++void vx_vsi_meminfo(struct sysinfo *val)
++{
++	struct vx_info *vxi = current->vx_info;
++	unsigned long totalram, freeram;
++	rlim_t v;
++
++	/* we blindly accept the max */
++	v = __rlim_soft(&vxi->limit, RLIMIT_RSS);
++	totalram = (v != RLIM_INFINITY) ? v : val->totalram;
++
++	/* total minus used equals free */
++	v = __vx_cres_array_fixup(&vxi->limit, VLA_RSS);
++	freeram = (v < totalram) ? totalram - v : 0;
++
++	val->totalram = totalram;
++	val->freeram = freeram;
++	val->bufferram = 0;
++	val->totalhigh = 0;
++	val->freehigh = 0;
++	return;
++}
++
++void vx_vsi_swapinfo(struct sysinfo *val)
++{
++	struct vx_info *vxi = current->vx_info;
++	unsigned long totalswap, freeswap;
++	rlim_t v, w;
++
++	v = __rlim_soft(&vxi->limit, RLIMIT_RSS);
++	if (v == RLIM_INFINITY) {
++		val->freeswap = val->totalswap;
++		return;
++	}
++
++	/* we blindly accept the max */
++	w = __rlim_hard(&vxi->limit, RLIMIT_RSS);
++	totalswap = (w != RLIM_INFINITY) ? (w - v) : val->totalswap;
++
++	/* currently 'used' swap */
++	w = __vx_cres_array_fixup(&vxi->limit, VLA_RSS);
++	w -= (w > v) ? v : w;
++
++	/* total minus used equals free */
++	freeswap = (w < totalswap) ? totalswap - w : 0;
++
++	val->totalswap = totalswap;
++	val->freeswap = freeswap;
++	return;
++}
++
++
++unsigned long vx_badness(struct task_struct *task, struct mm_struct *mm)
++{
++	struct vx_info *vxi = mm->mm_vx_info;
++	unsigned long points;
++	rlim_t v, w;
++
++	if (!vxi)
++		return 0;
++
++	v = __vx_cres_array_fixup(&vxi->limit, VLA_RSS);
++	w = __rlim_soft(&vxi->limit, RLIMIT_RSS);
++	points = (v > w) ? (v - w) : 0;
++
++	return points;
++}
++
+--- linux-2.6.22/kernel/vserver/limit_init.h	1970-01-01 01:00:00 +0100
++++ linux-2.6.22-vs2.2.0-rc5/kernel/vserver/limit_init.h	2007-06-15 02:37:04 +0200
+@@ -0,0 +1,33 @@
++
++
++static inline void vx_info_init_limit(struct _vx_limit *limit)
++{
++	int lim;
++
++	for (lim = 0; lim < NUM_LIMITS; lim++) {
++		__rlim_soft(limit, lim) = RLIM_INFINITY;
++		__rlim_hard(limit, lim) = RLIM_INFINITY;
++		__rlim_set(limit, lim, 0);
++		atomic_set(&__rlim_lhit(limit, lim), 0);
++		__rlim_rmin(limit, lim) = 0;
++		__rlim_rmax(limit, lim) = 0;
++	}
++}
++
++static inline void vx_info_exit_limit(struct _vx_limit *limit)
++{
++#ifdef	CONFIG_VSERVER_WARN
++	rlim_t value;
++	int lim;
++
++	for (lim = 0; lim < NUM_LIMITS; lim++) {
++		if ((1 << lim) & VLIM_NOCHECK)
++			continue;
++		value = __rlim_get(limit, lim);
++		vxwprintk(value,
++			"!!! limit: %p[%s,%d] = %ld on exit.",
++			limit, vlimit_name[lim], lim, (long)value);
++	}
++#endif
++}
++
+--- linux-2.6.22/kernel/vserver/limit_proc.h	1970-01-01 01:00:00 +0100
++++ linux-2.6.22-vs2.2.0-rc5/kernel/vserver/limit_proc.h	2007-06-15 02:37:04 +0200
+@@ -0,0 +1,57 @@
++#ifndef _VX_LIMIT_PROC_H
++#define _VX_LIMIT_PROC_H
++
++#include <linux/vserver/limit_int.h>
++
++
++#define VX_LIMIT_FMT	":\t%8ld\t%8ld/%8ld\t%8lld/%8lld\t%6d\n"
++#define VX_LIMIT_TOP	\
++	"Limit\t current\t     min/max\t\t    soft/hard\t\thits\n"
++
++#define VX_LIMIT_ARG(r)				\
++	(unsigned long)__rlim_get(limit, r),	\
++	(unsigned long)__rlim_rmin(limit, r),	\
++	(unsigned long)__rlim_rmax(limit, r),	\
++	VX_VLIM(__rlim_soft(limit, r)),		\
++	VX_VLIM(__rlim_hard(limit, r)),		\
++	atomic_read(&__rlim_lhit(limit, r))
++
++static inline int vx_info_proc_limit(struct _vx_limit *limit, char *buffer)
++{
++	vx_limit_fixup(limit, -1);
++	return sprintf(buffer, VX_LIMIT_TOP
++		"PROC"	VX_LIMIT_FMT
++		"VM"	VX_LIMIT_FMT
++		"VML"	VX_LIMIT_FMT
++		"RSS"	VX_LIMIT_FMT
++		"ANON"	VX_LIMIT_FMT
++		"RMAP"	VX_LIMIT_FMT
++		"FILES" VX_LIMIT_FMT
++		"OFD"	VX_LIMIT_FMT
++		"LOCKS" VX_LIMIT_FMT
++		"SOCK"	VX_LIMIT_FMT
++		"MSGQ"	VX_LIMIT_FMT
++		"SHM"	VX_LIMIT_FMT
++		"SEMA"	VX_LIMIT_FMT
++		"SEMS"	VX_LIMIT_FMT
++		"DENT"	VX_LIMIT_FMT,
++		VX_LIMIT_ARG(RLIMIT_NPROC),
++		VX_LIMIT_ARG(RLIMIT_AS),
++		VX_LIMIT_ARG(RLIMIT_MEMLOCK),
++		VX_LIMIT_ARG(RLIMIT_RSS),
++		VX_LIMIT_ARG(VLIMIT_ANON),
++		VX_LIMIT_ARG(VLIMIT_MAPPED),
++		VX_LIMIT_ARG(RLIMIT_NOFILE),
++		VX_LIMIT_ARG(VLIMIT_OPENFD),
++		VX_LIMIT_ARG(RLIMIT_LOCKS),
++		VX_LIMIT_ARG(VLIMIT_NSOCK),
++		VX_LIMIT_ARG(RLIMIT_MSGQUEUE),
++		VX_LIMIT_ARG(VLIMIT_SHMEM),
++		VX_LIMIT_ARG(VLIMIT_SEMARY),
++		VX_LIMIT_ARG(VLIMIT_NSEMS),
++		VX_LIMIT_ARG(VLIMIT_DENTRY));
++}
++
++#endif	/* _VX_LIMIT_PROC_H */
++
++
+--- linux-2.6.22/kernel/vserver/monitor.c	1970-01-01 01:00:00 +0100
++++ linux-2.6.22-vs2.2.0-rc5/kernel/vserver/monitor.c	2007-06-15 05:59:57 +0200
+@@ -0,0 +1,143 @@
++/*
++ *  kernel/vserver/monitor.c
++ *
++ *  Virtual Context Scheduler Monitor
++ *
++ *  Copyright (C) 2006-2007 Herbert Pötzl
++ *
++ *  V0.01  basic design
++ *
++ */
++
++#include <linux/errno.h>
++#include <linux/module.h>
++#include <linux/types.h>
++#include <linux/ctype.h>
++#include <linux/jiffies.h>
++
++#include <asm/uaccess.h>
++#include <asm/atomic.h>
++#include <asm/unistd.h>
++
++#include <linux/vserver/monitor.h>
++#include <linux/vserver/debug_cmd.h>
++
++
++#ifdef	CONFIG_VSERVER_MONITOR
++#define VXM_SIZE	CONFIG_VSERVER_MONITOR_SIZE
++#else
++#define VXM_SIZE	64
++#endif
++
++struct _vx_monitor {
++	unsigned int counter;
++
++	struct _vx_mon_entry entry[VXM_SIZE+1];
++};
++
++
++DEFINE_PER_CPU(struct _vx_monitor, vx_monitor_buffer);
++
++unsigned volatile int vxm_active = 1;
++
++static atomic_t sequence = ATOMIC_INIT(0);
++
++
++/*	vxm_advance()
++
++	* requires disabled preemption				*/
++
++struct _vx_mon_entry *vxm_advance(int cpu)
++{
++	struct _vx_monitor *mon = &per_cpu(vx_monitor_buffer, cpu);
++	struct _vx_mon_entry *entry;
++	unsigned int index;
++
++	index = vxm_active ? (mon->counter++ % VXM_SIZE) : VXM_SIZE;
++	entry = &mon->entry[index];
++
++	entry->ev.seq = atomic_inc_return(&sequence);
++	entry->ev.jif = jiffies;
++	return entry;
++}
++
++EXPORT_SYMBOL_GPL(vxm_advance);
++
++
++int do_read_monitor(struct __user _vx_mon_entry *data,
++	int cpu, uint32_t *index, uint32_t *count)
++{
++	int pos, ret = 0;
++	struct _vx_monitor *mon = &per_cpu(vx_monitor_buffer, cpu);
++	int end = mon->counter;
++	int start = end - VXM_SIZE + 2;
++	int idx = *index;
++
++	/* special case: get current pos */
++	if (!*count) {
++		*index = end;
++		return 0;
++	}
++
++	/* have we lost some data? */
++	if (idx < start)
++		idx = start;
++
++	for (pos = 0; (pos < *count) && (idx < end); pos++, idx++) {
++		struct _vx_mon_entry *entry =
++			&mon->entry[idx % VXM_SIZE];
++
++		/* send entry to userspace */
++		ret = copy_to_user(&data[pos], entry, sizeof(*entry));
++		if (ret)
++			break;
++	}
++	/* save new index and count */
++	*index = idx;
++	*count = pos;
++	return ret ? ret : (*index < end);
++}
++
++int vc_read_monitor(uint32_t id, void __user *data)
++{
++	struct vcmd_read_monitor_v0 vc_data;
++	int ret;
++
++	if (id >= NR_CPUS)
++		return -EINVAL;
++
++	if (copy_from_user(&vc_data, data, sizeof(vc_data)))
++		return -EFAULT;
++
++	ret = do_read_monitor((struct __user _vx_mon_entry *)vc_data.data,
++		id, &vc_data.index, &vc_data.count);
++
++	if (copy_to_user(data, &vc_data, sizeof(vc_data)))
++		return -EFAULT;
++	return ret;
++}
++
++#ifdef	CONFIG_COMPAT
++
++int vc_read_monitor_x32(uint32_t id, void __user *data)
++{
++	struct vcmd_read_monitor_v0_x32 vc_data;
++	int ret;
++
++	if (id >= NR_CPUS)
++		return -EINVAL;
++
++	if (copy_from_user(&vc_data, data, sizeof(vc_data)))
++		return -EFAULT;
++
++	ret = do_read_monitor((struct __user _vx_mon_entry *)
++		compat_ptr(vc_data.data_ptr),
++		id, &vc_data.index, &vc_data.count);
++
++	if (copy_to_user(data, &vc_data, sizeof(vc_data)))
++		return -EFAULT;
++	return ret;
++}
++
++#endif	/* CONFIG_COMPAT */
++
+--- linux-2.6.22/kernel/vserver/network.c	1970-01-01 01:00:00 +0100
++++ linux-2.6.22-vs2.2.0-rc5/kernel/vserver/network.c	2007-06-15 02:37:04 +0200
+@@ -0,0 +1,771 @@
++/*
++ *  linux/kernel/vserver/network.c
++ *
++ *  Virtual Server: Network Support
++ *
++ *  Copyright (C) 2003-2007  Herbert Pötzl
++ *
++ *  V0.01  broken out from vcontext V0.05
++ *  V0.02  cleaned up implementation
++ *  V0.03  added equiv nx commands
++ *  V0.04  switch to RCU based hash
++ *  V0.05  and back to locking again
++ *  V0.06  changed vcmds to nxi arg
++ *  V0.07  have __create claim() the nxi
++ *
++ */
++
++#include <linux/slab.h>
++#include <linux/rcupdate.h>
++#include <net/tcp.h>
++
++#include <asm/errno.h>
++#include <linux/vserver/base.h>
++#include <linux/vserver/network_cmd.h>
++
++
++atomic_t nx_global_ctotal	= ATOMIC_INIT(0);
++atomic_t nx_global_cactive	= ATOMIC_INIT(0);
++
++
++/*	__alloc_nx_info()
++
++	* allocate an initialized nx_info struct
++	* doesn't make it visible (hash)			*/
++
++static struct nx_info *__alloc_nx_info(nid_t nid)
++{
++	struct nx_info *new = NULL;
++
++	vxdprintk(VXD_CBIT(nid, 1), "alloc_nx_info(%d)*", nid);
++
++	/* would this benefit from a slab cache? */
++	new = kmalloc(sizeof(struct nx_info), GFP_KERNEL);
++	if (!new)
++		return 0;
++
++	memset(new, 0, sizeof(struct nx_info));
++	new->nx_id = nid;
++	INIT_HLIST_NODE(&new->nx_hlist);
++	atomic_set(&new->nx_usecnt, 0);
++	atomic_set(&new->nx_tasks, 0);
++	new->nx_state = 0;
++
++	new->nx_flags = NXF_INIT_SET;
++
++	/* rest of init goes here */
++
++	vxdprintk(VXD_CBIT(nid, 0),
++		"alloc_nx_info(%d) = %p", nid, new);
++	atomic_inc(&nx_global_ctotal);
++	return new;
++}
++
++/*	__dealloc_nx_info()
++
++	* final disposal of nx_info				*/
++
++static void __dealloc_nx_info(struct nx_info *nxi)
++{
++	vxdprintk(VXD_CBIT(nid, 0),
++		"dealloc_nx_info(%p)", nxi);
++
++	nxi->nx_hlist.next = LIST_POISON1;
++	nxi->nx_id = -1;
++
++	BUG_ON(atomic_read(&nxi->nx_usecnt));
++	BUG_ON(atomic_read(&nxi->nx_tasks));
++
++	nxi->nx_state |= NXS_RELEASED;
++	kfree(nxi);
++	atomic_dec(&nx_global_ctotal);
++}
++
++static void __shutdown_nx_info(struct nx_info *nxi)
++{
++	nxi->nx_state |= NXS_SHUTDOWN;
++	vs_net_change(nxi, VSC_NETDOWN);
++}
++
++/*	exported stuff						*/
++
++void free_nx_info(struct nx_info *nxi)
++{
++	/* context shutdown is mandatory */
++	BUG_ON(nxi->nx_state != NXS_SHUTDOWN);
++
++	/* context must not be hashed */
++	BUG_ON(nxi->nx_state & NXS_HASHED);
++
++	BUG_ON(atomic_read(&nxi->nx_usecnt));
++	BUG_ON(atomic_read(&nxi->nx_tasks));
++
++	__dealloc_nx_info(nxi);
++}
++
++
++/*	hash table for nx_info hash */
++
++#define NX_HASH_SIZE	13
++
++struct hlist_head nx_info_hash[NX_HASH_SIZE];
++
++static spinlock_t nx_info_hash_lock = SPIN_LOCK_UNLOCKED;
++
++
++static inline unsigned int __hashval(nid_t nid)
++{
++	return (nid % NX_HASH_SIZE);
++}
++
++
++
++/*	__hash_nx_info()
++
++	* add the nxi to the global hash table
++	* requires the hash_lock to be held			*/
++
++static inline void __hash_nx_info(struct nx_info *nxi)
++{
++	struct hlist_head *head;
++
++	vxd_assert_lock(&nx_info_hash_lock);
++	vxdprintk(VXD_CBIT(nid, 4),
++		"__hash_nx_info: %p[#%d]", nxi, nxi->nx_id);
++
++	/* context must not be hashed */
++	BUG_ON(nx_info_state(nxi, NXS_HASHED));
++
++	nxi->nx_state |= NXS_HASHED;
++	head = &nx_info_hash[__hashval(nxi->nx_id)];
++	hlist_add_head(&nxi->nx_hlist, head);
++	atomic_inc(&nx_global_cactive);
++}
++
++/*	__unhash_nx_info()
++
++	* remove the nxi from the global hash table
++	* requires the hash_lock to be held			*/
++
++static inline void __unhash_nx_info(struct nx_info *nxi)
++{
++	vxd_assert_lock(&nx_info_hash_lock);
++	vxdprintk(VXD_CBIT(nid, 4),
++		"__unhash_nx_info: %p[#%d.%d.%d]", nxi, nxi->nx_id,
++		atomic_read(&nxi->nx_usecnt), atomic_read(&nxi->nx_tasks));
++
++	/* context must be hashed */
++	BUG_ON(!nx_info_state(nxi, NXS_HASHED));
++	/* but without tasks */
++	BUG_ON(atomic_read(&nxi->nx_tasks));
++
++	nxi->nx_state &= ~NXS_HASHED;
++	hlist_del(&nxi->nx_hlist);
++	atomic_dec(&nx_global_cactive);
++}
++
++
++/*	__lookup_nx_info()
++
++	* requires the hash_lock to be held
++	* doesn't increment the nx_refcnt			*/
++
++static inline struct nx_info *__lookup_nx_info(nid_t nid)
++{
++	struct hlist_head *head = &nx_info_hash[__hashval(nid)];
++	struct hlist_node *pos;
++	struct nx_info *nxi;
++
++	vxd_assert_lock(&nx_info_hash_lock);
++	hlist_for_each(pos, head) {
++		nxi = hlist_entry(pos, struct nx_info, nx_hlist);
++
++		if (nxi->nx_id == nid)
++			goto found;
++	}
++	nxi = NULL;
++found:
++	vxdprintk(VXD_CBIT(nid, 0),
++		"__lookup_nx_info(#%u): %p[#%u]",
++		nid, nxi, nxi ? nxi->nx_id : 0);
++	return nxi;
++}
++
++
++/*	__nx_dynamic_id()
++
++	* find unused dynamic nid
++	* requires the hash_lock to be held			*/
++
++static inline nid_t __nx_dynamic_id(void)
++{
++	static nid_t seq = MAX_N_CONTEXT;
++	nid_t barrier = seq;
++
++	vxd_assert_lock(&nx_info_hash_lock);
++	do {
++		if (++seq > MAX_N_CONTEXT)
++			seq = MIN_D_CONTEXT;
++		if (!__lookup_nx_info(seq)) {
++			vxdprintk(VXD_CBIT(nid, 4),
++				"__nx_dynamic_id: [#%d]", seq);
++			return seq;
++		}
++	} while (barrier != seq);
++	return 0;
++}
++
++/*	__create_nx_info()
++
++	* create the requested context
++	* get(), claim() and hash it				*/
++
++static struct nx_info *__create_nx_info(int id)
++{
++	struct nx_info *new, *nxi = NULL;
++
++	vxdprintk(VXD_CBIT(nid, 1), "create_nx_info(%d)*", id);
++
++	if (!(new = __alloc_nx_info(id)))
++		return ERR_PTR(-ENOMEM);
++
++	/* required to make dynamic xids unique */
++	spin_lock(&nx_info_hash_lock);
++
++	/* dynamic context requested */
++	if (id == NX_DYNAMIC_ID) {
++#ifdef	CONFIG_VSERVER_DYNAMIC_IDS
++		id = __nx_dynamic_id();
++		if (!id) {
++			printk(KERN_ERR "no dynamic context available.\n");
++			nxi = ERR_PTR(-EAGAIN);
++			goto out_unlock;
++		}
++		new->nx_id = id;
++#else
++		printk(KERN_ERR "dynamic contexts disabled.\n");
++		nxi = ERR_PTR(-EINVAL);
++		goto out_unlock;
++#endif
++	}
++	/* static context requested */
++	else if ((nxi = __lookup_nx_info(id))) {
++		vxdprintk(VXD_CBIT(nid, 0),
++			"create_nx_info(%d) = %p (already there)", id, nxi);
++		if (nx_info_flags(nxi, NXF_STATE_SETUP, 0))
++			nxi = ERR_PTR(-EBUSY);
++		else
++			nxi = ERR_PTR(-EEXIST);
++		goto out_unlock;
++	}
++	/* dynamic nid creation blocker */
++	else if (id >= MIN_D_CONTEXT) {
++		vxdprintk(VXD_CBIT(nid, 0),
++			"create_nx_info(%d) (dynamic rejected)", id);
++		nxi = ERR_PTR(-EINVAL);
++		goto out_unlock;
++	}
++
++	/* new context */
++	vxdprintk(VXD_CBIT(nid, 0),
++		"create_nx_info(%d) = %p (new)", id, new);
++	claim_nx_info(new, NULL);
++	__hash_nx_info(get_nx_info(new));
++	nxi = new, new = NULL;
++
++out_unlock:
++	spin_unlock(&nx_info_hash_lock);
++	if (new)
++		__dealloc_nx_info(new);
++	return nxi;
++}
++
++
++
++/*	exported stuff						*/
++
++
++void unhash_nx_info(struct nx_info *nxi)
++{
++	__shutdown_nx_info(nxi);
++	spin_lock(&nx_info_hash_lock);
++	__unhash_nx_info(nxi);
++	spin_unlock(&nx_info_hash_lock);
++}
++
++#ifdef  CONFIG_VSERVER_LEGACYNET
++
++struct nx_info *create_nx_info(void)
++{
++	return __create_nx_info(NX_DYNAMIC_ID);
++}
++
++#endif
++
++/*	lookup_nx_info()
++
++	* search for a nx_info and get() it
++	* negative id means current				*/
++
++struct nx_info *lookup_nx_info(int id)
++{
++	struct nx_info *nxi = NULL;
++
++	if (id < 0) {
++		nxi = get_nx_info(current->nx_info);
++	} else if (id > 1) {
++		spin_lock(&nx_info_hash_lock);
++		nxi = get_nx_info(__lookup_nx_info(id));
++		spin_unlock(&nx_info_hash_lock);
++	}
++	return nxi;
++}
++
++/*	nid_is_hashed()
++
++	* verify that nid is still hashed			*/
++
++int nid_is_hashed(nid_t nid)
++{
++	int hashed;
++
++	spin_lock(&nx_info_hash_lock);
++	hashed = (__lookup_nx_info(nid) != NULL);
++	spin_unlock(&nx_info_hash_lock);
++	return hashed;
++}
++
++
++#ifdef	CONFIG_PROC_FS
++
++/*	get_nid_list()
++
++	* get a subset of hashed nids for proc
++	* assumes size is at least one				*/
++
++int get_nid_list(int index, unsigned int *nids, int size)
++{
++	int hindex, nr_nids = 0;
++
++	/* only show current and children */
++	if (!nx_check(0, VS_ADMIN | VS_WATCH)) {
++		if (index > 0)
++			return 0;
++		nids[nr_nids] = nx_current_nid();
++		return 1;
++	}
++
++	for (hindex = 0; hindex < NX_HASH_SIZE; hindex++) {
++		struct hlist_head *head = &nx_info_hash[hindex];
++		struct hlist_node *pos;
++
++		spin_lock(&nx_info_hash_lock);
++		hlist_for_each(pos, head) {
++			struct nx_info *nxi;
++
++			if (--index > 0)
++				continue;
++
++			nxi = hlist_entry(pos, struct nx_info, nx_hlist);
++			nids[nr_nids] = nxi->nx_id;
++			if (++nr_nids >= size) {
++				spin_unlock(&nx_info_hash_lock);
++				goto out;
++			}
++		}
++		/* keep the lock time short */
++		spin_unlock(&nx_info_hash_lock);
++	}
++out:
++	return nr_nids;
++}
++#endif
++
++
++/*
++ *	migrate task to new network
++ *	gets nxi, puts old_nxi on change
++ */
++
++int nx_migrate_task(struct task_struct *p, struct nx_info *nxi)
++{
++	struct nx_info *old_nxi;
++	int ret = 0;
++
++	if (!p || !nxi)
++		BUG();
++
++	vxdprintk(VXD_CBIT(nid, 5),
++		"nx_migrate_task(%p,%p[#%d.%d.%d])",
++		p, nxi, nxi->nx_id,
++		atomic_read(&nxi->nx_usecnt),
++		atomic_read(&nxi->nx_tasks));
++
++	if (nx_info_flags(nxi, NXF_INFO_PRIVATE, 0) &&
++		!nx_info_flags(nxi, NXF_STATE_SETUP, 0))
++		return -EACCES;
++
++	if (nx_info_state(nxi, NXS_SHUTDOWN))
++		return -EFAULT;
++
++	/* maybe disallow this completely? */
++	old_nxi = task_get_nx_info(p);
++	if (old_nxi == nxi)
++		goto out;
++
++	task_lock(p);
++	if (old_nxi)
++		clr_nx_info(&p->nx_info);
++	claim_nx_info(nxi, p);
++	set_nx_info(&p->nx_info, nxi);
++	p->nid = nxi->nx_id;
++	task_unlock(p);
++
++	vxdprintk(VXD_CBIT(nid, 5),
++		"moved task %p into nxi:%p[#%d]",
++		p, nxi, nxi->nx_id);
++
++	if (old_nxi)
++		release_nx_info(old_nxi, p);
++	ret = 0;
++out:
++	put_nx_info(old_nxi);
++	return ret;
++}
++
++
++#ifdef CONFIG_INET
++
++#include <linux/netdevice.h>
++#include <linux/inetdevice.h>
++
++int ifa_in_nx_info(struct in_ifaddr *ifa, struct nx_info *nxi)
++{
++	if (!nxi)
++		return 1;
++	if (!ifa)
++		return 0;
++	return addr_in_nx_info(nxi, ifa->ifa_local);
++}
++
++int dev_in_nx_info(struct net_device *dev, struct nx_info *nxi)
++{
++	struct in_device *in_dev;
++	struct in_ifaddr **ifap;
++	struct in_ifaddr *ifa;
++	int ret = 0;
++
++	if (!nxi)
++		return 1;
++
++	if (!dev)
++		goto out;
++	in_dev = in_dev_get(dev);
++	if (!in_dev)
++		goto out;
++
++	for (ifap = &in_dev->ifa_list; (ifa = *ifap) != NULL;
++		ifap = &ifa->ifa_next) {
++		if (addr_in_nx_info(nxi, ifa->ifa_local)) {
++			ret = 1;
++			break;
++		}
++	}
++	in_dev_put(in_dev);
++out:
++	return ret;
++}
++
++/*
++ *	check if address is covered by socket
++ *
++ *	sk:	the socket to check against
++ *	addr:	the address in question (must be != 0)
++ */
++static inline int __addr_in_socket(const struct sock *sk, uint32_t addr)
++{
++	struct nx_info *nxi = sk->sk_nx_info;
++	uint32_t saddr = inet_rcv_saddr(sk);
++
++	vxdprintk(VXD_CBIT(net, 5),
++		"__addr_in_socket(%p," NIPQUAD_FMT ") %p:" NIPQUAD_FMT " %p;%lx",
++		sk, NIPQUAD(addr), nxi, NIPQUAD(saddr), sk->sk_socket,
++		(sk->sk_socket ? sk->sk_socket->flags : 0));
++
++	if (saddr) {
++		/* direct address match */
++		return (saddr == addr);
++	} else if (nxi) {
++		/* match against nx_info */
++		return addr_in_nx_info(nxi, addr);
++	} else {
++		/* unrestricted any socket */
++		return 1;
++	}
++}
++
++
++int nx_addr_conflict(struct nx_info *nxi, uint32_t addr, const struct sock *sk)
++{
++	vxdprintk(VXD_CBIT(net, 2),
++		"nx_addr_conflict(%p,%p) " NIPQUAD_FMT,
++		nxi, sk, NIPQUAD(addr));
++
++	if (addr) {
++		/* check real address */
++		return __addr_in_socket(sk, addr);
++	} else if (nxi) {
++		/* check against nx_info */
++		int i, n = nxi->nbipv4;
++
++		for (i = 0; i < n; i++)
++			if (__addr_in_socket(sk, nxi->ipv4[i]))
++				return 1;
++		return 0;
++	} else {
++		/* check against any */
++		return 1;
++	}
++}
++
++#endif /* CONFIG_INET */
++
++void nx_set_persistent(struct nx_info *nxi)
++{
++	vxdprintk(VXD_CBIT(nid, 6),
++		"nx_set_persistent(%p[#%d])", nxi, nxi->nx_id);
++
++	get_nx_info(nxi);
++	claim_nx_info(nxi, NULL);
++}
++
++void nx_clear_persistent(struct nx_info *nxi)
++{
++	vxdprintk(VXD_CBIT(nid, 6),
++		"nx_clear_persistent(%p[#%d])", nxi, nxi->nx_id);
++
++	release_nx_info(nxi, NULL);
++	put_nx_info(nxi);
++}
++
++void nx_update_persistent(struct nx_info *nxi)
++{
++	if (nx_info_flags(nxi, NXF_PERSISTENT, 0))
++		nx_set_persistent(nxi);
++	else
++		nx_clear_persistent(nxi);
++}
++
++/* vserver syscall commands below here */
++
++/* taks nid and nx_info functions */
++
++#include <asm/uaccess.h>
++
++
++int vc_task_nid(uint32_t id, void __user *data)
++{
++	nid_t nid;
++
++	if (id) {
++		struct task_struct *tsk;
++
++		if (!nx_check(0, VS_ADMIN | VS_WATCH))
++			return -EPERM;
++
++		read_lock(&tasklist_lock);
++		tsk = find_task_by_real_pid(id);
++		nid = (tsk) ? tsk->nid : -ESRCH;
++		read_unlock(&tasklist_lock);
++	} else
++		nid = nx_current_nid();
++	return nid;
++}
++
++
++int vc_nx_info(struct nx_info *nxi, void __user *data)
++{
++	struct vcmd_nx_info_v0 vc_data;
++
++	vc_data.nid = nxi->nx_id;
++
++	if (copy_to_user(data, &vc_data, sizeof(vc_data)))
++		return -EFAULT;
++	return 0;
++}
++
++
++/* network functions */
++
++int vc_net_create(uint32_t nid, void __user *data)
++{
++	struct vcmd_net_create vc_data = { .flagword = NXF_INIT_SET };
++	struct nx_info *new_nxi;
++	int ret;
++
++	if (data && copy_from_user(&vc_data, data, sizeof(vc_data)))
++		return -EFAULT;
++
++	if ((nid > MAX_S_CONTEXT) && (nid != NX_DYNAMIC_ID))
++		return -EINVAL;
++	if (nid < 2)
++		return -EINVAL;
++
++	new_nxi = __create_nx_info(nid);
++	if (IS_ERR(new_nxi))
++		return PTR_ERR(new_nxi);
++
++	/* initial flags */
++	new_nxi->nx_flags = vc_data.flagword;
++
++	ret = -ENOEXEC;
++	if (vs_net_change(new_nxi, VSC_NETUP))
++		goto out;
++
++	ret = nx_migrate_task(current, new_nxi);
++	if (ret)
++		goto out;
++
++	/* return context id on success */
++	ret = new_nxi->nx_id;
++
++	/* get a reference for persistent contexts */
++	if ((vc_data.flagword & NXF_PERSISTENT))
++		nx_set_persistent(new_nxi);
++out:
++	release_nx_info(new_nxi, NULL);
++	put_nx_info(new_nxi);
++	return ret;
++}
++
++
++int vc_net_migrate(struct nx_info *nxi, void __user *data)
++{
++	return nx_migrate_task(current, nxi);
++}
++
++int vc_net_add(struct nx_info *nxi, void __user *data)
++{
++	struct vcmd_net_addr_v0 vc_data;
++	int index, pos, ret = 0;
++
++	if (data && copy_from_user(&vc_data, data, sizeof(vc_data)))
++		return -EFAULT;
++
++	switch (vc_data.type) {
++	case NXA_TYPE_IPV4:
++		if ((vc_data.count < 1) || (vc_data.count > 4))
++			return -EINVAL;
++		break;
++
++	default:
++		break;
++	}
++
++	switch (vc_data.type) {
++	case NXA_TYPE_IPV4:
++		index = 0;
++		while ((index < vc_data.count) &&
++			((pos = nxi->nbipv4) < NB_IPV4ROOT)) {
++			nxi->ipv4[pos] = vc_data.ip[index];
++			nxi->mask[pos] = vc_data.mask[index];
++			index++;
++			nxi->nbipv4++;
++		}
++		ret = index;
++		break;
++
++	case NXA_TYPE_IPV4|NXA_MOD_BCAST:
++		nxi->v4_bcast = vc_data.ip[0];
++		ret = 1;
++		break;
++
++	default:
++		ret = -EINVAL;
++		break;
++	}
++	return ret;
++}
++
++int vc_net_remove(struct nx_info *nxi, void __user *data)
++{
++	struct vcmd_net_addr_v0 vc_data;
++
++	if (data && copy_from_user(&vc_data, data, sizeof(vc_data)))
++		return -EFAULT;
++
++	switch (vc_data.type) {
++	case NXA_TYPE_ANY:
++		nxi->nbipv4 = 0;
++		break;
++
++	default:
++		return -EINVAL;
++	}
++	return 0;
++}
++
++int vc_get_nflags(struct nx_info *nxi, void __user *data)
++{
++	struct vcmd_net_flags_v0 vc_data;
++
++	vc_data.flagword = nxi->nx_flags;
++
++	/* special STATE flag handling */
++	vc_data.mask = vs_mask_flags(~0UL, nxi->nx_flags, NXF_ONE_TIME);
++
++	if (copy_to_user(data, &vc_data, sizeof(vc_data)))
++		return -EFAULT;
++	return 0;
++}
++
++int vc_set_nflags(struct nx_info *nxi, void __user *data)
++{
++	struct vcmd_net_flags_v0 vc_data;
++	uint64_t mask, trigger;
++
++	if (copy_from_user(&vc_data, data, sizeof(vc_data)))
++		return -EFAULT;
++
++	/* special STATE flag handling */
++	mask = vs_mask_mask(vc_data.mask, nxi->nx_flags, NXF_ONE_TIME);
++	trigger = (mask & nxi->nx_flags) ^ (mask & vc_data.flagword);
++
++	nxi->nx_flags = vs_mask_flags(nxi->nx_flags,
++		vc_data.flagword, mask);
++	if (trigger & NXF_PERSISTENT)
++		nx_update_persistent(nxi);
++
++	return 0;
++}
++
++int vc_get_ncaps(struct nx_info *nxi, void __user *data)
++{
++	struct vcmd_net_caps_v0 vc_data;
++
++	vc_data.ncaps = nxi->nx_ncaps;
++	vc_data.cmask = ~0UL;
++
++	if (copy_to_user(data, &vc_data, sizeof(vc_data)))
++		return -EFAULT;
++	return 0;
++}
++
++int vc_set_ncaps(struct nx_info *nxi, void __user *data)
++{
++	struct vcmd_net_caps_v0 vc_data;
++
++	if (copy_from_user(&vc_data, data, sizeof(vc_data)))
++		return -EFAULT;
++
++	nxi->nx_ncaps = vs_mask_flags(nxi->nx_ncaps,
++		vc_data.ncaps, vc_data.cmask);
++	return 0;
++}
++
++
++#include <linux/module.h>
++
++EXPORT_SYMBOL_GPL(free_nx_info);
++EXPORT_SYMBOL_GPL(unhash_nx_info);
++
+--- linux-2.6.22/kernel/vserver/proc.c	1970-01-01 01:00:00 +0100
++++ linux-2.6.22-vs2.2.0-rc5/kernel/vserver/proc.c	2007-06-15 19:20:10 +0200
+@@ -0,0 +1,1033 @@
++/*
++ *  linux/kernel/vserver/proc.c
++ *
++ *  Virtual Context Support
++ *
++ *  Copyright (C) 2003-2007  Herbert Pötzl
++ *
++ *  V0.01  basic structure
++ *  V0.02  adaptation vs1.3.0
++ *  V0.03  proc permissions
++ *  V0.04  locking/generic
++ *  V0.05  next generation procfs
++ *  V0.06  inode validation
++ *  V0.07  generic rewrite vid
++ *  V0.08  remove inode type
++ *
++ */
++
++#include <linux/errno.h>
++#include <linux/proc_fs.h>
++#include <linux/sched.h>
++#include <linux/vs_context.h>
++#include <linux/vs_network.h>
++#include <linux/vs_cvirt.h>
++
++#include <linux/vserver/switch.h>
++#include <linux/vserver/global.h>
++
++#include <asm/uaccess.h>
++#include <asm/unistd.h>
++
++#include "cvirt_proc.h"
++#include "cacct_proc.h"
++#include "limit_proc.h"
++#include "sched_proc.h"
++#include "vci_config.h"
++
++static struct proc_dir_entry *proc_virtual;
++
++static struct proc_dir_entry *proc_virtnet;
++
++
++/* first the actual feeds */
++
++
++static int proc_vci(char *buffer)
++{
++	return sprintf(buffer,
++		"VCIVersion:\t%04x:%04x\n"
++		"VCISyscall:\t%d\n"
++		"VCIKernel:\t%08x\n",
++		VCI_VERSION >> 16,
++		VCI_VERSION & 0xFFFF,
++		__NR_vserver,
++		vci_kernel_config());
++}
++
++static int proc_virtual_info(char *buffer)
++{
++	return proc_vci(buffer);
++}
++
++static int proc_virtual_status(char *buffer)
++{
++	return sprintf(buffer,
++		"#CTotal:\t%d\n"
++		"#CActive:\t%d\n"
++		"#NSProxy:\t%d\t%d %d %d %d\n",
++		atomic_read(&vx_global_ctotal),
++		atomic_read(&vx_global_cactive),
++		atomic_read(&vs_global_nsproxy),
++		atomic_read(&vs_global_fs),
++		atomic_read(&vs_global_mnt_ns),
++		atomic_read(&vs_global_uts_ns),
++		atomic_read(&vs_global_ipc_ns));
++}
++
++
++int proc_vxi_info(struct vx_info *vxi, char *buffer)
++{
++	int length;
++
++	length = sprintf(buffer,
++		"ID:\t%d\n"
++		"Info:\t%p\n"
++		"Init:\t%d\n",
++		vxi->vx_id,
++		vxi,
++		vxi->vx_initpid);
++	return length;
++}
++
++int proc_vxi_status(struct vx_info *vxi, char *buffer)
++{
++	int length;
++
++	length = sprintf(buffer,
++		"UseCnt:\t%d\n"
++		"Tasks:\t%d\n"
++		"Flags:\t%016llx\n"
++		"BCaps:\t%016llx\n"
++		"CCaps:\t%016llx\n"
++		"Spaces:\t%08lx\n",
++		atomic_read(&vxi->vx_usecnt),
++		atomic_read(&vxi->vx_tasks),
++		(unsigned long long)vxi->vx_flags,
++		(unsigned long long)vxi->vx_bcaps,
++		(unsigned long long)vxi->vx_ccaps,
++		vxi->vx_nsmask);
++	return length;
++}
++
++int proc_vxi_limit(struct vx_info *vxi, char *buffer)
++{
++	return vx_info_proc_limit(&vxi->limit, buffer);
++}
++
++int proc_vxi_sched(struct vx_info *vxi, char *buffer)
++{
++	int cpu, length;
++
++	length = vx_info_proc_sched(&vxi->sched, buffer);
++	for_each_online_cpu(cpu) {
++		length += vx_info_proc_sched_pc(
++			&vx_per_cpu(vxi, sched_pc, cpu),
++			buffer + length, cpu);
++	}
++	return length;
++}
++
++int proc_vxi_nsproxy(struct vx_info *vxi, char *buffer)
++{
++	return vx_info_proc_nsproxy(vxi->vx_nsproxy, buffer);
++}
++
++int proc_vxi_cvirt(struct vx_info *vxi, char *buffer)
++{
++	int cpu, length;
++
++	vx_update_load(vxi);
++	length = vx_info_proc_cvirt(&vxi->cvirt, buffer);
++	for_each_online_cpu(cpu) {
++		length += vx_info_proc_cvirt_pc(
++			&vx_per_cpu(vxi, cvirt_pc, cpu),
++			buffer + length, cpu);
++	}
++	return length;
++}
++
++int proc_vxi_cacct(struct vx_info *vxi, char *buffer)
++{
++	return vx_info_proc_cacct(&vxi->cacct, buffer);
++}
++
++
++static int proc_virtnet_info(char *buffer)
++{
++	return proc_vci(buffer);
++}
++
++static int proc_virtnet_status(char *buffer)
++{
++	return sprintf(buffer,
++		"#CTotal:\t%d\n"
++		"#CActive:\t%d\n",
++		atomic_read(&nx_global_ctotal),
++		atomic_read(&nx_global_cactive));
++}
++
++int proc_nxi_info(struct nx_info *nxi, char *buffer)
++{
++	int length, i;
++
++	length = sprintf(buffer,
++		"ID:\t%d\n"
++		"Info:\t%p\n",
++		nxi->nx_id,
++		nxi);
++	for (i = 0; i < nxi->nbipv4; i++) {
++		length += sprintf(buffer + length,
++			"%d:\t" NIPQUAD_FMT "/" NIPQUAD_FMT "\n", i,
++			NIPQUAD(nxi->ipv4[i]), NIPQUAD(nxi->mask[i]));
++	}
++	return length;
++}
++
++int proc_nxi_status(struct nx_info *nxi, char *buffer)
++{
++	int length;
++
++	length = sprintf(buffer,
++		"UseCnt:\t%d\n"
++		"Tasks:\t%d\n"
++		"Flags:\t%016llx\n"
++		"NCaps:\t%016llx\n",
++		atomic_read(&nxi->nx_usecnt),
++		atomic_read(&nxi->nx_tasks),
++		(unsigned long long)nxi->nx_flags,
++		(unsigned long long)nxi->nx_ncaps);
++	return length;
++}
++
++
++
++/* here the inode helpers */
++
++struct vs_entry {
++	int len;
++	char *name;
++	mode_t mode;
++	struct inode_operations *iop;
++	struct file_operations *fop;
++	union proc_op op;
++};
++
++static struct inode *vs_proc_make_inode(struct super_block *sb, struct vs_entry *p)
++{
++	struct inode *inode = new_inode(sb);
++
++	if (!inode)
++		goto out;
++
++	inode->i_mode = p->mode;
++	if (p->iop)
++		inode->i_op = p->iop;
++	if (p->fop)
++		inode->i_fop = p->fop;
++
++	inode->i_nlink = (p->mode & S_IFDIR) ? 2 : 1;
++	inode->i_flags |= S_IMMUTABLE;
++
++	inode->i_mtime = inode->i_atime = inode->i_ctime = CURRENT_TIME;
++
++	inode->i_uid = 0;
++	inode->i_gid = 0;
++	inode->i_tag = 0;
++out:
++	return inode;
++}
++
++static struct dentry *vs_proc_instantiate(struct inode *dir,
++	struct dentry *dentry, int id, void *ptr)
++{
++	struct vs_entry *p = ptr;
++	struct inode *inode = vs_proc_make_inode(dir->i_sb, p);
++	struct dentry *error = ERR_PTR(-EINVAL);
++
++	if (!inode)
++		goto out;
++
++	PROC_I(inode)->op = p->op;
++	PROC_I(inode)->fd = id;
++	d_add(dentry, inode);
++	error = NULL;
++out:
++	return error;
++}
++
++/* Lookups */
++
++typedef struct dentry *instantiate_t(struct inode *, struct dentry *, int, void *);
++
++/*
++ * Fill a directory entry.
++ *
++ * If possible create the dcache entry and derive our inode number and
++ * file type from dcache entry.
++ *
++ * Since all of the proc inode numbers are dynamically generated, the inode
++ * numbers do not exist until the inode is cache.  This means creating the
++ * the dcache entry in readdir is necessary to keep the inode numbers
++ * reported by readdir in sync with the inode numbers reported
++ * by stat.
++ */
++static int proc_fill_cache(struct file *filp, void *dirent, filldir_t filldir,
++	char *name, int len, instantiate_t instantiate, int id, void *ptr)
++{
++	struct dentry *child, *dir = filp->f_dentry;
++	struct inode *inode;
++	struct qstr qname;
++	ino_t ino = 0;
++	unsigned type = DT_UNKNOWN;
++
++	qname.name = name;
++	qname.len  = len;
++	qname.hash = full_name_hash(name, len);
++
++	child = d_lookup(dir, &qname);
++	if (!child) {
++		struct dentry *new;
++		new = d_alloc(dir, &qname);
++		if (new) {
++			child = instantiate(dir->d_inode, new, id, ptr);
++			if (child)
++				dput(new);
++			else
++				child = new;
++		}
++	}
++	if (!child || IS_ERR(child) || !child->d_inode)
++		goto end_instantiate;
++	inode = child->d_inode;
++	if (inode) {
++		ino = inode->i_ino;
++		type = inode->i_mode >> 12;
++	}
++	dput(child);
++end_instantiate:
++	if (!ino)
++		ino = find_inode_number(dir, &qname);
++	if (!ino)
++		ino = 1;
++	return filldir(dirent, name, len, filp->f_pos, ino, type);
++}
++
++
++
++/* get and revalidate vx_info/xid */
++
++static inline
++struct vx_info *get_proc_vx_info(struct inode *inode)
++{
++	return lookup_vx_info(PROC_I(inode)->fd);
++}
++
++static int proc_xid_revalidate(struct dentry *dentry, struct nameidata *nd)
++{
++	struct inode *inode = dentry->d_inode;
++	xid_t xid = PROC_I(inode)->fd;
++
++	if (!xid || xid_is_hashed(xid))
++		return 1;
++	d_drop(dentry);
++	return 0;
++}
++
++
++/* get and revalidate nx_info/nid */
++
++static int proc_nid_revalidate(struct dentry *dentry, struct nameidata *nd)
++{
++	struct inode *inode = dentry->d_inode;
++	nid_t nid = PROC_I(inode)->fd;
++
++	if (!nid || nid_is_hashed(nid))
++		return 1;
++	d_drop(dentry);
++	return 0;
++}
++
++
++
++#define PROC_BLOCK_SIZE (PAGE_SIZE - 1024)
++
++static ssize_t proc_vs_info_read(struct file *file, char __user *buf,
++			  size_t count, loff_t *ppos)
++{
++	struct inode *inode = file->f_dentry->d_inode;
++	unsigned long page;
++	ssize_t length = 0;
++
++	if (count > PROC_BLOCK_SIZE)
++		count = PROC_BLOCK_SIZE;
++
++	/* fade that out as soon as stable */
++	WARN_ON(PROC_I(inode)->fd);
++
++	if (!(page = __get_free_page(GFP_KERNEL)))
++		return -ENOMEM;
++
++	BUG_ON(!PROC_I(inode)->op.proc_vs_read);
++	length = PROC_I(inode)->op.proc_vs_read((char *)page);
++
++	if (length >= 0)
++		length = simple_read_from_buffer(buf, count, ppos,
++			(char *)page, length);
++
++	free_page(page);
++	return length;
++}
++
++static ssize_t proc_vx_info_read(struct file *file, char __user *buf,
++			  size_t count, loff_t *ppos)
++{
++	struct inode *inode = file->f_dentry->d_inode;
++	struct vx_info *vxi = NULL;
++	xid_t xid = PROC_I(inode)->fd;
++	unsigned long page;
++	ssize_t length = 0;
++
++	if (count > PROC_BLOCK_SIZE)
++		count = PROC_BLOCK_SIZE;
++
++	/* fade that out as soon as stable */
++	WARN_ON(!xid);
++	vxi = lookup_vx_info(xid);
++	if (!vxi)
++		goto out;
++
++	length = -ENOMEM;
++	if (!(page = __get_free_page(GFP_KERNEL)))
++		goto out_put;
++
++	BUG_ON(!PROC_I(inode)->op.proc_vxi_read);
++	length = PROC_I(inode)->op.proc_vxi_read(vxi, (char *)page);
++
++	if (length >= 0)
++		length = simple_read_from_buffer(buf, count, ppos,
++			(char *)page, length);
++
++	free_page(page);
++out_put:
++	put_vx_info(vxi);
++out:
++	return length;
++}
++
++static ssize_t proc_nx_info_read(struct file *file, char __user *buf,
++			  size_t count, loff_t *ppos)
++{
++	struct inode *inode = file->f_dentry->d_inode;
++	struct nx_info *nxi = NULL;
++	nid_t nid = PROC_I(inode)->fd;
++	unsigned long page;
++	ssize_t length = 0;
++
++	if (count > PROC_BLOCK_SIZE)
++		count = PROC_BLOCK_SIZE;
++
++	/* fade that out as soon as stable */
++	WARN_ON(!nid);
++	nxi = lookup_nx_info(nid);
++	if (!nxi)
++		goto out;
++
++	length = -ENOMEM;
++	if (!(page = __get_free_page(GFP_KERNEL)))
++		goto out_put;
++
++	BUG_ON(!PROC_I(inode)->op.proc_nxi_read);
++	length = PROC_I(inode)->op.proc_nxi_read(nxi, (char *)page);
++
++	if (length >= 0)
++		length = simple_read_from_buffer(buf, count, ppos,
++			(char *)page, length);
++
++	free_page(page);
++out_put:
++	put_nx_info(nxi);
++out:
++	return length;
++}
++
++
++
++/* here comes the lower level */
++
++
++#define NOD(NAME, MODE, IOP, FOP, OP) {	\
++	.len  = sizeof(NAME) - 1,	\
++	.name = (NAME),			\
++	.mode = MODE,			\
++	.iop  = IOP,			\
++	.fop  = FOP,			\
++	.op   = OP,			\
++}
++
++
++#define DIR(NAME, MODE, OTYPE)				\
++	NOD(NAME, (S_IFDIR | (MODE)),			\
++		&proc_ ## OTYPE ## _inode_operations,	\
++		&proc_ ## OTYPE ## _file_operations, { } )
++
++#define INF(NAME, MODE, OTYPE)				\
++	NOD(NAME, (S_IFREG | (MODE)), NULL,		\
++		&proc_vs_info_file_operations,		\
++		{ .proc_vs_read = &proc_##OTYPE } )
++
++#define VINF(NAME, MODE, OTYPE)				\
++	NOD(NAME, (S_IFREG | (MODE)), NULL,		\
++		&proc_vx_info_file_operations,		\
++		{ .proc_vxi_read = &proc_##OTYPE } )
++
++#define NINF(NAME, MODE, OTYPE)				\
++	NOD(NAME, (S_IFREG | (MODE)), NULL,		\
++		&proc_nx_info_file_operations,		\
++		{ .proc_nxi_read = &proc_##OTYPE } )
++
++
++static struct file_operations proc_vs_info_file_operations = {
++	.read =		proc_vs_info_read,
++};
++
++static struct file_operations proc_vx_info_file_operations = {
++	.read =		proc_vx_info_read,
++};
++
++static struct dentry_operations proc_xid_dentry_operations = {
++	.d_revalidate =	proc_xid_revalidate,
++};
++
++static struct vs_entry vx_base_stuff[] = {
++	VINF("info",	S_IRUGO, vxi_info),
++	VINF("status",	S_IRUGO, vxi_status),
++	VINF("limit",	S_IRUGO, vxi_limit),
++	VINF("sched",	S_IRUGO, vxi_sched),
++	VINF("nsproxy",	S_IRUGO, vxi_nsproxy),
++	VINF("cvirt",	S_IRUGO, vxi_cvirt),
++	VINF("cacct",	S_IRUGO, vxi_cacct),
++	{}
++};
++
++
++
++
++static struct dentry *proc_xid_instantiate(struct inode *dir,
++	struct dentry *dentry, int id, void *ptr)
++{
++	dentry->d_op = &proc_xid_dentry_operations;
++	return vs_proc_instantiate(dir, dentry, id, ptr);
++}
++
++static struct dentry *proc_xid_lookup(struct inode *dir,
++	struct dentry *dentry, struct nameidata *nd)
++{
++	struct vs_entry *p = vx_base_stuff;
++	struct dentry *error = ERR_PTR(-ENOENT);
++
++	for (; p->name; p++) {
++		if (p->len != dentry->d_name.len)
++			continue;
++		if (!memcmp(dentry->d_name.name, p->name, p->len))
++			break;
++	}
++	if (!p->name)
++		goto out;
++
++	error = proc_xid_instantiate(dir, dentry, PROC_I(dir)->fd, p);
++out:
++	return error;
++}
++
++static int proc_xid_readdir(struct file *filp,
++	void *dirent, filldir_t filldir)
++{
++	struct dentry *dentry = filp->f_dentry;
++	struct inode *inode = dentry->d_inode;
++	struct vs_entry *p = vx_base_stuff;
++	int size = sizeof(vx_base_stuff) / sizeof(struct vs_entry);
++	int pos, index;
++	u64 ino;
++
++	pos = filp->f_pos;
++	switch (pos) {
++	case 0:
++		ino = inode->i_ino;
++		if (filldir(dirent, ".", 1, pos, ino, DT_DIR) < 0)
++			goto out;
++		pos++;
++		/* fall through */
++	case 1:
++		ino = parent_ino(dentry);
++		if (filldir(dirent, "..", 2, pos, ino, DT_DIR) < 0)
++			goto out;
++		pos++;
++		/* fall through */
++	default:
++		index = pos - 2;
++		if (index >= size)
++			goto out;
++		for (p += index; p->name; p++) {
++			if (proc_fill_cache(filp, dirent, filldir, p->name, p->len,
++				vs_proc_instantiate, PROC_I(inode)->fd, p))
++				goto out;
++			pos++;
++		}
++	}
++out:
++	filp->f_pos = pos;
++	return 1;
++}
++
++
++
++static struct file_operations proc_nx_info_file_operations = {
++	.read =		proc_nx_info_read,
++};
++
++static struct dentry_operations proc_nid_dentry_operations = {
++	.d_revalidate =	proc_nid_revalidate,
++};
++
++static struct vs_entry nx_base_stuff[] = {
++	NINF("info",	S_IRUGO, nxi_info),
++	NINF("status",	S_IRUGO, nxi_status),
++	{}
++};
++
++
++static struct dentry *proc_nid_instantiate(struct inode *dir,
++	struct dentry *dentry, int id, void *ptr)
++{
++	dentry->d_op = &proc_nid_dentry_operations;
++	return vs_proc_instantiate(dir, dentry, id, ptr);
++}
++
++static struct dentry *proc_nid_lookup(struct inode *dir,
++	struct dentry *dentry, struct nameidata *nd)
++{
++	struct vs_entry *p = nx_base_stuff;
++	struct dentry *error = ERR_PTR(-ENOENT);
++
++	for (; p->name; p++) {
++		if (p->len != dentry->d_name.len)
++			continue;
++		if (!memcmp(dentry->d_name.name, p->name, p->len))
++			break;
++	}
++	if (!p->name)
++		goto out;
++
++	error = proc_nid_instantiate(dir, dentry, PROC_I(dir)->fd, p);
++out:
++	return error;
++}
++
++static int proc_nid_readdir(struct file *filp,
++	void *dirent, filldir_t filldir)
++{
++	struct dentry *dentry = filp->f_dentry;
++	struct inode *inode = dentry->d_inode;
++	struct vs_entry *p = nx_base_stuff;
++	int size = sizeof(nx_base_stuff) / sizeof(struct vs_entry);
++	int pos, index;
++	u64 ino;
++
++	pos = filp->f_pos;
++	switch (pos) {
++	case 0:
++		ino = inode->i_ino;
++		if (filldir(dirent, ".", 1, pos, ino, DT_DIR) < 0)
++			goto out;
++		pos++;
++		/* fall through */
++	case 1:
++		ino = parent_ino(dentry);
++		if (filldir(dirent, "..", 2, pos, ino, DT_DIR) < 0)
++			goto out;
++		pos++;
++		/* fall through */
++	default:
++		index = pos - 2;
++		if (index >= size)
++			goto out;
++		for (p += index; p->name; p++) {
++			if (proc_fill_cache(filp, dirent, filldir, p->name, p->len,
++				vs_proc_instantiate, PROC_I(inode)->fd, p))
++				goto out;
++			pos++;
++		}
++	}
++out:
++	filp->f_pos = pos;
++	return 1;
++}
++
++
++#define MAX_MULBY10	((~0U - 9) / 10)
++
++static inline int atovid(const char *str, int len)
++{
++	int vid, c;
++
++	vid = 0;
++	while (len-- > 0) {
++		c = *str - '0';
++		str++;
++		if (c > 9)
++			return -1;
++		if (vid >= MAX_MULBY10)
++			return -1;
++		vid *= 10;
++		vid += c;
++		if (!vid)
++			return -1;
++	}
++	return vid;
++}
++
++/* now the upper level (virtual) */
++
++
++static struct file_operations proc_xid_file_operations = {
++	.read =		generic_read_dir,
++	.readdir =	proc_xid_readdir,
++};
++
++static struct inode_operations proc_xid_inode_operations = {
++	.lookup =	proc_xid_lookup,
++};
++
++static struct vs_entry vx_virtual_stuff[] = {
++	INF("info",	S_IRUGO, virtual_info),
++	INF("status",	S_IRUGO, virtual_status),
++	DIR(NULL,	S_IRUGO | S_IXUGO, xid),
++};
++
++
++static struct dentry *proc_virtual_lookup(struct inode *dir,
++	struct dentry *dentry, struct nameidata *nd)
++{
++	struct vs_entry *p = vx_virtual_stuff;
++	struct dentry *error = ERR_PTR(-ENOENT);
++	int id = 0;
++
++	for (; p->name; p++) {
++		if (p->len != dentry->d_name.len)
++			continue;
++		if (!memcmp(dentry->d_name.name, p->name, p->len))
++			break;
++	}
++	if (p->name)
++		goto instantiate;
++
++	id = atovid(dentry->d_name.name, dentry->d_name.len);
++	if ((id < 0) || !xid_is_hashed(id))
++		goto out;
++
++instantiate:
++	error = proc_xid_instantiate(dir, dentry, id, p);
++out:
++	return error;
++}
++
++static struct file_operations proc_nid_file_operations = {
++	.read =		generic_read_dir,
++	.readdir =	proc_nid_readdir,
++};
++
++static struct inode_operations proc_nid_inode_operations = {
++	.lookup =	proc_nid_lookup,
++};
++
++static struct vs_entry nx_virtnet_stuff[] = {
++	INF("info",	S_IRUGO, virtnet_info),
++	INF("status",	S_IRUGO, virtnet_status),
++	DIR(NULL,	S_IRUGO | S_IXUGO, nid),
++};
++
++
++static struct dentry *proc_virtnet_lookup(struct inode *dir,
++	struct dentry *dentry, struct nameidata *nd)
++{
++	struct vs_entry *p = nx_virtnet_stuff;
++	struct dentry *error = ERR_PTR(-ENOENT);
++	int id = 0;
++
++	for (; p->name; p++) {
++		if (p->len != dentry->d_name.len)
++			continue;
++		if (!memcmp(dentry->d_name.name, p->name, p->len))
++			break;
++	}
++	if (p->name)
++		goto instantiate;
++
++	id = atovid(dentry->d_name.name, dentry->d_name.len);
++	if ((id < 0) || !nid_is_hashed(id))
++		goto out;
++
++instantiate:
++	error = proc_nid_instantiate(dir, dentry, id, p);
++out:
++	return error;
++}
++
++
++
++#define PROC_NUMBUF 10
++#define PROC_MAXVIDS 32
++
++int proc_virtual_readdir(struct file *filp,
++	void *dirent, filldir_t filldir)
++{
++	struct dentry *dentry = filp->f_dentry;
++	struct inode *inode = dentry->d_inode;
++	struct vs_entry *p = vx_virtual_stuff;
++	int size = sizeof(vx_virtual_stuff) / sizeof(struct vs_entry);
++	int pos, index;
++	unsigned int xid_array[PROC_MAXVIDS];
++	char buf[PROC_NUMBUF];
++	unsigned int nr_xids, i;
++	u64 ino;
++
++	pos = filp->f_pos;
++	switch (pos) {
++	case 0:
++		ino = inode->i_ino;
++		if (filldir(dirent, ".", 1, pos, ino, DT_DIR) < 0)
++			goto out;
++		pos++;
++		/* fall through */
++	case 1:
++		ino = parent_ino(dentry);
++		if (filldir(dirent, "..", 2, pos, ino, DT_DIR) < 0)
++			goto out;
++		pos++;
++		/* fall through */
++	default:
++		index = pos - 2;
++		if (index >= size)
++			goto entries;
++		for (p += index; p->name; p++) {
++			if (proc_fill_cache(filp, dirent, filldir, p->name, p->len,
++				vs_proc_instantiate, 0, p))
++				goto out;
++			pos++;
++		}
++	entries:
++		index = pos - size;
++		p = &vx_virtual_stuff[size - 1];
++		nr_xids = get_xid_list(index, xid_array, PROC_MAXVIDS);
++		for (i = 0; i < nr_xids; i++) {
++			int n, xid = xid_array[i];
++			unsigned int j = PROC_NUMBUF;
++
++			n = xid;
++			do
++				buf[--j] = '0' + (n % 10);
++			while (n /= 10);
++
++			if (proc_fill_cache(filp, dirent, filldir,
++				buf + j, PROC_NUMBUF - j,
++				vs_proc_instantiate, xid, p))
++				goto out;
++			pos++;
++		}
++	}
++out:
++	filp->f_pos = pos;
++	return 0;
++}
++
++static int proc_virtual_getattr(struct vfsmount *mnt,
++	struct dentry *dentry, struct kstat *stat)
++{
++	struct inode *inode = dentry->d_inode;
++
++	generic_fillattr(inode, stat);
++	stat->nlink = 2 + atomic_read(&vx_global_cactive);
++	return 0;
++}
++
++static struct file_operations proc_virtual_dir_operations = {
++	.read =		generic_read_dir,
++	.readdir =	proc_virtual_readdir,
++};
++
++static struct inode_operations proc_virtual_dir_inode_operations = {
++	.getattr =	proc_virtual_getattr,
++	.lookup =	proc_virtual_lookup,
++};
++
++
++
++
++
++int proc_virtnet_readdir(struct file *filp,
++	void *dirent, filldir_t filldir)
++{
++	struct dentry *dentry = filp->f_dentry;
++	struct inode *inode = dentry->d_inode;
++	struct vs_entry *p = nx_virtnet_stuff;
++	int size = sizeof(nx_virtnet_stuff) / sizeof(struct vs_entry);
++	int pos, index;
++	unsigned int nid_array[PROC_MAXVIDS];
++	char buf[PROC_NUMBUF];
++	unsigned int nr_nids, i;
++	u64 ino;
++
++	pos = filp->f_pos;
++	switch (pos) {
++	case 0:
++		ino = inode->i_ino;
++		if (filldir(dirent, ".", 1, pos, ino, DT_DIR) < 0)
++			goto out;
++		pos++;
++		/* fall through */
++	case 1:
++		ino = parent_ino(dentry);
++		if (filldir(dirent, "..", 2, pos, ino, DT_DIR) < 0)
++			goto out;
++		pos++;
++		/* fall through */
++	default:
++		index = pos - 2;
++		if (index >= size)
++			goto entries;
++		for (p += index; p->name; p++) {
++			if (proc_fill_cache(filp, dirent, filldir, p->name, p->len,
++				vs_proc_instantiate, 0, p))
++				goto out;
++			pos++;
++		}
++	entries:
++		index = pos - size;
++		p = &nx_virtnet_stuff[size - 1];
++		nr_nids = get_nid_list(index, nid_array, PROC_MAXVIDS);
++		for (i = 0; i < nr_nids; i++) {
++			int n, nid = nid_array[i];
++			unsigned int j = PROC_NUMBUF;
++
++			n = nid;
++			do
++				buf[--j] = '0' + (n % 10);
++			while (n /= 10);
++
++			if (proc_fill_cache(filp, dirent, filldir,
++				buf + j, PROC_NUMBUF - j,
++				vs_proc_instantiate, nid, p))
++				goto out;
++			pos++;
++		}
++	}
++out:
++	filp->f_pos = pos;
++	return 0;
++}
++
++static int proc_virtnet_getattr(struct vfsmount *mnt,
++	struct dentry *dentry, struct kstat *stat)
++{
++	struct inode *inode = dentry->d_inode;
++
++	generic_fillattr(inode, stat);
++	stat->nlink = 2 + atomic_read(&nx_global_cactive);
++	return 0;
++}
++
++static struct file_operations proc_virtnet_dir_operations = {
++	.read =		generic_read_dir,
++	.readdir =	proc_virtnet_readdir,
++};
++
++static struct inode_operations proc_virtnet_dir_inode_operations = {
++	.getattr = 	proc_virtnet_getattr,
++	.lookup =	proc_virtnet_lookup,
++};
++
++
++
++void proc_vx_init(void)
++{
++	struct proc_dir_entry *ent;
++
++	ent = proc_mkdir("virtual", 0);
++	if (ent) {
++		ent->proc_fops = &proc_virtual_dir_operations;
++		ent->proc_iops = &proc_virtual_dir_inode_operations;
++	}
++	proc_virtual = ent;
++
++	ent = proc_mkdir("virtnet", 0);
++	if (ent) {
++		ent->proc_fops = &proc_virtnet_dir_operations;
++		ent->proc_iops = &proc_virtnet_dir_inode_operations;
++	}
++	proc_virtnet = ent;
++}
++
++
++
++
++/* per pid info */
++
++
++int proc_pid_vx_info(struct task_struct *p, char *buffer)
++{
++	struct vx_info *vxi;
++	char *orig = buffer;
++
++	buffer += sprintf(buffer, "XID:\t%d\n", vx_task_xid(p));
++
++	vxi = task_get_vx_info(p);
++	if (!vxi)
++		goto out;
++
++	buffer += sprintf(buffer, "BCaps:\t%016llx\n",
++		(unsigned long long)vxi->vx_bcaps);
++	buffer += sprintf(buffer, "CCaps:\t%016llx\n",
++		(unsigned long long)vxi->vx_ccaps);
++	buffer += sprintf(buffer, "CFlags:\t%016llx\n",
++		(unsigned long long)vxi->vx_flags);
++	buffer += sprintf(buffer, "CIPid:\t%d\n", vxi->vx_initpid);
++
++	put_vx_info(vxi);
++out:
++	return buffer - orig;
++}
++
++
++int proc_pid_nx_info(struct task_struct *p, char *buffer)
++{
++	struct nx_info *nxi;
++	char *orig = buffer;
++	int i;
++
++	buffer += sprintf(buffer, "NID:\t%d\n", nx_task_nid(p));
++
++	nxi = task_get_nx_info(p);
++	if (!nxi)
++		goto out;
++
++	buffer += sprintf(buffer, "NCaps:\t%016llx\n",
++		(unsigned long long)nxi->nx_ncaps);
++	buffer += sprintf(buffer, "NFlags:\t%016llx\n",
++		(unsigned long long)nxi->nx_flags);
++
++	for (i = 0; i < nxi->nbipv4; i++){
++		buffer += sprintf(buffer,
++			"V4Root[%d]:\t" NIPQUAD_FMT "/" NIPQUAD_FMT "\n", i,
++			NIPQUAD(nxi->ipv4[i]),
++			NIPQUAD(nxi->mask[i]));
++	}
++	buffer += sprintf(buffer,
++		"V4Root[bcast]:\t" NIPQUAD_FMT "\n",
++		NIPQUAD(nxi->v4_bcast));
++
++	put_nx_info(nxi);
++out:
++	return buffer - orig;
++}
++
+--- linux-2.6.22/kernel/vserver/sched.c	1970-01-01 01:00:00 +0100
++++ linux-2.6.22-vs2.2.0-rc5/kernel/vserver/sched.c	2007-06-15 02:37:04 +0200
+@@ -0,0 +1,447 @@
++/*
++ *  linux/kernel/vserver/sched.c
++ *
++ *  Virtual Server: Scheduler Support
++ *
++ *  Copyright (C) 2004-2007  Herbert Pötzl
++ *
++ *  V0.01  adapted Sam Vilains version to 2.6.3
++ *  V0.02  removed legacy interface
++ *  V0.03  changed vcmds to vxi arg
++ *
++ */
++
++#include <linux/sched.h>
++#include <linux/vs_context.h>
++#include <linux/vs_sched.h>
++#include <linux/vserver/sched_cmd.h>
++
++#include <asm/errno.h>
++#include <asm/uaccess.h>
++
++#define vxd_check_range(val, min, max) do {		\
++	vxlprintk((val < min) || (val > max),		\
++		"check_range(%ld,%ld,%ld)",		\
++		(long)val, (long)min, (long)max,	\
++		__FILE__, __LINE__);			\
++	} while (0)
++
++
++void vx_update_sched_param(struct _vx_sched *sched,
++	struct _vx_sched_pc *sched_pc)
++{
++	unsigned int set_mask = sched->update_mask;
++
++	if (set_mask & VXSM_FILL_RATE)
++		sched_pc->fill_rate[0] = sched->fill_rate[0];
++	if (set_mask & VXSM_INTERVAL)
++		sched_pc->interval[0] = sched->interval[0];
++	if (set_mask & VXSM_FILL_RATE2)
++		sched_pc->fill_rate[1] = sched->fill_rate[1];
++	if (set_mask & VXSM_INTERVAL2)
++		sched_pc->interval[1] = sched->interval[1];
++	if (set_mask & VXSM_TOKENS)
++		sched_pc->tokens = sched->tokens;
++	if (set_mask & VXSM_TOKENS_MIN)
++		sched_pc->tokens_min = sched->tokens_min;
++	if (set_mask & VXSM_TOKENS_MAX)
++		sched_pc->tokens_max = sched->tokens_max;
++	if (set_mask & VXSM_PRIO_BIAS)
++		sched_pc->prio_bias = sched->prio_bias;
++
++	if (set_mask & VXSM_IDLE_TIME)
++		sched_pc->flags |= VXSF_IDLE_TIME;
++	else
++		sched_pc->flags &= ~VXSF_IDLE_TIME;
++
++	/* reset time */
++	sched_pc->norm_time = jiffies;
++}
++
++
++/*
++ * recalculate the context's scheduling tokens
++ *
++ * ret > 0 : number of tokens available
++ * ret < 0 : on hold, check delta_min[]
++ *	     -1 only jiffies
++ *	     -2 also idle time
++ *
++ */
++int vx_tokens_recalc(struct _vx_sched_pc *sched_pc,
++	unsigned long *norm_time, unsigned long *idle_time, int delta_min[2])
++{
++	long delta;
++	long tokens = 0;
++	int flags = sched_pc->flags;
++
++	/* how much time did pass? */
++	delta = *norm_time - sched_pc->norm_time;
++	vxd_check_range(delta, 0, INT_MAX);
++
++	if (delta >= sched_pc->interval[0]) {
++		long tokens, integral;
++
++		/* calc integral token part */
++		tokens = delta / sched_pc->interval[0];
++		integral = tokens * sched_pc->interval[0];
++		tokens *= sched_pc->fill_rate[0];
++#ifdef	CONFIG_VSERVER_HARDCPU
++		delta_min[0] = delta - integral;
++		vxd_check_range(delta_min[0], 0, sched_pc->interval[0]);
++#endif
++		/* advance time */
++		sched_pc->norm_time += delta;
++
++		/* add tokens */
++		sched_pc->tokens += tokens;
++		sched_pc->token_time += tokens;
++	} else
++		delta_min[0] = delta;
++
++#ifdef	CONFIG_VSERVER_IDLETIME
++	if (!(flags & VXSF_IDLE_TIME))
++		goto skip_idle;
++
++	/* how much was the idle skip? */
++	delta = *idle_time - sched_pc->idle_time;
++	vxd_check_range(delta, 0, INT_MAX);
++
++	if (delta >= sched_pc->interval[1]) {
++		long tokens, integral;
++
++		/* calc fair share token part */
++		tokens = delta / sched_pc->interval[1];
++		integral = tokens * sched_pc->interval[1];
++		tokens *= sched_pc->fill_rate[1];
++		delta_min[1] = delta - integral;
++		vxd_check_range(delta_min[1], 0, sched_pc->interval[1]);
++
++		/* advance idle time */
++		sched_pc->idle_time += integral;
++
++		/* add tokens */
++		sched_pc->tokens += tokens;
++		sched_pc->token_time += tokens;
++	} else
++		delta_min[1] = delta;
++skip_idle:
++#endif
++
++	/* clip at maximum */
++	if (sched_pc->tokens > sched_pc->tokens_max)
++		sched_pc->tokens = sched_pc->tokens_max;
++	tokens = sched_pc->tokens;
++
++	if ((flags & VXSF_ONHOLD)) {
++		/* can we unhold? */
++		if (tokens >= sched_pc->tokens_min) {
++			flags &= ~VXSF_ONHOLD;
++			sched_pc->hold_ticks +=
++				*norm_time - sched_pc->onhold;
++		} else
++			goto on_hold;
++	} else {
++		/* put on hold? */
++		if (tokens <= 0) {
++			flags |= VXSF_ONHOLD;
++			sched_pc->onhold = *norm_time;
++			goto on_hold;
++		}
++	}
++	sched_pc->flags = flags;
++	return tokens;
++
++on_hold:
++	tokens = sched_pc->tokens_min - tokens;
++	sched_pc->flags = flags;
++	BUG_ON(tokens < 0);
++
++#ifdef	CONFIG_VSERVER_HARDCPU
++	/* next interval? */
++	if (!sched_pc->fill_rate[0])
++		delta_min[0] = HZ;
++	else if (tokens > sched_pc->fill_rate[0])
++		delta_min[0] += sched_pc->interval[0] *
++			tokens / sched_pc->fill_rate[0];
++	else
++		delta_min[0] = sched_pc->interval[0] - delta_min[0];
++	vxd_check_range(delta_min[0], 0, INT_MAX);
++
++#ifdef	CONFIG_VSERVER_IDLETIME
++	if (!(flags & VXSF_IDLE_TIME))
++		return -1;
++
++	/* next interval? */
++	if (!sched_pc->fill_rate[1])
++		delta_min[1] = HZ;
++	else if (tokens > sched_pc->fill_rate[1])
++		delta_min[1] += sched_pc->interval[1] *
++			tokens / sched_pc->fill_rate[1];
++	else
++		delta_min[1] = sched_pc->interval[1] - delta_min[1];
++	vxd_check_range(delta_min[1], 0, INT_MAX);
++
++	return -2;
++#else
++	return -1;
++#endif /* CONFIG_VSERVER_IDLETIME */
++#else
++	return 0;
++#endif /* CONFIG_VSERVER_HARDCPU */
++}
++
++static inline unsigned long msec_to_ticks(unsigned long msec)
++{
++	return msecs_to_jiffies(msec);
++}
++
++static inline unsigned long ticks_to_msec(unsigned long ticks)
++{
++	return jiffies_to_msecs(ticks);
++}
++
++static inline unsigned long ticks_to_usec(unsigned long ticks)
++{
++	return jiffies_to_usecs(ticks);
++}
++
++
++static int do_set_sched(struct vx_info *vxi, struct vcmd_sched_v5 *data)
++{
++	unsigned int set_mask = data->mask;
++	unsigned int update_mask;
++	int i, cpu;
++
++	/* Sanity check data values */
++	if (data->tokens_max <= 0)
++		data->tokens_max = HZ;
++	if (data->tokens_min < 0)
++		data->tokens_min = HZ / 3;
++	if (data->tokens_min >= data->tokens_max)
++		data->tokens_min = data->tokens_max;
++
++	if (data->prio_bias > MAX_PRIO_BIAS)
++		data->prio_bias = MAX_PRIO_BIAS;
++	if (data->prio_bias < MIN_PRIO_BIAS)
++		data->prio_bias = MIN_PRIO_BIAS;
++
++	spin_lock(&vxi->sched.tokens_lock);
++
++	/* sync up on delayed updates */
++	for_each_cpu_mask(cpu, vxi->sched.update)
++		vx_update_sched_param(&vxi->sched,
++			&vx_per_cpu(vxi, sched_pc, cpu));
++
++	if (set_mask & VXSM_FILL_RATE)
++		vxi->sched.fill_rate[0] = data->fill_rate[0];
++	if (set_mask & VXSM_FILL_RATE2)
++		vxi->sched.fill_rate[1] = data->fill_rate[1];
++	if (set_mask & VXSM_INTERVAL)
++		vxi->sched.interval[0] = (set_mask & VXSM_MSEC) ?
++			msec_to_ticks(data->interval[0]) : data->interval[0];
++	if (set_mask & VXSM_INTERVAL2)
++		vxi->sched.interval[1] = (set_mask & VXSM_MSEC) ?
++			msec_to_ticks(data->interval[1]) : data->interval[1];
++	if (set_mask & VXSM_TOKENS)
++		vxi->sched.tokens = data->tokens;
++	if (set_mask & VXSM_TOKENS_MIN)
++		vxi->sched.tokens_min = data->tokens_min;
++	if (set_mask & VXSM_TOKENS_MAX)
++		vxi->sched.tokens_max = data->tokens_max;
++	if (set_mask & VXSM_PRIO_BIAS)
++		vxi->sched.prio_bias = data->prio_bias;
++
++	/* Sanity check rate/interval */
++	for (i = 0; i < 2; i++) {
++		if (data->fill_rate[i] < 0)
++			data->fill_rate[i] = 0;
++		if (data->interval[i] <= 0)
++			data->interval[i] = HZ;
++	}
++
++	update_mask = vxi->sched.update_mask & VXSM_SET_MASK;
++	update_mask |= (set_mask & (VXSM_SET_MASK | VXSM_IDLE_TIME));
++	vxi->sched.update_mask = update_mask;
++#ifdef	CONFIG_SMP
++	rmb();
++	if (set_mask & VXSM_CPU_ID) {
++		vxi->sched.update = cpumask_of_cpu(data->cpu_id);
++		cpus_and(vxi->sched.update, cpu_online_map,
++			vxi->sched.update);
++	} else
++		vxi->sched.update = cpu_online_map;
++
++	/* forced reload? */
++	if (set_mask & VXSM_FORCE) {
++		for_each_cpu_mask(cpu, vxi->sched.update)
++			vx_update_sched_param(&vxi->sched,
++				&vx_per_cpu(vxi, sched_pc, cpu));
++		vxi->sched.update = CPU_MASK_NONE;
++	}
++#else
++	/* on UP we update immediately */
++	vx_update_sched_param(&vxi->sched,
++		&vx_per_cpu(vxi, sched_pc, 0));
++#endif
++
++	spin_unlock(&vxi->sched.tokens_lock);
++	return 0;
++}
++
++#define COPY_IDS(C) C(cpu_id); C(bucket_id)
++#define COPY_PRI(C) C(prio_bias)
++#define COPY_TOK(C) C(tokens); C(tokens_min); C(tokens_max)
++#define COPY_FRI(C) C(fill_rate[0]); C(interval[0]);	\
++		    C(fill_rate[1]); C(interval[1]);
++
++#define COPY_VALUE(name) vc_data.name = data->name
++
++static int do_set_sched_v4(struct vx_info *vxi, struct vcmd_set_sched_v4 *data)
++{
++	struct vcmd_sched_v5 vc_data;
++
++	vc_data.mask = data->set_mask;
++	COPY_IDS(COPY_VALUE);
++	COPY_PRI(COPY_VALUE);
++	COPY_TOK(COPY_VALUE);
++	vc_data.fill_rate[0] = vc_data.fill_rate[1] = data->fill_rate;
++	vc_data.interval[0] = vc_data.interval[1] = data->interval;
++	return do_set_sched(vxi, &vc_data);
++}
++
++#ifdef	CONFIG_VSERVER_LEGACY
++
++#define COPY_MASK_V2(name, mask)			\
++	if (vc_data.name != SCHED_KEEP) {		\
++		vc_data_v4.name = vc_data.name;		\
++		vc_data_v4.set_mask |= mask;		\
++	}
++
++int vc_set_sched_v2(struct vx_info *vxi, void __user *data)
++{
++	struct vcmd_set_sched_v2 vc_data;
++	struct vcmd_set_sched_v4 vc_data_v4 = { .set_mask = 0 };
++
++	if (copy_from_user(&vc_data, data, sizeof(vc_data)))
++		return -EFAULT;
++
++	COPY_MASK_V2(fill_rate,	 VXSM_FILL_RATE);
++	COPY_MASK_V2(interval,	 VXSM_INTERVAL);
++	COPY_MASK_V2(tokens,	 VXSM_TOKENS);
++	COPY_MASK_V2(tokens_min, VXSM_TOKENS_MIN);
++	COPY_MASK_V2(tokens_max, VXSM_TOKENS_MAX);
++	vc_data_v4.bucket_id = 0;
++
++	do_set_sched_v4(vxi, &vc_data_v4);
++	return 0;
++}
++#endif
++
++int vc_set_sched_v3(struct vx_info *vxi, void __user *data)
++{
++	struct vcmd_set_sched_v3 vc_data;
++	struct vcmd_set_sched_v4 vc_data_v4;
++
++	if (copy_from_user(&vc_data, data, sizeof(vc_data)))
++		return -EFAULT;
++
++	/* structures are binary compatible */
++	memcpy(&vc_data_v4, &vc_data, sizeof(vc_data));
++	vc_data_v4.set_mask &= VXSM_V3_MASK;
++	vc_data_v4.bucket_id = 0;
++
++	return do_set_sched_v4(vxi, &vc_data_v4);
++}
++
++int vc_set_sched_v4(struct vx_info *vxi, void __user *data)
++{
++	struct vcmd_set_sched_v4 vc_data;
++
++	if (copy_from_user(&vc_data, data, sizeof(vc_data)))
++		return -EFAULT;
++
++	return do_set_sched_v4(vxi, &vc_data);
++}
++
++	/* latest interface is v5 */
++
++int vc_set_sched(struct vx_info *vxi, void __user *data)
++{
++	struct vcmd_sched_v5 vc_data;
++
++	if (copy_from_user(&vc_data, data, sizeof(vc_data)))
++		return -EFAULT;
++
++	return do_set_sched(vxi, &vc_data);
++}
++
++
++int vc_get_sched(struct vx_info *vxi, void __user *data)
++{
++	struct vcmd_sched_v5 vc_data;
++
++	if (copy_from_user(&vc_data, data, sizeof(vc_data)))
++		return -EFAULT;
++
++	if (vc_data.mask & VXSM_CPU_ID) {
++		int cpu = vc_data.cpu_id;
++		struct _vx_sched_pc *data;
++
++		if (!cpu_possible(cpu))
++			return -EINVAL;
++
++		data = &vx_per_cpu(vxi, sched_pc, cpu);
++		COPY_TOK(COPY_VALUE);
++		COPY_PRI(COPY_VALUE);
++		COPY_FRI(COPY_VALUE);
++
++		if (data->flags & VXSF_IDLE_TIME)
++			vc_data.mask |= VXSM_IDLE_TIME;
++	} else {
++		struct _vx_sched *data = &vxi->sched;
++
++		COPY_TOK(COPY_VALUE);
++		COPY_PRI(COPY_VALUE);
++		COPY_FRI(COPY_VALUE);
++	}
++
++	if (vc_data.mask & VXSM_MSEC) {
++		vc_data.interval[0] = ticks_to_msec(vc_data.interval[0]);
++		vc_data.interval[1] = ticks_to_msec(vc_data.interval[1]);
++	}
++
++	if (copy_to_user(data, &vc_data, sizeof(vc_data)))
++		return -EFAULT;
++	return 0;
++}
++
++
++int vc_sched_info(struct vx_info *vxi, void __user *data)
++{
++	struct vcmd_sched_info vc_data;
++	int cpu;
++
++	if (copy_from_user(&vc_data, data, sizeof(vc_data)))
++		return -EFAULT;
++
++	cpu = vc_data.cpu_id;
++	if (!cpu_possible(cpu))
++		return -EINVAL;
++
++	if (vxi) {
++		struct _vx_sched_pc *sched_pc =
++			&vx_per_cpu(vxi, sched_pc, cpu);
++
++		vc_data.user_msec = ticks_to_msec(sched_pc->user_ticks);
++		vc_data.sys_msec = ticks_to_msec(sched_pc->sys_ticks);
++		vc_data.hold_msec = ticks_to_msec(sched_pc->hold_ticks);
++		vc_data.vavavoom = sched_pc->vavavoom;
++	}
++	vc_data.token_usec = ticks_to_usec(1);
++
++	if (copy_to_user(data, &vc_data, sizeof(vc_data)))
++		return -EFAULT;
++	return 0;
++}
++
+--- linux-2.6.22/kernel/vserver/sched_init.h	1970-01-01 01:00:00 +0100
++++ linux-2.6.22-vs2.2.0-rc5/kernel/vserver/sched_init.h	2007-06-15 02:37:04 +0200
+@@ -0,0 +1,50 @@
++
++static inline void vx_info_init_sched(struct _vx_sched *sched)
++{
++	static struct lock_class_key tokens_lock_key;
++
++	/* scheduling; hard code starting values as constants */
++	sched->fill_rate[0]	= 1;
++	sched->interval[0]	= 4;
++	sched->fill_rate[1]	= 1;
++	sched->interval[1]	= 8;
++	sched->tokens		= HZ >> 2;
++	sched->tokens_min	= HZ >> 4;
++	sched->tokens_max	= HZ >> 1;
++	sched->tokens_lock	= SPIN_LOCK_UNLOCKED;
++	sched->prio_bias	= 0;
++
++	lockdep_set_class(&sched->tokens_lock, &tokens_lock_key);
++}
++
++static inline
++void vx_info_init_sched_pc(struct _vx_sched_pc *sched_pc, int cpu)
++{
++	sched_pc->fill_rate[0]	= 1;
++	sched_pc->interval[0]	= 4;
++	sched_pc->fill_rate[1]	= 1;
++	sched_pc->interval[1]	= 8;
++	sched_pc->tokens	= HZ >> 2;
++	sched_pc->tokens_min	= HZ >> 4;
++	sched_pc->tokens_max	= HZ >> 1;
++	sched_pc->prio_bias	= 0;
++	sched_pc->vavavoom	= 0;
++	sched_pc->token_time	= 0;
++	sched_pc->idle_time	= 0;
++	sched_pc->norm_time	= jiffies;
++
++	sched_pc->user_ticks = 0;
++	sched_pc->sys_ticks = 0;
++	sched_pc->hold_ticks = 0;
++}
++
++static inline void vx_info_exit_sched(struct _vx_sched *sched)
++{
++	return;
++}
++
++static inline
++void vx_info_exit_sched_pc(struct _vx_sched_pc *sched_pc, int cpu)
++{
++	return;
++}
+--- linux-2.6.22/kernel/vserver/sched_proc.h	1970-01-01 01:00:00 +0100
++++ linux-2.6.22-vs2.2.0-rc5/kernel/vserver/sched_proc.h	2007-06-15 02:37:04 +0200
+@@ -0,0 +1,57 @@
++#ifndef _VX_SCHED_PROC_H
++#define _VX_SCHED_PROC_H
++
++
++static inline
++int vx_info_proc_sched(struct _vx_sched *sched, char *buffer)
++{
++	int length = 0;
++
++	length += sprintf(buffer,
++		"FillRate:\t%8d,%d\n"
++		"Interval:\t%8d,%d\n"
++		"TokensMin:\t%8d\n"
++		"TokensMax:\t%8d\n"
++		"PrioBias:\t%8d\n",
++		sched->fill_rate[0],
++		sched->fill_rate[1],
++		sched->interval[0],
++		sched->interval[1],
++		sched->tokens_min,
++		sched->tokens_max,
++		sched->prio_bias);
++	return length;
++}
++
++static inline
++int vx_info_proc_sched_pc(struct _vx_sched_pc *sched_pc,
++	char *buffer, int cpu)
++{
++	int length = 0;
++
++	length += sprintf(buffer + length,
++		"cpu %d: %lld %lld %lld %ld %ld", cpu,
++		(unsigned long long)sched_pc->user_ticks,
++		(unsigned long long)sched_pc->sys_ticks,
++		(unsigned long long)sched_pc->hold_ticks,
++		sched_pc->token_time,
++		sched_pc->idle_time);
++	length += sprintf(buffer + length,
++		" %c%c %d %d %d %d/%d %d/%d",
++		(sched_pc->flags & VXSF_ONHOLD) ? 'H' : 'R',
++		(sched_pc->flags & VXSF_IDLE_TIME) ? 'I' : '-',
++		sched_pc->tokens,
++		sched_pc->tokens_min,
++		sched_pc->tokens_max,
++		sched_pc->fill_rate[0],
++		sched_pc->interval[0],
++		sched_pc->fill_rate[1],
++		sched_pc->interval[1]);
++	length += sprintf(buffer + length,
++		" %d %d\n",
++		sched_pc->prio_bias,
++		sched_pc->vavavoom);
++	return length;
++}
++
++#endif	/* _VX_SCHED_PROC_H */
+--- linux-2.6.22/kernel/vserver/signal.c	1970-01-01 01:00:00 +0100
++++ linux-2.6.22-vs2.2.0-rc5/kernel/vserver/signal.c	2007-06-15 02:37:04 +0200
+@@ -0,0 +1,134 @@
++/*
++ *  linux/kernel/vserver/signal.c
++ *
++ *  Virtual Server: Signal Support
++ *
++ *  Copyright (C) 2003-2007  Herbert Pötzl
++ *
++ *  V0.01  broken out from vcontext V0.05
++ *  V0.02  changed vcmds to vxi arg
++ *  V0.03  adjusted siginfo for kill
++ *
++ */
++
++#include <linux/sched.h>
++
++#include <asm/errno.h>
++#include <asm/uaccess.h>
++
++#include <linux/vs_context.h>
++#include <linux/vserver/signal_cmd.h>
++
++
++int vx_info_kill(struct vx_info *vxi, int pid, int sig)
++{
++	int retval, count = 0;
++	struct task_struct *p;
++	struct siginfo *sip = SEND_SIG_PRIV;
++
++	retval = -ESRCH;
++	vxdprintk(VXD_CBIT(misc, 4),
++		"vx_info_kill(%p[#%d],%d,%d)*",
++		vxi, vxi->vx_id, pid, sig);
++	read_lock(&tasklist_lock);
++	switch (pid) {
++	case  0:
++	case -1:
++		for_each_process(p) {
++			int err = 0;
++
++			if (vx_task_xid(p) != vxi->vx_id || p->pid <= 1 ||
++				(pid && vxi->vx_initpid == p->pid))
++				continue;
++
++			err = group_send_sig_info(sig, sip, p);
++			++count;
++			if (err != -EPERM)
++				retval = err;
++		}
++		break;
++
++	case 1:
++		if (vxi->vx_initpid) {
++			pid = vxi->vx_initpid;
++			/* for now, only SIGINT to private init ... */
++			if (!vx_info_flags(vxi, VXF_STATE_ADMIN, 0) &&
++				/* ... as long as there are tasks left */
++				(atomic_read(&vxi->vx_tasks) > 1))
++				sig = SIGINT;
++		}
++		/* fallthrough */
++	default:
++		p = find_task_by_real_pid(pid);
++		if (p) {
++			if (vx_task_xid(p) == vxi->vx_id)
++				retval = group_send_sig_info(sig, sip, p);
++		}
++		break;
++	}
++	read_unlock(&tasklist_lock);
++	vxdprintk(VXD_CBIT(misc, 4),
++		"vx_info_kill(%p[#%d],%d,%d,%ld) = %d",
++		vxi, vxi->vx_id, pid, sig, (long)sip, retval);
++	return retval;
++}
++
++int vc_ctx_kill(struct vx_info *vxi, void __user *data)
++{
++	struct vcmd_ctx_kill_v0 vc_data;
++
++	if (copy_from_user(&vc_data, data, sizeof(vc_data)))
++		return -EFAULT;
++
++	/* special check to allow guest shutdown */
++	if (!vx_info_flags(vxi, VXF_STATE_ADMIN, 0) &&
++		/* forbid killall pid=0 when init is present */
++		(((vc_data.pid < 1) && vxi->vx_initpid) ||
++		(vc_data.pid > 1)))
++		return -EACCES;
++
++	return vx_info_kill(vxi, vc_data.pid, vc_data.sig);
++}
++
++
++static int __wait_exit(struct vx_info *vxi)
++{
++	DECLARE_WAITQUEUE(wait, current);
++	int ret = 0;
++
++	add_wait_queue(&vxi->vx_wait, &wait);
++	set_current_state(TASK_INTERRUPTIBLE);
++
++wait:
++	if (vx_info_state(vxi,
++		VXS_SHUTDOWN | VXS_HASHED | VXS_HELPER) == VXS_SHUTDOWN)
++		goto out;
++	if (signal_pending(current)) {
++		ret = -ERESTARTSYS;
++		goto out;
++	}
++	schedule();
++	goto wait;
++
++out:
++	set_current_state(TASK_RUNNING);
++	remove_wait_queue(&vxi->vx_wait, &wait);
++	return ret;
++}
++
++
++
++int vc_wait_exit(struct vx_info *vxi, void __user *data)
++{
++	struct vcmd_wait_exit_v0 vc_data;
++	int ret;
++
++	ret = __wait_exit(vxi);
++	vc_data.reboot_cmd = vxi->reboot_cmd;
++	vc_data.exit_code = vxi->exit_code;
++
++	if (copy_to_user(data, &vc_data, sizeof(vc_data)))
++		ret = -EFAULT;
++	return ret;
++}
++
+--- linux-2.6.22/kernel/vserver/space.c	1970-01-01 01:00:00 +0100
++++ linux-2.6.22-vs2.2.0-rc5/kernel/vserver/space.c	2007-06-16 19:12:02 +0200
+@@ -0,0 +1,281 @@
++/*
++ *  linux/kernel/vserver/space.c
++ *
++ *  Virtual Server: Context Space Support
++ *
++ *  Copyright (C) 2003-2007  Herbert Pötzl
++ *
++ *  V0.01  broken out from context.c 0.07
++ *  V0.02  added task locking for namespace
++ *  V0.03  broken out vx_enter_namespace
++ *  V0.04  added *space support and commands
++ *
++ */
++
++#include <linux/utsname.h>
++#include <linux/sched.h>
++#include <linux/vs_context.h>
++#include <linux/vserver/space.h>
++#include <linux/vserver/space_cmd.h>
++#include <linux/dcache.h>
++#include <linux/mount.h>
++#include <linux/nsproxy.h>
++#include <linux/fs.h>
++
++#include <asm/errno.h>
++#include <asm/uaccess.h>
++
++
++atomic_t vs_global_nsproxy	= ATOMIC_INIT(0);
++atomic_t vs_global_fs		= ATOMIC_INIT(0);
++atomic_t vs_global_mnt_ns	= ATOMIC_INIT(0);
++atomic_t vs_global_uts_ns	= ATOMIC_INIT(0);
++atomic_t vs_global_ipc_ns	= ATOMIC_INIT(0);
++
++
++/* namespace functions */
++
++#include <linux/mnt_namespace.h>
++
++const struct vcmd_space_mask space_mask = {
++	.mask = CLONE_NEWNS |
++		CLONE_NEWUTS |
++		CLONE_NEWIPC |
++		CLONE_FS
++};
++
++
++/*
++ *	build a new nsproxy mix
++ *      assumes that both proxies are 'const'
++ *	does not touch nsproxy refcounts
++ *	will hold a reference on the result.
++ */
++
++struct nsproxy *vs_mix_nsproxy(struct nsproxy *old_nsproxy,
++	struct nsproxy *new_nsproxy, unsigned long mask)
++{
++	struct mnt_namespace *old_ns;
++	struct uts_namespace *old_uts;
++	struct ipc_namespace *old_ipc;
++	struct nsproxy *nsproxy;
++
++	nsproxy = copy_nsproxy(old_nsproxy);
++	if (!nsproxy)
++		goto out;
++
++	if (mask & CLONE_NEWNS) {
++		old_ns = nsproxy->mnt_ns;
++		nsproxy->mnt_ns = new_nsproxy->mnt_ns;
++		if (nsproxy->mnt_ns)
++			get_mnt_ns(nsproxy->mnt_ns);
++	} else
++		old_ns = NULL;
++
++	if (mask & CLONE_NEWUTS) {
++		old_uts = nsproxy->uts_ns;
++		nsproxy->uts_ns = new_nsproxy->uts_ns;
++		if (nsproxy->uts_ns)
++			get_uts_ns(nsproxy->uts_ns);
++	} else
++		old_uts = NULL;
++
++	if (mask & CLONE_NEWIPC) {
++		old_ipc = nsproxy->ipc_ns;
++		nsproxy->ipc_ns = new_nsproxy->ipc_ns;
++		if (nsproxy->ipc_ns)
++			get_ipc_ns(nsproxy->ipc_ns);
++	} else
++		old_ipc = NULL;
++
++	if (old_ns)
++		put_mnt_ns(old_ns);
++	if (old_uts)
++		put_uts_ns(old_uts);
++	if (old_ipc)
++		put_ipc_ns(old_ipc);
++out:
++	return nsproxy;
++}
++
++
++/*
++ *	merge two nsproxy structs into a new one.
++ *	will hold a reference on the result.
++ */
++
++static inline
++struct nsproxy *__vs_merge_nsproxy(struct nsproxy *old,
++	struct nsproxy *proxy, unsigned long mask)
++{
++	struct nsproxy null_proxy = { .mnt_ns = NULL };
++
++	if (!proxy)
++		return NULL;
++
++	if (mask) {
++		/* vs_mix_nsproxy returns with reference */
++		return vs_mix_nsproxy(old ? old : &null_proxy,
++			proxy, mask);
++	}
++	get_nsproxy(proxy);
++	return proxy;
++}
++
++/*
++ *	merge two fs structs into a new one.
++ *	will take a reference on the result.
++ */
++
++static inline
++struct fs_struct *__vs_merge_fs(struct fs_struct *old,
++	struct fs_struct *fs, unsigned long mask)
++{
++	if (!(mask & CLONE_FS)) {
++		if (old)
++			atomic_inc(&old->count);
++		return old;
++	}
++
++	if (!fs)
++		return NULL;
++
++	return copy_fs_struct(fs);
++}
++
++
++int vx_enter_space(struct vx_info *vxi, unsigned long mask)
++{
++	struct nsproxy *proxy, *proxy_cur, *proxy_new;
++	struct fs_struct *fs, *fs_cur, *fs_new;
++	int ret;
++
++	if (vx_info_flags(vxi, VXF_INFO_PRIVATE, 0))
++		return -EACCES;
++
++	if (!mask)
++		mask = vxi->vx_nsmask;
++
++	if ((mask & vxi->vx_nsmask) != mask)
++		return -EINVAL;
++
++	proxy = vxi->vx_nsproxy;
++	fs = vxi->vx_fs;
++
++	task_lock(current);
++	fs_cur = current->fs;
++	atomic_inc(&fs_cur->count);
++	proxy_cur = current->nsproxy;
++	get_nsproxy(proxy_cur);
++	task_unlock(current);
++
++	fs_new = __vs_merge_fs(fs_cur, fs, mask);
++	if (IS_ERR(fs_new)) {
++		ret = PTR_ERR(fs_new);
++		goto out_put;
++	}
++
++	proxy_new = __vs_merge_nsproxy(proxy_cur, proxy, mask);
++	if (IS_ERR(proxy_new)) {
++		ret = PTR_ERR(proxy_new);
++		goto out_put_fs;
++	}
++
++	fs_new = xchg(&current->fs, fs_new);
++	proxy_new = xchg(&current->nsproxy, proxy_new);
++	ret = 0;
++
++	if (proxy_new)
++		put_nsproxy(proxy_new);
++out_put_fs:
++	if (fs_new)
++		put_fs_struct(fs_new);
++out_put:
++	if (proxy_cur)
++		put_nsproxy(proxy_cur);
++	if (fs_cur)
++		put_fs_struct(fs_cur);
++	return ret;
++}
++
++
++int vx_set_space(struct vx_info *vxi, unsigned long mask)
++{
++	struct nsproxy *proxy_vxi, *proxy_cur, *proxy_new;
++	struct fs_struct *fs_vxi, *fs_cur, *fs_new;
++	int ret;
++
++	if (!mask)
++		mask = space_mask.mask;
++
++	if ((mask & space_mask.mask) != mask)
++		return -EINVAL;
++
++	proxy_vxi = vxi->vx_nsproxy;
++	fs_vxi = vxi->vx_fs;
++
++	task_lock(current);
++	fs_cur = current->fs;
++	atomic_inc(&fs_cur->count);
++	proxy_cur = current->nsproxy;
++	get_nsproxy(proxy_cur);
++	task_unlock(current);
++
++	fs_new = __vs_merge_fs(fs_vxi, fs_cur, mask);
++	if (IS_ERR(fs_new)) {
++		ret = PTR_ERR(fs_new);
++		goto out_put;
++	}
++
++	proxy_new = __vs_merge_nsproxy(proxy_vxi, proxy_cur, mask);
++	if (IS_ERR(proxy_new)) {
++		ret = PTR_ERR(proxy_new);
++		goto out_put_fs;
++	}
++
++	fs_new = xchg(&vxi->vx_fs, fs_new);
++	proxy_new = xchg(&vxi->vx_nsproxy, proxy_new);
++	vxi->vx_nsmask |= mask;
++	ret = 0;
++
++	if (proxy_new)
++		put_nsproxy(proxy_new);
++out_put_fs:
++	if (fs_new)
++		put_fs_struct(fs_new);
++out_put:
++	if (proxy_cur)
++		put_nsproxy(proxy_cur);
++	if (fs_cur)
++		put_fs_struct(fs_cur);
++	return ret;
++}
++
++
++int vc_enter_space(struct vx_info *vxi, void __user *data)
++{
++	struct vcmd_space_mask vc_data = { .mask = 0 };
++
++	if (data && copy_from_user(&vc_data, data, sizeof(vc_data)))
++		return -EFAULT;
++
++	return vx_enter_space(vxi, vc_data.mask);
++}
++
++int vc_set_space(struct vx_info *vxi, void __user *data)
++{
++	struct vcmd_space_mask vc_data = { .mask = 0 };
++
++	if (data && copy_from_user(&vc_data, data, sizeof(vc_data)))
++		return -EFAULT;
++
++	return vx_set_space(vxi, vc_data.mask);
++}
++
++int vc_get_space_mask(struct vx_info *vxi, void __user *data)
++{
++	if (copy_to_user(data, &space_mask, sizeof(space_mask)))
++		return -EFAULT;
++	return 0;
++}
++
+--- linux-2.6.22/kernel/vserver/switch.c	1970-01-01 01:00:00 +0100
++++ linux-2.6.22-vs2.2.0-rc5/kernel/vserver/switch.c	2007-06-15 02:37:04 +0200
+@@ -0,0 +1,527 @@
++/*
++ *  linux/kernel/vserver/switch.c
++ *
++ *  Virtual Server: Syscall Switch
++ *
++ *  Copyright (C) 2003-2007  Herbert Pötzl
++ *
++ *  V0.01  syscall switch
++ *  V0.02  added signal to context
++ *  V0.03  added rlimit functions
++ *  V0.04  added iattr, task/xid functions
++ *  V0.05  added debug/history stuff
++ *  V0.06  added compat32 layer
++ *  V0.07  vcmd args and perms
++ *  V0.08  added status commands
++ *
++ */
++
++#include <linux/linkage.h>
++#include <linux/sched.h>
++#include <linux/compat.h>
++#include <asm/errno.h>
++
++#include <linux/vs_context.h>
++#include <linux/vs_network.h>
++#include <linux/vserver/switch.h>
++
++#include "vci_config.h"
++
++static inline
++int vc_get_version(uint32_t id)
++{
++#ifdef	CONFIG_VSERVER_LEGACY_VERSION
++	if (id == 63)
++		return VCI_LEGACY_VERSION;
++#endif
++	return VCI_VERSION;
++}
++
++static inline
++int vc_get_vci(uint32_t id)
++{
++	return vci_kernel_config();
++}
++
++#include <linux/vserver/context_cmd.h>
++#include <linux/vserver/cvirt_cmd.h>
++#include <linux/vserver/cacct_cmd.h>
++#include <linux/vserver/limit_cmd.h>
++#include <linux/vserver/network_cmd.h>
++#include <linux/vserver/sched_cmd.h>
++#include <linux/vserver/debug_cmd.h>
++#include <linux/vserver/inode_cmd.h>
++#include <linux/vserver/dlimit_cmd.h>
++#include <linux/vserver/signal_cmd.h>
++#include <linux/vserver/space_cmd.h>
++
++#include <linux/vserver/legacy.h>
++#include <linux/vserver/inode.h>
++#include <linux/vserver/dlimit.h>
++
++
++#ifdef	CONFIG_COMPAT
++#define __COMPAT(name, id, data, compat)	\
++	(compat) ? name ## _x32(id, data) : name(id, data)
++#else
++#define __COMPAT(name, id, data, compat)	\
++	name(id, data)
++#endif
++
++
++static inline
++long do_vcmd(uint32_t cmd, uint32_t id,
++	struct vx_info *vxi, struct nx_info *nxi,
++	void __user *data, int compat)
++{
++	switch (cmd) {
++
++	case VCMD_get_version:
++		return vc_get_version(id);
++	case VCMD_get_vci:
++		return vc_get_vci(id);
++
++	case VCMD_task_xid:
++		return vc_task_xid(id, data);
++	case VCMD_vx_info:
++		return vc_vx_info(vxi, data);
++
++	case VCMD_task_nid:
++		return vc_task_nid(id, data);
++	case VCMD_nx_info:
++		return vc_nx_info(nxi, data);
++
++	case VCMD_set_space_v0:
++	/* this is version 1 */
++	case VCMD_set_space:
++		return vc_set_space(vxi, data);
++
++	case VCMD_get_space_mask:
++		return vc_get_space_mask(vxi, data);
++
++#ifdef	CONFIG_IA32_EMULATION
++	case VCMD_get_rlimit:
++		return __COMPAT(vc_get_rlimit, vxi, data, compat);
++	case VCMD_set_rlimit:
++		return __COMPAT(vc_set_rlimit, vxi, data, compat);
++#else
++	case VCMD_get_rlimit:
++		return vc_get_rlimit(vxi, data);
++	case VCMD_set_rlimit:
++		return vc_set_rlimit(vxi, data);
++#endif
++	case VCMD_get_rlimit_mask:
++		return vc_get_rlimit_mask(id, data);
++	case VCMD_reset_minmax:
++		return vc_reset_minmax(vxi, data);
++
++	case VCMD_get_vhi_name:
++		return vc_get_vhi_name(vxi, data);
++	case VCMD_set_vhi_name:
++		return vc_set_vhi_name(vxi, data);
++
++	case VCMD_ctx_stat:
++		return vc_ctx_stat(vxi, data);
++	case VCMD_virt_stat:
++		return vc_virt_stat(vxi, data);
++	case VCMD_sock_stat:
++		return vc_sock_stat(vxi, data);
++	case VCMD_rlimit_stat:
++		return vc_rlimit_stat(vxi, data);
++
++	case VCMD_set_cflags:
++		return vc_set_cflags(vxi, data);
++	case VCMD_get_cflags:
++		return vc_get_cflags(vxi, data);
++
++	case VCMD_set_ccaps_v0:
++		return vc_set_ccaps_v0(vxi, data);
++	/* this is version 1 */
++	case VCMD_set_ccaps:
++		return vc_set_ccaps(vxi, data);
++	case VCMD_get_ccaps_v0:
++		return vc_get_ccaps_v0(vxi, data);
++	/* this is version 1 */
++	case VCMD_get_ccaps:
++		return vc_get_ccaps(vxi, data);
++	case VCMD_set_bcaps:
++		return vc_set_bcaps(vxi, data);
++	case VCMD_get_bcaps:
++		return vc_get_bcaps(vxi, data);
++
++	case VCMD_set_nflags:
++		return vc_set_nflags(nxi, data);
++	case VCMD_get_nflags:
++		return vc_get_nflags(nxi, data);
++
++	case VCMD_set_ncaps:
++		return vc_set_ncaps(nxi, data);
++	case VCMD_get_ncaps:
++		return vc_get_ncaps(nxi, data);
++
++#ifdef	CONFIG_VSERVER_LEGACY
++	case VCMD_set_sched_v2:
++		return vc_set_sched_v2(vxi, data);
++#endif
++	case VCMD_set_sched_v3:
++		return vc_set_sched_v3(vxi, data);
++	case VCMD_set_sched_v4:
++		return vc_set_sched_v4(vxi, data);
++	/* this is version 5 */
++	case VCMD_set_sched:
++		return vc_set_sched(vxi, data);
++	case VCMD_get_sched:
++		return vc_get_sched(vxi, data);
++	case VCMD_sched_info:
++		return vc_sched_info(vxi, data);
++
++	case VCMD_add_dlimit:
++		return __COMPAT(vc_add_dlimit, id, data, compat);
++	case VCMD_rem_dlimit:
++		return __COMPAT(vc_rem_dlimit, id, data, compat);
++	case VCMD_set_dlimit:
++		return __COMPAT(vc_set_dlimit, id, data, compat);
++	case VCMD_get_dlimit:
++		return __COMPAT(vc_get_dlimit, id, data, compat);
++
++	case VCMD_ctx_kill:
++		return vc_ctx_kill(vxi, data);
++
++	case VCMD_wait_exit:
++		return vc_wait_exit(vxi, data);
++
++#ifdef	CONFIG_VSERVER_LEGACY
++	case VCMD_create_context:
++		return vc_ctx_create(id, NULL);
++#endif
++
++	case VCMD_get_iattr:
++		return __COMPAT(vc_get_iattr, id, data, compat);
++	case VCMD_set_iattr:
++		return __COMPAT(vc_set_iattr, id, data, compat);
++
++	case VCMD_enter_space_v0:
++		return vc_enter_space(vxi, NULL);
++	/* this is version 1 */
++	case VCMD_enter_space:
++		return vc_enter_space(vxi, data);
++
++	case VCMD_ctx_create_v0:
++		return vc_ctx_create(id, NULL);
++	case VCMD_ctx_create:
++		return vc_ctx_create(id, data);
++	case VCMD_ctx_migrate_v0:
++		return vc_ctx_migrate(vxi, NULL);
++	case VCMD_ctx_migrate:
++		return vc_ctx_migrate(vxi, data);
++
++	case VCMD_net_create_v0:
++		return vc_net_create(id, NULL);
++	case VCMD_net_create:
++		return vc_net_create(id, data);
++	case VCMD_net_migrate:
++		return vc_net_migrate(nxi, data);
++	case VCMD_net_add:
++		return vc_net_add(nxi, data);
++	case VCMD_net_remove:
++		return vc_net_remove(nxi, data);
++
++#ifdef	CONFIG_VSERVER_HISTORY
++	case VCMD_dump_history:
++		return vc_dump_history(id);
++	case VCMD_read_history:
++		return __COMPAT(vc_read_history, id, data, compat);
++#endif
++#ifdef	CONFIG_VSERVER_MONITOR
++	case VCMD_read_monitor:
++		return __COMPAT(vc_read_monitor, id, data, compat);
++#endif
++#ifdef	CONFIG_VSERVER_LEGACY
++	case VCMD_new_s_context:
++		return vc_new_s_context(id, data);
++#endif
++#ifdef	CONFIG_VSERVER_LEGACYNET
++	case VCMD_set_ipv4root:
++		return vc_set_ipv4root(id, data);
++#endif
++	default:
++		vxwprintk(1, "unimplemented VCMD_%02d_%d[%d]",
++			VC_CATEGORY(cmd), VC_COMMAND(cmd), VC_VERSION(cmd));
++	}
++	return -ENOSYS;
++}
++
++
++#define	__VCMD(vcmd, _perm, _args, _flags)		\
++	case VCMD_ ## vcmd: perm = _perm;		\
++		args = _args; flags = _flags; break
++
++
++#define VCA_NONE	0x00
++#define VCA_VXI		0x01
++#define VCA_NXI		0x02
++
++#define VCF_NONE	0x00
++#define VCF_INFO	0x01
++#define VCF_ADMIN	0x02
++#define VCF_ARES	0x06	/* includes admin */
++#define VCF_SETUP	0x08
++
++#define VCF_ZIDOK	0x10	/* zero id okay */
++
++
++static inline
++long do_vserver(uint32_t cmd, uint32_t id, void __user *data, int compat)
++{
++	long ret;
++	int permit = -1, state = 0;
++	int perm = -1, args = 0, flags = 0;
++	struct vx_info *vxi = NULL;
++	struct nx_info *nxi = NULL;
++
++	switch (cmd) {
++	/* unpriviledged commands */
++	__VCMD(get_version,	 0, VCA_NONE,	0);
++	__VCMD(get_vci,		 0, VCA_NONE,	0);
++	__VCMD(get_rlimit_mask,	 0, VCA_NONE,	0);
++	__VCMD(get_space_mask,	 0, VCA_NONE,   0);
++
++	/* info commands */
++	__VCMD(task_xid,	 2, VCA_NONE,	0);
++	__VCMD(reset_minmax,	 2, VCA_VXI,	0);
++	__VCMD(vx_info,		 3, VCA_VXI,	VCF_INFO);
++	__VCMD(get_bcaps,	 3, VCA_VXI,	VCF_INFO);
++	__VCMD(get_ccaps_v0,	 3, VCA_VXI,	VCF_INFO);
++	__VCMD(get_ccaps,	 3, VCA_VXI,	VCF_INFO);
++	__VCMD(get_cflags,	 3, VCA_VXI,	VCF_INFO);
++	__VCMD(get_vhi_name,	 3, VCA_VXI,	VCF_INFO);
++	__VCMD(get_rlimit,	 3, VCA_VXI,	VCF_INFO);
++
++	__VCMD(ctx_stat,	 3, VCA_VXI,	VCF_INFO);
++	__VCMD(virt_stat,	 3, VCA_VXI,	VCF_INFO);
++	__VCMD(sock_stat,	 3, VCA_VXI,	VCF_INFO);
++	__VCMD(rlimit_stat,	 3, VCA_VXI,	VCF_INFO);
++
++	__VCMD(task_nid,	 2, VCA_NONE,	0);
++	__VCMD(nx_info,		 3, VCA_NXI,	VCF_INFO);
++	__VCMD(get_ncaps,	 3, VCA_NXI,	VCF_INFO);
++	__VCMD(get_nflags,	 3, VCA_NXI,	VCF_INFO);
++
++	__VCMD(get_iattr,	 2, VCA_NONE,	0);
++	__VCMD(get_dlimit,	 3, VCA_NONE,	VCF_INFO);
++	__VCMD(get_sched,	 3, VCA_VXI,	VCF_INFO);
++	__VCMD(sched_info,	 3, VCA_VXI,	VCF_INFO | VCF_ZIDOK);
++
++	/* lower admin commands */
++	__VCMD(wait_exit,	 4, VCA_VXI,	VCF_INFO);
++	__VCMD(ctx_create_v0,	 5, VCA_NONE,	0);
++	__VCMD(ctx_create,	 5, VCA_NONE,	0);
++	__VCMD(ctx_migrate_v0,	 5, VCA_VXI,	VCF_ADMIN);
++	__VCMD(ctx_migrate,	 5, VCA_VXI,	VCF_ADMIN);
++	__VCMD(enter_space_v0,	 5, VCA_VXI,	VCF_ADMIN);
++	__VCMD(enter_space,	 5, VCA_VXI,	VCF_ADMIN);
++
++	__VCMD(net_create_v0,	 5, VCA_NONE,	0);
++	__VCMD(net_create,	 5, VCA_NONE,	0);
++	__VCMD(net_migrate,	 5, VCA_NXI,	VCF_ADMIN);
++
++	/* higher admin commands */
++	__VCMD(ctx_kill,	 6, VCA_VXI,	VCF_ARES);
++	__VCMD(set_space_v0,	 7, VCA_VXI,	VCF_ARES | VCF_SETUP);
++	__VCMD(set_space,	 7, VCA_VXI,	VCF_ARES | VCF_SETUP);
++
++	__VCMD(set_ccaps_v0,	 7, VCA_VXI,	VCF_ARES | VCF_SETUP);
++	__VCMD(set_ccaps,	 7, VCA_VXI,	VCF_ARES | VCF_SETUP);
++	__VCMD(set_bcaps,	 7, VCA_VXI,	VCF_ARES | VCF_SETUP);
++	__VCMD(set_cflags,	 7, VCA_VXI,	VCF_ARES | VCF_SETUP);
++
++	__VCMD(set_vhi_name,	 7, VCA_VXI,	VCF_ARES | VCF_SETUP);
++	__VCMD(set_rlimit,	 7, VCA_VXI,	VCF_ARES | VCF_SETUP);
++	__VCMD(set_sched,	 7, VCA_VXI,	VCF_ARES | VCF_SETUP);
++	__VCMD(set_sched_v2,	 7, VCA_VXI,	VCF_ARES | VCF_SETUP);
++	__VCMD(set_sched_v3,	 7, VCA_VXI,	VCF_ARES | VCF_SETUP);
++	__VCMD(set_sched_v4,	 7, VCA_VXI,	VCF_ARES | VCF_SETUP);
++
++	__VCMD(set_ncaps,	 7, VCA_NXI,	VCF_ARES | VCF_SETUP);
++	__VCMD(set_nflags,	 7, VCA_NXI,	VCF_ARES | VCF_SETUP);
++	__VCMD(net_add,		 8, VCA_NXI,	VCF_ARES | VCF_SETUP);
++	__VCMD(net_remove,	 8, VCA_NXI,	VCF_ARES | VCF_SETUP);
++
++	__VCMD(set_iattr,	 7, VCA_NONE,	0);
++	__VCMD(set_dlimit,	 7, VCA_NONE,	VCF_ARES);
++	__VCMD(add_dlimit,	 8, VCA_NONE,	VCF_ARES);
++	__VCMD(rem_dlimit,	 8, VCA_NONE,	VCF_ARES);
++
++	/* debug level admin commands */
++#ifdef	CONFIG_VSERVER_HISTORY
++	__VCMD(dump_history,	 9, VCA_NONE,	0);
++	__VCMD(read_history,	 9, VCA_NONE,	0);
++#endif
++#ifdef	CONFIG_VSERVER_MONITOR
++	__VCMD(read_monitor,	 9, VCA_NONE,	0);
++#endif
++
++	/* legacy commands */
++#ifdef	CONFIG_VSERVER_LEGACY
++	__VCMD(new_s_context,	 1, VCA_NONE,	0);
++	__VCMD(create_context,	 5, VCA_NONE,	0);
++#endif
++#ifdef	CONFIG_VSERVER_LEGACYNET
++	__VCMD(set_ipv4root,	 5, VCA_NONE,	0);
++#endif
++	default:
++		perm = -1;
++	}
++
++	vxdprintk(VXD_CBIT(switch, 0),
++		"vc: VCMD_%02d_%d[%d], %d,%p [%d,%d,%x,%x]",
++		VC_CATEGORY(cmd), VC_COMMAND(cmd),
++		VC_VERSION(cmd), id, data, compat,
++		perm, args, flags);
++
++	ret = -ENOSYS;
++	if (perm < 0)
++		goto out;
++
++	state = 1;
++#ifdef	CONFIG_VSERVER_LEGACY
++	if (!capable(CAP_CONTEXT) &&
++		/* dirty hack for capremove */
++		!(cmd == VCMD_new_s_context && id == -2))
++		goto out;
++#else
++	if (!capable(CAP_CONTEXT))
++		goto out;
++#endif
++
++	state = 2;
++	/* moved here from the individual commands */
++	ret = -EPERM;
++	if ((perm > 1) && !capable(CAP_SYS_ADMIN))
++		goto out;
++
++	state = 3;
++	/* vcmd involves resource management  */
++	ret = -EPERM;
++	if ((flags & VCF_ARES) && !capable(CAP_SYS_RESOURCE))
++		goto out;
++
++	state = 4;
++	/* various legacy exceptions */
++	switch (cmd) {
++#ifdef	CONFIG_VSERVER_LEGACY
++	case VCMD_set_cflags:
++	case VCMD_set_ccaps_v0:
++		ret = 0;
++		if (vx_check(0, VS_WATCH))
++			goto out;
++		break;
++
++	case VCMD_ctx_create_v0:
++#endif
++	/* will go away when spectator is a cap */
++	case VCMD_ctx_migrate_v0:
++	case VCMD_ctx_migrate:
++		if (id == 1) {
++			current->xid = 1;
++			ret = 1;
++			goto out;
++		}
++		break;
++
++	/* will go away when spectator is a cap */
++	case VCMD_net_migrate:
++		if (id == 1) {
++			current->nid = 1;
++			ret = 1;
++			goto out;
++		}
++		break;
++
++	/* legacy special casing */
++	case VCMD_set_space_v0:
++		id = -1;
++		break;
++	}
++
++	/* vcmds are fine by default */
++	permit = 1;
++
++	/* admin type vcmds require admin ... */
++	if (flags & VCF_ADMIN)
++		permit = vx_check(0, VS_ADMIN) ? 1 : 0;
++
++	/* ... but setup type vcmds override that */
++	if (!permit && (flags & VCF_SETUP))
++		permit = vx_flags(VXF_STATE_SETUP, 0) ? 2 : 0;
++
++	state = 5;
++	ret = -EPERM;
++	if (!permit)
++		goto out;
++
++	state = 6;
++	if (!id && (flags & VCF_ZIDOK))
++		goto skip_id;
++
++	ret = -ESRCH;
++	if (args & VCA_VXI) {
++		vxi = lookup_vx_info(id);
++		if (!vxi)
++			goto out;
++
++		if ((flags & VCF_ADMIN) &&
++			/* special case kill for shutdown */
++			(cmd != VCMD_ctx_kill) &&
++			/* can context be administrated? */
++			!vx_info_flags(vxi, VXF_STATE_ADMIN, 0)) {
++			ret = -EACCES;
++			goto out_vxi;
++		}
++	}
++	state = 7;
++	if (args & VCA_NXI) {
++		nxi = lookup_nx_info(id);
++		if (!nxi)
++			goto out_vxi;
++
++		if ((flags & VCF_ADMIN) &&
++			/* can context be administrated? */
++			!nx_info_flags(nxi, NXF_STATE_ADMIN, 0)) {
++			ret = -EACCES;
++			goto out_nxi;
++		}
++	}
++skip_id:
++	state = 8;
++	ret = do_vcmd(cmd, id, vxi, nxi, data, compat);
++
++out_nxi:
++	if ((args & VCA_NXI) && nxi)
++		put_nx_info(nxi);
++out_vxi:
++	if ((args & VCA_VXI) && vxi)
++		put_vx_info(vxi);
++out:
++	vxdprintk(VXD_CBIT(switch, 1),
++		"vc: VCMD_%02d_%d[%d] = %08lx(%ld) [%d,%d]",
++		VC_CATEGORY(cmd), VC_COMMAND(cmd),
++		VC_VERSION(cmd), ret, ret, state, permit);
++	return ret;
++}
++
++asmlinkage long
++sys_vserver(uint32_t cmd, uint32_t id, void __user *data)
++{
++	return do_vserver(cmd, id, data, 0);
++}
++
++#ifdef	CONFIG_COMPAT
++
++asmlinkage long
++sys32_vserver(uint32_t cmd, uint32_t id, void __user *data)
++{
++	return do_vserver(cmd, id, data, 1);
++}
++
++#endif	/* CONFIG_COMPAT */
+--- linux-2.6.22/kernel/vserver/sysctl.c	1970-01-01 01:00:00 +0100
++++ linux-2.6.22-vs2.2.0-rc5/kernel/vserver/sysctl.c	2007-06-16 05:31:20 +0200
+@@ -0,0 +1,248 @@
++/*
++ *  kernel/vserver/sysctl.c
++ *
++ *  Virtual Context Support
++ *
++ *  Copyright (C) 2004-2007  Herbert Pötzl
++ *
++ *  V0.01  basic structure
++ *
++ */
++
++#include <linux/errno.h>
++#include <linux/module.h>
++#include <linux/types.h>
++#include <linux/ctype.h>
++#include <linux/sysctl.h>
++#include <linux/parser.h>
++#include <linux/fs.h>
++
++#include <asm/uaccess.h>
++#include <asm/unistd.h>
++
++
++#define CTL_VSERVER	4242    /* unused? */
++
++enum {
++	CTL_DEBUG_ERROR		= 0,
++	CTL_DEBUG_SWITCH	= 1,
++	CTL_DEBUG_XID,
++	CTL_DEBUG_NID,
++	CTL_DEBUG_TAG,
++	CTL_DEBUG_NET,
++	CTL_DEBUG_LIMIT,
++	CTL_DEBUG_CRES,
++	CTL_DEBUG_DLIM,
++	CTL_DEBUG_QUOTA,
++	CTL_DEBUG_CVIRT,
++	CTL_DEBUG_SPACE,
++	CTL_DEBUG_MISC,
++};
++
++
++unsigned int vx_debug_switch	= 0;
++unsigned int vx_debug_xid	= 0;
++unsigned int vx_debug_nid	= 0;
++unsigned int vx_debug_tag	= 0;
++unsigned int vx_debug_net	= 0;
++unsigned int vx_debug_limit	= 0;
++unsigned int vx_debug_cres	= 0;
++unsigned int vx_debug_dlim	= 0;
++unsigned int vx_debug_quota	= 0;
++unsigned int vx_debug_cvirt	= 0;
++unsigned int vx_debug_space	= 0;
++unsigned int vx_debug_misc	= 0;
++
++
++static struct ctl_table_header *vserver_table_header;
++static ctl_table vserver_table[];
++
++
++void vserver_register_sysctl(void)
++{
++	if (!vserver_table_header) {
++		vserver_table_header = register_sysctl_table(vserver_table);
++	}
++
++}
++
++void vserver_unregister_sysctl(void)
++{
++	if (vserver_table_header) {
++		unregister_sysctl_table(vserver_table_header);
++		vserver_table_header = NULL;
++	}
++}
++
++
++static int proc_dodebug(ctl_table *table, int write,
++	struct file *filp, void __user *buffer, size_t *lenp, loff_t *ppos)
++{
++	char		tmpbuf[20], *p, c;
++	unsigned int	value;
++	size_t		left, len;
++
++	if ((*ppos && !write) || !*lenp) {
++		*lenp = 0;
++		return 0;
++	}
++
++	left = *lenp;
++
++	if (write) {
++		if (!access_ok(VERIFY_READ, buffer, left))
++			return -EFAULT;
++		p = (char *)buffer;
++		while (left && __get_user(c, p) >= 0 && isspace(c))
++			left--, p++;
++		if (!left)
++			goto done;
++
++		if (left > sizeof(tmpbuf) - 1)
++			return -EINVAL;
++		if (copy_from_user(tmpbuf, p, left))
++			return -EFAULT;
++		tmpbuf[left] = '\0';
++
++		for (p = tmpbuf, value = 0; '0' <= *p && *p <= '9'; p++, left--)
++			value = 10 * value + (*p - '0');
++		if (*p && !isspace(*p))
++			return -EINVAL;
++		while (left && isspace(*p))
++			left--, p++;
++		*(unsigned int *)table->data = value;
++	} else {
++		if (!access_ok(VERIFY_WRITE, buffer, left))
++			return -EFAULT;
++		len = sprintf(tmpbuf, "%d", *(unsigned int *)table->data);
++		if (len > left)
++			len = left;
++		if (__copy_to_user(buffer, tmpbuf, len))
++			return -EFAULT;
++		if ((left -= len) > 0) {
++			if (put_user('\n', (char *)buffer + len))
++				return -EFAULT;
++			left--;
++		}
++	}
++
++done:
++	*lenp -= left;
++	*ppos += *lenp;
++	return 0;
++}
++
++
++#define	CTL_ENTRY(ctl, name)				\
++	{						\
++		.ctl_name	= ctl,			\
++		.procname	= #name,		\
++		.data		= &vx_ ## name,		\
++		.maxlen		= sizeof(int),		\
++		.mode		= 0644,			\
++		.proc_handler	= &proc_dodebug		\
++	}
++
++static ctl_table debug_table[] = {
++	CTL_ENTRY(CTL_DEBUG_SWITCH,	debug_switch),
++	CTL_ENTRY(CTL_DEBUG_XID,	debug_xid),
++	CTL_ENTRY(CTL_DEBUG_NID,	debug_nid),
++	CTL_ENTRY(CTL_DEBUG_TAG,	debug_tag),
++	CTL_ENTRY(CTL_DEBUG_NET,	debug_net),
++	CTL_ENTRY(CTL_DEBUG_LIMIT,	debug_limit),
++	CTL_ENTRY(CTL_DEBUG_CRES,	debug_cres),
++	CTL_ENTRY(CTL_DEBUG_DLIM,	debug_dlim),
++	CTL_ENTRY(CTL_DEBUG_QUOTA,	debug_quota),
++	CTL_ENTRY(CTL_DEBUG_CVIRT,	debug_cvirt),
++	CTL_ENTRY(CTL_DEBUG_SPACE,	debug_space),
++	CTL_ENTRY(CTL_DEBUG_MISC,	debug_misc),
++	{ .ctl_name = 0 }
++};
++
++static ctl_table vserver_table[] = {
++	{
++		.ctl_name	= CTL_VSERVER,
++		.procname	= "vserver",
++		.mode		= 0555,
++		.child		= debug_table
++	},
++	{ .ctl_name = 0 }
++};
++
++
++static match_table_t tokens = {
++	{ CTL_DEBUG_SWITCH,	"switch=%x"	},
++	{ CTL_DEBUG_XID,	"xid=%x"	},
++	{ CTL_DEBUG_NID,	"nid=%x"	},
++	{ CTL_DEBUG_TAG,	"tag=%x"	},
++	{ CTL_DEBUG_NET,	"net=%x"	},
++	{ CTL_DEBUG_LIMIT,	"limit=%x"	},
++	{ CTL_DEBUG_CRES,	"cres=%x"	},
++	{ CTL_DEBUG_DLIM,	"dlim=%x"	},
++	{ CTL_DEBUG_QUOTA,	"quota=%x"	},
++	{ CTL_DEBUG_CVIRT,	"cvirt=%x"	},
++	{ CTL_DEBUG_SPACE,	"space=%x"	},
++	{ CTL_DEBUG_MISC,	"misc=%x"	},
++	{ CTL_DEBUG_ERROR,	NULL		}
++};
++
++#define	HANDLE_CASE(id, name, val)				\
++	case CTL_DEBUG_ ## id:					\
++		vx_debug_ ## name = val;			\
++		printk("vs_debug_" #name "=0x%x\n", val);	\
++		break
++
++
++static int __init vs_debug_setup(char *str)
++{
++	char *p;
++	int token;
++
++	printk("vs_debug_setup(%s)\n", str);
++	while ((p = strsep(&str, ",")) != NULL) {
++		substring_t args[MAX_OPT_ARGS];
++		unsigned int value;
++
++		if (!*p)
++			continue;
++
++		token = match_token(p, tokens, args);
++		value = (token > 0) ? simple_strtoul(args[0].from, NULL, 0) : 0;
++
++		switch (token) {
++		HANDLE_CASE(SWITCH, switch, value);
++		HANDLE_CASE(XID,    xid,    value);
++		HANDLE_CASE(NID,    nid,    value);
++		HANDLE_CASE(TAG,    tag,    value);
++		HANDLE_CASE(NET,    net,    value);
++		HANDLE_CASE(LIMIT,  limit,  value);
++		HANDLE_CASE(CRES,   cres,   value);
++		HANDLE_CASE(DLIM,   dlim,   value);
++		HANDLE_CASE(QUOTA,  quota,  value);
++		HANDLE_CASE(CVIRT,  cvirt,  value);
++		HANDLE_CASE(SPACE,  space,  value);
++		HANDLE_CASE(MISC,   misc,   value);
++		default:
++			return -EINVAL;
++			break;
++		}
++	}
++	return 1;
++}
++
++__setup("vsdebug=", vs_debug_setup);
++
++
++
++EXPORT_SYMBOL_GPL(vx_debug_switch);
++EXPORT_SYMBOL_GPL(vx_debug_xid);
++EXPORT_SYMBOL_GPL(vx_debug_nid);
++EXPORT_SYMBOL_GPL(vx_debug_net);
++EXPORT_SYMBOL_GPL(vx_debug_limit);
++EXPORT_SYMBOL_GPL(vx_debug_cres);
++EXPORT_SYMBOL_GPL(vx_debug_dlim);
++EXPORT_SYMBOL_GPL(vx_debug_quota);
++EXPORT_SYMBOL_GPL(vx_debug_cvirt);
++EXPORT_SYMBOL_GPL(vx_debug_space);
++EXPORT_SYMBOL_GPL(vx_debug_misc);
++
+--- linux-2.6.22/kernel/vserver/vci_config.h	1970-01-01 01:00:00 +0100
++++ linux-2.6.22-vs2.2.0-rc5/kernel/vserver/vci_config.h	2007-06-15 02:37:04 +0200
+@@ -0,0 +1,92 @@
++
++/*  interface version */
++
++#define VCI_VERSION		0x00020200
++#define VCI_LEGACY_VERSION	0x000100FF
++
++
++enum {
++	VCI_KCBIT_NO_DYNAMIC = 0,
++	VCI_KCBIT_LEGACY = 1,
++	VCI_KCBIT_LEGACYNET = 2,
++	VCI_KCBIT_NGNET = 3,
++
++	VCI_KCBIT_PROC_SECURE = 4,
++	VCI_KCBIT_HARDCPU = 5,
++	VCI_KCBIT_IDLELIMIT = 6,
++	VCI_KCBIT_IDLETIME = 7,
++
++	VCI_KCBIT_COWBL = 8,
++	VCI_KCBIT_FULLCOWBL = 9,
++	VCI_KCBIT_SPACES = 10,
++
++	VCI_KCBIT_LEGACY_VERSION = 15,
++	VCI_KCBIT_DEBUG = 16,
++	VCI_KCBIT_HISTORY = 20,
++	VCI_KCBIT_TAGGED = 24,
++};
++
++
++static inline uint32_t vci_kernel_config(void)
++{
++	return
++	/* various legacy options */
++#ifndef CONFIG_VSERVER_DYNAMIC_IDS
++	(1 << VCI_KCBIT_NO_DYNAMIC) |
++#endif
++#ifdef	CONFIG_VSERVER_LEGACY
++	(1 << VCI_KCBIT_LEGACY) |
++#endif
++#ifdef	CONFIG_VSERVER_LEGACYNET
++	(1 << VCI_KCBIT_LEGACYNET) |
++#endif
++#ifdef	CONFIG_VSERVER_LEGACY_VERSION
++	(1 << VCI_KCBIT_LEGACY_VERSION) |
++#endif
++
++	/* configured features */
++#ifdef	CONFIG_VSERVER_PROC_SECURE
++	(1 << VCI_KCBIT_PROC_SECURE) |
++#endif
++#ifdef	CONFIG_VSERVER_HARDCPU
++	(1 << VCI_KCBIT_HARDCPU) |
++#endif
++#ifdef	CONFIG_VSERVER_IDLELIMIT
++	(1 << VCI_KCBIT_IDLELIMIT) |
++#endif
++#ifdef	CONFIG_VSERVER_IDLETIME
++	(1 << VCI_KCBIT_IDLETIME) |
++#endif
++#ifdef	CONFIG_VSERVER_COWBL
++	(1 << VCI_KCBIT_COWBL) |
++	(1 << VCI_KCBIT_FULLCOWBL) |
++#endif
++	(1 << VCI_KCBIT_SPACES) |
++
++	/* debug options */
++#ifdef	CONFIG_VSERVER_DEBUG
++	(1 << VCI_KCBIT_DEBUG) |
++#endif
++#ifdef	CONFIG_VSERVER_HISTORY
++	(1 << VCI_KCBIT_HISTORY) |
++#endif
++
++	/* inode context tagging */
++#if	defined(CONFIG_TAGGING_NONE)
++	(0 << VCI_KCBIT_TAGGED) |
++#elif	defined(CONFIG_TAGGING_UID16)
++	(1 << VCI_KCBIT_TAGGED) |
++#elif	defined(CONFIG_TAGGING_GID16)
++	(2 << VCI_KCBIT_TAGGED) |
++#elif	defined(CONFIG_TAGGING_ID24)
++	(3 << VCI_KCBIT_TAGGED) |
++#elif	defined(CONFIG_TAGGING_INTERN)
++	(4 << VCI_KCBIT_TAGGED) |
++#elif	defined(CONFIG_TAGGING_RUNTIME)
++	(5 << VCI_KCBIT_TAGGED) |
++#else
++	(7 << VCI_KCBIT_TAGGED) |
++#endif
++	0;
++}
++
+--- linux-2.6.22/mm/filemap.c	2007-07-09 13:20:04 +0200
++++ linux-2.6.22-vs2.2.0-rc5/mm/filemap.c	2007-07-09 13:11:54 +0200
+@@ -1245,6 +1245,31 @@ int file_send_actor(read_descriptor_t * 
+ 	return written;
+ }
+ 
++/* FIXME: It would be as simple as this, if we had a (void __user*) to write.
++ * We already have a kernel buffer, so it should be even simpler, right? ;)
++ *
++ * Yes, sorta.  After duplicating the complete path of generic_file_write(),
++ * at least some special cases could be removed, so the copy is simpler than
++ * the original.  But it remains a copy, so overall complexity increases.
++ */
++static ssize_t
++generic_kernel_file_write(struct file *, const char *, size_t, loff_t *);
++
++ssize_t generic_file_sendpage(struct file *file, struct page *page,
++		int offset, size_t size, loff_t *ppos, int more)
++{
++	ssize_t ret;
++	char *kaddr;
++
++	kaddr = kmap(page);
++	ret = generic_kernel_file_write(file, kaddr + offset, size, ppos);
++	kunmap(page);
++
++	return ret;
++}
++
++EXPORT_SYMBOL(generic_file_sendpage);
++
+ ssize_t generic_file_sendfile(struct file *in_file, loff_t *ppos,
+ 			 size_t count, read_actor_t actor, void *target)
+ {
+@@ -1924,6 +1949,19 @@ int remove_suid(struct dentry *dentry)
+ }
+ EXPORT_SYMBOL(remove_suid);
+ 
++static inline size_t
++filemap_copy_from_kernel(struct page *page, unsigned long offset,
++			 const char *buf, unsigned bytes)
++{
++	char *kaddr;
++
++	kaddr = kmap(page);
++	memcpy(kaddr + offset, buf, bytes);
++	kunmap(page);
++
++	return bytes;
++}
++
+ size_t
+ __filemap_copy_from_user_iovec_inatomic(char *vaddr,
+ 			const struct iovec *iov, size_t base, size_t bytes)
+@@ -2235,6 +2273,175 @@ zero_length_segment:
+ }
+ EXPORT_SYMBOL(generic_file_buffered_write);
+ 
++static inline void
++filemap_set_next_kvec(const struct kvec **iovp, size_t *basep, size_t bytes)
++{
++	const struct kvec *iov = *iovp;
++	size_t base = *basep;
++
++	while (bytes) {
++		int copy = min(bytes, iov->iov_len - base);
++
++		bytes -= copy;
++		base += copy;
++		if (iov->iov_len == base) {
++			iov++;
++			base = 0;
++		}
++	}
++	*iovp = iov;
++	*basep = base;
++}
++
++/*
++ * TODO:
++ * This largely tries to copy generic_file_aio_write_nolock(), although it
++ * doesn't have to be nearly as generic.  A real cleanup should either
++ * merge this into generic_file_aio_write_nolock() as well or keep it special
++ * and remove as much code as possible.
++ */
++static ssize_t
++generic_kernel_file_aio_write_nolock(struct kiocb *iocb, const struct kvec*iov,
++				     unsigned long nr_segs, loff_t *ppos)
++{
++	struct file *file = iocb->ki_filp;
++	struct address_space * mapping = file->f_mapping;
++	const struct address_space_operations *a_ops = mapping->a_ops;
++	size_t ocount;		/* original count */
++	size_t count;		/* after file limit checks */
++	struct inode	*inode = mapping->host;
++	long		status = 0;
++	loff_t		pos;
++	struct page	*page;
++	struct page	*cached_page = NULL;
++	const int	isblk = S_ISBLK(inode->i_mode);
++	ssize_t		written;
++	ssize_t		err;
++	size_t		bytes;
++	struct pagevec	lru_pvec;
++	const struct kvec *cur_iov = iov; /* current kvec */
++	size_t		iov_base = 0;	   /* offset in the current kvec */
++	unsigned long	seg;
++	char		*buf;
++
++	ocount = 0;
++	for (seg = 0; seg < nr_segs; seg++) {
++		const struct kvec *iv = &iov[seg];
++
++		/*
++		 * If any segment has a negative length, or the cumulative
++		 * length ever wraps negative then return -EINVAL.
++		 */
++		ocount += iv->iov_len;
++		if (unlikely((ssize_t)(ocount|iv->iov_len) < 0))
++			return -EINVAL;
++	}
++
++	count = ocount;
++	pos = *ppos;
++	pagevec_init(&lru_pvec, 0);
++
++	/* We can write back this queue in page reclaim */
++	current->backing_dev_info = mapping->backing_dev_info;
++	written = 0;
++
++	err = generic_write_checks(file, &pos, &count, isblk);
++	if (err)
++		goto out;
++
++
++	if (count == 0)
++		goto out;
++
++	remove_suid(file->f_dentry);
++	file_update_time(file);
++
++	/* There is no sane reason to use O_DIRECT */
++	BUG_ON(file->f_flags & O_DIRECT);
++
++	buf = iov->iov_base;
++	do {
++		unsigned long index;
++		unsigned long offset;
++		size_t copied;
++
++		offset = (pos & (PAGE_CACHE_SIZE -1)); /* Within page */
++		index = pos >> PAGE_CACHE_SHIFT;
++		bytes = PAGE_CACHE_SIZE - offset;
++		if (bytes > count)
++			bytes = count;
++
++		page = __grab_cache_page(mapping,index,&cached_page,&lru_pvec);
++		if (!page) {
++			status = -ENOMEM;
++			break;
++		}
++
++		status = a_ops->prepare_write(file, page, offset, offset+bytes);
++		if (unlikely(status)) {
++			loff_t isize = i_size_read(inode);
++			/*
++			 * prepare_write() may have instantiated a few blocks
++			 * outside i_size.  Trim these off again.
++			 */
++			unlock_page(page);
++			page_cache_release(page);
++			if (pos + bytes > isize)
++				vmtruncate(inode, isize);
++			break;
++		}
++
++		BUG_ON(nr_segs != 1);
++		copied = filemap_copy_from_kernel(page, offset, buf, bytes);
++
++		flush_dcache_page(page);
++		status = a_ops->commit_write(file, page, offset, offset+bytes);
++		if (likely(copied > 0)) {
++			if (!status)
++				status = copied;
++
++			if (status >= 0) {
++				written += status;
++				count -= status;
++				pos += status;
++				buf += status;
++				if (unlikely(nr_segs > 1))
++					filemap_set_next_kvec(&cur_iov,
++							&iov_base, status);
++			}
++		}
++		if (unlikely(copied != bytes))
++			if (status >= 0)
++				status = -EFAULT;
++		unlock_page(page);
++		mark_page_accessed(page);
++		page_cache_release(page);
++		if (status < 0)
++			break;
++		balance_dirty_pages_ratelimited(mapping);
++		cond_resched();
++	} while (count);
++	*ppos = pos;
++
++	if (cached_page)
++		page_cache_release(cached_page);
++
++	/*
++	 * For now, when the user asks for O_SYNC, we'll actually give O_DSYNC
++	 */
++	if (status >= 0) {
++		if ((file->f_flags & O_SYNC) || IS_SYNC(inode))
++			status = generic_osync_inode(inode, mapping,
++					OSYNC_METADATA|OSYNC_DATA);
++	}
++
++	err = written ? written : status;
++out:
++	pagevec_lru_add(&lru_pvec);
++	current->backing_dev_info = 0;
++	return err;
++}
++
+ static ssize_t
+ __generic_file_aio_write_nolock(struct kiocb *iocb, const struct iovec *iov,
+ 				unsigned long nr_segs, loff_t *ppos)
+@@ -2335,6 +2542,36 @@ out:
+ 	return written ? written : err;
+ }
+ 
++static ssize_t
++generic_kernel_file_write_nolock(struct file *file, const struct kvec *iov,
++				 unsigned long nr_segs, loff_t *ppos)
++{
++	struct kiocb kiocb;
++	ssize_t ret;
++
++	init_sync_kiocb(&kiocb, file);
++	ret = generic_kernel_file_aio_write_nolock(&kiocb, iov, nr_segs, ppos);
++	if (ret == -EIOCBQUEUED)
++		ret = wait_on_sync_kiocb(&kiocb);
++	return ret;
++}
++
++static ssize_t generic_kernel_file_write(struct file *file, const char *buf,
++					 size_t count, loff_t *ppos)
++{
++	struct inode    *inode = file->f_mapping->host;
++	ssize_t         err;
++	struct kvec local_iov = { .iov_base = (char *) buf,
++				  .iov_len = count };
++
++	mutex_lock(&inode->i_mutex);
++	err = generic_kernel_file_write_nolock(file, &local_iov, 1, ppos);
++	mutex_unlock(&inode->i_mutex);
++
++	return err;
++}
++
++
+ ssize_t generic_file_aio_write_nolock(struct kiocb *iocb,
+ 		const struct iovec *iov, unsigned long nr_segs, loff_t pos)
+ {
+--- linux-2.6.22/mm/filemap_xip.c	2007-07-09 13:20:04 +0200
++++ linux-2.6.22-vs2.2.0-rc5/mm/filemap_xip.c	2007-06-15 05:30:21 +0200
+@@ -14,6 +14,7 @@
+ #include <linux/uio.h>
+ #include <linux/rmap.h>
+ #include <linux/sched.h>
++#include <linux/vs_memory.h>
+ #include <asm/tlbflush.h>
+ #include "filemap.h"
+ 
+--- linux-2.6.22/mm/fremap.c	2007-02-06 03:01:56 +0100
++++ linux-2.6.22-vs2.2.0-rc5/mm/fremap.c	2007-06-15 02:37:04 +0200
+@@ -15,6 +15,7 @@
+ #include <linux/rmap.h>
+ #include <linux/module.h>
+ #include <linux/syscalls.h>
++#include <linux/vs_memory.h>
+ 
+ #include <asm/mmu_context.h>
+ #include <asm/cacheflush.h>
+@@ -74,6 +75,8 @@ int install_page(struct mm_struct *mm, s
+ 	err = -ENOMEM;
+ 	if (page_mapcount(page) > INT_MAX/2)
+ 		goto unlock;
++	if (!vx_rss_avail(mm, 1))
++		goto unlock;
+ 
+ 	if (pte_none(*pte) || !zap_pte(mm, vma, addr, pte))
+ 		inc_mm_counter(mm, file_rss);
+--- linux-2.6.22/mm/hugetlb.c	2007-07-09 13:20:04 +0200
++++ linux-2.6.22-vs2.2.0-rc5/mm/hugetlb.c	2007-06-17 05:54:20 +0200
+@@ -19,6 +19,7 @@
+ #include <asm/pgtable.h>
+ 
+ #include <linux/hugetlb.h>
++#include <linux/vs_memory.h>
+ #include "internal.h"
+ 
+ const unsigned long hugetlb_zero = 0, hugetlb_infinity = ~0UL;
+--- linux-2.6.22/mm/memory.c	2007-07-09 13:20:04 +0200
++++ linux-2.6.22-vs2.2.0-rc5/mm/memory.c	2007-06-17 05:55:53 +0200
+@@ -498,6 +498,9 @@ static int copy_pte_range(struct mm_stru
+ 	int progress = 0;
+ 	int rss[2];
+ 
++	if (!vx_rss_avail(dst_mm, ((end - addr)/PAGE_SIZE + 1)))
++		return -ENOMEM;
++
+ again:
+ 	rss[1] = rss[0] = 0;
+ 	dst_pte = pte_alloc_map_lock(dst_mm, dst_pmd, addr, &dst_ptl);
+@@ -2157,6 +2160,11 @@ static int do_swap_page(struct mm_struct
+ 		count_vm_event(PGMAJFAULT);
+ 	}
+ 
++	if (!vx_rss_avail(mm, 1)) {
++		ret = VM_FAULT_OOM;
++		goto out;
++	}
++
+ 	delayacct_clear_flag(DELAYACCT_PF_SWAPIN);
+ 	mark_page_accessed(page);
+ 	lock_page(page);
+@@ -2229,6 +2237,8 @@ static int do_anonymous_page(struct mm_s
+ 		/* Allocate our own private page. */
+ 		pte_unmap(page_table);
+ 
++		if (!vx_rss_avail(mm, 1))
++			goto oom;
+ 		if (unlikely(anon_vma_prepare(vma)))
+ 			goto oom;
+ 		page = alloc_zeroed_user_highpage(vma, address);
+@@ -2302,6 +2312,9 @@ static int do_no_page(struct mm_struct *
+ 	pte_unmap(page_table);
+ 	BUG_ON(vma->vm_flags & VM_PFNMAP);
+ 
++	if (!vx_rss_avail(mm, 1))
++		return VM_FAULT_OOM;
++
+ 	if (vma->vm_file) {
+ 		mapping = vma->vm_file->f_mapping;
+ 		sequence = mapping->truncate_count;
+@@ -2527,6 +2540,7 @@ static inline int handle_pte_fault(struc
+ {
+ 	pte_t entry;
+ 	spinlock_t *ptl;
++	int ret, type = VXPT_UNKNOWN;
+ 
+ 	entry = *pte;
+ 	if (!pte_present(entry)) {
+@@ -2555,9 +2569,12 @@ static inline int handle_pte_fault(struc
+ 	if (unlikely(!pte_same(*pte, entry)))
+ 		goto unlock;
+ 	if (write_access) {
+-		if (!pte_write(entry))
+-			return do_wp_page(mm, vma, address,
++		if (!pte_write(entry)) {
++			ret = do_wp_page(mm, vma, address,
+ 					pte, pmd, ptl, entry);
++			type = VXPT_WRITE;
++			goto out;
++		}
+ 		entry = pte_mkdirty(entry);
+ 	}
+ 	entry = pte_mkyoung(entry);
+@@ -2576,7 +2593,10 @@ static inline int handle_pte_fault(struc
+ 	}
+ unlock:
+ 	pte_unmap_unlock(pte, ptl);
+-	return VM_FAULT_MINOR;
++	ret = VM_FAULT_MINOR;
++out:
++	vx_page_fault(mm, vma, type, ret);
++	return ret;
+ }
+ 
+ /*
+--- linux-2.6.22/mm/mlock.c	2007-07-09 13:20:04 +0200
++++ linux-2.6.22-vs2.2.0-rc5/mm/mlock.c	2007-06-15 05:30:38 +0200
+@@ -12,6 +12,7 @@
+ #include <linux/syscalls.h>
+ #include <linux/sched.h>
+ #include <linux/module.h>
++#include <linux/vs_memory.h>
+ 
+ int can_do_mlock(void)
+ {
+@@ -76,7 +77,7 @@ success:
+ 			ret = make_pages_present(start, end);
+ 	}
+ 
+-	mm->locked_vm -= pages;
++	vx_vmlocked_sub(mm, pages);
+ out:
+ 	if (ret == -ENOMEM)
+ 		ret = -EAGAIN;
+@@ -134,7 +135,7 @@ static int do_mlock(unsigned long start,
+ 
+ asmlinkage long sys_mlock(unsigned long start, size_t len)
+ {
+-	unsigned long locked;
++	unsigned long locked, grow;
+ 	unsigned long lock_limit;
+ 	int error = -ENOMEM;
+ 
+@@ -145,8 +146,10 @@ asmlinkage long sys_mlock(unsigned long 
+ 	len = PAGE_ALIGN(len + (start & ~PAGE_MASK));
+ 	start &= PAGE_MASK;
+ 
+-	locked = len >> PAGE_SHIFT;
+-	locked += current->mm->locked_vm;
++	grow = len >> PAGE_SHIFT;
++	if (!vx_vmlocked_avail(current->mm, grow))
++		goto out;
++	locked = current->mm->locked_vm + grow;
+ 
+ 	lock_limit = current->signal->rlim[RLIMIT_MEMLOCK].rlim_cur;
+ 	lock_limit >>= PAGE_SHIFT;
+@@ -154,6 +157,7 @@ asmlinkage long sys_mlock(unsigned long 
+ 	/* check against resource limits */
+ 	if ((locked <= lock_limit) || capable(CAP_IPC_LOCK))
+ 		error = do_mlock(start, len, 1);
++out:
+ 	up_write(&current->mm->mmap_sem);
+ 	return error;
+ }
+@@ -213,6 +217,8 @@ asmlinkage long sys_mlockall(int flags)
+ 	lock_limit >>= PAGE_SHIFT;
+ 
+ 	ret = -ENOMEM;
++	if (!vx_vmlocked_avail(current->mm, current->mm->total_vm))
++		goto out;
+ 	if (!(flags & MCL_CURRENT) || (current->mm->total_vm <= lock_limit) ||
+ 	    capable(CAP_IPC_LOCK))
+ 		ret = do_mlockall(flags);
+--- linux-2.6.22/mm/mmap.c	2007-07-09 13:20:04 +0200
++++ linux-2.6.22-vs2.2.0-rc5/mm/mmap.c	2007-07-07 03:52:54 +0200
+@@ -1144,10 +1144,10 @@ munmap_back:
+ 		kmem_cache_free(vm_area_cachep, vma);
+ 	}
+ out:	
+-	mm->total_vm += len >> PAGE_SHIFT;
++	vx_vmpages_add(mm, len >> PAGE_SHIFT);
+ 	vm_stat_account(mm, vm_flags, file, len >> PAGE_SHIFT);
+ 	if (vm_flags & VM_LOCKED) {
+-		mm->locked_vm += len >> PAGE_SHIFT;
++		vx_vmlocked_add(mm, len >> PAGE_SHIFT);
+ 		make_pages_present(addr, addr + len);
+ 	}
+ 	if (flags & MAP_POPULATE) {
+@@ -1502,9 +1502,9 @@ static int acct_stack_growth(struct vm_a
+ 		return -ENOMEM;
+ 
+ 	/* Ok, everything looks good - let it rip */
+-	mm->total_vm += grow;
++	vx_vmpages_add(mm, grow);
+ 	if (vma->vm_flags & VM_LOCKED)
+-		mm->locked_vm += grow;
++		vx_vmlocked_add(mm, grow);
+ 	vm_stat_account(mm, vma->vm_flags, vma->vm_file, grow);
+ 	return 0;
+ }
+@@ -1662,9 +1662,9 @@ static void remove_vma_list(struct mm_st
+ 	do {
+ 		long nrpages = vma_pages(vma);
+ 
+-		mm->total_vm -= nrpages;
++		vx_vmpages_sub(mm, nrpages);
+ 		if (vma->vm_flags & VM_LOCKED)
+-			mm->locked_vm -= nrpages;
++			vx_vmlocked_sub(mm, nrpages);
+ 		vm_stat_account(mm, vma->vm_flags, vma->vm_file, -nrpages);
+ 		vma = remove_vma(vma);
+ 	} while (vma);
+@@ -1903,6 +1903,8 @@ unsigned long do_brk(unsigned long addr,
+ 		lock_limit >>= PAGE_SHIFT;
+ 		if (locked > lock_limit && !capable(CAP_IPC_LOCK))
+ 			return -EAGAIN;
++		if (!vx_vmlocked_avail(mm, len >> PAGE_SHIFT))
++			return -ENOMEM;
+ 	}
+ 
+ 	/*
+@@ -1929,7 +1931,8 @@ unsigned long do_brk(unsigned long addr,
+ 	if (mm->map_count > sysctl_max_map_count)
+ 		return -ENOMEM;
+ 
+-	if (security_vm_enough_memory(len >> PAGE_SHIFT))
++	if (security_vm_enough_memory(len >> PAGE_SHIFT) ||
++		!vx_vmpages_avail(mm, len >> PAGE_SHIFT))
+ 		return -ENOMEM;
+ 
+ 	/* Can we just expand an old private anonymous mapping? */
+@@ -1955,9 +1958,9 @@ unsigned long do_brk(unsigned long addr,
+ 				(VM_READ|VM_WRITE|VM_EXEC|VM_SHARED)];
+ 	vma_link(mm, vma, prev, rb_link, rb_parent);
+ out:
+-	mm->total_vm += len >> PAGE_SHIFT;
++	vx_vmpages_add(mm, len >> PAGE_SHIFT);
+ 	if (flags & VM_LOCKED) {
+-		mm->locked_vm += len >> PAGE_SHIFT;
++		vx_vmlocked_add(mm, len >> PAGE_SHIFT);
+ 		make_pages_present(addr, addr + len);
+ 	}
+ 	return addr;
+@@ -1986,6 +1989,11 @@ void exit_mmap(struct mm_struct *mm)
+ 	free_pgtables(&tlb, vma, FIRST_USER_ADDRESS, 0);
+ 	tlb_finish_mmu(tlb, 0, end);
+ 
++	set_mm_counter(mm, file_rss, 0);
++	set_mm_counter(mm, anon_rss, 0);
++	vx_vmpages_sub(mm, mm->total_vm);
++	vx_vmlocked_sub(mm, mm->locked_vm);
++
+ 	/*
+ 	 * Walk the list again, actually closing and freeing it,
+ 	 * with preemption enabled, without holding any MM locks.
+@@ -2025,7 +2033,8 @@ int insert_vm_struct(struct mm_struct * 
+ 	if (__vma && __vma->vm_start < vma->vm_end)
+ 		return -ENOMEM;
+ 	if ((vma->vm_flags & VM_ACCOUNT) &&
+-	     security_vm_enough_memory(vma_pages(vma)))
++		(security_vm_enough_memory(vma_pages(vma)) ||
++		!vx_vmpages_avail(mm, vma_pages(vma))))
+ 		return -ENOMEM;
+ 	vma_link(mm, vma, prev, rb_link, rb_parent);
+ 	return 0;
+@@ -2098,6 +2107,8 @@ int may_expand_vm(struct mm_struct *mm, 
+ 
+ 	if (cur + npages > lim)
+ 		return 0;
++	if (!vx_vmpages_avail(mm, npages))
++		return 0;
+ 	return 1;
+ }
+ 
+@@ -2168,7 +2179,7 @@ int install_special_mapping(struct mm_st
+ 		return -ENOMEM;
+ 	}
+ 
+-	mm->total_vm += len >> PAGE_SHIFT;
+-
++	// mm->total_vm += len >> PAGE_SHIFT;
++	vx_vmpages_add(mm, len >> PAGE_SHIFT);
+ 	return 0;
+ }
+--- linux-2.6.22/mm/mremap.c	2007-02-06 03:01:56 +0100
++++ linux-2.6.22-vs2.2.0-rc5/mm/mremap.c	2007-06-15 02:37:04 +0200
+@@ -18,6 +18,7 @@
+ #include <linux/highmem.h>
+ #include <linux/security.h>
+ #include <linux/syscalls.h>
++#include <linux/vs_memory.h>
+ 
+ #include <asm/uaccess.h>
+ #include <asm/cacheflush.h>
+@@ -212,7 +213,7 @@ static unsigned long move_vma(struct vm_
+ 	 * If this were a serious issue, we'd add a flag to do_munmap().
+ 	 */
+ 	hiwater_vm = mm->hiwater_vm;
+-	mm->total_vm += new_len >> PAGE_SHIFT;
++	vx_vmpages_add(mm, new_len >> PAGE_SHIFT);
+ 	vm_stat_account(mm, vma->vm_flags, vma->vm_file, new_len>>PAGE_SHIFT);
+ 
+ 	if (do_munmap(mm, old_addr, old_len) < 0) {
+@@ -230,7 +231,7 @@ static unsigned long move_vma(struct vm_
+ 	}
+ 
+ 	if (vm_flags & VM_LOCKED) {
+-		mm->locked_vm += new_len >> PAGE_SHIFT;
++		vx_vmlocked_add(mm, new_len >> PAGE_SHIFT);
+ 		if (new_len > old_len)
+ 			make_pages_present(new_addr + old_len,
+ 					   new_addr + new_len);
+@@ -337,6 +338,9 @@ unsigned long do_mremap(unsigned long ad
+ 		ret = -EAGAIN;
+ 		if (locked > lock_limit && !capable(CAP_IPC_LOCK))
+ 			goto out;
++		if (!vx_vmlocked_avail(current->mm,
++			(new_len - old_len) >> PAGE_SHIFT))
++			goto out;
+ 	}
+ 	if (!may_expand_vm(mm, (new_len - old_len) >> PAGE_SHIFT)) {
+ 		ret = -ENOMEM;
+@@ -365,10 +369,10 @@ unsigned long do_mremap(unsigned long ad
+ 			vma_adjust(vma, vma->vm_start,
+ 				addr + new_len, vma->vm_pgoff, NULL);
+ 
+-			mm->total_vm += pages;
++			vx_vmpages_add(mm, pages);
+ 			vm_stat_account(mm, vma->vm_flags, vma->vm_file, pages);
+ 			if (vma->vm_flags & VM_LOCKED) {
+-				mm->locked_vm += pages;
++				vx_vmlocked_add(mm, pages);
+ 				make_pages_present(addr + old_len,
+ 						   addr + new_len);
+ 			}
+--- linux-2.6.22/mm/nommu.c	2007-07-09 13:20:04 +0200
++++ linux-2.6.22-vs2.2.0-rc5/mm/nommu.c	2007-06-15 02:37:04 +0200
+@@ -936,7 +936,7 @@ unsigned long do_mmap_pgoff(struct file 
+ 	realalloc += kobjsize(vma);
+ 	askedalloc += sizeof(*vma);
+ 
+-	current->mm->total_vm += len >> PAGE_SHIFT;
++	vx_vmpages_add(current->mm, len >> PAGE_SHIFT);
+ 
+ 	add_nommu_vma(vma);
+ 
+@@ -1061,7 +1061,7 @@ int do_munmap(struct mm_struct *mm, unsi
+ 	kfree(vml);
+ 
+ 	update_hiwater_vm(mm);
+-	mm->total_vm -= len >> PAGE_SHIFT;
++	vx_vmpages_sub(mm, len >> PAGE_SHIFT);
+ 
+ #ifdef DEBUG
+ 	show_process_blocks();
+@@ -1093,7 +1093,7 @@ void exit_mmap(struct mm_struct * mm)
+ 		printk("Exit_mmap:\n");
+ #endif
+ 
+-		mm->total_vm = 0;
++		vx_vmpages_sub(mm, mm->total_vm);
+ 
+ 		while ((tmp = mm->context.vmlist)) {
+ 			mm->context.vmlist = tmp->next;
+--- linux-2.6.22/mm/oom_kill.c	2007-07-09 13:20:04 +0200
++++ linux-2.6.22-vs2.2.0-rc5/mm/oom_kill.c	2007-06-15 02:37:04 +0200
+@@ -24,6 +24,7 @@
+ #include <linux/cpuset.h>
+ #include <linux/module.h>
+ #include <linux/notifier.h>
++#include <linux/vs_memory.h>
+ 
+ int sysctl_panic_on_oom;
+ /* #define DEBUG */
+@@ -66,6 +67,12 @@ unsigned long badness(struct task_struct
+ 	points = mm->total_vm;
+ 
+ 	/*
++	 * add points for context badness
++	 */
++
++	points += vx_badness(p, mm);
++
++	/*
+ 	 * After this unlock we can no longer dereference local variable `mm'
+ 	 */
+ 	task_unlock(p);
+@@ -156,8 +163,8 @@ unsigned long badness(struct task_struct
+ 	}
+ 
+ #ifdef DEBUG
+-	printk(KERN_DEBUG "OOMkill: task %d (%s) got %d points\n",
+-	p->pid, p->comm, points);
++	printk(KERN_DEBUG "OOMkill: task %d:#%u (%s) got %d points\n",
++		p->pid, p->xid, p->comm, points);
+ #endif
+ 	return points;
+ }
+@@ -288,7 +295,8 @@ static void __oom_kill_task(struct task_
+ 	}
+ 
+ 	if (verbose)
+-		printk(KERN_ERR "Killed process %d (%s)\n", p->pid, p->comm);
++		printk(KERN_ERR "Killed process %d:#%u (%s)\n",
++				p->pid, p->xid, p->comm);
+ 
+ 	/*
+ 	 * We give our sacrificial lamb high priority and access to
+@@ -358,8 +366,8 @@ static int oom_kill_process(struct task_
+ 		return 0;
+ 	}
+ 
+-	printk(KERN_ERR "%s: kill process %d (%s) score %li or a child\n",
+-					message, p->pid, p->comm, points);
++	printk(KERN_ERR "%s: kill process %d:#%u (%s) score %li or a child\n",
++				message, p->pid, p->xid, p->comm, points);
+ 
+ 	/* Try to kill a child first */
+ 	list_for_each(tsk, &p->children) {
+--- linux-2.6.22/mm/page_alloc.c	2007-07-09 13:20:04 +0200
++++ linux-2.6.22-vs2.2.0-rc5/mm/page_alloc.c	2007-06-17 05:54:20 +0200
+@@ -41,6 +41,8 @@
+ #include <linux/pfn.h>
+ #include <linux/backing-dev.h>
+ #include <linux/fault-inject.h>
++#include <linux/vs_base.h>
++#include <linux/vs_limit.h>
+ 
+ #include <asm/tlbflush.h>
+ #include <asm/div64.h>
+@@ -1488,6 +1490,9 @@ void si_meminfo(struct sysinfo *val)
+ 	val->totalhigh = totalhigh_pages;
+ 	val->freehigh = nr_free_highpages();
+ 	val->mem_unit = PAGE_SIZE;
++
++	if (vx_flags(VXF_VIRT_MEM, 0))
++		vx_vsi_meminfo(val);
+ }
+ 
+ EXPORT_SYMBOL(si_meminfo);
+@@ -1508,6 +1513,9 @@ void si_meminfo_node(struct sysinfo *val
+ 	val->freehigh = 0;
+ #endif
+ 	val->mem_unit = PAGE_SIZE;
++
++	if (vx_flags(VXF_VIRT_MEM, 0))
++		vx_vsi_meminfo(val);
+ }
+ #endif
+ 
+--- linux-2.6.22/mm/rmap.c	2007-07-09 13:20:04 +0200
++++ linux-2.6.22-vs2.2.0-rc5/mm/rmap.c	2007-07-07 03:52:54 +0200
+@@ -48,6 +48,7 @@
+ #include <linux/rcupdate.h>
+ #include <linux/module.h>
+ #include <linux/kallsyms.h>
++#include <linux/vs_memory.h>
+ 
+ #include <asm/tlbflush.h>
+ 
+--- linux-2.6.22/mm/shmem.c	2007-07-09 13:20:04 +0200
++++ linux-2.6.22-vs2.2.0-rc5/mm/shmem.c	2007-06-17 05:54:20 +0200
+@@ -55,7 +55,6 @@
+ #include <asm/pgtable.h>
+ 
+ /* This magic number is used in glibc for posix shared memory */
+-#define TMPFS_MAGIC	0x01021994
+ 
+ #define ENTRIES_PER_PAGE (PAGE_CACHE_SIZE/sizeof(unsigned long))
+ #define ENTRIES_PER_PAGEPAGE (ENTRIES_PER_PAGE*ENTRIES_PER_PAGE)
+@@ -1734,7 +1733,7 @@ static int shmem_statfs(struct dentry *d
+ {
+ 	struct shmem_sb_info *sbinfo = SHMEM_SB(dentry->d_sb);
+ 
+-	buf->f_type = TMPFS_MAGIC;
++	buf->f_type = TMPFS_SUPER_MAGIC;
+ 	buf->f_bsize = PAGE_CACHE_SIZE;
+ 	buf->f_namelen = NAME_MAX;
+ 	spin_lock(&sbinfo->stat_lock);
+@@ -2308,7 +2307,7 @@ static int shmem_fill_super(struct super
+ 	sb->s_maxbytes = SHMEM_MAX_BYTES;
+ 	sb->s_blocksize = PAGE_CACHE_SIZE;
+ 	sb->s_blocksize_bits = PAGE_CACHE_SHIFT;
+-	sb->s_magic = TMPFS_MAGIC;
++	sb->s_magic = TMPFS_SUPER_MAGIC;
+ 	sb->s_op = &shmem_ops;
+ 	sb->s_time_gran = 1;
+ #ifdef CONFIG_TMPFS_POSIX_ACL
+--- linux-2.6.22/mm/slab.c	2007-07-09 13:20:04 +0200
++++ linux-2.6.22-vs2.2.0-rc5/mm/slab.c	2007-07-09 13:11:54 +0200
+@@ -510,6 +510,8 @@ struct kmem_cache {
+ #define STATS_INC_FREEMISS(x)	do { } while (0)
+ #endif
+ 
++#include "slab_vs.h"
++
+ #if DEBUG
+ 
+ /*
+@@ -3314,6 +3316,7 @@ retry:
+ 
+ 	obj = slab_get_obj(cachep, slabp, nodeid);
+ 	check_slabp(cachep, slabp);
++	vx_slab_alloc(cachep, flags);
+ 	l3->free_objects--;
+ 	/* move slabp to correct slabp list: */
+ 	list_del(&slabp->list);
+@@ -3386,6 +3389,7 @@ __cache_alloc_node(struct kmem_cache *ca
+ 	/* ___cache_alloc_node can fall back to other nodes */
+ 	ptr = ____cache_alloc_node(cachep, flags, nodeid);
+   out:
++	vx_slab_alloc(cachep, flags);
+ 	local_irq_restore(save_flags);
+ 	ptr = cache_alloc_debugcheck_after(cachep, flags, ptr, caller);
+ 
+@@ -3551,6 +3555,7 @@ static inline void __cache_free(struct k
+ 
+ 	check_irq_off();
+ 	objp = cache_free_debugcheck(cachep, objp, __builtin_return_address(0));
++	vx_slab_free(cachep);
+ 
+ 	if (cache_free_alien(cachep, objp))
+ 		return;
+--- linux-2.6.22/mm/slab_vs.h	1970-01-01 01:00:00 +0100
++++ linux-2.6.22-vs2.2.0-rc5/mm/slab_vs.h	2007-06-15 02:37:04 +0200
+@@ -0,0 +1,27 @@
++
++#include <linux/vserver/context.h>
++
++#include <linux/vs_context.h>
++
++static inline
++void vx_slab_alloc(struct kmem_cache *cachep, gfp_t flags)
++{
++	int what = gfp_zone(cachep->gfpflags);
++
++	if (!current->vx_info)
++		return;
++
++	atomic_add(cachep->buffer_size, &current->vx_info->cacct.slab[what]);
++}
++
++static inline
++void vx_slab_free(struct kmem_cache *cachep)
++{
++	int what = gfp_zone(cachep->gfpflags);
++
++	if (!current->vx_info)
++		return;
++
++	atomic_sub(cachep->buffer_size, &current->vx_info->cacct.slab[what]);
++}
++
+--- linux-2.6.22/mm/swapfile.c	2007-07-09 13:20:04 +0200
++++ linux-2.6.22-vs2.2.0-rc5/mm/swapfile.c	2007-06-15 02:37:04 +0200
+@@ -31,6 +31,8 @@
+ #include <asm/pgtable.h>
+ #include <asm/tlbflush.h>
+ #include <linux/swapops.h>
++#include <linux/vs_base.h>
++#include <linux/vs_memory.h>
+ 
+ DEFINE_SPINLOCK(swap_lock);
+ unsigned int nr_swapfiles;
+@@ -1712,6 +1714,8 @@ void si_swapinfo(struct sysinfo *val)
+ 	val->freeswap = nr_swap_pages + nr_to_be_unused;
+ 	val->totalswap = total_swap_pages + nr_to_be_unused;
+ 	spin_unlock(&swap_lock);
++	if (vx_flags(VXF_VIRT_MEM, 0))
++		vx_vsi_swapinfo(val);
+ }
+ 
+ /*
+--- linux-2.6.22/net/core/dev.c	2007-07-09 13:20:05 +0200
++++ linux-2.6.22-vs2.2.0-rc5/net/core/dev.c	2007-07-07 03:52:54 +0200
+@@ -117,6 +117,8 @@
+ #include <linux/err.h>
+ #include <linux/ctype.h>
+ #include <linux/if_arp.h>
++#include <linux/vs_context.h> /* remove with NXF_HIDE_NETIF */
++#include <linux/vs_network.h>
+ 
+ /*
+  *	The list of packet types we will receive (as opposed to discard)
+@@ -2120,6 +2122,9 @@ static int dev_ifconf(char __user *arg)
+ 
+ 	total = 0;
+ 	for_each_netdev(dev) {
++		if (vx_flags(VXF_HIDE_NETIF, 0) &&
++			!dev_in_nx_info(dev, current->nx_info))
++			continue;
+ 		for (i = 0; i < NPROTO; i++) {
+ 			if (gifconf_list[i]) {
+ 				int done;
+@@ -2183,6 +2188,10 @@ void dev_seq_stop(struct seq_file *seq, 
+ static void dev_seq_printf_stats(struct seq_file *seq, struct net_device *dev)
+ {
+ 	struct net_device_stats *stats = dev->get_stats(dev);
++	struct nx_info *nxi = current->nx_info;
++
++	if (vx_flags(VXF_HIDE_NETIF, 0) && !dev_in_nx_info(dev, nxi))
++		return;
+ 
+ 	seq_printf(seq, "%6s:%8lu %7lu %4lu %4lu %4lu %5lu %10lu %9lu "
+ 		   "%8lu %7lu %4lu %4lu %4lu %5lu %7lu %10lu\n",
+--- linux-2.6.22/net/core/rtnetlink.c	2007-07-09 13:20:05 +0200
++++ linux-2.6.22-vs2.2.0-rc5/net/core/rtnetlink.c	2007-06-17 05:54:20 +0200
+@@ -35,6 +35,7 @@
+ #include <linux/security.h>
+ #include <linux/mutex.h>
+ #include <linux/if_addr.h>
++#include <linux/vs_context.h> /* remove with NXF_HIDE_NETIF */
+ 
+ #include <asm/uaccess.h>
+ #include <asm/system.h>
+@@ -537,6 +538,9 @@ static int rtnl_dump_ifinfo(struct sk_bu
+ 
+ 	idx = 0;
+ 	for_each_netdev(dev) {
++		if (vx_info_flags(skb->sk->sk_vx_info, VXF_HIDE_NETIF, 0) &&
++			!dev_in_nx_info(dev, skb->sk->sk_nx_info))
++			continue;
+ 		if (idx < s_idx)
+ 			goto cont;
+ 		if (rtnl_fill_ifinfo(skb, dev, RTM_NEWLINK,
+--- linux-2.6.22/net/core/sock.c	2007-07-09 13:20:05 +0200
++++ linux-2.6.22-vs2.2.0-rc5/net/core/sock.c	2007-06-15 02:37:04 +0200
+@@ -125,6 +125,9 @@
+ #include <linux/ipsec.h>
+ 
+ #include <linux/filter.h>
++#include <linux/vs_socket.h>
++#include <linux/vs_limit.h>
++#include <linux/vs_context.h>
+ 
+ #ifdef CONFIG_INET
+ #include <net/tcp.h>
+@@ -869,6 +872,8 @@ struct sock *sk_alloc(int family, gfp_t 
+ 			sk->sk_prot = sk->sk_prot_creator = prot;
+ 			sock_lock_init(sk);
+ 		}
++		sock_vx_init(sk);
++		sock_nx_init(sk);
+ 
+ 		if (security_sk_alloc(sk, family, priority))
+ 			goto out_free;
+@@ -907,6 +912,11 @@ void sk_free(struct sock *sk)
+ 		       __FUNCTION__, atomic_read(&sk->sk_omem_alloc));
+ 
+ 	security_sk_free(sk);
++	vx_sock_dec(sk);
++	clr_vx_info(&sk->sk_vx_info);
++	sk->sk_xid = -1;
++	clr_nx_info(&sk->sk_nx_info);
++	sk->sk_nid = -1;
+ 	if (sk->sk_prot_creator->slab != NULL)
+ 		kmem_cache_free(sk->sk_prot_creator->slab, sk);
+ 	else
+@@ -924,6 +934,8 @@ struct sock *sk_clone(const struct sock 
+ 		sock_copy(newsk, sk);
+ 
+ 		/* SANITY */
++		sock_vx_init(newsk);
++		sock_nx_init(newsk);
+ 		sk_node_init(&newsk->sk_node);
+ 		sock_lock_init(newsk);
+ 		bh_lock_sock(newsk);
+@@ -969,6 +981,12 @@ struct sock *sk_clone(const struct sock 
+ 		newsk->sk_priority = 0;
+ 		atomic_set(&newsk->sk_refcnt, 2);
+ 
++		set_vx_info(&newsk->sk_vx_info, sk->sk_vx_info);
++		newsk->sk_xid = sk->sk_xid;
++		vx_sock_inc(newsk);
++		set_nx_info(&newsk->sk_nx_info, sk->sk_nx_info);
++		newsk->sk_nid = sk->sk_nid;
++
+ 		/*
+ 		 * Increment the counter in the same struct proto as the master
+ 		 * sock (sk_refcnt_debug_inc uses newsk->sk_prot->socks, that
+@@ -1551,6 +1569,11 @@ void sock_init_data(struct socket *sock,
+ 
+ 	sk->sk_stamp = ktime_set(-1L, -1L);
+ 
++	set_vx_info(&sk->sk_vx_info, current->vx_info);
++	sk->sk_xid = vx_current_xid();
++	vx_sock_inc(sk);
++	set_nx_info(&sk->sk_nx_info, current->nx_info);
++	sk->sk_nid = nx_current_nid();
+ 	atomic_set(&sk->sk_refcnt, 1);
+ }
+ 
+--- linux-2.6.22/net/ipv4/af_inet.c	2007-07-09 13:20:05 +0200
++++ linux-2.6.22-vs2.2.0-rc5/net/ipv4/af_inet.c	2007-06-15 02:37:04 +0200
+@@ -115,6 +115,7 @@
+ #ifdef CONFIG_IP_MROUTE
+ #include <linux/mroute.h>
+ #endif
++#include <linux/vs_limit.h>
+ 
+ DEFINE_SNMP_STAT(struct linux_mib, net_statistics) __read_mostly;
+ 
+@@ -308,9 +309,11 @@ lookup_protocol:
+ 	}
+ 
+ 	err = -EPERM;
++	if ((protocol == IPPROTO_ICMP) && vx_ccaps(VXC_RAW_ICMP))
++		goto override;
+ 	if (answer->capability > 0 && !capable(answer->capability))
+ 		goto out_rcu_unlock;
+-
++override:
+ 	sock->ops = answer->ops;
+ 	answer_prot = answer->prot;
+ 	answer_no_check = answer->no_check;
+@@ -427,6 +430,10 @@ int inet_bind(struct socket *sock, struc
+ 	unsigned short snum;
+ 	int chk_addr_ret;
+ 	int err;
++	__u32 s_addr;	/* Address used for validation */
++	__u32 s_addr1;	/* Address used for socket */
++	__u32 s_addr2;	/* Broadcast address for the socket */
++	struct nx_info *nxi = sk->sk_nx_info;
+ 
+ 	/* If the socket has its own bind function then use it. (RAW) */
+ 	if (sk->sk_prot->bind) {
+@@ -437,7 +444,40 @@ int inet_bind(struct socket *sock, struc
+ 	if (addr_len < sizeof(struct sockaddr_in))
+ 		goto out;
+ 
+-	chk_addr_ret = inet_addr_type(addr->sin_addr.s_addr);
++	s_addr = addr->sin_addr.s_addr;
++	s_addr1 = s_addr;
++	s_addr2 = 0xffffffffl;
++
++	vxdprintk(VXD_CBIT(net, 3),
++		"inet_bind(%p)* %p,%p;%lx " NIPQUAD_FMT,
++		sk, sk->sk_nx_info, sk->sk_socket,
++		(sk->sk_socket?sk->sk_socket->flags:0),
++		NIPQUAD(s_addr));
++	if (nxi) {
++		__u32 v4_bcast = nxi->v4_bcast;
++		__u32 ipv4root = nxi->ipv4[0];
++		int nbipv4 = nxi->nbipv4;
++
++		if (s_addr == 0) {
++			/* bind to any for 1-n */
++			s_addr = ipv4root;
++			s_addr1 = (nbipv4 > 1) ? 0 : s_addr;
++			s_addr2 = v4_bcast;
++		} else if (s_addr == IPI_LOOPBACK) {
++			/* rewrite localhost to ipv4root */
++			s_addr = ipv4root;
++			s_addr1 = ipv4root;
++		} else if (s_addr != v4_bcast) {
++			/* normal address bind */
++			if (!addr_in_nx_info(nxi, s_addr))
++				return -EADDRNOTAVAIL;
++		}
++	}
++	chk_addr_ret = inet_addr_type(s_addr);
++
++	vxdprintk(VXD_CBIT(net, 3),
++		"inet_bind(%p) " NIPQUAD_FMT ", " NIPQUAD_FMT ", " NIPQUAD_FMT,
++		sk, NIPQUAD(s_addr), NIPQUAD(s_addr1), NIPQUAD(s_addr2));
+ 
+ 	/* Not specified by any standard per-se, however it breaks too
+ 	 * many applications when removed.  It is unfortunate since
+@@ -449,7 +489,7 @@ int inet_bind(struct socket *sock, struc
+ 	err = -EADDRNOTAVAIL;
+ 	if (!sysctl_ip_nonlocal_bind &&
+ 	    !inet->freebind &&
+-	    addr->sin_addr.s_addr != INADDR_ANY &&
++	    s_addr != INADDR_ANY &&
+ 	    chk_addr_ret != RTN_LOCAL &&
+ 	    chk_addr_ret != RTN_MULTICAST &&
+ 	    chk_addr_ret != RTN_BROADCAST)
+@@ -474,7 +514,8 @@ int inet_bind(struct socket *sock, struc
+ 	if (sk->sk_state != TCP_CLOSE || inet->num)
+ 		goto out_release_sock;
+ 
+-	inet->rcv_saddr = inet->saddr = addr->sin_addr.s_addr;
++	inet->rcv_saddr = inet->saddr = s_addr1;
++	inet->rcv_saddr2 = s_addr2;
+ 	if (chk_addr_ret == RTN_MULTICAST || chk_addr_ret == RTN_BROADCAST)
+ 		inet->saddr = 0;  /* Use device */
+ 
+--- linux-2.6.22/net/ipv4/devinet.c	2007-07-09 13:20:05 +0200
++++ linux-2.6.22-vs2.2.0-rc5/net/ipv4/devinet.c	2007-06-17 05:54:20 +0200
+@@ -56,6 +56,7 @@
+ #include <linux/sysctl.h>
+ #endif
+ #include <linux/kmod.h>
++#include <linux/vs_context.h>
+ 
+ #include <net/arp.h>
+ #include <net/ip.h>
+@@ -676,6 +677,9 @@ int devinet_ioctl(unsigned int cmd, void
+ 		*colon = ':';
+ 
+ 	if ((in_dev = __in_dev_get_rtnl(dev)) != NULL) {
++		struct nx_info *nxi = current->nx_info;
++		int hide_netif = vx_flags(VXF_HIDE_NETIF, 0);
++
+ 		if (tryaddrmatch) {
+ 			/* Matthias Andree */
+ 			/* compare label and address (4.4BSD style) */
+@@ -684,6 +688,8 @@ int devinet_ioctl(unsigned int cmd, void
+ 			   This is checked above. */
+ 			for (ifap = &in_dev->ifa_list; (ifa = *ifap) != NULL;
+ 			     ifap = &ifa->ifa_next) {
++				if (hide_netif && !ifa_in_nx_info(ifa, nxi))
++					continue;
+ 				if (!strcmp(ifr.ifr_name, ifa->ifa_label) &&
+ 				    sin_orig.sin_addr.s_addr ==
+ 							ifa->ifa_address) {
+@@ -696,9 +702,12 @@ int devinet_ioctl(unsigned int cmd, void
+ 		   comparing just the label */
+ 		if (!ifa) {
+ 			for (ifap = &in_dev->ifa_list; (ifa = *ifap) != NULL;
+-			     ifap = &ifa->ifa_next)
++			     ifap = &ifa->ifa_next) {
++				if (hide_netif && !ifa_in_nx_info(ifa, nxi))
++					continue;
+ 				if (!strcmp(ifr.ifr_name, ifa->ifa_label))
+ 					break;
++			}
+ 		}
+ 	}
+ 
+@@ -849,6 +858,9 @@ static int inet_gifconf(struct net_devic
+ 		goto out;
+ 
+ 	for (; ifa; ifa = ifa->ifa_next) {
++		if (vx_flags(VXF_HIDE_NETIF, 0) &&
++			!ifa_in_nx_info(ifa, current->nx_info))
++			continue;
+ 		if (!buf) {
+ 			done += sizeof(ifr);
+ 			continue;
+@@ -1179,6 +1191,7 @@ static int inet_dump_ifaddr(struct sk_bu
+ 	struct net_device *dev;
+ 	struct in_device *in_dev;
+ 	struct in_ifaddr *ifa;
++	struct sock *sk = skb->sk;
+ 	int s_ip_idx, s_idx = cb->args[0];
+ 
+ 	s_ip_idx = ip_idx = cb->args[1];
+@@ -1193,6 +1206,9 @@ static int inet_dump_ifaddr(struct sk_bu
+ 
+ 		for (ifa = in_dev->ifa_list, ip_idx = 0; ifa;
+ 		     ifa = ifa->ifa_next, ip_idx++) {
++			if (sk && vx_info_flags(sk->sk_vx_info, VXF_HIDE_NETIF, 0) &&
++				!ifa_in_nx_info(ifa, sk->sk_nx_info))
++				continue;
+ 			if (ip_idx < s_ip_idx)
+ 				goto cont;
+ 			if (inet_fill_ifaddr(skb, ifa, NETLINK_CB(cb->skb).pid,
+--- linux-2.6.22/net/ipv4/fib_hash.c	2007-07-09 13:20:05 +0200
++++ linux-2.6.22-vs2.2.0-rc5/net/ipv4/fib_hash.c	2007-06-15 02:37:04 +0200
+@@ -34,6 +34,7 @@
+ #include <linux/skbuff.h>
+ #include <linux/netlink.h>
+ #include <linux/init.h>
++#include <linux/vs_context.h>
+ 
+ #include <net/ip.h>
+ #include <net/protocol.h>
+@@ -982,6 +983,8 @@ static unsigned fib_flag_trans(int type,
+ 	return flags;
+ }
+ 
++extern int dev_in_nx_info(struct net_device *, struct nx_info *);
++
+ /*
+  *	This outputs /proc/net/route.
+  *
+@@ -1012,7 +1015,8 @@ static int fib_seq_show(struct seq_file 
+ 	prefix	= f->fn_key;
+ 	mask	= FZ_MASK(iter->zone);
+ 	flags	= fib_flag_trans(fa->fa_type, mask, fi);
+-	if (fi)
++	if (fi && (!vx_flags(VXF_HIDE_NETIF, 0) ||
++		dev_in_nx_info(fi->fib_dev, current->nx_info)))
+ 		snprintf(bf, sizeof(bf),
+ 			 "%s\t%08X\t%08X\t%04X\t%d\t%u\t%d\t%08X\t%d\t%u\t%u",
+ 			 fi->fib_dev ? fi->fib_dev->name : "*", prefix,
+--- linux-2.6.22/net/ipv4/inet_connection_sock.c	2007-07-09 13:20:05 +0200
++++ linux-2.6.22-vs2.2.0-rc5/net/ipv4/inet_connection_sock.c	2007-06-15 02:37:04 +0200
+@@ -37,7 +37,6 @@ int sysctl_local_port_range[2] = { 32768
+ int inet_csk_bind_conflict(const struct sock *sk,
+ 			   const struct inet_bind_bucket *tb)
+ {
+-	const __be32 sk_rcv_saddr = inet_rcv_saddr(sk);
+ 	struct sock *sk2;
+ 	struct hlist_node *node;
+ 	int reuse = sk->sk_reuse;
+@@ -50,9 +49,8 @@ int inet_csk_bind_conflict(const struct 
+ 		     sk->sk_bound_dev_if == sk2->sk_bound_dev_if)) {
+ 			if (!reuse || !sk2->sk_reuse ||
+ 			    sk2->sk_state == TCP_LISTEN) {
+-				const __be32 sk2_rcv_saddr = inet_rcv_saddr(sk2);
+-				if (!sk2_rcv_saddr || !sk_rcv_saddr ||
+-				    sk2_rcv_saddr == sk_rcv_saddr)
++				if (nx_addr_conflict(sk->sk_nx_info,
++					inet_rcv_saddr(sk), sk2))
+ 					break;
+ 			}
+ 		}
+--- linux-2.6.22/net/ipv4/inet_diag.c	2007-07-09 13:20:05 +0200
++++ linux-2.6.22-vs2.2.0-rc5/net/ipv4/inet_diag.c	2007-06-15 02:37:04 +0200
+@@ -697,6 +697,8 @@ static int inet_diag_dump(struct sk_buff
+ 			sk_for_each(sk, node, &hashinfo->listening_hash[i]) {
+ 				struct inet_sock *inet = inet_sk(sk);
+ 
++				if (!nx_check(sk->sk_nid, VS_WATCH_P | VS_IDENT))
++					continue;
+ 				if (num < s_num) {
+ 					num++;
+ 					continue;
+@@ -757,6 +759,8 @@ skip_listen_ht:
+ 		sk_for_each(sk, node, &head->chain) {
+ 			struct inet_sock *inet = inet_sk(sk);
+ 
++			if (!nx_check(sk->sk_nid, VS_WATCH_P | VS_IDENT))
++				continue;
+ 			if (num < s_num)
+ 				goto next_normal;
+ 			if (!(r->idiag_states & (1 << sk->sk_state)))
+@@ -781,6 +785,8 @@ next_normal:
+ 			inet_twsk_for_each(tw, node,
+ 				    &head->twchain) {
+ 
++				if (!nx_check(tw->tw_nid, VS_WATCH_P | VS_IDENT))
++					continue;
+ 				if (num < s_num)
+ 					goto next_dying;
+ 				if (r->id.idiag_sport != tw->tw_sport &&
+--- linux-2.6.22/net/ipv4/inet_hashtables.c	2007-05-02 19:25:40 +0200
++++ linux-2.6.22-vs2.2.0-rc5/net/ipv4/inet_hashtables.c	2007-06-15 02:37:04 +0200
+@@ -140,11 +140,10 @@ static struct sock *inet_lookup_listener
+ 			const __be32 rcv_saddr = inet->rcv_saddr;
+ 			int score = sk->sk_family == PF_INET ? 1 : 0;
+ 
+-			if (rcv_saddr) {
+-				if (rcv_saddr != daddr)
+-					continue;
++			if (inet_addr_match(sk->sk_nx_info, daddr, rcv_saddr))
+ 				score += 2;
+-			}
++			else
++				continue;
+ 			if (sk->sk_bound_dev_if) {
+ 				if (sk->sk_bound_dev_if != dif)
+ 					continue;
+@@ -175,7 +174,7 @@ struct sock *__inet_lookup_listener(stru
+ 		const struct inet_sock *inet = inet_sk((sk = __sk_head(head)));
+ 
+ 		if (inet->num == hnum && !sk->sk_node.next &&
+-		    (!inet->rcv_saddr || inet->rcv_saddr == daddr) &&
++		    inet_addr_match(sk->sk_nx_info, daddr, inet->rcv_saddr) &&
+ 		    (sk->sk_family == PF_INET || !ipv6_only_sock(sk)) &&
+ 		    !sk->sk_bound_dev_if)
+ 			goto sherry_cache;
+--- linux-2.6.22/net/ipv4/raw.c	2007-07-09 13:20:06 +0200
++++ linux-2.6.22-vs2.2.0-rc5/net/ipv4/raw.c	2007-06-15 02:37:04 +0200
+@@ -101,6 +101,27 @@ static void raw_v4_unhash(struct sock *s
+ 	write_unlock_bh(&raw_v4_lock);
+ }
+ 
++
++/*
++ *	Check if a given address matches for a socket
++ *
++ *	nxi:		the socket's nx_info if any
++ *	addr:		to be verified address
++ *	saddr/baddr:	socket addresses
++ */
++static inline int raw_addr_match (
++	struct nx_info *nxi,
++	uint32_t addr,
++	uint32_t saddr,
++	uint32_t baddr)
++{
++	if (addr && (saddr == addr || baddr == addr))
++		return 1;
++	if (!saddr)
++		return addr_in_nx_info(nxi, addr);
++	return 0;
++}
++
+ struct sock *__raw_v4_lookup(struct sock *sk, unsigned short num,
+ 			     __be32 raddr, __be32 laddr,
+ 			     int dif)
+@@ -112,7 +133,8 @@ struct sock *__raw_v4_lookup(struct sock
+ 
+ 		if (inet->num == num 					&&
+ 		    !(inet->daddr && inet->daddr != raddr) 		&&
+-		    !(inet->rcv_saddr && inet->rcv_saddr != laddr)	&&
++		    raw_addr_match(sk->sk_nx_info, laddr,
++			inet->rcv_saddr, inet->rcv_saddr2)		&&
+ 		    !(sk->sk_bound_dev_if && sk->sk_bound_dev_if != dif))
+ 			goto found; /* gotcha */
+ 	}
+@@ -314,6 +336,11 @@ static int raw_send_hdrinc(struct sock *
+ 		iph->check = ip_fast_csum((unsigned char *)iph, iph->ihl);
+ 	}
+ 
++	err = -EPERM;
++	if (!nx_check(0, VS_ADMIN) && !capable(CAP_NET_RAW)
++		&& (!addr_in_nx_info(sk->sk_nx_info, iph->saddr)))
++		goto error_free;
++
+ 	err = NF_HOOK(PF_INET, NF_IP_LOCAL_OUT, skb, NULL, rt->u.dst.dev,
+ 		      dst_output);
+ 	if (err > 0)
+@@ -325,6 +352,7 @@ out:
+ 
+ error_fault:
+ 	err = -EFAULT;
++error_free:
+ 	kfree_skb(skb);
+ error:
+ 	IP_INC_STATS(IPSTATS_MIB_OUTDISCARDS);
+@@ -491,6 +519,12 @@ static int raw_sendmsg(struct kiocb *ioc
+ 		}
+ 
+ 		security_sk_classify_flow(sk, &fl);
++		if (sk->sk_nx_info) {
++			err = ip_find_src(sk->sk_nx_info, &rt, &fl);
++
++			if (err)
++				goto done;
++		}
+ 		err = ip_route_output_flow(&rt, &fl, sk, 1);
+ 	}
+ 	if (err)
+@@ -795,7 +829,8 @@ static struct sock *raw_get_first(struct
+ 		struct hlist_node *node;
+ 
+ 		sk_for_each(sk, node, &raw_v4_htable[state->bucket])
+-			if (sk->sk_family == PF_INET)
++			if (sk->sk_family == PF_INET &&
++				nx_check(sk->sk_nid, VS_WATCH_P | VS_IDENT))
+ 				goto found;
+ 	}
+ 	sk = NULL;
+@@ -811,7 +846,8 @@ static struct sock *raw_get_next(struct 
+ 		sk = sk_next(sk);
+ try_again:
+ 		;
+-	} while (sk && sk->sk_family != PF_INET);
++	} while (sk && (sk->sk_family != PF_INET ||
++		!nx_check(sk->sk_nid, VS_WATCH_P | VS_IDENT)));
+ 
+ 	if (!sk && ++state->bucket < RAWV4_HTABLE_SIZE) {
+ 		sk = sk_head(&raw_v4_htable[state->bucket]);
+--- linux-2.6.22/net/ipv4/tcp.c	2007-07-09 13:20:06 +0200
++++ linux-2.6.22-vs2.2.0-rc5/net/ipv4/tcp.c	2007-07-07 03:52:54 +0200
+@@ -258,6 +258,7 @@
+ #include <linux/cache.h>
+ #include <linux/err.h>
+ #include <linux/crypto.h>
++#include <linux/in.h>
+ 
+ #include <net/icmp.h>
+ #include <net/tcp.h>
+--- linux-2.6.22/net/ipv4/tcp_ipv4.c	2007-07-09 13:20:06 +0200
++++ linux-2.6.22-vs2.2.0-rc5/net/ipv4/tcp_ipv4.c	2007-06-17 05:54:20 +0200
+@@ -1975,6 +1975,12 @@ static void *listening_get_next(struct s
+ 		req = req->dl_next;
+ 		while (1) {
+ 			while (req) {
++				vxdprintk(VXD_CBIT(net, 6),
++					"sk,req: %p [#%d] (from %d)", req->sk,
++					(req->sk)?req->sk->sk_nid:0, nx_current_nid());
++				if (req->sk &&
++					!nx_check(req->sk->sk_nid, VS_WATCH_P | VS_IDENT))
++					continue;
+ 				if (req->rsk_ops->family == st->family) {
+ 					cur = req;
+ 					goto out;
+@@ -1999,6 +2005,10 @@ get_req:
+ 	}
+ get_sk:
+ 	sk_for_each_from(sk, node) {
++		vxdprintk(VXD_CBIT(net, 6), "sk: %p [#%d] (from %d)",
++			sk, sk->sk_nid, nx_current_nid());
++		if (!nx_check(sk->sk_nid, VS_WATCH_P | VS_IDENT))
++			continue;
+ 		if (sk->sk_family == st->family) {
+ 			cur = sk;
+ 			goto out;
+@@ -2050,18 +2060,26 @@ static void *established_get_first(struc
+ 
+ 		read_lock(&tcp_hashinfo.ehash[st->bucket].lock);
+ 		sk_for_each(sk, node, &tcp_hashinfo.ehash[st->bucket].chain) {
+-			if (sk->sk_family != st->family) {
++			vxdprintk(VXD_CBIT(net, 6),
++				"sk,egf: %p [#%d] (from %d)",
++				sk, sk->sk_nid, nx_current_nid());
++			if (!nx_check(sk->sk_nid, VS_WATCH_P | VS_IDENT))
++				continue;
++			if (sk->sk_family != st->family)
+ 				continue;
+-			}
+ 			rc = sk;
+ 			goto out;
+ 		}
+ 		st->state = TCP_SEQ_STATE_TIME_WAIT;
+ 		inet_twsk_for_each(tw, node,
+ 				   &tcp_hashinfo.ehash[st->bucket].twchain) {
+-			if (tw->tw_family != st->family) {
++			vxdprintk(VXD_CBIT(net, 6),
++				"tw: %p [#%d] (from %d)",
++				tw, tw->tw_nid, nx_current_nid());
++			if (!nx_check(tw->tw_nid, VS_WATCH_P | VS_IDENT))
++				continue;
++			if (tw->tw_family != st->family)
+ 				continue;
+-			}
+ 			rc = tw;
+ 			goto out;
+ 		}
+@@ -2085,7 +2103,8 @@ static void *established_get_next(struct
+ 		tw = cur;
+ 		tw = tw_next(tw);
+ get_tw:
+-		while (tw && tw->tw_family != st->family) {
++		while (tw && (tw->tw_family != st->family ||
++			!nx_check(tw->tw_nid, VS_WATCH_P | VS_IDENT))) {
+ 			tw = tw_next(tw);
+ 		}
+ 		if (tw) {
+@@ -2109,6 +2128,11 @@ get_tw:
+ 		sk = sk_next(sk);
+ 
+ 	sk_for_each_from(sk, node) {
++		vxdprintk(VXD_CBIT(net, 6),
++			"sk,egn: %p [#%d] (from %d)",
++			sk, sk->sk_nid, nx_current_nid());
++		if (!nx_check(sk->sk_nid, VS_WATCH_P | VS_IDENT))
++			continue;
+ 		if (sk->sk_family == st->family)
+ 			goto found;
+ 	}
+--- linux-2.6.22/net/ipv4/tcp_minisocks.c	2007-07-09 13:20:06 +0200
++++ linux-2.6.22-vs2.2.0-rc5/net/ipv4/tcp_minisocks.c	2007-06-15 02:37:04 +0200
+@@ -28,6 +28,10 @@
+ #include <net/inet_common.h>
+ #include <net/xfrm.h>
+ 
++#include <linux/vs_limit.h>
++#include <linux/vs_socket.h>
++#include <linux/vs_context.h>
++
+ #ifdef CONFIG_SYSCTL
+ #define SYNC_INIT 0 /* let the user enable it */
+ #else
+@@ -293,6 +297,11 @@ void tcp_time_wait(struct sock *sk, int 
+ 		tcptw->tw_ts_recent	= tp->rx_opt.ts_recent;
+ 		tcptw->tw_ts_recent_stamp = tp->rx_opt.ts_recent_stamp;
+ 
++		tw->tw_xid		= sk->sk_xid;
++		tw->tw_vx_info		= NULL;
++		tw->tw_nid		= sk->sk_nid;
++		tw->tw_nx_info		= NULL;
++
+ #if defined(CONFIG_IPV6) || defined(CONFIG_IPV6_MODULE)
+ 		if (tw->tw_family == PF_INET6) {
+ 			struct ipv6_pinfo *np = inet6_sk(sk);
+--- linux-2.6.22/net/ipv4/udp.c	2007-07-09 13:20:06 +0200
++++ linux-2.6.22-vs2.2.0-rc5/net/ipv4/udp.c	2007-06-17 06:02:02 +0200
+@@ -221,11 +221,8 @@ int udp_get_port(struct sock *sk, unsign
+ 
+ int ipv4_rcv_saddr_equal(const struct sock *sk1, const struct sock *sk2)
+ {
+-	struct inet_sock *inet1 = inet_sk(sk1), *inet2 = inet_sk(sk2);
+-
+ 	return 	( !ipv6_only_sock(sk2)  &&
+-		  (!inet1->rcv_saddr || !inet2->rcv_saddr ||
+-		   inet1->rcv_saddr == inet2->rcv_saddr      ));
++		   nx_addr_conflict(sk1->sk_nx_info, inet_rcv_saddr(sk1), sk2));
+ }
+ 
+ static inline int udp_v4_get_port(struct sock *sk, unsigned short snum)
+@@ -246,15 +243,22 @@ static struct sock *__udp4_lib_lookup(__
+ 	int badness = -1;
+ 
+ 	read_lock(&udp_hash_lock);
++
+ 	sk_for_each(sk, node, &udptable[hnum & (UDP_HTABLE_SIZE - 1)]) {
+ 		struct inet_sock *inet = inet_sk(sk);
+ 
+ 		if (sk->sk_hash == hnum && !ipv6_only_sock(sk)) {
+ 			int score = (sk->sk_family == PF_INET ? 1 : 0);
++
+ 			if (inet->rcv_saddr) {
+ 				if (inet->rcv_saddr != daddr)
+ 					continue;
+ 				score+=2;
++			} else if (sk->sk_nx_info) {
++				if (addr_in_nx_info(sk->sk_nx_info, daddr))
++					score+=2;
++				else
++					continue;
+ 			}
+ 			if (inet->daddr) {
+ 				if (inet->daddr != saddr)
+@@ -280,6 +284,7 @@ static struct sock *__udp4_lib_lookup(__
+ 			}
+ 		}
+ 	}
++
+ 	if (result)
+ 		sock_hold(result);
+ 	read_unlock(&udp_hash_lock);
+@@ -301,7 +306,8 @@ static inline struct sock *udp_v4_mcast_
+ 		if (s->sk_hash != hnum					||
+ 		    (inet->daddr && inet->daddr != rmt_addr)		||
+ 		    (inet->dport != rmt_port && inet->dport)		||
+-		    (inet->rcv_saddr && inet->rcv_saddr != loc_addr)	||
++		    (inet->rcv_saddr && inet->rcv_saddr != loc_addr &&
++		     inet->rcv_saddr2 && inet->rcv_saddr2 != loc_addr)	||
+ 		    ipv6_only_sock(s)					||
+ 		    (s->sk_bound_dev_if && s->sk_bound_dev_if != dif))
+ 			continue;
+@@ -631,7 +637,20 @@ int udp_sendmsg(struct kiocb *iocb, stru
+ 				    .uli_u = { .ports =
+ 					       { .sport = inet->sport,
+ 						 .dport = dport } } };
++		struct nx_info *nxi = sk->sk_nx_info;
++
+ 		security_sk_classify_flow(sk, &fl);
++		if (nxi) {
++			err = ip_find_src(nxi, &rt, &fl);
++			if (err)
++				goto out;
++			if (daddr == IPI_LOOPBACK && !nx_check(0, VS_ADMIN))
++				daddr = fl.fl4_dst = nxi->ipv4[0];
++#ifdef CONFIG_VSERVER_REMAP_SADDR
++			if (saddr == IPI_LOOPBACK && !nx_check(0, VS_ADMIN))
++				saddr = fl.fl4_src = nxi->ipv4[0];
++#endif
++		}
+ 		err = ip_route_output_flow(&rt, &fl, sk, 1);
+ 		if (err) {
+ 			if (err == -ENETUNREACH)
+@@ -1551,7 +1570,8 @@ static struct sock *udp_get_first(struct
+ 	for (state->bucket = 0; state->bucket < UDP_HTABLE_SIZE; ++state->bucket) {
+ 		struct hlist_node *node;
+ 		sk_for_each(sk, node, state->hashtable + state->bucket) {
+-			if (sk->sk_family == state->family)
++			if (sk->sk_family == state->family &&
++				nx_check(sk->sk_nid, VS_WATCH_P | VS_IDENT))
+ 				goto found;
+ 		}
+ 	}
+@@ -1568,7 +1588,8 @@ static struct sock *udp_get_next(struct 
+ 		sk = sk_next(sk);
+ try_again:
+ 		;
+-	} while (sk && sk->sk_family != state->family);
++	} while (sk && (sk->sk_family != state->family ||
++		!nx_check(sk->sk_nid, VS_WATCH_P | VS_IDENT)));
+ 
+ 	if (!sk && ++state->bucket < UDP_HTABLE_SIZE) {
+ 		sk = sk_head(state->hashtable + state->bucket);
+--- linux-2.6.22/net/ipv6/addrconf.c	2007-07-09 13:20:06 +0200
++++ linux-2.6.22-vs2.2.0-rc5/net/ipv6/addrconf.c	2007-06-17 05:54:20 +0200
+@@ -2771,7 +2771,10 @@ static void if6_seq_stop(struct seq_file
+ static int if6_seq_show(struct seq_file *seq, void *v)
+ {
+ 	struct inet6_ifaddr *ifp = (struct inet6_ifaddr *)v;
+-	seq_printf(seq,
++
++	/* no ipv6 inside a vserver for now */
++	if (nx_check(0, VS_ADMIN|VS_WATCH))
++		seq_printf(seq,
+ 		   NIP6_SEQFMT " %02x %02x %02x %02x %8s\n",
+ 		   NIP6(ifp->addr),
+ 		   ifp->idev->dev->ifindex,
+@@ -3254,6 +3257,10 @@ static int inet6_dump_addr(struct sk_buf
+ 	struct ifmcaddr6 *ifmca;
+ 	struct ifacaddr6 *ifaca;
+ 
++	/* no ipv6 inside a vserver for now */
++	if (skb->sk && skb->sk->sk_vx_info)
++		return skb->len;
++
+ 	s_idx = cb->args[0];
+ 	s_ip_idx = ip_idx = cb->args[1];
+ 
+@@ -3577,6 +3584,10 @@ static int inet6_dump_ifinfo(struct sk_b
+ 	struct net_device *dev;
+ 	struct inet6_dev *idev;
+ 
++	/* no ipv6 inside a vserver for now */
++	if (skb->sk && skb->sk->sk_vx_info)
++		return skb->len;
++
+ 	read_lock(&dev_base_lock);
+ 	idx = 0;
+ 	for_each_netdev(dev) {
+--- linux-2.6.22/net/netlink/af_netlink.c	2007-07-09 13:20:07 +0200
++++ linux-2.6.22-vs2.2.0-rc5/net/netlink/af_netlink.c	2007-06-15 05:43:32 +0200
+@@ -56,6 +56,9 @@
+ #include <linux/audit.h>
+ #include <linux/selinux.h>
+ #include <linux/mutex.h>
++#include <linux/vs_context.h>
++#include <linux/vs_network.h>
++#include <linux/vs_limit.h>
+ 
+ #include <net/sock.h>
+ #include <net/scm.h>
+--- linux-2.6.22/net/socket.c	2007-07-09 13:20:13 +0200
++++ linux-2.6.22-vs2.2.0-rc5/net/socket.c	2007-06-15 02:37:04 +0200
+@@ -92,6 +92,8 @@
+ 
+ #include <net/sock.h>
+ #include <linux/netfilter.h>
++#include <linux/vs_base.h>
++#include <linux/vs_socket.h>
+ 
+ static int sock_no_open(struct inode *irrelevant, struct file *dontcare);
+ static ssize_t sock_aio_read(struct kiocb *iocb, const struct iovec *iov,
+@@ -543,7 +545,7 @@ static inline int __sock_sendmsg(struct 
+ 				 struct msghdr *msg, size_t size)
+ {
+ 	struct sock_iocb *si = kiocb_to_siocb(iocb);
+-	int err;
++	int err, len;
+ 
+ 	si->sock = sock;
+ 	si->scm = NULL;
+@@ -554,7 +556,22 @@ static inline int __sock_sendmsg(struct 
+ 	if (err)
+ 		return err;
+ 
+-	return sock->ops->sendmsg(iocb, sock, msg, size);
++	len = sock->ops->sendmsg(iocb, sock, msg, size);
++	if (sock->sk) {
++		if (len == size)
++			vx_sock_send(sock->sk, size);
++		else
++			vx_sock_fail(sock->sk, size);
++	}
++	vxdprintk(VXD_CBIT(net, 7),
++		"__sock_sendmsg: %p[%p,%p,%p;%d/%d]:%d/%d",
++		sock, sock->sk,
++		(sock->sk)?sock->sk->sk_nx_info:0,
++		(sock->sk)?sock->sk->sk_vx_info:0,
++		(sock->sk)?sock->sk->sk_xid:0,
++		(sock->sk)?sock->sk->sk_nid:0,
++		(unsigned int)size, len);
++	return len;
+ }
+ 
+ int sock_sendmsg(struct socket *sock, struct msghdr *msg, size_t size)
+@@ -623,7 +640,7 @@ EXPORT_SYMBOL_GPL(__sock_recv_timestamp)
+ static inline int __sock_recvmsg(struct kiocb *iocb, struct socket *sock,
+ 				 struct msghdr *msg, size_t size, int flags)
+ {
+-	int err;
++	int err, len;
+ 	struct sock_iocb *si = kiocb_to_siocb(iocb);
+ 
+ 	si->sock = sock;
+@@ -636,7 +653,18 @@ static inline int __sock_recvmsg(struct 
+ 	if (err)
+ 		return err;
+ 
+-	return sock->ops->recvmsg(iocb, sock, msg, size, flags);
++	len = sock->ops->recvmsg(iocb, sock, msg, size, flags);
++	if ((len >= 0) && sock->sk)
++		vx_sock_recv(sock->sk, len);
++	vxdprintk(VXD_CBIT(net, 7),
++		"__sock_recvmsg: %p[%p,%p,%p;%d/%d]:%d/%d",
++		sock, sock->sk,
++		(sock->sk)?sock->sk->sk_nx_info:0,
++		(sock->sk)?sock->sk->sk_vx_info:0,
++		(sock->sk)?sock->sk->sk_xid:0,
++		(sock->sk)?sock->sk->sk_nid:0,
++		(unsigned int)size, len);
++	return len;
+ }
+ 
+ int sock_recvmsg(struct socket *sock, struct msghdr *msg,
+@@ -1090,6 +1118,10 @@ static int __sock_create(int family, int
+ 	if (type < 0 || type >= SOCK_MAX)
+ 		return -EINVAL;
+ 
++	/* disable IPv6 inside vservers for now */
++	if (family == PF_INET6 && !nx_check(0, VS_ADMIN))
++		return -EAFNOSUPPORT;
++
+ 	/* Compatibility.
+ 
+ 	   This uglymoron is moved from INET layer to here to avoid
+@@ -1207,6 +1239,7 @@ asmlinkage long sys_socket(int family, i
+ 	if (retval < 0)
+ 		goto out;
+ 
++	set_bit(SOCK_USER_SOCKET, &sock->flags);
+ 	retval = sock_map_fd(sock);
+ 	if (retval < 0)
+ 		goto out_release;
+@@ -1239,10 +1272,12 @@ asmlinkage long sys_socketpair(int famil
+ 	err = sock_create(family, type, protocol, &sock1);
+ 	if (err < 0)
+ 		goto out;
++	set_bit(SOCK_USER_SOCKET, &sock1->flags);
+ 
+ 	err = sock_create(family, type, protocol, &sock2);
+ 	if (err < 0)
+ 		goto out_release_1;
++	set_bit(SOCK_USER_SOCKET, &sock2->flags);
+ 
+ 	err = sock1->ops->socketpair(sock1, sock2);
+ 	if (err < 0)
+--- linux-2.6.22/net/sunrpc/auth.c	2007-05-02 19:25:48 +0200
++++ linux-2.6.22-vs2.2.0-rc5/net/sunrpc/auth.c	2007-06-15 02:37:04 +0200
+@@ -13,6 +13,7 @@
+ #include <linux/errno.h>
+ #include <linux/sunrpc/clnt.h>
+ #include <linux/spinlock.h>
++#include <linux/vs_tag.h>
+ 
+ #ifdef RPC_DEBUG
+ # define RPCDBG_FACILITY	RPCDBG_AUTH
+@@ -263,6 +264,7 @@ rpcauth_lookupcred(struct rpc_auth *auth
+ 	struct auth_cred acred = {
+ 		.uid = current->fsuid,
+ 		.gid = current->fsgid,
++		.tag = dx_current_tag(),
+ 		.group_info = current->group_info,
+ 	};
+ 	struct rpc_cred *ret;
+@@ -282,6 +284,7 @@ rpcauth_bindcred(struct rpc_task *task)
+ 	struct auth_cred acred = {
+ 		.uid = current->fsuid,
+ 		.gid = current->fsgid,
++		.tag = dx_current_tag(),
+ 		.group_info = current->group_info,
+ 	};
+ 	struct rpc_cred *ret;
+--- linux-2.6.22/net/sunrpc/auth_unix.c	2007-05-02 19:25:48 +0200
++++ linux-2.6.22-vs2.2.0-rc5/net/sunrpc/auth_unix.c	2007-06-15 02:37:04 +0200
+@@ -11,12 +11,14 @@
+ #include <linux/module.h>
+ #include <linux/sunrpc/clnt.h>
+ #include <linux/sunrpc/auth.h>
++#include <linux/vs_tag.h>
+ 
+ #define NFS_NGROUPS	16
+ 
+ struct unx_cred {
+ 	struct rpc_cred		uc_base;
+ 	gid_t			uc_gid;
++	tag_t			uc_tag;
+ 	gid_t			uc_gids[NFS_NGROUPS];
+ };
+ #define uc_uid			uc_base.cr_uid
+@@ -79,6 +81,7 @@ unx_create_cred(struct rpc_auth *auth, s
+ 	if (flags & RPCAUTH_LOOKUP_ROOTCREDS) {
+ 		cred->uc_uid = 0;
+ 		cred->uc_gid = 0;
++		cred->uc_tag = dx_current_tag();
+ 		cred->uc_gids[0] = NOGROUP;
+ 	} else {
+ 		int groups = acred->group_info->ngroups;
+@@ -87,6 +90,7 @@ unx_create_cred(struct rpc_auth *auth, s
+ 
+ 		cred->uc_uid = acred->uid;
+ 		cred->uc_gid = acred->gid;
++		cred->uc_tag = acred->tag;
+ 		for (i = 0; i < groups; i++)
+ 			cred->uc_gids[i] = GROUP_AT(acred->group_info, i);
+ 		if (i < NFS_NGROUPS)
+@@ -118,7 +122,8 @@ unx_match(struct auth_cred *acred, struc
+ 		int groups;
+ 
+ 		if (cred->uc_uid != acred->uid
+-		 || cred->uc_gid != acred->gid)
++		 || cred->uc_gid != acred->gid
++		 || cred->uc_tag != acred->tag)
+ 			return 0;
+ 
+ 		groups = acred->group_info->ngroups;
+@@ -144,7 +149,7 @@ unx_marshal(struct rpc_task *task, __be3
+ 	struct rpc_clnt	*clnt = task->tk_client;
+ 	struct unx_cred	*cred = (struct unx_cred *) task->tk_msg.rpc_cred;
+ 	__be32		*base, *hold;
+-	int		i;
++	int		i, tag;
+ 
+ 	*p++ = htonl(RPC_AUTH_UNIX);
+ 	base = p++;
+@@ -154,9 +159,12 @@ unx_marshal(struct rpc_task *task, __be3
+ 	 * Copy the UTS nodename captured when the client was created.
+ 	 */
+ 	p = xdr_encode_array(p, clnt->cl_nodename, clnt->cl_nodelen);
++	tag = task->tk_client->cl_tag;
+ 
+-	*p++ = htonl((u32) cred->uc_uid);
+-	*p++ = htonl((u32) cred->uc_gid);
++	*p++ = htonl((u32) TAGINO_UID(tag,
++		cred->uc_uid, cred->uc_tag));
++	*p++ = htonl((u32) TAGINO_GID(tag,
++		cred->uc_gid, cred->uc_tag));
+ 	hold = p++;
+ 	for (i = 0; i < 16 && cred->uc_gids[i] != (gid_t) NOGROUP; i++)
+ 		*p++ = htonl((u32) cred->uc_gids[i]);
+--- linux-2.6.22/net/sunrpc/clnt.c	2007-07-09 13:20:13 +0200
++++ linux-2.6.22-vs2.2.0-rc5/net/sunrpc/clnt.c	2007-06-15 02:37:04 +0200
+@@ -30,6 +30,7 @@
+ #include <linux/smp_lock.h>
+ #include <linux/utsname.h>
+ #include <linux/workqueue.h>
++#include <linux/vs_cvirt.h>
+ 
+ #include <linux/sunrpc/clnt.h>
+ #include <linux/sunrpc/rpc_pipe_fs.h>
+@@ -249,7 +250,9 @@ struct rpc_clnt *rpc_create(struct rpc_c
+ 		clnt->cl_oneshot = 1;
+ 	if (args->flags & RPC_CLNT_CREATE_DISCRTRY)
+ 		clnt->cl_discrtry = 1;
+-
++	/* TODO: handle RPC_CLNT_CREATE_TAGGED
++	if (args->flags & RPC_CLNT_CREATE_TAGGED)
++		clnt->cl_tag = 1; */
+ 	return clnt;
+ }
+ EXPORT_SYMBOL_GPL(rpc_create);
+--- linux-2.6.22/net/unix/af_unix.c	2007-07-09 13:20:13 +0200
++++ linux-2.6.22-vs2.2.0-rc5/net/unix/af_unix.c	2007-06-17 05:54:20 +0200
+@@ -115,6 +115,8 @@
+ #include <linux/mount.h>
+ #include <net/checksum.h>
+ #include <linux/security.h>
++#include <linux/vs_context.h>
++#include <linux/vs_limit.h>
+ 
+ int sysctl_unix_max_dgram_qlen __read_mostly = 10;
+ 
+@@ -252,6 +254,8 @@ static struct sock *__unix_find_socket_b
+ 	sk_for_each(s, node, &unix_socket_table[hash ^ type]) {
+ 		struct unix_sock *u = unix_sk(s);
+ 
++		if (!nx_check(s->sk_nid, VS_WATCH_P | VS_IDENT))
++			continue;
+ 		if (u->addr->len == len &&
+ 		    !memcmp(u->addr->name, sunname, len))
+ 			goto found;
+@@ -807,7 +811,7 @@ static int unix_bind(struct socket *sock
+ 		 */
+ 		mode = S_IFSOCK |
+ 		       (SOCK_INODE(sock)->i_mode & ~current->fs->umask);
+-		err = vfs_mknod(nd.dentry->d_inode, dentry, mode, 0);
++		err = vfs_mknod(nd.dentry->d_inode, dentry, mode, 0, NULL);
+ 		if (err)
+ 			goto out_mknod_dput;
+ 		mutex_unlock(&nd.dentry->d_inode->i_mutex);
+--- linux-2.6.22/net/x25/af_x25.c	2007-07-09 13:20:13 +0200
++++ linux-2.6.22-vs2.2.0-rc5/net/x25/af_x25.c	2007-06-15 02:37:04 +0200
+@@ -500,7 +500,10 @@ static int x25_create(struct socket *soc
+ 
+ 	x25 = x25_sk(sk);
+ 
+-	sock_init_data(sock, sk);
++	sk->sk_socket = sock;
++	sk->sk_type = sock->type;
++	sk->sk_sleep = &sock->wait;
++	sock->sk = sk;
+ 
+ 	x25_init_timers(sk);
+ 
+--- linux-2.6.22/security/Kconfig	2006-11-30 21:19:47 +0100
++++ linux-2.6.22-vs2.2.0-rc5/security/Kconfig	2007-06-15 02:37:04 +0200
+@@ -6,6 +6,7 @@ menu "Security options"
+ 
+ config KEYS
+ 	bool "Enable access key retention support"
++	depends on !VSERVER_SECURITY
+ 	help
+ 	  This option provides support for retaining authentication tokens and
+ 	  access keys in the kernel.
+--- linux-2.6.22/security/commoncap.c	2007-07-09 13:20:14 +0200
++++ linux-2.6.22-vs2.2.0-rc5/security/commoncap.c	2007-06-15 02:37:04 +0200
+@@ -22,10 +22,11 @@
+ #include <linux/ptrace.h>
+ #include <linux/xattr.h>
+ #include <linux/hugetlb.h>
++#include <linux/vs_context.h>
+ 
+ int cap_netlink_send(struct sock *sk, struct sk_buff *skb)
+ {
+-	NETLINK_CB(skb).eff_cap = current->cap_effective;
++	cap_t(NETLINK_CB(skb).eff_cap) = vx_mbcap(cap_effective);
+ 	return 0;
+ }
+ 
+@@ -43,7 +44,7 @@ EXPORT_SYMBOL(cap_netlink_recv);
+ int cap_capable (struct task_struct *tsk, int cap)
+ {
+ 	/* Derived from include/linux/sched.h:capable. */
+-	if (cap_raised(tsk->cap_effective, cap))
++       if (vx_cap_raised(tsk->vx_info, tsk->cap_effective, cap))
+ 		return 0;
+ 	return -EPERM;
+ }
+@@ -141,7 +142,8 @@ void cap_bprm_apply_creds (struct linux_
+ 	/* Derived from fs/exec.c:compute_creds. */
+ 	kernel_cap_t new_permitted, working;
+ 
+-	new_permitted = cap_intersect (bprm->cap_permitted, cap_bset);
++	new_permitted = cap_intersect (bprm->cap_permitted,
++					vx_current_cap_bset());
+ 	working = cap_intersect (bprm->cap_inheritable,
+ 				 current->cap_inheritable);
+ 	new_permitted = cap_combine (new_permitted, working);
+@@ -310,7 +312,8 @@ void cap_task_reparent_to_init (struct t
+ 
+ int cap_syslog (int type)
+ {
+-	if ((type != 3 && type != 10) && !capable(CAP_SYS_ADMIN))
++	if ((type != 3 && type != 10) &&
++		!vx_capable(CAP_SYS_ADMIN, VXC_SYSLOG))
+ 		return -EPERM;
+ 	return 0;
+ }
+--- linux-2.6.22/security/dummy.c	2007-05-02 19:25:51 +0200
++++ linux-2.6.22-vs2.2.0-rc5/security/dummy.c	2007-06-15 02:37:04 +0200
+@@ -28,6 +28,7 @@
+ #include <linux/hugetlb.h>
+ #include <linux/ptrace.h>
+ #include <linux/file.h>
++#include <linux/vs_context.h>
+ 
+ static int dummy_ptrace (struct task_struct *parent, struct task_struct *child)
+ {
+@@ -678,7 +679,7 @@ static int dummy_sem_semop (struct sem_a
+ 
+ static int dummy_netlink_send (struct sock *sk, struct sk_buff *skb)
+ {
+-	NETLINK_CB(skb).eff_cap = current->cap_effective;
++	cap_t(NETLINK_CB(skb).eff_cap) = vx_mbcap(cap_effective);
+ 	return 0;
+ }
+ 

Added: dists/sid/linux-2.6/debian/patches/features/alpha/titan-video.patch
==============================================================================
--- (empty file)
+++ dists/sid/linux-2.6/debian/patches/features/alpha/titan-video.patch	Mon Nov 26 20:06:56 2007
@@ -0,0 +1,720 @@
+diff -uNr source/arch/alpha/Kconfig source-es45/arch/alpha/Kconfig
+--- source/arch/alpha/Kconfig	2006-09-19 20:42:06.000000000 -0700
++++ source-es45/arch/alpha/Kconfig	2006-09-30 03:14:44.000000000 -0700
+@@ -469,6 +469,11 @@
+ 	depends on ALPHA_GENERIC || ALPHA_PC164
+ 	default y
+ 
++config VGA_HOSE
++	bool "VGA on arbitrary hose"
++	depends on ALPHA_GENERIC || ALPHA_TITAN || ALPHA_MARVEL || ALPHA_TSUNAMI
++	default y
++
+ config ALPHA_SRM
+ 	bool "Use SRM as bootloader" if ALPHA_CABRIOLET || ALPHA_AVANTI_CH || ALPHA_EB64P || ALPHA_PC164 || ALPHA_TAKARA || ALPHA_EB164 || ALPHA_ALCOR || ALPHA_MIATA || ALPHA_LX164 || ALPHA_SX164 || ALPHA_NAUTILUS || ALPHA_NONAME
+ 	default y if ALPHA_JENSEN || ALPHA_MIKASA || ALPHA_SABLE || ALPHA_LYNX || ALPHA_NORITAKE || ALPHA_DP264 || ALPHA_RAWHIDE || ALPHA_EIGER || ALPHA_WILDFIRE || ALPHA_TITAN || ALPHA_SHARK || ALPHA_MARVEL
+@@ -626,6 +631,13 @@
+ 
+ source "drivers/Kconfig"
+ 
++# DUMMY_CONSOLE may be defined in drivers/video/console/Kconfig
++# but we also need it if VGA_HOSE is set
++config DUMMY_CONSOLE
++	bool
++	depends on VGA_HOSE
++	default y
++
+ source "fs/Kconfig"
+
+ source "arch/alpha/oprofile/Kconfig"
+diff -uNr source/arch/alpha/kernel/alpha_ksyms.c source-es45/arch/alpha/kernel/alpha_ksyms.c
+--- source/arch/alpha/kernel/alpha_ksyms.c	2006-09-19 20:42:06.000000000 -0700
++++ source-es45/arch/alpha/kernel/alpha_ksyms.c	2006-09-30 03:14:44.000000000 -0700
+@@ -206,3 +206,7 @@
+ EXPORT_SYMBOL(irongate_ioremap);
+ EXPORT_SYMBOL(irongate_iounmap);
+ #endif
++
++#ifdef CONFIG_VGA_HOSE
++EXPORT_SYMBOL(pci_vga_hose);
++#endif
+diff -uNr source/arch/alpha/kernel/console.c source-es45/arch/alpha/kernel/console.c
+--- source/arch/alpha/kernel/console.c	2006-09-19 20:42:06.000000000 -0700
++++ source-es45/arch/alpha/kernel/console.c	2006-09-30 03:14:44.000000000 -0700
+@@ -8,17 +8,16 @@
+ #include <linux/pci.h>
+ #include <linux/init.h>
+ #include <linux/tty.h>
++#include <linux/vt.h>
+ #include <linux/console.h>
+ #include <asm/vga.h>
+ #include <asm/machvec.h>
+ 
++#include "pci_impl.h"
++
+ #ifdef CONFIG_VGA_HOSE
+ 
+-/*
+- * Externally-visible vga hose bases
+- */
+-unsigned long __vga_hose_io_base = 0;	/* base for default hose */
+-unsigned long __vga_hose_mem_base = 0;	/* base for default hose */
++struct pci_controller *pci_vga_hose = NULL;
+ 
+ static struct pci_controller * __init 
+ default_vga_hose_select(struct pci_controller *h1, struct pci_controller *h2)
+@@ -32,10 +31,7 @@
+ void __init 
+ set_vga_hose(struct pci_controller *hose)
+ {
+-	if (hose) {
+-		__vga_hose_io_base = hose->io_space->start;
+-		__vga_hose_mem_base = hose->mem_space->start;
+-	}
++	pci_vga_hose = hose;
+ }
+ 
+ void __init 
+@@ -44,18 +40,18 @@
+ 	struct pci_controller *hose = NULL;
+ 	struct pci_dev *dev = NULL;
+ 
++	/* Default the select function */
+ 	if (!sel_func) sel_func = (void *)default_vga_hose_select;
+ 
++	/* Find the console VGA device */
+ 	for(dev=NULL; (dev=pci_get_class(PCI_CLASS_DISPLAY_VGA << 8, dev));) {
+ 		if (!hose) hose = dev->sysdata;
+ 		else hose = sel_func(hose, dev->sysdata);
+ 	}
+ 
+-	/* Did we already inititialize the correct one? */
+-	if (conswitchp == &vga_con &&
+-	    __vga_hose_io_base == hose->io_space->start &&
+-	    __vga_hose_mem_base == hose->mem_space->start)
+-		return;
++	/* Did we already initialize the correct one? Is there one? */
++	if (!hose || (conswitchp == &vga_con && pci_vga_hose == hose))
++		return;
+ 
+ 	/* Set the VGA hose and init the new console */
+ 	set_vga_hose(hose);
+diff -uNr source/arch/alpha/kernel/core_marvel.c source-es45/arch/alpha/kernel/core_marvel.c
+--- source/arch/alpha/kernel/core_marvel.c	2006-09-19 20:42:06.000000000 -0700
++++ source-es45/arch/alpha/kernel/core_marvel.c	2006-09-30 03:14:44.000000000 -0700
+@@ -684,9 +684,6 @@
+ /*
+  * IO map support.
+  */
+-
+-#define __marvel_is_mem_vga(a)	(((a) >= 0xa0000) && ((a) <= 0xc0000))
+-
+ void __iomem *
+ marvel_ioremap(unsigned long addr, unsigned long size)
+ {
+@@ -698,13 +695,9 @@
+ 	unsigned long pfn;
+ 
+ 	/*
+-	 * Adjust the addr.
++	 * Adjust the address.
+ 	 */ 
+-#ifdef CONFIG_VGA_HOSE
+-	if (pci_vga_hose && __marvel_is_mem_vga(addr)) {
+-		addr += pci_vga_hose->mem_space->start;
+-	}
+-#endif
++	FIXUP_MEMADDR_VGA(addr);
+ 
+ 	/*
+ 	 * Find the hose.
+@@ -781,7 +774,7 @@
+ 		return (void __iomem *) vaddr;
+ 	}
+ 
+-	return NULL;
++	return (void __iomem *) NULL;
+ }
+ 
+ void
+@@ -803,8 +796,6 @@
+ 		return (addr & 0xFF000000UL) == 0;
+ }
+ 
+-#define __marvel_is_port_vga(a)	\
+-  (((a) >= 0x3b0) && ((a) < 0x3e0) && ((a) != 0x3b3) && ((a) != 0x3d3))
+ #define __marvel_is_port_kbd(a)	(((a) == 0x60) || ((a) == 0x64))
+ #define __marvel_is_port_rtc(a)	(((a) == 0x70) || ((a) == 0x71))
+ 
+@@ -813,7 +804,7 @@
+ 	if (__marvel_is_port_rtc (addr) || __marvel_is_port_kbd(addr))
+ 		;
+ #ifdef CONFIG_VGA_HOSE
+-	else if (__marvel_is_port_vga (addr) && pci_vga_hose)
++	else if (__is_port_vga (addr) && pci_vga_hose)
+ 		addr += pci_vga_hose->io_space->start;
+ #endif
+ 	else
+diff -uNr source/arch/alpha/kernel/core_titan.c source-es45/arch/alpha/kernel/core_titan.c
+--- source/arch/alpha/kernel/core_titan.c	2006-09-19 20:42:06.000000000 -0700
++++ source-es45/arch/alpha/kernel/core_titan.c	2006-09-30 03:14:44.000000000 -0700
+@@ -35,6 +35,17 @@
+ } saved_config[4] __attribute__((common));
+ 
+ /*
++ * Is PChip 1 present? No need to query it more than once.
++ */
++static int titan_pchip1_present;
++
++/* hoseno to index mapping */
++#define H2I(h) ((((h)&2)>>1)|(((h)&1)<<1))
++/* index to hoseno mapping */
++#define I2H(i) ((((i)&2)>>1)|(((i)&1)<<1))
++
++
++/*
+  * BIOS32-style PCI interface:
+  */
+ 
+@@ -196,14 +207,14 @@
+ titan_pci_tbi(struct pci_controller *hose, dma_addr_t start, dma_addr_t end)
+ {
+ 	titan_pachip *pachip = 
+-	  (hose->index & 1) ? TITAN_pachip1 : TITAN_pachip0;
++	  (hose->index & 2) ? TITAN_pachip1 : TITAN_pachip0;
+ 	titan_pachip_port *port;
+ 	volatile unsigned long *csr;
+ 	unsigned long value;
+ 
+ 	/* Get the right hose.  */
+ 	port = &pachip->g_port;
+-	if (hose->index & 2) 
++	if (hose->index & 1) 
+ 		port = &pachip->a_port;
+ 
+ 	/* We can invalidate up to 8 tlb entries in a go.  The flush
+@@ -238,12 +249,12 @@
+ }
+ 
+ static void __init
+-titan_init_one_pachip_port(titan_pachip_port *port, int index)
++titan_init_one_pachip_port(titan_pachip_port *port, int hoseno)
+ {
+ 	struct pci_controller *hose;
+ 
+ 	hose = alloc_pci_controller();
+-	if (index == 0)
++	if (hoseno == 0)
+ 		pci_isa_hose = hose;
+ 	hose->io_space = alloc_resource();
+ 	hose->mem_space = alloc_resource();
+@@ -258,47 +269,47 @@
+ 	hose->sparse_mem_base = 0;
+ 	hose->sparse_io_base = 0;
+ 	hose->dense_mem_base
+-	  = (TITAN_MEM(index) & 0xffffffffffUL) | 0x80000000000UL;
++	  = (TITAN_MEM(hoseno) & 0xffffffffffUL) | 0x80000000000UL;
+ 	hose->dense_io_base
+-	  = (TITAN_IO(index) & 0xffffffffffUL) | 0x80000000000UL;
++	  = (TITAN_IO(hoseno) & 0xffffffffffUL) | 0x80000000000UL;
+ 
+-	hose->config_space_base = TITAN_CONF(index);
+-	hose->index = index;
++	hose->config_space_base = TITAN_CONF(hoseno);
++	hose->index = H2I(hoseno);
+ 
+-	hose->io_space->start = TITAN_IO(index) - TITAN_IO_BIAS;
++	hose->io_space->start = TITAN_IO(hoseno) - TITAN_IO_BIAS;
+ 	hose->io_space->end = hose->io_space->start + TITAN_IO_SPACE - 1;
+-	hose->io_space->name = pci_io_names[index];
++	hose->io_space->name = pci_io_names[hoseno];
+ 	hose->io_space->flags = IORESOURCE_IO;
+ 
+-	hose->mem_space->start = TITAN_MEM(index) - TITAN_MEM_BIAS;
++	hose->mem_space->start = TITAN_MEM(hoseno) - TITAN_MEM_BIAS;
+ 	hose->mem_space->end = hose->mem_space->start + 0xffffffff;
+-	hose->mem_space->name = pci_mem_names[index];
++	hose->mem_space->name = pci_mem_names[hoseno];
+ 	hose->mem_space->flags = IORESOURCE_MEM;
+ 
+ 	if (request_resource(&ioport_resource, hose->io_space) < 0)
+-		printk(KERN_ERR "Failed to request IO on hose %d\n", index);
++		printk(KERN_ERR "Failed to request IO on hose %d\n", hoseno);
+ 	if (request_resource(&iomem_resource, hose->mem_space) < 0)
+-		printk(KERN_ERR "Failed to request MEM on hose %d\n", index);
++		printk(KERN_ERR "Failed to request MEM on hose %d\n", hoseno);
+ 
+ 	/*
+ 	 * Save the existing PCI window translations.  SRM will 
+ 	 * need them when we go to reboot.
+ 	 */
+-	saved_config[index].wsba[0] = port->wsba[0].csr;
+-	saved_config[index].wsm[0]  = port->wsm[0].csr;
+-	saved_config[index].tba[0]  = port->tba[0].csr;
+-
+-	saved_config[index].wsba[1] = port->wsba[1].csr;
+-	saved_config[index].wsm[1]  = port->wsm[1].csr;
+-	saved_config[index].tba[1]  = port->tba[1].csr;
+-
+-	saved_config[index].wsba[2] = port->wsba[2].csr;
+-	saved_config[index].wsm[2]  = port->wsm[2].csr;
+-	saved_config[index].tba[2]  = port->tba[2].csr;
+-
+-	saved_config[index].wsba[3] = port->wsba[3].csr;
+-	saved_config[index].wsm[3]  = port->wsm[3].csr;
+-	saved_config[index].tba[3]  = port->tba[3].csr;
++	saved_config[hoseno].wsba[0] = port->wsba[0].csr;
++	saved_config[hoseno].wsm[0]  = port->wsm[0].csr;
++	saved_config[hoseno].tba[0]  = port->tba[0].csr;
++
++	saved_config[hoseno].wsba[1] = port->wsba[1].csr;
++	saved_config[hoseno].wsm[1]  = port->wsm[1].csr;
++	saved_config[hoseno].tba[1]  = port->tba[1].csr;
++
++	saved_config[hoseno].wsba[2] = port->wsba[2].csr;
++	saved_config[hoseno].wsm[2]  = port->wsm[2].csr;
++	saved_config[hoseno].tba[2]  = port->tba[2].csr;
++
++	saved_config[hoseno].wsba[3] = port->wsba[3].csr;
++	saved_config[hoseno].wsm[3]  = port->wsm[3].csr;
++	saved_config[hoseno].tba[3]  = port->tba[3].csr;
+ 
+ 	/*
+ 	 * Set up the PCI to main memory translation windows.
+@@ -344,14 +355,14 @@
+ static void __init
+ titan_init_pachips(titan_pachip *pachip0, titan_pachip *pachip1)
+ {
+-	int pchip1_present = TITAN_cchip->csc.csr & 1L<<14;
++	titan_pchip1_present = TITAN_cchip->csc.csr & 1L<<14;
+ 
+ 	/* Init the ports in hose order... */
+ 	titan_init_one_pachip_port(&pachip0->g_port, 0);	/* hose 0 */
+-	if (pchip1_present)
++	if (titan_pchip1_present)
+ 		titan_init_one_pachip_port(&pachip1->g_port, 1);/* hose 1 */
+ 	titan_init_one_pachip_port(&pachip0->a_port, 2);	/* hose 2 */
+-	if (pchip1_present)
++	if (titan_pchip1_present)
+ 		titan_init_one_pachip_port(&pachip1->a_port, 3);/* hose 3 */
+ }
+ 
+@@ -366,16 +377,18 @@
+ 		int h = (pu64[30] >> 24) & 0xff;	/* console hose # */
+ 
+ 		/*
+-		 * Our hose numbering matches the console's, so just find
++		 * Our hose numbering does NOT match the console's, so find
+ 		 * the right one...
+ 		 */
+ 		for (hose = hose_head; hose; hose = hose->next) {
+-			if (hose->index == h) break;
++			if (I2H(hose->index) == h) break;
+ 		}
+ 
+ 		if (hose) {
+-			printk("Console graphics on hose %d\n", hose->index);
++			printk("Console graphics on hose %d\n", h);
+ 			pci_vga_hose = hose;
++		} else {
++			printk("ERROR: Console graphics hose not found\n");
+ 		}
+ 	}
+ #endif /* CONFIG_VGA_HOSE */
+@@ -406,6 +419,7 @@
+ 
+ 	/* With multiple PCI busses, we play with I/O as physical addrs.  */
+ 	ioport_resource.end = ~0UL;
++	iomem_resource.end = ~0UL;
+ 
+ 	/* PCI DMA Direct Mapping is 1GB at 2GB.  */
+ 	__direct_map_base = 0x80000000;
+@@ -441,9 +455,7 @@
+ static void
+ titan_kill_pachips(titan_pachip *pachip0, titan_pachip *pachip1)
+ {
+-	int pchip1_present = TITAN_cchip->csc.csr & 1L<<14;
+-
+-	if (pchip1_present) {
++	if (titan_pchip1_present) {
+ 		titan_kill_one_pachip_port(&pachip1->g_port, 1);
+ 		titan_kill_one_pachip_port(&pachip1->a_port, 3);
+ 	}
+@@ -474,12 +486,12 @@
+ 	unsigned long *ptes;
+ 	unsigned long pfn;
+ 
++#ifdef CONFIG_VGA_HOSE
+ 	/*
+-	 * Adjust the addr.
++	 * Adjust the address and hose, if necessary.
+ 	 */ 
+-#ifdef CONFIG_VGA_HOSE
+-	if (pci_vga_hose && __titan_is_mem_vga(addr)) {
+-		h = pci_vga_hose->index;
++	if (pci_vga_hose && __is_mem_vga(addr)) {
++		h = I2H(pci_vga_hose->index);
+ 		addr += pci_vga_hose->mem_space->start;
+ 	}
+ #endif
+@@ -488,7 +500,7 @@
+ 	 * Find the hose.
+ 	 */
+ 	for (hose = hose_head; hose; hose = hose->next)
+-		if (hose->index == h)
++		if (I2H(hose->index) == h)
+ 			break;
+ 	if (!hose)
+ 		return NULL;
+@@ -521,8 +533,10 @@
+ 		 * Map it
+ 		 */
+ 		area = get_vm_area(size, VM_IOREMAP);
+-		if (!area)
++		if (!area) {
++			printk("ioremap failed... no vm_area...\n");
+ 			return NULL;
++		}
+ 
+ 		ptes = hose->sg_pci->ptes;
+ 		for (vaddr = (unsigned long)area->addr; 
+@@ -539,7 +553,7 @@
+ 			if (__alpha_remap_area_pages(vaddr,
+ 						     pfn << PAGE_SHIFT, 
+ 						     PAGE_SIZE, 0)) {
+-				printk("FAILED to map...\n");
++				printk("FAILED to remap_area_pages...\n");
+ 				vfree(area->addr);
+ 				return NULL;
+ 			}
+@@ -551,7 +565,8 @@
+ 		return (void __iomem *) vaddr;
+ 	}
+ 
+-	return NULL;
++	/* Assume a legacy (read: VGA) address, and return appropriately. */
++	return (void __iomem *)(addr + TITAN_MEM_BIAS);
+ }
+ 
+ void
+@@ -750,6 +765,7 @@
+ 	if (titan_query_agp(port))
+ 		hosenum = 2;
+ 	if (hosenum < 0 && 
++	    titan_pchip1_present &&
+ 	    titan_query_agp(port = &TITAN_pachip1->a_port)) 
+ 		hosenum = 3;
+ 	
+@@ -757,7 +773,7 @@
+ 	 * Find the hose the port is on.
+ 	 */
+ 	for (hose = hose_head; hose; hose = hose->next)
+-		if (hose->index == hosenum)
++		if (I2H(hose->index) == hosenum)
+ 			break;
+ 
+ 	if (!hose || !hose->sg_pci)
+diff -uNr source/arch/alpha/kernel/core_tsunami.c source-es45/arch/alpha/kernel/core_tsunami.c
+--- source/arch/alpha/kernel/core_tsunami.c	2006-09-19 20:42:06.000000000 -0700
++++ source-es45/arch/alpha/kernel/core_tsunami.c	2006-09-30 03:14:44.000000000 -0700
+@@ -349,6 +349,32 @@
+ 	tsunami_pci_tbi(hose, 0, -1);
+ }
+ 
++static void __init
++tsunami_init_vga_hose(void)
++{
++#ifdef CONFIG_VGA_HOSE
++	u64 *pu64 = (u64 *)((u64)hwrpb + hwrpb->ctbt_offset);
++
++	if (pu64[7] == 3) {	/* TERM_TYPE == graphics */
++		struct pci_controller *hose;
++		int h = (pu64[30] >> 24) & 0xff;	/* console hose # */
++
++		/*
++		 * Our hose numbering does NOT match the console's, so find
++		 * the right one...
++		 */
++		for (hose = hose_head; hose; hose = hose->next) {
++			if (hose->index == h) break;
++		}
++
++		if (hose) {
++			printk("Console graphics on hose %d\n", h);
++			pci_vga_hose = hose;
++		}
++	}
++#endif /* CONFIG_VGA_HOSE */
++}
++
+ void __init
+ tsunami_init_arch(void)
+ {
+@@ -393,6 +419,9 @@
+ 	tsunami_init_one_pchip(TSUNAMI_pchip0, 0);
+ 	if (TSUNAMI_cchip->csc.csr & 1L<<14)
+ 		tsunami_init_one_pchip(TSUNAMI_pchip1, 1);
++
++	/* Check for graphic console location (if any).  */
++	tsunami_init_vga_hose();
+ }
+ 
+ static void
+diff -uNr source/arch/alpha/kernel/proto.h source-es45/arch/alpha/kernel/proto.h
+--- source/arch/alpha/kernel/proto.h	2006-09-19 20:42:06.000000000 -0700
++++ source-es45/arch/alpha/kernel/proto.h	2006-09-30 03:14:44.000000000 -0700
+@@ -106,6 +106,9 @@
+ extern unsigned long wildfire_node_mem_start(int);
+ extern unsigned long wildfire_node_mem_size(int);
+ 
++/* console.c */
++  extern void locate_and_init_vga(void *(*)(void *, void *));
++
+ /* setup.c */
+ extern unsigned long srm_hae;
+ extern int boot_cpuid;
+diff -uNr source/arch/alpha/kernel/setup.c source-es45/arch/alpha/kernel/setup.c
+--- source/arch/alpha/kernel/setup.c	2006-09-19 20:42:06.000000000 -0700
++++ source-es45/arch/alpha/kernel/setup.c	2006-09-30 03:14:44.000000000 -0700
+@@ -787,9 +787,9 @@
+ static int rawhide_indices[] = {0,0,0,1,1,2,2,3,3,4,4};
+ 
+ static char titan_names[][16] = {
+-	"DEFAULT", "Privateer", "Falcon", "Granite"
++	"DEFAULT", "Privateer", "Falcon", "Granite", "HyperBrick2"
+ };
+-static int titan_indices[] = {0,1,2,2,3};
++static int titan_indices[] = {0,1,2,2,3,4};
+ 
+ static char tsunami_names[][16] = {
+ 	"0", "DP264", "Warhol", "Windjammer", "Monet", "Clipper",
+@@ -891,6 +891,7 @@
+ 		&privateer_mv,		/* privateer */
+ 		&titan_mv,		/* falcon    */
+ 		&privateer_mv,		/* granite   */
++		&titan_mv,		/* hyperbrick2 */
+ 	};
+ 
+ 	static struct alpha_machine_vector *tsunami_vecs[]  __initdata =
+diff -uNr source/arch/alpha/kernel/sys_dp264.c source-es45/arch/alpha/kernel/sys_dp264.c
+--- source/arch/alpha/kernel/sys_dp264.c	2006-09-19 20:42:06.000000000 -0700
++++ source-es45/arch/alpha/kernel/sys_dp264.c	2006-09-30 03:14:44.000000000 -0700
+@@ -42,6 +42,14 @@
+ /* dp264 boards handle at max four CPUs */
+ static unsigned long cpu_irq_affinity[4] = { 0UL, 0UL, 0UL, 0UL };
+ 
++#ifdef CONFIG_VGA_HOSE
++extern void locate_and_init_vga(void *(*handler)(void *, void *));
++#else
++static inline void locate_and_init_vga(void *(*handler)(void *, void *))
++{
++}
++#endif
++
+ DEFINE_SPINLOCK(dp264_irq_lock);
+ 
+ static void
+@@ -543,6 +551,7 @@
+ {
+ 	common_init_pci();
+ 	SMC669_Init(0);
++	locate_and_init_vga(NULL);
+ }
+ 
+ static void __init
+@@ -551,6 +560,14 @@
+ 	common_init_pci();
+ 	SMC669_Init(1);
+ 	es1888_init();
++	locate_and_init_vga(NULL);
++}
++
++static void __init
++clipper_init_pci(void)
++{
++	common_init_pci();
++	locate_and_init_vga(NULL);
+ }
+ 
+ static void __init
+@@ -655,7 +672,7 @@
+ 	.init_arch		= tsunami_init_arch,
+ 	.init_irq		= clipper_init_irq,
+ 	.init_rtc		= common_init_rtc,
+-	.init_pci		= common_init_pci,
++	.init_pci		= clipper_init_pci,
+ 	.kill_arch		= tsunami_kill_arch,
+ 	.pci_map_irq		= clipper_map_irq,
+ 	.pci_swizzle		= common_swizzle,
+diff -uNr source/drivers/video/console/vgacon.c source-es45/drivers/video/console/vgacon.c
+--- source/drivers/video/console/vgacon.c	2006-09-19 20:42:06.000000000 -0700
++++ source-es45/drivers/video/console/vgacon.c	2006-09-30 03:14:44.000000000 -0700
+@@ -52,6 +52,11 @@
+ #include <video/vga.h>
+ #include <asm/io.h>
+ 
++/* wait until after includes to test for this, to allow arch-specific mod. */
++#ifndef vga_request_resource
++# define vga_request_resource request_resource
++#endif
++
+ static DEFINE_SPINLOCK(vga_lock);
+ static int cursor_size_lastfrom;
+ static int cursor_size_lastto;
+@@ -393,7 +398,7 @@
+ 			vga_video_type = VIDEO_TYPE_EGAM;
+ 			vga_vram_size = 0x8000;
+ 			display_desc = "EGA+";
+-			request_resource(&ioport_resource,
++			vga_request_resource(&ioport_resource,
+ 					 &ega_console_resource);
+ 		} else {
+ 			static struct resource mda1_console_resource =
+@@ -403,9 +408,9 @@
+ 			vga_video_type = VIDEO_TYPE_MDA;
+ 			vga_vram_size = 0x2000;
+ 			display_desc = "*MDA";
+-			request_resource(&ioport_resource,
++			vga_request_resource(&ioport_resource,
+ 					 &mda1_console_resource);
+-			request_resource(&ioport_resource,
++			vga_request_resource(&ioport_resource,
+ 					 &mda2_console_resource);
+ 			vga_video_font_height = 14;
+ 		}
+@@ -425,14 +430,14 @@
+ 				    = { .name = "ega", .start = 0x3C0, .end = 0x3DF };
+ 				vga_video_type = VIDEO_TYPE_EGAC;
+ 				display_desc = "EGA";
+-				request_resource(&ioport_resource,
++				vga_request_resource(&ioport_resource,
+ 						 &ega_console_resource);
+ 			} else {
+ 				static struct resource vga_console_resource
+ 				    = { .name = "vga+", .start = 0x3C0, .end = 0x3DF };
+ 				vga_video_type = VIDEO_TYPE_VGAC;
+ 				display_desc = "VGA+";
+-				request_resource(&ioport_resource,
++				vga_request_resource(&ioport_resource,
+ 						 &vga_console_resource);
+ 
+ #ifdef VGA_CAN_DO_64KB
+@@ -477,7 +482,7 @@
+ 			vga_video_type = VIDEO_TYPE_CGA;
+ 			vga_vram_size = 0x2000;
+ 			display_desc = "*CGA";
+-			request_resource(&ioport_resource,
++			vga_request_resource(&ioport_resource,
+ 					 &cga_console_resource);
+ 			vga_video_font_height = 8;
+ 		}
+diff -uNr source/include/asm-alpha/core_titan.h source-es45/include/asm-alpha/core_titan.h
+--- source/include/asm-alpha/core_titan.h	2006-09-19 20:42:06.000000000 -0700
++++ source-es45/include/asm-alpha/core_titan.h	2006-09-30 03:14:44.000000000 -0700
+@@ -3,6 +3,7 @@
+ 
+ #include <linux/types.h>
+ #include <linux/pci.h>
++#include <asm/pci.h>
+ #include <asm/compiler.h>
+ 
+ /*
+@@ -383,6 +384,7 @@
+ 
+ __EXTERN_INLINE void __iomem *titan_ioportmap(unsigned long addr)
+ {
++	FIXUP_IOADDR_VGA(addr);
+ 	return (void __iomem *)(addr + TITAN_IO_BIAS);
+ }
+ 
+diff -uNr source/include/asm-alpha/core_tsunami.h source-es45/include/asm-alpha/core_tsunami.h
+--- source/include/asm-alpha/core_tsunami.h	2006-09-19 20:42:06.000000000 -0700
++++ source-es45/include/asm-alpha/core_tsunami.h	2006-09-30 03:14:44.000000000 -0700
+@@ -2,6 +2,8 @@
+ #define __ALPHA_TSUNAMI__H__
+ 
+ #include <linux/types.h>
++#include <linux/pci.h>
++#include <asm/pci.h>
+ #include <asm/compiler.h>
+ 
+ /*
+@@ -305,12 +307,14 @@
+ 
+ __EXTERN_INLINE void __iomem *tsunami_ioportmap(unsigned long addr)
+ {
++	FIXUP_IOADDR_VGA(addr);
+ 	return (void __iomem *)(addr + TSUNAMI_IO_BIAS);
+ }
+ 
+ __EXTERN_INLINE void __iomem *tsunami_ioremap(unsigned long addr, 
+ 					      unsigned long size)
+ {
++	FIXUP_MEMADDR_VGA(addr);
+ 	return (void __iomem *)(addr + TSUNAMI_MEM_BIAS);
+ }
+ 
+diff -uNr source/include/asm-alpha/io.h source-es45/include/asm-alpha/io.h
+--- source/include/asm-alpha/io.h	2006-09-19 20:42:06.000000000 -0700
++++ source-es45/include/asm-alpha/io.h	2006-09-30 03:14:44.000000000 -0700
+@@ -126,6 +126,30 @@
+ 	return (long)address <= 0 ? NULL : virt;
+ }
+ 
++#ifdef CONFIG_VGA_HOSE
++extern struct pci_controller *pci_vga_hose;
++
++# define __is_port_vga(a)       \
++	(((a) >= 0x3b0) && ((a) < 0x3e0) && \
++	 ((a) != 0x3b3) && ((a) != 0x3d3))
++
++# define __is_mem_vga(a) \
++	(((a) >= 0xa0000) && ((a) <= 0xc0000))
++
++# define FIXUP_IOADDR_VGA(a) do {                       \
++	if (pci_vga_hose && __is_port_vga(a))     \
++		a += pci_vga_hose->io_space->start;     \
++ } while(0)
++
++# define FIXUP_MEMADDR_VGA(a) do {                       \
++	if (pci_vga_hose && __is_mem_vga(a))     \
++		a += pci_vga_hose->io_space->start;     \
++ } while(0)
++
++#else /* CONFIG_VGA_HOSE */
++# define FIXUP_IOADDR_VGA(a)
++#endif /* CONFIG_VGA_HOSE */
++
+ /*
+  * There are different chipsets to interface the Alpha CPUs to the world.
+  */
+diff -uNr source/include/asm-alpha/vga.h source-es45/include/asm-alpha/vga.h
+--- source/include/asm-alpha/vga.h	2006-09-19 20:42:06.000000000 -0700
++++ source-es45/include/asm-alpha/vga.h	2006-09-30 03:14:44.000000000 -0700
+@@ -48,4 +48,26 @@
+ 
+ #define VGA_MAP_MEM(x,s)	((unsigned long) ioremap(x, s))
+ 
++#ifdef CONFIG_VGA_HOSE
++#include <linux/ioport.h>
++#include <linux/pci.h>
++
++extern struct pci_controller *pci_vga_hose;
++ 
++#define vga_request_resource alpha_vga_request_resource
++
++static int inline
++alpha_vga_request_resource(struct resource *root, struct resource *new)
++{
++	/* First, fixup the VGA resource bounds WRT the hose it is on. */
++	if (pci_vga_hose) {
++		new->start += pci_vga_hose->io_space->start;
++		new->end += pci_vga_hose->io_space->start;
++	}
++
++	/* Finally, do a normal request_resource(). */
++	return request_resource(root, new);
++}
++#endif /* CONFIG_VGA_HOSE */
++
+ #endif

Modified: dists/sid/linux-2.6/debian/patches/features/arm/ixp4xx-net-driver-improve-mac-handling.patch
==============================================================================
--- dists/sid/linux-2.6/debian/patches/features/arm/ixp4xx-net-driver-improve-mac-handling.patch	(original)
+++ dists/sid/linux-2.6/debian/patches/features/arm/ixp4xx-net-driver-improve-mac-handling.patch	Mon Nov 26 20:06:56 2007
@@ -1,5 +1,5 @@
 diff --git a/drivers/net/ixp4xx/mac_driver.c b/drivers/net/ixp4xx/mac_driver.c
-index 2ae78e5..2212293 100644
+index f393c3c..03ed8fe 100644
 --- a/drivers/net/ixp4xx/mac_driver.c
 +++ b/drivers/net/ixp4xx/mac_driver.c
 @@ -350,6 +350,16 @@ static int ixmac_open (struct net_device *dev)
@@ -19,7 +19,7 @@
  	mac_set_uniaddr(dev);
  	media_check(dev, 1);
  	ixmac_set_rx_mode(dev);
-@@ -692,20 +702,6 @@ static int mac_probe(struct platform_device *pdev)
+@@ -691,20 +701,6 @@ static int mac_probe(struct platform_device *pdev)
  
  	INIT_DELAYED_WORK(&mac->mdio_thread, mac_mdio_thread);
  

Modified: dists/sid/linux-2.6/debian/patches/features/arm/ixp4xx-npe-driver-0.3.1.patch
==============================================================================
--- dists/sid/linux-2.6/debian/patches/features/arm/ixp4xx-npe-driver-0.3.1.patch	(original)
+++ dists/sid/linux-2.6/debian/patches/features/arm/ixp4xx-npe-driver-0.3.1.patch	Mon Nov 26 20:06:56 2007
@@ -319,10 +319,10 @@
 +	return ret;
 +}
 diff --git a/arch/arm/kernel/setup.c b/arch/arm/kernel/setup.c
-index 650eac1..47eb0db 100644
+index 4de432e..c4c810b 100644
 --- a/arch/arm/kernel/setup.c
 +++ b/arch/arm/kernel/setup.c
-@@ -60,6 +60,7 @@ extern int root_mountflags;
+@@ -61,6 +61,7 @@ extern int root_mountflags;
  extern void _stext, _text, _etext, __data_start, _edata, _end;
  
  unsigned int processor_id;
@@ -331,7 +331,7 @@
  EXPORT_SYMBOL(__machine_arch_type);
  
 diff --git a/arch/arm/mach-ixp4xx/common.c b/arch/arm/mach-ixp4xx/common.c
-index 8112f72..5c9afe4 100644
+index c1271c4..2ad3984 100644
 --- a/arch/arm/mach-ixp4xx/common.c
 +++ b/arch/arm/mach-ixp4xx/common.c
 @@ -28,6 +28,7 @@
@@ -453,7 +453,7 @@
  	printk("IXP4xx: Using %luMiB expansion bus window size\n",
  			ixp4xx_exp_bus_size >> 20);
  }
-@@ -486,3 +582,16 @@ static int __init ixp4xx_clockevent_init(void)
+@@ -488,3 +584,16 @@ static int __init ixp4xx_clockevent_init(void)
  	clockevents_register_device(&clockevent_ixp4xx);
  	return 0;
  }
@@ -471,63 +471,66 @@
 +
 +EXPORT_SYMBOL(ix_fuse);
 diff --git a/arch/arm/mach-ixp4xx/ixdp425-setup.c b/arch/arm/mach-ixp4xx/ixdp425-setup.c
-index ec4f079..21818a1 100644
+index d5008d8..eb90096 100644
 --- a/arch/arm/mach-ixp4xx/ixdp425-setup.c
 +++ b/arch/arm/mach-ixp4xx/ixdp425-setup.c
-@@ -101,10 +101,59 @@ static struct platform_device ixdp425_uart = {
+@@ -177,6 +177,52 @@ static struct platform_device ixdp425_uart = {
  	.resource		= ixdp425_uart_resources
  };
  
 +/* MACs */
 +static struct resource res_mac0 = {
-+	.start		= IXP4XX_EthB_BASE_PHYS,
-+	.end		= IXP4XX_EthB_BASE_PHYS + 0x1ff,
-+	.flags          = IORESOURCE_MEM,
++	.start			= IXP4XX_EthB_BASE_PHYS,
++	.end			= IXP4XX_EthB_BASE_PHYS + 0x1ff,
++	.flags			= IORESOURCE_MEM,
 +};
 +
 +static struct resource res_mac1 = {
-+	.start		= IXP4XX_EthC_BASE_PHYS,
-+	.end		= IXP4XX_EthC_BASE_PHYS + 0x1ff,
-+	.flags          = IORESOURCE_MEM,
++	.start			= IXP4XX_EthC_BASE_PHYS,
++	.end			= IXP4XX_EthC_BASE_PHYS + 0x1ff,
++	.flags			= IORESOURCE_MEM,
 +};
 +
 +static struct mac_plat_info plat_mac0 = {
-+	.npe_id		= 1,
-+	.phy_id		= 0,
-+	.eth_id		= 0,
-+	.rxq_id		= 27,
-+	.txq_id		= 24,
-+	.rxdoneq_id	= 4,
++	.npe_id			= 1,
++	.phy_id			= 0,
++	.eth_id			= 0,
++	.rxq_id			= 27,
++	.txq_id			= 24,
++	.rxdoneq_id		= 4,
 +};
-+
 +static struct mac_plat_info plat_mac1 = {
-+	.npe_id		= 2,
-+	.phy_id		= 1,
-+	.eth_id		= 1,
-+	.rxq_id		= 28,
-+	.txq_id		= 25,
-+	.rxdoneq_id	= 5,
++	.npe_id			= 2,
++	.phy_id			= 1,
++	.eth_id			= 1,
++	.rxq_id			= 28,
++	.txq_id			= 25,
++	.rxdoneq_id		= 5,
 +};
 +
 +static struct platform_device mac0 = {
-+	.name           = "ixp4xx_mac",
-+	.id             = 0,
-+	.dev.platform_data = &plat_mac0,
-+	.num_resources  = 1,
-+	.resource       = &res_mac0,
++	.name			= "ixp4xx_mac",
++	.id			= 0,
++	.dev.platform_data	= &plat_mac0,
++	.num_resources		= 1,
++	.resource		= &res_mac0,
 +};
 +
 +static struct platform_device mac1 = {
-+	.name           = "ixp4xx_mac",
-+	.id             = 1,
-+	.dev.platform_data = &plat_mac1,
-+	.num_resources  = 1,
-+	.resource       = &res_mac1,
++	.name			= "ixp4xx_mac",
++	.id			= 1,
++	.dev.platform_data	= &plat_mac1,
++	.num_resources		= 1,
++	.resource		= &res_mac1,
 +};
 +
  static struct platform_device *ixdp425_devices[] __initdata = {
  	&ixdp425_i2c_controller,
  	&ixdp425_flash,
+@@ -184,7 +230,9 @@ static struct platform_device *ixdp425_devices[] __initdata = {
+     defined(CONFIG_MTD_NAND_PLATFORM_MODULE)
+ 	&ixdp425_flash_nand,
+ #endif
 -	&ixdp425_uart
 +	&ixdp425_uart,
 +	&mac0,
@@ -536,23 +539,23 @@
  
  static void __init ixdp425_init(void)
 diff --git a/drivers/net/Kconfig b/drivers/net/Kconfig
-index 7d57f4a..ba1a25e 100644
+index 5b9e17b..8a7bee0 100644
 --- a/drivers/net/Kconfig
 +++ b/drivers/net/Kconfig
-@@ -201,6 +201,8 @@ config MACB
+@@ -216,6 +216,8 @@ config MACB
  
  source "drivers/net/arm/Kconfig"
  
 +source "drivers/net/ixp4xx/Kconfig"
 +
- config MACE
- 	tristate "MACE (Power Mac ethernet) support"
- 	depends on NET_ETHERNET && PPC_PMAC && PPC32
+ config AX88796
+ 	tristate "ASIX AX88796 NE2000 clone support"
+ 	depends on ARM || MIPS
 diff --git a/drivers/net/Makefile b/drivers/net/Makefile
-index a77affa..c463574 100644
+index e684212..2c77ab7 100644
 --- a/drivers/net/Makefile
 +++ b/drivers/net/Makefile
-@@ -221,6 +221,7 @@ obj-$(CONFIG_HAMRADIO) += hamradio/
+@@ -229,6 +229,7 @@ obj-$(CONFIG_HAMRADIO) += hamradio/
  obj-$(CONFIG_IRDA) += irda/
  obj-$(CONFIG_ETRAX_ETHERNET) += cris/
  obj-$(CONFIG_ENP2611_MSF_NET) += ixp2000/
@@ -2247,10 +2250,10 @@
 +
 diff --git a/drivers/net/ixp4xx/mac_driver.c b/drivers/net/ixp4xx/mac_driver.c
 new file mode 100644
-index 0000000..2ae78e5
+index 0000000..f393c3c
 --- /dev/null
 +++ b/drivers/net/ixp4xx/mac_driver.c
-@@ -0,0 +1,850 @@
+@@ -0,0 +1,849 @@
 +/*
 + * mac_driver.c - provide a network interface for each MAC
 + *
@@ -2834,7 +2837,6 @@
 +	.set_msglevel           = ixmac_set_msglevel,
 +	.get_regs_len		= ixmac_get_regs_len,
 +	.get_regs		= ixmac_get_regs,
-+	.get_perm_addr		= ethtool_op_get_perm_addr,
 +	.get_strings		= ixmac_get_strings,
 +	.get_stats_count	= ixmac_get_stats_count,
 +	.get_ethtool_stats	= ixmac_get_ethtool_stats,

Added: dists/sid/linux-2.6/debian/patches/features/arm/n2100-set-fan.patch
==============================================================================
--- (empty file)
+++ dists/sid/linux-2.6/debian/patches/features/arm/n2100-set-fan.patch	Mon Nov 26 20:06:56 2007
@@ -0,0 +1,50 @@
+Upstream status: Riku will submit it for 2.6.24
+
+From d011b8868255310f214d848fa1543265753858bd Mon Sep 17 00:00:00 2001
+From: riku.voipio at iki.fi <riku.voipio at movial.fi>
+Date: Tue, 25 Sep 2007 16:33:24 +0300
+Subject: [PATCH] On n2100 systems, set fans to full speed on default
+
+
+Signed-off-by: Riku Voipio <Riku Voipio riku.voipio at movial.fi>
+---
+ arch/arm/mach-iop32x/n2100.c |   11 +++++++++++
+ 1 files changed, 11 insertions(+), 0 deletions(-)
+
+diff --git a/arch/arm/mach-iop32x/n2100.c b/arch/arm/mach-iop32x/n2100.c
+index 1873bd8..5a4acff 100644
+--- a/arch/arm/mach-iop32x/n2100.c
++++ b/arch/arm/mach-iop32x/n2100.c
+@@ -16,6 +16,7 @@
+ 
+ #include <linux/mm.h>
+ #include <linux/init.h>
++#include <linux/f75375s.h>
+ #include <linux/delay.h>
+ #include <linux/kernel.h>
+ #include <linux/pci.h>
+@@ -200,11 +201,21 @@ static struct platform_device n2100_serial_device = {
+ 	.resource	= &n2100_uart_resource,
+ };
+ 
++static struct f75375s_platform_data n2100_f75375s = {
++	.pwm		= { 255, 255},
++	.pwm_enable = { 0, 0 },
++};
++
+ static struct i2c_board_info __initdata n2100_i2c_devices[] = {
+ 	{
+ 		I2C_BOARD_INFO("rtc-rs5c372", 0x32),
+ 		.type = "rs5c372b",
+ 	},
++	{
++		I2C_BOARD_INFO("f75375", 0x2e),
++		.type = "f75375",
++		.platform_data = &n2100_f75375s,
++	},
+ };
+ 
+ /*
+-- 
+1.5.3.1
+

Added: dists/sid/linux-2.6/debian/patches/features/f75375-new-style-bindings.patch
==============================================================================
--- (empty file)
+++ dists/sid/linux-2.6/debian/patches/features/f75375-new-style-bindings.patch	Mon Nov 26 20:06:56 2007
@@ -0,0 +1,217 @@
+Upstream status: Riku will submit it for 2.6.24
+
+From 53eba46aca590170b64a4a85c0eebd3222ca83ee Mon Sep 17 00:00:00 2001
+From: Riku Voipio <riku.voipio at movial.fi>
+Date: Tue, 25 Sep 2007 15:05:36 +0300
+Subject: [PATCH] Add new style bindings
+
+
+Signed-off-by: Riku Voipio <riku.voipio at movial.fi>
+---
+ drivers/hwmon/f75375s.c |  112 +++++++++++++++++++++++++++++++++++-----------
+ 1 files changed, 85 insertions(+), 27 deletions(-)
+
+diff --git a/drivers/hwmon/f75375s.c b/drivers/hwmon/f75375s.c
+index 6425184..9336f5e 100644
+--- a/drivers/hwmon/f75375s.c
++++ b/drivers/hwmon/f75375s.c
+@@ -86,7 +86,7 @@ I2C_CLIENT_INSMOD_2(f75373, f75375);
+ 
+ struct f75375_data {
+ 	unsigned short addr;
+-	struct i2c_client client;
++	struct i2c_client *client;
+ 	struct class_device *class_dev;
+ 
+ 	const char *name;
+@@ -116,15 +116,26 @@ struct f75375_data {
+ static int f75375_attach_adapter(struct i2c_adapter *adapter);
+ static int f75375_detect(struct i2c_adapter *adapter, int address, int kind);
+ static int f75375_detach_client(struct i2c_client *client);
++static int f75375_probe(struct i2c_client *client);
++static int f75375_remove(struct i2c_client *client);
+ 
+-static struct i2c_driver f75375_driver = {
++static struct i2c_driver f75375_legacy_driver = {
+ 	.driver = {
+-		.name = "f75375",
++		.name = "f75375_legacy",
+ 	},
+ 	.attach_adapter = f75375_attach_adapter,
+ 	.detach_client = f75375_detach_client,
+ };
+ 
++static struct i2c_driver f75375_driver = {
++	.driver = {
++		.name = "f75375",
++	},
++	.probe = f75375_probe,
++	.remove = f75375_remove,
++};
++
++
+ static inline int f75375_read8(struct i2c_client *client, u8 reg)
+ {
+ 	return i2c_smbus_read_byte_data(client, reg);
+@@ -580,12 +591,8 @@ static const struct attribute_group f75375_group = {
+ 
+ static int f75375_detach_client(struct i2c_client *client)
+ {
+-	struct f75375_data *data = i2c_get_clientdata(client);
+ 	int err;
+-
+-	hwmon_device_unregister(data->class_dev);
+-	sysfs_remove_group(&client->dev.kobj, &f75375_group);
+-
++	f75375_remove(client);
+ 	err = i2c_detach_client(client);
+ 	if (err) {
+ 		dev_err(&client->dev,
+@@ -593,10 +600,64 @@ static int f75375_detach_client(struct i2c_client *client)
+ 			"client not detached.\n");
+ 		return err;
+ 	}
++	kfree(client);
++	return 0;
++}
++
++static int f75375_probe(struct i2c_client *client)
++{
++	struct f75375_data *data = i2c_get_clientdata(client);
++	int err;
++
++	if (!i2c_check_functionality(client->adapter,
++				I2C_FUNC_SMBUS_BYTE_DATA))
++		return -EIO;
++	if (!(data = kzalloc(sizeof(struct f75375_data), GFP_KERNEL)))
++		return -ENOMEM;
++
++	i2c_set_clientdata(client, data);
++	data->client = client;
++	mutex_init(&data->update_lock);
++
++	if (strcmp(client->name, "f75375") == 0)
++		data->kind = f75375;
++	else if (strcmp(client->name, "f75373") == 0)
++		data->kind = f75373;
++	else {
++		dev_err(&client->dev, "Unsupported device: %s\n", client->name);
++		return -ENODEV;
++	}
++
++	if ((err = sysfs_create_group(&client->dev.kobj, &f75375_group)))
++		goto exit_free;
++
++	data->class_dev = hwmon_device_register(&client->dev);
++	if (IS_ERR(data->class_dev)) {
++		err = PTR_ERR(data->class_dev);
++		goto exit_remove;
++	}
++
++	return 0;
++
++exit_remove:
++	sysfs_remove_group(&client->dev.kobj, &f75375_group);
++exit_free:
+ 	kfree(data);
++	i2c_set_clientdata(client, NULL);
++	return err;
++}
++
++static int f75375_remove(struct i2c_client *client)
++{
++	struct f75375_data *data = i2c_get_clientdata(client);
++	hwmon_device_unregister(data->class_dev);
++	sysfs_remove_group(&client->dev.kobj, &f75375_group);
++	kfree(data);
++	i2c_set_clientdata(client, NULL);
+ 	return 0;
+ }
+ 
++
+ static int f75375_attach_adapter(struct i2c_adapter *adapter)
+ {
+ 	if (!(adapter->class & I2C_CLASS_HWMON))
+@@ -608,20 +669,17 @@ static int f75375_attach_adapter(struct i2c_adapter *adapter)
+ static int f75375_detect(struct i2c_adapter *adapter, int address, int kind)
+ {
+ 	struct i2c_client *client;
+-	struct f75375_data *data;
+ 	u8 version = 0;
+ 	int err = 0;
+ 	const char *name = "";
+ 
+-	if (!(data = kzalloc(sizeof(struct f75375_data), GFP_KERNEL))) {
++	if (!(client = kzalloc(sizeof(*client), GFP_KERNEL))) {
+ 		err = -ENOMEM;
+ 		goto exit;
+ 	}
+-	client = &data->client;
+-	i2c_set_clientdata(client, data);
+ 	client->addr = address;
+ 	client->adapter = adapter;
+-	client->driver = &f75375_driver;
++	client->driver = &f75375_legacy_driver;
+ 
+ 	if (kind < 0) {
+ 		u16 vendid = f75375_read16(client, F75375_REG_VENDOR);
+@@ -644,42 +702,42 @@ static int f75375_detect(struct i2c_adapter *adapter, int address, int kind)
+ 	} else if (kind == f75373) {
+ 		name = "f75373";
+ 	}
+-
+ 	dev_info(&adapter->dev, "found %s version: %02X\n", name, version);
+ 	strlcpy(client->name, name, I2C_NAME_SIZE);
+-	data->kind = kind;
+-	mutex_init(&data->update_lock);
++
+ 	if ((err = i2c_attach_client(client)))
+ 		goto exit_free;
+ 
+-	if ((err = sysfs_create_group(&client->dev.kobj, &f75375_group)))
++	if ((err = f75375_probe(client)) < 0)
+ 		goto exit_detach;
+ 
+-	data->class_dev = hwmon_device_register(&client->dev);
+-	if (IS_ERR(data->class_dev)) {
+-		err = PTR_ERR(data->class_dev);
+-		goto exit_remove;
+-	}
+-
+ 	return 0;
+ 
+-exit_remove:
+-	sysfs_remove_group(&client->dev.kobj, &f75375_group);
+ exit_detach:
+ 	i2c_detach_client(client);
+ exit_free:
+-	kfree(data);
++	kfree(client);
+ exit:
+ 	return err;
+ }
+ 
+ static int __init sensors_f75375_init(void)
+ {
+-	return i2c_add_driver(&f75375_driver);
++	int status;
++	status = i2c_add_driver(&f75375_driver);
++	if (status < 0)
++		return status;
++
++	status = i2c_add_driver(&f75375_legacy_driver);
++	if (status < 0)
++		i2c_del_driver(&f75375_driver);
++
++	return status;
+ }
+ 
+ static void __exit sensors_f75375_exit(void)
+ {
++	i2c_del_driver(&f75375_legacy_driver);
+ 	i2c_del_driver(&f75375_driver);
+ }
+ 
+-- 
+1.5.3.1
+

Added: dists/sid/linux-2.6/debian/patches/features/f75375-set-fans-platform-data.patch
==============================================================================
--- (empty file)
+++ dists/sid/linux-2.6/debian/patches/features/f75375-set-fans-platform-data.patch	Mon Nov 26 20:06:56 2007
@@ -0,0 +1,137 @@
+Upstream status: Riku will submit it for 2.6.24
+
+From 588962ab89405c2cb480895253b3509ba15505ce Mon Sep 17 00:00:00 2001
+From: Riku Voipio <riku.voipio at movial.fi>
+Date: Tue, 25 Sep 2007 16:32:18 +0300
+Subject: [PATCH] Add support for setting up fans with platform_data
+
+
+Signed-off-by: Riku Voipio <riku.voipio at movial.fi>
+---
+ drivers/hwmon/f75375s.c |   42 +++++++++++++++++++++++++++++++++++-------
+ include/linux/f75375s.h |   21 +++++++++++++++++++++
+ 2 files changed, 56 insertions(+), 7 deletions(-)
+ create mode 100644 include/linux/f75375s.h
+
+diff --git a/drivers/hwmon/f75375s.c b/drivers/hwmon/f75375s.c
+index 9336f5e..3074f74 100644
+--- a/drivers/hwmon/f75375s.c
++++ b/drivers/hwmon/f75375s.c
+@@ -34,6 +34,7 @@
+ #include <linux/i2c.h>
+ #include <linux/err.h>
+ #include <linux/mutex.h>
++#include <linux/f75375s.h>
+ 
+ /* Addresses to scan */
+ static unsigned short normal_i2c[] = { 0x2d, 0x2e, I2C_CLIENT_END };
+@@ -287,19 +288,14 @@ static ssize_t show_pwm_enable(struct device *dev, struct device_attribute
+ 	return sprintf(buf, "%d\n", data->pwm_enable[nr]);
+ }
+ 
+-static ssize_t set_pwm_enable(struct device *dev, struct device_attribute *attr,
+-		const char *buf, size_t count)
++static int set_pwm_enable_direct(struct i2c_client *client, int nr, int val)
+ {
+-	int nr = to_sensor_dev_attr(attr)->index;
+-	struct i2c_client *client = to_i2c_client(dev);
+ 	struct f75375_data *data = i2c_get_clientdata(client);
+-	int val = simple_strtoul(buf, NULL, 10);
+ 	u8 fanmode;
+ 
+ 	if (val < 0 || val > 4)
+ 		return -EINVAL;
+ 
+-	mutex_lock(&data->update_lock);
+ 	fanmode = f75375_read8(client, F75375_REG_FAN_TIMER);
+ 	fanmode = ~(3 << FAN_CTRL_MODE(nr));
+ 
+@@ -321,8 +317,22 @@ static ssize_t set_pwm_enable(struct device *dev, struct device_attribute *attr,
+ 	}
+ 	f75375_write8(client, F75375_REG_FAN_TIMER, fanmode);
+ 	data->pwm_enable[nr] = val;
++	return 0;
++}
++
++static ssize_t set_pwm_enable(struct device *dev, struct device_attribute *attr,
++		const char *buf, size_t count)
++{
++	int nr = to_sensor_dev_attr(attr)->index;
++	struct i2c_client *client = to_i2c_client(dev);
++	struct f75375_data *data = i2c_get_clientdata(client);
++	int val = simple_strtoul(buf, NULL, 10);
++	int err = 0;
++
++	mutex_lock(&data->update_lock);
++	err = set_pwm_enable_direct(client, nr, val);
+ 	mutex_unlock(&data->update_lock);
+-	return count;
++	return err ? err : count;
+ }
+ 
+ static ssize_t set_pwm_mode(struct device *dev, struct device_attribute *attr,
+@@ -604,9 +614,24 @@ static int f75375_detach_client(struct i2c_client *client)
+ 	return 0;
+ }
+ 
++static void f75375_init(struct i2c_client *client, struct f75375_data *data,
++		struct f75375s_platform_data *f75375s_pdata)
++{
++	int nr;
++	set_pwm_enable_direct(client, 0, f75375s_pdata->pwm_enable[0]);
++	set_pwm_enable_direct(client, 1, f75375s_pdata->pwm_enable[1]);
++	for (nr = 0; nr < 2; nr++) {
++		data->pwm[nr] = SENSORS_LIMIT(f75375s_pdata->pwm[nr], 0, 255);
++		f75375_write8(client, F75375_REG_FAN_PWM_DUTY(nr),
++			data->pwm[nr]);
++	}
++
++}
++
+ static int f75375_probe(struct i2c_client *client)
+ {
+ 	struct f75375_data *data = i2c_get_clientdata(client);
++	struct f75375s_platform_data *f75375s_pdata = client->dev.platform_data;
+ 	int err;
+ 
+ 	if (!i2c_check_functionality(client->adapter,
+@@ -637,6 +662,9 @@ static int f75375_probe(struct i2c_client *client)
+ 		goto exit_remove;
+ 	}
+ 
++	if (f75375s_pdata != NULL)
++		f75375_init(client, data, f75375s_pdata);
++
+ 	return 0;
+ 
+ exit_remove:
+diff --git a/include/linux/f75375s.h b/include/linux/f75375s.h
+new file mode 100644
+index 0000000..e99e225
+--- /dev/null
++++ b/include/linux/f75375s.h
+@@ -0,0 +1,21 @@
++/*
++ * f75375s.h - platform data structure for f75375s sensor
++ *
++ * This file is subject to the terms and conditions of the GNU General Public
++ * License.  See the file "COPYING" in the main directory of this archive
++ * for more details.
++ *
++ * Copyright (C) 2007, Riku Voipio <riku.voipio at iki.fi>
++ */
++
++#ifndef __LINUX_F75375S_H
++#define __LINUX_F75375S_H
++
++/* We want to set fans spinning on systems where there is no
++ * BIOS to do that for us */
++struct f75375s_platform_data {
++	u8 pwm[2];
++	u8 pwm_enable[2];
++};
++
++#endif /* __LINUX_F75375S_H */
+-- 
+1.5.3.1
+

Modified: dists/sid/linux-2.6/debian/patches/features/fintek-f75375.patch
==============================================================================
--- dists/sid/linux-2.6/debian/patches/features/fintek-f75375.patch	(original)
+++ dists/sid/linux-2.6/debian/patches/features/fintek-f75375.patch	Mon Nov 26 20:06:56 2007
@@ -1,20 +1,69 @@
-diff -urpN linux-2.6.17/drivers/hwmon/f75375s.c linux-2.6.18-rc6/drivers/hwmon/f75375s.c
---- linux-2.6.17/drivers/hwmon/f75375s.c	1970-01-01 02:00:00.000000000 +0200
-+++ linux-2.6.18-rc6/drivers/hwmon/f75375s.c	2006-10-31 21:54:04.000000000 +0200
-@@ -0,0 +1,636 @@
+Upstream status: will be in 2.6.24-rc1
+
+From f079e78bfdfd228378b693174d1e92b8fb3ada59 Mon Sep 17 00:00:00 2001
+From: Riku Voipio <riku.voipio at movial.fi>
+Date: Fri, 24 Aug 2007 10:46:18 +0300
+Subject: [PATCH] Add f75375s driver
+
+Signed-off-by: Riku Voipio <Riku Voipio riku.voipio at iki.fi>
+---
+ drivers/hwmon/Kconfig   |   10 +
+ drivers/hwmon/Makefile  |    1 +
+ drivers/hwmon/f75375s.c |  691 +++++++++++++++++++++++++++++++++++++++++++++++
+ 3 files changed, 702 insertions(+), 0 deletions(-)
+ create mode 100644 drivers/hwmon/f75375s.c
+
+diff --git a/drivers/hwmon/Kconfig b/drivers/hwmon/Kconfig
+index 192953b..17aa5d7 100644
+--- a/drivers/hwmon/Kconfig
++++ b/drivers/hwmon/Kconfig
+@@ -216,6 +216,16 @@ config SENSORS_F71805F
+ 	  This driver can also be built as a module.  If so, the module
+ 	  will be called f71805f.
+ 
++config SENSORS_F75375S
++	tristate "Fintek F75375S/SP and F75373";
++	depends on I2C && EXPERIMENTAL
++	help
++	  If you say yes here you get support for hardware monitoring
++	  features of the Fintek F75375S/SP and F75373
++
++	  This driver can also be built as a module.  If so, the module
++	  will be called f75375s.
++
+ config SENSORS_FSCHER
+ 	tristate "FSC Hermes"
+ 	depends on I2C
+diff --git a/drivers/hwmon/Makefile b/drivers/hwmon/Makefile
+index d04f900..54efadd 100644
+--- a/drivers/hwmon/Makefile
++++ b/drivers/hwmon/Makefile
+@@ -29,6 +29,7 @@ obj-$(CONFIG_SENSORS_CORETEMP)	+= coretemp.o
+ obj-$(CONFIG_SENSORS_DME1737)	+= dme1737.o
+ obj-$(CONFIG_SENSORS_DS1621)	+= ds1621.o
+ obj-$(CONFIG_SENSORS_F71805F)	+= f71805f.o
++obj-$(CONFIG_SENSORS_F75375S)	+= f75375s.o
+ obj-$(CONFIG_SENSORS_FSCHER)	+= fscher.o
+ obj-$(CONFIG_SENSORS_FSCPOS)	+= fscpos.o
+ obj-$(CONFIG_SENSORS_GL518SM)	+= gl518sm.o
+diff --git a/drivers/hwmon/f75375s.c b/drivers/hwmon/f75375s.c
+new file mode 100644
+index 0000000..6425184
+--- /dev/null
++++ b/drivers/hwmon/f75375s.c
+@@ -0,0 +1,691 @@
 +/*
-+ * f75375.c - driver for the Fintek F75375/SP and F75373
++ * f75375s.c - driver for the Fintek F75375/SP and F75373
 + *             hardware monitoring features
-+ *             
-+ * Copyright (C) 2005  Riku Voipio <riku.voipio at movial.fi>
++ * Copyright (C) 2006-2007  Riku Voipio <riku.voipio at movial.fi>
 + *
-+ * The F75375/SP is a I2C chip made by Fintek. It integrates
-+ * complete hardware monitoring features: voltage, fan and temperature
-+ * sensors, and manual and automatic fan speed control.
++ * Datasheets available at:
 + *
-+ * Datasheets at:
-+ * 
-+ * http://www.fintek.com.tw/eng/products.asp?BID=4&SID=5
++ * f75375:
++ * http://www.fintek.com.tw/files/productfiles/2005111152950.pdf
++ *
++ * f75373:
++ * http://www.fintek.com.tw/files/productfiles/2005111153128.pdf
 + *
 + * 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
@@ -29,68 +78,61 @@
 + * 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., 675 Mass Ave, Cambridge, MA 02139, USA.
++ *
 + */
 +
 +#include <linux/module.h>
-+#include <linux/init.h>
-+#include <linux/slab.h>
 +#include <linux/jiffies.h>
 +#include <linux/hwmon.h>
 +#include <linux/hwmon-sysfs.h>
 +#include <linux/i2c.h>
 +#include <linux/err.h>
 +#include <linux/mutex.h>
-+#include <asm/io.h>
 +
 +/* Addresses to scan */
 +static unsigned short normal_i2c[] = { 0x2d, 0x2e, I2C_CLIENT_END };
 +
 +/* Insmod parameters */
-+I2C_CLIENT_INSMOD_1(f75375);
++I2C_CLIENT_INSMOD_2(f75373, f75375);
 +
 +/* Fintek F75375 registers  */
-+#define F75375_REG_CONFIG0		0x0	/* |start|x|x|x|x|x|soft_pwdn|init| */
-+#define F75375_REG_CONFIG1		0x1	/* |pin2_mode|pin4_mode|t1_mode|t2_mode|fan1_linear_mode|fan2_linear_mode|x|x| */
++#define F75375_REG_CONFIG0		0x0
++#define F75375_REG_CONFIG1		0x1
 +#define F75375_REG_CONFIG2		0x2
 +#define F75375_REG_CONFIG3		0x3
 +#define F75375_REG_ADDR			0x4
-+#define F75375_REG_INTR			0x31	/* fault registers upto 38 */
++#define F75375_REG_INTR			0x31
 +#define F75375_CHIP_ID			0x5A
 +#define F75375_REG_VERSION		0x5C
 +#define F75375_REG_VENDOR		0x5D
-+#define F75375_REG_FAN_TIMER		0x60	/* 6-7 fan2 speed/temp/man|4-5 fan3 */
++#define F75375_REG_FAN_TIMER		0x60
 +
 +#define F75375_REG_VOLT(nr)		(0x10 + (nr))
-+#define F75375_REG_VOLT_HIGH(nr)	(0x20 + (nr) * 2 )
-+#define F75375_REG_VOLT_LOW(nr)		(0x21 + (nr) * 2 )
++#define F75375_REG_VOLT_HIGH(nr)	(0x20 + (nr) * 2)
++#define F75375_REG_VOLT_LOW(nr)		(0x21 + (nr) * 2)
 +
 +#define F75375_REG_TEMP(nr)		(0x14 + (nr))
-+#define F75375_REG_TEMP_HIGH(nr)	(0x28 + (nr) * 2 )
-+#define F75375_REG_TEMP_HYST(nr)	(0x29 + (nr) * 2 )
++#define F75375_REG_TEMP_HIGH(nr)	(0x28 + (nr) * 2)
++#define F75375_REG_TEMP_HYST(nr)	(0x29 + (nr) * 2)
 +
-+#define F75375_REG_FAN(nr)		(0x16 + (nr) * 2 )
-+#define F75375_REG_FAN_MIN(nr)		(0x2C + (nr) * 2 )
-+#define F75375_REG_FAN_MAX(nr)		(0x70 + (nr) * 0x10 )
-+	/*72 - 75 expect count */
-+#define F75375_REG_FAN_PWM_DUTY(nr)	(0x76 + (nr) * 0x10 )
-+#define F75375_REG_FAN_PWM_CLOCK(nr)	(0x7D + (nr) * 0x10 )
-+
-+#define F75375_REG_FAN_EXP(nr)		(0x74 + (nr) * 0x10 )
-+#define F75375_REG_FAN_B_TEMP(nr,step)	((0xA0 + (nr) * 0x10) + (step))	/* 1..4 */
-+#define F75375_REG_FAN_B_SPEED(nr,step)	((0xA5 + (nr) * 0x10) + (step) * 2 )
++#define F75375_REG_FAN(nr)		(0x16 + (nr) * 2)
++#define F75375_REG_FAN_MIN(nr)		(0x2C + (nr) * 2)
++#define F75375_REG_FAN_FULL(nr)		(0x70 + (nr) * 0x10)
++#define F75375_REG_FAN_PWM_DUTY(nr)	(0x76 + (nr) * 0x10)
++#define F75375_REG_FAN_PWM_CLOCK(nr)	(0x7D + (nr) * 0x10)
++
++#define F75375_REG_FAN_EXP(nr)		(0x74 + (nr) * 0x10)
++#define F75375_REG_FAN_B_TEMP(nr, step)	((0xA0 + (nr) * 0x10) + (step))
++#define F75375_REG_FAN_B_SPEED(nr, step) \
++	((0xA5 + (nr) * 0x10) + (step) * 2)
 +
 +#define F75375_REG_PWM1_RAISE_DUTY	0x69
 +#define F75375_REG_PWM2_RAISE_DUTY	0x6A
 +#define F75375_REG_PWM1_DROP_DUTY	0x6B
 +#define F75375_REG_PWM2_DROP_DUTY	0x6C
 +
-+#define  F75375_FAN1_LINEAR_MODE	0x10
-+#define  F75375_FAN2_LINEAR_MODE        0x20
-+
-+#define  F75375_FAN1_MANUAL_MODE	0x30
-+#define  F75375_FAN2_MANUAL_MODE	0xc0
-+
-+#define F75375_PWM_DEFAULT		0xFF
++#define FAN_CTRL_LINEAR(nr)		(4 + nr)
++#define FAN_CTRL_MODE(nr)		(5 + ((nr) * 2))
 +
 +/*
 + * Data structures and manipulation thereof
@@ -102,7 +144,8 @@
 +	struct class_device *class_dev;
 +
 +	const char *name;
-+	struct mutex update_lock;
++	int kind;
++	struct mutex update_lock; /* protect register access */
 +	char valid;
 +	unsigned long last_updated;	/* In jiffies */
 +	unsigned long last_limits;	/* In jiffies */
@@ -113,57 +156,56 @@
 +	u8 in_min[4];
 +	u16 fan[2];
 +	u16 fan_min[2];
-+	u16 fan_max[2];
++	u16 fan_full[2];
 +	u16 fan_exp[2];
 +	u8 fan_timer;
 +	u8 pwm[2];
-+	u8 temp[2];
-+	u8 temp_high[2];
-+	u8 temp_max_hyst[2];
-+	u8 alarms[3];
-+	u8 fan_enabled;		/* Read once at init time */
++	u8 pwm_mode[2];
++	u8 pwm_enable[2];
++	s8 temp[2];
++	s8 temp_high[2];
++	s8 temp_max_hyst[2];
 +};
 +
 +static int f75375_attach_adapter(struct i2c_adapter *adapter);
 +static int f75375_detect(struct i2c_adapter *adapter, int address, int kind);
-+static void f75375_init_client(struct i2c_client *client);
 +static int f75375_detach_client(struct i2c_client *client);
-+static inline int f75375_read_value(struct i2c_client *client, u8 reg);
-+static inline int f75375_write_value(struct i2c_client *client, u8 reg,
-+				     u8 value);
-+static struct f75375_data *f75375_update_device(struct device *dev);
 +
 +static struct i2c_driver f75375_driver = {
 +	.driver = {
-+		   .name = "f75375",
-+		   },
++		.name = "f75375",
++	},
 +	.attach_adapter = f75375_attach_adapter,
 +	.detach_client = f75375_detach_client,
 +};
 +
-+static inline int f75375_read_value(struct i2c_client *client, u8 reg)
++static inline int f75375_read8(struct i2c_client *client, u8 reg)
 +{
 +	return i2c_smbus_read_byte_data(client, reg);
 +}
-+static inline u16 f75375_read_value16(struct i2c_client *client, u8 reg)
++
++/* in most cases, should be called while holding update_lock */
++static inline u16 f75375_read16(struct i2c_client *client, u8 reg)
 +{
 +	return ((i2c_smbus_read_byte_data(client, reg) << 8)
 +		| i2c_smbus_read_byte_data(client, reg + 1));
 +}
 +
-+static inline int f75375_write_value(struct i2c_client *client, u8 reg,
-+				     u8 value)
++static inline void f75375_write8(struct i2c_client *client, u8 reg,
++		u8 value)
 +{
-+	return i2c_smbus_write_byte_data(client, reg, value);
++	i2c_smbus_write_byte_data(client, reg, value);
 +}
-+static inline int f75375_write_value16(struct i2c_client *client, u8 reg,
-+				       u16 value)
++
++static inline void f75375_write16(struct i2c_client *client, u8 reg,
++		u16 value)
 +{
 +	int err = i2c_smbus_write_byte_data(client, reg, (value << 8));
 +	if (err)
-+		return err;
-+	return i2c_smbus_write_byte_data(client, reg + 1, (value & 0xFF));
++		return;
++	i2c_smbus_write_byte_data(client, reg + 1, (value & 0xFF));
 +}
++
 +static struct f75375_data *f75375_update_device(struct device *dev)
 +{
 +	struct i2c_client *client = to_i2c_client(dev);
@@ -173,49 +215,45 @@
 +	mutex_lock(&data->update_lock);
 +
 +	/* Limit registers cache is refreshed after 60 seconds */
-+	if (time_after(jiffies, data->last_updated + 60 * HZ)
-+	    || !data->valid) {
++	if (time_after(jiffies, data->last_limits + 60 * HZ)
++		|| !data->valid) {
 +		for (nr = 0; nr < 2; nr++) {
-+			data->temp_high[nr] = f75375_read_value(client,
-+								F75375_REG_TEMP_HIGH
-+								(nr));
++			data->temp_high[nr] =
++				f75375_read8(client, F75375_REG_TEMP_HIGH(nr));
 +			data->temp_max_hyst[nr] =
-+			    f75375_read_value(client, F75375_REG_TEMP_HYST(nr));
-+			data->fan_max[nr] =
-+			    f75375_read_value16(client, F75375_REG_FAN_MAX(nr));
++				f75375_read8(client, F75375_REG_TEMP_HYST(nr));
++			data->fan_full[nr] =
++				f75375_read16(client, F75375_REG_FAN_FULL(nr));
++			data->fan_min[nr] =
++				f75375_read16(client, F75375_REG_FAN_MIN(nr));
 +			data->fan_exp[nr] =
-+			    f75375_read_value16(client, F75375_REG_FAN_EXP(nr));
++				f75375_read16(client, F75375_REG_FAN_EXP(nr));
++			data->pwm[nr] =	f75375_read8(client,
++				F75375_REG_FAN_PWM_DUTY(nr));
 +
 +		}
 +		for (nr = 0; nr < 4; nr++) {
-+			data->in_max[nr] = f75375_read_value(client,
-+							     F75375_REG_VOLT_HIGH
-+							     (nr));
++			data->in_max[nr] =
++				f75375_read8(client, F75375_REG_VOLT_HIGH(nr));
 +			data->in_min[nr] =
-+			    f75375_read_value(client, F75375_REG_VOLT_LOW(nr));
++				f75375_read8(client, F75375_REG_VOLT_LOW(nr));
 +		}
-+		data->fan_timer = f75375_read_value(client,
-+						    F75375_REG_FAN_TIMER);
++		data->fan_timer = f75375_read8(client, F75375_REG_FAN_TIMER);
 +		data->last_limits = jiffies;
 +	}
 +
 +	/* Measurement registers cache is refreshed after 2 second */
 +	if (time_after(jiffies, data->last_updated + 2 * HZ)
-+	    || !data->valid) {
++		|| !data->valid) {
 +		for (nr = 0; nr < 2; nr++) {
-+			data->temp[nr] = f75375_read_value(client,
-+							   F75375_REG_TEMP(nr));
-+			data->fan[nr] = f75375_read_value16(client,
-+							    F75375_REG_FAN(nr));
-+		}
-+		for (nr = 0; nr < 4; nr++) {
-+			data->in[nr] = f75375_read_value(client,
-+							 F75375_REG_VOLT(nr));
++			data->temp[nr] =
++				f75375_read8(client, F75375_REG_TEMP(nr));
++			data->fan[nr] =
++				f75375_read16(client, F75375_REG_FAN(nr));
 +		}
-+		/*for (nr = 0; nr < 3; nr++) {
-+		   data->alarms[nr] = f75375_read8(data,
-+		   F71805F_REG_STATUS(nr));
-+		   } */
++		for (nr = 0; nr < 4; nr++)
++			data->in[nr] =
++				f75375_read8(client, F75375_REG_VOLT(nr));
 +
 +		data->last_updated = jiffies;
 +		data->valid = 1;
@@ -225,264 +263,374 @@
 +	return data;
 +}
 +
-+#define show(thing) \
-+static ssize_t show_##thing(struct device *dev, struct device_attribute *attr, \
-+			char *buf)\
-+{\
-+	struct sensor_device_attribute *sensor_attr = to_sensor_dev_attr(attr);\
-+	int nr = sensor_attr->index;\
-+	struct f75375_data *data = f75375_update_device(dev); \
-+	return sprintf(buf, "%d\n", data->thing[nr]); \
++static inline u16 rpm_from_reg(u16 reg)
++{
++	if (reg == 0 || reg == 0xffff)
++		return 0;
++	return (1500000 / reg);
 +}
 +
-+static ssize_t set_fan_min(struct device *dev, struct device_attribute *attr,
-+			   const char *buf, size_t count)
++static inline u16 rpm_to_reg(int rpm)
 +{
-+	struct sensor_device_attribute *sensor_attr = to_sensor_dev_attr(attr);
-+	int nr = sensor_attr->index;
++	if (rpm < 367 || rpm > 0xffff)
++		return 0xffff;
++	return (1500000 / rpm);
++}
 +
++static ssize_t set_fan_min(struct device *dev, struct device_attribute *attr,
++		const char *buf, size_t count)
++{
++	int nr = to_sensor_dev_attr(attr)->index;
 +	struct i2c_client *client = to_i2c_client(dev);
 +	struct f75375_data *data = i2c_get_clientdata(client);
-+	int val = simple_strtol(buf, NULL, 10);
++	int val = simple_strtoul(buf, NULL, 10);
 +
 +	mutex_lock(&data->update_lock);
-+	data->fan_min[nr] = val;
-+	f75375_write_value16(client, F75375_REG_FAN_MIN(nr), data->fan_min[nr]);
++	data->fan_min[nr] = rpm_to_reg(val);
++	f75375_write16(client, F75375_REG_FAN_MIN(nr), data->fan_min[nr]);
 +	mutex_unlock(&data->update_lock);
 +	return count;
 +}
 +
 +static ssize_t set_fan_exp(struct device *dev, struct device_attribute *attr,
-+			   const char *buf, size_t count)
++		const char *buf, size_t count)
 +{
-+	struct sensor_device_attribute *sensor_attr = to_sensor_dev_attr(attr);
-+	int nr = sensor_attr->index;
-+
++	int nr = to_sensor_dev_attr(attr)->index;
 +	struct i2c_client *client = to_i2c_client(dev);
 +	struct f75375_data *data = i2c_get_clientdata(client);
-+	int val = simple_strtol(buf, NULL, 10);
++	int val = simple_strtoul(buf, NULL, 10);
 +
 +	mutex_lock(&data->update_lock);
-+	data->fan_exp[nr] = val;
-+	f75375_write_value16(client, F75375_REG_FAN_MIN(nr),
-+			     data->fan_exp[nr]);
++	data->fan_exp[nr] = rpm_to_reg(val);
++	f75375_write16(client, F75375_REG_FAN_EXP(nr), data->fan_exp[nr]);
 +	mutex_unlock(&data->update_lock);
 +	return count;
 +}
 +
-+show(fan);
-+show(fan_min);
-+show(fan_max);
-+show(fan_exp);
-+
-+#define show_fan_offset(offset) \
-+static SENSOR_DEVICE_ATTR(fan##offset##_input, S_IRUGO,      \
-+        show_fan, NULL, offset - 1);\
-+static SENSOR_DEVICE_ATTR(fan##offset##_max, S_IRUGO,      \
-+        show_fan_max, NULL, offset - 1);\
-+static SENSOR_DEVICE_ATTR(fan##offset##_min, S_IRUGO | S_IWUSR,  \
-+        show_fan_min, set_fan_min, offset - 1);       \
-+static SENSOR_DEVICE_ATTR(fan##offset##_exp, S_IRUGO | S_IWUSR,  \
-+        show_fan_exp, set_fan_exp, offset - 1);       \
++static ssize_t set_pwm(struct device *dev, struct device_attribute *attr,
++		const char *buf, size_t count)
++{
++	int nr = to_sensor_dev_attr(attr)->index;
++	struct i2c_client *client = to_i2c_client(dev);
++	struct f75375_data *data = i2c_get_clientdata(client);
++	int val = simple_strtoul(buf, NULL, 10);
 +
-+show_fan_offset(1);
-+show_fan_offset(2);
++	mutex_lock(&data->update_lock);
++	data->pwm[nr] = SENSORS_LIMIT(val, 0, 255);
++	f75375_write8(client, F75375_REG_FAN_PWM_DUTY(nr), data->pwm[nr]);
++	mutex_unlock(&data->update_lock);
++	return count;
++}
 +
-+show(pwm);
++static ssize_t show_pwm_enable(struct device *dev, struct device_attribute
++		*attr, char *buf)
++{
++	int nr = to_sensor_dev_attr(attr)->index;
++	struct f75375_data *data = f75375_update_device(dev);
++	return sprintf(buf, "%d\n", data->pwm_enable[nr]);
++}
 +
-+static ssize_t set_pwm(struct device *dev, struct device_attribute *attr,
-+		       const char *buf, size_t count)
++static ssize_t set_pwm_enable(struct device *dev, struct device_attribute *attr,
++		const char *buf, size_t count)
 +{
-+	struct sensor_device_attribute *sensor_attr = to_sensor_dev_attr(attr);
-+	int nr = sensor_attr->index;
++	int nr = to_sensor_dev_attr(attr)->index;
++	struct i2c_client *client = to_i2c_client(dev);
++	struct f75375_data *data = i2c_get_clientdata(client);
++	int val = simple_strtoul(buf, NULL, 10);
++	u8 fanmode;
++
++	if (val < 0 || val > 4)
++		return -EINVAL;
++
++	mutex_lock(&data->update_lock);
++	fanmode = f75375_read8(client, F75375_REG_FAN_TIMER);
++	fanmode = ~(3 << FAN_CTRL_MODE(nr));
 +
++	switch (val) {
++	case 0: /* Full speed */
++		fanmode  |= (3 << FAN_CTRL_MODE(nr));
++		data->pwm[nr] = 255;
++		f75375_write8(client, F75375_REG_FAN_PWM_DUTY(nr),
++				data->pwm[nr]);
++		break;
++	case 1: /* PWM */
++		fanmode  |= (3 << FAN_CTRL_MODE(nr));
++		break;
++	case 2: /* AUTOMATIC*/
++		fanmode  |= (2 << FAN_CTRL_MODE(nr));
++		break;
++	case 3: /* fan speed */
++		break;
++	}
++	f75375_write8(client, F75375_REG_FAN_TIMER, fanmode);
++	data->pwm_enable[nr] = val;
++	mutex_unlock(&data->update_lock);
++	return count;
++}
++
++static ssize_t set_pwm_mode(struct device *dev, struct device_attribute *attr,
++		const char *buf, size_t count)
++{
++	int nr = to_sensor_dev_attr(attr)->index;
 +	struct i2c_client *client = to_i2c_client(dev);
 +	struct f75375_data *data = i2c_get_clientdata(client);
-+	int val = simple_strtol(buf, NULL, 10);
++	int val = simple_strtoul(buf, NULL, 10);
++	u8 conf = 0;
++
++	if (val != 0 || val != 1 || data->kind == f75373)
++		return -EINVAL;
 +
 +	mutex_lock(&data->update_lock);
-+	data->pwm[nr] = val;
-+	f75375_write_value(client, F75375_REG_FAN_PWM_DUTY(nr), data->pwm[nr]);
++	conf = f75375_read8(client, F75375_REG_CONFIG1);
++	conf = ~(1 << FAN_CTRL_LINEAR(nr));
++
++	if (val == 0)
++		conf |= (1 << FAN_CTRL_LINEAR(nr)) ;
++
++	f75375_write8(client, F75375_REG_CONFIG1, conf);
++	data->pwm_mode[nr] = val;
 +	mutex_unlock(&data->update_lock);
 +	return count;
 +}
 +
-+static SENSOR_DEVICE_ATTR(pwm1, S_IRUGO | S_IWUSR, show_pwm, set_pwm, 0);
-+static SENSOR_DEVICE_ATTR(pwm2, S_IRUGO | S_IWUSR, show_pwm, set_pwm, 1);
++static ssize_t show_pwm(struct device *dev, struct device_attribute
++		*attr, char *buf)
++{
++	int nr = to_sensor_dev_attr(attr)->index;
++	struct f75375_data *data = f75375_update_device(dev);
++	return sprintf(buf, "%d\n", data->pwm[nr]);
++}
++
++static ssize_t show_pwm_mode(struct device *dev, struct device_attribute
++		*attr, char *buf)
++{
++	int nr = to_sensor_dev_attr(attr)->index;
++	struct f75375_data *data = f75375_update_device(dev);
++	return sprintf(buf, "%d\n", data->pwm_mode[nr]);
++}
 +
-+#define VOLT_FROM_REG(val) ((val)*8000)
-+#define VOLT_TO_REG(val) ((val)/8000)
++#define VOLT_FROM_REG(val) ((val) * 8)
++#define VOLT_TO_REG(val) ((val) / 8)
 +
 +static ssize_t show_in(struct device *dev, struct device_attribute *attr,
-+		       char *buf)
++		char *buf)
 +{
-+	struct sensor_device_attribute *sensor_attr = to_sensor_dev_attr(attr);
-+	int nr = sensor_attr->index;
++	int nr = to_sensor_dev_attr(attr)->index;
 +	struct f75375_data *data = f75375_update_device(dev);
 +	return sprintf(buf, "%d\n", VOLT_FROM_REG(data->in[nr]));
 +}
 +
 +static ssize_t show_in_max(struct device *dev, struct device_attribute *attr,
-+			   char *buf)
++		char *buf)
 +{
-+	struct sensor_device_attribute *sensor_attr = to_sensor_dev_attr(attr);
-+	int nr = sensor_attr->index;
++	int nr = to_sensor_dev_attr(attr)->index;
 +	struct f75375_data *data = f75375_update_device(dev);
 +	return sprintf(buf, "%d\n", VOLT_FROM_REG(data->in_max[nr]));
 +}
 +
 +static ssize_t show_in_min(struct device *dev, struct device_attribute *attr,
-+			   char *buf)
++		char *buf)
 +{
-+	struct sensor_device_attribute *sensor_attr = to_sensor_dev_attr(attr);
-+	int nr = sensor_attr->index;
++	int nr = to_sensor_dev_attr(attr)->index;
 +	struct f75375_data *data = f75375_update_device(dev);
-+	return sprintf(buf, "%d\n", VOLT_FROM_REG(data->in_max[nr]));
++	return sprintf(buf, "%d\n", VOLT_FROM_REG(data->in_min[nr]));
 +}
 +
 +static ssize_t set_in_max(struct device *dev, struct device_attribute *attr,
-+			  const char *buf, size_t count)
++		const char *buf, size_t count)
 +{
-+	struct sensor_device_attribute *sensor_attr = to_sensor_dev_attr(attr);
-+	int nr = sensor_attr->index;
++	int nr = to_sensor_dev_attr(attr)->index;
 +	struct i2c_client *client = to_i2c_client(dev);
 +	struct f75375_data *data = i2c_get_clientdata(client);
-+	int val = simple_strtol(buf, NULL, 10);
++	int val = simple_strtoul(buf, NULL, 10);
++	val = SENSORS_LIMIT(VOLT_TO_REG(val), 0, 0xff);
 +	mutex_lock(&data->update_lock);
-+	data->in_max[nr] = VOLT_TO_REG(val);
-+	f75375_write_value(client, F75375_REG_VOLT_HIGH(nr), data->in_max[nr]);
++	data->in_max[nr] = val;
++	f75375_write8(client, F75375_REG_VOLT_HIGH(nr), data->in_max[nr]);
 +	mutex_unlock(&data->update_lock);
 +	return count;
 +}
 +
 +static ssize_t set_in_min(struct device *dev, struct device_attribute *attr,
-+			  const char *buf, size_t count)
++		const char *buf, size_t count)
 +{
-+	struct sensor_device_attribute *sensor_attr = to_sensor_dev_attr(attr);
-+	int nr = sensor_attr->index;
++	int nr = to_sensor_dev_attr(attr)->index;
 +	struct i2c_client *client = to_i2c_client(dev);
 +	struct f75375_data *data = i2c_get_clientdata(client);
-+	int val = simple_strtol(buf, NULL, 10);
++	int val = simple_strtoul(buf, NULL, 10);
++	val = SENSORS_LIMIT(VOLT_TO_REG(val), 0, 0xff);
 +	mutex_lock(&data->update_lock);
-+	data->in_min[nr] = VOLT_TO_REG(val);
-+	f75375_write_value(client, F75375_REG_VOLT_LOW(nr), data->in_min[nr]);
++	data->in_min[nr] = val;
++	f75375_write8(client, F75375_REG_VOLT_LOW(nr), data->in_min[nr]);
 +	mutex_unlock(&data->update_lock);
 +	return count;
 +}
-+
-+#define show_in_offset(offset) \
-+static SENSOR_DEVICE_ATTR(in##offset##_input, S_IRUGO,      \
-+        show_in, NULL, offset);\
-+static SENSOR_DEVICE_ATTR(in##offset##_max, S_IRUGO | S_IWUSR,      \
-+        show_in_max, set_in_max, offset);\
-+static SENSOR_DEVICE_ATTR(in##offset##_min, S_IRUGO | S_IWUSR,  \
-+        show_in_min, set_in_min, offset);       \
-+
-+show_in_offset(0);
-+show_in_offset(1);
-+show_in_offset(2);
-+show_in_offset(3);
-+
-+#define TEMP_FROM_REG(val) ((val)*1000)
-+#define TEMP_TO_REG(val) ((val)/1000)
++#define TEMP_FROM_REG(val) ((val) * 1000)
++#define TEMP_TO_REG(val) ((val) / 1000)
 +
 +static ssize_t show_temp(struct device *dev, struct device_attribute *attr,
-+			 char *buf)
++		char *buf)
 +{
-+	struct sensor_device_attribute *sensor_attr = to_sensor_dev_attr(attr);
-+	int nr = sensor_attr->index;
++	int nr = to_sensor_dev_attr(attr)->index;
 +	struct f75375_data *data = f75375_update_device(dev);
 +	return sprintf(buf, "%d\n", TEMP_FROM_REG(data->temp[nr]));
 +}
 +
 +static ssize_t show_temp_max(struct device *dev, struct device_attribute *attr,
-+			     char *buf)
++		char *buf)
 +{
-+	struct sensor_device_attribute *sensor_attr = to_sensor_dev_attr(attr);
-+	int nr = sensor_attr->index;
++	int nr = to_sensor_dev_attr(attr)->index;
 +	struct f75375_data *data = f75375_update_device(dev);
 +	return sprintf(buf, "%d\n", TEMP_FROM_REG(data->temp_high[nr]));
 +}
 +
 +static ssize_t show_temp_max_hyst(struct device *dev,
-+				  struct device_attribute *attr, char *buf)
++		struct device_attribute *attr, char *buf)
 +{
-+	struct sensor_device_attribute *sensor_attr = to_sensor_dev_attr(attr);
-+	int nr = sensor_attr->index;
++	int nr = to_sensor_dev_attr(attr)->index;
 +	struct f75375_data *data = f75375_update_device(dev);
 +	return sprintf(buf, "%d\n", TEMP_FROM_REG(data->temp_max_hyst[nr]));
 +}
 +
 +static ssize_t set_temp_max(struct device *dev, struct device_attribute *attr,
-+			    const char *buf, size_t count)
++		const char *buf, size_t count)
 +{
-+	struct sensor_device_attribute *sensor_attr = to_sensor_dev_attr(attr);
-+	int nr = sensor_attr->index;
-+
++	int nr = to_sensor_dev_attr(attr)->index;
 +	struct i2c_client *client = to_i2c_client(dev);
 +	struct f75375_data *data = i2c_get_clientdata(client);
 +	int val = simple_strtol(buf, NULL, 10);
-+
++	val = SENSORS_LIMIT(TEMP_TO_REG(val), 0, 127);
 +	mutex_lock(&data->update_lock);
-+	data->temp_high[nr] = TEMP_TO_REG(val);
-+	f75375_write_value(client, F75375_REG_TEMP_HIGH(nr),
-+			   data->temp_high[nr]);
++	data->temp_high[nr] = val;
++	f75375_write8(client, F75375_REG_TEMP_HIGH(nr), data->temp_high[nr]);
 +	mutex_unlock(&data->update_lock);
 +	return count;
 +}
 +
 +static ssize_t set_temp_max_hyst(struct device *dev,
-+				 struct device_attribute *attr, const char *buf,
-+				 size_t count)
++	struct device_attribute *attr, const char *buf, size_t count)
 +{
-+	struct sensor_device_attribute *sensor_attr = to_sensor_dev_attr(attr);
-+	int nr = sensor_attr->index;
-+
++	int nr = to_sensor_dev_attr(attr)->index;
 +	struct i2c_client *client = to_i2c_client(dev);
 +	struct f75375_data *data = i2c_get_clientdata(client);
 +	int val = simple_strtol(buf, NULL, 10);
-+
++	val = SENSORS_LIMIT(TEMP_TO_REG(val), 0, 127);
 +	mutex_lock(&data->update_lock);
-+	data->temp_max_hyst[nr] = TEMP_TO_REG(val);
-+	f75375_write_value(client, F75375_REG_TEMP_HYST(nr),
-+			   data->temp_max_hyst[nr]);
++	data->temp_max_hyst[nr] = val;
++	f75375_write8(client, F75375_REG_TEMP_HYST(nr),
++		data->temp_max_hyst[nr]);
 +	mutex_unlock(&data->update_lock);
 +	return count;
 +}
 +
-+#define show_temp_offset(offset) \
-+static SENSOR_DEVICE_ATTR(temp##offset##_input, S_IRUGO,      \
-+        show_temp, NULL, offset - 1); \
-+static SENSOR_DEVICE_ATTR(temp##offset##_max_hyst, S_IRUGO | S_IWUSR,  \
-+        show_temp_max_hyst, set_temp_max_hyst, offset - 1);       \
-+static SENSOR_DEVICE_ATTR(temp##offset##_max, S_IRUGO | S_IWUSR,  \
-+        show_temp_max, set_temp_max, offset - 1);
-+
-+show_temp_offset(1);
-+show_temp_offset(2);
-+
-+static void f75375_init_client(struct i2c_client *client)
-+{
-+	/* Start the fans in manual mode */
-+	struct f75375_data *data = i2c_get_clientdata(client);
-+	int tmp = F75375_FAN1_LINEAR_MODE | F75375_FAN2_LINEAR_MODE;
-+	mutex_lock(&data->update_lock);
-+	f75375_write_value(client, F75375_REG_CONFIG1, tmp);
-+	tmp = F75375_FAN1_MANUAL_MODE | F75375_FAN2_MANUAL_MODE;
-+	f75375_write_value(client, F75375_REG_FAN_TIMER, tmp);
-+	f75375_write_value(client, F75375_REG_FAN_PWM_DUTY(0),
-+			   F75375_PWM_DEFAULT);
-+	f75375_write_value(client, F75375_REG_FAN_PWM_DUTY(1),
-+			   F75375_PWM_DEFAULT);
-+	printk(KERN_INFO "f75375: fan timer after: %X \n", data->fan_timer);
-+	mutex_unlock(&data->update_lock);
++#define show_fan(thing) \
++static ssize_t show_##thing(struct device *dev, struct device_attribute *attr, \
++			char *buf)\
++{\
++	int nr = to_sensor_dev_attr(attr)->index;\
++	struct f75375_data *data = f75375_update_device(dev); \
++	return sprintf(buf, "%d\n", rpm_from_reg(data->thing[nr])); \
 +}
 +
-+static int f75375_attach_adapter(struct i2c_adapter *adapter)
-+{
-+	printk(KERN_INFO "f75375: attaching\n");
-+	return i2c_probe(adapter, &addr_data, f75375_detect);
-+}
++show_fan(fan);
++show_fan(fan_min);
++show_fan(fan_full);
++show_fan(fan_exp);
++
++static SENSOR_DEVICE_ATTR(in0_input, S_IRUGO, show_in, NULL, 0);
++static SENSOR_DEVICE_ATTR(in0_max, S_IRUGO|S_IWUSR,
++	show_in_max, set_in_max, 0);
++static SENSOR_DEVICE_ATTR(in0_min, S_IRUGO|S_IWUSR,
++	show_in_min, set_in_min, 0);
++static SENSOR_DEVICE_ATTR(in1_input, S_IRUGO, show_in, NULL, 1);
++static SENSOR_DEVICE_ATTR(in1_max, S_IRUGO|S_IWUSR,
++	show_in_max, set_in_max, 1);
++static SENSOR_DEVICE_ATTR(in1_min, S_IRUGO|S_IWUSR,
++	show_in_min, set_in_min, 1);
++static SENSOR_DEVICE_ATTR(in2_input, S_IRUGO, show_in, NULL, 2);
++static SENSOR_DEVICE_ATTR(in2_max, S_IRUGO|S_IWUSR,
++	show_in_max, set_in_max, 2);
++static SENSOR_DEVICE_ATTR(in2_min, S_IRUGO|S_IWUSR,
++	show_in_min, set_in_min, 2);
++static SENSOR_DEVICE_ATTR(in3_input, S_IRUGO, show_in, NULL, 3);
++static SENSOR_DEVICE_ATTR(in3_max, S_IRUGO|S_IWUSR,
++	show_in_max, set_in_max, 3);
++static SENSOR_DEVICE_ATTR(in3_min, S_IRUGO|S_IWUSR,
++	show_in_min, set_in_min, 3);
++static SENSOR_DEVICE_ATTR(temp1_input, S_IRUGO, show_temp, NULL, 0);
++static SENSOR_DEVICE_ATTR(temp1_max_hyst, S_IRUGO|S_IWUSR,
++	show_temp_max_hyst, set_temp_max_hyst, 0);
++static SENSOR_DEVICE_ATTR(temp1_max, S_IRUGO|S_IWUSR,
++	show_temp_max, set_temp_max, 0);
++static SENSOR_DEVICE_ATTR(temp2_input, S_IRUGO, show_temp, NULL, 1);
++static SENSOR_DEVICE_ATTR(temp2_max_hyst, S_IRUGO|S_IWUSR,
++	show_temp_max_hyst, set_temp_max_hyst, 1);
++static SENSOR_DEVICE_ATTR(temp2_max, S_IRUGO|S_IWUSR,
++	show_temp_max, set_temp_max, 1);
++static SENSOR_DEVICE_ATTR(fan1_input, S_IRUGO, show_fan, NULL, 0);
++static SENSOR_DEVICE_ATTR(fan1_full, S_IRUGO, show_fan_full, NULL, 0);
++static SENSOR_DEVICE_ATTR(fan1_min, S_IRUGO|S_IWUSR,
++	show_fan_min, set_fan_min, 0);
++static SENSOR_DEVICE_ATTR(fan1_exp, S_IRUGO|S_IWUSR,
++	show_fan_exp, set_fan_exp, 0);
++static SENSOR_DEVICE_ATTR(fan2_input, S_IRUGO, show_fan, NULL, 1);
++static SENSOR_DEVICE_ATTR(fan2_full, S_IRUGO, show_fan_full, NULL, 1);
++static SENSOR_DEVICE_ATTR(fan2_min, S_IRUGO|S_IWUSR,
++	show_fan_min, set_fan_min, 1);
++static SENSOR_DEVICE_ATTR(fan2_exp, S_IRUGO|S_IWUSR,
++	show_fan_exp, set_fan_exp, 1);
++static SENSOR_DEVICE_ATTR(pwm1, S_IRUGO|S_IWUSR,
++	show_pwm, set_pwm, 0);
++static SENSOR_DEVICE_ATTR(pwm1_enable, S_IRUGO|S_IWUSR,
++	show_pwm_enable, set_pwm_enable, 0);
++static SENSOR_DEVICE_ATTR(pwm1_mode, S_IRUGO|S_IWUSR,
++	show_pwm_mode, set_pwm_mode, 0);
++static SENSOR_DEVICE_ATTR(pwm2, S_IRUGO | S_IWUSR,
++	show_pwm, set_pwm, 1);
++static SENSOR_DEVICE_ATTR(pwm2_enable, S_IRUGO|S_IWUSR,
++	show_pwm_enable, set_pwm_enable, 1);
++static SENSOR_DEVICE_ATTR(pwm2_mode, S_IRUGO|S_IWUSR,
++	show_pwm_mode, set_pwm_mode, 1);
++
++static struct attribute *f75375_attributes[] = {
++	&sensor_dev_attr_temp1_input.dev_attr.attr,
++	&sensor_dev_attr_temp1_max.dev_attr.attr,
++	&sensor_dev_attr_temp1_max_hyst.dev_attr.attr,
++	&sensor_dev_attr_temp2_input.dev_attr.attr,
++	&sensor_dev_attr_temp2_max.dev_attr.attr,
++	&sensor_dev_attr_temp2_max_hyst.dev_attr.attr,
++	&sensor_dev_attr_fan1_input.dev_attr.attr,
++	&sensor_dev_attr_fan1_full.dev_attr.attr,
++	&sensor_dev_attr_fan1_min.dev_attr.attr,
++	&sensor_dev_attr_fan1_exp.dev_attr.attr,
++	&sensor_dev_attr_fan2_input.dev_attr.attr,
++	&sensor_dev_attr_fan2_full.dev_attr.attr,
++	&sensor_dev_attr_fan2_min.dev_attr.attr,
++	&sensor_dev_attr_fan2_exp.dev_attr.attr,
++	&sensor_dev_attr_pwm1.dev_attr.attr,
++	&sensor_dev_attr_pwm1_enable.dev_attr.attr,
++	&sensor_dev_attr_pwm1_mode.dev_attr.attr,
++	&sensor_dev_attr_pwm2.dev_attr.attr,
++	&sensor_dev_attr_pwm2_enable.dev_attr.attr,
++	&sensor_dev_attr_pwm2_mode.dev_attr.attr,
++	&sensor_dev_attr_in0_input.dev_attr.attr,
++	&sensor_dev_attr_in0_max.dev_attr.attr,
++	&sensor_dev_attr_in0_min.dev_attr.attr,
++	&sensor_dev_attr_in1_input.dev_attr.attr,
++	&sensor_dev_attr_in1_max.dev_attr.attr,
++	&sensor_dev_attr_in1_min.dev_attr.attr,
++	&sensor_dev_attr_in2_input.dev_attr.attr,
++	&sensor_dev_attr_in2_max.dev_attr.attr,
++	&sensor_dev_attr_in2_min.dev_attr.attr,
++	&sensor_dev_attr_in3_input.dev_attr.attr,
++	&sensor_dev_attr_in3_max.dev_attr.attr,
++	&sensor_dev_attr_in3_min.dev_attr.attr,
++	NULL
++};
++
++static const struct attribute_group f75375_group = {
++	.attrs = f75375_attributes,
++};
 +
 +static int f75375_detach_client(struct i2c_client *client)
 +{
@@ -490,6 +638,7 @@
 +	int err;
 +
 +	hwmon_device_unregister(data->class_dev);
++	sysfs_remove_group(&client->dev.kobj, &f75375_group);
 +
 +	err = i2c_detach_client(client);
 +	if (err) {
@@ -502,123 +651,79 @@
 +	return 0;
 +}
 +
++static int f75375_attach_adapter(struct i2c_adapter *adapter)
++{
++	if (!(adapter->class & I2C_CLASS_HWMON))
++		return 0;
++	return i2c_probe(adapter, &addr_data, f75375_detect);
++}
++
 +/* This function is called by i2c_probe */
 +static int f75375_detect(struct i2c_adapter *adapter, int address, int kind)
 +{
-+	struct i2c_client *new_client;
++	struct i2c_client *client;
 +	struct f75375_data *data;
++	u8 version = 0;
 +	int err = 0;
-+	char *name = "";
++	const char *name = "";
 +
 +	if (!(data = kzalloc(sizeof(struct f75375_data), GFP_KERNEL))) {
 +		err = -ENOMEM;
 +		goto exit;
 +	}
-+
-+	new_client = &data->client;
-+	i2c_set_clientdata(new_client, data);
-+	new_client->addr = address;
-+	new_client->adapter = adapter;
-+	new_client->driver = &f75375_driver;
-+	new_client->flags = 0;
++	client = &data->client;
++	i2c_set_clientdata(client, data);
++	client->addr = address;
++	client->adapter = adapter;
++	client->driver = &f75375_driver;
 +
 +	if (kind < 0) {
-+		u16 chipid =
-+		    (i2c_smbus_read_byte_data(new_client, F75375_CHIP_ID) << 8)
-+		    | i2c_smbus_read_byte_data(new_client, F75375_CHIP_ID + 1);
-+		u8 version =
-+		    i2c_smbus_read_byte_data(new_client, F75375_REG_VERSION);
-+		u16 vendid =
-+		    (i2c_smbus_read_byte_data(new_client, F75375_REG_VENDOR) <<
-+		     8)
-+		    | i2c_smbus_read_byte_data(new_client,
-+					       F75375_REG_VENDOR + 1);
++		u16 vendid = f75375_read16(client, F75375_REG_VENDOR);
++		u16 chipid = f75375_read16(client, F75375_CHIP_ID);
++		version = f75375_read8(client, F75375_REG_VERSION);
 +		if (chipid == 0x0306 && vendid == 0x1934) {
-+			pr_info("F75375: found F75375 version: %02X\n",
-+				version);
-+			name = "F75375";
++			kind = f75375;
 +		} else if (chipid == 0x0204 && vendid == 0x1934) {
-+			pr_info("F75375: found F75373 version: %02X\n",
-+				version);
-+			name = "F75373";
++			kind = f75373;
 +		} else {
-+			printk(KERN_INFO "f75375: failed,%02X,%02X,%02X\n",
-+			       chipid, version, vendid);
++			dev_err(&adapter->dev,
++				"failed,%02X,%02X,%02X\n",
++				chipid, version, vendid);
 +			goto exit_free;
 +		}
 +	}
-+	strlcpy(new_client->name, name, I2C_NAME_SIZE);
-+	data->valid = 0;
++
++	if (kind == f75375) {
++		name = "f75375";
++	} else if (kind == f75373) {
++		name = "f75373";
++	}
++
++	dev_info(&adapter->dev, "found %s version: %02X\n", name, version);
++	strlcpy(client->name, name, I2C_NAME_SIZE);
++	data->kind = kind;
 +	mutex_init(&data->update_lock);
-+	if ((err = i2c_attach_client(new_client)))
++	if ((err = i2c_attach_client(client)))
 +		goto exit_free;
 +
-+	/* Initialize the chip */
-+	f75375_init_client(new_client);
++	if ((err = sysfs_create_group(&client->dev.kobj, &f75375_group)))
++		goto exit_detach;
 +
-+	/* Register sysfs hooks */
-+	data->class_dev = hwmon_device_register(&new_client->dev);
++	data->class_dev = hwmon_device_register(&client->dev);
 +	if (IS_ERR(data->class_dev)) {
 +		err = PTR_ERR(data->class_dev);
-+		goto exit_detach;
++		goto exit_remove;
 +	}
-+	device_create_file(&new_client->dev,
-+			   &sensor_dev_attr_temp1_input.dev_attr);
-+	device_create_file(&new_client->dev,
-+			   &sensor_dev_attr_temp1_max.dev_attr);
-+	device_create_file(&new_client->dev,
-+			   &sensor_dev_attr_temp1_max_hyst.dev_attr);
-+	device_create_file(&new_client->dev,
-+			   &sensor_dev_attr_temp2_input.dev_attr);
-+	device_create_file(&new_client->dev,
-+			   &sensor_dev_attr_temp2_max.dev_attr);
-+	device_create_file(&new_client->dev,
-+			   &sensor_dev_attr_temp2_max_hyst.dev_attr);
-+
-+	device_create_file(&new_client->dev,
-+			   &sensor_dev_attr_fan1_input.dev_attr);
-+	device_create_file(&new_client->dev,
-+			   &sensor_dev_attr_fan1_max.dev_attr);
-+	device_create_file(&new_client->dev,
-+			   &sensor_dev_attr_fan1_min.dev_attr);
-+	device_create_file(&new_client->dev,
-+			   &sensor_dev_attr_fan1_exp.dev_attr);
-+	device_create_file(&new_client->dev,
-+			   &sensor_dev_attr_fan2_input.dev_attr);
-+	device_create_file(&new_client->dev,
-+			   &sensor_dev_attr_fan2_max.dev_attr);
-+	device_create_file(&new_client->dev,
-+			   &sensor_dev_attr_fan2_min.dev_attr);
-+	device_create_file(&new_client->dev,
-+			   &sensor_dev_attr_fan2_exp.dev_attr);
-+
-+	device_create_file(&new_client->dev, &sensor_dev_attr_pwm1.dev_attr);
-+	device_create_file(&new_client->dev, &sensor_dev_attr_pwm2.dev_attr);
-+
-+	device_create_file(&new_client->dev,
-+			   &sensor_dev_attr_in0_input.dev_attr);
-+	device_create_file(&new_client->dev, &sensor_dev_attr_in0_max.dev_attr);
-+	device_create_file(&new_client->dev, &sensor_dev_attr_in0_min.dev_attr);
-+	device_create_file(&new_client->dev,
-+			   &sensor_dev_attr_in1_input.dev_attr);
-+	device_create_file(&new_client->dev, &sensor_dev_attr_in1_max.dev_attr);
-+	device_create_file(&new_client->dev, &sensor_dev_attr_in1_min.dev_attr);
-+	device_create_file(&new_client->dev,
-+			   &sensor_dev_attr_in2_input.dev_attr);
-+	device_create_file(&new_client->dev, &sensor_dev_attr_in2_max.dev_attr);
-+	device_create_file(&new_client->dev, &sensor_dev_attr_in2_min.dev_attr);
-+	device_create_file(&new_client->dev,
-+			   &sensor_dev_attr_in3_input.dev_attr);
-+	device_create_file(&new_client->dev, &sensor_dev_attr_in3_max.dev_attr);
-+	device_create_file(&new_client->dev, &sensor_dev_attr_in3_min.dev_attr);
 +
 +	return 0;
 +
-+      exit_detach:
-+	i2c_detach_client(new_client);
-+      exit_free:
++exit_remove:
++	sysfs_remove_group(&client->dev.kobj, &f75375_group);
++exit_detach:
++	i2c_detach_client(client);
++exit_free:
 +	kfree(data);
-+      exit:
++exit:
 +	return err;
 +}
 +
@@ -638,34 +743,6 @@
 +
 +module_init(sensors_f75375_init);
 +module_exit(sensors_f75375_exit);
-diff -urpN linux-2.6.17/drivers/hwmon/Kconfig linux-2.6.18-rc6/drivers/hwmon/Kconfig
---- linux-2.6.17/drivers/hwmon/Kconfig	2006-10-31 20:00:09.000000000 +0200
-+++ linux-2.6.18-rc6/drivers/hwmon/Kconfig	2006-10-15 15:05:55.000000000 +0300
-@@ -139,6 +139,16 @@ config SENSORS_F71805F
- 	  This driver can also be built as a module.  If so, the module
- 	  will be called f71805f.
- 
-+config SENSORS_F75375S
-+	tristate "Fintek F75375S/SP and F75373"
-+	depends on HWMON && I2C && EXPERIMENTAL
-+	help
-+	  If you say yes here you get support for hardware monitoring
-+	  features of the Fintek F75375S/SP and F75373
-+
-+	  This driver can also be built as a module.  If so, the module
-+	  will be called f75375s.
-+
- config SENSORS_FSCHER
- 	tristate "FSC Hermes"
- 	depends on HWMON && I2C && EXPERIMENTAL
-diff -urpN linux-2.6.17/drivers/hwmon/Makefile linux-2.6.18-rc6/drivers/hwmon/Makefile
---- linux-2.6.17/drivers/hwmon/Makefile	2006-10-31 20:00:09.000000000 +0200
-+++ linux-2.6.18-rc6/drivers/hwmon/Makefile	2006-10-15 15:02:16.000000000 +0300
-@@ -21,6 +21,7 @@ obj-$(CONFIG_SENSORS_ADM9240)	+= adm9240
- obj-$(CONFIG_SENSORS_ATXP1)	+= atxp1.o
- obj-$(CONFIG_SENSORS_DS1621)	+= ds1621.o
- obj-$(CONFIG_SENSORS_F71805F)	+= f71805f.o
-+obj-$(CONFIG_SENSORS_F75375S)	+= f75375s.o
- obj-$(CONFIG_SENSORS_FSCHER)	+= fscher.o
- obj-$(CONFIG_SENSORS_FSCPOS)	+= fscpos.o
- obj-$(CONFIG_SENSORS_GL518SM)	+= gl518sm.o
+-- 
+1.5.3.1
+

Added: dists/sid/linux-2.6/debian/patches/series/1~experimental.1
==============================================================================
--- (empty file)
+++ dists/sid/linux-2.6/debian/patches/series/1~experimental.1	Mon Nov 26 20:06:56 2007
@@ -0,0 +1,61 @@
++ debian/version.patch
++ debian/kernelvariables.patch
++ debian/doc-build-parallel.patch
++ debian/scripts-kconfig-reportoldconfig.patch
++ debian/powerpc-mkvmlinuz-support-ppc.patch
++ debian/powerpc-mkvmlinuz-support-powerpc.patch
+
++ debian/drivers-ata-ata_piix-postpone-pata.patch
+
++ debian/dfsg/drivers-net-tg3-fix-simple.patch
+
++ bugfix/powerpc/build-links.patch
++ bugfix/powerpc/mv643xx-hotplug-support.patch
++ bugfix/powerpc/oldworld-boot-fix.patch
++ bugfix/powerpc/prep-utah-ide-interrupt.patch
++ bugfix/powerpc/serial.patch
++ bugfix/mips/tulip_dc21143.patch
++ bugfix/mips/cobalt-ide-resources.patch
++ bugfix/mips/bcm1480-pci-build-fix.patch
++ bugfix/mips/ip22-disable-early-printk.patch
++ bugfix/mips/ip22-fix-eisa-interrupt-setup.patch
++ bugfix/mips/ip22-fix-eprom-access.patch
++ features/arm/ixp4xx-npe-driver-0.3.1.patch
++ features/arm/ixp4xx-net-driver-improve-mac-handling.patch
++ features/arm/nslu2-i2c-gpio-driver-support.patch
++ features/arm/nas100d-i2c-gpio-driver-support.patch
++ features/arm/nslu2-mac_plat_info.patch
++ features/arm/nas100d-mac_plat_info.patch
++ features/arm/nslu2-setup-mac.patch
++ features/arm/nas100d-setup-mac.patch
+#+ bugfix/drivers-bus_to_virt.patch
++ bugfix/sparc/drivers_net-broken.patch
++ bugfix/forcedeth-napi-broken.patch
+#+ bugfix/powerpc/drivers_macintosh-broken.patch
++ bugfix/ia64/hardcode-arch-script-output.patch
++ features/fintek-f75375.patch
++ features/f75375-new-style-bindings.patch
++ features/f75375-set-fans-platform-data.patch
++ features/arm/n2100-set-fan.patch
+#+ features/alpha/isa-mapping-support.patch
++ bugfix/powerpc/libgcc-__ucmpdi2.patch
++ bugfix/arm/disable-dvb_b2c2_flexcop.patch
++ bugfix/arm/disable-dvb_budget.patch
++ bugfix/arm/disable-netxen_nic.patch
++ bugfix/arm/disable-chelsio_t3.patch
++ bugfix/arm/disable-video_bt848.patch
++ bugfix/arm/disable-bcm43xx.patch
++ bugfix/arm/binutils-notes.patch
++ bugfix/all/git-ieee1394.patch
++ features/all/v7-iwlwifi-add-iwlwifi-wireless-drivers.patch
++ features/all/e1000e-20070806.patch
++ features/all/e1000e-fixes.patch
++ bugfix/all/2.6.23.1
++ bugfix/arm/disable-scsi_acard.patch
++ bugfix/all/stable/2.6.23.2.patch
++ bugfix/all/stable/2.6.23.3.patch
++ bugfix/all/stable/2.6.23.4.patch
++ bugfix/all/stable/2.6.23.5.patch
++ bugfix/all/stable/2.6.23.6.patch
++ bugfix/all/stable/2.6.23.7.patch
++ bugfix/all/stable/2.6.23.8.patch

Added: dists/sid/linux-2.6/debian/patches/series/1~experimental.1-extra
==============================================================================
--- (empty file)
+++ dists/sid/linux-2.6/debian/patches/series/1~experimental.1-extra	Mon Nov 26 20:06:56 2007
@@ -0,0 +1,2 @@
++ features/all/vserver/vs2.2.0-rc5.patch *_vserver *_xen-vserver
++ features/all/vserver/bindmount-dev.patch *_vserver *_xen-vserver

Added: dists/sid/linux-2.6/debian/patches/series/orig-0
==============================================================================
--- (empty file)
+++ dists/sid/linux-2.6/debian/patches/series/orig-0	Mon Nov 26 20:06:56 2007
@@ -0,0 +1,18 @@
++ debian/dfsg/drivers-net-tg3-mark.patch
+X debian/dfsg/files-1
++ debian/dfsg/drivers-atm.patch
++ debian/dfsg/drivers-char-computone.patch
++ debian/dfsg/drivers-media-dvb-ttusb-budget.patch
++ debian/dfsg/drivers-media-video-dabus.patch
++ debian/dfsg/drivers-net-acenic-remove.patch
++ debian/dfsg/drivers-net-bnx2-disable.patch
++ debian/dfsg/drivers-net-appletalk-cops.patch
++ debian/dfsg/drivers-net-dgrs.patch
++ debian/dfsg/drivers-net-hamradio-yam.patch
++ debian/dfsg/drivers-net-myri.patch
++ debian/dfsg/drivers-net-tg3-remove.patch
++ debian/dfsg/drivers-net-tokenring-3c359-smctr.patch
++ debian/dfsg/drivers-scsi-qlogicpti.patch
++ debian/dfsg/drivers-usb-misc-emi62-emi26.patch
++ debian/dfsg/drivers-usb-serial-keyspan-remove.patch
++ debian/dfsg/sound-pci.patch

Modified: dists/sid/linux-2.6/debian/rules
==============================================================================
--- dists/sid/linux-2.6/debian/rules	(original)
+++ dists/sid/linux-2.6/debian/rules	Mon Nov 26 20:06:56 2007
@@ -15,7 +15,7 @@
 source: debian/control $(STAMPS_DIR)/source-base
 $(STAMPS_DIR)/source-base: $(BUILD_DIR) $(STAMPS_DIR)
 	dh_testdir
-	$(MAKE) -f debian/rules.gen source-$(DEB_HOST_ARCH)
+	$(MAKE) -f debian/rules.gen source_$(DEB_HOST_ARCH)
 	touch $@
 
 source-all: debian/control $(BUILD_DIR) $(STAMPS_DIR)
@@ -25,32 +25,36 @@
 setup: debian/control $(STAMPS_DIR)/setup-base
 $(STAMPS_DIR)/setup-base: $(STAMPS_DIR)/source-base
 	dh_testdir
-	$(MAKE) -f debian/rules.gen setup-$(DEB_HOST_ARCH)
+	$(MAKE) -f debian/rules.gen setup_$(DEB_HOST_ARCH)
 	touch $@
 
 build: debian/control $(STAMPS_DIR)/build-base
 $(STAMPS_DIR)/build-base: $(STAMPS_DIR)/setup-base
 	dh_testdir
-	$(MAKE) -f debian/rules.gen build-$(DEB_HOST_ARCH)
+	$(MAKE) -f debian/rules.gen build_$(DEB_HOST_ARCH)
 	touch $@
 
 $(BUILD_DIR) $(STAMPS_DIR):
 	@[ -d $@ ] || mkdir $@
 
 DIR_ORIG = ../orig/$(SOURCE)-$(VERSION)
-TAR_ORIG = ../$(SOURCE)_$(VERSION).orig.tar.gz
+TAR_ORIG_NAME = $(SOURCE)_$(VERSION).orig.tar.gz
+TAR_ORIG = $(firstword $(wildcard ../$(TAR_ORIG_NAME)) $(wildcard ../orig/$(TAR_ORIG_NAME)))
 
 orig: $(DIR_ORIG)
-	rsync --delete --exclude debian --exclude .svn --link-dest=$(DIR_ORIG)/ -a $(DIR_ORIG)/ .
+	rsync --delete --exclude debian --exclude .svk --exclude .svn --link-dest=$(DIR_ORIG)/ -a $(DIR_ORIG)/ .
 
 $(DIR_ORIG):
-	@[ -e $(TAR_ORIG) ] || ( echo "Can't find orig tarball" >&2; exit 1 )
+ifeq ($(TAR_ORIG),)
+	$(error Cannot find orig tarball $(TAR_ORIG_NAME))
+else
 	mkdir -p ../orig
 	tar -C ../orig -xzf $(TAR_ORIG)
+endif
 
 maintainerclean:
-	rm -f debian/control debian/control.md5sum debian/rules.gen debian/bin/patch.* debian/linux-*
-	rm -rf $(filter-out debian .svn, $(wildcard * .[^.]*))
+	rm -f debian/config.defines.dump debian/control debian/control.md5sum debian/rules.gen debian/bin/patch.* debian/linux-*
+	rm -rf $(filter-out debian .svk .svn, $(wildcard * .[^.]*))
 
 clean: debian/control
 	dh_testdir
@@ -63,26 +67,22 @@
 
 binary-arch: $(STAMPS_DIR)/build-base
 	dh_testdir
-	$(MAKE) -f debian/rules.gen binary-arch-$(DEB_HOST_ARCH)
+	$(MAKE) -f debian/rules.gen binary-arch_$(DEB_HOST_ARCH)
 
 binary:	binary-indep binary-arch
 
 CONTROL_FILES = debian/changelog $(wildcard debian/templates/*.in)
-CONTROL_FILES += debian/arch/defines $(wildcard debian/arch/*/defines) $(wildcard debian/arch/*/*/defines)
+CONTROL_FILES += debian/config/defines $(wildcard debian/config/*/defines) $(wildcard debian/config/*/*/defines)
 debian/control debian/rules.gen: debian/bin/gencontrol.py $(CONTROL_FILES)
-	if [ -f debian/control.md5sum ]; then \
-		if [ "$(VERSION_DEBIAN_BINNMU)" ]; then \
-			if ! grep -v debian/changelog debian/control.md5sum | md5sum --check - --status; then \
-				$(MAKE) -f debian/rules debian/control-real; \
-			fi \
-		else \
-			if ! md5sum --check debian/control.md5sum --status; then \
-				$(MAKE) -f debian/rules debian/control-real; \
-			fi \
-		fi \
-	else \
-		$(MAKE) -f debian/rules debian/control-real; \
-	fi
+ifeq ($(wildcard debian/control.md5sum),)
+	$(MAKE) -f debian/rules debian/control-real
+else ifeq ($(VERSION_DEBIAN_BINNMU),)
+	md5sum --check debian/control.md5sum --status || \
+		$(MAKE) -f debian/rules debian/control-real
+else
+	grep -v debian/changelog debian/control.md5sum | md5sum --check - --status || \
+		$(MAKE) -f debian/rules debian/control-real
+endif
 
 debian/control-real: debian/bin/gencontrol.py $(CONTROL_FILES)
 	chmod +x $<
@@ -96,22 +96,4 @@
 	@echo
 	exit 1
 
-#
-# Rule to check all configs snipplets in debian/arch
-#
-
-CheckConfs_DIR := $(BUILD_DIR)/check
-
-$(CheckConfs_DIR) source-configs: debian/control $(BUILD_DIR) $(STAMPS_DIR)
-	$(MAKE) -f debian/rules.gen setup-$(DEB_HOST_ARCH)-real
-	rm -rf '$(CheckConfs_DIR)'
-	cp -al $(BUILD_DIR)/source $(CheckConfs_DIR)
-
-check-configs: $(CheckConfs_DIR)
-	@echo "Checking all configuration files"
-	ocaml debian/bin/kconfig.ml -c -b "debian/arch"
-
-clean-configs:
-	rm -rf '$(CheckConfs_DIR)'
-
 .PHONY: clean build setup binary-indep binary-arch binary

Modified: dists/sid/linux-2.6/debian/rules.real
==============================================================================
--- dists/sid/linux-2.6/debian/rules.real	(original)
+++ dists/sid/linux-2.6/debian/rules.real	Mon Nov 26 20:06:56 2007
@@ -15,54 +15,39 @@
 export DH_OPTIONS
 export DEB_HOST_ARCH DEB_HOST_GNU_TYPE DEB_BUILD_ARCH
 
-#
-# Build the list of common config files to be included
-#
-ifeq ($(SUBARCH),none)
-  basedir := debian/arch/$(ARCH)
-else
-  basedir := debian/arch/$(ARCH)/$(SUBARCH)
+include debian/rules.defs
+
+ifdef DEBIAN_KERNEL_JOBS
+  JOBS_ARG = -j$(DEBIAN_KERNEL_JOBS)
 endif
 
--include $(basedir)/Makefile.inc
+setup_env := env -u ABINAME -u ARCH -u FEATURESET -u FLAVOUR -u VERSION -u LOCALVERSION -u MAKEFLAGS
+setup_env += DISTRIBUTION_OFFICIAL_BUILD=1 DISTRIBUTION_UPLOADER=$(UPLOADER) DISTRIBUTION_VERSION="$(SOURCEVERSION)"
 
-include debian/rules.defs
+MAKE_CLEAN = $(setup_env) $(MAKE)
+MAKE_SELF = $(MAKE) -f debian/rules.real
 
-#
-# Here we construct the command lines for different make-kpkg
-# calls (build, linux-image, linux-headers) based on the values
-# of variables defined so far and provided by the arch/subarch
-# in Makefile.inc. @flavour@ in the expressions is going to be
-# replaced by the flavour for which the command is run. 
-#
-kpkg_image := make-kpkg
-kpkg_image += --arch '$(firstword $(KPKG_ARCH) $(ARCH))' --cross-compile=-
-kpkg_image += --stem linux
-kpkg_image += --config silentoldconfig
+kpkg_image := $(setup_env)
+ifdef DEBIAN_KERNEL_JOBS
+  kpkg_image += CONCURRENCY_LEVEL=$(DEBIAN_KERNEL_JOBS)
+endif
+kpkg_image += make-kpkg --arch '$(firstword $(KPKG_ARCH) $(ARCH))' --cross-compile=- --stem linux --config silentoldconfig
 ifneq ($(INITRAMFS),False)
   kpkg_image += --initrd
 endif
 ifdef KPKG_SUBARCH
   kpkg_image += --subarch '$(KPKG_SUBARCH)'
 endif
-setup_env := env -u ABINAME -u ARCH -u SUBARCH -u FLAVOUR -u VERSION -u LOCALVERSION -u MAKEFLAGS
-
-ifdef DEBIAN_KERNEL_JOBS
-  setup_env_kpkg_jobs = CONCURRENCY_LEVEL=$(DEBIAN_KERNEL_JOBS)
-  JOBS_ARG = -j$(DEBIAN_KERNEL_JOBS)
-endif
-
-setup_env += DISTRIBUTION_OFFICIAL_BUILD=1 DISTRIBUTION_UPLOADER=$(UPLOADER) DISTRIBUTION_VERSION="$(SOURCEVERSION)"
 
 #
 # Targets
 #
-binary-arch-arch: install-headers-$(ARCH)
+binary-arch-arch: install-headers_$(ARCH)
 binary-arch-arch: install-libc-dev_$(ARCH)
-binary-arch-subarch: install-headers-$(ARCH)-$(SUBARCH)
-binary-arch-flavour: install-image-$(ARCH)-$(SUBARCH)-$(FLAVOUR)-$(TYPE)
+binary-arch-featureset: install-headers_$(ARCH)_$(FEATURESET)
+binary-arch-flavour: install-image_$(ARCH)_$(FEATURESET)_$(FLAVOUR)_$(TYPE)
 ifeq ($(MODULES),True)
-  binary-arch-flavour: install-headers-$(ARCH)-$(SUBARCH)-$(FLAVOUR)
+  binary-arch-flavour: install-headers_$(ARCH)_$(FEATURESET)_$(FLAVOUR)
 endif
 
 binary-indep: install-doc
@@ -72,15 +57,15 @@
 binary-indep: install-support
 binary-indep: install-tree
 
-build: $(STAMPS_DIR)/build-$(ARCH)-$(SUBARCH)-$(FLAVOUR)-$(TYPE)
+build: $(STAMPS_DIR)/build_$(ARCH)_$(FEATURESET)_$(FLAVOUR)_$(TYPE)
 
-setup-flavour: $(STAMPS_DIR)/setup-$(ARCH)-$(SUBARCH)-$(FLAVOUR)-$(TYPE)
+setup-flavour: $(STAMPS_DIR)/setup_$(ARCH)_$(FEATURESET)_$(FLAVOUR)_$(TYPE)
 
 source-arch: $(STAMPS_DIR)/source
-source-subarch: $(STAMPS_DIR)/source-$(ARCH)-$(SUBARCH)
+source-featureset: $(STAMPS_DIR)/source_$(ARCH)_$(FEATURESET)
 
-$(BUILD_DIR)/config.$(ARCH)-$(SUBARCH)-$(FLAVOUR): $(foreach t,$(KCONFIG),debian/arch/$(t))
-	python2.4 debian/bin/kconfig.py '$@' $(KCONFIG)
+$(BUILD_DIR)/config.$(ARCH)_$(FEATURESET)_$(FLAVOUR): $(KCONFIG)
+	python debian/bin/kconfig.py '$@' $(KCONFIG)
 
 $(BUILD_DIR)/linux-source-$(UPSTREAMVERSION).tar.bz2: SOURCE_DIR=$(BUILD_DIR)/source
 $(BUILD_DIR)/linux-source-$(UPSTREAMVERSION).tar.bz2: DIR = $(BUILD_DIR)/linux-source-$(UPSTREAMVERSION)
@@ -92,7 +77,7 @@
 	rm -rf '$(DIR)'
 
 define patch_cmd
-cd '$(DIR)'; python2.4 '$(CURDIR)/debian/bin/patch.apply' --overwrite-home='$(CURDIR)/debian/patches'
+cd '$(DIR)'; python '$(CURDIR)/debian/bin/patch.apply' --overwrite-home='$(CURDIR)/debian/patches'
 endef
 
 $(STAMPS_DIR)/source: SOURCE_FILES = $(filter-out debian, $(wildcard * .[^.]*))
@@ -104,18 +89,18 @@
 	$(patch_cmd)
 	touch '$@'
 
-$(STAMPS_DIR)/source-$(ARCH)-$(SUBARCH): SOURCE_DIR=$(BUILD_DIR)/source
-$(STAMPS_DIR)/source-$(ARCH)-$(SUBARCH): DIR=$(BUILD_DIR)/source-$(ARCH)-$(SUBARCH)
-$(STAMPS_DIR)/source-$(ARCH)-$(SUBARCH): $(STAMPS_DIR)/source
+$(STAMPS_DIR)/source_$(ARCH)_$(FEATURESET): SOURCE_DIR=$(BUILD_DIR)/source
+$(STAMPS_DIR)/source_$(ARCH)_$(FEATURESET): DIR=$(BUILD_DIR)/source_$(ARCH)_$(FEATURESET)
+$(STAMPS_DIR)/source_$(ARCH)_$(FEATURESET): $(STAMPS_DIR)/source
 	rm -rf '$(DIR)'
 	cp -al '$(SOURCE_DIR)' '$(DIR)'
-	$(patch_cmd) -a $(ARCH) -s $(SUBARCH)
+	$(patch_cmd) -a $(ARCH) -s $(FEATURESET)
 	touch '$@'
 
-setup-$(ARCH)-$(SUBARCH)-$(FLAVOUR)-all: CONFIG=$(BUILD_DIR)/config.$(ARCH)-$(SUBARCH)-$(FLAVOUR)
-setup-$(ARCH)-$(SUBARCH)-$(FLAVOUR)-all: SOURCE_DIR=$(BUILD_DIR)/source-$(ARCH)-$(SUBARCH)
-setup-$(ARCH)-$(SUBARCH)-$(FLAVOUR)-all: DIR=$(BUILD_DIR)/build-$(ARCH)-$(SUBARCH)-$(FLAVOUR)
-setup-$(ARCH)-$(SUBARCH)-$(FLAVOUR)-all: $(BUILD_DIR)/config.$(ARCH)-$(SUBARCH)-$(FLAVOUR)
+setup_$(ARCH)_$(FEATURESET)_$(FLAVOUR)_all: CONFIG=$(BUILD_DIR)/config.$(ARCH)_$(FEATURESET)_$(FLAVOUR)
+setup_$(ARCH)_$(FEATURESET)_$(FLAVOUR)_all: SOURCE_DIR=$(BUILD_DIR)/source_$(ARCH)_$(FEATURESET)
+setup_$(ARCH)_$(FEATURESET)_$(FLAVOUR)_all: DIR=$(BUILD_DIR)/build_$(ARCH)_$(FEATURESET)_$(FLAVOUR)
+setup_$(ARCH)_$(FEATURESET)_$(FLAVOUR)_all: $(BUILD_DIR)/config.$(ARCH)_$(FEATURESET)_$(FLAVOUR)
 	rm -rf '$(DIR)'
 	cp -al '$(SOURCE_DIR)' '$(DIR)'
 	cp '$(CONFIG)' '$(DIR)/.config'
@@ -131,55 +116,51 @@
 	echo 'override CROSS_COMPILE = $$(DEB_HOST_GNU_TYPE)-' >> '$(DIR)/.kernelvariables'
 	echo 'endif' >> '$(DIR)/.kernelvariables'
 endif
+ifdef CFLAGS
 	echo 'CFLAGS += $(CFLAGS)'  >> '$(DIR)/.kernelvariables'
-	cd '$(DIR)'; $(setup_env) make reportoldconfig
+endif
+	$(MAKE_CLEAN) -C '$(DIR)' reportoldconfig
 
-$(STAMPS_DIR)/setup-$(ARCH)-$(SUBARCH)-$(FLAVOUR)-$(TYPE): DIR=$(BUILD_DIR)/build-$(ARCH)-$(SUBARCH)-$(FLAVOUR)
-$(STAMPS_DIR)/setup-$(ARCH)-$(SUBARCH)-$(FLAVOUR)-$(TYPE): $(STAMPS_DIR)/source-$(ARCH)-$(SUBARCH)
+$(STAMPS_DIR)/setup_$(ARCH)_$(FEATURESET)_$(FLAVOUR)_$(TYPE): DIR=$(BUILD_DIR)/build_$(ARCH)_$(FEATURESET)_$(FLAVOUR)
+$(STAMPS_DIR)/setup_$(ARCH)_$(FEATURESET)_$(FLAVOUR)_$(TYPE): $(STAMPS_DIR)/source_$(ARCH)_$(FEATURESET)
 
-$(STAMPS_DIR)/setup-$(ARCH)-$(SUBARCH)-$(FLAVOUR)-kernel-package:
-	$(MAKE) -f debian/rules.real setup-$(ARCH)-$(SUBARCH)-$(FLAVOUR)-all
+$(STAMPS_DIR)/setup_$(ARCH)_$(FEATURESET)_$(FLAVOUR)_kernel-package:
+	$(MAKE_SELF) setup_$(ARCH)_$(FEATURESET)_$(FLAVOUR)_all
 	mkdir -p '$(DIR)/debian'
 	cp debian/{changelog,control,copyright} '$(DIR)/debian'
 	touch '$(DIR)/debian/official'
-	cd '$(DIR)'; $(setup_env) $(kpkg_image) configure
+	cd '$(DIR)'; $(kpkg_image) configure
 	touch '$@'
 
-$(STAMPS_DIR)/setup-$(ARCH)-$(SUBARCH)-$(FLAVOUR)-plain \
-$(STAMPS_DIR)/setup-$(ARCH)-$(SUBARCH)-$(FLAVOUR)-plain-s390-tape \
-$(STAMPS_DIR)/setup-$(ARCH)-$(SUBARCH)-$(FLAVOUR)-plain-xen:
-	$(MAKE) -f debian/rules.real setup-$(ARCH)-$(SUBARCH)-$(FLAVOUR)-all
-	cd '$(DIR)'; $(setup_env) make prepare $(JOBS_ARG)
+$(STAMPS_DIR)/setup_$(ARCH)_$(FEATURESET)_$(FLAVOUR)_plain \
+$(STAMPS_DIR)/setup_$(ARCH)_$(FEATURESET)_$(FLAVOUR)_plain-s390-tape \
+$(STAMPS_DIR)/setup_$(ARCH)_$(FEATURESET)_$(FLAVOUR)_plain-xen:
+	$(MAKE_SELF) setup_$(ARCH)_$(FEATURESET)_$(FLAVOUR)_all
+	$(MAKE_CLEAN) -C '$(DIR)' $(JOBS_ARG) prepare
 	touch '$@'
 
-$(STAMPS_DIR)/build-$(ARCH)-$(SUBARCH)-$(FLAVOUR)-$(TYPE): DIR=$(BUILD_DIR)/build-$(ARCH)-$(SUBARCH)-$(FLAVOUR)
-$(STAMPS_DIR)/build-$(ARCH)-$(SUBARCH)-$(FLAVOUR)-$(TYPE): $(STAMPS_DIR)/setup-$(ARCH)-$(SUBARCH)-$(FLAVOUR)-$(TYPE)
+$(STAMPS_DIR)/build_$(ARCH)_$(FEATURESET)_$(FLAVOUR)_$(TYPE): DIR=$(BUILD_DIR)/build_$(ARCH)_$(FEATURESET)_$(FLAVOUR)
+$(STAMPS_DIR)/build_$(ARCH)_$(FEATURESET)_$(FLAVOUR)_$(TYPE): $(STAMPS_DIR)/setup_$(ARCH)_$(FEATURESET)_$(FLAVOUR)_$(TYPE)
 
-$(STAMPS_DIR)/build-$(ARCH)-$(SUBARCH)-$(FLAVOUR)-kernel-package:
-	cd '$(DIR)'; $(setup_env) $(setup_env_kpkg_jobs) $(kpkg_image) build
-	python2.4 debian/bin/abicheck.py $(DIR) $(ARCH) $(SUBARCH) $(FLAVOUR)
+$(STAMPS_DIR)/build_$(ARCH)_$(FEATURESET)_$(FLAVOUR)_kernel-package:
+	cd '$(DIR)'; $(kpkg_image) build
+	python debian/bin/abicheck.py $(DIR) $(ARCH) $(FEATURESET) $(FLAVOUR)
 	touch '$@'
 
-$(STAMPS_DIR)/build-$(ARCH)-$(SUBARCH)-$(FLAVOUR)-plain \
-$(STAMPS_DIR)/build-$(ARCH)-$(SUBARCH)-$(FLAVOUR)-plain-s390-tape \
-$(STAMPS_DIR)/build-$(ARCH)-$(SUBARCH)-$(FLAVOUR)-plain-xen:
-	cd '$(DIR)'; $(setup_env) make $(JOBS_ARG)
-	python2.4 debian/bin/abicheck.py $(DIR) $(ARCH) $(SUBARCH) $(FLAVOUR)
+$(STAMPS_DIR)/build_$(ARCH)_$(FEATURESET)_$(FLAVOUR)_plain \
+$(STAMPS_DIR)/build_$(ARCH)_$(FEATURESET)_$(FLAVOUR)_plain-s390-tape \
+$(STAMPS_DIR)/build_$(ARCH)_$(FEATURESET)_$(FLAVOUR)_plain-xen:
+	$(MAKE_CLEAN) -C '$(DIR)' $(JOBS_ARG)
+	python debian/bin/abicheck.py $(DIR) $(ARCH) $(FEATURESET) $(FLAVOUR)
 	touch '$@'
 
 $(STAMPS_DIR)/build-doc: SOURCE_DIR=$(BUILD_DIR)/source
 $(STAMPS_DIR)/build-doc: DIR=$(BUILD_DIR)/build-doc
 $(STAMPS_DIR)/build-doc: $(STAMPS_DIR)/source
-	rm -rf '$(DIR)'
-	cp -al '$(SOURCE_DIR)' '$(DIR)'
-	$(setup_env) make -C '$(DIR)' $(JOBS_ARG) htmldocs mandocs
-	touch '$@'
-
-$(STAMPS_DIR)/build-libc-dev: SOURCE_DIR = $(BUILD_DIR)/source
-$(STAMPS_DIR)/build-libc-dev: DIR = $(BUILD_DIR)/build-libc-dev
-$(STAMPS_DIR)/build-libc-dev: $(STAMPS_DIR)/source
-	rm -rf '$(DIR)'
-	cp -al '$(SOURCE_DIR)' '$(DIR)'
+	rm -rf $(DIR)
+	mkdir $(DIR)
+	$(MAKE_CLEAN) -C $(SOURCE_DIR) O='$(CURDIR)/$(DIR)' $(JOBS_ARG) xmldocs
+	$(MAKE_CLEAN) -C $(SOURCE_DIR) O='$(CURDIR)/$(DIR)' $(JOBS_ARG) htmldocs mandocs
 	touch '$@'
 
 install-base:
@@ -194,51 +175,53 @@
 
 install-doc: PACKAGE_NAME = linux-doc-$(VERSION)
 install-doc: DIR = $(BUILD_DIR)/build-doc
-install-doc: PACKAGE_DIR = $(CURDIR)/debian/$(PACKAGE_NAME)
+install-doc: SOURCE_DIR = $(BUILD_DIR)/source
+install-doc: PACKAGE_DIR = debian/$(PACKAGE_NAME)
 install-doc: OUT_DIR = $(PACKAGE_DIR)/usr/share/doc/$(PACKAGE_NAME)
 install-doc: DH_OPTIONS = -p$(PACKAGE_NAME)
 install-doc: $(STAMPS_DIR)/build-doc
 	dh_clean -d -k
-	cd $(DIR)/Documentation; \
+	mkdir -p $(OUT_DIR)
+	cp -a $(addprefix $(SOURCE_DIR)/, COPYING CREDITS MAINTAINERS README REPORTING-BUGS Documentation) $(OUT_DIR)
+	rm -rf $(OUT_DIR)/Documentation/DocBook
+	cd $(DIR)/Documentation/DocBook; \
 	find . \
-	  -path './DocBook/man/*' -prune -o \
-	  -path './DocBook/*' -a \( -name '*.tmpl' -o -name '*.xml' -o -name '*.9' \) -prune -o \
-	  \( -name 'Makefile*' -o -name '.*.cmd' -o -name '.gitignore' \) -prune -o \
+	  -path './man/*' -prune -o \
+	  \( -name '*.tmpl' -o -name '*.xml' -o -name '*.9' -o \
+	     -name 'Makefile*' -o -name '.*.cmd' -o -name '.gitignore' \) -prune -o \
 	  -print \
 	| \
-	cpio -pd --preserve-modification-time '$(OUT_DIR)/Documentation'
-	mv '$(OUT_DIR)/Documentation/DocBook' '$(OUT_DIR)/html'
-	-gzip -9qfr '$(OUT_DIR)/Documentation'
-	$(MAKE) -f debian/rules.real install-base
+	cpio -pd --preserve-modification-time '$(CURDIR)/$(OUT_DIR)/html'
+	gzip -9qfr $(OUT_DIR)/Documentation
+	$(MAKE_SELF) install-base
 
 install-manual: PACKAGE_NAME = linux-manual-$(VERSION)
 install-manual: DIR=$(BUILD_DIR)/build-doc
-install-manual: PACKAGE_DIR = $(CURDIR)/debian/$(PACKAGE_NAME)
 install-manual: DH_OPTIONS = -p$(PACKAGE_NAME)
 install-manual: $(STAMPS_DIR)/build-doc
 	dh_clean -d -k
-	find '$(DIR)/Documentation/DocBook/' -name '*.9' | xargs dh_installman
-	$(MAKE) -f debian/rules.real install-base
+	find $(DIR)/Documentation/DocBook/man/ -name '*.9' | xargs dh_installman
+	$(MAKE_SELF) install-base
 
 install-dummy:
 	dh_testdir
 	dh_testroot
 	dh_clean -d -k
-	$(MAKE) -f debian/rules.real install-base
+	$(MAKE_SELF) install-base
 
-install-headers-$(ARCH): PACKAGE_NAMES = linux-headers-$(UPSTREAMVERSION)$(ABINAME)-all linux-headers-$(UPSTREAMVERSION)$(ABINAME)-all-$(ARCH)
-install-headers-$(ARCH): DH_OPTIONS = $(foreach p, $(PACKAGE_NAMES), -p$(p))
-install-headers-$(ARCH):
+install-headers_$(ARCH): PACKAGE_NAMES = linux-headers-$(UPSTREAMVERSION)$(ABINAME)-all linux-headers-$(UPSTREAMVERSION)$(ABINAME)-all-$(ARCH)
+install-headers_$(ARCH): DH_OPTIONS = $(foreach p, $(PACKAGE_NAMES), -p$(p))
+install-headers_$(ARCH):
 	dh_testdir
 	dh_testroot
-	$(MAKE) -f debian/rules.real install-base GENCONTROL_ARGS='-Vkernel:Arch=$(ARCH)'
+	$(MAKE_SELF) install-base GENCONTROL_ARGS='-Vkernel:Arch=$(ARCH)'
 
-install-headers-$(ARCH)-$(SUBARCH): PACKAGE_NAME = linux-headers-$(UPSTREAMVERSION)$(ABINAME)$(LOCALVERSION_HEADERS)
-install-headers-$(ARCH)-$(SUBARCH): DH_OPTIONS = -p$(PACKAGE_NAME)
-install-headers-$(ARCH)-$(SUBARCH): BASE_DIR = /usr/src/$(PACKAGE_NAME)
-install-headers-$(ARCH)-$(SUBARCH): SOURCE_DIR = $(BUILD_DIR)/source-$(ARCH)-$(SUBARCH)
-install-headers-$(ARCH)-$(SUBARCH): DIR = $(CURDIR)/debian/$(PACKAGE_NAME)/$(BASE_DIR)
-install-headers-$(ARCH)-$(SUBARCH): $(STAMPS_DIR)/source-$(ARCH)-$(SUBARCH)
+install-headers_$(ARCH)_$(FEATURESET): PACKAGE_NAME = linux-headers-$(UPSTREAMVERSION)$(ABINAME)-common$(LOCALVERSION_HEADERS)
+install-headers_$(ARCH)_$(FEATURESET): DH_OPTIONS = -p$(PACKAGE_NAME)
+install-headers_$(ARCH)_$(FEATURESET): BASE_DIR = /usr/src/$(PACKAGE_NAME)
+install-headers_$(ARCH)_$(FEATURESET): SOURCE_DIR = $(BUILD_DIR)/source_$(ARCH)_$(FEATURESET)
+install-headers_$(ARCH)_$(FEATURESET): DIR = debian/$(PACKAGE_NAME)/$(BASE_DIR)
+install-headers_$(ARCH)_$(FEATURESET): $(STAMPS_DIR)/source_$(ARCH)_$(FEATURESET)
 	dh_testdir
 	dh_testroot
 	dh_clean -k -d
@@ -259,194 +242,188 @@
 	  done; \
 	) \
 	| \
-	cpio -pd --preserve-modification-time $(DIR)
-	$(MAKE) -f debian/rules.real install-base
+	cpio -pd --preserve-modification-time '$(CURDIR)/$(DIR)'
+	$(MAKE_SELF) install-base
 
-install-headers-$(ARCH)-$(SUBARCH)-$(FLAVOUR): REAL_VERSION = $(UPSTREAMVERSION)$(ABINAME)$(LOCALVERSION)
-install-headers-$(ARCH)-$(SUBARCH)-$(FLAVOUR): PACKAGE_NAME = linux-headers-$(REAL_VERSION)
-install-headers-$(ARCH)-$(SUBARCH)-$(FLAVOUR): PACKAGE_NAME_HEADERS = linux-headers-$(UPSTREAMVERSION)$(ABINAME)$(LOCALVERSION_HEADERS)
-install-headers-$(ARCH)-$(SUBARCH)-$(FLAVOUR): PACKAGE_NAME_KBUILD = linux-kbuild-$(VERSION)
-install-headers-$(ARCH)-$(SUBARCH)-$(FLAVOUR): DH_OPTIONS = -p$(PACKAGE_NAME)
-install-headers-$(ARCH)-$(SUBARCH)-$(FLAVOUR): BASE_DIR = /usr/src/$(PACKAGE_NAME)
-install-headers-$(ARCH)-$(SUBARCH)-$(FLAVOUR): SOURCE_DIR = $(BUILD_DIR)/build-$(ARCH)-$(SUBARCH)-$(FLAVOUR)
-install-headers-$(ARCH)-$(SUBARCH)-$(FLAVOUR): REF_DIR = $(BUILD_DIR)/source-$(ARCH)-$(SUBARCH)
-install-headers-$(ARCH)-$(SUBARCH)-$(FLAVOUR): PACKAGE_DIR = $(CURDIR)/debian/$(PACKAGE_NAME)
-install-headers-$(ARCH)-$(SUBARCH)-$(FLAVOUR): DIR = $(PACKAGE_DIR)/$(BASE_DIR)
-install-headers-$(ARCH)-$(SUBARCH)-$(FLAVOUR): $(STAMPS_DIR)/build-$(ARCH)-$(SUBARCH)-$(FLAVOUR)-$(TYPE)
+install-headers_$(ARCH)_$(FEATURESET)_$(FLAVOUR): REAL_VERSION = $(UPSTREAMVERSION)$(ABINAME)$(LOCALVERSION)
+install-headers_$(ARCH)_$(FEATURESET)_$(FLAVOUR): PACKAGE_NAME = linux-headers-$(REAL_VERSION)
+install-headers_$(ARCH)_$(FEATURESET)_$(FLAVOUR): PACKAGE_NAME_HEADERS = linux-headers-$(UPSTREAMVERSION)$(ABINAME)-common$(LOCALVERSION_HEADERS)
+install-headers_$(ARCH)_$(FEATURESET)_$(FLAVOUR): PACKAGE_NAME_KBUILD = linux-kbuild-$(VERSION)
+install-headers_$(ARCH)_$(FEATURESET)_$(FLAVOUR): DH_OPTIONS = -p$(PACKAGE_NAME)
+install-headers_$(ARCH)_$(FEATURESET)_$(FLAVOUR): BASE_DIR = /usr/src/$(PACKAGE_NAME)
+install-headers_$(ARCH)_$(FEATURESET)_$(FLAVOUR): SOURCE_DIR = $(BUILD_DIR)/build_$(ARCH)_$(FEATURESET)_$(FLAVOUR)
+install-headers_$(ARCH)_$(FEATURESET)_$(FLAVOUR): REF_DIR = $(BUILD_DIR)/source_$(ARCH)_$(FEATURESET)
+install-headers_$(ARCH)_$(FEATURESET)_$(FLAVOUR): PACKAGE_DIR = debian/$(PACKAGE_NAME)
+install-headers_$(ARCH)_$(FEATURESET)_$(FLAVOUR): DIR = $(PACKAGE_DIR)/$(BASE_DIR)
+install-headers_$(ARCH)_$(FEATURESET)_$(FLAVOUR): $(STAMPS_DIR)/build_$(ARCH)_$(FEATURESET)_$(FLAVOUR)_$(TYPE)
 	dh_testdir
 	dh_testroot
 	dh_clean -k -d
 
-	mkdir -p "${DIR}/arch/${KERNEL_ARCH}/kernel"
-	mkdir -p "${DIR}/include"
-	cp -a ${SOURCE_DIR}/{.config,.kernel*,Module.symvers}  "${DIR}"
+	mkdir -p $(DIR)/arch/$(KERNEL_ARCH)/kernel
+	mkdir -p $(DIR)/include
+	cp -a $(SOURCE_DIR)/{.config,.kernel*,Module.symvers} $(DIR)
 
-	cd ${SOURCE_DIR}; \
+	cd $(SOURCE_DIR); \
 	find . -mindepth 1 -maxdepth 1 \
 		! -name debian -a ! -name Documentation -a ! -name include -a \
-		! -name DEBIAN -a ! -name scripts -a ! -name arch -a ! -name '.*' -a \( \
-		-name Makefile -o -type d \) \
-		-printf "../${PACKAGE_NAME_HEADERS}/%f\n" | \
-		xargs ln -s --target-directory="${DIR}"
+		! -name scripts -a ! -name arch -a \( -name Makefile -o -type d \) \
+		-printf "../$(PACKAGE_NAME_HEADERS)/%f\n" | \
+		xargs ln -s --target-directory='$(CURDIR)'/$(DIR)
 	
-	cd ${SOURCE_DIR}; \
-	find "arch/${KERNEL_ARCH}" -mindepth 1 -maxdepth 1 \( \
+	cd $(SOURCE_DIR); \
+	find arch/$(KERNEL_ARCH) -mindepth 1 -maxdepth 1 \
 		-type d -a ! -name include -a ! -name kernel -o \
-		-type f -a \( -name 'Makefile*' -o -name 'Kconfig*' \) \) \
-		-printf "../../../${PACKAGE_NAME_HEADERS}/%p\n" | \
-		xargs ln -s --target-directory="${DIR}/arch/${KERNEL_ARCH}"
-
-	[ -d "${SOURCE_DIR}/arch/${KERNEL_ARCH}/include" ] && \
-		cp -a "${SOURCE_DIR}/arch/${KERNEL_ARCH}/include" "${DIR}/arch/${KERNEL_ARCH}/include" || :
-	[ -f "${SOURCE_DIR}/arch/${KERNEL_ARCH}/kernel/asm-offsets.s" ] && \
-		ln -f "${SOURCE_DIR}/arch/${KERNEL_ARCH}/kernel/asm-offsets.s" "${DIR}/arch/${KERNEL_ARCH}/kernel" || :
-	[ -f "${SOURCE_DIR}/arch/${KERNEL_ARCH}/module.lds" ] && \
-		ln -f "${SOURCE_DIR}/arch/${KERNEL_ARCH}/module.lds" "${DIR}/arch/${KERNEL_ARCH}" || :
-	[ -f "${SOURCE_DIR}/arch/${KERNEL_ARCH}/kernel/module.lds" ] && \
-		ln -f "${SOURCE_DIR}/arch/${KERNEL_ARCH}/kernel/module.lds" "${DIR}/arch/${KERNEL_ARCH}" || :
-	ln -s "../../../../${PACKAGE_NAME_HEADERS}/arch/${KERNEL_ARCH}/kernel/Makefile" "${DIR}/arch/${KERNEL_ARCH}/kernel"
+		-type f -a \( -name 'Makefile*' -o -name 'Kconfig*' -o -name "module.lds" \) \
+		-printf "../../../$(PACKAGE_NAME_HEADERS)/%p\n" | \
+		xargs ln -s --target-directory='$(CURDIR)'/$(DIR)/arch/$(KERNEL_ARCH)
 
-	cd ${SOURCE_DIR}; \
+	cd $(SOURCE_DIR); \
+	find arch/$(KERNEL_ARCH)/kernel -mindepth 1 -maxdepth 1 \
+		-type f -a \( -name 'Makefile*' -o -name 'Kconfig*' -o -name "module.lds" \) \
+		-printf "../../../../$(PACKAGE_NAME_HEADERS)/%p\n" | \
+		xargs ln -s --target-directory='$(CURDIR)'/$(DIR)/arch/$(KERNEL_ARCH)/kernel
+
+	[ -d $(SOURCE_DIR)/arch/$(KERNEL_ARCH)/include ] && \
+		cp -a $(SOURCE_DIR)/arch/$(KERNEL_ARCH)/include $(DIR)/arch/$(KERNEL_ARCH)/include || :
+	cp -a $(SOURCE_DIR)/arch/$(KERNEL_ARCH)/kernel/asm-offsets.s $(DIR)/arch/$(KERNEL_ARCH)/kernel || :
+
+	cd $(SOURCE_DIR); \
 	find include -mindepth 1 -maxdepth 1 \
 		! -name config -a ! -name linux -a ! -name 'asm*' \
-		-printf "../../${PACKAGE_NAME_HEADERS}/%p\n" | \
-		xargs ln -s --target-directory="${DIR}/include"
-	cp -a ${SOURCE_DIR}/include/config "${DIR}/include"
+		-printf "../../$(PACKAGE_NAME_HEADERS)/%p\n" | \
+		xargs ln -s --target-directory='$(CURDIR)'/$(DIR)/include
+	cp -a $(SOURCE_DIR)/include/config $(DIR)/include
 	
-	ln -sf "asm-${KERNEL_ARCH}" "${DIR}/include/asm"
+	ln -sf asm-$(KERNEL_ARCH) $(DIR)/include/asm
 
-	cd ${SOURCE_DIR}; \
-	for dir in linux asm-generic $(foreach t, $(KERNEL_HEADER_DIRS), asm-$(t)); do \
-		mkdir "${DIR}/include/$$dir"; \
-		for file in $$(find "include/$$dir" -mindepth 1 -maxdepth 1); do \
-			if [ -e ${CURDIR}/${REF_DIR}/$$file ]; then \
-				ln -s --target-directory="${DIR}/include/$$dir" "../../../${PACKAGE_NAME_HEADERS}/$$file"; \
-			elif [ -d ${CURDIR}/${SOURCE_DIR}/$$file ]; then \
-				cp -a "${CURDIR}/${SOURCE_DIR}/$$file" "${DIR}/include/$$dir"; \
+	cd $(SOURCE_DIR); \
+	for dir in linux asm-$(KERNEL_ARCH); do \
+		mkdir '$(CURDIR)'/$(DIR)/include/$$dir; \
+		for file in $$(find include/$$dir -mindepth 1 -maxdepth 1); do \
+			if [ -e '$(CURDIR)'/$(REF_DIR)/$$file ]; then \
+				ln -s --target-directory='$(CURDIR)'/$(DIR)/include/$$dir ../../../$(PACKAGE_NAME_HEADERS)/$$file; \
 			else \
-				ln -f --target-directory="${DIR}/include/$$dir" "${CURDIR}/${SOURCE_DIR}/$$file"; \
+				ln -f --target-directory='$(CURDIR)'/$(DIR)/include/$$dir '$(CURDIR)'/$(SOURCE_DIR)/$$file; \
 			fi \
 		done \
 	done
-	
-	mkdir -p "${PACKAGE_DIR}/lib/modules/${REAL_VERSION}"
-	ln -s "/usr/src/${PACKAGE_NAME}" "${PACKAGE_DIR}/lib/modules/${REAL_VERSION}/build"
 
-	ln -s "../${PACKAGE_NAME_KBUILD}/scripts" "${DIR}"
+	cd $(SOURCE_DIR); \
+	for dir in asm-generic $(foreach t,$(filter-out $(KERNEL_ARCH),$(KERNEL_HEADER_DIRS)),asm-$(t)); do \
+		ln -s --target-directory='$(CURDIR)'/$(DIR)/include ../../$(PACKAGE_NAME_HEADERS)/include/$$dir; \
+	done
+
+	ln -s ../$(PACKAGE_NAME_KBUILD)/scripts $(DIR)
 
-	$(MAKE) -f debian/rules.real install-base
+	mkdir -p $(PACKAGE_DIR)/lib/modules/$(REAL_VERSION)
+	ln -s /usr/src/$(PACKAGE_NAME) $(PACKAGE_DIR)/lib/modules/$(REAL_VERSION)/build
+
+	$(MAKE_SELF) install-base
 
 install-libc-dev_$(ARCH): PACKAGE_NAME = linux-libc-dev
 install-libc-dev_$(ARCH): DH_OPTIONS = -p$(PACKAGE_NAME)
-install-libc-dev_$(ARCH): SOURCE_DIR = $(BUILD_DIR)/build-libc-dev
-install-libc-dev_$(ARCH): DIR = $(CURDIR)/debian/$(PACKAGE_NAME)/usr
-install-libc-dev_$(ARCH): $(STAMPS_DIR)/build-libc-dev
+install-libc-dev_$(ARCH): SOURCE_DIR = $(BUILD_DIR)/source
+install-libc-dev_$(ARCH): DIR = $(BUILD_DIR)/build-libc-dev
+install-libc-dev_$(ARCH): OUT_DIR = debian/$(PACKAGE_NAME)/usr
+install-libc-dev_$(ARCH):
 	dh_testdir
 	dh_testroot
 	dh_clean -d -k
-	$(setup_env) make -C '$(SOURCE_DIR)' headers_check ARCH=$(HEADERS_ARCH)
-	$(setup_env) make -C '$(SOURCE_DIR)' headers_install ARCH=$(HEADERS_ARCH) INSTALL_HDR_PATH='$(DIR)'
+	rm -rf '$(DIR)'
+	mkdir $(DIR)
+	$(MAKE_CLEAN) -C $(SOURCE_DIR) O='$(CURDIR)/$(DIR)' headers_check ARCH=$(LIBC_DEV_ARCH)
+	$(MAKE_CLEAN) -C $(SOURCE_DIR) O='$(CURDIR)/$(DIR)' headers_install ARCH=$(LIBC_DEV_ARCH) INSTALL_HDR_PATH='$(CURDIR)'/$(OUT_DIR)
 	# XXX: Needs to be removed from libc6-dev
-	rm -rf '$(DIR)'/include/scsi
-	$(MAKE) -f debian/rules.real install-base
-
-# XXX: This needs to be moved into the config
-install-libc-dev_$(ARCH): HEADERS_ARCH = $(ARCH)
-install-libc-dev_amd64 \
-install-libc-dev_i386: HEADERS_ARCH = x86_64
-install-libc-dev_armel: HEADERS_ARCH = arm
-install-libc-dev_hppa: HEADERS_ARCH = parisc
-install-libc-dev_mipsel: HEADERS_ARCH = mips
-install-libc-dev_sparc: HEADERS_ARCH = sparc64
+	rm -rf $(OUT_DIR)/include/scsi
+	$(MAKE_SELF) install-base
 
 install-support: PACKAGE_NAME = linux-support-$(UPSTREAMVERSION)$(ABINAME)
 install-support: DH_OPTIONS = -p$(PACKAGE_NAME)
-install-support: PACKAGE_DIR = $(CURDIR)/debian/$(PACKAGE_NAME)
+install-support: PACKAGE_DIR = debian/$(PACKAGE_NAME)
+install-support: PACKAGE_ROOT = /usr/src/$(PACKAGE_NAME)
 install-support:
 	dh_testdir
 	dh_testroot
 	dh_clean -k -d
-	chmod a+x debian/modules/gencontrol.py
-	dh_install debian/arch debian/lib debian/modules /usr/src/$(PACKAGE_NAME)
-	dh_python -V 2.4 /usr/src/$(PACKAGE_NAME)/lib/python
-	echo -e "[version]\nsource: $(SOURCEVERSION)\nabiname: $(ABINAME)" > $(PACKAGE_DIR)/usr/src/$(PACKAGE_NAME)/version
-	$(MAKE) -f debian/rules.real install-base
-
-install-image-$(ARCH)-$(SUBARCH)-$(FLAVOUR)-$(TYPE): REAL_VERSION = $(UPSTREAMVERSION)$(ABINAME)$(LOCALVERSION)
-install-image-$(ARCH)-$(SUBARCH)-$(FLAVOUR)-$(TYPE): PACKAGE_NAME = linux-image-$(REAL_VERSION)
-install-image-$(ARCH)-$(SUBARCH)-$(FLAVOUR)-$(TYPE): PACKAGE_DIR = $(CURDIR)/debian/$(PACKAGE_NAME)
-install-image-$(ARCH)-$(SUBARCH)-$(FLAVOUR)-$(TYPE): INSTALL_DIR = $(PACKAGE_DIR)/boot
-install-image-$(ARCH)-$(SUBARCH)-$(FLAVOUR)-$(TYPE): DIR = $(BUILD_DIR)/build-$(ARCH)-$(SUBARCH)-$(FLAVOUR)
-install-image-$(ARCH)-$(SUBARCH)-$(FLAVOUR)-$(TYPE): DH_OPTIONS = -p$(PACKAGE_NAME)
-install-image-$(ARCH)-$(SUBARCH)-$(FLAVOUR)-$(TYPE): $(STAMPS_DIR)/build-$(ARCH)-$(SUBARCH)-$(FLAVOUR)-$(TYPE)
-
-install-image-$(ARCH)-$(SUBARCH)-$(FLAVOUR)-kernel-package:
-ifdef IMAGE_POSTPROC
-#	Install the postproc script into the hook directory
-	install -d '$(DIR)/debian/image.d'
-	install 'debian/bin/$(IMAGE_POSTPROC)' '$(DIR)/debian/image.d'
-endif
-	cd '$(DIR)'; $(setup_env) $(kpkg_image) kernel-image
+	dh_installdirs $(PACKAGE_ROOT)/lib/python/debian_linux $(PACKAGE_ROOT)/modules
+	cp debian/config.defines.dump $(PACKAGE_DIR)$(PACKAGE_ROOT)
+	cp debian/lib/python/debian_linux/*.py $(PACKAGE_DIR)$(PACKAGE_ROOT)/lib/python/debian_linux
+	cp debian/modules/* $(PACKAGE_DIR)$(PACKAGE_ROOT)/modules
+	chmod a+x $(PACKAGE_DIR)$(PACKAGE_ROOT)/modules/gencontrol.py
+	dh_pycentral /usr/src/$(PACKAGE_NAME)/lib/python
+	$(MAKE_SELF) install-base
+
+install-image_$(ARCH)_$(FEATURESET)_$(FLAVOUR)_$(TYPE): REAL_VERSION = $(UPSTREAMVERSION)$(ABINAME)$(LOCALVERSION)
+install-image_$(ARCH)_$(FEATURESET)_$(FLAVOUR)_$(TYPE): PACKAGE_NAME = linux-image-$(REAL_VERSION)
+install-image_$(ARCH)_$(FEATURESET)_$(FLAVOUR)_$(TYPE): PACKAGE_DIR = debian/$(PACKAGE_NAME)
+install-image_$(ARCH)_$(FEATURESET)_$(FLAVOUR)_$(TYPE): INSTALL_DIR = $(PACKAGE_DIR)/boot
+install-image_$(ARCH)_$(FEATURESET)_$(FLAVOUR)_$(TYPE): DIR = $(BUILD_DIR)/build_$(ARCH)_$(FEATURESET)_$(FLAVOUR)
+install-image_$(ARCH)_$(FEATURESET)_$(FLAVOUR)_$(TYPE): DH_OPTIONS = -p$(PACKAGE_NAME)
+install-image_$(ARCH)_$(FEATURESET)_$(FLAVOUR)_$(TYPE): $(STAMPS_DIR)/build_$(ARCH)_$(FEATURESET)_$(FLAVOUR)_$(TYPE)
+
+install-image_$(ARCH)_$(FEATURESET)_$(FLAVOUR)_kernel-package:
+	cd '$(DIR)'; $(kpkg_image) kernel-image
 	cat '$(DIR)/debian/files' >> debian/files
 	@for i in $$(awk '{ print $$1; }' '$(DIR)/debian/files'); do	\
 	  echo "mv \"$(BUILD_DIR)/$$i\" ..";				\
 	  mv "$(BUILD_DIR)/$$i" ..;					\
 	done
 
-install-image-$(ARCH)-$(SUBARCH)-$(FLAVOUR)-plain:
+install-image_$(ARCH)_$(FEATURESET)_$(FLAVOUR)_plain:
 	dh_testdir
 	dh_testroot
 	dh_clean -d -k
 	dh_installdirs 'boot'
-	$(MAKE) -f debian/rules.real \
-	  install-image-$(ARCH)-$(SUBARCH)-$(FLAVOUR)-plain_image \
+	$(MAKE_SELF) \
+	  install-image_$(ARCH)_$(FEATURESET)_$(FLAVOUR)_plain_image \
 	  DIR='$(DIR)' PACKAGE_DIR='$(PACKAGE_DIR)' INSTALL_DIR='$(INSTALL_DIR)' REAL_VERSION='$(REAL_VERSION)'
 ifeq ($(MODULES),True)
-	cd $(DIR); $(setup_env) make modules_install INSTALL_MOD_PATH=$(PACKAGE_DIR)
+	$(MAKE_CLEAN) -C $(DIR) modules_install INSTALL_MOD_PATH='$(CURDIR)'/$(PACKAGE_DIR)
 	cp $(DIR)/.config $(PACKAGE_DIR)/boot/config-$(REAL_VERSION)
 	cp $(DIR)/System.map $(PACKAGE_DIR)/boot/System.map-$(REAL_VERSION)
 	rm $(PACKAGE_DIR)/lib/modules/$(REAL_VERSION)/{build,source,modules.*}
 endif
-	$(MAKE) -f debian/rules.real \
-	  install-image-$(ARCH)-$(SUBARCH)-$(FLAVOUR)-plain_templates \
+	$(MAKE_SELF) \
+	  install-image_$(ARCH)_$(FEATURESET)_$(FLAVOUR)_plain_templates \
 	  PACKAGE_DIR='$(PACKAGE_DIR)' REAL_VERSION='$(REAL_VERSION)'
-	$(MAKE) -f debian/rules.real \
-	  install-image-$(ARCH)-$(SUBARCH)-$(FLAVOUR)-plain_bug \
+	$(MAKE_SELF) \
+	  install-image_$(ARCH)_$(FEATURESET)_$(FLAVOUR)_plain_bug \
 	  PACKAGE_DIR='$(PACKAGE_DIR)' PACKAGE_NAME='$(PACKAGE_NAME)' REAL_VERSION='$(REAL_VERSION)'
-	$(MAKE) -f debian/rules.real install-base
+	$(MAKE_SELF) install-base
 
-install-image-amd64-$(SUBARCH)-$(FLAVOUR)-plain_image \
-install-image-i386-$(SUBARCH)-$(FLAVOUR)-plain_image:
-	cp '$(DIR)/arch/$(KERNEL_ARCH)/boot/bzImage' $(INSTALL_DIR)/vmlinuz-$(REAL_VERSION)
+install-image_amd64_$(FEATURESET)_$(FLAVOUR)_plain_image \
+install-image_i386_$(FEATURESET)_$(FLAVOUR)_plain_image:
+	install -m644 '$(DIR)/arch/$(KERNEL_ARCH)/boot/bzImage' $(INSTALL_DIR)/vmlinuz-$(REAL_VERSION)
 
-install-image-m68k-$(SUBARCH)-$(FLAVOUR)-plain_image:
+install-image_m68k_$(FEATURESET)_$(FLAVOUR)_plain_image:
 	install -m644 '$(DIR)/vmlinux.gz' $(INSTALL_DIR)/vmlinuz-$(REAL_VERSION)
 
-install-image-powerpc-$(SUBARCH)-$(FLAVOUR)-plain_image:
+install-image_powerpc_$(FEATURESET)_$(FLAVOUR)_plain_image:
 	install -m644 '$(DIR)/vmlinux' $(INSTALL_DIR)/vmlinux-$(REAL_VERSION)
 ifeq ($(KERNEL_ARCH),ppc)
 	# TODO: GNA
-	$(setup_env) make -C '$(DIR)/arch/ppc/boot' mkvmlinuz_support_install \
-	  INSTALL_MKVMLINUZ=$(PACKAGE_DIR)/usr/lib/linux-image-$(REAL_VERSION)
+	$(MAKE_CLEAN) -C '$(DIR)/arch/ppc/boot' mkvmlinuz_support_install \
+	  INSTALL_MKVMLINUZ='$(CURDIR)'/$(PACKAGE_DIR)/usr/lib/linux-image-$(REAL_VERSION)
 else
-	$(setup_env) make -C '$(DIR)' mkvmlinuz_support_install \
-	  INSTALL_MKVMLINUZ=$(PACKAGE_DIR)/usr/lib/linux-image-$(REAL_VERSION)
+	$(MAKE_CLEAN) -C '$(DIR)' mkvmlinuz_support_install \
+	  INSTALL_MKVMLINUZ='$(CURDIR)'/$(PACKAGE_DIR)/usr/lib/linux-image-$(REAL_VERSION)
 endif
 
-install-image-s390-$(SUBARCH)-$(FLAVOUR)-plain_image:
-	cp '$(DIR)/arch/s390/boot/image' $(INSTALL_DIR)/vmlinuz-$(REAL_VERSION)
+install-image_s390_$(FEATURESET)_$(FLAVOUR)_plain_image:
+	install -m644 '$(DIR)/arch/s390/boot/image' $(INSTALL_DIR)/vmlinuz-$(REAL_VERSION)
 
 ifneq ($(INITRAMFS),False)
-install-image-$(ARCH)-$(SUBARCH)-$(FLAVOUR)-plain_templates: ARG_INITRD = YES
+install-image_$(ARCH)_$(FEATURESET)_$(FLAVOUR)_plain_templates: ARG_INITRD = YES
 endif
 
-install-image-powerpc-$(SUBARCH)-$(FLAVOUR)-plain_templates: ARG_KIMAGE = vmlinux
+install-image_powerpc_$(FEATURESET)_$(FLAVOUR)_plain_templates: ARG_KIMAGE = vmlinux
 
-install-image-s390-$(SUBARCH)-$(FLAVOUR)-plain_templates: ARG_BOOTLOADER = zipl
+install-image_s390_$(FEATURESET)_$(FLAVOUR)_plain_templates: ARG_BOOTLOADER = zipl
 
-install-image-$(ARCH)-$(SUBARCH)-$(FLAVOUR)-plain_templates:
+install-image_$(ARCH)_$(FEATURESET)_$(FLAVOUR)_plain_templates:
 	install -d $(PACKAGE_DIR)/DEBIAN
-	for i in $(notdir $(wildcard debian/templates/temp.image.plain/*)); do \
+	for i in $(wildcard debian/templates/temp.image.plain/*); do \
 	  sed \
 	    -e 's,=D,/boot,g' \
 	    -e 's/=OF/YES/g' \
@@ -463,44 +440,49 @@
 	    -e 's/=MD//g' \
 	    -e 's/=R//g' \
 	    -e 's/=S//g' \
-	    '$(CURDIR)'/debian/templates/temp.image.plain/$$i > '$(PACKAGE_DIR)'/DEBIAN/$$i; \
+	    $$i > $(PACKAGE_DIR)/DEBIAN/$$(basename $$i); \
 	done
-	chmod 755 '$(PACKAGE_DIR)'/DEBIAN/{config,{pre,post}*}
-	chmod 644 '$(PACKAGE_DIR)'/DEBIAN/templates
+	chmod 755 $(PACKAGE_DIR)/DEBIAN/{config,{pre,post}*}
+	chmod 644 $(PACKAGE_DIR)/DEBIAN/templates
 
-install-image-$(ARCH)-$(SUBARCH)-$(FLAVOUR)-plain_bug:
+install-image_$(ARCH)_$(FEATURESET)_$(FLAVOUR)_plain_bug:
 	dh_installdirs usr/share/bug/$(PACKAGE_NAME)
 	dh_install debian/templates/image.plain.bug/* usr/share/bug/$(PACKAGE_NAME)
-	chmod 755 '$(PACKAGE_DIR)'/usr/share/bug/$(PACKAGE_NAME)/script
-	echo "RELEASE='$(REAL_VERSION)'" > '$(PACKAGE_DIR)'/usr/share/bug/$(PACKAGE_NAME)/info
+	chmod 755 $(PACKAGE_DIR)/usr/share/bug/$(PACKAGE_NAME)/script
+	echo "RELEASE='$(REAL_VERSION)'" > $(PACKAGE_DIR)/usr/share/bug/$(PACKAGE_NAME)/info
 
-install-image-$(ARCH)-$(SUBARCH)-$(FLAVOUR)-plain-s390-tape:
+install-image_$(ARCH)_$(FEATURESET)_$(FLAVOUR)_plain-s390-tape:
 	dh_testdir
 	dh_testroot
 	dh_clean -d -k
 	dh_installdirs 'boot'
 	cp '$(DIR)/arch/s390/boot/image' $(PACKAGE_DIR)/boot/vmlinuz-$(REAL_VERSION)
-	$(MAKE) -f debian/rules.real install-base
+	$(MAKE_SELF) install-base
 
-install-image-$(ARCH)-$(SUBARCH)-$(FLAVOUR)-plain-xen: MODULES_PACKAGE_NAME = linux-modules-$(REAL_VERSION)
-install-image-$(ARCH)-$(SUBARCH)-$(FLAVOUR)-plain-xen: MODULES_PACKAGE_DIR = $(CURDIR)/debian/$(MODULES_PACKAGE_NAME)
-install-image-$(ARCH)-$(SUBARCH)-$(FLAVOUR)-plain-xen: DH_OPTIONS = -p$(PACKAGE_NAME) -p$(MODULES_PACKAGE_NAME)
-install-image-$(ARCH)-$(SUBARCH)-$(FLAVOUR)-plain-xen:
+install-image_$(ARCH)_$(FEATURESET)_$(FLAVOUR)_plain-xen: MODULES_PACKAGE_NAME = linux-modules-$(REAL_VERSION)
+install-image_$(ARCH)_$(FEATURESET)_$(FLAVOUR)_plain-xen: MODULES_PACKAGE_DIR = debian/$(MODULES_PACKAGE_NAME)
+install-image_$(ARCH)_$(FEATURESET)_$(FLAVOUR)_plain-xen: DH_OPTIONS =
+install-image_$(ARCH)_$(FEATURESET)_$(FLAVOUR)_plain-xen:
 	dh_testdir
 	dh_testroot
 	dh_clean -d -k
-	DH_OPTIONS= dh_installdirs -p$(PACKAGE_NAME) 'boot' 'var/lib/$(PACKAGE_NAME)'
-	DH_OPTIONS= dh_installdirs -p$(MODULES_PACKAGE_NAME) 'boot'
-	cp $(DIR)/vmlinuz $(INSTALL_DIR)/vmlinuz-$(REAL_VERSION)
-	cd $(DIR); $(setup_env) make modules_install INSTALL_MOD_PATH=$(MODULES_PACKAGE_DIR)
+	dh_installdirs -p$(PACKAGE_NAME) boot 'var/lib/$(PACKAGE_NAME)'
+	dh_installdirs -p$(MODULES_PACKAGE_NAME) boot
+ifneq ($(DEB_BUILD_ARCH),$(DEB_HOST_ARCH))
+	$(DEB_HOST_GNU_TYPE)-objcopy -g --strip-unneeded $(DIR)/vmlinux $(DIR)/vmlinux-stripped
+else
+	objcopy -g --strip-unneeded $(DIR)/vmlinux $(DIR)/vmlinux-stripped
+endif
+	gzip -c -9 $(DIR)/vmlinux-stripped > $(INSTALL_DIR)/vmlinuz-$(REAL_VERSION)
+	$(MAKE_CLEAN) -C $(DIR) modules_install INSTALL_MOD_PATH='$(CURDIR)'/$(MODULES_PACKAGE_DIR)
 	cp $(DIR)/.config $(MODULES_PACKAGE_DIR)/boot/config-$(REAL_VERSION)
 	cp $(DIR)/System.map $(MODULES_PACKAGE_DIR)/boot/System.map-$(REAL_VERSION)
 	rm $(MODULES_PACKAGE_DIR)/lib/modules/$(REAL_VERSION)/{build,source}
-	DH_OPTIONS= dh_installmodules -p$(MODULES_PACKAGE_NAME)
-	for i in $(XEN_VERSIONS); do echo $$i >> $(PACKAGE_DIR)/var/lib/$(PACKAGE_NAME)/xen-versions; done
+	dh_installmodules -p$(MODULES_PACKAGE_NAME)
+	for i in $(XEN_VERSIONS); do echo $$i; done > $(PACKAGE_DIR)/var/lib/$(PACKAGE_NAME)/xen-versions
 	install -d $(PACKAGE_DIR)/DEBIAN
 	echo /var/lib/$(PACKAGE_NAME)/xen-versions >> $(PACKAGE_DIR)/DEBIAN/conffiles
-	$(MAKE) -f debian/rules.real install-base
+	$(MAKE_SELF) install-base DH_OPTIONS='-p$(PACKAGE_NAME) -p$(MODULES_PACKAGE_NAME)'
 
 install-patch: PACKAGE = linux-patch-debian-$(VERSION)
 install-patch: pbase := /usr/src/kernel-patches/all/$(UPSTREAMVERSION)
@@ -515,17 +497,17 @@
 	install debian/bin/patch.apply '$(pfull)/apply/debian'
 	install debian/bin/patch.unpatch '$(pfull)/unpatch/debian'
 	find '$(pfull)/debian' ! -path '*/series/*' -type f -execdir bzip2 '{}' ';' -execdir chmod 644 '{}.bz2' ';'
-	$(MAKE) -f debian/rules.real install-base DH_OPTIONS='$(DH_OPTIONS)'
+	$(MAKE_SELF) install-base DH_OPTIONS='$(DH_OPTIONS)'
 
 install-source: DH_OPTIONS = -plinux-source-$(VERSION)
 install-source: $(BUILD_DIR)/linux-source-$(UPSTREAMVERSION).tar.bz2
 	dh_testdir
 	dh_testroot
 	dh_install $(DH_OPTIONS) '$<' /usr/src
-	$(MAKE) -f debian/rules.real install-base DH_OPTIONS='$(DH_OPTIONS)'
+	$(MAKE_SELF) install-base DH_OPTIONS='$(DH_OPTIONS)'
 
 install-tree: DH_OPTIONS = -plinux-tree-$(VERSION)
 install-tree:
-	$(MAKE) -f debian/rules.real install-dummy DH_OPTIONS='$(DH_OPTIONS)'
+	$(MAKE_SELF) install-dummy DH_OPTIONS='$(DH_OPTIONS)'
 
 # vim: filetype=make

Modified: dists/sid/linux-2.6/debian/templates/control.headers.arch.in
==============================================================================
--- dists/sid/linux-2.6/debian/templates/control.headers.arch.in	(original)
+++ dists/sid/linux-2.6/debian/templates/control.headers.arch.in	Mon Nov 26 20:06:56 2007
@@ -1,13 +1,3 @@
-Package: linux-libc-dev
-Section: devel
-Priority: optional
-Provides: linux-kernel-headers
-Replaces: linux-kernel-headers
-Conflicts: linux-kernel-headers
-Description: Linux Kernel Headers for development
- This package provides headers from the Linux kernel.  These headers
- are used by the installed headers for GNU glibc and other system libraries.
-
 Package: linux-headers- at upstreamversion@@abiname at -all
 Section: devel
 Priority: optional

Added: dists/sid/linux-2.6/debian/templates/control.headers.featureset.in
==============================================================================
--- (empty file)
+++ dists/sid/linux-2.6/debian/templates/control.headers.featureset.in	Mon Nov 26 20:06:56 2007
@@ -0,0 +1,14 @@
+Package: linux-headers- at upstreamversion@@abiname at -common@localversion_headers@
+Section: devel
+Priority: optional
+Description: Common header files for Linux @upstreamversion@
+ This package provides the architecture-specific common kernel header files
+ for Linux kernel version @upstreamversion@, generally used for building out-of-tree
+ kernel modules. To obtain a complete set of headers you also need to install
+ the linux-headers- at upstreamversion@@abiname at -(flavour) package, matching the
+ flavour of the kernel you intend the build for. To obtain such a set for the
+ currently running kernel it is sufficient to run a command
+ .
+ apt-get install linux-headers-$(uname -r)
+ .
+ and it will be unpacked in /usr/src/linux-headers- at upstreamversion@@abiname at -(flavour).

Modified: dists/sid/linux-2.6/debian/templates/control.headers.in
==============================================================================
--- dists/sid/linux-2.6/debian/templates/control.headers.in	(original)
+++ dists/sid/linux-2.6/debian/templates/control.headers.in	Mon Nov 26 20:06:56 2007
@@ -1,7 +1,7 @@
 Package: linux-headers- at upstreamversion@@abiname@@localversion@
 Section: devel
 Priority: optional
-Depends: linux-headers- at upstreamversion@@abiname@@localversion_headers@ (= ${Source-Version}), linux-kbuild- at version@
+Depends: linux-headers- at upstreamversion@@abiname at -common@localversion_headers@ (= ${Source-Version}), linux-kbuild- at version@
 Provides: linux-headers, linux-headers- at major@
 Description: Header files for Linux @upstreamversion@ on @class@
  This package provides the architecture-specific kernel header files

Added: dists/sid/linux-2.6/debian/templates/control.libc-dev.in
==============================================================================
--- (empty file)
+++ dists/sid/linux-2.6/debian/templates/control.libc-dev.in	Mon Nov 26 20:06:56 2007
@@ -0,0 +1,9 @@
+Package: linux-libc-dev
+Section: devel
+Priority: optional
+Provides: linux-kernel-headers
+Replaces: linux-kernel-headers
+Conflicts: linux-kernel-headers
+Description: Linux Kernel Headers for development
+ This package provides headers from the Linux kernel.  These headers
+ are used by the installed headers for GNU glibc and other system libraries.

Modified: dists/sid/linux-2.6/debian/templates/control.main.in
==============================================================================
--- dists/sid/linux-2.6/debian/templates/control.main.in	(original)
+++ dists/sid/linux-2.6/debian/templates/control.main.in	Mon Nov 26 20:06:56 2007
@@ -54,7 +54,7 @@
 Architecture: all
 Section: devel
 Priority: optional
-Depends: bzip2, python2.4-minimal
+Depends: bzip2, python
 Suggests: linux-source- at version@
 Description: Debian patches to version @version@ of the Linux kernel
  This package includes the patches used to produce the prepackaged

Modified: dists/sid/linux-2.6/debian/templates/control.source.in
==============================================================================
--- dists/sid/linux-2.6/debian/templates/control.source.in	(original)
+++ dists/sid/linux-2.6/debian/templates/control.source.in	Mon Nov 26 20:06:56 2007
@@ -4,5 +4,6 @@
 Maintainer: Debian Kernel Team <debian-kernel at lists.debian.org>
 Uploaders: Bastian Blank <waldi at debian.org>, Frederik Schüler <fs at debian.org>, maximilian attems <maks at debian.org>
 Standards-Version: 3.7.2.2
-Build-Depends: debhelper (>= 4.1.0), module-init-tools, dpkg-dev (>= 1.10.23), debianutils (>= 1.6), bzip2, sparc-utils [sparc], kernel-package (>= 10.063), python, python2.4-minimal
-Build-Depends-Indep: docbook-utils, findutils (>= 4.2.12), gs, transfig, xmlto
+Build-Depends: debhelper (>= 4.1.0), module-init-tools, dpkg-dev (>= 1.10.23), sparc-utils [sparc], kernel-package (>= 10.063), python
+Build-Depends-Indep: bzip2, findutils (>= 4.2.12), python-central, xmlto
+XS-Python-Version: current

Modified: dists/sid/linux-2.6/debian/templates/control.support.in
==============================================================================
--- dists/sid/linux-2.6/debian/templates/control.support.in	(original)
+++ dists/sid/linux-2.6/debian/templates/control.support.in	Mon Nov 26 20:06:56 2007
@@ -2,7 +2,8 @@
 Architecture: all
 Section: devel
 Priority: optional
-Depends: python2.4-minimal
+Depends: ${python:Depends}
 Description: Support files for Linux @upstreamversion@
  This package provides support files for the Linux kernel build.
+XB-Python-Version: ${python:Versions}
 

Added: dists/sid/linux-2.6/debian/templates/image.plain.bug/include-1cmdline
==============================================================================
--- (empty file)
+++ dists/sid/linux-2.6/debian/templates/image.plain.bug/include-1cmdline	Mon Nov 26 20:06:56 2007
@@ -0,0 +1,8 @@
+add_1cmdline() {
+	echo '** cmdline:' >&3
+	cat /proc/cmdline >&3
+}
+
+ask_1cmdline() {
+	true
+}

Modified: dists/sid/linux-2.6/debian/templates/patch.apply.in
==============================================================================
--- dists/sid/linux-2.6/debian/templates/patch.apply.in	(original)
+++ dists/sid/linux-2.6/debian/templates/patch.apply.in	Mon Nov 26 20:06:56 2007
@@ -1,4 +1,4 @@
-#!/usr/bin/env python2.4
+#!/usr/bin/env python
 
 import os, os.path, re, sys
 from warnings import warn

Modified: dists/sid/linux-2.6/debian/templates/temp.image.plain/postinst
==============================================================================
--- dists/sid/linux-2.6/debian/templates/temp.image.plain/postinst	(original)
+++ dists/sid/linux-2.6/debian/templates/temp.image.plain/postinst	Mon Nov 26 20:06:56 2007
@@ -116,7 +116,6 @@
       $do_symlink      = "" if /do_symlinks\s*=\s*(no|false|0)\s*$/ig;
       $no_symlink      = "" if /no_symlinks\s*=\s*(no|false|0)\s*$/ig;
       $reverse_symlink = "" if /reverse_symlink\s*=\s*(no|false|0)\s*$/ig;
-      $link_in_boot    = "" if /image_in_boot\s*=\s*(no|false|0)\s*$/ig;
       $link_in_boot    = "" if /link_in_boot\s*=\s*(no|false|0)\s*$/ig;
       $move_image      = "" if /move_image\s*=\s*(no|false|0)\s*$/ig;
       $clobber_modules = '' if /clobber_modules\s*=\s*(no|false|0)\s*$/ig;
@@ -139,7 +138,6 @@
       $do_symlink      = "Yes" if /do_symlinks\s*=\s*(yes|true|1)\s*$/ig;
       $no_symlink      = "Yes" if /no_symlinks\s*=\s*(yes|true|1)\s*$/ig;
       $reverse_symlink = "Yes" if /reverse_symlinks\s*=\s*(yes|true|1)\s*$/ig;
-      $link_in_boot    = "Yes" if /image_in_boot\s*=\s*(yes|true|1)\s*$/ig;
       $link_in_boot    = "Yes" if /link_in_boot\s*=\s*(yes|true|1)\s*$/ig;
       $move_image      = "Yes" if /move_image\s*=\s*(yes|true|1)\s*$/ig;
       $clobber_modules = "Yes" if /clobber_modules\s*=\s*(yes|true|1)\s*$/ig;
@@ -475,13 +473,13 @@
 
   if ($use_hard_links =~ m/YES/i) {
     link($Old . "$link_name", $src_dir . "$link_name") ||
-      die("Failed to symbolic-link " . $dest_dir . "$link_name to " . $src_dir
+      die("Failed to hard-link " . $dest_dir . "$link_name to " . $src_dir
           . "$link_name .\n");
     warn "ln " . $Old . "$link_name " . $src_dir . "$link_name"  if $DEBUG;
   }
   else {
     symlink($Old . "$link_name", $src_dir . "$link_name") ||
-      die("Failed to link " . $dest_dir . "$link_name to " . $src_dir . 
+      die("Failed to symbolically link " . $dest_dir . "$link_name to " . $src_dir . 
           "$link_name .\n");
     warn "ln -s " . $Old . "$link_name " . $src_dir . "$link_name" if $DEBUG;
   }
@@ -515,7 +513,7 @@
     if $DEBUG;
   my $vmlinuz_target = readlink "$kimage";
   my $real_target = '';
-  my $target = `readlink -q -m "${realimageloc}${kimage-$version}"`;
+  my $target = `readlink -q -m "${realimageloc}${kimage}-$version"`;
   $real_target = abs_path($vmlinuz_target) if defined($vmlinuz_target);
 
   if (!defined($vmlinuz_target) || ! -f "$real_target") {
@@ -794,7 +792,7 @@
     if ($use_hard_links =~ m/YES/i) {
       warn "ln " . $Old . "$kimage " . $realimageloc . "$image_name" if $DEBUG;
       if (! link($Old . "$kimage", $realimageloc . "$image_name")) {
-        warn "Could not link " . $image_dest .
+        warn "Could not hard link " . $image_dest .
           "$kimage to $image_name :$!";
       }
     }
@@ -827,7 +825,7 @@
     if (! link($Old . "$image_name", "$kimage")) {
       warn "mv $kimage.$$ $kimage" if $DEBUG;
       rename("$kimage.$$", "$kimage");
-      die("Failed to link " . $realimageloc . "$image_name to "
+      die("Failed to hard link " . $realimageloc . "$image_name to "
           . $image_dest . "$kimage .\n");
     }
   }
@@ -1151,9 +1149,10 @@
 
 # set the env var stem
 $ENV{'STEM'} = "=ST";
-sub exec_script {
+sub run_hook {
   my $type   = shift;
   my $script = shift;
+
   print STDERR "Running $type hook script $script.\n";
   system ("$script $version $realimageloc$kimage-$version") &&
     print STDERR "User $type hook script [$script] ";
@@ -1171,31 +1170,6 @@
     exit $? >> 8;
   }
 }
-sub run_hook {
-  my $type   = shift;
-  my $script = shift;
-  if ($script =~ m,^/,) {
-    # Full path provided for the hook script
-    if (-x "$script") {
-      &exec_script($type,$script);
-    }
-    else {
-      die "The provided $type hook script [$script] could not be run.\n";
-    }
-  }
-  else {
-    # Look for it in a safe path
-    for my $path ('/bin', '/sbin', '/usr/bin', '/usr/sbin') {
-      if (-x "$path/$script") {
-        &exec_script($type, "$path/$script");
-        return 0;
-      }
-    }
-    # No luck
-    print STDERR "Could not find $type hook script [$script].\n";
-    die "Looked in: '/bin', '/sbin', '/usr/bin', '/usr/sbin'\n";
-  }
-}
 
 ## Run user hook script here, if any
 if ($postinst_hook) {

Modified: dists/sid/linux-2.6/debian/templates/temp.image.plain/postrm
==============================================================================
--- dists/sid/linux-2.6/debian/templates/temp.image.plain/postrm	(original)
+++ dists/sid/linux-2.6/debian/templates/temp.image.plain/postrm	Mon Nov 26 20:06:56 2007
@@ -119,7 +119,6 @@
       $do_symlink      = "" if /do_symlinks\s*=\s*(no|false|0)\s*$/ig;
       $no_symlink      = "" if /no_symlinks\s*=\s*(no|false|0)\s*$/ig;
       $reverse_symlink = "" if /reverse_symlinks\s*=\s*(no|false|0)\s*$/ig;
-      $link_in_boot    = "" if /image_in_boot\s*=\s*(no|false|0)\s*$/ig;
       $link_in_boot    = "" if /link_in_boot\s*=\s*(no|false|0)\s*$/ig;
       $move_image      = "" if /move_image\s*=\s*(no|false|0)\s*$/ig;
       $clobber_modules = '' if /clobber_modules\s*=\s*(no|false|0)\s*$/ig;
@@ -141,7 +140,6 @@
       $do_symlink      = "Yes" if /do_symlinks\s*=\s*(yes|true|1)\s*$/ig;
       $no_symlink      = "Yes" if /no_symlinks\s*=\s*(yes|true|1)\s*$/ig;
       $reverse_symlink = "Yes" if /reverse_symlinks\s*=\s*(yes|true|1)\s*$/ig;
-      $link_in_boot    = "Yes" if /image_in_boot\s*=\s*(yes|true|1)\s*$/ig;
       $link_in_boot    = "Yes" if /link_in_boot\s*=\s*(yes|true|1)\s*$/ig;
       $move_image      = "Yes" if /move_image\s*=\s*(yes|true|1)\s*$/ig;
       $clobber_modules = "Yes" if /clobber_modules\s*=\s*(yes|true|1)\s*$/ig;
@@ -374,6 +372,7 @@
                          modules.ieee1394map modules.pnpbiosmap
                          modules.alias modules.ccwmap modules.inputmap
                          modules.symbols build source modules.ofmap
+                         modules.seriomap
                        };
 
 foreach my $extra_file (@files_to_remove) {

Modified: dists/sid/linux-2.6/debian/templates/temp.image.plain/preinst
==============================================================================
--- dists/sid/linux-2.6/debian/templates/temp.image.plain/preinst	(original)
+++ dists/sid/linux-2.6/debian/templates/temp.image.plain/preinst	Mon Nov 26 20:06:56 2007
@@ -117,7 +117,6 @@
       $do_symlink      = "" if /do_symlinks\s*=\s*(no|false|0)\s*$/ig;
       $no_symlink      = "" if /no_symlinks\s*=\s*(no|false|0)\s*$/ig;
       $reverse_symlink = "" if /reverse_symlinks\s*=\s*(no|false|0)\s*$/ig;
-      $link_in_boot    = "" if /image_in_boot\s*=\s*(no|false|0)\s*$/ig;
       $link_in_boot    = "" if /link_in_boot\s*=\s*(no|false|0)\s*$/ig;
       $move_image      = "" if /move_image\s*=\s*(no|false|0)\s*$/ig;
       $clobber_modules = '' if /clobber_modules\s*=\s*(no|false|0)\s*$/ig;
@@ -140,7 +139,6 @@
       $do_symlink      = "Yes" if /do_symlinks\s*=\s*(yes|true|1)\s*$/ig;
       $no_symlink      = "Yes" if /no_symlinks\s*=\s*(yes|true|1)\s*$/ig;
       $reverse_symlink = "Yes" if /reverse_symlinks\s*=\s*(yes|true|1)\s*$/ig;
-      $link_in_boot    = "Yes" if /image_in_boot\s*=\s*(yes|true|1)\s*$/ig;
       $link_in_boot    = "Yes" if /link_in_boot\s*=\s*(yes|true|1)\s*$/ig;
       $move_image      = "Yes" if /move_image\s*=\s*(yes|true|1)\s*$/ig;
       $clobber_modules = "Yes" if /clobber_modules\s*=\s*(yes|true|1)\s*$/ig;
@@ -302,7 +300,8 @@
   }
   $answer =~ s/^\s+//;
   $answer =~ s/\s+$//;
-  print STDERR "Ok, Aborting\n" unless $answer =~ /^(f|n)/i;
+  print STDERR "Ok, Aborting, since the bootloader might not handle " .
+    "an initrd/initramfs image.\n" unless $answer =~ /^(f|n)/i;
   if ($answer !~ /^(f|n)/i && $invisible) {
     my $note = "${package_name}/preinst/abort-install-$version";
 
@@ -446,7 +445,8 @@
 
     $answer =~ s/^\s+//;
     $answer =~ s/\s+$//;
-    print STDERR "Ok, Aborting\n" unless $answer =~ /^(f|n)/i;
+    print STDERR "Ok, aborting, since modules for this image already exist.\n"
+      unless $answer =~ /^(f|n)/i;
     if ($answer !~ /^(f|n)/i && $invisible) {
       my $note = "${package_name}/preinst/abort-overwrite-$version";
 

Modified: dists/sid/linux-2.6/debian/templates/temp.image.plain/prerm
==============================================================================
--- dists/sid/linux-2.6/debian/templates/temp.image.plain/prerm	(original)
+++ dists/sid/linux-2.6/debian/templates/temp.image.plain/prerm	Mon Nov 26 20:06:56 2007
@@ -120,7 +120,6 @@
       $do_symlink      = "" if /do_symlinks\s*=\s*(no|false|0)\s*$/ig;
       $no_symlink      = "" if /no_symlinks\s*=\s*(no|false|0)\s*$/ig;
       $reverse_symlink = "" if /reverse_symlinks\s*=\s*(no|false|0)\s*$/ig;
-      $link_in_boot    = "" if /image_in_boot\s*=\s*(no|false|0)\s*$/ig;
       $link_in_boot    = "" if /link_in_boot\s*=\s*(no|false|0)\s*$/ig;
       $move_image      = "" if /move_image\s*=\s*(no|false|0)\s*$/ig;
       $clobber_modules = '' if /clobber_modules\s*=\s*(no|false|0)\s*$/ig;
@@ -142,7 +141,6 @@
       $do_symlink      = "Yes" if /do_symlinks\s*=\s*(yes|true|1)\s*$/ig;
       $no_symlink      = "Yes" if /no_symlinks\s*=\s*(yes|true|1)\s*$/ig;
       $reverse_symlink = "Yes" if /reverse_symlinks\s*=\s*(yes|true|1)\s*$/ig;
-      $link_in_boot    = "Yes" if /image_in_boot\s*=\s*(yes|true|1)\s*$/ig;
       $link_in_boot    = "Yes" if /link_in_boot\s*=\s*(yes|true|1)\s*$/ig;
       $move_image      = "Yes" if /move_image\s*=\s*(yes|true|1)\s*$/ig;
       $clobber_modules = "Yes" if /clobber_modules\s*=\s*(yes|true|1)\s*$/ig;



More information about the Kernel-svn-changes mailing list